orbcafe-ui 3.1.7 → 3.1.9
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.d.mts +82 -11
- package/dist/index.d.ts +82 -11
- package/dist/index.js +21 -20
- package/dist/index.mjs +20 -19
- package/dist/orbis.css +477 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import {f,d,g,e,a,b,c}from'./chunk-7TUSE6H4.mjs';export{h as COrbCanvas}from'./chunk-7TUSE6H4.mjs';import*as jt from'react';import jt__default,{createContext,forwardRef,useId,useRef,useState,useImperativeHandle,useMemo,Children,isValidElement,useEffect,useContext,useCallback,Fragment,useLayoutEffect,cloneElement}from'react';import*as No from'@radix-ui/react-dropdown-menu';import*as Zo from'@radix-ui/react-tooltip';import {createPortal}from'react-dom';import*as wo from'@radix-ui/react-dialog';import*as br from'@radix-ui/react-popover';import rr from'dayjs';import Hh 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 Jf from'dayjs/plugin/isBetween';import eb 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 ay from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import fC from'react-markdown';import bC from'remark-gfm';import vC from'remark-math';import yC from'rehype-katex';import CC from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import vm from'mermaid';import _x from'dayjs/plugin/isoWeek';var Fg={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"},Bg={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"},Es={light:Fg,dark:Bg},lw='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',cw=t=>{let o=Es[t];return [o.primary,o.p300,o.muted,o.p700]},dw=10,pw="0.2s ease";var Cc=createContext({mode:"light",setting:"light"}),Wg=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;},En=({mode:t,defaultMode:o="light",children:r})=>{let n=t??o,[a,i]=useState("light"),[s,l]=useState(false);useEffect(()=>{l(true);let m=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>i(m.matches?"dark":"light");return h(),m.addEventListener("change",h),()=>m.removeEventListener("change",h)},[]);let d=n==="system"?s?a:"light":n;useEffect(()=>{Wg(d);},[d]);let u=useMemo(()=>({mode:d,setting:n}),[d,n]);return f(Cc.Provider,{value:u,children:r})},mo=()=>useContext(Cc).mode,Ls=()=>Es[mo()];var tt=(t,o)=>{let r=Math.min(1,Math.max(0,o)),n=t.trim(),a=d=>d.split("").map(u=>u+u).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),u=parseInt(s.slice(2,4),16),m=parseInt(s.slice(4,6),16);return `rgba(${d}, ${u}, ${m}, ${r})`}let l=`${Math.round(r*100)}%`;return `color-mix(in oklch, ${t} ${l}, transparent)`};var Ro=t=>{let o=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[r,n]=useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(o).matches);return useEffect(()=>{if(typeof window.matchMedia!="function")return;let a=window.matchMedia(o),i=()=>n(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[o]),r};var Gg={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},Ug=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},qg=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?Kg[o[1]]:void 0},Pt=forwardRef(({name:t,size:o,title:r,className:n,style:a,strokeWidth:i,fill:s,...l},d)=>{let u=l["aria-label"]??r,m=Ug(o??qg(n)??"1em"),h={fontFamily:"SAP-icons",fontSize:m,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:m,height:m,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...a};return f("span",{ref:d,role:u?"img":void 0,"aria-hidden":u?void 0:true,title:r,className:n,"data-sap-icon":t,style:h,...l,children:String.fromCodePoint(Gg[t])})});Pt.displayName="SapIcon";var ne=(t,o)=>{let r=forwardRef((n,a)=>f(Pt,{ref:a,name:t,...n}));return r.displayName=o??`SapIcon(${t})`,r};var wc=ne("activity","Activity"),ka=ne("error","AlertCircle"),Sc=ne("warning","AlertTriangle"),Rw=ne("down","ArrowDown"),Dw=ne("navigationRight","ArrowRight"),kc=ne("up","ArrowUp"),Os=ne("barChart","BarChart"),Nw=ne("activate","Bot"),Fs=ne("calendar","Calendar"),Aw=Fs,Ew=ne("camera","Camera"),Lw=ne("lineChart","ChartNoAxesCombined"),Do=ne("accept","Check"),Pa=ne("accept","CheckCircle"),Fo=ne("slimDown","ChevronDown"),Ta=ne("navigationLeft","ChevronLeft"),Bo=ne("navigationRight","ChevronRight"),Ow=ne("slimUp","ChevronUp"),Fw=ne("expandAll","ChevronsDown"),Bw=ne("collapseAll","ChevronsUp"),Ia=ne("error","CircleAlert"),Ln=ne("accept","CircleCheck"),Hw=Ln,Pc=ne("stop","CircleStop"),Tc=ne("copy","Clipboard"),zw=ne("checklist","ClipboardCheck"),Vw=ne("checklist","ClipboardList"),Ic=ne("time","Clock"),Ww=ne("tableColumn","Columns3"),qo=ne("copy","Copy"),$w=ne("duplicate","CopyPlus"),_w=ne("delete","Delete"),Ma=ne("download","Download"),Mc=ne("edit","Edit"),Rc=ne("fullScreen","Expand"),Gw=ne("show","Eye"),Uw=ne("hide","EyeOff"),Ra=ne("document","File"),Dc=ne("document","FileText"),Kw=ne("filter","Filter"),On=ne("tree","FolderTree"),Nc=ne("process","GitBranch"),Fn=ne("world","Globe"),Ac=ne("grid","Grid"),qw=ne("move","GripVertical"),Xw=ne("wrench","Hammer"),Ec=ne("picture","Image"),Da=ne("information","Info"),Zw=ne("translate","Languages"),Yw=ne("dimension","Layers"),Qw=ne("home","LayoutDashboard"),Na=ne("lightbulb","Lightbulb"),Lc=ne("lineChart","LineChart"),Oc=ne("synchronize","Loader2"),Aa=ne("locked","Lock"),jw=Aa,Fc=ne("log","LogOut"),Bs=ne("email","Mail"),Bc=ne("map","MapPin"),Hc=ne("menu","Menu"),Xg=ne("message","MessageCircle"),zc=Xg,Ea=ne("microphone","Mic"),Jw=ne("microphone","MicOff"),Vc=ne("darkMode","Moon"),e0=ne("overflow","MoreHorizontal"),t0=ne("accept","PackageCheck"),o0=ne("product","PackageSearch"),La=ne("splitOne","PanelLeftOpen"),Oa=ne("splitTwo","PanelRight"),r0=ne("overview","PanelsTopLeft"),Wc=ne("pieChart","PieChart"),Qr=ne("pushpin","Pin"),n0=ne("play","Play"),jr=ne("add","Plus"),a0=ne("qrCode","QrCode"),i0=ne("receipt","ReceiptText"),Fa=ne("refresh","RefreshCw"),s0=ne("activate","Rocket"),l0=ne("refresh","RotateCcw"),$c=ne("refresh","RotateCw"),c0=ne("tableRow","Rows3"),d0=ne("save","Save"),p0=ne("qrCode","ScanLine"),Ho=ne("search","Search"),Zg=ne("paperPlane","Send"),_c=Zg,Jr=ne("wrench","Settings"),u0=ne("accept","ShieldCheck"),m0=ne("sum","Sigma"),g0=ne("sort","SortAsc"),h0=ne("splitTwo","SquareSplitHorizontal"),f0=ne("favorite","Star"),Gc=ne("lightMode","Sun"),b0=ne("table","Table2"),v0=ne("ipad","TabletSmartphone"),Bn=ne("command","Terminal"),Uc=ne("thumbDown","ThumbsDown"),Kc=ne("thumbUp","ThumbsUp"),qc=ne("delete","Trash2"),y0=ne("tree","TreePine"),Xc=ne("trendDown","TrendingDown"),Ba=ne("warning","TriangleAlert"),C0=ne("shipping","Truck"),Zc=ne("upload","UploadCloud"),Hs=ne("employee","User"),Yc=ne("sound","Volume2"),x0=ne("factory","Warehouse"),w0=ne("process","Workflow"),Ut=ne("decline","X"),Ha=ne("error","XCircle");var Qg={contained:"primary",outlined:"secondary",text:"ghost"},jg={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},Se=forwardRef(({variant:t="primary",size:o="medium",block:r=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:l,sx:d$1,className:u,children:m,disabled:h,type:f$1="button",...p},v)=>{let C=Qg[t]??t,g$1=["orb-btn",`orb-btn-${C}`,jg[o],r?"orb-btn-block":void 0,n?"orb-is-loading":void 0,u].filter(Boolean).join(" "),x=d(d$1,g$1),b=s??(l?"a":"button");return g(b,{ref:v,type:b==="button"?f$1:void 0,href:l,className:x.className,style:x.style,disabled:b==="button"?h||n:void 0,"aria-disabled":b!=="button"&&(h||n)?true:void 0,...p,children:[n&&f("span",{className:`orb-spin ${C==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,m,!n&&i]})});Se.displayName="CButton";var He=forwardRef(({label:t,value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:l="text",placeholder:d$1,disabled:u,readOnly:m,required:h,autoFocus:f$1,autoComplete:p,name:v,id:C,error:g$1,helperText:x,dense:b=false,size:y,fullWidth:k=true,select:S=false,multiline:P=false,rows:I,children:w,variant:M,margin:N,onClick:T,startAdornment:R,endAdornment:A,InputProps:L,inputProps:$,InputLabelProps:j,SelectProps:O,sx:z,className:H},q)=>{let V=useId(),B=C??`orb-tf-${V}`,G=R??L?.startAdornment,X=A??L?.endAdornment,oe=(typeof g$1=="string"?g$1:void 0)??x,xe={id:B,className:`orb-inp ${b||y==="small"?"orb-inp-dense":""}`,style:k?void 0:{width:"auto"},value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:d$1,disabled:u,required:h,autoFocus:f$1,autoComplete:p,name:v,onClick:T,"aria-invalid":!!g$1},ze=S?f("select",{...xe,ref:q,onChange:n,children:w}):P?f("textarea",{...xe,ref:q,onChange:n,rows:I,readOnly:m||L?.readOnly}):f("input",{...xe,ref:q,onChange:n,type:l,readOnly:m||L?.readOnly,...$}),Pe=d(z,`orb-fld ${g$1?"orb-is-error":""} ${H??""}`,{width:k?"100%":void 0});return g("div",{className:Pe.className,style:Pe.style,children:[t&&f("label",{htmlFor:B,children:t}),G||X?g("div",{className:"orb-inp-adornment-wrap",children:[G&&f("span",{className:"orb-inp-adornment",children:G}),X&&f("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:X}),ze]}):ze,oe&&f("span",{className:"orb-fld-msg",children:oe})]})});He.displayName="CTextField";var Hn=forwardRef(({label:t,value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l,minRows:d$1=3,multiline:u,error:m,helperText:h,fullWidth:f$1=true,name:p,id:v,inputProps:C,sx:g$1,className:x},b)=>{let y=useId(),k=v??`orb-ta-${y}`,P=(typeof m=="string"?m:void 0)??h,I=d(g$1,`orb-fld ${m?"orb-is-error":""} ${x??""}`,{width:f$1?"100%":void 0});return g("div",{className:I.className,style:I.style,children:[t&&f("label",{htmlFor:k,children:t}),f("textarea",{ref:b,id:k,className:"orb-inp",value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l??d$1,name:p,"aria-invalid":!!m,...C}),P&&f("span",{className:"orb-fld-msg",children:P})]})});Hn.displayName="CTextArea";var Ht=forwardRef(({label:t,options:o,children:r,value:n,defaultValue:a,onChange:i,disabled:s,size:l,dense:d$1=true,fullWidth:u=true,minWidth:m,placeholder:h,displayEmpty:f$1,renderValue:p,multiple:v,MenuProps:C,variant:g$1,disableUnderline:x,onClick:b,onMouseDown:y,error:k,helperText:S,name:P,id:I,"aria-label":w,sx:M,className:N},T)=>{let R=useId(),A=I??`orb-sel-${R}`,$=(typeof k=="string"?k:void 0)??S,j=useRef(null),O=useRef(null),[z,H]=useState(false),[q,V]=useState(180),[B,G]=useState(a??"");useImperativeHandle(T,()=>j.current);let X=useMemo(()=>Children.toArray(r).flatMap(le=>{if(!isValidElement(le)||le.type!=="option")return [];let fe=le;return [{value:Array.isArray(fe.props.value)?fe.props.value[0]??"":fe.props.value??"",label:fe.props.children,disabled:fe.props.disabled}]}),[r]),pe=o??X,oe=n??B,me=Array.isArray(oe)?oe[0]??"":oe,xe=String(me??""),ze=pe.find(le=>String(le.value)===xe),Pe=p?p(oe):ze?.label??(xe||(h??"")),Te=d(M,`orb-fld ${k?"orb-is-error":""} ${N??""}`,{width:u?"100%":void 0,minWidth:typeof m=="number"?`${m}px`:m});if(v)return g("div",{className:Te.className,style:Te.style,children:[t&&f("label",{htmlFor:A,children:t}),g("select",{ref:T,id:A,className:`orb-inp ${d$1||l==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:P,multiple:true,onClick:b,onMouseDown:y,"aria-invalid":!!k,"aria-label":w,children:[h!==void 0&&f("option",{value:"",children:h}),o?o.map(le=>f("option",{value:le.value,disabled:le.disabled,children:le.label},le.value)):r]}),$&&f("span",{className:"orb-fld-msg",children:$})]});let Be=le=>{n===void 0&&G(le);let fe=j.current;fe&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(fe,le),i?.({target:fe,currentTarget:fe}));};return g("div",{className:Te.className,style:Te.style,children:[t&&f("label",{htmlFor:A,children:t}),f("select",{ref:j,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:P,value:xe,disabled:s,onChange:()=>{},children:pe.map(le=>f("option",{value:le.value,disabled:le.disabled,children:le.label},String(le.value)))}),g(No.Root,{open:z,onOpenChange:le=>{le&&V(O.current?.getBoundingClientRect().width??180),H(le);},children:[f(No.Trigger,{asChild:true,children:g("button",{ref:O,id:A,type:"button",className:`orb-inp orb-select-trigger ${d$1||l==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!k,"aria-label":w,"aria-haspopup":"listbox","data-placeholder":!ze&&!xe?"":void 0,onClick:b,onMouseDown:y,children:[f("span",{className:"orb-select-value",children:Pe}),f(Pt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),f(No.Portal,{children:f(No.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:q},children:f(No.RadioGroup,{value:xe,onValueChange:Be,children:pe.map(le=>g(No.RadioItem,{className:"orb-select-option",value:String(le.value),disabled:le.disabled,children:[f("span",{className:"orb-select-check","aria-hidden":"true",children:String(le.value)===xe?f(Pt,{name:"accept",size:13}):null}),f("span",{children:le.label})]},String(le.value)))})})})]}),$&&f("span",{className:"orb-fld-msg",children:$})]})});Ht.displayName="CSelect";var Tt=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,indeterminate:i,name:s,value:l,id:d$1,size:u,color:m,onClick:h,inputProps:f$1,sx:p,className:v},C)=>{let g$1=d([{...u==="small"?{fontSize:13}:void 0,...m?{color:m}:void 0},...Array.isArray(p)?p:p?[p]:[]],`orb-chk ${v??""}`),x=f("input",{ref:b=>{b&&(b.indeterminate=!!i),typeof C=="function"?C(b):C&&(C.current=b);},type:"checkbox",id:d$1,checked:o,defaultChecked:r,onChange:n,readOnly:o!==void 0&&n===void 0,disabled:a,name:s,value:l,onClick:h,...f$1});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})]})});Tt.displayName="CCheckbox";var ph=({label:t,options:o,value:r,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:u})=>{let m=useId(),h=i??`orb-rdo-${m}`;return g("div",{className:`orb-fld ${u??""}`,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(f$1=>g("label",{className:"orb-rdo",children:[f("input",{type:"radio",name:h,value:f$1.value,checked:r!==void 0?r===f$1.value:void 0,defaultChecked:n!==void 0?n===f$1.value:void 0,onChange:a?p=>a(p,f$1.value):void 0,disabled:l||f$1.disabled}),f("span",{children:f$1.label})]},f$1.value))})]})};var za=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,name:i,id:s,size:l,sx:d$1,className:u},m)=>{let h=d([{...l==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],`orb-sw ${u??""}`),f$1=f("input",{ref:m,type:"checkbox",role:"switch",id:s,checked:o,defaultChecked:r,onChange:n?p=>n(p,p.target.checked):void 0,disabled:a,name:i});return t==null?f("span",{className:h.className,style:h.style,children:f$1}):g("label",{className:h.className,style:h.style,children:[f$1,f("span",{children:t})]})});za.displayName="CSwitch";var gh={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},Ct=forwardRef(({label:t,children:o,tone:r,color:n="default",variant:a,size:i="medium",clickable:s,avatar:l,icon:d$1,onDelete:u,onClick:m,sx:h,className:f$1},p)=>{let v=r??(a==="outlined"&&n==="default"?"outline":gh[n]??"gray"),C=s??!!m,g$1=d([{cursor:C?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(h)?h:h?[h]:[]],`orb-chip orb-chip-${v} ${f$1??""}`);return g("span",{ref:p,className:g$1.className,style:g$1.style,onClick:m,role:C?"button":void 0,tabIndex:C?0:void 0,onKeyDown:C?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),m?.(x));}:void 0,children:[l??d$1,f("span",{className:"orb-chip-label",children:o??t}),u&&f("button",{type:"button","aria-label":"Remove",onClick:x=>{x.stopPropagation(),u(x);},style:{background:"none",border:"none",padding:0,display:"inline-flex",cursor:"pointer",color:"inherit"},children:f(Ut,{size:13,strokeWidth:2})})]})});Ct.displayName="CChip";var Va=forwardRef(({badgeContent:t,color:o="primary",children:r,invisible:n=false,sx:a,className:i},s)=>{let l=d(a,i,{display:"inline-flex",position:r?"relative":void 0}),d$1=!n&&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:l.className,style:l.style,children:[r,d$1]}):f("span",{ref:s,className:l.className,style:l.style,children:d$1})});Va.displayName="CBadge";var en=forwardRef(({children:t,src:o,alt:r,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:o?f("img",{src:o,alt:r??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});en.displayName="CAvatar";var tn=forwardRef(({severity:t="info",title:o,children:r,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:[o&&f("b",{children:o}),r&&f("span",{children:r})]}),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"})]})});tn.displayName="CAlert";var zn=({value:t,variant:o,color:r,sx:n,className:a})=>{let i=o==="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:r}}),i&&f("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},vh=({width:t,height:o=14,variant:r="rectangular",sx:n,className:a})=>f("div",{className:`orb-skel ${a??""}`,style:{width:t,height:o,borderRadius:r==="circular"?"50%":r==="text"?6:"var(--orb-r)",...n}}),Xo=({size:t=12,onPrimary:o=false,sx:r,className:n})=>f("span",{className:`orb-spin ${o?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...r},role:"status","aria-label":"Loading"});var lt=({title:t,children:o,enterDelay:r=300,side:n="top",align:a="center",disabled:i})=>!t||i?f(e,{children:o}):f(Zo.Provider,{delayDuration:r,skipDelayDuration:200,children:g(Zo.Root,{children:[f(Zo.Trigger,{asChild:true,children:o}),f(Zo.Portal,{children:f(Zo.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});var ae=forwardRef(({tooltip:t,size:o="small",active:r=false,edge:n,color:a,sx:i,className:s,children:l,type:d$1="button",...u},m)=>{let h=d([{color:r?"var(--orb-primary)":a,...n==="start"?{marginLeft:-8}:n==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${o==="small"?"orb-icon-btn-sm":""} ${s??""}`),f$1=f("button",{ref:m,type:d$1,className:h.className,style:h.style,...u,children:l});return t?f(lt,{title:t,children:f$1}):f$1});ae.displayName="CIconButton";var Vn=({value:t,options:o,onValueChange:r,size:n="medium",sx:a,className:i,...s})=>{let l=useRef([]),d$1=o.findIndex(p=>!p.disabled),u=o.findIndex(p=>p.value===t),m=(p,v)=>{let C=o.map((b,y)=>b.disabled?-1:y).filter(b=>b>=0);if(C.length===0)return;let g=C.indexOf(v),x;p.key==="Home"&&(x=C[0]),p.key==="End"&&(x=C[C.length-1]),(p.key==="ArrowRight"||p.key==="ArrowDown")&&(x=C[(g+1+C.length)%C.length]),(p.key==="ArrowLeft"||p.key==="ArrowUp")&&(x=C[(g-1+C.length)%C.length]),x!==void 0&&(p.preventDefault(),l.current[x]?.focus(),r(o[x].value));},h=d(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),f$1={...h.style,"--orb-segmented-count":Math.max(o.length,1),"--orb-segmented-index":Math.max(u,0)};return g("div",{role:"radiogroup",className:h.className,style:f$1,"data-has-selection":u>=0?"true":"false",...s,children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),o.map((p,v)=>{let C=p.value===t;return f(ae,{ref:g=>{l.current[v]=g;},className:["orb-segmented-control-item",p.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:p.label,role:"radio","aria-label":p.label,"aria-checked":C,"data-selected":C?"true":void 0,disabled:p.disabled,tabIndex:C||t==null&&v===d$1?0:-1,onClick:()=>r(p.value),onKeyDown:g=>m(g,v),children:p.icon??f("span",{className:"orb-segmented-control-label",children:p.label})},p.value)})]})};var Yt=({triggerLabel:t,items:o=[],trigger:r,align:n="start",anchorEl:a,open:i,onClose:s,children:l,slotProps:d$1,PaperProps:u,anchorPosition:m,sx:h})=>{let f$1=useRef(null);if(useEffect(()=>{if(i!==true)return;let p=C=>{let g=C.composedPath();f$1.current&&g.includes(f$1.current)||a&&g.includes(a)||s?.();},v=C=>{C.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",p,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",p,true),document.removeEventListener("keydown",v,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let p=a?.getBoundingClientRect(),v=window.innerWidth,C=p?.left??16,g=p?.right??C,x=d$1?.paper?.sx??u?.sx,b=d([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(h)?h:h?[h]:[]],"orb-pop orb-menu",d$1?.paper?.style??u?.style),y=Children.map(l,k=>{if(!isValidElement(k)||k.type!=="option")return k;let S=k.props,{children:P,disabled:I,selected:w}=S,M=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:M.className,style:M.style,onClick:I?void 0:S.onClick,onKeyDown:N=>{!I&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),S.onClick?.(N));},children:P})});return createPortal(f("div",{ref:f$1,role:"menu",className:b.className,style:{...b.style,position:"fixed",left:n==="end"&&!m?void 0:m?.left??C,right:n==="end"&&!m?Math.max(16,v-g):void 0,top:m?.top??(p?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:y}),document.body)}return g(No.Root,{children:[f(No.Trigger,{asChild:true,children:r??f(Se,{variant:"primary",children:t})}),f(No.Portal,{children:f(No.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:o.map((p,v)=>g(No.Item,{className:"orb-menu-item",disabled:p.disabled,onSelect:()=>p.onClick?.(),children:[p.icon,p.label]},v))})})]})};var Ne=forwardRef(({elevation:t=1,variant:o,component:r,sx:n,style:a,className:i,children:s,...l},d$1)=>{let u=r??"div",m=d(n,`orb-card ${t>0&&o!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return f(u,{ref:d$1,className:m.className,style:m.style,...l,children:s})});Ne.displayName="CPaper";var Rt=forwardRef(({orientation:t="horizontal",flexItem:o,sx:r,className:n},a)=>{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"} ${n??""}`);return f("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});Rt.displayName="CDivider";var Rh={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"},Dh={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},E=forwardRef(({variant:t="body1",component:o,muted:r=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:l,className:d$1,children:u,...m},h)=>{let f$1=o??Dh[t]??"span",v=[t==="inherit"?void 0:Rh[t],d$1].filter(Boolean).join(" "),C=d([{...r?{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(f$1,{ref:h,className:C.className,style:C.style,...m,children:u})});E.displayName="CTypography";var Ah=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},ie=forwardRef(({direction:t="column",spacing:o,alignItems:r,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:l,className:d$1,children:u,...m},h)=>{let f$1=d([{display:"flex",flexDirection:t,gap:Ah(o),alignItems:r,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(l)?l:l?[l]:[]],d$1);return f("div",{ref:h,className:f$1.className,style:f$1.style,...m,children:u})});ie.displayName="CStack";var Et=({open:t,onClose:o,title:r,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:l=false,PaperProps:d$1,slotProps:u,disableRestoreFocus:m,keepMounted:h,hideCloseButton:f$1=false,sx:p,className:v})=>{let C=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??u?.paper?.sx)?d$1?.sx??u?.paper?.sx:d$1?.sx??u?.paper?.sx?[d$1?.sx??u?.paper?.sx]:[],...Array.isArray(p)?p:p?[p]:[]],`orb-dialog ${v??""}`);return f(wo.Root,{open:t,onOpenChange:g=>{g||o?.();},children:g(wo.Portal,{children:[f(wo.Overlay,{className:"orb-overlay"}),g(wo.Content,{className:C.className,style:C.style,children:[(r||!f$1)&&g("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[r?f(wo.Title,{className:"orb-dialog-title",children:r}):f(wo.Title,{className:"orb-visually-hidden",children:"Dialog"}),!f$1&&f(wo.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(Ut,{size:16,strokeWidth:2})})})]}),f("div",{style:{minWidth:0},children:n}),a&&f("div",{className:"orb-dialog-actions",children:a})]})]})})};var Vs=({open:t,defaultOpen:o,onOpenChange:r,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:l=6,matchTriggerWidth:d=false,sx:u,className:m})=>g(br.Root,{open:t,defaultOpen:o,onOpenChange:r,children:[f(br.Trigger,{asChild:true,children:n}),f(br.Portal,{children:f(br.Content,{className:`orb-pop ${m??""}`,align:i,side:s,sideOffset:l,style:{minWidth:d?"var(--radix-popover-trigger-width)":void 0,...u},onOpenAutoFocus:h=>h.preventDefault(),children:a})})]});var Oh=({items:t,value:o,defaultValue:r,onChange:n,sx:a,className:i})=>{let s=o!==void 0,[l,d]=useState(r??t[0]?.value),u=s?o:l,m=useRef([]),h=p=>{s||d(p),n?.(p);},f$1=p=>{if(p.key!=="ArrowRight"&&p.key!=="ArrowLeft")return;p.preventDefault();let v=t.filter(b=>!b.disabled),C=v.findIndex(b=>b.value===u),g=p.key==="ArrowRight"?1:-1,x=v[(C+g+v.length)%v.length];if(x){h(x.value);let b=t.findIndex(y=>y.value===x.value);m.current[b]?.focus();}};return f("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:f$1,children:t.map((p,v)=>{let C=p.value===u;return g("button",{ref:g=>{m.current[v]=g;},type:"button",role:"tab","aria-selected":C,disabled:p.disabled,className:`orb-tab ${C?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>h(p.value),children:[p.icon,p.label]},p.value)})})};var Bh=["su","mo","tu","we","th","fr","sa"],Wn=(t,o)=>!!(t&&o&&t.isSame(o,"day")),$n=({value:t,rangeStart:o,rangeEnd:r,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:l,maxDate:d,locale:u,renderDay:m})=>{let h=a!==void 0,[f$1,p]=useState(()=>i??t??o??rr()),v=(h?a:f$1).startOf("month"),C=S=>{h||p(S),s?.(S);},g$1=useMemo(()=>u?v.locale(u):v,[v,u]),x=useMemo(()=>{let P=v.startOf("month").startOf("week"),I=[],w=P;for(let M=0;M<6;M+=1){let N=[];for(let T=0;T<7;T+=1)N.push(w),w=w.add(1,"day");if(I.push(N),w.isAfter(v.endOf("month"))&&M>=3)break}return I},[v]),b=useMemo(()=>{let S=u?rr().locale(u):rr();return Bh.map((P,I)=>S.startOf("week").add(I,"day").format("dd"))},[u]),y=S=>!!(l&&S.isBefore(l.startOf("day"))||d&&S.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:()=>C(v.subtract(1,"month")),children:f(Ta,{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:()=>C(v.add(1,"month")),children:f(Bo,{size:16,strokeWidth:2})})]}),g("div",{className:"orb-cal-grid",role:"grid",children:[b.map((S,P)=>f("span",{className:"orb-cal-dow",children:S},`${S}-${P}`)),x.flat().map(S=>{let P=!S.isSame(v,"month"),I=y(S),w=k?Wn(S,o)||Wn(S,r):Wn(S,t),M=S.isSame(rr(),"day"),N=k&&o&&r&&S.isAfter(o.startOf("day"))&&S.isBefore(r.startOf("day")),T=k&&Wn(S,o)&&!!r,R=k&&Wn(S,r)&&!!o,A=["orb-cal-day",P?"orb-is-outside":void 0,M?"orb-is-today":void 0,w?"orb-is-selected":void 0,N?"orb-is-in-range":void 0,T?"orb-is-range-start":void 0,R?"orb-is-range-end":void 0].filter(Boolean).join(" ");return m?f("span",{className:"orb-cal-day-slot",children:m(S,{outsideCurrentMonth:P,selected:w,today:M,disabled:I})},S.format("YYYY-MM-DD")):f("button",{type:"button",role:"gridcell","aria-selected":w,"aria-current":M?"date":void 0,className:A,disabled:I,onClick:()=>n?.(S),children:S.date()},S.format("YYYY-MM-DD"))})]})]})};rr.extend(Hh);var zh=({label:t,value:o,defaultValue:r,onChange:n,minDate:a,maxDate:i,disabled:s,format:l="YYYY-MM-DD",placeholder:d,locale:u,dense:m=false,error:h,helperText:f$1,sx:p,className:v})=>{let C=o!==void 0,[g$1,x]=useState(r??null),b=C?o:g$1,[y,k]=useState(false),[S,P]=useState(null),I=R=>{C||x(R),n?.(R);},w=S??(b?(u?b.locale(u):b).format(l):""),M=()=>{if(S===null)return;let R=S.trim();if(!R)I(null);else {let A=rr(R,l,true);A.isValid()&&!(a&&A.isBefore(a.startOf("day")))&&!(i&&A.isAfter(i.startOf("day")))&&I(A);}P(null);},T=(typeof h=="string"?h:void 0)??f$1;return g("div",{className:`orb-fld ${h?"orb-is-error":""} ${v??""}`,style:p,children:[t&&f("label",{children:t}),f(Vs,{open:y,onOpenChange:k,trigger:g("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[f("span",{className:"orb-inp-adornment",children:f(Fs,{size:15,strokeWidth:1.8})}),f("input",{className:`orb-inp ${m?"orb-inp-dense":""}`,value:w,placeholder:d??l,disabled:s,onFocus:()=>k(true),onChange:R=>P(R.target.value),onBlur:M,onKeyDown:R=>{R.key==="Enter"&&(M(),k(false)),R.key==="Escape"&&k(false);}})]}),children:f($n,{value:b,onChange:R=>{I(R),P(null),k(false);},minDate:a,maxDate:i,locale:u,defaultMonth:b??void 0})}),T&&f("span",{className:"orb-fld-msg",children:T})]})};var Wh=({onFilesSelected:t,multiple:o=false,accept:r="*",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),[u,m]=useState([]),h=useRef(null),f$1=b=>{b.preventDefault(),d(true);},p=b=>{b.preventDefault(),d(false);},v=b=>{b.preventDefault(),d(false),g$1(Array.from(b.dataTransfer.files));},C=b=>{b.target.files&&g$1(Array.from(b.target.files));},g$1=b=>{let y=n?b.filter(S=>S.size<=n):b;y.length<b.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let k=o?[...u,...y]:y;o&&(k=k.filter((S,P,I)=>P===I.findIndex(w=>w.name===S.name&&w.size===S.size&&w.lastModified===S.lastModified))),m(k),t?.(k),h.current&&(h.current.value="");},x=b=>{let y=u.filter((k,S)=>S!==b);m(y),t?.(y);};return g("div",{style:{width:"100%",...s},children:[g("div",{onClick:()=>h.current?.click(),onDragOver:f$1,onDragLeave:p,onDrop:v,role:"button",tabIndex:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),h.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:h,style:{display:"none"},multiple:o,accept:r,onChange:C}),g("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[f(Zc,{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})]})]}),u.length>0&&f("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:u.map((b,y)=>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(Dc,{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:()=>x(y),children:f(qc,{size:15,strokeWidth:1.8})})]},`${b.name}-${y}`))})]})};function fo(...t){return twMerge(clsx(t))}var $a={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"},_n={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},ed=()=>"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 Kh=cva(ed(),{variants:{variant:{default:`${$a.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${$a.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:$a.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:_n.none,sm:_n.sm,md:_n.md,full:_n.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),_s=jt.forwardRef(({className:t,variant:o,size:r,asChild:n=false,...a},i)=>f(n?Slot:"button",{className:fo(Kh({variant:o,size:r,className:t})),ref:i,...a}));_s.displayName="Button";var qh={"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.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.searchOpenPanel":"Open conversation","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","omph.status.idle":"Idle","omph.status.pending":"Pending","omph.status.running":"Working","omph.status.success":"Success","omph.status.error":"Error","omph.working":"Working","omph.workingFor":"Working for {duration}","omph.loadOlder":"Load earlier","omph.loadingOlder":"Loading earlier\u2026","omph.toBottom":"Back to bottom","omph.copy":"Copy","omph.copied":"Copied","omph.turnActions":"Reply actions","omph.usage":"Usage","omph.inputTokens":"Input","omph.outputTokens":"Output","omph.duration":"Duration","omph.send":"Send","omph.stop":"Stop","omph.turnRail":"Turns","omph.secondUnit":"s","omph.minuteUnit":"m","omph.preview.title":"File preview","omph.preview.close":"Close preview","omph.preview.back":"Back to conversation","omph.preview.expand":"Expand preview","omph.preview.collapse":"Restore preview size","omph.preview.copyContent":"Copy content","omph.preview.copyPath":"Copy path","omph.preview.download":"Download","omph.preview.openExternal":"Open externally","omph.preview.wrap":"Wrap","omph.preview.loading":"Loading file","omph.preview.missing":"File not found","omph.preview.failed":"Could not load this file","omph.preview.unsupported":"No preview for this file type","omph.preview.retry":"Try again","omph.preview.resize":"Resize preview","omph.preview.line":"Line {start}","omph.preview.lines":"Lines {start}\u2013{end}","omph.preview.truncated":"Showing the first {shown} of {total} lines","omph.preview.imageFailed":"The image could not be displayed","omph.preview.zoomIn":"Zoom in","omph.preview.zoomOut":"Zoom out","omph.preview.zoomFit":"Fit to width","omph.newConversation":"New conversation","omph.conversationList":"Conversation list","omph.conversations":"Conversations","omph.noConversations":"No conversations yet","omph.approval.waiting":"Waiting for approval","omph.approval.choose":"Choose an action","omph.approval.details":"Approval details","omph.approval.choices":"Actions","omph.approval.reject":"Reject","omph.approval.allowOnce":"Allow once","omph.approval.confirm":"Continue","omph.approval.other":"Other","omph.approval.otherPlaceholder":"Describe the action to take","omph.approval.escalation":"Tool {toolName} requests privileged execution","omph.input.placeholder":"Type a message...","omph.input.upload":"Upload file","omph.input.send":"Send message","omph.input.stop":"Stop generating","omph.input.message":"Message input","omph.input.tools":"Input tools","agentui.html.defaultTitle":"Interactive HTML","agentui.html.open":"Open","agentui.html.preview":"Preview","agentui.html.code":"Code","agentui.html.toggle":"Switch between code and preview","agentui.html.copy":"Copy code","agentui.html.copied":"Copied","agentui.html.download":"Download","agentui.html.close":"Close"},Xh={"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.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.searchOpenPanel":"\u6253\u5F00\u5BF9\u8BDD","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","omph.status.idle":"\u7A7A\u95F2","omph.status.pending":"\u7B49\u5F85\u4E2D","omph.status.running":"\u5904\u7406\u4E2D","omph.status.success":"\u5DF2\u5B8C\u6210","omph.status.error":"\u51FA\u9519","omph.working":"\u5904\u7406\u4E2D","omph.workingFor":"\u5DF2\u5904\u7406 {duration}","omph.loadOlder":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","omph.loadingOlder":"\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F\u2026","omph.toBottom":"\u56DE\u5230\u5E95\u90E8","omph.copy":"\u590D\u5236","omph.copied":"\u5DF2\u590D\u5236","omph.turnActions":"\u56DE\u590D\u64CD\u4F5C","omph.usage":"\u7528\u91CF","omph.inputTokens":"\u8F93\u5165","omph.outputTokens":"\u8F93\u51FA","omph.duration":"\u7528\u65F6","omph.send":"\u53D1\u9001","omph.stop":"\u505C\u6B62","omph.turnRail":"\u8F6E\u6B21","omph.secondUnit":"\u79D2","omph.minuteUnit":"\u5206","omph.preview.title":"\u6587\u4EF6\u9884\u89C8","omph.preview.close":"\u5173\u95ED\u9884\u89C8","omph.preview.back":"\u8FD4\u56DE\u5BF9\u8BDD","omph.preview.expand":"\u5C55\u5F00\u9884\u89C8","omph.preview.collapse":"\u8FD8\u539F\u9884\u89C8\u5927\u5C0F","omph.preview.copyContent":"\u590D\u5236\u5185\u5BB9","omph.preview.copyPath":"\u590D\u5236\u8DEF\u5F84","omph.preview.download":"\u4E0B\u8F7D","omph.preview.openExternal":"\u5728\u5916\u90E8\u6253\u5F00","omph.preview.wrap":"\u81EA\u52A8\u6362\u884C","omph.preview.loading":"\u6B63\u5728\u52A0\u8F7D\u6587\u4EF6","omph.preview.missing":"\u6587\u4EF6\u4E0D\u5B58\u5728","omph.preview.failed":"\u65E0\u6CD5\u52A0\u8F7D\u6B64\u6587\u4EF6","omph.preview.unsupported":"\u6B64\u6587\u4EF6\u7C7B\u578B\u4E0D\u652F\u6301\u9884\u89C8","omph.preview.retry":"\u91CD\u8BD5","omph.preview.resize":"\u8C03\u6574\u9884\u89C8\u5927\u5C0F","omph.preview.line":"\u7B2C {start} \u884C","omph.preview.lines":"\u7B2C {start}\u2013{end} \u884C","omph.preview.truncated":"\u5171 {total} \u884C\uFF0C\u4EC5\u663E\u793A\u524D {shown} \u884C","omph.preview.imageFailed":"\u56FE\u7247\u65E0\u6CD5\u663E\u793A","omph.preview.zoomIn":"\u653E\u5927","omph.preview.zoomOut":"\u7F29\u5C0F","omph.preview.zoomFit":"\u9002\u5E94\u5BBD\u5EA6","omph.newConversation":"\u65B0\u5EFA\u4F1A\u8BDD","omph.conversationList":"\u4F1A\u8BDD\u5217\u8868","omph.conversations":"\u4F1A\u8BDD","omph.noConversations":"\u8FD8\u6CA1\u6709\u4F1A\u8BDD","omph.approval.waiting":"\u7B49\u5F85\u5BA1\u6279","omph.approval.choose":"\u8BF7\u9009\u62E9\u64CD\u4F5C","omph.approval.details":"\u5BA1\u6279\u8BE6\u60C5","omph.approval.choices":"\u53EF\u9009\u64CD\u4F5C","omph.approval.reject":"\u62D2\u7EDD","omph.approval.allowOnce":"\u4EC5\u6B64\u4E00\u6B21","omph.approval.confirm":"\u7EE7\u7EED","omph.approval.other":"\u5176\u4ED6","omph.approval.otherPlaceholder":"\u63CF\u8FF0\u8981\u6267\u884C\u7684\u64CD\u4F5C","omph.approval.escalation":"\u5DE5\u5177 {toolName} \u8BF7\u6C42\u7279\u6743\u6267\u884C","omph.input.placeholder":"\u8F93\u5165\u6D88\u606F\u2026","omph.input.upload":"\u4E0A\u4F20\u6587\u4EF6","omph.input.send":"\u53D1\u9001\u6D88\u606F","omph.input.stop":"\u505C\u6B62\u751F\u6210","omph.input.message":"\u6D88\u606F\u8F93\u5165","omph.input.tools":"\u8F93\u5165\u5DE5\u5177","agentui.html.defaultTitle":"\u4EA4\u4E92\u5F0F HTML","agentui.html.open":"\u6253\u5F00","agentui.html.preview":"\u9884\u89C8","agentui.html.code":"\u4EE3\u7801","agentui.html.toggle":"\u5207\u6362\u4EE3\u7801\u4E0E\u9884\u89C8","agentui.html.copy":"\u590D\u5236\u4EE3\u7801","agentui.html.copied":"\u5DF2\u590D\u5236","agentui.html.download":"\u4E0B\u8F7D","agentui.html.close":"\u5173\u95ED"},Zh={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.searchOpenPanel":"Ouvrir la conversation","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","omph.status.idle":"Inactif","omph.status.pending":"En attente","omph.status.running":"En cours","omph.status.success":"Termin\xE9","omph.status.error":"Erreur","omph.working":"En cours","omph.workingFor":"En cours depuis {duration}","omph.loadOlder":"Charger les messages pr\xE9c\xE9dents","omph.loadingOlder":"Chargement des messages pr\xE9c\xE9dents\u2026","omph.toBottom":"Revenir en bas","omph.copy":"Copier","omph.copied":"Copi\xE9","omph.turnActions":"Actions de r\xE9ponse","omph.usage":"Utilisation","omph.inputTokens":"Entr\xE9e","omph.outputTokens":"Sortie","omph.duration":"Dur\xE9e","omph.send":"Envoyer","omph.stop":"Arr\xEAter","omph.turnRail":"Tours","omph.secondUnit":"s","omph.minuteUnit":"min","omph.preview.title":"Aper\xE7u du fichier","omph.preview.close":"Fermer l'aper\xE7u","omph.preview.back":"Retour \xE0 la conversation","omph.preview.expand":"Agrandir l\u2019aper\xE7u","omph.preview.collapse":"R\xE9duire l\u2019aper\xE7u","omph.preview.copyContent":"Copier le contenu","omph.preview.copyPath":"Copier le chemin","omph.preview.download":"T\xE9l\xE9charger","omph.preview.openExternal":"Ouvrir \xE0 l\u2019ext\xE9rieur","omph.preview.wrap":"Retour \xE0 la ligne","omph.preview.loading":"Chargement du fichier","omph.preview.missing":"Fichier introuvable","omph.preview.failed":"Impossible de charger ce fichier","omph.preview.unsupported":"Aucun aper\xE7u pour ce type de fichier","omph.preview.retry":"R\xE9essayer","omph.preview.resize":"Redimensionner l\u2019aper\xE7u","omph.preview.line":"Ligne {start}","omph.preview.lines":"Lignes {start}\u2013{end}","omph.preview.truncated":"Affichage des {shown} premi\xE8res lignes sur {total}","omph.preview.imageFailed":"Impossible d'afficher l'image","omph.preview.zoomIn":"Zoom avant","omph.preview.zoomOut":"Zoom arri\xE8re","omph.preview.zoomFit":"Ajuster \xE0 la largeur","omph.newConversation":"Nouvelle conversation","omph.conversationList":"Liste des conversations","omph.conversations":"Conversations","omph.noConversations":"Aucune conversation","omph.approval.waiting":"En attente d'approbation","omph.approval.choose":"Choisir une action","omph.approval.details":"D\xE9tails de l'approbation","omph.approval.choices":"Actions","omph.approval.reject":"Refuser","omph.approval.allowOnce":"Autoriser une fois","omph.approval.confirm":"Continuer","omph.approval.other":"Autre","omph.approval.otherPlaceholder":"D\xE9crire l'action \xE0 effectuer","omph.approval.escalation":"L'outil {toolName} demande une ex\xE9cution privil\xE9gi\xE9e","omph.input.placeholder":"Saisir un message\u2026","omph.input.upload":"T\xE9l\xE9verser un fichier","omph.input.send":"Envoyer le message","omph.input.stop":"Arr\xEAter la g\xE9n\xE9ration","omph.input.message":"Saisie de message","omph.input.tools":"Outils de saisie","agentui.html.defaultTitle":"HTML interactif","agentui.html.open":"Ouvrir","agentui.html.preview":"Aper\xE7u","agentui.html.code":"Code","agentui.html.toggle":"Basculer entre code et aper\xE7u","agentui.html.copy":"Copier le code","agentui.html.copied":"Copi\xE9","agentui.html.download":"T\xE9l\xE9charger","agentui.html.close":"Fermer"},Yh={"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.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.searchOpenPanel":"Unterhaltung \xF6ffnen","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","omph.status.idle":"Inaktiv","omph.status.pending":"Ausstehend","omph.status.running":"L\xE4uft","omph.status.success":"Erfolgt","omph.status.error":"Fehler","omph.working":"In Arbeit","omph.workingFor":"In Arbeit seit {duration}","omph.loadOlder":"Fr\xFChere Nachrichten laden","omph.loadingOlder":"Fr\xFChere Nachrichten werden geladen\u2026","omph.toBottom":"Nach unten","omph.copy":"Kopieren","omph.copied":"Kopiert","omph.turnActions":"Antwortaktionen","omph.usage":"Nutzung","omph.inputTokens":"Eingabe","omph.outputTokens":"Ausgabe","omph.duration":"Dauer","omph.send":"Senden","omph.stop":"Stoppen","omph.turnRail":"Runden","omph.secondUnit":"s","omph.minuteUnit":"min","omph.preview.title":"Dateivorschau","omph.preview.close":"Vorschau schlie\xDFen","omph.preview.back":"Zur\xFCck zur Konversation","omph.preview.expand":"Vorschau vergr\xF6\xDFern","omph.preview.collapse":"Vorschau wiederherstellen","omph.preview.copyContent":"Inhalt kopieren","omph.preview.copyPath":"Pfad kopieren","omph.preview.download":"Herunterladen","omph.preview.openExternal":"Extern \xF6ffnen","omph.preview.wrap":"Zeilenumbruch","omph.preview.loading":"Datei wird geladen","omph.preview.missing":"Datei nicht gefunden","omph.preview.failed":"Datei konnte nicht geladen werden","omph.preview.unsupported":"Keine Vorschau f\xFCr diesen Dateityp","omph.preview.retry":"Erneut versuchen","omph.preview.resize":"Vorschaugr\xF6\xDFe \xE4ndern","omph.preview.line":"Zeile {start}","omph.preview.lines":"Zeilen {start}\u2013{end}","omph.preview.truncated":"Die ersten {shown} von {total} Zeilen werden angezeigt","omph.preview.imageFailed":"Bild konnte nicht angezeigt werden","omph.preview.zoomIn":"Vergr\xF6\xDFern","omph.preview.zoomOut":"Verkleinern","omph.preview.zoomFit":"An Breite anpassen","omph.newConversation":"Neue Konversation","omph.conversationList":"Konversationsliste","omph.conversations":"Konversationen","omph.noConversations":"Noch keine Konversationen","omph.approval.waiting":"Auf Genehmigung wartend","omph.approval.choose":"Aktion w\xE4hlen","omph.approval.details":"Genehmigungsdetails","omph.approval.choices":"Aktionen","omph.approval.reject":"Ablehnen","omph.approval.allowOnce":"Einmal erlauben","omph.approval.confirm":"Fortfahren","omph.approval.other":"Sonstiges","omph.approval.otherPlaceholder":"Aktion beschreiben","omph.approval.escalation":"Tool {toolName} fordert privilegierte Ausf\xFChrung","omph.input.placeholder":"Nachricht eingeben\u2026","omph.input.upload":"Datei hochladen","omph.input.send":"Nachricht senden","omph.input.stop":"Generierung stoppen","omph.input.message":"Nachrichteneingabe","omph.input.tools":"Eingabewerkzeuge","agentui.html.defaultTitle":"Interaktives HTML","agentui.html.open":"\xD6ffnen","agentui.html.preview":"Vorschau","agentui.html.code":"Code","agentui.html.toggle":"Zwischen Code und Vorschau wechseln","agentui.html.copy":"Code kopieren","agentui.html.copied":"Kopiert","agentui.html.download":"Herunterladen","agentui.html.close":"Schlie\xDFen"},Qh={"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.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.searchOpenPanel":"\u4F1A\u8A71\u3092\u958B\u304F","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","omph.status.idle":"\u5F85\u6A5F\u4E2D","omph.status.pending":"\u51E6\u7406\u5F85\u3061","omph.status.running":"\u51E6\u7406\u4E2D","omph.status.success":"\u5B8C\u4E86","omph.status.error":"\u30A8\u30E9\u30FC","omph.working":"\u51E6\u7406\u4E2D","omph.workingFor":"\u51E6\u7406\u4E2D\uFF08{duration} \u7D4C\u904E\uFF09","omph.loadOlder":"\u904E\u53BB\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8AAD\u307F\u8FBC\u3080","omph.loadingOlder":"\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026","omph.toBottom":"\u4E00\u756A\u4E0B\u3078","omph.copy":"\u30B3\u30D4\u30FC","omph.copied":"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F","omph.turnActions":"\u8FD4\u4FE1\u30A2\u30AF\u30B7\u30E7\u30F3","omph.usage":"\u4F7F\u7528\u91CF","omph.inputTokens":"\u5165\u529B","omph.outputTokens":"\u51FA\u529B","omph.duration":"\u6240\u8981\u6642\u9593","omph.send":"\u9001\u4FE1","omph.stop":"\u505C\u6B62","omph.turnRail":"\u30BF\u30FC\u30F3","omph.secondUnit":"\u79D2","omph.minuteUnit":"\u5206","omph.preview.title":"\u30D5\u30A1\u30A4\u30EB\u30D7\u30EC\u30D3\u30E5\u30FC","omph.preview.close":"\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u9589\u3058\u308B","omph.preview.back":"\u4F1A\u8A71\u306B\u623B\u308B","omph.preview.expand":"\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u62E1\u5927","omph.preview.collapse":"\u30D7\u30EC\u30D3\u30E5\u30FC\u306E\u30B5\u30A4\u30BA\u3092\u623B\u3059","omph.preview.copyContent":"\u5185\u5BB9\u3092\u30B3\u30D4\u30FC","omph.preview.copyPath":"\u30D1\u30B9\u3092\u30B3\u30D4\u30FC","omph.preview.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","omph.preview.openExternal":"\u5916\u90E8\u3067\u958B\u304F","omph.preview.wrap":"\u6298\u308A\u8FD4\u3057","omph.preview.loading":"\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D","omph.preview.missing":"\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","omph.preview.failed":"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F","omph.preview.unsupported":"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u306F\u30D7\u30EC\u30D3\u30E5\u30FC\u3067\u304D\u307E\u305B\u3093","omph.preview.retry":"\u518D\u8A66\u884C","omph.preview.resize":"\u30D7\u30EC\u30D3\u30E5\u30FC\u30B5\u30A4\u30BA\u306E\u5909\u66F4","omph.preview.line":"{start} \u884C\u76EE","omph.preview.lines":"{start}\u2013{end} \u884C","omph.preview.truncated":"\u5168 {total} \u884C\u4E2D\u5148\u982D {shown} \u884C\u3092\u8868\u793A","omph.preview.imageFailed":"\u753B\u50CF\u3092\u8868\u793A\u3067\u304D\u307E\u305B\u3093","omph.preview.zoomIn":"\u62E1\u5927","omph.preview.zoomOut":"\u7E2E\u5C0F","omph.preview.zoomFit":"\u5E45\u306B\u5408\u308F\u305B\u308B","omph.newConversation":"\u65B0\u3057\u3044\u4F1A\u8A71","omph.conversationList":"\u4F1A\u8A71\u30EA\u30B9\u30C8","omph.conversations":"\u4F1A\u8A71","omph.noConversations":"\u4F1A\u8A71\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093","omph.approval.waiting":"\u627F\u8A8D\u5F85\u3061","omph.approval.choose":"\u64CD\u4F5C\u3092\u9078\u629E","omph.approval.details":"\u627F\u8A8D\u306E\u8A73\u7D30","omph.approval.choices":"\u64CD\u4F5C","omph.approval.reject":"\u62D2\u5426","omph.approval.allowOnce":"\u4ECA\u56DE\u306E\u307F\u8A31\u53EF","omph.approval.confirm":"\u7D9A\u884C","omph.approval.other":"\u305D\u306E\u4ED6","omph.approval.otherPlaceholder":"\u5B9F\u884C\u3059\u308B\u64CD\u4F5C\u3092\u5165\u529B","omph.approval.escalation":"\u30C4\u30FC\u30EB {toolName} \u304C\u7279\u6A29\u5B9F\u884C\u3092\u8981\u6C42\u3057\u3066\u3044\u307E\u3059","omph.input.placeholder":"\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u5165\u529B\u2026","omph.input.upload":"\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9","omph.input.send":"\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u9001\u4FE1","omph.input.stop":"\u751F\u6210\u3092\u505C\u6B62","omph.input.message":"\u30E1\u30C3\u30BB\u30FC\u30B8\u5165\u529B","omph.input.tools":"\u5165\u529B\u30C4\u30FC\u30EB","agentui.html.defaultTitle":"\u30A4\u30F3\u30BF\u30E9\u30AF\u30C6\u30A3\u30D6 HTML","agentui.html.open":"\u958B\u304F","agentui.html.preview":"\u30D7\u30EC\u30D3\u30E5\u30FC","agentui.html.code":"\u30B3\u30FC\u30C9","agentui.html.toggle":"\u30B3\u30FC\u30C9\u3068\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u5207\u308A\u66FF\u3048\u308B","agentui.html.copy":"\u30B3\u30FC\u30C9\u3092\u30B3\u30D4\u30FC","agentui.html.copied":"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F","agentui.html.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","agentui.html.close":"\u9589\u3058\u308B"},jh={"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.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.searchOpenPanel":"\uB300\uD654 \uC5F4\uAE30","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","omph.status.idle":"\uB300\uAE30","omph.status.pending":"\uB300\uAE30 \uC911","omph.status.running":"\uCC98\uB9AC \uC911","omph.status.success":"\uC644\uB8CC","omph.status.error":"\uC624\uB958","omph.working":"\uCC98\uB9AC \uC911","omph.workingFor":"\uCC98\uB9AC \uC911 {duration} \uACBD\uACFC","omph.loadOlder":"\uC774\uC804 \uBA54\uC2DC\uC9C0 \uBD88\uB7EC\uC624\uAE30","omph.loadingOlder":"\uBD88\uB7EC\uC624\uB294 \uC911\u2026","omph.toBottom":"\uB9E8 \uC544\uB798\uB85C","omph.copy":"\uBCF5\uC0AC","omph.copied":"\uBCF5\uC0AC\uB428","omph.turnActions":"\uC751\uB2F5 \uC791\uC5C5","omph.usage":"\uC0AC\uC6A9\uB7C9","omph.inputTokens":"\uC785\uB825","omph.outputTokens":"\uCD9C\uB825","omph.duration":"\uC18C\uC694 \uC2DC\uAC04","omph.send":"\uBCF4\uB0B4\uAE30","omph.stop":"\uC911\uC9C0","omph.turnRail":"\uD134","omph.secondUnit":"\uCD08","omph.minuteUnit":"\uBD84","omph.preview.title":"\uD30C\uC77C \uBBF8\uB9AC\uBCF4\uAE30","omph.preview.close":"\uBBF8\uB9AC\uBCF4\uAE30 \uB2EB\uAE30","omph.preview.back":"\uB300\uD654\uB85C \uB3CC\uC544\uAC00\uAE30","omph.preview.expand":"\uBBF8\uB9AC\uBCF4\uAE30 \uD655\uB300","omph.preview.collapse":"\uBBF8\uB9AC\uBCF4\uAE30 \uD06C\uAE30 \uBCF5\uC6D0","omph.preview.copyContent":"\uB0B4\uC6A9 \uBCF5\uC0AC","omph.preview.copyPath":"\uACBD\uB85C \uBCF5\uC0AC","omph.preview.download":"\uB2E4\uC6B4\uB85C\uB4DC","omph.preview.openExternal":"\uC678\uBD80\uC5D0\uC11C \uC5F4\uAE30","omph.preview.wrap":"\uC904 \uBC14\uAFC8","omph.preview.loading":"\uD30C\uC77C \uB85C\uB4DC \uC911","omph.preview.missing":"\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C","omph.preview.failed":"\uC774 \uD30C\uC77C\uC744 \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.unsupported":"\uC774 \uD30C\uC77C \uD615\uC2DD\uC740 \uBBF8\uB9AC\uBCFC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.retry":"\uB2E4\uC2DC \uC2DC\uB3C4","omph.preview.resize":"\uBBF8\uB9AC\uBCF4\uAE30 \uD06C\uAE30 \uC870\uC815","omph.preview.line":"{start}\uC904","omph.preview.lines":"{start}\u2013{end}\uC904","omph.preview.truncated":"\uC804\uCCB4 {total}\uC904 \uC911 \uCC98\uC74C {shown}\uC904 \uD45C\uC2DC","omph.preview.imageFailed":"\uC774\uBBF8\uC9C0\uB97C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.zoomIn":"\uD655\uB300","omph.preview.zoomOut":"\uCD95\uC18C","omph.preview.zoomFit":"\uB108\uBE44\uC5D0 \uB9DE\uCD94\uAE30","omph.newConversation":"\uC0C8 \uB300\uD654","omph.conversationList":"\uB300\uD654 \uBAA9\uB85D","omph.conversations":"\uB300\uD654","omph.noConversations":"\uC544\uC9C1 \uB300\uD654\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","omph.approval.waiting":"\uC2B9\uC778 \uB300\uAE30 \uC911","omph.approval.choose":"\uC791\uC5C5\uC744 \uC120\uD0DD\uD558\uC138\uC694","omph.approval.details":"\uC2B9\uC778 \uC138\uBD80 \uC815\uBCF4","omph.approval.choices":"\uC791\uC5C5","omph.approval.reject":"\uAC70\uBD80","omph.approval.allowOnce":"\uD55C \uBC88\uB9CC \uD5C8\uC6A9","omph.approval.confirm":"\uACC4\uC18D","omph.approval.other":"\uAE30\uD0C0","omph.approval.otherPlaceholder":"\uC218\uD589\uD560 \uC791\uC5C5\uC744 \uC124\uBA85\uD558\uC138\uC694","omph.approval.escalation":"\uB3C4\uAD6C {toolName}\uC774(\uAC00) \uAD8C\uD55C \uC788\uB294 \uC2E4\uD589\uC744 \uC694\uCCAD\uD569\uB2C8\uB2E4","omph.input.placeholder":"\uBA54\uC2DC\uC9C0 \uC785\uB825\u2026","omph.input.upload":"\uD30C\uC77C \uC5C5\uB85C\uB4DC","omph.input.send":"\uBA54\uC2DC\uC9C0 \uBCF4\uB0B4\uAE30","omph.input.stop":"\uC0DD\uC131 \uC911\uC9C0","omph.input.message":"\uBA54\uC2DC\uC9C0 \uC785\uB825","omph.input.tools":"\uC785\uB825 \uB3C4\uAD6C","agentui.html.defaultTitle":"\uC778\uD130\uB799\uD2F0\uBE0C HTML","agentui.html.open":"\uC5F4\uAE30","agentui.html.preview":"\uBBF8\uB9AC \uBCF4\uAE30","agentui.html.code":"\uCF54\uB4DC","agentui.html.toggle":"\uCF54\uB4DC\uC640 \uBBF8\uB9AC \uBCF4\uAE30 \uC804\uD658","agentui.html.copy":"\uCF54\uB4DC \uBCF5\uC0AC","agentui.html.copied":"\uBCF5\uC0AC\uB428","agentui.html.download":"\uB2E4\uC6B4\uB85C\uB4DC","agentui.html.close":"\uB2EB\uAE30"},Gn={en:qh,zh:Xh,fr:Zh,de:Yh,ja:Qh,ko:jh};var od=(t,o)=>o?t.replace(/\{(\w+)\}/g,(r,n)=>{let a=o[n];return a==null?"":String(a)}):t,of={locale:"en",t:(t,o)=>od(Gn.en[t]||t,o)},rd=createContext(of),_a=({locale:t="en",messages:o,children:r})=>{let n=useMemo(()=>{let a=Gn[t]||Gn.en,i=o?.[t]||{},s={...Gn.en,...a,...i};return {locale:t,t:(l,d)=>od(s[l]||l,d)}},[t,o]);return f(rd.Provider,{value:n,children:r})},se=()=>useContext(rd);function Un({items:t,onItemClick:o,className:r="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:l=false,pinnedIds:d,onTogglePin:u}){let{t:m}=se(),h=s==="dark",f$1=usePathname(),[p,v]=useState(false),[C,g$1]=useState(new Set),x=a!==void 0&&i!==void 0,b=x?a:C;useEffect(()=>{v(true);},[]);let y=S=>{if(x)i(S);else {let P=new Set(C);P.has(S)?P.delete(S):P.add(S),g$1(P);}},k=S=>{S.children&&S.children.length>0&&y(S.id),o&&o(S);};return !t||!Array.isArray(t)?f("div",{className:fo("tree-menu",r),children:f("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:m("navigation.noItems")})}):f("div",{className:fo("tree-menu",r),children:t.map(S=>{let P=b.has(S.id)||S.isExpanded,I=S.children&&S.children.length>0,M=56+Math.max(0,n-1)*8,N=n===0?12:I?M-24:M,T=S.appurl||S.href,R=p&&T?f$1===T:false,A=d?.has(S.id)??false,L=l&&S.pinnable!==false&&!!T&&!I;return g("div",{className:"tree-menu-item relative",children:[R&&f("div",{className:fo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),g(_s,{variant:"ghost",className:fo("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",I&&P&&!R?h?"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",R?h?"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)]":h?"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:`${N}px`,paddingRight:L?"34px":"10px"},onClick:()=>k(S),children:[I&&f("div",{className:fo("flex-shrink-0 transition-transform duration-200",P&&"rotate-90",R?"text-[var(--orb-nav-active-fg)]":h?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:f(Bo,{className:"h-4 w-4"})}),S.icon&&f("div",{className:fo("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",R?"text-[var(--orb-nav-active-fg)]":h?"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:fo("text-sm truncate transition-colors duration-200",R?"font-semibold":"font-medium"),children:S.title||S.label}),S.description&&f("div",{className:fo("text-xs truncate transition-colors duration-200",R?h?"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&&u&&f("button",{type:"button","aria-label":m(A?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":A,title:m(A?"navigation.pin.remove":"navigation.pin.add"),onClick:$=>{$.preventDefault(),$.stopPropagation(),u(S);},className:fo("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",A&&"orb-is-pinned"),children:f(Qr,{className:fo("h-3.5 w-3.5",A&&"fill-current")})}),I&&f("div",{className:fo("grid transition-[grid-template-rows] duration-300 ease-in-out",P?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:f("div",{className:fo("overflow-hidden",P&&"pt-1"),children:f(Un,{items:S.children,onItemClick:o,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:u})})})]},S.id)})})}var sf="orbcafe:navigation-island:pinned-items",Gs="orbcafe-navigation-pinned",lf=t=>t.appurl||t.href,ad=t=>{let o=[];return t.forEach(r=>{let n=!!r.children?.length;r.pinnable!==false&&lf(r)&&!n&&o.push({...r,children:void 0}),r.children?.length&&o.push(...ad(r.children));}),o},id=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:u=true,pinStorageKey:m=sf,pinnedItemIds:h,defaultPinnedItemIds:f$1=[],onPinnedItemIdsChange:p,pinnedSectionTitle:v})=>{let{t:C}=se(),g$1=i==="dark",x=s==="floating",b=useRouter(),[y,k]=useState(""),[S,P]=useState(new Set),[I,w]=useState(f$1),[M,N]=useState(false),T=h!==void 0,R=useMemo(()=>h??I,[h,I]),A=useMemo(()=>new Set(R),[R]);useEffect(()=>{t&&P(new Set);},[t]),useEffect(()=>{if(!u||T){N(true);return}try{let B=window.localStorage.getItem(m);if(B){let G=JSON.parse(B);Array.isArray(G)&&w(G.filter(X=>typeof X=="string"));}}catch{}finally{N(true);}},[u,T,m]),useEffect(()=>{if(!(!u||T||!M))try{window.localStorage.setItem(m,JSON.stringify(R));}catch{}},[R,u,T,m,M]),useEffect(()=>{!u||t||R.length===0||P(B=>{if(B.has(Gs))return B;let G=new Set(B);return G.add(Gs),G});},[t,R.length,u]);let L=useCallback(B=>{let G=Array.from(new Set(B));T||w(G),p?.(G);},[T,p]),$=useCallback(B=>{let G=B.id,X=A.has(G)?R.filter(pe=>pe!==G):[...R,G];L(X);},[R,A,L]),j=useMemo(()=>{if(!u||R.length===0)return a;let B=new Map(ad(a).map(X=>[X.id,X])),G=R.map(X=>B.get(X)).filter(X=>!!X);return G.length===0?a:[{id:Gs,title:v||C("navigation.pinned"),icon:f(Qr,{className:"w-4 h-4"}),children:G,pinnable:false},...a]},[R,u,a,v,C]),O=useCallback(B=>{let G=[],X=pe=>{pe.forEach(oe=>{G.push(oe.id),oe.children&&X(oe.children);});};return X(B),G},[]),z=useMemo(()=>{if(!y.trim())return j;let B=G=>G.reduce((X,pe)=>{let oe=pe.title?.toLowerCase().includes(y.toLowerCase())||pe.description?.toLowerCase().includes(y.toLowerCase()),me=pe.children?B(pe.children):[];return (oe||me.length>0)&&X.push({...pe,children:me.length>0?me:pe.children}),X},[]);return B(j)},[y,j]),H=useMemo(()=>y.trim()?new Set(O(j)):S,[y,j,S,O]),q=useCallback(async B=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",B),B.id==="chat"||B.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(X){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",X),b.push("/chat");}return}let G=B.appurl||B.href;G&&(G.startsWith("http://")||G.startsWith("https://")?window.open(G,"_blank"):b.push(G));},[b]),V=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 ${r} ${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: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:C("navigation.expand"),children:f(Ho,{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:C("navigation.searchPlaceholder"),value:y,onChange:B=>k(B.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(Ho,{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:z.length===0?f("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?f(On,{className:"h-5 w-5"}):C(y?"navigation.noMatch":"navigation.noAccessibleApp")}):g(e,{children:[!t&&f("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:f(Un,{items:z,onItemClick:q,className:"space-y-1",expandedIds:H,colorMode:i,enablePinning:u,pinnedIds:A,onTogglePin:$,onToggleExpand:B=>{let G=new Set(S);z.some(pe=>pe.id===B)?G.has(B)?G.delete(B):(z.forEach(pe=>{pe.id!==B&&G.has(pe.id)&&G.delete(pe.id);}),G.add(B)):G.has(B)?G.delete(B):G.add(B),P(G);}})}),t&&f("div",{className:"space-y-2",children:j.map(B=>f("div",{className:"space-y-1",children:f("button",{onClick:()=>{o();let G=new Set([B.id]);P(G);},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:C("navigation.expandView",{title:B.title||""}),children:B.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:B.title?.charAt(0)||"?"})})},B.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:C("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:V,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:C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(La,{className:"h-4 w-4"}):f(Oa,{className:"h-4 w-4"})})]})};var df="orbcafe:navigation-island:pinned-items",Us="orbcafe-navigation-pinned",sd=t=>t.appurl||t.href,ld=t=>t.flatMap(o=>{let r=!!o.children?.length,n=o.pinnable!==false&&sd(o)&&!r?[{...o,children:void 0}]:[];return o.children?.length?[...n,...ld(o.children)]:n}),cd=t=>t.flatMap(o=>[o.id,...o.children?cd(o.children):[]]),dd=(t,o)=>t.reduce((r,n)=>{let a=n.children?dd(n.children,o):[];return ([n.title,n.label,n.description].some(s=>s?.toLocaleLowerCase().includes(o))||a.length>0)&&r.push({...n,children:a.length>0?a:n.children}),r},[]),Ks=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:u=true,pinStorageKey:m=df,pinnedItemIds:h,defaultPinnedItemIds:f$1=[],onPinnedItemIdsChange:p,pinnedSectionTitle:v})=>{let{t:C}=se(),g$1=useRouter(),x=s==="floating",[b,y]=useState(""),[k,S]=useState(new Set),[P,I]=useState(f$1),[w,M]=useState(false),N=h!==void 0,T=h??P,R=useMemo(()=>new Set(T),[T]);useEffect(()=>{t&&S(new Set);},[t]),useEffect(()=>{if(!u||N){M(true);return}try{let B=window.localStorage.getItem(m);if(B){let G=JSON.parse(B);Array.isArray(G)&&I(G.filter(X=>typeof X=="string"));}}catch{}finally{M(true);}},[u,N,m]),useEffect(()=>{if(!(!u||N||!w))try{window.localStorage.setItem(m,JSON.stringify(T));}catch{}},[T,u,N,m,w]),useEffect(()=>{!u||t||T.length===0||S(B=>{if(B.has(Us))return B;let G=new Set(B);return G.add(Us),G});},[t,T.length,u]);let A=useCallback(B=>{let G=Array.from(new Set(B));N||I(G),p?.(G);},[N,p]),L=useCallback(B=>{A(R.has(B.id)?T.filter(G=>G!==B.id):[...T,B.id]);},[T,R,A]),$=useMemo(()=>{if(!u||T.length===0)return a;let B=new Map(ld(a).map(X=>[X.id,X])),G=T.map(X=>B.get(X)).filter(X=>!!X);return G.length===0?a:[{id:Us,title:v||C("navigation.pinned"),icon:f(Qr,{className:"h-4 w-4"}),children:G,pinnable:false},...a]},[T,u,a,v,C]),j=b.trim().toLocaleLowerCase(),O=useMemo(()=>j?dd($,j):$,[$,j]),z=useMemo(()=>j?new Set(cd(O)):k,[k,O,j]),H=useCallback(B=>{S(G=>{let X=new Set(G),pe=O.some(oe=>oe.id===B);return X.has(B)?X.delete(B):(pe&&O.forEach(oe=>X.delete(oe.id)),X.add(B)),X});},[O]),q=useCallback(B=>{let G=sd(B);G&&(B.id==="chat"||B.appurl==="/chat"?g$1.push("/chat?new=true"):/^https?:\/\//.test(G)?window.open(G,"_blank","noopener,noreferrer"):g$1.push(G));},[g$1]),V=B=>{o(),S(new Set([B.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: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: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:C("navigation.expand"),"aria-label":C("navigation.expand"),children:f(Ho,{className:"h-5 w-5"})}):g("label",{className:"relative block",children:[f("span",{className:"orb-visually-hidden",children:C("navigation.searchPlaceholder")}),f(Ho,{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:B=>y(B.target.value),placeholder:C("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:O.length===0?f("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?f(On,{className:"h-5 w-5"}):C(j?"navigation.noMatch":"navigation.noAccessibleApp")}):t?f("div",{className:"space-y-1",children:$.map(B=>f("button",{type:"button",onClick:()=>V(B),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:C("navigation.expandView",{title:B.title||B.label||""}),children:B.icon||f(On,{className:"h-5 w-5"})},B.id))}):f(Un,{items:O,onItemClick:q,className:"space-y-1",expandedIds:z,onToggleExpand:H,colorMode:i,enablePinning:u,pinnedIds:R,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:C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(La,{className:"h-4 w-4"}):f(Oa,{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:C("navigation.collapse"),"aria-label":C("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}})})})]})};Ks.displayName="NavigationIsland2";var ud=(t={})=>{let{initialCollapsed:o=false,initialDisplayMode:r="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:u}=t,[m,h]=useState(o),[f,p]=useState(r),[v,C]=useState(n),g=useCallback(()=>{h(y=>!y);},[]),x=useCallback(()=>{p(y=>y==="fixed"?"floating":"fixed");},[]),b=useMemo(()=>({collapsed:m,onToggle:g,menuData:v,displayMode:f,onDisplayModeChange:p,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:u}),[m,g,v,f,p,a,i,s,l,d,u]);return {collapsed:m,setCollapsed:h,toggleCollapsed:g,displayMode:f,setDisplayMode:p,toggleDisplayMode:x,menuData:v,setMenuData:C,navigationIslandProps:b}};var Xs=class{constructor(){a(this,"listener",null);}register(o){this.listener=o;}unregister(){this.listener=null;}show(o,r,n){this.listener&&this.listener({type:o,content:r,options:n});}hide(){this.listener&&this.listener(null);}},ir=new Xs,_P={success:(t,o)=>ir.show("success",t,o),error:(t,o)=>ir.show("error",t,o),warning:(t,o)=>ir.show("warning",t,o),info:(t,o)=>ir.show("info",t,o),show:(t,o,r)=>ir.show(t,o,r),hide:()=>ir.hide()};var uf={success:{icon:f(Ln,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:f(Ba,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:f(Ia,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:f(Da,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},Xn=({open:t,title:o,message:r,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:l=true,maxWidth:d="xs",type:u="default"})=>{let{t:m}=se(),h=i||m("messageBox.confirm"),f$1=s||m("messageBox.cancel"),p=()=>{a?a():n();},v=uf[u],C=u!=="default";return g(Et,{open:t,onClose:n,maxWidth:d,sx:C?{borderTop:`6px solid ${v.iconColor}`}:void 0,children:[C&&f("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:v.iconColor},children:v.icon}),o&&f("div",{className:"orb-dialog-title",style:{textAlign:C?"center":"left",paddingTop:C?8:16},children:o}),f("div",{className:"orb-dialog-content",style:{textAlign:C?"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:C?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[l&&f(Se,{onClick:n,variant:"text",children:f$1}),f(Se,{onClick:p,variant:"contained",color:C&&u==="error"?"error":"primary",autoFocus:true,children:h})]})]})},QP=()=>{let[t,o]=jt__default.useState(null),[r,n]=jt__default.useState(false);jt__default.useEffect(()=>{let s=l=>{l?(o(l),n(true)):(n(false),o(null));};return ir.register(s),()=>ir.unregister()},[]);let a=()=>{n(false),t?.options?.onClose&&t.options.onClose(),o(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),n(false),o(null);};return t?f(Xn,{open:r,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 oT=({status:t,showIcon:o=true})=>{let r="gray",n,a=t;return t==="OK"?(r="blue",n=f(Ln,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(r="orange",n=f(Ia,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(r="orange",n=f(Ba,{size:14,strokeWidth:2}),a="Warning"),f(Ct,{label:a,tone:r,icon:o&&n?n:void 0})};var aT=({dense:t,sx:o,className:r,children:n,...a})=>f("ul",{...a,className:r,style:{listStyle:"none",margin:0,padding:0,...o},children:n}),iT=({button:t,divider:o,sx:r,className:n,children:a,...i})=>f("li",{...i,className:n,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:a}),sT=({sx:t,className:o,children:r,...n})=>f("button",{...n,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}),lT=({children:t,sx:o})=>f("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...o},children:t}),cT=({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})]}),dT=({sx:t,className:o,children:r,...n})=>f("li",{...n,className:o,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:r}),pT=({children:t,sx:o})=>f("div",{style:{marginRight:12,display:"flex",alignItems:"center",...o},children:t});var gT=({xs:t,md:o,lg:r,sx:n,children:a,className:i,...s})=>{let l=r?`span ${r}`:o?`span ${o}`:t?`span ${t}`:"span 12";return f("div",{...s,className:i,style:{gridColumn:l,minWidth:0,...n},children:a})};var Ao=tt,no=(t,o)=>forwardRef(({component:r,sx:n,className:a,style:i,children:s,...l},d$1)=>{let u=r??t,m=d(n,[o,a].filter(Boolean).join(" "),i);return f(u,{ref:d$1,className:m.className,style:m.style,...l,children:s})}),Ie=no("div"),gd=no("a","orb-link"),Or=Ne,hd=ie,bo=E;var fd=ae;var bd=Rt,Qo=tn,Qa=en,ja=Va;var Ja=za,vd=Xo,yd=({value:t,variant:o,color:r,sx:n})=>f(zn,{value:o==="determinate"?t:void 0,color:r,sx:n}),Cd=no("table","orb-tbl"),xd=no("tbody"),Qs=no("td"),wd=no("div","orb-table-container"),Sd=no("thead"),js=no("tr");no("tfoot");no("div","orb-dialog-title");no("div","orb-dialog-content");no("div","orb-dialog-actions");no("p","orb-body-dense");var sr=no("span","orb-input-adornment"),kd=forwardRef(({sx:t,fullWidth:o,className:r,style:n,...a},i)=>{let s=d(t,["orb-input-base",r].filter(Boolean).join(" "),n);return f("input",{ref:i,className:s.className,style:{width:o?"100%":void 0,...s.style},...a})});var vr=no("div","orb-form-control"),Zn=({control:t,label:o,...r})=>g("label",{className:"orb-form-control-label",...r,children:[t,f("span",{children:o})]}),vf=({primary:t,secondary:o,children:r,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>g("span",{className:"orb-list-item-text",...i,children:[t??r,o?f("small",{children:o}):null]}),yf=no("span","orb-list-item-icon"),$t=vf,zo=yf;no("div","orb-list-subheader");var Js=({container:t,item:o,spacing:r,xs:n,sm:a,md:i,lg:s,xl:l,sx:d,...u})=>{let m={},h=f=>typeof f=="number"?`${f/12*100}%`:f?"100%":void 0;return n!==void 0&&(m.xs=h(n)),a!==void 0&&(m.sm=h(a)),i!==void 0&&(m.md=h(i)),s!==void 0&&(m.lg=h(s)),l!==void 0&&(m.xl=h(l)),f(Ie,{...u,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&r?r:void 0,width:o?m:void 0,...d??{}}})},on=({in:t,children:o,unmountOnExit:r,...n})=>!t&&r?null:f("div",{hidden:!t,...n,children:o}),Pd=({children:t,container:o})=>typeof document>"u"?null:createPortal(t,o??document.body),Td=no("div","orb-toolbar"),Id=({active:t,direction:o="asc",children:r,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":o,...s,children:[f("span",{className:"orb-table-sort-content",children:r}),f(Pt,{className:"orb-table-sort-icon",name:o==="desc"?"down":"up",size:11})]})},ei=({open:t,anchorEl:o,onClose:r,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:l,sx:d$1,className:u,style:m,...h})=>{let f$1=useRef(null);if(useEffect(()=>{if(!t)return;let x=y=>{let k=y.composedPath();f$1.current&&k.includes(f$1.current)||o&&k.includes(o)||r?.();},b=y=>{y.key==="Escape"&&r?.();};return document.addEventListener("pointerdown",x,true),document.addEventListener("keydown",b,true),()=>{document.removeEventListener("pointerdown",x,true),document.removeEventListener("keydown",b,true);}},[o,r,t]),!t||typeof document>"u")return null;let p=o?.getBoundingClientRect(),v=s?.paper??l,C=[...Array.isArray(v?.sx)?v.sx:v?.sx?[v.sx]:[],...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],g=d(C,["orb-pop",v?.className,u].filter(Boolean).join(" "),{...v?.style,...m});return createPortal(f("div",{...h,ref:f$1,className:g.className,style:{position:"fixed",left:p?.left??16,top:(p?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},Md=({open:t,onClose:o,anchor:r="left",children:n,PaperProps:a})=>{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(a?.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:n})]}),document.body)},Rd=({value:t,onChange:o,children:r,variant:n,scrollButtons:a,...i})=>f("div",{role:"tablist",className:"orb-tabs",...i,children:Children.map(r,s=>isValidElement(s)?cloneElement(s,{selected:s.props.value===t,onSelect:l=>o?.(null,l)}):s)}),Dd=({value:t,label:o,children:r,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:o??r});var ao=()=>c(),yr=(t,o)=>Ro(t);var Nd=({day:t,onDaySelect:o,selected:r,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...l})=>{let d$1=d(i,`orb-cal-day ${r?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return f("button",{type:"button",className:d$1.className,style:d$1.style,onClick:()=>o?.(t),...l,children:t.date()})},Ad=({value:t,referenceDate:o,onChange:r,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>f($n,{value:t,month:o,onChange:u=>r?.(u),onMonthChange:u=>{n?.(u),a?.(u);},minDate:i,maxDate:s,renderDay:l?.day?(u,m)=>l.day?.({day:u,selected:m.selected,outsideCurrentMonth:m.outsideCurrentMonth,onDaySelect:h=>r?.(h)}):void 0,...d}),Ed=({children:t})=>f(e,{children:t}),Ya=class{};var Cf=(t,o)=>o!==void 0?o:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,we=t=>({fontSize:r,size:n,sx:a,className:i,style:s,titleAccess:l,...d$1})=>{let u=d(a,i,s);return f(Pt,{name:t,size:Cf(r,n),className:u.className,style:u.style,"aria-label":d$1["aria-label"]??l,...d$1})},Cr=we("tree"),Fr=we("add"),Ld=we("duplicate"),el=we("down"),Od=we("navigationRight"),Fd=we("navigationRight"),tl=we("up"),Bd=we("delete"),Hd=we("camera"),zd=we("accept"),Vd=we("accept"),ti=we("navigationRight"),Wd=we("dimension"),$d=we("decline"),xr=we("decline"),_d=we("decline"),Gd=we("decline"),oi=we("delete"),ri=we("delete"),Ud=we("download"),Kd=we("move"),qd=we("edit"),rn=we("slimDown"),Xd=we("filter"),nn=we("sum"),Zd=we("lineChart"),Yd=we("document"),Vo=we("slimDown"),Qd=we("navigationLeft"),wr=we("navigationRight"),ni=we("slimUp"),ai=we("navigationLeft"),ii=we("navigationRight"),jd=we("dimension"),Jd=we("splitOne"),si=we("menu"),ep=we("microphone"),tp=we("microphone"),op=we("microphone"),rp=we("qrCode"),Sr=we("save"),Br=we("search"),np=we("search"),ap=we("paperPlane"),ip=we("paperPlane"),sp=we("wrench"),lp=we("sort"),li=we("splitTwo"),cp=we("favorite"),dp=we("favorite"),pp=we("stop"),up=we("tableRow"),ci=we("collapseAll"),di=we("expandAll"),an=we("tableColumn"),mp=we("overview"),gp=we("hide");var wf=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],fp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],So=t=>String(t),bp=(t,o)=>t[o],vp=t=>{let o=t.value??t.id??t.key??t.code;return typeof o=="number"||typeof o=="string"?o:""},Sf=t=>{let o=t.label??t.description??t.name??t.title;return String(typeof o=="number"||typeof o=="string"?o:vp(t))},kf=t=>{let o=t.description??t.subtitle;return typeof o=="number"||typeof o=="string"?String(o):void 0},yp=({value:t=null,items:o=[],columns:r,mode:n="single",dialogTitle:a="Value Help",searchPlaceholder:i="Search values...",selectLabel:s="Select",clearLabel:l="Clear",cancelLabel:d="Cancel",valueHelpLabel:u="Open value help",noResultsText:m="No matching values",loading:h=false,clearable:f$1=true,allowManualInput:p=true,validateManualInput:v=true,manualInputErrorText:C="Enter a valid value.",selectedItems:g$1=[],displayValue:x,getOptionValue:b=vp,getOptionLabel:y=Sf,getOptionDescription:k=kf,onChange:S,onSearch:P,disabled:I,InputProps:w,onFocus:M,onBlur:N,onKeyDown:T,error:R,helperText:A,...L})=>{let $=mo(),j=n==="multiple",[O,z]=useState(false),[H,q]=useState(false),[V,B]=useState(""),[G,X]=useState(null),[pe,oe]=useState(false),[me,xe]=useState(()=>fp(t)),[ze,Pe]=useState(""),[Te,Be]=useState(""),le=useMemo(()=>r&&r.length>0?r:wf,[r]),fe=G??o,Ve=useMemo(()=>{let ee=[...g$1,...o,...G??[]],be=new Map;return ee.forEach(De=>{be.set(So(b(De)),De);}),be},[b,o,G,g$1]),et=useMemo(()=>fp(t),[t]),rt=useMemo(()=>et.map(String).join(", "),[et]);useEffect(()=>{O||xe(et);},[O,et]),useEffect(()=>{!H&&!Te&&Pe(rt);},[H,rt,Te]);let at=useMemo(()=>{let ee=V.trim().toLowerCase();if(!ee||P)return fe;let be=le.filter(De=>De.searchable!==false);return fe.filter(De=>[b(De),y(De),k(De),...be.map(it=>bp(De,it.field))].some(it=>String(it??"").toLowerCase().includes(ee)))},[fe,k,y,b,P,V,le]),K=useMemo(()=>{if(x!==void 0)return x;if(et.length===0)return "";let ee=be=>{let De=Ve.get(So(be));if(!De)return String(be);let je=y(De);return je&&je!==String(be)?`${be} - ${je}`:String(be)};return j?et.length>2?`${et.length} selected`:et.map(ee).join(", "):ee(et[0])},[x,y,j,Ve,et]),Re=useCallback(async()=>{if(P){oe(true);try{let ee=await P(V);Array.isArray(ee)&&X(ee);}finally{oe(false);}}},[P,V]),ye=()=>{I||(xe(et),z(true));},Oe=()=>{z(false);},nt=()=>{S?.(j?[]:null,j?[]:null),xe([]),Pe(""),Be("");},Ze=ee=>{let be=b(ee);if(j){xe(De=>De.some(it=>So(it)===So(be))?De.filter(it=>So(it)!==So(be)):[...De,be]);return}xe([be]);},xt=()=>{let ee=me.map(be=>Ve.get(So(be))).filter(be=>!!be);j?S?.(me,ee):S?.(me[0]??null,ee[0]??null),Be(""),z(false);},It=ee=>{if(ee.key==="F4"){ee.preventDefault(),ye();return}if(ee.key==="Enter"&&p&&!Nt(ze,true)){ee.preventDefault();return}T?.(ee);},Lt=ee=>v?ee.every(be=>Ve.has(So(be))):true,Nt=(ee,be)=>{if(j){let je=ee.split(/[,;\n]/).map(dt=>dt.trim()).filter(Boolean);if(je.length===0)return Be(""),S?.([],[]),true;if(!Lt(je))return be&&Be(C),false;Be("");let it=je.map(dt=>Ve.get(So(dt))).filter(dt=>!!dt);return S?.(je,it),true}let De=ee.trim();return De?Lt([De])?(Be(""),S?.(De,Ve.get(So(De))??null),true):(be&&Be(C),false):(Be(""),S?.(null,null),true)},te=ee=>{if(!p)return;let be=ee.target.value;Pe(be),Be(""),Nt(be,false);},Ge=h||pe,Le=et.length>0,ve=p&&(H||!!Te)?ze:K;return g(e,{children:[f(He,{...L,className:["orb-value-help-field",f$1&&Le&&!I?"orb-value-help-has-clear":"",L.className??""].filter(Boolean).join(" "),disabled:I,value:ve,error:!!Te||R,helperText:Te||A,onChange:te,onFocus:ee=>{q(true),Pe(rt),M?.(ee);},onBlur:ee=>{p&&Nt(ze,true),q(false),N?.(ee);},onKeyDown:It,InputProps:{...w,readOnly:!p,endAdornment:g("span",{className:"orb-value-help-actions",children:[Ge?f(Xo,{size:18}):null,f$1&&Le&&!I?f(ae,{className:"orb-value-help-clear-trigger",size:"small",tooltip:l,"aria-label":l,onMouseDown:ee=>ee.preventDefault(),onClick:ee=>{ee.stopPropagation(),nt();},children:f(Pt,{name:"decline",size:14})}):null,f(ae,{className:"orb-value-help-search-trigger",size:"small",tooltip:u,"aria-label":u,onMouseDown:ee=>ee.preventDefault(),onClick:ee=>{ee.stopPropagation(),ye();},disabled:I,children:f(Pt,{name:"search",size:16})})]})}}),g(Et,{open:O,onClose:Oe,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:ee=>({borderRadius:2,overflow:"hidden",border:`1px solid ${ee.palette.divider}`,boxShadow:$==="dark"?`0 24px 80px ${tt(ee.palette.common.black,.72)}`:`0 24px 80px ${tt(ee.palette.common.black,.18)}`})},children:[g("div",{className:"orb-dialog-title",sx:ee=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${ee.palette.divider}`,bgcolor:ee.palette.background.paper}),children:[g("div",{children:[f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),j?f(E,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${me.length} selected`}):null]}),f(ae,{"aria-label":"Close",onClick:Oe,size:"small",children:f(xr,{fontSize:"small"})})]}),g("div",{className:"orb-dialog-content",sx:{p:0},children:[g(ie,{direction:{xs:"column",sm:"row"},spacing:1,sx:ee=>({px:2.5,py:1.5,borderBottom:`1px solid ${ee.palette.divider}`,bgcolor:$==="dark"?tt(ee.palette.common.white,.025):tt(ee.palette.primary.main,.035)}),children:[f(He,{size:"small",fullWidth:true,autoFocus:true,value:V,placeholder:i,onChange:ee=>B(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"&&(ee.preventDefault(),Re());},InputProps:{startAdornment:f(sr,{position:"start",children:f(Pt,{name:"search",size:16})}),sx:ee=>({borderRadius:1,bgcolor:ee.palette.background.paper,"& fieldset":{borderColor:tt(ee.palette.text.primary,$==="dark"?.2:.16)},"&:hover fieldset":{borderColor:tt(ee.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:ee.palette.primary.main}})}}),P?f(Se,{variant:"outlined",onClick:()=>{Re();},disabled:Ge,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:Ge?f(Xo,{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:ee=>({bgcolor:$==="dark"?"var(--orb-canvas)":ee.palette.background.paper,borderBottom:`1px solid ${ee.palette.divider}`})}),le.map(ee=>f("td",{align:ee.align==="inherit"?void 0:ee.align,sx:be=>({minWidth:ee.minWidth,width:ee.width,fontSize:"0.78rem",fontWeight:800,bgcolor:$==="dark"?"var(--orb-canvas)":be.palette.background.paper,borderBottom:`1px solid ${be.palette.divider}`}),children:ee.label},String(ee.field)))]})}),g("tbody",{children:[at.map(ee=>{let be=b(ee),De=me.some(je=>So(je)===So(be));return g("tr",{hover:true,selected:De,onClick:()=>Ze(ee),onDoubleClick:()=>{j||(xe([be]),S?.(be,ee),z(false));},sx:je=>({cursor:"pointer","&.orb-selected":{bgcolor:tt(je.palette.primary.main,$==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:tt(je.palette.primary.main,$==="dark"?.28:.18)}}),children:[f("td",{padding:"checkbox",children:f(Tt,{size:"small",checked:De})}),le.map(je=>{let it=bp(ee,je.field);return f("td",{align:je.align==="inherit"?void 0:je.align,sx:{fontSize:"0.82rem",py:1},children:je.render?je.render(it,ee):String(it??"")},String(je.field))})]},So(be))}),at.length===0?f("tr",{children:f("td",{colSpan:le.length+1,children:f("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:m})})}):null]})]})})]}),g("div",{className:"orb-dialog-actions",sx:ee=>({px:2.5,py:1.5,borderTop:`1px solid ${ee.palette.divider}`,bgcolor:ee.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[f$1&&(Le||me.length>0)?f(Se,{onClick:nt,children:l}):null,f("div",{sx:{flex:1}}),f(Se,{onClick:Oe,children:d}),f(Se,{variant:"contained",onClick:xt,disabled:!j&&me.length===0,children:s})]})]})]})};var pi=({title:t,hideHeader:o,children:r})=>g("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!o&&f("div",{sx:{mb:2},children:f(E,{variant:"h4",children:t})}),f("div",{sx:{flex:1,overflow:"hidden"},children:r})]});var ol={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"},rl={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"},Yn={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Qn={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Cp={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},co={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 Pf={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"}},ui=({rowsPerPage:t=20,rowsPerPageOptions:o=[20,50,100,-1],page:r=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=se(),l=o.length>0?o:[20,50,100,-1],d=Math.max(0,r),u=t===-1?1:Math.max(1,Math.ceil(n/t)),m=Math.min(d+1,u),h=d>0,f$1=d<u-1&&t!==-1;return g("div",{className:"orb-table-pager",children:[f(E,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),f(lt,{title:s("table.toolbar.itemsPerPage"),children:f(Ht,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:p=>a?.(Number(p.target.value)),sx:Pf,children:l.map(p=>f("option",{value:p,children:p===-1?s("common.all"):p},`rows-per-page-${p}`))})}),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:!h,sx:co,children:f(Qd,{})}),g(E,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:m,total:u}),children:[m," / ",u]}),f(ae,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,u-1)),disabled:!f$1,sx:co,children:f(wr,{})})]})};var mi=({value:t="",onChange:o})=>{let{t:r}=se();return f("div",{className:"orb-table-toolbar-search",children:f(He,{className:"orb-table-toolbar-search-field",size:"small",placeholder:r("table.toolbar.searchPlaceholder"),value:t,onChange:n=>o?.(n.target.value),InputProps:{startAdornment:f(sr,{position:"start",children:f(Br,{size:16})})}})})};var gi=t=>{let{t:o}=se(),r=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],n=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],a=[...r,...n],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return f(Td,{className:"orb-table-toolbar",role:"toolbar","aria-label":o("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(mi,{value:t.filterText,onChange:l=>{t.setFilterText(l),t.onPageChange?.(0);}}),f(ui,{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(jt__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(lt,{title:o("table.toolbar.groupBy"),children:f(ae,{className:"orb-table-tool-button",sx:co,onClick:l=>t.setGroupAnchorEl(t.groupAnchorEl?null:l.currentTarget),children:f(ja,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:f(Cr,{})})})}),f(lt,{title:o("table.toolbar.summary"),children:f(ae,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:co,onClick:l=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:l.currentTarget),children:f(nn,{})})}),f(lt,{title:o("table.toolbar.columns"),children:f(ae,{className:"orb-table-tool-button",sx:co,onClick:l=>t.setAnchorEl(t.anchorEl?null:l.currentTarget),children:f(an,{})})}),f(lt,{title:o("table.toolbar.export"),children:f(ae,{className:"orb-table-tool-button",sx:co,onClick:t.handleExport,children:f(Ud,{})})})]}),i&&g("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&f(lt,{title:o("table.toolbar.newItem"),children:f(ae,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:co,children:f(Fr,{})})}),t.showEditButton&&f(lt,{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:co,children:f(qd,{})})})}),t.showDeleteButton&&f(lt,{title:o("table.toolbar.deleteItem"),children:f("span",{children:f(ae,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...co,color:"error.main"},children:f(oi,{})})})})]}),s&&g("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&f(lt,{title:o("table.toolbar.graphicReport"),children:f(ae,{className:"orb-table-tool-button",sx:co,onClick:t.onOpenGraphReport,children:f(Zd,{})})}),t.onLayoutSave&&!t.layoutManager&&f(lt,{title:o("table.toolbar.saveLayout"),children:f(ae,{className:"orb-table-tool-button",sx:co,onClick:l=>t.onLayoutSave(l),children:f(Sr,{})})}),t.layoutManager]})]})]})})};var hi=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 [hi.Translate.toString(t),hi.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:o,duration:r,easing:n}=t;return o+" "+r+"ms "+n}}});var fi=t=>{let{t:o}=se(),{onSelectAllClick:r,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:l=0,onRequestSort:d,onContextMenu:u,columns:m,visibleColumns:h,selectionMode:f$1,grouping:p=[],isAllExpanded:v=false,handleToggleAll:C,onColumnResize:g$1,columnWidths:x,enableColumnReorder:b=false,disableSorting:y=false}=t,[k,S]=useState(null),P=useRef(null),I=H=>q=>{y||k||d(H);},w=(H,q,V)=>{H.preventDefault(),H.stopPropagation(),S(q),P.current={startX:H.clientX,startWidth:V,colId:q},document.addEventListener("mousemove",M),document.addEventListener("mouseup",N),document.body.style.cursor="col-resize";},M=H=>{if(!P.current)return;let{startX:q,startWidth:V,colId:B}=P.current,G=H.clientX-q,X=Math.max(50,V+G);g$1&&g$1(B,X);},N=()=>{S(null),P.current=null,document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",N),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",N);},[]);let T=f$1==="multiple"||f$1==="single",R=p.length>0&&!!C,A=o(v?"table.group.collapseAll":"table.group.expandAll"),L=m.filter(H=>h.includes(H.id)),$=new Map(i.map((H,q)=>[H.field,{...H,priority:q+1}])),j=L.map(H=>{let q=x?.[H.id]||H.minWidth||100,V=$.get(H.id);return f(Ef,{headCell:H,width:typeof q=="number"?q:100,order:n,orderBy:a,multiSortInfo:y?void 0:V,onRequestSort:I(H.id),onContextMenu:u,onResizeMouseDown:B=>w(B,H.id,typeof q=="number"?q:100),enableColumnReorder:b,disableSorting:y},H.id)}),O=L.map(H=>H.id),z=g("tr",{children:[T&&f("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:f(Tt,{color:"primary",indeterminate:s>0&&s<l,checked:l>0&&s===l,onChange:r,disabled:f$1==="single",sx:Yn})}),R&&f("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:f(lt,{title:A,children:f(ae,{size:"small",onClick:H=>{H.stopPropagation(),C?.(!v);},sx:Qn,children:v?f(ci,{}):f(di,{})})})}),b?f(SortableContext,{items:O,strategy:horizontalListSortingStrategy,children:j}):j]});return f("thead",{children:z})},Ef=({headCell:t,width:o,order:r,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:l,enableColumnReorder:d,disableSorting:u})=>{let{setNodeRef:m,attributes:h,listeners:f$1,transform:p,transition:v,isDragging:C}=useSortable({id:t.id,disabled:!d}),g$1=d?{transform:hi.Transform.toString(p),transition:v,opacity:C?.6:1}:{},x=u?"asc":a?.direction??(n===t.id?r:"asc"),b=!u&&(!!a||n===t.id);return g("th",{ref:d?m:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${d?"orb-is-reorderable":""} ${C?"orb-is-dragging":""}`,"aria-sort":b?x==="asc"?"ascending":"descending":"none",onContextMenu:s?y=>s(y,t.id):void 0,style:{width:o,minWidth:o,maxWidth:o,...g$1},...d?h:{},...d?f$1:{},children:[u?f("span",{className:"orb-table-head-label",children:t.label}):f(Id,{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:y=>y.stopPropagation(),onClick:y=>y.stopPropagation()})]})};var bi=t=>{let{t:o}=se(),{visibleRows:r,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:l,expandedGroups:d=new Set,selectionMode:u,grouping:m=[],isGroupFullyExpanded:h,handleExpandGroupRecursively:f$1,handleCollapseGroupRecursively:p,emptyLabel:v,getRowDataKey:C,getRowProps:g$1,getGroupRowProps:x}=t,b=P=>a.indexOf(P)!==-1,y=u==="multiple"||u==="single",k=m.length>0,S=n.length+(y?1:0)+(k?1:0);return g("tbody",{children:[r.map((P,I)=>{if(P.type==="group"){let w=d.has(P.id),M=P.childIds||[],N=M.filter(H=>b(H)).length,T=M.length>0&&N===M.length,R=N>0&&N<M.length,A={entry:P,data:P,id:P.id,index:I,selected:T,group:true},L=x?.(A)||{},{className:$,onClick:j,...O}=L,z=H=>{if(H.stopPropagation(),!!t.onSelectionChange)if(T){let q=a.filter(V=>!M.includes(V));t.onSelectionChange(q);}else {let q=Array.from(new Set([...a,...M]));t.onSelectionChange(q);}};return g("tr",{...O,"data-ctable-row-key":C?.(A),className:["orb-table-group-row",$].filter(Boolean).join(" "),onClick:j,sx:H=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:H.palette.text.primary,borderBottomColor:H.palette.divider},"& .orb-icon-btn":{color:H.palette.text.primary},"& .orb-chk":{color:H.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:H.palette.primary.main}}),children:[y&&f("td",{padding:"checkbox",sx:ol,children:f(Tt,{size:"small",checked:T,indeterminate:R,onChange:z,onClick:H=>H.stopPropagation(),sx:Yn})}),k&&f("td",{padding:"checkbox",sx:rl,children:g("div",{sx:Cp,children:[m.length>1&&P.level<m.length-1&&f(lt,{title:h?.(P.id)?o("table.group.collapseAll"):o("table.group.expandAll"),children:f(ae,{size:"small",onClick:()=>{h?.(P.id)?p?.(P.id):f$1?.(P.id);},sx:Qn,children:h?.(P.id)?f(ci,{}):f(di,{})})}),f(ae,{size:"small",onClick:()=>l&&l(P.id),sx:Qn,children:w?f(Vo,{}):f(wr,{})})]})}),f("td",{colSpan:n.length,sx:{py:1,pl:P.level*3+1},children:g(E,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[P.field,": ",P.value," (",P.count,")"]})})]},P.id)}else {let w=P.data||P,M=P.id||w.id||I,N=b(M),T=`enhanced-table-checkbox-${I}`,R={entry:P,data:w,id:M,index:I,selected:N,group:false},A=g$1?.(R)||{},{className:L,onClick:$,...j}=A,z=(P.level!==void 0?P.level:0)*4;return g("tr",{...j,"data-ctable-row-key":C?.(R),className:[N?"orb-is-selected":"",L].filter(Boolean).join(" "),onClick:H=>{$?.(H),H.defaultPrevented||i?.(H,w);},role:y?"checkbox":j.role,"aria-checked":y?N:j["aria-checked"],tabIndex:j.tabIndex??-1,children:[y&&f("td",{padding:"checkbox",sx:ol,children:f(Tt,{color:"primary",checked:N,inputProps:{"aria-labelledby":T},sx:Yn})}),k&&f("td",{padding:"checkbox",sx:rl}),s.filter(H=>n.includes(H.id)).map((H,q)=>{let B=q===0&&z>0?{pl:z+2}:{};return f("td",{className:H.numeric?"orb-num":void 0,align:H.numeric?"right":"left",sx:B,children:H.render?H.render(w[H.id],w):(function(){let X=w[H.id];if(H.numeric){if(typeof X=="number")return X.toLocaleString();if(typeof X=="string"&&X.trim()!==""&&!isNaN(Number(X)))return Number(X).toLocaleString()}return X})()},H.id)})]},M)}}),r.length===0&&f("tr",{children:f("td",{colSpan:S,align:"center",children:v??o("common.noData")})})]})};var xp=t=>{let{columns:o=[],visibleColumns:r,summaryRow:n,selectionMode:a,grouping:i=[],columnWidths:s={}}=t;if(!t.showSummary)return null;let l=a==="multiple"||a==="single",d=i.length>0,u=o.filter(m=>r.includes(m.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}}),u.map(m=>f("td",{className:`orb-table-footer-cell ${m.numeric?"orb-num":""}`,style:{width:s[m.id]||m.minWidth||100,minWidth:s[m.id]||m.minWidth||100,maxWidth:s[m.id]||m.minWidth||100},children:(function(){let f=n[m.id];return f==null||f===""?"":typeof f=="number"?f.toLocaleString():typeof f=="string"&&f.trim()!==""&&!isNaN(Number(f))?Number(f).toLocaleString():f})()},m.id))]})})};var wp=t=>{let{t:o}=se();return f("div",{sx:{p:2},children:f(E,{children:o("table.mobile.notImplemented")})})};var cn=({groupAnchorEl:t,setGroupAnchorEl:o,grouping:r,setGrouping:n,columns:a})=>{let{t:i}=se(),[s,l]=useState(r);useEffect(()=>{t&&l(r);},[t,r]);let d=()=>{l(r),o(null);},u=h=>{l(f=>f.includes(h)?f.filter(p=>p!==h):[...f,h]);},m=()=>{n(s),o(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:h=>h.stopPropagation(),children:[f(E,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&f(Se,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:h=>{h.stopPropagation(),l([]);},children:i("table.menu.clearAll")})]}),f(Rt,{className:"orb-table-group-menu-divider"}),a.map(h=>{let f$1=s.includes(h.id),p=s.indexOf(h.id)+1;return f("option",{className:"orb-table-group-menu-option",selected:f$1,onClick:v=>{v.stopPropagation(),u(h.id);},children:g("div",{className:"orb-table-group-menu-option-content",children:[f(Tt,{className:"orb-table-group-menu-checkbox",checked:f$1,size:"small"}),f($t,{className:"orb-table-group-menu-label",primary:h.label}),f$1&&f("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${p}`,children:p})]})},h.id)}),g("div",{className:"orb-table-group-menu-footer",children:[f(Se,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),f(Se,{size:"small",variant:"primary",onClick:m,children:i("common.ok")})]})]})},dn=({anchorEl:t,setAnchorEl:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=se();return g(Yt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{disabled:true,children:f($t,{primary:i("table.menu.visibleColumns")})}),f(Rt,{}),r.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Tt,{checked:n.includes(s.id),size:"small"}),f($t,{primary:s.label})]},s.id))]})},vi=({anchorEl:t,setAnchorEl:o,showSummary:r,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:l}=se();return g(Yt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{children:f(Zn,{control:f(Ja,{checked:r,onChange:d=>n(d.target.checked),size:"small"}),label:l("table.menu.showSummaryRow")})}),f(Rt,{}),a.filter(d=>d.numeric).map(d=>g("option",{onClick:()=>s(d.id),disabled:!r,children:[f(Tt,{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")})})]})},yi=({contextMenu:t,handleCloseContextMenu:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=se();return g(Yt,{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(Rt,{}),f("option",{disabled:true,children:i("table.menu.visibleColumns")}),r.map(s=>g("option",{onClick:()=>a(s.id),children:[f(zo,{children:n.includes(s.id)&&f(zd,{fontSize:"small"})}),f($t,{children:s.label})]},s.id))]})},Tp=({contextMenu:t,handleClose:o,columns:r,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:l,orderBy:d,order:u,onSortAsc:m,onSortDesc:h,onClearSort:f$1,onHideColumn:p,onToggleGroup:v,onToggleSummary:C,onOpenSortDialog:g$1})=>{let{t:x}=se(),b=t?.columnId??"",y=r.find(T=>T.id===b),k=a.includes(b),S=i.includes(b),P=!!y?.numeric,I=l.find(T=>T.field===b),w=I?I.direction==="asc":d===b&&u==="asc",M=I?I.direction==="desc":d===b&&u==="desc",N=w||M;return g(Yt,{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($t,{primary:y?.label??b})}),f(Rt,{}),g("option",{onClick:()=>{m(b),o();},selected:w,children:[f(zo,{children:f(tl,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.sortAsc")})]}),g("option",{onClick:()=>{h(b),o();},selected:M,children:[f(zo,{children:f(el,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.sortDesc")})]}),N&&g("option",{onClick:()=>{f$1(b),o();},children:[f(zo,{children:f(Wd,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.clearSort")})]}),g("option",{onClick:()=>{g$1(),o();},children:[f(zo,{children:f(Fr,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.configureSort")})]}),f(Rt,{}),g("option",{onClick:()=>{v(b),o();},selected:k,children:[f(zo,{children:f(Cr,{fontSize:"small"})}),f($t,{primary:x(k?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),P&&s&&g("option",{onClick:()=>{C(b),o();},selected:S,children:[f(zo,{children:f(nn,{fontSize:"small"})}),f($t,{primary:x(S?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),f(Rt,{}),g("option",{onClick:()=>{p(b),o();},children:[f(zo,{children:f(gp,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.hideColumn")})]})]})},Ip=({open:t,onClose:o,columns:r,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=se(),[l,d]=useState([]);useEffect(()=>{t&&d(n.length>0?n.map(C=>({...C})):[]);},[t,n]);let u=useMemo(()=>new Set(l.map(C=>C.field)),[l]),m=useMemo(()=>r.filter(C=>!u.has(C.id)),[r,u]),h=()=>{let C=m[0];C&&d(g=>[...g,{field:C.id,direction:"asc"}]);},f$1=C=>{d(g=>g.filter((x,b)=>b!==C));},p=(C,g)=>{d(x=>x.map((b,y)=>y===C?{...b,...g}:b));},v=(C,g)=>{d(x=>{let b=C+g;if(b<0||b>=x.length)return x;let y=[...x],[k]=y.splice(C,1);return y.splice(b,0,k),y});};return f(Et,{open:t,onClose:o,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:g(e,{children:[f(Se,{className:"orb-table-sort-clear",variant:"neutral",disabled:l.length===0&&n.length===0,onClick:()=>{i(),o();},children:s("table.sortDialog.clearAll")}),f("span",{className:"orb-table-sort-action-spacer"}),f(Se,{variant:"neutral",onClick:o,children:s("common.cancel")}),f(Se,{variant:"primary",onClick:()=>{a(l),o();},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(ie,{className:"orb-table-sort-rules",spacing:1,children:l.map((C,g$1)=>{let x=new Set(l.filter((y,k)=>k!==g$1).map(y=>y.field)),b=r.filter(y=>!x.has(y.id));return g("div",{className:"orb-table-sort-rule",children:[f(ja,{className:"orb-table-sort-order",badgeContent:g$1+1,color:"primary"}),f(Ht,{size:"small",value:C.field,onChange:y=>p(g$1,{field:y.target.value}),options:b.map(y=>({value:y.id,label:y.label}))}),f(Ht,{size:"small",value:C.direction,onChange:y=>p(g$1,{direction:y.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(tl,{fontSize:"small"})}),f(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,1),disabled:g$1===l.length-1,children:f(el,{fontSize:"small"})}),f(ae,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>f$1(g$1),children:f(ri,{fontSize:"small"})})]},`sort-rule-${g$1}`)})}),f(Se,{size:"small",onClick:h,disabled:m.length===0,startIcon:f(Fr,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};var jn=(t,o=2)=>t.toLocaleString(void 0,{maximumFractionDigits:o}),Mp=({kpis:t})=>{let{t:o}=se(),r=[{label:o("graph.kpi.totalRecords"),value:jn(t.totalRecords,0),color:"var(--orb-fg)"},{label:o("graph.kpi.totalReport"),value:jn(t.totalReportHours),color:"var(--orb-fg)"},{label:o("graph.kpi.totalBillable"),value:jn(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:jn(t.totalAmount),color:"var(--orb-primary)"},{label:o("graph.kpi.flagged"),value:jn(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(n=>g(Ne,{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 Ci=({title:t,subtitle:o,children:r})=>g(Ne,{elevation:0,sx:{padding:16},children:[f(E,{variant:"h4",sx:{fontWeight:700},children:t}),o&&f(E,{variant:"body2",muted:true,sx:{marginBottom:16},children:o}),r]});var Jn=({data:t,orientation:o="horizontal",valueSuffix:r="",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 o==="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),r]})]},l.name))}):f(ie,{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),r]})]},l.name))})};var Rp=({data:t,color:o="var(--orb-chart-1)",valueSuffix:r="",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(f=>f.value),l=Math.min(...s,0),u=Math.max(...s,1)-l||1,m=t.map((f,p)=>{let v=i+p*(a-i*2)/Math.max(t.length-1,1),C=n-i-(f.value-l)/u*(n-i*2);return {x:v,y:C,...f}}),h=m.map(f=>`${f.x},${f.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:o},strokeWidth:3,points:h}),m.map(f$1=>f("circle",{cx:f$1.x,cy:f$1.y,r:4,style:{fill:o}},f$1.name))]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(f$1=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:f$1.name,sx:{display:"block"},children:f$1.name}),g(E,{variant:"caption",muted:true,children:[f$1.value.toFixed(1),r]})]},f$1.name))})]})};var Dp=({data:t,barColor:o="var(--orb-chart-1)",lineColor:r="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(m=>m.barValue),1),l=Math.max(...t.map(m=>m.lineValue),1),d=t.map((m,h)=>{let f=(a-i*2)/t.length,p=Math.max(f*.5,8),v=i+h*f+(f-p)/2,C=m.barValue/s*(n-i*2),g=n-i-C;return {x:v,y:g,barHeight:C,barWidth:p,item:m}}),u=t.map((m,h)=>{let f=(a-i*2)/t.length,p=i+h*f+f/2,v=n-i-m.lineValue/l*(n-i*2);return {x:p,y:v,item:m}});return g(ie,{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(m=>f("rect",{x:m.x,y:m.y,width:m.barWidth,height:Math.max(m.barHeight,4),rx:6,style:{fill:o}},m.item.name)),f("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:u.map(m=>`${m.x},${m.y}`).join(" ")}),u.map(m=>f("circle",{cx:m.x,cy:m.y,r:3.5,style:{fill:r}},`${m.item.name}-line`))]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(m=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:m.name,sx:{display:"block"},children:m.name}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",m.barValue.toFixed(1)]}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",m.lineValue.toFixed(1)]})]},m.name))})]})};var Lf=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)`},Np=({data:t})=>{if(t.length===0)return f(E,{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))),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(${o.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+o.length*64},children:[f("div",{}),o.map(i=>f(E,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),r.map(i=>g("div",{style:{display:"contents"},children:[f(E,{variant:"caption",sx:{alignSelf:"center"},children:i}),o.map(s=>{let l=a.get(`${i}__${s}`)||0,d=l/n;return f("div",{sx:{height:36,borderRadius:1,background:Lf(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 Of=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],xi=({data:t,variant:o="donut",colors:r=Of,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,u)=>{let m=s;return s+=d.percent,`${r[u%r.length]} ${m}% ${s}%`});return g(ie,{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:o==="donut"&&f("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),f(ie,{spacing:1,sx:{minWidth:180},children:t.map((d,u)=>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:r[u%r.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 Ap=({effect:t,branches:o})=>{if(o.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let r=o.filter((a,i)=>i%2===0),n=o.filter((a,i)=>i%2===1);return g(ie,{spacing:1.5,children:[f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.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 Ep=({data:t,height:o=240})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let r=0,n=t.map(h=>{let f=h.type==="total"?0:r,p=h.type==="total"?h.value:r+h.value;return h.type!=="total"&&(r=p),{...h,start:f,end:p,delta:p-f}}),a=n.flatMap(h=>[h.start,h.end]),i=Math.min(...a,0),s=Math.max(...a,1),l=680,d=30,u=s-i||1,m=h=>o-d-(h-i)/u*(o-d*2);return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${l} ${o}`,style:{width:"100%",height:o},children:[f("line",{x1:d,y1:m(0),x2:l-d,y2:m(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((h,f$1)=>{let p=(l-d*2)/n.length,v=Math.max(p*.55,8),C=d+f$1*p+(p-v)/2,g$1=m(Math.max(h.start,h.end)),x=m(Math.min(h.start,h.end)),b=h.type==="total"?"var(--orb-chart-1)":h.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return g("g",{children:[f("rect",{x:C,y:g$1,width:v,height:Math.max(x-g$1,4),rx:6,style:{fill:b}}),f("text",{x:C+v/2,y:g$1-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:h.end.toFixed(1)})]},h.name)})]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(h=>f(E,{variant:"caption",title:h.name,children:h.name},h.name))})]})};var ea=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>{let a=encodeURIComponent(o);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${a}&zoom=${r}&maptype=${n}`},_M=(t,o=360)=>{let r=ea(t);return `<iframe width="100%" height="${o}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${r}"></iframe>`};var Lp=({apiKey:t,query:o,embedUrl:r,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=r||(t&&o?ea({apiKey:t,query:o,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 wi=({keyword:t,location:o,src:r="orbcafe-ui"})=>{if(o){let n=encodeURIComponent(o.name||t||"Location");return `https://uri.amap.com/marker?position=${o.lng},${o.lat}&name=${n}&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 Op=({keyword:t,location:o,embedUrl:r,height:n=320})=>{let a=r||wi({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.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 Fp=({billableByPrimary:t,efficiencyBySecondary:o,statusDistribution:r,interaction:n})=>{let{t:a}=se();return g("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[f(Ci,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:f(Jn,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),f(Ci,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:f(Jn,{data:o,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),f(Ci,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:f(xi,{data:r,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};var Bf=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Hf=["zh","en","de","fr","ja","ko"],Bp=({open:t,onClose:o,value:r,onSaveAll:n,modelOptions:a=Bf,promptLangOptions:i=Hf,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:u})=>{let[m,h]=useState(r),[f$1,p]=useState(d||""),[v,C]=useState(u||""),[g$1,x]=useState(false);useEffect(()=>{t&&(h(r),p(d||""),C(u||""));},[t,r,d,u]);let b=(k,S)=>{h(P=>({...P,[k]:S}));},y=async()=>{if(n)try{x(!0),await n({settings:m,analysisTemplateId:f$1||void 0,responseTemplateId:v||void 0});}finally{x(false);}};return g(Et,{open:t,onClose:o,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(ae,{onClick:o,sx:{position:"absolute",right:12,top:12},children:f(xr,{})})]}),f("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:g(ie,{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:m.baseUrl,onChange:k=>b("baseUrl",k.target.value),fullWidth:true,label:"Base URL"})}),f("div",{children:f(He,{size:"small",type:"password",value:m.apiKey,onChange:k=>b("apiKey",k.target.value),fullWidth:true,label:"API Key"})}),f("div",{children:f(He,{size:"small",value:m.model,onChange:k=>b("model",k.target.value),fullWidth:true,select:true,label:"Model",children:a.map(k=>f("option",{value:k,children:k},k))})}),f("div",{children:f(He,{size:"small",value:m.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(He,{size:"small",value:f$1,onChange:k=>p(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(Hn,{multiline:true,minRows:8,value:m.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(He,{size:"small",value:v,onChange:k=>C(k.target.value),fullWidth:true,select:true,label:"Response Template",children:[f("option",{value:"",children:"Default"}),l.map(k=>f("option",{value:k.id,children:k.label},k.id))]}),f(Hn,{multiline:true,minRows:8,value:m.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(Se,{variant:"outlined",onClick:o,children:"Cancel"}),f(Se,{variant:"contained",onClick:y,disabled:!n||g$1,children:"Save"})]})]})};var ki=({open:t,onClose:o,model:r,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=se(),[d,u]=useState(s?.defaultPrompt||""),[m,h]=useState(false),[f$1,p]=useState(false),v=i?.enabled!==false&&!!i,C=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&&u(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let y=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},k=async()=>{let S=d.trim();if(!(!S||!s?.onSubmit))try{h(!0),await s.onSubmit(S,{filters:g$1,model:r});}finally{h(false);}};return f(Et,{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(ie,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[g(ie,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[f(E,{variant:"h3",sx:{fontWeight:800},children:r.title}),f(Ct,{label:l("graph.records",{count:r.kpis.totalRecords})}),v&&g$1.primaryDimension&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g$1.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),v&&g$1.secondaryDimension&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g$1.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),v&&g$1.status&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.status}: ${g$1.status}`,onDelete:()=>i?.onClearFilter("status")}),v&&x&&f(Se,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),g(ie,{direction:"row",spacing:10,alignItems:"center",children:[C&&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(Ea,{size:16,strokeWidth:1.8})}),f("input",{className:"orb-inp orb-inp-dense",value:d,onChange:S=>u(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),k());},placeholder:b,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),f(ae,{size:"small",onClick:k,disabled:m||!d.trim(),children:f(_c,{size:16,strokeWidth:1.8})}),f(ae,{size:"small",onClick:()=>p(true),children:f(Jr,{size:16,strokeWidth:1.8})})]}),f(ae,{onClick:o,children:f(Ut,{size:18,strokeWidth:2})})]})]})}),g("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[f(Mp,{kpis:r.kpis}),f(Fp,{billableByPrimary:r.charts.billableByPrimary,efficiencyBySecondary:r.charts.efficiencyBySecondary,statusDistribution:r.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(Bp,{open:f$1,onClose:()=>p(false),value:y,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var Tr={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"]},Vf=5,Hp=t=>t.toLowerCase().replace(/[\s_-]/g,""),Ir=(t,o,r,n)=>{if(o)return o;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[Hp(s),s]));for(let s of r){let l=i.get(Hp(s));if(l)return l}return a[0]||n},ko=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},go=(t,o)=>t==null||t===""?o:String(t),Wf=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let l=go(s[o],a);i.set(l,(i.get(l)||0)+ko(s[r]));}),Array.from(i.entries()).map(([s,l])=>({name:s,value:l})).sort((s,l)=>l.value-s.value).slice(0,n)},$f=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=go(l[o],i),u=s.get(d)||{report:0,billable:0};u.report+=ko(l[r]),u.billable+=ko(l[n]),s.set(d,u);}),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)},_f=(t,o,r)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=go(i[o],r);a.set(s,(a.get(s)||0)+1);}),Array.from(a.entries()).map(([i,s])=>({name:i,value:s,percent:s/n*100}))},zp=(t,o,r)=>{let n=new Map;return t.forEach(a=>{let i=go(a[o],"N/A");n.set(i,(n.get(i)||0)+ko(a[r]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},Gf=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=go(l[o],i),u=s.get(d)||{report:0,billable:0};u.report+=ko(l[r]),u.billable+=ko(l[n]),s.set(d,u);}),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)},Uf=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let l=go(s[o],a),d=go(s[r],a),u=`${l}__${d}`;i.set(u,(i.get(u)||0)+ko(s[n]));}),Array.from(i.entries()).map(([s,l])=>{let[d,u]=s.split("__");return {x:d,y:u,value:l}})},Kf=(t,o,r)=>{let n=zp(t,o,r),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"}]},qf=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=go(l[o],i),u=`${go(l[r],i)} / ${go(l[n],i)}`,m=s.get(d)||new Map;m.set(u,(m.get(u)||0)+1),s.set(d,m);}),Array.from(s.entries()).map(([l,d])=>({title:l,causes:Array.from(d.entries()).sort((u,m)=>m[1]-u[1]).slice(0,a).map(([u,m])=>`${u} (${m})`)})).slice(0,6)},pn=({rows:t,config:o})=>{let{t:r}=se(),n=r("graph.unassigned"),a=useMemo(()=>{let m=o?.fieldMapping;return {primaryDimension:Ir(t,m?.primaryDimension,Tr.primaryDimension,"Category"),secondaryDimension:Ir(t,m?.secondaryDimension,Tr.secondaryDimension,"Owner"),status:Ir(t,m?.status,Tr.status,"Status"),date:Ir(t,m?.date,Tr.date,"Date"),description:Ir(t,m?.description,Tr.description,"Description"),reportHours:Ir(t,m?.reportHours,Tr.reportHours,"ReportHours"),billableHours:Ir(t,m?.billableHours,Tr.billableHours,"BillableHours"),amount:Ir(t,m?.amount,Tr.amount,"Amount")}},[t,o?.fieldMapping]),i=useMemo(()=>t.map((m,h)=>{let f=ko(m[a.reportHours]),p=ko(m[a.billableHours]),v=ko(m[a.amount]),C=f>0?p/f*100:0;return {id:`graph-row-${h}`,Date:go(m[a.date],""),Primary:go(m[a.primaryDimension],n),Secondary:go(m[a.secondaryDimension],n),Description:go(m[a.description],""),ReportHours:f,BillableHours:p,Amount:v,Efficiency:C,Status:go(m[a.status],n)}}),[t,a,n]),s=useMemo(()=>{let m=i.length,h=i.reduce((x,b)=>x+ko(b.ReportHours),0),f=i.reduce((x,b)=>x+ko(b.BillableHours),0),p=i.reduce((x,b)=>x+ko(b.Amount),0),v=h>0?f/h*100:0,C=o?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>C.includes(go(x.Status,"").toLowerCase())).length;return {totalRecords:m,totalReportHours:h,totalBillableHours:f,efficiency:v,totalAmount:p,flaggedCount:g}},[i,o?.statusFlagValues]),l=o?.topN||Vf,d=useMemo(()=>({billableByPrimary:Wf(i,"Primary","BillableHours",l,n),efficiencyBySecondary:$f(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:_f(i,"Status",n),lineByDate:zp(i,"Date","BillableHours"),comboByPrimary:Gf(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:Uf(i,"Primary","Secondary","BillableHours",n),waterfallBillable:Kf(i,"Date","BillableHours"),fishboneStatusCauses:qf(i,"Status","Primary","Secondary",3,n)}),[i,l,n]),u=useMemo(()=>({title:o?.title||r("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: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:a.status}],rows:i}}),[d,o?.title,a,s,i,r]);return {fieldMapping:a,model:u}};var un=t=>String(t??"").trim(),Ti=(t={})=>{let[o,r]=useState(t),n=useCallback((d,u)=>{r(m=>{let h=u?.trim();if(!h){let f={...m};return delete f[d],f}if(m[d]===h){let f={...m};return delete f[d],f}return {...m,[d]:h}});},[]),a=useCallback(d=>{r(u=>{if(!u[d])return u;let m={...u};return delete m[d],m});},[]),i=useCallback(()=>{r({});},[]),s=useMemo(()=>!!(o.primaryDimension||o.secondaryDimension||o.status),[o]),l=useCallback((d,u)=>d.filter(m=>!(o.primaryDimension&&un(m[u.primaryDimension])!==un(o.primaryDimension)||o.secondaryDimension&&un(m[u.secondaryDimension])!==un(o.secondaryDimension)||o.status&&un(m[u.status])!==un(o.status))),[o]);return {filters:o,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:l}};var Mi=({variants:t,currentVariantId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=se(),[l,d]=useState(false),[u,m]=useState(""),[h,f$1]=useState(false),[p,v]=useState(false),C=t.find(b=>b.id===o),g$1=()=>{m(C?.name||s("variant.newVariant")),f$1(C?.isDefault||false),v(C?.isPublic||false),d(true);},x=()=>{n({name:u,isDefault:h,isPublic:p,description:""}),d(false);};return g("div",{className:"orb-variant-management",children:[f(Ht,{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 y=t.find(k=>k.id===b.target.value);y&&r(y);}}),f(lt,{title:s("variant.saveView"),children:f(ae,{className:"orb-variant-save-button",onClick:g$1,size:"small",color:"primary",children:f(Sr,{fontSize:"small"})})}),g(Et,{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:u,onChange:b=>m(b.target.value)}),f(Zn,{control:f(Tt,{checked:h,onChange:b=>f$1(b.target.checked)}),label:s("variant.setDefault")}),f(Zn,{control:f(Tt,{checked:p,onChange:b=>v(b.target.checked)}),label:s("variant.publicAllUsers")})]}),g("div",{className:"orb-dialog-actions",children:[f(Se,{onClick:()=>d(false),children:s("common.cancel")}),f(Se,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};var Wp=({appId:t,tableKey:o="default",currentFilters:r,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:l,onError:d,onSuccess:u,currentVariantId:m,onVariantChange:h})=>{let{t:f$1}=se(),[p,v]=useState([]),[C,g]=useState(""),x=`orbcafe.variants.${t}.${o}`,b=m!==void 0?m:C,y=R=>{m===void 0&&g(R),h&&h(R);},k=useCallback(()=>{try{let R=localStorage.getItem(x);if(!R)return [];let A=JSON.parse(R);return Array.isArray(A)?A:[]}catch{return []}},[x]),S=useCallback(R=>{try{localStorage.setItem(x,JSON.stringify(R));}catch{}},[x]),P=useCallback(R=>{v(R);let A=R.find(L=>L.isDefault);A&&!b&&(y(A.id),i(A));},[b,i,y]),I=useCallback(async()=>{if(!t)return [];try{let R=[];if(s)R=await s.getVariants(t,o);else if(l){let A=await fetch(`${l}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!A.ok)throw new Error(f$1("variant.toast.fetchFailed"));R=await A.json();}else R=k();return P(R),R}catch(R){console.error("Error fetching variants",R);let A=k();return P(A),d&&d(f$1("variant.toast.fetchFailed")),A}},[t,o,s,l,k,P,d,f$1]);return useEffect(()=>{I();},[t,o]),f(Mi,{variants:p,currentVariantId:b,onLoad:R=>{y(R.id),i(R);},onSave:async R=>{let A=Date.now().toString(),L;try{let $=R.scope||"Both",j=p.find(q=>q.name===R.name);A=j?j.id:Date.now().toString();let O=[];if(j&&(Array.isArray(j.filters)?O=[...j.filters]:j.filters&&(O=[{scope:"default",filters:j.filters}])),$==="Search"||$==="Both"){let q=(Array.isArray(r),r);if(q)if(Array.isArray(q)&&q.length>0&&q[0].scope)q.forEach(V=>{let B=O.findIndex(G=>G.scope===V.scope);B>=0?O[B]=V:O.push(V);});else {let V={scope:o,filters:q},B=O.findIndex(G=>G.scope===o);B>=0?O[B]=V:O.push(V);}}let z=j?.layout||{},H=[];if(j&&Array.isArray(j.layoutRefs)&&(H=[...j.layoutRefs]),$==="Layout"||$==="Both")if(a&&a.length>0)a.forEach(q=>{let V=H.findIndex(B=>B.tableKey===q.tableKey);V>=0?H[V]=q:H.push(q);});else {let q={tableKey:o,layoutId:n||null},V=H.findIndex(B=>B.tableKey===o);V>=0?H[V]=q:H.push(q);}if(L={appId:t,tableKey:o,...R,scope:$,id:A,createdAt:new Date().toISOString(),filters:O,layout:z,layoutRefs:H},s)await s.saveVariant(L,t,o);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(f$1("variant.toast.saveFailed"))}else {let V=p.some(B=>B.id===A)?p.map(B=>B.id===A?L:B):[...p,L];v(V),S(V);}u&&u(f$1("variant.toast.saveSuccess")),(s||l)&&await I(),y(A),i(L);}catch($){console.error("Error saving variant",$);let O=p.some(z=>z.id===A)?p.map(z=>z.id===A?L:z):[...p,L];v(O),S(O),y(A),i(L),d&&d(f$1("variant.toast.saveFailed"));}},onDelete:async R=>{try{if(s)await s.deleteVariant(R);else if(l){if(!(await fetch(`${l}/api/variants/${R}`,{method:"DELETE"})).ok)throw new Error(f$1("variant.toast.deleteFailed"))}else {let A=p.filter(L=>L.id!==R);v(A),S(A);}b===R&&y(""),(s||l)&&I(),u&&u(f$1("variant.toast.deleteSuccess"));}catch(A){console.error("Error deleting variant",A);let L=p.filter($=>$.id!==R);v(L),S(L),b===R&&y(""),d&&d(f$1("variant.toast.deleteFailed"));}},onSetDefault:async R=>{try{let A=p.find($=>$.id===R);if(!A)return;let L={appId:t,tableKey:o,...A,isDefault:!0};if(s)await s.setDefaultVariant(R,t,o);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(f$1("variant.toast.defaultFailed"))}else {let $=p.map(j=>({...j,isDefault:j.id===R}));v($),S($);}(s||l)&&await I(),u&&u(f$1("variant.toast.defaultSuccess"));}catch(A){console.error("Error setting default variant",A);let L=p.map($=>({...$,isDefault:$.id===R}));v(L),S(L),d&&d(f$1("variant.toast.defaultFailed"));}}})};rr.extend(Jf);rr.extend(eb);rr.extend(Hh);var oa="YYYY-MM-DD",ob=[null,null],Hr="0.85rem",rb={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},nb=({isInRange:t,isStart:o,isEnd:r,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=ao();return f(Nd,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:l.palette.primary.light,color:l.palette.primary.contrastText}:{},n&&!t&&!o&&!r?{borderRadius:0,backgroundColor:l.palette.action.hover,border:`1px dashed ${l.palette.primary.main}`}:{},o?{borderRadius:"50% 0 0 50%",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},r?{borderRadius:"0 50% 50% 0",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},o&&r?{borderRadius:"50%"}:{}]})},_p=({label:t,value:o=ob,onChange:r})=>{let{t:n,locale:a}=se(),i=rb[a]||"en",s=t||n("dateRange.label"),[l,d]=useState(null),[u,m]=useState(o),[h,f$1]=useState("start"),[p,v]=useState(null),[C,g$1]=useState((o[0]||rr()).locale(i)),[x,b]=useState(""),[y,k]=useState(""),[S,P]=useState(false),[I,w]=useState(false),M=jt__default.useRef(o);useEffect(()=>{let[q,V]=o,[B,G]=M.current,X=me=>me&&typeof me.isSame=="function",pe=!(q===null&&B===null||X(q)&&X(B)&&q.isSame(B,"day")),oe=!(V===null&&G===null||X(V)&&X(G)&&V.isSame(G,"day"));(pe||oe)&&(m(o),o[0]&&X(o[0])&&g$1(o[0].locale(i))),M.current=o;},[o,i]),useEffect(()=>{b(u[0]?u[0].locale(i).format(oa):""),k(u[1]?u[1].locale(i).format(oa):""),P(false),w(false);},[u,i]);let N=(q,V)=>{let B=V.trim(),G=q==="start"?P:w;if(!B){let oe=q==="start"?[null,u[1]]:[u[0],null];G(false),m(oe);return}let X=rr(B,oa,true).locale(i);if(!X.isValid()){G(true);return}G(false);let pe=[...u];if(q==="start")pe[0]=X,pe[1]&&X.isAfter(pe[1],"day")&&(pe[1]=null),f$1(pe[1]?"start":"end");else {let oe=pe[0];oe&&X.isBefore(oe,"day")?(pe=[X,null],f$1("end")):(pe[1]=X,f$1("start"));}m(pe),g$1(X);},T=q=>{d(q.currentTarget);},R=()=>{d(null),f$1("start"),v(null);},A=!!l,L=q=>{if(!q)return;let V=[...u];if(h==="start")V=[q,null],f$1("end");else {let B=V[0];B&&q.isBefore(B)?(V=[q,null],f$1("end")):(V=[B,q],f$1("start"));}m(V);},$=q=>{let V=rr().locale(i),B=[null,null];switch(q){case "today":B=[V,V];break;case "week":B=[V.startOf("week"),V.endOf("week")];break;case "month":B=[V.startOf("month"),V.endOf("month")];break}m(B),f$1("start"),g$1(V);},j=()=>{r&&r(u),R();},O=()=>{m(o),f$1("start"),R();},z=useCallback(q=>{let{day:V,...B}=q,[G,X]=u,pe=G?V.isSame(G,"day"):false,oe=X?V.isSame(X,"day"):false,me=G&&X?V.isBetween(G,X,"day","()"):false,xe=false;return h==="end"&&G&&!X&&p&&V.isAfter(G,"day")&&V.isBefore(p.add(1,"day"),"day")&&(xe=true),f(nb,{...B,day:V,disableMargin:true,isStart:pe,isEnd:oe,isInRange:me||xe,onMouseEnter:()=>v(V)})},[u,h,p]),H=q=>q?q.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:u[0]?`${H(u[0])} - ${H(u[1])}`:"",onClick:T,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Hr}},InputProps:{readOnly:true,sx:{fontSize:Hr,"& .orb-inp":{fontSize:Hr},paddingRight:"4px"},endAdornment:f(ae,{className:"orb-date-range-calendar-trigger",size:"small",onClick:T,tooltip:s,children:f(Pt,{name:"calendar",size:16})})}}),g(ei,{open:A,anchorEl:l,onClose:R,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(ie,{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:oa,value:x,error:S,size:"small",onFocus:()=>f$1("start"),onChange:q=>{b(q.target.value),S&&P(false);},onBlur:()=>N("start",x),onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),N("start",x));},sx:{"& .orb-inp":{fontSize:Hr,py:.75},"& label":{fontSize:Hr}}}),f(Od,{color:"action",fontSize:"small"}),f(He,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:oa,value:y,error:I,size:"small",onFocus:()=>{u[0]&&f$1("end");},onChange:q=>{k(q.target.value),I&&w(false);},onBlur:()=>N("end",y),onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),N("end",y));},sx:{"& .orb-inp":{fontSize:Hr,py:.75},"& label":{fontSize:Hr}}})]})}),f("div",{className:"orb-date-range-shortcuts",children:g(ie,{direction:"row",spacing:1,justifyContent:"center",children:[f(Ct,{label:n("dateRange.today"),onClick:()=>$("today"),clickable:true,size:"small",variant:"outlined"}),f(Ct,{label:n("dateRange.thisWeek"),onClick:()=>$("week"),clickable:true,size:"small",variant:"outlined"}),f(Ct,{label:n("dateRange.thisMonth"),onClick:()=>$("month"),clickable:true,size:"small",variant:"outlined"})]})}),f("div",{className:"orb-date-range-calendar",children:f(Ed,{dateAdapter:Ya,adapterLocale:i,children:f(Ad,{value:null,referenceDate:C,onMonthChange:g$1,onYearChange:g$1,onChange:L,slots:{day:z},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),f(Rt,{}),g(ie,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[f(Se,{size:"small",onClick:O,color:"inherit",children:n("common.cancel")}),f(Se,{size:"small",variant:"contained",onClick:j,children:n("common.done")})]})]})]})};var Di={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},sb={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"},lb=["contains","notContains",">",">=","<","<=","equals"],Up=["=","!=",">","<",">=","<=","between"],to="0.85rem",cb=({field:t,value:o,onChange:r})=>{let{t:n}=se(),[a,i]=useState(null),[s,l]=useState(null),[d,u]=useState(null),[m,h]=useState(""),[f$1,p]=useState(""),[v,C]=useState(""),[g$1,x]=useState("");useEffect(()=>{let T=setTimeout(()=>{x(v);},1e3);return ()=>clearTimeout(T)},[v]);let b=o?.operator||(t.type==="number"?"=":"equals"),y=o?.value,k=T=>{let R=sb[T];return R?n(R):T},S=T=>{i(a?null:T.currentTarget);},P=T=>{r({...o,operator:T,value:y}),i(null);},I={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:to}},InputProps:{sx:{fontSize:to}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:to,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},w=t.type||"text";if(w==="date"){let R=(A=>{if(!A)return [null,null];if(Array.isArray(A)&&A.length===2){let L=A[0]?rr.isDayjs(A[0])?A[0]:rr(A[0]):null,$=A[1]?rr.isDayjs(A[1])?A[1]:rr(A[1]):null;return [L,$]}return rr.isDayjs(A)||typeof A=="string"?[rr.isDayjs(A)?A:rr(A),null]:[null,null]})(y);return f(_p,{label:t.label,value:R,onChange:A=>r({value:A,operator:"between"})})}if(w==="number"&&b==="between"){let T=()=>{r({value:[m,f$1],operator:"between"}),l(null);},R=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return g(e,{children:[f(He,{...I,label:t.label,value:R,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...I.InputProps,startAdornment:f(sr,{position:"start",children:f(lt,{title:k("between"),children:f(ae,{size:"small",onClick:S,sx:{width:24,height:24,fontSize:to},children:Di.between})})}),readOnly:true},onClick:A=>l(s?null:A.currentTarget)}),f(Yt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:to,minHeight:"auto",py:.5}}},children:Up.map(A=>g("option",{selected:A===b,onClick:()=>P(A),children:[f("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Di[A]}),f($t,{primary:k(A),primaryTypographyProps:{fontSize:to}})]},A))}),f(ei,{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:m,onChange:A=>h(A.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:to}},InputProps:{sx:{fontSize:to}}}),f(Fd,{color:"action"}),f(He,{size:"small",label:n("smartFilter.max"),type:"number",value:f$1,onChange:A=>p(A.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:to}},InputProps:{sx:{fontSize:to}}}),f(Se,{variant:"contained",size:"small",onClick:T,children:n("common.ok")})]})})]})}if(t.isValueHelp||w==="value-help"){let T=t.valueHelp?.mode||"single";return f(yp,{...I,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:y??(T==="multiple"?[]:null),mode:T,onChange:R=>r({value:R,operator:T==="multiple"?"anyOf":"equals"})})}if(w==="select")return g(Ht,{size:"small",fullWidth:true,label:t.label,value:y||"",onChange:T=>r({...o,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(y)?y:[],R=t.options?.filter(z=>z.label.toLowerCase().includes(g$1.toLowerCase()))||[],A=z=>t.options?.find(H=>H.value===z)?.label||z,L=T.map(A),$=L.length===0?n("common.none"):L.length>2?`${L.slice(0,2).join(", ")} +${L.length-2}`:L.join(", "),j=()=>{u(null),C(""),x("");},O=z=>{let H=T.includes(z)?T.filter(q=>q!==z):[...T,z];r({...o,value:H,operator:"anyOf"});};return g("div",{className:"orb-fld",children:[f("label",{children:t.label}),g(Se,{variant:"outlined",size:"small",onClick:z=>u(d?null:z.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:to,fontWeight:400},children:[f("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:$}),f(Vo,{fontSize:"small"})]}),f(Yt,{anchorEl:d,open:!!d,onClose:j,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:g("div",{onClick:z=>z.stopPropagation(),sx:{display:"grid",gap:.35},children:[f(He,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:f(sr,{position:"start",children:f(Br,{fontSize:"small"})}),sx:{fontSize:to}},value:v,onChange:z=>C(z.target.value),onKeyDown:z=>z.stopPropagation()}),R.length>0?R.map(z=>{let H=T.includes(z.value);return g("div",{role:"option","aria-selected":H,tabIndex:0,className:`orb-menu-item ${H?"orb-selected":""}`,onClick:()=>O(z.value),onKeyDown:q=>{(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),O(z.value));},children:[f(Tt,{checked:H,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),f($t,{primary:z.label})]},String(z.value))}):f("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let M=w==="number"?Up:lb;return g(e,{children:[f(He,{...I,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:y||"",type:w==="number"?"number":"text",onChange:T=>r({...o,value:T.target.value,operator:b}),InputProps:{...I.InputProps,startAdornment:f(sr,{position:"start",children:f(lt,{title:k(b),children:f(ae,{className:"orb-filter-operator-trigger",size:"small",onClick:S,onMouseDown:T=>T.preventDefault(),sx:{width:24,height:24,fontSize:to,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Di[b]})})}),endAdornment:t.hasSearchIcon?f(sr,{position:"end",children:f(Br,{color:"action"})}):void 0}}),f(Yt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:to,minHeight:"auto",py:.5}}},children:M.map(T=>g("option",{selected:T===b,onClick:()=>P(T),children:[f("span",{className:"orb-filter-operator-symbol",children:Di[T]}),f($t,{primary:k(T),primaryTypographyProps:{fontSize:to}})]},T))})]})},Wo=({fields:t,filters:o,onFilterChange:r,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:l,onVariantSetDefault:d,onSearch:u,loading:m=false,appId:h,tableKey:f$1,currentLayout:p,currentLayoutId:v,layoutRefs:C,variantService:g$1,serviceUrl:x})=>{let{t:b}=se(),[y,k]=useState(true),[S,P]=useState(null),[I,w]=useState(t.filter(R=>!R.hidden).map(R=>R.id)),M=(R,A)=>{r({...o,[R]:A});},N=R=>{I.includes(R)?w(I.filter(A=>A!==R)):w([...I,R]);};return g(Ne,{className:`orb-smart-filter ${y?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[y?g(e,{children:[g("div",{className:"orb-smart-filter-header",children:[h?f(Wp,{appId:h,tableKey:f$1,currentFilters:{values:o,visibleFields:I},currentLayout:p,currentLayoutId:v,layoutRefs:C,onLoad:R=>{if(!R.filters)return;let A=null;if(Array.isArray(R.filters)){let L=f$1||"default",$=R.filters.find(j=>j.scope===L);A=$?$.filters:null;}else A=R.filters;A&&(A.values||A.visibleFields?(A.visibleFields&&Array.isArray(A.visibleFields)&&w(A.visibleFields),A.values&&r(A.values)):r(A)),i&&i(R);},variantService:g$1,serviceUrl:x,currentVariantId:a}):f(Mi,{variants:n,currentVariantId:a,onLoad:i,onSave:R=>{s&&s({...R,filters:{values:o,visibleFields:I}});},onDelete:l,onSetDefault:d}),g("div",{className:"orb-smart-filter-actions",children:[f(lt,{title:b("smartFilter.addFilters"),children:f(Se,{className:"orb-smart-filter-adapt",onClick:R=>P(S?null:R.currentTarget),size:"small",color:"primary",startIcon:f(sp,{fontSize:"small"}),sx:{textTransform:"none",fontSize:to,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:u,disabled:m,children:m?f(Xo,{size:16}):f(Pt,{name:"play",size:16})}),g(Yt,{anchorEl:S,open:!!S,onClose:()=>P(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:to,minHeight:32}}}},children:[f("option",{disabled:true,children:f($t,{primary:b("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:to}})}),f(Rt,{}),t.map(R=>g("option",{onClick:()=>N(R.id),children:[f(Tt,{checked:I.includes(R.id),size:"small"}),f($t,{primary:R.label,primaryTypographyProps:{fontSize:to}})]},R.id))]})]})]}),f("div",{className:"orb-smart-filter-grid",children:f(Js,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(R=>I.includes(R.id)).map(R=>f(Js,{size:1,children:f(cb,{field:R,value:o[R.id]||{value:"",operator:R.type==="number"?"=":"equals"},onChange:A=>M(R.id,A)})},R.id))})})]}):null,f("div",{className:"orb-smart-filter-toggle",children:f(ae,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>k(!y),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:y?f(ni,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):f(Vo,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};var Kp=({layouts:t,currentLayoutId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=se(),[l,d]=useState(null),[u,m]=useState(false),[h,f$1]=useState(""),[p,v]=useState(""),[C,g$1]=useState({isDefault:false,isPublic:false}),x=t.find(I=>I.id===o),b=I=>{d(I.currentTarget);},y=()=>{d(null);},k=I=>{r(I),y();},S=()=>{f$1(""),v(""),g$1({isDefault:false,isPublic:false}),m(true),y();},P=()=>{h.trim()&&(n({name:h,description:p,...C}),m(false));};return g("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[f(lt,{title:s("layout.layoutOptions"),children:f(ae,{onClick:b,color:x?"primary":"default",size:"small",children:f(mp,{fontSize:"small"})})}),g(Yt,{anchorEl:l,open:!!l,onClose:y,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(zo,{children:f(Sr,{fontSize:"small"})}),f($t,{children:s("layout.saveCurrentLayout")})]}),f(Rt,{}),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:()=>k(I),selected:I.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(E,{variant:"body2",fontWeight:I.id===o?"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:M=>M.stopPropagation(),children:[f(lt,{title:I.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:f(ae,{size:"small",onClick:M=>{M.stopPropagation(),i(I.id);},children:I.isDefault?f(dp,{fontSize:"small",color:"warning"}):f(cp,{fontSize:"small"})})}),f(lt,{title:s("common.delete"),children:f(ae,{size:"small",color:"error",onClick:M=>{M.stopPropagation(),a(I.id);},children:f(oi,{fontSize:"small"})})})]})]})},I.id||w))]}),f(Et,{open:u,onClose:()=>m(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:g(e,{children:[f(Se,{variant:"ghost",onClick:()=>m(false),children:s("common.cancel")}),f(Se,{onClick:P,variant:"primary",disabled:!h.trim(),children:s("common.save")})]}),children:g("div",{className:"orb-layout-save-form",children:[f(He,{label:s("layout.layoutName"),value:h,onChange:I=>f$1(I.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(I=>I.name===h)&&f(E,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),f(He,{label:s("layout.layoutDescription"),value:p,onChange:I=>v(I.target.value),fullWidth:true,size:"small"}),f(Tt,{className:"orb-layout-save-option",checked:C.isDefault,onChange:I=>g$1({...C,isDefault:I.target.checked}),label:s("layout.useAsDefault")}),f(Tt,{className:"orb-layout-save-option",checked:C.isPublic,onChange:I=>g$1({...C,isPublic:I.target.checked}),label:s("layout.publicAllUsers")})]})})]})};var gn=({appId:t,tableKey:o="default",currentLayoutData:r,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:l,onSuccess:d})=>{let{t:u}=se(),[m,h]=useState([]),[f$1,p]=useState(""),v=`orbcafe.layouts.${t}.${o}`,C=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:o,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 M=JSON.parse(w);return Array.isArray(M)?M:[]}catch{return []}},[v]),b=useCallback(w=>{try{localStorage.setItem(v,JSON.stringify(w));}catch{}},[v]);useEffect(()=>{i!==void 0&&p(i);},[i]),useEffect(()=>{if(a&&m.length>0){let w=m.find(M=>M.id===a);w&&(p(w.id),n(w));}},[a,m,n]);let y=useCallback(async()=>{if(t){if(!s){let w=x();h(w);let M=w.find(N=>N.isDefault);M&&!f$1&&!a&&(p(M.id),n(M));return}try{let w=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!w.ok)throw new Error("LAYOUT_FETCH_FAILED");let N=(await w.json()).map(C);h(N);let T=N.find(R=>R.isDefault);T&&!f$1&&!a&&(p(T.id),n(T));}catch(w){console.error("Error fetching layouts",w);let M=x();h(M);let N=M.find(T=>T.isDefault);N&&!f$1&&!a&&(p(N.id),n(N)),l&&l(u("layout.toast.loadFallback"));}}},[t,o,s,l,f$1,n,a,x,u]);return useEffect(()=>{y();},[t,o]),f(Kp,{layouts:m,currentLayoutId:f$1,onLoad:w=>{p(w.id),n(w);},onSave:async w=>{let M=m.find(R=>R.name===w.name),N=M?M.id:Date.now().toString(),T={id:N,...w,createdAt:new Date().toISOString(),layoutData:r,isDefault:w.isDefault??false,isPublic:w.isPublic??false};if(!s){let A=m.some(L=>L.id===N)?m.map(L=>L.id===N?T:L):[...m,T];h(A),b(A),p(N),n(T),d&&d(u("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(u("layout.toast.saveSuccess")),await y(),p(N),n(T);}catch(R){console.error("Error saving layout",R);let L=m.some($=>$.id===N)?m.map($=>$.id===N?T:$):[...m,T];h(L),b(L),p(N),n(T),d&&d(u("layout.toast.saveLocalSuccess")),l&&l(u("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async w=>{if(!s){let M=m.filter(N=>N.id!==w);h(M),b(M),f$1===w&&p(""),d&&d(u("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(w)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f$1===w&&p(""),d&&d(u("layout.toast.deleteSuccess")),await y();}catch(M){console.error("Error deleting layout",M);let N=m.filter(T=>T.id!==w);h(N),b(N),f$1===w&&p(""),d&&d(u("layout.toast.deleteLocalSuccess")),l&&l(u("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async w=>{if(!s){let M=m.map(N=>({...N,isDefault:N.id===w}));h(M),b(M),d&&d(u("layout.toast.defaultLocalSuccess"));return}try{let M=m.find(T=>T.id===w);if(!M)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...M,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(u("layout.toast.defaultSuccess")),await y();}catch(M){console.error("Error setting default",M);let N=m.map(T=>({...T,isDefault:T.id===w}));h(N),b(N),d&&d(u("layout.toast.defaultLocalSuccess")),l&&l(u("layout.toast.backendUnavailableDefaultLocal"));}}})};var Ni=(t,o)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let r=t.filters.find(a=>a.scope===o);if(r)return r.filters;let n=t.filters.find(a=>a.scope==="default");return n?n.filters:null}return typeof t.filters=="object"?t.filters:null},Ai=(t,o)=>{if(!t)return {layout:null,layoutId:null};let r=null,n=null;if(Array.isArray(t.layoutRefs)){let a=t.layoutRefs.find(i=>i.tableKey===o);a&&(r=a.layoutId);}return !r&&t.layoutId&&(r=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(n=t.layout),{layoutId:r,layout:n}};function Xp(t,o,r){return o[r]<t[r]?-1:o[r]>t[r]?1:0}function db(t,o){return t==="desc"?(r,n)=>Xp(r,n,o):(r,n)=>-Xp(r,n,o)}function pb(t,o){let r=t.map((n,a)=>[n,a]);return r.sort((n,a)=>{let i=o(n[0],a[0]);return i!==0?i:n[1]-a[1]}),r.map(n=>n[0])}var hn=t=>{let o=!!t.disableGrouping,r=!!t.disableSorting,n=useCallback(Z=>{let Y=String(Z?.label??Z?.id??"").length*9+64,he=typeof Z?.minWidth=="number"?Z.minWidth:0;return Math.max(100,he,Y)},[]),a=useCallback(()=>(t.columns||[]).filter(Z=>!!Z?.numeric).map(Z=>Z.id),[t.columns]),[i,s]=useState(""),[l,d]=useState(t.order||"asc"),[u,m]=useState(t.orderBy||""),[h,f]=useState([]),[p,v]=useState(t.page||0),[C,g]=useState(t.rowsPerPage||20),[x,b]=useState(t.selected||[]),[y,k]=useState(t.columns?t.columns.map(Z=>Z.id):[]),[S,P]=useState(t.columns?t.columns.map(Z=>Z.id):[]),[I,w]=useState(t.showSummary||false),[M,N]=useState(()=>a()),[T,R]=useState([]),[A,L]=useState(new Set),[$,j]=useState(()=>{let Z={};return (t.columns||[]).forEach(W=>{Z[W.id]=n(W);}),Z}),[O,z]=useState(null),[H,q]=useState(null),[V,B]=useState(null),[G,X]=useState(null),[pe,oe]=useState(false),[me,xe]=useState(""),[ze,Pe]=useState(""),Te=o?[]:T,Be=useCallback(Z=>{if(o){R([]),L(new Set),q(null);return}R(Z);},[o]);useEffect(()=>{o&&(R([]),L(new Set),q(null));},[o]),useEffect(()=>{r&&(d("asc"),m(""),f([]));},[r]),useEffect(()=>{t.layout&&wt(t.layout);},[t.layout]),useEffect(()=>{if(r){d("asc"),m("");return}t.order!==void 0&&d(t.order),t.orderBy!==void 0&&m(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 Z=a();N(W=>W.filter(he=>Z.includes(he)));},[a]),useEffect(()=>{j(Z=>{let W={...Z};return (t.columns||[]).forEach(Y=>{W[Y.id]===void 0&&(W[Y.id]=n(Y));}),W});},[t.columns,n]),useEffect(()=>{P(Z=>{let W=(t.columns||[]).map(Ke=>Ke.id),Y=new Set(W),he=Z.filter(Ke=>Y.has(Ke)),Ce=new Set(he),Ae=W.filter(Ke=>!Ce.has(Ke)),$e=[...he,...Ae];return $e.length===Z.length&&$e.every((Ke,Ye)=>Ke===Z[Ye])?Z:$e});},[t.columns]);let le=useMemo(()=>{let Z=t.columns||[];if(S.length===0)return Z;let W=new Map(Z.map(Ce=>[Ce.id,Ce])),Y=[],he=new Set;return S.forEach(Ce=>{let Ae=W.get(Ce);Ae&&(Y.push(Ae),he.add(Ce));}),Z.forEach(Ce=>{he.has(Ce.id)||Y.push(Ce);}),Y},[t.columns,S]),fe=useMemo(()=>{let Z=t.rows||[];return i&&(Z=Z.filter(W=>Object.keys(W).some(Y=>String(W[Y]).toLowerCase().includes(i.toLowerCase())))),Z},[t.rows,i]),Ve=useMemo(()=>{if(r||t.onSortChange)return fe;if(h.length>0){let Z=[...fe];return Z.sort((W,Y)=>{for(let he of h){let Ce=W?.[he.field],Ae=Y?.[he.field];if(!(Ce==null&&Ae==null)){if(Ce==null)return he.direction==="asc"?-1:1;if(Ae==null)return he.direction==="asc"?1:-1;if(Ce<Ae)return he.direction==="asc"?-1:1;if(Ce>Ae)return he.direction==="asc"?1:-1}}return 0}),Z}return u?pb(fe,db(l,u)):fe},[fe,l,u,h,t.onSortChange,r]),et=useCallback(Z=>{if(Te.length===0)return Z.map(Ae=>({type:"row",data:Ae,id:Ae[t.rowKey||"id"]}));let W=[...Z].sort((Ae,$e)=>{for(let Ke of Te){if(Ae[Ke]<$e[Ke])return -1;if(Ae[Ke]>$e[Ke])return 1}return 0}),Y=(Ae,$e=0)=>{if($e>=Te.length)return Ae;let Ke=Te[$e],Ye={},ut=[];return Ae.forEach(gt=>{let Mt=gt[Ke],bt=`${Ke}:${Mt}`;Ye[bt]||(Ye[bt]={key:bt,field:Ke,value:Mt,children:[],count:0,level:$e},ut.push(Ye[bt])),Ye[bt].children.push(gt),Ye[bt].count++;}),ut.forEach(gt=>{gt.children&&(gt.children=Y(gt.children,$e+1));}),ut},he=Y(W),Ce=(Ae,$e="")=>{let Ke=[];return Ae.forEach(Ye=>{if(Ye.children){let ut=$e?`${$e}>${Ye.key}`:Ye.key,gt=A.has(ut);Ke.push({type:"group",id:ut,field:Ye.field,value:Ye.value,level:Ye.level,count:Ye.count,isExpanded:gt,childIds:(function Mt(bt){let F=[];return bt.children.forEach(Q=>{Q.children?F=F.concat(Mt(Q)):F.push(Q[t.rowKey||"id"]);}),F})(Ye)}),gt&&(Ke=Ke.concat(Ce(Ye.children,ut)));}else Ke.push({type:"row",data:Ye,id:Ye[t.rowKey||"id"],level:Te.length});}),Ke};return Ce(he)},[Te,A,t.rowKey]),rt=useCallback(Z=>{if(Te.length===0)return [];let W=[...Z].sort((Ce,Ae)=>{for(let $e of Te){if(Ce[$e]<Ae[$e])return -1;if(Ce[$e]>Ae[$e])return 1}return 0}),Y=[],he=(Ce,Ae,$e)=>{if(Ae>=Te.length)return;let Ke=Te[Ae],Ye=new Map;Ce.forEach(ut=>{let gt=ut[Ke],Mt=Ye.get(gt);Mt?Mt.push(ut):Ye.set(gt,[ut]);}),Ye.forEach((ut,gt)=>{let Mt=`${Ke}:${gt}`,bt=$e?`${$e}>${Mt}`:Mt;Y.push(bt),he(ut,Ae+1,bt);});};return he(W,0,""),Y},[Te]),at=useMemo(()=>et(Ve),[Ve,et]),K=useMemo(()=>rt(Ve),[Ve,rt]),Re=useMemo(()=>{let Z=(t.rows||[]).length;return typeof t.count=="number"&&t.count>Z},[t.count,t.rows]),ye=useMemo(()=>Re?at:C>0?at.slice(p*C,p*C+C):at,[at,p,C,Re]),Oe=useMemo(()=>Re&&typeof t.count=="number"?t.count:at.length,[at.length,Re,t.count]),nt=Z=>{L(W=>{let Y=new Set(W);return Y.has(Z)?Y.delete(Z):Y.add(Z),Y});},Ze=Z=>{let W=K.filter(Y=>Y===Z||Y.startsWith(`${Z}>`));L(Y=>{let he=new Set(Y);return W.forEach(Ce=>he.add(Ce)),he});},xt=Z=>{L(W=>{let Y=new Set(W);return Array.from(Y).forEach(he=>{(he===Z||he.startsWith(`${Z}>`))&&Y.delete(he);}),Y});},It=Z=>{if(!Z){L(new Set);return}L(new Set(K));},Lt=Z=>{let W=K.filter(Y=>Y.startsWith(`${Z}>`));return W.length===0?A.has(Z):A.has(Z)&&W.every(Y=>A.has(Y))},Nt=Z=>{if(r)return;h.length>0&&f([]);let W=u===Z&&l==="asc",Y=u===Z&&l==="desc";if(t.onSortChange){W?t.onSortChange(Z,"desc"):Y?t.onSortChange("","asc"):t.onSortChange(Z,"asc");return}W?(d("desc"),m(Z)):Y?(d("asc"),m("")):(d("asc"),m(Z));},te=Z=>{if(r){d("asc"),m(""),f([]);return}let W=Z.filter(Y=>Y&&Y.field);f(W),W.length>0&&m("");},Ge=()=>{f([]);},Le=(Z,W)=>{j(Y=>({...Y,[Z]:W}));},ce=Z=>{if(Z.target.checked){let W=fe.map(Y=>Y[t.rowKey||"id"]);b(W),t.onSelectionChange&&t.onSelectionChange(W);return}b([]),t.onSelectionChange&&t.onSelectionChange([]);},ve=(Z,W)=>{let Y=W[t.rowKey||"id"],he=x.indexOf(Y),Ce=[];he===-1?Ce=Ce.concat(x,Y):he===0?Ce=Ce.concat(x.slice(1)):he===x.length-1?Ce=Ce.concat(x.slice(0,-1)):he>0&&(Ce=Ce.concat(x.slice(0,he),x.slice(he+1))),b(Ce),t.onSelectionChange&&t.onSelectionChange(Ce);},ee=Z=>{v(Z),t.onPageChange&&t.onPageChange(Z);},be=Z=>{g(Z),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(Z);},De=Z=>{let W=y.indexOf(Z),Y=[...y];W===-1?Y.push(Z):Y.splice(W,1),k(Y);},je=Z=>{if(o)return;let W=Te.indexOf(Z),Y=[...Te];W===-1?Y.push(Z):Y.splice(W,1),Be(Y);},it=Z=>{a().includes(Z)&&N(Y=>Y.includes(Z)?Y.filter(he=>he!==Z):[...Y,Z]);},dt=(Z,W)=>{!Z||!W||Z===W||P(Y=>{let he=Y.indexOf(Z),Ce=Y.indexOf(W);if(he===-1||Ce===-1)return Y;let Ae=[...Y];return Ae.splice(he,1),Ae.splice(Ce,0,Z),Ae});},Ft=Z=>{let W=Z?.active?.id,Y=Z?.over?.id;typeof W=="string"&&typeof Y=="string"&&dt(W,Y);},qt=Z=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:y,columnOrder:S,order:r?"asc":l,orderBy:r?"":u,sortBy:r?[]:h,grouping:Te,columnWidths:$,showSummary:I,summaryColumns:M});},zt=Z=>{let{layout:W,layoutId:Y}=Ai(Z,t.tableKey||"default");Y?(Pe(Y),xe(Y)):(Pe(""),xe("")),W&&(W.visibleColumns&&k(W.visibleColumns),Array.isArray(W.columnOrder)&&P(W.columnOrder),r?(d("asc"),m(""),f([])):(W.order&&d(W.order),W.orderBy&&m(W.orderBy),Array.isArray(W.sortBy)&&f(W.sortBy)),W.grouping&&Be(W.grouping),W.columnWidths&&j(W.columnWidths),W.showSummary!==void 0&&w(!!W.showSummary),Array.isArray(W.summaryColumns)&&N(W.summaryColumns));},wt=Z=>{let W=Z?.layoutData||Z?.layout||Z||{};W.visibleColumns&&k(W.visibleColumns),Array.isArray(W.columnOrder)&&P(W.columnOrder),r?(d("asc"),m(""),f([])):(W.order&&d(W.order),W.orderBy!==void 0&&m(W.orderBy),Array.isArray(W.sortBy)&&f(W.sortBy)),W.grouping&&Be(W.grouping),W.columnWidths&&j(W.columnWidths),W.showSummary!==void 0&&w(!!W.showSummary),Array.isArray(W.summaryColumns)&&N(W.summaryColumns),L(new Set),v(0),Z?.id&&xe(Z.id),Pe("");};useEffect(()=>{t.layout&&zt({layout:t.layout});},[t.layout]);let Vt=Z=>{Z.preventDefault(),X(G===null?{mouseX:Z.clientX+2,mouseY:Z.clientY-6}:null);},ft=()=>{X(null);},Dt=useMemo(()=>{if(!I)return {};let Z={};t.columns.forEach(Y=>{if(Y.numeric&&M.includes(Y.id)){let he=fe.reduce((Ce,Ae)=>{let $e=parseFloat(Ae[Y.id]);return Ce+(isNaN($e)?0:$e)},0);Z[Y.id]=he.toFixed(2);}else Z[Y.id]="";});let W=t.columns.find(Y=>y.includes(Y.id)&&!Y.numeric);return W&&!W.numeric&&(Z[W.id]="Total"),Z},[fe,t.columns,I,M,y]),st=()=>{if(!t.columns||!fe)return;let Z=t.columns.map(Ae=>Ae.label).join(","),W=fe.map(Ae=>t.columns.map($e=>{let Ke=Ae[$e.id];return `"${(Ke==null?"":String(Ke)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
2
|
-
`),
|
|
3
|
-
${W}`,he=encodeURI(Y),Ce=document.createElement("a");Ce.setAttribute("href",he),Ce.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce);},Ot=()=>{oe(true);},Xt=()=>{oe(false);};return {isMobile:false,columns:le,order:l,setOrder:d,orderBy:u,setOrderBy:m,sortBy:h,setSortBy:f,applyMultiSort:te,clearMultiSort:Ge,columnOrder:S,setColumnOrder:P,filterText:i,setFilterText:s,visibleColumns:y,setVisibleColumns:k,showSummary:I,setShowSummary:w,summaryColumns:M,grouping:Te,setGrouping:Be,expandedGroups:A,setExpandedGroups:L,groupAnchorEl:H,setGroupAnchorEl:q,summaryAnchorEl:V,setSummaryAnchorEl:B,columnWidths:$,setColumnWidths:j,anchorEl:O,setAnchorEl:z,contextMenu:G,setContextMenu:X,sensors:void 0,sortedAndFilteredRows:Ve,visibleRows:ye,summaryRow:Dt,page:p,setPage:ee,rowsPerPage:C,setRowsPerPage:be,totalDisplayCount:Oe,selected:x,setSelected:b,isAllExpanded:K.length>0&&K.every(Z=>A.has(Z)),handleColumnResize:Le,handleRequestSort:Nt,handleSelectAllClick:ce,handleClick:ve,toggleSummaryColumn:it,handleDragEnd:Ft,handleColumnReorder:dt,handleExport:st,handleContextMenu:Vt,handleCloseContextMenu:ft,toggleColumnVisibility:De,toggleGroupExpand:nt,toggleGroupField:je,handleToggleAll:It,handleExpandGroupRecursively:Ze,handleCollapseGroupRecursively:xt,isGroupFullyExpanded:Lt,handleLayoutLoad:wt,handleVariantLoad:zt,handleLayoutSave:qt,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:y,order:r?"asc":l,orderBy:r?"":u,sortBy:r?[]:h,columnOrder:S,grouping:Te,columnWidths:$,showSummary:I,summaryColumns:M},currentLayoutId:me,layoutIdToLoad:ze,onPageChange:ee,onRowsPerPageChange:be,graphReportOpen:pe,handleOpenGraphReport:Ot,handleCloseGraphReport:Xt}};var q1=t=>f("tbody",{...t}),X1=({align:t,...o})=>f("td",{align:t==="inherit"?void 0:t,...o}),Z1=t=>f("div",{...t}),Y1=t=>f("thead",{...t}),Q1=t=>f("tr",{...t}),Jo=t=>{let{t:o}=se(),r="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:u,fitContainer:m=false,fullWidth:h=false,maxHeight:f$1,loading:p=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:C,filterConfig:g$1,rowKey:x,tableKey:b="default",graphReport:y,quickCreate:k,quickEdit:S,quickDelete:P,serviceUrl:I,disableGrouping:w=false,disableSorting:M=false}=t,N=n||o("table.title.default"),{isMobile:T,columns:R,order:A,orderBy:L,filterText:$,setFilterText:j,visibleColumns:O,showSummary:z,setShowSummary:H,summaryColumns:q,grouping:V,setGrouping:B,expandedGroups:G,groupAnchorEl:X,setGroupAnchorEl:pe,summaryAnchorEl:oe,setSummaryAnchorEl:me,columnWidths:xe,anchorEl:ze,setAnchorEl:Pe,contextMenu:Te,sensors:Be,sortedAndFilteredRows:le,summaryRow:fe,visibleRows:Ve,isAllExpanded:et,page:rt,setPage:at,rowsPerPage:K,setRowsPerPage:Re,totalDisplayCount:ye,setSelected:Oe,handleColumnResize:nt,handleRequestSort:Ze,handleSelectAllClick:xt,handleClick:It,toggleSummaryColumn:Lt,handleDragEnd:Nt,handleExport:te,handleContextMenu:Ge,handleCloseContextMenu:Le,toggleColumnVisibility:ce,toggleGroupExpand:ve,handleToggleAll:ee,handleExpandGroupRecursively:be,handleCollapseGroupRecursively:De,isGroupFullyExpanded:je,handleLayoutLoad:it,handleVariantLoad:dt,handleLayoutSave:Ft,effectiveAppId:qt,currentLayoutData:zt,currentLayoutId:wt,layoutIdToLoad:Vt,graphReportOpen:ft,handleOpenGraphReport:Dt,handleCloseGraphReport:st}=hn(t),Ot=y?.enabled??false,Xt=Ot&&(y?.interaction?.enabled??true),Z=Ti(),W=!!k?.enabled,Y=!!S?.enabled,he=!!P?.enabled,Ce=k?.fields,Ae=k?.excludeFields||[],$e=k?.initialValues||{},[Ke,Ye]=jt__default.useState(false),[ut,gt]=jt__default.useState(false),[Mt,bt]=jt__default.useState({}),[F,Q]=jt__default.useState(false),[ge,ke]=jt__default.useState(false),[Je,qe]=jt__default.useState({}),[St,ht]=jt__default.useState(false),[mt,yt]=jt__default.useState(false),oo=p||ut||ge||mt,At=jt__default.useMemo(()=>{let re=[...R];if(Array.isArray(Ce)&&Ce.length>0){let ue=new Set(Ce);re=re.filter(J=>ue.has(J.id));}if(Ae.length>0){let ue=new Set(Ae);re=re.filter(J=>!ue.has(J.id));}return re.filter(ue=>!!ue?.id)},[R,Ae,Ce]),Zt=x||"id",Bt=jt__default.useMemo(()=>{let re=new Set(s);return le.filter(ue=>re.has(ue?.[Zt]))},[s,le,Zt]),Gt=Bt.length===1?Bt[0]:null,Wt=S?.fields,eo=S?.excludeFields||[],ro=S?.editableFields||[],ho=S?.nonEditableFields||[],To=S?.primaryKeys?.length?S.primaryKeys:[Zt],Io=jt__default.useMemo(()=>{let re=[...R];if(Array.isArray(Wt)&&Wt.length>0){let ue=new Set(Wt);re=re.filter(J=>ue.has(J.id));}if(eo.length>0){let ue=new Set(eo);re=re.filter(J=>!ue.has(J.id));}return re.filter(ue=>!!ue?.id)},[R,eo,Wt]),nr=jt__default.useMemo(()=>new Set(To),[To]),yo=jt__default.useMemo(()=>new Set(ro),[ro]),Oo=jt__default.useMemo(()=>new Set(ho),[ho]),Ur=jt__default.useCallback(re=>yo.size>0?yo.has(re):!(Oo.has(re)||nr.has(re)),[yo,Oo,nr]);jt__default.useEffect(()=>{!ft&&Z.hasActiveFilters&&Z.clearAll();},[ft,Z.hasActiveFilters,Z.clearAll]);let Kr=()=>{let re={};At.forEach(ue=>{re[ue.id]=$e[ue.id]??"";}),bt(re),Ye(true);},Ar=()=>{ut||Ye(false);},qr=(re,ue)=>{bt(J=>({...J,[re]:ue}));},Xr=async()=>{if(!k?.onSubmit){Ye(false);return}try{gt(!0),await k.onSubmit(Mt),Ye(!1);}finally{gt(false);}},Mo=()=>{if(!Gt)return;let re={};Io.forEach(J=>{re[J.id]=Gt[J.id]??"";});let ue=S?.getInitialValues?{...re,...S.getInitialValues(Gt)}:re;qe(ue),Q(true);},Er=()=>{ge||Q(false);},Zr=(re,ue)=>{qe(J=>({...J,[re]:ue}));},Ko=async()=>{if(Gt){if(!S?.onSubmit){Q(false);return}try{ke(!0),await S.onSubmit(Je,Gt),Q(!1);}finally{ke(false);}}},ar=()=>{Bt.length!==0&&ht(true);},An=()=>{mt||ht(false);},Lr=async()=>{if(Bt.length===0){ht(false);return}if(!P?.onConfirm){ht(false),Oe([]),l?.([]);return}try{yt(!0),await P.onConfirm(Bt),ht(!1),Oe([]),l?.([]);}finally{yt(false);}},D=le,{fieldMapping:_}=pn({rows:D,config:{...y,title:y?.title||`${N} ${o("graph.reportTitle")}`}}),U=jt__default.useMemo(()=>Xt?Z.applyRows(D,_):D,[Xt,Z.applyRows,D,_]),{model:de}=pn({rows:U,config:{...y,title:y?.title||`${N} ${o("graph.reportTitle")}`,fieldMapping:_}}),Fe=de.table.columns.map(re=>({id:re.id,label:re.label,align:re.align||"left",minWidth:120,numeric:re.align==="right"})),ot=qt?f(gn,{appId:qt,tableKey:b,currentLayoutData:zt,onLayoutLoad:it,targetLayoutId:Vt,activeLayoutId:wt,serviceUrl:I??g$1?.serviceUrl}):null,_e=g(e,{children:[!w&&f(cn,{groupAnchorEl:X,setGroupAnchorEl:pe,grouping:V,setGrouping:B,columns:R}),f(dn,{anchorEl:ze,setAnchorEl:Pe,columns:R,visibleColumns:O,toggleColumnVisibility:ce}),f(vi,{anchorEl:oe,setAnchorEl:me,showSummary:z,setShowSummary:H,columns:R,summaryColumns:q,toggleSummaryColumn:Lt}),f(yi,{contextMenu:Te,handleCloseContextMenu:Le,columns:R,visibleColumns:O,toggleColumnVisibility:ce})]});return T?g("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g$1&&f(Wo,{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:zt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl}),f(wp,{title:N,loading:p,showSummary:z,setShowSummary:H,setAnchorEl:Pe,setSummaryAnchorEl:me,filterText:$,setFilterText:j,sortedAndFilteredRows:le,selected:s,columns:R,visibleColumns:O,summaryRow:fe,handleClick:It,selectionMode:i}),_e]}):g("div",{sx:{width:h?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1&&f("div",{sx:{mb:2},children:f(Wo,{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:p,appId:g$1.appId,tableKey:b,currentLayout:[{tableKey:b,layoutData:zt}],currentLayoutId:wt,layoutRefs:[{tableKey:b,layoutId:wt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl})}),g(Ne,{className:"orb-ctable-surface",sx:{width:h?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":oo?{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"}},...f$1?{height:f$1}:m?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&f(gi,{filterText:$,setFilterText:j,onRowsPerPageChange:Re,rowsPerPage:K,rowsPerPageOptions:v,page:rt,count:ye,onPageChange:at,actions:d,extraTools:u,grouping:V,disableGrouping:w,groupAnchorEl:X,setGroupAnchorEl:pe,showSummary:z,setShowSummary:H,anchorEl:ze,setAnchorEl:Pe,summaryAnchorEl:oe,setSummaryAnchorEl:me,handleExport:te,showCreateButton:W,onOpenCreateDialog:Kr,showEditButton:Y,onOpenEditDialog:Mo,editDisabled:Bt.length!==1,showDeleteButton:he,onOpenDeleteConfirm:ar,deleteDisabled:Bt.length===0,onLayoutSave:C||g$1?.variantService&&g$1?.appId?Ft:void 0,loading:p,layoutManager:ot,onOpenGraphReport:Ot?Dt:void 0}),f("div",{sx:{flex:1,...f$1?{maxHeight:f$1,height:f$1}:m?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:f(DndContext,{sensors:Be,collisionDetection:closestCenter,onDragEnd:Nt,modifiers:[restrictToHorizontalAxis],children:g("table",{className:"orb-tbl orb-ctable",style:{minWidth:h?750:void 0,width:h?"100%":"auto",tableLayout:Object.keys(xe).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:r},"aria-labelledby":"tableTitle",children:[f(fi,{columns:R,visibleColumns:O,order:A,orderBy:L,onRequestSort:Ze,disableSorting:M,onContextMenu:Ge,selectionMode:i,grouping:V,isAllExpanded:et,handleToggleAll:ee,rowCount:le.length,numSelected:s.length,onSelectAllClick:xt,columnWidths:xe,onColumnResize:nt}),f(bi,{visibleRows:Ve,columns:R,visibleColumns:O,selectionMode:i,selected:s,orderBy:L,loading:p,expandedGroups:G,toggleGroupExpand:ve,handleExpandGroupRecursively:be,handleCollapseGroupRecursively:De,isGroupFullyExpanded:je,handleClick:It,onSelectionChange:l,grouping:V,rowKeyProp:x,page:rt,rowsPerPage:K}),z&&f(xp,{showSummary:z,columns:R,visibleColumns:O,summaryRow:fe,selectionMode:i?.toString(),grouping:V,columnWidths:xe,orderBy:L,zIndex:3})]})})})]}),W&&g(Et,{open:Ke,onClose:Ar,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:k?.title||o("quickCreate.createWithTitle",{title:N})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[At.map(re=>{let ue=re.type==="number"||re.numeric?"number":re.type==="date"?"date":"text",J=re.label||re.id;return f(He,{label:J,value:Mt[re.id]??"",onChange:Ee=>qr(re.id,Ee.target.value),type:ue,size:"small",fullWidth:true,InputLabelProps:{shrink:ue==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${re.id}`)}),k?.description&&f(Qo,{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(Se,{onClick:Ar,sx:{fontSize:"0.85rem"},disabled:ut,children:k?.cancelLabel||o("common.cancel")}),f(Se,{onClick:Xr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ut,children:k?.submitLabel||o("common.save")})]})]}),Y&&g(Et,{open:F,onClose:Er,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||o("quickEdit.editWithTitle",{title:N})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Io.map(re=>{let ue=re.type==="number"||re.numeric?"number":re.type==="date"?"date":"text",J=re.label||re.id,Ee=Ur(re.id);return f(He,{label:J,value:Je[re.id]??"",onChange:Qe=>Zr(re.id,Qe.target.value),type:ue,size:"small",fullWidth:true,disabled:!Ee,InputLabelProps:{shrink:ue==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${re.id}`)}),S?.description&&f(Qo,{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(Se,{onClick:Er,sx:{fontSize:"0.85rem"},disabled:ge,children:S?.cancelLabel||o("common.cancel")}),f(Se,{onClick:Ko,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ge||!Gt,children:S?.submitLabel||o("common.save")})]})]}),he&&f(Xn,{open:St,type:"warning",title:P?.title||o("quickDelete.confirmTitle"),message:P?.message||(Bt.length>1?o("quickDelete.confirmMessageMultiple",{count:Bt.length}):o("quickDelete.confirmMessageSingle")),confirmText:P?.confirmText||o("common.delete"),cancelText:P?.cancelText||o("common.cancel"),onClose:An,onConfirm:Lr}),_e,Ot&&f(ki,{open:ft,onClose:st,model:de,aiAssistant:y?.aiAssistant,interaction:Xt?{enabled:true,filters:Z.filters,fieldMapping:_,onPrimaryDimensionClick:re=>Z.setFilter("primaryDimension",re),onSecondaryDimensionClick:re=>Z.setFilter("secondaryDimension",re),onStatusClick:re=>Z.setFilter("status",re),onClearFilter:Z.clearFilter,onClearAll:Z.clearAll}:void 0,tableContent:f(Jo,{appId:qt||"graph-report-internal",title:o("graph.dataBody"),columns:Fe,rows:de.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},j1=Jo;var aD=({id:t,title:o,hideHeader:r=true,filterConfig:n,tableProps:a,children:i,spacing:s=1,mode:l="separated"})=>{let d=n?{...n,appId:n.appId||t}:void 0,u={...a,appId:a.appId||t};return g(pi,{title:o,hideHeader:r,children:[g(ie,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l==="separated"&&d&&f("div",{sx:{flexShrink:0},children:f(Wo,{...d})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(Jo,{...u,fitContainer:true,filterConfig:l==="integrated"?d:void 0})})]}),i]})};var pD=({metadata:t,fetchData:o,initialRowsPerPage:r=20,rowsPerPageOptions:n=[20,50,100,-1],tableKey:a="default",mode:i="integrated",serviceUrl:s,variantService:l})=>{let{t:d}=se(),[u,m]=useState(false),[h,f]=useState([]),[p,v]=useState({}),[C,g]=useState(t.variants||[]),[x,b]=useState(t.layout||null),[y,k]=useState(""),[S,P]=useState(0),[I,w]=useState(0),[M,N]=useState(r),[T,R]=useState([]),[A,L]=useState("asc"),[$,j]=useState("");useEffect(()=>{let oe={};t.filters.forEach(me=>{me.defaultValue!==void 0&&(oe[me.id]=me.defaultValue);}),v(oe);},[t.filters]);let O=useCallback(async(oe,me,xe,ze,Pe)=>{m(true);try{let Te={...oe,page:me+1,limit:xe,sort:Pe,order:ze},Be;o?Be=await o(Te):typeof t.api=="function"?Be=await t.api(Te):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,Te),Be={rows:[],total:0}):(console.warn("No API configured for report"),Be={rows:[],total:0}),Be&&(f(Be.rows||[]),P(Be.total||0));}catch(Te){console.error("Failed to fetch report data",Te);}finally{m(false);}},[t.api,o]);useEffect(()=>{O(p,I,M,A,$);},[O,I,M,A,$]);let z=()=>{w(0),O(p,0,M,A,$);},H=oe=>{w(0),N(oe);},q=(oe,me)=>{L(me),j(oe);},V=oe=>{v(oe);},B=oe=>{k(oe?.id||"");let me=Ni(oe,a);if(me){let ze=me.values??me;v(ze),O(ze,0,M,A,$),w(0);}let{layout:xe}=Ai(oe,a);xe&&b(xe);},G=oe=>{let me={...oe,id:Date.now().toString(),createdAt:new Date().toISOString()};g(xe=>[...xe,me]);},X=oe=>{b(oe);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:p,onFilterChange:V,onSearch:z,onVariantLoad:B,onVariantSave:G,onVariantDelete:oe=>g(me=>me.filter(xe=>xe.id!==oe)),onVariantSetDefault:oe=>{g(me=>me.map(xe=>({...xe,isDefault:xe.id===oe})));},variants:C,currentVariantId:y,variantService:l,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:h,loading:u,rowKey:"id",count:S,page:I,rowsPerPage:M,rowsPerPageOptions:n,onPageChange:w,onRowsPerPageChange:H,selectionMode:"multiple",selected:T,onSelectionChange:R,onLayoutSave:X,layout:x,title:t.title,showSummary:true,order:A,orderBy:$,serviceUrl:s,onSortChange:q,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:p,rows:h,loading:u,refresh:z}};var vb=new Set(["id","title","description","icon","iconNode","meta"]),yb=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,o=>o.toUpperCase()).trim(),Cb=t=>Object.entries(t).filter(([o,r])=>!vb.has(o)&&r!==null&&r!==void 0&&["string","number","boolean"].includes(typeof r)).map(([o,r])=>({key:o,label:yb(o),value:String(r)})),Yp=({item:t,open:o,onClose:r,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=se(),u=mo()==="dark"?"var(--orb-p300)":"var(--orb-primary)";jt__default.useEffect(()=>{if(!o)return;let h=f=>{f.key==="Escape"&&r();};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[o,r]);let m=Cb(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(ie,{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(Pt,{name:t.icon??"product",size:30,style:{color:u}})}),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(ae,{tooltip:s??l("cardPage.close"),"aria-label":s??l("cardPage.close"),onClick:r,children:f(Pt,{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,m.length>0?f("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:m.map(h=>g("div",{children:[f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:h.label}),f(E,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:h.value})]},h.key))}):null]})}),n?f("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:f(Se,{variant:"contained",sx:{width:"100%"},startIcon:f(Pt,{name:"download",size:16}),onClick:()=>n(t),children:i??l("cardPage.download")})}):null]})]}),document.body)};var xb={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},wb=({item:t,onDetailClick:o,onDownloadClick:r,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=se(),l=mo()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??f(Pt,{name:t.icon??"product",size:26,style:{color:l}});return g(Ne,{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(ie,{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",...xb},children:t.description||"\xA0"})}),g(ie,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[f(ae,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>o?.(t),children:f(Pt,{name:"show",size:18})}),f(ae,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>r?.(t),children:f(Pt,{name:"download",size:18})})]})]})},jp=({items:t,loading:o=false,onDetailClick:r,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:l,detailPanel:d=true,renderDetailContent:u})=>{let{t:m}=se(),[h,f$1]=jt__default.useState(null),[p,v]=jt__default.useState(false),C=x=>{r?.(x),d&&(f$1(x),requestAnimationFrame(()=>requestAnimationFrame(()=>v(true))));},g$1=()=>{v(false),setTimeout(()=>f$1(null),260);};return o?f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(Xo,{})}):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(wb,{item:x,onDetailClick:C,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&h?f(Yp,{item:h,open:p,onClose:g$1,onDownloadClick:n,renderContent:u,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??m("cardPage.empty")})})};var ED=({id:t,title:o,hideHeader:r=true,filterConfig:n,gridProps:a,children:i,spacing:s=1})=>{let l=n?{...n,appId:n.appId||t}:void 0;return g(pi,{title:o,hideHeader:r,children:[g(ie,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l&&f("div",{sx:{flexShrink:0},children:f(Wo,{...l})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(jp,{...a})})]}),i]})};var HD=({metadata:t,fetchData:o,tableKey:r="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,u]=useState(false),[m,h]=useState([]),[f,p]=useState(0),[v,C]=useState({}),[g,x]=useState(t.variants||[]),[b,y]=useState("");useEffect(()=>{let N={};t.filters.forEach(T=>{T.defaultValue!==void 0&&(N[T.id]=T.defaultValue);}),C(N);},[t.filters]);let k=useCallback(async N=>{u(true);try{let T=o?await o({...N}):{rows:[],total:0};h(T?.rows||[]),p(T?.total||0);}catch(T){console.error("Failed to fetch card page data",T);}finally{u(false);}},[o]);useEffect(()=>{k(v);},[k]);let S=()=>{k(v);},P=N=>{C(N);},I=N=>{y(N?.id||"");let T=Ni(N,r);if(T){let R=T.values??T;C(R),k(R);}},w=N=>{let T={...N,id:Date.now().toString(),createdAt:new Date().toISOString()};x(R=>[...R,T]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:r,fields:t.filters,filters:v,onFilterChange:P,onSearch:S,onVariantLoad:I,onVariantSave:w,onVariantDelete:N=>x(T=>T.filter(R=>R.id!==N)),onVariantSetDefault:N=>{x(T=>T.map(R=>({...R,isDefault:R.id===N})));},variants:g,currentVariantId:b,variantService:n,serviceUrl:a},gridProps:{items:m,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:l}},items:m,total:f,filters:v,loading:d,refresh:S}};var kb=t=>[...t].sort((o,r)=>r.value-o.value),WD=({bars:t=[],lines:o=[],combos:r=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=useMemo(()=>kb(t),[t]),l=useMemo(()=>[...o],[o]),d=useMemo(()=>[...r],[r]),u=useMemo(()=>[...n],[n]),m=useMemo(()=>{let f=a.reduce((p,v)=>p+v.value,0);return a.map(p=>({...p,percent:f>0?p.value/f*100:p.percent}))},[a]),h=useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:u,pies:m,waterfalls:h}};var KD=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>useMemo(()=>!t||!o?"":ea({apiKey:t,query:o,zoom:r,mapType:n}),[t,o,r,n]),qD=({keyword:t,location:o})=>useMemo(()=>wi({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0}),[t,o]);var aa=({code:t,language:o="text",copyable:r=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:o}),r&&f(
|
|
5
|
-
`).map(s=>s.trim()).filter(Boolean);if(o.length<2)return null;let r=
|
|
1
|
+
import {f,d,g,e,a,b,c}from'./chunk-7TUSE6H4.mjs';export{h as COrbCanvas}from'./chunk-7TUSE6H4.mjs';import*as Jt from'react';import Jt__default,{createContext,forwardRef,useId,useRef,useState,useImperativeHandle,useMemo,Children,isValidElement,useEffect,useContext,useCallback,Fragment,useLayoutEffect,cloneElement}from'react';import*as Eo from'@radix-ui/react-dropdown-menu';import*as Qo from'@radix-ui/react-tooltip';import {createPortal}from'react-dom';import*as ko from'@radix-ui/react-dialog';import*as vr from'@radix-ui/react-popover';import nr from'dayjs';import Qh 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 ub from'dayjs/plugin/isBetween';import mb 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 vy from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import DC from'react-markdown';import AC from'remark-gfm';import EC from'remark-math';import LC from'rehype-katex';import OC from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import Sm from'mermaid';import uw from'dayjs/plugin/isoWeek';var Zg={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"},Yg={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"},Ws={light:Zg,dark:Yg},Dw='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',Aw=t=>{let o=Ws[t];return [o.primary,o.p300,o.muted,o.p700]},Ew=10,Lw="0.2s ease";var Mc=createContext({mode:"light",setting:"light"}),eh=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;},On=({mode:t,defaultMode:o="light",children:r})=>{let n=t??o,[a,i]=useState("light"),[s,c]=useState(false);useEffect(()=>{c(true);let m=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>i(m.matches?"dark":"light");return h(),m.addEventListener("change",h),()=>m.removeEventListener("change",h)},[]);let d=n==="system"?s?a:"light":n;useEffect(()=>{eh(d);},[d]);let u=useMemo(()=>({mode:d,setting:n}),[d,n]);return f(Mc.Provider,{value:u,children:r})},ho=()=>useContext(Mc).mode,$s=()=>Ws[ho()];var tt=(t,o)=>{let r=Math.min(1,Math.max(0,o)),n=t.trim(),a=d=>d.split("").map(u=>u+u).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),u=parseInt(s.slice(2,4),16),m=parseInt(s.slice(4,6),16);return `rgba(${d}, ${u}, ${m}, ${r})`}let c=`${Math.round(r*100)}%`;return `color-mix(in oklch, ${t} ${c}, transparent)`};var Do=t=>{let o=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[r,n]=useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(o).matches);return useEffect(()=>{if(typeof window.matchMedia!="function")return;let a=window.matchMedia(o),i=()=>n(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[o]),r};var rh={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},nh=t=>typeof t=="number"?`${t}px`:t,ah={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},ih=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?ah[o[1]]:void 0},Pt=forwardRef(({name:t,size:o,title:r,className:n,style:a,strokeWidth:i,fill:s,...c},d)=>{let u=c["aria-label"]??r,m=nh(o??ih(n)??"1em"),h={fontFamily:"SAP-icons",fontSize:m,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:m,height:m,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...a};return f("span",{ref:d,role:u?"img":void 0,"aria-hidden":u?void 0:true,title:r,className:n,"data-sap-icon":t,style:h,...c,children:String.fromCodePoint(rh[t])})});Pt.displayName="SapIcon";var ae=(t,o)=>{let r=forwardRef((n,a)=>f(Pt,{ref:a,name:t,...n}));return r.displayName=o??`SapIcon(${t})`,r};var Nc=ae("activity","Activity"),Na=ae("error","AlertCircle"),Dc=ae("warning","AlertTriangle"),jw=ae("down","ArrowDown"),Jw=ae("navigationRight","ArrowRight"),Ac=ae("up","ArrowUp"),_s=ae("barChart","BarChart"),e0=ae("activate","Bot"),Gs=ae("calendar","Calendar"),t0=Gs,o0=ae("camera","Camera"),r0=ae("lineChart","ChartNoAxesCombined"),wo=ae("accept","Check"),Da=ae("accept","CheckCircle"),Ho=ae("slimDown","ChevronDown"),Aa=ae("navigationLeft","ChevronLeft"),zo=ae("navigationRight","ChevronRight"),n0=ae("slimUp","ChevronUp"),a0=ae("expandAll","ChevronsDown"),i0=ae("collapseAll","ChevronsUp"),Ea=ae("error","CircleAlert"),Fn=ae("accept","CircleCheck"),s0=Fn,Us=ae("stop","CircleStop"),Ec=ae("copy","Clipboard"),l0=ae("checklist","ClipboardCheck"),c0=ae("checklist","ClipboardList"),Lc=ae("time","Clock"),d0=ae("tableColumn","Columns3"),Ao=ae("copy","Copy"),p0=ae("duplicate","CopyPlus"),u0=ae("delete","Delete"),Bn=ae("download","Download"),Oc=ae("edit","Edit"),Fc=ae("fullScreen","Expand"),m0=ae("show","Eye"),g0=ae("hide","EyeOff"),La=ae("document","File"),Bc=ae("document","FileText"),h0=ae("filter","Filter"),Hn=ae("tree","FolderTree"),Hc=ae("process","GitBranch"),zn=ae("world","Globe"),zc=ae("grid","Grid"),f0=ae("move","GripVertical"),b0=ae("wrench","Hammer"),Vc=ae("picture","Image"),Oa=ae("information","Info"),v0=ae("translate","Languages"),y0=ae("dimension","Layers"),C0=ae("home","LayoutDashboard"),Fa=ae("lightbulb","Lightbulb"),Wc=ae("lineChart","LineChart"),$c=ae("synchronize","Loader2"),Ba=ae("locked","Lock"),x0=Ba,_c=ae("log","LogOut"),Ks=ae("email","Mail"),Gc=ae("map","MapPin"),Uc=ae("menu","Menu"),sh=ae("message","MessageCircle"),Kc=sh,Ha=ae("microphone","Mic"),w0=ae("microphone","MicOff"),qc=ae("darkMode","Moon"),S0=ae("overflow","MoreHorizontal"),k0=ae("accept","PackageCheck"),P0=ae("product","PackageSearch"),za=ae("splitOne","PanelLeftOpen"),Va=ae("splitTwo","PanelRight"),T0=ae("overview","PanelsTopLeft"),Xc=ae("pieChart","PieChart"),jr=ae("pushpin","Pin"),I0=ae("play","Play"),Jr=ae("add","Plus"),M0=ae("qrCode","QrCode"),R0=ae("receipt","ReceiptText"),Wa=ae("refresh","RefreshCw"),N0=ae("activate","Rocket"),D0=ae("refresh","RotateCcw"),Zc=ae("refresh","RotateCw"),A0=ae("tableRow","Rows3"),E0=ae("save","Save"),L0=ae("qrCode","ScanLine"),Vo=ae("search","Search"),lh=ae("paperPlane","Send"),Yc=lh,en=ae("wrench","Settings"),O0=ae("accept","ShieldCheck"),F0=ae("sum","Sigma"),B0=ae("sort","SortAsc"),H0=ae("splitTwo","SquareSplitHorizontal"),z0=ae("favorite","Star"),Qc=ae("lightMode","Sun"),V0=ae("table","Table2"),W0=ae("ipad","TabletSmartphone"),Vn=ae("command","Terminal"),jc=ae("thumbDown","ThumbsDown"),Jc=ae("thumbUp","ThumbsUp"),ed=ae("delete","Trash2"),$0=ae("tree","TreePine"),td=ae("trendDown","TrendingDown"),$a=ae("warning","TriangleAlert"),_0=ae("shipping","Truck"),od=ae("upload","UploadCloud"),qs=ae("employee","User"),rd=ae("sound","Volume2"),G0=ae("factory","Warehouse"),U0=ae("process","Workflow"),Kt=ae("decline","X"),_a=ae("error","XCircle");var dh={contained:"primary",outlined:"secondary",text:"ghost"},ph={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},Pe=forwardRef(({variant:t="primary",size:o="medium",block:r=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:c,sx:d$1,className:u,children:m,disabled:h,type:f$1="button",...p},b)=>{let C=dh[t]??t,g$1=["orb-btn",`orb-btn-${C}`,ph[o],r?"orb-btn-block":void 0,n?"orb-is-loading":void 0,u].filter(Boolean).join(" "),x=d(d$1,g$1),v=s??(c?"a":"button");return g(v,{ref:b,type:v==="button"?f$1:void 0,href:c,className:x.className,style:x.style,disabled:v==="button"?h||n:void 0,"aria-disabled":v!=="button"&&(h||n)?true:void 0,...p,children:[n&&f("span",{className:`orb-spin ${C==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,m,!n&&i]})});Pe.displayName="CButton";var He=forwardRef(({label:t,value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:c="text",placeholder:d$1,disabled:u,readOnly:m,required:h,autoFocus:f$1,autoComplete:p,name:b,id:C,error:g$1,helperText:x,dense:v=false,size:y,fullWidth:P=true,select:S=false,multiline:I=false,rows:M,children:w,variant:D,margin:N,onClick:T,startAdornment:k,endAdornment:A,InputProps:L,inputProps:W,InputLabelProps:ee,SelectProps:O,sx:_,className:V},Q)=>{let H=useId(),B=C??`orb-tf-${H}`,q=k??L?.startAdornment,Z=A??L?.endAdornment,J=(typeof g$1=="string"?g$1:void 0)??x,he={id:B,className:`orb-inp ${v||y==="small"?"orb-inp-dense":""}`,style:P?void 0:{width:"auto"},value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:d$1,disabled:u,required:h,autoFocus:f$1,autoComplete:p,name:b,onClick:T,"aria-invalid":!!g$1},ze=S?f("select",{...he,ref:Q,onChange:n,children:w}):I?f("textarea",{...he,ref:Q,onChange:n,rows:M,readOnly:m||L?.readOnly}):f("input",{...he,ref:Q,onChange:n,type:c,readOnly:m||L?.readOnly,...W}),be=d(_,`orb-fld ${g$1?"orb-is-error":""} ${V??""}`,{width:P?"100%":void 0});return g("div",{className:be.className,style:be.style,children:[t&&f("label",{htmlFor:B,children:t}),q||Z?g("div",{className:"orb-inp-adornment-wrap",children:[q&&f("span",{className:"orb-inp-adornment",children:q}),Z&&f("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:Z}),ze]}):ze,J&&f("span",{className:"orb-fld-msg",children:J})]})});He.displayName="CTextField";var Wn=forwardRef(({label:t,value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:c,minRows:d$1=3,multiline:u,error:m,helperText:h,fullWidth:f$1=true,name:p,id:b,inputProps:C,sx:g$1,className:x},v)=>{let y=useId(),P=b??`orb-ta-${y}`,I=(typeof m=="string"?m:void 0)??h,M=d(g$1,`orb-fld ${m?"orb-is-error":""} ${x??""}`,{width:f$1?"100%":void 0});return g("div",{className:M.className,style:M.style,children:[t&&f("label",{htmlFor:P,children:t}),f("textarea",{ref:v,id:P,className:"orb-inp",value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:c??d$1,name:p,"aria-invalid":!!m,...C}),I&&f("span",{className:"orb-fld-msg",children:I})]})});Wn.displayName="CTextArea";var zt=forwardRef(({label:t,options:o,children:r,value:n,defaultValue:a,onChange:i,disabled:s,size:c,dense:d$1=true,fullWidth:u=true,minWidth:m,placeholder:h,displayEmpty:f$1,renderValue:p,multiple:b,MenuProps:C,variant:g$1,disableUnderline:x,onClick:v,onMouseDown:y,error:P,helperText:S,name:I,id:M,"aria-label":w,sx:D,className:N},T)=>{let k=useId(),A=M??`orb-sel-${k}`,W=(typeof P=="string"?P:void 0)??S,ee=useRef(null),O=useRef(null),[_,V]=useState(false),[Q,H]=useState(180),[B,q]=useState(a??"");useImperativeHandle(T,()=>ee.current);let Z=useMemo(()=>Children.toArray(r).flatMap(de=>{if(!isValidElement(de)||de.type!=="option")return [];let ve=de;return [{value:Array.isArray(ve.props.value)?ve.props.value[0]??"":ve.props.value??"",label:ve.props.children,disabled:ve.props.disabled}]}),[r]),Y=o??Z,J=n??B,le=Array.isArray(J)?J[0]??"":J,he=String(le??""),ze=Y.find(de=>String(de.value)===he),be=p?p(J):ze?.label??(he||(h??"")),Ce=d(D,`orb-fld ${P?"orb-is-error":""} ${N??""}`,{width:u?"100%":void 0,minWidth:typeof m=="number"?`${m}px`:m});if(b)return g("div",{className:Ce.className,style:Ce.style,children:[t&&f("label",{htmlFor:A,children:t}),g("select",{ref:T,id:A,className:`orb-inp ${d$1||c==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:I,multiple:true,onClick:v,onMouseDown:y,"aria-invalid":!!P,"aria-label":w,children:[h!==void 0&&f("option",{value:"",children:h}),o?o.map(de=>f("option",{value:de.value,disabled:de.disabled,children:de.label},de.value)):r]}),W&&f("span",{className:"orb-fld-msg",children:W})]});let Be=de=>{n===void 0&&q(de);let ve=ee.current;ve&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(ve,de),i?.({target:ve,currentTarget:ve}));};return g("div",{className:Ce.className,style:Ce.style,children:[t&&f("label",{htmlFor:A,children:t}),f("select",{ref:ee,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:I,value:he,disabled:s,onChange:()=>{},children:Y.map(de=>f("option",{value:de.value,disabled:de.disabled,children:de.label},String(de.value)))}),g(Eo.Root,{open:_,onOpenChange:de=>{de&&H(O.current?.getBoundingClientRect().width??180),V(de);},children:[f(Eo.Trigger,{asChild:true,children:g("button",{ref:O,id:A,type:"button",className:`orb-inp orb-select-trigger ${d$1||c==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!P,"aria-label":w,"aria-haspopup":"listbox","data-placeholder":!ze&&!he?"":void 0,onClick:v,onMouseDown:y,children:[f("span",{className:"orb-select-value",children:be}),f(Pt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),f(Eo.Portal,{children:f(Eo.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:Q},children:f(Eo.RadioGroup,{value:he,onValueChange:Be,children:Y.map(de=>g(Eo.RadioItem,{className:"orb-select-option",value:String(de.value),disabled:de.disabled,children:[f("span",{className:"orb-select-check","aria-hidden":"true",children:String(de.value)===he?f(Pt,{name:"accept",size:13}):null}),f("span",{children:de.label})]},String(de.value)))})})})]}),W&&f("span",{className:"orb-fld-msg",children:W})]})});zt.displayName="CSelect";var Tt=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,indeterminate:i,name:s,value:c,id:d$1,size:u,color:m,onClick:h,inputProps:f$1,sx:p,className:b},C)=>{let g$1=d([{...u==="small"?{fontSize:13}:void 0,...m?{color:m}:void 0},...Array.isArray(p)?p:p?[p]:[]],`orb-chk ${b??""}`),x=f("input",{ref:v=>{v&&(v.indeterminate=!!i),typeof C=="function"?C(v):C&&(C.current=v);},type:"checkbox",id:d$1,checked:o,defaultChecked:r,onChange:n,readOnly:o!==void 0&&n===void 0,disabled:a,name:s,value:c,onClick:h,...f$1});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})]})});Tt.displayName="CCheckbox";var kh=({label:t,options:o,value:r,defaultValue:n,onChange:a,name:i,row:s=false,disabled:c,sx:d,className:u})=>{let m=useId(),h=i??`orb-rdo-${m}`;return g("div",{className:`orb-fld ${u??""}`,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(f$1=>g("label",{className:"orb-rdo",children:[f("input",{type:"radio",name:h,value:f$1.value,checked:r!==void 0?r===f$1.value:void 0,defaultChecked:n!==void 0?n===f$1.value:void 0,onChange:a?p=>a(p,f$1.value):void 0,disabled:c||f$1.disabled}),f("span",{children:f$1.label})]},f$1.value))})]})};var Ga=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,name:i,id:s,size:c,sx:d$1,className:u},m)=>{let h=d([{...c==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],`orb-sw ${u??""}`),f$1=f("input",{ref:m,type:"checkbox",role:"switch",id:s,checked:o,defaultChecked:r,onChange:n?p=>n(p,p.target.checked):void 0,disabled:a,name:i});return t==null?f("span",{className:h.className,style:h.style,children:f$1}):g("label",{className:h.className,style:h.style,children:[f$1,f("span",{children:t})]})});Ga.displayName="CSwitch";var Ih={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},Ct=forwardRef(({label:t,children:o,tone:r,color:n="default",variant:a,size:i="medium",clickable:s,avatar:c,icon:d$1,onDelete:u,onClick:m,sx:h,className:f$1},p)=>{let b=r??(a==="outlined"&&n==="default"?"outline":Ih[n]??"gray"),C=s??!!m,g$1=d([{cursor:C?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(h)?h:h?[h]:[]],`orb-chip orb-chip-${b} ${f$1??""}`);return g("span",{ref:p,className:g$1.className,style:g$1.style,onClick:m,role:C?"button":void 0,tabIndex:C?0:void 0,onKeyDown:C?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),m?.(x));}:void 0,children:[c??d$1,f("span",{className:"orb-chip-label",children:o??t}),u&&f("button",{type:"button","aria-label":"Remove",onClick:x=>{x.stopPropagation(),u(x);},style:{background:"none",border:"none",padding:0,display:"inline-flex",cursor:"pointer",color:"inherit"},children:f(Kt,{size:13,strokeWidth:2})})]})});Ct.displayName="CChip";var Ua=forwardRef(({badgeContent:t,color:o="primary",children:r,invisible:n=false,sx:a,className:i},s)=>{let c=d(a,i,{display:"inline-flex",position:r?"relative":void 0}),d$1=!n&&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})});Ua.displayName="CBadge";var tn=forwardRef(({children:t,src:o,alt:r,size:n=28,sx:a,className:i},s)=>{let c=d([{width:n,height:n,fontSize:n*.4},...Array.isArray(a)?a:a?[a]:[]],`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})});tn.displayName="CAvatar";var on=forwardRef(({severity:t="info",title:o,children:r,onClose:n,sx:a,className:i},s)=>{let c=d(a,`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})]}),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"})]})});on.displayName="CAlert";var $n=({value:t,variant:o,color:r,sx:n,className:a})=>{let i=o==="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:r}}),i&&f("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},Dh=({width:t,height:o=14,variant:r="rectangular",sx:n,className:a})=>f("div",{className:`orb-skel ${a??""}`,style:{width:t,height:o,borderRadius:r==="circular"?"50%":r==="text"?6:"var(--orb-r)",...n}}),Yo=({size:t=12,onPrimary:o=false,sx:r,className:n})=>f("span",{className:`orb-spin ${o?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...r},role:"status","aria-label":"Loading"});var ct=({title:t,children:o,enterDelay:r=300,side:n="top",align:a="center",disabled:i})=>!t||i?f(e,{children:o}):f(Qo.Provider,{delayDuration:r,skipDelayDuration:200,children:g(Qo.Root,{children:[f(Qo.Trigger,{asChild:true,children:o}),f(Qo.Portal,{children:f(Qo.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});var ie=forwardRef(({tooltip:t,size:o="small",active:r=false,edge:n,color:a,sx:i,className:s,children:c,type:d$1="button",...u},m)=>{let h=d([{color:r?"var(--orb-primary)":a,...n==="start"?{marginLeft:-8}:n==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${o==="small"?"orb-icon-btn-sm":""} ${s??""}`),f$1=f("button",{ref:m,type:d$1,className:h.className,style:h.style,...u,children:c});return t?f(ct,{title:t,children:f$1}):f$1});ie.displayName="CIconButton";var _n=({value:t,options:o,onValueChange:r,size:n="medium",sx:a,className:i,...s})=>{let c=useRef([]),d$1=o.findIndex(p=>!p.disabled),u=o.findIndex(p=>p.value===t),m=(p,b)=>{let C=o.map((v,y)=>v.disabled?-1:y).filter(v=>v>=0);if(C.length===0)return;let g=C.indexOf(b),x;p.key==="Home"&&(x=C[0]),p.key==="End"&&(x=C[C.length-1]),(p.key==="ArrowRight"||p.key==="ArrowDown")&&(x=C[(g+1+C.length)%C.length]),(p.key==="ArrowLeft"||p.key==="ArrowUp")&&(x=C[(g-1+C.length)%C.length]),x!==void 0&&(p.preventDefault(),c.current[x]?.focus(),r(o[x].value));},h=d(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),f$1={...h.style,"--orb-segmented-count":Math.max(o.length,1),"--orb-segmented-index":Math.max(u,0)};return g("div",{role:"radiogroup",className:h.className,style:f$1,"data-has-selection":u>=0?"true":"false",...s,children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),o.map((p,b)=>{let C=p.value===t;return f(ie,{ref:g=>{c.current[b]=g;},className:["orb-segmented-control-item",p.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:p.label,role:"radio","aria-label":p.label,"aria-checked":C,"data-selected":C?"true":void 0,disabled:p.disabled,tabIndex:C||t==null&&b===d$1?0:-1,onClick:()=>r(p.value),onKeyDown:g=>m(g,b),children:p.icon??f("span",{className:"orb-segmented-control-label",children:p.label})},p.value)})]})};var Qt=({triggerLabel:t,items:o=[],trigger:r,align:n="start",anchorEl:a,open:i,onClose:s,children:c,slotProps:d$1,PaperProps:u,anchorPosition:m,sx:h})=>{let f$1=useRef(null);if(useEffect(()=>{if(i!==true)return;let p=C=>{let g=C.composedPath();f$1.current&&g.includes(f$1.current)||a&&g.includes(a)||s?.();},b=C=>{C.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",p,true),document.addEventListener("keydown",b,true),()=>{document.removeEventListener("pointerdown",p,true),document.removeEventListener("keydown",b,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let p=a?.getBoundingClientRect(),b=window.innerWidth,C=p?.left??16,g=p?.right??C,x=d$1?.paper?.sx??u?.sx,v=d([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(h)?h:h?[h]:[]],"orb-pop orb-menu",d$1?.paper?.style??u?.style),y=Children.map(c,P=>{if(!isValidElement(P)||P.type!=="option")return P;let S=P.props,{children:I,disabled:M,selected:w}=S,D=d(S.sx,`orb-menu-item ${w?"orb-selected":""} ${S.className??""}`,S.style);return f("div",{role:"menuitem","aria-disabled":M||void 0,"aria-selected":w||void 0,tabIndex:M?-1:0,id:S.id,title:S.title,className:D.className,style:D.style,onClick:M?void 0:S.onClick,onKeyDown:N=>{!M&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),S.onClick?.(N));},children:I})});return createPortal(f("div",{ref:f$1,role:"menu",className:v.className,style:{...v.style,position:"fixed",left:n==="end"&&!m?void 0:m?.left??C,right:n==="end"&&!m?Math.max(16,b-g):void 0,top:m?.top??(p?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:y}),document.body)}return g(Eo.Root,{children:[f(Eo.Trigger,{asChild:true,children:r??f(Pe,{variant:"primary",children:t})}),f(Eo.Portal,{children:f(Eo.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:o.map((p,b)=>g(Eo.Item,{className:"orb-menu-item",disabled:p.disabled,onSelect:()=>p.onClick?.(),children:[p.icon,p.label]},b))})})]})};var De=forwardRef(({elevation:t=1,variant:o,component:r,sx:n,style:a,className:i,children:s,...c},d$1)=>{let u=r??"div",m=d(n,`orb-card ${t>0&&o!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return f(u,{ref:d$1,className:m.className,style:m.style,...c,children:s})});De.displayName="CPaper";var Rt=forwardRef(({orientation:t="horizontal",flexItem:o,sx:r,className:n},a)=>{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"} ${n??""}`);return f("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});Rt.displayName="CDivider";var $h={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"},_h={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},E=forwardRef(({variant:t="body1",component:o,muted:r=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:c,className:d$1,children:u,...m},h)=>{let f$1=o??_h[t]??"span",b=[t==="inherit"?void 0:$h[t],d$1].filter(Boolean).join(" "),C=d([{...r?{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(c)?c:c?[c]:[]],b);return f(f$1,{ref:h,className:C.className,style:C.style,...m,children:u})});E.displayName="CTypography";var Uh=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},se=forwardRef(({direction:t="column",spacing:o,alignItems:r,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:c,className:d$1,children:u,...m},h)=>{let f$1=d([{display:"flex",flexDirection:t,gap:Uh(o),alignItems:r,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(c)?c:c?[c]:[]],d$1);return f("div",{ref:h,className:f$1.className,style:f$1.style,...m,children:u})});se.displayName="CStack";var Lt=({open:t,onClose:o,title:r,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:c=false,PaperProps:d$1,slotProps:u,disableRestoreFocus:m,keepMounted:h,hideCloseButton:f$1=false,sx:p,className:b})=>{let C=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??u?.paper?.sx)?d$1?.sx??u?.paper?.sx:d$1?.sx??u?.paper?.sx?[d$1?.sx??u?.paper?.sx]:[],...Array.isArray(p)?p:p?[p]:[]],`orb-dialog ${b??""}`);return f(ko.Root,{open:t,onOpenChange:g=>{g||o?.();},children:g(ko.Portal,{children:[f(ko.Overlay,{className:"orb-overlay"}),g(ko.Content,{className:C.className,style:C.style,children:[(r||!f$1)&&g("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[r?f(ko.Title,{className:"orb-dialog-title",children:r}):f(ko.Title,{className:"orb-visually-hidden",children:"Dialog"}),!f$1&&f(ko.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(Kt,{size:16,strokeWidth:2})})})]}),f("div",{style:{minWidth:0},children:n}),a&&f("div",{className:"orb-dialog-actions",children:a})]})]})})};var Zs=({open:t,defaultOpen:o,onOpenChange:r,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:c=6,matchTriggerWidth:d=false,sx:u,className:m})=>g(vr.Root,{open:t,defaultOpen:o,onOpenChange:r,children:[f(vr.Trigger,{asChild:true,children:n}),f(vr.Portal,{children:f(vr.Content,{className:`orb-pop ${m??""}`,align:i,side:s,sideOffset:c,style:{minWidth:d?"var(--radix-popover-trigger-width)":void 0,...u},onOpenAutoFocus:h=>h.preventDefault(),children:a})})]});var Xh=({items:t,value:o,defaultValue:r,onChange:n,sx:a,className:i})=>{let s=o!==void 0,[c,d]=useState(r??t[0]?.value),u=s?o:c,m=useRef([]),h=p=>{s||d(p),n?.(p);},f$1=p=>{if(p.key!=="ArrowRight"&&p.key!=="ArrowLeft")return;p.preventDefault();let b=t.filter(v=>!v.disabled),C=b.findIndex(v=>v.value===u),g=p.key==="ArrowRight"?1:-1,x=b[(C+g+b.length)%b.length];if(x){h(x.value);let v=t.findIndex(y=>y.value===x.value);m.current[v]?.focus();}};return f("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:f$1,children:t.map((p,b)=>{let C=p.value===u;return g("button",{ref:g=>{m.current[b]=g;},type:"button",role:"tab","aria-selected":C,disabled:p.disabled,className:`orb-tab ${C?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>h(p.value),children:[p.icon,p.label]},p.value)})})};var Yh=["su","mo","tu","we","th","fr","sa"],Gn=(t,o)=>!!(t&&o&&t.isSame(o,"day")),Un=({value:t,rangeStart:o,rangeEnd:r,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:c,maxDate:d,locale:u,renderDay:m})=>{let h=a!==void 0,[f$1,p]=useState(()=>i??t??o??nr()),b=(h?a:f$1).startOf("month"),C=S=>{h||p(S),s?.(S);},g$1=useMemo(()=>u?b.locale(u):b,[b,u]),x=useMemo(()=>{let I=b.startOf("month").startOf("week"),M=[],w=I;for(let D=0;D<6;D+=1){let N=[];for(let T=0;T<7;T+=1)N.push(w),w=w.add(1,"day");if(M.push(N),w.isAfter(b.endOf("month"))&&D>=3)break}return M},[b]),v=useMemo(()=>{let S=u?nr().locale(u):nr();return Yh.map((I,M)=>S.startOf("week").add(M,"day").format("dd"))},[u]),y=S=>!!(c&&S.isBefore(c.startOf("day"))||d&&S.isAfter(d.startOf("day"))),P=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:()=>C(b.subtract(1,"month")),children:f(Aa,{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:()=>C(b.add(1,"month")),children:f(zo,{size:16,strokeWidth:2})})]}),g("div",{className:"orb-cal-grid",role:"grid",children:[v.map((S,I)=>f("span",{className:"orb-cal-dow",children:S},`${S}-${I}`)),x.flat().map(S=>{let I=!S.isSame(b,"month"),M=y(S),w=P?Gn(S,o)||Gn(S,r):Gn(S,t),D=S.isSame(nr(),"day"),N=P&&o&&r&&S.isAfter(o.startOf("day"))&&S.isBefore(r.startOf("day")),T=P&&Gn(S,o)&&!!r,k=P&&Gn(S,r)&&!!o,A=["orb-cal-day",I?"orb-is-outside":void 0,D?"orb-is-today":void 0,w?"orb-is-selected":void 0,N?"orb-is-in-range":void 0,T?"orb-is-range-start":void 0,k?"orb-is-range-end":void 0].filter(Boolean).join(" ");return m?f("span",{className:"orb-cal-day-slot",children:m(S,{outsideCurrentMonth:I,selected:w,today:D,disabled:M})},S.format("YYYY-MM-DD")):f("button",{type:"button",role:"gridcell","aria-selected":w,"aria-current":D?"date":void 0,className:A,disabled:M,onClick:()=>n?.(S),children:S.date()},S.format("YYYY-MM-DD"))})]})]})};nr.extend(Qh);var jh=({label:t,value:o,defaultValue:r,onChange:n,minDate:a,maxDate:i,disabled:s,format:c="YYYY-MM-DD",placeholder:d,locale:u,dense:m=false,error:h,helperText:f$1,sx:p,className:b})=>{let C=o!==void 0,[g$1,x]=useState(r??null),v=C?o:g$1,[y,P]=useState(false),[S,I]=useState(null),M=k=>{C||x(k),n?.(k);},w=S??(v?(u?v.locale(u):v).format(c):""),D=()=>{if(S===null)return;let k=S.trim();if(!k)M(null);else {let A=nr(k,c,true);A.isValid()&&!(a&&A.isBefore(a.startOf("day")))&&!(i&&A.isAfter(i.startOf("day")))&&M(A);}I(null);},T=(typeof h=="string"?h:void 0)??f$1;return g("div",{className:`orb-fld ${h?"orb-is-error":""} ${b??""}`,style:p,children:[t&&f("label",{children:t}),f(Zs,{open:y,onOpenChange:P,trigger:g("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[f("span",{className:"orb-inp-adornment",children:f(Gs,{size:15,strokeWidth:1.8})}),f("input",{className:`orb-inp ${m?"orb-inp-dense":""}`,value:w,placeholder:d??c,disabled:s,onFocus:()=>P(true),onChange:k=>I(k.target.value),onBlur:D,onKeyDown:k=>{k.key==="Enter"&&(D(),P(false)),k.key==="Escape"&&P(false);}})]}),children:f(Un,{value:v,onChange:k=>{M(k),I(null),P(false);},minDate:a,maxDate:i,locale:u,defaultMonth:v??void 0})}),T&&f("span",{className:"orb-fld-msg",children:T})]})};var ef=({onFilesSelected:t,multiple:o=false,accept:r="*",maxSize:n,title:a="Drag and drop files here or click to upload",subtitle:i="Support for bulk upload",sx:s})=>{let[c,d]=useState(false),[u,m]=useState([]),h=useRef(null),f$1=v=>{v.preventDefault(),d(true);},p=v=>{v.preventDefault(),d(false);},b=v=>{v.preventDefault(),d(false),g$1(Array.from(v.dataTransfer.files));},C=v=>{v.target.files&&g$1(Array.from(v.target.files));},g$1=v=>{let y=n?v.filter(S=>S.size<=n):v;y.length<v.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let P=o?[...u,...y]:y;o&&(P=P.filter((S,I,M)=>I===M.findIndex(w=>w.name===S.name&&w.size===S.size&&w.lastModified===S.lastModified))),m(P),t?.(P),h.current&&(h.current.value="");},x=v=>{let y=u.filter((P,S)=>S!==v);m(y),t?.(y);};return g("div",{style:{width:"100%",...s},children:[g("div",{onClick:()=>h.current?.click(),onDragOver:f$1,onDragLeave:p,onDrop:b,role:"button",tabIndex:0,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),h.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:h,style:{display:"none"},multiple:o,accept:r,onChange:C}),g("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[f(od,{size:40,strokeWidth:1.5,color:c?"var(--orb-primary)":"var(--orb-muted)"}),f("span",{className:"orb-subtitle",children:a}),f("span",{className:"orb-meta",children:i})]})]}),u.length>0&&f("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:u.map((v,y)=>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(Bc,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),f("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:v.name}),g("span",{className:"orb-meta",children:["(",(v.size/1024).toFixed(1)," KB)"]})]}),f(ie,{"aria-label":`Remove ${v.name}`,onClick:()=>x(y),children:f(ed,{size:15,strokeWidth:1.8})})]},`${v.name}-${y}`))})]})};function vo(...t){return twMerge(clsx(t))}var qa={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"},Kn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},sd=()=>"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 af=cva(sd(),{variants:{variant:{default:`${qa.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${qa.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:qa.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:Kn.none,sm:Kn.sm,md:Kn.md,full:Kn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),js=Jt.forwardRef(({className:t,variant:o,size:r,asChild:n=false,...a},i)=>f(n?Slot:"button",{className:vo(af({variant:o,size:r,className:t})),ref:i,...a}));js.displayName="Button";var sf={"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.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.searchOpenPanel":"Open conversation","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","omph.status.idle":"Idle","omph.status.pending":"Pending","omph.status.running":"Working","omph.status.success":"Success","omph.status.error":"Error","omph.working":"Working","omph.workingFor":"Working for {duration}","omph.loadOlder":"Load earlier","omph.loadingOlder":"Loading earlier\u2026","omph.toBottom":"Back to bottom","omph.copy":"Copy","omph.copied":"Copied","omph.turnActions":"Reply actions","omph.usage":"Usage","omph.inputTokens":"Input","omph.outputTokens":"Output","omph.duration":"Duration","omph.send":"Send","omph.stop":"Stop","omph.supplement.queued":"Added to the running task","omph.turnRail":"Turns","omph.secondUnit":"s","omph.minuteUnit":"m","omph.preview.title":"File preview","omph.preview.close":"Close preview","omph.preview.back":"Back to conversation","omph.preview.expand":"Expand preview","omph.preview.collapse":"Restore preview size","omph.preview.copyContent":"Copy content","omph.preview.copyPath":"Copy path","omph.preview.download":"Download","omph.preview.openExternal":"Open externally","omph.preview.wrap":"Wrap","omph.preview.loading":"Loading file","omph.preview.missing":"File not found","omph.preview.failed":"Could not load this file","omph.preview.unsupported":"No preview for this file type","omph.preview.retry":"Try again","omph.preview.resize":"Resize preview","omph.preview.line":"Line {start}","omph.preview.lines":"Lines {start}\u2013{end}","omph.preview.truncated":"Showing the first {shown} of {total} lines","omph.preview.sheetTruncated":"Showing the first {shown} of {total} rows","omph.preview.imageFailed":"The image could not be displayed","omph.preview.zoomIn":"Zoom in","omph.preview.zoomOut":"Zoom out","omph.preview.zoomFit":"Fit to width","omph.newConversation":"New conversation","omph.conversationList":"Conversation list","omph.conversations":"Conversations","omph.noConversations":"No conversations yet","omph.initial.suggestions":"Suggested questions","omph.approval.waiting":"Waiting for approval","omph.approval.choose":"Choose an action","omph.approval.details":"Approval details","omph.approval.choices":"Actions","omph.approval.reject":"Reject","omph.approval.allowOnce":"Allow once","omph.approval.confirm":"Continue","omph.approval.other":"Other","omph.approval.otherPlaceholder":"Describe the action to take","omph.approval.escalation":"Tool {toolName} requests privileged execution","omph.approval.recommended":"(Recommended)","omph.approval.allowOnceException":"Allow this exception once","omph.approval.allowSession":"Allow this kind for the rest of the session","omph.approval.abandon":"Abandon","omph.input.placeholder":"Type a message...","omph.input.upload":"Upload file","omph.input.send":"Send message","omph.input.stop":"Stop generating","omph.input.queue.ask":"Agent is running. Send this now or after the turn?","omph.input.queue.sendNow":"Send now","omph.input.queue.afterTurn":"Send after this turn","omph.input.queue.queued":"Queued \u2014 sends after this turn","omph.input.queue.cancel":"Cancel","omph.input.message":"Message input","omph.input.tools":"Input tools","agentui.html.defaultTitle":"Interactive HTML","agentui.html.open":"Open","agentui.html.preview":"Preview","agentui.html.code":"Code","agentui.html.toggle":"Switch between code and preview","agentui.html.copy":"Copy code","agentui.html.copied":"Copied","agentui.html.download":"Download","agentui.html.close":"Close"},lf={"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.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.searchOpenPanel":"\u6253\u5F00\u5BF9\u8BDD","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","omph.status.idle":"\u7A7A\u95F2","omph.status.pending":"\u7B49\u5F85\u4E2D","omph.status.running":"\u5904\u7406\u4E2D","omph.status.success":"\u5DF2\u5B8C\u6210","omph.status.error":"\u51FA\u9519","omph.working":"\u5904\u7406\u4E2D","omph.workingFor":"\u5DF2\u5904\u7406 {duration}","omph.loadOlder":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","omph.loadingOlder":"\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F\u2026","omph.toBottom":"\u56DE\u5230\u5E95\u90E8","omph.copy":"\u590D\u5236","omph.copied":"\u5DF2\u590D\u5236","omph.turnActions":"\u56DE\u590D\u64CD\u4F5C","omph.usage":"\u7528\u91CF","omph.inputTokens":"\u8F93\u5165","omph.outputTokens":"\u8F93\u51FA","omph.duration":"\u7528\u65F6","omph.send":"\u53D1\u9001","omph.stop":"\u505C\u6B62","omph.supplement.queued":"\u5DF2\u52A0\u5165\u5F53\u524D\u4EFB\u52A1","omph.turnRail":"\u8F6E\u6B21","omph.secondUnit":"\u79D2","omph.minuteUnit":"\u5206","omph.preview.title":"\u6587\u4EF6\u9884\u89C8","omph.preview.close":"\u5173\u95ED\u9884\u89C8","omph.preview.back":"\u8FD4\u56DE\u5BF9\u8BDD","omph.preview.expand":"\u5C55\u5F00\u9884\u89C8","omph.preview.collapse":"\u8FD8\u539F\u9884\u89C8\u5927\u5C0F","omph.preview.copyContent":"\u590D\u5236\u5185\u5BB9","omph.preview.copyPath":"\u590D\u5236\u8DEF\u5F84","omph.preview.download":"\u4E0B\u8F7D","omph.preview.openExternal":"\u5728\u5916\u90E8\u6253\u5F00","omph.preview.wrap":"\u81EA\u52A8\u6362\u884C","omph.preview.loading":"\u6B63\u5728\u52A0\u8F7D\u6587\u4EF6","omph.preview.missing":"\u6587\u4EF6\u4E0D\u5B58\u5728","omph.preview.failed":"\u65E0\u6CD5\u52A0\u8F7D\u6B64\u6587\u4EF6","omph.preview.unsupported":"\u6B64\u6587\u4EF6\u7C7B\u578B\u4E0D\u652F\u6301\u9884\u89C8","omph.preview.retry":"\u91CD\u8BD5","omph.preview.resize":"\u8C03\u6574\u9884\u89C8\u5927\u5C0F","omph.preview.line":"\u7B2C {start} \u884C","omph.preview.lines":"\u7B2C {start}\u2013{end} \u884C","omph.preview.truncated":"\u5171 {total} \u884C\uFF0C\u4EC5\u663E\u793A\u524D {shown} \u884C","omph.preview.sheetTruncated":"\u5171 {total} \u884C\uFF0C\u4EC5\u663E\u793A\u524D {shown} \u884C","omph.preview.imageFailed":"\u56FE\u7247\u65E0\u6CD5\u663E\u793A","omph.preview.zoomIn":"\u653E\u5927","omph.preview.zoomOut":"\u7F29\u5C0F","omph.preview.zoomFit":"\u9002\u5E94\u5BBD\u5EA6","omph.newConversation":"\u65B0\u5EFA\u4F1A\u8BDD","omph.conversationList":"\u4F1A\u8BDD\u5217\u8868","omph.conversations":"\u4F1A\u8BDD","omph.noConversations":"\u8FD8\u6CA1\u6709\u4F1A\u8BDD","omph.initial.suggestions":"\u5019\u9009\u95EE\u9898","omph.approval.waiting":"\u7B49\u5F85\u5BA1\u6279","omph.approval.choose":"\u8BF7\u9009\u62E9\u64CD\u4F5C","omph.approval.details":"\u5BA1\u6279\u8BE6\u60C5","omph.approval.choices":"\u53EF\u9009\u64CD\u4F5C","omph.approval.reject":"\u62D2\u7EDD","omph.approval.allowOnce":"\u4EC5\u6B64\u4E00\u6B21","omph.approval.confirm":"\u7EE7\u7EED","omph.approval.other":"\u5176\u4ED6","omph.approval.otherPlaceholder":"\u63CF\u8FF0\u8981\u6267\u884C\u7684\u64CD\u4F5C","omph.approval.escalation":"\u5DE5\u5177 {toolName} \u8BF7\u6C42\u7279\u6743\u6267\u884C","omph.approval.recommended":"\uFF08\u63A8\u8350\uFF09","omph.approval.allowOnceException":"\u4EC5\u672C\u6B21\u7834\u4F8B","omph.approval.allowSession":"\u672C\u4F1A\u8BDD\u540C\u7C7B\u90FD\u5141\u8BB8","omph.approval.abandon":"\u653E\u5F03","omph.input.placeholder":"\u8F93\u5165\u6D88\u606F\u2026","omph.input.upload":"\u4E0A\u4F20\u6587\u4EF6","omph.input.send":"\u53D1\u9001\u6D88\u606F","omph.input.stop":"\u505C\u6B62\u751F\u6210","omph.input.queue.ask":"Agent \u6B63\u5728\u8FD0\u884C\uFF0C\u8FD9\u6761\u6D88\u606F\u600E\u4E48\u53D1\uFF1F","omph.input.queue.sendNow":"\u7ACB\u5373\u53D1\u9001","omph.input.queue.afterTurn":"\u672C\u8F6E\u7ED3\u675F\u540E\u53D1\u9001","omph.input.queue.queued":"\u5DF2\u6392\u961F\uFF0C\u672C\u8F6E\u7ED3\u675F\u540E\u81EA\u52A8\u53D1\u9001","omph.input.queue.cancel":"\u53D6\u6D88","omph.input.message":"\u6D88\u606F\u8F93\u5165","omph.input.tools":"\u8F93\u5165\u5DE5\u5177","agentui.html.defaultTitle":"\u4EA4\u4E92\u5F0F HTML","agentui.html.open":"\u6253\u5F00","agentui.html.preview":"\u9884\u89C8","agentui.html.code":"\u4EE3\u7801","agentui.html.toggle":"\u5207\u6362\u4EE3\u7801\u4E0E\u9884\u89C8","agentui.html.copy":"\u590D\u5236\u4EE3\u7801","agentui.html.copied":"\u5DF2\u590D\u5236","agentui.html.download":"\u4E0B\u8F7D","agentui.html.close":"\u5173\u95ED"},cf={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.searchOpenPanel":"Ouvrir la conversation","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","omph.status.idle":"Inactif","omph.status.pending":"En attente","omph.status.running":"En cours","omph.status.success":"Termin\xE9","omph.status.error":"Erreur","omph.working":"En cours","omph.workingFor":"En cours depuis {duration}","omph.loadOlder":"Charger les messages pr\xE9c\xE9dents","omph.loadingOlder":"Chargement des messages pr\xE9c\xE9dents\u2026","omph.toBottom":"Revenir en bas","omph.copy":"Copier","omph.copied":"Copi\xE9","omph.turnActions":"Actions de r\xE9ponse","omph.usage":"Utilisation","omph.inputTokens":"Entr\xE9e","omph.outputTokens":"Sortie","omph.duration":"Dur\xE9e","omph.send":"Envoyer","omph.stop":"Arr\xEAter","omph.supplement.queued":"Ajout\xE9 \xE0 la t\xE2che en cours","omph.turnRail":"Tours","omph.secondUnit":"s","omph.minuteUnit":"min","omph.preview.title":"Aper\xE7u du fichier","omph.preview.close":"Fermer l'aper\xE7u","omph.preview.back":"Retour \xE0 la conversation","omph.preview.expand":"Agrandir l\u2019aper\xE7u","omph.preview.collapse":"R\xE9duire l\u2019aper\xE7u","omph.preview.copyContent":"Copier le contenu","omph.preview.copyPath":"Copier le chemin","omph.preview.download":"T\xE9l\xE9charger","omph.preview.openExternal":"Ouvrir \xE0 l\u2019ext\xE9rieur","omph.preview.wrap":"Retour \xE0 la ligne","omph.preview.loading":"Chargement du fichier","omph.preview.missing":"Fichier introuvable","omph.preview.failed":"Impossible de charger ce fichier","omph.preview.unsupported":"Aucun aper\xE7u pour ce type de fichier","omph.preview.retry":"R\xE9essayer","omph.preview.resize":"Redimensionner l\u2019aper\xE7u","omph.preview.line":"Ligne {start}","omph.preview.lines":"Lignes {start}\u2013{end}","omph.preview.truncated":"Affichage des {shown} premi\xE8res lignes sur {total}","omph.preview.sheetTruncated":"Affichage des {shown} premi\xE8res lignes sur {total}","omph.preview.imageFailed":"Impossible d'afficher l'image","omph.preview.zoomIn":"Zoom avant","omph.preview.zoomOut":"Zoom arri\xE8re","omph.preview.zoomFit":"Ajuster \xE0 la largeur","omph.newConversation":"Nouvelle conversation","omph.conversationList":"Liste des conversations","omph.conversations":"Conversations","omph.noConversations":"Aucune conversation","omph.initial.suggestions":"Questions sugg\xE9r\xE9es","omph.approval.waiting":"En attente d'approbation","omph.approval.choose":"Choisir une action","omph.approval.details":"D\xE9tails de l'approbation","omph.approval.choices":"Actions","omph.approval.reject":"Refuser","omph.approval.allowOnce":"Autoriser une fois","omph.approval.confirm":"Continuer","omph.approval.other":"Autre","omph.approval.otherPlaceholder":"D\xE9crire l'action \xE0 effectuer","omph.approval.escalation":"L'outil {toolName} demande une ex\xE9cution privil\xE9gi\xE9e","omph.approval.recommended":"(Recommand\xE9)","omph.approval.allowOnceException":"Autoriser cette exception une fois","omph.approval.allowSession":"Autoriser ce type pour le reste de la session","omph.approval.abandon":"Abandonner","omph.input.placeholder":"Saisir un message\u2026","omph.input.upload":"T\xE9l\xE9verser un fichier","omph.input.send":"Envoyer le message","omph.input.stop":"Arr\xEAter la g\xE9n\xE9ration","omph.input.queue.ask":"L'agent travaille. Envoyer maintenant ou apr\xE8s ce tour ?","omph.input.queue.sendNow":"Envoyer maintenant","omph.input.queue.afterTurn":"Envoyer apr\xE8s ce tour","omph.input.queue.queued":"En file d'attente \u2014 envoi apr\xE8s ce tour","omph.input.queue.cancel":"Annuler","omph.input.message":"Saisie de message","omph.input.tools":"Outils de saisie","agentui.html.defaultTitle":"HTML interactif","agentui.html.open":"Ouvrir","agentui.html.preview":"Aper\xE7u","agentui.html.code":"Code","agentui.html.toggle":"Basculer entre code et aper\xE7u","agentui.html.copy":"Copier le code","agentui.html.copied":"Copi\xE9","agentui.html.download":"T\xE9l\xE9charger","agentui.html.close":"Fermer"},df={"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.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.searchOpenPanel":"Unterhaltung \xF6ffnen","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","omph.status.idle":"Inaktiv","omph.status.pending":"Ausstehend","omph.status.running":"L\xE4uft","omph.status.success":"Erfolgt","omph.status.error":"Fehler","omph.working":"In Arbeit","omph.workingFor":"In Arbeit seit {duration}","omph.loadOlder":"Fr\xFChere Nachrichten laden","omph.loadingOlder":"Fr\xFChere Nachrichten werden geladen\u2026","omph.toBottom":"Nach unten","omph.copy":"Kopieren","omph.copied":"Kopiert","omph.turnActions":"Antwortaktionen","omph.usage":"Nutzung","omph.inputTokens":"Eingabe","omph.outputTokens":"Ausgabe","omph.duration":"Dauer","omph.send":"Senden","omph.stop":"Stoppen","omph.supplement.queued":"Zum laufenden Vorgang hinzugef\xFCgt","omph.turnRail":"Runden","omph.secondUnit":"s","omph.minuteUnit":"min","omph.preview.title":"Dateivorschau","omph.preview.close":"Vorschau schlie\xDFen","omph.preview.back":"Zur\xFCck zur Konversation","omph.preview.expand":"Vorschau vergr\xF6\xDFern","omph.preview.collapse":"Vorschau wiederherstellen","omph.preview.copyContent":"Inhalt kopieren","omph.preview.copyPath":"Pfad kopieren","omph.preview.download":"Herunterladen","omph.preview.openExternal":"Extern \xF6ffnen","omph.preview.wrap":"Zeilenumbruch","omph.preview.loading":"Datei wird geladen","omph.preview.missing":"Datei nicht gefunden","omph.preview.failed":"Datei konnte nicht geladen werden","omph.preview.unsupported":"Keine Vorschau f\xFCr diesen Dateityp","omph.preview.retry":"Erneut versuchen","omph.preview.resize":"Vorschaugr\xF6\xDFe \xE4ndern","omph.preview.line":"Zeile {start}","omph.preview.lines":"Zeilen {start}\u2013{end}","omph.preview.truncated":"Die ersten {shown} von {total} Zeilen werden angezeigt","omph.preview.sheetTruncated":"Die ersten {shown} von {total} Zeilen werden angezeigt","omph.preview.imageFailed":"Bild konnte nicht angezeigt werden","omph.preview.zoomIn":"Vergr\xF6\xDFern","omph.preview.zoomOut":"Verkleinern","omph.preview.zoomFit":"An Breite anpassen","omph.newConversation":"Neue Konversation","omph.conversationList":"Konversationsliste","omph.conversations":"Konversationen","omph.noConversations":"Noch keine Konversationen","omph.initial.suggestions":"Vorgeschlagene Fragen","omph.approval.waiting":"Auf Genehmigung wartend","omph.approval.choose":"Aktion w\xE4hlen","omph.approval.details":"Genehmigungsdetails","omph.approval.choices":"Aktionen","omph.approval.reject":"Ablehnen","omph.approval.allowOnce":"Einmal erlauben","omph.approval.confirm":"Fortfahren","omph.approval.other":"Sonstiges","omph.approval.otherPlaceholder":"Aktion beschreiben","omph.approval.escalation":"Tool {toolName} fordert privilegierte Ausf\xFChrung","omph.approval.recommended":"(Empfohlen)","omph.approval.allowOnceException":"Diese Ausnahme einmal erlauben","omph.approval.allowSession":"Diese Art f\xFCr den Rest der Sitzung erlauben","omph.approval.abandon":"Aufgeben","omph.input.placeholder":"Nachricht eingeben\u2026","omph.input.upload":"Datei hochladen","omph.input.send":"Nachricht senden","omph.input.stop":"Generierung stoppen","omph.input.queue.ask":"Der Agent arbeitet. Jetzt oder nach diesem Zug senden?","omph.input.queue.sendNow":"Jetzt senden","omph.input.queue.afterTurn":"Nach diesem Zug senden","omph.input.queue.queued":"In Warteschlange \u2014 Senden nach diesem Zug","omph.input.queue.cancel":"Abbrechen","omph.input.message":"Nachrichteneingabe","omph.input.tools":"Eingabewerkzeuge","agentui.html.defaultTitle":"Interaktives HTML","agentui.html.open":"\xD6ffnen","agentui.html.preview":"Vorschau","agentui.html.code":"Code","agentui.html.toggle":"Zwischen Code und Vorschau wechseln","agentui.html.copy":"Code kopieren","agentui.html.copied":"Kopiert","agentui.html.download":"Herunterladen","agentui.html.close":"Schlie\xDFen"},pf={"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.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.searchOpenPanel":"\u4F1A\u8A71\u3092\u958B\u304F","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","omph.status.idle":"\u5F85\u6A5F\u4E2D","omph.status.pending":"\u51E6\u7406\u5F85\u3061","omph.status.running":"\u51E6\u7406\u4E2D","omph.status.success":"\u5B8C\u4E86","omph.status.error":"\u30A8\u30E9\u30FC","omph.working":"\u51E6\u7406\u4E2D","omph.workingFor":"\u51E6\u7406\u4E2D\uFF08{duration} \u7D4C\u904E\uFF09","omph.loadOlder":"\u904E\u53BB\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8AAD\u307F\u8FBC\u3080","omph.loadingOlder":"\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026","omph.toBottom":"\u4E00\u756A\u4E0B\u3078","omph.copy":"\u30B3\u30D4\u30FC","omph.copied":"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F","omph.turnActions":"\u8FD4\u4FE1\u30A2\u30AF\u30B7\u30E7\u30F3","omph.usage":"\u4F7F\u7528\u91CF","omph.inputTokens":"\u5165\u529B","omph.outputTokens":"\u51FA\u529B","omph.duration":"\u6240\u8981\u6642\u9593","omph.send":"\u9001\u4FE1","omph.stop":"\u505C\u6B62","omph.supplement.queued":"\u5B9F\u884C\u4E2D\u306E\u30BF\u30B9\u30AF\u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F","omph.turnRail":"\u30BF\u30FC\u30F3","omph.secondUnit":"\u79D2","omph.minuteUnit":"\u5206","omph.preview.title":"\u30D5\u30A1\u30A4\u30EB\u30D7\u30EC\u30D3\u30E5\u30FC","omph.preview.close":"\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u9589\u3058\u308B","omph.preview.back":"\u4F1A\u8A71\u306B\u623B\u308B","omph.preview.expand":"\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u62E1\u5927","omph.preview.collapse":"\u30D7\u30EC\u30D3\u30E5\u30FC\u306E\u30B5\u30A4\u30BA\u3092\u623B\u3059","omph.preview.copyContent":"\u5185\u5BB9\u3092\u30B3\u30D4\u30FC","omph.preview.copyPath":"\u30D1\u30B9\u3092\u30B3\u30D4\u30FC","omph.preview.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","omph.preview.openExternal":"\u5916\u90E8\u3067\u958B\u304F","omph.preview.wrap":"\u6298\u308A\u8FD4\u3057","omph.preview.loading":"\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D","omph.preview.missing":"\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","omph.preview.failed":"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F","omph.preview.unsupported":"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u306F\u30D7\u30EC\u30D3\u30E5\u30FC\u3067\u304D\u307E\u305B\u3093","omph.preview.retry":"\u518D\u8A66\u884C","omph.preview.resize":"\u30D7\u30EC\u30D3\u30E5\u30FC\u30B5\u30A4\u30BA\u306E\u5909\u66F4","omph.preview.line":"{start} \u884C\u76EE","omph.preview.lines":"{start}\u2013{end} \u884C","omph.preview.truncated":"\u5168 {total} \u884C\u4E2D\u5148\u982D {shown} \u884C\u3092\u8868\u793A","omph.preview.sheetTruncated":"\u5168 {total} \u884C\u4E2D\u5148\u982D {shown} \u884C\u3092\u8868\u793A","omph.preview.imageFailed":"\u753B\u50CF\u3092\u8868\u793A\u3067\u304D\u307E\u305B\u3093","omph.preview.zoomIn":"\u62E1\u5927","omph.preview.zoomOut":"\u7E2E\u5C0F","omph.preview.zoomFit":"\u5E45\u306B\u5408\u308F\u305B\u308B","omph.newConversation":"\u65B0\u3057\u3044\u4F1A\u8A71","omph.conversationList":"\u4F1A\u8A71\u30EA\u30B9\u30C8","omph.conversations":"\u4F1A\u8A71","omph.noConversations":"\u4F1A\u8A71\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093","omph.initial.suggestions":"\u5019\u88DC\u306E\u8CEA\u554F","omph.approval.waiting":"\u627F\u8A8D\u5F85\u3061","omph.approval.choose":"\u64CD\u4F5C\u3092\u9078\u629E","omph.approval.details":"\u627F\u8A8D\u306E\u8A73\u7D30","omph.approval.choices":"\u64CD\u4F5C","omph.approval.reject":"\u62D2\u5426","omph.approval.allowOnce":"\u4ECA\u56DE\u306E\u307F\u8A31\u53EF","omph.approval.confirm":"\u7D9A\u884C","omph.approval.other":"\u305D\u306E\u4ED6","omph.approval.otherPlaceholder":"\u5B9F\u884C\u3059\u308B\u64CD\u4F5C\u3092\u5165\u529B","omph.approval.escalation":"\u30C4\u30FC\u30EB {toolName} \u304C\u7279\u6A29\u5B9F\u884C\u3092\u8981\u6C42\u3057\u3066\u3044\u307E\u3059","omph.approval.recommended":"\uFF08\u63A8\u5968\uFF09","omph.approval.allowOnceException":"\u4ECA\u56DE\u306E\u307F\u4F8B\u5916\u3092\u8A31\u53EF","omph.approval.allowSession":"\u3053\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u3067\u306F\u540C\u7A2E\u3092\u8A31\u53EF","omph.approval.abandon":"\u653E\u68C4","omph.input.placeholder":"\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u5165\u529B\u2026","omph.input.upload":"\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9","omph.input.send":"\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u9001\u4FE1","omph.input.stop":"\u751F\u6210\u3092\u505C\u6B62","omph.input.queue.ask":"\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304C\u5B9F\u884C\u4E2D\u3067\u3059\u3002\u4ECA\u3059\u3050\u9001\u4FE1\u3057\u307E\u3059\u304B\u3001\u3053\u306E\u30BF\u30FC\u30F3\u306E\u5F8C\u306B\u9001\u4FE1\u3057\u307E\u3059\u304B\uFF1F","omph.input.queue.sendNow":"\u4ECA\u3059\u3050\u9001\u4FE1","omph.input.queue.afterTurn":"\u3053\u306E\u30BF\u30FC\u30F3\u306E\u5F8C\u306B\u9001\u4FE1","omph.input.queue.queued":"\u5F85\u6A5F\u4E2D \u2014 \u3053\u306E\u30BF\u30FC\u30F3\u306E\u5F8C\u306B\u81EA\u52D5\u9001\u4FE1","omph.input.queue.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","omph.input.message":"\u30E1\u30C3\u30BB\u30FC\u30B8\u5165\u529B","omph.input.tools":"\u5165\u529B\u30C4\u30FC\u30EB","agentui.html.defaultTitle":"\u30A4\u30F3\u30BF\u30E9\u30AF\u30C6\u30A3\u30D6 HTML","agentui.html.open":"\u958B\u304F","agentui.html.preview":"\u30D7\u30EC\u30D3\u30E5\u30FC","agentui.html.code":"\u30B3\u30FC\u30C9","agentui.html.toggle":"\u30B3\u30FC\u30C9\u3068\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u5207\u308A\u66FF\u3048\u308B","agentui.html.copy":"\u30B3\u30FC\u30C9\u3092\u30B3\u30D4\u30FC","agentui.html.copied":"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F","agentui.html.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","agentui.html.close":"\u9589\u3058\u308B"},uf={"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.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.searchOpenPanel":"\uB300\uD654 \uC5F4\uAE30","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","omph.status.idle":"\uB300\uAE30","omph.status.pending":"\uB300\uAE30 \uC911","omph.status.running":"\uCC98\uB9AC \uC911","omph.status.success":"\uC644\uB8CC","omph.status.error":"\uC624\uB958","omph.working":"\uCC98\uB9AC \uC911","omph.workingFor":"\uCC98\uB9AC \uC911 {duration} \uACBD\uACFC","omph.loadOlder":"\uC774\uC804 \uBA54\uC2DC\uC9C0 \uBD88\uB7EC\uC624\uAE30","omph.loadingOlder":"\uBD88\uB7EC\uC624\uB294 \uC911\u2026","omph.toBottom":"\uB9E8 \uC544\uB798\uB85C","omph.copy":"\uBCF5\uC0AC","omph.copied":"\uBCF5\uC0AC\uB428","omph.turnActions":"\uC751\uB2F5 \uC791\uC5C5","omph.usage":"\uC0AC\uC6A9\uB7C9","omph.inputTokens":"\uC785\uB825","omph.outputTokens":"\uCD9C\uB825","omph.duration":"\uC18C\uC694 \uC2DC\uAC04","omph.send":"\uBCF4\uB0B4\uAE30","omph.stop":"\uC911\uC9C0","omph.supplement.queued":"\uC2E4\uD589 \uC911\uC778 \uC791\uC5C5\uC5D0 \uCD94\uAC00\uB428","omph.turnRail":"\uD134","omph.secondUnit":"\uCD08","omph.minuteUnit":"\uBD84","omph.preview.title":"\uD30C\uC77C \uBBF8\uB9AC\uBCF4\uAE30","omph.preview.close":"\uBBF8\uB9AC\uBCF4\uAE30 \uB2EB\uAE30","omph.preview.back":"\uB300\uD654\uB85C \uB3CC\uC544\uAC00\uAE30","omph.preview.expand":"\uBBF8\uB9AC\uBCF4\uAE30 \uD655\uB300","omph.preview.collapse":"\uBBF8\uB9AC\uBCF4\uAE30 \uD06C\uAE30 \uBCF5\uC6D0","omph.preview.copyContent":"\uB0B4\uC6A9 \uBCF5\uC0AC","omph.preview.copyPath":"\uACBD\uB85C \uBCF5\uC0AC","omph.preview.download":"\uB2E4\uC6B4\uB85C\uB4DC","omph.preview.openExternal":"\uC678\uBD80\uC5D0\uC11C \uC5F4\uAE30","omph.preview.wrap":"\uC904 \uBC14\uAFC8","omph.preview.loading":"\uD30C\uC77C \uB85C\uB4DC \uC911","omph.preview.missing":"\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C","omph.preview.failed":"\uC774 \uD30C\uC77C\uC744 \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.unsupported":"\uC774 \uD30C\uC77C \uD615\uC2DD\uC740 \uBBF8\uB9AC\uBCFC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.retry":"\uB2E4\uC2DC \uC2DC\uB3C4","omph.preview.resize":"\uBBF8\uB9AC\uBCF4\uAE30 \uD06C\uAE30 \uC870\uC815","omph.preview.line":"{start}\uC904","omph.preview.lines":"{start}\u2013{end}\uC904","omph.preview.truncated":"\uC804\uCCB4 {total}\uC904 \uC911 \uCC98\uC74C {shown}\uC904 \uD45C\uC2DC","omph.preview.sheetTruncated":"\uC804\uCCB4 {total}\uD589 \uC911 \uCC98\uC74C {shown}\uD589 \uD45C\uC2DC","omph.preview.imageFailed":"\uC774\uBBF8\uC9C0\uB97C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.zoomIn":"\uD655\uB300","omph.preview.zoomOut":"\uCD95\uC18C","omph.preview.zoomFit":"\uB108\uBE44\uC5D0 \uB9DE\uCD94\uAE30","omph.newConversation":"\uC0C8 \uB300\uD654","omph.conversationList":"\uB300\uD654 \uBAA9\uB85D","omph.conversations":"\uB300\uD654","omph.noConversations":"\uC544\uC9C1 \uB300\uD654\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","omph.initial.suggestions":"\uCD94\uCC9C \uC9C8\uBB38","omph.approval.waiting":"\uC2B9\uC778 \uB300\uAE30 \uC911","omph.approval.choose":"\uC791\uC5C5\uC744 \uC120\uD0DD\uD558\uC138\uC694","omph.approval.details":"\uC2B9\uC778 \uC138\uBD80 \uC815\uBCF4","omph.approval.choices":"\uC791\uC5C5","omph.approval.reject":"\uAC70\uBD80","omph.approval.allowOnce":"\uD55C \uBC88\uB9CC \uD5C8\uC6A9","omph.approval.confirm":"\uACC4\uC18D","omph.approval.other":"\uAE30\uD0C0","omph.approval.otherPlaceholder":"\uC218\uD589\uD560 \uC791\uC5C5\uC744 \uC124\uBA85\uD558\uC138\uC694","omph.approval.escalation":"\uB3C4\uAD6C {toolName}\uC774(\uAC00) \uAD8C\uD55C \uC788\uB294 \uC2E4\uD589\uC744 \uC694\uCCAD\uD569\uB2C8\uB2E4","omph.approval.recommended":"(\uAD8C\uC7A5)","omph.approval.allowOnceException":"\uC774\uBC88\uB9CC \uC608\uC678 \uD5C8\uC6A9","omph.approval.allowSession":"\uC774 \uC138\uC158\uC5D0\uC11C \uAC19\uC740 \uC885\uB958 \uD5C8\uC6A9","omph.approval.abandon":"\uD3EC\uAE30","omph.input.placeholder":"\uBA54\uC2DC\uC9C0 \uC785\uB825\u2026","omph.input.upload":"\uD30C\uC77C \uC5C5\uB85C\uB4DC","omph.input.send":"\uBA54\uC2DC\uC9C0 \uBCF4\uB0B4\uAE30","omph.input.stop":"\uC0DD\uC131 \uC911\uC9C0","omph.input.queue.ask":"\uC5D0\uC774\uC804\uD2B8\uAC00 \uC2E4\uD589 \uC911\uC785\uB2C8\uB2E4. \uC9C0\uAE08 \uBCF4\uB0BC\uAE4C\uC694, \uC774\uBC88 \uD134\uC774 \uB05D\uB09C \uD6C4\uC5D0 \uBCF4\uB0BC\uAE4C\uC694?","omph.input.queue.sendNow":"\uC9C0\uAE08 \uBCF4\uB0B4\uAE30","omph.input.queue.afterTurn":"\uC774\uBC88 \uD134 \uD6C4\uC5D0 \uBCF4\uB0B4\uAE30","omph.input.queue.queued":"\uB300\uAE30 \uC911 \u2014 \uC774\uBC88 \uD134 \uD6C4 \uC790\uB3D9 \uC804\uC1A1","omph.input.queue.cancel":"\uCDE8\uC18C","omph.input.message":"\uBA54\uC2DC\uC9C0 \uC785\uB825","omph.input.tools":"\uC785\uB825 \uB3C4\uAD6C","agentui.html.defaultTitle":"\uC778\uD130\uB799\uD2F0\uBE0C HTML","agentui.html.open":"\uC5F4\uAE30","agentui.html.preview":"\uBBF8\uB9AC \uBCF4\uAE30","agentui.html.code":"\uCF54\uB4DC","agentui.html.toggle":"\uCF54\uB4DC\uC640 \uBBF8\uB9AC \uBCF4\uAE30 \uC804\uD658","agentui.html.copy":"\uCF54\uB4DC \uBCF5\uC0AC","agentui.html.copied":"\uBCF5\uC0AC\uB428","agentui.html.download":"\uB2E4\uC6B4\uB85C\uB4DC","agentui.html.close":"\uB2EB\uAE30"},qn={en:sf,zh:lf,fr:cf,de:df,ja:pf,ko:uf};var cd=(t,o)=>o?t.replace(/\{(\w+)\}/g,(r,n)=>{let a=o[n];return a==null?"":String(a)}):t,ff={locale:"en",t:(t,o)=>cd(qn.en[t]||t,o)},dd=createContext(ff),Xa=({locale:t="en",messages:o,children:r})=>{let n=useMemo(()=>{let a=qn[t]||qn.en,i=o?.[t]||{},s={...qn.en,...a,...i};return {locale:t,t:(c,d)=>cd(s[c]||c,d)}},[t,o]);return f(dd.Provider,{value:n,children:r})},ce=()=>useContext(dd);function Xn({items:t,onItemClick:o,className:r="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:c=false,pinnedIds:d,onTogglePin:u}){let{t:m}=ce(),h=s==="dark",f$1=usePathname(),[p,b]=useState(false),[C,g$1]=useState(new Set),x=a!==void 0&&i!==void 0,v=x?a:C;useEffect(()=>{b(true);},[]);let y=S=>{if(x)i(S);else {let I=new Set(C);I.has(S)?I.delete(S):I.add(S),g$1(I);}},P=S=>{S.children&&S.children.length>0&&y(S.id),o&&o(S);};return !t||!Array.isArray(t)?f("div",{className:vo("tree-menu",r),children:f("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:m("navigation.noItems")})}):f("div",{className:vo("tree-menu",r),children:t.map(S=>{let I=v.has(S.id)||S.isExpanded,M=S.children&&S.children.length>0,D=56+Math.max(0,n-1)*8,N=n===0?12:M?D-24:D,T=S.appurl||S.href,k=p&&T?f$1===T:false,A=d?.has(S.id)??false,L=c&&S.pinnable!==false&&!!T&&!M;return g("div",{className:"tree-menu-item relative",children:[k&&f("div",{className:vo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),g(js,{variant:"ghost",className:vo("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",M&&I&&!k?h?"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",k?h?"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)]":h?"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:`${N}px`,paddingRight:L?"34px":"10px"},onClick:()=>P(S),children:[M&&f("div",{className:vo("flex-shrink-0 transition-transform duration-200",I&&"rotate-90",k?"text-[var(--orb-nav-active-fg)]":h?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:f(zo,{className:"h-4 w-4"})}),S.icon&&f("div",{className:vo("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",k?"text-[var(--orb-nav-active-fg)]":h?"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:vo("text-sm truncate transition-colors duration-200",k?"font-semibold":"font-medium"),children:S.title||S.label}),S.description&&f("div",{className:vo("text-xs truncate transition-colors duration-200",k?h?"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&&u&&f("button",{type:"button","aria-label":m(A?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":A,title:m(A?"navigation.pin.remove":"navigation.pin.add"),onClick:W=>{W.preventDefault(),W.stopPropagation(),u(S);},className:vo("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",A&&"orb-is-pinned"),children:f(jr,{className:vo("h-3.5 w-3.5",A&&"fill-current")})}),M&&f("div",{className:vo("grid transition-[grid-template-rows] duration-300 ease-in-out",I?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:f("div",{className:vo("overflow-hidden",I&&"pt-1"),children:f(Xn,{items:S.children,onItemClick:o,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:c,pinnedIds:d,onTogglePin:u})})})]},S.id)})})}var Cf="orbcafe:navigation-island:pinned-items",Js="orbcafe-navigation-pinned",xf=t=>t.appurl||t.href,ud=t=>{let o=[];return t.forEach(r=>{let n=!!r.children?.length;r.pinnable!==false&&xf(r)&&!n&&o.push({...r,children:void 0}),r.children?.length&&o.push(...ud(r.children));}),o},md=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:c,showDisplayModeToggle:d=true,enablePinning:u=true,pinStorageKey:m=Cf,pinnedItemIds:h,defaultPinnedItemIds:f$1=[],onPinnedItemIdsChange:p,pinnedSectionTitle:b})=>{let{t:C}=ce(),g$1=i==="dark",x=s==="floating",v=useRouter(),[y,P]=useState(""),[S,I]=useState(new Set),[M,w]=useState(f$1),[D,N]=useState(false),T=h!==void 0,k=useMemo(()=>h??M,[h,M]),A=useMemo(()=>new Set(k),[k]);useEffect(()=>{t&&I(new Set);},[t]),useEffect(()=>{if(!u||T){N(true);return}try{let B=window.localStorage.getItem(m);if(B){let q=JSON.parse(B);Array.isArray(q)&&w(q.filter(Z=>typeof Z=="string"));}}catch{}finally{N(true);}},[u,T,m]),useEffect(()=>{if(!(!u||T||!D))try{window.localStorage.setItem(m,JSON.stringify(k));}catch{}},[k,u,T,m,D]),useEffect(()=>{!u||t||k.length===0||I(B=>{if(B.has(Js))return B;let q=new Set(B);return q.add(Js),q});},[t,k.length,u]);let L=useCallback(B=>{let q=Array.from(new Set(B));T||w(q),p?.(q);},[T,p]),W=useCallback(B=>{let q=B.id,Z=A.has(q)?k.filter(Y=>Y!==q):[...k,q];L(Z);},[k,A,L]),ee=useMemo(()=>{if(!u||k.length===0)return a;let B=new Map(ud(a).map(Z=>[Z.id,Z])),q=k.map(Z=>B.get(Z)).filter(Z=>!!Z);return q.length===0?a:[{id:Js,title:b||C("navigation.pinned"),icon:f(jr,{className:"w-4 h-4"}),children:q,pinnable:false},...a]},[k,u,a,b,C]),O=useCallback(B=>{let q=[],Z=Y=>{Y.forEach(J=>{q.push(J.id),J.children&&Z(J.children);});};return Z(B),q},[]),_=useMemo(()=>{if(!y.trim())return ee;let B=q=>q.reduce((Z,Y)=>{let J=Y.title?.toLowerCase().includes(y.toLowerCase())||Y.description?.toLowerCase().includes(y.toLowerCase()),le=Y.children?B(Y.children):[];return (J||le.length>0)&&Z.push({...Y,children:le.length>0?le:Y.children}),Z},[]);return B(ee)},[y,ee]),V=useMemo(()=>y.trim()?new Set(O(ee)):S,[y,ee,S,O]),Q=useCallback(async B=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",B),B.id==="chat"||B.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{v.push("/chat?new=true");}catch(Z){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",Z),v.push("/chat");}return}let q=B.appurl||B.href;q&&(q.startsWith("http://")||q.startsWith("https://")?window.open(q,"_blank"):v.push(q));},[v]),H=useCallback(()=>{c?.(s==="fixed"?"floating":"fixed");},[s,c]);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 ${r} ${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: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:C("navigation.expand"),children:f(Vo,{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:C("navigation.searchPlaceholder"),value:y,onChange:B=>P(B.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(Vo,{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:_.length===0?f("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?f(Hn,{className:"h-5 w-5"}):C(y?"navigation.noMatch":"navigation.noAccessibleApp")}):g(e,{children:[!t&&f("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:f(Xn,{items:_,onItemClick:Q,className:"space-y-1",expandedIds:V,colorMode:i,enablePinning:u,pinnedIds:A,onTogglePin:W,onToggleExpand:B=>{let q=new Set(S);_.some(Y=>Y.id===B)?q.has(B)?q.delete(B):(_.forEach(Y=>{Y.id!==B&&q.has(Y.id)&&q.delete(Y.id);}),q.add(B)):q.has(B)?q.delete(B):q.add(B),I(q);}})}),t&&f("div",{className:"space-y-2",children:ee.map(B=>f("div",{className:"space-y-1",children:f("button",{onClick:()=>{o();let q=new Set([B.id]);I(q);},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:C("navigation.expandView",{title:B.title||""}),children:B.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:B.title?.charAt(0)||"?"})})},B.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:C("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:C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(za,{className:"h-4 w-4"}):f(Va,{className:"h-4 w-4"})})]})};var Sf="orbcafe:navigation-island:pinned-items",el="orbcafe-navigation-pinned",gd=t=>t.appurl||t.href,hd=t=>t.flatMap(o=>{let r=!!o.children?.length,n=o.pinnable!==false&&gd(o)&&!r?[{...o,children:void 0}]:[];return o.children?.length?[...n,...hd(o.children)]:n}),fd=t=>t.flatMap(o=>[o.id,...o.children?fd(o.children):[]]),bd=(t,o)=>t.reduce((r,n)=>{let a=n.children?bd(n.children,o):[];return ([n.title,n.label,n.description].some(s=>s?.toLocaleLowerCase().includes(o))||a.length>0)&&r.push({...n,children:a.length>0?a:n.children}),r},[]),tl=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:c,showDisplayModeToggle:d=true,enablePinning:u=true,pinStorageKey:m=Sf,pinnedItemIds:h,defaultPinnedItemIds:f$1=[],onPinnedItemIdsChange:p,pinnedSectionTitle:b})=>{let{t:C}=ce(),g$1=useRouter(),x=s==="floating",[v,y]=useState(""),[P,S]=useState(new Set),[I,M]=useState(f$1),[w,D]=useState(false),N=h!==void 0,T=h??I,k=useMemo(()=>new Set(T),[T]);useEffect(()=>{t&&S(new Set);},[t]),useEffect(()=>{if(!u||N){D(true);return}try{let B=window.localStorage.getItem(m);if(B){let q=JSON.parse(B);Array.isArray(q)&&M(q.filter(Z=>typeof Z=="string"));}}catch{}finally{D(true);}},[u,N,m]),useEffect(()=>{if(!(!u||N||!w))try{window.localStorage.setItem(m,JSON.stringify(T));}catch{}},[T,u,N,m,w]),useEffect(()=>{!u||t||T.length===0||S(B=>{if(B.has(el))return B;let q=new Set(B);return q.add(el),q});},[t,T.length,u]);let A=useCallback(B=>{let q=Array.from(new Set(B));N||M(q),p?.(q);},[N,p]),L=useCallback(B=>{A(k.has(B.id)?T.filter(q=>q!==B.id):[...T,B.id]);},[T,k,A]),W=useMemo(()=>{if(!u||T.length===0)return a;let B=new Map(hd(a).map(Z=>[Z.id,Z])),q=T.map(Z=>B.get(Z)).filter(Z=>!!Z);return q.length===0?a:[{id:el,title:b||C("navigation.pinned"),icon:f(jr,{className:"h-4 w-4"}),children:q,pinnable:false},...a]},[T,u,a,b,C]),ee=v.trim().toLocaleLowerCase(),O=useMemo(()=>ee?bd(W,ee):W,[W,ee]),_=useMemo(()=>ee?new Set(fd(O)):P,[P,O,ee]),V=useCallback(B=>{S(q=>{let Z=new Set(q),Y=O.some(J=>J.id===B);return Z.has(B)?Z.delete(B):(Y&&O.forEach(J=>Z.delete(J.id)),Z.add(B)),Z});},[O]),Q=useCallback(B=>{let q=gd(B);q&&(B.id==="chat"||B.appurl==="/chat"?g$1.push("/chat?new=true"):/^https?:\/\//.test(q)?window.open(q,"_blank","noopener,noreferrer"):g$1.push(q));},[g$1]),H=B=>{o(),S(new Set([B.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: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: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:C("navigation.expand"),"aria-label":C("navigation.expand"),children:f(Vo,{className:"h-5 w-5"})}):g("label",{className:"relative block",children:[f("span",{className:"orb-visually-hidden",children:C("navigation.searchPlaceholder")}),f(Vo,{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:v,onChange:B=>y(B.target.value),placeholder:C("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:O.length===0?f("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?f(Hn,{className:"h-5 w-5"}):C(ee?"navigation.noMatch":"navigation.noAccessibleApp")}):t?f("div",{className:"space-y-1",children:W.map(B=>f("button",{type:"button",onClick:()=>H(B),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:C("navigation.expandView",{title:B.title||B.label||""}),children:B.icon||f(Hn,{className:"h-5 w-5"})},B.id))}):f(Xn,{items:O,onItemClick:Q,className:"space-y-1",expandedIds:_,onToggleExpand:V,colorMode:i,enablePinning:u,pinnedIds:k,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?.(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:C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(za,{className:"h-4 w-4"}):f(Va,{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:C("navigation.collapse"),"aria-label":C("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}})})})]})};tl.displayName="NavigationIsland2";var yd=(t={})=>{let{initialCollapsed:o=false,initialDisplayMode:r="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:c,onPinnedItemIdsChange:d,pinnedSectionTitle:u}=t,[m,h]=useState(o),[f,p]=useState(r),[b,C]=useState(n),g=useCallback(()=>{h(y=>!y);},[]),x=useCallback(()=>{p(y=>y==="fixed"?"floating":"fixed");},[]),v=useMemo(()=>({collapsed:m,onToggle:g,menuData:b,displayMode:f,onDisplayModeChange:p,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:c,onPinnedItemIdsChange:d,pinnedSectionTitle:u}),[m,g,b,f,p,a,i,s,c,d,u]);return {collapsed:m,setCollapsed:h,toggleCollapsed:g,displayMode:f,setDisplayMode:p,toggleDisplayMode:x,menuData:b,setMenuData:C,navigationIslandProps:v}};var rl=class{constructor(){a(this,"listener",null);}register(o){this.listener=o;}unregister(){this.listener=null;}show(o,r,n){this.listener&&this.listener({type:o,content:r,options:n});}hide(){this.listener&&this.listener(null);}},sr=new rl,uT={success:(t,o)=>sr.show("success",t,o),error:(t,o)=>sr.show("error",t,o),warning:(t,o)=>sr.show("warning",t,o),info:(t,o)=>sr.show("info",t,o),show:(t,o,r)=>sr.show(t,o,r),hide:()=>sr.hide()};var Pf={success:{icon:f(Fn,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:f($a,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:f(Ea,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:f(Oa,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},Qn=({open:t,title:o,message:r,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:c=true,maxWidth:d="xs",type:u="default"})=>{let{t:m}=ce(),h=i||m("messageBox.confirm"),f$1=s||m("messageBox.cancel"),p=()=>{a?a():n();},b=Pf[u],C=u!=="default";return g(Lt,{open:t,onClose:n,maxWidth:d,sx:C?{borderTop:`6px solid ${b.iconColor}`}:void 0,children:[C&&f("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:b.iconColor},children:b.icon}),o&&f("div",{className:"orb-dialog-title",style:{textAlign:C?"center":"left",paddingTop:C?8:16},children:o}),f("div",{className:"orb-dialog-content",style:{textAlign:C?"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:C?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[c&&f(Pe,{onClick:n,variant:"text",children:f$1}),f(Pe,{onClick:p,variant:"contained",color:C&&u==="error"?"error":"primary",autoFocus:true,children:h})]})]})},CT=()=>{let[t,o]=Jt__default.useState(null),[r,n]=Jt__default.useState(false);Jt__default.useEffect(()=>{let s=c=>{c?(o(c),n(true)):(n(false),o(null));};return sr.register(s),()=>sr.unregister()},[]);let a=()=>{n(false),t?.options?.onClose&&t.options.onClose(),o(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),n(false),o(null);};return t?f(Qn,{open:r,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 PT=({status:t,showIcon:o=true})=>{let r="gray",n,a=t;return t==="OK"?(r="blue",n=f(Fn,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(r="orange",n=f(Ea,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(r="orange",n=f($a,{size:14,strokeWidth:2}),a="Warning"),f(Ct,{label:a,tone:r,icon:o&&n?n:void 0})};var MT=({dense:t,sx:o,className:r,children:n,...a})=>f("ul",{...a,className:r,style:{listStyle:"none",margin:0,padding:0,...o},children:n}),RT=({button:t,divider:o,sx:r,className:n,children:a,...i})=>f("li",{...i,className:n,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:a}),NT=({sx:t,className:o,children:r,...n})=>f("button",{...n,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}),DT=({children:t,sx:o})=>f("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...o},children:t}),AT=({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})]}),ET=({sx:t,className:o,children:r,...n})=>f("li",{...n,className:o,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:r}),LT=({children:t,sx:o})=>f("div",{style:{marginRight:12,display:"flex",alignItems:"center",...o},children:t});var BT=({xs:t,md:o,lg:r,sx:n,children:a,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,...n},children:a})};var Lo=tt,ao=(t,o)=>forwardRef(({component:r,sx:n,className:a,style:i,children:s,...c},d$1)=>{let u=r??t,m=d(n,[o,a].filter(Boolean).join(" "),i);return f(u,{ref:d$1,className:m.className,style:m.style,...c,children:s})}),Ie=ao("div"),xd=ao("a","orb-link"),Fr=De,wd=se,yo=E;var Sd=ie;var kd=Rt,Jo=on,oi=tn,ri=Ua;var ni=Ga,Pd=Yo,Td=({value:t,variant:o,color:r,sx:n})=>f($n,{value:o==="determinate"?t:void 0,color:r,sx:n}),Id=ao("table","orb-tbl"),Md=ao("tbody"),il=ao("td"),Rd=ao("div","orb-table-container"),Nd=ao("thead"),sl=ao("tr");ao("tfoot");ao("div","orb-dialog-title");ao("div","orb-dialog-content");ao("div","orb-dialog-actions");ao("p","orb-body-dense");var lr=ao("span","orb-input-adornment"),Dd=forwardRef(({sx:t,fullWidth:o,className:r,style:n,...a},i)=>{let s=d(t,["orb-input-base",r].filter(Boolean).join(" "),n);return f("input",{ref:i,className:s.className,style:{width:o?"100%":void 0,...s.style},...a})});var yr=ao("div","orb-form-control"),jn=({control:t,label:o,...r})=>g("label",{className:"orb-form-control-label",...r,children:[t,f("span",{children:o})]}),Df=({primary:t,secondary:o,children:r,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>g("span",{className:"orb-list-item-text",...i,children:[t??r,o?f("small",{children:o}):null]}),Af=ao("span","orb-list-item-icon"),_t=Df,Wo=Af;ao("div","orb-list-subheader");var ll=({container:t,item:o,spacing:r,xs:n,sm:a,md:i,lg:s,xl:c,sx:d,...u})=>{let m={},h=f=>typeof f=="number"?`${f/12*100}%`:f?"100%":void 0;return n!==void 0&&(m.xs=h(n)),a!==void 0&&(m.sm=h(a)),i!==void 0&&(m.md=h(i)),s!==void 0&&(m.lg=h(s)),c!==void 0&&(m.xl=h(c)),f(Ie,{...u,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&r?r:void 0,width:o?m:void 0,...d??{}}})},rn=({in:t,children:o,unmountOnExit:r,...n})=>!t&&r?null:f("div",{hidden:!t,...n,children:o}),Ad=({children:t,container:o})=>typeof document>"u"?null:createPortal(t,o??document.body),Ed=ao("div","orb-toolbar"),Ld=({active:t,direction:o="asc",children:r,sx:n,className:a,style:i,...s})=>{let c=d(n,["orb-table-sort-label",t?"orb-is-active":"",a].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(Pt,{className:"orb-table-sort-icon",name:o==="desc"?"down":"up",size:11})]})},ai=({open:t,anchorEl:o,onClose:r,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:c,sx:d$1,className:u,style:m,...h})=>{let f$1=useRef(null);if(useEffect(()=>{if(!t)return;let x=y=>{let P=y.composedPath();f$1.current&&P.includes(f$1.current)||o&&P.includes(o)||r?.();},v=y=>{y.key==="Escape"&&r?.();};return document.addEventListener("pointerdown",x,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",x,true),document.removeEventListener("keydown",v,true);}},[o,r,t]),!t||typeof document>"u")return null;let p=o?.getBoundingClientRect(),b=s?.paper??c,C=[...Array.isArray(b?.sx)?b.sx:b?.sx?[b.sx]:[],...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],g=d(C,["orb-pop",b?.className,u].filter(Boolean).join(" "),{...b?.style,...m});return createPortal(f("div",{...h,ref:f$1,className:g.className,style:{position:"fixed",left:p?.left??16,top:(p?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},Od=({open:t,onClose:o,anchor:r="left",children:n,PaperProps:a})=>{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(a?.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:n})]}),document.body)},Fd=({value:t,onChange:o,children:r,variant:n,scrollButtons:a,...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)}),Bd=({value:t,label:o,children:r,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:o??r});var io=()=>c(),Cr=(t,o)=>Do(t);var Hd=({day:t,onDaySelect:o,selected:r,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...c})=>{let d$1=d(i,`orb-cal-day ${r?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return f("button",{type:"button",className:d$1.className,style:d$1.style,onClick:()=>o?.(t),...c,children:t.date()})},zd=({value:t,referenceDate:o,onChange:r,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:c,...d})=>f(Un,{value:t,month:o,onChange:u=>r?.(u),onMonthChange:u=>{n?.(u),a?.(u);},minDate:i,maxDate:s,renderDay:c?.day?(u,m)=>c.day?.({day:u,selected:m.selected,outsideCurrentMonth:m.outsideCurrentMonth,onDaySelect:h=>r?.(h)}):void 0,...d}),Vd=({children:t})=>f(e,{children:t}),ti=class{};var Ef=(t,o)=>o!==void 0?o:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,ke=t=>({fontSize:r,size:n,sx:a,className:i,style:s,titleAccess:c,...d$1})=>{let u=d(a,i,s);return f(Pt,{name:t,size:Ef(r,n),className:u.className,style:u.style,"aria-label":d$1["aria-label"]??c,...d$1})},xr=ke("tree"),Br=ke("add"),Wd=ke("duplicate"),cl=ke("down"),$d=ke("navigationRight"),_d=ke("navigationRight"),dl=ke("up"),Gd=ke("delete"),Ud=ke("camera"),Kd=ke("accept"),qd=ke("accept"),ii=ke("navigationRight"),Xd=ke("dimension"),pl=ke("decline"),wr=ke("decline"),Zd=ke("decline"),Yd=ke("decline"),si=ke("delete"),li=ke("delete"),Qd=ke("download"),jd=ke("move"),Jd=ke("edit"),nn=ke("slimDown"),ep=ke("filter"),an=ke("sum"),tp=ke("lineChart"),op=ke("document"),$o=ke("slimDown"),rp=ke("navigationLeft"),Sr=ke("navigationRight"),ci=ke("slimUp"),di=ke("navigationLeft"),pi=ke("navigationRight"),np=ke("dimension"),ap=ke("splitOne"),ui=ke("menu"),ip=ke("microphone"),sp=ke("microphone"),lp=ke("microphone"),cp=ke("qrCode"),kr=ke("save"),Hr=ke("search"),dp=ke("search"),pp=ke("paperPlane"),up=ke("paperPlane"),mp=ke("wrench"),gp=ke("sort"),mi=ke("splitTwo"),hp=ke("favorite"),fp=ke("favorite"),ul=ke("stop"),bp=ke("tableRow"),gi=ke("collapseAll"),hi=ke("expandAll"),sn=ke("tableColumn"),vp=ke("overview"),yp=ke("hide");var Of=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],xp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],Po=t=>String(t),wp=(t,o)=>t[o],Sp=t=>{let o=t.value??t.id??t.key??t.code;return typeof o=="number"||typeof o=="string"?o:""},Ff=t=>{let o=t.label??t.description??t.name??t.title;return String(typeof o=="number"||typeof o=="string"?o:Sp(t))},Bf=t=>{let o=t.description??t.subtitle;return typeof o=="number"||typeof o=="string"?String(o):void 0},kp=({value:t=null,items:o=[],columns:r,mode:n="single",dialogTitle:a="Value Help",searchPlaceholder:i="Search values...",selectLabel:s="Select",clearLabel:c="Clear",cancelLabel:d="Cancel",valueHelpLabel:u="Open value help",noResultsText:m="No matching values",loading:h=false,clearable:f$1=true,allowManualInput:p=true,validateManualInput:b=true,manualInputErrorText:C="Enter a valid value.",selectedItems:g$1=[],displayValue:x,getOptionValue:v=Sp,getOptionLabel:y=Ff,getOptionDescription:P=Bf,onChange:S,onSearch:I,disabled:M,InputProps:w,onFocus:D,onBlur:N,onKeyDown:T,error:k,helperText:A,...L})=>{let W=ho(),ee=n==="multiple",[O,_]=useState(false),[V,Q]=useState(false),[H,B]=useState(""),[q,Z]=useState(null),[Y,J]=useState(false),[le,he]=useState(()=>xp(t)),[ze,be]=useState(""),[Ce,Be]=useState(""),de=useMemo(()=>r&&r.length>0?r:Of,[r]),ve=q??o,We=useMemo(()=>{let oe=[...g$1,...o,...q??[]],ye=new Map;return oe.forEach(Ne=>{ye.set(Po(v(Ne)),Ne);}),ye},[v,o,q,g$1]),et=useMemo(()=>xp(t),[t]),nt=useMemo(()=>et.map(String).join(", "),[et]);useEffect(()=>{O||he(et);},[O,et]),useEffect(()=>{!V&&!Ce&&be(nt);},[V,nt,Ce]);let it=useMemo(()=>{let oe=H.trim().toLowerCase();if(!oe||I)return ve;let ye=de.filter(Ne=>Ne.searchable!==false);return ve.filter(Ne=>[v(Ne),y(Ne),P(Ne),...ye.map(st=>wp(Ne,st.field))].some(st=>String(st??"").toLowerCase().includes(oe)))},[ve,P,y,v,I,H,de]),U=useMemo(()=>{if(x!==void 0)return x;if(et.length===0)return "";let oe=ye=>{let Ne=We.get(Po(ye));if(!Ne)return String(ye);let je=y(Ne);return je&&je!==String(ye)?`${ye} - ${je}`:String(ye)};return ee?et.length>2?`${et.length} selected`:et.map(oe).join(", "):oe(et[0])},[x,y,ee,We,et]),Re=useCallback(async()=>{if(I){J(true);try{let oe=await I(H);Array.isArray(oe)&&Z(oe);}finally{J(false);}}},[I,H]),we=()=>{M||(he(et),_(true));},Oe=()=>{_(false);},at=()=>{S?.(ee?[]:null,ee?[]:null),he([]),be(""),Be("");},Ze=oe=>{let ye=v(oe);if(ee){he(Ne=>Ne.some(st=>Po(st)===Po(ye))?Ne.filter(st=>Po(st)!==Po(ye)):[...Ne,ye]);return}he([ye]);},xt=()=>{let oe=le.map(ye=>We.get(Po(ye))).filter(ye=>!!ye);ee?S?.(le,oe):S?.(le[0]??null,oe[0]??null),Be(""),_(false);},It=oe=>{if(oe.key==="F4"){oe.preventDefault(),we();return}if(oe.key==="Enter"&&p&&!At(ze,true)){oe.preventDefault();return}T?.(oe);},Ot=oe=>b?oe.every(ye=>We.has(Po(ye))):true,At=(oe,ye)=>{if(ee){let je=oe.split(/[,;\n]/).map(pt=>pt.trim()).filter(Boolean);if(je.length===0)return Be(""),S?.([],[]),true;if(!Ot(je))return ye&&Be(C),false;Be("");let st=je.map(pt=>We.get(Po(pt))).filter(pt=>!!pt);return S?.(je,st),true}let Ne=oe.trim();return Ne?Ot([Ne])?(Be(""),S?.(Ne,We.get(Po(Ne))??null),true):(ye&&Be(C),false):(Be(""),S?.(null,null),true)},re=oe=>{if(!p)return;let ye=oe.target.value;be(ye),Be(""),At(ye,false);},Ge=h||Y,Le=et.length>0,xe=p&&(V||!!Ce)?ze:U;return g(e,{children:[f(He,{...L,className:["orb-value-help-field",f$1&&Le&&!M?"orb-value-help-has-clear":"",L.className??""].filter(Boolean).join(" "),disabled:M,value:xe,error:!!Ce||k,helperText:Ce||A,onChange:re,onFocus:oe=>{Q(true),be(nt),D?.(oe);},onBlur:oe=>{p&&At(ze,true),Q(false),N?.(oe);},onKeyDown:It,InputProps:{...w,readOnly:!p,endAdornment:g("span",{className:"orb-value-help-actions",children:[Ge?f(Yo,{size:18}):null,f$1&&Le&&!M?f(ie,{className:"orb-value-help-clear-trigger",size:"small",tooltip:c,"aria-label":c,onMouseDown:oe=>oe.preventDefault(),onClick:oe=>{oe.stopPropagation(),at();},children:f(Pt,{name:"decline",size:14})}):null,f(ie,{className:"orb-value-help-search-trigger",size:"small",tooltip:u,"aria-label":u,onMouseDown:oe=>oe.preventDefault(),onClick:oe=>{oe.stopPropagation(),we();},disabled:M,children:f(Pt,{name:"search",size:16})})]})}}),g(Lt,{open:O,onClose:Oe,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:oe=>({borderRadius:2,overflow:"hidden",border:`1px solid ${oe.palette.divider}`,boxShadow:W==="dark"?`0 24px 80px ${tt(oe.palette.common.black,.72)}`:`0 24px 80px ${tt(oe.palette.common.black,.18)}`})},children:[g("div",{className:"orb-dialog-title",sx:oe=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${oe.palette.divider}`,bgcolor:oe.palette.background.paper}),children:[g("div",{children:[f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),ee?f(E,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${le.length} selected`}):null]}),f(ie,{"aria-label":"Close",onClick:Oe,size:"small",children:f(wr,{fontSize:"small"})})]}),g("div",{className:"orb-dialog-content",sx:{p:0},children:[g(se,{direction:{xs:"column",sm:"row"},spacing:1,sx:oe=>({px:2.5,py:1.5,borderBottom:`1px solid ${oe.palette.divider}`,bgcolor:W==="dark"?tt(oe.palette.common.white,.025):tt(oe.palette.primary.main,.035)}),children:[f(He,{size:"small",fullWidth:true,autoFocus:true,value:H,placeholder:i,onChange:oe=>B(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&(oe.preventDefault(),Re());},InputProps:{startAdornment:f(lr,{position:"start",children:f(Pt,{name:"search",size:16})}),sx:oe=>({borderRadius:1,bgcolor:oe.palette.background.paper,"& fieldset":{borderColor:tt(oe.palette.text.primary,W==="dark"?.2:.16)},"&:hover fieldset":{borderColor:tt(oe.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:oe.palette.primary.main}})}}),I?f(Pe,{variant:"outlined",onClick:()=>{Re();},disabled:Ge,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:Ge?f(Yo,{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:oe=>({bgcolor:W==="dark"?"var(--orb-canvas)":oe.palette.background.paper,borderBottom:`1px solid ${oe.palette.divider}`})}),de.map(oe=>f("td",{align:oe.align==="inherit"?void 0:oe.align,sx:ye=>({minWidth:oe.minWidth,width:oe.width,fontSize:"0.78rem",fontWeight:800,bgcolor:W==="dark"?"var(--orb-canvas)":ye.palette.background.paper,borderBottom:`1px solid ${ye.palette.divider}`}),children:oe.label},String(oe.field)))]})}),g("tbody",{children:[it.map(oe=>{let ye=v(oe),Ne=le.some(je=>Po(je)===Po(ye));return g("tr",{hover:true,selected:Ne,onClick:()=>Ze(oe),onDoubleClick:()=>{ee||(he([ye]),S?.(ye,oe),_(false));},sx:je=>({cursor:"pointer","&.orb-selected":{bgcolor:tt(je.palette.primary.main,W==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:tt(je.palette.primary.main,W==="dark"?.28:.18)}}),children:[f("td",{padding:"checkbox",children:f(Tt,{size:"small",checked:Ne})}),de.map(je=>{let st=wp(oe,je.field);return f("td",{align:je.align==="inherit"?void 0:je.align,sx:{fontSize:"0.82rem",py:1},children:je.render?je.render(st,oe):String(st??"")},String(je.field))})]},Po(ye))}),it.length===0?f("tr",{children:f("td",{colSpan:de.length+1,children:f("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:m})})}):null]})]})})]}),g("div",{className:"orb-dialog-actions",sx:oe=>({px:2.5,py:1.5,borderTop:`1px solid ${oe.palette.divider}`,bgcolor:oe.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[f$1&&(Le||le.length>0)?f(Pe,{onClick:at,children:c}):null,f("div",{sx:{flex:1}}),f(Pe,{onClick:Oe,children:d}),f(Pe,{variant:"contained",onClick:xt,disabled:!ee&&le.length===0,children:s})]})]})]})};var fi=({title:t,hideHeader:o,children:r})=>g("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!o&&f("div",{sx:{mb:2},children:f(E,{variant:"h4",children:t})}),f("div",{sx:{flex:1,overflow:"hidden"},children:r})]});var ml={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"},gl={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"},Jn={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},ea={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Pp={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},po={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 Hf={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"}},bi=({rowsPerPage:t=20,rowsPerPageOptions:o=[20,50,100,-1],page:r=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=ce(),c=o.length>0?o:[20,50,100,-1],d=Math.max(0,r),u=t===-1?1:Math.max(1,Math.ceil(n/t)),m=Math.min(d+1,u),h=d>0,f$1=d<u-1&&t!==-1;return g("div",{className:"orb-table-pager",children:[f(E,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),f(ct,{title:s("table.toolbar.itemsPerPage"),children:f(zt,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:p=>a?.(Number(p.target.value)),sx:Hf,children:c.map(p=>f("option",{value:p,children:p===-1?s("common.all"):p},`rows-per-page-${p}`))})}),f("span",{className:"orb-table-pager-divider"}),f(ie,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(d-1,0)),disabled:!h,sx:po,children:f(rp,{})}),g(E,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:m,total:u}),children:[m," / ",u]}),f(ie,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,u-1)),disabled:!f$1,sx:po,children:f(Sr,{})})]})};var vi=({value:t="",onChange:o})=>{let{t:r}=ce();return f("div",{className:"orb-table-toolbar-search",children:f(He,{className:"orb-table-toolbar-search-field",size:"small",placeholder:r("table.toolbar.searchPlaceholder"),value:t,onChange:n=>o?.(n.target.value),InputProps:{startAdornment:f(lr,{position:"start",children:f(Hr,{size:16})})}})})};var yi=t=>{let{t:o}=ce(),r=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],n=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],a=[...r,...n],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return f(Ed,{className:"orb-table-toolbar",role:"toolbar","aria-label":o("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(vi,{value:t.filterText,onChange:c=>{t.setFilterText(c),t.onPageChange?.(0);}}),f(bi,{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((c,d)=>f(Jt__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(ct,{title:o("table.toolbar.groupBy"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:c=>t.setGroupAnchorEl(t.groupAnchorEl?null:c.currentTarget),children:f(ri,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:f(xr,{})})})}),f(ct,{title:o("table.toolbar.summary"),children:f(ie,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:po,onClick:c=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:c.currentTarget),children:f(an,{})})}),f(ct,{title:o("table.toolbar.columns"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:c=>t.setAnchorEl(t.anchorEl?null:c.currentTarget),children:f(sn,{})})}),f(ct,{title:o("table.toolbar.export"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:t.handleExport,children:f(Qd,{})})})]}),i&&g("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&f(ct,{title:o("table.toolbar.newItem"),children:f(ie,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:po,children:f(Br,{})})}),t.showEditButton&&f(ct,{title:o("table.toolbar.editItem"),children:f("span",{children:f(ie,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:po,children:f(Jd,{})})})}),t.showDeleteButton&&f(ct,{title:o("table.toolbar.deleteItem"),children:f("span",{children:f(ie,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...po,color:"error.main"},children:f(si,{})})})})]}),s&&g("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&f(ct,{title:o("table.toolbar.graphicReport"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:t.onOpenGraphReport,children:f(tp,{})})}),t.onLayoutSave&&!t.layoutManager&&f(ct,{title:o("table.toolbar.saveLayout"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:c=>t.onLayoutSave(c),children:f(kr,{})})}),t.layoutManager]})]})]})})};var Ci=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 [Ci.Translate.toString(t),Ci.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:o,duration:r,easing:n}=t;return o+" "+r+"ms "+n}}});var xi=t=>{let{t:o}=ce(),{onSelectAllClick:r,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:c=0,onRequestSort:d,onContextMenu:u,columns:m,visibleColumns:h,selectionMode:f$1,grouping:p=[],isAllExpanded:b=false,handleToggleAll:C,onColumnResize:g$1,columnWidths:x,enableColumnReorder:v=false,disableSorting:y=false}=t,[P,S]=useState(null),I=useRef(null),M=V=>Q=>{y||P||d(V);},w=(V,Q,H)=>{V.preventDefault(),V.stopPropagation(),S(Q),I.current={startX:V.clientX,startWidth:H,colId:Q},document.addEventListener("mousemove",D),document.addEventListener("mouseup",N),document.body.style.cursor="col-resize";},D=V=>{if(!I.current)return;let{startX:Q,startWidth:H,colId:B}=I.current,q=V.clientX-Q,Z=Math.max(50,H+q);g$1&&g$1(B,Z);},N=()=>{S(null),I.current=null,document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",N),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",N);},[]);let T=f$1==="multiple"||f$1==="single",k=p.length>0&&!!C,A=o(b?"table.group.collapseAll":"table.group.expandAll"),L=m.filter(V=>h.includes(V.id)),W=new Map(i.map((V,Q)=>[V.field,{...V,priority:Q+1}])),ee=L.map(V=>{let Q=x?.[V.id]||V.minWidth||100,H=W.get(V.id);return f(Kf,{headCell:V,width:typeof Q=="number"?Q:100,order:n,orderBy:a,multiSortInfo:y?void 0:H,onRequestSort:M(V.id),onContextMenu:u,onResizeMouseDown:B=>w(B,V.id,typeof Q=="number"?Q:100),enableColumnReorder:v,disableSorting:y},V.id)}),O=L.map(V=>V.id),_=g("tr",{children:[T&&f("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:f(Tt,{color:"primary",indeterminate:s>0&&s<c,checked:c>0&&s===c,onChange:r,disabled:f$1==="single",sx:Jn})}),k&&f("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:f(ct,{title:A,children:f(ie,{size:"small",onClick:V=>{V.stopPropagation(),C?.(!b);},sx:ea,children:b?f(gi,{}):f(hi,{})})})}),v?f(SortableContext,{items:O,strategy:horizontalListSortingStrategy,children:ee}):ee]});return f("thead",{children:_})},Kf=({headCell:t,width:o,order:r,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:c,enableColumnReorder:d,disableSorting:u})=>{let{setNodeRef:m,attributes:h,listeners:f$1,transform:p,transition:b,isDragging:C}=useSortable({id:t.id,disabled:!d}),g$1=d?{transform:Ci.Transform.toString(p),transition:b,opacity:C?.6:1}:{},x=u?"asc":a?.direction??(n===t.id?r:"asc"),v=!u&&(!!a||n===t.id);return g("th",{ref:d?m:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${d?"orb-is-reorderable":""} ${C?"orb-is-dragging":""}`,"aria-sort":v?x==="asc"?"ascending":"descending":"none",onContextMenu:s?y=>s(y,t.id):void 0,style:{width:o,minWidth:o,maxWidth:o,...g$1},...d?h:{},...d?f$1:{},children:[u?f("span",{className:"orb-table-head-label",children:t.label}):f(Ld,{className:"orb-table-head-sort",active:v,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:c,onPointerDown:y=>y.stopPropagation(),onClick:y=>y.stopPropagation()})]})};var wi=t=>{let{t:o}=ce(),{visibleRows:r,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:u,grouping:m=[],isGroupFullyExpanded:h,handleExpandGroupRecursively:f$1,handleCollapseGroupRecursively:p,emptyLabel:b,getRowDataKey:C,getRowProps:g$1,getGroupRowProps:x}=t,v=I=>a.indexOf(I)!==-1,y=u==="multiple"||u==="single",P=m.length>0,S=n.length+(y?1:0)+(P?1:0);return g("tbody",{children:[r.map((I,M)=>{if(I.type==="group"){let w=d.has(I.id),D=I.childIds||[],N=D.filter(V=>v(V)).length,T=D.length>0&&N===D.length,k=N>0&&N<D.length,A={entry:I,data:I,id:I.id,index:M,selected:T,group:true},L=x?.(A)||{},{className:W,onClick:ee,...O}=L,_=V=>{if(V.stopPropagation(),!!t.onSelectionChange)if(T){let Q=a.filter(H=>!D.includes(H));t.onSelectionChange(Q);}else {let Q=Array.from(new Set([...a,...D]));t.onSelectionChange(Q);}};return g("tr",{...O,"data-ctable-row-key":C?.(A),className:["orb-table-group-row",W].filter(Boolean).join(" "),onClick:ee,sx:V=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:V.palette.text.primary,borderBottomColor:V.palette.divider},"& .orb-icon-btn":{color:V.palette.text.primary},"& .orb-chk":{color:V.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:V.palette.primary.main}}),children:[y&&f("td",{padding:"checkbox",sx:ml,children:f(Tt,{size:"small",checked:T,indeterminate:k,onChange:_,onClick:V=>V.stopPropagation(),sx:Jn})}),P&&f("td",{padding:"checkbox",sx:gl,children:g("div",{sx:Pp,children:[m.length>1&&I.level<m.length-1&&f(ct,{title:h?.(I.id)?o("table.group.collapseAll"):o("table.group.expandAll"),children:f(ie,{size:"small",onClick:()=>{h?.(I.id)?p?.(I.id):f$1?.(I.id);},sx:ea,children:h?.(I.id)?f(gi,{}):f(hi,{})})}),f(ie,{size:"small",onClick:()=>c&&c(I.id),sx:ea,children:w?f($o,{}):f(Sr,{})})]})}),f("td",{colSpan:n.length,sx:{py:1,pl:I.level*3+1},children:g(E,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[I.field,": ",I.value," (",I.count,")"]})})]},I.id)}else {let w=I.data||I,D=I.id||w.id||M,N=v(D),T=`enhanced-table-checkbox-${M}`,k={entry:I,data:w,id:D,index:M,selected:N,group:false},A=g$1?.(k)||{},{className:L,onClick:W,...ee}=A,_=(I.level!==void 0?I.level:0)*4;return g("tr",{...ee,"data-ctable-row-key":C?.(k),className:[N?"orb-is-selected":"",L].filter(Boolean).join(" "),onClick:V=>{W?.(V),V.defaultPrevented||i?.(V,w);},role:y?"checkbox":ee.role,"aria-checked":y?N:ee["aria-checked"],tabIndex:ee.tabIndex??-1,children:[y&&f("td",{padding:"checkbox",sx:ml,children:f(Tt,{color:"primary",checked:N,inputProps:{"aria-labelledby":T},sx:Jn})}),P&&f("td",{padding:"checkbox",sx:gl}),s.filter(V=>n.includes(V.id)).map((V,Q)=>{let B=Q===0&&_>0?{pl:_+2}:{};return f("td",{className:V.numeric?"orb-num":void 0,align:V.numeric?"right":"left",sx:B,children:V.render?V.render(w[V.id],w):(function(){let Z=w[V.id];if(V.numeric){if(typeof Z=="number")return Z.toLocaleString();if(typeof Z=="string"&&Z.trim()!==""&&!isNaN(Number(Z)))return Number(Z).toLocaleString()}return Z})()},V.id)})]},D)}}),r.length===0&&f("tr",{children:f("td",{colSpan:S,align:"center",children:b??o("common.noData")})})]})};var Tp=t=>{let{columns:o=[],visibleColumns:r,summaryRow:n,selectionMode:a,grouping:i=[],columnWidths:s={}}=t;if(!t.showSummary)return null;let c=a==="multiple"||a==="single",d=i.length>0,u=o.filter(m=>r.includes(m.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}}),u.map(m=>f("td",{className:`orb-table-footer-cell ${m.numeric?"orb-num":""}`,style:{width:s[m.id]||m.minWidth||100,minWidth:s[m.id]||m.minWidth||100,maxWidth:s[m.id]||m.minWidth||100},children:(function(){let f=n[m.id];return f==null||f===""?"":typeof f=="number"?f.toLocaleString():typeof f=="string"&&f.trim()!==""&&!isNaN(Number(f))?Number(f).toLocaleString():f})()},m.id))]})})};var Ip=t=>{let{t:o}=ce();return f("div",{sx:{p:2},children:f(E,{children:o("table.mobile.notImplemented")})})};var dn=({groupAnchorEl:t,setGroupAnchorEl:o,grouping:r,setGrouping:n,columns:a})=>{let{t:i}=ce(),[s,c]=useState(r);useEffect(()=>{t&&c(r);},[t,r]);let d=()=>{c(r),o(null);},u=h=>{c(f=>f.includes(h)?f.filter(p=>p!==h):[...f,h]);},m=()=>{n(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:h=>h.stopPropagation(),children:[f(E,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&f(Pe,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:h=>{h.stopPropagation(),c([]);},children:i("table.menu.clearAll")})]}),f(Rt,{className:"orb-table-group-menu-divider"}),a.map(h=>{let f$1=s.includes(h.id),p=s.indexOf(h.id)+1;return f("option",{className:"orb-table-group-menu-option",selected:f$1,onClick:b=>{b.stopPropagation(),u(h.id);},children:g("div",{className:"orb-table-group-menu-option-content",children:[f(Tt,{className:"orb-table-group-menu-checkbox",checked:f$1,size:"small"}),f(_t,{className:"orb-table-group-menu-label",primary:h.label}),f$1&&f("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${p}`,children:p})]})},h.id)}),g("div",{className:"orb-table-group-menu-footer",children:[f(Pe,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),f(Pe,{size:"small",variant:"primary",onClick:m,children:i("common.ok")})]})]})},pn=({anchorEl:t,setAnchorEl:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=ce();return g(Qt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{disabled:true,children:f(_t,{primary:i("table.menu.visibleColumns")})}),f(Rt,{}),r.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Tt,{checked:n.includes(s.id),size:"small"}),f(_t,{primary:s.label})]},s.id))]})},Si=({anchorEl:t,setAnchorEl:o,showSummary:r,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:c}=ce();return g(Qt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{children:f(jn,{control:f(ni,{checked:r,onChange:d=>n(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),f(Rt,{}),a.filter(d=>d.numeric).map(d=>g("option",{onClick:()=>s(d.id),disabled:!r,children:[f(Tt,{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:c("table.menu.noNumericColumns")})})]})},ki=({contextMenu:t,handleCloseContextMenu:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{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(Rt,{}),f("option",{disabled:true,children:i("table.menu.visibleColumns")}),r.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Wo,{children:n.includes(s.id)&&f(Kd,{fontSize:"small"})}),f(_t,{children:s.label})]},s.id))]})},Dp=({contextMenu:t,handleClose:o,columns:r,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:c,orderBy:d,order:u,onSortAsc:m,onSortDesc:h,onClearSort:f$1,onHideColumn:p,onToggleGroup:b,onToggleSummary:C,onOpenSortDialog:g$1})=>{let{t:x}=ce(),v=t?.columnId??"",y=r.find(T=>T.id===v),P=a.includes(v),S=i.includes(v),I=!!y?.numeric,M=c.find(T=>T.field===v),w=M?M.direction==="asc":d===v&&u==="asc",D=M?M.direction==="desc":d===v&&u==="desc",N=w||D;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(_t,{primary:y?.label??v})}),f(Rt,{}),g("option",{onClick:()=>{m(v),o();},selected:w,children:[f(Wo,{children:f(dl,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.sortAsc")})]}),g("option",{onClick:()=>{h(v),o();},selected:D,children:[f(Wo,{children:f(cl,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.sortDesc")})]}),N&&g("option",{onClick:()=>{f$1(v),o();},children:[f(Wo,{children:f(Xd,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.clearSort")})]}),g("option",{onClick:()=>{g$1(),o();},children:[f(Wo,{children:f(Br,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.configureSort")})]}),f(Rt,{}),g("option",{onClick:()=>{b(v),o();},selected:P,children:[f(Wo,{children:f(xr,{fontSize:"small"})}),f(_t,{primary:x(P?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),I&&s&&g("option",{onClick:()=>{C(v),o();},selected:S,children:[f(Wo,{children:f(an,{fontSize:"small"})}),f(_t,{primary:x(S?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),f(Rt,{}),g("option",{onClick:()=>{p(v),o();},children:[f(Wo,{children:f(yp,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.hideColumn")})]})]})},Ap=({open:t,onClose:o,columns:r,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=ce(),[c,d]=useState([]);useEffect(()=>{t&&d(n.length>0?n.map(C=>({...C})):[]);},[t,n]);let u=useMemo(()=>new Set(c.map(C=>C.field)),[c]),m=useMemo(()=>r.filter(C=>!u.has(C.id)),[r,u]),h=()=>{let C=m[0];C&&d(g=>[...g,{field:C.id,direction:"asc"}]);},f$1=C=>{d(g=>g.filter((x,v)=>v!==C));},p=(C,g)=>{d(x=>x.map((v,y)=>y===C?{...v,...g}:v));},b=(C,g)=>{d(x=>{let v=C+g;if(v<0||v>=x.length)return x;let y=[...x],[P]=y.splice(C,1);return y.splice(v,0,P),y});};return f(Lt,{open:t,onClose:o,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:g(e,{children:[f(Pe,{className:"orb-table-sort-clear",variant:"neutral",disabled:c.length===0&&n.length===0,onClick:()=>{i(),o();},children:s("table.sortDialog.clearAll")}),f("span",{className:"orb-table-sort-action-spacer"}),f(Pe,{variant:"neutral",onClick:o,children:s("common.cancel")}),f(Pe,{variant:"primary",onClick:()=>{a(c),o();},children:s("common.ok")})]}),children:g("div",{className:"orb-table-sort-dialog-content",children:[c.length===0?f(E,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):f(se,{className:"orb-table-sort-rules",spacing:1,children:c.map((C,g$1)=>{let x=new Set(c.filter((y,P)=>P!==g$1).map(y=>y.field)),v=r.filter(y=>!x.has(y.id));return g("div",{className:"orb-table-sort-rule",children:[f(ri,{className:"orb-table-sort-order",badgeContent:g$1+1,color:"primary"}),f(zt,{size:"small",value:C.field,onChange:y=>p(g$1,{field:y.target.value}),options:v.map(y=>({value:y.id,label:y.label}))}),f(zt,{size:"small",value:C.direction,onChange:y=>p(g$1,{direction:y.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),f(ie,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>b(g$1,-1),disabled:g$1===0,children:f(dl,{fontSize:"small"})}),f(ie,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>b(g$1,1),disabled:g$1===c.length-1,children:f(cl,{fontSize:"small"})}),f(ie,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>f$1(g$1),children:f(li,{fontSize:"small"})})]},`sort-rule-${g$1}`)})}),f(Pe,{size:"small",onClick:h,disabled:m.length===0,startIcon:f(Br,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};var ta=(t,o=2)=>t.toLocaleString(void 0,{maximumFractionDigits:o}),Ep=({kpis:t})=>{let{t:o}=ce(),r=[{label:o("graph.kpi.totalRecords"),value:ta(t.totalRecords,0),color:"var(--orb-fg)"},{label:o("graph.kpi.totalReport"),value:ta(t.totalReportHours),color:"var(--orb-fg)"},{label:o("graph.kpi.totalBillable"),value:ta(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:ta(t.totalAmount),color:"var(--orb-primary)"},{label:o("graph.kpi.flagged"),value:ta(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(n=>g(De,{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 Pi=({title:t,subtitle:o,children:r})=>g(De,{elevation:0,sx:{padding:16},children:[f(E,{variant:"h4",sx:{fontWeight:700},children:t}),o&&f(E,{variant:"body2",muted:true,sx:{marginBottom:16},children:o}),r]});var oa=({data:t,orientation:o="horizontal",valueSuffix:r="",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(c=>c.value),1);return o==="vertical"?f("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:n},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===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:i?"pointer":"default",opacity:a&&c.name!==a?.45:1}}),f(E,{variant:"caption",title:c.name,sx:{display:"block",mt:.5},children:c.name}),g(E,{variant:"caption",muted:true,children:[c.value.toFixed(1),r]})]},c.name))}):f(se,{spacing:1,children:t.map(c=>g("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[f(E,{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:a&&c.name!==a?.45:1},children:f("div",{style:{width:`${c.value/s*100}%`,height:"100%",background:c.name===a?"primary.dark":"primary.main"}})}),g(E,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),r]})]},c.name))})};var Lp=({data:t,color:o="var(--orb-chart-1)",valueSuffix:r="",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(f=>f.value),c=Math.min(...s,0),u=Math.max(...s,1)-c||1,m=t.map((f,p)=>{let b=i+p*(a-i*2)/Math.max(t.length-1,1),C=n-i-(f.value-c)/u*(n-i*2);return {x:b,y:C,...f}}),h=m.map(f=>`${f.x},${f.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:o},strokeWidth:3,points:h}),m.map(f$1=>f("circle",{cx:f$1.x,cy:f$1.y,r:4,style:{fill:o}},f$1.name))]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(f$1=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:f$1.name,sx:{display:"block"},children:f$1.name}),g(E,{variant:"caption",muted:true,children:[f$1.value.toFixed(1),r]})]},f$1.name))})]})};var Op=({data:t,barColor:o="var(--orb-chart-1)",lineColor:r="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(m=>m.barValue),1),c=Math.max(...t.map(m=>m.lineValue),1),d=t.map((m,h)=>{let f=(a-i*2)/t.length,p=Math.max(f*.5,8),b=i+h*f+(f-p)/2,C=m.barValue/s*(n-i*2),g=n-i-C;return {x:b,y:g,barHeight:C,barWidth:p,item:m}}),u=t.map((m,h)=>{let f=(a-i*2)/t.length,p=i+h*f+f/2,b=n-i-m.lineValue/c*(n-i*2);return {x:p,y:b,item:m}});return g(se,{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(m=>f("rect",{x:m.x,y:m.y,width:m.barWidth,height:Math.max(m.barHeight,4),rx:6,style:{fill:o}},m.item.name)),f("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:u.map(m=>`${m.x},${m.y}`).join(" ")}),u.map(m=>f("circle",{cx:m.x,cy:m.y,r:3.5,style:{fill:r}},`${m.item.name}-line`))]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(m=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:m.name,sx:{display:"block"},children:m.name}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",m.barValue.toFixed(1)]}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",m.lineValue.toFixed(1)]})]},m.name))})]})};var qf=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)`},Fp=({data:t})=>{if(t.length===0)return f(E,{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))),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(${o.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+o.length*64},children:[f("div",{}),o.map(i=>f(E,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),r.map(i=>g("div",{style:{display:"contents"},children:[f(E,{variant:"caption",sx:{alignSelf:"center"},children:i}),o.map(s=>{let c=a.get(`${i}__${s}`)||0,d=c/n;return f("div",{sx:{height:36,borderRadius:1,background:qf(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:c.toFixed(1)})},`${i}-${s}`)})]},i))]})})};var Xf=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],Ti=({data:t,variant:o="donut",colors:r=Xf,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let s=0,c=t.map((d,u)=>{let m=s;return s+=d.percent,`${r[u%r.length]} ${m}% ${s}%`});return g(se,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[f("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:o==="donut"&&f("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),f(se,{spacing:1,sx:{minWidth:180},children:t.map((d,u)=>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:r[u%r.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:o})=>{if(o.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let r=o.filter((a,i)=>i%2===0),n=o.filter((a,i)=>i%2===1);return g(se,{spacing:1.5,children:[f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.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 Hp=({data:t,height:o=240})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let r=0,n=t.map(h=>{let f=h.type==="total"?0:r,p=h.type==="total"?h.value:r+h.value;return h.type!=="total"&&(r=p),{...h,start:f,end:p,delta:p-f}}),a=n.flatMap(h=>[h.start,h.end]),i=Math.min(...a,0),s=Math.max(...a,1),c=680,d=30,u=s-i||1,m=h=>o-d-(h-i)/u*(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:m(0),x2:c-d,y2:m(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((h,f$1)=>{let p=(c-d*2)/n.length,b=Math.max(p*.55,8),C=d+f$1*p+(p-b)/2,g$1=m(Math.max(h.start,h.end)),x=m(Math.min(h.start,h.end)),v=h.type==="total"?"var(--orb-chart-1)":h.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return g("g",{children:[f("rect",{x:C,y:g$1,width:b,height:Math.max(x-g$1,4),rx:6,style:{fill:v}}),f("text",{x:C+b/2,y:g$1-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:h.end.toFixed(1)})]},h.name)})]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(h=>f(E,{variant:"caption",title:h.name,children:h.name},h.name))})]})};var ra=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>{let a=encodeURIComponent(o);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${a}&zoom=${r}&maptype=${n}`},uR=(t,o=360)=>{let r=ra(t);return `<iframe width="100%" height="${o}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${r}"></iframe>`};var zp=({apiKey:t,query:o,embedUrl:r,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=r||(t&&o?ra({apiKey:t,query:o,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 Ii=({keyword:t,location:o,src:r="orbcafe-ui"})=>{if(o){let n=encodeURIComponent(o.name||t||"Location");return `https://uri.amap.com/marker?position=${o.lng},${o.lat}&name=${n}&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 Vp=({keyword:t,location:o,embedUrl:r,height:n=320})=>{let a=r||Ii({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.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 Wp=({billableByPrimary:t,efficiencyBySecondary:o,statusDistribution:r,interaction:n})=>{let{t:a}=ce();return g("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[f(Pi,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:f(oa,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),f(Pi,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:f(oa,{data:o,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),f(Pi,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:f(Ti,{data:r,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};var Yf=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Qf=["zh","en","de","fr","ja","ko"],$p=({open:t,onClose:o,value:r,onSaveAll:n,modelOptions:a=Yf,promptLangOptions:i=Qf,analysisTemplateOptions:s=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:u})=>{let[m,h]=useState(r),[f$1,p]=useState(d||""),[b,C]=useState(u||""),[g$1,x]=useState(false);useEffect(()=>{t&&(h(r),p(d||""),C(u||""));},[t,r,d,u]);let v=(P,S)=>{h(I=>({...I,[P]:S}));},y=async()=>{if(n)try{x(!0),await n({settings:m,analysisTemplateId:f$1||void 0,responseTemplateId:b||void 0});}finally{x(false);}};return g(Lt,{open:t,onClose:o,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(ie,{onClick:o,sx:{position:"absolute",right:12,top:12},children:f(wr,{})})]}),f("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:g(se,{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:m.baseUrl,onChange:P=>v("baseUrl",P.target.value),fullWidth:true,label:"Base URL"})}),f("div",{children:f(He,{size:"small",type:"password",value:m.apiKey,onChange:P=>v("apiKey",P.target.value),fullWidth:true,label:"API Key"})}),f("div",{children:f(He,{size:"small",value:m.model,onChange:P=>v("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:m.promptLang,onChange:P=>v("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:f$1,onChange:P=>p(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(Wn,{multiline:true,minRows:8,value:m.analysisPrompt,onChange:P=>v("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:b,onChange:P=>C(P.target.value),fullWidth:true,select:true,label:"Response Template",children:[f("option",{value:"",children:"Default"}),c.map(P=>f("option",{value:P.id,children:P.label},P.id))]}),f(Wn,{multiline:true,minRows:8,value:m.responsePrompt,onChange:P=>v("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(Pe,{variant:"outlined",onClick:o,children:"Cancel"}),f(Pe,{variant:"contained",onClick:y,disabled:!n||g$1,children:"Save"})]})]})};var Ri=({open:t,onClose:o,model:r,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:c}=ce(),[d,u]=useState(s?.defaultPrompt||""),[m,h]=useState(false),[f$1,p]=useState(false),b=i?.enabled!==false&&!!i,C=s?.enabled!==false,g$1=i?.filters||{},x=!!(g$1.primaryDimension||g$1.secondaryDimension||g$1.status),v=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{t&&u(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let y=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},P=async()=>{let S=d.trim();if(!(!S||!s?.onSubmit))try{h(!0),await s.onSubmit(S,{filters:g$1,model:r});}finally{h(false);}};return f(Lt,{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(se,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[g(se,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[f(E,{variant:"h3",sx:{fontWeight:800},children:r.title}),f(Ct,{label:c("graph.records",{count:r.kpis.totalRecords})}),b&&g$1.primaryDimension&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g$1.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),b&&g$1.secondaryDimension&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g$1.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),b&&g$1.status&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.status}: ${g$1.status}`,onDelete:()=>i?.onClearFilter("status")}),b&&x&&f(Pe,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),g(se,{direction:"row",spacing:10,alignItems:"center",children:[C&&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(ie,{size:"small",onClick:s?.onVoiceInput,children:f(Ha,{size:16,strokeWidth:1.8})}),f("input",{className:"orb-inp orb-inp-dense",value:d,onChange:S=>u(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),P());},placeholder:v,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),f(ie,{size:"small",onClick:P,disabled:m||!d.trim(),children:f(Yc,{size:16,strokeWidth:1.8})}),f(ie,{size:"small",onClick:()=>p(true),children:f(en,{size:16,strokeWidth:1.8})})]}),f(ie,{onClick:o,children:f(Kt,{size:18,strokeWidth:2})})]})]})}),g("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[f(Ep,{kpis:r.kpis}),f(Wp,{billableByPrimary:r.charts.billableByPrimary,efficiencyBySecondary:r.charts.efficiencyBySecondary,statusDistribution:r.charts.statusDistribution,interaction:b?{filters:g$1,onPrimaryDimensionClick:S=>i?.onPrimaryDimensionClick(S),onSecondaryDimensionClick:S=>i?.onSecondaryDimensionClick(S),onStatusClick:S=>i?.onStatusClick(S)}:void 0}),a,n]}),f($p,{open:f$1,onClose:()=>p(false),value:y,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var Ir={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"]},Jf=5,_p=t=>t.toLowerCase().replace(/[\s_-]/g,""),Mr=(t,o,r,n)=>{if(o)return o;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[_p(s),s]));for(let s of r){let c=i.get(_p(s));if(c)return c}return a[0]||n},To=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},fo=(t,o)=>t==null||t===""?o:String(t),eb=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let c=fo(s[o],a);i.set(c,(i.get(c)||0)+To(s[r]));}),Array.from(i.entries()).map(([s,c])=>({name:s,value:c})).sort((s,c)=>c.value-s.value).slice(0,n)},tb=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(c=>{let d=fo(c[o],i),u=s.get(d)||{report:0,billable:0};u.report+=To(c[r]),u.billable+=To(c[n]),s.set(d,u);}),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,a)},ob=(t,o,r)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=fo(i[o],r);a.set(s,(a.get(s)||0)+1);}),Array.from(a.entries()).map(([i,s])=>({name:i,value:s,percent:s/n*100}))},Gp=(t,o,r)=>{let n=new Map;return t.forEach(a=>{let i=fo(a[o],"N/A");n.set(i,(n.get(i)||0)+To(a[r]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},rb=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(c=>{let d=fo(c[o],i),u=s.get(d)||{report:0,billable:0};u.report+=To(c[r]),u.billable+=To(c[n]),s.set(d,u);}),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,a)},nb=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let c=fo(s[o],a),d=fo(s[r],a),u=`${c}__${d}`;i.set(u,(i.get(u)||0)+To(s[n]));}),Array.from(i.entries()).map(([s,c])=>{let[d,u]=s.split("__");return {x:d,y:u,value:c}})},ab=(t,o,r)=>{let n=Gp(t,o,r),a=n.map(s=>({name:s.name,value:s.value,type:"delta"})),i=n.reduce((s,c)=>s+c.value,0);return [...a,{name:"Total",value:i,type:"total"}]},ib=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(c=>{let d=fo(c[o],i),u=`${fo(c[r],i)} / ${fo(c[n],i)}`,m=s.get(d)||new Map;m.set(u,(m.get(u)||0)+1),s.set(d,m);}),Array.from(s.entries()).map(([c,d])=>({title:c,causes:Array.from(d.entries()).sort((u,m)=>m[1]-u[1]).slice(0,a).map(([u,m])=>`${u} (${m})`)})).slice(0,6)},un=({rows:t,config:o})=>{let{t:r}=ce(),n=r("graph.unassigned"),a=useMemo(()=>{let m=o?.fieldMapping;return {primaryDimension:Mr(t,m?.primaryDimension,Ir.primaryDimension,"Category"),secondaryDimension:Mr(t,m?.secondaryDimension,Ir.secondaryDimension,"Owner"),status:Mr(t,m?.status,Ir.status,"Status"),date:Mr(t,m?.date,Ir.date,"Date"),description:Mr(t,m?.description,Ir.description,"Description"),reportHours:Mr(t,m?.reportHours,Ir.reportHours,"ReportHours"),billableHours:Mr(t,m?.billableHours,Ir.billableHours,"BillableHours"),amount:Mr(t,m?.amount,Ir.amount,"Amount")}},[t,o?.fieldMapping]),i=useMemo(()=>t.map((m,h)=>{let f=To(m[a.reportHours]),p=To(m[a.billableHours]),b=To(m[a.amount]),C=f>0?p/f*100:0;return {id:`graph-row-${h}`,Date:fo(m[a.date],""),Primary:fo(m[a.primaryDimension],n),Secondary:fo(m[a.secondaryDimension],n),Description:fo(m[a.description],""),ReportHours:f,BillableHours:p,Amount:b,Efficiency:C,Status:fo(m[a.status],n)}}),[t,a,n]),s=useMemo(()=>{let m=i.length,h=i.reduce((x,v)=>x+To(v.ReportHours),0),f=i.reduce((x,v)=>x+To(v.BillableHours),0),p=i.reduce((x,v)=>x+To(v.Amount),0),b=h>0?f/h*100:0,C=o?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>C.includes(fo(x.Status,"").toLowerCase())).length;return {totalRecords:m,totalReportHours:h,totalBillableHours:f,efficiency:b,totalAmount:p,flaggedCount:g}},[i,o?.statusFlagValues]),c=o?.topN||Jf,d=useMemo(()=>({billableByPrimary:eb(i,"Primary","BillableHours",c,n),efficiencyBySecondary:tb(i,"Secondary","ReportHours","BillableHours",c,n),statusDistribution:ob(i,"Status",n),lineByDate:Gp(i,"Date","BillableHours"),comboByPrimary:rb(i,"Primary","ReportHours","BillableHours",c,n),heatmapPrimarySecondary:nb(i,"Primary","Secondary","BillableHours",n),waterfallBillable:ab(i,"Date","BillableHours"),fishboneStatusCauses:ib(i,"Status","Primary","Secondary",3,n)}),[i,c,n]),u=useMemo(()=>({title:o?.title||r("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: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:a.status}],rows:i}}),[d,o?.title,a,s,i,r]);return {fieldMapping:a,model:u}};var mn=t=>String(t??"").trim(),Di=(t={})=>{let[o,r]=useState(t),n=useCallback((d,u)=>{r(m=>{let h=u?.trim();if(!h){let f={...m};return delete f[d],f}if(m[d]===h){let f={...m};return delete f[d],f}return {...m,[d]:h}});},[]),a=useCallback(d=>{r(u=>{if(!u[d])return u;let m={...u};return delete m[d],m});},[]),i=useCallback(()=>{r({});},[]),s=useMemo(()=>!!(o.primaryDimension||o.secondaryDimension||o.status),[o]),c=useCallback((d,u)=>d.filter(m=>!(o.primaryDimension&&mn(m[u.primaryDimension])!==mn(o.primaryDimension)||o.secondaryDimension&&mn(m[u.secondaryDimension])!==mn(o.secondaryDimension)||o.status&&mn(m[u.status])!==mn(o.status))),[o]);return {filters:o,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:c}};var Ei=({variants:t,currentVariantId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=ce(),[c,d]=useState(false),[u,m]=useState(""),[h,f$1]=useState(false),[p,b]=useState(false),C=t.find(v=>v.id===o),g$1=()=>{m(C?.name||s("variant.newVariant")),f$1(C?.isDefault||false),b(C?.isPublic||false),d(true);},x=()=>{n({name:u,isDefault:h,isPublic:p,description:""}),d(false);};return g("div",{className:"orb-variant-management",children:[f(zt,{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(v=>({value:v.id,label:v.name+(v.isDefault?` (${s("variant.defaultSuffix")})`:"")}))],onChange:v=>{let y=t.find(P=>P.id===v.target.value);y&&r(y);}}),f(ct,{title:s("variant.saveView"),children:f(ie,{className:"orb-variant-save-button",onClick:g$1,size:"small",color:"primary",children:f(kr,{fontSize:"small"})})}),g(Lt,{open:c,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:u,onChange:v=>m(v.target.value)}),f(jn,{control:f(Tt,{checked:h,onChange:v=>f$1(v.target.checked)}),label:s("variant.setDefault")}),f(jn,{control:f(Tt,{checked:p,onChange:v=>b(v.target.checked)}),label:s("variant.publicAllUsers")})]}),g("div",{className:"orb-dialog-actions",children:[f(Pe,{onClick:()=>d(false),children:s("common.cancel")}),f(Pe,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};var Kp=({appId:t,tableKey:o="default",currentFilters:r,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:c,onError:d,onSuccess:u,currentVariantId:m,onVariantChange:h})=>{let{t:f$1}=ce(),[p,b]=useState([]),[C,g]=useState(""),x=`orbcafe.variants.${t}.${o}`,v=m!==void 0?m:C,y=k=>{m===void 0&&g(k),h&&h(k);},P=useCallback(()=>{try{let k=localStorage.getItem(x);if(!k)return [];let A=JSON.parse(k);return Array.isArray(A)?A:[]}catch{return []}},[x]),S=useCallback(k=>{try{localStorage.setItem(x,JSON.stringify(k));}catch{}},[x]),I=useCallback(k=>{b(k);let A=k.find(L=>L.isDefault);A&&!v&&(y(A.id),i(A));},[v,i,y]),M=useCallback(async()=>{if(!t)return [];try{let k=[];if(s)k=await s.getVariants(t,o);else if(c){let A=await fetch(`${c}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!A.ok)throw new Error(f$1("variant.toast.fetchFailed"));k=await A.json();}else k=P();return I(k),k}catch(k){console.error("Error fetching variants",k);let A=P();return I(A),d&&d(f$1("variant.toast.fetchFailed")),A}},[t,o,s,c,P,I,d,f$1]);return useEffect(()=>{M();},[t,o]),f(Ei,{variants:p,currentVariantId:v,onLoad:k=>{y(k.id),i(k);},onSave:async k=>{let A=Date.now().toString(),L;try{let W=k.scope||"Both",ee=p.find(Q=>Q.name===k.name);A=ee?ee.id:Date.now().toString();let O=[];if(ee&&(Array.isArray(ee.filters)?O=[...ee.filters]:ee.filters&&(O=[{scope:"default",filters:ee.filters}])),W==="Search"||W==="Both"){let Q=(Array.isArray(r),r);if(Q)if(Array.isArray(Q)&&Q.length>0&&Q[0].scope)Q.forEach(H=>{let B=O.findIndex(q=>q.scope===H.scope);B>=0?O[B]=H:O.push(H);});else {let H={scope:o,filters:Q},B=O.findIndex(q=>q.scope===o);B>=0?O[B]=H:O.push(H);}}let _=ee?.layout||{},V=[];if(ee&&Array.isArray(ee.layoutRefs)&&(V=[...ee.layoutRefs]),W==="Layout"||W==="Both")if(a&&a.length>0)a.forEach(Q=>{let H=V.findIndex(B=>B.tableKey===Q.tableKey);H>=0?V[H]=Q:V.push(Q);});else {let Q={tableKey:o,layoutId:n||null},H=V.findIndex(B=>B.tableKey===o);H>=0?V[H]=Q:V.push(Q);}if(L={appId:t,tableKey:o,...k,scope:W,id:A,createdAt:new Date().toISOString(),filters:O,layout:_,layoutRefs:V},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(f$1("variant.toast.saveFailed"))}else {let H=p.some(B=>B.id===A)?p.map(B=>B.id===A?L:B):[...p,L];b(H),S(H);}u&&u(f$1("variant.toast.saveSuccess")),(s||c)&&await M(),y(A),i(L);}catch(W){console.error("Error saving variant",W);let O=p.some(_=>_.id===A)?p.map(_=>_.id===A?L:_):[...p,L];b(O),S(O),y(A),i(L),d&&d(f$1("variant.toast.saveFailed"));}},onDelete:async k=>{try{if(s)await s.deleteVariant(k);else if(c){if(!(await fetch(`${c}/api/variants/${k}`,{method:"DELETE"})).ok)throw new Error(f$1("variant.toast.deleteFailed"))}else {let A=p.filter(L=>L.id!==k);b(A),S(A);}v===k&&y(""),(s||c)&&M(),u&&u(f$1("variant.toast.deleteSuccess"));}catch(A){console.error("Error deleting variant",A);let L=p.filter(W=>W.id!==k);b(L),S(L),v===k&&y(""),d&&d(f$1("variant.toast.deleteFailed"));}},onSetDefault:async k=>{try{let A=p.find(W=>W.id===k);if(!A)return;let L={appId:t,tableKey:o,...A,isDefault:!0};if(s)await s.setDefaultVariant(k,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(f$1("variant.toast.defaultFailed"))}else {let W=p.map(ee=>({...ee,isDefault:ee.id===k}));b(W),S(W);}(s||c)&&await M(),u&&u(f$1("variant.toast.defaultSuccess"));}catch(A){console.error("Error setting default variant",A);let L=p.map(W=>({...W,isDefault:W.id===k}));b(L),S(L),d&&d(f$1("variant.toast.defaultFailed"));}}})};nr.extend(ub);nr.extend(mb);nr.extend(Qh);var aa="YYYY-MM-DD",hb=[null,null],zr="0.85rem",fb={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},bb=({isInRange:t,isStart:o,isEnd:r,isHovered:n,disableMargin:a,sx:i,...s})=>{let c=io();return f(Hd,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:c.palette.primary.light,color:c.palette.primary.contrastText}:{},n&&!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%"}:{}]})},Xp=({label:t,value:o=hb,onChange:r})=>{let{t:n,locale:a}=ce(),i=fb[a]||"en",s=t||n("dateRange.label"),[c,d]=useState(null),[u,m]=useState(o),[h,f$1]=useState("start"),[p,b]=useState(null),[C,g$1]=useState((o[0]||nr()).locale(i)),[x,v]=useState(""),[y,P]=useState(""),[S,I]=useState(false),[M,w]=useState(false),D=Jt__default.useRef(o);useEffect(()=>{let[Q,H]=o,[B,q]=D.current,Z=le=>le&&typeof le.isSame=="function",Y=!(Q===null&&B===null||Z(Q)&&Z(B)&&Q.isSame(B,"day")),J=!(H===null&&q===null||Z(H)&&Z(q)&&H.isSame(q,"day"));(Y||J)&&(m(o),o[0]&&Z(o[0])&&g$1(o[0].locale(i))),D.current=o;},[o,i]),useEffect(()=>{v(u[0]?u[0].locale(i).format(aa):""),P(u[1]?u[1].locale(i).format(aa):""),I(false),w(false);},[u,i]);let N=(Q,H)=>{let B=H.trim(),q=Q==="start"?I:w;if(!B){let J=Q==="start"?[null,u[1]]:[u[0],null];q(false),m(J);return}let Z=nr(B,aa,true).locale(i);if(!Z.isValid()){q(true);return}q(false);let Y=[...u];if(Q==="start")Y[0]=Z,Y[1]&&Z.isAfter(Y[1],"day")&&(Y[1]=null),f$1(Y[1]?"start":"end");else {let J=Y[0];J&&Z.isBefore(J,"day")?(Y=[Z,null],f$1("end")):(Y[1]=Z,f$1("start"));}m(Y),g$1(Z);},T=Q=>{d(Q.currentTarget);},k=()=>{d(null),f$1("start"),b(null);},A=!!c,L=Q=>{if(!Q)return;let H=[...u];if(h==="start")H=[Q,null],f$1("end");else {let B=H[0];B&&Q.isBefore(B)?(H=[Q,null],f$1("end")):(H=[B,Q],f$1("start"));}m(H);},W=Q=>{let H=nr().locale(i),B=[null,null];switch(Q){case "today":B=[H,H];break;case "week":B=[H.startOf("week"),H.endOf("week")];break;case "month":B=[H.startOf("month"),H.endOf("month")];break}m(B),f$1("start"),g$1(H);},ee=()=>{r&&r(u),k();},O=()=>{m(o),f$1("start"),k();},_=useCallback(Q=>{let{day:H,...B}=Q,[q,Z]=u,Y=q?H.isSame(q,"day"):false,J=Z?H.isSame(Z,"day"):false,le=q&&Z?H.isBetween(q,Z,"day","()"):false,he=false;return h==="end"&&q&&!Z&&p&&H.isAfter(q,"day")&&H.isBefore(p.add(1,"day"),"day")&&(he=true),f(bb,{...B,day:H,disableMargin:true,isStart:Y,isEnd:J,isInRange:le||he,onMouseEnter:()=>b(H)})},[u,h,p]),V=Q=>Q?Q.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:u[0]?`${V(u[0])} - ${V(u[1])}`:"",onClick:T,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:zr}},InputProps:{readOnly:true,sx:{fontSize:zr,"& .orb-inp":{fontSize:zr},paddingRight:"4px"},endAdornment:f(ie,{className:"orb-date-range-calendar-trigger",size:"small",onClick:T,tooltip:s,children:f(Pt,{name:"calendar",size:16})})}}),g(ai,{open:A,anchorEl:c,onClose:k,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(se,{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:aa,value:x,error:S,size:"small",onFocus:()=>f$1("start"),onChange:Q=>{v(Q.target.value),S&&I(false);},onBlur:()=>N("start",x),onKeyDown:Q=>{Q.key==="Enter"&&(Q.preventDefault(),N("start",x));},sx:{"& .orb-inp":{fontSize:zr,py:.75},"& label":{fontSize:zr}}}),f($d,{color:"action",fontSize:"small"}),f(He,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:aa,value:y,error:M,size:"small",onFocus:()=>{u[0]&&f$1("end");},onChange:Q=>{P(Q.target.value),M&&w(false);},onBlur:()=>N("end",y),onKeyDown:Q=>{Q.key==="Enter"&&(Q.preventDefault(),N("end",y));},sx:{"& .orb-inp":{fontSize:zr,py:.75},"& label":{fontSize:zr}}})]})}),f("div",{className:"orb-date-range-shortcuts",children:g(se,{direction:"row",spacing:1,justifyContent:"center",children:[f(Ct,{label:n("dateRange.today"),onClick:()=>W("today"),clickable:true,size:"small",variant:"outlined"}),f(Ct,{label:n("dateRange.thisWeek"),onClick:()=>W("week"),clickable:true,size:"small",variant:"outlined"}),f(Ct,{label:n("dateRange.thisMonth"),onClick:()=>W("month"),clickable:true,size:"small",variant:"outlined"})]})}),f("div",{className:"orb-date-range-calendar",children:f(Vd,{dateAdapter:ti,adapterLocale:i,children:f(zd,{value:null,referenceDate:C,onMonthChange:g$1,onYearChange:g$1,onChange:L,slots:{day:_},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),f(Rt,{}),g(se,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[f(Pe,{size:"small",onClick:O,color:"inherit",children:n("common.cancel")}),f(Pe,{size:"small",variant:"contained",onClick:ee,children:n("common.done")})]})]})]})};var Oi={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Cb={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"},xb=["contains","notContains",">",">=","<","<=","equals"],Yp=["=","!=",">","<",">=","<=","between"],oo="0.85rem",wb=({field:t,value:o,onChange:r})=>{let{t:n}=ce(),[a,i]=useState(null),[s,c]=useState(null),[d,u]=useState(null),[m,h]=useState(""),[f$1,p]=useState(""),[b,C]=useState(""),[g$1,x]=useState("");useEffect(()=>{let T=setTimeout(()=>{x(b);},1e3);return ()=>clearTimeout(T)},[b]);let v=o?.operator||(t.type==="number"?"=":"equals"),y=o?.value,P=T=>{let k=Cb[T];return k?n(k):T},S=T=>{i(a?null:T.currentTarget);},I=T=>{r({...o,operator:T,value:y}),i(null);},M={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:oo}},InputProps:{sx:{fontSize:oo}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:oo,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},w=t.type||"text";if(w==="date"){let k=(A=>{if(!A)return [null,null];if(Array.isArray(A)&&A.length===2){let L=A[0]?nr.isDayjs(A[0])?A[0]:nr(A[0]):null,W=A[1]?nr.isDayjs(A[1])?A[1]:nr(A[1]):null;return [L,W]}return nr.isDayjs(A)||typeof A=="string"?[nr.isDayjs(A)?A:nr(A),null]:[null,null]})(y);return f(Xp,{label:t.label,value:k,onChange:A=>r({value:A,operator:"between"})})}if(w==="number"&&v==="between"){let T=()=>{r({value:[m,f$1],operator:"between"}),c(null);},k=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return g(e,{children:[f(He,{...M,label:t.label,value:k,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...M.InputProps,startAdornment:f(lr,{position:"start",children:f(ct,{title:P("between"),children:f(ie,{size:"small",onClick:S,sx:{width:24,height:24,fontSize:oo},children:Oi.between})})}),readOnly:true},onClick:A=>c(s?null:A.currentTarget)}),f(Qt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:oo,minHeight:"auto",py:.5}}},children:Yp.map(A=>g("option",{selected:A===v,onClick:()=>I(A),children:[f("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Oi[A]}),f(_t,{primary:P(A),primaryTypographyProps:{fontSize:oo}})]},A))}),f(ai,{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(He,{size:"small",label:n("smartFilter.min"),type:"number",value:m,onChange:A=>h(A.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:oo}},InputProps:{sx:{fontSize:oo}}}),f(_d,{color:"action"}),f(He,{size:"small",label:n("smartFilter.max"),type:"number",value:f$1,onChange:A=>p(A.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:oo}},InputProps:{sx:{fontSize:oo}}}),f(Pe,{variant:"contained",size:"small",onClick:T,children:n("common.ok")})]})})]})}if(t.isValueHelp||w==="value-help"){let T=t.valueHelp?.mode||"single";return f(kp,{...M,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:y??(T==="multiple"?[]:null),mode:T,onChange:k=>r({value:k,operator:T==="multiple"?"anyOf":"equals"})})}if(w==="select")return g(zt,{size:"small",fullWidth:true,label:t.label,value:y||"",onChange:T=>r({...o,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(y)?y:[],k=t.options?.filter(_=>_.label.toLowerCase().includes(g$1.toLowerCase()))||[],A=_=>t.options?.find(V=>V.value===_)?.label||_,L=T.map(A),W=L.length===0?n("common.none"):L.length>2?`${L.slice(0,2).join(", ")} +${L.length-2}`:L.join(", "),ee=()=>{u(null),C(""),x("");},O=_=>{let V=T.includes(_)?T.filter(Q=>Q!==_):[...T,_];r({...o,value:V,operator:"anyOf"});};return g("div",{className:"orb-fld",children:[f("label",{children:t.label}),g(Pe,{variant:"outlined",size:"small",onClick:_=>u(d?null:_.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:oo,fontWeight:400},children:[f("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W}),f($o,{fontSize:"small"})]}),f(Qt,{anchorEl:d,open:!!d,onClose:ee,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:g("div",{onClick:_=>_.stopPropagation(),sx:{display:"grid",gap:.35},children:[f(He,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:f(lr,{position:"start",children:f(Hr,{fontSize:"small"})}),sx:{fontSize:oo}},value:b,onChange:_=>C(_.target.value),onKeyDown:_=>_.stopPropagation()}),k.length>0?k.map(_=>{let V=T.includes(_.value);return g("div",{role:"option","aria-selected":V,tabIndex:0,className:`orb-menu-item ${V?"orb-selected":""}`,onClick:()=>O(_.value),onKeyDown:Q=>{(Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),O(_.value));},children:[f(Tt,{checked:V,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),f(_t,{primary:_.label})]},String(_.value))}):f("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let D=w==="number"?Yp:xb;return g(e,{children:[f(He,{...M,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:y||"",type:w==="number"?"number":"text",onChange:T=>r({...o,value:T.target.value,operator:v}),InputProps:{...M.InputProps,startAdornment:f(lr,{position:"start",children:f(ct,{title:P(v),children:f(ie,{className:"orb-filter-operator-trigger",size:"small",onClick:S,onMouseDown:T=>T.preventDefault(),sx:{width:24,height:24,fontSize:oo,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Oi[v]})})}),endAdornment:t.hasSearchIcon?f(lr,{position:"end",children:f(Hr,{color:"action"})}):void 0}}),f(Qt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:oo,minHeight:"auto",py:.5}}},children:D.map(T=>g("option",{selected:T===v,onClick:()=>I(T),children:[f("span",{className:"orb-filter-operator-symbol",children:Oi[T]}),f(_t,{primary:P(T),primaryTypographyProps:{fontSize:oo}})]},T))})]})},_o=({fields:t,filters:o,onFilterChange:r,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:c,onVariantSetDefault:d,onSearch:u,loading:m=false,appId:h,tableKey:f$1,currentLayout:p,currentLayoutId:b,layoutRefs:C,variantService:g$1,serviceUrl:x})=>{let{t:v}=ce(),[y,P]=useState(true),[S,I]=useState(null),[M,w]=useState(t.filter(k=>!k.hidden).map(k=>k.id)),D=(k,A)=>{r({...o,[k]:A});},N=k=>{M.includes(k)?w(M.filter(A=>A!==k)):w([...M,k]);};return g(De,{className:`orb-smart-filter ${y?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[y?g(e,{children:[g("div",{className:"orb-smart-filter-header",children:[h?f(Kp,{appId:h,tableKey:f$1,currentFilters:{values:o,visibleFields:M},currentLayout:p,currentLayoutId:b,layoutRefs:C,onLoad:k=>{if(!k.filters)return;let A=null;if(Array.isArray(k.filters)){let L=f$1||"default",W=k.filters.find(ee=>ee.scope===L);A=W?W.filters:null;}else A=k.filters;A&&(A.values||A.visibleFields?(A.visibleFields&&Array.isArray(A.visibleFields)&&w(A.visibleFields),A.values&&r(A.values)):r(A)),i&&i(k);},variantService:g$1,serviceUrl:x,currentVariantId:a}):f(Ei,{variants:n,currentVariantId:a,onLoad:i,onSave:k=>{s&&s({...k,filters:{values:o,visibleFields:M}});},onDelete:c,onSetDefault:d}),g("div",{className:"orb-smart-filter-actions",children:[f(ct,{title:v("smartFilter.addFilters"),children:f(Pe,{className:"orb-smart-filter-adapt",onClick:k=>I(S?null:k.currentTarget),size:"small",color:"primary",startIcon:f(mp,{fontSize:"small"}),sx:{textTransform:"none",fontSize:oo,whiteSpace:"nowrap",minWidth:"fit-content"},children:v("smartFilter.adaptFilters")})}),f(ie,{className:"orb-smart-filter-go",tooltip:v("smartFilter.go"),"aria-label":v("smartFilter.go"),onClick:u,disabled:m,children:m?f(Yo,{size:16}):f(Pt,{name:"play",size:16})}),g(Qt,{anchorEl:S,open:!!S,onClose:()=>I(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:oo,minHeight:32}}}},children:[f("option",{disabled:true,children:f(_t,{primary:v("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:oo}})}),f(Rt,{}),t.map(k=>g("option",{onClick:()=>N(k.id),children:[f(Tt,{checked:M.includes(k.id),size:"small"}),f(_t,{primary:k.label,primaryTypographyProps:{fontSize:oo}})]},k.id))]})]})]}),f("div",{className:"orb-smart-filter-grid",children:f(ll,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(k=>M.includes(k.id)).map(k=>f(ll,{size:1,children:f(wb,{field:k,value:o[k.id]||{value:"",operator:k.type==="number"?"=":"equals"},onChange:A=>D(k.id,A)})},k.id))})})]}):null,f("div",{className:"orb-smart-filter-toggle",children:f(ie,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>P(!y),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:y?f(ci,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):f($o,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};var Qp=({layouts:t,currentLayoutId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=ce(),[c,d]=useState(null),[u,m]=useState(false),[h,f$1]=useState(""),[p,b]=useState(""),[C,g$1]=useState({isDefault:false,isPublic:false}),x=t.find(M=>M.id===o),v=M=>{d(M.currentTarget);},y=()=>{d(null);},P=M=>{r(M),y();},S=()=>{f$1(""),b(""),g$1({isDefault:false,isPublic:false}),m(true),y();},I=()=>{h.trim()&&(n({name:h,description:p,...C}),m(false));};return g("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[f(ct,{title:s("layout.layoutOptions"),children:f(ie,{onClick:v,color:x?"primary":"default",size:"small",children:f(vp,{fontSize:"small"})})}),g(Qt,{anchorEl:c,open:!!c,onClose:y,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(Wo,{children:f(kr,{fontSize:"small"})}),f(_t,{children:s("layout.saveCurrentLayout")})]}),f(Rt,{}),t.length===0&&f("option",{disabled:true,children:f(E,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((M,w)=>f("option",{onClick:()=>P(M),selected:M.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(E,{variant:"body2",fontWeight:M.id===o?"bold":"normal",noWrap:true,children:M.name})}),M.description&&f(E,{variant:"caption",color:"text.secondary",noWrap:true,children:M.description})]}),g("div",{sx:{display:"flex",alignItems:"center"},onClick:D=>D.stopPropagation(),children:[f(ct,{title:M.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:f(ie,{size:"small",onClick:D=>{D.stopPropagation(),i(M.id);},children:M.isDefault?f(fp,{fontSize:"small",color:"warning"}):f(hp,{fontSize:"small"})})}),f(ct,{title:s("common.delete"),children:f(ie,{size:"small",color:"error",onClick:D=>{D.stopPropagation(),a(M.id);},children:f(si,{fontSize:"small"})})})]})]})},M.id||w))]}),f(Lt,{open:u,onClose:()=>m(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:g(e,{children:[f(Pe,{variant:"ghost",onClick:()=>m(false),children:s("common.cancel")}),f(Pe,{onClick:I,variant:"primary",disabled:!h.trim(),children:s("common.save")})]}),children:g("div",{className:"orb-layout-save-form",children:[f(He,{label:s("layout.layoutName"),value:h,onChange:M=>f$1(M.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(M=>M.name===h)&&f(E,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),f(He,{label:s("layout.layoutDescription"),value:p,onChange:M=>b(M.target.value),fullWidth:true,size:"small"}),f(Tt,{className:"orb-layout-save-option",checked:C.isDefault,onChange:M=>g$1({...C,isDefault:M.target.checked}),label:s("layout.useAsDefault")}),f(Tt,{className:"orb-layout-save-option",checked:C.isPublic,onChange:M=>g$1({...C,isPublic:M.target.checked}),label:s("layout.publicAllUsers")})]})})]})};var hn=({appId:t,tableKey:o="default",currentLayoutData:r,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:c,onSuccess:d})=>{let{t:u}=ce(),[m,h]=useState([]),[f$1,p]=useState(""),b=`orbcafe.layouts.${t}.${o}`,C=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:o,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(b);if(!w)return [];let D=JSON.parse(w);return Array.isArray(D)?D:[]}catch{return []}},[b]),v=useCallback(w=>{try{localStorage.setItem(b,JSON.stringify(w));}catch{}},[b]);useEffect(()=>{i!==void 0&&p(i);},[i]),useEffect(()=>{if(a&&m.length>0){let w=m.find(D=>D.id===a);w&&(p(w.id),n(w));}},[a,m,n]);let y=useCallback(async()=>{if(t){if(!s){let w=x();h(w);let D=w.find(N=>N.isDefault);D&&!f$1&&!a&&(p(D.id),n(D));return}try{let w=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!w.ok)throw new Error("LAYOUT_FETCH_FAILED");let N=(await w.json()).map(C);h(N);let T=N.find(k=>k.isDefault);T&&!f$1&&!a&&(p(T.id),n(T));}catch(w){console.error("Error fetching layouts",w);let D=x();h(D);let N=D.find(T=>T.isDefault);N&&!f$1&&!a&&(p(N.id),n(N)),c&&c(u("layout.toast.loadFallback"));}}},[t,o,s,c,f$1,n,a,x,u]);return useEffect(()=>{y();},[t,o]),f(Qp,{layouts:m,currentLayoutId:f$1,onLoad:w=>{p(w.id),n(w);},onSave:async w=>{let D=m.find(k=>k.name===w.name),N=D?D.id:Date.now().toString(),T={id:N,...w,createdAt:new Date().toISOString(),layoutData:r,isDefault:w.isDefault??false,isPublic:w.isPublic??false};if(!s){let A=m.some(L=>L.id===N)?m.map(L=>L.id===N?T:L):[...m,T];h(A),v(A),p(N),n(T),d&&d(u("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(u("layout.toast.saveSuccess")),await y(),p(N),n(T);}catch(k){console.error("Error saving layout",k);let L=m.some(W=>W.id===N)?m.map(W=>W.id===N?T:W):[...m,T];h(L),v(L),p(N),n(T),d&&d(u("layout.toast.saveLocalSuccess")),c&&c(u("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async w=>{if(!s){let D=m.filter(N=>N.id!==w);h(D),v(D),f$1===w&&p(""),d&&d(u("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(w)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f$1===w&&p(""),d&&d(u("layout.toast.deleteSuccess")),await y();}catch(D){console.error("Error deleting layout",D);let N=m.filter(T=>T.id!==w);h(N),v(N),f$1===w&&p(""),d&&d(u("layout.toast.deleteLocalSuccess")),c&&c(u("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async w=>{if(!s){let D=m.map(N=>({...N,isDefault:N.id===w}));h(D),v(D),d&&d(u("layout.toast.defaultLocalSuccess"));return}try{let D=m.find(T=>T.id===w);if(!D)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...D,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(u("layout.toast.defaultSuccess")),await y();}catch(D){console.error("Error setting default",D);let N=m.map(T=>({...T,isDefault:T.id===w}));h(N),v(N),d&&d(u("layout.toast.defaultLocalSuccess")),c&&c(u("layout.toast.backendUnavailableDefaultLocal"));}}})};var Fi=(t,o)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let r=t.filters.find(a=>a.scope===o);if(r)return r.filters;let n=t.filters.find(a=>a.scope==="default");return n?n.filters:null}return typeof t.filters=="object"?t.filters:null},Bi=(t,o)=>{if(!t)return {layout:null,layoutId:null};let r=null,n=null;if(Array.isArray(t.layoutRefs)){let a=t.layoutRefs.find(i=>i.tableKey===o);a&&(r=a.layoutId);}return !r&&t.layoutId&&(r=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(n=t.layout),{layoutId:r,layout:n}};function Jp(t,o,r){return o[r]<t[r]?-1:o[r]>t[r]?1:0}function Sb(t,o){return t==="desc"?(r,n)=>Jp(r,n,o):(r,n)=>-Jp(r,n,o)}function kb(t,o){let r=t.map((n,a)=>[n,a]);return r.sort((n,a)=>{let i=o(n[0],a[0]);return i!==0?i:n[1]-a[1]}),r.map(n=>n[0])}var fn=t=>{let o=!!t.disableGrouping,r=!!t.disableSorting,n=useCallback(K=>{let X=String(K?.label??K?.id??"").length*9+64,fe=typeof K?.minWidth=="number"?K.minWidth:0;return Math.max(100,fe,X)},[]),a=useCallback(()=>(t.columns||[]).filter(K=>!!K?.numeric).map(K=>K.id),[t.columns]),[i,s]=useState(""),[c,d]=useState(t.order||"asc"),[u,m]=useState(t.orderBy||""),[h,f]=useState([]),[p,b]=useState(t.page||0),[C,g]=useState(t.rowsPerPage||20),[x,v]=useState(t.selected||[]),[y,P]=useState(t.columns?t.columns.map(K=>K.id):[]),[S,I]=useState(t.columns?t.columns.map(K=>K.id):[]),[M,w]=useState(t.showSummary||false),[D,N]=useState(()=>a()),[T,k]=useState([]),[A,L]=useState(new Set),[W,ee]=useState(()=>{let K={};return (t.columns||[]).forEach(z=>{K[z.id]=n(z);}),K}),[O,_]=useState(null),[V,Q]=useState(null),[H,B]=useState(null),[q,Z]=useState(null),[Y,J]=useState(false),[le,he]=useState(""),[ze,be]=useState(""),Ce=o?[]:T,Be=useCallback(K=>{if(o){k([]),L(new Set),Q(null);return}k(K);},[o]);useEffect(()=>{o&&(k([]),L(new Set),Q(null));},[o]),useEffect(()=>{r&&(d("asc"),m(""),f([]));},[r]),useEffect(()=>{t.layout&&wt(t.layout);},[t.layout]),useEffect(()=>{if(r){d("asc"),m("");return}t.order!==void 0&&d(t.order),t.orderBy!==void 0&&m(t.orderBy);},[t.order,t.orderBy,r]),useEffect(()=>{t.selected!==void 0&&v(t.selected);},[t.selected]),useEffect(()=>{t.page!==void 0&&b(t.page);},[t.page]),useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),useEffect(()=>{let K=a();N(z=>z.filter(fe=>K.includes(fe)));},[a]),useEffect(()=>{ee(K=>{let z={...K};return (t.columns||[]).forEach(X=>{z[X.id]===void 0&&(z[X.id]=n(X));}),z});},[t.columns,n]),useEffect(()=>{I(K=>{let z=(t.columns||[]).map(Ke=>Ke.id),X=new Set(z),fe=K.filter(Ke=>X.has(Ke)),Se=new Set(fe),Ae=z.filter(Ke=>!Se.has(Ke)),$e=[...fe,...Ae];return $e.length===K.length&&$e.every((Ke,Ye)=>Ke===K[Ye])?K:$e});},[t.columns]);let de=useMemo(()=>{let K=t.columns||[];if(S.length===0)return K;let z=new Map(K.map(Se=>[Se.id,Se])),X=[],fe=new Set;return S.forEach(Se=>{let Ae=z.get(Se);Ae&&(X.push(Ae),fe.add(Se));}),K.forEach(Se=>{fe.has(Se.id)||X.push(Se);}),X},[t.columns,S]),ve=useMemo(()=>{let K=t.rows||[];return i&&(K=K.filter(z=>Object.keys(z).some(X=>String(z[X]).toLowerCase().includes(i.toLowerCase())))),K},[t.rows,i]),We=useMemo(()=>{if(r||t.onSortChange)return ve;if(h.length>0){let K=[...ve];return K.sort((z,X)=>{for(let fe of h){let Se=z?.[fe.field],Ae=X?.[fe.field];if(!(Se==null&&Ae==null)){if(Se==null)return fe.direction==="asc"?-1:1;if(Ae==null)return fe.direction==="asc"?1:-1;if(Se<Ae)return fe.direction==="asc"?-1:1;if(Se>Ae)return fe.direction==="asc"?1:-1}}return 0}),K}return u?kb(ve,Sb(c,u)):ve},[ve,c,u,h,t.onSortChange,r]),et=useCallback(K=>{if(Ce.length===0)return K.map(Ae=>({type:"row",data:Ae,id:Ae[t.rowKey||"id"]}));let z=[...K].sort((Ae,$e)=>{for(let Ke of Ce){if(Ae[Ke]<$e[Ke])return -1;if(Ae[Ke]>$e[Ke])return 1}return 0}),X=(Ae,$e=0)=>{if($e>=Ce.length)return Ae;let Ke=Ce[$e],Ye={},ut=[];return Ae.forEach(gt=>{let Mt=gt[Ke],bt=`${Ke}:${Mt}`;Ye[bt]||(Ye[bt]={key:bt,field:Ke,value:Mt,children:[],count:0,level:$e},ut.push(Ye[bt])),Ye[bt].children.push(gt),Ye[bt].count++;}),ut.forEach(gt=>{gt.children&&(gt.children=X(gt.children,$e+1));}),ut},fe=X(z),Se=(Ae,$e="")=>{let Ke=[];return Ae.forEach(Ye=>{if(Ye.children){let ut=$e?`${$e}>${Ye.key}`:Ye.key,gt=A.has(ut);Ke.push({type:"group",id:ut,field:Ye.field,value:Ye.value,level:Ye.level,count:Ye.count,isExpanded:gt,childIds:(function Mt(bt){let F=[];return bt.children.forEach(j=>{j.children?F=F.concat(Mt(j)):F.push(j[t.rowKey||"id"]);}),F})(Ye)}),gt&&(Ke=Ke.concat(Se(Ye.children,ut)));}else Ke.push({type:"row",data:Ye,id:Ye[t.rowKey||"id"],level:Ce.length});}),Ke};return Se(fe)},[Ce,A,t.rowKey]),nt=useCallback(K=>{if(Ce.length===0)return [];let z=[...K].sort((Se,Ae)=>{for(let $e of Ce){if(Se[$e]<Ae[$e])return -1;if(Se[$e]>Ae[$e])return 1}return 0}),X=[],fe=(Se,Ae,$e)=>{if(Ae>=Ce.length)return;let Ke=Ce[Ae],Ye=new Map;Se.forEach(ut=>{let gt=ut[Ke],Mt=Ye.get(gt);Mt?Mt.push(ut):Ye.set(gt,[ut]);}),Ye.forEach((ut,gt)=>{let Mt=`${Ke}:${gt}`,bt=$e?`${$e}>${Mt}`:Mt;X.push(bt),fe(ut,Ae+1,bt);});};return fe(z,0,""),X},[Ce]),it=useMemo(()=>et(We),[We,et]),U=useMemo(()=>nt(We),[We,nt]),Re=useMemo(()=>{let K=(t.rows||[]).length;return typeof t.count=="number"&&t.count>K},[t.count,t.rows]),we=useMemo(()=>Re?it:C>0?it.slice(p*C,p*C+C):it,[it,p,C,Re]),Oe=useMemo(()=>Re&&typeof t.count=="number"?t.count:it.length,[it.length,Re,t.count]),at=K=>{L(z=>{let X=new Set(z);return X.has(K)?X.delete(K):X.add(K),X});},Ze=K=>{let z=U.filter(X=>X===K||X.startsWith(`${K}>`));L(X=>{let fe=new Set(X);return z.forEach(Se=>fe.add(Se)),fe});},xt=K=>{L(z=>{let X=new Set(z);return Array.from(X).forEach(fe=>{(fe===K||fe.startsWith(`${K}>`))&&X.delete(fe);}),X});},It=K=>{if(!K){L(new Set);return}L(new Set(U));},Ot=K=>{let z=U.filter(X=>X.startsWith(`${K}>`));return z.length===0?A.has(K):A.has(K)&&z.every(X=>A.has(X))},At=K=>{if(r)return;h.length>0&&f([]);let z=u===K&&c==="asc",X=u===K&&c==="desc";if(t.onSortChange){z?t.onSortChange(K,"desc"):X?t.onSortChange("","asc"):t.onSortChange(K,"asc");return}z?(d("desc"),m(K)):X?(d("asc"),m("")):(d("asc"),m(K));},re=K=>{if(r){d("asc"),m(""),f([]);return}let z=K.filter(X=>X&&X.field);f(z),z.length>0&&m("");},Ge=()=>{f([]);},Le=(K,z)=>{ee(X=>({...X,[K]:z}));},pe=K=>{if(K.target.checked){let z=ve.map(X=>X[t.rowKey||"id"]);v(z),t.onSelectionChange&&t.onSelectionChange(z);return}v([]),t.onSelectionChange&&t.onSelectionChange([]);},xe=(K,z)=>{let X=z[t.rowKey||"id"],fe=x.indexOf(X),Se=[];fe===-1?Se=Se.concat(x,X):fe===0?Se=Se.concat(x.slice(1)):fe===x.length-1?Se=Se.concat(x.slice(0,-1)):fe>0&&(Se=Se.concat(x.slice(0,fe),x.slice(fe+1))),v(Se),t.onSelectionChange&&t.onSelectionChange(Se);},oe=K=>{b(K),t.onPageChange&&t.onPageChange(K);},ye=K=>{g(K),b(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(K);},Ne=K=>{let z=y.indexOf(K),X=[...y];z===-1?X.push(K):X.splice(z,1),P(X);},je=K=>{if(o)return;let z=Ce.indexOf(K),X=[...Ce];z===-1?X.push(K):X.splice(z,1),Be(X);},st=K=>{a().includes(K)&&N(X=>X.includes(K)?X.filter(fe=>fe!==K):[...X,K]);},pt=(K,z)=>{!K||!z||K===z||I(X=>{let fe=X.indexOf(K),Se=X.indexOf(z);if(fe===-1||Se===-1)return X;let Ae=[...X];return Ae.splice(fe,1),Ae.splice(Se,0,K),Ae});},Bt=K=>{let z=K?.active?.id,X=K?.over?.id;typeof z=="string"&&typeof X=="string"&&pt(z,X);},Xt=K=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:y,columnOrder:S,order:r?"asc":c,orderBy:r?"":u,sortBy:r?[]:h,grouping:Ce,columnWidths:W,showSummary:M,summaryColumns:D});},Vt=K=>{let{layout:z,layoutId:X}=Bi(K,t.tableKey||"default");X?(be(X),he(X)):(be(""),he("")),z&&(z.visibleColumns&&P(z.visibleColumns),Array.isArray(z.columnOrder)&&I(z.columnOrder),r?(d("asc"),m(""),f([])):(z.order&&d(z.order),z.orderBy&&m(z.orderBy),Array.isArray(z.sortBy)&&f(z.sortBy)),z.grouping&&Be(z.grouping),z.columnWidths&&ee(z.columnWidths),z.showSummary!==void 0&&w(!!z.showSummary),Array.isArray(z.summaryColumns)&&N(z.summaryColumns));},wt=K=>{let z=K?.layoutData||K?.layout||K||{};z.visibleColumns&&P(z.visibleColumns),Array.isArray(z.columnOrder)&&I(z.columnOrder),r?(d("asc"),m(""),f([])):(z.order&&d(z.order),z.orderBy!==void 0&&m(z.orderBy),Array.isArray(z.sortBy)&&f(z.sortBy)),z.grouping&&Be(z.grouping),z.columnWidths&&ee(z.columnWidths),z.showSummary!==void 0&&w(!!z.showSummary),Array.isArray(z.summaryColumns)&&N(z.summaryColumns),L(new Set),b(0),K?.id&&he(K.id),be("");};useEffect(()=>{t.layout&&Vt({layout:t.layout});},[t.layout]);let Wt=K=>{K.preventDefault(),Z(q===null?{mouseX:K.clientX+2,mouseY:K.clientY-6}:null);},ft=()=>{Z(null);},Dt=useMemo(()=>{if(!M)return {};let K={};t.columns.forEach(X=>{if(X.numeric&&D.includes(X.id)){let fe=ve.reduce((Se,Ae)=>{let $e=parseFloat(Ae[X.id]);return Se+(isNaN($e)?0:$e)},0);K[X.id]=fe.toFixed(2);}else K[X.id]="";});let z=t.columns.find(X=>y.includes(X.id)&&!X.numeric);return z&&!z.numeric&&(K[z.id]="Total"),K},[ve,t.columns,M,D,y]),lt=()=>{if(!t.columns||!ve)return;let K=t.columns.map(Ae=>Ae.label).join(","),z=ve.map(Ae=>t.columns.map($e=>{let Ke=Ae[$e.id];return `"${(Ke==null?"":String(Ke)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
2
|
+
`),X=`data:text/csv;charset=utf-8,${K}
|
|
3
|
+
${z}`,fe=encodeURI(X),Se=document.createElement("a");Se.setAttribute("href",fe),Se.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(Se),Se.click(),document.body.removeChild(Se);},Ft=()=>{J(true);},Zt=()=>{J(false);};return {isMobile:false,columns:de,order:c,setOrder:d,orderBy:u,setOrderBy:m,sortBy:h,setSortBy:f,applyMultiSort:re,clearMultiSort:Ge,columnOrder:S,setColumnOrder:I,filterText:i,setFilterText:s,visibleColumns:y,setVisibleColumns:P,showSummary:M,setShowSummary:w,summaryColumns:D,grouping:Ce,setGrouping:Be,expandedGroups:A,setExpandedGroups:L,groupAnchorEl:V,setGroupAnchorEl:Q,summaryAnchorEl:H,setSummaryAnchorEl:B,columnWidths:W,setColumnWidths:ee,anchorEl:O,setAnchorEl:_,contextMenu:q,setContextMenu:Z,sensors:void 0,sortedAndFilteredRows:We,visibleRows:we,summaryRow:Dt,page:p,setPage:oe,rowsPerPage:C,setRowsPerPage:ye,totalDisplayCount:Oe,selected:x,setSelected:v,isAllExpanded:U.length>0&&U.every(K=>A.has(K)),handleColumnResize:Le,handleRequestSort:At,handleSelectAllClick:pe,handleClick:xe,toggleSummaryColumn:st,handleDragEnd:Bt,handleColumnReorder:pt,handleExport:lt,handleContextMenu:Wt,handleCloseContextMenu:ft,toggleColumnVisibility:Ne,toggleGroupExpand:at,toggleGroupField:je,handleToggleAll:It,handleExpandGroupRecursively:Ze,handleCollapseGroupRecursively:xt,isGroupFullyExpanded:Ot,handleLayoutLoad:wt,handleVariantLoad:Vt,handleLayoutSave:Xt,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:y,order:r?"asc":c,orderBy:r?"":u,sortBy:r?[]:h,columnOrder:S,grouping:Ce,columnWidths:W,showSummary:M,summaryColumns:D},currentLayoutId:le,layoutIdToLoad:ze,onPageChange:oe,onRowsPerPageChange:ye,graphReportOpen:Y,handleOpenGraphReport:Ft,handleCloseGraphReport:Zt}};var fN=t=>f("tbody",{...t}),bN=({align:t,...o})=>f("td",{align:t==="inherit"?void 0:t,...o}),vN=t=>f("div",{...t}),yN=t=>f("thead",{...t}),CN=t=>f("tr",{...t}),tr=t=>{let{t:o}=ce(),r="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:c,actions:d,extraTools:u,fitContainer:m=false,fullWidth:h=false,maxHeight:f$1,loading:p=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:C,filterConfig:g$1,rowKey:x,tableKey:v="default",graphReport:y,quickCreate:P,quickEdit:S,quickDelete:I,serviceUrl:M,disableGrouping:w=false,disableSorting:D=false}=t,N=n||o("table.title.default"),{isMobile:T,columns:k,order:A,orderBy:L,filterText:W,setFilterText:ee,visibleColumns:O,showSummary:_,setShowSummary:V,summaryColumns:Q,grouping:H,setGrouping:B,expandedGroups:q,groupAnchorEl:Z,setGroupAnchorEl:Y,summaryAnchorEl:J,setSummaryAnchorEl:le,columnWidths:he,anchorEl:ze,setAnchorEl:be,contextMenu:Ce,sensors:Be,sortedAndFilteredRows:de,summaryRow:ve,visibleRows:We,isAllExpanded:et,page:nt,setPage:it,rowsPerPage:U,setRowsPerPage:Re,totalDisplayCount:we,setSelected:Oe,handleColumnResize:at,handleRequestSort:Ze,handleSelectAllClick:xt,handleClick:It,toggleSummaryColumn:Ot,handleDragEnd:At,handleExport:re,handleContextMenu:Ge,handleCloseContextMenu:Le,toggleColumnVisibility:pe,toggleGroupExpand:xe,handleToggleAll:oe,handleExpandGroupRecursively:ye,handleCollapseGroupRecursively:Ne,isGroupFullyExpanded:je,handleLayoutLoad:st,handleVariantLoad:pt,handleLayoutSave:Bt,effectiveAppId:Xt,currentLayoutData:Vt,currentLayoutId:wt,layoutIdToLoad:Wt,graphReportOpen:ft,handleOpenGraphReport:Dt,handleCloseGraphReport:lt}=fn(t),Ft=y?.enabled??false,Zt=Ft&&(y?.interaction?.enabled??true),K=Di(),z=!!P?.enabled,X=!!S?.enabled,fe=!!I?.enabled,Se=P?.fields,Ae=P?.excludeFields||[],$e=P?.initialValues||{},[Ke,Ye]=Jt__default.useState(false),[ut,gt]=Jt__default.useState(false),[Mt,bt]=Jt__default.useState({}),[F,j]=Jt__default.useState(false),[ge,Te]=Jt__default.useState(false),[Je,qe]=Jt__default.useState({}),[St,ht]=Jt__default.useState(false),[mt,yt]=Jt__default.useState(false),ro=p||ut||ge||mt,Et=Jt__default.useMemo(()=>{let ne=[...k];if(Array.isArray(Se)&&Se.length>0){let me=new Set(Se);ne=ne.filter(te=>me.has(te.id));}if(Ae.length>0){let me=new Set(Ae);ne=ne.filter(te=>!me.has(te.id));}return ne.filter(me=>!!me?.id)},[k,Ae,Se]),Yt=x||"id",Ht=Jt__default.useMemo(()=>{let ne=new Set(s);return de.filter(me=>ne.has(me?.[Yt]))},[s,de,Yt]),Ut=Ht.length===1?Ht[0]:null,$t=S?.fields,to=S?.excludeFields||[],no=S?.editableFields||[],bo=S?.nonEditableFields||[],Mo=S?.primaryKeys?.length?S.primaryKeys:[Yt],Ro=Jt__default.useMemo(()=>{let ne=[...k];if(Array.isArray($t)&&$t.length>0){let me=new Set($t);ne=ne.filter(te=>me.has(te.id));}if(to.length>0){let me=new Set(to);ne=ne.filter(te=>!me.has(te.id));}return ne.filter(me=>!!me?.id)},[k,to,$t]),ar=Jt__default.useMemo(()=>new Set(Mo),[Mo]),xo=Jt__default.useMemo(()=>new Set(no),[no]),Bo=Jt__default.useMemo(()=>new Set(bo),[bo]),Kr=Jt__default.useCallback(ne=>xo.size>0?xo.has(ne):!(Bo.has(ne)||ar.has(ne)),[xo,Bo,ar]);Jt__default.useEffect(()=>{!ft&&K.hasActiveFilters&&K.clearAll();},[ft,K.hasActiveFilters,K.clearAll]);let qr=()=>{let ne={};Et.forEach(me=>{ne[me.id]=$e[me.id]??"";}),bt(ne),Ye(true);},Er=()=>{ut||Ye(false);},Xr=(ne,me)=>{bt(te=>({...te,[ne]:me}));},Zr=async()=>{if(!P?.onSubmit){Ye(false);return}try{gt(!0),await P.onSubmit(Mt),Ye(!1);}finally{gt(false);}},No=()=>{if(!Ut)return;let ne={};Ro.forEach(te=>{ne[te.id]=Ut[te.id]??"";});let me=S?.getInitialValues?{...ne,...S.getInitialValues(Ut)}:ne;qe(me),j(true);},Lr=()=>{ge||j(false);},Yr=(ne,me)=>{qe(te=>({...te,[ne]:me}));},Zo=async()=>{if(Ut){if(!S?.onSubmit){j(false);return}try{Te(!0),await S.onSubmit(Je,Ut),j(!1);}finally{Te(false);}}},ir=()=>{Ht.length!==0&&ht(true);},Ln=()=>{mt||ht(false);},Or=async()=>{if(Ht.length===0){ht(false);return}if(!I?.onConfirm){ht(false),Oe([]),c?.([]);return}try{yt(!0),await I.onConfirm(Ht),ht(!1),Oe([]),c?.([]);}finally{yt(false);}},R=de,{fieldMapping:$}=un({rows:R,config:{...y,title:y?.title||`${N} ${o("graph.reportTitle")}`}}),G=Jt__default.useMemo(()=>Zt?K.applyRows(R,$):R,[Zt,K.applyRows,R,$]),{model:ue}=un({rows:G,config:{...y,title:y?.title||`${N} ${o("graph.reportTitle")}`,fieldMapping:$}}),Fe=ue.table.columns.map(ne=>({id:ne.id,label:ne.label,align:ne.align||"left",minWidth:120,numeric:ne.align==="right"})),rt=Xt?f(hn,{appId:Xt,tableKey:v,currentLayoutData:Vt,onLayoutLoad:st,targetLayoutId:Wt,activeLayoutId:wt,serviceUrl:M??g$1?.serviceUrl}):null,_e=g(e,{children:[!w&&f(dn,{groupAnchorEl:Z,setGroupAnchorEl:Y,grouping:H,setGrouping:B,columns:k}),f(pn,{anchorEl:ze,setAnchorEl:be,columns:k,visibleColumns:O,toggleColumnVisibility:pe}),f(Si,{anchorEl:J,setAnchorEl:le,showSummary:_,setShowSummary:V,columns:k,summaryColumns:Q,toggleSummaryColumn:Ot}),f(ki,{contextMenu:Ce,handleCloseContextMenu:Le,columns:k,visibleColumns:O,toggleColumnVisibility:pe})]});return T?g("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g$1&&f(_o,{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:v,currentLayout:[{tableKey:v,layoutData:Vt}],variantService:g$1.variantService,serviceUrl:M??g$1.serviceUrl}),f(Ip,{title:N,loading:p,showSummary:_,setShowSummary:V,setAnchorEl:be,setSummaryAnchorEl:le,filterText:W,setFilterText:ee,sortedAndFilteredRows:de,selected:s,columns:k,visibleColumns:O,summaryRow:ve,handleClick:It,selectionMode:i}),_e]}):g("div",{sx:{width:h?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1&&f("div",{sx:{mb:2},children:f(_o,{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:ne=>{pt(ne),g$1.onVariantLoad&&g$1.onVariantLoad(ne);},onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,loading:p,appId:g$1.appId,tableKey:v,currentLayout:[{tableKey:v,layoutData:Vt}],currentLayoutId:wt,layoutRefs:[{tableKey:v,layoutId:wt}],variantService:g$1.variantService,serviceUrl:M??g$1.serviceUrl})}),g(De,{className:"orb-ctable-surface",sx:{width:h?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":ro?{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"}},...f$1?{height:f$1}:m?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&f(yi,{filterText:W,setFilterText:ee,onRowsPerPageChange:Re,rowsPerPage:U,rowsPerPageOptions:b,page:nt,count:we,onPageChange:it,actions:d,extraTools:u,grouping:H,disableGrouping:w,groupAnchorEl:Z,setGroupAnchorEl:Y,showSummary:_,setShowSummary:V,anchorEl:ze,setAnchorEl:be,summaryAnchorEl:J,setSummaryAnchorEl:le,handleExport:re,showCreateButton:z,onOpenCreateDialog:qr,showEditButton:X,onOpenEditDialog:No,editDisabled:Ht.length!==1,showDeleteButton:fe,onOpenDeleteConfirm:ir,deleteDisabled:Ht.length===0,onLayoutSave:C||g$1?.variantService&&g$1?.appId?Bt:void 0,loading:p,layoutManager:rt,onOpenGraphReport:Ft?Dt:void 0}),f("div",{sx:{flex:1,...f$1?{maxHeight:f$1,height:f$1}:m?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:f(DndContext,{sensors:Be,collisionDetection:closestCenter,onDragEnd:At,modifiers:[restrictToHorizontalAxis],children:g("table",{className:"orb-tbl orb-ctable",style:{minWidth:h?750:void 0,width:h?"100%":"auto",tableLayout:Object.keys(he).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:r},"aria-labelledby":"tableTitle",children:[f(xi,{columns:k,visibleColumns:O,order:A,orderBy:L,onRequestSort:Ze,disableSorting:D,onContextMenu:Ge,selectionMode:i,grouping:H,isAllExpanded:et,handleToggleAll:oe,rowCount:de.length,numSelected:s.length,onSelectAllClick:xt,columnWidths:he,onColumnResize:at}),f(wi,{visibleRows:We,columns:k,visibleColumns:O,selectionMode:i,selected:s,orderBy:L,loading:p,expandedGroups:q,toggleGroupExpand:xe,handleExpandGroupRecursively:ye,handleCollapseGroupRecursively:Ne,isGroupFullyExpanded:je,handleClick:It,onSelectionChange:c,grouping:H,rowKeyProp:x,page:nt,rowsPerPage:U}),_&&f(Tp,{showSummary:_,columns:k,visibleColumns:O,summaryRow:ve,selectionMode:i?.toString(),grouping:H,columnWidths:he,orderBy:L,zIndex:3})]})})})]}),z&&g(Lt,{open:Ke,onClose:Er,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:ne=>`1px solid ${ne.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:P?.title||o("quickCreate.createWithTitle",{title:N})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Et.map(ne=>{let me=ne.type==="number"||ne.numeric?"number":ne.type==="date"?"date":"text",te=ne.label||ne.id;return f(He,{label:te,value:Mt[ne.id]??"",onChange:Ee=>Xr(ne.id,Ee.target.value),type:me,size:"small",fullWidth:true,InputLabelProps:{shrink:me==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${ne.id}`)}),P?.description&&f(Jo,{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(Pe,{onClick:Er,sx:{fontSize:"0.85rem"},disabled:ut,children:P?.cancelLabel||o("common.cancel")}),f(Pe,{onClick:Zr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ut,children:P?.submitLabel||o("common.save")})]})]}),X&&g(Lt,{open:F,onClose:Lr,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:ne=>`1px solid ${ne.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:S?.title||o("quickEdit.editWithTitle",{title:N})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ro.map(ne=>{let me=ne.type==="number"||ne.numeric?"number":ne.type==="date"?"date":"text",te=ne.label||ne.id,Ee=Kr(ne.id);return f(He,{label:te,value:Je[ne.id]??"",onChange:Qe=>Yr(ne.id,Qe.target.value),type:me,size:"small",fullWidth:true,disabled:!Ee,InputLabelProps:{shrink:me==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${ne.id}`)}),S?.description&&f(Jo,{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(Pe,{onClick:Lr,sx:{fontSize:"0.85rem"},disabled:ge,children:S?.cancelLabel||o("common.cancel")}),f(Pe,{onClick:Zo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ge||!Ut,children:S?.submitLabel||o("common.save")})]})]}),fe&&f(Qn,{open:St,type:"warning",title:I?.title||o("quickDelete.confirmTitle"),message:I?.message||(Ht.length>1?o("quickDelete.confirmMessageMultiple",{count:Ht.length}):o("quickDelete.confirmMessageSingle")),confirmText:I?.confirmText||o("common.delete"),cancelText:I?.cancelText||o("common.cancel"),onClose:Ln,onConfirm:Or}),_e,Ft&&f(Ri,{open:ft,onClose:lt,model:ue,aiAssistant:y?.aiAssistant,interaction:Zt?{enabled:true,filters:K.filters,fieldMapping:$,onPrimaryDimensionClick:ne=>K.setFilter("primaryDimension",ne),onSecondaryDimensionClick:ne=>K.setFilter("secondaryDimension",ne),onStatusClick:ne=>K.setFilter("status",ne),onClearFilter:K.clearFilter,onClearAll:K.clearAll}:void 0,tableContent:f(tr,{appId:Xt||"graph-report-internal",title:o("graph.dataBody"),columns:Fe,rows:ue.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},xN=tr;var MN=({id:t,title:o,hideHeader:r=true,filterConfig:n,tableProps:a,children:i,spacing:s=1,mode:c="separated"})=>{let d=n?{...n,appId:n.appId||t}:void 0,u={...a,appId:a.appId||t};return g(fi,{title:o,hideHeader:r,children:[g(se,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[c==="separated"&&d&&f("div",{sx:{flexShrink:0},children:f(_o,{...d})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(tr,{...u,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),i]})};var LN=({metadata:t,fetchData:o,initialRowsPerPage:r=20,rowsPerPageOptions:n=[20,50,100,-1],tableKey:a="default",mode:i="integrated",serviceUrl:s,variantService:c})=>{let{t:d}=ce(),[u,m]=useState(false),[h,f]=useState([]),[p,b]=useState({}),[C,g]=useState(t.variants||[]),[x,v]=useState(t.layout||null),[y,P]=useState(""),[S,I]=useState(0),[M,w]=useState(0),[D,N]=useState(r),[T,k]=useState([]),[A,L]=useState("asc"),[W,ee]=useState("");useEffect(()=>{let J={};t.filters.forEach(le=>{le.defaultValue!==void 0&&(J[le.id]=le.defaultValue);}),b(J);},[t.filters]);let O=useCallback(async(J,le,he,ze,be)=>{m(true);try{let Ce={...J,page:le+1,limit:he,sort:be,order:ze},Be;o?Be=await o(Ce):typeof t.api=="function"?Be=await t.api(Ce):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,Ce),Be={rows:[],total:0}):(console.warn("No API configured for report"),Be={rows:[],total:0}),Be&&(f(Be.rows||[]),I(Be.total||0));}catch(Ce){console.error("Failed to fetch report data",Ce);}finally{m(false);}},[t.api,o]);useEffect(()=>{O(p,M,D,A,W);},[O,M,D,A,W]);let _=()=>{w(0),O(p,0,D,A,W);},V=J=>{w(0),N(J);},Q=(J,le)=>{L(le),ee(J);},H=J=>{b(J);},B=J=>{P(J?.id||"");let le=Fi(J,a);if(le){let ze=le.values??le;b(ze),O(ze,0,D,A,W),w(0);}let{layout:he}=Bi(J,a);he&&v(he);},q=J=>{let le={...J,id:Date.now().toString(),createdAt:new Date().toISOString()};g(he=>[...he,le]);},Z=J=>{v(J);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:p,onFilterChange:H,onSearch:_,onVariantLoad:B,onVariantSave:q,onVariantDelete:J=>g(le=>le.filter(he=>he.id!==J)),onVariantSetDefault:J=>{g(le=>le.map(he=>({...he,isDefault:he.id===J})));},variants:C,currentVariantId:y,variantService:c,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:h,loading:u,rowKey:"id",count:S,page:M,rowsPerPage:D,rowsPerPageOptions:n,onPageChange:w,onRowsPerPageChange:V,selectionMode:"multiple",selected:T,onSelectionChange:k,onLayoutSave:Z,layout:x,title:t.title,showSummary:true,order:A,orderBy:W,serviceUrl:s,onSortChange:Q,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:p,rows:h,loading:u,refresh:_}};var Db=new Set(["id","title","description","icon","iconNode","meta"]),Ab=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,o=>o.toUpperCase()).trim(),Eb=t=>Object.entries(t).filter(([o,r])=>!Db.has(o)&&r!==null&&r!==void 0&&["string","number","boolean"].includes(typeof r)).map(([o,r])=>({key:o,label:Ab(o),value:String(r)})),tu=({item:t,open:o,onClose:r,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:c}=ce(),u=ho()==="dark"?"var(--orb-p300)":"var(--orb-primary)";Jt__default.useEffect(()=>{if(!o)return;let h=f=>{f.key==="Escape"&&r();};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[o,r]);let m=Eb(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(se,{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(Pt,{name:t.icon??"product",size:30,style:{color:u}})}),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(ie,{tooltip:s??c("cardPage.close"),"aria-label":s??c("cardPage.close"),onClick:r,children:f(Pt,{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,m.length>0?f("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:m.map(h=>g("div",{children:[f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:h.label}),f(E,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:h.value})]},h.key))}):null]})}),n?f("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:f(Pe,{variant:"contained",sx:{width:"100%"},startIcon:f(Pt,{name:"download",size:16}),onClick:()=>n(t),children:i??c("cardPage.download")})}):null]})]}),document.body)};var Lb={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},Ob=({item:t,onDetailClick:o,onDownloadClick:r,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=ce(),c=ho()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??f(Pt,{name:t.icon??"product",size:26,style:{color:c}});return g(De,{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(se,{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",...Lb},children:t.description||"\xA0"})}),g(se,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[f(ie,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>o?.(t),children:f(Pt,{name:"show",size:18})}),f(ie,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>r?.(t),children:f(Pt,{name:"download",size:18})})]})]})},ru=({items:t,loading:o=false,onDetailClick:r,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:c,detailPanel:d=true,renderDetailContent:u})=>{let{t:m}=ce(),[h,f$1]=Jt__default.useState(null),[p,b]=Jt__default.useState(false),C=x=>{r?.(x),d&&(f$1(x),requestAnimationFrame(()=>requestAnimationFrame(()=>b(true))));},g$1=()=>{b(false),setTimeout(()=>f$1(null),260);};return o?f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(Yo,{})}):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(Ob,{item:x,onDetailClick:C,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&h?f(tu,{item:h,open:p,onClose:g$1,onDownloadClick:n,renderContent:u,downloadTooltip:s}):null]}):f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(E,{sx:{color:"text.secondary"},children:c??m("cardPage.empty")})})};var oD=({id:t,title:o,hideHeader:r=true,filterConfig:n,gridProps:a,children:i,spacing:s=1})=>{let c=n?{...n,appId:n.appId||t}:void 0;return g(fi,{title:o,hideHeader:r,children:[g(se,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[c&&f("div",{sx:{flexShrink:0},children:f(_o,{...c})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(ru,{...a})})]}),i]})};var sD=({metadata:t,fetchData:o,tableKey:r="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:c})=>{let[d,u]=useState(false),[m,h]=useState([]),[f,p]=useState(0),[b,C]=useState({}),[g,x]=useState(t.variants||[]),[v,y]=useState("");useEffect(()=>{let N={};t.filters.forEach(T=>{T.defaultValue!==void 0&&(N[T.id]=T.defaultValue);}),C(N);},[t.filters]);let P=useCallback(async N=>{u(true);try{let T=o?await o({...N}):{rows:[],total:0};h(T?.rows||[]),p(T?.total||0);}catch(T){console.error("Failed to fetch card page data",T);}finally{u(false);}},[o]);useEffect(()=>{P(b);},[P]);let S=()=>{P(b);},I=N=>{C(N);},M=N=>{y(N?.id||"");let T=Fi(N,r);if(T){let k=T.values??T;C(k),P(k);}},w=N=>{let T={...N,id:Date.now().toString(),createdAt:new Date().toISOString()};x(k=>[...k,T]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:r,fields:t.filters,filters:b,onFilterChange:I,onSearch:S,onVariantLoad:M,onVariantSave:w,onVariantDelete:N=>x(T=>T.filter(k=>k.id!==N)),onVariantSetDefault:N=>{x(T=>T.map(k=>({...k,isDefault:k.id===N})));},variants:g,currentVariantId:v,variantService:n,serviceUrl:a},gridProps:{items:m,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:c}},items:m,total:f,filters:b,loading:d,refresh:S}};var Bb=t=>[...t].sort((o,r)=>r.value-o.value),dD=({bars:t=[],lines:o=[],combos:r=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=useMemo(()=>Bb(t),[t]),c=useMemo(()=>[...o],[o]),d=useMemo(()=>[...r],[r]),u=useMemo(()=>[...n],[n]),m=useMemo(()=>{let f=a.reduce((p,b)=>p+b.value,0);return a.map(p=>({...p,percent:f>0?p.value/f*100:p.percent}))},[a]),h=useMemo(()=>[...i],[i]);return {bars:s,lines:c,combos:d,heatmap:u,pies:m,waterfalls:h}};var hD=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>useMemo(()=>!t||!o?"":ra({apiKey:t,query:o,zoom:r,mapType:n}),[t,o,r,n]),fD=({keyword:t,location:o})=>useMemo(()=>Ii({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0}),[t,o]);var la=({code:t,language:o="text",copyable:r=true,showLineNumbers:n=false,wrapLongLines:a=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(ie,{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(wo,{size:14,strokeWidth:1.8}):f(Ao,{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((m,h)=>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:h+1}),f("span",{style:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:m})]},`${h}-${m}`)):f("code",{style:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:t})})]})};var _b=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},Gb=async t=>new Function("m","return import(m)")(t),ca=({expression:t,inline:o=false,allowKatex:r=false})=>{let n=useMemo(()=>_b(t),[t]),[a,i]=useState("");return useEffect(()=>{let s=true;return (async()=>{if(!r||!n){i("");return}try{let d=await Gb("katex"),m=(d?.default||d)?.renderToString?.(n,{displayMode:!o,throwOnError:!1,strict:"warn"});s&&typeof m=="string"&&i(m);}catch{s&&i("");}})(),()=>{s=false;}},[r,n,o]),n?a?f(Ie,{component:o?"span":"div",sx:{display:o?"inline-flex":"block",my:o?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):o?f(Ie,{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(Ie,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:f(yo,{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 qb=async t=>new Function("m","return import(m)")(t),yl=({code:t,title:o="Mermaid Diagram",height:r=320,enabled:n=true})=>{let[a,i]=useState(""),[s,c]=useState(""),[d,u]=useState(false),m=useMemo(()=>t.trim(),[t]);return useEffect(()=>{let h=true;return (async()=>{if(!n||!m){i(""),c("");return}u(true),c(""),i("");try{let p=await qb("mermaid"),b=p?.default||p;if(!b||typeof b.render!="function")throw new Error("Mermaid runtime is not available");b.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let C=await b.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,m),g=typeof C=="string"?C:C?.svg;h&&typeof g=="string"&&i(g);}catch(p){if(h){let b=p instanceof Error?p.message:"Failed to render Mermaid diagram";c(b);}}finally{h&&u(false);}})(),()=>{h=false;}},[n,m]),g(Fr,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[f(Ie,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(yo,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:o})}),g(Ie,{sx:{p:1},children:[d&&f(Ie,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:f(Pd,{size:20})}),!d&&a&&f(Ie,{sx:{maxHeight:r,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&g(Ie,{children:[s&&f(Jo,{severity:"info",sx:{mb:1},children:s}),f(la,{code:m,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var Cl=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(r=>r.trim()),Zb=t=>/^:?-{3,}:?$/.test(t.trim()),Yb=t=>{let o=t.trim(),r=o.startsWith(":"),n=o.endsWith(":");return r&&n?"center":n?"right":"left"},Hi=t=>{let o=t.split(`
|
|
5
|
+
`).map(s=>s.trim()).filter(Boolean);if(o.length<2)return null;let r=Cl(o[0]),n=Cl(o[1]);if(r.length===0||n.length!==r.length||!n.every(Zb))return null;let a=n.map(Yb),i=o.slice(2).filter(s=>s.includes("|")).map(s=>{let c=Cl(s);return c.length<r.length?[...c,...Array.from({length:r.length-c.length},()=>"")]:c.slice(0,r.length)});return {headers:r,aligns:a,rows:i}},xl=({markdown:t,table:o,maxHeight:r=360})=>{let n=useMemo(()=>o||(t?Hi(t):null),[o,t]);return !n||n.headers.length===0?f(Fr,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:f(yo,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):f(Fr,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:f(Rd,{sx:{maxHeight:r},children:g(Id,{size:"small",stickyHeader:true,children:[f(Nd,{children:f(sl,{children:n.headers.map((a,i)=>f(il,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),f(Md,{children:n.rows.map((a,i)=>f(sl,{hover:true,children:a.map((s,c)=>f(il,{align:n.aligns[c],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||f(Ie,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${c}`))},`row-${i}`))})]})})})};var zi=({content:t,title:o="Thinking",defaultExpanded:r=false,isStreaming:n=false})=>{let[a,i]=useState(r);return g(Ie,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[g(wd,{direction:"row",alignItems:"center",spacing:.6,children:[f(Sd,{size:"small",onClick:()=>i(s=>!s),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:f(nn,{fontSize:"inherit"})}),g(yo,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[o,n?" ...":""]})]}),f(rn,{in:a,children:f(yo,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};var wl=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Vi=t=>t.trim().startsWith("```"),su=t=>/^#{1,6}\s+/.test(t.trim()),Sl=t=>/^[-*+]\s+/.test(t.trim()),kl=t=>/^\d+\.\s+/.test(t.trim()),lu=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),Pl=t=>t.trim().startsWith(">"),cu=(t,o)=>{if(o+1>=t.length)return false;let r=t[o],n=t[o+1];return !r.includes("|")||!n.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(n.trim())},du=t=>t.trim().startsWith("<think>")||t.trim()===":::think",da=(t,o,r)=>{let n=[],a=0,i=0;wl.lastIndex=0;let s=wl.exec(t);for(;s;){s.index>a&&n.push(t.slice(a,s.index));let c=s[0],d=`${r}-${i}`;if(c.startsWith("**")&&c.endsWith("**"))n.push(f("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))n.push(f("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))n.push(f(Ie,{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 u=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/);u?n.push(f(xd,{href:u[2],target:"_blank",rel:"noreferrer",children:u[1]},d)):n.push(c);}else c.startsWith("$")&&c.endsWith("$")&&o.enableMath?n.push(f(ca,{expression:c,inline:true,allowKatex:true},d)):n.push(c);a=s.index+c.length,i+=1,s=wl.exec(t);}return a<t.length&&n.push(t.slice(a)),n.length>0?n:[t]},pa=({markdown:t,content:o,className:r,enableMath:n=true,enableMermaid:a=true,enableThinkBlock:i=true,codeCopyable:s=true,codeLineNumbers:c=false})=>{let d=t??o??"",u=useMemo(()=>{let m=[],h=d.replace(/\r\n/g,`
|
|
6
6
|
`).split(`
|
|
7
|
-
`),f$1={enableMath:n},p=0;for(;p<h.length;){let
|
|
8
|
-
`).trim()},`think-tag-${p}`));continue}p+=1;let x=[];for(;p<h.length&&h[p].trim()!==":::";)x.push(h[p]),p+=1;p<h.length&&h[p].trim()===":::"&&(p+=1),m.push(f(
|
|
9
|
-
`).trim()},`think-fence-${p}`));continue}if(
|
|
10
|
-
`);if(a&&x==="mermaid"){m.push(f(
|
|
11
|
-
`).trim(),allowKatex:true},`math-${p}`));continue}if(
|
|
12
|
-
`),y=Ei(b);if(y){m.push(f(dl,{table:y},`table-${p}`)),p=x;continue}}if(gl(v)){let x=[];for(;p<h.length&&gl(h[p]);)x.push(h[p].replace(/^\s*>\s?/,"")),p+=1;m.push(f(Or,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:f(bo,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((b,y)=>g(Fragment,{children:[y>0&&f("br",{}),sa(b,f$1,`q-${p}-${y}`)]},`quote-line-${y}`))})},`quote-${p}`));continue}if(ul(v)){let x=[];for(;p<h.length&&ul(h[p]);)x.push(h[p].trim().replace(/^[-*+]\s+/,"")),p+=1;m.push(f(Ie,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((b,y)=>f(Ie,{component:"li",sx:{mb:.45},children:f(bo,{variant:"body2",children:sa(b,f$1,`ul-${p}-${y}`)})},`ul-item-${y}`))},`ul-${p}`));continue}if(ml(v)){let x=[];for(;p<h.length&&ml(h[p]);)x.push(h[p].trim().replace(/^\d+\.\s+/,"")),p+=1;m.push(f(Ie,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((b,y)=>f(Ie,{component:"li",sx:{mb:.45},children:f(bo,{variant:"body2",children:sa(b,f$1,`ol-${p}-${y}`)})},`ol-item-${y}`))},`ol-${p}`));continue}let g$1=[];for(;p<h.length;){let x=h[p],b=x.trim();if(!b||Oi(x)||ou(x)||ru(x)||ul(x)||ml(x)||gl(x)||nu(h,p)||i&&au(x)||n&&b.startsWith("$$"))break;g$1.push(x),p+=1;}g$1.length>0?m.push(f(bo,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g$1.map((x,b)=>g(Fragment,{children:[b>0&&f("br",{}),sa(x,f$1,`p-${p}-${b}`)]},`p-line-${b}`))},`p-${p}`)):p+=1;}return m},[d,n,a,i,s,l]);return f(Ie,{className:r,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:u})};var IN=(t,o)=>f(la,{markdown:t,...o});var iu=({value:t,onChange:o,onSubmit:r,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:l=false,compact:d=false,showStatusText:u=true})=>g(ie,{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(Br,{sx:{fontSize:d?16:18,color:"text.secondary"}}),f(kd,{fullWidth:true,value:t,onChange:m=>o(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),r());},placeholder:i,sx:{fontSize:d?"0.84rem":"0.9rem"}}),t&&a&&f(ae,{size:"small",onClick:a,children:f(xr,{sx:{fontSize:d?16:18}})}),n&&f(ae,{size:"small",onClick:n,children:f(ep,{sx:{fontSize:d?16:18}})}),f(ae,{size:"small",onClick:r,disabled:l||!t.trim(),children:f(ap,{sx:{fontSize:d?16:18}})})]}),u&&s&&f(E,{variant:"caption",color:"text.secondary",children:s})]});var su=(t,o)=>{let r=o.trim();if(!r)return t;let n=t.toLowerCase(),a=r.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+r.length)}),t.slice(i+r.length)]})},Fi=({section:t,highlightQuery:o=""})=>{let r=t.columns||2;return g(Ne,{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:r===3?"repeat(3, minmax(0, 1fr))":r===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:su(n.label,o)}),f(E,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?su(a,o):n.value})]},n.id)})})]})};var hl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",Hi=t=>t.trim().toLowerCase(),$b=(t,o)=>{let r=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||hl(a.value),s={source:"section",sourceId:n.id,sourceSectionId:n.id,sourceTitle:n.title,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Hi(`${n.title} ${a.label} ${i}`)});});}),o.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||hl(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Hi(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||hl(i.value),l={source:"tab",sourceId:n.id,sourceSectionId:a.id,sourceTitle:`${n.label} / ${a.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};r.push({hit:l,text:Hi(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),r},lu=({sections:t,tabs:o=[],defaultTabId:r,ai:n})=>{let{t:a}=se(),[i,s]=useState(""),[l,d]=useState(r||o[0]?.id),[u,m]=useState("idle"),[h,f]=useState([]),[p,v]=useState(""),[C,g]=useState(""),[x,b]=useState(false),y=useMemo(()=>$b(t,o),[t,o]);useEffect(()=>{if(o.length===0){d(void 0);return}o.some(M=>M.id===l)||d(r||o[0]?.id);},[o,l,r]);let k=useCallback(()=>{m("idle"),f([]),v(""),g("");},[]),S=useCallback(w=>{s(w),w.trim()||(m("idle"),f([]),v(""),g(""));},[]),P=useCallback(w=>{let M=Hi(w);return M?y.filter(N=>N.text.includes(M)).map(N=>N.hit):[]},[y]),I=useCallback(async()=>{let w=i.trim();if(!w)return;b(true);let M=P(w);if(f(M),M.length>0){m("search"),g(""),v(a("detail.searchAi.matches",{count:M.length})),b(false);return}if(n?.enabled!==false&&n?.onSubmit){m("ai"),v(a("detail.searchAi.autoAiFallback"));try{let T=await n.onSubmit(w,{query:w,hits:M,activeTabId:l,sections:t,tabs:o});g(typeof T=="string"?T:"");}finally{b(false);}return}m("search"),g(""),v(a("detail.searchAi.noMatch")),b(false);},[i,P,a,n,l,t,o]);return {query:i,setQuery:S,activeTabId:l,setActiveTabId:d,searchMode:u,hits:h,statusText:p,aiResponse:C,searching:x,handleSubmit:I,clearResult:k}};var tA=({title:t,subtitle:o,sections:r,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:l,searchBarWidth:d=460,onClose:u,closeLabel:m="Close"})=>{let{t:h}=se(),{query:f$1,setQuery:p,activeTabId:v,setActiveTabId:C,searchMode:g$1,hits:x,statusText:b,aiResponse:y,searching:k,handleSubmit:S,clearResult:P}=lu({sections:r,tabs:n,defaultTabId:a,ai:s}),I=useMemo(()=>n.find(N=>N.id===v)||n[0],[n,v]),w=useCallback(N=>{let T=R=>{let A=document.getElementById(N);if(A){A.scrollIntoView({behavior:"smooth",block:"center"});return}R<4&&setTimeout(()=>T(R+1),60);};requestAnimationFrame(()=>T(0));},[]),M=useCallback((N,T)=>{if(n.some(R=>R.id===N)){C(N),w(T?`detail-tab-${N}-section-${T}`:`detail-tab-${N}`);return}w(`detail-section-${N}`);},[n,C,w]);return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[g(ie,{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}),o&&f(E,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:o})]}),g(ie,{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(iu,{value:f$1,onChange:p,onSubmit:S,onVoiceInput:s?.onVoiceInput,onClear:()=>{p(""),P();},placeholder:s?.placeholder||h("detail.searchAi.placeholder"),statusText:b,loading:k,compact:true,showStatusText:false})}),u&&f(lt,{title:m,children:f(ae,{size:"small",onClick:u,children:f(_d,{fontSize:"small"})})}),l]})]}),b&&f(E,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:b}),g$1==="search"&&x.length>0&&g(Ne,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:h("detail.searchAi.matches",{count:x.length})}),f(ie,{spacing:.35,children:x.slice(0,8).map(N=>f("div",{component:"button",type:"button",onClick:()=>M(N.sourceId,N.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:N.sourceTitle})," \xB7 ",f("div",{component:"span",sx:{fontWeight:700},children:N.fieldLabel})," = ",f("div",{component:"span",children:N.fieldValue||"-"})]})},`${N.source}|${N.sourceId}|${N.fieldId}`))})]}),g$1==="ai"&&y&&g(Ne,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:h("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(la,{markdown:y})})]}),f("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:r.map(N=>f("div",{id:`detail-section-${N.id}`,children:f(Fi,{section:N,highlightQuery:f$1})},N.id))}),n.length>0&&g(Ne,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[f(Rd,{value:I?.id||false,onChange:(N,T)=>C(String(T)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(N=>f(Dd,{value:N.id,label:N.label,sx:{textTransform:"none"}},N.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(ie,{spacing:1.5,children:[(I?.sections||[]).map(N=>f("div",{id:`detail-tab-${I?.id}-section-${N.id}`,children:f(Fi,{section:N,highlightQuery:f$1})},N.id)),I?.fields&&I.fields.length>0&&f(Fi,{section:{id:`${I.id}-fields`,title:I.label,fields:I.fields,columns:2},highlightQuery:f$1})]})]})]}),i&&f(Jo,{title:i.title||h("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};var pu=({bucket:t,cardCount:o,highlighted:r=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:l,renameLabel:d,sx:u})=>{let{t:m}=se(),[h,f$1]=useState(false),[p,v]=useState(t.title),C=()=>{v(t.title),f$1(false);},g$1=x=>{x.preventDefault();let b=p.trim();b&&(b!==t.title&&l?.(b),v(b),f$1(false));};return f(Ne,{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:r?`1px solid ${tt(b,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:r?`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(u)?u:u?[u]:[]],children:g(ie,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[g(Ie,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[f(Ie,{sx:{minWidth:0,flex:1},children:g(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&f(Ie,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),h?g(Ie,{component:"form",onSubmit:g$1,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[f(He,{dense:true,autoFocus:true,value:p,onChange:x=>v(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),C());},inputProps:{"aria-label":d??m("kanban.bucket.rename")},error:!p.trim(),sx:{flex:1,minWidth:0}}),f(ae,{type:"submit",size:"small",tooltip:m("kanban.bucket.saveRename"),"aria-label":m("kanban.bucket.saveRename"),disabled:!p.trim(),children:f(Do,{size:14})}),f(ae,{size:"small",tooltip:m("kanban.bucket.cancelRename"),"aria-label":m("kanban.bucket.cancelRename"),onClick:C,children:f(Ut,{size:14})})]}):f(E,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!h&&g(ie,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[f(Ct,{size:"small",label:o,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&f(Ct,{size:"small",label:`${m("kanban.bucket.limit")} ${t.limit}`,color:o>t.limit?"warning":"default",variant:"outlined"}),l&&f(ae,{size:"small",tooltip:d??m("kanban.bucket.rename"),"aria-label":d??m("kanban.bucket.rename"),onClick:()=>{v(t.title),f$1(true);},sx:{width:26,height:26},children:f(Mc,{size:14})})]})]}),r&&f(E,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:m("kanban.bucket.dropHere")}),f(Ie,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:o>0?n:f(Ie,{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??m("kanban.empty")})})})]})})};var Gb={success:"success",warning:"warning",info:"info",error:"error"},Ub={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)"},qb=(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}},Xb=t=>t?t.split(/\s+/).map(o=>o.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",fl=({card:t,bucket:o,dragging:r=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=se(),l=!!(a&&o),d=t.tone??(t.priority?Ub[t.priority]:"default"),u=d==="default"?"primary":Gb[d],m=Kb[d],h=o?{card:t,bucket:o}:void 0;return f(Ne,{onClick:l?()=>h&&a?.(h):void 0,onKeyDown:l?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),h&&a?.(h));}: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(m,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:n?"var(--orb-shadow-3)":r?"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:r?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:m},"&:hover":l?{transform:"translateY(-1px)",borderColor:tt(m,.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(ie,{spacing:1.25,children:[g(Ie,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[g(Ie,{sx:{minWidth:0,flex:1},children:[(t.kicker||o?.title)&&f(E,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??o?.title}),f(E,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&f(Ct,{size:"small",color:u,label:qb(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(Ie,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(f$1=>g(Ie,{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:f$1.label}),f(E,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:f$1.value})]},f$1.id))}),typeof t.progress=="number"&&g(Ie,{children:[g(Ie,{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(yd,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:m,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||l)&&g(ie,{spacing:.9,children:[t.tags&&t.tags.length>0&&f(Ie,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(f$1=>f(Ct,{size:"small",label:f$1.label,color:f$1.color??"default",variant:"outlined"},f$1.id))}),g(Ie,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[g(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&g(e,{children:[f(Qa,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??Xb(t.assignee.name)}),g(Ie,{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 uu=(t,o)=>{let r=o.title.trim();return !o.id||!r||t.buckets.some(n=>n.id===o.id)?t:{buckets:[...t.buckets,{...o,title:r,cards:[]}]}},mu=(t,o,r)=>{let n=r.trim();if(!n)return t;let a=t.buckets.find(i=>i.id===o);return !a||a.title===n?t:{buckets:t.buckets.map(i=>i.id===o?{...i,title:n}:i)}},Zb=(t,o)=>Number.isNaN(t)||t<0?0:t>o?o:t,gu=({buckets:t,cards:o})=>{let r=new Map;return o.forEach((n,a)=>{let i=r.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),r.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...r.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}})}},_o=(t,o)=>{for(let r=0;r<t.buckets.length;r+=1){let n=t.buckets[r],a=n.cards.findIndex(i=>i.id===o);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:r,cardIndex:a}}},zi=(t,o)=>{let r=_o(t,o.cardId);if(!r)return t;let n=t.buckets.findIndex(u=>u.id===o.toBucketId);if(n<0)return t;let a=t.buckets.map(u=>({...u,cards:u.cards.map(m=>({...m}))})),i=a[r.bucketIndex],[s]=i.cards.splice(r.cardIndex,1);if(!s)return t;let l=a[n],d=Zb(o.targetIndex??l.cards.length,l.cards.length);return l.cards.splice(d,0,{...s,bucketId:o.toBucketId}),{buckets:a.map(u=>({...u,cards:u.cards.map((m,h)=>({...m,bucketId:u.id,position:h}))}))}};var yl="kanban-card|",Cl="kanban-bucket|",bu=t=>`${yl}${t}`,iv=t=>`${Cl}${t}`,Vi=t=>t?.startsWith(yl)?t.slice(yl.length):void 0,fu=t=>t?.startsWith(Cl)?t.slice(Cl.length):void 0,sv=({card:t,bucket:o,onCardClick:r})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=useSortable({id:bu(t.id)}),u={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:u,...a,...i,children:f(fl,{card:t,bucket:o,dragging:d,onClick:r})})},lv=({bucket:t,highlighted:o,bucketHeight:r,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=useDroppable({id:iv(t.id)});return f(Ie,{ref:l,sx:{minWidth:0,minHeight:0,height:r},children:f(pu,{bucket:t,cardCount:t.cards.length,highlighted:o||s,emptyLabel:n,height:r,onRename:a,children:f(SortableContext,{items:t.cards.map(d=>bu(d.id)),strategy:verticalListSortingStrategy,children:f(ie,{spacing:1,children:t.cards.map(d=>f(sv,{card:d,bucket:t,onCardClick:i},d.id))})})})})},vu=t=>String(t??"").toLocaleLowerCase(),cv=(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(n=>[n.id,n.label])??[],...t.metrics?.flatMap(n=>[n.label,n.value])??[]].some(n=>vu(n).includes(o)),RA=({model:t,onCardMove:o,onCardClick:r,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:l=320,bucketHeight:d,bucketMaxHeight:u,searchable:m=false,searchValue:h,defaultSearchValue:f$1="",onSearchValueChange:p,searchPlaceholder:v,emptyBucketLabel:C,sx:g$1})=>{let{t:x}=se(),[b,y]=useState(null),[k,S]=useState(),[P,I]=useState(f$1),w=h??P,M=w.trim().toLocaleLowerCase(),N=d??u??560,T=useMemo(()=>({buckets:t.buckets.map(V=>{let B=n?V.cards.filter(X=>n(X,V)):V.cards;if(!M)return {...V,cards:B};let G=[V.id,V.title,V.description].some(X=>vu(X).includes(M));return {...V,cards:G?B:B.filter(X=>cv(X,M))}})}),[n,t,M]),R=useMemo(()=>T.buckets.reduce((V,B)=>V+B.cards.length,0),[T]),A=useCallback(V=>{h===void 0&&I(V),p?.(V);},[p,h]),L=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),$=useMemo(()=>b?_o(t,b):void 0,[b,t]),j=useCallback(()=>{y(null),S(void 0);},[]),O=useCallback(V=>{if(!V)return;let B=Vi(V);return B?_o(t,B)?.bucket.id:fu(V)},[t]),z=useCallback(V=>{y(Vi(String(V.active.id))??null);},[]),H=useCallback(V=>{S(O(V.over?String(V.over.id):void 0));},[O]),q=useCallback(V=>{let B=Vi(String(V.active.id)),G=V.over?String(V.over.id):void 0;if(!B||!G){j();return}let X=_o(t,B);if(!X){j();return}let pe=X.bucket.id,oe=X.cardIndex,me=Vi(G);if(me){let Pe=_o(t,me);if(!Pe){j();return}pe=Pe.bucket.id,oe=Pe.cardIndex;}else {let Pe=fu(G),Te=t.buckets.find(Be=>Be.id===Pe);if(!Pe||!Te){j();return}pe=Pe,oe=Te.cards.length;}if(X.bucket.id===pe&&X.cardIndex===oe){j();return}let xe=zi(t,{cardId:B,fromBucketId:X.bucket.id,toBucketId:pe,targetIndex:oe}),ze=_o(xe,B);ze&&!(ze.bucket.id===X.bucket.id&&ze.cardIndex===X.cardIndex)&&o?.({cardId:B,fromBucketId:X.bucket.id,toBucketId:ze.bucket.id,targetIndex:ze.cardIndex,card:ze.card,model:xe}),j();},[t,o,j]);return g(DndContext,{sensors:L,collisionDetection:closestCorners,onDragStart:z,onDragOver:H,onDragEnd:q,onDragCancel:j,children:[g(Ie,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(m||a)&&g(Ie,{role:m?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[m&&f(Ie,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:f(He,{dense:true,value:w,onChange:V=>A(V.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(Ho,{size:16,"aria-hidden":"true"}),endAdornment:w?f(ae,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>A(""),sx:{width:26,height:26},children:f(Ut,{size:15})}):void 0})}),g(Ie,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[M&&f(E,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:R>0?x("kanban.search.results",{count:R}):x("kanban.search.noMatch")}),a&&f(Se,{size:"small",variant:"secondary",startIcon:f(jr,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),f(Ie,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${l}px, ${Math.max(l,360)}px)`,gap:1.5,gridAutoRows:N==="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(V=>f(lv,{bucket:V,highlighted:V.id===k,bucketHeight:N,emptyBucketLabel:M?x("kanban.search.noMatch"):C,onBucketRename:i?B=>i(V.id,B):void 0,onCardClick:r},V.id))})]}),f(DragOverlay,{children:$?f(Ie,{sx:{width:Math.max(l-24,260)},children:f(fl,{card:$.card,bucket:$.bucket,overlay:true})}):null})]})};var uv=({initialModel:t,initialBuckets:o,initialCards:r})=>t||gu({buckets:o??[],cards:r??[]}),LA=t=>{let{onCardMove:o,onCardClick:r}=t,[n,a]=useState(()=>uv(t)),i=useCallback(f=>{a(p=>typeof f=="function"?f(p):f);},[]),s=useCallback(f=>_o(n,f),[n]),l=useCallback((f,p,v)=>{let C=_o(n,f);if(!C)return;let g=zi(n,{cardId:f,fromBucketId:C.bucket.id,toBucketId:p,targetIndex:v}),x=_o(g,f);if(!x||x.bucket.id===C.bucket.id&&x.cardIndex===C.cardIndex)return;a(g);let b={cardId:f,fromBucketId:C.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return o?.(b),b},[n,o]),d=useCallback((f,p)=>{a(v=>({buckets:v.buckets.map(C=>({...C,cards:C.cards.map(g=>g.id!==f?g:typeof p=="function"?p(g):{...g,...p})}))}));},[]),u=useCallback(f=>{let p=uu(n,f);return p===n?false:(a(p),true)},[n]),m=useCallback((f,p)=>{let v=mu(n,f,p);return v===n?false:(a(v),true)},[n]),h=useMemo(()=>({model:n,onCardMove:f=>{l(f.cardId,f.toBucketId,f.targetIndex);},onCardClick:r}),[n,l,r]);return {model:n,actions:{replaceModel:i,moveCard:l,updateCard:d,addBucket:u,renameBucket:m,getCard:s},boardProps:h}};function Cn({onTextUpdate:t,onComplete:o,onError:r,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,l]=useState(false),d=useRef(null),u=useRef(null),m=useRef(null),h=useRef(null),f=useRef(null),p=useRef(0),v=useRef(false),C=useRef(false),g=useCallback(()=>{d.current&&(d.current.close(),d.current=null),h.current&&(h.current.disconnect(),h.current=null),f.current&&(f.current.disconnect(),f.current=null),u.current&&(u.current.getTracks().forEach(y=>y.stop()),u.current=null),m.current&&(m.current.close(),m.current=null),C.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||C.current)){C.current=true,v.current=false,p.current=Date.now();try{let y=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});u.current=y;let k=new WebSocket(n);d.current=k,k.onopen=()=>{l(!0),C.current=!1;},k.onmessage=M=>{try{let N=JSON.parse(M.data);if(N.type==="recognition")N.is_final?o(N.text):t?.(N.text);else if(N.type==="error"){let T=N.message||"Voice recognition error";r?.(T),x();}}catch{r?.("Failed to parse voice message");}},k.onerror=()=>{r?.("Voice service connection failed"),g();},k.onclose=()=>{g();};let S=window.AudioContext||window.webkitAudioContext;if(!S)throw new Error("AudioContext is not supported in this browser");let P=new S({sampleRate:16e3});m.current=P;let I=P.createMediaStreamSource(y);f.current=I;let w=P.createScriptProcessor(4096,1,1);h.current=w,w.onaudioprocess=M=>{if(d.current?.readyState!==WebSocket.OPEN)return;let N=M.inputBuffer.getChannelData(0),T=0;for(let L=0;L<N.length;L+=1)T+=N[L]*N[L];if(Math.sqrt(T/N.length)>i)p.current=Date.now();else if(Date.now()-p.current>a&&!v.current){x();return}let A=new Int16Array(N.length);for(let L=0;L<N.length;L+=1){let $=Math.max(-1,Math.min(1,N[L]));A[L]=$<0?$*32768:$*32767;}d.current.send(A.buffer);},I.connect(w),w.connect(P.destination);}catch{r?.("Cannot access microphone"),g();}}},[g,s,i,o,r,t,a,x,n]);return useEffect(()=>g,[g]),{isRecording:s,startRecording:b,stopRecording:x}}var fv=["en","zh","fr","de","ja","ko"],Cu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},wl=({searchPlaceholder:t,onSearch:o,onSearchAdd:r,onOpenPanel:n,panelOpen:a=false,maxWidth:i=540,sx:s})=>{let{t:l}=se(),[d,u]=useState(""),m=useCallback((x=d)=>{let b=x.trim();b&&(u(""),o?.(b));},[o,d]),h=x=>{x.preventDefault(),m();},{isRecording:f$1,startRecording:p,stopRecording:v}=Cn({onTextUpdate:u,onComplete:x=>{u(x),m(x);},onError:x=>{console.error("Header voice input error:",x);}}),C=useCallback(async()=>{if(f$1){v();return}await p();},[f$1,p,v]),g$1=t||l("header.searchPlaceholder");return f("form",{className:"orb-app-header-search",onSubmit:h,style:{width:"100%",maxWidth:typeof i=="number"?`${i}px`:i,...s},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:l("header.searchAddFeature"),children:f(Pt,{name:"add",size:16})})}),f("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:d,onChange:x=>u(x.target.value),placeholder:g$1,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),g("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[n&&!a&&f(ae,{className:"orb-app-header-ai-action",size:"small","aria-label":l("header.searchOpenPanel"),tooltip:l("header.searchOpenPanel"),onClick:n,children:f(Pt,{name:"message",size:16})}),f(ae,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{C();},tooltip:l(f$1?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:f$1?"var(--orb-err)":void 0},children:f(Pt,{name:"microphone",size:16})})]})]})})},Wi=({appTitle:t,logo:o,onToggleMode:r,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:l,showSearch:d=false,onSearch:u,onSearchAdd:m,onOpenPanel:h,panelOpen:f$1,user:p,onUserRefresh:v,onUserSetting:C,onUserLogout:g$1,userMenuItems:x,leftSlot:b,rightSlot:y})=>{let{t:k,locale:S}=se(),P=mo(),I=n||S,w=a||Cu[I],M=i||fv,N=P==="dark"?f(Vc,{size:15}):f(Gc,{size:15}),T=k(P==="dark"?"header.theme.dark":"header.theme.light"),R=[...v?[{key:"refresh",label:k("header.menu.refresh"),icon:f(Fa,{size:15}),onClick:v}]:[],...C?[{key:"settings",label:k("header.menu.setting"),icon:f(Jr,{size:16}),onClick:C}]:[],...g$1?[{key:"logout",label:k("header.menu.logout"),icon:f(Fc,{size:16}),onClick:g$1}]:[]],A=x||R,L=M.map($=>({label:Cu[$],onClick:()=>{s?.($),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:$===I}));return g("header",{className:"orb-app-header",children:[g("div",{className:"orb-app-header-brand",children:[b,o===null?null:o||f("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:f(Pt,{name:"product",size:20})}),t&&f(E,{variant:"h4",sx:{fontWeight:700},children:t})]}),f("div",{className:"orb-app-header-center",children:d&&f(wl,{searchPlaceholder:l,onSearch:u,onSearchAdd:m,onOpenPanel:h,panelOpen:f$1})}),g("div",{className:"orb-app-header-actions",children:[g("div",{className:"orb-app-header-utilities",children:[s?f(Yt,{triggerLabel:w,trigger:g("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[f(Fn,{size:15}),f("span",{className:"orb-label",children:w})]}),items:L,align:"end"}):g("div",{className:"orb-app-header-locale","aria-label":w,children:[f(Fn,{size:15}),f("span",{className:"orb-label",children:w})]}),f(ae,{className:"orb-app-header-theme",size:"small",onClick:r,tooltip:T,children:N})]}),p&&f("span",{className:"orb-app-header-divider","aria-hidden":"true"}),p&&f(Yt,{triggerLabel:p.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:p.name}),p.subtitle&&f(E,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:p.subtitle,children:p.subtitle})]}),f(en,{src:p.avatarSrc,alt:p.name,size:32,children:p.avatarText||p.name.slice(0,1).toUpperCase()})]}),items:A.map($=>({label:$.label,onClick:$.onClick,disabled:$.disabled,icon:$.icon})),align:"end"}),y]})]})};var xu=({menuData:t=[],initialNavigationCollapsed:o=false,initialNavigationMode:r="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:u}=ud({initialCollapsed:o,initialDisplayMode:r,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[m,h]=useState(900);useEffect(()=>{let p=()=>h(window.innerHeight);return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);let f=useMemo(()=>Math.max(280,m-100),[m]);return {navigationIslandProps:u,navigationMaxHeight:f}};var Lo=12,Su=56,ku=234,xv="orbcafe:page-layout-locale",Pu=["en","zh","fr","de","ja","ko"],wv=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",$i=(t,o)=>`orbcafe:page-layout:${wv(t)}:${o}`,Sv=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,kv=t=>t==="system"?"dark":t==="dark"?"light":"system",_i=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),Pv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,rE=({appId:t,appTitle:o,menuData:r=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:l,onLocaleChange:d,mode:u,defaultMode:m="system",onModeChange:h,user:f$1,onUserRefresh:p,onUserSetting:v,onUserLogout:C,userMenuItems:g$1,logo:x,searchPlaceholder:b,searchPlacement:y="hidden",floatingSearchSx:k,onSearch:S,onSearchAdd:P,onOpenPanel:I,panelOpen:w,rightHeaderSlot:M,leftHeaderSlot:N,contentSx:T,navigationVariant:R="classic",navigationMode:A,defaultNavigationMode:L="fixed",onNavigationModeChange:$,showNavigationModeToggle:j=true,enableNavigationPinning:O=true,navigationPinStorageKey:z,pinnedNavigationItemIds:H,defaultPinnedNavigationItemIds:q,onPinnedNavigationItemIdsChange:V,pinnedNavigationSectionTitle:B})=>{let G=t?$i(t,"mode"):"orbcafe:page-layout-mode",X=t?$i(t,"locale"):xv,pe=t?$i(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[oe,me]=useState(m),[xe,ze]=useState("light"),[Pe,Te]=useState(false),[Be,le]=useState(i),[fe,Ve]=useState(false),[et,rt]=useState(false),[at,K]=useState(L),[Re,ye]=useState({x:Lo,y:Lo}),[Oe,nt]=useState("left"),[Ze,xt]=useState(false),It=useRef(null),Lt=useRef(null),Nt=u!==void 0,te=u??oe,Ge=d!==void 0,Le=Ge?i:Be,ce=l?.join("|")??"",ve=A!==void 0,ee=A??at,be=ee==="floating",De=R==="v2"?Ks:id,je=y==="header",it=te==="system"?Pe?xe:"light":te;useEffect(()=>{if(!Nt)try{let he=window.localStorage.getItem(G);(he==="light"||he==="dark"||he==="system")&&me(he);}catch{}Te(true);let W=window.matchMedia("(prefers-color-scheme: dark)"),Y=()=>{ze(W.matches?"dark":"light");};return Y(),W.addEventListener("change",Y),()=>W.removeEventListener("change",Y)},[Nt,G]),useEffect(()=>{if(!(Nt||!Pe))try{window.localStorage.setItem(G,te);}catch{}},[Pe,Nt,te,G]),useEffect(()=>{if(Ge){Ve(true);return}try{let W=window.localStorage.getItem(X),Y=l??Pu;W&&Pu.includes(W)&&Y.includes(W)&&le(W);}catch{}finally{Ve(true);}},[Ge,ce,X]),useEffect(()=>{if(!(Ge||!fe))try{window.localStorage.setItem(X,Le);}catch{}},[Le,Ge,fe,X]),useEffect(()=>{if(ve){rt(true);return}try{let W=window.localStorage.getItem(pe);(W==="fixed"||W==="floating")&&K(W);}catch{}finally{rt(true);}},[ve]),useEffect(()=>{if(et)try{window.localStorage.setItem(pe,ee);}catch{}},[ee,et]),useEffect(()=>{it==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[it]);let dt=useCallback(W=>{ve||K(W),$?.(W);},[ve,$]),Ft=useCallback(W=>{Nt||me(W),h?.(W);},[Nt,h]),qt=useCallback(W=>{Ge||le(W),d?.(W);},[Ge,d]),{navigationIslandProps:zt,navigationMaxHeight:wt}=xu({menuData:r,initialNavigationCollapsed:false,initialNavigationMode:ee,enableNavigationPinning:O,navigationPinStorageKey:z??(t?$i(t,"pinned-navigation-items"):Sv(o)),pinnedNavigationItemIds:H,defaultPinnedNavigationItemIds:q,onPinnedNavigationItemIdsChange:V,pinnedNavigationSectionTitle:B}),Vt=zt.collapsed,ft=useCallback(W=>{let Y=It.current,he=Y?.parentElement;if(!Y||!he)return W;let Ce=he.getBoundingClientRect(),Ae=Y.getBoundingClientRect(),$e=Lo,Ke=Lo,Ye=Math.max($e,Ce.width-Ae.width-Lo),ut=Math.max(Ke,Ce.height-Ae.height-Lo);return {x:_i(W.x,$e,Ye),y:_i(W.y,Ke,ut)}},[]),Dt=useCallback(W=>{let Y=It.current,he=Y?.parentElement;if(!Y||!he)return W;let Ce=he.getBoundingClientRect(),Ae=Y.getBoundingClientRect(),$e=Lo,Ke=Lo,Ye=Math.max($e,Ce.width-Ae.width-Lo),ut=Math.max(Ke,Ce.height-Ae.height-Lo),gt={x:_i(W.x,$e,Ye),y:_i(W.y,Ke,ut)},bt=[{distance:Math.abs(gt.x-$e),position:{x:$e,y:gt.y}},{distance:Math.abs(gt.x-Ye),position:{x:Ye,y:gt.y}},{distance:Math.abs(gt.y-Ke),position:{x:gt.x,y:Ke}},{distance:Math.abs(gt.y-ut),position:{x:gt.x,y:ut}}].reduce((F,Q)=>Q.distance<F.distance?Q:F).position;return nt(bt.x>=($e+Ye)/2?"right":"left"),bt},[]),st=useMemo(()=>{if(!be||Ze)return Re.x;if(Oe==="right"){let he=It.current?.parentElement?.getBoundingClientRect().width,Ce=Vt?Su:ku;return he?Math.max(Lo,he-Ce-Lo):Vt?Re.x:Re.x-(ku-Su)}return Re.x},[Oe,Re.x,Ze,be,Vt]),Ot=useCallback(W=>{if(!be||!Vt||Pv(W.target))return;W.preventDefault(),W.currentTarget.setPointerCapture(W.pointerId);let Y=ft({x:st,y:Re.y});nt("left"),ye(Y),Lt.current={pointerId:W.pointerId,startClientX:W.clientX,startClientY:W.clientY,startX:Y.x,startY:Y.y,currentX:Y.x,currentY:Y.y},xt(true);},[ft,st,Re.y,be,Vt]),Xt=useCallback(W=>{let Y=Lt.current;if(!Y||Y.pointerId!==W.pointerId)return;let he=ft({x:Y.startX+W.clientX-Y.startClientX,y:Y.startY+W.clientY-Y.startClientY});Y.currentX=he.x,Y.currentY=he.y,ye(he);},[ft]),Z=useCallback(W=>{let Y=Lt.current;if(!(!Y||Y.pointerId!==W.pointerId)){try{W.currentTarget.releasePointerCapture(W.pointerId);}catch{}Lt.current=null,ye(Dt({x:Y.currentX,y:Y.currentY})),xt(false);}},[Dt]);return useEffect(()=>{if(!be)return;let W=()=>{ye(Ce=>ft(Ce));},Y=window.requestAnimationFrame(W),he=window.setTimeout(W,430);return ()=>{window.cancelAnimationFrame(Y),window.clearTimeout(he);}},[ft,be,Vt,wt]),f(En,{mode:te,children:f(_a,{locale:Le,children:g("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[f(Wi,{appTitle:o,logo:x,mode:te,onToggleMode:()=>Ft(kv(te)),locale:Le,localeLabel:Ge||Le===i?s:void 0,localeOptions:l,onLocaleChange:qt,user:f$1,onUserRefresh:p,onUserSetting:v,onUserLogout:C,userMenuItems:g$1,searchPlaceholder:b,showSearch:je,onSearch:S,onSearchAdd:P,onOpenPanel:I,panelOpen:w,leftSlot:N,rightSlot:M}),y==="floating"&&f("div",{className:"orb-float-search",style:k,children:f(wl,{searchPlaceholder:b,onSearch:S,onSearchAdd:P,onOpenPanel:I,panelOpen:w,maxWidth:"100%"})}),g("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!be&&f("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:Vt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:f(De,{...zt,maxHeight:wt,colorMode:it,displayMode:ee,onDisplayModeChange:dt,showDisplayModeToggle:j&&Vt})}),a&&be&&f("div",{ref:It,onPointerDown:Ot,onPointerMove:Xt,onPointerUp:Z,onPointerCancel:Z,style:{position:"absolute",top:Re.y,left:st,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:Vt?Ze?"grabbing":"grab":"default",touchAction:Vt?"none":"auto",userSelect:Ze?"none":void 0,transition:Ze?"none":"left 180ms ease-out, top 180ms ease-out"},children:f(De,{...zt,maxHeight:wt,colorMode:it,displayMode:ee,onDisplayModeChange:dt,showDisplayModeToggle:j&&Vt})}),f("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!be&&Vt?4:12,...T},children:n})]})]})})})};var Gi="(blank)",Tu="Result",Iu="Grand Total",Mu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Ru=["sum","count","avg","min","max"];var Du=["palette","rows","columns","filters","values"];var Nu=t=>Du.includes(t),Au=t=>t==="rows"||t==="columns"||t==="filters",Ui=t=>{let o=t.split("|");return o.length===2&&o[0]==="container"&&Nu(o[1])?{kind:"container",zone:o[1]}:o.length===3&&o[0]==="item"&&Nu(o[1])&&o[2]?{kind:"item",zone:o[1],key:o[2]}:null},dr=t=>t==null||t===""?Gi:t instanceof Date?t.toISOString().slice(0,10):String(t),Wr=t=>JSON.stringify(t),Eu=(t,o)=>{let r=t.join(""),n=o.join("");return r.localeCompare(n,void 0,{sensitivity:"base"})},Tv=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},xn=(t,o,r)=>{if(r==="count")return t.length;let n=t.map(a=>Tv(a[o])).filter(a=>a!==null);return n.length===0?0:r==="sum"?n.reduce((a,i)=>a+i,0):r==="avg"?n.reduce((a,i)=>a+i,0)/n.length:r==="min"?Math.min(...n):Math.max(...n)},io=(t,o)=>{if(!t||t.length===0)return [];let r=new Set,n=[];return t.forEach(a=>{!o.has(a)||r.has(a)||(r.add(a),n.push(a));}),n},pr=(t,o)=>t.length!==o.length?false:t.every((r,n)=>r===o[n]),Lu=(t,o)=>{let r=Object.keys(t),n=Object.keys(o);return r.length!==n.length?false:r.every(a=>{let i=t[a]??[],s=o[a]??[];return pr(i,s)})},Ki=(t,o)=>t.length!==o.length?false:t.every((r,n)=>{let a=o[n];return r.tokenId===a.tokenId&&r.fieldId===a.fieldId&&r.aggregation===a.aggregation}),Sl=t=>!t?.aggregations||t.aggregations.length===0?Ru:t.aggregations,vo=(t,o)=>{let r=Sl(o);return t&&r.includes(t)?t:o?.type==="number"&&r.includes("sum")?"sum":r.includes("count")?"count":r[0]},ca=(t,o,r)=>{let n=r.get(o.fieldId);return n?.formatValue?n.formatValue(t):o.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var Fu=({options:t,selectedValues:o,onChange:r,minWidth:n=96})=>{let{t:a}=se(),[i,s]=useState(""),[l,d]=useState(null),u=useMemo(()=>{let p=i.trim().toLowerCase();return p?t.filter(v=>v.toLowerCase().includes(p)):t},[t,i]),m=t.length>0&&o.length===t.length,h=t.length===0?a("pivot.filter.na"):o.length===0?a("common.none"):m?a("common.all"):`${o.length}/${t.length}`,f$1=p=>{r(o.includes(p)?o.filter(v=>v!==p):[...o,p]);};return g("div",{sx:{minWidth:n},onClick:p=>p.stopPropagation(),onMouseDown:p=>p.stopPropagation(),children:[f(Se,{variant:"outlined",size:"small",onClick:p=>d(p.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:h}),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:p=>p.stopPropagation(),sx:{display:"grid",gap:.4},children:[f(He,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:p=>s(p.target.value),onKeyDown:p=>p.stopPropagation(),onClick:p=>p.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(Se,{variant:"text",size:"small",onClick:p=>{p.preventDefault(),p.stopPropagation(),r(m?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(m?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),u.length===0&&f("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),u.map(p=>{let v=o.includes(p);return g("div",{role:"option","aria-selected":v,tabIndex:0,className:`orb-menu-item ${v?"orb-selected":""}`,onClick:()=>f$1(p),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),f$1(p));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[f(Tt,{size:"small",checked:v,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),f("span",{children:p})]},p)})]})})]})};var wn=({size:t=18,subtle:o=false})=>{let r=Math.max(2,Math.round(t/6));return f(Ie,{"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},(n,a)=>f(Ie,{sx:{width:r,height:r,borderRadius:999,bgcolor:"currentColor"}},a))})};var kl=({label:t,subtitle:o,isDragging:r,dragRef:n,listeners:a,attributes:i,style:s})=>f(Ne,{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: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(wn,{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}),o&&f(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]})]})}),Bu=({id:t,label:o,subtitle:r})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=useDraggable({id:t});return f(kl,{label:o,subtitle:r,isDragging:s,dragRef:n,listeners:a,attributes:i})};var Sn=({zone:t,title:o,hint:r,icon:n,children:a,itemCount:i,onClear:s})=>{let l=`container|${t}`,{isOver:d,setNodeRef:u}=useDroppable({id:l}),{t:m}=se();return g(Ne,{ref:u,sx:h=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:d?"var(--orb-primary)":"var(--orb-p200)",bgcolor:d?"var(--orb-p100)":h.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:o}),g(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&f(lt,{title:m("pivot.clearArea"),children:f(ae,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:f(jd,{size:13})})})]}),f(E,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:r}),f("div",{sx:{flex:1},children:a})]})};var Hu={xs:1.2,md:1.6},kn=({title:t,subtitle:o,collapsed:r,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:l,unmountOnExit:d=false,headerActions:u})=>g(Ne,{sx:m=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${m.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[g("div",{sx:m=>({px:Hu,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:r?"none":`1px solid ${m.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:o})]}),g("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[u,f(ae,{size:"small","aria-label":r?a:i,onClick:n,sx:m=>({border:`1px solid ${m.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(ni,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:r?"rotate(180deg)":"rotate(0deg)"}})})]})]}),f(on,{in:!r,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:f("div",{sx:[{px:Hu,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});var qi=({label:t,caption:o,onRemove:r,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:l,style:d})=>f(Ne,{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(wn,{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}),o&&f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]}),n,r&&f(ae,{size:"small",onClick:u=>{u.stopPropagation(),r();},sx:{width:24,height:24,p:0},children:f(xr,{size:13})})]})}),da=({id:t,label:o,caption:r,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:l,transform:d,transition:u,isDragging:m}=useSortable({id:t}),h={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:u,zIndex:m?999:"auto"};return f(qi,{label:o,caption:r,onRemove:n,trailing:a,isDragging:m,dragRef:i,listeners:l,attributes:s,style:h})};var Yi={rows:f(up,{size:16,sx:{color:"var(--orb-primary)"}}),columns:f(an,{size:16,sx:{color:"var(--orb-primary)"}}),filters:f(Xd,{size:16,sx:{color:"var(--orb-primary)"}}),values:f(nn,{size:16,sx:{color:"var(--orb-accent)"}})},zu=({isConfiguratorCollapsed:t,onToggleCollapse:o,availableFields:r,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:l,clearZone:d,removeFieldFromZone:u,getFilterSelectionSummary:m,renderDimensionFilterSelect:h,renderAggregationSelect:f$1,getAggregationLabel:p})=>{let{t:v}=se(),C=[`${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(kn,{title:v("pivot.config.title"),subtitle:C,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(Sn,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:r.length,icon:f(wn,{size:18,subtle:true}),children:g(ie,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[r.length===0&&f(E,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:v("pivot.allFieldsInUse")}),r.map(g=>f(Bu,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),g(ie,{spacing:2,children:[g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(Sn,{zone:"filters",title:v("pivot.zone.filters"),hint:v("pivot.hint.filters"),icon:Yi.filters,itemCount:a.length,onClear:()=>d("filters"),children:f(SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:verticalListSortingStrategy,children:f(ie,{spacing:.7,children:a.map(g=>f(da,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:m(g),trailing:h(g),onRemove:()=>u("filters",g)},g))})})}),f(Sn,{zone:"columns",title:v("pivot.zone.columns"),hint:v("pivot.hint.columns"),icon:Yi.columns,itemCount:i.length,onClear:()=>d("columns"),children:f(SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:verticalListSortingStrategy,children:f(ie,{spacing:.7,children:i.map(g=>f(da,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:h(g),onRemove:()=>u("columns",g)},g))})})})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(Sn,{zone:"rows",title:v("pivot.zone.rows"),hint:v("pivot.hint.rows"),icon:Yi.rows,itemCount:s.length,onClear:()=>d("rows"),children:f(SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:verticalListSortingStrategy,children:f(ie,{spacing:.7,children:s.map(g=>f(da,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:h(g),onRemove:()=>u("rows",g)},g))})})}),f(Sn,{zone:"values",title:v("pivot.zone.values"),hint:v("pivot.hint.values"),icon:Yi.values,itemCount:l.length,onClear:()=>d("values"),children:f(SortableContext,{items:l.map(g=>`item|values|${g.tokenId}`),strategy:verticalListSortingStrategy,children:f(ie,{spacing:.7,children:l.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,b=`${p(g.aggregation)}(${x})`;return f(da,{id:`item|values|${g.tokenId}`,label:x,caption:b,trailing:f$1(g),onRemove:()=>u("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};var Vu=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Wu=({data:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=ao();if(t.length===0)return null;let s=720,l=250,d={top:20,right:24,bottom:40,left:52},u=r?t.map(g=>g.primaryValue):t.map((g,x)=>x+1),m=r?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),h=Math.max(...u,1),f$1=Math.max(...m,1),p=s-d.left-d.right,v=l-d.top-d.bottom,C=t.map((g,x)=>{let b=r?g.primaryValue:x+1,y=r?g.secondaryValue??0:g.primaryValue,k=d.left+b/h*p,S=l-d.bottom-y/f$1*v;return {...g,x:k,y:S,rawX:b,rawY:y}});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:Ao(i.palette.text.secondary,.35)}),f("line",{x1:d.left,y1:d.top,x2:d.left,y2:l-d.bottom,stroke:Ao(i.palette.text.secondary,.35)}),C.map(g$1=>g("g",{children:[f("circle",{cx:g$1.x,cy:g$1.y,r:7,fill:Ao(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,`
|
|
7
|
+
`),f$1={enableMath:n},p=0;for(;p<h.length;){let b=h[p],C=b.trim();if(!C){p+=1;continue}if(i&&du(b)){if(C.startsWith("<think>")){let v=[],y=b;for(;;){let P=y.indexOf("<think>"),S=P>=0?y.slice(P+7):y,I=S.indexOf("</think>");if(I>=0){v.push(S.slice(0,I)),p+=1;break}if(v.push(S),p+=1,p>=h.length)break;y=h[p];}m.push(f(zi,{content:v.join(`
|
|
8
|
+
`).trim()},`think-tag-${p}`));continue}p+=1;let x=[];for(;p<h.length&&h[p].trim()!==":::";)x.push(h[p]),p+=1;p<h.length&&h[p].trim()===":::"&&(p+=1),m.push(f(zi,{content:x.join(`
|
|
9
|
+
`).trim()},`think-fence-${p}`));continue}if(Vi(b)){let x=C.slice(3).trim().toLowerCase(),v=[];for(p+=1;p<h.length&&!Vi(h[p]);)v.push(h[p]),p+=1;p<h.length&&Vi(h[p])&&(p+=1);let y=v.join(`
|
|
10
|
+
`);if(a&&x==="mermaid"){m.push(f(yl,{code:y},`mermaid-${p}`));continue}if(n&&["math","latex","katex"].includes(x)){m.push(f(ca,{expression:y,allowKatex:true},`math-fence-${p}`));continue}m.push(f(la,{code:y,language:x||"text",copyable:s,showLineNumbers:c,wrapLongLines:true},`code-${p}`));continue}if(n&&C.startsWith("$$")){let x=[];if(C.endsWith("$$")&&C!=="$$")x.push(C.slice(2,-2)),p+=1;else {let y=b.slice(b.indexOf("$$")+2);for(y.trim()&&x.push(y),p+=1;p<h.length;){let P=h[p],S=P.indexOf("$$");if(S>=0){x.push(P.slice(0,S)),p+=1;break}x.push(P),p+=1;}}m.push(f(ca,{expression:x.join(`
|
|
11
|
+
`).trim(),allowKatex:true},`math-${p}`));continue}if(su(b)){let x=Math.min(6,b.match(/^#{1,6}/)?.[0]?.length||1),v=b.replace(/^#{1,6}\s+/,""),y=x===1?"h5":x===2?"h6":"subtitle1";m.push(f(yo,{variant:y,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:da(v,f$1,`h-${p}`)},`heading-${p}`)),p+=1;continue}if(lu(b)){m.push(f(kd,{sx:{my:1.2}},`hr-${p}`)),p+=1;continue}if(cu(h,p)){let x=p+2;for(;x<h.length&&h[x].trim()&&h[x].includes("|");)x+=1;let v=h.slice(p,x).join(`
|
|
12
|
+
`),y=Hi(v);if(y){m.push(f(xl,{table:y},`table-${p}`)),p=x;continue}}if(Pl(b)){let x=[];for(;p<h.length&&Pl(h[p]);)x.push(h[p].replace(/^\s*>\s?/,"")),p+=1;m.push(f(Fr,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:f(yo,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((v,y)=>g(Fragment,{children:[y>0&&f("br",{}),da(v,f$1,`q-${p}-${y}`)]},`quote-line-${y}`))})},`quote-${p}`));continue}if(Sl(b)){let x=[];for(;p<h.length&&Sl(h[p]);)x.push(h[p].trim().replace(/^[-*+]\s+/,"")),p+=1;m.push(f(Ie,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((v,y)=>f(Ie,{component:"li",sx:{mb:.45},children:f(yo,{variant:"body2",children:da(v,f$1,`ul-${p}-${y}`)})},`ul-item-${y}`))},`ul-${p}`));continue}if(kl(b)){let x=[];for(;p<h.length&&kl(h[p]);)x.push(h[p].trim().replace(/^\d+\.\s+/,"")),p+=1;m.push(f(Ie,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((v,y)=>f(Ie,{component:"li",sx:{mb:.45},children:f(yo,{variant:"body2",children:da(v,f$1,`ol-${p}-${y}`)})},`ol-item-${y}`))},`ol-${p}`));continue}let g$1=[];for(;p<h.length;){let x=h[p],v=x.trim();if(!v||Vi(x)||su(x)||lu(x)||Sl(x)||kl(x)||Pl(x)||cu(h,p)||i&&du(x)||n&&v.startsWith("$$"))break;g$1.push(x),p+=1;}g$1.length>0?m.push(f(yo,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g$1.map((x,v)=>g(Fragment,{children:[v>0&&f("br",{}),da(x,f$1,`p-${p}-${v}`)]},`p-line-${v}`))},`p-${p}`)):p+=1;}return m},[d,n,a,i,s,c]);return f(Ie,{className:r,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:u})};var YD=(t,o)=>f(pa,{markdown:t,...o});var pu=({value:t,onChange:o,onSubmit:r,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:c=false,compact:d=false,showStatusText:u=true})=>g(se,{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(Hr,{sx:{fontSize:d?16:18,color:"text.secondary"}}),f(Dd,{fullWidth:true,value:t,onChange:m=>o(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),r());},placeholder:i,sx:{fontSize:d?"0.84rem":"0.9rem"}}),t&&a&&f(ie,{size:"small",onClick:a,children:f(wr,{sx:{fontSize:d?16:18}})}),n&&f(ie,{size:"small",onClick:n,children:f(ip,{sx:{fontSize:d?16:18}})}),f(ie,{size:"small",onClick:r,disabled:c||!t.trim(),children:f(pp,{sx:{fontSize:d?16:18}})})]}),u&&s&&f(E,{variant:"caption",color:"text.secondary",children:s})]});var uu=(t,o)=>{let r=o.trim();if(!r)return t;let n=t.toLowerCase(),a=r.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+r.length)}),t.slice(i+r.length)]})},Wi=({section:t,highlightQuery:o=""})=>{let r=t.columns||2;return g(De,{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:r===3?"repeat(3, minmax(0, 1fr))":r===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:uu(n.label,o)}),f(E,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?uu(a,o):n.value})]},n.id)})})]})};var Tl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",_i=t=>t.trim().toLowerCase(),tv=(t,o)=>{let r=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||Tl(a.value),s={source:"section",sourceId:n.id,sourceSectionId:n.id,sourceTitle:n.title,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:_i(`${n.title} ${a.label} ${i}`)});});}),o.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||Tl(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:_i(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||Tl(i.value),c={source:"tab",sourceId:n.id,sourceSectionId:a.id,sourceTitle:`${n.label} / ${a.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};r.push({hit:c,text:_i(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),r},mu=({sections:t,tabs:o=[],defaultTabId:r,ai:n})=>{let{t:a}=ce(),[i,s]=useState(""),[c,d]=useState(r||o[0]?.id),[u,m]=useState("idle"),[h,f]=useState([]),[p,b]=useState(""),[C,g]=useState(""),[x,v]=useState(false),y=useMemo(()=>tv(t,o),[t,o]);useEffect(()=>{if(o.length===0){d(void 0);return}o.some(D=>D.id===c)||d(r||o[0]?.id);},[o,c,r]);let P=useCallback(()=>{m("idle"),f([]),b(""),g("");},[]),S=useCallback(w=>{s(w),w.trim()||(m("idle"),f([]),b(""),g(""));},[]),I=useCallback(w=>{let D=_i(w);return D?y.filter(N=>N.text.includes(D)).map(N=>N.hit):[]},[y]),M=useCallback(async()=>{let w=i.trim();if(!w)return;v(true);let D=I(w);if(f(D),D.length>0){m("search"),g(""),b(a("detail.searchAi.matches",{count:D.length})),v(false);return}if(n?.enabled!==false&&n?.onSubmit){m("ai"),b(a("detail.searchAi.autoAiFallback"));try{let T=await n.onSubmit(w,{query:w,hits:D,activeTabId:c,sections:t,tabs:o});g(typeof T=="string"?T:"");}finally{v(false);}return}m("search"),g(""),b(a("detail.searchAi.noMatch")),v(false);},[i,I,a,n,c,t,o]);return {query:i,setQuery:S,activeTabId:c,setActiveTabId:d,searchMode:u,hits:h,statusText:p,aiResponse:C,searching:x,handleSubmit:M,clearResult:P}};var kA=({title:t,subtitle:o,sections:r,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:c,searchBarWidth:d=460,onClose:u,closeLabel:m="Close"})=>{let{t:h}=ce(),{query:f$1,setQuery:p,activeTabId:b,setActiveTabId:C,searchMode:g$1,hits:x,statusText:v,aiResponse:y,searching:P,handleSubmit:S,clearResult:I}=mu({sections:r,tabs:n,defaultTabId:a,ai:s}),M=useMemo(()=>n.find(N=>N.id===b)||n[0],[n,b]),w=useCallback(N=>{let T=k=>{let A=document.getElementById(N);if(A){A.scrollIntoView({behavior:"smooth",block:"center"});return}k<4&&setTimeout(()=>T(k+1),60);};requestAnimationFrame(()=>T(0));},[]),D=useCallback((N,T)=>{if(n.some(k=>k.id===N)){C(N),w(T?`detail-tab-${N}-section-${T}`:`detail-tab-${N}`);return}w(`detail-section-${N}`);},[n,C,w]);return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[g(se,{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}),o&&f(E,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:o})]}),g(se,{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(pu,{value:f$1,onChange:p,onSubmit:S,onVoiceInput:s?.onVoiceInput,onClear:()=>{p(""),I();},placeholder:s?.placeholder||h("detail.searchAi.placeholder"),statusText:v,loading:P,compact:true,showStatusText:false})}),u&&f(ct,{title:m,children:f(ie,{size:"small",onClick:u,children:f(Zd,{fontSize:"small"})})}),c]})]}),v&&f(E,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:v}),g$1==="search"&&x.length>0&&g(De,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:h("detail.searchAi.matches",{count:x.length})}),f(se,{spacing:.35,children:x.slice(0,8).map(N=>f("div",{component:"button",type:"button",onClick:()=>D(N.sourceId,N.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:N.sourceTitle})," \xB7 ",f("div",{component:"span",sx:{fontWeight:700},children:N.fieldLabel})," = ",f("div",{component:"span",children:N.fieldValue||"-"})]})},`${N.source}|${N.sourceId}|${N.fieldId}`))})]}),g$1==="ai"&&y&&g(De,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:h("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(pa,{markdown:y})})]}),f("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:r.map(N=>f("div",{id:`detail-section-${N.id}`,children:f(Wi,{section:N,highlightQuery:f$1})},N.id))}),n.length>0&&g(De,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[f(Fd,{value:M?.id||false,onChange:(N,T)=>C(String(T)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(N=>f(Bd,{value:N.id,label:N.label,sx:{textTransform:"none"}},N.id))}),g("div",{sx:{p:1.5},children:[f("div",{id:`detail-tab-${M?.id||""}`}),M?.description&&f(E,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:M.description}),M?.content?M.content:g(se,{spacing:1.5,children:[(M?.sections||[]).map(N=>f("div",{id:`detail-tab-${M?.id}-section-${N.id}`,children:f(Wi,{section:N,highlightQuery:f$1})},N.id)),M?.fields&&M.fields.length>0&&f(Wi,{section:{id:`${M.id}-fields`,title:M.label,fields:M.fields,columns:2},highlightQuery:f$1})]})]})]}),i&&f(tr,{title:i.title||h("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};var fu=({bucket:t,cardCount:o,highlighted:r=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:c,renameLabel:d,sx:u})=>{let{t:m}=ce(),[h,f$1]=useState(false),[p,b]=useState(t.title),C=()=>{b(t.title),f$1(false);},g$1=x=>{x.preventDefault();let v=p.trim();v&&(v!==t.title&&c?.(v),b(v),f$1(false));};return f(De,{elevation:0,sx:[x=>{let v=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:r?`1px solid ${tt(v,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:r?`0 0 0 2px ${tt(v,.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:v}}},...Array.isArray(u)?u:u?[u]:[]],children:g(se,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[g(Ie,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[f(Ie,{sx:{minWidth:0,flex:1},children:g(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&f(Ie,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),h?g(Ie,{component:"form",onSubmit:g$1,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[f(He,{dense:true,autoFocus:true,value:p,onChange:x=>b(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),C());},inputProps:{"aria-label":d??m("kanban.bucket.rename")},error:!p.trim(),sx:{flex:1,minWidth:0}}),f(ie,{type:"submit",size:"small",tooltip:m("kanban.bucket.saveRename"),"aria-label":m("kanban.bucket.saveRename"),disabled:!p.trim(),children:f(wo,{size:14})}),f(ie,{size:"small",tooltip:m("kanban.bucket.cancelRename"),"aria-label":m("kanban.bucket.cancelRename"),onClick:C,children:f(Kt,{size:14})})]}):f(E,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!h&&g(se,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[f(Ct,{size:"small",label:o,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&f(Ct,{size:"small",label:`${m("kanban.bucket.limit")} ${t.limit}`,color:o>t.limit?"warning":"default",variant:"outlined"}),c&&f(ie,{size:"small",tooltip:d??m("kanban.bucket.rename"),"aria-label":d??m("kanban.bucket.rename"),onClick:()=>{b(t.title),f$1(true);},sx:{width:26,height:26},children:f(Oc,{size:14})})]})]}),r&&f(E,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:m("kanban.bucket.dropHere")}),f(Ie,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:o>0?n:f(Ie,{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??m("kanban.empty")})})})]})})};var rv={success:"success",warning:"warning",info:"info",error:"error"},nv={critical:"error",high:"warning",medium:"info",low:"success"},av={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},iv=(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}},sv=t=>t?t.split(/\s+/).map(o=>o.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Il=({card:t,bucket:o,dragging:r=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=ce(),c=!!(a&&o),d=t.tone??(t.priority?nv[t.priority]:"default"),u=d==="default"?"primary":rv[d],m=av[d],h=o?{card:t,bucket:o}:void 0;return f(De,{onClick:c?()=>h&&a?.(h):void 0,onKeyDown:c?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),h&&a?.(h));}: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 ${tt(m,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:n?"var(--orb-shadow-3)":r?"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:c?"pointer":"default",opacity:r?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:m},"&:hover":c?{transform:"translateY(-1px)",borderColor:tt(m,.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(se,{spacing:1.25,children:[g(Ie,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[g(Ie,{sx:{minWidth:0,flex:1},children:[(t.kicker||o?.title)&&f(E,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??o?.title}),f(E,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&f(Ct,{size:"small",color:u,label:iv(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(Ie,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(f$1=>g(Ie,{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:f$1.label}),f(E,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:f$1.value})]},f$1.id))}),typeof t.progress=="number"&&g(Ie,{children:[g(Ie,{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(Td,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:m,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||c)&&g(se,{spacing:.9,children:[t.tags&&t.tags.length>0&&f(Ie,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(f$1=>f(Ct,{size:"small",label:f$1.label,color:f$1.color??"default",variant:"outlined"},f$1.id))}),g(Ie,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[g(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&g(e,{children:[f(oi,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??sv(t.assignee.name)}),g(Ie,{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})]}),c&&f(E,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var bu=(t,o)=>{let r=o.title.trim();return !o.id||!r||t.buckets.some(n=>n.id===o.id)?t:{buckets:[...t.buckets,{...o,title:r,cards:[]}]}},vu=(t,o,r)=>{let n=r.trim();if(!n)return t;let a=t.buckets.find(i=>i.id===o);return !a||a.title===n?t:{buckets:t.buckets.map(i=>i.id===o?{...i,title:n}:i)}},lv=(t,o)=>Number.isNaN(t)||t<0?0:t>o?o:t,yu=({buckets:t,cards:o})=>{let r=new Map;return o.forEach((n,a)=>{let i=r.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),r.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...r.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}})}},Uo=(t,o)=>{for(let r=0;r<t.buckets.length;r+=1){let n=t.buckets[r],a=n.cards.findIndex(i=>i.id===o);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:r,cardIndex:a}}},Gi=(t,o)=>{let r=Uo(t,o.cardId);if(!r)return t;let n=t.buckets.findIndex(u=>u.id===o.toBucketId);if(n<0)return t;let a=t.buckets.map(u=>({...u,cards:u.cards.map(m=>({...m}))})),i=a[r.bucketIndex],[s]=i.cards.splice(r.cardIndex,1);if(!s)return t;let c=a[n],d=lv(o.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...s,bucketId:o.toBucketId}),{buckets:a.map(u=>({...u,cards:u.cards.map((m,h)=>({...m,bucketId:u.id,position:h}))}))}};var Nl="kanban-card|",Dl="kanban-bucket|",wu=t=>`${Nl}${t}`,yv=t=>`${Dl}${t}`,Ui=t=>t?.startsWith(Nl)?t.slice(Nl.length):void 0,xu=t=>t?.startsWith(Dl)?t.slice(Dl.length):void 0,Cv=({card:t,bucket:o,onCardClick:r})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:c,isDragging:d}=useSortable({id:wu(t.id)}),u={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:n,style:u,...a,...i,children:f(Il,{card:t,bucket:o,dragging:d,onClick:r})})},xv=({bucket:t,highlighted:o,bucketHeight:r,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:c}=useDroppable({id:yv(t.id)});return f(Ie,{ref:c,sx:{minWidth:0,minHeight:0,height:r},children:f(fu,{bucket:t,cardCount:t.cards.length,highlighted:o||s,emptyLabel:n,height:r,onRename:a,children:f(SortableContext,{items:t.cards.map(d=>wu(d.id)),strategy:verticalListSortingStrategy,children:f(se,{spacing:1,children:t.cards.map(d=>f(Cv,{card:d,bucket:t,onCardClick:i},d.id))})})})})},Su=t=>String(t??"").toLocaleLowerCase(),wv=(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(n=>[n.id,n.label])??[],...t.metrics?.flatMap(n=>[n.label,n.value])??[]].some(n=>Su(n).includes(o)),jA=({model:t,onCardMove:o,onCardClick:r,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:c=320,bucketHeight:d,bucketMaxHeight:u,searchable:m=false,searchValue:h,defaultSearchValue:f$1="",onSearchValueChange:p,searchPlaceholder:b,emptyBucketLabel:C,sx:g$1})=>{let{t:x}=ce(),[v,y]=useState(null),[P,S]=useState(),[I,M]=useState(f$1),w=h??I,D=w.trim().toLocaleLowerCase(),N=d??u??560,T=useMemo(()=>({buckets:t.buckets.map(H=>{let B=n?H.cards.filter(Z=>n(Z,H)):H.cards;if(!D)return {...H,cards:B};let q=[H.id,H.title,H.description].some(Z=>Su(Z).includes(D));return {...H,cards:q?B:B.filter(Z=>wv(Z,D))}})}),[n,t,D]),k=useMemo(()=>T.buckets.reduce((H,B)=>H+B.cards.length,0),[T]),A=useCallback(H=>{h===void 0&&M(H),p?.(H);},[p,h]),L=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),W=useMemo(()=>v?Uo(t,v):void 0,[v,t]),ee=useCallback(()=>{y(null),S(void 0);},[]),O=useCallback(H=>{if(!H)return;let B=Ui(H);return B?Uo(t,B)?.bucket.id:xu(H)},[t]),_=useCallback(H=>{y(Ui(String(H.active.id))??null);},[]),V=useCallback(H=>{S(O(H.over?String(H.over.id):void 0));},[O]),Q=useCallback(H=>{let B=Ui(String(H.active.id)),q=H.over?String(H.over.id):void 0;if(!B||!q){ee();return}let Z=Uo(t,B);if(!Z){ee();return}let Y=Z.bucket.id,J=Z.cardIndex,le=Ui(q);if(le){let be=Uo(t,le);if(!be){ee();return}Y=be.bucket.id,J=be.cardIndex;}else {let be=xu(q),Ce=t.buckets.find(Be=>Be.id===be);if(!be||!Ce){ee();return}Y=be,J=Ce.cards.length;}if(Z.bucket.id===Y&&Z.cardIndex===J){ee();return}let he=Gi(t,{cardId:B,fromBucketId:Z.bucket.id,toBucketId:Y,targetIndex:J}),ze=Uo(he,B);ze&&!(ze.bucket.id===Z.bucket.id&&ze.cardIndex===Z.cardIndex)&&o?.({cardId:B,fromBucketId:Z.bucket.id,toBucketId:ze.bucket.id,targetIndex:ze.cardIndex,card:ze.card,model:he}),ee();},[t,o,ee]);return g(DndContext,{sensors:L,collisionDetection:closestCorners,onDragStart:_,onDragOver:V,onDragEnd:Q,onDragCancel:ee,children:[g(Ie,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(m||a)&&g(Ie,{role:m?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[m&&f(Ie,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:f(He,{dense:true,value:w,onChange:H=>A(H.target.value),placeholder:b??x("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:w?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:f(Vo,{size:16,"aria-hidden":"true"}),endAdornment:w?f(ie,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>A(""),sx:{width:26,height:26},children:f(Kt,{size:15})}):void 0})}),g(Ie,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[D&&f(E,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:k>0?x("kanban.search.results",{count:k}):x("kanban.search.noMatch")}),a&&f(Pe,{size:"small",variant:"secondary",startIcon:f(Jr,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),f(Ie,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${c}px, ${Math.max(c,360)}px)`,gap:1.5,gridAutoRows:N==="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(H=>f(xv,{bucket:H,highlighted:H.id===P,bucketHeight:N,emptyBucketLabel:D?x("kanban.search.noMatch"):C,onBucketRename:i?B=>i(H.id,B):void 0,onCardClick:r},H.id))})]}),f(DragOverlay,{children:W?f(Ie,{sx:{width:Math.max(c-24,260)},children:f(Il,{card:W.card,bucket:W.bucket,overlay:true})}):null})]})};var Pv=({initialModel:t,initialBuckets:o,initialCards:r})=>t||yu({buckets:o??[],cards:r??[]}),rE=t=>{let{onCardMove:o,onCardClick:r}=t,[n,a]=useState(()=>Pv(t)),i=useCallback(f=>{a(p=>typeof f=="function"?f(p):f);},[]),s=useCallback(f=>Uo(n,f),[n]),c=useCallback((f,p,b)=>{let C=Uo(n,f);if(!C)return;let g=Gi(n,{cardId:f,fromBucketId:C.bucket.id,toBucketId:p,targetIndex:b}),x=Uo(g,f);if(!x||x.bucket.id===C.bucket.id&&x.cardIndex===C.cardIndex)return;a(g);let v={cardId:f,fromBucketId:C.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return o?.(v),v},[n,o]),d=useCallback((f,p)=>{a(b=>({buckets:b.buckets.map(C=>({...C,cards:C.cards.map(g=>g.id!==f?g:typeof p=="function"?p(g):{...g,...p})}))}));},[]),u=useCallback(f=>{let p=bu(n,f);return p===n?false:(a(p),true)},[n]),m=useCallback((f,p)=>{let b=vu(n,f,p);return b===n?false:(a(b),true)},[n]),h=useMemo(()=>({model:n,onCardMove:f=>{c(f.cardId,f.toBucketId,f.targetIndex);},onCardClick:r}),[n,c,r]);return {model:n,actions:{replaceModel:i,moveCard:c,updateCard:d,addBucket:u,renameBucket:m,getCard:s},boardProps:h}};function xn({onTextUpdate:t,onComplete:o,onError:r,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,c]=useState(false),d=useRef(null),u=useRef(null),m=useRef(null),h=useRef(null),f=useRef(null),p=useRef(0),b=useRef(false),C=useRef(false),g=useCallback(()=>{d.current&&(d.current.close(),d.current=null),h.current&&(h.current.disconnect(),h.current=null),f.current&&(f.current.disconnect(),f.current=null),u.current&&(u.current.getTracks().forEach(y=>y.stop()),u.current=null),m.current&&(m.current.close(),m.current=null),C.current=false,c(false);},[]),x=useCallback(()=>{b.current||(b.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),v=useCallback(async()=>{if(!(s||C.current)){C.current=true,b.current=false,p.current=Date.now();try{let y=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});u.current=y;let P=new WebSocket(n);d.current=P,P.onopen=()=>{c(!0),C.current=!1;},P.onmessage=D=>{try{let N=JSON.parse(D.data);if(N.type==="recognition")N.is_final?o(N.text):t?.(N.text);else if(N.type==="error"){let T=N.message||"Voice recognition error";r?.(T),x();}}catch{r?.("Failed to parse voice message");}},P.onerror=()=>{r?.("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 I=new S({sampleRate:16e3});m.current=I;let M=I.createMediaStreamSource(y);f.current=M;let w=I.createScriptProcessor(4096,1,1);h.current=w,w.onaudioprocess=D=>{if(d.current?.readyState!==WebSocket.OPEN)return;let N=D.inputBuffer.getChannelData(0),T=0;for(let L=0;L<N.length;L+=1)T+=N[L]*N[L];if(Math.sqrt(T/N.length)>i)p.current=Date.now();else if(Date.now()-p.current>a&&!b.current){x();return}let A=new Int16Array(N.length);for(let L=0;L<N.length;L+=1){let W=Math.max(-1,Math.min(1,N[L]));A[L]=W<0?W*32768:W*32767;}d.current.send(A.buffer);},M.connect(w),w.connect(I.destination);}catch{r?.("Cannot access microphone"),g();}}},[g,s,i,o,r,t,a,x,n]);return useEffect(()=>g,[g]),{isRecording:s,startRecording:v,stopRecording:x}}var Rv=["en","zh","fr","de","ja","ko"],Pu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},El=({searchPlaceholder:t,onSearch:o,onSearchAdd:r,onOpenPanel:n,panelOpen:a=false,maxWidth:i=540,sx:s})=>{let{t:c}=ce(),[d,u]=useState(""),m=useCallback((x=d)=>{let v=x.trim();v&&(u(""),o?.(v));},[o,d]),h=x=>{x.preventDefault(),m();},{isRecording:f$1,startRecording:p,stopRecording:b}=xn({onTextUpdate:u,onComplete:x=>{u(x),m(x);},onError:x=>{console.error("Header voice input error:",x);}}),C=useCallback(async()=>{if(f$1){b();return}await p();},[f$1,p,b]),g$1=t||c("header.searchPlaceholder");return f("form",{className:"orb-app-header-search",onSubmit:h,style:{width:"100%",maxWidth:typeof i=="number"?`${i}px`:i,...s},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(ie,{className:"orb-app-header-ai-action",size:"small",onClick:r,tooltip:c("header.searchAddFeature"),children:f(Pt,{name:"add",size:16})})}),f("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:d,onChange:x=>u(x.target.value),placeholder:g$1,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),g("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[n&&!a&&f(ie,{className:"orb-app-header-ai-action",size:"small","aria-label":c("header.searchOpenPanel"),tooltip:c("header.searchOpenPanel"),onClick:n,children:f(Pt,{name:"message",size:16})}),f(ie,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{C();},tooltip:c(f$1?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:f$1?"var(--orb-err)":void 0},children:f(Pt,{name:"microphone",size:16})})]})]})})},Ki=({appTitle:t,logo:o,onToggleMode:r,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:c,showSearch:d=false,onSearch:u,onSearchAdd:m,onOpenPanel:h,panelOpen:f$1,user:p,onUserRefresh:b,onUserSetting:C,onUserLogout:g$1,userMenuItems:x,leftSlot:v,rightSlot:y})=>{let{t:P,locale:S}=ce(),I=ho(),M=n||S,w=a||Pu[M],D=i||Rv,N=I==="dark"?f(qc,{size:15}):f(Qc,{size:15}),T=P(I==="dark"?"header.theme.dark":"header.theme.light"),k=[...b?[{key:"refresh",label:P("header.menu.refresh"),icon:f(Wa,{size:15}),onClick:b}]:[],...C?[{key:"settings",label:P("header.menu.setting"),icon:f(en,{size:16}),onClick:C}]:[],...g$1?[{key:"logout",label:P("header.menu.logout"),icon:f(_c,{size:16}),onClick:g$1}]:[]],A=x||k,L=D.map(W=>({label:Pu[W],onClick:()=>{s?.(W),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:W===M}));return g("header",{className:"orb-app-header",children:[g("div",{className:"orb-app-header-brand",children:[v,o===null?null:o||f("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:f(Pt,{name:"product",size:20})}),t&&f(E,{variant:"h4",sx:{fontWeight:700},children:t})]}),f("div",{className:"orb-app-header-center",children:d&&f(El,{searchPlaceholder:c,onSearch:u,onSearchAdd:m,onOpenPanel:h,panelOpen:f$1})}),g("div",{className:"orb-app-header-actions",children:[g("div",{className:"orb-app-header-utilities",children:[s?f(Qt,{triggerLabel:w,trigger:g("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[f(zn,{size:15}),f("span",{className:"orb-label",children:w})]}),items:L,align:"end"}):g("div",{className:"orb-app-header-locale","aria-label":w,children:[f(zn,{size:15}),f("span",{className:"orb-label",children:w})]}),f(ie,{className:"orb-app-header-theme",size:"small",onClick:r,tooltip:T,children:N})]}),p&&f("span",{className:"orb-app-header-divider","aria-hidden":"true"}),p&&f(Qt,{triggerLabel:p.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:p.name}),p.subtitle&&f(E,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:p.subtitle,children:p.subtitle})]}),f(tn,{src:p.avatarSrc,alt:p.name,size:32,children:p.avatarText||p.name.slice(0,1).toUpperCase()})]}),items:A.map(W=>({label:W.label,onClick:W.onClick,disabled:W.disabled,icon:W.icon})),align:"end"}),y]})]})};var Tu=({menuData:t=[],initialNavigationCollapsed:o=false,initialNavigationMode:r="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:c,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:u}=yd({initialCollapsed:o,initialDisplayMode:r,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:c,pinnedSectionTitle:d}),[m,h]=useState(900);useEffect(()=>{let p=()=>h(window.innerHeight);return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);let f=useMemo(()=>Math.max(280,m-100),[m]);return {navigationIslandProps:u,navigationMaxHeight:f}};var Fo=12,Mu=56,Ru=234,Lv="orbcafe:page-layout-locale",Nu=["en","zh","fr","de","ja","ko"],Ov=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",qi=(t,o)=>`orbcafe:page-layout:${Ov(t)}:${o}`,Fv=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,Bv=t=>t==="system"?"dark":t==="dark"?"light":"system",Xi=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),Hv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,TE=({appId:t,appTitle:o,menuData:r=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:c,onLocaleChange:d,mode:u,defaultMode:m="system",onModeChange:h,user:f$1,onUserRefresh:p,onUserSetting:b,onUserLogout:C,userMenuItems:g$1,logo:x,searchPlaceholder:v,searchPlacement:y="hidden",floatingSearchSx:P,onSearch:S,onSearchAdd:I,onOpenPanel:M,panelOpen:w,rightHeaderSlot:D,leftHeaderSlot:N,contentSx:T,navigationVariant:k="classic",navigationMode:A,defaultNavigationMode:L="fixed",onNavigationModeChange:W,showNavigationModeToggle:ee=true,enableNavigationPinning:O=true,navigationPinStorageKey:_,pinnedNavigationItemIds:V,defaultPinnedNavigationItemIds:Q,onPinnedNavigationItemIdsChange:H,pinnedNavigationSectionTitle:B})=>{let q=t?qi(t,"mode"):"orbcafe:page-layout-mode",Z=t?qi(t,"locale"):Lv,Y=t?qi(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[J,le]=useState(m),[he,ze]=useState("light"),[be,Ce]=useState(false),[Be,de]=useState(i),[ve,We]=useState(false),[et,nt]=useState(false),[it,U]=useState(L),[Re,we]=useState({x:Fo,y:Fo}),[Oe,at]=useState("left"),[Ze,xt]=useState(false),It=useRef(null),Ot=useRef(null),At=u!==void 0,re=u??J,Ge=d!==void 0,Le=Ge?i:Be,pe=c?.join("|")??"",xe=A!==void 0,oe=A??it,ye=oe==="floating",Ne=k==="v2"?tl:md,je=y==="header",st=re==="system"?be?he:"light":re;useEffect(()=>{if(!At)try{let fe=window.localStorage.getItem(q);(fe==="light"||fe==="dark"||fe==="system")&&le(fe);}catch{}Ce(true);let z=window.matchMedia("(prefers-color-scheme: dark)"),X=()=>{ze(z.matches?"dark":"light");};return X(),z.addEventListener("change",X),()=>z.removeEventListener("change",X)},[At,q]),useEffect(()=>{if(!(At||!be))try{window.localStorage.setItem(q,re);}catch{}},[be,At,re,q]),useEffect(()=>{if(Ge){We(true);return}try{let z=window.localStorage.getItem(Z),X=c??Nu;z&&Nu.includes(z)&&X.includes(z)&&de(z);}catch{}finally{We(true);}},[Ge,pe,Z]),useEffect(()=>{if(!(Ge||!ve))try{window.localStorage.setItem(Z,Le);}catch{}},[Le,Ge,ve,Z]),useEffect(()=>{if(xe){nt(true);return}try{let z=window.localStorage.getItem(Y);(z==="fixed"||z==="floating")&&U(z);}catch{}finally{nt(true);}},[xe]),useEffect(()=>{if(et)try{window.localStorage.setItem(Y,oe);}catch{}},[oe,et]),useEffect(()=>{st==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[st]);let pt=useCallback(z=>{xe||U(z),W?.(z);},[xe,W]),Bt=useCallback(z=>{At||le(z),h?.(z);},[At,h]),Xt=useCallback(z=>{Ge||de(z),d?.(z);},[Ge,d]),{navigationIslandProps:Vt,navigationMaxHeight:wt}=Tu({menuData:r,initialNavigationCollapsed:false,initialNavigationMode:oe,enableNavigationPinning:O,navigationPinStorageKey:_??(t?qi(t,"pinned-navigation-items"):Fv(o)),pinnedNavigationItemIds:V,defaultPinnedNavigationItemIds:Q,onPinnedNavigationItemIdsChange:H,pinnedNavigationSectionTitle:B}),Wt=Vt.collapsed,ft=useCallback(z=>{let X=It.current,fe=X?.parentElement;if(!X||!fe)return z;let Se=fe.getBoundingClientRect(),Ae=X.getBoundingClientRect(),$e=Fo,Ke=Fo,Ye=Math.max($e,Se.width-Ae.width-Fo),ut=Math.max(Ke,Se.height-Ae.height-Fo);return {x:Xi(z.x,$e,Ye),y:Xi(z.y,Ke,ut)}},[]),Dt=useCallback(z=>{let X=It.current,fe=X?.parentElement;if(!X||!fe)return z;let Se=fe.getBoundingClientRect(),Ae=X.getBoundingClientRect(),$e=Fo,Ke=Fo,Ye=Math.max($e,Se.width-Ae.width-Fo),ut=Math.max(Ke,Se.height-Ae.height-Fo),gt={x:Xi(z.x,$e,Ye),y:Xi(z.y,Ke,ut)},bt=[{distance:Math.abs(gt.x-$e),position:{x:$e,y:gt.y}},{distance:Math.abs(gt.x-Ye),position:{x:Ye,y:gt.y}},{distance:Math.abs(gt.y-Ke),position:{x:gt.x,y:Ke}},{distance:Math.abs(gt.y-ut),position:{x:gt.x,y:ut}}].reduce((F,j)=>j.distance<F.distance?j:F).position;return at(bt.x>=($e+Ye)/2?"right":"left"),bt},[]),lt=useMemo(()=>{if(!ye||Ze)return Re.x;if(Oe==="right"){let fe=It.current?.parentElement?.getBoundingClientRect().width,Se=Wt?Mu:Ru;return fe?Math.max(Fo,fe-Se-Fo):Wt?Re.x:Re.x-(Ru-Mu)}return Re.x},[Oe,Re.x,Ze,ye,Wt]),Ft=useCallback(z=>{if(!ye||!Wt||Hv(z.target))return;z.preventDefault(),z.currentTarget.setPointerCapture(z.pointerId);let X=ft({x:lt,y:Re.y});at("left"),we(X),Ot.current={pointerId:z.pointerId,startClientX:z.clientX,startClientY:z.clientY,startX:X.x,startY:X.y,currentX:X.x,currentY:X.y},xt(true);},[ft,lt,Re.y,ye,Wt]),Zt=useCallback(z=>{let X=Ot.current;if(!X||X.pointerId!==z.pointerId)return;let fe=ft({x:X.startX+z.clientX-X.startClientX,y:X.startY+z.clientY-X.startClientY});X.currentX=fe.x,X.currentY=fe.y,we(fe);},[ft]),K=useCallback(z=>{let X=Ot.current;if(!(!X||X.pointerId!==z.pointerId)){try{z.currentTarget.releasePointerCapture(z.pointerId);}catch{}Ot.current=null,we(Dt({x:X.currentX,y:X.currentY})),xt(false);}},[Dt]);return useEffect(()=>{if(!ye)return;let z=()=>{we(Se=>ft(Se));},X=window.requestAnimationFrame(z),fe=window.setTimeout(z,430);return ()=>{window.cancelAnimationFrame(X),window.clearTimeout(fe);}},[ft,ye,Wt,wt]),f(On,{mode:re,children:f(Xa,{locale:Le,children:g("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[f(Ki,{appTitle:o,logo:x,mode:re,onToggleMode:()=>Bt(Bv(re)),locale:Le,localeLabel:Ge||Le===i?s:void 0,localeOptions:c,onLocaleChange:Xt,user:f$1,onUserRefresh:p,onUserSetting:b,onUserLogout:C,userMenuItems:g$1,searchPlaceholder:v,showSearch:je,onSearch:S,onSearchAdd:I,onOpenPanel:M,panelOpen:w,leftSlot:N,rightSlot:D}),y==="floating"&&f("div",{className:"orb-float-search",style:P,children:f(El,{searchPlaceholder:v,onSearch:S,onSearchAdd:I,onOpenPanel:M,panelOpen:w,maxWidth:"100%"})}),g("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!ye&&f("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:Wt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:f(Ne,{...Vt,maxHeight:wt,colorMode:st,displayMode:oe,onDisplayModeChange:pt,showDisplayModeToggle:ee&&Wt})}),a&&ye&&f("div",{ref:It,onPointerDown:Ft,onPointerMove:Zt,onPointerUp:K,onPointerCancel:K,style:{position:"absolute",top:Re.y,left:lt,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:Wt?Ze?"grabbing":"grab":"default",touchAction:Wt?"none":"auto",userSelect:Ze?"none":void 0,transition:Ze?"none":"left 180ms ease-out, top 180ms ease-out"},children:f(Ne,{...Vt,maxHeight:wt,colorMode:st,displayMode:oe,onDisplayModeChange:pt,showDisplayModeToggle:ee&&Wt})}),f("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!ye&&Wt?4:12,...T},children:n})]})]})})})};var Zi="(blank)",Du="Result",Au="Grand Total",Eu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Lu=["sum","count","avg","min","max"];var Ou=["palette","rows","columns","filters","values"];var Fu=t=>Ou.includes(t),Bu=t=>t==="rows"||t==="columns"||t==="filters",Yi=t=>{let o=t.split("|");return o.length===2&&o[0]==="container"&&Fu(o[1])?{kind:"container",zone:o[1]}:o.length===3&&o[0]==="item"&&Fu(o[1])&&o[2]?{kind:"item",zone:o[1],key:o[2]}:null},pr=t=>t==null||t===""?Zi:t instanceof Date?t.toISOString().slice(0,10):String(t),$r=t=>JSON.stringify(t),Hu=(t,o)=>{let r=t.join(""),n=o.join("");return r.localeCompare(n,void 0,{sensitivity:"base"})},zv=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},wn=(t,o,r)=>{if(r==="count")return t.length;let n=t.map(a=>zv(a[o])).filter(a=>a!==null);return n.length===0?0:r==="sum"?n.reduce((a,i)=>a+i,0):r==="avg"?n.reduce((a,i)=>a+i,0)/n.length:r==="min"?Math.min(...n):Math.max(...n)},so=(t,o)=>{if(!t||t.length===0)return [];let r=new Set,n=[];return t.forEach(a=>{!o.has(a)||r.has(a)||(r.add(a),n.push(a));}),n},ur=(t,o)=>t.length!==o.length?false:t.every((r,n)=>r===o[n]),zu=(t,o)=>{let r=Object.keys(t),n=Object.keys(o);return r.length!==n.length?false:r.every(a=>{let i=t[a]??[],s=o[a]??[];return ur(i,s)})},Qi=(t,o)=>t.length!==o.length?false:t.every((r,n)=>{let a=o[n];return r.tokenId===a.tokenId&&r.fieldId===a.fieldId&&r.aggregation===a.aggregation}),Ll=t=>!t?.aggregations||t.aggregations.length===0?Lu:t.aggregations,Co=(t,o)=>{let r=Ll(o);return t&&r.includes(t)?t:o?.type==="number"&&r.includes("sum")?"sum":r.includes("count")?"count":r[0]},ua=(t,o,r)=>{let n=r.get(o.fieldId);return n?.formatValue?n.formatValue(t):o.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var Wu=({options:t,selectedValues:o,onChange:r,minWidth:n=96})=>{let{t:a}=ce(),[i,s]=useState(""),[c,d]=useState(null),u=useMemo(()=>{let p=i.trim().toLowerCase();return p?t.filter(b=>b.toLowerCase().includes(p)):t},[t,i]),m=t.length>0&&o.length===t.length,h=t.length===0?a("pivot.filter.na"):o.length===0?a("common.none"):m?a("common.all"):`${o.length}/${t.length}`,f$1=p=>{r(o.includes(p)?o.filter(b=>b!==p):[...o,p]);};return g("div",{sx:{minWidth:n},onClick:p=>p.stopPropagation(),onMouseDown:p=>p.stopPropagation(),children:[f(Pe,{variant:"outlined",size:"small",onClick:p=>d(p.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:h}),f(Qt,{anchorEl:c,open:!!c,onClose:()=>d(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:g("div",{onClick:p=>p.stopPropagation(),sx:{display:"grid",gap:.4},children:[f(He,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:p=>s(p.target.value),onKeyDown:p=>p.stopPropagation(),onClick:p=>p.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(Pe,{variant:"text",size:"small",onClick:p=>{p.preventDefault(),p.stopPropagation(),r(m?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(m?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),u.length===0&&f("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),u.map(p=>{let b=o.includes(p);return g("div",{role:"option","aria-selected":b,tabIndex:0,className:`orb-menu-item ${b?"orb-selected":""}`,onClick:()=>f$1(p),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),f$1(p));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[f(Tt,{size:"small",checked:b,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),f("span",{children:p})]},p)})]})})]})};var Sn=({size:t=18,subtle:o=false})=>{let r=Math.max(2,Math.round(t/6));return f(Ie,{"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},(n,a)=>f(Ie,{sx:{width:r,height:r,borderRadius:999,bgcolor:"currentColor"}},a))})};var Ol=({label:t,subtitle:o,isDragging:r,dragRef:n,listeners:a,attributes:i,style:s})=>f(De,{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: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(Sn,{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}),o&&f(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]})]})}),$u=({id:t,label:o,subtitle:r})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=useDraggable({id:t});return f(Ol,{label:o,subtitle:r,isDragging:s,dragRef:n,listeners:a,attributes:i})};var kn=({zone:t,title:o,hint:r,icon:n,children:a,itemCount:i,onClear:s})=>{let c=`container|${t}`,{isOver:d,setNodeRef:u}=useDroppable({id:c}),{t:m}=ce();return g(De,{ref:u,sx:h=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:d?"var(--orb-primary)":"var(--orb-p200)",bgcolor:d?"var(--orb-p100)":h.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:o}),g(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&f(ct,{title:m("pivot.clearArea"),children:f(ie,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:f(np,{size:13})})})]}),f(E,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:r}),f("div",{sx:{flex:1},children:a})]})};var _u={xs:1.2,md:1.6},Pn=({title:t,subtitle:o,collapsed:r,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:c,unmountOnExit:d=false,headerActions:u})=>g(De,{sx:m=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${m.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[g("div",{sx:m=>({px:_u,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:r?"none":`1px solid ${m.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:o})]}),g("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[u,f(ie,{size:"small","aria-label":r?a:i,onClick:n,sx:m=>({border:`1px solid ${m.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(ci,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:r?"rotate(180deg)":"rotate(0deg)"}})})]})]}),f(rn,{in:!r,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:f("div",{sx:[{px:_u,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:s})})]});var ji=({label:t,caption:o,onRemove:r,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:c,style:d})=>f(De,{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",{...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(Sn,{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}),o&&f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]}),n,r&&f(ie,{size:"small",onClick:u=>{u.stopPropagation(),r();},sx:{width:24,height:24,p:0},children:f(wr,{size:13})})]})}),ma=({id:t,label:o,caption:r,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:c,transform:d,transition:u,isDragging:m}=useSortable({id:t}),h={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:u,zIndex:m?999:"auto"};return f(ji,{label:o,caption:r,onRemove:n,trailing:a,isDragging:m,dragRef:i,listeners:c,attributes:s,style:h})};var ts={rows:f(bp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:f(sn,{size:16,sx:{color:"var(--orb-primary)"}}),filters:f(ep,{size:16,sx:{color:"var(--orb-primary)"}}),values:f(an,{size:16,sx:{color:"var(--orb-accent)"}})},Gu=({isConfiguratorCollapsed:t,onToggleCollapse:o,availableFields:r,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:c,clearZone:d,removeFieldFromZone:u,getFilterSelectionSummary:m,renderDimensionFilterSelect:h,renderAggregationSelect:f$1,getAggregationLabel:p})=>{let{t:b}=ce(),C=[`${b("pivot.zone.rows")} ${s.length}`,`${b("pivot.zone.columns")} ${i.length}`,`${b("pivot.zone.filters")} ${a.length}`,`${b("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return f(Pn,{title:b("pivot.config.title"),subtitle:C,collapsed:t,onToggleCollapse:o,expandAriaLabel:b("pivot.collapse.ariaExpand"),collapseAriaLabel:b("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[f(kn,{zone:"palette",title:b("pivot.fieldList"),hint:b("pivot.availableDimensions"),itemCount:r.length,icon:f(Sn,{size:18,subtle:true}),children:g(se,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[r.length===0&&f(E,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:b("pivot.allFieldsInUse")}),r.map(g=>f($u,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),g(se,{spacing:2,children:[g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(kn,{zone:"filters",title:b("pivot.zone.filters"),hint:b("pivot.hint.filters"),icon:ts.filters,itemCount:a.length,onClear:()=>d("filters"),children:f(SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:verticalListSortingStrategy,children:f(se,{spacing:.7,children:a.map(g=>f(ma,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:m(g),trailing:h(g),onRemove:()=>u("filters",g)},g))})})}),f(kn,{zone:"columns",title:b("pivot.zone.columns"),hint:b("pivot.hint.columns"),icon:ts.columns,itemCount:i.length,onClear:()=>d("columns"),children:f(SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:verticalListSortingStrategy,children:f(se,{spacing:.7,children:i.map(g=>f(ma,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:h(g),onRemove:()=>u("columns",g)},g))})})})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(kn,{zone:"rows",title:b("pivot.zone.rows"),hint:b("pivot.hint.rows"),icon:ts.rows,itemCount:s.length,onClear:()=>d("rows"),children:f(SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:verticalListSortingStrategy,children:f(se,{spacing:.7,children:s.map(g=>f(ma,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:h(g),onRemove:()=>u("rows",g)},g))})})}),f(kn,{zone:"values",title:b("pivot.zone.values"),hint:b("pivot.hint.values"),icon:ts.values,itemCount:c.length,onClear:()=>d("values"),children:f(SortableContext,{items:c.map(g=>`item|values|${g.tokenId}`),strategy:verticalListSortingStrategy,children:f(se,{spacing:.7,children:c.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,v=`${p(g.aggregation)}(${x})`;return f(ma,{id:`item|values|${g.tokenId}`,label:x,caption:v,trailing:f$1(g),onRemove:()=>u("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};var Uu=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Ku=({data:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=io();if(t.length===0)return null;let s=720,c=250,d={top:20,right:24,bottom:40,left:52},u=r?t.map(g=>g.primaryValue):t.map((g,x)=>x+1),m=r?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),h=Math.max(...u,1),f$1=Math.max(...m,1),p=s-d.left-d.right,b=c-d.top-d.bottom,C=t.map((g,x)=>{let v=r?g.primaryValue:x+1,y=r?g.secondaryValue??0:g.primaryValue,P=d.left+v/h*p,S=c-d.bottom-y/f$1*b;return {...g,x:P,y:S,rawX:v,rawY:y}});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:Lo(i.palette.text.secondary,.35)}),f("line",{x1:d.left,y1:d.top,x2:d.left,y2:c-d.bottom,stroke:Lo(i.palette.text.secondary,.35)}),C.map(g$1=>g("g",{children:[f("circle",{cx:g$1.x,cy:g$1.y,r:7,fill:Lo(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
13
|
`,r?`${o}: ${n(g$1.primaryValue)}`:`${o}: ${n(g$1.primaryValue)}`,r?`
|
|
14
|
-
${r}: ${(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:
|
|
15
|
-
`,r,": ",a(
|
|
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:y=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Ao(y.palette.divider,.7)}`,bgcolor:Ao(y.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 _u=(t,o,r)=>{let n=new Set,a=[];return t.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:r.get(i)?.label??i,zone:"rows"}));}),o.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:r.get(i)?.label??i,zone:"columns"}));}),a},Gu=(t,o,r)=>t.map(n=>{let a=o.get(n.fieldId),i=a?.label??n.fieldId;return {fieldId:n.fieldId,label:`${r(n.aggregation)} \xB7 ${i}`,item:n,field:a}}),Uu=({rows:t,dimensionFieldId:o,primaryValue:r,secondaryValue:n})=>{if(!o)return [];let a=new Map;return t.forEach(i=>{let s=dr(i[o]),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:xn(s,r.fieldId,r.aggregation),secondaryValue:n?xn(s,n.fieldId,n.aggregation):void 0}))};var Ku=({rows:t,fieldMap:o,rowFields:r,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:l,chartType:d,isCollapsed:u,onChartDimensionFieldIdChange:m,onChartPrimaryValueFieldIdChange:h,onChartSecondaryValueFieldIdChange:f$1,onChartTypeChange:p,onToggleCollapse:v,getAggregationLabel:C})=>{let{t:g$1}=se(),x=useMemo(()=>_u(r,n,o),[n,o,r]),b=useMemo(()=>Gu(a,o,C),[o,C,a]),y=b.find(T=>T.fieldId===s)??b[0],k=b.find(T=>T.fieldId===l&&T.fieldId!==y?.fieldId)??null,S=x.find(T=>T.fieldId===i)??x[0],P=S&&y?g$1("pivot.chart.subtitleReady",{dimension:S.label,measure:k?`${y.label} / ${k.label}`:y.label}):g$1("pivot.chart.subtitle"),I=useMemo(()=>!S||!y?[]:Uu({rows:t,dimensionFieldId:S.fieldId,primaryValue:y.item,secondaryValue:k?.item}),[y,t,k,S]),w=T=>y?ca(T,y.item,o):T.toLocaleString(),M=T=>k?ca(T,k.item,o):T.toLocaleString(),N=x.length>1||b.length>1;return g(kn,{title:g$1("pivot.chart.title"),subtitle:P,collapsed:u,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:[N&&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(vr,{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(Ht,{value:S?.fieldId??"",onChange:T=>m(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(vr,{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(Ht,{value:y?.fieldId??"",onChange:T=>h(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(vr,{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(Ht,{value:k?.fieldId??"",onChange:T=>f$1(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!==y?.fieldId).map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))]})]}),g(vr,{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(Ht,{value:d,onChange:T=>p(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?y?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(Wu,{data:I,primaryLabel:y.label,secondaryLabel:k?.label,formatPrimaryValue:w,formatSecondaryValue:M}):f($u,{data:I,chartType:d,primaryLabel:y.label,secondaryLabel:k?.label,formatPrimaryValue:w,formatSecondaryValue:M}):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 Qi=({node:t,dataColumns:o,fieldMap:r,level:n,expandedKeys:a,onToggle:i,getValue:s})=>{let l=a.has(t.key),d=t.children.length>0,u=t.isGrandTotal,m=d&&!l&&!u,h=u?800:m?700:d?600:500,f$1=u?800:m?600:500;return g(e,{children:[g("tr",{sx:{bgcolor:u?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:u?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:h},sx:p=>({fontSize:"0.76rem",borderBottom:`1px solid ${p.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!u&&f(ae,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:l?f(Vo,{size:12}):f(wr,{size:12})}),!d&&!u&&n>0&&f("div",{sx:{width:18}}),t.value]}),o.map(p=>f("td",{align:"right",style:{fontWeight:f$1},sx:{fontSize:"0.76rem",borderBottom:v=>`1px solid ${v.palette.divider}`,whiteSpace:"nowrap"},children:ca(s?s(t,p.id):t.aggregatedValues[p.id]??0,p.valueItem,r)},`${t.key}-${p.id}`))]}),l&&t.children.map(p=>f(Qi,{node:p,dataColumns:o,fieldMap:r,level:n+1,expandedKeys:a,onToggle:i,getValue:s},p.key))]})};var Il=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},Ji=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",Ml=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",Xu=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children.length>0&&(o.add(a.key),r(a.children));});};return r(t),o},Zu=(t,o,r=0)=>t.length===0?r:t.reduce((n,a)=>a.children.length===0||!o.has(a.key)?Math.max(n,r+1):Math.max(n,Zu(a.children,o,r+1)),r),Bv=(t,o)=>{let r=[],n=a=>{a.forEach(i=>{if(i.children.length>0&&o.has(i.key)){n(i.children);return}r.push(i);});};return n(t),r},UL=({title:t,rows:o,fields:r,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:l=false,initialTableCollapsed:d=false,model:u,enablePresetManagement:m=false,presets:h,defaultPresets:f$1,onPresetsChange:p,initialPresetId:v,onPresetApplied:C})=>{let{t:g$1}=se(),x=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),b$1=useRef(0),y=useRef(false),k=t??g$1("pivot.title.default"),S=i??g$1("pivot.empty"),P=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(D=>P[D]??Mu[D],[P]),w=useMemo(()=>new Set(r.map(D=>D.id)),[r]),M=useMemo(()=>new Map(r.map(D=>[D.id,D])),[r]),[N,T]=useState(()=>io(n?.rows,w)),[R,A]=useState(()=>io(n?.columns,w)),[L,$]=useState(()=>io(n?.filters,w)),[j,O]=useState(()=>{let D=n?.values??[],_=new Set,U=[];return D.forEach(de=>{if(!w.has(de.fieldId)||_.has(de.fieldId))return;_.add(de.fieldId),b$1.current+=1;let Fe=M.get(de.fieldId);U.push({tokenId:`v${b$1.current}`,fieldId:de.fieldId,aggregation:vo(de.aggregation,Fe)});}),U}),[z,H]=useState({}),[q,V]=useState(true),[B,G]=useState(false),[X,pe]=useState(()=>Il(io(n?.rows,w),io(n?.columns,w),a?.dimensionFieldId)),[oe,me]=useState(()=>{let D=(n?.values??[]).filter((_,U,de)=>w.has(_.fieldId)&&de.findIndex(Fe=>Fe.fieldId===_.fieldId)===U).map(_=>({tokenId:_.fieldId,fieldId:_.fieldId,aggregation:vo(_.aggregation,M.get(_.fieldId))}));return Ji(D,a?.primaryValueFieldId)}),[xe,ze]=useState(()=>{let D=(n?.values??[]).filter((U,de,Fe)=>w.has(U.fieldId)&&Fe.findIndex(ot=>ot.fieldId===U.fieldId)===de).map(U=>({tokenId:U.fieldId,fieldId:U.fieldId,aggregation:vo(U.aggregation,M.get(U.fieldId))})),_=Ji(D,a?.primaryValueFieldId);return Ml(D,_,a?.secondaryValueFieldId)}),[Pe,Te]=useState(a?.chartType??"bar-vertical"),[Be,le]=useState(l),[fe,Ve]=useState(d),[et,rt]=useState(()=>f$1??[]),[at,K]=useState(""),[Re,ye]=useState(false),[Oe,nt]=useState(""),[Ze,xt]=useState(null),[It,Lt]=useState(new Set(["__grand_total__"])),[Nt,te]=useState(new Set),Ge=u?.rowFields??N,Le=u?.columnFields??R,ce=u?.filterFields??L,ve=u?.valueFields??j,ee=u?.filterSelections??z,be=u?.showGrandTotal??q,De=u?.isConfiguratorCollapsed??B,je=u?.chartDimensionFieldId??X,it=u?.chartPrimaryValueFieldId??oe,dt=u?.chartSecondaryValueFieldId??xe,Ft=u?.chartType??Pe,qt=u?.isChartCollapsed??Be,zt=u?.isTableCollapsed??fe,wt=h??et,Vt=m||wt.length>0||!!p,ft=useCallback(D=>{if(u?.setRowFields){u.setRowFields(D);return}T(D);},[u]),Dt=useCallback(D=>{if(u?.setColumnFields){u.setColumnFields(D);return}A(D);},[u]),st=useCallback(D=>{if(u?.setFilterFields){u.setFilterFields(D);return}$(D);},[u]),Ot=useCallback(D=>{if(u?.setValueFields){u.setValueFields(D);return}O(D);},[u]),Xt=useCallback(D=>{if(u?.setFilterSelections){u.setFilterSelections(D);return}H(D);},[u]),Z=useCallback(D=>{if(u?.setShowGrandTotal){u.setShowGrandTotal(D);return}V(D);},[u]),W=useCallback(D=>{if(u?.setIsConfiguratorCollapsed){u.setIsConfiguratorCollapsed(D);return}G(D);},[u]),Y=useCallback(D=>{if(u?.setChartDimensionFieldId){u.setChartDimensionFieldId(D);return}pe(D);},[u]),he=useCallback(D=>{if(u?.setChartPrimaryValueFieldId){u.setChartPrimaryValueFieldId(D);return}me(D);},[u]),Ce=useCallback(D=>{if(u?.setChartSecondaryValueFieldId){u.setChartSecondaryValueFieldId(D);return}ze(D);},[u]),Ae=useCallback(D=>{if(u?.setChartType){u.setChartType(D);return}Te(D);},[u]),$e=useCallback(D=>{if(u?.setIsChartCollapsed){u.setIsChartCollapsed(D);return}le(D);},[u]),Ke=useCallback(D=>{if(u?.setIsTableCollapsed){u.setIsTableCollapsed(D);return}Ve(D);},[u]),Ye=useCallback(D=>{let _=typeof D=="function"?D(wt):D;h||rt(_),p?.(_);},[p,wt,h]),ut=useMemo(()=>new Set([...Ge,...Le,...ce]),[Ge,Le,ce]),gt=useMemo(()=>r.filter(D=>!ut.has(D.id)),[r,ut]),Mt=useMemo(()=>{let D=[...Ge,...Le,...ce],_=new Set,U=[];return D.forEach(de=>{_.has(de)||(_.add(de),U.push(de));}),U},[Le,ce,Ge]);useEffect(()=>{ft(D=>{let _=D.filter(U=>w.has(U));return pr(D,_)?D:_}),Dt(D=>{let _=D.filter(U=>w.has(U));return pr(D,_)?D:_}),st(D=>{let _=D.filter(U=>w.has(U));return pr(D,_)?D:_}),Ot(D=>{let _=D.filter(U=>w.has(U.fieldId)).map(U=>({...U,aggregation:vo(U.aggregation,M.get(U.fieldId))}));return Ki(D,_)?D:_});},[M,w]);let bt=useMemo(()=>{let D={};return Mt.forEach(_=>{let U=new Set;o.forEach(de=>{U.add(dr(de[_]));}),D[_]=Array.from(U).sort((de,Fe)=>de.localeCompare(Fe));}),D},[Mt,o]);useEffect(()=>{Xt(D=>{let _={};return Mt.forEach(U=>{let de=bt[U]??[],ot=(D[U]??[]).filter(re=>de.includes(re)),_e=Object.prototype.hasOwnProperty.call(D,U);_[U]=_e?ot:de;}),Lu(D,_)?D:_});},[Mt,bt]),useEffect(()=>{Y(D=>Il(Ge,Le,D));},[Le,Ge,Y]),useEffect(()=>{he(D=>Ji(ve,D));},[he,ve]),useEffect(()=>{Ce(D=>Ml(ve,it,D));},[it,Ce,ve]);let F=useMemo(()=>o.filter(D=>Mt.every(_=>{let U=ee[_]??[],de=bt[_]??[];if(U.length===de.length)return true;if(U.length===0)return false;let Fe=dr(D[_]);return U.includes(Fe)})),[Mt,bt,ee,o]),Q=useMemo(()=>{if(ve.length===0)return null;let D=new Map;if(F.forEach(_e=>{let re=Le.length>0?Le.map(J=>dr(_e[J])):[g$1("pivot.valueLabel")],ue=Wr(re);D.set(ue,re);}),D.size===0){let _e=Le.length>0?Le.map(()=>Gi):[g$1("pivot.valueLabel")];D.set(Wr(_e),_e);}let _=Array.from(D.entries()).sort((_e,re)=>Eu(_e[1],re[1])),U=_.flatMap(([_e,re])=>ve.map(ue=>{let J=M.get(ue.fieldId),Ee=`${I(ue.aggregation)} ${J?.label??ue.fieldId}`,Qe=Le.length===0||ve.length>1?`${re.join(" / ")} \u2022 ${Ee}`:re.join(" / ");return {id:`${_e}::${ue.tokenId}`,colKey:_e,valueItem:ue,label:Qe}})),de=[];Le.length>0&&_.forEach(([_e,re])=>{let ue=U.filter(Qe=>Qe.colKey===_e),J=de,Ee=[];re.forEach((Qe,Me)=>{Ee.push(`d${Me}:${Qe}`);let Xe=`col::${Wr(Ee)}`,kt=J.find(Yr=>Yr.key===Xe);kt||(kt={key:Xe,label:Qe,children:[],leafColumnIds:[],path:re.slice(0,Me+1),depth:Me},J.push(kt)),ue.forEach(Yr=>{kt.leafColumnIds.includes(Yr.id)||kt.leafColumnIds.push(Yr.id);}),J=kt.children;});});let Fe=_e=>{let re={};return U.forEach(ue=>{let J=_e.filter(Ee=>{let Qe=Le.length>0?Le.map(Me=>dr(Ee[Me])):[g$1("pivot.valueLabel")];return Wr(Qe)===ue.colKey});re[ue.id]=xn(J,ue.valueItem.fieldId,ue.valueItem.aggregation);}),re},ot=[];if(Ge.length===0)ot.push({key:"root",value:g$1("pivot.resultLabel")||Tu,children:[],isLeaf:true,aggregatedValues:Fe(F),path:[],depth:0});else {let _e=(re,ue,J)=>{if(ue>=Ge.length)return [];let Ee=Ge[ue],Qe=new Map;return re.forEach(Me=>{let Xe=dr(Me[Ee]);Qe.has(Xe)||Qe.set(Xe,[]),Qe.get(Xe).push(Me);}),Array.from(Qe.keys()).sort().map(Me=>{let Xe=Qe.get(Me),kt=[...J,Me];return {key:Wr(kt),value:Me,fieldId:Ee,aggregatedValues:Fe(Xe),children:_e(Xe,ue+1,kt),isLeaf:ue===Ge.length-1,path:kt,depth:ue}})};ot.push(..._e(F,0,[]));}return {dataColumns:U,columnTree:de,rowTree:ot}},[Le,M,F,I,Ge,g$1,ve]),ge=useCallback((D,_)=>(b$1.current+=1,{tokenId:`v${b$1.current}`,fieldId:D,aggregation:vo(_,M.get(D))}),[M]),ke=useCallback(D=>{if(D==="rows")return ft([]);if(D==="columns")return Dt([]);if(D==="filters")return st([]);Ot([]);},[]),Je=useCallback((D,_)=>{if(D==="rows")return ft(U=>U.filter(de=>de!==_));if(D==="columns")return Dt(U=>U.filter(de=>de!==_));if(D==="filters")return st(U=>U.filter(de=>de!==_));Ot(U=>U.filter(de=>de.tokenId!==_));},[]),qe=useCallback((D,_)=>{Ot(U=>U.map(de=>de.tokenId===D?{...de,aggregation:vo(_,M.get(de.fieldId))}:de));},[M]),St=useCallback(D=>{xt(String(D.active.id));},[]),ht=useCallback(D=>{if(xt(null),!D.over)return;let _=Ui(String(D.active.id)),U=Ui(String(D.over.id));if(!_||!U||_.kind!=="item"||!_.key)return;if(_.zone===U.zone&&U.kind==="item"){if(_.zone==="rows"){let Me=Ge.indexOf(_.key),Xe=Ge.indexOf(U.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&ft(kt=>arrayMove(kt,Me,Xe));return}if(_.zone==="columns"){let Me=Le.indexOf(_.key),Xe=Le.indexOf(U.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&Dt(kt=>arrayMove(kt,Me,Xe));return}if(_.zone==="filters"){let Me=ce.indexOf(_.key),Xe=ce.indexOf(U.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&st(kt=>arrayMove(kt,Me,Xe));return}if(_.zone==="values"){let Me=ve.findIndex(kt=>kt.tokenId===_.key),Xe=ve.findIndex(kt=>kt.tokenId===(U.key??""));Me!==-1&&Xe!==-1&&Me!==Xe&&Ot(kt=>arrayMove(kt,Me,Xe));}return}let de=U.zone,Fe=[...Ge],ot=[...Le],_e=[...ce],re=[...ve],ue="",J=null;if(_.zone==="palette")ue=_.key;else if(_.zone==="values"){let Me=re.find(Xe=>Xe.tokenId===_.key);if(!Me)return;ue=Me.fieldId,J=Me,re=re.filter(Xe=>Xe.tokenId!==_.key);}else _.zone==="rows"?(ue=_.key,Fe=Fe.filter(Me=>Me!==ue)):_.zone==="columns"?(ue=_.key,ot=ot.filter(Me=>Me!==ue)):_.zone==="filters"&&(ue=_.key,_e=_e.filter(Me=>Me!==ue));if(!ue)return;let Ee=()=>{Fe=Fe.filter(Me=>Me!==ue),ot=ot.filter(Me=>Me!==ue),_e=_e.filter(Me=>Me!==ue);},Qe=Me=>{if(U.kind!=="item"||!U.key)return Me==="rows"?Fe.length:Me==="columns"?ot.length:Me==="filters"?_e.length:Me==="values"?re.length:0;if(Me==="rows"){let Xe=Fe.indexOf(U.key);return Xe>=0?Xe:Fe.length}if(Me==="columns"){let Xe=ot.indexOf(U.key);return Xe>=0?Xe:ot.length}if(Me==="filters"){let Xe=_e.indexOf(U.key);return Xe>=0?Xe:_e.length}if(Me==="values"){let Xe=re.findIndex(kt=>kt.tokenId===U.key);return Xe>=0?Xe:re.length}return 0};if(de==="palette"){ft(Fe),Dt(ot),st(_e),Ot(re);return}if(de==="values"){let Me=Qe("values"),Xe=J??ge(ue);re.splice(Me,0,Xe),ft(Fe),Dt(ot),st(_e),Ot(re);return}if(Au(de)){Ee();let Me=Qe(de);de==="rows"?Fe.splice(Me,0,ue):de==="columns"?ot.splice(Me,0,ue):_e.splice(Me,0,ue),ft(Fe),Dt(ot),st(_e),Ot(re);}},[Le,ge,ce,Ge,ve]),mt=useCallback((D,_)=>{Xt(U=>({...U,[D]:_}));},[]),yt=useCallback(D=>{Lt(_=>{let U=new Set(_);return U.has(D)?U.delete(D):U.add(D),U});},[]),oo=useCallback(D=>{te(_=>{let U=new Set(_);return U.has(D)?U.delete(D):U.add(D),U});},[]),At=useCallback(D=>{let _=M.get(D.fieldId),U=Sl(_);return f(vr,{size:"small",sx:{minWidth:98},children:f(Ht,{value:D.aggregation,onChange:de=>qe(D.tokenId,de.target.value),onClick:de=>de.stopPropagation(),onMouseDown:de=>de.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:U.map(de=>f("option",{value:de,sx:{fontSize:"0.75rem"},children:I(de)},de))})})},[M,I,qe]),Zt=useCallback(D=>{let _=bt[D]??[],U=ee[D]??_;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})},[bt,ee,g$1]),Bt=useCallback(D=>{let _=bt[D]??[],U=ee[D]??_;return f(Fu,{options:_,selectedValues:U,onChange:de=>mt(D,de)})},[bt,ee,mt]),Gt=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Wt=useCallback(()=>{let D={};return new Set([...Mt,...Object.keys(ee)]).forEach(U=>{if(!w.has(U))return;let de=ee[U]??[];D[U]=[...de];}),{layout:{rows:[...Ge],columns:[...Le],filters:[...ce],values:ve.map(U=>({fieldId:U.fieldId,aggregation:U.aggregation}))},filterSelections:D,showGrandTotal:be,chart:{dimensionFieldId:je,primaryValueFieldId:it,secondaryValueFieldId:dt,chartType:Ft}}},[Mt,je,it,dt,Ft,Le,ce,ee,Ge,be,w,ve]),eo=useCallback(D=>{let _=io(D.layout.rows,w),U=io(D.layout.columns,w),de=io(D.layout.filters,w),Fe=new Set,ot=(D.layout.values??[]).filter(ue=>!w.has(ue.fieldId)||Fe.has(ue.fieldId)?false:(Fe.add(ue.fieldId),true)).map(ue=>ge(ue.fieldId,ue.aggregation)),_e={};Object.entries(D.filterSelections??{}).forEach(([ue,J])=>{!w.has(ue)||!Array.isArray(J)||(_e[ue]=Array.from(new Set(J.map(Ee=>String(Ee)))));}),ft(_),Dt(U),st(de),Ot(ot),Xt(_e),typeof D.showGrandTotal=="boolean"&&Z(D.showGrandTotal),Y(Il(_,U,D.chart?.dimensionFieldId));let re=Ji(ot,D.chart?.primaryValueFieldId);he(re),Ce(Ml(ot,re,D.chart?.secondaryValueFieldId)),Ae(D.chart?.chartType??"bar-vertical"),K(D.id),C?.(D);},[ge,C,Y,he,Ce,Ae,Dt,st,Xt,ft,Z,Ot,w]),ro=useCallback(D=>{if(!D){K("");return}let _=wt.find(U=>U.id===D);if(!_){K("");return}eo(_);},[eo,wt]),ho=useCallback(()=>{let D=g$1("pivot.preset.defaultName",{index:wt.length+1});nt(D),ye(true);},[wt.length,g$1]),To=useCallback(()=>{let D=Oe.trim();if(!D)return;let _={id:Gt(),name:D,...Wt()};Ye(U=>[...U,_]),K(_.id),ye(false);},[Wt,Gt,Oe,Ye]),Io=useCallback(()=>{at&&(Ye(D=>D.filter(_=>_.id!==at)),K(""));},[at,Ye]);useEffect(()=>{if(!v||y.current)return;let D=wt.find(_=>_.id===v);D&&(y.current=true,eo(D));},[eo,v,wt]),useEffect(()=>{at&&(wt.some(D=>D.id===at)||K(""));},[at,wt]);let nr=useMemo(()=>{if(!be||!Q||!Ge.length)return null;let D={};return Q.dataColumns.forEach(_=>{let U=F.filter(de=>{let Fe=Le.length>0?Le.map(ot=>dr(de[ot])):[g$1("pivot.valueLabel")];return Wr(Fe)===_.colKey});D[_.id]=xn(U,_.valueItem.fieldId,_.valueItem.aggregation);}),{key:"__grand_total__",value:g$1("pivot.grandTotal")||Iu,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:D,path:[],depth:-1}},[be,Q,F,Le,Ge.length,g$1]),yo=useMemo(()=>Xu(Q?.rowTree??[]),[Q]),Oo=useMemo(()=>Xu(Q?.columnTree??[]),[Q]);useEffect(()=>{Lt(D=>{let _=new Set;return D.has("__grand_total__")&&_.add("__grand_total__"),yo.forEach(U=>{D.has(U)&&_.add(U);}),_});},[yo]),useEffect(()=>{te(D=>{let _=new Set;return Oo.forEach(U=>{D.has(U)&&_.add(U);}),_});},[Oo]);let Ur=useCallback(()=>{Lt(D=>{let _=new Set(D);return yo.forEach(U=>_.add(U)),_});},[yo]),Kr=useCallback(()=>{Lt(D=>{let _=new Set;return D.has("__grand_total__")&&_.add("__grand_total__"),_});},[]),Ar=useCallback(()=>{te(new Set(Oo));},[Oo]),qr=useCallback(()=>{te(new Set);},[]),Xr=useMemo(()=>!Q||Le.length===0?[]:Bv(Q.columnTree,Nt),[Le.length,Nt,Q]),Mo=useMemo(()=>{if(!Q)return [];if(Le.length===0)return Q.dataColumns.map(_=>({id:_.id,label:_.label,leafColumnIds:[_.id],valueItem:_.valueItem}));let D=new Map(Q.dataColumns.map(_=>[_.id,_]));return Xr.flatMap(_=>{let U=new Map;return _.leafColumnIds.forEach(de=>{let Fe=D.get(de);if(!Fe)return;let ot=Fe.valueItem.tokenId,_e=`${I(Fe.valueItem.aggregation)} ${M.get(Fe.valueItem.fieldId)?.label??Fe.valueItem.fieldId}`,re=U.get(ot);if(re){re.leafColumnIds.push(de);return}U.set(ot,{id:`${_.key}::${ot}`,label:ve.length>1?_e:_.label,leafColumnIds:[de],valueItem:Fe.valueItem});}),Array.from(U.values())})},[Le.length,M,I,Q,ve.length,Xr]),Er=useMemo(()=>new Map(Mo.map(D=>[D.id,D])),[Mo]),Zr=useMemo(()=>Mo.map(D=>({id:D.id,colKey:D.id,valueItem:D.valueItem,label:D.label})),[Mo]),Ko=useMemo(()=>{if(!Q||Le.length===0)return [];let D=[],_=Zu(Q.columnTree,Nt),U=_+(ve.length>1?1:0),de=(Fe,ot)=>{D[ot]??(D[ot]=[]),Fe.forEach(_e=>{let re=_e.children.length>0&&Nt.has(_e.key),ue=Mo.filter(Ee=>_e.leafColumnIds.some(Qe=>Ee.leafColumnIds.includes(Qe))).length,J=re||ve.length>1?1:U-ot;D[ot].push({key:_e.key,label:_e.label,colSpan:ue,rowSpan:J,expandable:_e.children.length>0,expanded:re}),re&&de(_e.children,ot+1);});};return de(Q.columnTree,0),ve.length>1&&(D[_]=Mo.map(Fe=>({key:Fe.id,label:Fe.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),D},[Le.length,Nt,Q,ve.length,Mo]),ar=useCallback((D,_)=>_.leafColumnIds.reduce((U,de)=>U+(D.aggregatedValues[de]??0),0),[]),An=useMemo(()=>g(e,{children:[f(Se,{size:"small",variant:"text",onClick:Ur,disabled:yo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandRowsAll")}),f(Se,{size:"small",variant:"text",onClick:Kr,disabled:yo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseRowsAll")}),f(Rt,{orientation:"vertical",flexItem:true}),f(Se,{size:"small",variant:"text",onClick:Ar,disabled:Oo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandColumnsAll")}),f(Se,{size:"small",variant:"text",onClick:qr,disabled:Le.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseColumnsAll")})]}),[Le.length,Oo.size,yo.size,qr,Kr,Ar,Ur,g$1]),Lr=()=>{if(!Ze)return null;let D=Ui(Ze);if(!D||D.kind!=="item"||!D.key)return null;if(D.zone==="palette"){let Fe=M.get(D.key);return Fe?f(kl,{label:Fe.label,subtitle:Fe.type}):null}if(D.zone==="values"){let Fe=ve.find(ue=>ue.tokenId===D.key);if(!Fe)return null;let _e=M.get(Fe.fieldId)?.label??Fe.fieldId,re=`${I(Fe.aggregation)}(${_e})`;return f(qi,{label:_e,caption:re})}let U=M.get(D.key)?.label??D.key,de=Zt(D.key);return f(qi,{label:U,caption:de})};return g(Ne,{sx:D=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${D.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:k}),f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.subtitle.default")})]}),g(ie,{direction:"row",spacing:1.5,alignItems:"center",children:[Vt&&g(e,{children:[f(vr,{size:"small",sx:{minWidth:200},children:g(Ht,{value:at,displayEmpty:true,onChange:D=>ro(String(D.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")}),wt.map(D=>f("option",{value:D.id,sx:{fontSize:"0.75rem"},children:D.name},D.id))]})}),f(lt,{title:g$1("pivot.preset.save"),children:f(ae,{size:"small",onClick:ho,"aria-label":g$1("pivot.preset.save"),sx:{width:28,height:28,p:0},children:f(Sr,{size:15})})}),f(lt,{title:g$1("pivot.preset.delete"),children:f("span",{children:f(ae,{size:"small",onClick:Io,disabled:!at,"aria-label":g$1("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:f(ri,{size:15})})})}),f(Rt,{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:o.length.toLocaleString()})," / ",g$1("pivot.afterFilter"),":"," ",f("strong",{children:F.length.toLocaleString()})]}),f(Rt,{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(Ja,{size:"small",checked:be,onChange:D=>Z(D.target.checked)})]})]})]}),f(Rt,{}),g(DndContext,{sensors:x,collisionDetection:closestCenter,onDragStart:St,onDragEnd:ht,children:[f(zu,{isConfiguratorCollapsed:De,onToggleCollapse:()=>W(D=>!D),availableFields:gt,fieldMap:M,filterFields:ce,columnFields:Le,rowFields:Ge,valueFields:ve,clearZone:ke,removeFieldFromZone:Je,getFilterSelectionSummary:Zt,renderDimensionFilterSelect:Bt,renderAggregationSelect:At,getAggregationLabel:I}),f(Pd,{children:f(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Lr()})})]}),f(Ku,{rows:F,fieldMap:M,rowFields:Ge,columnFields:Le,valueFields:ve,chartDimensionFieldId:je,chartPrimaryValueFieldId:it,chartSecondaryValueFieldId:dt,chartType:Ft,isCollapsed:qt,onChartDimensionFieldIdChange:D=>Y(D),onChartPrimaryValueFieldIdChange:D=>he(D),onChartSecondaryValueFieldIdChange:D=>Ce(D),onChartTypeChange:D=>Ae(D),onToggleCollapse:()=>$e(D=>!D),getAggregationLabel:I}),f(kn,{title:g$1("pivot.table.sectionTitle"),subtitle:Ge.length>0?Ge.map(D=>M.get(D)?.label??D).join(" > "):g$1("pivot.table.dimensions"),collapsed:zt,onToggleCollapse:()=>Ke(D=>!D),expandAriaLabel:g$1("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:An,children:Q===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:(Ko.length>0?Ko:[[]]).map((D,_)=>g("tr",{children:[_===0&&f("td",{rowSpan:Math.max(Ko.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:Ge.length>0?Ge.map(U=>M.get(U)?.label).join(" > "):g$1("pivot.table.dimensions")}),(D.length>0?D:Mo.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:de=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${de.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:g("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[U.expandable&&f(ae,{size:"small",onClick:()=>oo(U.key),sx:{width:22,height:22,p:0,ml:-0.2},children:U.expanded?f(Vo,{size:12}):f(wr,{size:12})}),f("div",{component:"span",children:U.label})]})},U.key))]},`pivot-header-row-${_}`))}),g("tbody",{children:[Q.rowTree.map(D=>f(Qi,{node:D,dataColumns:Zr,fieldMap:M,level:0,expandedKeys:It,onToggle:yt,getValue:(_,U)=>{let de=Er.get(U);return de?ar(_,de):0}},D.key)),nr&&f(Qi,{node:nr,dataColumns:Zr,fieldMap:M,level:0,expandedKeys:It,onToggle:yt,getValue:(D,_)=>{let U=Er.get(_);return U?ar(D,U):0}})]})]})})}),g(Et,{open:Re,onClose:()=>ye(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:Oe,onChange:D=>nt(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),To());}})}),g("div",{className:"orb-dialog-actions",children:[f(Se,{onClick:()=>ye(false),children:g$1("common.cancel")}),f(Se,{variant:"contained",onClick:To,disabled:!Oe.trim(),children:g$1("common.save")})]})]})]})};var Yu=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},Dl=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",Qu=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",YL=({fields:t,initialLayout:o,initialFilterSelections:r={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:l=false})=>{let d=useRef(0),u=useMemo(()=>new Set(t.map(K=>K.id)),[t]),m=useMemo(()=>new Map(t.map(K=>[K.id,K])),[t]),[h,f]=useState(()=>io(o?.rows,u)),[p,v]=useState(()=>io(o?.columns,u)),[C,g]=useState(()=>io(o?.filters,u)),[x,b]=useState(()=>{let K=o?.values??[],Re=new Set,ye=[];return K.forEach(Oe=>{!u.has(Oe.fieldId)||Re.has(Oe.fieldId)||(Re.add(Oe.fieldId),d.current+=1,ye.push({tokenId:`v${d.current}`,fieldId:Oe.fieldId,aggregation:vo(Oe.aggregation,m.get(Oe.fieldId))}));}),ye}),[y,k]=useState(r),[S,P]=useState(n),[I,w]=useState(a),[M,N]=useState(()=>Yu(io(o?.rows,u),io(o?.columns,u),i?.dimensionFieldId)),[T,R]=useState(()=>{let K=(()=>{let Re=o?.values??[],ye=new Set,Oe=[];return Re.forEach(nt=>{!u.has(nt.fieldId)||ye.has(nt.fieldId)||(ye.add(nt.fieldId),Oe.push({tokenId:nt.fieldId,fieldId:nt.fieldId,aggregation:vo(nt.aggregation,m.get(nt.fieldId))}));}),Oe})();return Dl(K,i?.primaryValueFieldId)}),[A,L]=useState(()=>{let K=(()=>{let ye=o?.values??[],Oe=new Set,nt=[];return ye.forEach(Ze=>{!u.has(Ze.fieldId)||Oe.has(Ze.fieldId)||(Oe.add(Ze.fieldId),nt.push({tokenId:Ze.fieldId,fieldId:Ze.fieldId,aggregation:vo(Ze.aggregation,m.get(Ze.fieldId))}));}),nt})(),Re=Dl(K,i?.primaryValueFieldId);return Qu(K,Re,i?.secondaryValueFieldId)}),[$,j]=useState(i?.chartType??"bar-vertical"),[O,z]=useState(s),[H,q]=useState(l);useEffect(()=>{f(K=>{let Re=K.filter(ye=>u.has(ye));return pr(K,Re)?K:Re}),v(K=>{let Re=K.filter(ye=>u.has(ye));return pr(K,Re)?K:Re}),g(K=>{let Re=K.filter(ye=>u.has(ye));return pr(K,Re)?K:Re}),b(K=>{let Re=K.filter(ye=>u.has(ye.fieldId)).map(ye=>({...ye,aggregation:vo(ye.aggregation,m.get(ye.fieldId))}));return Ki(K,Re)?K:Re});},[m,u]),useEffect(()=>{N(K=>Yu(h,p,K));},[p,h]),useEffect(()=>{R(K=>Dl(x,K));},[x]),useEffect(()=>{L(K=>Qu(x,T,K));},[T,x]);let V=useCallback(K=>{f(io(K,u));},[u]),B=useCallback(K=>{v(io(K,u));},[u]),G=useCallback(K=>{g(io(K,u));},[u]),X=useCallback(K=>{b(Re=>{let ye=K??[],Oe=new Set,nt=[];return ye.forEach(Ze=>{if(!u.has(Ze.fieldId)||Oe.has(Ze.fieldId))return;Oe.add(Ze.fieldId);let xt=Re.find(It=>It.fieldId===Ze.fieldId);if(xt){nt.push({...xt,aggregation:vo(Ze.aggregation??xt.aggregation,m.get(Ze.fieldId))});return}d.current+=1,nt.push({tokenId:`v${d.current}`,fieldId:Ze.fieldId,aggregation:vo(Ze.aggregation,m.get(Ze.fieldId))});}),nt});},[m,u]),pe=useCallback(K=>{V(K.rows??[]),B(K.columns??[]),G(K.filters??[]),X(K.values??[]);},[B,G,V,X]),oe=useCallback(K=>{if(K==="rows")return f([]);if(K==="columns")return v([]);if(K==="filters")return g([]);b([]);},[]),me=useCallback((K,Re)=>{if(K==="rows")return f(ye=>ye.filter(Oe=>Oe!==Re));if(K==="columns")return v(ye=>ye.filter(Oe=>Oe!==Re));if(K==="filters")return g(ye=>ye.filter(Oe=>Oe!==Re));b(ye=>ye.filter(Oe=>Oe.tokenId!==Re));},[]),xe=useCallback((K,Re)=>{b(ye=>ye.map(Oe=>Oe.tokenId===K?{...Oe,aggregation:vo(Re,m.get(Oe.fieldId))}:Oe));},[m]),ze=useCallback((K,Re)=>{k(ye=>({...ye,[K]:Re}));},[]),Pe=useCallback(()=>{k({});},[]),Te=useCallback(()=>{P(K=>!K);},[]),Be=useCallback(()=>{w(K=>!K);},[]),le=useCallback(K=>{N(K);},[]),fe=useCallback(K=>{R(K);},[]),Ve=useCallback(K=>{L(K);},[]),et=useCallback(()=>{z(K=>!K);},[]),rt=useCallback(()=>{q(K=>!K);},[]);return {model:useMemo(()=>({rowFields:h,setRowFields:f,columnFields:p,setColumnFields:v,filterFields:C,setFilterFields:g,valueFields:x,setValueFields:b,filterSelections:y,setFilterSelections:k,showGrandTotal:S,setShowGrandTotal:P,isConfiguratorCollapsed:I,setIsConfiguratorCollapsed:w,chartDimensionFieldId:M,setChartDimensionFieldId:N,chartPrimaryValueFieldId:T,setChartPrimaryValueFieldId:R,chartSecondaryValueFieldId:A,setChartSecondaryValueFieldId:L,chartType:$,setChartType:j,isChartCollapsed:O,setIsChartCollapsed:z,isTableCollapsed:H,setIsTableCollapsed:q}),[M,T,A,$,p,C,y,O,I,H,h,S,x]),actions:{setRows:V,setColumns:B,setFilters:G,setValues:X,setLayout:pe,clearZone:oe,removeFieldFromZone:me,setAggregationForValue:xe,setFilterSelection:ze,resetFilterSelections:Pe,toggleGrandTotal:Te,toggleConfigurator:Be,setChartDimension:le,setChartPrimaryValue:fe,setChartSecondaryValue:Ve,setChartType:j,toggleChart:et,toggleTable:rt}}};var eO=({orientation:t="auto",defaultNavigationOpen:o,onNavOpenChange:r}={})=>{let n=ao(),a=yr("(orientation: portrait)"),i=yr(n.breakpoints.down("md")),s=useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[l,d]=useState(o??s==="landscape");useEffect(()=>{d(o??s==="landscape");},[o,s]);let u=h=>{d(h),r?.(h);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:l,setNavigationOpen:u,toggleNavigationOpen:()=>u(!l)}};var _v=t=>{let o=Number(t||0);return Number.isFinite(o)?o:0},rO=({rows:t,rowKey:o="id",numericField:r,defaultSelectedId:n})=>{let i=t[0]?.[o],[s,l]=useState(n??i),d=useMemo(()=>t.find(p=>p[o]===s)||t[0],[o,t,s]),[u,m]=useState(()=>{let p=d?.[r];return p==null?"0":String(p)});return {selectedId:s,selectedRecord:d,editorValue:u,setEditorValue:m,selectRecord:p=>{let v=p[o];l(v);let C=p[r];m(C==null?"0":String(C));},applyEditorValue:p=>{if(s===void 0)return;let v=_v(u),C=t.map(g=>g[o]===s?{...g,[r]:v}:g);p(C);}}};var Gv=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Ju=(t,o,r,n)=>{o?.(t),n&&r?.();},cO=({open:t,onClose:o,title:r="Scan barcode",subtitle:n="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=Gv,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:l=true,scanIntervalMs:d=600,confirmLabel:u="Use code",cancelLabel:m="Close",manualPlaceholder:h="Enter barcode manually",onDetected:f$1,onError:p,sx:v})=>{let C=jt__default.useRef(null),g$1=jt__default.useRef(null),x=jt__default.useRef(null),b$1=jt__default.useRef(null),[y,k]=jt__default.useState("idle"),[S,P]=jt__default.useState(""),[I,w]=jt__default.useState(null),[M,N]=jt__default.useState(null),T=jt__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),C.current&&(C.current.srcObject=null);},[]),R=jt__default.useCallback(L=>{N(L),k("error"),p?.(L);},[p]);jt__default.useEffect(()=>{if(!t){T(),k("idle"),N(null),P("");return}let L=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){k("unsupported"),N("Camera access is not supported in this browser.");return}k("starting"),N(null);try{let j=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(L){j.getTracks().forEach(O=>O.stop());return}if(g$1.current=j,C.current&&(C.current.srcObject=j,await C.current.play()),!window.BarcodeDetector){k("unsupported"),N("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}b$1.current=new window.BarcodeDetector({formats:a}),k("ready"),x.current=window.setInterval(async()=>{if(!(!C.current||!b$1.current)&&!(C.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let z=(await b$1.current.detect(C.current)).find(q=>q.rawValue);if(!z?.rawValue)return;let H={rawValue:z.rawValue,format:z.format};w(H),T(),Ju(H,f$1,o,l);}catch(O){R(O instanceof Error?O.message:"Failed to detect barcode.");}},d);}catch(j){R(j instanceof Error?j.message:"Unable to start camera.");}}})(),()=>{L=true,T();}},[l,i,a,o,f$1,t,R,d,T]);let A=()=>{let L=S.trim();if(!L)return;let $={rawValue:L,format:"manual"};w($),Ju($,f$1,o,l);};return g(Et,{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(ie,{spacing:2,sx:v,children:[f(E,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),g(Ne,{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:C,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(Ct,{icon:f(Hd,{}),label:y==="ready"?"Camera ready":y==="starting"?"Starting camera":y==="unsupported"?"Preview only":y==="error"?"Scanner error":"Idle",size:"small",color:y==="error"?"error":"primary",variant:"filled"}),I?f(Ct,{icon:f(rp,{}),label:`${I.format||"barcode"}: ${I.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),M?f(Qo,{severity:y==="unsupported"?"info":"warning",children:M}):null,s?g(ie,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[f(He,{fullWidth:true,label:"Barcode",placeholder:h,value:S,onChange:L=>P(L.target.value)}),f(Se,{variant:"contained",onClick:A,sx:{minHeight:56,px:2.5},children:u})]}):null]})}),f("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:f(Se,{onClick:o,children:m})})]})};var Uv={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)"},fO=({title:t,description:o,kicker:r,icon:n,badges:a=[],metrics:i=[],footer:s,children:l,selected:d=false,draggable:u=false,isDragging:m=false,swipeThreshold:h=88,startAction:f$1,endAction:p,dragHandleProps:v,onClick:C,onSwipe:g$1,sx:x})=>{let[b$1,y]=useState(0),[k,S]=useState(false),P=useRef(null),I=useRef(0),w=useRef(0),M=!!(f$1||p),N=132,T=()=>{y(0),S(false),P.current=null,I.current=0,w.current=0;},R=O=>{(O==="start"?f$1:p)?.onTrigger?.(),g$1?.(O),T();},A=O=>{!M||O.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(P.current=O.pointerId,I.current=O.clientX,w.current=O.clientX,S(true),O.currentTarget.setPointerCapture(O.pointerId));},L=O=>{if(!k||P.current!==O.pointerId)return;w.current=O.clientX;let z=w.current-I.current,H=Math.max(-N,Math.min(N,z));y(H);},$=O=>{if(!k||P.current!==O.pointerId)return;let z=w.current-I.current;if(z>=h&&f$1){R("start");return}if(z<=-h&&p){R("end");return}Math.abs(z)<12&&C?.(),T();},j=(O,z)=>{if(!O)return null;let H=O.backgroundColor||Uv[O.tone||"default"];return f("div",{sx:{position:"absolute",top:0,bottom:0,[z]:0,width:N,px:2,display:"flex",alignItems:"center",justifyContent:z==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${H}, rgba(15,23,42,0.92))`},children:g(ie,{direction:"row",spacing:1,alignItems:"center",children:[O.icon,f(E,{sx:{fontWeight:700,fontSize:"0.95rem"},children:O.label})]})})};return g("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[j(f$1,"left"),j(p,"right"),f(Ne,{elevation:0,onPointerDown:A,onPointerMove:L,onPointerUp:$,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(${m?.985:1})`,transition:k?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:C?"pointer":"default",opacity:m?.9:1},children:g(ie,{spacing:1.5,children:[g(ie,{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:[r?f(E,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:r}):null,f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),o?f(E,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:o}):null]}),u?f("div",{"data-no-swipe":"true",...v,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:f(ae,{size:"small",children:f(Kd,{})})}):null]}),a.length>0?f(ie,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((O,z)=>f(Ct,{label:O,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},z))}):null,i.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(O=>g(Ne,{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:O.label}),f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:O.value})]},O.id))}):null,l,s]})})]})};var pa=({label:t,onPress:o,emphasis:r="default"})=>f("div",{component:"button",type:"button",onClick:o,sx:n=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:r==="primary"?"primary.main":"divider",background:r==="primary"?n.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}),kO=({value:t,defaultValue:o="",title:r,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:l,confirmLabel:d,clearLabel:u,backspaceLabel:m,onChange:h,onSubmit:f$1,onClose:p,sx:v})=>{let{t:C}=se(),[g$1,x]=useState(o),b=t??g$1,y=T=>{t===void 0&&x(T),h?.(T);},k=T=>{l&&b.length>=l||y(`${b}${T}`);},S=T=>{if(T==="00"){if(!b){y("0");return}k("00");return}k(T);},P=()=>{!i||b.includes(".")||y(b?`${b}.`:"0.");},I=()=>{if(s){if(b.startsWith("-")){y(b.slice(1));return}y(b?`-${b}`:"-");}},w=()=>{y(b.slice(0,-1));},M=()=>{y("");},N=()=>{f$1?.(b);};return f(Ne,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...v},children:g(ie,{spacing:2,children:[g(ie,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[g("div",{sx:{minWidth:0},children:[r?f(E,{sx:{fontSize:"1rem",fontWeight:800},children:r}):null,n?f(E,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),p?f(ae,{onClick:p,size:"small",children:f(Gd,{})}):null]}),f(Ne,{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(pa,{label:T,onPress:()=>S(T)},T)),f(pa,{label:s?"+/-":"00",onPress:s?I:()=>S("00")}),f(pa,{label:"0",onPress:()=>S("0")}),f(pa,{label:i?".":m?String(m):"DEL",onPress:i?P: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(ie,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Bd,{}),f(E,{sx:{fontWeight:700},children:m||"DEL"})]})}),f(pa,{label:String(u||"CLR"),onPress:M,emphasis:"danger"}),f("div",{component:"button",type:"button",onClick:N,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(ie,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Vd,{}),f(E,{sx:{fontWeight:800},children:d||C("common.ok")})]})})]})]})})};var tm=({touchMode:t="comfortable",sx:o,...r})=>{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},...o},children:f(Wo,{...r})})};var Yv=(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);}},om=({items:t,selectedId:o,orientation:r="auto",onItemSelect:n,sx:a})=>{let i=ao(),[s,l]=useState(false);useEffect(()=>{l(true);},[]);let d=yr("(orientation: portrait)"),u=yr(i.breakpoints.down("md")),m=r==="auto"?d||u?"portrait":"landscape":r,h=useRouter();return f("div",{sx:{display:"grid",gridTemplateColumns:!s||m==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:t.map(f$1=>{let p=f$1.id===o,v=f$1.color||(p?i.palette.primary.main:i.palette.divider);return f(Ne,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:p?"primary.main":"divider",boxShadow:p?"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:f$1.disabled,onClick:()=>Yv(h,f$1,n),sx:{width:"100%",p:2,minHeight:m==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:f$1.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:g(ie,{spacing:1.5,sx:{height:"100%"},children:[g(ie,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[f("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:p?"var(--orb-on-primary)":"text.primary",background:p?v:"action.hover"},children:f$1.icon||f(E,{sx:{fontSize:"1rem",fontWeight:900},children:f$1.title.slice(0,1).toUpperCase()})}),f$1.badge!==void 0?f("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:p?"primary.main":"action.hover",color:p?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:f$1.badge}):null]}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:f$1.title}),f$1.caption?f(E,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:f$1.caption}):null,f$1.description?f(E,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:f$1.description}):null]})]})})},f$1.id)})})};var am=(t,o)=>o.trim()?t.reduce((r,n)=>{let a=n.title?.toLowerCase().includes(o.toLowerCase())||n.label?.toLowerCase().includes(o.toLowerCase())||n.description?.toLowerCase().includes(o.toLowerCase()),i=n.children?am(n.children,o):[];return (a||i.length>0)&&r.push({...n,children:i.length>0?i:n.children}),r},[]):t,ey=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children?.length&&(o.add(a.id),r(a.children));});};return r(t),o},im=({collapsed:t=false,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:l,footerSlot:d,activeHref:u,onItemSelect:m})=>{let{t:h}=se(),f$1=ao(),p=Ro("(orientation: portrait)"),v=Ro(f$1.breakpoints.down("md")),C=s==="auto"?p||v?"portrait":"landscape":s,g$1=i==="dark",x=useRouter(),b=usePathname(),[y,k]=useState(""),[S,P]=useState(new Set),I=useMemo(()=>am(a,y),[a,y]),w=useMemo(()=>y.trim()?ey(I):S,[S,I,y]);useEffect(()=>{t&&P(new Set);},[t]);let M=L=>L.appurl||L.href||"",N=L=>{m?.(L);let $=M(L);if($){if($.startsWith("http://")||$.startsWith("https://")){window.open($,"_blank");return}x.push($);}},T=L=>{let $=!!L.children?.length;if(t&&$){o?.();return}if($){P(j=>{let O=new Set(j);return O.has(L.id)?O.delete(L.id):O.add(L.id),O});return}N(L);},R=L=>{let $=u||b,j=M(L);return !!(j&&$===j)},A=(L,$=0)=>{let j=!!L.children?.length,O=w.has(L.id),z=R(L);return f("div",{sx:{pl:$===0?0:1.5},children:g(Ne,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:z?"primary.main":"divider",bgcolor:z?"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(Qa,{variant:"rounded",sx:{width:40,height:40,bgcolor:z?"primary.main":"action.hover",color:z?"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]}),j?f(rn,{sx:{transform:O?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):f(ti,{color:"action"})]}),j?f(on,{in:O,children:f("div",{sx:{px:1.25,pb:1.25},children:L.children?.map(H=>A(H,$+1))})}):null]})},L.id)};return t?f(Ne,{elevation:0,className:r,sx:{width:C==="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(ie,{spacing:1,children:[f(ae,{onClick:o,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:h("navigation.expand"),children:f(si,{})}),a.map(L=>f(ae,{onClick:()=>T(L),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:R(L)?"primary.main":"action.hover",color:R(L)?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()},L.id))]})}):f(Ne,{elevation:0,className:r,sx:{width:C==="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(ie,{spacing:1.25,sx:{flex:1,minHeight:0},children:[g(ie,{direction:"row",spacing:1,alignItems:"center",children:[f(He,{value:y,onChange:L=>k(L.target.value),placeholder:h("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:f(np,{fontSize:"small",color:"action"})}}),C==="landscape"&&!t?f(ae,{onClick:o,sx:{bgcolor:"action.hover"},children:f(Jd,{})}):null]}),l,f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:I.length>0?I.map(L=>A(L)):f(E,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:h("navigation.noMatch")})}),d]})})};var sm=(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)},ty=t=>jt__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}),oy=(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)},ry=({summaryRow:t,visibleColumns:o,columns:r})=>{let n=r.filter(a=>o.includes(a.id)&&t[a.id]!=="");return n.length===0?null:f(Ne,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g(ie,{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(Ne,{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}`))})]})})},ny=t=>{let{t:o}=se(),r=ao(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:u,fitContainer:m=false,fullWidth:h=false,maxHeight:f$1,loading:p=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:C,filterConfig:g$1,rowKey:x,tableKey:b$1="default",graphReport:y,quickCreate:k,quickEdit:S,quickDelete:P,serviceUrl:I,orientation:w="auto",cardTitleField:M,cardSubtitleFields:N,toolbarSlot:T,emptyState:R,rowHeight:A="comfortable",cardActionSlot:L,renderCardFooter:$,onRowClick:j}=t,O=n||o("table.title.default"),z=Ro("(orientation: portrait)"),H=Ro(r.breakpoints.down("md")),q=w==="auto"?z||H?"portrait":"landscape":w,{columns:V,filterText:B,setFilterText:G,visibleColumns:X,showSummary:pe,setShowSummary:oe,summaryColumns:me,grouping:xe,setGrouping:ze,expandedGroups:Pe,groupAnchorEl:Te,setGroupAnchorEl:Be,summaryAnchorEl:le,setSummaryAnchorEl:fe,anchorEl:Ve,setAnchorEl:et,contextMenu:rt,sortedAndFilteredRows:at,summaryRow:K,visibleRows:Re,page:ye,setPage:Oe,rowsPerPage:nt,setRowsPerPage:Ze,totalDisplayCount:xt,setSelected:It,handleClick:Lt,toggleSummaryColumn:Nt,handleExport:te,handleCloseContextMenu:Ge,toggleColumnVisibility:Le,toggleGroupExpand:ce,handleExpandGroupRecursively:ve,handleCollapseGroupRecursively:ee,handleLayoutLoad:be,handleVariantLoad:De,handleLayoutSave:je,effectiveAppId:it,currentLayoutData:dt,currentLayoutId:Ft,layoutIdToLoad:qt,graphReportOpen:zt,handleOpenGraphReport:wt,handleCloseGraphReport:Vt}=hn(t),ft=y?.enabled??false,Dt=ft&&(y?.interaction?.enabled??true),st=Ti(),Ot=x||"id",Xt=jt__default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:tt(r.palette.divider,b()==="dark"?.55:.3),bgcolor:b()==="dark"?tt(r.palette.common.white,.06):tt(r.palette.background.paper,.92),color:r.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[r]),Z=jt__default.useMemo(()=>({...Xt,borderColor:tt(r.palette.primary.main,b()==="dark"?.42:.24),bgcolor:b()==="dark"?tt(r.palette.primary.main,.16):tt(r.palette.primary.main,.08)}),[Xt,r]),W=jt__default.useMemo(()=>{let J=new Set(s);return at.filter(Ee=>J.has(Ee?.[Ot]))},[Ot,s,at]),Y=W.length===1?W[0]:null,he=!!k?.enabled,Ce=!!S?.enabled,Ae=!!P?.enabled,$e=k?.fields,Ke=k?.excludeFields||[],Ye=k?.initialValues||{},ut=S?.fields,gt=S?.excludeFields||[],Mt=S?.editableFields||[],bt=S?.nonEditableFields||[],F=S?.primaryKeys?.length?S.primaryKeys:[Ot],[Q,ge]=jt__default.useState(false),[ke,Je]=jt__default.useState(false),[qe,St]=jt__default.useState({}),[ht,mt]=jt__default.useState(false),[yt,oo]=jt__default.useState(false),[At,Zt]=jt__default.useState({}),[Bt,Gt]=jt__default.useState(false),[Wt,eo]=jt__default.useState(false),ro=p||ke||yt||Wt,ho=jt__default.useMemo(()=>{let J=[...V];if(Array.isArray($e)&&$e.length>0){let Ee=new Set($e);J=J.filter(Qe=>Ee.has(Qe.id));}if(Ke.length>0){let Ee=new Set(Ke);J=J.filter(Qe=>!Ee.has(Qe.id));}return J.filter(Ee=>!!Ee?.id)},[V,Ke,$e]),To=jt__default.useMemo(()=>{let J=[...V];if(Array.isArray(ut)&&ut.length>0){let Ee=new Set(ut);J=J.filter(Qe=>Ee.has(Qe.id));}if(gt.length>0){let Ee=new Set(gt);J=J.filter(Qe=>!Ee.has(Qe.id));}return J.filter(Ee=>!!Ee?.id)},[V,gt,ut]),Io=jt__default.useMemo(()=>new Set(F),[F]),nr=jt__default.useMemo(()=>new Set(Mt),[Mt]),yo=jt__default.useMemo(()=>new Set(bt),[bt]),Oo=jt__default.useCallback(J=>nr.size>0?nr.has(J):!(yo.has(J)||Io.has(J)),[nr,yo,Io]);jt__default.useEffect(()=>{!zt&&st.hasActiveFilters&&st.clearAll();},[st,zt]);let Ur=()=>{let J={};ho.forEach(Ee=>{J[Ee.id]=Ye[Ee.id]??"";}),St(J),ge(true);},Kr=(J,Ee)=>{St(Qe=>({...Qe,[J]:Ee}));},Ar=async()=>{if(!k?.onSubmit){ge(false);return}try{Je(!0),await k.onSubmit(qe),ge(!1);}finally{Je(false);}},qr=()=>{if(!Y)return;let J={};To.forEach(Qe=>{J[Qe.id]=Y[Qe.id]??"";});let Ee=S?.getInitialValues?{...J,...S.getInitialValues(Y)}:J;Zt(Ee),mt(true);},Xr=(J,Ee)=>{Zt(Qe=>({...Qe,[J]:Ee}));},Mo=async()=>{if(Y){if(!S?.onSubmit){mt(false);return}try{oo(!0),await S.onSubmit(At,Y),mt(!1);}finally{oo(false);}}},Er=()=>{W.length!==0&&Gt(true);},Zr=async()=>{if(W.length===0){Gt(false);return}if(!P?.onConfirm){Gt(false),It([]),l?.([]);return}try{eo(!0),await P.onConfirm(W),Gt(!1),It([]),l?.([]);}finally{eo(false);}},Ko=at,{fieldMapping:ar}=pn({rows:Ko,config:{...y,title:y?.title||`${O} ${o("graph.reportTitle")}`}}),An=jt__default.useMemo(()=>Dt?st.applyRows(Ko,ar):Ko,[ar,st,Dt,Ko]),{model:Lr}=pn({rows:An,config:{...y,title:y?.title||`${O} ${o("graph.reportTitle")}`,fieldMapping:ar}}),D=Lr.table.columns.map(J=>({id:J.id,label:J.label,align:J.align||"left",minWidth:120,numeric:J.align==="right"})),_=it?f(gn,{appId:it,tableKey:b$1,currentLayoutData:dt,onLayoutLoad:be,targetLayoutId:qt,activeLayoutId:Ft,serviceUrl:I??g$1?.serviceUrl}):null,U=V.filter(J=>X.includes(J.id)),de=U.find(J=>J.id===M)||U[0],Fe=N?.map(J=>U.find(Ee=>Ee.id===J)).filter(Boolean)||U.filter(J=>J.id!==de?.id).slice(0,q==="portrait"?2:3),ot=U.filter(J=>J.id!==de?.id&&!Fe.some(Ee=>Ee.id===J.id)),_e=[T,u].filter(Boolean),re=g(e,{children:[f(cn,{groupAnchorEl:Te,setGroupAnchorEl:Be,grouping:xe,setGrouping:ze,columns:V}),f(dn,{anchorEl:Ve,setAnchorEl:et,columns:V,visibleColumns:X,toggleColumnVisibility:Le}),f(vi,{anchorEl:le,setAnchorEl:fe,showSummary:pe,setShowSummary:oe,columns:V,summaryColumns:me,toggleSummaryColumn:Nt}),f(yi,{contextMenu:rt,handleCloseContextMenu:Ge,columns:V,visibleColumns:X,toggleColumnVisibility:Le})]}),ue=(J,Ee,Qe)=>{let Me=s.includes(Ee),Xe=q==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",kt=Qe%2===0?tt(r.palette.primary.main,b()==="dark"?.09:.04):tt(r.palette.primary.main,b()==="dark"?.05:.022),Yr=tt(r.palette.divider,.22);return f(Ne,{elevation:0,onClick:()=>{Lt({},J),j?.(J);},sx:{p:A==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Me?tt(r.palette.primary.main,.38):Yr,background:Me?`linear-gradient(135deg, ${tt(r.palette.primary.main,.13)}, ${tt(r.palette.primary.main,.06)})`:`linear-gradient(135deg, ${kt}, ${tt(r.palette.primary.main,.015)})`,boxShadow:Me?`0 12px 30px ${tt(r.palette.primary.main,.2)}`:`0 3px 10px ${tt(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:Me?r.palette.primary.main:Qe%2===0?tt(r.palette.primary.main,.26):tt(r.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${tt(r.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:g(ie,{spacing:1.25,children:[g(ie,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?f(Tt,{checked:Me,onClick:xo=>xo.stopPropagation(),onChange:()=>Lt({},J),sx:{mt:-0.6,ml:-0.6}}):null,g("div",{sx:{flex:1,minWidth:0},children:[de?f(E,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:sm(de,J)}):null,Fe.length>0?f(ie,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Fe.map(xo=>f(Ct,{label:`${xo.label}: ${oy(xo,J)}`,size:"small",variant:"outlined",sx:Xt},`${Ee}-${xo.id}`))}):null]}),L?f("div",{onClick:xo=>xo.stopPropagation(),children:L(J)}):null]}),ot.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:Xe,gap:1},children:ot.map(xo=>g(Ne,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:b()==="dark"?tt(r.palette.background.default,.7):tt(r.palette.background.paper,.92),border:"0.1px solid",borderColor:tt(r.palette.divider,.24)},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:xo.label}),ty(sm(xo,J))]},`${Ee}-${xo.id}-detail`))}):null,$?g(e,{children:[f(Rt,{}),f("div",{onClick:xo=>xo.stopPropagation(),children:$(J)})]}):null]})},Ee)};return g("div",{sx:{width:h?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1?f("div",{sx:{mb:2},children:f(tm,{...g$1,onVariantLoad:J=>{De(J),g$1.onVariantLoad?.(J);},appId:g$1.appId,tableKey:b$1,currentLayout:[{tableKey:b$1,layoutData:dt}],currentLayoutId:Ft,layoutRefs:[{tableKey:b$1,layoutId:Ft}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl,touchMode:q==="portrait"?"expanded":"comfortable"})}):null,g(Ne,{sx:{width:h?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":ro?{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"}},...f$1?{height:f$1}:m?{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(gi,{filterText:B,setFilterText:G,onRowsPerPageChange:Ze,rowsPerPage:nt,rowsPerPageOptions:v,page:ye,count:xt,onPageChange:Oe,actions:d,extraTools:_e,grouping:xe,setGroupAnchorEl:Be,showSummary:pe,setShowSummary:oe,setAnchorEl:et,setSummaryAnchorEl:fe,handleExport:te,showCreateButton:he,onOpenCreateDialog:Ur,showEditButton:Ce,onOpenEditDialog:qr,editDisabled:W.length!==1,showDeleteButton:Ae,onOpenDeleteConfirm:Er,deleteDisabled:W.length===0,onLayoutSave:C||g$1?.variantService&&g$1?.appId?je:void 0,loading:p,layoutManager:_,onOpenGraphReport:ft?wt:void 0})}):null,f("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:g(ie,{spacing:1.25,children:[Re.length===0&&!p?R||f(Ne,{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:o("common.noData")})}):null,Re.map((J,Ee)=>{if(J.type==="group"){let Xe=Pe.has(J.id);return f(Ne,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g("div",{component:"button",type:"button",onClick:()=>ce(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(rn,{}):f(ti,{}),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"]})]}),xe.length>1&&J.level<xe.length-1?g(ie,{direction:"row",spacing:.5,children:[f(Ct,{size:"small",label:o("table.group.expandAll"),onClick:kt=>{kt.stopPropagation(),ve(J.id);},sx:Z}),f(Ct,{size:"small",label:o("table.group.collapseAll"),onClick:kt=>{kt.stopPropagation(),ee(J.id);},sx:Z})]}):null]})},J.id)}let Qe=J.data||J,Me=J.id||Qe[Ot]||Ee;return ue(Qe,Me,Ee)}),pe?f(ry,{summaryRow:K,visibleColumns:X,columns:V}):null,p?f(E,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:o("common.loading")}):null]})})]}),he?g(Et,{open:Q,onClose:()=>!ke&&ge(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:k?.title||o("quickCreate.createWithTitle",{title:O})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ho.map(J=>{let Ee=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=>Kr(J.id,Qe.target.value),type:Ee,fullWidth:true,InputLabelProps:{shrink:Ee==="date"?true:void 0}},`quick-create-${J.id}`)}),k?.description?f(Qo,{severity:"info",children:k.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Se,{onClick:()=>ge(false),disabled:ke,children:k?.cancelLabel||o("common.cancel")}),f(Se,{onClick:Ar,variant:"contained",disabled:ke,children:k?.submitLabel||o("common.save")})]})]}):null,Ce?g(Et,{open:ht,onClose:()=>!yt&&mt(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:S?.title||o("quickEdit.editWithTitle",{title:O})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[To.map(J=>{let Ee=J.type==="number"||J.numeric?"number":J.type==="date"?"date":"text";return f(He,{label:J.label||J.id,value:At[J.id]??"",onChange:Qe=>Xr(J.id,Qe.target.value),type:Ee,disabled:!Oo(J.id),fullWidth:true,InputLabelProps:{shrink:Ee==="date"?true:void 0}},`quick-edit-${J.id}`)}),S?.description?f(Qo,{severity:"info",children:S.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Se,{onClick:()=>mt(false),disabled:yt,children:S?.cancelLabel||o("common.cancel")}),f(Se,{onClick:Mo,variant:"contained",disabled:yt||!Y,children:S?.submitLabel||o("common.save")})]})]}):null,Ae?f(Xn,{open:Bt,type:"warning",title:P?.title||o("quickDelete.confirmTitle"),message:P?.message||(W.length>1?o("quickDelete.confirmMessageMultiple",{count:W.length}):o("quickDelete.confirmMessageSingle")),confirmText:P?.confirmText||o("common.delete"),cancelText:P?.cancelText||o("common.cancel"),onClose:()=>!Wt&&Gt(false),onConfirm:Zr}):null,re,ft?f(ki,{open:zt,onClose:Vt,model:Lr,aiAssistant:y?.aiAssistant,interaction:Dt?{enabled:true,filters:st.filters,fieldMapping:ar,onPrimaryDimensionClick:J=>st.setFilter("primaryDimension",J),onSecondaryDimensionClick:J=>st.setFilter("secondaryDimension",J),onStatusClick:J=>st.setFilter("status",J),onClearFilter:st.clearFilter,onClearAll:st.clearAll}:void 0,tableContent:f(ny,{appId:it||"graph-report-internal",title:o("graph.dataBody"),columns:D,rows:Lr.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var vF=({appTitle:t,children:o,menuData:r=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:l="auto",logo:d,headerSlot:u,actionSlot:m,portraitBottomSlot:h,contentSx:f$1,containerSx:p,user:v,onSearch:C,onSearchAdd:g$1,defaultNavigationOpen:x,navOpen:b,onNavOpenChange:y,onWorkloadSelect:k,locale:S="en",localeLabel:P,localeOptions:I,onLocaleChange:w,onUserSetting:M,onUserLogout:N,userMenuItems:T,leftHeaderSlot:R,rightHeaderSlot:A})=>{let L="orbcafe:page-layout-mode",[$,j]=useState("system"),[O,z]=useState("light"),[H,q]=useState(false),[V,B]=useState(false),G=$==="system"?V?O:"light":$;useEffect(()=>{q(true);},[]),useEffect(()=>{try{let rt=window.localStorage.getItem(L);(rt==="light"||rt==="dark"||rt==="system")&&j(rt);}catch{}B(true);let Ve=window.matchMedia("(prefers-color-scheme: dark)"),et=()=>{z(Ve.matches?"dark":"light");};return et(),Ve.addEventListener("change",et),()=>Ve.removeEventListener("change",et)},[]),useEffect(()=>{if(V)try{window.localStorage.setItem(L,$);}catch{}},[V,$]),useEffect(()=>{G==="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");},[G]);let X=Ro("(orientation: portrait)"),pe=Ro("(max-width: 899.95px)"),oe=l==="auto"?!H||X||pe?"portrait":"landscape":l,[me,xe]=useState({landscape:x??true,portrait:false}),ze=me[oe],Pe=b??ze,Te=Ve=>{b===void 0&&xe(et=>({...et,[oe]:Ve})),y?.(Ve);},Be=g(ie,{direction:"row",spacing:1,alignItems:"center",children:[!H||i&&oe==="portrait"?f(ae,{onClick:()=>Te(!Pe),sx:{bgcolor:"action.hover"},children:f(si,{})}):null,R]}),le=g(ie,{direction:"row",spacing:1,alignItems:"center",children:[m,A]}),fe=f(im,{collapsed:oe==="landscape"?!Pe:false,onToggle:()=>Te(!Pe),menuData:r,orientation:oe,colorMode:G,maxHeight:oe==="landscape"?900:void 0});return f(En,{mode:$,children:f(_a,{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(p)?p:[p]],children:[f(Wi,{appTitle:t,logo:d===void 0?null:d,mode:$,onToggleMode:()=>j(Ve=>Ve==="system"?"dark":Ve==="dark"?"light":"system"),locale:S,localeLabel:P,localeOptions:I,onLocaleChange:w,user:v,onUserSetting:M,onUserLogout:N,userMenuItems:T,onSearch:C,onSearchAdd:g$1,leftSlot:Be,rightSlot:le}),u?f("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:u}):null,g("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[H&&i&&oe==="landscape"?f("div",{sx:{p:1.5,pr:0,flexShrink:0},children:fe}):null,!H||i&&oe==="portrait"?f(Md,{open:Pe,onClose:()=>Te(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:fe}):null,f("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f$1},children:g(ie,{spacing:1.5,children:[s&&n.length>0?f(om,{items:n,selectedId:a,orientation:oe,onItemSelect:k}):null,f(Ne,{elevation:0,sx:{flex:1,minHeight:oe==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:"color-mix(in oklch, var(--orb-canvas) 72%, transparent)",backdropFilter:"blur(12px)",color:"text.primary"},children:o})]})})]}),oe==="portrait"&&h?g(e,{children:[f(Rt,{}),f("div",{sx:{p:1.5},children:h})]}):null]})})})};var lm=ay(()=>import('./COrbCanvas-4PZFJUYO.mjs').then(t=>t.COrbCanvas),{ssr:false,loading:()=>f("div",{className:"h-full w-full bg-transparent"})});function Al({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(lm,{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(lm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var SF=Al;var dm=createContext(null);function uy(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 my({children:t,onVoiceSubmit:o,onVoicePartial:r,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:l=true,wsUrl:d,silenceThresholdMs:u,minVolumeRms:m}){let[h,f$1]=useState(false),[p,v]=useState(false),C=useRef(null),g$1=useRef(false),x=useRef(false),b=useCallback(()=>{x.current=false,f$1(false);},[]),{isRecording:y,startRecording:k,stopRecording:S}=Cn({wsUrl:d,silenceThresholdMs:u,minVolumeRms:m,onTextUpdate:M=>{r?.(M);},onComplete:async M=>{try{M.trim()&&(v(!0),await o(M.trim()));}catch(N){let T=N instanceof Error?N.message:"Failed to process voice command";n?.(T);}finally{v(!1),b();}},onError:M=>{n?.(M),v(!1),g$1.current||b();}}),P=useCallback(async()=>{x.current=false,await k();},[k]),I=useCallback(()=>{S();},[S]);useEffect(()=>{if(i)return;let M=T=>{T.isComposing||(T.code==="Space"||T.key===" ")&&(g$1.current||T.repeat||s&&uy(document.activeElement)||(g$1.current=true,T.preventDefault(),C.current=setTimeout(()=>{x.current=true,f$1(true),k();},a)));},N=T=>{(T.code==="Space"||T.key===" ")&&(C.current&&(clearTimeout(C.current),C.current=null),g$1.current=false,x.current&&(T.preventDefault(),f$1(false),S()));};return window.addEventListener("keydown",M),window.addEventListener("keyup",N),()=>{window.removeEventListener("keydown",M),window.removeEventListener("keyup",N),C.current&&(clearTimeout(C.current),C.current=null);}},[i,s,a,k,S]);let w=useMemo(()=>({isRecording:y,isHotkeyRecording:h,isSubmitting:p,startRecording:P,stopRecording:I}),[h,y,p,P,I]);return g(dm.Provider,{value:w,children:[l?f(Al,{isRecording:h}):null,t]})}function gy(){let t=useContext(dm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var RF=my,DF=gy;function pt(...t){return twMerge(clsx(t))}var yy=({content:t,theme:o="light",size:r="base",defaultExpanded:n=false})=>{let[a,i]=useState(n),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(!a),children:[g("span",{className:"flex items-center",children:[f(Na,{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(Fo,{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})]})},pm=yy;var ky=({content:t,language:o="text",isStreaming:r=false,className:n=""})=>{let a=mo(),[i,s]=useState(false),l=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3);}catch(u){console.error("\u590D\u5236\u5931\u8D25:",u);}},d=a==="dark"?oneDark:oneLight;return g("div",{className:pt("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:o}),f("button",{onClick:l,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:r,title:i?"Copied":"Copy code",children:i?f(Do,{size:14,className:"text-[var(--orb-status-success)]"}):f(Tc,{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:a==="dark"?"var(--orb-surface-2)":"var(--orb-canvas)"},wrapLongLines:true,children:t})})]})},um=ky;var gm="orb-html-demo",hm="orb-html-demo-ping",os=16,My=2,Ry=2e3,Dy=300,Ny=96,Ay=200,Ey=560,Ly=320,Ol=`<script>(function(){var post=function(){var body=document.body;var height=Math.ceil(document.documentElement.scrollHeight);if(body){var style=getComputedStyle(body);height=Math.ceil(Math.max(body.offsetHeight,body.scrollHeight)+parseFloat(style.marginTop||'0')+parseFloat(style.marginBottom||'0'))}parent.postMessage({source:${JSON.stringify(gm)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);addEventListener('message',function(event){if(event.data&&event.data.source===${JSON.stringify(hm)})post()});new MutationObserver(post).observe(document.documentElement,{subtree:true,childList:true,attributes:true,characterData:true});var retries=0;var timer=setInterval(function(){post();retries+=1;if(retries>5)clearInterval(timer)},250);post()})()</script>`,Oy="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",Fy=t=>/<html[\s>]/i.test(t),By=t=>{let o=t.trim();return Fy(o)?/<\/body>/i.test(o)?o.replace(/<\/body>/i,`${Ol}</body>`):`${o}${Ol}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${Oy}</style></head><body>${o}${Ol}</body></html>`},Hy=t=>{let o=/<title[^>]*>([^<]+)<\/title>/i.exec(t)?.[1]?.trim();return o||(/<h1[^>]*>([^<]+)<\/h1>/i.exec(t)?.[1]?.trim()??null)},zy=t=>{if(t<1024)return `${t} B`;let o=t/1024;if(o<1024)return `${o<10?o.toFixed(1):Math.round(o)} KB`;let r=o/1024;return `${r<10?r.toFixed(1):Math.round(r)} MB`},Vy=t=>`${t.toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"interactive-demo"}.html`,Wy=(t,o)=>{let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=o,n.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3);},ha=new Map,Bl="orb-html-demo-store",$y=t=>t.replace(/^\s+/,"").slice(0,Ny),Fl=(t,o)=>{ha.set(t,o),window.dispatchEvent(new CustomEvent(Bl));},_y=({content:t,title:o})=>{let{t:r}=se(),n=mo(),a=$y(t),[i,s]=useState(()=>ha.get(a)?.open??false),[l,d]=useState(()=>ha.get(a)?.view??"preview"),[u,m]=useState(false),[h,f$1]=useState(Ly),p=useRef(null),v=useRef(null),C=useRef(false),g$1=useRef(false),x=useRef(t),b=R=>Fl(a,{open:R,view:l}),y=R=>Fl(a,{open:i,view:R}),k=()=>{g$1.current=true,b(false);};useEffect(()=>{let R=()=>{let A=ha.get(a);s(A?.open??false),d(A?.view??"preview");};return window.addEventListener(Bl,R),()=>window.removeEventListener(Bl,R)},[a]),useEffect(()=>{x.current!==t&&(x.current=t,ha.has(a)||Fl(a,{open:true,view:"preview"}));},[t,a]);let[S,P]=useState(t);useEffect(()=>{if(t===S)return;let R=window.setTimeout(()=>P(t),Dy);return ()=>window.clearTimeout(R)},[t,S]);let I=useMemo(()=>By(S),[S]);useEffect(()=>{if(!i)return;let R=A=>{let L=A.data;!L||L.source!==gm||typeof L.height!="number"||v.current&&A.source!==v.current.contentWindow||f$1(Math.max(Ay,Math.min(Ey,Math.ceil(L.height))));};return window.addEventListener("message",R),v.current?.contentWindow?.postMessage({source:hm},"*"),()=>window.removeEventListener("message",R)},[i]);let w=o??Hy(t)??r("agentui.html.defaultTitle"),M=useMemo(()=>new TextEncoder().encode(t).length,[t]);useEffect(()=>{if(!u)return;let R=window.setTimeout(()=>m(false),Ry);return ()=>window.clearTimeout(R)},[u]),useEffect(()=>{if(i){C.current=true;return}C.current&&(C.current=false,g$1.current&&(g$1.current=false,p.current?.focus()));},[i]);let N=()=>{navigator.clipboard.writeText(t).then(()=>m(true));},T=()=>Wy(new Blob([t],{type:"text/html;charset=utf-8"}),Vy(w));return i?g("section",{className:"orb-html-demo","aria-label":w,"data-view":l,children:[g("header",{className:"orb-html-demo-head",children:[f("span",{className:"orb-html-demo-glyph","aria-hidden":"true",children:"</>"}),f("span",{className:"orb-html-demo-head-title",title:w,children:w}),g("div",{className:"orb-segmented-control orb-html-demo-segment",role:"group","aria-label":r("agentui.html.toggle"),"data-has-selection":"true",style:{"--orb-segmented-count":My,"--orb-segmented-index":l==="code"?0:1},children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),f("button",{type:"button",className:"orb-segmented-control-item orb-segmented-control-item-label","data-selected":l==="code","aria-pressed":l==="code",onClick:()=>y("code"),children:r("agentui.html.code")}),f("button",{type:"button",className:"orb-segmented-control-item orb-segmented-control-item-label","data-selected":l==="preview","aria-pressed":l==="preview",onClick:()=>y("preview"),children:r("agentui.html.preview")})]}),g("div",{className:"orb-html-demo-actions",children:[f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r(u?"agentui.html.copied":"agentui.html.copy"),title:r(u?"agentui.html.copied":"agentui.html.copy"),onClick:N,children:u?f(Do,{size:os}):f(qo,{size:os})}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r("agentui.html.download"),title:r("agentui.html.download"),onClick:T,children:f(Ma,{size:os})}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r("agentui.html.close"),title:r("agentui.html.close"),onClick:k,children:f(Ut,{size:os})})]})]}),g("div",{className:"orb-html-demo-body",children:[f("iframe",{ref:v,className:"orb-html-demo-frame",title:w,sandbox:"allow-scripts",srcDoc:I,style:{height:h},hidden:l!=="preview"}),f("div",{className:"orb-html-demo-code",hidden:l!=="code",children:f(Prism,{language:"html",style:n==="dark"?oneDark:oneLight,customStyle:{margin:0,padding:"16px 20px",background:"transparent",fontSize:"13px",lineHeight:"1.6"},wrapLongLines:true,children:t})})]})]}):g("button",{ref:p,type:"button",className:"orb-html-demo-card","aria-expanded":false,onClick:()=>b(true),children:[f("span",{className:"orb-html-demo-glyph","aria-hidden":"true",children:"</>"}),g("span",{className:"orb-html-demo-info",children:[f("span",{className:"orb-html-demo-title",children:w}),g("span",{className:"orb-html-demo-meta",children:["HTML \xB7 ",zy(M)]})]}),f("span",{className:"orb-html-demo-openpill",children:r("agentui.html.open")})]})},fm=_y;var Ky=t=>{let o=/line (\d+)/i.exec(t)?.[1];return o?`Mermaid syntax error around line ${o} \u2014 expand for details`:"Mermaid syntax error \u2014 expand for details"},qy=({content:t,isLoading:o,className:r="",style:n})=>{let a=useRef(null),[i,s]=useState(false),[l,d]=useState(null),u=mo();return useEffect(()=>{let m=false,h=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{vm.initialize({startOnLoad:!1,theme:u==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit",flowchart:{htmlLabels:!1}});let p=`mermaid-${Math.random().toString(36).substr(2,9)}`,v=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:C,bindFunctions:g}=await vm.render(p,v);!m&&a.current&&(a.current.innerHTML=C,g?.(a.current));}catch(p){if(m)return;console.error("Mermaid render failed:",p),d(p instanceof Error?p.message:"Render failed");}finally{m||s(false);}}},f=setTimeout(()=>{h();},100);return ()=>{m=true,clearTimeout(f);}},[t,u]),g("div",{className:`mermaid-block ${r}`,style:n,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..."})]}),l&&g("div",{className:"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-3 text-sm text-[var(--orb-status-error)]",children:[f("p",{className:"font-medium",children:Ky(l)}),g("details",{className:"mt-1",children:[f("summary",{className:"cursor-pointer text-xs text-[var(--orb-muted)]",children:"Details & source"}),f("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words",children:l}),f("pre",{className:"mt-2 max-h-40 overflow-auto text-xs text-[var(--orb-muted)]",children:t})]})]}),f("div",{ref:a,className:`overflow-x-auto ${o||i||l?"hidden":""}`})]})},ym=qy;var Xy=({title:t="\u53D1\u751F\u9519\u8BEF",content:o,errorCode:r,stack:n,icon:a,closable:i=true,onClose:s,onRetry:l,className:d="",...u})=>{let[m,h]=useState(false),[f$1,p]=useState(false),v=async()=>{if(l){p(true);try{await l();}catch(C){console.error("\u91CD\u8BD5\u5931\u8D25:",C);}finally{p(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}`,...u,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(ka,{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}),(l||n)&&g("div",{className:"flex items-center space-x-4 mt-2",children:[l&&g("button",{onClick:v,disabled:f$1,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[f($c,{className:`w-3.5 h-3.5 mr-1.5 ${f$1?"animate-spin":""}`}),f$1?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&g("button",{onClick:()=>h(!m),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:[m?f(Fo,{className:"w-3.5 h-3.5 mr-1"}):f(Bo,{className:"w-3.5 h-3.5 mr-1"}),m?"\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(Ut,{className:"w-4 h-4"})})]}),n&&m&&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})})]})},rs=Xy;var Zy=({title:t="\u8B66\u544A",content:o,warningType:r,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:l,onConfirm:d,actionText:u,className:m="",...h})=>{let f$1=()=>{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)]"}}},p=()=>{switch(n){case "info":return f(Da,{className:"w-5 h-5"});case "error":return f(Ha,{className:"w-5 h-5"});case "success":return f(Pa,{className:"w-5 h-5"});default:return f(Sc,{className:"w-5 h-5"})}},v=f$1();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 ${m}`,...h,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||p()}),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}),a&&a.length>0&&f("ul",{className:"mt-2 space-y-1",children:a.map((C,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:C})]},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(Ut,{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:u||"\u786E\u8BA4"})})]})},ns=Zy;var Yy=({title:t="\u76F8\u5173\u63A8\u8350",content:o,suggestions:r,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:l,className:d="",...u})=>{let[m,h]=useState(false),[f$1,p]=useState(""),[v,C]=useState(false),g$1=useMemo(()=>f$1.trim()?r.filter(y=>y.toLowerCase().includes(f$1.toLowerCase())):r,[r,f$1]),x=useMemo(()=>m?g$1:g$1.slice(0,a),[g$1,m,a]),b=y=>{n?.(y);};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}`,...u,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(Na,{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:()=>C(!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(Ho,{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(Ut,{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:f$1,onChange:y=>p(y.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(Ho,{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((y,k)=>f("li",{children:g("button",{onClick:()=>b(y),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:y}),f(Bo,{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>a&&f("button",{onClick:()=>h(!m),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:m?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g$1.length})`}),g$1.length===0&&f$1&&f("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},as=Yy;var Qy=({title:t,content:o,toolName:r,parameters:n,result:a,status:i,duration:s,icon:l,closable:d=false,onClose:u,onAction:m,actionText:h,className:f$1="",...p})=>{let[v,C]=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"}}},y=()=>{switch(i){case "pending":return f(Oc,{className:"w-5 h-5 animate-spin"});case "error":return f(Ha,{className:"w-5 h-5"});default:return f(Pa,{className:"w-5 h-5"})}},k=I=>I?I<1e3?`${I}ms`:`${(I/1e3).toFixed(2)}s`:"",S=b(),P=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 ${f$1}`,...p,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||y()}),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:P}),f("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${S.badgeBg} ${S.badgeText}`,children:S.label})]}),r&&t&&g("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[f(Bn,{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(Ic,{className:"w-3 h-3 mr-1"}),k(s)]}),d&&u&&f("button",{onClick:u,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:f(Ut,{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}),n&&g("div",{className:"mb-3",children:[g("button",{onClick:()=>C(!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(Fo,{className:"w-3.5 h-3.5 mr-1"}):f(Bo,{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(Fo,{className:"w-3.5 h-3.5 mr-1"}):f(Bo,{className:"w-3.5 h-3.5 mr-1"}),f(Bn,{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)})})]}),m&&f("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:f("button",{onClick:m,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:h||"\u6267\u884C\u64CD\u4F5C"})})]})]})},is=Qy;var Jy=({data:t})=>{if(!t)return null;let o=useMemo(()=>{let r=[],n=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(r=t,r.length>0&&(n=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"&&(a=t.title||a,r=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})):r.length>0&&(n=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:a,columns:n,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(Jo,{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]})})},ss=Jy;var eC=({title:t,subtitle:o,data:r,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return f(Os,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return f(Lc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return f(Wc,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return f(wc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return f(Ac,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return f(Nc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return f(Xc,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return f(Fn,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return f(Bc,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return f(Os,{className:"w-4 h-4"})}},s=()=>{if(!r&&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(Jn,{data:r,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return f(Rp,{data:r,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let l=r.reduce((u,m)=>u+(Number(m.value)||0),0),d=r.map(u=>({name:u.name,value:Number(u.value)||0,percent:typeof u.percent=="number"?u.percent:l>0?(Number(u.value)||0)/l*100:0}));return f(xi,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return f(Dp,{data:r,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return f(Np,{data:r});case "fishbone-chart-card":return f(Ap,{branches:r,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return f(Ep,{data:r,height:a.height});case "google-map-card":return f(Lp,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,apiKey:a.apiKey,query:a.query||r&&r[0]?.query||t,height:a.height});case "amap-card":return f(Op,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,keyword:a.keyword||r&&r[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}),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)})]})})]})]})},ls=eC;var ms=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],tC={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},ps=480,Tn=214,_t={top:18,right:16,bottom:38,left:30},Jt=t=>typeof t=="number"&&Number.isFinite(t)?t:0,Pm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Uo=(t,o)=>`${t.id||t.label}-${o}`,Tm=(t,o=13)=>t.length>o?`${t.slice(0,Math.max(1,o-1))}\u2026`:t,us=(t,o,r)=>Math.min(r,Math.max(o,t)),mr=(t,o,r)=>t.color??r[o%r.length],gr=(t,o)=>o?{onMouseEnter:()=>o.onItemHoverStart?.(t),onMouseMove:()=>o.onItemHoverStart?.(t),onMouseLeave:()=>o.onItemHoverEnd?.(t),onContextMenu:r=>o.onItemContextMenu?.(r,t)}:{},Im=t=>{let o=t.map(a=>Jt(a.value)),r=Math.min(0,...o),n=Math.max(0,...o);return {min:r,max:n===r?r+1:n,range:n===r?1:n-r}},oC=(t,o,r)=>{let n=ps-_t.left-_t.right,a=Tn-_t.top-_t.bottom,{max:i,range:s}=Im(r),l=_t.left+t*n/Math.max(r.length-1,1),d=_t.top+(i-Jt(o.value))/s*a,u=_t.top+i/s*a;return {x:l,y:d,zeroY:u}},ds=(t,o,r,n)=>{let a=(n-90)*Math.PI/180;return {x:t+r*Math.cos(a),y:o+r*Math.sin(a)}},rC=(t,o,r,n,a,i)=>{let s=ds(t,o,r,i),l=ds(t,o,r,a),d=i-a>180?1:0;if(n===0)return `M ${t} ${o} L ${s.x} ${s.y} A ${r} ${r} 0 ${d} 0 ${l.x} ${l.y} Z`;let u=ds(t,o,n,i),m=ds(t,o,n,a);return `M ${s.x} ${s.y} A ${r} ${r} 0 ${d} 0 ${l.x} ${l.y} L ${m.x} ${m.y} A ${n} ${n} 0 ${d} 1 ${u.x} ${u.y} Z`},nC=({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})]}),aC=()=>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"})]}),Vl=({item:t,onItemClick:o,interactions:r})=>{let n=()=>o?.(t);return {...o?{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{o&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n());}}:{},...gr(t,r),style:{cursor:o||r?"pointer":"default"}}},iC=({loading:t,error:o,hasData:r,emptyState:n,children:a})=>t?f(aC,{}):o?f("div",{className:"orb-metric-error",role:"alert",children:o}):r?f(e,{children:a}):f(nC,{children:n??"No data for the current selection."}),sC=({data:t,activeId:o,onItemClick:r,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 u=Jt(l.value),m=`${us(Math.abs(u)/s*100,0,100)}%`,h=o===l.id,f$1=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${h?" is-active":""}`,style:{width:m,backgroundColor:mr(l,d,i)}})}),f("span",{className:"orb-metric-bar-value",children:a(u)})]});return r?f("button",{type:"button",className:`orb-metric-bar-row${h?" is-active":""}`,onClick:()=>r(l),title:`${l.label}: ${a(u)}`,"aria-pressed":h,...gr(l,n),children:f$1},Uo(l,d)):f("div",{className:`orb-metric-bar-row${h?" is-active":""}`,role:"listitem",...gr(l,n),children:f$1},Uo(l,d))})})},lC=({data:t,activeId:o,onItemClick:r,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 u=Math.max(Jt(l.value),0),m=us(u/s*100,0,100),h=o===l.id,f$1=g(e,{children:[g("span",{className:"orb-metric-progress-heading",children:[f("span",{title:l.label,children:l.label}),f("strong",{children:a(u)})]}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:"orb-metric-bar-fill",style:{width:`${m}%`,backgroundColor:mr(l,d,i)}})})]});return r?f("button",{type:"button",className:`orb-metric-progress-row${h?" is-active":""}`,onClick:()=>r(l),"aria-pressed":h,...gr(l,n),children:f$1},Uo(l,d)):f("div",{className:`orb-metric-progress-row${h?" is-active":""}`,role:"listitem",...gr(l,n),children:f$1},Uo(l,d))})})},cC=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:l,ariaLabel:d})=>{let{min:u,max:m,range:h}=Im(o),f$1=ps-_t.left-_t.right,p=Tn-_t.top-_t.bottom,v=_t.top+m/h*p,C=Math.max(1,Math.ceil(o.length/6)),g$1=o.map((y,k)=>oC(k,y,o)),x=g$1.map(y=>`${y.x},${y.y}`).join(" "),b=Math.max(...o.map(y=>Math.max(Jt(y.secondaryValue),0)),1);return f("div",{className:"orb-metric-svg-wrap",children:g("svg",{className:"orb-metric-svg",viewBox:`0 0 ${ps} ${Tn}`,role:"img","aria-label":d,children:[f("line",{className:"orb-metric-axis",x1:_t.left,y1:v,x2:ps-_t.right,y2:v}),f("line",{className:"orb-metric-grid",x1:_t.left,y1:_t.top,x2:_t.left,y2:Tn-_t.bottom}),t==="column"&&o.map((y,k)=>{let S=g$1[k],P=Jt(y.value),I=Math.max(Math.abs(S.y-v),P===0?2:0),w=S.x-Math.min(18,f$1/Math.max(o.length*2,1)),M=Math.min(36,Math.max(10,f$1/Math.max(o.length*1.8,1))),N=r===y.id;return g("g",{...Vl({item:y,onItemClick:n,interactions:a}),"aria-label":`${y.label}: ${i(P)}`,children:[f("rect",{className:`orb-metric-column${N?" is-active":""}`,x:w,y:Math.min(S.y,v),width:M,height:I,rx:4,fill:mr(y,k,l)}),g("title",{children:[y.label,": ",i(P)]}),(k%C===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:S.x,y:Tn-14,textAnchor:"middle",children:Tm(y.label)})]},Uo(y,k))}),(t==="line"||t==="scatter"||t==="bubble")&&g(e,{children:[t==="line"&&f("polyline",{className:"orb-metric-line",fill:"none",points:x,stroke:l[0]}),o.map((y,k)=>{let S=g$1[k],P=r===y.id,I=t==="bubble"?7+Math.max(Jt(y.secondaryValue),0)/b*12:t==="scatter"?5:4;return g("g",{...Vl({item:y,onItemClick:n,interactions:a}),"aria-label":`${y.label}: ${i(Jt(y.value))}`,children:[t==="line"&&f("circle",{className:`orb-metric-point${P?" is-active":""}`,cx:S.x,cy:S.y,r:P?6:4,fill:mr(y,k,l)}),t!=="line"&&f("circle",{className:`orb-metric-point${P?" is-active":""}`,cx:S.x,cy:S.y,r:I,fill:mr(y,k,l),opacity:t==="bubble"?.82:.9}),g("title",{children:[y.label,": ",i(Jt(y.value)),t==="bubble"&&y.secondaryValue!==void 0?` \xB7 Size: ${s(Jt(y.secondaryValue))}`:""]}),(k%C===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:S.x,y:Math.max(_t.top+8,S.y-I-7),textAnchor:"middle",children:Tm(y.label)})]},Uo(y,k))})]}),f("text",{className:"orb-metric-axis-label",x:_t.left,y:_t.top-5,children:i(m)}),u<0&&f("text",{className:"orb-metric-axis-label",x:_t.left,y:Tn-_t.bottom+14,children:i(u)})]})})},dC=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,colors:s,ariaLabel:l})=>{let d=o.map(p=>({...p,value:Math.max(Jt(p.value),0)})),u=d.reduce((p,v)=>p+v.value,0),m=72,h=92,f$1=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((p,v)=>{let C=p.value/u*360,g$1=f$1;f$1+=C;let x=r===p.id,b=C>=359.9?void 0:rC(h,h,m,t==="donut"?46:0,g$1,g$1+C),y=Vl({item:p,onItemClick:n,interactions:a});return b?f("path",{className:`orb-metric-slice${x?" is-active":""}`,d:b,fill:mr(p,v,s),...y,children:g("title",{children:[p.label,": ",i(p.value)," (",(p.value/u*100).toFixed(1),"%)"]})},Uo(p,v)):f("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:h,cy:h,r:t==="donut"?60:m,fill:t==="donut"?"none":mr(p,v,s),stroke:t==="donut"?mr(p,v,s):void 0,strokeWidth:28,...y,children:g("title",{children:[p.label,": ",i(p.value)," (100%)"]})},Uo(p,v))}),t==="donut"&&f("circle",{cx:h,cy:h,r:44,fill:"var(--orb-surface)"}),t==="donut"&&f("text",{className:"orb-metric-donut-total",x:h,y:h+5,textAnchor:"middle",children:i(u)})]}),f("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((p,v)=>{let C=r===p.id;return g("button",{type:"button",className:`orb-metric-legend-item${C?" is-active":""}`,onClick:()=>n?.(p),disabled:!n,title:p.label,...gr(p,a),children:[f("span",{className:"orb-metric-legend-dot",style:{backgroundColor:mr(p,v,s)}}),f("span",{className:"orb-metric-legend-label",children:p.label}),g("strong",{children:[(p.value/u*100).toFixed(0),"%"]})]},Uo(p,v))})})]})},pC=({data:t,activeId:o,onItemClick:r,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 r?f("button",{type:"button",className:`orb-metric-list-row${o===s.id?" is-active":""}`,onClick:()=>r(s),"aria-pressed":o===s.id,...gr(s,n),children:d},Uo(s,l)):f("div",{className:`orb-metric-list-row${o===s.id?" is-active":""}`,role:"listitem",...gr(s,n),children:d},Uo(s,l))})}),gs=({title:t,subtitle:o,data:r=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:l,valueFormatter:d=Pm,secondaryValueFormatter:u=Pm,valueLabel:m,secondaryValueLabel:h,emptyState:f$1,loading:p=false,error:v,maxItems:C=8,showChartTypeControl:g$1=true,showDataDetails:x=true,dataRevealDelayMs:b=1e3,chartTypeOptions:y,chartTypeLabels:k,footer:S,ariaLabel:P,className:I,style:w,sx:M})=>{let N=Ls(),T=useRef(null),R=useRef(null),[A,L]=useState(n),[$,j]=useState(false),[O,z]=useState(null),[H,q]=useState(null);useEffect(()=>L(n),[n]);let V=useCallback(()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null);},[]);useEffect(()=>V,[V]),useEffect(()=>{if(!H)return;let K=Re=>{let ye=Re.target;ye instanceof HTMLElement&&ye.closest(".orb-metric-context-menu")||q(null);};return document.addEventListener("pointerdown",K),()=>document.removeEventListener("pointerdown",K)},[H]);let B=A,G=useMemo(()=>[N.chart1,N.chart2,N.chart3,N.chart4,N.chart5,N.chart6],[N]),X=useMemo(()=>$?r:r.slice(0,Math.max(1,C)),[r,C,$]),pe=Math.max(0,r.length-X.length),oe=X.some(K=>Jt(K.value)>0),me=X.length>0&&(B!=="pie"&&B!=="donut"?true:oe),xe=(y??[B,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((K,Re,ye)=>ms.includes(K)&&ye.indexOf(K)===Re),ze={...tC,...k},Pe=X[0],Te=P??`${t} ${ze[B]} chart`,Be=K=>{L(K),a?.(K);},le=useCallback((K,Re)=>{z({item:K,source:Re}),q(null),s?.(K,Re);},[s]),fe=useCallback(K=>{V(),!(!x||H)&&(R.current=window.setTimeout(()=>{le(K,"hover"),R.current=null;},Math.max(0,b)));},[V,H,b,le,x]),Ve=useCallback(()=>{V();},[V]),et=useCallback((K,Re)=>{if(!x)return;K.preventDefault(),V();let ye=T.current?.getBoundingClientRect(),Oe=ye?us(K.clientX-ye.left,8,Math.max(8,ye.width-164)):8,nt=ye?us(K.clientY-ye.top,8,Math.max(8,ye.height-72)):8;q({item:Re,left:Oe,top:nt});},[V,x]),rt=x?{onItemHoverStart:fe,onItemHoverEnd:Ve,onItemContextMenu:et}:void 0,at=B==="metric"?g("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>Pe&&i?.(Pe),onKeyDown:K=>{Pe&&i&&(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),i(Pe));},"aria-label":Te,...Pe?gr(Pe,rt):{},children:[f("span",{className:"orb-metric-kpi-label",children:Pe?.label??m??"Value"}),f("strong",{children:Pe?d(Jt(Pe.value)):"\u2014"}),Pe?.secondaryValue!==void 0&&g("span",{className:"orb-metric-kpi-secondary",children:[h??"Compared with"," \xB7 ",u(Jt(Pe.secondaryValue))]})]}):B==="progress"?f(lC,{data:X,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,colors:G}):B==="bar"?f(sC,{data:X,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,colors:G}):B==="list"?f(pC,{data:X,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,secondaryValueFormatter:u}):B==="pie"||B==="donut"?f(dC,{type:B,data:X,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,colors:G,ariaLabel:Te}):f(cC,{type:B,data:X,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,secondaryValueFormatter:u,colors:G,ariaLabel:Te});return g("div",{ref:T,className:"orb-metric-chart-shell",onMouseLeave:()=>{V(),O?.source==="hover"&&z(null);},children:[g(Ne,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${I??""}`,style:w,sx:M,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}),o&&f(E,{variant:"caption",muted:true,component:"div",noWrap:true,children:o})]}),g$1&&xe.length>1&&f(Ht,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:B,options:xe.map(K=>({value:K,label:ze[K]})),onChange:K=>Be(K.target.value),minWidth:108,fullWidth:false,size:"small"})]}),g("div",{className:"orb-metric-chart-body",children:[f(iC,{loading:p,error:v,hasData:me,emptyState:f$1,children:at}),pe>0&&!p&&!v&&f("button",{type:"button",className:"orb-metric-more",onClick:()=>j(K=>!K),children:$?"Show fewer":`Show all ${r.length}`})]}),S&&f("div",{className:"orb-metric-chart-footer",children:S})]}),H&&g("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:V,onKeyDown:K=>{K.key==="Escape"&&q(null);},style:{left:H.left,top:H.top},onPointerDown:K=>K.stopPropagation(),children:[f("div",{className:"orb-metric-context-label",children:H.item.label}),f("button",{type:"button",role:"menuitem",onClick:K=>{K.preventDefault(),K.stopPropagation(),le(H.item,"contextmenu");},children:"Show data"})]}),O&&g("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${O.item.label} data details`,onPointerDown:K=>K.stopPropagation(),children:[g("div",{className:"orb-metric-data-details-header",children:[f("strong",{children:O.item.label}),f("button",{type:"button","aria-label":"Close data details",onClick:()=>z(null),children:"\xD7"})]}),g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:m??"Value"}),f("strong",{children:d(Jt(O.item.value))})]}),O.item.secondaryValue!==void 0&&g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:h??"Secondary value"}),f("strong",{children:u(Jt(O.item.secondaryValue))})]}),f("span",{className:"orb-metric-data-details-hint",children:O.source==="hover"?`Shown after ${Math.max(0,b)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};gs.displayName="CMetricChartCard";var uC=({messageId:t,cardHooks:o,valueSuffix:r,secondaryValueSuffix:n,...a})=>{let i=(l,d)=>{o?.onCardEvent?.({messageId:t,cardType:"metric-chart-card",action:l,title:a.title,payload:d,rawData:a});},s=(l,d)=>`${l.toLocaleString()}${d??""}`;return f(gs,{...a,valueFormatter:l=>s(l,r),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})})},hs=uC;var mC=({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)})})})]}),fs=mC;var gC=t=>Array.isArray(t)?t.flatMap((o,r)=>{if(!o||typeof o!="object")return [];let n=o,a=String(n.label??n.name??n.id??`Item ${r+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??r),label:a,value:s,...l!==void 0&&Number.isFinite(l)?{secondaryValue:l}:{},...typeof n.color=="string"?{color:n.color}:{}}]}):[],bs=t=>{let o;try{o=JSON.parse(t);}catch{return null}if(o&&typeof o=="object"){if(o.type==="metric-chart-card"&&o.title&&Array.isArray(o.data)){let r=ms.includes(o.chartType)?o.chartType:"bar";return {...o,type:"metric-chart-card",chartType:r,data:gC(o.data)}}if((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)return o}return null};var xC=({content:t,theme:o,size:r="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:l})=>{let d=useRef(l);d.current=l;let u=!!l?.onCardEvent,m=useMemo(()=>u?{onCardEvent:C=>d.current?.onCardEvent?.(C)}:void 0,[u]),h=useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(C,g)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(g.trim())}"></div>`):"",[t]),f$1=(C,g,x,b,y)=>{m?.onCardEvent?.({messageId:s,cardType:C,action:g,title:x,payload:b,rawData:y});},p=(C,g,x,b,y,k)=>{if(!(!y&&!m?.onCardEvent))return (...S)=>{let P=y?.(...S),I=k?k(...S):void 0;return f$1(C,g,x,I,b),P}},v=useMemo(()=>({div(C){let{"data-component":g,"data-think-content":x,...b}=C;return g==="thinkbox"&&x?f(pm,{content:decodeURIComponent(x),theme:o,size:r,defaultExpanded:false}):f("div",{...b})},table({children:C}){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:C})})},thead({children:C}){return f("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:C})},tbody({children:C}){return f("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:C})},tr({children:C}){return f("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:C})},th({children:C,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:C})},td({children:C,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:C})},code({className:C,children:g,...x}){let b=/language-([\w-]+)/.exec(C||""),y=b?b[1]:"",k=String(g);if(!b&&!k.includes(`
|
|
17
|
-
`))return f("code",{children:g});let P=k.replace(/\n$/,"");if(i&&y==="mermaid")return f(ym,{content:P});if(y==="html"||y==="htm")return f(fm,{content:P});if(y==="json"){let I=bs(P);if(I)switch(I.type){case "table":return f(ss,{data:I.data});case "metric-chart-card":return f(hs,{...I,messageId:s,cardHooks:m});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(ls,{...I});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(fs,{...I});case "error-card":{let w=I;return f(rs,{...w,onClose:p("error-card","close",w.title,w,w.onClose),onRetry:p("error-card","retry",w.title,w,w.onRetry)})}case "warning-card":{let w=I,M=w.onConfirm?p("warning-card","confirm",w.title,w,w.onConfirm):w.actionText&&m?.onCardEvent?p("warning-card","confirm",w.title,w):void 0;return f(ns,{...w,onClose:p("warning-card","close",w.title,w,w.onClose),onConfirm:M})}case "suggestions-card":{let w=I;return f(as,{...w,onClose:p("suggestions-card","close",w.title,w,w.onClose),onSuggestionClick:p("suggestions-card","suggestion-click",w.title,w,w.onSuggestionClick,M=>({suggestion:M}))})}case "tool-result-card":{let w=I;return f(is,{...w,onClose:p("tool-result-card","close",w.title,w,w.onClose),onAction:p("tool-result-card","action",w.title,w,w.onAction)})}}}return a?f(um,{content:P,language:y,className:"not-prose"}):f("code",{className:C,...x,children:g})}}),[o,r,i,a,m,s]);return f("div",{className:pt("markdown-body max-w-none",n),children:f(fC,{remarkPlugins:[bC,vC],rehypePlugins:[yC,CC],components:v,children:h})})},In=xC;var wC=({content:t,messageId:o,cardHooks:r})=>{let n=(s,l,d,u,m)=>{r?.onCardEvent?.({messageId:o,cardType:s,action:l,title:d,payload:u,rawData:m});},a=(s,l,d,u,m,h)=>{if(!(!m&&!r?.onCardEvent))return (...f)=>{let p=m?.(...f),v=h?h(...f):void 0;return n(s,l,d,v,u),p}},i=bs(t);if(i)switch(i.type){case "table":return f(ss,{data:i.data});case "metric-chart-card":return f(hs,{...i,messageId:o,cardHooks:r});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(ls,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(fs,{...i});case "error-card":{let s=i;return f(rs,{...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&&r?.onCardEvent?a("warning-card","confirm",s.title,s):void 0;return f(ns,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:l})}case "suggestions-card":{let s=i;return f(as,{...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(is,{...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(In,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r})})},Mm=wC;var $l=class{static analyze(o){if(!o.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let n=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(o),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(o),i=o.includes("NQ#")||o.includes("data-component");return n||a||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"}}},kC=({content:t,className:o="",messageId:r,cardHooks:n})=>{let a=jt__default.useMemo(()=>$l.analyze(t),[t]);return f("div",{className:`universal-content-renderer ${o}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?f(Mm,{content:i.content,messageId:r,cardHooks:n},`block-${s}`):f(In,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:n},`block-${s}`))})},vs=kC;var PC=({content:t,isStreaming:o=true,onComplete:r,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:l})=>{let[d,u]=useState(o?0:t.length),[m,h]=useState(!o);useEffect(()=>{if(o){u(0),h(false);return}u(t.length),h(true);},[t,o]),useEffect(()=>{if(!o||m)return;if(d>=t.length){h(true),r?.();return}let g=window.setTimeout(()=>{u(x=>Math.min(x+i,t.length));},a);return ()=>{window.clearTimeout(g);}},[t.length,m,o,r,i,a,d]);let f$1=()=>{o&&!m&&(u(t.length),h(true),r?.());},p=o?t.slice(0,d):t,v=o&&!m,C=o&&!m;return g("div",{className:`streaming-markdown ${n}`,onClick:f$1,style:{cursor:o?"pointer":"default"},children:[g("div",{className:"relative",children:[f(vs,{content:p,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)"}})]}),C&&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"})]})},Nm=PC;var Am=({buttons:t,className:o})=>{let r=n=>{switch(n){case "copy":return f(qo,{size:14});case "refresh":return f(Fa,{size:14});case "volume":return f(Yc,{size:14});case "like":return f(Kc,{size:14});case "dislike":return f(Uc,{size:14});default:return null}};return f("div",{className:pt("flex items-center gap-1",o),children:t.map((n,a)=>f("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:pt("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:r(n.type)},`${n.type}-${a}`))})};var ys=({message:t,onStreamingComplete:o,assistantActions:r,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=!!(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(Nm,{content:t.content,isStreaming:t.isStreaming??false,onComplete:o,streamIntervalMs:n,streamChunkSize:a,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(Am,{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: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 Em=({onTextUpdate:t,onComplete:o,onCancel:r,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:l}=Cn({onTextUpdate:t,onComplete:u=>{o?.(u);},onError:u=>{console.error("Voice input error:",u),r?.();}});return f("button",{onClick:async()=>{i?l():await s();},disabled:n,className:pt("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(tp,{size:16}):f(op,{size:16})})};var lo={container:"w-full max-w-4xl mx-auto",inputContainer:pt("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[color-mix(in_oklch,var(--orb-canvas)_64%,transparent)] backdrop-blur-[28px] 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:pt("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:pt("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:pt("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:pt("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:pt("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:pt("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95")},IC={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},MC=({enabled:t,onClick:o})=>{let{t:r}=se();return f("button",{className:pt(lo.buttonBase,lo.buttonSmall,lo.buttonNormal),onClick:o,disabled:!t,"aria-label":r("omph.input.upload"),type:"button",children:f(Ld,{size:16})})},RC=({canSend:t,isResponding:o,onSend:r,onStop:n})=>{let{t:a}=se();return o?f("button",{className:pt(lo.buttonBase,lo.buttonSmall,lo.stopButton),onClick:n,"aria-label":a("omph.input.stop"),type:"button",children:f(pp,{size:15})}):f("button",{className:pt(lo.buttonBase,lo.buttonSmall,t?lo.sendButton:lo.sendButtonDisabled),onClick:r,disabled:!t,"aria-label":a("omph.input.send"),type:"button",children:f(ip,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})})},_l=({onSend:t,onStop:o,isResponding:r=false,placeholder:n,getText:a})=>{let[i,s]=useState(""),[l,d]=useState([]),[u,m]=useState(false),[h,f$1]=useState(false),p=useRef(null),{t:v}=se(),C=v("omph.input.placeholder"),g$1=C!=="omph.input.placeholder"?C:"Type a message...",x=n||(a?a("00019",g$1):g$1),b=(i.trim().length>0||l.length>0)&&!r,y={enabled:true},k=useCallback(z=>{s(z.target.value),z.target.style.height="auto",z.target.style.height=`${Math.min(z.target.scrollHeight,200)}px`;},[]),S=useCallback(z=>{if(z.target.files&&z.target.files.length>0){let H=Array.from(z.target.files);d(q=>{let V=H.filter(G=>q.some(X=>X.name===G.name&&X.size===G.size));V.length>0&&console.warn("Duplicate files ignored:",V.map(G=>G.name));let B=H.filter(G=>!q.some(X=>X.name===G.name&&X.size===G.size));return [...q,...B]}),p.current&&(p.current.value="");}},[]),P=useCallback(z=>{d(H=>H.filter((q,V)=>V!==z));},[]),I=useCallback(()=>{p.current?.click();},[]),w=useCallback(async()=>{if(!b)return;let z=i,H=[...l];s(""),d([]),p.current&&(p.current.value="");try{await t(z,H);}catch(q){console.error("Failed to send message:",q),s(z),d(H);}},[i,b,t,l]),M=useCallback(z=>{z.key==="Enter"&&!z.shiftKey&&!u&&(z.preventDefault(),w());},[w,u]),N=useCallback(()=>{m(true);},[]),T=useCallback(()=>{m(false);},[]),R=useCallback(z=>{s(z);},[]),A=useCallback(z=>{s(z);},[]),L=useCallback(()=>{},[]),$=useCallback(z=>{z.preventDefault(),f$1(true);},[]),j=useCallback(z=>{z.preventDefault(),f$1(false);},[]),O=useCallback(z=>{if(z.preventDefault(),f$1(false),z.dataTransfer.files&&z.dataTransfer.files.length>0){let H=Array.from(z.dataTransfer.files);d(q=>[...q,...H]);}},[]);return f("div",{className:lo.container,children:g("div",{className:"relative",children:[f("input",{type:"file",multiple:true,className:"hidden",ref:p,onChange:S}),g("div",{className:pt(lo.inputContainer,h&&lo.dragActive),onDragOver:$,onDragLeave:j,onDrop:O,children:[l.length>0&&f("div",{className:lo.filePreviewArea,children:l.map((z,H)=>g("div",{className:lo.fileTag,children:[f(Yd,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),f("span",{className:"truncate max-w-[150px]",children:z.name}),f("button",{onClick:()=>P(H),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:f($d,{sx:{fontSize:16}})})]},`${z.name}-${H}`))}),g("div",{className:"flex w-full flex-col p-2",children:[f("div",{className:pt(lo.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:f("textarea",{className:pt(lo.textarea,"min-h-[24px] py-0 px-0"),placeholder:x,value:i,onChange:k,onKeyDown:M,onCompositionStart:N,onCompositionEnd:T,style:IC,"aria-label":v("omph.input.message"),spellCheck:false,rows:1})}),g("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[f("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":v("omph.input.tools"),children:f(MC,{enabled:y.enabled,onClick:I})}),g("div",{className:"flex items-center gap-1",children:[f(Em,{onTextUpdate:R,onComplete:A,onCancel:L,disabled:r,className:lo.buttonSmall}),f(RC,{canSend:b,isResponding:r,onSend:w,onStop:o})]})]})]})]})]})})};var Om=({messages:t,onSend:o,onStop:r,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:l,streamChunkSize:d,onMessageStreamingComplete:u,cardHooks:m,showInput:h=true,statusLine:f$1})=>{let p=useRef(null),v=useRef(t.length);return useEffect(()=>{t.length>v.current&&p.current?.scrollIntoView({behavior:"smooth"}),v.current=t.length;},[t]),g("div",{className:pt("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((C,g)=>{let x=C.type==="assistant"&&g===t.length-1,b=C.type==="assistant"?{isLatestAssistant:x,isResponding:a,onRegenerate:n?()=>n(C.id):void 0}:void 0;return f(ys,{message:C,assistantActions:b,onStreamingComplete:()=>u?.(C.id),streamIntervalMs:l,streamChunkSize:d,cardHooks:m},C.id)}),f$1,f("div",{ref:p})]}),h&&f("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:f(_l,{onSend:o||(async()=>{}),onStop:r||(()=>{}),isResponding:a,placeholder:s})})]})};var Fm={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},Bm=({title:t="AI Agent",description:o,headerActions:r,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:l=false,...d})=>{let u=a??(d.isResponding?"running":"idle"),m=u==="running"||u==="pending",h=[Fm[u],o].filter(Boolean).join(" \xB7 ");return g("div",{className:pt("orb-agent-panel",n),children:[g("div",{className:pt("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":m||void 0}),f("span",{className:"truncate",children:h||"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(Om,{...d,showInput:l,statusLine:m?g("div",{className:pt("orb-agent-status-line","mb-1"),children:[f("span",{className:"orb-agent-spinner","aria-hidden":"true"}),f("span",{children:i??`${Fm[u]}\u2026`})]}):void 0})})]})};var EC=t=>Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t),zm=({conversations:t,activeConversationId:o,labels:r,onNewConversation:n,onSelectConversation:a})=>{let[i,s]=useState(false),l=useRef(null),d=useRef(null),u=useRef(null),m=useId(),h=!!a;useEffect(()=>{if(!i)return;let p=C=>{l.current?.contains(C.target)||s(false);},v=C=>{C.key==="Escape"&&(C.stopPropagation(),s(false),u.current?.focus());};return document.addEventListener("pointerdown",p),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",p),document.removeEventListener("keydown",v);}},[i]),useEffect(()=>{if(!i)return;let p=d.current?.querySelector('[aria-selected="true"]'),v=d.current?.querySelector('[role="option"]');(p??v)?.focus();},[i]);let f$1=p=>{let v=Array.from(d.current?.querySelectorAll('[role="option"]')??[]);if(v.length===0)return;let C=v.findIndex(x=>x===document.activeElement),g=C<0?p===1?0:v.length-1:(C+p+v.length)%v.length;v[g]?.focus();};return !n&&!h?null:g(e,{children:[n&&f("button",{type:"button",className:"orb-omph-icon-btn","aria-label":r.newConversation,onClick:()=>{s(false),n();},children:f(jr,{size:16})}),h&&a&&g("div",{className:"orb-omph-conversation-anchor",ref:l,children:[f("button",{ref:u,type:"button",className:"orb-omph-icon-btn","aria-label":r.conversationList,"aria-expanded":i,"aria-controls":m,onClick:()=>s(p=>!p),children:f(Hc,{size:16})}),i&&f("div",{ref:d,id:m,className:"orb-omph-conversations",role:"listbox","aria-label":r.conversations,onKeyDown:p=>{p.key==="ArrowDown"?(p.preventDefault(),f$1(1)):p.key==="ArrowUp"&&(p.preventDefault(),f$1(-1));},children:t.length===0?f("p",{className:"orb-omph-conversation-empty",children:r.noConversations}):t.map(p=>{let v=p.updatedAt?EC(p.updatedAt):"",C=[p.preview,v].filter(x=>x&&x.length>0).join(" \xB7 "),g$1=p.id===o;return g("button",{type:"button",role:"option",className:"orb-omph-conversation","aria-selected":g$1,"data-active":g$1||void 0,onClick:()=>{a(p.id),s(false);},children:[f("span",{className:"orb-omph-conversation-title",children:p.title}),C&&f("span",{className:"orb-omph-conversation-meta",children:C})]},p.id)})})]})]})};var zC=2e3,VC=1/3,xs=[.25,.5,.75,1,1.5,2,3,4],WC=100,Vm={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},Wm=({text:t,language:o,startLine:r,endLine:n,wrap:a,labels:i})=>{let s=useRef(null),l=useMemo(()=>{let m=t.split(`
|
|
18
|
-
`);
|
|
19
|
-
`),shownCount:h,total:m.length}},[t]),d=useCallback(m=>{let h=n??r,f=r!==void 0&&h!==void 0&&m>=r&&m<=h;return {className:"orb-omph-code-line","data-line":m,...f?{"data-hit":"true"}:{}}},[n,r]);useEffect(()=>{let m=s.current,h=m?.closest(".orb-omph-pv-body");if(!m||!h)return;if(r===void 0){h.scrollTop=0;return}let f=m.querySelector(`[data-line="${r}"]`);if(!f)return;let p=f.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop;h.scrollTop=Math.max(0,p-h.clientHeight*VC);},[r,l.shown]);let u={"--orb-omph-digits":String(l.shownCount).length};return g("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:u,children:[f(Prism,{language:o,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:d,customStyle:Vm,codeTagProps:{className:`language-${o}`,style:Vm},children:l.shown}),l.total>l.shownCount&&f("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},$m=({text:t})=>f("div",{className:"orb-omph-pv-doc",children:f(In,{content:t})}),_m=({url:t,alt:o,labels:r})=>{let[n,a]=useState("fit"),[i,s]=useState(null),[l,d]=useState(false),u=n==="fit"?1:n,m=xs.some(v=>v>u),h=xs.some(v=>v<u),f$1=v=>a(C=>{let g=C==="fit"?1:C;return (v>0?xs.find(b=>b>g):[...xs].reverse().find(b=>b<g))??C}),p=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:o?`${r.imageFailed} \xB7 ${o}`:r.imageFailed}):g("div",{className:"orb-omph-img",children:[f("div",{className:"orb-omph-img-stage",children:f("img",{src:t,alt:o??"",draggable:false,style:p,onLoad:v=>s(v.currentTarget.naturalWidth),onError:()=>d(true)})}),g("div",{className:"orb-omph-img-zoom",role:"group","aria-label":r.zoomFit,children:[f("button",{type:"button","aria-label":r.zoomOut,disabled:!h,onClick:()=>f$1(-1),children:"\u2212"}),f("button",{type:"button","aria-label":r.zoomFit,"data-active":n==="fit"||void 0,onClick:()=>a("fit"),children:n==="fit"?r.zoomFit:`${Math.round(n*WC)}%`}),f("button",{type:"button","aria-label":r.zoomIn,disabled:!m,onClick:()=>f$1(1),children:"+"})]})]})};var $C=/^[a-z][a-z0-9+.-]*:/i,_C=/^L(\d+)(?:-L?(\d+))?$/i;var Gm=["B","KB","MB","GB"];var GC=t=>{try{return decodeURIComponent(t)}catch{return t}},Kl=t=>{let o=t.trim();if(!o||o.startsWith("#")||o.startsWith("//")||$C.test(o))return null;let r=o.indexOf("#"),n=r>=0?o.slice(0,r):o,a=r>=0?o.slice(r+1):"",i=n.indexOf("?"),s=GC(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=_C.exec(a);if(!l)return {path:s};let d=Number(l[1]);if(d<1)return {path:s};let u=l[2]?Number(l[2]):d;return {path:s,startLine:d,endLine:Math.max(d,u)}},ws=t=>t.split("/").filter(Boolean).pop()??t,Km=t=>{let o=t.split("/");return o.pop(),o.join("/")},ql=t=>{let o=ws(t),r=o.lastIndexOf(".");return r>0?o.slice(r+1).toLowerCase():""},qm={prism:"text",label:"Text"},Um={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:qm},Xl=(t,o)=>o?Object.values(Um).find(n=>n.prism===o)??{prism:o,label:o}:Um[ql(t)]??qm,Xm=t=>{let o=t,r=0;for(;o>=1024&&r<Gm.length-1;)o/=1024,r+=1;return `${r>0&&o<10?o.toFixed(1):Math.round(o).toString()} ${Gm[r]}`};var UC=1e3,KC=9,tr=16,qC={markdown:"text/markdown;charset=utf-8",code:"text/plain;charset=utf-8"},Qm=(t,o)=>{let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=o,n.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3);},Zl=({tone:t,icon:o,title:r,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:o}),f("div",{className:"orb-omph-pv-notice-title",children:r}),n&&f("p",{className:"orb-omph-pv-notice-text",children:n}),a]}),jm=({state:t,placement:o,expanded:r,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:l,onRetry:d,onToggleExpand:u,onOpenExternally:m})=>{let[h,f$1]=useState(true),[p,v]=useState(false),{open:C,ref:g$1,phase:x,data:b}=t,y=b?.body;useEffect(()=>{if(!p)return;let O=window.setTimeout(()=>v(false),UC);return ()=>window.clearTimeout(O)},[p]),useEffect(()=>{C&&s.current?.focus({preventScroll:true});},[C,s,g$1?.path]);let k=b?.absolutePath??g$1?.path??"",S=y&&(y.kind==="markdown"||y.kind==="code")?y.text:k,P=S===k?a.previewCopyPath:a.previewCopyContent,I=y?.kind==="code"&&g$1?Xl(g$1.path,y.language):null,w=!!(y&&(y.kind==="markdown"||y.kind==="code")&&y.previewOnly),M=!!(g$1&&y&&!w&&(y.kind==="markdown"||y.kind==="code"||y.kind==="image"||y.kind==="embed")),N=()=>{if(!y||!g$1)return;let O=ws(k);if(y.kind==="markdown"&&!/\.(md|markdown|txt)$/i.test(O)&&(O=`${O}.md`),y.kind==="markdown"||y.kind==="code"){Qm(new Blob([y.text],{type:qC[y.kind]}),O);return}(y.kind==="image"||y.kind==="embed")&&fetch(y.url).then(z=>{if(!z.ok)throw new Error(`HTTP ${z.status}`);return z.blob()}).then(z=>Qm(z,O)).catch(()=>window.open(y.url,"_blank","noopener"));},T=[];I&&T.push(I.label),y?.kind==="markdown"&&T.push("Markdown"),y?.kind==="image"&&g$1&&T.push(ql(g$1.path).toUpperCase()),b?.size!==void 0&&T.push(Xm(b.size)),y?.kind==="code"&&g$1?.startLine!==void 0&&T.push(a.previewLines(g$1.startLine,g$1.endLine??g$1.startLine));let R=O=>{O.key==="Escape"&&(O.stopPropagation(),l(true));},A=f("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),L=()=>{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:KC},(O,z)=>f("span",{},z))});if(x==="error"||!y)return f(Zl,{tone:"error",icon:f(ka,{size:tr}),title:a.previewFailed,text:k,action:A});switch(y.kind){case "missing":return f(Zl,{tone:"neutral",icon:f(Ra,{size:tr}),title:a.previewMissing,text:y.message??k});case "unsupported":return f(Zl,{tone:"neutral",icon:f(Ra,{size:tr}),title:a.previewUnsupported,text:y.message??k,action:m&&f("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>m(g$1),children:a.previewOpenExternal})});case "markdown":return f($m,{text:y.text},g$1.path);case "code":return f(Wm,{text:y.text,language:Xl(g$1.path,y.language).prism,startLine:g$1.startLine,endLine:g$1.endLine,wrap:h,labels:a},g$1.path);case "image":return f(_m,{url:y.url,alt:y.alt,labels:a},y.url);case "embed":return f("iframe",{src:y.url,title:y.caption??a.previewTitle,className:"orb-omph-pv-embed"},y.url);default:return null}},$=o==="overlay",j=y?.kind==="image"?Ec:Ra;return g("aside",{ref:s,className:"orb-omph-preview","data-open":C||void 0,"data-placement":o,role:$?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!C||void 0,tabIndex:-1,onKeyDown:R,children:[!$&&C&&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:[$&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:f(Ta,{size:tr})}),f("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:f(j,{size:tr})}),g("div",{className:"orb-omph-pv-titles",children:[f("div",{className:"orb-omph-pv-name",title:k,children:g$1?ws(g$1.path):""}),f("div",{className:"orb-omph-pv-path",title:k,children:f("bdi",{children:Km(k)})})]}),g("div",{className:"orb-omph-pv-actions",children:[y?.kind==="code"&&f("button",{type:"button",className:"orb-omph-text-button","aria-pressed":h,onClick:()=>f$1(O=>!O),children:a.previewWrap}),M&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewDownload,title:a.previewDownload,onClick:N,children:f(Ma,{size:tr})}),g$1&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":p?a.copied:P,title:p?a.copied:P,onClick:()=>{navigator.clipboard.writeText(S).then(()=>v(true));},children:p?f(Do,{size:tr}):f(qo,{size:tr})}),n&&f("button",{type:"button",className:"orb-omph-icon-button","aria-pressed":r,"aria-label":r?a.previewCollapse:a.previewExpand,title:r?a.previewCollapse:a.previewExpand,onClick:u,children:f(Rc,{size:tr})}),!$&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:f(Ut,{size:tr})})]})]}),f("div",{className:"orb-omph-pv-meta",children:T.join(" \xB7 ")}),f("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?y?.kind:void 0,children:L()})]})]})};var ZC=1e3,Jm=50,YC=1e3,QC=t=>t==="tool"?Jr:t==="command"?Bn:zc,tg=t=>!!t.streaming||t.status==="running"||t.status==="pending",jC=(t,o)=>o==="expanded"?true:tg(t),JC=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),ex=(t,o)=>`${Math.max(1,Math.round(t/YC))}${o.secondUnit}`,tx=({content:t})=>{let o=useRef(null),[r,n]=useState(false);return useEffect(()=>{let a=o.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:o,className:"orb-omph-process-body","data-overflow":r||void 0,children:t})},ox=({turn:t,labels:o})=>{let[r,n]=useState(false),[a,i]=useState(false),s=t.assistant?.content??"",l=t.usage;return useEffect(()=>{if(!r)return;let d=window.setTimeout(()=>n(false),ZC);return ()=>window.clearTimeout(d)},[r]),g("div",{className:"orb-omph-turn-actions",role:"group","aria-label":o.turnActions,children:[f("span",{className:"orb-omph-actions-time",children:t.assistant?.timestamp.toLocaleTimeString()}),JC(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:o.usage})]}),f("button",{type:"button",className:"orb-omph-icon-button orb-omph-actions-end","aria-label":r?o.copied:o.copy,onClick:()=>{navigator.clipboard.writeText(s).then(()=>n(true));},children:r?f(Do,{size:14}):f(qo,{size:14})}),a&&l&&g("div",{className:"orb-omph-usage",children:[l.inputTokens!==void 0&&g("span",{children:[o.inputTokens," ",l.inputTokens.toLocaleString()]}),l.outputTokens!==void 0&&g("span",{children:[o.outputTokens," ",l.outputTokens.toLocaleString()]}),l.durationMs!==void 0&&g("span",{children:[o.duration," ",ex(l.durationMs,o)]})]})]})},rx=({item:t,display:o,open:r,onToggle:n})=>{let a=QC(t.kind),i=tg(t),s=o!=="compact"&&!!t.summary,l=r&&!!t.content;return g("div",{className:"orb-omph-process","data-status":t.status,"data-open":r||void 0,children:[g("button",{type:"button",className:"orb-omph-process-toggle","aria-expanded":r,onClick:n,children:[f(Fo,{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(tx,{content:t.content}),r&&t.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},Yl=t=>{let o=t.user?.content||t.assistant?.content||t.id,r=o.split(`
|
|
20
|
-
`).find(n=>n.trim())??o;return r.length>Jm?`${r.slice(0,Jm)}\u2026`:r},nx=0,og=({turns:t,labels:o,processDisplay:r,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=useState({}),d=u=>{if(!i||u.defaultPrevented||u.button!==nx||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey)return;let m=u.target.closest("a[href]");if(!m)return;let h=a(m.getAttribute("href")??"");h&&(u.preventDefault(),i(h,m));};return f(e,{children:t.map((u,m)=>{let h=!!(u.assistant&&!u.assistant.streaming),p=m===t.length-1&&h?"always":"hover";return g("article",{className:"orb-omph-turn","data-omph-turn":u.id,"data-actions-reveal":p,children:[u.user&&g("div",{className:"orb-omph-user",children:[f("div",{className:"orb-omph-user-bubble",children:u.user.content}),f("div",{className:"orb-omph-clock",children:u.user.timestamp.toLocaleTimeString()})]}),u.process&&u.process.length>0&&f("div",{className:"orb-omph-process-list",children:u.process.map(v=>{let C=v.id in s?s[v.id]:jC(v,r);return f(rx,{item:v,display:r,open:C,onToggle:()=>l(g=>({...g,[v.id]:!C}))},v.id)})}),u.assistant&&g("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[f(vs,{content:u.assistant.content,messageId:u.assistant.id,cardHooks:n}),u.assistant.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),u.failure&&f("div",{className:"orb-omph-failure","data-severity":u.failure.severity,children:u.failure.content}),h&&f(ox,{turn:u,labels:o})]},u.id)})})};var Ql=t=>({idle:t("omph.status.idle"),pending:t("omph.status.pending"),running:t("omph.status.running"),success:t("omph.status.success"),error:t("omph.status.error"),working:t("omph.working"),workingFor:o=>t("omph.workingFor",{duration:o}),loadOlder:t("omph.loadOlder"),loadingOlder:t("omph.loadingOlder"),toBottom:t("omph.toBottom"),copy:t("omph.copy"),copied:t("omph.copied"),turnActions:t("omph.turnActions"),usage:t("omph.usage"),inputTokens:t("omph.inputTokens"),outputTokens:t("omph.outputTokens"),duration:t("omph.duration"),send:t("omph.send"),stop:t("omph.stop"),turnRail:t("omph.turnRail"),secondUnit:t("omph.secondUnit"),minuteUnit:t("omph.minuteUnit"),previewTitle:t("omph.preview.title"),previewClose:t("omph.preview.close"),previewBack:t("omph.preview.back"),previewExpand:t("omph.preview.expand"),previewCollapse:t("omph.preview.collapse"),previewCopyContent:t("omph.preview.copyContent"),previewCopyPath:t("omph.preview.copyPath"),previewDownload:t("omph.preview.download"),previewOpenExternal:t("omph.preview.openExternal"),previewWrap:t("omph.preview.wrap"),previewLoading:t("omph.preview.loading"),previewMissing:t("omph.preview.missing"),previewFailed:t("omph.preview.failed"),previewUnsupported:t("omph.preview.unsupported"),previewRetry:t("omph.preview.retry"),previewResize:t("omph.preview.resize"),previewLines:(o,r)=>t(o===r?"omph.preview.line":"omph.preview.lines",{start:o,end:r}),previewTruncated:(o,r)=>t("omph.preview.truncated",{shown:o,total:r}),imageFailed:t("omph.preview.imageFailed"),zoomIn:t("omph.preview.zoomIn"),zoomOut:t("omph.preview.zoomOut"),zoomFit:t("omph.preview.zoomFit"),newConversation:t("omph.newConversation"),conversationList:t("omph.conversationList"),conversations:t("omph.conversations"),noConversations:t("omph.noConversations")}),jl=t=>({waiting:t("omph.approval.waiting"),choose:t("omph.approval.choose"),details:t("omph.approval.details"),choices:t("omph.approval.choices"),reject:t("omph.approval.reject"),allowOnce:t("omph.approval.allowOnce"),confirm:t("omph.approval.confirm"),other:t("omph.approval.other"),otherPlaceholder:t("omph.approval.otherPlaceholder"),escalation:o=>t("omph.approval.escalation",{toolName:o})});var ax=1e3,rg=60,ix=1e3,ng=(t,o)=>{let r=Math.max(1,Math.round(Math.max(t,ix)/ax)),n=Math.floor(r/rg),a=r%rg;return n<=0?`${r}${o.secondUnit}`:`${n}${o.minuteUnit} ${a}${o.secondUnit}`};var cx={open:false,ref:null,phase:"loading",data:null},ag=t=>{let[o,r]=useState(cx),n=useRef(o);n.current=o;let a=useRef(t);a.current=t;let i=useRef(null),s=useRef(0),l=useRef(null),d=useCallback(f=>{let p=a.current;if(!p)return;i.current?.abort();let v=new AbortController;i.current=v,s.current+=1;let C=s.current;r({open:true,ref:f,phase:"loading",data:null}),p(f,v.signal).then(g=>{C===s.current&&r(x=>({...x,phase:"ready",data:g}));},()=>{C!==s.current||v.signal.aborted||r(g=>({...g,phase:"error",data:null}));});},[]),u=useCallback((f,p)=>{l.current=p??null;let v=n.current;if(v.ref?.path===f.path&&v.phase==="ready"){r({...v,open:true,ref:f});return}d(f);},[d]),m=useCallback((f=false)=>{s.current+=1,i.current?.abort(),r(v=>({...v,open:false}));let p=l.current;f&&p?.isConnected&&p.focus({preventScroll:true});},[]),h=useCallback(()=>{let{ref:f}=n.current;f&&d(f);},[d]);return useEffect(()=>()=>{i.current?.abort();},[]),{state:o,open:u,close:m,reload:h}};var ec="--orb-omph-pv-w",tc="--orb-omph-pv-pref",ux=880,mx=560,sg=400,$r=320,gx=.45,hx=.7,lg=24,Jl=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),cg=({open:t,layout:o})=>{let r=useRef(null),n=useRef(null),[a,i]=useState(0),[s,l]=useState(null),[d,u]=useState(false),[m,h]=useState(false);useLayoutEffect(()=>{let P=r.current;if(!P)return;let I=()=>i(P.getBoundingClientRect().width);I();let w=new ResizeObserver(I);return w.observe(P),()=>w.disconnect()},[]),useEffect(()=>{t||u(false);},[t]);let f=o==="overlay"?false:o==="split"?a>=sg+$r:a>=ux,p=f&&!d?"split":"overlay",v=Math.max($r,Math.min(a*hx,a-sg)),C=Jl(s??a*gx,$r,v),g=a>0&&a<mx,x=useCallback(P=>{let I=r.current;I&&(I.style.setProperty(tc,`${P}px`),I.dataset.placement==="split"&&I.dataset.open==="true"&&I.style.setProperty(ec,`${P}px`));},[]),b=useCallback(P=>{P.button===0&&(P.preventDefault(),P.currentTarget.setPointerCapture(P.pointerId),n.current={pointerId:P.pointerId,startX:P.clientX,startWidth:C,latest:C},h(true));},[C]),y=useCallback(P=>{let I=n.current;!I||I.pointerId!==P.pointerId||(I.latest=Jl(I.startWidth+(I.startX-P.clientX),$r,v),x(I.latest));},[v,x]),k=useCallback(P=>{let I=n.current;!I||I.pointerId!==P.pointerId||(n.current=null,P.currentTarget.hasPointerCapture(P.pointerId)&&P.currentTarget.releasePointerCapture(P.pointerId),l(I.latest),h(false));},[]),S=useCallback(P=>{let I={ArrowLeft:C+lg,ArrowRight:C-lg,Home:$r,End:v};P.key in I&&(P.preventDefault(),l(Jl(I[P.key],$r,v)));},[v,C]);return {mainRef:r,placement:p,width:C,compact:g,dragging:m,expanded:d,canExpand:f,toggleExpanded:()=>u(P=>!P),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":$r,"aria-valuemax":Math.round(v),"aria-valuenow":Math.round(C),tabIndex:0,onPointerDown:b,onPointerMove:y,onPointerUp:k,onPointerCancel:k,onKeyDown:S}}};var Ts=48,bx=900,pg=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,ug=({turns:t,contentVersion:o,hasOlder:r=false,loadingOlder:n=false,onLoadOlder:a})=>{let i=useRef(null),s=useRef(null),l=useRef(true),d=useRef({height:0,top:0}),u=useRef(void 0),m=useRef(false),[h,f]=useState(true),[p,v]=useState(false),[C,g]=useState(t[0]?.id),x=useCallback(()=>{let P=i.current;P&&(d.current={height:P.scrollHeight,top:P.scrollTop});},[]),b=useCallback(()=>{let P=i.current;if(!P)return;let I=P.getBoundingClientRect().top,w=P.querySelector("[data-omph-turn]")?.dataset.omphTurn;P.querySelectorAll("[data-omph-turn]").forEach(M=>{M.getBoundingClientRect().top-I<=Ts&&(w=M.dataset.omphTurn);}),g(w);},[]);useEffect(()=>{let P=i.current,I=s.current;if(!P||!I)return;let w=()=>{v(P.clientWidth>bx),l.current&&(P.scrollTop=P.scrollHeight),x();};w();let M=new ResizeObserver(w);return M.observe(P),M.observe(I),()=>M.disconnect()},[x]),useLayoutEffect(()=>{let P=i.current;if(!P)return;let I=t[0]?.id,w=u.current,M=w!==void 0&&t.some(R=>R.id===w),N=M&&I!==void 0&&I!==w,T=w!==void 0&&!M;if(u.current=I,T){l.current=true,f(true),P.scrollTop=P.scrollHeight,x(),b();return}if(N){l.current=false,f(false);let R=P.scrollHeight-d.current.height;P.scrollTop=d.current.top+Math.max(0,R),x(),b();return}l.current&&(P.scrollTop=P.scrollHeight),x(),b();},[o,x,t,b]),useEffect(()=>{n||(m.current=false);},[n]);let y=useCallback(()=>{let P=i.current;if(!P)return;let w=P.scrollHeight-P.scrollTop-P.clientHeight<=Ts;w!==l.current&&(l.current=w,f(w)),x(),b();let M=P.scrollHeight-P.clientHeight>Ts,N=P.scrollTop<=Ts;!M||!N||w||!r||n||!a||m.current||(m.current=true,a());},[r,n,a,x,b]),k=useCallback(()=>{let P=i.current;P&&(l.current=true,f(true),P.scrollTo({top:P.scrollHeight,behavior:pg()?"auto":"smooth"}));},[]),S=useCallback(P=>{let w=i.current?.querySelector(`[data-omph-turn="${CSS.escape(P)}"]`);w&&(l.current=false,f(false),w.scrollIntoView({block:"start",behavior:pg()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:h,railVisible:p,activeTurnId:C,onScroll:y,returnToBottom:k,scrollToTurn:S}};var yx=1e3,Cx=(t,o)=>o[t],xx=t=>t.map(o=>[o.id,o.user?.content.length??0,o.assistant?.content.length??0,o.assistant?.streaming?"1":"0",o.failure?.id??"",(o.process??[]).map(r=>`${r.id}:${r.status}:${r.content?.length??0}`).join(",")].join(":")).join("|"),wx=({startedAt:t,labels:o})=>{let[r,n]=useState(()=>Date.now());useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),yx);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?o.working:o.workingFor(ng(Math.max(0,r-t),o));return g("div",{className:"orb-omph-running","data-omph-running":"true",children:[f("span",{className:"orb-visually-hidden",role:"status","aria-live":"polite",children:o.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})]})]})},iz=({turns:t,title:o,avatar:r,description:n,headerActions:a,agentStatus:i,isResponding:s=false,labels:l,processDisplay:d="standard",showInput:u=false,placeholder:m,className:h,cardHooks:f$1,hasOlder:p=false,loadingOlder:v=false,onLoadOlder:C,onSend:g$1,onStop:x,onHeaderPointerDown:b,conversations:y=[],activeConversationId:k,onNewConversation:S,onSelectConversation:P,loadFilePreview:I,resolveFileLink:w=Kl,filePreviewLayout:M="auto",onOpenFileExternally:N})=>{let{t:T}=se(),R={...Ql(T),...l},A=i??(s?"running":"idle"),L=A==="running"||A==="pending",$=[Cx(A,R),n].filter(Boolean).join(" \xB7 "),j=useMemo(()=>xx(t),[t]),O=ug({turns:t,contentVersion:j,hasOlder:p,loadingOlder:v,onLoadOlder:C}),[z,H]=useState(""),q=z.trim(),V=s&&q.length===0,B=[...t].reverse().find(le=>!!le.assistant?.streaming||le.process?.some(fe=>fe.streaming||fe.status==="running"||fe.status==="pending")),G=L?B?.startedAt:void 0,X=!!I,pe=ag(I),oe=cg({open:pe.state.open,layout:M}),me=useRef(null),xe=useRef(null),ze=X&&pe.state.open&&oe.placement==="overlay",Pe=oe.placement==="split"&&pe.state.open,Te={[tc]:`${oe.width}px`,[ec]:Pe?`${oe.width}px`:"0px"};useEffect(()=>{xe.current?.toggleAttribute("inert",ze);},[ze]);let Be=async()=>{if(!q||!g$1)return;let le=q;H("");try{await g$1(le);}catch{H(fe=>fe.trim().length===0?le:fe);}};return g("div",{className:pt("orb-omph-panel",h),"data-omph-panel":"","data-status":A,"data-compact":oe.compact||void 0,children:[g("div",{className:pt("orb-omph-header",b&&"cursor-grab active:cursor-grabbing"),onPointerDown:b,children:[f("span",{className:"orb-omph-avatar","aria-hidden":"true",children:r??"AI"}),g("div",{className:"min-w-0 flex-1",children:[o&&f("div",{className:"orb-omph-title",children:o}),g("div",{className:"orb-omph-subtitle",children:[f("span",{className:"orb-omph-dot","data-active":L||void 0}),f("span",{className:"truncate",children:$||R.idle})]})]}),(S||P||a)&&g("div",{className:"orb-omph-header-actions",onPointerDown:le=>le.stopPropagation(),children:[f(zm,{conversations:y,activeConversationId:k,labels:R,onNewConversation:S,onSelectConversation:P}),a]})]}),g("div",{ref:oe.mainRef,className:"orb-omph-main","data-placement":oe.placement,"data-open":String(pe.state.open),"data-dragging":oe.dragging||void 0,style:Te,children:[g("div",{ref:xe,className:"orb-omph-center",children:[g("div",{className:"orb-omph-stage","data-rail":O.railVisible||void 0,children:[f("div",{ref:O.scrollerRef,className:"orb-omph-scroll",onScroll:O.onScroll,children:g("div",{ref:O.contentRef,className:"orb-omph-column",children:[p&&C&&f("button",{type:"button",className:"orb-omph-older",disabled:v,onClick:C,children:v?R.loadingOlder:R.loadOlder}),f(og,{turns:t,labels:R,processDisplay:d,cardHooks:f$1,resolveFileLink:w,onOpenFile:X?pe.open:void 0}),L&&f(wx,{startedAt:G,labels:R})]})}),O.railVisible&&t.length>0&&f("nav",{className:"orb-omph-rail","aria-label":R.turnRail,children:t.map(le=>f("button",{type:"button",className:"orb-omph-rail-mark","data-active":O.activeTurnId===le.id||void 0,"aria-label":Yl(le),title:Yl(le),onClick:()=>O.scrollToTurn(le.id)},le.id))}),!O.following&&f("button",{type:"button",className:"orb-omph-to-bottom","aria-label":R.toBottom,onClick:O.returnToBottom,children:f(Fo,{size:16})})]}),u&&g("form",{className:"orb-omph-composer",onSubmit:le=>{le.preventDefault(),V?x?.():Be();},children:[f("textarea",{className:"orb-omph-input",value:z,placeholder:m,rows:1,onChange:le=>H(le.target.value),onKeyDown:le=>{le.key!=="Enter"||le.shiftKey||le.nativeEvent.isComposing||(le.preventDefault(),V?x?.():Be());}}),f("button",{type:"submit",className:V?"orb-omph-stop":"orb-omph-send","aria-label":V?R.stop:R.send,disabled:!V&&q.length===0,children:V?f(Pc,{size:16}):f(kc,{size:16})})]})]}),X&&f(jm,{state:pe.state,placement:oe.placement,expanded:oe.expanded,canExpand:oe.canExpand,labels:R,gripProps:oe.gripProps,paneRef:me,onClose:pe.close,onRetry:pe.reload,onToggleExpand:oe.toggleExpanded,onOpenExternally:N})]})]})};var hr="other",Sx=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,kx=({request:t,onDecide:o,labels:r})=>{let{t:n}=se(),a={...jl(n),...r},i=useRef(null),s=useRef(null),l=useRef(false),d=useRef(false),[u,m]=useState(false),[h,f$1]=useState(null),[p,v]=useState(""),C=t.choices??[],g$1=t.allowOther??C.length>0,x=C.length>0||g$1,b=t.reason?.trim()||a.escalation(t.toolName),y=t.detail?.trim(),k=h===hr&&p.trim().length>0,S=!x||h!==null&&h!==hr||k;useEffect(()=>{m(false),f$1(null),v(""),i.current?.focus();},[t.id]),useEffect(()=>{h===hr&&s.current?.focus();},[h]);let P=M=>{u||(m(true),o(M,t));},I=()=>{if(S){if(!x){P({kind:"allowed-once"});return}if(h===hr){let M=p.trim();if(!M)return;P({kind:"other",text:M});return}h&&P({kind:"choice",choiceId:h});}},w=M=>{if(!(u||Sx(M.target))&&!(M.key!=="Enter"&&M.key!=="Escape")&&!(M.key==="Enter"&&M.target instanceof HTMLElement&&M.target.closest('button, a[href], [role="button"]'))&&!(M.ctrlKey||M.metaKey||M.altKey||M.shiftKey)&&(M.preventDefault(),M.stopPropagation(),!(M.repeat||l.current||d.current||M.nativeEvent.isComposing))){if(M.key==="Escape"){P({kind:"rejected"});return}I();}};return f("div",{className:"orb-omph-approval","data-omph-approval":t.id,"aria-busy":u,onKeyDown:w,onKeyUpCapture:()=>{d.current=false;},onCompositionStartCapture:()=>{l.current=true;},onCompositionEndCapture:()=>{l.current=false,d.current=true;},children:g("div",{className:"orb-omph-approval-card",children:[g("div",{className:"orb-omph-approval-strip",children:[f("span",{className:"orb-omph-approval-dot","aria-hidden":"true"}),x?a.choose:a.waiting]}),g("div",{ref:i,className:"orb-omph-approval-body",tabIndex:0,role:"group","aria-label":a.details,children:[f("div",{className:"orb-omph-approval-headline",children:b}),y&&f("div",{className:"orb-omph-approval-detail",children:y}),x&&g("fieldset",{className:"orb-omph-approval-choices",disabled:u,children:[f("legend",{className:"orb-visually-hidden",children:a.choices}),C.map(M=>{let N=h===M.id;return g("label",{className:"orb-omph-approval-choice","data-selected":N,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:M.id,checked:N,onChange:()=>f$1(M.id)}),g("span",{className:"orb-omph-approval-choice-copy",children:[f("span",{children:M.label}),M.description&&f("span",{className:"orb-omph-approval-choice-description",children:M.description})]})]},M.id)}),g$1&&g("label",{className:"orb-omph-approval-choice","data-selected":h===hr,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:hr,checked:h===hr,onChange:()=>f$1(hr)}),f("span",{className:"orb-omph-approval-choice-copy",children:f("span",{children:a.other})})]}),g$1&&h===hr&&f("textarea",{ref:s,className:"orb-omph-approval-other",value:p,placeholder:a.otherPlaceholder,rows:3,"aria-label":a.other,onChange:M=>v(M.target.value)})]})]}),g("div",{className:"orb-omph-approval-actions",children:[f("button",{type:"button",className:"orb-btn orb-btn-neutral orb-omph-approval-reject",disabled:u,onClick:()=>P({kind:"rejected"}),children:a.reject}),f("button",{type:"button",className:"orb-btn orb-btn-primary",disabled:u||!S,onClick:I,children:x?a.confirm:a.allowOnce})]})]})})};var yg=520,Ix=88,Mx=88,Rx=24,Ms=640,Cg=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),nc=t=>typeof t=="number"?`${t}px`:t,Dx=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,vz=({anchor:t,defaultAnchor:o="right",onAnchorChange:r,width:n=yg,top:a=Ix,bottom:i=Mx,inset:s=Rx,zIndex:l=1300,shellClassName:d,shellStyle:u,className:m,onHeaderPointerDown:h,...f$1})=>{let p=useRef(null),v=useRef(null),[C,g]=useState(o),[x,b]=useState(0),[y,k]=useState(typeof n=="number"?n:yg),[S,P]=useState(0),[I,w]=useState(false),M=t??C;useEffect(()=>{let O=()=>b(window.innerWidth);return O(),window.addEventListener("resize",O),()=>window.removeEventListener("resize",O)},[]),useLayoutEffect(()=>{let O=()=>{let H=p.current?.getBoundingClientRect();H?.width?k(H.width):typeof n=="number"&&k(n);};if(O(),!p.current||typeof ResizeObserver>"u")return;let z=new ResizeObserver(O);return z.observe(p.current),()=>z.disconnect()},[n]);let N=useCallback(O=>{if(!x)return s;let z=x<Ms?12:s,H=Math.max(z,x-y-z);return x<Ms||O==="left"?z:O==="center"?Cg((x-y)/2,z,H):H},[s,y,x]),T=useCallback(O=>["left","center","right"].reduce((H,q)=>{let V=Math.abs(O-N(H));return Math.abs(O-N(q))<V?q:H},"right"),[N]),R=useCallback(O=>{t===void 0&&g(O),r?.(O);},[t,r]);useEffect(()=>{I||P(N(M));},[N,I,M]);let A=useCallback(O=>{h?.(O),!(O.defaultPrevented||Dx(O.target))&&(O.preventDefault(),O.currentTarget.setPointerCapture(O.pointerId),v.current={pointerId:O.pointerId,startClientX:O.clientX,startX:S,currentX:S,captureElement:O.currentTarget},w(true));},[h,S]),L=useCallback(O=>{let z=v.current;if(!z||z.pointerId!==O.pointerId)return;let H=x<Ms?12:s,q=Math.max(H,x-y-H),V=Cg(z.startX+O.clientX-z.startClientX,H,q);z.currentX=V,P(V);},[s,y,x]),$=useCallback(O=>{let z=v.current;if(!z||z.pointerId!==O.pointerId)return;try{z.captureElement.releasePointerCapture(O.pointerId);}catch{}let H=T(z.currentX);v.current=null,w(false),R(H),P(N(H));},[N,R,T]),j=useMemo(()=>({position:"fixed",top:nc(a),bottom:nc(i),left:S,width:nc(n),maxWidth:`calc(100vw - ${x<Ms?24:s*2}px)`,zIndex:l,pointerEvents:"auto",transition:I?"none":"left 180ms ease-out",touchAction:"none",...u}),[i,s,I,S,u,a,x,n,l]);return f("div",{ref:p,className:pt("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":M,"data-dragging":I?"true":"false",style:j,onPointerMove:L,onPointerUp:$,onPointerCancel:$,children:f(Bm,{...f$1,className:m,onHeaderPointerDown:A})})};var Ex={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},Tz=({messages:t,onSend:o,onRegenerate:r,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:l="bottom-right",onCollapse:d,onHeaderPointerDown:u,onPlusClick:m,onMicClick:h,streamIntervalMs:f$1,streamChunkSize:p,onMessageStreamingComplete:v,cardHooks:C})=>{let[g$1,x]=useState(""),[b,y]=useState(false),k=useRef(null),S=Ex[l];useEffect(()=>{k.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let P=useCallback(async()=>{let w=g$1.trim();!w||n||(x(""),await o(w));},[n,o,g$1]),I=useCallback(async w=>{w.key==="Enter"&&!b&&(w.preventDefault(),await P());},[P,b]);return g("div",{className:pt("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:pt("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:pt("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:u,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,M)=>{let N=w.type==="assistant"&&M===t.length-1,T=w.type==="assistant"?{isLatestAssistant:N,isResponding:n,onRegenerate:r?()=>r(w.id):void 0}:void 0;return f(ys,{message:w,assistantActions:T,onStreamingComplete:()=>v?.(w.id),streamIntervalMs:f$1,streamChunkSize:p,cardHooks:C},w.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:m,type:"button","aria-label":"Add",children:f(jr,{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:()=>y(true),onCompositionEnd:()=>y(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:h,type:"button","aria-label":"Microphone",children:f(Ea,{className:"h-4 w-4"})})]})})]})};var Lx=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],Ox=`
|
|
14
|
+
${r}: ${(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: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:Uu(f$1)}),f("text",{x:s-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:Uu(h)})]})}),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 ${Lo(x.palette.divider,.7)}`,bgcolor:Lo(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:[o,": ",n(g$1.primaryValue)]}),r&&g(E,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[r,": ",(a??n)(g$1.secondaryValue??0)]})]},g$1.name))})]})};var Fl=t=>Math.max(...t,1),qu=({data:t,chartType:o,primaryLabel:r,secondaryLabel:n,formatPrimaryValue:a,formatSecondaryValue:i})=>{let s=io(),c=s.palette.primary.main,d=s.palette.warning.main;if(t.length===0)return null;if(o==="bar-horizontal"){let v=Fl(t.flatMap(y=>[y.primaryValue,y.secondaryValue??0]));return f(se,{spacing:1.1,children:t.map(y=>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:y.name,children:y.name}),g(se,{spacing:.65,children:[f("div",{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:Lo(s.palette.action.active,.08)},children:f("div",{sx:{width:`${y.primaryValue/v*100}%`,height:"100%",bgcolor:c}})}),n&&f("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:Lo(s.palette.action.active,.08)},children:f("div",{sx:{width:`${(y.secondaryValue??0)/v*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(y.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"var(--orb-fg)"},children:(i??a)(y.secondaryValue??0)})]})]},y.name))})}if(o==="bar-vertical"){let v=Fl(t.flatMap(P=>[P.primaryValue,P.secondaryValue??0])),y=n?92:76;return f("div",{sx:{overflowX:"auto",pb:.5},children:f("div",{sx:{minWidth:Math.max(620,t.length*y),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/v*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${r}: ${a(P.primaryValue)}`}),n&&f("div",{sx:{width:16,minHeight:8,height:`${Math.max((P.secondaryValue??0)/v*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 u=Math.max(680,t.length*74),m=240,h={top:20,right:18,bottom:36,left:18},f$1=Fl(t.flatMap(v=>[v.primaryValue,v.secondaryValue??0])),p=u-h.left-h.right,b=m-h.top-h.bottom,C=v=>t.map((y,P)=>{let S=h.left+P*p/Math.max(t.length-1,1),I=m-h.bottom-v(y)/f$1*b;return {x:S,y:I,item:y}}),g$1=C(v=>v.primaryValue),x=n?C(v=>v.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 ${u} ${m}`,sx:{width:"100%",minWidth:u,height:m},children:[f("line",{x1:h.left,y1:m-h.bottom,x2:u-h.right,y2:m-h.bottom,stroke:Lo(s.palette.text.secondary,.35)}),f("polyline",{fill:"none",stroke:c,strokeWidth:3,points:g$1.map(v=>`${v.x},${v.y}`).join(" ")}),g$1.map(v=>f("circle",{cx:v.x,cy:v.y,r:4,fill:c,children:g("title",{children:[v.item.name,`
|
|
15
|
+
`,r,": ",a(v.item.primaryValue)]})},`primary-${v.item.name}`)),n&&g(e,{children:[f("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:x.map(v=>`${v.x},${v.y}`).join(" ")}),x.map(v=>f("circle",{cx:v.x,cy:v.y,r:3.5,fill:d,children:g("title",{children:[v.item.name,`
|
|
16
|
+
`,n,": ",(i??a)(v.item.secondaryValue??0)]})},`secondary-${v.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(v=>g("div",{sx:y=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Lo(y.palette.divider,.7)}`,bgcolor:Lo(y.palette.background.default,.35)}),children:[f(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:v.name,children:v.name}),f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(v.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(v.secondaryValue??0)})]},v.name))})]})};var Xu=(t,o,r)=>{let n=new Set,a=[];return t.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:r.get(i)?.label??i,zone:"rows"}));}),o.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:r.get(i)?.label??i,zone:"columns"}));}),a},Zu=(t,o,r)=>t.map(n=>{let a=o.get(n.fieldId),i=a?.label??n.fieldId;return {fieldId:n.fieldId,label:`${r(n.aggregation)} \xB7 ${i}`,item:n,field:a}}),Yu=({rows:t,dimensionFieldId:o,primaryValue:r,secondaryValue:n})=>{if(!o)return [];let a=new Map;return t.forEach(i=>{let s=pr(i[o]),c=a.get(s);if(c){c.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:wn(s,r.fieldId,r.aggregation),secondaryValue:n?wn(s,n.fieldId,n.aggregation):void 0}))};var Qu=({rows:t,fieldMap:o,rowFields:r,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:u,onChartDimensionFieldIdChange:m,onChartPrimaryValueFieldIdChange:h,onChartSecondaryValueFieldIdChange:f$1,onChartTypeChange:p,onToggleCollapse:b,getAggregationLabel:C})=>{let{t:g$1}=ce(),x=useMemo(()=>Xu(r,n,o),[n,o,r]),v=useMemo(()=>Zu(a,o,C),[o,C,a]),y=v.find(T=>T.fieldId===s)??v[0],P=v.find(T=>T.fieldId===c&&T.fieldId!==y?.fieldId)??null,S=x.find(T=>T.fieldId===i)??x[0],I=S&&y?g$1("pivot.chart.subtitleReady",{dimension:S.label,measure:P?`${y.label} / ${P.label}`:y.label}):g$1("pivot.chart.subtitle"),M=useMemo(()=>!S||!y?[]:Yu({rows:t,dimensionFieldId:S.fieldId,primaryValue:y.item,secondaryValue:P?.item}),[y,t,P,S]),w=T=>y?ua(T,y.item,o):T.toLocaleString(),D=T=>P?ua(T,P.item,o):T.toLocaleString(),N=x.length>1||v.length>1;return g(Pn,{title:g$1("pivot.chart.title"),subtitle:I,collapsed:u,onToggleCollapse:b,expandAriaLabel:g$1("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[N&&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(yr,{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(zt,{value:S?.fieldId??"",onChange:T=>m(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(yr,{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(zt,{value:y?.fieldId??"",onChange:T=>h(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:v.map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))})]}),g(yr,{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(zt,{value:P?.fieldId??"",onChange:T=>f$1(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")}),v.filter(T=>T.fieldId!==y?.fieldId).map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))]})]}),g(yr,{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(zt,{value:d,onChange:T=>p(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?y?M.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(Ku,{data:M,primaryLabel:y.label,secondaryLabel:P?.label,formatPrimaryValue:w,formatSecondaryValue:D}):f(qu,{data:M,chartType:d,primaryLabel:y.label,secondaryLabel:P?.label,formatPrimaryValue:w,formatSecondaryValue:D}):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 os=({node:t,dataColumns:o,fieldMap:r,level:n,expandedKeys:a,onToggle:i,getValue:s})=>{let c=a.has(t.key),d=t.children.length>0,u=t.isGrandTotal,m=d&&!c&&!u,h=u?800:m?700:d?600:500,f$1=u?800:m?600:500;return g(e,{children:[g("tr",{sx:{bgcolor:u?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:u?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:h},sx:p=>({fontSize:"0.76rem",borderBottom:`1px solid ${p.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!u&&f(ie,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:c?f($o,{size:12}):f(Sr,{size:12})}),!d&&!u&&n>0&&f("div",{sx:{width:18}}),t.value]}),o.map(p=>f("td",{align:"right",style:{fontWeight:f$1},sx:{fontSize:"0.76rem",borderBottom:b=>`1px solid ${b.palette.divider}`,whiteSpace:"nowrap"},children:ua(s?s(t,p.id):t.aggregatedValues[p.id]??0,p.valueItem,r)},`${t.key}-${p.id}`))]}),c&&t.children.map(p=>f(os,{node:p,dataColumns:o,fieldMap:r,level:n+1,expandedKeys:a,onToggle:i,getValue:s},p.key))]})};var Hl=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},ns=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",zl=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",Ju=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children.length>0&&(o.add(a.key),r(a.children));});};return r(t),o},em=(t,o,r=0)=>t.length===0?r:t.reduce((n,a)=>a.children.length===0||!o.has(a.key)?Math.max(n,r+1):Math.max(n,em(a.children,o,r+1)),r),Yv=(t,o)=>{let r=[],n=a=>{a.forEach(i=>{if(i.children.length>0&&o.has(i.key)){n(i.children);return}r.push(i);});};return n(t),r},gO=({title:t,rows:o,fields:r,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:u,enablePresetManagement:m=false,presets:h,defaultPresets:f$1,onPresetsChange:p,initialPresetId:b$1,onPresetApplied:C})=>{let{t:g$1}=ce(),x=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),v=useRef(0),y=useRef(false),P=t??g$1("pivot.title.default"),S=i??g$1("pivot.empty"),I=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]),M=useCallback(R=>I[R]??Eu[R],[I]),w=useMemo(()=>new Set(r.map(R=>R.id)),[r]),D=useMemo(()=>new Map(r.map(R=>[R.id,R])),[r]),[N,T]=useState(()=>so(n?.rows,w)),[k,A]=useState(()=>so(n?.columns,w)),[L,W]=useState(()=>so(n?.filters,w)),[ee,O]=useState(()=>{let R=n?.values??[],$=new Set,G=[];return R.forEach(ue=>{if(!w.has(ue.fieldId)||$.has(ue.fieldId))return;$.add(ue.fieldId),v.current+=1;let Fe=D.get(ue.fieldId);G.push({tokenId:`v${v.current}`,fieldId:ue.fieldId,aggregation:Co(ue.aggregation,Fe)});}),G}),[_,V]=useState({}),[Q,H]=useState(true),[B,q]=useState(false),[Z,Y]=useState(()=>Hl(so(n?.rows,w),so(n?.columns,w),a?.dimensionFieldId)),[J,le]=useState(()=>{let R=(n?.values??[]).filter(($,G,ue)=>w.has($.fieldId)&&ue.findIndex(Fe=>Fe.fieldId===$.fieldId)===G).map($=>({tokenId:$.fieldId,fieldId:$.fieldId,aggregation:Co($.aggregation,D.get($.fieldId))}));return ns(R,a?.primaryValueFieldId)}),[he,ze]=useState(()=>{let R=(n?.values??[]).filter((G,ue,Fe)=>w.has(G.fieldId)&&Fe.findIndex(rt=>rt.fieldId===G.fieldId)===ue).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:Co(G.aggregation,D.get(G.fieldId))})),$=ns(R,a?.primaryValueFieldId);return zl(R,$,a?.secondaryValueFieldId)}),[be,Ce]=useState(a?.chartType??"bar-vertical"),[Be,de]=useState(c),[ve,We]=useState(d),[et,nt]=useState(()=>f$1??[]),[it,U]=useState(""),[Re,we]=useState(false),[Oe,at]=useState(""),[Ze,xt]=useState(null),[It,Ot]=useState(new Set(["__grand_total__"])),[At,re]=useState(new Set),Ge=u?.rowFields??N,Le=u?.columnFields??k,pe=u?.filterFields??L,xe=u?.valueFields??ee,oe=u?.filterSelections??_,ye=u?.showGrandTotal??Q,Ne=u?.isConfiguratorCollapsed??B,je=u?.chartDimensionFieldId??Z,st=u?.chartPrimaryValueFieldId??J,pt=u?.chartSecondaryValueFieldId??he,Bt=u?.chartType??be,Xt=u?.isChartCollapsed??Be,Vt=u?.isTableCollapsed??ve,wt=h??et,Wt=m||wt.length>0||!!p,ft=useCallback(R=>{if(u?.setRowFields){u.setRowFields(R);return}T(R);},[u]),Dt=useCallback(R=>{if(u?.setColumnFields){u.setColumnFields(R);return}A(R);},[u]),lt=useCallback(R=>{if(u?.setFilterFields){u.setFilterFields(R);return}W(R);},[u]),Ft=useCallback(R=>{if(u?.setValueFields){u.setValueFields(R);return}O(R);},[u]),Zt=useCallback(R=>{if(u?.setFilterSelections){u.setFilterSelections(R);return}V(R);},[u]),K=useCallback(R=>{if(u?.setShowGrandTotal){u.setShowGrandTotal(R);return}H(R);},[u]),z=useCallback(R=>{if(u?.setIsConfiguratorCollapsed){u.setIsConfiguratorCollapsed(R);return}q(R);},[u]),X=useCallback(R=>{if(u?.setChartDimensionFieldId){u.setChartDimensionFieldId(R);return}Y(R);},[u]),fe=useCallback(R=>{if(u?.setChartPrimaryValueFieldId){u.setChartPrimaryValueFieldId(R);return}le(R);},[u]),Se=useCallback(R=>{if(u?.setChartSecondaryValueFieldId){u.setChartSecondaryValueFieldId(R);return}ze(R);},[u]),Ae=useCallback(R=>{if(u?.setChartType){u.setChartType(R);return}Ce(R);},[u]),$e=useCallback(R=>{if(u?.setIsChartCollapsed){u.setIsChartCollapsed(R);return}de(R);},[u]),Ke=useCallback(R=>{if(u?.setIsTableCollapsed){u.setIsTableCollapsed(R);return}We(R);},[u]),Ye=useCallback(R=>{let $=typeof R=="function"?R(wt):R;h||nt($),p?.($);},[p,wt,h]),ut=useMemo(()=>new Set([...Ge,...Le,...pe]),[Ge,Le,pe]),gt=useMemo(()=>r.filter(R=>!ut.has(R.id)),[r,ut]),Mt=useMemo(()=>{let R=[...Ge,...Le,...pe],$=new Set,G=[];return R.forEach(ue=>{$.has(ue)||($.add(ue),G.push(ue));}),G},[Le,pe,Ge]);useEffect(()=>{ft(R=>{let $=R.filter(G=>w.has(G));return ur(R,$)?R:$}),Dt(R=>{let $=R.filter(G=>w.has(G));return ur(R,$)?R:$}),lt(R=>{let $=R.filter(G=>w.has(G));return ur(R,$)?R:$}),Ft(R=>{let $=R.filter(G=>w.has(G.fieldId)).map(G=>({...G,aggregation:Co(G.aggregation,D.get(G.fieldId))}));return Qi(R,$)?R:$});},[D,w]);let bt=useMemo(()=>{let R={};return Mt.forEach($=>{let G=new Set;o.forEach(ue=>{G.add(pr(ue[$]));}),R[$]=Array.from(G).sort((ue,Fe)=>ue.localeCompare(Fe));}),R},[Mt,o]);useEffect(()=>{Zt(R=>{let $={};return Mt.forEach(G=>{let ue=bt[G]??[],rt=(R[G]??[]).filter(ne=>ue.includes(ne)),_e=Object.prototype.hasOwnProperty.call(R,G);$[G]=_e?rt:ue;}),zu(R,$)?R:$});},[Mt,bt]),useEffect(()=>{X(R=>Hl(Ge,Le,R));},[Le,Ge,X]),useEffect(()=>{fe(R=>ns(xe,R));},[fe,xe]),useEffect(()=>{Se(R=>zl(xe,st,R));},[st,Se,xe]);let F=useMemo(()=>o.filter(R=>Mt.every($=>{let G=oe[$]??[],ue=bt[$]??[];if(G.length===ue.length)return true;if(G.length===0)return false;let Fe=pr(R[$]);return G.includes(Fe)})),[Mt,bt,oe,o]),j=useMemo(()=>{if(xe.length===0)return null;let R=new Map;if(F.forEach(_e=>{let ne=Le.length>0?Le.map(te=>pr(_e[te])):[g$1("pivot.valueLabel")],me=$r(ne);R.set(me,ne);}),R.size===0){let _e=Le.length>0?Le.map(()=>Zi):[g$1("pivot.valueLabel")];R.set($r(_e),_e);}let $=Array.from(R.entries()).sort((_e,ne)=>Hu(_e[1],ne[1])),G=$.flatMap(([_e,ne])=>xe.map(me=>{let te=D.get(me.fieldId),Ee=`${M(me.aggregation)} ${te?.label??me.fieldId}`,Qe=Le.length===0||xe.length>1?`${ne.join(" / ")} \u2022 ${Ee}`:ne.join(" / ");return {id:`${_e}::${me.tokenId}`,colKey:_e,valueItem:me,label:Qe}})),ue=[];Le.length>0&&$.forEach(([_e,ne])=>{let me=G.filter(Qe=>Qe.colKey===_e),te=ue,Ee=[];ne.forEach((Qe,Me)=>{Ee.push(`d${Me}:${Qe}`);let Xe=`col::${$r(Ee)}`,kt=te.find(Qr=>Qr.key===Xe);kt||(kt={key:Xe,label:Qe,children:[],leafColumnIds:[],path:ne.slice(0,Me+1),depth:Me},te.push(kt)),me.forEach(Qr=>{kt.leafColumnIds.includes(Qr.id)||kt.leafColumnIds.push(Qr.id);}),te=kt.children;});});let Fe=_e=>{let ne={};return G.forEach(me=>{let te=_e.filter(Ee=>{let Qe=Le.length>0?Le.map(Me=>pr(Ee[Me])):[g$1("pivot.valueLabel")];return $r(Qe)===me.colKey});ne[me.id]=wn(te,me.valueItem.fieldId,me.valueItem.aggregation);}),ne},rt=[];if(Ge.length===0)rt.push({key:"root",value:g$1("pivot.resultLabel")||Du,children:[],isLeaf:true,aggregatedValues:Fe(F),path:[],depth:0});else {let _e=(ne,me,te)=>{if(me>=Ge.length)return [];let Ee=Ge[me],Qe=new Map;return ne.forEach(Me=>{let Xe=pr(Me[Ee]);Qe.has(Xe)||Qe.set(Xe,[]),Qe.get(Xe).push(Me);}),Array.from(Qe.keys()).sort().map(Me=>{let Xe=Qe.get(Me),kt=[...te,Me];return {key:$r(kt),value:Me,fieldId:Ee,aggregatedValues:Fe(Xe),children:_e(Xe,me+1,kt),isLeaf:me===Ge.length-1,path:kt,depth:me}})};rt.push(..._e(F,0,[]));}return {dataColumns:G,columnTree:ue,rowTree:rt}},[Le,D,F,M,Ge,g$1,xe]),ge=useCallback((R,$)=>(v.current+=1,{tokenId:`v${v.current}`,fieldId:R,aggregation:Co($,D.get(R))}),[D]),Te=useCallback(R=>{if(R==="rows")return ft([]);if(R==="columns")return Dt([]);if(R==="filters")return lt([]);Ft([]);},[]),Je=useCallback((R,$)=>{if(R==="rows")return ft(G=>G.filter(ue=>ue!==$));if(R==="columns")return Dt(G=>G.filter(ue=>ue!==$));if(R==="filters")return lt(G=>G.filter(ue=>ue!==$));Ft(G=>G.filter(ue=>ue.tokenId!==$));},[]),qe=useCallback((R,$)=>{Ft(G=>G.map(ue=>ue.tokenId===R?{...ue,aggregation:Co($,D.get(ue.fieldId))}:ue));},[D]),St=useCallback(R=>{xt(String(R.active.id));},[]),ht=useCallback(R=>{if(xt(null),!R.over)return;let $=Yi(String(R.active.id)),G=Yi(String(R.over.id));if(!$||!G||$.kind!=="item"||!$.key)return;if($.zone===G.zone&&G.kind==="item"){if($.zone==="rows"){let Me=Ge.indexOf($.key),Xe=Ge.indexOf(G.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&ft(kt=>arrayMove(kt,Me,Xe));return}if($.zone==="columns"){let Me=Le.indexOf($.key),Xe=Le.indexOf(G.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&Dt(kt=>arrayMove(kt,Me,Xe));return}if($.zone==="filters"){let Me=pe.indexOf($.key),Xe=pe.indexOf(G.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&<(kt=>arrayMove(kt,Me,Xe));return}if($.zone==="values"){let Me=xe.findIndex(kt=>kt.tokenId===$.key),Xe=xe.findIndex(kt=>kt.tokenId===(G.key??""));Me!==-1&&Xe!==-1&&Me!==Xe&&Ft(kt=>arrayMove(kt,Me,Xe));}return}let ue=G.zone,Fe=[...Ge],rt=[...Le],_e=[...pe],ne=[...xe],me="",te=null;if($.zone==="palette")me=$.key;else if($.zone==="values"){let Me=ne.find(Xe=>Xe.tokenId===$.key);if(!Me)return;me=Me.fieldId,te=Me,ne=ne.filter(Xe=>Xe.tokenId!==$.key);}else $.zone==="rows"?(me=$.key,Fe=Fe.filter(Me=>Me!==me)):$.zone==="columns"?(me=$.key,rt=rt.filter(Me=>Me!==me)):$.zone==="filters"&&(me=$.key,_e=_e.filter(Me=>Me!==me));if(!me)return;let Ee=()=>{Fe=Fe.filter(Me=>Me!==me),rt=rt.filter(Me=>Me!==me),_e=_e.filter(Me=>Me!==me);},Qe=Me=>{if(G.kind!=="item"||!G.key)return Me==="rows"?Fe.length:Me==="columns"?rt.length:Me==="filters"?_e.length:Me==="values"?ne.length:0;if(Me==="rows"){let Xe=Fe.indexOf(G.key);return Xe>=0?Xe:Fe.length}if(Me==="columns"){let Xe=rt.indexOf(G.key);return Xe>=0?Xe:rt.length}if(Me==="filters"){let Xe=_e.indexOf(G.key);return Xe>=0?Xe:_e.length}if(Me==="values"){let Xe=ne.findIndex(kt=>kt.tokenId===G.key);return Xe>=0?Xe:ne.length}return 0};if(ue==="palette"){ft(Fe),Dt(rt),lt(_e),Ft(ne);return}if(ue==="values"){let Me=Qe("values"),Xe=te??ge(me);ne.splice(Me,0,Xe),ft(Fe),Dt(rt),lt(_e),Ft(ne);return}if(Bu(ue)){Ee();let Me=Qe(ue);ue==="rows"?Fe.splice(Me,0,me):ue==="columns"?rt.splice(Me,0,me):_e.splice(Me,0,me),ft(Fe),Dt(rt),lt(_e),Ft(ne);}},[Le,ge,pe,Ge,xe]),mt=useCallback((R,$)=>{Zt(G=>({...G,[R]:$}));},[]),yt=useCallback(R=>{Ot($=>{let G=new Set($);return G.has(R)?G.delete(R):G.add(R),G});},[]),ro=useCallback(R=>{re($=>{let G=new Set($);return G.has(R)?G.delete(R):G.add(R),G});},[]),Et=useCallback(R=>{let $=D.get(R.fieldId),G=Ll($);return f(yr,{size:"small",sx:{minWidth:98},children:f(zt,{value:R.aggregation,onChange:ue=>qe(R.tokenId,ue.target.value),onClick:ue=>ue.stopPropagation(),onMouseDown:ue=>ue.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:G.map(ue=>f("option",{value:ue,sx:{fontSize:"0.75rem"},children:M(ue)},ue))})})},[D,M,qe]),Yt=useCallback(R=>{let $=bt[R]??[],G=oe[R]??$;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})},[bt,oe,g$1]),Ht=useCallback(R=>{let $=bt[R]??[],G=oe[R]??$;return f(Wu,{options:$,selectedValues:G,onChange:ue=>mt(R,ue)})},[bt,oe,mt]),Ut=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),$t=useCallback(()=>{let R={};return new Set([...Mt,...Object.keys(oe)]).forEach(G=>{if(!w.has(G))return;let ue=oe[G]??[];R[G]=[...ue];}),{layout:{rows:[...Ge],columns:[...Le],filters:[...pe],values:xe.map(G=>({fieldId:G.fieldId,aggregation:G.aggregation}))},filterSelections:R,showGrandTotal:ye,chart:{dimensionFieldId:je,primaryValueFieldId:st,secondaryValueFieldId:pt,chartType:Bt}}},[Mt,je,st,pt,Bt,Le,pe,oe,Ge,ye,w,xe]),to=useCallback(R=>{let $=so(R.layout.rows,w),G=so(R.layout.columns,w),ue=so(R.layout.filters,w),Fe=new Set,rt=(R.layout.values??[]).filter(me=>!w.has(me.fieldId)||Fe.has(me.fieldId)?false:(Fe.add(me.fieldId),true)).map(me=>ge(me.fieldId,me.aggregation)),_e={};Object.entries(R.filterSelections??{}).forEach(([me,te])=>{!w.has(me)||!Array.isArray(te)||(_e[me]=Array.from(new Set(te.map(Ee=>String(Ee)))));}),ft($),Dt(G),lt(ue),Ft(rt),Zt(_e),typeof R.showGrandTotal=="boolean"&&K(R.showGrandTotal),X(Hl($,G,R.chart?.dimensionFieldId));let ne=ns(rt,R.chart?.primaryValueFieldId);fe(ne),Se(zl(rt,ne,R.chart?.secondaryValueFieldId)),Ae(R.chart?.chartType??"bar-vertical"),U(R.id),C?.(R);},[ge,C,X,fe,Se,Ae,Dt,lt,Zt,ft,K,Ft,w]),no=useCallback(R=>{if(!R){U("");return}let $=wt.find(G=>G.id===R);if(!$){U("");return}to($);},[to,wt]),bo=useCallback(()=>{let R=g$1("pivot.preset.defaultName",{index:wt.length+1});at(R),we(true);},[wt.length,g$1]),Mo=useCallback(()=>{let R=Oe.trim();if(!R)return;let $={id:Ut(),name:R,...$t()};Ye(G=>[...G,$]),U($.id),we(false);},[$t,Ut,Oe,Ye]),Ro=useCallback(()=>{it&&(Ye(R=>R.filter($=>$.id!==it)),U(""));},[it,Ye]);useEffect(()=>{if(!b$1||y.current)return;let R=wt.find($=>$.id===b$1);R&&(y.current=true,to(R));},[to,b$1,wt]),useEffect(()=>{it&&(wt.some(R=>R.id===it)||U(""));},[it,wt]);let ar=useMemo(()=>{if(!ye||!j||!Ge.length)return null;let R={};return j.dataColumns.forEach($=>{let G=F.filter(ue=>{let Fe=Le.length>0?Le.map(rt=>pr(ue[rt])):[g$1("pivot.valueLabel")];return $r(Fe)===$.colKey});R[$.id]=wn(G,$.valueItem.fieldId,$.valueItem.aggregation);}),{key:"__grand_total__",value:g$1("pivot.grandTotal")||Au,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:R,path:[],depth:-1}},[ye,j,F,Le,Ge.length,g$1]),xo=useMemo(()=>Ju(j?.rowTree??[]),[j]),Bo=useMemo(()=>Ju(j?.columnTree??[]),[j]);useEffect(()=>{Ot(R=>{let $=new Set;return R.has("__grand_total__")&&$.add("__grand_total__"),xo.forEach(G=>{R.has(G)&&$.add(G);}),$});},[xo]),useEffect(()=>{re(R=>{let $=new Set;return Bo.forEach(G=>{R.has(G)&&$.add(G);}),$});},[Bo]);let Kr=useCallback(()=>{Ot(R=>{let $=new Set(R);return xo.forEach(G=>$.add(G)),$});},[xo]),qr=useCallback(()=>{Ot(R=>{let $=new Set;return R.has("__grand_total__")&&$.add("__grand_total__"),$});},[]),Er=useCallback(()=>{re(new Set(Bo));},[Bo]),Xr=useCallback(()=>{re(new Set);},[]),Zr=useMemo(()=>!j||Le.length===0?[]:Yv(j.columnTree,At),[Le.length,At,j]),No=useMemo(()=>{if(!j)return [];if(Le.length===0)return j.dataColumns.map($=>({id:$.id,label:$.label,leafColumnIds:[$.id],valueItem:$.valueItem}));let R=new Map(j.dataColumns.map($=>[$.id,$]));return Zr.flatMap($=>{let G=new Map;return $.leafColumnIds.forEach(ue=>{let Fe=R.get(ue);if(!Fe)return;let rt=Fe.valueItem.tokenId,_e=`${M(Fe.valueItem.aggregation)} ${D.get(Fe.valueItem.fieldId)?.label??Fe.valueItem.fieldId}`,ne=G.get(rt);if(ne){ne.leafColumnIds.push(ue);return}G.set(rt,{id:`${$.key}::${rt}`,label:xe.length>1?_e:$.label,leafColumnIds:[ue],valueItem:Fe.valueItem});}),Array.from(G.values())})},[Le.length,D,M,j,xe.length,Zr]),Lr=useMemo(()=>new Map(No.map(R=>[R.id,R])),[No]),Yr=useMemo(()=>No.map(R=>({id:R.id,colKey:R.id,valueItem:R.valueItem,label:R.label})),[No]),Zo=useMemo(()=>{if(!j||Le.length===0)return [];let R=[],$=em(j.columnTree,At),G=$+(xe.length>1?1:0),ue=(Fe,rt)=>{R[rt]??(R[rt]=[]),Fe.forEach(_e=>{let ne=_e.children.length>0&&At.has(_e.key),me=No.filter(Ee=>_e.leafColumnIds.some(Qe=>Ee.leafColumnIds.includes(Qe))).length,te=ne||xe.length>1?1:G-rt;R[rt].push({key:_e.key,label:_e.label,colSpan:me,rowSpan:te,expandable:_e.children.length>0,expanded:ne}),ne&&ue(_e.children,rt+1);});};return ue(j.columnTree,0),xe.length>1&&(R[$]=No.map(Fe=>({key:Fe.id,label:Fe.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),R},[Le.length,At,j,xe.length,No]),ir=useCallback((R,$)=>$.leafColumnIds.reduce((G,ue)=>G+(R.aggregatedValues[ue]??0),0),[]),Ln=useMemo(()=>g(e,{children:[f(Pe,{size:"small",variant:"text",onClick:Kr,disabled:xo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandRowsAll")}),f(Pe,{size:"small",variant:"text",onClick:qr,disabled:xo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseRowsAll")}),f(Rt,{orientation:"vertical",flexItem:true}),f(Pe,{size:"small",variant:"text",onClick:Er,disabled:Bo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandColumnsAll")}),f(Pe,{size:"small",variant:"text",onClick:Xr,disabled:Le.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseColumnsAll")})]}),[Le.length,Bo.size,xo.size,Xr,qr,Er,Kr,g$1]),Or=()=>{if(!Ze)return null;let R=Yi(Ze);if(!R||R.kind!=="item"||!R.key)return null;if(R.zone==="palette"){let Fe=D.get(R.key);return Fe?f(Ol,{label:Fe.label,subtitle:Fe.type}):null}if(R.zone==="values"){let Fe=xe.find(me=>me.tokenId===R.key);if(!Fe)return null;let _e=D.get(Fe.fieldId)?.label??Fe.fieldId,ne=`${M(Fe.aggregation)}(${_e})`;return f(ji,{label:_e,caption:ne})}let G=D.get(R.key)?.label??R.key,ue=Yt(R.key);return f(ji,{label:G,caption:ue})};return g(De,{sx:R=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${R.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(se,{direction:"row",spacing:1.5,alignItems:"center",children:[Wt&&g(e,{children:[f(yr,{size:"small",sx:{minWidth:200},children:g(zt,{value:it,displayEmpty:true,onChange:R=>no(String(R.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")}),wt.map(R=>f("option",{value:R.id,sx:{fontSize:"0.75rem"},children:R.name},R.id))]})}),f(ct,{title:g$1("pivot.preset.save"),children:f(ie,{size:"small",onClick:bo,"aria-label":g$1("pivot.preset.save"),sx:{width:28,height:28,p:0},children:f(kr,{size:15})})}),f(ct,{title:g$1("pivot.preset.delete"),children:f("span",{children:f(ie,{size:"small",onClick:Ro,disabled:!it,"aria-label":g$1("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:f(li,{size:15})})})}),f(Rt,{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:o.length.toLocaleString()})," / ",g$1("pivot.afterFilter"),":"," ",f("strong",{children:F.length.toLocaleString()})]}),f(Rt,{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(ni,{size:"small",checked:ye,onChange:R=>K(R.target.checked)})]})]})]}),f(Rt,{}),g(DndContext,{sensors:x,collisionDetection:closestCenter,onDragStart:St,onDragEnd:ht,children:[f(Gu,{isConfiguratorCollapsed:Ne,onToggleCollapse:()=>z(R=>!R),availableFields:gt,fieldMap:D,filterFields:pe,columnFields:Le,rowFields:Ge,valueFields:xe,clearZone:Te,removeFieldFromZone:Je,getFilterSelectionSummary:Yt,renderDimensionFilterSelect:Ht,renderAggregationSelect:Et,getAggregationLabel:M}),f(Ad,{children:f(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Or()})})]}),f(Qu,{rows:F,fieldMap:D,rowFields:Ge,columnFields:Le,valueFields:xe,chartDimensionFieldId:je,chartPrimaryValueFieldId:st,chartSecondaryValueFieldId:pt,chartType:Bt,isCollapsed:Xt,onChartDimensionFieldIdChange:R=>X(R),onChartPrimaryValueFieldIdChange:R=>fe(R),onChartSecondaryValueFieldIdChange:R=>Se(R),onChartTypeChange:R=>Ae(R),onToggleCollapse:()=>$e(R=>!R),getAggregationLabel:M}),f(Pn,{title:g$1("pivot.table.sectionTitle"),subtitle:Ge.length>0?Ge.map(R=>D.get(R)?.label??R).join(" > "):g$1("pivot.table.dimensions"),collapsed:Vt,onToggleCollapse:()=>Ke(R=>!R),expandAriaLabel:g$1("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Ln,children:j===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:(Zo.length>0?Zo:[[]]).map((R,$)=>g("tr",{children:[$===0&&f("td",{rowSpan:Math.max(Zo.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:Ge.length>0?Ge.map(G=>D.get(G)?.label).join(" > "):g$1("pivot.table.dimensions")}),(R.length>0?R:No.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:ue=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${ue.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:g("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[G.expandable&&f(ie,{size:"small",onClick:()=>ro(G.key),sx:{width:22,height:22,p:0,ml:-0.2},children:G.expanded?f($o,{size:12}):f(Sr,{size:12})}),f("div",{component:"span",children:G.label})]})},G.key))]},`pivot-header-row-${$}`))}),g("tbody",{children:[j.rowTree.map(R=>f(os,{node:R,dataColumns:Yr,fieldMap:D,level:0,expandedKeys:It,onToggle:yt,getValue:($,G)=>{let ue=Lr.get(G);return ue?ir($,ue):0}},R.key)),ar&&f(os,{node:ar,dataColumns:Yr,fieldMap:D,level:0,expandedKeys:It,onToggle:yt,getValue:(R,$)=>{let G=Lr.get($);return G?ir(R,G):0}})]})]})})}),g(Lt,{open:Re,onClose:()=>we(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:Oe,onChange:R=>at(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),Mo());}})}),g("div",{className:"orb-dialog-actions",children:[f(Pe,{onClick:()=>we(false),children:g$1("common.cancel")}),f(Pe,{variant:"contained",onClick:Mo,disabled:!Oe.trim(),children:g$1("common.save")})]})]})]})};var tm=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},Wl=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",om=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",yO=({fields:t,initialLayout:o,initialFilterSelections:r={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:c=false})=>{let d=useRef(0),u=useMemo(()=>new Set(t.map(U=>U.id)),[t]),m=useMemo(()=>new Map(t.map(U=>[U.id,U])),[t]),[h,f]=useState(()=>so(o?.rows,u)),[p,b]=useState(()=>so(o?.columns,u)),[C,g]=useState(()=>so(o?.filters,u)),[x,v]=useState(()=>{let U=o?.values??[],Re=new Set,we=[];return U.forEach(Oe=>{!u.has(Oe.fieldId)||Re.has(Oe.fieldId)||(Re.add(Oe.fieldId),d.current+=1,we.push({tokenId:`v${d.current}`,fieldId:Oe.fieldId,aggregation:Co(Oe.aggregation,m.get(Oe.fieldId))}));}),we}),[y,P]=useState(r),[S,I]=useState(n),[M,w]=useState(a),[D,N]=useState(()=>tm(so(o?.rows,u),so(o?.columns,u),i?.dimensionFieldId)),[T,k]=useState(()=>{let U=(()=>{let Re=o?.values??[],we=new Set,Oe=[];return Re.forEach(at=>{!u.has(at.fieldId)||we.has(at.fieldId)||(we.add(at.fieldId),Oe.push({tokenId:at.fieldId,fieldId:at.fieldId,aggregation:Co(at.aggregation,m.get(at.fieldId))}));}),Oe})();return Wl(U,i?.primaryValueFieldId)}),[A,L]=useState(()=>{let U=(()=>{let we=o?.values??[],Oe=new Set,at=[];return we.forEach(Ze=>{!u.has(Ze.fieldId)||Oe.has(Ze.fieldId)||(Oe.add(Ze.fieldId),at.push({tokenId:Ze.fieldId,fieldId:Ze.fieldId,aggregation:Co(Ze.aggregation,m.get(Ze.fieldId))}));}),at})(),Re=Wl(U,i?.primaryValueFieldId);return om(U,Re,i?.secondaryValueFieldId)}),[W,ee]=useState(i?.chartType??"bar-vertical"),[O,_]=useState(s),[V,Q]=useState(c);useEffect(()=>{f(U=>{let Re=U.filter(we=>u.has(we));return ur(U,Re)?U:Re}),b(U=>{let Re=U.filter(we=>u.has(we));return ur(U,Re)?U:Re}),g(U=>{let Re=U.filter(we=>u.has(we));return ur(U,Re)?U:Re}),v(U=>{let Re=U.filter(we=>u.has(we.fieldId)).map(we=>({...we,aggregation:Co(we.aggregation,m.get(we.fieldId))}));return Qi(U,Re)?U:Re});},[m,u]),useEffect(()=>{N(U=>tm(h,p,U));},[p,h]),useEffect(()=>{k(U=>Wl(x,U));},[x]),useEffect(()=>{L(U=>om(x,T,U));},[T,x]);let H=useCallback(U=>{f(so(U,u));},[u]),B=useCallback(U=>{b(so(U,u));},[u]),q=useCallback(U=>{g(so(U,u));},[u]),Z=useCallback(U=>{v(Re=>{let we=U??[],Oe=new Set,at=[];return we.forEach(Ze=>{if(!u.has(Ze.fieldId)||Oe.has(Ze.fieldId))return;Oe.add(Ze.fieldId);let xt=Re.find(It=>It.fieldId===Ze.fieldId);if(xt){at.push({...xt,aggregation:Co(Ze.aggregation??xt.aggregation,m.get(Ze.fieldId))});return}d.current+=1,at.push({tokenId:`v${d.current}`,fieldId:Ze.fieldId,aggregation:Co(Ze.aggregation,m.get(Ze.fieldId))});}),at});},[m,u]),Y=useCallback(U=>{H(U.rows??[]),B(U.columns??[]),q(U.filters??[]),Z(U.values??[]);},[B,q,H,Z]),J=useCallback(U=>{if(U==="rows")return f([]);if(U==="columns")return b([]);if(U==="filters")return g([]);v([]);},[]),le=useCallback((U,Re)=>{if(U==="rows")return f(we=>we.filter(Oe=>Oe!==Re));if(U==="columns")return b(we=>we.filter(Oe=>Oe!==Re));if(U==="filters")return g(we=>we.filter(Oe=>Oe!==Re));v(we=>we.filter(Oe=>Oe.tokenId!==Re));},[]),he=useCallback((U,Re)=>{v(we=>we.map(Oe=>Oe.tokenId===U?{...Oe,aggregation:Co(Re,m.get(Oe.fieldId))}:Oe));},[m]),ze=useCallback((U,Re)=>{P(we=>({...we,[U]:Re}));},[]),be=useCallback(()=>{P({});},[]),Ce=useCallback(()=>{I(U=>!U);},[]),Be=useCallback(()=>{w(U=>!U);},[]),de=useCallback(U=>{N(U);},[]),ve=useCallback(U=>{k(U);},[]),We=useCallback(U=>{L(U);},[]),et=useCallback(()=>{_(U=>!U);},[]),nt=useCallback(()=>{Q(U=>!U);},[]);return {model:useMemo(()=>({rowFields:h,setRowFields:f,columnFields:p,setColumnFields:b,filterFields:C,setFilterFields:g,valueFields:x,setValueFields:v,filterSelections:y,setFilterSelections:P,showGrandTotal:S,setShowGrandTotal:I,isConfiguratorCollapsed:M,setIsConfiguratorCollapsed:w,chartDimensionFieldId:D,setChartDimensionFieldId:N,chartPrimaryValueFieldId:T,setChartPrimaryValueFieldId:k,chartSecondaryValueFieldId:A,setChartSecondaryValueFieldId:L,chartType:W,setChartType:ee,isChartCollapsed:O,setIsChartCollapsed:_,isTableCollapsed:V,setIsTableCollapsed:Q}),[D,T,A,W,p,C,y,O,M,V,h,S,x]),actions:{setRows:H,setColumns:B,setFilters:q,setValues:Z,setLayout:Y,clearZone:J,removeFieldFromZone:le,setAggregationForValue:he,setFilterSelection:ze,resetFilterSelections:be,toggleGrandTotal:Ce,toggleConfigurator:Be,setChartDimension:de,setChartPrimaryValue:ve,setChartSecondaryValue:We,setChartType:ee,toggleChart:et,toggleTable:nt}}};var SO=({orientation:t="auto",defaultNavigationOpen:o,onNavOpenChange:r}={})=>{let n=io(),a=Cr("(orientation: portrait)"),i=Cr(n.breakpoints.down("md")),s=useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[c,d]=useState(o??s==="landscape");useEffect(()=>{d(o??s==="landscape");},[o,s]);let u=h=>{d(h),r?.(h);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:c,setNavigationOpen:u,toggleNavigationOpen:()=>u(!c)}};var oy=t=>{let o=Number(t||0);return Number.isFinite(o)?o:0},TO=({rows:t,rowKey:o="id",numericField:r,defaultSelectedId:n})=>{let i=t[0]?.[o],[s,c]=useState(n??i),d=useMemo(()=>t.find(p=>p[o]===s)||t[0],[o,t,s]),[u,m]=useState(()=>{let p=d?.[r];return p==null?"0":String(p)});return {selectedId:s,selectedRecord:d,editorValue:u,setEditorValue:m,selectRecord:p=>{let b=p[o];c(b);let C=p[r];m(C==null?"0":String(C));},applyEditorValue:p=>{if(s===void 0)return;let b=oy(u),C=t.map(g=>g[o]===s?{...g,[r]:b}:g);p(C);}}};var ry=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],nm=(t,o,r,n)=>{o?.(t),n&&r?.();},AO=({open:t,onClose:o,title:r="Scan barcode",subtitle:n="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=ry,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:u="Use code",cancelLabel:m="Close",manualPlaceholder:h="Enter barcode manually",onDetected:f$1,onError:p,sx:b$1})=>{let C=Jt__default.useRef(null),g$1=Jt__default.useRef(null),x=Jt__default.useRef(null),v=Jt__default.useRef(null),[y,P]=Jt__default.useState("idle"),[S,I]=Jt__default.useState(""),[M,w]=Jt__default.useState(null),[D,N]=Jt__default.useState(null),T=Jt__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),C.current&&(C.current.srcObject=null);},[]),k=Jt__default.useCallback(L=>{N(L),P("error"),p?.(L);},[p]);Jt__default.useEffect(()=>{if(!t){T(),P("idle"),N(null),I("");return}let L=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){P("unsupported"),N("Camera access is not supported in this browser.");return}P("starting"),N(null);try{let ee=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(L){ee.getTracks().forEach(O=>O.stop());return}if(g$1.current=ee,C.current&&(C.current.srcObject=ee,await C.current.play()),!window.BarcodeDetector){P("unsupported"),N("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}v.current=new window.BarcodeDetector({formats:a}),P("ready"),x.current=window.setInterval(async()=>{if(!(!C.current||!v.current)&&!(C.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let _=(await v.current.detect(C.current)).find(Q=>Q.rawValue);if(!_?.rawValue)return;let V={rawValue:_.rawValue,format:_.format};w(V),T(),nm(V,f$1,o,c);}catch(O){k(O instanceof Error?O.message:"Failed to detect barcode.");}},d);}catch(ee){k(ee instanceof Error?ee.message:"Unable to start camera.");}}})(),()=>{L=true,T();}},[c,i,a,o,f$1,t,k,d,T]);let A=()=>{let L=S.trim();if(!L)return;let W={rawValue:L,format:"manual"};w(W),nm(W,f$1,o,c);};return g(Lt,{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(se,{spacing:2,sx:b$1,children:[f(E,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),g(De,{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:C,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(Ct,{icon:f(Ud,{}),label:y==="ready"?"Camera ready":y==="starting"?"Starting camera":y==="unsupported"?"Preview only":y==="error"?"Scanner error":"Idle",size:"small",color:y==="error"?"error":"primary",variant:"filled"}),M?f(Ct,{icon:f(cp,{}),label:`${M.format||"barcode"}: ${M.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),D?f(Jo,{severity:y==="unsupported"?"info":"warning",children:D}):null,s?g(se,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[f(He,{fullWidth:true,label:"Barcode",placeholder:h,value:S,onChange:L=>I(L.target.value)}),f(Pe,{variant:"contained",onClick:A,sx:{minHeight:56,px:2.5},children:u})]}):null]})}),f("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:f(Pe,{onClick:o,children:m})})]})};var ny={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)"},zO=({title:t,description:o,kicker:r,icon:n,badges:a=[],metrics:i=[],footer:s,children:c,selected:d=false,draggable:u=false,isDragging:m=false,swipeThreshold:h=88,startAction:f$1,endAction:p,dragHandleProps:b$1,onClick:C,onSwipe:g$1,sx:x})=>{let[v,y]=useState(0),[P,S]=useState(false),I=useRef(null),M=useRef(0),w=useRef(0),D=!!(f$1||p),N=132,T=()=>{y(0),S(false),I.current=null,M.current=0,w.current=0;},k=O=>{(O==="start"?f$1:p)?.onTrigger?.(),g$1?.(O),T();},A=O=>{!D||O.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(I.current=O.pointerId,M.current=O.clientX,w.current=O.clientX,S(true),O.currentTarget.setPointerCapture(O.pointerId));},L=O=>{if(!P||I.current!==O.pointerId)return;w.current=O.clientX;let _=w.current-M.current,V=Math.max(-N,Math.min(N,_));y(V);},W=O=>{if(!P||I.current!==O.pointerId)return;let _=w.current-M.current;if(_>=h&&f$1){k("start");return}if(_<=-h&&p){k("end");return}Math.abs(_)<12&&C?.(),T();},ee=(O,_)=>{if(!O)return null;let V=O.backgroundColor||ny[O.tone||"default"];return f("div",{sx:{position:"absolute",top:0,bottom:0,[_]:0,width:N,px:2,display:"flex",alignItems:"center",justifyContent:_==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${V}, rgba(15,23,42,0.92))`},children:g(se,{direction:"row",spacing:1,alignItems:"center",children:[O.icon,f(E,{sx:{fontWeight:700,fontSize:"0.95rem"},children:O.label})]})})};return g("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[ee(f$1,"left"),ee(p,"right"),f(De,{elevation:0,onPointerDown:A,onPointerMove:L,onPointerUp:W,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(${v}px, 0, 0) scale(${m?.985:1})`,transition:P?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:C?"pointer":"default",opacity:m?.9:1},children:g(se,{spacing:1.5,children:[g(se,{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:[r?f(E,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:r}):null,f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),o?f(E,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:o}):null]}),u?f("div",{"data-no-swipe":"true",...b$1,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:f(ie,{size:"small",children:f(jd,{})})}):null]}),a.length>0?f(se,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((O,_)=>f(Ct,{label:O,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},_))}):null,i.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(O=>g(De,{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:O.label}),f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:O.value})]},O.id))}):null,c,s]})})]})};var ga=({label:t,onPress:o,emphasis:r="default"})=>f("div",{component:"button",type:"button",onClick:o,sx:n=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:r==="primary"?"primary.main":"divider",background:r==="primary"?n.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}),qO=({value:t,defaultValue:o="",title:r,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:c,confirmLabel:d,clearLabel:u,backspaceLabel:m,onChange:h,onSubmit:f$1,onClose:p,sx:b})=>{let{t:C}=ce(),[g$1,x]=useState(o),v=t??g$1,y=T=>{t===void 0&&x(T),h?.(T);},P=T=>{c&&v.length>=c||y(`${v}${T}`);},S=T=>{if(T==="00"){if(!v){y("0");return}P("00");return}P(T);},I=()=>{!i||v.includes(".")||y(v?`${v}.`:"0.");},M=()=>{if(s){if(v.startsWith("-")){y(v.slice(1));return}y(v?`-${v}`:"-");}},w=()=>{y(v.slice(0,-1));},D=()=>{y("");},N=()=>{f$1?.(v);};return f(De,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...b},children:g(se,{spacing:2,children:[g(se,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[g("div",{sx:{minWidth:0},children:[r?f(E,{sx:{fontSize:"1rem",fontWeight:800},children:r}):null,n?f(E,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),p?f(ie,{onClick:p,size:"small",children:f(Yd,{})}):null]}),f(De,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(E,{sx:{minHeight:38,fontSize:v?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:v?"text.primary":"text.disabled"},children:v||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(ga,{label:T,onPress:()=>S(T)},T)),f(ga,{label:s?"+/-":"00",onPress:s?M:()=>S("00")}),f(ga,{label:"0",onPress:()=>S("0")}),f(ga,{label:i?".":m?String(m):"DEL",onPress:i?I: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(se,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Gd,{}),f(E,{sx:{fontWeight:700},children:m||"DEL"})]})}),f(ga,{label:String(u||"CLR"),onPress:D,emphasis:"danger"}),f("div",{component:"button",type:"button",onClick:N,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(se,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(qd,{}),f(E,{sx:{fontWeight:800},children:d||C("common.ok")})]})})]})]})})};var im=({touchMode:t="comfortable",sx:o,...r})=>{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},...o},children:f(_o,{...r})})};var cy=(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);}},sm=({items:t,selectedId:o,orientation:r="auto",onItemSelect:n,sx:a})=>{let i=io(),[s,c]=useState(false);useEffect(()=>{c(true);},[]);let d=Cr("(orientation: portrait)"),u=Cr(i.breakpoints.down("md")),m=r==="auto"?d||u?"portrait":"landscape":r,h=useRouter();return f("div",{sx:{display:"grid",gridTemplateColumns:!s||m==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:t.map(f$1=>{let p=f$1.id===o,b$1=f$1.color||(p?i.palette.primary.main:i.palette.divider);return f(De,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:p?"primary.main":"divider",boxShadow:p?"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:f$1.disabled,onClick:()=>cy(h,f$1,n),sx:{width:"100%",p:2,minHeight:m==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:f$1.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:g(se,{spacing:1.5,sx:{height:"100%"},children:[g(se,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[f("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:p?"var(--orb-on-primary)":"text.primary",background:p?b$1:"action.hover"},children:f$1.icon||f(E,{sx:{fontSize:"1rem",fontWeight:900},children:f$1.title.slice(0,1).toUpperCase()})}),f$1.badge!==void 0?f("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:p?"primary.main":"action.hover",color:p?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:f$1.badge}):null]}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:f$1.title}),f$1.caption?f(E,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:f$1.caption}):null,f$1.description?f(E,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:f$1.description}):null]})]})})},f$1.id)})})};var dm=(t,o)=>o.trim()?t.reduce((r,n)=>{let a=n.title?.toLowerCase().includes(o.toLowerCase())||n.label?.toLowerCase().includes(o.toLowerCase())||n.description?.toLowerCase().includes(o.toLowerCase()),i=n.children?dm(n.children,o):[];return (a||i.length>0)&&r.push({...n,children:i.length>0?i:n.children}),r},[]):t,my=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children?.length&&(o.add(a.id),r(a.children));});};return r(t),o},pm=({collapsed:t=false,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:c,footerSlot:d,activeHref:u,onItemSelect:m})=>{let{t:h}=ce(),f$1=io(),p=Do("(orientation: portrait)"),b=Do(f$1.breakpoints.down("md")),C=s==="auto"?p||b?"portrait":"landscape":s,g$1=i==="dark",x=useRouter(),v=usePathname(),[y,P]=useState(""),[S,I]=useState(new Set),M=useMemo(()=>dm(a,y),[a,y]),w=useMemo(()=>y.trim()?my(M):S,[S,M,y]);useEffect(()=>{t&&I(new Set);},[t]);let D=L=>L.appurl||L.href||"",N=L=>{m?.(L);let W=D(L);if(W){if(W.startsWith("http://")||W.startsWith("https://")){window.open(W,"_blank");return}x.push(W);}},T=L=>{let W=!!L.children?.length;if(t&&W){o?.();return}if(W){I(ee=>{let O=new Set(ee);return O.has(L.id)?O.delete(L.id):O.add(L.id),O});return}N(L);},k=L=>{let W=u||v,ee=D(L);return !!(ee&&W===ee)},A=(L,W=0)=>{let ee=!!L.children?.length,O=w.has(L.id),_=k(L);return f("div",{sx:{pl:W===0?0:1.5},children:g(De,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:_?"primary.main":"divider",bgcolor:_?"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(oi,{variant:"rounded",sx:{width:40,height:40,bgcolor:_?"primary.main":"action.hover",color:_?"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]}),ee?f(nn,{sx:{transform:O?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):f(ii,{color:"action"})]}),ee?f(rn,{in:O,children:f("div",{sx:{px:1.25,pb:1.25},children:L.children?.map(V=>A(V,W+1))})}):null]})},L.id)};return t?f(De,{elevation:0,className:r,sx:{width:C==="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(se,{spacing:1,children:[f(ie,{onClick:o,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:h("navigation.expand"),children:f(ui,{})}),a.map(L=>f(ie,{onClick:()=>T(L),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:k(L)?"primary.main":"action.hover",color:k(L)?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()},L.id))]})}):f(De,{elevation:0,className:r,sx:{width:C==="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(se,{spacing:1.25,sx:{flex:1,minHeight:0},children:[g(se,{direction:"row",spacing:1,alignItems:"center",children:[f(He,{value:y,onChange:L=>P(L.target.value),placeholder:h("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:f(dp,{fontSize:"small",color:"action"})}}),C==="landscape"&&!t?f(ie,{onClick:o,sx:{bgcolor:"action.hover"},children:f(ap,{})}):null]}),c,f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:M.length>0?M.map(L=>A(L)):f(E,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:h("navigation.noMatch")})}),d]})})};var um=(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)},gy=t=>Jt__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}),hy=(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)},fy=({summaryRow:t,visibleColumns:o,columns:r})=>{let n=r.filter(a=>o.includes(a.id)&&t[a.id]!=="");return n.length===0?null:f(De,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g(se,{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(De,{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}`))})]})})},by=t=>{let{t:o}=ce(),r=io(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:c,actions:d,extraTools:u,fitContainer:m=false,fullWidth:h=false,maxHeight:f$1,loading:p=false,rowsPerPageOptions:b$1=[20,50,100,-1],onLayoutSave:C,filterConfig:g$1,rowKey:x,tableKey:v="default",graphReport:y,quickCreate:P,quickEdit:S,quickDelete:I,serviceUrl:M,orientation:w="auto",cardTitleField:D,cardSubtitleFields:N,toolbarSlot:T,emptyState:k,rowHeight:A="comfortable",cardActionSlot:L,renderCardFooter:W,onRowClick:ee}=t,O=n||o("table.title.default"),_=Do("(orientation: portrait)"),V=Do(r.breakpoints.down("md")),Q=w==="auto"?_||V?"portrait":"landscape":w,{columns:H,filterText:B,setFilterText:q,visibleColumns:Z,showSummary:Y,setShowSummary:J,summaryColumns:le,grouping:he,setGrouping:ze,expandedGroups:be,groupAnchorEl:Ce,setGroupAnchorEl:Be,summaryAnchorEl:de,setSummaryAnchorEl:ve,anchorEl:We,setAnchorEl:et,contextMenu:nt,sortedAndFilteredRows:it,summaryRow:U,visibleRows:Re,page:we,setPage:Oe,rowsPerPage:at,setRowsPerPage:Ze,totalDisplayCount:xt,setSelected:It,handleClick:Ot,toggleSummaryColumn:At,handleExport:re,handleCloseContextMenu:Ge,toggleColumnVisibility:Le,toggleGroupExpand:pe,handleExpandGroupRecursively:xe,handleCollapseGroupRecursively:oe,handleLayoutLoad:ye,handleVariantLoad:Ne,handleLayoutSave:je,effectiveAppId:st,currentLayoutData:pt,currentLayoutId:Bt,layoutIdToLoad:Xt,graphReportOpen:Vt,handleOpenGraphReport:wt,handleCloseGraphReport:Wt}=fn(t),ft=y?.enabled??false,Dt=ft&&(y?.interaction?.enabled??true),lt=Di(),Ft=x||"id",Zt=Jt__default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:tt(r.palette.divider,b()==="dark"?.55:.3),bgcolor:b()==="dark"?tt(r.palette.common.white,.06):tt(r.palette.background.paper,.92),color:r.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[r]),K=Jt__default.useMemo(()=>({...Zt,borderColor:tt(r.palette.primary.main,b()==="dark"?.42:.24),bgcolor:b()==="dark"?tt(r.palette.primary.main,.16):tt(r.palette.primary.main,.08)}),[Zt,r]),z=Jt__default.useMemo(()=>{let te=new Set(s);return it.filter(Ee=>te.has(Ee?.[Ft]))},[Ft,s,it]),X=z.length===1?z[0]:null,fe=!!P?.enabled,Se=!!S?.enabled,Ae=!!I?.enabled,$e=P?.fields,Ke=P?.excludeFields||[],Ye=P?.initialValues||{},ut=S?.fields,gt=S?.excludeFields||[],Mt=S?.editableFields||[],bt=S?.nonEditableFields||[],F=S?.primaryKeys?.length?S.primaryKeys:[Ft],[j,ge]=Jt__default.useState(false),[Te,Je]=Jt__default.useState(false),[qe,St]=Jt__default.useState({}),[ht,mt]=Jt__default.useState(false),[yt,ro]=Jt__default.useState(false),[Et,Yt]=Jt__default.useState({}),[Ht,Ut]=Jt__default.useState(false),[$t,to]=Jt__default.useState(false),no=p||Te||yt||$t,bo=Jt__default.useMemo(()=>{let te=[...H];if(Array.isArray($e)&&$e.length>0){let Ee=new Set($e);te=te.filter(Qe=>Ee.has(Qe.id));}if(Ke.length>0){let Ee=new Set(Ke);te=te.filter(Qe=>!Ee.has(Qe.id));}return te.filter(Ee=>!!Ee?.id)},[H,Ke,$e]),Mo=Jt__default.useMemo(()=>{let te=[...H];if(Array.isArray(ut)&&ut.length>0){let Ee=new Set(ut);te=te.filter(Qe=>Ee.has(Qe.id));}if(gt.length>0){let Ee=new Set(gt);te=te.filter(Qe=>!Ee.has(Qe.id));}return te.filter(Ee=>!!Ee?.id)},[H,gt,ut]),Ro=Jt__default.useMemo(()=>new Set(F),[F]),ar=Jt__default.useMemo(()=>new Set(Mt),[Mt]),xo=Jt__default.useMemo(()=>new Set(bt),[bt]),Bo=Jt__default.useCallback(te=>ar.size>0?ar.has(te):!(xo.has(te)||Ro.has(te)),[ar,xo,Ro]);Jt__default.useEffect(()=>{!Vt&<.hasActiveFilters&<.clearAll();},[lt,Vt]);let Kr=()=>{let te={};bo.forEach(Ee=>{te[Ee.id]=Ye[Ee.id]??"";}),St(te),ge(true);},qr=(te,Ee)=>{St(Qe=>({...Qe,[te]:Ee}));},Er=async()=>{if(!P?.onSubmit){ge(false);return}try{Je(!0),await P.onSubmit(qe),ge(!1);}finally{Je(false);}},Xr=()=>{if(!X)return;let te={};Mo.forEach(Qe=>{te[Qe.id]=X[Qe.id]??"";});let Ee=S?.getInitialValues?{...te,...S.getInitialValues(X)}:te;Yt(Ee),mt(true);},Zr=(te,Ee)=>{Yt(Qe=>({...Qe,[te]:Ee}));},No=async()=>{if(X){if(!S?.onSubmit){mt(false);return}try{ro(!0),await S.onSubmit(Et,X),mt(!1);}finally{ro(false);}}},Lr=()=>{z.length!==0&&Ut(true);},Yr=async()=>{if(z.length===0){Ut(false);return}if(!I?.onConfirm){Ut(false),It([]),c?.([]);return}try{to(!0),await I.onConfirm(z),Ut(!1),It([]),c?.([]);}finally{to(false);}},Zo=it,{fieldMapping:ir}=un({rows:Zo,config:{...y,title:y?.title||`${O} ${o("graph.reportTitle")}`}}),Ln=Jt__default.useMemo(()=>Dt?lt.applyRows(Zo,ir):Zo,[ir,lt,Dt,Zo]),{model:Or}=un({rows:Ln,config:{...y,title:y?.title||`${O} ${o("graph.reportTitle")}`,fieldMapping:ir}}),R=Or.table.columns.map(te=>({id:te.id,label:te.label,align:te.align||"left",minWidth:120,numeric:te.align==="right"})),$=st?f(hn,{appId:st,tableKey:v,currentLayoutData:pt,onLayoutLoad:ye,targetLayoutId:Xt,activeLayoutId:Bt,serviceUrl:M??g$1?.serviceUrl}):null,G=H.filter(te=>Z.includes(te.id)),ue=G.find(te=>te.id===D)||G[0],Fe=N?.map(te=>G.find(Ee=>Ee.id===te)).filter(Boolean)||G.filter(te=>te.id!==ue?.id).slice(0,Q==="portrait"?2:3),rt=G.filter(te=>te.id!==ue?.id&&!Fe.some(Ee=>Ee.id===te.id)),_e=[T,u].filter(Boolean),ne=g(e,{children:[f(dn,{groupAnchorEl:Ce,setGroupAnchorEl:Be,grouping:he,setGrouping:ze,columns:H}),f(pn,{anchorEl:We,setAnchorEl:et,columns:H,visibleColumns:Z,toggleColumnVisibility:Le}),f(Si,{anchorEl:de,setAnchorEl:ve,showSummary:Y,setShowSummary:J,columns:H,summaryColumns:le,toggleSummaryColumn:At}),f(ki,{contextMenu:nt,handleCloseContextMenu:Ge,columns:H,visibleColumns:Z,toggleColumnVisibility:Le})]}),me=(te,Ee,Qe)=>{let Me=s.includes(Ee),Xe=Q==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",kt=Qe%2===0?tt(r.palette.primary.main,b()==="dark"?.09:.04):tt(r.palette.primary.main,b()==="dark"?.05:.022),Qr=tt(r.palette.divider,.22);return f(De,{elevation:0,onClick:()=>{Ot({},te),ee?.(te);},sx:{p:A==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Me?tt(r.palette.primary.main,.38):Qr,background:Me?`linear-gradient(135deg, ${tt(r.palette.primary.main,.13)}, ${tt(r.palette.primary.main,.06)})`:`linear-gradient(135deg, ${kt}, ${tt(r.palette.primary.main,.015)})`,boxShadow:Me?`0 12px 30px ${tt(r.palette.primary.main,.2)}`:`0 3px 10px ${tt(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:Me?r.palette.primary.main:Qe%2===0?tt(r.palette.primary.main,.26):tt(r.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${tt(r.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:g(se,{spacing:1.25,children:[g(se,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?f(Tt,{checked:Me,onClick:So=>So.stopPropagation(),onChange:()=>Ot({},te),sx:{mt:-0.6,ml:-0.6}}):null,g("div",{sx:{flex:1,minWidth:0},children:[ue?f(E,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:um(ue,te)}):null,Fe.length>0?f(se,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Fe.map(So=>f(Ct,{label:`${So.label}: ${hy(So,te)}`,size:"small",variant:"outlined",sx:Zt},`${Ee}-${So.id}`))}):null]}),L?f("div",{onClick:So=>So.stopPropagation(),children:L(te)}):null]}),rt.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:Xe,gap:1},children:rt.map(So=>g(De,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:b()==="dark"?tt(r.palette.background.default,.7):tt(r.palette.background.paper,.92),border:"0.1px solid",borderColor:tt(r.palette.divider,.24)},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:So.label}),gy(um(So,te))]},`${Ee}-${So.id}-detail`))}):null,W?g(e,{children:[f(Rt,{}),f("div",{onClick:So=>So.stopPropagation(),children:W(te)})]}):null]})},Ee)};return g("div",{sx:{width:h?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1?f("div",{sx:{mb:2},children:f(im,{...g$1,onVariantLoad:te=>{Ne(te),g$1.onVariantLoad?.(te);},appId:g$1.appId,tableKey:v,currentLayout:[{tableKey:v,layoutData:pt}],currentLayoutId:Bt,layoutRefs:[{tableKey:v,layoutId:Bt}],variantService:g$1.variantService,serviceUrl:M??g$1.serviceUrl,touchMode:Q==="portrait"?"expanded":"comfortable"})}):null,g(De,{sx:{width:h?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":no?{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"}},...f$1?{height:f$1}:m?{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(yi,{filterText:B,setFilterText:q,onRowsPerPageChange:Ze,rowsPerPage:at,rowsPerPageOptions:b$1,page:we,count:xt,onPageChange:Oe,actions:d,extraTools:_e,grouping:he,setGroupAnchorEl:Be,showSummary:Y,setShowSummary:J,setAnchorEl:et,setSummaryAnchorEl:ve,handleExport:re,showCreateButton:fe,onOpenCreateDialog:Kr,showEditButton:Se,onOpenEditDialog:Xr,editDisabled:z.length!==1,showDeleteButton:Ae,onOpenDeleteConfirm:Lr,deleteDisabled:z.length===0,onLayoutSave:C||g$1?.variantService&&g$1?.appId?je:void 0,loading:p,layoutManager:$,onOpenGraphReport:ft?wt:void 0})}):null,f("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:g(se,{spacing:1.25,children:[Re.length===0&&!p?k||f(De,{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:o("common.noData")})}):null,Re.map((te,Ee)=>{if(te.type==="group"){let Xe=be.has(te.id);return f(De,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g("div",{component:"button",type:"button",onClick:()=>pe(te.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(nn,{}):f(ii,{}),g("div",{sx:{flex:1,minWidth:0},children:[g(E,{sx:{fontSize:"0.94rem",fontWeight:800},children:[te.field,": ",te.value]}),g(E,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[te.count," records"]})]}),he.length>1&&te.level<he.length-1?g(se,{direction:"row",spacing:.5,children:[f(Ct,{size:"small",label:o("table.group.expandAll"),onClick:kt=>{kt.stopPropagation(),xe(te.id);},sx:K}),f(Ct,{size:"small",label:o("table.group.collapseAll"),onClick:kt=>{kt.stopPropagation(),oe(te.id);},sx:K})]}):null]})},te.id)}let Qe=te.data||te,Me=te.id||Qe[Ft]||Ee;return me(Qe,Me,Ee)}),Y?f(fy,{summaryRow:U,visibleColumns:Z,columns:H}):null,p?f(E,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:o("common.loading")}):null]})})]}),fe?g(Lt,{open:j,onClose:()=>!Te&&ge(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:P?.title||o("quickCreate.createWithTitle",{title:O})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[bo.map(te=>{let Ee=te.type==="number"||te.numeric?"number":te.type==="date"?"date":"text";return f(He,{label:te.label||te.id,value:qe[te.id]??"",onChange:Qe=>qr(te.id,Qe.target.value),type:Ee,fullWidth:true,InputLabelProps:{shrink:Ee==="date"?true:void 0}},`quick-create-${te.id}`)}),P?.description?f(Jo,{severity:"info",children:P.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Pe,{onClick:()=>ge(false),disabled:Te,children:P?.cancelLabel||o("common.cancel")}),f(Pe,{onClick:Er,variant:"contained",disabled:Te,children:P?.submitLabel||o("common.save")})]})]}):null,Se?g(Lt,{open:ht,onClose:()=>!yt&&mt(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:S?.title||o("quickEdit.editWithTitle",{title:O})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Mo.map(te=>{let Ee=te.type==="number"||te.numeric?"number":te.type==="date"?"date":"text";return f(He,{label:te.label||te.id,value:Et[te.id]??"",onChange:Qe=>Zr(te.id,Qe.target.value),type:Ee,disabled:!Bo(te.id),fullWidth:true,InputLabelProps:{shrink:Ee==="date"?true:void 0}},`quick-edit-${te.id}`)}),S?.description?f(Jo,{severity:"info",children:S.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Pe,{onClick:()=>mt(false),disabled:yt,children:S?.cancelLabel||o("common.cancel")}),f(Pe,{onClick:No,variant:"contained",disabled:yt||!X,children:S?.submitLabel||o("common.save")})]})]}):null,Ae?f(Qn,{open:Ht,type:"warning",title:I?.title||o("quickDelete.confirmTitle"),message:I?.message||(z.length>1?o("quickDelete.confirmMessageMultiple",{count:z.length}):o("quickDelete.confirmMessageSingle")),confirmText:I?.confirmText||o("common.delete"),cancelText:I?.cancelText||o("common.cancel"),onClose:()=>!$t&&Ut(false),onConfirm:Yr}):null,ne,ft?f(Ri,{open:Vt,onClose:Wt,model:Or,aiAssistant:y?.aiAssistant,interaction:Dt?{enabled:true,filters:lt.filters,fieldMapping:ir,onPrimaryDimensionClick:te=>lt.setFilter("primaryDimension",te),onSecondaryDimensionClick:te=>lt.setFilter("secondaryDimension",te),onStatusClick:te=>lt.setFilter("status",te),onClearFilter:lt.clearFilter,onClearAll:lt.clearAll}:void 0,tableContent:f(by,{appId:st||"graph-report-internal",title:o("graph.dataBody"),columns:R,rows:Or.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var WF=({appTitle:t,children:o,menuData:r=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:c="auto",logo:d,headerSlot:u,actionSlot:m,portraitBottomSlot:h,contentSx:f$1,containerSx:p,user:b,onSearch:C,onSearchAdd:g$1,defaultNavigationOpen:x,navOpen:v,onNavOpenChange:y,onWorkloadSelect:P,locale:S="en",localeLabel:I,localeOptions:M,onLocaleChange:w,onUserSetting:D,onUserLogout:N,userMenuItems:T,leftHeaderSlot:k,rightHeaderSlot:A})=>{let L="orbcafe:page-layout-mode",[W,ee]=useState("system"),[O,_]=useState("light"),[V,Q]=useState(false),[H,B]=useState(false),q=W==="system"?H?O:"light":W;useEffect(()=>{Q(true);},[]),useEffect(()=>{try{let nt=window.localStorage.getItem(L);(nt==="light"||nt==="dark"||nt==="system")&&ee(nt);}catch{}B(true);let We=window.matchMedia("(prefers-color-scheme: dark)"),et=()=>{_(We.matches?"dark":"light");};return et(),We.addEventListener("change",et),()=>We.removeEventListener("change",et)},[]),useEffect(()=>{if(H)try{window.localStorage.setItem(L,W);}catch{}},[H,W]),useEffect(()=>{q==="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");},[q]);let Z=Do("(orientation: portrait)"),Y=Do("(max-width: 899.95px)"),J=c==="auto"?!V||Z||Y?"portrait":"landscape":c,[le,he]=useState({landscape:x??true,portrait:false}),ze=le[J],be=v??ze,Ce=We=>{v===void 0&&he(et=>({...et,[J]:We})),y?.(We);},Be=g(se,{direction:"row",spacing:1,alignItems:"center",children:[!V||i&&J==="portrait"?f(ie,{onClick:()=>Ce(!be),sx:{bgcolor:"action.hover"},children:f(ui,{})}):null,k]}),de=g(se,{direction:"row",spacing:1,alignItems:"center",children:[m,A]}),ve=f(pm,{collapsed:J==="landscape"?!be:false,onToggle:()=>Ce(!be),menuData:r,orientation:J,colorMode:q,maxHeight:J==="landscape"?900:void 0});return f(On,{mode:W,children:f(Xa,{locale:S,children:g("div",{sx:[We=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:We.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":We.palette.background.default}),...Array.isArray(p)?p:[p]],children:[f(Ki,{appTitle:t,logo:d===void 0?null:d,mode:W,onToggleMode:()=>ee(We=>We==="system"?"dark":We==="dark"?"light":"system"),locale:S,localeLabel:I,localeOptions:M,onLocaleChange:w,user:b,onUserSetting:D,onUserLogout:N,userMenuItems:T,onSearch:C,onSearchAdd:g$1,leftSlot:Be,rightSlot:de}),u?f("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:u}):null,g("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[V&&i&&J==="landscape"?f("div",{sx:{p:1.5,pr:0,flexShrink:0},children:ve}):null,!V||i&&J==="portrait"?f(Od,{open:be,onClose:()=>Ce(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:ve}):null,f("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f$1},children:g(se,{spacing:1.5,children:[s&&n.length>0?f(sm,{items:n,selectedId:a,orientation:J,onItemSelect:P}):null,f(De,{elevation:0,sx:{flex:1,minHeight:J==="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})]})})]}),J==="portrait"&&h?g(e,{children:[f(Rt,{}),f("div",{sx:{p:1.5},children:h})]}):null]})})})};var mm=vy(()=>import('./COrbCanvas-4PZFJUYO.mjs').then(t=>t.COrbCanvas),{ssr:false,loading:()=>f("div",{className:"h-full w-full bg-transparent"})});function _l({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(mm,{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(mm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var KF=_l;var hm=createContext(null);function Py(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 Ty({children:t,onVoiceSubmit:o,onVoicePartial:r,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:u,minVolumeRms:m}){let[h,f$1]=useState(false),[p,b]=useState(false),C=useRef(null),g$1=useRef(false),x=useRef(false),v=useCallback(()=>{x.current=false,f$1(false);},[]),{isRecording:y,startRecording:P,stopRecording:S}=xn({wsUrl:d,silenceThresholdMs:u,minVolumeRms:m,onTextUpdate:D=>{r?.(D);},onComplete:async D=>{try{D.trim()&&(b(!0),await o(D.trim()));}catch(N){let T=N instanceof Error?N.message:"Failed to process voice command";n?.(T);}finally{b(!1),v();}},onError:D=>{n?.(D),b(!1),g$1.current||v();}}),I=useCallback(async()=>{x.current=false,await P();},[P]),M=useCallback(()=>{S();},[S]);useEffect(()=>{if(i)return;let D=T=>{T.isComposing||(T.code==="Space"||T.key===" ")&&(g$1.current||T.repeat||s&&Py(document.activeElement)||(g$1.current=true,T.preventDefault(),C.current=setTimeout(()=>{x.current=true,f$1(true),P();},a)));},N=T=>{(T.code==="Space"||T.key===" ")&&(C.current&&(clearTimeout(C.current),C.current=null),g$1.current=false,x.current&&(T.preventDefault(),f$1(false),S()));};return window.addEventListener("keydown",D),window.addEventListener("keyup",N),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",N),C.current&&(clearTimeout(C.current),C.current=null);}},[i,s,a,P,S]);let w=useMemo(()=>({isRecording:y,isHotkeyRecording:h,isSubmitting:p,startRecording:I,stopRecording:M}),[h,y,p,I,M]);return g(hm.Provider,{value:w,children:[c?f(_l,{isRecording:h}):null,t]})}function Iy(){let t=useContext(hm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var jF=Ty,JF=Iy;function ot(...t){return twMerge(clsx(t))}var Ay=({content:t,theme:o="light",size:r="base",defaultExpanded:n=false})=>{let[a,i]=useState(n),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(!a),children:[g("span",{className:"flex items-center",children:[f(Fa,{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(Ho,{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})]})},fm=Ay;var By=({content:t,language:o="text",isStreaming:r=false,className:n=""})=>{let a=ho(),[i,s]=useState(false),c=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3);}catch(u){console.error("\u590D\u5236\u5931\u8D25:",u);}},d=a==="dark"?oneDark:oneLight;return g("div",{className:ot("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: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(wo,{size:14,className:"text-[var(--orb-status-success)]"}):f(Ec,{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:a==="dark"?"var(--orb-surface-2)":"var(--orb-canvas)"},wrapLongLines:true,children:t})})]})},bm=By;var ym="orb-html-demo",Cm="orb-html-demo-ping",ss=16,Wy=2,$y=2e3,_y=300,Gy=96,Uy=200,Ky=560,qy=320,Kl=`<script>(function(){var post=function(){var body=document.body;var height=Math.ceil(document.documentElement.scrollHeight);if(body){var style=getComputedStyle(body);height=Math.ceil(Math.max(body.offsetHeight,body.scrollHeight)+parseFloat(style.marginTop||'0')+parseFloat(style.marginBottom||'0'))}parent.postMessage({source:${JSON.stringify(ym)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);addEventListener('message',function(event){if(event.data&&event.data.source===${JSON.stringify(Cm)})post()});new MutationObserver(post).observe(document.documentElement,{subtree:true,childList:true,attributes:true,characterData:true});var retries=0;var timer=setInterval(function(){post();retries+=1;if(retries>5)clearInterval(timer)},250);post()})()</script>`,Xy="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",Zy=t=>/<html[\s>]/i.test(t),Yy=t=>{let o=t.trim();return Zy(o)?/<\/body>/i.test(o)?o.replace(/<\/body>/i,`${Kl}</body>`):`${o}${Kl}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${Xy}</style></head><body>${o}${Kl}</body></html>`},Qy=t=>{let o=/<title[^>]*>([^<]+)<\/title>/i.exec(t)?.[1]?.trim();return o||(/<h1[^>]*>([^<]+)<\/h1>/i.exec(t)?.[1]?.trim()??null)},jy=t=>{if(t<1024)return `${t} B`;let o=t/1024;if(o<1024)return `${o<10?o.toFixed(1):Math.round(o)} KB`;let r=o/1024;return `${r<10?r.toFixed(1):Math.round(r)} MB`},Jy=t=>`${t.toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"interactive-demo"}.html`,eC=(t,o)=>{let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=o,n.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3);},va=new Map,Xl="orb-html-demo-store",tC=t=>t.replace(/^\s+/,"").slice(0,Gy),ql=(t,o)=>{va.set(t,o),window.dispatchEvent(new CustomEvent(Xl));},oC=({content:t,title:o})=>{let{t:r}=ce(),n=ho(),a=tC(t),[i,s]=useState(()=>va.get(a)?.open??false),[c,d]=useState(()=>va.get(a)?.view??"preview"),[u,m]=useState(false),[h,f$1]=useState(qy),p=useRef(null),b=useRef(null),C=useRef(false),g$1=useRef(false),x=useRef(t),v=k=>ql(a,{open:k,view:c}),y=k=>ql(a,{open:i,view:k}),P=()=>{g$1.current=true,v(false);};useEffect(()=>{let k=()=>{let A=va.get(a);s(A?.open??false),d(A?.view??"preview");};return window.addEventListener(Xl,k),()=>window.removeEventListener(Xl,k)},[a]),useEffect(()=>{x.current!==t&&(x.current=t,va.has(a)||ql(a,{open:true,view:"preview"}));},[t,a]);let[S,I]=useState(t);useEffect(()=>{if(t===S)return;let k=window.setTimeout(()=>I(t),_y);return ()=>window.clearTimeout(k)},[t,S]);let M=useMemo(()=>Yy(S),[S]);useEffect(()=>{if(!i)return;let k=A=>{let L=A.data;!L||L.source!==ym||typeof L.height!="number"||b.current&&A.source!==b.current.contentWindow||f$1(Math.max(Uy,Math.min(Ky,Math.ceil(L.height))));};return window.addEventListener("message",k),b.current?.contentWindow?.postMessage({source:Cm},"*"),()=>window.removeEventListener("message",k)},[i]);let w=o??Qy(t)??r("agentui.html.defaultTitle"),D=useMemo(()=>new TextEncoder().encode(t).length,[t]);useEffect(()=>{if(!u)return;let k=window.setTimeout(()=>m(false),$y);return ()=>window.clearTimeout(k)},[u]),useEffect(()=>{if(i){C.current=true;return}C.current&&(C.current=false,g$1.current&&(g$1.current=false,p.current?.focus()));},[i]);let N=()=>{navigator.clipboard.writeText(t).then(()=>m(true));},T=()=>eC(new Blob([t],{type:"text/html;charset=utf-8"}),Jy(w));return i?g("section",{className:"orb-html-demo","aria-label":w,"data-view":c,children:[g("header",{className:"orb-html-demo-head",children:[f("span",{className:"orb-html-demo-glyph","aria-hidden":"true",children:"</>"}),f("span",{className:"orb-html-demo-head-title",title:w,children:w}),g("div",{className:"orb-segmented-control orb-html-demo-segment",role:"group","aria-label":r("agentui.html.toggle"),"data-has-selection":"true",style:{"--orb-segmented-count":Wy,"--orb-segmented-index":c==="code"?0:1},children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),f("button",{type:"button",className:"orb-segmented-control-item orb-segmented-control-item-label","data-selected":c==="code","aria-pressed":c==="code",onClick:()=>y("code"),children:r("agentui.html.code")}),f("button",{type:"button",className:"orb-segmented-control-item orb-segmented-control-item-label","data-selected":c==="preview","aria-pressed":c==="preview",onClick:()=>y("preview"),children:r("agentui.html.preview")})]}),g("div",{className:"orb-html-demo-actions",children:[f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r(u?"agentui.html.copied":"agentui.html.copy"),title:r(u?"agentui.html.copied":"agentui.html.copy"),onClick:N,children:u?f(wo,{size:ss}):f(Ao,{size:ss})}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r("agentui.html.download"),title:r("agentui.html.download"),onClick:T,children:f(Bn,{size:ss})}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r("agentui.html.close"),title:r("agentui.html.close"),onClick:P,children:f(Kt,{size:ss})})]})]}),g("div",{className:"orb-html-demo-body",children:[f("iframe",{ref:b,className:"orb-html-demo-frame",title:w,sandbox:"allow-scripts",srcDoc:M,style:{height:h},hidden:c!=="preview"}),f("div",{className:"orb-html-demo-code",hidden:c!=="code",children:f(Prism,{language:"html",style:n==="dark"?oneDark:oneLight,customStyle:{margin:0,padding:"16px 20px",background:"transparent",fontSize:"13px",lineHeight:"1.6"},wrapLongLines:true,children:t})})]})]}):g("button",{ref:p,type:"button",className:"orb-html-demo-card","aria-expanded":false,onClick:()=>v(true),children:[f("span",{className:"orb-html-demo-glyph","aria-hidden":"true",children:"</>"}),g("span",{className:"orb-html-demo-info",children:[f("span",{className:"orb-html-demo-title",children:w}),g("span",{className:"orb-html-demo-meta",children:["HTML \xB7 ",jy(D)]})]}),f("span",{className:"orb-html-demo-openpill",children:r("agentui.html.open")})]})},xm=oC;var go={useMaxWidth:false},aC=t=>{let o=t.closest(".markdown-body, .orb-omph-assistant")??t,r=getComputedStyle(o);return {fontSize:r.fontSize,fontFamily:r.fontFamily}},iC=t=>{let o=t.querySelector("svg");if(!o)return;let r=o.style.maxWidth;o.getAttribute("width")==="100%"&&r.endsWith("px")&&(o.setAttribute("width",r),o.style.width=r,o.style.maxWidth="none");},sC=t=>{let o=/line (\d+)/i.exec(t)?.[1];return o?`Mermaid syntax error around line ${o} \u2014 expand for details`:"Mermaid syntax error \u2014 expand for details"},lC=({content:t,isLoading:o,className:r="",style:n})=>{let a=useRef(null),[i,s]=useState(false),[c,d]=useState(null),u=ho();return useEffect(()=>{let m=false,h=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{let p=aC(a.current),b=Number.parseFloat(p.fontSize);Sm.initialize({startOnLoad:!1,theme:u==="dark"?"dark":"default",securityLevel:"loose",fontFamily:p.fontFamily,themeVariables:{fontFamily:p.fontFamily,fontSize:p.fontSize},flowchart:{htmlLabels:!1,...go},sequence:{...go,actorFontSize:b,noteFontSize:b,messageFontSize:b,actorFontFamily:p.fontFamily,noteFontFamily:p.fontFamily,messageFontFamily:p.fontFamily},gantt:go,journey:go,class:go,state:go,er:go,pie:go,mindmap:go,timeline:go,gitGraph:go,quadrantChart:go,requirement:go,sankey:go,block:go,c4:go,xyChart:go});let C=`mermaid-${Math.random().toString(36).substr(2,9)}`,g=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:x,bindFunctions:v}=await Sm.render(C,g);!m&&a.current&&(a.current.innerHTML=x,iC(a.current),v?.(a.current));}catch(p){if(m)return;console.error("Mermaid render failed:",p),d(p instanceof Error?p.message:"Render failed");}finally{m||s(false);}}},f=setTimeout(()=>{h();},100);return ()=>{m=true,clearTimeout(f);}},[t,u]),g("div",{className:`mermaid-block ${r}`,style:n,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:"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-3 text-sm text-[var(--orb-status-error)]",children:[f("p",{className:"font-medium",children:sC(c)}),g("details",{className:"mt-1",children:[f("summary",{className:"cursor-pointer text-xs text-[var(--orb-muted)]",children:"Details & source"}),f("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words",children:c}),f("pre",{className:"mt-2 max-h-40 overflow-auto text-xs text-[var(--orb-muted)]",children:t})]})]}),f("div",{ref:a,className:`overflow-x-auto ${o||i||c?"hidden":""}`})]})},km=lC;var cC=({title:t="\u53D1\u751F\u9519\u8BEF",content:o,errorCode:r,stack:n,icon:a,closable:i=true,onClose:s,onRetry:c,className:d="",...u})=>{let[m,h]=useState(false),[f$1,p]=useState(false),b=async()=>{if(c){p(true);try{await c();}catch(C){console.error("\u91CD\u8BD5\u5931\u8D25:",C);}finally{p(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}`,...u,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(Na,{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||n)&&g("div",{className:"flex items-center space-x-4 mt-2",children:[c&&g("button",{onClick:b,disabled:f$1,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[f(Zc,{className:`w-3.5 h-3.5 mr-1.5 ${f$1?"animate-spin":""}`}),f$1?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&g("button",{onClick:()=>h(!m),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:[m?f(Ho,{className:"w-3.5 h-3.5 mr-1"}):f(zo,{className:"w-3.5 h-3.5 mr-1"}),m?"\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(Kt,{className:"w-4 h-4"})})]}),n&&m&&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})})]})},ls=cC;var dC=({title:t="\u8B66\u544A",content:o,warningType:r,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:c,onConfirm:d,actionText:u,className:m="",...h})=>{let f$1=()=>{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)]"}}},p=()=>{switch(n){case "info":return f(Oa,{className:"w-5 h-5"});case "error":return f(_a,{className:"w-5 h-5"});case "success":return f(Da,{className:"w-5 h-5"});default:return f(Dc,{className:"w-5 h-5"})}},b=f$1();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 ${m}`,...h,children:[g("div",{className:`flex p-4 border-l-4 ${b.borderLeftColor} ${b.bgColor}`,children:[f("div",{className:`flex-shrink-0 mr-3 ${b.iconColor}`,children:i||p()}),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}),a&&a.length>0&&f("ul",{className:"mt-2 space-y-1",children:a.map((C,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:C})]},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(Kt,{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:u||"\u786E\u8BA4"})})]})},cs=dC;var pC=({title:t="\u76F8\u5173\u63A8\u8350",content:o,suggestions:r,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:c,className:d="",...u})=>{let[m,h]=useState(false),[f$1,p]=useState(""),[b,C]=useState(false),g$1=useMemo(()=>f$1.trim()?r.filter(y=>y.toLowerCase().includes(f$1.toLowerCase())):r,[r,f$1]),x=useMemo(()=>m?g$1:g$1.slice(0,a),[g$1,m,a]),v=y=>{n?.(y);};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}`,...u,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(Fa,{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:()=>C(!b),className:`p-1.5 rounded-md transition-colors ${b?"bg-[var(--orb-p100)] text-[var(--orb-status-primary)]":"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]"}`,title:b?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:f(Vo,{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(Kt,{className:"w-4 h-4"})})]})]}),b&&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:f$1,onChange:y=>p(y.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(Vo,{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((y,P)=>f("li",{children:g("button",{onClick:()=>v(y),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:y}),f(zo,{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:()=>h(!m),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:m?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g$1.length})`}),g$1.length===0&&f$1&&f("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},ds=pC;var uC=({title:t,content:o,toolName:r,parameters:n,result:a,status:i,duration:s,icon:c,closable:d=false,onClose:u,onAction:m,actionText:h,className:f$1="",...p})=>{let[b,C]=useState(false),[g$1,x]=useState(true),v=()=>{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"}}},y=()=>{switch(i){case "pending":return f($c,{className:"w-5 h-5 animate-spin"});case "error":return f(_a,{className:"w-5 h-5"});default:return f(Da,{className:"w-5 h-5"})}},P=M=>M?M<1e3?`${M}ms`:`${(M/1e3).toFixed(2)}s`:"",S=v(),I=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 ${f$1}`,...p,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:c||y()}),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:I}),f("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${S.badgeBg} ${S.badgeText}`,children:S.label})]}),r&&t&&g("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[f(Vn,{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(Lc,{className:"w-3 h-3 mr-1"}),P(s)]}),d&&u&&f("button",{onClick:u,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:f(Kt,{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}),n&&g("div",{className:"mb-3",children:[g("button",{onClick:()=>C(!b),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:[b?f(Ho,{className:"w-3.5 h-3.5 mr-1"}):f(zo,{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"]}),b&&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(Ho,{className:"w-3.5 h-3.5 mr-1"}):f(zo,{className:"w-3.5 h-3.5 mr-1"}),f(Vn,{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)})})]}),m&&f("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:f("button",{onClick:m,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:h||"\u6267\u884C\u64CD\u4F5C"})})]})]})},ps=uC;var gC=({data:t})=>{if(!t)return null;let o=useMemo(()=>{let r=[],n=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(r=t,r.length>0&&(n=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"&&(a=t.title||a,r=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})):r.length>0&&(n=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:a,columns:n,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(tr,{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]})})},us=gC;var hC=({title:t,subtitle:o,data:r,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return f(_s,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return f(Wc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return f(Xc,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return f(Nc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return f(zc,{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(td,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return f(zn,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return f(Gc,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return f(_s,{className:"w-4 h-4"})}},s=()=>{if(!r&&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(oa,{data:r,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return f(Lp,{data:r,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let c=r.reduce((u,m)=>u+(Number(m.value)||0),0),d=r.map(u=>({name:u.name,value:Number(u.value)||0,percent:typeof u.percent=="number"?u.percent:c>0?(Number(u.value)||0)/c*100:0}));return f(Ti,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return f(Op,{data:r,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return f(Fp,{data:r});case "fishbone-chart-card":return f(Bp,{branches:r,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return f(Hp,{data:r,height:a.height});case "google-map-card":return f(zp,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,apiKey:a.apiKey,query:a.query||r&&r[0]?.query||t,height:a.height});case "amap-card":return f(Vp,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,keyword:a.keyword||r&&r[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(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)})]})})]})]})},ms=hC;var vs=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],fC={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},fs=480,In=214,Gt={top:18,right:16,bottom:38,left:30},eo=t=>typeof t=="number"&&Number.isFinite(t)?t:0,Nm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),qo=(t,o)=>`${t.id||t.label}-${o}`,Dm=(t,o=13)=>t.length>o?`${t.slice(0,Math.max(1,o-1))}\u2026`:t,bs=(t,o,r)=>Math.min(r,Math.max(o,t)),gr=(t,o,r)=>t.color??r[o%r.length],hr=(t,o)=>o?{onMouseEnter:()=>o.onItemHoverStart?.(t),onMouseMove:()=>o.onItemHoverStart?.(t),onMouseLeave:()=>o.onItemHoverEnd?.(t),onContextMenu:r=>o.onItemContextMenu?.(r,t)}:{},Am=t=>{let o=t.map(a=>eo(a.value)),r=Math.min(0,...o),n=Math.max(0,...o);return {min:r,max:n===r?r+1:n,range:n===r?1:n-r}},bC=(t,o,r)=>{let n=fs-Gt.left-Gt.right,a=In-Gt.top-Gt.bottom,{max:i,range:s}=Am(r),c=Gt.left+t*n/Math.max(r.length-1,1),d=Gt.top+(i-eo(o.value))/s*a,u=Gt.top+i/s*a;return {x:c,y:d,zeroY:u}},hs=(t,o,r,n)=>{let a=(n-90)*Math.PI/180;return {x:t+r*Math.cos(a),y:o+r*Math.sin(a)}},vC=(t,o,r,n,a,i)=>{let s=hs(t,o,r,i),c=hs(t,o,r,a),d=i-a>180?1:0;if(n===0)return `M ${t} ${o} L ${s.x} ${s.y} A ${r} ${r} 0 ${d} 0 ${c.x} ${c.y} Z`;let u=hs(t,o,n,i),m=hs(t,o,n,a);return `M ${s.x} ${s.y} A ${r} ${r} 0 ${d} 0 ${c.x} ${c.y} L ${m.x} ${m.y} A ${n} ${n} 0 ${d} 1 ${u.x} ${u.y} Z`},yC=({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})]}),CC=()=>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"})]}),Ql=({item:t,onItemClick:o,interactions:r})=>{let n=()=>o?.(t);return {...o?{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{o&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n());}}:{},...hr(t,r),style:{cursor:o||r?"pointer":"default"}}},xC=({loading:t,error:o,hasData:r,emptyState:n,children:a})=>t?f(CC,{}):o?f("div",{className:"orb-metric-error",role:"alert",children:o}):r?f(e,{children:a}):f(yC,{children:n??"No data for the current selection."}),wC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(c=>Math.abs(eo(c.value))),1);return f("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((c,d)=>{let u=eo(c.value),m=`${bs(Math.abs(u)/s*100,0,100)}%`,h=o===c.id,f$1=g(e,{children:[f("span",{className:"orb-metric-bar-label",title:c.label,children:c.label}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:`orb-metric-bar-fill${h?" is-active":""}`,style:{width:m,backgroundColor:gr(c,d,i)}})}),f("span",{className:"orb-metric-bar-value",children:a(u)})]});return r?f("button",{type:"button",className:`orb-metric-bar-row${h?" is-active":""}`,onClick:()=>r(c),title:`${c.label}: ${a(u)}`,"aria-pressed":h,...hr(c,n),children:f$1},qo(c,d)):f("div",{className:`orb-metric-bar-row${h?" is-active":""}`,role:"listitem",...hr(c,n),children:f$1},qo(c,d))})})},SC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((c,d)=>c+Math.max(eo(d.value),0),0),1);return f("div",{className:"orb-metric-progress",role:"list","aria-label":"Chart data",children:t.map((c,d)=>{let u=Math.max(eo(c.value),0),m=bs(u/s*100,0,100),h=o===c.id,f$1=g(e,{children:[g("span",{className:"orb-metric-progress-heading",children:[f("span",{title:c.label,children:c.label}),f("strong",{children:a(u)})]}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:"orb-metric-bar-fill",style:{width:`${m}%`,backgroundColor:gr(c,d,i)}})})]});return r?f("button",{type:"button",className:`orb-metric-progress-row${h?" is-active":""}`,onClick:()=>r(c),"aria-pressed":h,...hr(c,n),children:f$1},qo(c,d)):f("div",{className:`orb-metric-progress-row${h?" is-active":""}`,role:"listitem",...hr(c,n),children:f$1},qo(c,d))})})},kC=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:c,ariaLabel:d})=>{let{min:u,max:m,range:h}=Am(o),f$1=fs-Gt.left-Gt.right,p=In-Gt.top-Gt.bottom,b=Gt.top+m/h*p,C=Math.max(1,Math.ceil(o.length/6)),g$1=o.map((y,P)=>bC(P,y,o)),x=g$1.map(y=>`${y.x},${y.y}`).join(" "),v=Math.max(...o.map(y=>Math.max(eo(y.secondaryValue),0)),1);return f("div",{className:"orb-metric-svg-wrap",children:g("svg",{className:"orb-metric-svg",viewBox:`0 0 ${fs} ${In}`,role:"img","aria-label":d,children:[f("line",{className:"orb-metric-axis",x1:Gt.left,y1:b,x2:fs-Gt.right,y2:b}),f("line",{className:"orb-metric-grid",x1:Gt.left,y1:Gt.top,x2:Gt.left,y2:In-Gt.bottom}),t==="column"&&o.map((y,P)=>{let S=g$1[P],I=eo(y.value),M=Math.max(Math.abs(S.y-b),I===0?2:0),w=S.x-Math.min(18,f$1/Math.max(o.length*2,1)),D=Math.min(36,Math.max(10,f$1/Math.max(o.length*1.8,1))),N=r===y.id;return g("g",{...Ql({item:y,onItemClick:n,interactions:a}),"aria-label":`${y.label}: ${i(I)}`,children:[f("rect",{className:`orb-metric-column${N?" is-active":""}`,x:w,y:Math.min(S.y,b),width:D,height:M,rx:4,fill:gr(y,P,c)}),g("title",{children:[y.label,": ",i(I)]}),(P%C===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:S.x,y:In-14,textAnchor:"middle",children:Dm(y.label)})]},qo(y,P))}),(t==="line"||t==="scatter"||t==="bubble")&&g(e,{children:[t==="line"&&f("polyline",{className:"orb-metric-line",fill:"none",points:x,stroke:c[0]}),o.map((y,P)=>{let S=g$1[P],I=r===y.id,M=t==="bubble"?7+Math.max(eo(y.secondaryValue),0)/v*12:t==="scatter"?5:4;return g("g",{...Ql({item:y,onItemClick:n,interactions:a}),"aria-label":`${y.label}: ${i(eo(y.value))}`,children:[t==="line"&&f("circle",{className:`orb-metric-point${I?" is-active":""}`,cx:S.x,cy:S.y,r:I?6:4,fill:gr(y,P,c)}),t!=="line"&&f("circle",{className:`orb-metric-point${I?" is-active":""}`,cx:S.x,cy:S.y,r:M,fill:gr(y,P,c),opacity:t==="bubble"?.82:.9}),g("title",{children:[y.label,": ",i(eo(y.value)),t==="bubble"&&y.secondaryValue!==void 0?` \xB7 Size: ${s(eo(y.secondaryValue))}`:""]}),(P%C===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:S.x,y:Math.max(Gt.top+8,S.y-M-7),textAnchor:"middle",children:Dm(y.label)})]},qo(y,P))})]}),f("text",{className:"orb-metric-axis-label",x:Gt.left,y:Gt.top-5,children:i(m)}),u<0&&f("text",{className:"orb-metric-axis-label",x:Gt.left,y:In-Gt.bottom+14,children:i(u)})]})})},PC=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,colors:s,ariaLabel:c})=>{let d=o.map(p=>({...p,value:Math.max(eo(p.value),0)})),u=d.reduce((p,b)=>p+b.value,0),m=72,h=92,f$1=0;return g("div",{className:"orb-metric-circular",children:[g("svg",{className:"orb-metric-donut",viewBox:"0 0 184 184",role:"img","aria-label":c,children:[d.map((p,b)=>{let C=p.value/u*360,g$1=f$1;f$1+=C;let x=r===p.id,v=C>=359.9?void 0:vC(h,h,m,t==="donut"?46:0,g$1,g$1+C),y=Ql({item:p,onItemClick:n,interactions:a});return v?f("path",{className:`orb-metric-slice${x?" is-active":""}`,d:v,fill:gr(p,b,s),...y,children:g("title",{children:[p.label,": ",i(p.value)," (",(p.value/u*100).toFixed(1),"%)"]})},qo(p,b)):f("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:h,cy:h,r:t==="donut"?60:m,fill:t==="donut"?"none":gr(p,b,s),stroke:t==="donut"?gr(p,b,s):void 0,strokeWidth:28,...y,children:g("title",{children:[p.label,": ",i(p.value)," (100%)"]})},qo(p,b))}),t==="donut"&&f("circle",{cx:h,cy:h,r:44,fill:"var(--orb-surface)"}),t==="donut"&&f("text",{className:"orb-metric-donut-total",x:h,y:h+5,textAnchor:"middle",children:i(u)})]}),f("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((p,b)=>{let C=r===p.id;return g("button",{type:"button",className:`orb-metric-legend-item${C?" is-active":""}`,onClick:()=>n?.(p),disabled:!n,title:p.label,...hr(p,a),children:[f("span",{className:"orb-metric-legend-dot",style:{backgroundColor:gr(p,b,s)}}),f("span",{className:"orb-metric-legend-label",children:p.label}),g("strong",{children:[(p.value/u*100).toFixed(0),"%"]})]},qo(p,b))})})]})},TC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,secondaryValueFormatter:i})=>f("div",{className:"orb-metric-list",role:"list","aria-label":"Chart data",children:t.map((s,c)=>{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(eo(s.value))}),s.secondaryValue!==void 0&&f("span",{className:"orb-metric-list-secondary",children:i(eo(s.secondaryValue))})]});return r?f("button",{type:"button",className:`orb-metric-list-row${o===s.id?" is-active":""}`,onClick:()=>r(s),"aria-pressed":o===s.id,...hr(s,n),children:d},qo(s,c)):f("div",{className:`orb-metric-list-row${o===s.id?" is-active":""}`,role:"listitem",...hr(s,n),children:d},qo(s,c))})}),ys=({title:t,subtitle:o,data:r=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:c,valueFormatter:d=Nm,secondaryValueFormatter:u=Nm,valueLabel:m,secondaryValueLabel:h,emptyState:f$1,loading:p=false,error:b,maxItems:C=8,showChartTypeControl:g$1=true,showDataDetails:x=true,dataRevealDelayMs:v=1e3,chartTypeOptions:y,chartTypeLabels:P,footer:S,ariaLabel:I,className:M,style:w,sx:D})=>{let N=$s(),T=useRef(null),k=useRef(null),[A,L]=useState(n),[W,ee]=useState(false),[O,_]=useState(null),[V,Q]=useState(null);useEffect(()=>L(n),[n]);let H=useCallback(()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null);},[]);useEffect(()=>H,[H]),useEffect(()=>{if(!V)return;let U=Re=>{let we=Re.target;we instanceof HTMLElement&&we.closest(".orb-metric-context-menu")||Q(null);};return document.addEventListener("pointerdown",U),()=>document.removeEventListener("pointerdown",U)},[V]);let B=A,q=useMemo(()=>[N.chart1,N.chart2,N.chart3,N.chart4,N.chart5,N.chart6],[N]),Z=useMemo(()=>W?r:r.slice(0,Math.max(1,C)),[r,C,W]),Y=Math.max(0,r.length-Z.length),J=Z.some(U=>eo(U.value)>0),le=Z.length>0&&(B!=="pie"&&B!=="donut"?true:J),he=(y??[B,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((U,Re,we)=>vs.includes(U)&&we.indexOf(U)===Re),ze={...fC,...P},be=Z[0],Ce=I??`${t} ${ze[B]} chart`,Be=U=>{L(U),a?.(U);},de=useCallback((U,Re)=>{_({item:U,source:Re}),Q(null),s?.(U,Re);},[s]),ve=useCallback(U=>{H(),!(!x||V)&&(k.current=window.setTimeout(()=>{de(U,"hover"),k.current=null;},Math.max(0,v)));},[H,V,v,de,x]),We=useCallback(()=>{H();},[H]),et=useCallback((U,Re)=>{if(!x)return;U.preventDefault(),H();let we=T.current?.getBoundingClientRect(),Oe=we?bs(U.clientX-we.left,8,Math.max(8,we.width-164)):8,at=we?bs(U.clientY-we.top,8,Math.max(8,we.height-72)):8;Q({item:Re,left:Oe,top:at});},[H,x]),nt=x?{onItemHoverStart:ve,onItemHoverEnd:We,onItemContextMenu:et}:void 0,it=B==="metric"?g("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>be&&i?.(be),onKeyDown:U=>{be&&i&&(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),i(be));},"aria-label":Ce,...be?hr(be,nt):{},children:[f("span",{className:"orb-metric-kpi-label",children:be?.label??m??"Value"}),f("strong",{children:be?d(eo(be.value)):"\u2014"}),be?.secondaryValue!==void 0&&g("span",{className:"orb-metric-kpi-secondary",children:[h??"Compared with"," \xB7 ",u(eo(be.secondaryValue))]})]}):B==="progress"?f(SC,{data:Z,activeId:c,onItemClick:i,interactions:nt,valueFormatter:d,colors:q}):B==="bar"?f(wC,{data:Z,activeId:c,onItemClick:i,interactions:nt,valueFormatter:d,colors:q}):B==="list"?f(TC,{data:Z,activeId:c,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:u}):B==="pie"||B==="donut"?f(PC,{type:B,data:Z,activeId:c,onItemClick:i,interactions:nt,valueFormatter:d,colors:q,ariaLabel:Ce}):f(kC,{type:B,data:Z,activeId:c,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:u,colors:q,ariaLabel:Ce});return g("div",{ref:T,className:"orb-metric-chart-shell",onMouseLeave:()=>{H(),O?.source==="hover"&&_(null);},children:[g(De,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${M??""}`,style:w,sx:D,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}),o&&f(E,{variant:"caption",muted:true,component:"div",noWrap:true,children:o})]}),g$1&&he.length>1&&f(zt,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:B,options:he.map(U=>({value:U,label:ze[U]})),onChange:U=>Be(U.target.value),minWidth:108,fullWidth:false,size:"small"})]}),g("div",{className:"orb-metric-chart-body",children:[f(xC,{loading:p,error:b,hasData:le,emptyState:f$1,children:it}),Y>0&&!p&&!b&&f("button",{type:"button",className:"orb-metric-more",onClick:()=>ee(U=>!U),children:W?"Show fewer":`Show all ${r.length}`})]}),S&&f("div",{className:"orb-metric-chart-footer",children:S})]}),V&&g("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:H,onKeyDown:U=>{U.key==="Escape"&&Q(null);},style:{left:V.left,top:V.top},onPointerDown:U=>U.stopPropagation(),children:[f("div",{className:"orb-metric-context-label",children:V.item.label}),f("button",{type:"button",role:"menuitem",onClick:U=>{U.preventDefault(),U.stopPropagation(),de(V.item,"contextmenu");},children:"Show data"})]}),O&&g("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${O.item.label} data details`,onPointerDown:U=>U.stopPropagation(),children:[g("div",{className:"orb-metric-data-details-header",children:[f("strong",{children:O.item.label}),f("button",{type:"button","aria-label":"Close data details",onClick:()=>_(null),children:"\xD7"})]}),g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:m??"Value"}),f("strong",{children:d(eo(O.item.value))})]}),O.item.secondaryValue!==void 0&&g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:h??"Secondary value"}),f("strong",{children:u(eo(O.item.secondaryValue))})]}),f("span",{className:"orb-metric-data-details-hint",children:O.source==="hover"?`Shown after ${Math.max(0,v)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};ys.displayName="CMetricChartCard";var IC=({messageId:t,cardHooks:o,valueSuffix:r,secondaryValueSuffix:n,...a})=>{let i=(c,d)=>{o?.onCardEvent?.({messageId:t,cardType:"metric-chart-card",action:c,title:a.title,payload:d,rawData:a});},s=(c,d)=>`${c.toLocaleString()}${d??""}`;return f(ys,{...a,valueFormatter:c=>s(c,r),secondaryValueFormatter:c=>s(c,n),onChartTypeChange:c=>i("action",{chartType:c}),onItemClick:c=>i("action",{item:c}),onDataDetails:(c,d)=>i("show-data",{item:c,source:d})})},Cs=IC;var MC=({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)})})})]}),xs=MC;var RC=t=>Array.isArray(t)?t.flatMap((o,r)=>{if(!o||typeof o!="object")return [];let n=o,a=String(n.label??n.name??n.id??`Item ${r+1}`),i=Number(n.value),s=Number.isFinite(i)?i:0,c=n.secondaryValue===void 0?void 0:Number(n.secondaryValue);return [{id:String(n.id??n.name??n.label??r),label:a,value:s,...c!==void 0&&Number.isFinite(c)?{secondaryValue:c}:{},...typeof n.color=="string"?{color:n.color}:{}}]}):[],ws=t=>{let o;try{o=JSON.parse(t);}catch{return null}if(o&&typeof o=="object"){if(o.type==="metric-chart-card"&&o.title&&Array.isArray(o.data)){let r=vs.includes(o.chartType)?o.chartType:"bar";return {...o,type:"metric-chart-card",chartType:r,data:RC(o.data)}}if((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)return o}return null};var FC=({content:t,theme:o,size:r="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:c})=>{let d=useRef(c);d.current=c;let u=!!c?.onCardEvent,m=useMemo(()=>u?{onCardEvent:C=>d.current?.onCardEvent?.(C)}:void 0,[u]),h=useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(C,g)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(g.trim())}"></div>`):"",[t]),f$1=(C,g,x,v,y)=>{m?.onCardEvent?.({messageId:s,cardType:C,action:g,title:x,payload:v,rawData:y});},p=(C,g,x,v,y,P)=>{if(!(!y&&!m?.onCardEvent))return (...S)=>{let I=y?.(...S),M=P?P(...S):void 0;return f$1(C,g,x,M,v),I}},b=useMemo(()=>({div(C){let{"data-component":g,"data-think-content":x,...v}=C;return g==="thinkbox"&&x?f(fm,{content:decodeURIComponent(x),theme:o,size:r,defaultExpanded:false}):f("div",{...v})},table({children:C}){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:C})})},thead({children:C}){return f("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:C})},tbody({children:C}){return f("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:C})},tr({children:C}){return f("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:C})},th({children:C,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:C})},td({children:C,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:C})},code({className:C,children:g,...x}){let v=/language-([\w-]+)/.exec(C||""),y=v?v[1]:"",P=String(g);if(!v&&!P.includes(`
|
|
17
|
+
`))return f("code",{children:g});let I=P.replace(/\n$/,"");if(i&&y==="mermaid")return f(km,{content:I});if(y==="html"||y==="htm")return f(xm,{content:I});if(y==="json"){let M=ws(I);if(M)switch(M.type){case "table":return f(us,{data:M.data});case "metric-chart-card":return f(Cs,{...M,messageId:s,cardHooks:m});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(ms,{...M});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(xs,{...M});case "error-card":{let w=M;return f(ls,{...w,onClose:p("error-card","close",w.title,w,w.onClose),onRetry:p("error-card","retry",w.title,w,w.onRetry)})}case "warning-card":{let w=M,D=w.onConfirm?p("warning-card","confirm",w.title,w,w.onConfirm):w.actionText&&m?.onCardEvent?p("warning-card","confirm",w.title,w):void 0;return f(cs,{...w,onClose:p("warning-card","close",w.title,w,w.onClose),onConfirm:D})}case "suggestions-card":{let w=M;return f(ds,{...w,onClose:p("suggestions-card","close",w.title,w,w.onClose),onSuggestionClick:p("suggestions-card","suggestion-click",w.title,w,w.onSuggestionClick,D=>({suggestion:D}))})}case "tool-result-card":{let w=M;return f(ps,{...w,onClose:p("tool-result-card","close",w.title,w,w.onClose),onAction:p("tool-result-card","action",w.title,w,w.onAction)})}}}return a?f(bm,{content:I,language:y,className:"not-prose"}):f("code",{className:C,...x,children:g})}}),[o,r,i,a,m,s]);return f("div",{className:ot("markdown-body max-w-none",n),children:f(DC,{remarkPlugins:[AC,EC],rehypePlugins:[LC,OC],components:b,children:h})})},Mn=FC;var BC=({content:t,messageId:o,cardHooks:r})=>{let n=(s,c,d,u,m)=>{r?.onCardEvent?.({messageId:o,cardType:s,action:c,title:d,payload:u,rawData:m});},a=(s,c,d,u,m,h)=>{if(!(!m&&!r?.onCardEvent))return (...f)=>{let p=m?.(...f),b=h?h(...f):void 0;return n(s,c,d,b,u),p}},i=ws(t);if(i)switch(i.type){case "table":return f(us,{data:i.data});case "metric-chart-card":return f(Cs,{...i,messageId:o,cardHooks:r});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(ms,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(xs,{...i});case "error-card":{let s=i;return f(ls,{...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,c=s.onConfirm?a("warning-card","confirm",s.title,s,s.onConfirm):s.actionText&&r?.onCardEvent?a("warning-card","confirm",s.title,s):void 0;return f(cs,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:c})}case "suggestions-card":{let s=i;return f(ds,{...s,onClose:a("suggestions-card","close",s.title,s,s.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",s.title,s,s.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let s=i;return f(ps,{...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(Mn,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r})})},Em=BC;var Jl=class{static analyze(o){if(!o.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let n=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(o),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(o),i=o.includes("NQ#")||o.includes("data-component");return n||a||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"}}},zC=({content:t,className:o="",messageId:r,cardHooks:n})=>{let a=Jt__default.useMemo(()=>Jl.analyze(t),[t]);return f("div",{className:`universal-content-renderer ${o}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?f(Em,{content:i.content,messageId:r,cardHooks:n},`block-${s}`):f(Mn,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:n},`block-${s}`))})},Ss=zC;var VC=({content:t,isStreaming:o=true,onComplete:r,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:c})=>{let[d,u]=useState(o?0:t.length),[m,h]=useState(!o);useEffect(()=>{if(o){u(0),h(false);return}u(t.length),h(true);},[t,o]),useEffect(()=>{if(!o||m)return;if(d>=t.length){h(true),r?.();return}let g=window.setTimeout(()=>{u(x=>Math.min(x+i,t.length));},a);return ()=>{window.clearTimeout(g);}},[t.length,m,o,r,i,a,d]);let f$1=()=>{o&&!m&&(u(t.length),h(true),r?.());},p=o?t.slice(0,d):t,b=o&&!m,C=o&&!m;return g("div",{className:`streaming-markdown ${n}`,onClick:f$1,style:{cursor:o?"pointer":"default"},children:[g("div",{className:"relative",children:[f(Ss,{content:p,messageId:s,cardHooks:c}),b&&f("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),C&&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"})]})},Fm=VC;var Bm=({buttons:t,className:o})=>{let r=n=>{switch(n){case "copy":return f(Ao,{size:14});case "refresh":return f(Wa,{size:14});case "volume":return f(rd,{size:14});case "like":return f(Jc,{size:14});case "dislike":return f(jc,{size:14});default:return null}};return f("div",{className:ot("flex items-center gap-1",o),children:t.map((n,a)=>f("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:ot("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:r(n.type)},`${n.type}-${a}`))})};var ks=({message:t,onStreamingComplete:o,assistantActions:r,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"},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(Fm,{content:t.content,isStreaming:t.isStreaming??false,onComplete:o,streamIntervalMs:n,streamChunkSize:a,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(Bm,{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 Hm=({onTextUpdate:t,onComplete:o,onCancel:r,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:c}=xn({onTextUpdate:t,onComplete:u=>{o?.(u);},onError:u=>{console.error("Voice input error:",u),r?.();}});return f("button",{onClick:async()=>{i?c():await s();},disabled:n,className:ot("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(sp,{size:16}):f(lp,{size:16})})};var Nt={container:"w-full max-w-4xl mx-auto",inputContainer:ot("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[color-mix(in_oklch,var(--orb-canvas)_64%,transparent)] backdrop-blur-[28px] 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:ot("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",queueArea:"px-4 pt-3 flex flex-col gap-2",queueCard:ot("flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 rounded-lg","bg-[var(--orb-p50,#eef2f9)] border border-[var(--orb-p100,#dbdbdb)]","text-xs text-[var(--orb-fg,#555555)]"),queueContent:"min-w-0 flex-1 truncate font-medium",queueHint:"text-[var(--orb-muted,#8c8c8c)]",queueButton:ot("shrink-0 px-2 py-1 rounded-md text-xs font-semibold cursor-pointer active:scale-95","text-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p50,#eef2f9)]"),queueCancelButton:ot("shrink-0 flex items-center justify-center h-5 w-5 rounded-full cursor-pointer","text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)] hover:bg-[var(--orb-hover,#eef2f9)]"),fileTag:ot("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:ot("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:ot("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:ot("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:ot("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95"),stopSecondary:ot("cursor-pointer border border-[var(--orb-border,#dbdbdb)] text-[var(--orb-muted,#8c8c8c)]","hover:border-[var(--orb-err,#c43f02)] hover:text-[var(--orb-err,#c43f02)] active:scale-95")},$C={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},_C=({enabled:t,onClick:o})=>{let{t:r}=ce();return f("button",{className:ot(Nt.buttonBase,Nt.buttonSmall,Nt.buttonNormal),onClick:o,disabled:!t,"aria-label":r("omph.input.upload"),type:"button",children:f(Wd,{size:16})})},GC=({canSend:t,isResponding:o,onSend:r,onStop:n})=>{let{t:a}=ce();return o&&!t?f("button",{className:ot(Nt.buttonBase,Nt.buttonSmall,Nt.stopButton),onClick:n,"aria-label":a("omph.input.stop"),type:"button",children:f(ul,{size:15})}):g(e,{children:[o&&f("button",{className:ot(Nt.buttonBase,Nt.buttonSmall,Nt.stopSecondary),onClick:n,"aria-label":a("omph.input.stop"),type:"button",children:f(ul,{size:14})}),f("button",{className:ot(Nt.buttonBase,Nt.buttonSmall,t?Nt.sendButton:Nt.sendButtonDisabled),onClick:r,disabled:!t,"aria-label":a("omph.input.send"),type:"button",children:f(up,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})})]})},xa=({onSend:t,onStop:o,isResponding:r=false,placeholder:n,getText:a})=>{let[i,s]=useState(""),[c,d]=useState([]),[u,m]=useState(false),[h,f$1]=useState(false),[p,b]=useState([]),C=useRef(null),g$1=useRef(0),{t:x}=ce(),v=x("omph.input.placeholder"),y=v!=="omph.input.placeholder"?v:"Type a message...",P=n||(a?a("00019",y):y),S=i.trim().length>0||c.length>0,I={enabled:true},M=useCallback(Y=>{s(Y.target.value),Y.target.style.height="auto",Y.target.style.height=`${Math.min(Y.target.scrollHeight,200)}px`;},[]),w=useCallback(Y=>{if(Y.target.files&&Y.target.files.length>0){let J=Array.from(Y.target.files);d(le=>{let he=J.filter(be=>le.some(Ce=>Ce.name===be.name&&Ce.size===be.size));he.length>0&&console.warn("Duplicate files ignored:",he.map(be=>be.name));let ze=J.filter(be=>!le.some(Ce=>Ce.name===be.name&&Ce.size===be.size));return [...le,...ze]}),C.current&&(C.current.value="");}},[]),D=useCallback(Y=>{d(J=>J.filter((le,he)=>he!==Y));},[]),N=useCallback(()=>{C.current?.click();},[]),T=useCallback(async()=>{if(!S)return;let Y=i,J=[...c];if(r){g$1.current+=1,b(le=>[...le,{id:g$1.current,content:Y,files:J,confirmed:false}]),s(""),d([]),C.current&&(C.current.value="");return}s(""),d([]),C.current&&(C.current.value="");try{await t(Y,J);}catch(le){console.error("Failed to send message:",le),s(Y),d(J);}},[i,S,r,t,c]),k=useCallback(Y=>{let J=p.find(le=>le.id===Y);J&&(b(le=>le.filter(he=>he.id!==Y)),t(J.content,J.files).catch(()=>s(J.content)));},[p,t]),A=useCallback(Y=>{b(J=>J.map(le=>le.id===Y?{...le,confirmed:true}:le));},[]),L=useCallback(Y=>{b(J=>J.filter(le=>le.id!==Y));},[]);useEffect(()=>{if(r||p.length===0)return;let Y=p;b([]),(async()=>{for(let J of Y)try{await t(J.content,J.files);}catch(le){console.error("Failed to send queued message:",le),s(J.content);}})();},[r,p,t]);let W=useCallback(()=>{b([]),o();},[o]),ee=useCallback(Y=>{Y.key==="Enter"&&!Y.shiftKey&&!u&&(Y.preventDefault(),T());},[T,u]),O=useCallback(()=>{m(true);},[]),_=useCallback(()=>{m(false);},[]),V=useCallback(Y=>{s(Y);},[]),Q=useCallback(Y=>{s(Y);},[]),H=useCallback(()=>{},[]),B=useCallback(Y=>{Y.preventDefault(),f$1(true);},[]),q=useCallback(Y=>{Y.preventDefault(),f$1(false);},[]),Z=useCallback(Y=>{if(Y.preventDefault(),f$1(false),Y.dataTransfer.files&&Y.dataTransfer.files.length>0){let J=Array.from(Y.dataTransfer.files);d(le=>[...le,...J]);}},[]);return f("div",{className:Nt.container,children:g("div",{className:"relative",children:[f("input",{type:"file",multiple:true,className:"hidden",ref:C,onChange:w}),g("div",{className:ot(Nt.inputContainer,h&&Nt.dragActive),onDragOver:B,onDragLeave:q,onDrop:Z,children:[p.length>0&&f("div",{className:Nt.queueArea,children:p.map(Y=>g("div",{className:Nt.queueCard,"data-omph-queue":Y.id,children:[f("span",{className:Nt.queueContent,title:Y.content,children:Y.content}),Y.confirmed?f("span",{className:Nt.queueHint,children:x("omph.input.queue.queued")}):f("span",{className:Nt.queueHint,children:x("omph.input.queue.ask")}),f("button",{className:Nt.queueButton,onClick:()=>k(Y.id),type:"button",children:x("omph.input.queue.sendNow")}),!Y.confirmed&&f("button",{className:Nt.queueButton,onClick:()=>A(Y.id),type:"button",children:x("omph.input.queue.afterTurn")}),f("button",{className:Nt.queueCancelButton,onClick:()=>L(Y.id),"aria-label":x("omph.input.queue.cancel"),type:"button",children:f(pl,{sx:{fontSize:14}})})]},Y.id))}),c.length>0&&f("div",{className:Nt.filePreviewArea,children:c.map((Y,J)=>g("div",{className:Nt.fileTag,children:[f(op,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),f("span",{className:"truncate max-w-[150px]",children:Y.name}),f("button",{onClick:()=>D(J),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:f(pl,{sx:{fontSize:16}})})]},`${Y.name}-${J}`))}),g("div",{className:"flex w-full flex-col p-2",children:[f("div",{className:ot(Nt.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:f("textarea",{className:ot(Nt.textarea,"min-h-[24px] py-0 px-0"),placeholder:P,value:i,onChange:M,onKeyDown:ee,onCompositionStart:O,onCompositionEnd:_,style:$C,"aria-label":x("omph.input.message"),spellCheck:false,rows:1})}),g("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[f("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":x("omph.input.tools"),children:f(_C,{enabled:I.enabled,onClick:N})}),g("div",{className:"flex items-center gap-1",children:[f(Hm,{onTextUpdate:V,onComplete:Q,onCancel:H,disabled:r,className:Nt.buttonSmall}),f(GC,{canSend:S,isResponding:r,onSend:T,onStop:W})]})]})]})]})]})})};var Wm=({messages:t,onSend:o,onStop:r,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:u,cardHooks:m,showInput:h=true,statusLine:f$1})=>{let p=useRef(null),b=useRef(t.length);return useEffect(()=>{t.length>b.current&&p.current?.scrollIntoView({behavior:"smooth"}),b.current=t.length;},[t]),g("div",{className:ot("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((C,g)=>{let x=C.type==="assistant"&&g===t.length-1,v=C.type==="assistant"?{isLatestAssistant:x,isResponding:a,onRegenerate:n?()=>n(C.id):void 0}:void 0;return f(ks,{message:C,assistantActions:v,onStreamingComplete:()=>u?.(C.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:m},C.id)}),f$1,f("div",{ref:p})]}),h&&f("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:f(xa,{onSend:o||(async()=>{}),onStop:r||(()=>{}),isResponding:a,placeholder:s})})]})};var $m={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},_m=({title:t="AI Agent",description:o,headerActions:r,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:c=false,...d})=>{let u=a??(d.isResponding?"running":"idle"),m=u==="running"||u==="pending",h=[$m[u],o].filter(Boolean).join(" \xB7 ");return g("div",{className:ot("orb-agent-panel",n),children:[g("div",{className:ot("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":m||void 0}),f("span",{className:"truncate",children:h||"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(Wm,{...d,showInput:c,statusLine:m?g("div",{className:ot("orb-agent-status-line","mb-1"),children:[f("span",{className:"orb-agent-spinner","aria-hidden":"true"}),f("span",{children:i??`${$m[u]}\u2026`})]}):void 0})})]})};var XC=t=>Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t),Ps=({conversations:t,activeConversationId:o,labels:r,onNewConversation:n,onSelectConversation:a})=>{let[i,s]=useState(false),c=useRef(null),d=useRef(null),u=useRef(null),m=useId(),h=!!a;useEffect(()=>{if(!i)return;let p=C=>{c.current?.contains(C.target)||s(false);},b=C=>{C.key==="Escape"&&(C.stopPropagation(),s(false),u.current?.focus());};return document.addEventListener("pointerdown",p),document.addEventListener("keydown",b),()=>{document.removeEventListener("pointerdown",p),document.removeEventListener("keydown",b);}},[i]),useEffect(()=>{if(!i)return;let p=d.current?.querySelector('[aria-selected="true"]'),b=d.current?.querySelector('[role="option"]');(p??b)?.focus();},[i]);let f$1=p=>{let b=Array.from(d.current?.querySelectorAll('[role="option"]')??[]);if(b.length===0)return;let C=b.findIndex(x=>x===document.activeElement),g=C<0?p===1?0:b.length-1:(C+p+b.length)%b.length;b[g]?.focus();};return !n&&!h?null:g(e,{children:[n&&f("button",{type:"button",className:"orb-omph-icon-btn","aria-label":r.newConversation,onClick:()=>{s(false),n();},children:f(Jr,{size:16})}),h&&a&&g("div",{className:"orb-omph-conversation-anchor",ref:c,children:[f("button",{ref:u,type:"button",className:"orb-omph-icon-btn","aria-label":r.conversationList,"aria-expanded":i,"aria-controls":m,onClick:()=>s(p=>!p),children:f(Uc,{size:16})}),i&&f("div",{ref:d,id:m,className:"orb-omph-conversations",role:"listbox","aria-label":r.conversations,onKeyDown:p=>{p.key==="ArrowDown"?(p.preventDefault(),f$1(1)):p.key==="ArrowUp"&&(p.preventDefault(),f$1(-1));},children:t.length===0?f("p",{className:"orb-omph-conversation-empty",children:r.noConversations}):t.map(p=>{let b=p.updatedAt?XC(p.updatedAt):"",C=[p.preview,b].filter(x=>x&&x.length>0).join(" \xB7 "),g$1=p.id===o;return g("button",{type:"button",role:"option",className:"orb-omph-conversation","aria-selected":g$1,"data-active":g$1||void 0,onClick:()=>{a(p.id),s(false);},children:[f("span",{className:"orb-omph-conversation-title",children:p.title}),C&&f("span",{className:"orb-omph-conversation-meta",children:C})]},p.id)})})]})]})};var ZC=t=>{let o=0;for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n<65||n>90)break;o=o*26+(n-64);}return o-1},YC=/^\$?([A-Za-z]+)\$?\d+$/,Um=t=>{let o=[];return t.querySelectorAll("t").forEach(r=>o.push(r.textContent??"")),o.join("")},Ts=t=>new DOMParser().parseFromString(t,"application/xml"),QC="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Km=async t=>{let{default:o}=await import('jszip'),r=await o.loadAsync(t),n=[],a=r.file("xl/sharedStrings.xml");a&&Ts(await a.async("string")).querySelectorAll("si").forEach(p=>n.push(Um(p)));let i=r.file("xl/workbook.xml");if(!i)throw new Error("Not an xlsx workbook");let s=Ts(await i.async("string")),c=new Map,d=r.file("xl/_rels/workbook.xml.rels");d&&Ts(await d.async("string")).querySelectorAll("Relationship").forEach(p=>{let b=p.getAttribute("Id"),C=p.getAttribute("Target");b&&C&&c.set(b,C.startsWith("xl/")?C:`xl/${C.replace(/^\//,"")}`);});let u=2e5,m=[],h=Array.from(s.querySelectorAll("sheet"));for(let f of h){let p=f.getAttribute("name")??`Sheet${m.length+1}`,b=f.getAttributeNS(QC,"id"),C=b&&c.get(b)||`xl/worksheets/sheet${m.length+1}.xml`,g=r.file(C);if(!g)continue;let x=Ts(await g.async("string")),v=[],y=false;for(x.querySelectorAll("row").forEach(P=>{if(v.length>=5e3||u<=0){y=true;return}let S=[];P.querySelectorAll("c").forEach(I=>{if(u<=0)return;let M=I.getAttribute("r")??"",w=YC.exec(M),D=w?ZC(w[1].toUpperCase()):S.length;if(D<0)return;let N=I.getAttribute("t"),T="";if(N==="inlineStr"){let k=I.querySelector("is");T=k?Um(k):"";}else {let k=I.querySelector("v")?.textContent??"";N==="s"?T=n[Number(k)]??"":N==="b"?T=k==="1"?"TRUE":"FALSE":T=k;}T!==""&&(S[D]=T,u-=1);}),v.push(Array.from(S,I=>I??""));});v.length>0&&v[v.length-1].every(P=>P==="");)v.pop();m.push({name:p,rows:v,truncated:y});}if(m.length===0)throw new Error("No worksheets found");return m},qm=t=>t.map(o=>{let r=[...o];for(;r.length>0&&r[r.length-1]==="";)r.pop();return r.join(" ")}).join(`
|
|
18
|
+
`);var tx=2e3,ox=1/3,Is=[.25,.5,.75,1,1.5,2,3,4],rx=100,nx=500,ax=100,ix=9,sx=1e3,Xm=14,Zm={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},Qm=({text:t,language:o,startLine:r,endLine:n,wrap:a,labels:i})=>{let s=useRef(null),c=useMemo(()=>{let m=t.split(`
|
|
19
|
+
`);m.length>1&&m[m.length-1]===""&&m.pop();let h=Math.min(m.length,tx);return {shown:m.slice(0,h).join(`
|
|
20
|
+
`),shownCount:h,total:m.length}},[t]),d=useCallback(m=>{let h=n??r,f=r!==void 0&&h!==void 0&&m>=r&&m<=h;return {className:"orb-omph-code-line","data-line":m,...f?{"data-hit":"true"}:{}}},[n,r]);useEffect(()=>{let m=s.current,h=m?.closest(".orb-omph-pv-body");if(!m||!h)return;if(r===void 0){h.scrollTop=0;return}let f=m.querySelector(`[data-line="${r}"]`);if(!f)return;let p=f.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop;h.scrollTop=Math.max(0,p-h.clientHeight*ox);},[r,c.shown]);let u={"--orb-omph-digits":String(c.shownCount).length};return g("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:u,children:[f(Prism,{language:o,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:d,customStyle:Zm,codeTagProps:{className:`language-${o}`,style:Zm},children:c.shown}),c.total>c.shownCount&&f("div",{className:"orb-omph-pv-note",children:i.previewTruncated(c.shownCount,c.total)})]})},jm=({text:t})=>f("div",{className:"orb-omph-pv-doc",children:f(Mn,{content:t})}),Jm=({url:t,alt:o,labels:r})=>{let[n,a]=useState("fit"),[i,s]=useState(null),[c,d]=useState(false),u=n==="fit"?1:n,m=Is.some(b=>b>u),h=Is.some(b=>b<u),f$1=b=>a(C=>{let g=C==="fit"?1:C;return (b>0?Is.find(v=>v>g):[...Is].reverse().find(v=>v<g))??C}),p=n==="fit"||i===null?{maxWidth:"100%",height:"auto"}:{width:i*n,maxWidth:"none",height:"auto"};return c?f("div",{className:"orb-omph-pv-note",role:"alert",children:o?`${r.imageFailed} \xB7 ${o}`:r.imageFailed}):g("div",{className:"orb-omph-img",children:[f("div",{className:"orb-omph-img-stage",children:f("img",{src:t,alt:o??"",draggable:false,style:p,onLoad:b=>s(b.currentTarget.naturalWidth),onError:()=>d(true)})}),g("div",{className:"orb-omph-img-zoom",role:"group","aria-label":r.zoomFit,children:[f("button",{type:"button","aria-label":r.zoomOut,disabled:!h,onClick:()=>f$1(-1),children:"\u2212"}),f("button",{type:"button","aria-label":r.zoomFit,"data-active":n==="fit"||void 0,onClick:()=>a("fit"),children:n==="fit"?r.zoomFit:`${Math.round(n*rx)}%`}),f("button",{type:"button","aria-label":r.zoomIn,disabled:!m,onClick:()=>f$1(1),children:"+"})]})]})},lx=t=>{let o=t+1,r="";for(;o>0;){let n=(o-1)%26;r=String.fromCharCode(65+n)+r,o=Math.floor((o-1)/26);}return r},eg=({body:t,labels:o})=>{let[r,n]=useState({status:"parsing"}),[a,i]=useState(0),[s,c]=useState(false);useEffect(()=>{let h=false,f=new AbortController;return n({status:"parsing"}),(async()=>{if(t.bytes)return t.bytes;if(!t.url)throw new Error("Sheet body has neither bytes nor url");let b=await fetch(t.url,{signal:f.signal});if(!b.ok)throw new Error(`HTTP ${b.status}`);return b.arrayBuffer()})().then(b=>Km(b)).then(b=>{h||(i(0),n({status:"ready",sheets:b}));}).catch(b=>{h||b instanceof DOMException&&b.name==="AbortError"||n({status:"error",message:b instanceof Error?b.message:String(b)});}),()=>{h=true,f.abort();}},[t]),useEffect(()=>{if(!s)return;let h=window.setTimeout(()=>c(false),sx);return ()=>window.clearTimeout(h)},[s]);let d=r.status==="ready"?r.sheets[Math.min(a,r.sheets.length-1)]:null,u=useMemo(()=>{if(!d)return null;let h=Math.min(d.rows.reduce((p,b)=>Math.max(p,b.length),0),ax),f=d.rows.slice(0,nx);return {columnCount:h,shownRows:f}},[d]);if(r.status==="parsing")return f("div",{className:"orb-omph-pv-skel",role:"status","aria-label":o.previewLoading,children:Array.from({length:ix},(h,f$1)=>f("span",{},f$1))});if(r.status==="error")return g("div",{className:"orb-omph-pv-note",role:"alert",children:[o.previewFailed," \xB7 ",r.message]});if(!d||!u)return null;let m=d.truncated||d.rows.length>u.shownRows.length;return g("div",{className:"orb-omph-sheet",children:[g("div",{className:"orb-omph-sheet-bar",children:[f("div",{className:"orb-omph-sheet-tabs",role:"tablist",children:r.sheets.map((h,f$1)=>f("button",{type:"button",role:"tab","aria-selected":f$1===a,"data-active":f$1===a||void 0,className:"orb-omph-sheet-tab",onClick:()=>i(f$1),children:h.name},h.name))}),f("button",{type:"button",className:"orb-omph-icon-button","aria-label":s?o.copied:o.previewCopyContent,title:s?o.copied:o.previewCopyContent,onClick:()=>{navigator.clipboard.writeText(qm(d.rows)).then(()=>c(true));},children:s?f(wo,{size:Xm}):f(Ao,{size:Xm})})]}),g("div",{className:"orb-omph-sheet-scroll",children:[g("table",{className:"orb-omph-sheet-grid",children:[f("thead",{children:g("tr",{children:[f("th",{className:"orb-omph-sheet-corner","aria-label":d.name}),Array.from({length:u.columnCount},(h,f$1)=>f("th",{scope:"col",children:lx(f$1)},f$1))]})}),f("tbody",{children:u.shownRows.map((h,f$1)=>g("tr",{children:[f("th",{scope:"row",children:f$1+1}),Array.from({length:u.columnCount},(p,b)=>f("td",{children:h[b]??""},b))]},f$1))})]}),d.rows.length===0&&f("div",{className:"orb-omph-pv-note",children:o.previewUnsupported}),m&&f("div",{className:"orb-omph-pv-note",children:o.previewSheetTruncated(u.shownRows.length,d.rows.length)})]})]})};var cx=/^[a-z][a-z0-9+.-]*:/i,dx=/^L(\d+)(?:-L?(\d+))?$/i;var tg=["B","KB","MB","GB"];var px=t=>{try{return decodeURIComponent(t)}catch{return t}},oc=t=>{let o=t.trim();if(!o||o.startsWith("#")||o.startsWith("//")||cx.test(o))return null;let r=o.indexOf("#"),n=r>=0?o.slice(0,r):o,a=r>=0?o.slice(r+1):"",i=n.indexOf("?"),s=px(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let c=dx.exec(a);if(!c)return {path:s};let d=Number(c[1]);if(d<1)return {path:s};let u=c[2]?Number(c[2]):d;return {path:s,startLine:d,endLine:Math.max(d,u)}},Ms=t=>t.split("/").filter(Boolean).pop()??t,rg=t=>{let o=t.split("/");return o.pop(),o.join("/")},Rs=t=>{let o=Ms(t),r=o.lastIndexOf(".");return r>0?o.slice(r+1).toLowerCase():""},ng={prism:"text",label:"Text"},og={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:ng},rc=(t,o)=>o?Object.values(og).find(n=>n.prism===o)??{prism:o,label:o}:og[Rs(t)]??ng,ag=t=>{let o=t,r=0;for(;o>=1024&&r<tg.length-1;)o/=1024,r+=1;return `${r>0&&o<10?o.toFixed(1):Math.round(o).toString()} ${tg[r]}`};var ux=1e3,mx=9,Xo=16,gx={markdown:"text/markdown;charset=utf-8",code:"text/plain;charset=utf-8"},hx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",Ns=(t,o)=>{let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=o,n.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3);},nc=({tone:t,icon:o,title:r,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:o}),f("div",{className:"orb-omph-pv-notice-title",children:r}),n&&f("p",{className:"orb-omph-pv-notice-text",children:n}),a]}),lg=({state:t,placement:o,expanded:r,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:c,onRetry:d,onToggleExpand:u,onOpenExternally:m})=>{let[h,f$1]=useState(true),[p,b]=useState(false),{open:C,ref:g$1,phase:x,data:v}=t,y=v?.body;useEffect(()=>{if(!p)return;let O=window.setTimeout(()=>b(false),ux);return ()=>window.clearTimeout(O)},[p]),useEffect(()=>{C&&s.current?.focus({preventScroll:true});},[C,s,g$1?.path]);let P=v?.absolutePath??g$1?.path??"",S=y&&(y.kind==="markdown"||y.kind==="code")?y.text:P,I=S===P?a.previewCopyPath:a.previewCopyContent,M=y?.kind==="code"&&g$1?rc(g$1.path,y.language):null,w=!!(y&&(y.kind==="markdown"||y.kind==="code")&&y.previewOnly),D=!!(g$1&&y&&!w&&(y.kind==="markdown"||y.kind==="code"||y.kind==="image"||y.kind==="embed"||y.kind==="sheet")),N=()=>{if(!y||!g$1)return;let O=Ms(P);if(y.kind==="markdown"&&!/\.(md|markdown|txt)$/i.test(O)&&(O=`${O}.md`),y.kind==="markdown"||y.kind==="code"){Ns(new Blob([y.text],{type:gx[y.kind]}),O);return}if(y.kind==="sheet"){if(y.fileName&&(O=y.fileName),/\.(xlsx|xlsm|xls|csv)$/i.test(O)||(O=`${O}.xlsx`),y.bytes){let _=y.bytes instanceof Uint8Array?y.bytes.slice().buffer:y.bytes;Ns(new Blob([_],{type:hx}),O);return}y.url&&fetch(y.url).then(_=>{if(!_.ok)throw new Error(`HTTP ${_.status}`);return _.blob()}).then(_=>Ns(_,O)).catch(()=>window.open(y.url,"_blank","noopener"));return}(y.kind==="image"||y.kind==="embed")&&fetch(y.url).then(_=>{if(!_.ok)throw new Error(`HTTP ${_.status}`);return _.blob()}).then(_=>Ns(_,O)).catch(()=>window.open(y.url,"_blank","noopener"));},T=[];M&&T.push(M.label),y?.kind==="markdown"&&T.push("Markdown"),y?.kind==="image"&&g$1&&T.push(Rs(g$1.path).toUpperCase()),y?.kind==="sheet"&&g$1&&T.push(Rs(g$1.path).toUpperCase()||"XLSX"),v?.size!==void 0&&T.push(ag(v.size)),y?.kind==="code"&&g$1?.startLine!==void 0&&T.push(a.previewLines(g$1.startLine,g$1.endLine??g$1.startLine));let k=O=>{O.key==="Escape"&&(O.stopPropagation(),c(true));},A=f("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),L=()=>{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:mx},(O,_)=>f("span",{},_))});if(x==="error"||!y)return f(nc,{tone:"error",icon:f(Na,{size:Xo}),title:a.previewFailed,text:P,action:A});switch(y.kind){case "missing":return f(nc,{tone:"neutral",icon:f(La,{size:Xo}),title:a.previewMissing,text:y.message??P});case "unsupported":return f(nc,{tone:"neutral",icon:f(La,{size:Xo}),title:a.previewUnsupported,text:y.message??P,action:m&&f("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>m(g$1),children:a.previewOpenExternal})});case "markdown":return f(jm,{text:y.text},g$1.path);case "code":return f(Qm,{text:y.text,language:rc(g$1.path,y.language).prism,startLine:g$1.startLine,endLine:g$1.endLine,wrap:h,labels:a},g$1.path);case "image":return f(Jm,{url:y.url,alt:y.alt,labels:a},y.url);case "sheet":return f(eg,{body:y,labels:a},g$1.path);case "embed":return f("iframe",{src:y.url,title:y.caption??a.previewTitle,className:"orb-omph-pv-embed"},y.url);default:return null}},W=o==="overlay",ee=y?.kind==="image"?Vc:La;return g("aside",{ref:s,className:"orb-omph-preview","data-open":C||void 0,"data-placement":o,role:W?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!C||void 0,tabIndex:-1,onKeyDown:k,children:[!W&&C&&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:[W&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>c(true),children:f(Aa,{size:Xo})}),f("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:f(ee,{size:Xo})}),g("div",{className:"orb-omph-pv-titles",children:[f("div",{className:"orb-omph-pv-name",title:P,children:g$1?Ms(P):""}),f("div",{className:"orb-omph-pv-path",title:P,children:f("bdi",{children:rg(P)})})]}),g("div",{className:"orb-omph-pv-actions",children:[y?.kind==="code"&&f("button",{type:"button",className:"orb-omph-text-button","aria-pressed":h,onClick:()=>f$1(O=>!O),children:a.previewWrap}),D&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewDownload,title:a.previewDownload,onClick:N,children:f(Bn,{size:Xo})}),w&&g$1&&m&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewOpenExternal,title:a.previewOpenExternal,onClick:()=>m(g$1),children:f(Bn,{size:Xo})}),g$1&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":p?a.copied:I,title:p?a.copied:I,onClick:()=>{navigator.clipboard.writeText(S).then(()=>b(true));},children:p?f(wo,{size:Xo}):f(Ao,{size:Xo})}),n&&f("button",{type:"button",className:"orb-omph-icon-button","aria-pressed":r,"aria-label":r?a.previewCollapse:a.previewExpand,title:r?a.previewCollapse:a.previewExpand,onClick:u,children:f(Fc,{size:Xo})}),!W&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>c(true),children:f(Kt,{size:Xo})})]})]}),f("div",{className:"orb-omph-pv-meta",children:T.join(" \xB7 ")}),f("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?y?.kind:void 0,children:L()})]})]})};var bx=1e3,cg=50,vx=1e3,yx=t=>t==="tool"?en:t==="command"?Vn:Kc,pg=t=>!!t.streaming||t.status==="running"||t.status==="pending",Cx=(t,o)=>o==="expanded"?true:pg(t),xx=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),wx=(t,o)=>`${Math.max(1,Math.round(t/vx))}${o.secondUnit}`,Sx=({content:t})=>{let o=useRef(null),[r,n]=useState(false);return useEffect(()=>{let a=o.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:o,className:"orb-omph-process-body","data-overflow":r||void 0,children:t})},kx=({turn:t,labels:o})=>{let[r,n]=useState(false),[a,i]=useState(false),s=t.assistant?.content??"",c=t.usage;return useEffect(()=>{if(!r)return;let d=window.setTimeout(()=>n(false),bx);return ()=>window.clearTimeout(d)},[r]),g("div",{className:"orb-omph-turn-actions",role:"group","aria-label":o.turnActions,children:[f("span",{className:"orb-omph-actions-time",children:t.assistant?.timestamp.toLocaleTimeString()}),xx(c)&&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:o.usage})]}),f("button",{type:"button",className:"orb-omph-icon-button orb-omph-actions-end","aria-label":r?o.copied:o.copy,onClick:()=>{navigator.clipboard.writeText(s).then(()=>n(true));},children:r?f(wo,{size:14}):f(Ao,{size:14})}),a&&c&&g("div",{className:"orb-omph-usage",children:[c.inputTokens!==void 0&&g("span",{children:[o.inputTokens," ",c.inputTokens.toLocaleString()]}),c.outputTokens!==void 0&&g("span",{children:[o.outputTokens," ",c.outputTokens.toLocaleString()]}),c.durationMs!==void 0&&g("span",{children:[o.duration," ",wx(c.durationMs,o)]})]})]})},Px=({item:t,display:o,open:r,onToggle:n})=>{let a=yx(t.kind),i=pg(t),s=o!=="compact"&&!!t.summary,c=r&&!!t.content;return g("div",{className:"orb-omph-process","data-status":t.status,"data-open":r||void 0,children:[g("button",{type:"button",className:"orb-omph-process-toggle","aria-expanded":r,onClick:n,children:[f(Ho,{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})]}),c&&t.content&&f(Sx,{content:t.content}),r&&t.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},ac=t=>{let o=t.user?.content||t.assistant?.content||t.id,r=o.split(`
|
|
21
|
+
`).find(n=>n.trim())??o;return r.length>cg?`${r.slice(0,cg)}\u2026`:r},Tx=0,ug=({turns:t,labels:o,processDisplay:r,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,c]=useState({}),d=u=>{if(!i||u.defaultPrevented||u.button!==Tx||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey)return;let m=u.target.closest("a[href]");if(!m)return;let h=a(m.getAttribute("href")??"");h&&(u.preventDefault(),i(h,m));};return f(e,{children:t.map((u,m)=>{let h=!!(u.assistant&&!u.assistant.streaming),p=m===t.length-1&&h?"always":"hover";return g("article",{className:"orb-omph-turn","data-omph-turn":u.id,"data-actions-reveal":p,children:[u.user&&g("div",{className:"orb-omph-user",children:[f("div",{className:"orb-omph-user-bubble","data-queued":u.user.queued||void 0,children:u.user.content}),g("div",{className:"orb-omph-user-meta",children:[u.user.queued&&f("span",{className:"orb-omph-user-queued",children:o.supplementQueued}),f("span",{className:"orb-omph-clock",children:u.user.timestamp.toLocaleTimeString()})]})]}),u.process&&u.process.length>0&&f("div",{className:"orb-omph-process-list",children:u.process.map(b=>{let C=b.id in s?s[b.id]:Cx(b,r);return f(Px,{item:b,display:r,open:C,onToggle:()=>c(g=>({...g,[b.id]:!C}))},b.id)})}),u.assistant&&g("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[f(Ss,{content:u.assistant.content,messageId:u.assistant.id,cardHooks:n}),u.assistant.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),u.failure&&f("div",{className:"orb-omph-failure","data-severity":u.failure.severity,children:u.failure.content}),h&&f(kx,{turn:u,labels:o})]},u.id)})})};var wa=t=>({idle:t("omph.status.idle"),pending:t("omph.status.pending"),running:t("omph.status.running"),success:t("omph.status.success"),error:t("omph.status.error"),working:t("omph.working"),workingFor:o=>t("omph.workingFor",{duration:o}),loadOlder:t("omph.loadOlder"),loadingOlder:t("omph.loadingOlder"),toBottom:t("omph.toBottom"),copy:t("omph.copy"),copied:t("omph.copied"),turnActions:t("omph.turnActions"),usage:t("omph.usage"),inputTokens:t("omph.inputTokens"),outputTokens:t("omph.outputTokens"),duration:t("omph.duration"),send:t("omph.send"),stop:t("omph.stop"),supplementQueued:t("omph.supplement.queued"),turnRail:t("omph.turnRail"),secondUnit:t("omph.secondUnit"),minuteUnit:t("omph.minuteUnit"),previewTitle:t("omph.preview.title"),previewClose:t("omph.preview.close"),previewBack:t("omph.preview.back"),previewExpand:t("omph.preview.expand"),previewCollapse:t("omph.preview.collapse"),previewCopyContent:t("omph.preview.copyContent"),previewCopyPath:t("omph.preview.copyPath"),previewDownload:t("omph.preview.download"),previewOpenExternal:t("omph.preview.openExternal"),previewWrap:t("omph.preview.wrap"),previewLoading:t("omph.preview.loading"),previewMissing:t("omph.preview.missing"),previewFailed:t("omph.preview.failed"),previewUnsupported:t("omph.preview.unsupported"),previewRetry:t("omph.preview.retry"),previewResize:t("omph.preview.resize"),previewLines:(o,r)=>t(o===r?"omph.preview.line":"omph.preview.lines",{start:o,end:r}),previewTruncated:(o,r)=>t("omph.preview.truncated",{shown:o,total:r}),previewSheetTruncated:(o,r)=>t("omph.preview.sheetTruncated",{shown:o,total:r}),imageFailed:t("omph.preview.imageFailed"),zoomIn:t("omph.preview.zoomIn"),zoomOut:t("omph.preview.zoomOut"),zoomFit:t("omph.preview.zoomFit"),newConversation:t("omph.newConversation"),conversationList:t("omph.conversationList"),conversations:t("omph.conversations"),noConversations:t("omph.noConversations")}),ic=t=>({waiting:t("omph.approval.waiting"),choose:t("omph.approval.choose"),details:t("omph.approval.details"),choices:t("omph.approval.choices"),reject:t("omph.approval.reject"),allowOnce:t("omph.approval.allowOnce"),confirm:t("omph.approval.confirm"),other:t("omph.approval.other"),otherPlaceholder:t("omph.approval.otherPlaceholder"),recommended:t("omph.approval.recommended"),allowOnceException:t("omph.approval.allowOnceException"),allowSession:t("omph.approval.allowSession"),abandon:t("omph.approval.abandon"),escalation:o=>t("omph.approval.escalation",{toolName:o})});var Ix=1e3,mg=60,Mx=1e3,gg=(t,o)=>{let r=Math.max(1,Math.round(Math.max(t,Mx)/Ix)),n=Math.floor(r/mg),a=r%mg;return n<=0?`${r}${o.secondUnit}`:`${n}${o.minuteUnit} ${a}${o.secondUnit}`};var Dx={open:false,ref:null,phase:"loading",data:null},hg=t=>{let[o,r]=useState(Dx),n=useRef(o);n.current=o;let a=useRef(t);a.current=t;let i=useRef(null),s=useRef(0),c=useRef(null),d=useCallback(f=>{let p=a.current;if(!p)return;i.current?.abort();let b=new AbortController;i.current=b,s.current+=1;let C=s.current;r({open:true,ref:f,phase:"loading",data:null}),p(f,b.signal).then(g=>{C===s.current&&r(x=>({...x,phase:"ready",data:g}));},()=>{C!==s.current||b.signal.aborted||r(g=>({...g,phase:"error",data:null}));});},[]),u=useCallback((f,p)=>{c.current=p??null;let b=n.current;if(b.ref?.path===f.path&&b.phase==="ready"){r({...b,open:true,ref:f});return}d(f);},[d]),m=useCallback((f=false)=>{s.current+=1,i.current?.abort(),r(b=>({...b,open:false}));let p=c.current;f&&p?.isConnected&&p.focus({preventScroll:true});},[]),h=useCallback(()=>{let{ref:f}=n.current;f&&d(f);},[d]);return useEffect(()=>()=>{i.current?.abort();},[]),{state:o,open:u,close:m,reload:h}};var lc="--orb-omph-pv-w",cc="--orb-omph-pv-pref",Lx=880,Ox=560,bg=400,_r=320,Fx=.45,Bx=.7,vg=24,sc=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),yg=({open:t,layout:o})=>{let r=useRef(null),n=useRef(null),[a,i]=useState(0),[s,c]=useState(null),[d,u]=useState(false),[m,h]=useState(false);useLayoutEffect(()=>{let I=r.current;if(!I)return;let M=()=>i(I.getBoundingClientRect().width);M();let w=new ResizeObserver(M);return w.observe(I),()=>w.disconnect()},[]),useEffect(()=>{t||u(false);},[t]);let f=o==="overlay"?false:o==="split"?a>=bg+_r:a>=Lx,p=f&&!d?"split":"overlay",b=Math.max(_r,Math.min(a*Bx,a-bg)),C=sc(s??a*Fx,_r,b),g=a>0&&a<Ox,x=useCallback(I=>{let M=r.current;M&&(M.style.setProperty(cc,`${I}px`),M.dataset.placement==="split"&&M.dataset.open==="true"&&M.style.setProperty(lc,`${I}px`));},[]),v=useCallback(I=>{I.button===0&&(I.preventDefault(),I.currentTarget.setPointerCapture(I.pointerId),n.current={pointerId:I.pointerId,startX:I.clientX,startWidth:C,latest:C},h(true));},[C]),y=useCallback(I=>{let M=n.current;!M||M.pointerId!==I.pointerId||(M.latest=sc(M.startWidth+(M.startX-I.clientX),_r,b),x(M.latest));},[b,x]),P=useCallback(I=>{let M=n.current;!M||M.pointerId!==I.pointerId||(n.current=null,I.currentTarget.hasPointerCapture(I.pointerId)&&I.currentTarget.releasePointerCapture(I.pointerId),c(M.latest),h(false));},[]),S=useCallback(I=>{let M={ArrowLeft:C+vg,ArrowRight:C-vg,Home:_r,End:b};I.key in M&&(I.preventDefault(),c(sc(M[I.key],_r,b)));},[b,C]);return {mainRef:r,placement:p,width:C,compact:g,dragging:m,expanded:d,canExpand:f,toggleExpanded:()=>u(I=>!I),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":_r,"aria-valuemax":Math.round(b),"aria-valuenow":Math.round(C),tabIndex:0,onPointerDown:v,onPointerMove:y,onPointerUp:P,onPointerCancel:P,onKeyDown:S}}};var Ls=48,zx=900,xg=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,wg=({turns:t,contentVersion:o,hasOlder:r=false,loadingOlder:n=false,onLoadOlder:a})=>{let i=useRef(null),s=useRef(null),c=useRef(true),d=useRef({height:0,top:0}),u=useRef(void 0),m=useRef(false),[h,f]=useState(true),[p,b]=useState(false),[C,g]=useState(t[0]?.id),x=useCallback(()=>{let I=i.current;I&&(d.current={height:I.scrollHeight,top:I.scrollTop});},[]),v=useCallback(()=>{let I=i.current;if(!I)return;let M=I.getBoundingClientRect().top,w=I.querySelector("[data-omph-turn]")?.dataset.omphTurn;I.querySelectorAll("[data-omph-turn]").forEach(D=>{D.getBoundingClientRect().top-M<=Ls&&(w=D.dataset.omphTurn);}),g(w);},[]);useEffect(()=>{let I=i.current,M=s.current;if(!I||!M)return;let w=()=>{b(I.clientWidth>zx),c.current&&(I.scrollTop=I.scrollHeight),x();};w();let D=new ResizeObserver(w);return D.observe(I),D.observe(M),()=>D.disconnect()},[x]),useLayoutEffect(()=>{let I=i.current;if(!I)return;let M=t[0]?.id,w=u.current,D=w!==void 0&&t.some(k=>k.id===w),N=D&&M!==void 0&&M!==w,T=w!==void 0&&!D;if(u.current=M,T){c.current=true,f(true),I.scrollTop=I.scrollHeight,x(),v();return}if(N){c.current=false,f(false);let k=I.scrollHeight-d.current.height;I.scrollTop=d.current.top+Math.max(0,k),x(),v();return}c.current&&(I.scrollTop=I.scrollHeight),x(),v();},[o,x,t,v]),useEffect(()=>{n||(m.current=false);},[n]);let y=useCallback(()=>{let I=i.current;if(!I)return;let w=I.scrollHeight-I.scrollTop-I.clientHeight<=Ls;w!==c.current&&(c.current=w,f(w)),x(),v();let D=I.scrollHeight-I.clientHeight>Ls,N=I.scrollTop<=Ls;!D||!N||w||!r||n||!a||m.current||(m.current=true,a());},[r,n,a,x,v]),P=useCallback(()=>{let I=i.current;I&&(c.current=true,f(true),I.scrollTo({top:I.scrollHeight,behavior:xg()?"auto":"smooth"}));},[]),S=useCallback(I=>{let w=i.current?.querySelector(`[data-omph-turn="${CSS.escape(I)}"]`);w&&(c.current=false,f(false),w.scrollIntoView({block:"start",behavior:xg()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:h,railVisible:p,activeTurnId:C,onScroll:y,returnToBottom:P,scrollToTurn:S}};var Wx=1e3,$x=(t,o)=>o[t],_x=t=>t.map(o=>[o.id,o.user?.content.length??0,o.assistant?.content.length??0,o.assistant?.streaming?"1":"0",o.failure?.id??"",(o.process??[]).map(r=>`${r.id}:${r.status}:${r.content?.length??0}`).join(",")].join(":")).join("|"),Gx=({startedAt:t,labels:o})=>{let[r,n]=useState(()=>Date.now());useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),Wx);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?o.working:o.workingFor(gg(Math.max(0,r-t),o));return g("div",{className:"orb-omph-running","data-omph-running":"true",children:[f("span",{className:"orb-visually-hidden",role:"status","aria-live":"polite",children:o.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})]})]})},Az=({turns:t,title:o,avatar:r,description:n,headerActions:a,agentStatus:i,isResponding:s=false,labels:c,processDisplay:d="standard",showInput:u=false,placeholder:m,className:h,cardHooks:f$1,hasOlder:p=false,loadingOlder:b=false,onLoadOlder:C,onSend:g$1,onStop:x,onHeaderPointerDown:v,conversations:y=[],activeConversationId:P,onNewConversation:S,onSelectConversation:I,loadFilePreview:M,resolveFileLink:w=oc,filePreviewLayout:D="auto",onOpenFileExternally:N})=>{let{t:T}=ce(),k={...wa(T),...c},A=i??(s?"running":"idle"),L=A==="running"||A==="pending",W=[$x(A,k),n].filter(Boolean).join(" \xB7 "),ee=useMemo(()=>_x(t),[t]),O=wg({turns:t,contentVersion:ee,hasOlder:p,loadingOlder:b,onLoadOlder:C}),[_,V]=useState(""),Q=_.trim(),H=s&&Q.length===0,B=[...t].reverse().find(de=>!!de.assistant?.streaming||de.process?.some(ve=>ve.streaming||ve.status==="running"||ve.status==="pending")),q=L?B?.startedAt:void 0,Z=!!M,Y=hg(M),J=yg({open:Y.state.open,layout:D}),le=useRef(null),he=useRef(null),ze=Z&&Y.state.open&&J.placement==="overlay",be=J.placement==="split"&&Y.state.open,Ce={[cc]:`${J.width}px`,[lc]:be?`${J.width}px`:"0px"};useEffect(()=>{he.current?.toggleAttribute("inert",ze);},[ze]);let Be=async()=>{if(!Q||!g$1)return;let de=Q;V("");try{await g$1(de);}catch{V(ve=>ve.trim().length===0?de:ve);}};return g("div",{className:ot("orb-omph-panel",h),"data-omph-panel":"","data-status":A,"data-compact":J.compact||void 0,children:[g("div",{className:ot("orb-omph-header",v&&"cursor-grab active:cursor-grabbing"),onPointerDown:v,children:[f("span",{className:"orb-omph-avatar","aria-hidden":"true",children:r??"AI"}),g("div",{className:"min-w-0 flex-1",children:[o&&f("div",{className:"orb-omph-title",children:o}),g("div",{className:"orb-omph-subtitle",children:[f("span",{className:"orb-omph-dot","data-active":L||void 0}),f("span",{className:"truncate",children:W||k.idle})]})]}),(S||I||a)&&g("div",{className:"orb-omph-header-actions",onPointerDown:de=>de.stopPropagation(),children:[f(Ps,{conversations:y,activeConversationId:P,labels:k,onNewConversation:S,onSelectConversation:I}),a]})]}),g("div",{ref:J.mainRef,className:"orb-omph-main","data-placement":J.placement,"data-open":String(Y.state.open),"data-dragging":J.dragging||void 0,style:Ce,children:[g("div",{ref:he,className:"orb-omph-center",children:[g("div",{className:"orb-omph-stage","data-rail":O.railVisible||void 0,children:[f("div",{ref:O.scrollerRef,className:"orb-omph-scroll",onScroll:O.onScroll,children:g("div",{ref:O.contentRef,className:"orb-omph-column",children:[p&&C&&f("button",{type:"button",className:"orb-omph-older",disabled:b,onClick:C,children:b?k.loadingOlder:k.loadOlder}),f(ug,{turns:t,labels:k,processDisplay:d,cardHooks:f$1,resolveFileLink:w,onOpenFile:Z?Y.open:void 0}),L&&f(Gx,{startedAt:q,labels:k})]})}),O.railVisible&&t.length>0&&f("nav",{className:"orb-omph-rail","aria-label":k.turnRail,children:t.map(de=>f("button",{type:"button",className:"orb-omph-rail-mark","data-active":O.activeTurnId===de.id||void 0,"aria-label":ac(de),title:ac(de),onClick:()=>O.scrollToTurn(de.id)},de.id))}),!O.following&&f("button",{type:"button",className:"orb-omph-to-bottom","aria-label":k.toBottom,onClick:O.returnToBottom,children:f(Ho,{size:16})})]}),u&&g("form",{className:"orb-omph-composer",onSubmit:de=>{de.preventDefault(),H?x?.():Be();},children:[f("textarea",{className:"orb-omph-input",value:_,placeholder:m,rows:1,onChange:de=>V(de.target.value),onKeyDown:de=>{de.key!=="Enter"||de.shiftKey||de.nativeEvent.isComposing||(de.preventDefault(),H?x?.():Be());}}),!H&&s&&x&&f("button",{type:"button",className:"orb-omph-stop-secondary","aria-label":k.stop,title:k.stop,onClick:x,children:f(Us,{size:14})}),f("button",{type:"submit",className:H?"orb-omph-stop":"orb-omph-send","aria-label":H?k.stop:k.send,disabled:!H&&Q.length===0,children:H?f(Us,{size:16}):f(Ac,{size:16})})]})]}),Z&&f(lg,{state:Y.state,placement:J.placement,expanded:J.expanded,canExpand:J.canExpand,labels:k,gripProps:J.gripProps,paneRef:le,onClose:Y.close,onRetry:Y.reload,onToggleExpand:J.toggleExpanded,onOpenExternally:N})]})]})};var fr="other",Ig="allow-once",Mg="allow-session",Rg="abandon",Ux=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,Kx=({request:t,onDecide:o,labels:r})=>{let{t:n}=ce(),a={...ic(n),...r},i=useRef(null),s=useRef(null),c=useRef(false),d=useRef(false),[u,m]=useState(false),[h,f$1]=useState(null),[p,b]=useState(""),C=t.kind,g$1=C==="authorize"?[{id:Ig,label:a.allowOnceException,recommended:true},{id:Mg,label:a.allowSession},{id:Rg,label:a.abandon}]:[],x=C==="authorize"?g$1:t.choices??[],v=C==="authorize"?false:t.allowOther??x.length>0,y=x.length>0||v,P=k=>(C==="tradeoff"||C==="authorize")&&k===true,S=t.reason?.trim()||a.escalation(t.toolName),I=t.detail?.trim(),M=h===fr&&p.trim().length>0,w=!y||h!==null&&h!==fr||M;useEffect(()=>{m(false),f$1(null),b(""),i.current?.focus();},[t.id]),useEffect(()=>{h===fr&&s.current?.focus();},[h]);let D=k=>{u||(m(true),o(k,t));},N=()=>{if(w){if(!y){D({kind:"allowed-once"});return}if(h===fr){let k=p.trim();if(!k)return;D({kind:"other",text:k});return}if(C==="authorize"){h===Ig?D({kind:"allowed-once"}):h===Mg?D({kind:"allowed-session"}):h===Rg&&D({kind:"rejected"});return}h&&D({kind:"choice",choiceId:h});}},T=k=>{if(!(u||Ux(k.target))&&!(k.key!=="Enter"&&k.key!=="Escape")&&!(k.key==="Enter"&&k.target instanceof HTMLElement&&k.target.closest('button, a[href], [role="button"]'))&&!(k.ctrlKey||k.metaKey||k.altKey||k.shiftKey)&&(k.preventDefault(),k.stopPropagation(),!(k.repeat||c.current||d.current||k.nativeEvent.isComposing))){if(k.key==="Escape"){D({kind:"rejected"});return}N();}};return f("div",{className:"orb-omph-approval","data-omph-approval":t.id,"aria-busy":u,onKeyDown:T,onKeyUpCapture:()=>{d.current=false;},onCompositionStartCapture:()=>{c.current=true;},onCompositionEndCapture:()=>{c.current=false,d.current=true;},children:g("div",{className:"orb-omph-approval-card","data-kind":C,children:[g("div",{className:"orb-omph-approval-strip",children:[f("span",{className:"orb-omph-approval-dot","aria-hidden":"true"}),y?a.choose:a.waiting]}),g("div",{ref:i,className:"orb-omph-approval-body",tabIndex:0,role:"group","aria-label":a.details,children:[f("div",{className:"orb-omph-approval-headline",children:S}),I&&f("div",{className:"orb-omph-approval-detail",children:I}),y&&g("fieldset",{className:"orb-omph-approval-choices",disabled:u,children:[f("legend",{className:"orb-visually-hidden",children:a.choices}),x.map(k=>{let A=h===k.id;return g("label",{className:"orb-omph-approval-choice","data-selected":A,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:k.id,checked:A,onChange:()=>f$1(k.id)}),g("span",{className:"orb-omph-approval-choice-copy",children:[g("span",{children:[k.label,P(k.recommended)&&f("span",{className:"orb-omph-approval-recommended",children:a.recommended})]}),k.description&&f("span",{className:"orb-omph-approval-choice-description",children:k.description})]})]},k.id)}),v&&g("label",{className:"orb-omph-approval-choice","data-selected":h===fr,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:fr,checked:h===fr,onChange:()=>f$1(fr)}),f("span",{className:"orb-omph-approval-choice-copy",children:f("span",{children:a.other})})]}),v&&h===fr&&f("textarea",{ref:s,className:"orb-omph-approval-other",value:p,placeholder:a.otherPlaceholder,rows:3,"aria-label":a.other,onChange:k=>b(k.target.value)})]})]}),g("div",{className:"orb-omph-approval-actions",children:[f("button",{type:"button",className:"orb-btn orb-btn-neutral orb-omph-approval-reject",disabled:u,onClick:()=>D({kind:"rejected"}),children:a.reject}),f("button",{type:"button",className:"orb-btn orb-btn-primary",disabled:u||!w,onClick:N,children:y?a.confirm:a.allowOnce})]})]})})};var qx=({mark:t,hint:o,suggestions:r=[],placeholder:n,isResponding:a=false,labels:i,conversations:s=[],activeConversationId:c,onSelectConversation:d,onSend:u,onStop:m,className:h})=>{let{t:f$1}=ce(),p={...wa(f$1),...i},b=o?.trim(),C=r.filter(g=>g.label.trim().length>0);return g("section",{className:["orb-omph-initial",h].filter(Boolean).join(" "),children:[g("div",{className:"orb-omph-initial-stage","aria-hidden":"true",children:[f("span",{className:"orb-omph-initial-bloom orb-omph-initial-bloom-petrol"}),f("span",{className:"orb-omph-initial-bloom orb-omph-initial-bloom-blue"}),f("span",{className:"orb-omph-initial-bloom orb-omph-initial-bloom-pink"}),g("svg",{className:"orb-omph-initial-arc",viewBox:"0 0 1440 900",preserveAspectRatio:"xMidYMid slice",children:[f("path",{d:"M-80 690C240 180 680 1040 1520 260"}),f("path",{d:"M-40 780C300 320 760 1120 1500 390"})]})]}),g("div",{className:"orb-omph-initial-center",children:[t&&f("div",{className:"orb-omph-initial-mark",children:t}),g("div",{className:"orb-omph-initial-composer",children:[f(xa,{placeholder:n,isResponding:a,onSend:async(g,x)=>{await u(g,x);},onStop:()=>m?.()}),d&&f("div",{className:"orb-omph-initial-menu",children:f(Ps,{conversations:s,activeConversationId:c,labels:p,onSelectConversation:d})})]}),C.length>0?f("div",{className:"orb-omph-initial-suggestions",role:"group","aria-label":f$1("omph.initial.suggestions"),children:C.map(g=>f("button",{type:"button",className:"orb-omph-initial-suggestion",disabled:a,onClick:()=>{u(g.label.trim());},children:g.label.trim()},g.id))}):b&&f("p",{className:"orb-omph-initial-hint",children:b})]})]})};var Ag=520,Yx=88,Qx=88,jx=24,Fs=640,Eg=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),uc=t=>typeof t=="number"?`${t}px`:t,Jx=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,Yz=({anchor:t,defaultAnchor:o="right",onAnchorChange:r,width:n=Ag,top:a=Yx,bottom:i=Qx,inset:s=jx,zIndex:c=1300,shellClassName:d,shellStyle:u,className:m,onHeaderPointerDown:h,...f$1})=>{let p=useRef(null),b=useRef(null),[C,g]=useState(o),[x,v]=useState(0),[y,P]=useState(typeof n=="number"?n:Ag),[S,I]=useState(0),[M,w]=useState(false),D=t??C;useEffect(()=>{let O=()=>v(window.innerWidth);return O(),window.addEventListener("resize",O),()=>window.removeEventListener("resize",O)},[]),useLayoutEffect(()=>{let O=()=>{let V=p.current?.getBoundingClientRect();V?.width?P(V.width):typeof n=="number"&&P(n);};if(O(),!p.current||typeof ResizeObserver>"u")return;let _=new ResizeObserver(O);return _.observe(p.current),()=>_.disconnect()},[n]);let N=useCallback(O=>{if(!x)return s;let _=x<Fs?12:s,V=Math.max(_,x-y-_);return x<Fs||O==="left"?_:O==="center"?Eg((x-y)/2,_,V):V},[s,y,x]),T=useCallback(O=>["left","center","right"].reduce((V,Q)=>{let H=Math.abs(O-N(V));return Math.abs(O-N(Q))<H?Q:V},"right"),[N]),k=useCallback(O=>{t===void 0&&g(O),r?.(O);},[t,r]);useEffect(()=>{M||I(N(D));},[N,M,D]);let A=useCallback(O=>{h?.(O),!(O.defaultPrevented||Jx(O.target))&&(O.preventDefault(),O.currentTarget.setPointerCapture(O.pointerId),b.current={pointerId:O.pointerId,startClientX:O.clientX,startX:S,currentX:S,captureElement:O.currentTarget},w(true));},[h,S]),L=useCallback(O=>{let _=b.current;if(!_||_.pointerId!==O.pointerId)return;let V=x<Fs?12:s,Q=Math.max(V,x-y-V),H=Eg(_.startX+O.clientX-_.startClientX,V,Q);_.currentX=H,I(H);},[s,y,x]),W=useCallback(O=>{let _=b.current;if(!_||_.pointerId!==O.pointerId)return;try{_.captureElement.releasePointerCapture(O.pointerId);}catch{}let V=T(_.currentX);b.current=null,w(false),k(V),I(N(V));},[N,k,T]),ee=useMemo(()=>({position:"fixed",top:uc(a),bottom:uc(i),left:S,width:uc(n),maxWidth:`calc(100vw - ${x<Fs?24:s*2}px)`,zIndex:c,pointerEvents:"auto",transition:M?"none":"left 180ms ease-out",touchAction:"none",...u}),[i,s,M,S,u,a,x,n,c]);return f("div",{ref:p,className:ot("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":D,"data-dragging":M?"true":"false",style:ee,onPointerMove:L,onPointerUp:W,onPointerCancel:W,children:f(_m,{...f$1,className:m,onHeaderPointerDown:A})})};var ow={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},n5=({messages:t,onSend:o,onRegenerate:r,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:u,onPlusClick:m,onMicClick:h,streamIntervalMs:f$1,streamChunkSize:p,onMessageStreamingComplete:b,cardHooks:C})=>{let[g$1,x]=useState(""),[v,y]=useState(false),P=useRef(null),S=ow[c];useEffect(()=>{P.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let I=useCallback(async()=>{let w=g$1.trim();!w||n||(x(""),await o(w));},[n,o,g$1]),M=useCallback(async w=>{w.key==="Enter"&&!v&&(w.preventDefault(),await I());},[I,v]);return g("div",{className:ot("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:ot("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:ot("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:u,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,D)=>{let N=w.type==="assistant"&&D===t.length-1,T=w.type==="assistant"?{isLatestAssistant:N,isResponding:n,onRegenerate:r?()=>r(w.id):void 0}:void 0;return f(ks,{message:w,assistantActions:T,onStreamingComplete:()=>b?.(w.id),streamIntervalMs:f$1,streamChunkSize:p,cardHooks:C},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:m,type:"button","aria-label":"Add",children:f(Jr,{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:()=>y(true),onCompositionEnd:()=>y(false),onKeyDown:M,"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:h,type:"button","aria-label":"Microphone",children:f(Ha,{className:"h-4 w-4"})})]})})]})};var rw=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],nw=`
|
|
21
22
|
.orbcafe-ai-browser-glow {
|
|
22
23
|
position: fixed;
|
|
23
24
|
inset: 0;
|
|
@@ -49,4 +50,4 @@ ${r}: ${(a??n)(g$1.secondaryValue??0)}`:""]})}),f("text",{x:g$1.x,y:Math.max(g$1
|
|
|
49
50
|
0%, 100% { opacity: 0.5; }
|
|
50
51
|
50% { opacity: 1; }
|
|
51
52
|
}
|
|
52
|
-
`,Rz=({active:t=false,colors:o=Lx,zIndex:r=2147483e3})=>{let n={"--orbcafe-ai-glow-line":o[0],"--orbcafe-ai-glow-z-index":r};return g(e,{children:[f("style",{children:Ox}),f("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var Gz=({defaultMode:t="login",onLogin:o,onRegister:r,onForgotPassword:n}={})=>{let[a,i]=useState(t),[s,l]=useState(false),d=useCallback(async p=>{l(true);try{await p?.();}finally{l(false);}},[]),u=useCallback(p=>d(()=>o?.(p)),[o,d]),m=useCallback(p=>d(()=>r?.(p)),[r,d]),h=useCallback(p=>d(()=>n?.(p)),[n,d]),f=useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:u,onRegister:m,onForgotPassword:h}),[h,u,m,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:f}};var Hx={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."},Jz=({mode:t,defaultMode:o="login",onModeChange:r,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:l,copy:d,sx:u})=>{let m=t!==void 0,[h,f$1]=useState(o),p=t??h,v=useMemo(()=>({...Hx,...d}),[d]),[C,g$1]=useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,b]=useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[y,k]=useState({email:""}),[S,P]=useState(""),I=A=>{m||f$1(A),P(""),r?.(A);},w=async A=>{A.preventDefault(),await n?.(C),P("Demo login accepted. No real authentication request was sent.");},M=async A=>{A.preventDefault(),await a?.(x),P("Demo registration saved locally for this screen.");},N=async A=>{A.preventDefault(),await i?.(y),P("Demo reset link request created. No email was sent.");},T=p==="login"?v.loginTitle:p==="register"?v.registerTitle:v.forgotTitle,R=p==="login"?v.loginSubtitle:p==="register"?v.registerSubtitle:v.forgotSubtitle;return g("div",{className:"orb-auth-frame orb-root",style:u,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:R}),S&&f(tn,{severity:"success",children:S}),p==="login"&&g("form",{onSubmit:w,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Email",type:"email",autoComplete:"username",value:C.username,onChange:A=>g$1(L=>({...L,username:A.target.value})),startAdornment:f(Hs,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"current-password",value:C.password,onChange:A=>g$1(L=>({...L,password:A.target.value})),startAdornment:f(Aa,{size:15,strokeWidth:1.8})}),g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[f(Tt,{label:"Remember me",checked:C.remember,onChange:A=>g$1(L=>({...L,remember:A.target.checked}))}),f("button",{type:"button",className:"orb-link",onClick:()=>I("forgot"),children:"Forgot password?"})]}),f(Se,{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"})]})]}),p==="register"&&g("form",{onSubmit:M,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Full name",value:x.name,onChange:A=>b(L=>({...L,name:A.target.value})),startAdornment:f(Hs,{size:15,strokeWidth:1.8})}),f(He,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:A=>b(L=>({...L,email:A.target.value})),startAdornment:f(Bs,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:A=>b(L=>({...L,password:A.target.value})),startAdornment:f(Aa,{size:15,strokeWidth:1.8})}),f(He,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:A=>b(L=>({...L,confirmPassword:A.target.value}))}),f(Tt,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:A=>b(L=>({...L,acceptedTerms:A.target.checked}))}),f(Se,{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"})]})]}),p==="forgot"&&g("form",{onSubmit:N,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Work email",type:"email",autoComplete:"username",value:y.email,onChange:A=>k({email:A.target.value}),startAdornment:f(Bs,{size:15,strokeWidth:1.8})}),f(Se,{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(Se,{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 Vx={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},Wx=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],kg=({tasks:t,appId:o,tableKey:r,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:l,filterTableKey:d,serviceUrl:u,variantService:m,layout:h,columns:f,page:p,rowsPerPage:v,rowsPerPageOptions:C,count:g,onPageChange:x,onRowsPerPageChange:b,onFilterSearch:y,onFilterVariantLoad:k,enableRowReorder:S,onTaskReorder:P,onLayoutIdChange:I,onLayoutSave:w})=>{let M=o??l??"planning-gantt",N=r??d??"planning",[T,R]=useState(n),[A,L]=useState(a??t[0]?.id??""),[$,j]=useState(""),[O,z]=useState(null),[H,q]=useState({...Vx,...i}),V=useMemo(()=>{let me=String(H.keyword?.value??"").trim().toLowerCase(),xe=String(H.status?.value??"").trim(),ze=String(H.owner?.value??"").trim().toLowerCase(),Pe=String(H.workCenter?.value??"").trim().toLowerCase(),Te=H.dateRange?.value,Be=Te?.[0]?rr(Te[0]):null,le=Te?.[1]?rr(Te[1]):null;return t.filter(fe=>{if(me&&![fe.id,fe.code,fe.title,fe.project,fe.workCenter,fe.owner?.name].join(" ").toLowerCase().includes(me)||xe&&fe.status!==xe||ze&&!String(fe.owner?.name??"").toLowerCase().includes(ze)||Pe&&!String(fe.workCenter??"").toLowerCase().includes(Pe))return false;if(Be||le){let Ve=rr(fe.startDate),et=rr(fe.endDate),rt=Be?et.isAfter(Be)||et.isSame(Be,"day"):true,at=le?Ve.isBefore(le)||Ve.isSame(le,"day"):true;if(!rt||!at)return false}return true})},[H,t]);useEffect(()=>{V.length!==0&&(V.some(me=>me.id===A)||L(V[0].id));},[V,A]);let B=useCallback(me=>{L(me.id);},[]),G=useCallback(me=>{j(me),I?.(me);},[I]),X=useCallback(me=>{z(xe=>({key:(xe?.key??0)+1,variant:me})),k?.(me);},[k]),pe=useMemo(()=>({appId:M,tableKey:N,fields:s??Wx,filters:H,onFilterChange:q,onVariantLoad:X,onSearch:y??(()=>{}),currentLayoutId:$,layoutRefs:[{tableKey:N,layoutId:$||null}],variantService:m,serviceUrl:u}),[$,s,H,X,y,M,N,u,m]),oe=useMemo(()=>({appId:M,tableKey:N,serviceUrl:u,tasks:V,columns:f,scale:T,onScaleChange:R,page:p,rowsPerPage:v,rowsPerPageOptions:C,count:g,onPageChange:x,onRowsPerPageChange:b,selectedTaskId:A,onTaskSelect:B,enableRowReorder:S,onTaskReorder:P,layout:h,layoutVariant:O?.variant,layoutVariantLoadKey:O?.key,onLayoutIdChange:G,onLayoutSave:w}),[f,g,S,V,G,h,O?.key,O?.variant,x,b,w,P,B,p,M,N,v,C,T,u,A]);return {scale:T,setScale:R,selectedTaskId:A,setSelectedTaskId:L,filters:H,setFilters:q,filteredTasks:V,smartFilterProps:pe,planningGanttProps:oe}};var s5=t=>{let o=kg(t),r=useMemo(()=>({filterProps:o.smartFilterProps,ganttProps:o.planningGanttProps}),[o.planningGanttProps,o.smartFilterProps]);return {...o,layoutProps:r}};rr.extend(_x);var lc=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],cc=36,dc=58,Sa=8,pc=260,Yx=320,_r="220ms cubic-bezier(0.2, 0, 0, 1)",Pg={"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"}},Qx=t=>t?Pg[t]?.label??t:"Planned",jx=t=>t?Pg[t]?.color??"default":"info",Tg=t=>Math.min(100,Math.max(0,t??0)),Ig=(t,o=0)=>t.flatMap(r=>[{...r,level:o},...Ig(r.children??[],o+1)]),Jx=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:Qx(t.status),statusTone:t.status??"planned",progress:Tg(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Mg=(t,o)=>o==="month"?t.startOf("month"):o==="week"?t.startOf("week"):o==="day"?t.startOf("day"):t.startOf("hour"),Rg=(t,o)=>o==="month"?t.endOf("month"):o==="week"?t.endOf("week"):o==="day"?t.endOf("day"):t.endOf("hour"),ew=(t,o,r)=>{let n=[],a=Mg(t,r),i=Rg(o,r);for(;a.isBefore(i)||a.isSame(i);){let s=r==="month"?a.add(1,"month"):r==="week"?a.add(1,"week"):r==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${r}-${a.valueOf()}`,label:r==="month"?a.format("MMM YYYY"):r==="week"?a.format("MMM D"):r==="day"?a.format("D"):a.format("HH:mm"),contextLabel:r==="hour"?a.format("MMM D"):r==="day"?a.format("MMM"):r==="week"?`W${a.isoWeek()}`:void 0,title:r==="hour"?a.format("MMM D, YYYY HH:mm"):r==="day"?a.format("MMM D, YYYY"):r==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},uc=(t,o,r)=>{let n=0;for(let a of o){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*r}n+=r;}return n},Dg=({appId:t="planning-gantt",tableKey:o="planning",serviceUrl:r,title:n="Project Plan",extraTools:a,bodyHeight:i=560,tasks:s,columns:l,scale:d="week",onScaleChange:u,page:m,rowsPerPage:h=20,rowsPerPageOptions:f$1=[20,50,100,-1],count:p,onPageChange:v,onRowsPerPageChange:C,timelineStart:g$1,timelineEnd:x,selectedTaskId:b$1,onTaskSelect:y,enableRowReorder:k=true,onTaskReorder:S,layout:P,layoutVariant:I,layoutVariantLoadKey:w,onLayoutIdChange:M,onLayoutSave:N,emptyLabel:T="No planning tasks available.",sx:R})=>{let A=ao(),{t:L}=se(),$=useRef(null),j=useRef(null),O=useRef(null),z=useRef(false),[H,q]=useState(null),[V,B]=useState("content"),[G,X]=useState(null),[pe,oe]=useState(0),[me,xe]=useState({}),[ze,Pe]=useState(cc),[Te,Be]=useState([]),le=useRef(void 0),[fe,Ve]=useState({activeId:null,overId:null}),[et,rt]=useState(null),[at,K]=useState(false),Re=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}})),ye=useRef(null),Oe=useMemo(()=>Ig(s),[s]),nt=useMemo(()=>{if(Te.length===0)return Oe;let F=new Map(Oe.map(ke=>[ke.id,ke])),Q=Te.map(ke=>F.get(ke)).filter(ke=>!!ke),ge=new Set(Q.map(ke=>ke.id));return [...Q,...Oe.filter(ke=>!ge.has(ke.id))]},[Oe,Te]),Ze=useMemo(()=>new Map(nt.map(F=>[F.id,F])),[nt]),xt=useMemo(()=>nt.map(F=>Jx(F)),[nt]),It=useMemo(()=>new Map(xt.map(F=>[F.id,F])),[xt]),Lt=useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(F,Q)=>g(ie,{spacing:.2,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:Q.title}),f(E,{sx:{fontSize:13,color:"text.secondary"},children:Q.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(F,Q)=>f(Ct,{label:Q.status,color:jx(Q.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:F=>g(ie,{spacing:.6,children:[g(E,{variant:"caption",sx:{color:"text.secondary"},children:[F,"%"]}),f(zn,{variant:"determinate",value:F,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Nt=useMemo(()=>{if(!l||l.length===0)return Lt;let F=new Map(Lt.map(Q=>[Q.id,Q]));return l.map(Q=>{let ge=F.get(Q.id),ke=Q.width??ge?.minWidth??120,Je={id:Q.id,label:Q.label,minWidth:ke};if(ge?.numeric&&(Je.numeric=true),Q.render){let qe=Q.render;return Je.render=(St,ht)=>{let mt=Ze.get(ht.id);return qe(mt||ht)},Je}return ge?.render?(Je.render=ge.render,Je):(Je.render=(qe,St)=>{let ht=St[Q.id];if(ht!=null&&String(ht).length>0)return String(ht);let yt=Ze.get(St.id)?.[Q.id];return yt!=null&&String(yt).length>0?String(yt):"-"},Je)})},[l,Lt,Ze]),te=hn({appId:t,tableKey:o,title:n,columns:Nt,rows:xt,rowKey:"id",page:m,rowsPerPage:h,rowsPerPageOptions:f$1,count:p??xt.length,onPageChange:v,onRowsPerPageChange:C,showSummary:false,layout:P,onLayoutSave:N}),Ge=t?f(gn,{appId:t,tableKey:o,currentLayoutData:te.currentLayoutData,onLayoutLoad:te.handleLayoutLoad,targetLayoutId:te.layoutIdToLoad,activeLayoutId:te.currentLayoutId,serviceUrl:r}):null,Le=te.visibleRows;useEffect(()=>{let F=Oe.map(Q=>Q.id);Be(Q=>{let ge=new Set(F),ke=Q.filter(ht=>ge.has(ht)),Je=new Set(ke),qe=F.filter(ht=>!Je.has(ht)),St=[...ke,...qe];return St.length===Q.length&&St.every((ht,mt)=>ht===Q[mt])?Q:St});},[Oe]),useEffect(()=>{w===void 0||!I||le.current!==w&&(le.current=w,te.handleVariantLoad(I));},[te,I,w]),useEffect(()=>{M?.(te.currentLayoutId);},[te.currentLayoutId,M]);let ce=F=>F.type==="group"?`group-${F.id}`:`row-${(F.data||F)?.id}`,ve=useMemo(()=>{let F=xt.map(mt=>rr(mt.startDate)),Q=xt.map(mt=>rr(mt.endDate)),ge=g$1?rr(g$1):F.reduce((mt,yt)=>yt.isBefore(mt)?yt:mt,F[0]??rr()),ke=x?rr(x):Q.reduce((mt,yt)=>yt.isAfter(mt)?yt:mt,Q[0]??rr().add(30,"day")),Je=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",qe=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",St=d==="hour"?12:1,ht=d==="hour"?12:1;return {start:Mg(ge.subtract(St,Je),d),end:Rg(ke.add(ht,qe),d)}},[xt,d,x,g$1]),ee=lc.find(F=>F.value===d)??lc[1],be=Array.isArray(a)?a:a?[a]:[],De=useMemo(()=>ew(ve.start,ve.end,d),[ve.end,ve.start,d]),je=De.length*ee.width,it=De.length>0?100/De.length:100,dt=De.length>0?`repeat(${De.length}, minmax(${ee.width}px, 1fr))`:"1fr",Ft=De.length>0?`calc(100% / ${De.length}) 100%`:"100% 100%",qt=(te.columns||[]).filter(F=>te.visibleColumns.includes(F.id)).reduce((F,Q)=>F+(te.columnWidths?.[Q.id]||Q.minWidth||100),0)+(te.grouping.length>0?72:0),zt=V==="manual"&&H!==null?H:qt,wt=G==="table",Vt=G==="timeline",ft=G==="timeline",Dt=G==="table",st=!ft&&!Dt,Ot=()=>{let F=pe||$.current?.clientWidth||0;return F>0?Math.max(pc,F-Sa-Yx):Math.max(pc,qt)},Xt=F=>Math.min(Math.max(F,pc),Ot()),W=(()=>{if(pe<=0)return null;let F=st?Sa:0;if(wt)return {tableWidth:pe,splitterWidth:F,timelineWidth:0};if(Vt)return {tableWidth:0,splitterWidth:F,timelineWidth:pe};if(V==="even"){let ge=Math.max(0,(pe-F)/2);return {tableWidth:ge,splitterWidth:F,timelineWidth:Math.max(0,pe-F-ge)}}let Q=Xt(zt);return {tableWidth:Q,splitterWidth:F,timelineWidth:Math.max(0,pe-F-Q)}})(),Y=W?`${W.tableWidth}px ${W.splitterWidth}px ${W.timelineWidth}px`:wt?"minmax(0, 1fr) 0px 0px":Vt?"0px 0px minmax(0, 1fr)":V==="even"?`minmax(0, 1fr) ${Sa}px minmax(0, 1fr)`:`${zt}px ${Sa}px minmax(0, 1fr)`;useEffect(()=>{V==="manual"&&q(F=>F===null?null:Xt(F));},[V,qt,pe]);let he=F=>{F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),X(null),B("manual"),ye.current={startX:F.clientX,startWidth:j.current?.getBoundingClientRect().width??zt};let Q=ke=>{let Je=ye.current;if(!Je)return;let qe=Xt(Je.startWidth+ke.clientX-Je.startX);q(qe);},ge=()=>{ye.current=null,window.removeEventListener("pointermove",Q),window.removeEventListener("pointerup",ge),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",Q),window.addEventListener("pointerup",ge);},Ce=()=>{X(null),B("even"),q(null);},Ae=F=>!k||!F?false:It.get(F)?.reorderable!==false,$e=(F,Q)=>{if(!F||!Q||F===Q||!Ae(F)||!Ae(Q))return false;if(te.grouping.length===0)return true;let ge=It.get(F),ke=It.get(Q);return !ge||!ke?false:te.grouping.every(Je=>ge[Je]===ke[Je])},Ke=(F,Q)=>{if(!$e(F,Q))return;let ge=Le.filter(At=>At.type!=="group").map(At=>String((At.data||At)?.id)),ke=ge.indexOf(F),Je=ge.indexOf(Q);if(ke<0||Je<0)return;let qe=[...ge];[qe[ke],qe[Je]]=[qe[Je],qe[ke]];let St=new Set(ge),ht=nt.map(At=>At.id),mt=[...qe,...ht.filter(At=>!St.has(At))],yt=Ze.get(F),oo=Ze.get(Q);if(te.setOrder("asc"),te.setOrderBy(""),Be(mt),yt&&oo){let{level:At,...Zt}=yt,{level:Bt,...Gt}=oo,Wt=mt.reduce((eo,ro)=>{let ho=Ze.get(ro);if(ho){let{level:To,...Io}=ho;eo.push(Io);}return eo},[]);S?.(Wt,{activeTask:Zt,targetTask:Gt});}},Ye=(F,Q)=>{if(!Ae(Q.id)){F.preventDefault();return}F.stopPropagation(),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",Q.id),Ve({activeId:Q.id,overId:null}),y?.(Ze.get(Q.id)||Q);},ut=(F,Q)=>{if(!$e(fe.activeId,Q)){Ve(ge=>ge.overId===null?ge:{...ge,overId:null});return}F.preventDefault(),F.stopPropagation(),F.dataTransfer.dropEffect="move",Ve(ge=>ge.overId===Q?ge:{...ge,overId:Q});},gt=(F,Q)=>{let ge=fe.activeId||F.dataTransfer.getData("text/plain");if(!$e(ge,Q)){Ve({activeId:null,overId:null});return}F.preventDefault(),F.stopPropagation(),Ke(ge,Q),Ve({activeId:null,overId:null});},Mt=()=>{Ve({activeId:null,overId:null});},bt=F=>{if(z.current)return;let Q=F==="table"?j.current:O.current,ge=F==="table"?O.current:j.current;!Q||!ge||(z.current=true,ge.scrollTop=Q.scrollTop,window.requestAnimationFrame(()=>{z.current=false;}));};return useLayoutEffect(()=>{let F=$.current;if(!F){oe(0);return}let Q=0,ge=()=>{window.cancelAnimationFrame(Q),Q=window.requestAnimationFrame(()=>{let Je=F.clientWidth;oe(qe=>Math.abs(qe-Je)<.5?qe:Je);});};if(ge(),typeof ResizeObserver>"u")return window.addEventListener("resize",ge),()=>{window.cancelAnimationFrame(Q),window.removeEventListener("resize",ge);};let ke=new ResizeObserver(ge);return ke.observe(F),window.addEventListener("resize",ge),()=>{window.cancelAnimationFrame(Q),ke.disconnect(),window.removeEventListener("resize",ge);}},[xt.length]),useLayoutEffect(()=>{if(!b$1||Dt)return;let F=O.current,Q=j.current;if(!F)return;let ge=`row-${b$1}`,ke=Array.from(F.querySelectorAll("[data-planning-timeline-row-key]")).find(St=>St.dataset.planningTimelineRowKey===ge),Je=It.get(b$1);if(!ke||!Je)return;let qe=window.requestAnimationFrame(()=>{let St=F.getBoundingClientRect(),ht=ke.getBoundingClientRect(),mt=Math.max(1,F.clientHeight-ze),yt=F.scrollTop+ht.top-St.top-ze-(mt-ht.height)/2;z.current=true,F.scrollTop=Math.max(0,yt),Q&&!ft&&(Q.scrollTop=F.scrollTop);let oo=Math.max(1,F.scrollWidth),At=De.length>0?oo/De.length:ee.width,Zt=uc(rr(Je.startDate),De,At),Bt=Math.max(0,Zt-At);F.scrollLeft=Math.min(Bt,Math.max(0,oo-F.clientWidth)),window.requestAnimationFrame(()=>{z.current=false;});});return ()=>window.cancelAnimationFrame(qe)},[ee.width,ze,b$1,ft,It,Dt,Le,De]),useLayoutEffect(()=>{let F=j.current;if(!F)return;let Q=0,ge=0,ke=false,Je=()=>{if(ke)return;let Bt=F.querySelector("thead"),Gt=Array.from(F.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Gt.length===0)return;let Wt=Bt?.getBoundingClientRect().height||cc,eo={};Gt.forEach(ro=>{let ho=ro.dataset.ctableRowKey;ho&&(eo[ho]=ro.getBoundingClientRect().height);}),Pe(ro=>Math.abs(ro-Wt)<.01?ro:Wt),xe(ro=>{let ho=Object.keys(ro),To=Object.keys(eo);return ho.length===To.length&&To.every(Io=>Math.abs((ro[Io]??0)-eo[Io])<.01)?ro:eo});},qe=()=>{window.cancelAnimationFrame(Q),Q=window.requestAnimationFrame(Je);};if(Je(),window.cancelAnimationFrame(ge),ge=window.requestAnimationFrame(()=>{ge=window.requestAnimationFrame(Je);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{ke||qe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",qe),()=>{ke=true,window.cancelAnimationFrame(Q),window.cancelAnimationFrame(ge),window.removeEventListener("resize",qe);};let St=new ResizeObserver(qe),ht=F.querySelector("table"),mt=F.querySelector("tbody"),yt=F.querySelector("thead");ht&&St.observe(ht),yt&&St.observe(yt);let oo=new WeakSet,At=()=>{F.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Bt=>{oo.has(Bt)||(St.observe(Bt),oo.add(Bt));});};At();let Zt=null;return mt&&typeof MutationObserver<"u"&&(Zt=new MutationObserver(()=>{At(),qe();}),Zt.observe(mt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",qe),()=>{ke=true,window.cancelAnimationFrame(Q),window.cancelAnimationFrame(ge),St.disconnect(),Zt?.disconnect(),window.removeEventListener("resize",qe);}},[Le,te.visibleColumns,te.grouping,te.columnWidths]),g(Ne,{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 ${A.palette.divider}`,...R},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(mi,{value:te.filterText,onChange:F=>{te.setFilterText(F),te.setPage(0);}}),f(ui,{rowsPerPage:te.rowsPerPage,rowsPerPageOptions:f$1,page:te.page,count:te.totalDisplayCount,onRowsPerPageChange:te.setRowsPerPage,onPageChange:te.setPage}),be.length>0&&f("div",{className:"orb-table-toolbar-custom",children:be.map((F,Q)=>f("div",{className:"orb-planning-extra-tool",children:F},`planning-extra-tool-${Q}`))}),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=>te.setAnchorEl(F.currentTarget),sx:co,children:f(an,{fontSize:"small"})}),f(ae,{className:"orb-table-tool-button",tooltip:"Group by",onClick:F=>te.setGroupAnchorEl(F.currentTarget),sx:co,children:f(Cr,{fontSize:"small"})}),f(ae,{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:()=>K(true),sx:co,children:f(lp,{fontSize:"small"})})]}),Ge&&f("div",{className:"orb-table-tool-group",children:Ge}),f("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:f(Vn,{"aria-label":"Planning pane layout",size:"small",value:G??(V==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:f(ii,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(li,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:f(ai,{fontSize:"small"})}],onValueChange:F=>{F==="split"?Ce():X(F);}})}),f("div",{className:"orb-table-tool-group orb-planning-scale-control",children:f(Ht,{label:"",value:d,options:lc.map(F=>({value:F.value,label:F.label})),onChange:F=>u?.(F.target.value)})})]})]})}),xt.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:$,sx:{height:"100%",display:"grid",gridTemplateColumns:Y,minWidth:0,transition:`grid-template-columns ${_r}`},children:[f("div",{"data-planning-scroll-pane":"table",ref:j,onScroll:()=>bt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:ft?0:1,transform:ft?"translateX(-10px)":"translateX(0)",pointerEvents:ft?"none":"auto",transition:`opacity ${_r}, transform ${_r}`},children:f(DndContext,{sensors:Re,collisionDetection:closestCenter,modifiers:[restrictToHorizontalAxis],onDragEnd:F=>{let Q=F?.active?.id,ge=F?.over?.id;typeof Q=="string"&&typeof ge=="string"&&te.handleColumnReorder(Q,ge);},children:g("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:qt,"& thead th":{height:cc,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[f(fi,{columns:te.columns,visibleColumns:te.visibleColumns,order:te.order,orderBy:te.orderBy,sortBy:te.sortBy,onRequestSort:te.handleRequestSort,onContextMenu:(F,Q)=>{F.preventDefault(),F.stopPropagation(),rt({mouseX:F.clientX+2,mouseY:F.clientY-6,columnId:Q});},grouping:te.grouping,isAllExpanded:te.isAllExpanded,handleToggleAll:te.handleToggleAll,columnWidths:te.columnWidths,onColumnResize:te.handleColumnResize,enableColumnReorder:true}),f(bi,{visibleRows:Le,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,Q)=>{y?.(Ze.get(Q.id)||Q);},getRowDataKey:({entry:F})=>ce(F),getGroupRowProps:()=>({style:{height:dc}}),getRowProps:({data:F})=>{let Q=F,ge=Ae(Q.id),ke=fe.activeId===Q.id,Je=fe.overId===Q.id&&$e(fe.activeId,Q.id);return {draggable:ge,className:Je?"orb-is-drop-target":void 0,style:{cursor:ke?"grabbing":ge?"grab":y?"pointer":"default",height:dc,opacity:ke?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:qe=>Ye(qe,Q),onDragOver:qe=>ut(qe,Q.id),onDragEnter:qe=>ut(qe,Q.id),onDrop:qe=>gt(qe,Q.id),onDragEnd:Mt}}})]})})}),f("div",{onPointerDown:st?he:void 0,role:"separator","aria-orientation":"vertical",sx:{width:st?Sa:0,cursor:st?"col-resize":"default",opacity:st?1:0,pointerEvents:st?"auto":"none",borderLeft:st?`1px solid ${A.palette.divider}`:"0 solid transparent",borderRight:st?`1px solid ${A.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 ${_r}, opacity ${_r}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:A.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:st?"col-resize":"default"}}}),f("div",{sx:{minWidth:0,overflow:"hidden",opacity:Dt?0:1,transform:Dt?"translateX(10px)":"translateX(0)",pointerEvents:Dt?"none":"auto",transition:`opacity ${_r}, transform ${_r}`},children:f("div",{"data-planning-scroll-pane":"timeline",ref:O,onScroll:()=>bt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:g("div",{sx:{width:"100%",minWidth:je||"100%"},children:[f("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:dt,height:ze,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`,position:"sticky",top:0,zIndex:2},children:De.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 ${A.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(ie,{sx:{position:"relative"},children:Le.map(F=>{let Q=ce(F),ge=me[Q]??dc;if(F.type==="group")return f("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":Q,sx:{position:"relative",height:ge,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`}},F.id);let ke=F.data||F,Je=rr(ke.startDate),qe=rr(ke.endDate),St=uc(Je,De,it),ht=uc(qe,De,it),mt=Math.max(0,ht-St),yt=Tg(ke.progress),oo=ke.id===b$1,At=Ae(ke.id),Zt=fe.activeId===ke.id,Bt=fe.overId===ke.id&&$e(fe.activeId,ke.id),Gt=ke.color??(ke.statusTone==="blocked"?A.palette.error.main:A.palette.primary.main);return f("div",{className:`orb-planning-timeline-row ${oo?"orb-is-selected":""}`,"data-planning-timeline-row-key":Q,draggable:At,onDragStart:Wt=>Ye(Wt,ke),onDragOver:Wt=>ut(Wt,ke.id),onDragEnter:Wt=>ut(Wt,ke.id),onDrop:Wt=>gt(Wt,ke.id),onDragEnd:Mt,onClick:()=>y?.(Ze.get(ke.id)||ke),sx:{position:"relative",height:ge,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`,opacity:Zt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:A.palette.primary.main,opacity:Bt?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:Ft,cursor:Zt?"grabbing":At?"grab":y?"pointer":"default",transition:"opacity 120ms ease"},children:f(lt,{title:`${ke.title}: ${Je.format("MMM D HH:mm")} - ${qe.format("MMM D HH:mm")}`,children:g("div",{sx:{position:"absolute",left:`${St}%`,top:Math.max(8,(ge-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:oo?`2px solid ${A.palette.warning.main}`:"none",outlineOffset:2},children:[f("div",{sx:{height:"100%",width:`${yt}%`,backgroundColor:Gt}}),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:ke.code})]})})},ke.id)})})]})})})]})}),f(cn,{groupAnchorEl:te.groupAnchorEl,setGroupAnchorEl:te.setGroupAnchorEl,grouping:te.grouping,setGrouping:te.setGrouping,columns:te.columns}),f(dn,{anchorEl:te.anchorEl,setAnchorEl:te.setAnchorEl,columns:te.columns,visibleColumns:te.visibleColumns,toggleColumnVisibility:te.toggleColumnVisibility}),f(Tp,{contextMenu:et,handleClose:()=>rt(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 Q=te.sortBy.filter(ge=>ge.field!==F);Q.length>0?te.applyMultiSort(Q):(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:()=>K(true)}),f(Ip,{open:at,onClose:()=>K(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 V5=({filterProps:t,ganttProps:o,spacing:r=2,sx:n,children:a})=>{let i=n?[{height:"100%",overflow:"hidden"},n]:{height:"100%",overflow:"hidden"},s=o.sx?[{height:"100%"},o.sx]:{height:"100%"};return g(ie,{spacing:r,sx:i,children:[f("div",{sx:{flexShrink:0},children:f(Wo,{...t})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:f(Dg,{...o,bodyHeight:o.bodyHeight??"100%",sx:s})}),a]})};var Ng=640,tw=360,ow=360,As=8,Nn="220ms cubic-bezier(0.2, 0, 0, 1)",hc=(t,o,r=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:r,hasChildren:i.length>0,parentIds:n}];return o.has(a.id)?[...s,...hc(i,o,r+1,[...n,a.id])]:s}),Eg=t=>t.flatMap(o=>[o,...Eg(o.children??[])]),Lg=(t,o=0,r=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:o,hasChildren:a.length>0,parentIds:r},...Lg(a,o+1,[...r,n.id])]}),Og=t=>t.flatMap(o=>{let r=o.children??[];return r.length===0?[]:[o.id,...Og(r)]}),Ag=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(),Q5=({title:t,subtitle:o,nodes:r,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:l,expandedNodeIds:d,defaultExpandedNodeIds:u,onExpandedNodeIdsChange:m,defaultPaneMode:h="split",minTreePaneWidth:f$1=tw,minDetailPaneWidth:p=ow,tableAppId:v="ctree-comp",tableKey:C="default",tableTitle:g$1,filterConfig:x,searchQuery:b$1,searchToken:y,defaultRowsPerPage:k=-1,rowsPerPageOptions:S=[20,50,100,-1],serviceUrl:P,emptyLabel:I="No tree items available.",headerAction:w,sx:M,className:N})=>{let T=ao(),R=useRef(null),A=useRef(null),L=useRef(null),[$,j]=useState(s??r[0]?.id??null),[O,z]=useState(u??Og(r).slice(0,3)),[H,q]=useState(h),[V,B]=useState(Ng),[G,X]=useState(0),[pe,oe]=useState(0),[me,xe]=useState(k),ze=useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:ce=>g(ie,{spacing:.3,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:ce.label}),ce.subtitle&&f(E,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:ce.subtitle})]})}],[n]),Pe=useMemo(()=>new Set(d??O),[d,O]),Te=useMemo(()=>hc(r,Pe),[r,Pe]),Be=useMemo(()=>Eg(r),[r]),le=useMemo(()=>Lg(r),[r]),fe=i===void 0?$:i,Ve=useMemo(()=>Be.find(ce=>ce.id===fe)??null,[fe,Be]),et=ce=>{let ve=A.current?.clientWidth??0,ee=ve>0?Math.max(f$1,ve-As-p):Math.max(f$1,ce);return Math.min(Math.max(ce,f$1),ee)},rt=H==="detail",at=H==="tree"||!a,K=H==="split"&&!!a,ye=(()=>{if(G<=0)return null;if(H==="tree"||!a)return {treeWidth:G,splitterWidth:0,detailWidth:0};if(H==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:G};let ce=K?As:0,ve=et(V);return {treeWidth:ve,splitterWidth:ce,detailWidth:Math.max(0,G-ce-ve)}})(),Oe=ye?`${ye.treeWidth}px ${ye.splitterWidth}px ${ye.detailWidth}px`:H==="tree"||!a?"minmax(0, 1fr) 0px 0px":H==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${f$1}px, ${V}px) ${As}px minmax(${p}px, 1fr)`;useEffect(()=>{let ce=A.current;if(!ce){X(0);return}let ve=0,ee=()=>{window.cancelAnimationFrame(ve),ve=window.requestAnimationFrame(()=>{let De=ce.clientWidth;X(je=>Math.abs(je-De)<.5?je:De);});};if(ee(),typeof ResizeObserver>"u")return window.addEventListener("resize",ee),()=>{window.cancelAnimationFrame(ve),window.removeEventListener("resize",ee);};let be=new ResizeObserver(ee);return be.observe(ce),window.addEventListener("resize",ee),()=>{window.cancelAnimationFrame(ve),be.disconnect(),window.removeEventListener("resize",ee);}},[]);let nt=ce=>{d===void 0&&z(ce),m?.(ce);},Ze=ce=>{let ve=new Set(Pe);ve.has(ce)?ve.delete(ce):ve.add(ce),nt(Array.from(ve));},xt=ce=>{i===void 0&&j(ce.id),l?.(ce);};useEffect(()=>{oe(0);},[r]),useEffect(()=>{let ce=b$1?.trim().toLowerCase();if(!ce)return;let ve=le.find(({node:dt})=>Ag(dt).includes(ce));if(!ve)return;let ee=new Set(Pe);ve.parentIds.forEach(dt=>ee.add(dt)),nt(Array.from(ee)),xt(ve.node);let De=hc(r,ee).findIndex(({node:dt})=>dt.id===ve.node.id);De>=0&&me>0&&oe(Math.floor(De/me));let je=0,it=0;return je=window.requestAnimationFrame(()=>{it=window.requestAnimationFrame(()=>{let dt=R.current?.querySelector("tr.orb-selected"),Ft=dt?.closest(".orb-table-container");if(dt&&Ft){let qt=Ft.getBoundingClientRect(),zt=dt.getBoundingClientRect(),wt=zt.top-qt.top+Ft.scrollTop;Ft.scrollTo({top:wt-Ft.clientHeight/2+zt.height/2,behavior:"smooth"});return}dt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(je),window.cancelAnimationFrame(it);}},[b$1,y,le,r,me]);let It=useMemo(()=>Te.map(({node:ce,level:ve,hasChildren:ee})=>({...ce,id:ce.id,__node:ce,__level:ve,__hasChildren:ee,__expanded:Pe.has(ce.id),__searchText:Ag(ce)})),[Pe,Te]),Lt=useMemo(()=>ze.map((ce,ve)=>({id:ce.id,label:ce.label,minWidth:typeof ce.width=="number"?ce.width:ce.minWidth??(ve===0?320:120),numeric:ce.numeric??ce.align==="right",render:(ee,be)=>{let De=be.__node,je=ce.render?ce.render(De):De[ce.id];if(ve!==0)return f(Ie,{sx:{minWidth:0,color:ce.align==="right"?"text.primary":"text.secondary",fontWeight:ce.align==="right"?750:500,textAlign:ce.align??"left"},children:je});let it=Number(be.__level??0),dt=!!be.__hasChildren,Ft=!!be.__expanded;return g(ie,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${it*24}px`},children:[f(ae,{tooltip:dt?Ft?"Collapse":"Expand":"",onClick:qt=>{qt.stopPropagation(),dt&&Ze(De.id);},disabled:!dt,sx:{width:24,height:24,visibility:dt?"visible":"hidden",transform:Ft?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:f(Vo,{sx:{fontSize:20}})}),f(Ie,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:De.markerColor??T.palette.primary.main}}),f(Ie,{sx:{minWidth:0},children:je})]})}})),[ze,Pe,T.palette.primary.main]),Nt=ce=>{if(!K)return;ce.preventDefault(),ce.currentTarget.setPointerCapture(ce.pointerId),L.current={startX:ce.clientX,startWidth:V};let ve=be=>{let De=L.current;De&&B(et(De.startWidth+be.clientX-De.startX));},ee=()=>{L.current=null,window.removeEventListener("pointermove",ve),window.removeEventListener("pointerup",ee),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",ve),window.addEventListener("pointerup",ee);},te=()=>{let ce=A.current?.clientWidth??0,ve=ce>0?Math.max(f$1,(ce-As)/2):Ng;q("split"),B(et(ve));},Ge=()=>a?typeof a=="function"?a(Ve):a:null,Le=a?f(Vn,{"aria-label":"Tree pane layout",value:H,options:[{value:"tree",label:"Expand tree",icon:f(ii,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(li,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:f(ai,{fontSize:"small"})}],onValueChange:ce=>{ce==="split"?te():q(ce);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return g(Ie,{ref:R,className:["ctree_comp",N].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)}`,...M},children:[Le,g(Ie,{ref:A,sx:{height:"100%",display:"grid",gridTemplateColumns:Oe,transition:`grid-template-columns ${Nn}`,minWidth:0},children:[g(Ie,{"aria-hidden":rt?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:rt?0:1,transform:rt?"translateX(-12px)":"translateX(0)",pointerEvents:rt?"none":"auto",transition:`opacity ${Nn}, transform ${Nn}`,willChange:"opacity, transform"},children:[g(ie,{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(ie,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[f(Cr,{sx:{color:"primary.main",fontSize:28}}),g(Ie,{sx:{minWidth:0},children:[f(E,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),o&&f(E,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:o})]})]}),w!==void 0?w:f(ae,{tooltip:"Add node",color:"default",children:f(Fr,{fontSize:"small"})})]}),g(Ie,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[f(Jo,{appId:v,tableKey:C,title:g$1??(typeof t=="string"?t:"Tree"),columns:Lt,rows:It,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:fe?[fe]:[],onSelectionChange:ce=>{let ve=ce[ce.length-1],ee=Be.find(be=>be.id===ve);ee&&xt(ee);},page:pe,rowsPerPage:me,rowsPerPageOptions:S,count:It.length,onPageChange:oe,onRowsPerPageChange:ce=>{oe(0),xe(ce);},filterConfig:x,serviceUrl:P,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),It.length===0&&f(Ie,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:I})]})]}),f(Ie,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:K?Nt:void 0,sx:{width:"100%",cursor:K?"col-resize":"default",backgroundColor:K?tt(T.palette.text.primary,b()==="dark"?.16:.08):"transparent",opacity:K?1:0,pointerEvents:K?"auto":"none",position:"relative",transition:`opacity ${Nn}, background-color 120ms ease`,"&:hover":{backgroundColor:K?tt(T.palette.primary.main,b()==="dark"?.35:.18):"transparent"}}}),g(Ie,{"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 ${Nn}, transform ${Nn}`,willChange:"opacity, transform"},children:[f(Ie,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:f(Rt,{sx:{width:"100%"}})}),f(Ie,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:Ge()})]})]})]})};var iw={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)"}}},oV=({children:t,transitionKey:o,variant:r="fade",durationMs:n=220,delayMs:a=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:l})=>{let d=yr("(prefers-reduced-motion: reduce)"),[u,m]=useState("to"),h=!s&&!d&&r!=="none";useEffect(()=>{if(!h){m("to");return}m("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{m("to");});});return ()=>cancelAnimationFrame(v)},[o,h]);let f$1=iw[r],p=useMemo(()=>h?u==="from"?f$1.from:f$1.to:{opacity:1,transform:"none"},[h,u,f$1.from,f$1.to]);return f(Ie,{sx:{willChange:h?"opacity, transform":"auto",transition:h?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...p,...l},children:t})},rV={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};export{Rz as AIBrowserGlow,wc as Activity,Bm as AgentPanel,ka as AlertCircle,Sc as AlertTriangle,Rw as ArrowDown,Dw as ArrowRight,kc as ArrowUp,Os as BarChart,Nw as Bot,_s as Button,my as CAINavProvider,tn as CAlert,Op as CAmapChart,Wi as CAppHeader,wl as CAppHeaderSearch,rE as CAppPageLayout,Jz as CAuthPage,en as CAvatar,Va as CBadge,Jn as CBarChart,Se as CButton,$n as CCalendar,Yp as CCardDetailPanel,jp as CCardGrid,wb as CCardGridCard,ED as CCardPage,Ci as CChartCard,Tt as CCheckbox,Ct as CChip,Dp as CComboChart,Bp as CCustomizeAgent,zh as CDatePicker,tA as CDetailInfoPage,iu as CDetailSearchAiBar,Fi as CDetailSectionCard,Et as CDialog,Rt as CDivider,Wh as CFileUpload,gT as CFilterField,Ap as CFishboneChart,Lp as CGoogleMapChart,Fp as CGraphCharts,Mp as CGraphKpiCards,ki as CGraphReport,Np as CHeatmapChart,ae as CIconButton,RA as CKanbanBoard,pu as CKanbanBucket,fl as CKanbanCard,Kp as CLayoutManagement,gn as CLayoutManager,Rp as CLineChart,aT as CList,iT as CListItem,pT as CListItemAvatar,sT as CListItemButton,lT as CListItemIcon,cT as CListItemText,dT as CListSubheader,Yt as CMenu,Xn as CMessageBox,gs as CMetricChartCard,pi as CPageLayout,oV as CPageTransition,Ne as CPaper,xi as CPieChart,UL as CPivotTable,Dg as CPlanningGantt,V5 as CPlanningLayout,Vs as CPopover,zn as CProgress,ph as CRadioGroup,Vn as CSegmentedControl,Ht as CSelect,vh as CSkeleton,Wo as CSmartFilter,j1 as CSmartTable,Xo as CSpinner,ie as CStack,aD as CStandardPage,oT as CStatusBadge,za as CSwitch,Jo as CTable,q1 as CTableBody,X1 as CTableCell,Z1 as CTableContainer,Y1 as CTableHead,Q1 as CTableRow,Oh as CTabs,Hn as CTextArea,He as CTextField,lt as CTooltip,Q5 as CTreeComp,E as CTypography,yp as CValueHelp,Mi as CVariantManagement,Wp as CVariantManager,Al as CVoiceWaveOverlay,Ep as CWaterfallChart,Fs as Calendar,Aw as CalendarDays,Ew as Camera,Lw as ChartNoAxesCombined,Do as Check,Pa as CheckCircle,Fo as ChevronDown,Ta as ChevronLeft,Bo as ChevronRight,Ow as ChevronUp,Fw as ChevronsDown,Bw as ChevronsUp,Ia as CircleAlert,Ln as CircleCheck,Hw as CircleCheckBig,Pc as CircleStop,Tc as Clipboard,zw as ClipboardCheck,Vw as ClipboardList,Ic as Clock,aa as CodeBlock,Ww as Columns3,Tz as CopilotChat,qo as Copy,$w as CopyPlus,_w as Delete,Ma as Download,Mc as Edit,Rc as Expand,Gw as Eye,Uw as EyeOff,Ra as File,Dc as FileText,Kw as Filter,vz as FloatingAgentPanel,On as FolderTree,Nc as GitBranch,QP as GlobalMessage,Fn as Globe,Ac as Grid,qw as GripVertical,Xw as Hammer,Ec as Image,Da as Info,_l as InputArea,Zw as Languages,Yw as Layers,Qw as LayoutDashboard,Na as Lightbulb,Lc as LineChart,Oc as Loader2,Aa as Lock,jw as LockKeyhole,Fc as LogOut,ms as METRIC_CHART_TYPES,Bs as Mail,Bc as MapPin,la as MarkdownRenderer,ia as MathBlock,Hc as Menu,ll as MermaidBlock,Xg as MessageCircle,zc as MessageSquare,Ea as Mic,Jw as MicOff,Vc as Moon,e0 as MoreHorizontal,id as NavigationIsland,Ks as NavigationIsland2,kx as OMPHApprovalCard,iz as OMPHPanel,Gn as ORBCAFE_I18N_MESSAGES,Bg as ORB_DARK,lw as ORB_FONT_STACK,Fg as ORB_LIGHT,dw as ORB_RADIUS,Es as ORB_TOKENS,pw as ORB_TRANSITION_FAST,_a as OrbcafeI18nProvider,En as OrbisModeProvider,rV as PAGE_TRANSITION_PRESETS,vF as PAppPageLayout,cO as PBarcodeScanner,im as PNavIsland,kO as PNumericKeypad,tm as PSmartFilter,ny as PTable,fO as PTouchCard,om as PWorkloadNav,t0 as PackageCheck,o0 as PackageSearch,La as PanelLeftOpen,Oa as PanelRight,r0 as PanelsTopLeft,Wc as PieChart,Qr as Pin,Ku as PivotChartPanel,n0 as Play,jr as Plus,a0 as QrCode,i0 as ReceiptText,Fa as RefreshCw,s0 as Rocket,l0 as RotateCcw,$c as RotateCw,c0 as Rows3,Pt as SapIcon,d0 as Save,p0 as ScanLine,Ho as Search,Zg as Send,_c as SendHorizontal,Jr as Settings,u0 as ShieldCheck,m0 as Sigma,g0 as SortAsc,h0 as SquareSplitHorizontal,f0 as Star,Om as StdChat,Gc as Sun,b0 as Table2,dl as TableBlock,v0 as TabletSmartphone,Bn as Terminal,Li as ThinkBlock,Uc as ThumbsDown,Kc as ThumbsUp,qc as Trash2,Un as TreeMenu,y0 as TreePine,Xc as TrendingDown,Ba as TriangleAlert,C0 as Truck,Zc as UploadCloud,Hs as User,RF as VoiceNavigatorProvider,SF as VoiceWaveOverlay,Yc as Volume2,x0 as Warehouse,w0 as Workflow,Ut as X,Ha as XCircle,uu as addKanbanBucket,wi as buildAmapEmbedUrl,ea as buildGoogleMapEmbedUrl,_M as buildGoogleMapIframe,Kh as buttonVariants,gu as createKanbanBoardModel,ne as createSapIcon,_o as findKanbanCard,_P as message,ir as messageManager,zi as moveKanbanCard,jl as omphApprovalLabelsFromI18n,Ql as omphLabelsFromI18n,tt as orbAlpha,cw as orbChartSeries,Ei as parseMarkdownTable,Kl as parseOmphFileHref,mu as renameKanbanBucket,IN as renderMarkdown,Ni as resolveVariantFilters,Ai as resolveVariantLayout,gy as useAINav,qD as useAmapEmbedUrl,Gz as useAuthPage,HD as useCardPage,lu as useDetailInfo,KD as useGoogleMapEmbedUrl,WD as useGraphChartData,Ti as useGraphInteraction,pn as useGraphReport,LA as useKanbanBoard,Ro as useMediaQuery,ud as useNavigationIsland,mo as useOrbMode,Ls as useOrbTokens,se as useOrbcafeI18n,eO as usePadLayout,rO as usePadRecordEditor,xu as usePageLayout,YL as usePivotTable,kg as usePlanningGantt,s5 as usePlanningLayout,pD as useStandardReport,Cn as useVoiceInput,DF as useVoiceNavigator};
|
|
53
|
+
`,s5=({active:t=false,colors:o=rw,zIndex:r=2147483e3})=>{let n={"--orbcafe-ai-glow-line":o[0],"--orbcafe-ai-glow-z-index":r};return g(e,{children:[f("style",{children:nw}),f("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var S5=({defaultMode:t="login",onLogin:o,onRegister:r,onForgotPassword:n}={})=>{let[a,i]=useState(t),[s,c]=useState(false),d=useCallback(async p=>{c(true);try{await p?.();}finally{c(false);}},[]),u=useCallback(p=>d(()=>o?.(p)),[o,d]),m=useCallback(p=>d(()=>r?.(p)),[r,d]),h=useCallback(p=>d(()=>n?.(p)),[n,d]),f=useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:u,onRegister:m,onForgotPassword:h}),[h,u,m,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:f}};var sw={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."},A5=({mode:t,defaultMode:o="login",onModeChange:r,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:c,copy:d,sx:u})=>{let m=t!==void 0,[h,f$1]=useState(o),p=t??h,b=useMemo(()=>({...sw,...d}),[d]),[C,g$1]=useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,v]=useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[y,P]=useState({email:""}),[S,I]=useState(""),M=A=>{m||f$1(A),I(""),r?.(A);},w=async A=>{A.preventDefault(),await n?.(C),I("Demo login accepted. No real authentication request was sent.");},D=async A=>{A.preventDefault(),await a?.(x),I("Demo registration saved locally for this screen.");},N=async A=>{A.preventDefault(),await i?.(y),I("Demo reset link request created. No email was sent.");},T=p==="login"?b.loginTitle:p==="register"?b.registerTitle:b.forgotTitle,k=p==="login"?b.loginSubtitle:p==="register"?b.registerSubtitle:b.forgotSubtitle;return g("div",{className:"orb-auth-frame orb-root",style:u,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:b.headline}),f("p",{children:b.subheadline})]}),f("div",{className:"orb-auth-meta",children:b.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:b.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:k}),S&&f(on,{severity:"success",children:S}),p==="login"&&g("form",{onSubmit:w,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Email",type:"email",autoComplete:"username",value:C.username,onChange:A=>g$1(L=>({...L,username:A.target.value})),startAdornment:f(qs,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"current-password",value:C.password,onChange:A=>g$1(L=>({...L,password:A.target.value})),startAdornment:f(Ba,{size:15,strokeWidth:1.8})}),g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[f(Tt,{label:"Remember me",checked:C.remember,onChange:A=>g$1(L=>({...L,remember:A.target.checked}))}),f("button",{type:"button",className:"orb-link",onClick:()=>M("forgot"),children:"Forgot password?"})]}),f(Pe,{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:()=>M("register"),children:"Register"})]})]}),p==="register"&&g("form",{onSubmit:D,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Full name",value:x.name,onChange:A=>v(L=>({...L,name:A.target.value})),startAdornment:f(qs,{size:15,strokeWidth:1.8})}),f(He,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:A=>v(L=>({...L,email:A.target.value})),startAdornment:f(Ks,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:A=>v(L=>({...L,password:A.target.value})),startAdornment:f(Ba,{size:15,strokeWidth:1.8})}),f(He,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:A=>v(L=>({...L,confirmPassword:A.target.value}))}),f(Tt,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:A=>v(L=>({...L,acceptedTerms:A.target.checked}))}),f(Pe,{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:()=>M("login"),children:"Sign in"})]})]}),p==="forgot"&&g("form",{onSubmit:N,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Work email",type:"email",autoComplete:"username",value:y.email,onChange:A=>P({email:A.target.value}),startAdornment:f(Ks,{size:15,strokeWidth:1.8})}),f(Pe,{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:()=>M("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(Pe,{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 cw={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},dw=[{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"}],Bg=({tasks:t,appId:o,tableKey:r,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:c,filterTableKey:d,serviceUrl:u,variantService:m,layout:h,columns:f,page:p,rowsPerPage:b,rowsPerPageOptions:C,count:g,onPageChange:x,onRowsPerPageChange:v,onFilterSearch:y,onFilterVariantLoad:P,enableRowReorder:S,onTaskReorder:I,onLayoutIdChange:M,onLayoutSave:w})=>{let D=o??c??"planning-gantt",N=r??d??"planning",[T,k]=useState(n),[A,L]=useState(a??t[0]?.id??""),[W,ee]=useState(""),[O,_]=useState(null),[V,Q]=useState({...cw,...i}),H=useMemo(()=>{let le=String(V.keyword?.value??"").trim().toLowerCase(),he=String(V.status?.value??"").trim(),ze=String(V.owner?.value??"").trim().toLowerCase(),be=String(V.workCenter?.value??"").trim().toLowerCase(),Ce=V.dateRange?.value,Be=Ce?.[0]?nr(Ce[0]):null,de=Ce?.[1]?nr(Ce[1]):null;return t.filter(ve=>{if(le&&![ve.id,ve.code,ve.title,ve.project,ve.workCenter,ve.owner?.name].join(" ").toLowerCase().includes(le)||he&&ve.status!==he||ze&&!String(ve.owner?.name??"").toLowerCase().includes(ze)||be&&!String(ve.workCenter??"").toLowerCase().includes(be))return false;if(Be||de){let We=nr(ve.startDate),et=nr(ve.endDate),nt=Be?et.isAfter(Be)||et.isSame(Be,"day"):true,it=de?We.isBefore(de)||We.isSame(de,"day"):true;if(!nt||!it)return false}return true})},[V,t]);useEffect(()=>{H.length!==0&&(H.some(le=>le.id===A)||L(H[0].id));},[H,A]);let B=useCallback(le=>{L(le.id);},[]),q=useCallback(le=>{ee(le),M?.(le);},[M]),Z=useCallback(le=>{_(he=>({key:(he?.key??0)+1,variant:le})),P?.(le);},[P]),Y=useMemo(()=>({appId:D,tableKey:N,fields:s??dw,filters:V,onFilterChange:Q,onVariantLoad:Z,onSearch:y??(()=>{}),currentLayoutId:W,layoutRefs:[{tableKey:N,layoutId:W||null}],variantService:m,serviceUrl:u}),[W,s,V,Z,y,D,N,u,m]),J=useMemo(()=>({appId:D,tableKey:N,serviceUrl:u,tasks:H,columns:f,scale:T,onScaleChange:k,page:p,rowsPerPage:b,rowsPerPageOptions:C,count:g,onPageChange:x,onRowsPerPageChange:v,selectedTaskId:A,onTaskSelect:B,enableRowReorder:S,onTaskReorder:I,layout:h,layoutVariant:O?.variant,layoutVariantLoadKey:O?.key,onLayoutIdChange:q,onLayoutSave:w}),[f,g,S,H,q,h,O?.key,O?.variant,x,v,w,I,B,p,D,N,b,C,T,u,A]);return {scale:T,setScale:k,selectedTaskId:A,setSelectedTaskId:L,filters:V,setFilters:Q,filteredTasks:H,smartFilterProps:Y,planningGanttProps:J}};var V5=t=>{let o=Bg(t),r=useMemo(()=>({filterProps:o.smartFilterProps,ganttProps:o.planningGanttProps}),[o.planningGanttProps,o.smartFilterProps]);return {...o,layoutProps:r}};nr.extend(uw);var fc=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],bc=36,vc=58,Ra=8,yc=260,yw=320,Gr="220ms cubic-bezier(0.2, 0, 0, 1)",Hg={"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"}},Cw=t=>t?Hg[t]?.label??t:"Planned",xw=t=>t?Hg[t]?.color??"default":"info",zg=t=>Math.min(100,Math.max(0,t??0)),Vg=(t,o=0)=>t.flatMap(r=>[{...r,level:o},...Vg(r.children??[],o+1)]),ww=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:Cw(t.status),statusTone:t.status??"planned",progress:zg(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Wg=(t,o)=>o==="month"?t.startOf("month"):o==="week"?t.startOf("week"):o==="day"?t.startOf("day"):t.startOf("hour"),$g=(t,o)=>o==="month"?t.endOf("month"):o==="week"?t.endOf("week"):o==="day"?t.endOf("day"):t.endOf("hour"),Sw=(t,o,r)=>{let n=[],a=Wg(t,r),i=$g(o,r);for(;a.isBefore(i)||a.isSame(i);){let s=r==="month"?a.add(1,"month"):r==="week"?a.add(1,"week"):r==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${r}-${a.valueOf()}`,label:r==="month"?a.format("MMM YYYY"):r==="week"?a.format("MMM D"):r==="day"?a.format("D"):a.format("HH:mm"),contextLabel:r==="hour"?a.format("MMM D"):r==="day"?a.format("MMM"):r==="week"?`W${a.isoWeek()}`:void 0,title:r==="hour"?a.format("MMM D, YYYY HH:mm"):r==="day"?a.format("MMM D, YYYY"):r==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},Cc=(t,o,r)=>{let n=0;for(let a of o){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*r}n+=r;}return n},_g=({appId:t="planning-gantt",tableKey:o="planning",serviceUrl:r,title:n="Project Plan",extraTools:a,bodyHeight:i=560,tasks:s,columns:c,scale:d="week",onScaleChange:u,page:m,rowsPerPage:h=20,rowsPerPageOptions:f$1=[20,50,100,-1],count:p,onPageChange:b$1,onRowsPerPageChange:C,timelineStart:g$1,timelineEnd:x,selectedTaskId:v,onTaskSelect:y,enableRowReorder:P=true,onTaskReorder:S,layout:I,layoutVariant:M,layoutVariantLoadKey:w,onLayoutIdChange:D,onLayoutSave:N,emptyLabel:T="No planning tasks available.",sx:k})=>{let A=io(),{t:L}=ce(),W=useRef(null),ee=useRef(null),O=useRef(null),_=useRef(false),[V,Q]=useState(null),[H,B]=useState("content"),[q,Z]=useState(null),[Y,J]=useState(0),[le,he]=useState({}),[ze,be]=useState(bc),[Ce,Be]=useState([]),de=useRef(void 0),[ve,We]=useState({activeId:null,overId:null}),[et,nt]=useState(null),[it,U]=useState(false),Re=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}})),we=useRef(null),Oe=useMemo(()=>Vg(s),[s]),at=useMemo(()=>{if(Ce.length===0)return Oe;let F=new Map(Oe.map(Te=>[Te.id,Te])),j=Ce.map(Te=>F.get(Te)).filter(Te=>!!Te),ge=new Set(j.map(Te=>Te.id));return [...j,...Oe.filter(Te=>!ge.has(Te.id))]},[Oe,Ce]),Ze=useMemo(()=>new Map(at.map(F=>[F.id,F])),[at]),xt=useMemo(()=>at.map(F=>ww(F)),[at]),It=useMemo(()=>new Map(xt.map(F=>[F.id,F])),[xt]),Ot=useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(F,j)=>g(se,{spacing:.2,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:j.title}),f(E,{sx:{fontSize:13,color:"text.secondary"},children:j.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(F,j)=>f(Ct,{label:j.status,color:xw(j.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:F=>g(se,{spacing:.6,children:[g(E,{variant:"caption",sx:{color:"text.secondary"},children:[F,"%"]}),f($n,{variant:"determinate",value:F,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),At=useMemo(()=>{if(!c||c.length===0)return Ot;let F=new Map(Ot.map(j=>[j.id,j]));return c.map(j=>{let ge=F.get(j.id),Te=j.width??ge?.minWidth??120,Je={id:j.id,label:j.label,minWidth:Te};if(ge?.numeric&&(Je.numeric=true),j.render){let qe=j.render;return Je.render=(St,ht)=>{let mt=Ze.get(ht.id);return qe(mt||ht)},Je}return ge?.render?(Je.render=ge.render,Je):(Je.render=(qe,St)=>{let ht=St[j.id];if(ht!=null&&String(ht).length>0)return String(ht);let yt=Ze.get(St.id)?.[j.id];return yt!=null&&String(yt).length>0?String(yt):"-"},Je)})},[c,Ot,Ze]),re=fn({appId:t,tableKey:o,title:n,columns:At,rows:xt,rowKey:"id",page:m,rowsPerPage:h,rowsPerPageOptions:f$1,count:p??xt.length,onPageChange:b$1,onRowsPerPageChange:C,showSummary:false,layout:I,onLayoutSave:N}),Ge=t?f(hn,{appId:t,tableKey:o,currentLayoutData:re.currentLayoutData,onLayoutLoad:re.handleLayoutLoad,targetLayoutId:re.layoutIdToLoad,activeLayoutId:re.currentLayoutId,serviceUrl:r}):null,Le=re.visibleRows;useEffect(()=>{let F=Oe.map(j=>j.id);Be(j=>{let ge=new Set(F),Te=j.filter(ht=>ge.has(ht)),Je=new Set(Te),qe=F.filter(ht=>!Je.has(ht)),St=[...Te,...qe];return St.length===j.length&&St.every((ht,mt)=>ht===j[mt])?j:St});},[Oe]),useEffect(()=>{w===void 0||!M||de.current!==w&&(de.current=w,re.handleVariantLoad(M));},[re,M,w]),useEffect(()=>{D?.(re.currentLayoutId);},[re.currentLayoutId,D]);let pe=F=>F.type==="group"?`group-${F.id}`:`row-${(F.data||F)?.id}`,xe=useMemo(()=>{let F=xt.map(mt=>nr(mt.startDate)),j=xt.map(mt=>nr(mt.endDate)),ge=g$1?nr(g$1):F.reduce((mt,yt)=>yt.isBefore(mt)?yt:mt,F[0]??nr()),Te=x?nr(x):j.reduce((mt,yt)=>yt.isAfter(mt)?yt:mt,j[0]??nr().add(30,"day")),Je=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",qe=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",St=d==="hour"?12:1,ht=d==="hour"?12:1;return {start:Wg(ge.subtract(St,Je),d),end:$g(Te.add(ht,qe),d)}},[xt,d,x,g$1]),oe=fc.find(F=>F.value===d)??fc[1],ye=Array.isArray(a)?a:a?[a]:[],Ne=useMemo(()=>Sw(xe.start,xe.end,d),[xe.end,xe.start,d]),je=Ne.length*oe.width,st=Ne.length>0?100/Ne.length:100,pt=Ne.length>0?`repeat(${Ne.length}, minmax(${oe.width}px, 1fr))`:"1fr",Bt=Ne.length>0?`calc(100% / ${Ne.length}) 100%`:"100% 100%",Xt=(re.columns||[]).filter(F=>re.visibleColumns.includes(F.id)).reduce((F,j)=>F+(re.columnWidths?.[j.id]||j.minWidth||100),0)+(re.grouping.length>0?72:0),Vt=H==="manual"&&V!==null?V:Xt,wt=q==="table",Wt=q==="timeline",ft=q==="timeline",Dt=q==="table",lt=!ft&&!Dt,Ft=()=>{let F=Y||W.current?.clientWidth||0;return F>0?Math.max(yc,F-Ra-yw):Math.max(yc,Xt)},Zt=F=>Math.min(Math.max(F,yc),Ft()),z=(()=>{if(Y<=0)return null;let F=lt?Ra:0;if(wt)return {tableWidth:Y,splitterWidth:F,timelineWidth:0};if(Wt)return {tableWidth:0,splitterWidth:F,timelineWidth:Y};if(H==="even"){let ge=Math.max(0,(Y-F)/2);return {tableWidth:ge,splitterWidth:F,timelineWidth:Math.max(0,Y-F-ge)}}let j=Zt(Vt);return {tableWidth:j,splitterWidth:F,timelineWidth:Math.max(0,Y-F-j)}})(),X=z?`${z.tableWidth}px ${z.splitterWidth}px ${z.timelineWidth}px`:wt?"minmax(0, 1fr) 0px 0px":Wt?"0px 0px minmax(0, 1fr)":H==="even"?`minmax(0, 1fr) ${Ra}px minmax(0, 1fr)`:`${Vt}px ${Ra}px minmax(0, 1fr)`;useEffect(()=>{H==="manual"&&Q(F=>F===null?null:Zt(F));},[H,Xt,Y]);let fe=F=>{F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),Z(null),B("manual"),we.current={startX:F.clientX,startWidth:ee.current?.getBoundingClientRect().width??Vt};let j=Te=>{let Je=we.current;if(!Je)return;let qe=Zt(Je.startWidth+Te.clientX-Je.startX);Q(qe);},ge=()=>{we.current=null,window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",ge),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",j),window.addEventListener("pointerup",ge);},Se=()=>{Z(null),B("even"),Q(null);},Ae=F=>!P||!F?false:It.get(F)?.reorderable!==false,$e=(F,j)=>{if(!F||!j||F===j||!Ae(F)||!Ae(j))return false;if(re.grouping.length===0)return true;let ge=It.get(F),Te=It.get(j);return !ge||!Te?false:re.grouping.every(Je=>ge[Je]===Te[Je])},Ke=(F,j)=>{if(!$e(F,j))return;let ge=Le.filter(Et=>Et.type!=="group").map(Et=>String((Et.data||Et)?.id)),Te=ge.indexOf(F),Je=ge.indexOf(j);if(Te<0||Je<0)return;let qe=[...ge];[qe[Te],qe[Je]]=[qe[Je],qe[Te]];let St=new Set(ge),ht=at.map(Et=>Et.id),mt=[...qe,...ht.filter(Et=>!St.has(Et))],yt=Ze.get(F),ro=Ze.get(j);if(re.setOrder("asc"),re.setOrderBy(""),Be(mt),yt&&ro){let{level:Et,...Yt}=yt,{level:Ht,...Ut}=ro,$t=mt.reduce((to,no)=>{let bo=Ze.get(no);if(bo){let{level:Mo,...Ro}=bo;to.push(Ro);}return to},[]);S?.($t,{activeTask:Yt,targetTask:Ut});}},Ye=(F,j)=>{if(!Ae(j.id)){F.preventDefault();return}F.stopPropagation(),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",j.id),We({activeId:j.id,overId:null}),y?.(Ze.get(j.id)||j);},ut=(F,j)=>{if(!$e(ve.activeId,j)){We(ge=>ge.overId===null?ge:{...ge,overId:null});return}F.preventDefault(),F.stopPropagation(),F.dataTransfer.dropEffect="move",We(ge=>ge.overId===j?ge:{...ge,overId:j});},gt=(F,j)=>{let ge=ve.activeId||F.dataTransfer.getData("text/plain");if(!$e(ge,j)){We({activeId:null,overId:null});return}F.preventDefault(),F.stopPropagation(),Ke(ge,j),We({activeId:null,overId:null});},Mt=()=>{We({activeId:null,overId:null});},bt=F=>{if(_.current)return;let j=F==="table"?ee.current:O.current,ge=F==="table"?O.current:ee.current;!j||!ge||(_.current=true,ge.scrollTop=j.scrollTop,window.requestAnimationFrame(()=>{_.current=false;}));};return useLayoutEffect(()=>{let F=W.current;if(!F){J(0);return}let j=0,ge=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(()=>{let Je=F.clientWidth;J(qe=>Math.abs(qe-Je)<.5?qe:Je);});};if(ge(),typeof ResizeObserver>"u")return window.addEventListener("resize",ge),()=>{window.cancelAnimationFrame(j),window.removeEventListener("resize",ge);};let Te=new ResizeObserver(ge);return Te.observe(F),window.addEventListener("resize",ge),()=>{window.cancelAnimationFrame(j),Te.disconnect(),window.removeEventListener("resize",ge);}},[xt.length]),useLayoutEffect(()=>{if(!v||Dt)return;let F=O.current,j=ee.current;if(!F)return;let ge=`row-${v}`,Te=Array.from(F.querySelectorAll("[data-planning-timeline-row-key]")).find(St=>St.dataset.planningTimelineRowKey===ge),Je=It.get(v);if(!Te||!Je)return;let qe=window.requestAnimationFrame(()=>{let St=F.getBoundingClientRect(),ht=Te.getBoundingClientRect(),mt=Math.max(1,F.clientHeight-ze),yt=F.scrollTop+ht.top-St.top-ze-(mt-ht.height)/2;_.current=true,F.scrollTop=Math.max(0,yt),j&&!ft&&(j.scrollTop=F.scrollTop);let ro=Math.max(1,F.scrollWidth),Et=Ne.length>0?ro/Ne.length:oe.width,Yt=Cc(nr(Je.startDate),Ne,Et),Ht=Math.max(0,Yt-Et);F.scrollLeft=Math.min(Ht,Math.max(0,ro-F.clientWidth)),window.requestAnimationFrame(()=>{_.current=false;});});return ()=>window.cancelAnimationFrame(qe)},[oe.width,ze,v,ft,It,Dt,Le,Ne]),useLayoutEffect(()=>{let F=ee.current;if(!F)return;let j=0,ge=0,Te=false,Je=()=>{if(Te)return;let Ht=F.querySelector("thead"),Ut=Array.from(F.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Ut.length===0)return;let $t=Ht?.getBoundingClientRect().height||bc,to={};Ut.forEach(no=>{let bo=no.dataset.ctableRowKey;bo&&(to[bo]=no.getBoundingClientRect().height);}),be(no=>Math.abs(no-$t)<.01?no:$t),he(no=>{let bo=Object.keys(no),Mo=Object.keys(to);return bo.length===Mo.length&&Mo.every(Ro=>Math.abs((no[Ro]??0)-to[Ro])<.01)?no:to});},qe=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(Je);};if(Je(),window.cancelAnimationFrame(ge),ge=window.requestAnimationFrame(()=>{ge=window.requestAnimationFrame(Je);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{Te||qe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",qe),()=>{Te=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(ge),window.removeEventListener("resize",qe);};let St=new ResizeObserver(qe),ht=F.querySelector("table"),mt=F.querySelector("tbody"),yt=F.querySelector("thead");ht&&St.observe(ht),yt&&St.observe(yt);let ro=new WeakSet,Et=()=>{F.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Ht=>{ro.has(Ht)||(St.observe(Ht),ro.add(Ht));});};Et();let Yt=null;return mt&&typeof MutationObserver<"u"&&(Yt=new MutationObserver(()=>{Et(),qe();}),Yt.observe(mt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",qe),()=>{Te=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(ge),St.disconnect(),Yt?.disconnect(),window.removeEventListener("resize",qe);}},[Le,re.visibleColumns,re.grouping,re.columnWidths]),g(De,{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 ${A.palette.divider}`,...k},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(vi,{value:re.filterText,onChange:F=>{re.setFilterText(F),re.setPage(0);}}),f(bi,{rowsPerPage:re.rowsPerPage,rowsPerPageOptions:f$1,page:re.page,count:re.totalDisplayCount,onRowsPerPageChange:re.setRowsPerPage,onPageChange:re.setPage}),ye.length>0&&f("div",{className:"orb-table-toolbar-custom",children:ye.map((F,j)=>f("div",{className:"orb-planning-extra-tool",children:F},`planning-extra-tool-${j}`))}),f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[f(ie,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:F=>re.setAnchorEl(F.currentTarget),sx:po,children:f(sn,{fontSize:"small"})}),f(ie,{className:"orb-table-tool-button",tooltip:"Group by",onClick:F=>re.setGroupAnchorEl(F.currentTarget),sx:po,children:f(xr,{fontSize:"small"})}),f(ie,{className:`orb-table-tool-button ${re.sortBy.length>0||re.orderBy?"orb-is-active":""}`,tooltip:"Sort by...",active:re.sortBy.length>0||!!re.orderBy,onClick:()=>U(true),sx:po,children:f(gp,{fontSize:"small"})})]}),Ge&&f("div",{className:"orb-table-tool-group",children:Ge}),f("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:f(_n,{"aria-label":"Planning pane layout",size:"small",value:q??(H==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:f(pi,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(mi,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:f(di,{fontSize:"small"})}],onValueChange:F=>{F==="split"?Se():Z(F);}})}),f("div",{className:"orb-table-tool-group orb-planning-scale-control",children:f(zt,{label:"",value:d,options:fc.map(F=>({value:F.value,label:F.label})),onChange:F=>u?.(F.target.value)})})]})]})}),xt.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:W,sx:{height:"100%",display:"grid",gridTemplateColumns:X,minWidth:0,transition:`grid-template-columns ${Gr}`},children:[f("div",{"data-planning-scroll-pane":"table",ref:ee,onScroll:()=>bt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:ft?0:1,transform:ft?"translateX(-10px)":"translateX(0)",pointerEvents:ft?"none":"auto",transition:`opacity ${Gr}, transform ${Gr}`},children:f(DndContext,{sensors:Re,collisionDetection:closestCenter,modifiers:[restrictToHorizontalAxis],onDragEnd:F=>{let j=F?.active?.id,ge=F?.over?.id;typeof j=="string"&&typeof ge=="string"&&re.handleColumnReorder(j,ge);},children:g("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:Xt,"& thead th":{height:bc,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[f(xi,{columns:re.columns,visibleColumns:re.visibleColumns,order:re.order,orderBy:re.orderBy,sortBy:re.sortBy,onRequestSort:re.handleRequestSort,onContextMenu:(F,j)=>{F.preventDefault(),F.stopPropagation(),nt({mouseX:F.clientX+2,mouseY:F.clientY-6,columnId:j});},grouping:re.grouping,isAllExpanded:re.isAllExpanded,handleToggleAll:re.handleToggleAll,columnWidths:re.columnWidths,onColumnResize:re.handleColumnResize,enableColumnReorder:true}),f(wi,{visibleRows:Le,columns:re.columns,visibleColumns:re.visibleColumns,selected:v?[v]:[],expandedGroups:re.expandedGroups,toggleGroupExpand:re.toggleGroupExpand,handleExpandGroupRecursively:re.handleExpandGroupRecursively,handleCollapseGroupRecursively:re.handleCollapseGroupRecursively,isGroupFullyExpanded:re.isGroupFullyExpanded,grouping:re.grouping,rowKeyProp:"id",page:re.page,rowsPerPage:re.rowsPerPage,emptyLabel:T,handleClick:(F,j)=>{y?.(Ze.get(j.id)||j);},getRowDataKey:({entry:F})=>pe(F),getGroupRowProps:()=>({style:{height:vc}}),getRowProps:({data:F})=>{let j=F,ge=Ae(j.id),Te=ve.activeId===j.id,Je=ve.overId===j.id&&$e(ve.activeId,j.id);return {draggable:ge,className:Je?"orb-is-drop-target":void 0,style:{cursor:Te?"grabbing":ge?"grab":y?"pointer":"default",height:vc,opacity:Te?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:qe=>Ye(qe,j),onDragOver:qe=>ut(qe,j.id),onDragEnter:qe=>ut(qe,j.id),onDrop:qe=>gt(qe,j.id),onDragEnd:Mt}}})]})})}),f("div",{onPointerDown:lt?fe:void 0,role:"separator","aria-orientation":"vertical",sx:{width:lt?Ra:0,cursor:lt?"col-resize":"default",opacity:lt?1:0,pointerEvents:lt?"auto":"none",borderLeft:lt?`1px solid ${A.palette.divider}`:"0 solid transparent",borderRight:lt?`1px solid ${A.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 ${Gr}, opacity ${Gr}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:A.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:lt?"col-resize":"default"}}}),f("div",{sx:{minWidth:0,overflow:"hidden",opacity:Dt?0:1,transform:Dt?"translateX(10px)":"translateX(0)",pointerEvents:Dt?"none":"auto",transition:`opacity ${Gr}, transform ${Gr}`},children:f("div",{"data-planning-scroll-pane":"timeline",ref:O,onScroll:()=>bt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:g("div",{sx:{width:"100%",minWidth:je||"100%"},children:[f("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:pt,height:ze,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`,position:"sticky",top:0,zIndex:2},children:Ne.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 ${A.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(se,{sx:{position:"relative"},children:Le.map(F=>{let j=pe(F),ge=le[j]??vc;if(F.type==="group")return f("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":j,sx:{position:"relative",height:ge,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`}},F.id);let Te=F.data||F,Je=nr(Te.startDate),qe=nr(Te.endDate),St=Cc(Je,Ne,st),ht=Cc(qe,Ne,st),mt=Math.max(0,ht-St),yt=zg(Te.progress),ro=Te.id===v,Et=Ae(Te.id),Yt=ve.activeId===Te.id,Ht=ve.overId===Te.id&&$e(ve.activeId,Te.id),Ut=Te.color??(Te.statusTone==="blocked"?A.palette.error.main:A.palette.primary.main);return f("div",{className:`orb-planning-timeline-row ${ro?"orb-is-selected":""}`,"data-planning-timeline-row-key":j,draggable:Et,onDragStart:$t=>Ye($t,Te),onDragOver:$t=>ut($t,Te.id),onDragEnter:$t=>ut($t,Te.id),onDrop:$t=>gt($t,Te.id),onDragEnd:Mt,onClick:()=>y?.(Ze.get(Te.id)||Te),sx:{position:"relative",height:ge,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`,opacity:Yt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:A.palette.primary.main,opacity:Ht?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:Bt,cursor:Yt?"grabbing":Et?"grab":y?"pointer":"default",transition:"opacity 120ms ease"},children:f(ct,{title:`${Te.title}: ${Je.format("MMM D HH:mm")} - ${qe.format("MMM D HH:mm")}`,children:g("div",{sx:{position:"absolute",left:`${St}%`,top:Math.max(8,(ge-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:ro?`2px solid ${A.palette.warning.main}`:"none",outlineOffset:2},children:[f("div",{sx:{height:"100%",width:`${yt}%`,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:Te.code})]})})},Te.id)})})]})})})]})}),f(dn,{groupAnchorEl:re.groupAnchorEl,setGroupAnchorEl:re.setGroupAnchorEl,grouping:re.grouping,setGrouping:re.setGrouping,columns:re.columns}),f(pn,{anchorEl:re.anchorEl,setAnchorEl:re.setAnchorEl,columns:re.columns,visibleColumns:re.visibleColumns,toggleColumnVisibility:re.toggleColumnVisibility}),f(Dp,{contextMenu:et,handleClose:()=>nt(null),columns:re.columns,visibleColumns:re.visibleColumns,grouping:re.grouping,summaryColumns:re.summaryColumns,showSummary:re.showSummary,sortBy:re.sortBy,orderBy:re.orderBy,order:re.order,onSortAsc:F=>{re.applyMultiSort([{field:F,direction:"asc"}]);},onSortDesc:F=>{re.applyMultiSort([{field:F,direction:"desc"}]);},onClearSort:F=>{let j=re.sortBy.filter(ge=>ge.field!==F);j.length>0?re.applyMultiSort(j):(re.clearMultiSort(),re.orderBy===F&&re.setOrderBy(""));},onHideColumn:F=>{re.visibleColumns.includes(F)&&re.toggleColumnVisibility(F);},onToggleGroup:F=>re.toggleGroupField(F),onToggleSummary:F=>re.toggleSummaryColumn(F),onOpenSortDialog:()=>U(true)}),f(Ap,{open:it,onClose:()=>U(false),columns:re.columns,initialRules:re.sortBy.length>0?re.sortBy:re.orderBy?[{field:re.orderBy,direction:re.order}]:[],onApply:F=>re.applyMultiSort(F),onClear:()=>{re.clearMultiSort(),re.setOrderBy("");}})]})};var yV=({filterProps:t,ganttProps:o,spacing:r=2,sx:n,children:a})=>{let i=n?[{height:"100%",overflow:"hidden"},n]:{height:"100%",overflow:"hidden"},s=o.sx?[{height:"100%"},o.sx]:{height:"100%"};return g(se,{spacing:r,sx:i,children:[f("div",{sx:{flexShrink:0},children:f(_o,{...t})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:f(_g,{...o,bodyHeight:o.bodyHeight??"100%",sx:s})}),a]})};var Gg=640,kw=360,Pw=360,Vs=8,En="220ms cubic-bezier(0.2, 0, 0, 1)",Sc=(t,o,r=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:r,hasChildren:i.length>0,parentIds:n}];return o.has(a.id)?[...s,...Sc(i,o,r+1,[...n,a.id])]:s}),Kg=t=>t.flatMap(o=>[o,...Kg(o.children??[])]),qg=(t,o=0,r=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:o,hasChildren:a.length>0,parentIds:r},...qg(a,o+1,[...r,n.id])]}),Xg=t=>t.flatMap(o=>{let r=o.children??[];return r.length===0?[]:[o.id,...Xg(r)]}),Ug=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(),NV=({title:t,subtitle:o,nodes:r,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:c,expandedNodeIds:d,defaultExpandedNodeIds:u,onExpandedNodeIdsChange:m,defaultPaneMode:h="split",minTreePaneWidth:f$1=kw,minDetailPaneWidth:p=Pw,tableAppId:b$1="ctree-comp",tableKey:C="default",tableTitle:g$1,filterConfig:x,searchQuery:v,searchToken:y,defaultRowsPerPage:P=-1,rowsPerPageOptions:S=[20,50,100,-1],serviceUrl:I,emptyLabel:M="No tree items available.",headerAction:w,sx:D,className:N})=>{let T=io(),k=useRef(null),A=useRef(null),L=useRef(null),[W,ee]=useState(s??r[0]?.id??null),[O,_]=useState(u??Xg(r).slice(0,3)),[V,Q]=useState(h),[H,B]=useState(Gg),[q,Z]=useState(0),[Y,J]=useState(0),[le,he]=useState(P),ze=useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:pe=>g(se,{spacing:.3,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:pe.label}),pe.subtitle&&f(E,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:pe.subtitle})]})}],[n]),be=useMemo(()=>new Set(d??O),[d,O]),Ce=useMemo(()=>Sc(r,be),[r,be]),Be=useMemo(()=>Kg(r),[r]),de=useMemo(()=>qg(r),[r]),ve=i===void 0?W:i,We=useMemo(()=>Be.find(pe=>pe.id===ve)??null,[ve,Be]),et=pe=>{let xe=A.current?.clientWidth??0,oe=xe>0?Math.max(f$1,xe-Vs-p):Math.max(f$1,pe);return Math.min(Math.max(pe,f$1),oe)},nt=V==="detail",it=V==="tree"||!a,U=V==="split"&&!!a,we=(()=>{if(q<=0)return null;if(V==="tree"||!a)return {treeWidth:q,splitterWidth:0,detailWidth:0};if(V==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:q};let pe=U?Vs:0,xe=et(H);return {treeWidth:xe,splitterWidth:pe,detailWidth:Math.max(0,q-pe-xe)}})(),Oe=we?`${we.treeWidth}px ${we.splitterWidth}px ${we.detailWidth}px`:V==="tree"||!a?"minmax(0, 1fr) 0px 0px":V==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${f$1}px, ${H}px) ${Vs}px minmax(${p}px, 1fr)`;useEffect(()=>{let pe=A.current;if(!pe){Z(0);return}let xe=0,oe=()=>{window.cancelAnimationFrame(xe),xe=window.requestAnimationFrame(()=>{let Ne=pe.clientWidth;Z(je=>Math.abs(je-Ne)<.5?je:Ne);});};if(oe(),typeof ResizeObserver>"u")return window.addEventListener("resize",oe),()=>{window.cancelAnimationFrame(xe),window.removeEventListener("resize",oe);};let ye=new ResizeObserver(oe);return ye.observe(pe),window.addEventListener("resize",oe),()=>{window.cancelAnimationFrame(xe),ye.disconnect(),window.removeEventListener("resize",oe);}},[]);let at=pe=>{d===void 0&&_(pe),m?.(pe);},Ze=pe=>{let xe=new Set(be);xe.has(pe)?xe.delete(pe):xe.add(pe),at(Array.from(xe));},xt=pe=>{i===void 0&&ee(pe.id),c?.(pe);};useEffect(()=>{J(0);},[r]),useEffect(()=>{let pe=v?.trim().toLowerCase();if(!pe)return;let xe=de.find(({node:pt})=>Ug(pt).includes(pe));if(!xe)return;let oe=new Set(be);xe.parentIds.forEach(pt=>oe.add(pt)),at(Array.from(oe)),xt(xe.node);let Ne=Sc(r,oe).findIndex(({node:pt})=>pt.id===xe.node.id);Ne>=0&&le>0&&J(Math.floor(Ne/le));let je=0,st=0;return je=window.requestAnimationFrame(()=>{st=window.requestAnimationFrame(()=>{let pt=k.current?.querySelector("tr.orb-selected"),Bt=pt?.closest(".orb-table-container");if(pt&&Bt){let Xt=Bt.getBoundingClientRect(),Vt=pt.getBoundingClientRect(),wt=Vt.top-Xt.top+Bt.scrollTop;Bt.scrollTo({top:wt-Bt.clientHeight/2+Vt.height/2,behavior:"smooth"});return}pt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(je),window.cancelAnimationFrame(st);}},[v,y,de,r,le]);let It=useMemo(()=>Ce.map(({node:pe,level:xe,hasChildren:oe})=>({...pe,id:pe.id,__node:pe,__level:xe,__hasChildren:oe,__expanded:be.has(pe.id),__searchText:Ug(pe)})),[be,Ce]),Ot=useMemo(()=>ze.map((pe,xe)=>({id:pe.id,label:pe.label,minWidth:typeof pe.width=="number"?pe.width:pe.minWidth??(xe===0?320:120),numeric:pe.numeric??pe.align==="right",render:(oe,ye)=>{let Ne=ye.__node,je=pe.render?pe.render(Ne):Ne[pe.id];if(xe!==0)return f(Ie,{sx:{minWidth:0,color:pe.align==="right"?"text.primary":"text.secondary",fontWeight:pe.align==="right"?750:500,textAlign:pe.align??"left"},children:je});let st=Number(ye.__level??0),pt=!!ye.__hasChildren,Bt=!!ye.__expanded;return g(se,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${st*24}px`},children:[f(ie,{tooltip:pt?Bt?"Collapse":"Expand":"",onClick:Xt=>{Xt.stopPropagation(),pt&&Ze(Ne.id);},disabled:!pt,sx:{width:24,height:24,visibility:pt?"visible":"hidden",transform:Bt?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:f($o,{sx:{fontSize:20}})}),f(Ie,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:Ne.markerColor??T.palette.primary.main}}),f(Ie,{sx:{minWidth:0},children:je})]})}})),[ze,be,T.palette.primary.main]),At=pe=>{if(!U)return;pe.preventDefault(),pe.currentTarget.setPointerCapture(pe.pointerId),L.current={startX:pe.clientX,startWidth:H};let xe=ye=>{let Ne=L.current;Ne&&B(et(Ne.startWidth+ye.clientX-Ne.startX));},oe=()=>{L.current=null,window.removeEventListener("pointermove",xe),window.removeEventListener("pointerup",oe),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",xe),window.addEventListener("pointerup",oe);},re=()=>{let pe=A.current?.clientWidth??0,xe=pe>0?Math.max(f$1,(pe-Vs)/2):Gg;Q("split"),B(et(xe));},Ge=()=>a?typeof a=="function"?a(We):a:null,Le=a?f(_n,{"aria-label":"Tree pane layout",value:V,options:[{value:"tree",label:"Expand tree",icon:f(pi,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(mi,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:f(di,{fontSize:"small"})}],onValueChange:pe=>{pe==="split"?re():Q(pe);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return g(Ie,{ref:k,className:["ctree_comp",N].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)}`,...D},children:[Le,g(Ie,{ref:A,sx:{height:"100%",display:"grid",gridTemplateColumns:Oe,transition:`grid-template-columns ${En}`,minWidth:0},children:[g(Ie,{"aria-hidden":nt?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:nt?0:1,transform:nt?"translateX(-12px)":"translateX(0)",pointerEvents:nt?"none":"auto",transition:`opacity ${En}, transform ${En}`,willChange:"opacity, transform"},children:[g(se,{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(se,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[f(xr,{sx:{color:"primary.main",fontSize:28}}),g(Ie,{sx:{minWidth:0},children:[f(E,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),o&&f(E,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:o})]})]}),w!==void 0?w:f(ie,{tooltip:"Add node",color:"default",children:f(Br,{fontSize:"small"})})]}),g(Ie,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[f(tr,{appId:b$1,tableKey:C,title:g$1??(typeof t=="string"?t:"Tree"),columns:Ot,rows:It,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:ve?[ve]:[],onSelectionChange:pe=>{let xe=pe[pe.length-1],oe=Be.find(ye=>ye.id===xe);oe&&xt(oe);},page:Y,rowsPerPage:le,rowsPerPageOptions:S,count:It.length,onPageChange:J,onRowsPerPageChange:pe=>{J(0),he(pe);},filterConfig:x,serviceUrl:I,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),It.length===0&&f(Ie,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:M})]})]}),f(Ie,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:U?At:void 0,sx:{width:"100%",cursor:U?"col-resize":"default",backgroundColor:U?tt(T.palette.text.primary,b()==="dark"?.16:.08):"transparent",opacity:U?1:0,pointerEvents:U?"auto":"none",position:"relative",transition:`opacity ${En}, background-color 120ms ease`,"&:hover":{backgroundColor:U?tt(T.palette.primary.main,b()==="dark"?.35:.18):"transparent"}}}),g(Ie,{"aria-hidden":it?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:it?0:1,transform:it?"translateX(12px)":"translateX(0)",pointerEvents:it?"none":"auto",transition:`opacity ${En}, transform ${En}`,willChange:"opacity, transform"},children:[f(Ie,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:f(Rt,{sx:{width:"100%"}})}),f(Ie,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:Ge()})]})]})]})};var Rw={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)"}}},OV=({children:t,transitionKey:o,variant:r="fade",durationMs:n=220,delayMs:a=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:c})=>{let d=Cr("(prefers-reduced-motion: reduce)"),[u,m]=useState("to"),h=!s&&!d&&r!=="none";useEffect(()=>{if(!h){m("to");return}m("from");let b=requestAnimationFrame(()=>{b=requestAnimationFrame(()=>{m("to");});});return ()=>cancelAnimationFrame(b)},[o,h]);let f$1=Rw[r],p=useMemo(()=>h?u==="from"?f$1.from:f$1.to:{opacity:1,transform:"none"},[h,u,f$1.from,f$1.to]);return f(Ie,{sx:{willChange:h?"opacity, transform":"auto",transition:h?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...p,...c},children:t})},FV={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};export{s5 as AIBrowserGlow,Nc as Activity,_m as AgentPanel,Na as AlertCircle,Dc as AlertTriangle,jw as ArrowDown,Jw as ArrowRight,Ac as ArrowUp,_s as BarChart,e0 as Bot,js as Button,Ty as CAINavProvider,on as CAlert,Vp as CAmapChart,Ki as CAppHeader,El as CAppHeaderSearch,TE as CAppPageLayout,A5 as CAuthPage,tn as CAvatar,Ua as CBadge,oa as CBarChart,Pe as CButton,Un as CCalendar,tu as CCardDetailPanel,ru as CCardGrid,Ob as CCardGridCard,oD as CCardPage,Pi as CChartCard,Tt as CCheckbox,Ct as CChip,Op as CComboChart,$p as CCustomizeAgent,jh as CDatePicker,kA as CDetailInfoPage,pu as CDetailSearchAiBar,Wi as CDetailSectionCard,Lt as CDialog,Rt as CDivider,ef as CFileUpload,BT as CFilterField,Bp as CFishboneChart,zp as CGoogleMapChart,Wp as CGraphCharts,Ep as CGraphKpiCards,Ri as CGraphReport,Fp as CHeatmapChart,ie as CIconButton,jA as CKanbanBoard,fu as CKanbanBucket,Il as CKanbanCard,Qp as CLayoutManagement,hn as CLayoutManager,Lp as CLineChart,MT as CList,RT as CListItem,LT as CListItemAvatar,NT as CListItemButton,DT as CListItemIcon,AT as CListItemText,ET as CListSubheader,Qt as CMenu,Qn as CMessageBox,ys as CMetricChartCard,fi as CPageLayout,OV as CPageTransition,De as CPaper,Ti as CPieChart,gO as CPivotTable,_g as CPlanningGantt,yV as CPlanningLayout,Zs as CPopover,$n as CProgress,kh as CRadioGroup,_n as CSegmentedControl,zt as CSelect,Dh as CSkeleton,_o as CSmartFilter,xN as CSmartTable,Yo as CSpinner,se as CStack,MN as CStandardPage,PT as CStatusBadge,Ga as CSwitch,tr as CTable,fN as CTableBody,bN as CTableCell,vN as CTableContainer,yN as CTableHead,CN as CTableRow,Xh as CTabs,Wn as CTextArea,He as CTextField,ct as CTooltip,NV as CTreeComp,E as CTypography,kp as CValueHelp,Ei as CVariantManagement,Kp as CVariantManager,_l as CVoiceWaveOverlay,Hp as CWaterfallChart,Gs as Calendar,t0 as CalendarDays,o0 as Camera,r0 as ChartNoAxesCombined,wo as Check,Da as CheckCircle,Ho as ChevronDown,Aa as ChevronLeft,zo as ChevronRight,n0 as ChevronUp,a0 as ChevronsDown,i0 as ChevronsUp,Ea as CircleAlert,Fn as CircleCheck,s0 as CircleCheckBig,Us as CircleStop,Ec as Clipboard,l0 as ClipboardCheck,c0 as ClipboardList,Lc as Clock,la as CodeBlock,d0 as Columns3,n5 as CopilotChat,Ao as Copy,p0 as CopyPlus,u0 as Delete,Bn as Download,Oc as Edit,Fc as Expand,m0 as Eye,g0 as EyeOff,La as File,Bc as FileText,h0 as Filter,Yz as FloatingAgentPanel,Hn as FolderTree,Hc as GitBranch,CT as GlobalMessage,zn as Globe,zc as Grid,f0 as GripVertical,b0 as Hammer,Vc as Image,Oa as Info,xa as InputArea,v0 as Languages,y0 as Layers,C0 as LayoutDashboard,Fa as Lightbulb,Wc as LineChart,$c as Loader2,Ba as Lock,x0 as LockKeyhole,_c as LogOut,vs as METRIC_CHART_TYPES,Ks as Mail,Gc as MapPin,pa as MarkdownRenderer,ca as MathBlock,Uc as Menu,yl as MermaidBlock,sh as MessageCircle,Kc as MessageSquare,Ha as Mic,w0 as MicOff,qc as Moon,S0 as MoreHorizontal,md as NavigationIsland,tl as NavigationIsland2,Kx as OMPHApprovalCard,qx as OMPHInitial,Az as OMPHPanel,qn as ORBCAFE_I18N_MESSAGES,Yg as ORB_DARK,Dw as ORB_FONT_STACK,Zg as ORB_LIGHT,Ew as ORB_RADIUS,Ws as ORB_TOKENS,Lw as ORB_TRANSITION_FAST,Xa as OrbcafeI18nProvider,On as OrbisModeProvider,FV as PAGE_TRANSITION_PRESETS,WF as PAppPageLayout,AO as PBarcodeScanner,pm as PNavIsland,qO as PNumericKeypad,im as PSmartFilter,by as PTable,zO as PTouchCard,sm as PWorkloadNav,k0 as PackageCheck,P0 as PackageSearch,za as PanelLeftOpen,Va as PanelRight,T0 as PanelsTopLeft,Xc as PieChart,jr as Pin,Qu as PivotChartPanel,I0 as Play,Jr as Plus,M0 as QrCode,R0 as ReceiptText,Wa as RefreshCw,N0 as Rocket,D0 as RotateCcw,Zc as RotateCw,A0 as Rows3,Pt as SapIcon,E0 as Save,L0 as ScanLine,Vo as Search,lh as Send,Yc as SendHorizontal,en as Settings,O0 as ShieldCheck,F0 as Sigma,B0 as SortAsc,H0 as SquareSplitHorizontal,z0 as Star,Wm as StdChat,Qc as Sun,V0 as Table2,xl as TableBlock,W0 as TabletSmartphone,Vn as Terminal,zi as ThinkBlock,jc as ThumbsDown,Jc as ThumbsUp,ed as Trash2,Xn as TreeMenu,$0 as TreePine,td as TrendingDown,$a as TriangleAlert,_0 as Truck,od as UploadCloud,qs as User,jF as VoiceNavigatorProvider,KF as VoiceWaveOverlay,rd as Volume2,G0 as Warehouse,U0 as Workflow,Kt as X,_a as XCircle,bu as addKanbanBucket,Ii as buildAmapEmbedUrl,ra as buildGoogleMapEmbedUrl,uR as buildGoogleMapIframe,af as buttonVariants,yu as createKanbanBoardModel,ae as createSapIcon,Uo as findKanbanCard,uT as message,sr as messageManager,Gi as moveKanbanCard,ic as omphApprovalLabelsFromI18n,wa as omphLabelsFromI18n,tt as orbAlpha,Aw as orbChartSeries,Hi as parseMarkdownTable,oc as parseOmphFileHref,vu as renameKanbanBucket,YD as renderMarkdown,Fi as resolveVariantFilters,Bi as resolveVariantLayout,Iy as useAINav,fD as useAmapEmbedUrl,S5 as useAuthPage,sD as useCardPage,mu as useDetailInfo,hD as useGoogleMapEmbedUrl,dD as useGraphChartData,Di as useGraphInteraction,un as useGraphReport,rE as useKanbanBoard,Do as useMediaQuery,yd as useNavigationIsland,ho as useOrbMode,$s as useOrbTokens,ce as useOrbcafeI18n,SO as usePadLayout,TO as usePadRecordEditor,Tu as usePageLayout,yO as usePivotTable,Bg as usePlanningGantt,V5 as usePlanningLayout,LN as useStandardReport,xn as useVoiceInput,JF as useVoiceNavigator};
|