orbcafe-ui 3.1.4 → 3.1.8
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 +119 -9
- package/dist/index.d.ts +119 -9
- package/dist/index.js +22 -21
- package/dist/index.mjs +20 -19
- package/dist/orbis.css +313 -7
- 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 Do from'@radix-ui/react-dropdown-menu';import*as Xo from'@radix-ui/react-tooltip';import {createPortal}from'react-dom';import*as So from'@radix-ui/react-dialog';import*as br from'@radix-ui/react-popover';import or from'dayjs';import Df 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 Gh from'dayjs/plugin/isBetween';import Uh 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 Zv from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import Jy from'react-markdown';import eC from'remark-gfm';import tC from'remark-math';import oC from'rehype-katex';import rC 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 Mx from'dayjs/plugin/isoWeek';var Ig={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"},Mg={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"},Is={light:Ig,dark:Mg},qx='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',Xx=t=>{let o=Is[t];return [o.primary,o.p300,o.muted,o.p700]},Yx=10,Zx="0.2s ease";var dc=createContext({mode:"light",setting:"light"}),Ag=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;},An=({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)"),f=()=>i(m.matches?"dark":"light");return f(),m.addEventListener("change",f),()=>m.removeEventListener("change",f)},[]);let d=n==="system"?s?a:"light":n;useEffect(()=>{Ag(d);},[d]);let u=useMemo(()=>({mode:d,setting:n}),[d,n]);return f(dc.Provider,{value:u,children:r})},yo=()=>useContext(dc).mode,Ms=()=>Is[yo()];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 Og={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},Fg=t=>typeof t=="number"?`${t}px`:t,Bg={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},Hg=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?Bg[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=Fg(o??Hg(n)??"1em"),f$1={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:f$1,...l,children:String.fromCodePoint(Og[t])})});Pt.displayName="SapIcon";var re=(t,o)=>{let r=forwardRef((n,a)=>f(Pt,{ref:a,name:t,...n}));return r.displayName=o??`SapIcon(${t})`,r};var uc=re("activity","Activity"),Ca=re("error","AlertCircle"),mc=re("warning","AlertTriangle"),g0=re("down","ArrowDown"),f0=re("navigationRight","ArrowRight"),gc=re("up","ArrowUp"),Rs=re("barChart","BarChart"),h0=re("activate","Bot"),Ds=re("calendar","Calendar"),b0=Ds,v0=re("camera","Camera"),y0=re("lineChart","ChartNoAxesCombined"),Ko=re("accept","Check"),xa=re("accept","CheckCircle"),Oo=re("slimDown","ChevronDown"),Sa=re("navigationLeft","ChevronLeft"),Fo=re("navigationRight","ChevronRight"),C0=re("slimUp","ChevronUp"),x0=re("expandAll","ChevronsDown"),S0=re("collapseAll","ChevronsUp"),wa=re("error","CircleAlert"),En=re("accept","CircleCheck"),w0=En,fc=re("stop","CircleStop"),hc=re("copy","Clipboard"),k0=re("checklist","ClipboardCheck"),P0=re("checklist","ClipboardList"),bc=re("time","Clock"),T0=re("tableColumn","Columns3"),hr=re("copy","Copy"),I0=re("duplicate","CopyPlus"),M0=re("delete","Delete"),vc=re("download","Download"),yc=re("edit","Edit"),Cc=re("fullScreen","Expand"),R0=re("show","Eye"),D0=re("hide","EyeOff"),ka=re("document","File"),xc=re("document","FileText"),N0=re("filter","Filter"),Ln=re("tree","FolderTree"),Sc=re("process","GitBranch"),On=re("world","Globe"),wc=re("grid","Grid"),A0=re("move","GripVertical"),E0=re("wrench","Hammer"),kc=re("picture","Image"),Pa=re("information","Info"),L0=re("translate","Languages"),O0=re("dimension","Layers"),F0=re("home","LayoutDashboard"),Ta=re("lightbulb","Lightbulb"),Pc=re("lineChart","LineChart"),Tc=re("synchronize","Loader2"),Ia=re("locked","Lock"),B0=Ia,Ic=re("log","LogOut"),Ns=re("email","Mail"),Mc=re("map","MapPin"),Rc=re("menu","Menu"),zg=re("message","MessageCircle"),Dc=zg,Ma=re("microphone","Mic"),H0=re("microphone","MicOff"),Nc=re("darkMode","Moon"),z0=re("overflow","MoreHorizontal"),V0=re("accept","PackageCheck"),W0=re("product","PackageSearch"),Ra=re("splitOne","PanelLeftOpen"),Da=re("splitTwo","PanelRight"),$0=re("overview","PanelsTopLeft"),Ac=re("pieChart","PieChart"),Qr=re("pushpin","Pin"),_0=re("play","Play"),jr=re("add","Plus"),G0=re("qrCode","QrCode"),U0=re("receipt","ReceiptText"),Na=re("refresh","RefreshCw"),K0=re("activate","Rocket"),q0=re("refresh","RotateCcw"),Ec=re("refresh","RotateCw"),X0=re("tableRow","Rows3"),Y0=re("save","Save"),Z0=re("qrCode","ScanLine"),Bo=re("search","Search"),Vg=re("paperPlane","Send"),Lc=Vg,Jr=re("wrench","Settings"),Q0=re("accept","ShieldCheck"),j0=re("sum","Sigma"),J0=re("sort","SortAsc"),eS=re("splitTwo","SquareSplitHorizontal"),tS=re("favorite","Star"),Oc=re("lightMode","Sun"),oS=re("table","Table2"),rS=re("ipad","TabletSmartphone"),Fn=re("command","Terminal"),Fc=re("thumbDown","ThumbsDown"),Bc=re("thumbUp","ThumbsUp"),Hc=re("delete","Trash2"),nS=re("tree","TreePine"),zc=re("trendDown","TrendingDown"),Aa=re("warning","TriangleAlert"),aS=re("shipping","Truck"),Vc=re("upload","UploadCloud"),As=re("employee","User"),Wc=re("sound","Volume2"),iS=re("factory","Warehouse"),sS=re("process","Workflow"),Yt=re("decline","X"),Ea=re("error","XCircle");var $g={contained:"primary",outlined:"secondary",text:"ghost"},_g={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:f$1,type:h="button",...p},v)=>{let y=$g[t]??t,g$1=["orb-btn",`orb-btn-${y}`,_g[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"?h:void 0,href:l,className:x.className,style:x.style,disabled:b==="button"?f$1||n:void 0,"aria-disabled":b!=="button"&&(f$1||n)?true:void 0,...p,children:[n&&f("span",{className:`orb-spin ${y==="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:f$1,autoFocus:h,autoComplete:p,name:v,id:y,error:g$1,helperText:x,dense:b=false,size:C,fullWidth:k=true,select:w=false,multiline:P=false,rows:I,children:S,variant:N,margin:M,onClick:T,startAdornment:D,endAdornment:A,InputProps:L,inputProps:O,InputLabelProps:_,SelectProps:F,sx:X,className:V},Z)=>{let z=useId(),H=y??`orb-tf-${z}`,U=D??L?.startAdornment,K=A??L?.endAdornment,ie=(typeof g$1=="string"?g$1:void 0)??x,xe={id:H,className:`orb-inp ${b||C==="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:f$1,autoFocus:h,autoComplete:p,name:v,onClick:T,"aria-invalid":!!g$1},We=w?f("select",{...xe,ref:Z,onChange:n,children:S}):P?f("textarea",{...xe,ref:Z,onChange:n,rows:I,readOnly:m||L?.readOnly}):f("input",{...xe,ref:Z,onChange:n,type:l,readOnly:m||L?.readOnly,...O}),we=d(X,`orb-fld ${g$1?"orb-is-error":""} ${V??""}`,{width:k?"100%":void 0});return g("div",{className:we.className,style:we.style,children:[t&&f("label",{htmlFor:H,children:t}),U||K?g("div",{className:"orb-inp-adornment-wrap",children:[U&&f("span",{className:"orb-inp-adornment",children:U}),K&&f("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:K}),We]}):We,ie&&f("span",{className:"orb-fld-msg",children:ie})]})});He.displayName="CTextField";var Bn=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:f$1,fullWidth:h=true,name:p,id:v,inputProps:y,sx:g$1,className:x},b)=>{let C=useId(),k=v??`orb-ta-${C}`,P=(typeof m=="string"?m:void 0)??f$1,I=d(g$1,`orb-fld ${m?"orb-is-error":""} ${x??""}`,{width:h?"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,...y}),P&&f("span",{className:"orb-fld-msg",children:P})]})});Bn.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:f$1,displayEmpty:h,renderValue:p,multiple:v,MenuProps:y,variant:g$1,disableUnderline:x,onClick:b,onMouseDown:C,error:k,helperText:w,name:P,id:I,"aria-label":S,sx:N,className:M},T)=>{let D=useId(),A=I??`orb-sel-${D}`,O=(typeof k=="string"?k:void 0)??w,_=useRef(null),F=useRef(null),[X,V]=useState(false),[Z,z]=useState(180),[H,U]=useState(a??"");useImperativeHandle(T,()=>_.current);let K=useMemo(()=>Children.toArray(r).flatMap(Ie=>{if(!isValidElement(Ie)||Ie.type!=="option")return [];let ke=Ie;return [{value:Array.isArray(ke.props.value)?ke.props.value[0]??"":ke.props.value??"",label:ke.props.children,disabled:ke.props.disabled}]}),[r]),ge=o??K,ie=n??H,pe=Array.isArray(ie)?ie[0]??"":ie,xe=String(pe??""),We=ge.find(Ie=>String(Ie.value)===xe),we=p?p(ie):We?.label??(xe||(f$1??"")),se=d(N,`orb-fld ${k?"orb-is-error":""} ${M??""}`,{width:u?"100%":void 0,minWidth:typeof m=="number"?`${m}px`:m});if(v)return g("div",{className:se.className,style:se.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:C,"aria-invalid":!!k,"aria-label":S,children:[f$1!==void 0&&f("option",{value:"",children:f$1}),o?o.map(Ie=>f("option",{value:Ie.value,disabled:Ie.disabled,children:Ie.label},Ie.value)):r]}),O&&f("span",{className:"orb-fld-msg",children:O})]});let Ae=Ie=>{n===void 0&&U(Ie);let ke=_.current;ke&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(ke,Ie),i?.({target:ke,currentTarget:ke}));};return g("div",{className:se.className,style:se.style,children:[t&&f("label",{htmlFor:A,children:t}),f("select",{ref:_,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:P,value:xe,disabled:s,onChange:()=>{},children:ge.map(Ie=>f("option",{value:Ie.value,disabled:Ie.disabled,children:Ie.label},String(Ie.value)))}),g(Do.Root,{open:X,onOpenChange:Ie=>{Ie&&z(F.current?.getBoundingClientRect().width??180),V(Ie);},children:[f(Do.Trigger,{asChild:true,children:g("button",{ref:F,id:A,type:"button",className:`orb-inp orb-select-trigger ${d$1||l==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!k,"aria-label":S,"aria-haspopup":"listbox","data-placeholder":!We&&!xe?"":void 0,onClick:b,onMouseDown:C,children:[f("span",{className:"orb-select-value",children:we}),f(Pt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),f(Do.Portal,{children:f(Do.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:Z},children:f(Do.RadioGroup,{value:xe,onValueChange:Ae,children:ge.map(Ie=>g(Do.RadioItem,{className:"orb-select-option",value:String(Ie.value),disabled:Ie.disabled,children:[f("span",{className:"orb-select-check","aria-hidden":"true",children:String(Ie.value)===xe?f(Pt,{name:"accept",size:13}):null}),f("span",{children:Ie.label})]},String(Ie.value)))})})})]}),O&&f("span",{className:"orb-fld-msg",children:O})]})});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:f$1,inputProps:h,sx:p,className:v},y)=>{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 y=="function"?y(b):y&&(y.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:f$1,...h});return t==null?f("span",{className:g$1.className,style:g$1.style,children:x}):g("label",{className:g$1.className,style:g$1.style,children:[x,f("span",{children:t})]})});Tt.displayName="CCheckbox";var of=({label:t,options:o,value:r,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:u})=>{let m=useId(),f$1=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(h=>g("label",{className:"orb-rdo",children:[f("input",{type:"radio",name:f$1,value:h.value,checked:r!==void 0?r===h.value:void 0,defaultChecked:n!==void 0?n===h.value:void 0,onChange:a?p=>a(p,h.value):void 0,disabled:l||h.disabled}),f("span",{children:h.label})]},h.value))})]})};var La=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,name:i,id:s,size:l,sx:d$1,className:u},m)=>{let f$1=d([{...l==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],`orb-sw ${u??""}`),h=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:f$1.className,style:f$1.style,children:h}):g("label",{className:f$1.className,style:f$1.style,children:[h,f("span",{children:t})]})});La.displayName="CSwitch";var af={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:f$1,className:h},p)=>{let v=r??(a==="outlined"&&n==="default"?"outline":af[n]??"gray"),y=s??!!m,g$1=d([{cursor:y?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(f$1)?f$1:f$1?[f$1]:[]],`orb-chip orb-chip-${v} ${h??""}`);return g("span",{ref:p,className:g$1.className,style:g$1.style,onClick:m,role:y?"button":void 0,tabIndex:y?0:void 0,onKeyDown:y?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(Yt,{size:13,strokeWidth:2})})]})});Ct.displayName="CChip";var Oa=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})});Oa.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 Hn=({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%; } }"})]})},df=({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}}),qo=({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(Xo.Provider,{delayDuration:r,skipDelayDuration:200,children:g(Xo.Root,{children:[f(Xo.Trigger,{asChild:true,children:o}),f(Xo.Portal,{children:f(Xo.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});var ne=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 f$1=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??""}`),h=f("button",{ref:m,type:d$1,className:f$1.className,style:f$1.style,...u,children:l});return t?f(lt,{title:t,children:h}):h});ne.displayName="CIconButton";var zn=({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 y=o.map((b,C)=>b.disabled?-1:C).filter(b=>b>=0);if(y.length===0)return;let g=y.indexOf(v),x;p.key==="Home"&&(x=y[0]),p.key==="End"&&(x=y[y.length-1]),(p.key==="ArrowRight"||p.key==="ArrowDown")&&(x=y[(g+1+y.length)%y.length]),(p.key==="ArrowLeft"||p.key==="ArrowUp")&&(x=y[(g-1+y.length)%y.length]),x!==void 0&&(p.preventDefault(),l.current[x]?.focus(),r(o[x].value));},f$1=d(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),h={...f$1.style,"--orb-segmented-count":Math.max(o.length,1),"--orb-segmented-index":Math.max(u,0)};return g("div",{role:"radiogroup",className:f$1.className,style:h,"data-has-selection":u>=0?"true":"false",...s,children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),o.map((p,v)=>{let y=p.value===t;return f(ne,{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":y,"data-selected":y?"true":void 0,disabled:p.disabled,tabIndex:y||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 Zt=({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:f$1})=>{let h=useRef(null);if(useEffect(()=>{if(i!==true)return;let p=y=>{let g=y.composedPath();h.current&&g.includes(h.current)||a&&g.includes(a)||s?.();},v=y=>{y.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",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,y=p?.left??16,g=p?.right??y,x=d$1?.paper?.sx??u?.sx,b=d([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(f$1)?f$1:f$1?[f$1]:[]],"orb-pop orb-menu",d$1?.paper?.style??u?.style),C=Children.map(l,k=>{if(!isValidElement(k)||k.type!=="option")return k;let w=k.props,{children:P,disabled:I,selected:S}=w,N=d(w.sx,`orb-menu-item ${S?"orb-selected":""} ${w.className??""}`,w.style);return f("div",{role:"menuitem","aria-disabled":I||void 0,"aria-selected":S||void 0,tabIndex:I?-1:0,id:w.id,title:w.title,className:N.className,style:N.style,onClick:I?void 0:w.onClick,onKeyDown:M=>{!I&&(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),w.onClick?.(M));},children:P})});return createPortal(f("div",{ref:h,role:"menu",className:b.className,style:{...b.style,position:"fixed",left:n==="end"&&!m?void 0:m?.left??y,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:C}),document.body)}return g(Do.Root,{children:[f(Do.Trigger,{asChild:true,children:r??f(Se,{variant:"primary",children:t})}),f(Do.Portal,{children:f(Do.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:o.map((p,v)=>g(Do.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 xf={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"},Sf={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},f$1)=>{let h=o??Sf[t]??"span",v=[t==="inherit"?void 0:xf[t],d$1].filter(Boolean).join(" "),y=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(h,{ref:f$1,className:y.className,style:y.style,...m,children:u})});E.displayName="CTypography";var kf=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},ae=forwardRef(({direction:t="column",spacing:o,alignItems:r,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:l,className:d$1,children:u,...m},f$1)=>{let h=d([{display:"flex",flexDirection:t,gap:kf(o),alignItems:r,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(l)?l:l?[l]:[]],d$1);return f("div",{ref:f$1,className:h.className,style:h.style,...m,children:u})});ae.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:f$1,hideCloseButton:h=false,sx:p,className:v})=>{let y=d([{width:l?"100vw":s?"min(920px, calc(100vw - 32px))":void 0,height:l?"100vh":void 0,maxWidth:l?"none":typeof i=="number"?`${i}px`:i},...Array.isArray(d$1?.sx??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(So.Root,{open:t,onOpenChange:g=>{g||o?.();},children:g(So.Portal,{children:[f(So.Overlay,{className:"orb-overlay"}),g(So.Content,{className:y.className,style:y.style,children:[(r||!h)&&g("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[r?f(So.Title,{className:"orb-dialog-title",children:r}):f(So.Title,{className:"orb-visually-hidden",children:"Dialog"}),!h&&f(So.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(Yt,{size:16,strokeWidth:2})})})]}),f("div",{style:{minWidth:0},children:n}),a&&f("div",{className:"orb-dialog-actions",children:a})]})]})})};var Ls=({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:f=>f.preventDefault(),children:a})})]});var If=({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([]),f$1=p=>{s||d(p),n?.(p);},h=p=>{if(p.key!=="ArrowRight"&&p.key!=="ArrowLeft")return;p.preventDefault();let v=t.filter(b=>!b.disabled),y=v.findIndex(b=>b.value===u),g=p.key==="ArrowRight"?1:-1,x=v[(y+g+v.length)%v.length];if(x){f$1(x.value);let b=t.findIndex(C=>C.value===x.value);m.current[b]?.focus();}};return f("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:h,children:t.map((p,v)=>{let y=p.value===u;return g("button",{ref:g=>{m.current[v]=g;},type:"button",role:"tab","aria-selected":y,disabled:p.disabled,className:`orb-tab ${y?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>f$1(p.value),children:[p.icon,p.label]},p.value)})})};var Rf=["su","mo","tu","we","th","fr","sa"],Vn=(t,o)=>!!(t&&o&&t.isSame(o,"day")),Wn=({value:t,rangeStart:o,rangeEnd:r,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:l,maxDate:d,locale:u,renderDay:m})=>{let f$1=a!==void 0,[h,p]=useState(()=>i??t??o??or()),v=(f$1?a:h).startOf("month"),y=w=>{f$1||p(w),s?.(w);},g$1=useMemo(()=>u?v.locale(u):v,[v,u]),x=useMemo(()=>{let P=v.startOf("month").startOf("week"),I=[],S=P;for(let N=0;N<6;N+=1){let M=[];for(let T=0;T<7;T+=1)M.push(S),S=S.add(1,"day");if(I.push(M),S.isAfter(v.endOf("month"))&&N>=3)break}return I},[v]),b=useMemo(()=>{let w=u?or().locale(u):or();return Rf.map((P,I)=>w.startOf("week").add(I,"day").format("dd"))},[u]),C=w=>!!(l&&w.isBefore(l.startOf("day"))||d&&w.isAfter(d.startOf("day"))),k=o!==void 0||r!==void 0;return g("div",{className:"orb-cal",children:[g("div",{className:"orb-cal-head",children:[f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>y(v.subtract(1,"month")),children:f(Sa,{size:16,strokeWidth:2})}),f("span",{className:"orb-cal-title","aria-live":"polite",children:g$1.format("MMMM YYYY")}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>y(v.add(1,"month")),children:f(Fo,{size:16,strokeWidth:2})})]}),g("div",{className:"orb-cal-grid",role:"grid",children:[b.map((w,P)=>f("span",{className:"orb-cal-dow",children:w},`${w}-${P}`)),x.flat().map(w=>{let P=!w.isSame(v,"month"),I=C(w),S=k?Vn(w,o)||Vn(w,r):Vn(w,t),N=w.isSame(or(),"day"),M=k&&o&&r&&w.isAfter(o.startOf("day"))&&w.isBefore(r.startOf("day")),T=k&&Vn(w,o)&&!!r,D=k&&Vn(w,r)&&!!o,A=["orb-cal-day",P?"orb-is-outside":void 0,N?"orb-is-today":void 0,S?"orb-is-selected":void 0,M?"orb-is-in-range":void 0,T?"orb-is-range-start":void 0,D?"orb-is-range-end":void 0].filter(Boolean).join(" ");return m?f("span",{className:"orb-cal-day-slot",children:m(w,{outsideCurrentMonth:P,selected:S,today:N,disabled:I})},w.format("YYYY-MM-DD")):f("button",{type:"button",role:"gridcell","aria-selected":S,"aria-current":N?"date":void 0,className:A,disabled:I,onClick:()=>n?.(w),children:w.date()},w.format("YYYY-MM-DD"))})]})]})};or.extend(Df);var Nf=({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:f$1,helperText:h,sx:p,className:v})=>{let y=o!==void 0,[g$1,x]=useState(r??null),b=y?o:g$1,[C,k]=useState(false),[w,P]=useState(null),I=D=>{y||x(D),n?.(D);},S=w??(b?(u?b.locale(u):b).format(l):""),N=()=>{if(w===null)return;let D=w.trim();if(!D)I(null);else {let A=or(D,l,true);A.isValid()&&!(a&&A.isBefore(a.startOf("day")))&&!(i&&A.isAfter(i.startOf("day")))&&I(A);}P(null);},T=(typeof f$1=="string"?f$1:void 0)??h;return g("div",{className:`orb-fld ${f$1?"orb-is-error":""} ${v??""}`,style:p,children:[t&&f("label",{children:t}),f(Ls,{open:C,onOpenChange:k,trigger:g("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[f("span",{className:"orb-inp-adornment",children:f(Ds,{size:15,strokeWidth:1.8})}),f("input",{className:`orb-inp ${m?"orb-inp-dense":""}`,value:S,placeholder:d??l,disabled:s,onFocus:()=>k(true),onChange:D=>P(D.target.value),onBlur:N,onKeyDown:D=>{D.key==="Enter"&&(N(),k(false)),D.key==="Escape"&&k(false);}})]}),children:f(Wn,{value:b,onChange:D=>{I(D),P(null),k(false);},minDate:a,maxDate:i,locale:u,defaultMonth:b??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[l,d]=useState(false),[u,m]=useState([]),f$1=useRef(null),h=b=>{b.preventDefault(),d(true);},p=b=>{b.preventDefault(),d(false);},v=b=>{b.preventDefault(),d(false),g$1(Array.from(b.dataTransfer.files));},y=b=>{b.target.files&&g$1(Array.from(b.target.files));},g$1=b=>{let C=n?b.filter(w=>w.size<=n):b;C.length<b.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let k=o?[...u,...C]:C;o&&(k=k.filter((w,P,I)=>P===I.findIndex(S=>S.name===w.name&&S.size===w.size&&S.lastModified===w.lastModified))),m(k),t?.(k),f$1.current&&(f$1.current.value="");},x=b=>{let C=u.filter((k,w)=>w!==b);m(C),t?.(C);};return g("div",{style:{width:"100%",...s},children:[g("div",{onClick:()=>f$1.current?.click(),onDragOver:h,onDragLeave:p,onDrop:v,role:"button",tabIndex:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f$1.current?.click());},style:{border:`2px dashed ${l?"var(--orb-primary)":"var(--orb-border)"}`,borderRadius:"var(--orb-r)",padding:32,textAlign:"center",cursor:"pointer",backgroundColor:l?"var(--orb-hover)":"var(--orb-canvas)",transition:"border-color var(--orb-t-fast), background-color var(--orb-t-fast)"},children:[f("input",{type:"file",ref:f$1,style:{display:"none"},multiple:o,accept:r,onChange:y}),g("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[f(Vc,{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,C)=>g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid var(--orb-border)",borderRadius:"var(--orb-r)",backgroundColor:"var(--orb-surface)"},children:[g("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[f(xc,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),f("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.name}),g("span",{className:"orb-meta",children:["(",(b.size/1024).toFixed(1)," KB)"]})]}),f(ne,{"aria-label":`Remove ${b.name}`,onClick:()=>x(C),children:f(Hc,{size:15,strokeWidth:1.8})})]},`${b.name}-${C}`))})]})};function fo(...t){return twMerge(clsx(t))}var Ba={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"},Uc=()=>"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 Hf=cva(Uc(),{variants:{variant:{default:`${Ba.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${Ba.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:Ba.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"}}),Bs=jt.forwardRef(({className:t,variant:o,size:r,asChild:n=false,...a},i)=>f(n?Slot:"button",{className:fo(Hf({variant:o,size:r,className:t})),ref:i,...a}));Bs.displayName="Button";var zf={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.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"},Vf={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.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"},Wf={"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"},$f={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.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"},_f={"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"},Gf={"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"},_n={en:zf,zh:Vf,fr:Wf,de:$f,ja:_f,ko:Gf};var qc=(t,o)=>o?t.replace(/\{(\w+)\}/g,(r,n)=>{let a=o[n];return a==null?"":String(a)}):t,Xf={locale:"en",t:(t,o)=>qc(_n.en[t]||t,o)},Xc=createContext(Xf),Ha=({locale:t="en",messages:o,children:r})=>{let n=useMemo(()=>{let a=_n[t]||_n.en,i=o?.[t]||{},s={..._n.en,...a,...i};return {locale:t,t:(l,d)=>qc(s[l]||l,d)}},[t,o]);return f(Xc.Provider,{value:n,children:r})},de=()=>useContext(Xc);function Gn({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}=de(),f$1=s==="dark",h=usePathname(),[p,v]=useState(false),[y,g$1]=useState(new Set),x=a!==void 0&&i!==void 0,b=x?a:y;useEffect(()=>{v(true);},[]);let C=w=>{if(x)i(w);else {let P=new Set(y);P.has(w)?P.delete(w):P.add(w),g$1(P);}},k=w=>{w.children&&w.children.length>0&&C(w.id),o&&o(w);};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(w=>{let P=b.has(w.id)||w.isExpanded,I=w.children&&w.children.length>0,N=56+Math.max(0,n-1)*8,M=n===0?12:I?N-24:N,T=w.appurl||w.href,D=p&&T?h===T:false,A=d?.has(w.id)??false,L=l&&w.pinnable!==false&&!!T&&!I;return g("div",{className:"tree-menu-item relative",children:[D&&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(Bs,{variant:"ghost",className:fo("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",I&&P&&!D?f$1?"bg-[color-mix(in_oklch,var(--orb-inverse-fg)_5%,transparent)] text-[var(--orb-fg)] hover:bg-[color-mix(in_oklch,var(--orb-inverse-fg)_8%,transparent)]":"bg-[color-mix(in_oklch,var(--orb-surface)_70%,transparent)] text-[var(--orb-fg)] hover:bg-[var(--orb-surface)]":"",n>=2?"min-h-9 py-1.5 rounded-md":n>0?"min-h-10 rounded-lg":"rounded-lg",D?f$1?"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_35%,transparent)]":"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]":f$1?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)] text-[var(--orb-fg)]":"hover:bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] text-[var(--orb-fg)]"),style:{paddingLeft:`${M}px`,paddingRight:L?"34px":"10px"},onClick:()=>k(w),children:[I&&f("div",{className:fo("flex-shrink-0 transition-transform duration-200",P&&"rotate-90",D?"text-[var(--orb-nav-active-fg)]":f$1?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:f(Fo,{className:"h-4 w-4"})}),w.icon&&f("div",{className:fo("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",D?"text-[var(--orb-nav-active-fg)]":f$1?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:w.icon}),g("div",{className:"flex-1 text-left overflow-hidden z-10",children:[f("div",{className:fo("text-sm truncate transition-colors duration-200",D?"font-semibold":"font-medium"),children:w.title||w.label}),w.description&&f("div",{className:fo("text-xs truncate transition-colors duration-200",D?f$1?"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_70%,transparent)]":"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_75%,transparent)]":"text-[var(--orb-muted)]"),title:w.description,children:w.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:O=>{O.preventDefault(),O.stopPropagation(),u(w);},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(Gn,{items:w.children,onItemClick:o,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:u})})})]},w.id)})})}var jf="orbcafe:navigation-island:pinned-items",Hs="orbcafe-navigation-pinned",Jf=t=>t.appurl||t.href,Zc=t=>{let o=[];return t.forEach(r=>{let n=!!r.children?.length;r.pinnable!==false&&Jf(r)&&!n&&o.push({...r,children:void 0}),r.children?.length&&o.push(...Zc(r.children));}),o},Qc=({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=jf,pinnedItemIds:f$1,defaultPinnedItemIds:h=[],onPinnedItemIdsChange:p,pinnedSectionTitle:v})=>{let{t:y}=de(),g$1=i==="dark",x=s==="floating",b=useRouter(),[C,k]=useState(""),[w,P]=useState(new Set),[I,S]=useState(h),[N,M]=useState(false),T=f$1!==void 0,D=useMemo(()=>f$1??I,[f$1,I]),A=useMemo(()=>new Set(D),[D]);useEffect(()=>{t&&P(new Set);},[t]),useEffect(()=>{if(!u||T){M(true);return}try{let H=window.localStorage.getItem(m);if(H){let U=JSON.parse(H);Array.isArray(U)&&S(U.filter(K=>typeof K=="string"));}}catch{}finally{M(true);}},[u,T,m]),useEffect(()=>{if(!(!u||T||!N))try{window.localStorage.setItem(m,JSON.stringify(D));}catch{}},[D,u,T,m,N]),useEffect(()=>{!u||t||D.length===0||P(H=>{if(H.has(Hs))return H;let U=new Set(H);return U.add(Hs),U});},[t,D.length,u]);let L=useCallback(H=>{let U=Array.from(new Set(H));T||S(U),p?.(U);},[T,p]),O=useCallback(H=>{let U=H.id,K=A.has(U)?D.filter(ge=>ge!==U):[...D,U];L(K);},[D,A,L]),_=useMemo(()=>{if(!u||D.length===0)return a;let H=new Map(Zc(a).map(K=>[K.id,K])),U=D.map(K=>H.get(K)).filter(K=>!!K);return U.length===0?a:[{id:Hs,title:v||y("navigation.pinned"),icon:f(Qr,{className:"w-4 h-4"}),children:U,pinnable:false},...a]},[D,u,a,v,y]),F=useCallback(H=>{let U=[],K=ge=>{ge.forEach(ie=>{U.push(ie.id),ie.children&&K(ie.children);});};return K(H),U},[]),X=useMemo(()=>{if(!C.trim())return _;let H=U=>U.reduce((K,ge)=>{let ie=ge.title?.toLowerCase().includes(C.toLowerCase())||ge.description?.toLowerCase().includes(C.toLowerCase()),pe=ge.children?H(ge.children):[];return (ie||pe.length>0)&&K.push({...ge,children:pe.length>0?pe:ge.children}),K},[]);return H(_)},[C,_]),V=useMemo(()=>C.trim()?new Set(F(_)):w,[C,_,w,F]),Z=useCallback(async H=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",H),H.id==="chat"||H.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(K){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",K),b.push("/chat");}return}let U=H.appurl||H.href;U&&(U.startsWith("http://")||U.startsWith("https://")?window.open(U,"_blank"):b.push(U));},[b]),z=useCallback(()=>{l?.(s==="fixed"?"floating":"fixed");},[s,l]);return g("div",{className:`flex flex-col backdrop-blur-xl border ${x?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${t?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${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:y("navigation.expand"),children:f(Bo,{className:"h-5 w-5"})})}):g("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[f("input",{type:"text",placeholder:y("navigation.searchPlaceholder"),value:C,onChange:H=>k(H.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(Bo,{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:X.length===0?f("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?f(Ln,{className:"h-5 w-5"}):y(C?"navigation.noMatch":"navigation.noAccessibleApp")}):g(e,{children:[!t&&f("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:f(Gn,{items:X,onItemClick:Z,className:"space-y-1",expandedIds:V,colorMode:i,enablePinning:u,pinnedIds:A,onTogglePin:O,onToggleExpand:H=>{let U=new Set(w);X.some(ge=>ge.id===H)?U.has(H)?U.delete(H):(X.forEach(ge=>{ge.id!==H&&U.has(ge.id)&&U.delete(ge.id);}),U.add(H)):U.has(H)?U.delete(H):U.add(H),P(U);}})}),t&&f("div",{className:"space-y-2",children:_.map(H=>f("div",{className:"space-y-1",children:f("button",{onClick:()=>{o();let U=new Set([H.id]);P(U);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g$1?"text-[var(--orb-muted)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expandView",{title:H.title||""}),children:H.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:H.title?.charAt(0)||"?"})})},H.id))})]})}),!t&&f("button",{onClick:o,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${g$1?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)]":"hover:bg-[color-mix(in_oklch,var(--orb-canvas)_20%,transparent)]"}`,title:y("navigation.collapse"),children:f("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:f("div",{className:g$1?"border-[var(--orb-status-warning)]":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid var(--orb-ai-accent)",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&t&&f("button",{type:"button",onClick:z,className:`absolute -bottom-4 left-1/2 z-30 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border shadow-md transition-colors focus:outline-none focus:ring-2 focus:ring-[color-mix(in_oklch,var(--orb-primary)_45%,transparent)] ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-status-fg)] hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]"}`,style:{touchAction:"manipulation"},title:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(Ra,{className:"h-4 w-4"}):f(Da,{className:"h-4 w-4"})})]})};var th="orbcafe:navigation-island:pinned-items",zs="orbcafe-navigation-pinned",jc=t=>t.appurl||t.href,Jc=t=>t.flatMap(o=>{let r=!!o.children?.length,n=o.pinnable!==false&&jc(o)&&!r?[{...o,children:void 0}]:[];return o.children?.length?[...n,...Jc(o.children)]:n}),ed=t=>t.flatMap(o=>[o.id,...o.children?ed(o.children):[]]),td=(t,o)=>t.reduce((r,n)=>{let a=n.children?td(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},[]),Vs=({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=th,pinnedItemIds:f$1,defaultPinnedItemIds:h=[],onPinnedItemIdsChange:p,pinnedSectionTitle:v})=>{let{t:y}=de(),g$1=useRouter(),x=s==="floating",[b,C]=useState(""),[k,w]=useState(new Set),[P,I]=useState(h),[S,N]=useState(false),M=f$1!==void 0,T=f$1??P,D=useMemo(()=>new Set(T),[T]);useEffect(()=>{t&&w(new Set);},[t]),useEffect(()=>{if(!u||M){N(true);return}try{let H=window.localStorage.getItem(m);if(H){let U=JSON.parse(H);Array.isArray(U)&&I(U.filter(K=>typeof K=="string"));}}catch{}finally{N(true);}},[u,M,m]),useEffect(()=>{if(!(!u||M||!S))try{window.localStorage.setItem(m,JSON.stringify(T));}catch{}},[T,u,M,m,S]),useEffect(()=>{!u||t||T.length===0||w(H=>{if(H.has(zs))return H;let U=new Set(H);return U.add(zs),U});},[t,T.length,u]);let A=useCallback(H=>{let U=Array.from(new Set(H));M||I(U),p?.(U);},[M,p]),L=useCallback(H=>{A(D.has(H.id)?T.filter(U=>U!==H.id):[...T,H.id]);},[T,D,A]),O=useMemo(()=>{if(!u||T.length===0)return a;let H=new Map(Jc(a).map(K=>[K.id,K])),U=T.map(K=>H.get(K)).filter(K=>!!K);return U.length===0?a:[{id:zs,title:v||y("navigation.pinned"),icon:f(Qr,{className:"h-4 w-4"}),children:U,pinnable:false},...a]},[T,u,a,v,y]),_=b.trim().toLocaleLowerCase(),F=useMemo(()=>_?td(O,_):O,[O,_]),X=useMemo(()=>_?new Set(ed(F)):k,[k,F,_]),V=useCallback(H=>{w(U=>{let K=new Set(U),ge=F.some(ie=>ie.id===H);return K.has(H)?K.delete(H):(ge&&F.forEach(ie=>K.delete(ie.id)),K.add(H)),K});},[F]),Z=useCallback(H=>{let U=jc(H);U&&(H.id==="chat"||H.appurl==="/chat"?g$1.push("/chat?new=true"):/^https?:\/\//.test(U)?window.open(U,"_blank","noopener,noreferrer"):g$1.push(U));},[g$1]),z=H=>{o(),w(new Set([H.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:y("navigation.expand"),"aria-label":y("navigation.expand"),children:f(Bo,{className:"h-5 w-5"})}):g("label",{className:"relative block",children:[f("span",{className:"orb-visually-hidden",children:y("navigation.searchPlaceholder")}),f(Bo,{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:H=>C(H.target.value),placeholder:y("navigation.searchPlaceholder"),className:"w-full py-2 pl-10 pr-3 text-sm outline-none"})]})}),f("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:F.length===0?f("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?f(Ln,{className:"h-5 w-5"}):y(_?"navigation.noMatch":"navigation.noAccessibleApp")}):t?f("div",{className:"space-y-1",children:O.map(H=>f("button",{type:"button",onClick:()=>z(H),className:"flex h-10 w-full items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expandView",{title:H.title||H.label||""}),children:H.icon||f(Ln,{className:"h-5 w-5"})},H.id))}):f(Gn,{items:F,onItemClick:Z,className:"space-y-1",expandedIds:X,onToggleExpand:V,colorMode:i,enablePinning:u,pinnedIds:D,onTogglePin:L})}),d&&t&&f("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:f("button",{type:"button",onClick:()=>l?.(x?"fixed":"floating"),className:"flex h-9 w-9 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(Ra,{className:"h-4 w-4"}):f(Da,{className:"h-4 w-4"})})}),!t&&f("button",{type:"button",onClick:o,className:"absolute -bottom-1 -right-1 z-20 flex h-6 w-6 items-center justify-center rounded-full bg-transparent transition-all duration-300 ease-in-out",title:y("navigation.collapse"),"aria-label":y("navigation.collapse"),children:f("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:f("span",{className:"absolute rounded-full border-[3px] border-[var(--orb-ai-accent)]",style:{width:32,height:32,top:-16,left:-16}})})})]})};Vs.displayName="NavigationIsland2";var rd=(t={})=>{let{initialCollapsed:o=false,initialDisplayMode:r="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:u}=t,[m,f]=useState(o),[h,p]=useState(r),[v,y]=useState(n),g=useCallback(()=>{f(C=>!C);},[]),x=useCallback(()=>{p(C=>C==="fixed"?"floating":"fixed");},[]),b=useMemo(()=>({collapsed:m,onToggle:g,menuData:v,displayMode:h,onDisplayModeChange:p,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:u}),[m,g,v,h,p,a,i,s,l,d,u]);return {collapsed:m,setCollapsed:f,toggleCollapsed:g,displayMode:h,setDisplayMode:p,toggleDisplayMode:x,menuData:v,setMenuData:y,navigationIslandProps:b}};var $s=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);}},ar=new $s,MP={success:(t,o)=>ar.show("success",t,o),error:(t,o)=>ar.show("error",t,o),warning:(t,o)=>ar.show("warning",t,o),info:(t,o)=>ar.show("info",t,o),show:(t,o,r)=>ar.show(t,o,r),hide:()=>ar.hide()};var rh={success:{icon:f(En,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:f(Aa,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:f(wa,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:f(Pa,{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:l=true,maxWidth:d="xs",type:u="default"})=>{let{t:m}=de(),f$1=i||m("messageBox.confirm"),h=s||m("messageBox.cancel"),p=()=>{a?a():n();},v=rh[u],y=u!=="default";return g(Et,{open:t,onClose:n,maxWidth:d,sx:y?{borderTop:`6px solid ${v.iconColor}`}:void 0,children:[y&&f("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:v.iconColor},children:v.icon}),o&&f("div",{className:"orb-dialog-title",style:{textAlign:y?"center":"left",paddingTop:y?8:16},children:o}),f("div",{className:"orb-dialog-content",style:{textAlign:y?"center":"left"},children:typeof r=="string"?f("p",{style:{margin:0,color:"var(--orb-muted)"},children:r}):r}),g("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:y?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[l&&f(Se,{onClick:n,variant:"text",children:h}),f(Se,{onClick:p,variant:"contained",color:y&&u==="error"?"error":"primary",autoFocus:true,children:f$1})]})]})},FP=()=>{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 ar.register(s),()=>ar.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 WP=({status:t,showIcon:o=true})=>{let r="gray",n,a=t;return t==="OK"?(r="blue",n=f(En,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(r="orange",n=f(wa,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(r="orange",n=f(Aa,{size:14,strokeWidth:2}),a="Warning"),f(Ct,{label:a,tone:r,icon:o&&n?n:void 0})};var GP=({dense:t,sx:o,className:r,children:n,...a})=>f("ul",{...a,className:r,style:{listStyle:"none",margin:0,padding:0,...o},children:n}),UP=({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}),KP=({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}),qP=({children:t,sx:o})=>f("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...o},children:t}),XP=({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})]}),YP=({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}),ZP=({children:t,sx:o})=>f("div",{style:{marginRight:12,display:"flex",alignItems:"center",...o},children:t});var JP=({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 No=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})}),Te=no("div"),ad=no("a","orb-link"),Or=Ne,id=ae,ho=E;var sd=ne;var ld=Rt,Zo=tn,Ka=en,qa=Oa;var Xa=La,cd=qo,dd=({value:t,variant:o,color:r,sx:n})=>f(Hn,{value:o==="determinate"?t:void 0,color:r,sx:n}),pd=no("table","orb-tbl"),ud=no("tbody"),Us=no("td"),md=no("div","orb-table-container"),gd=no("thead"),Ks=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 ir=no("span","orb-input-adornment"),fd=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"),Xn=({control:t,label:o,...r})=>g("label",{className:"orb-form-control-label",...r,children:[t,f("span",{children:o})]}),ch=({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]}),dh=no("span","orb-list-item-icon"),$t=ch,Ho=dh;no("div","orb-list-subheader");var qs=({container:t,item:o,spacing:r,xs:n,sm:a,md:i,lg:s,xl:l,sx:d,...u})=>{let m={},f$1=h=>typeof h=="number"?`${h/12*100}%`:h?"100%":void 0;return n!==void 0&&(m.xs=f$1(n)),a!==void 0&&(m.sm=f$1(a)),i!==void 0&&(m.md=f$1(i)),s!==void 0&&(m.lg=f$1(s)),l!==void 0&&(m.xl=f$1(l)),f(Te,{...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}),hd=({children:t,container:o})=>typeof document>"u"?null:createPortal(t,o??document.body),bd=no("div","orb-toolbar"),vd=({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})]})},Ya=({open:t,anchorEl:o,onClose:r,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:l,sx:d$1,className:u,style:m,...f$1})=>{let h=useRef(null);if(useEffect(()=>{if(!t)return;let x=C=>{let k=C.composedPath();h.current&&k.includes(h.current)||o&&k.includes(o)||r?.();},b=C=>{C.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,y=[...Array.isArray(v?.sx)?v.sx:v?.sx?[v.sx]:[],...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],g=d(y,["orb-pop",v?.className,u].filter(Boolean).join(" "),{...v?.style,...m});return createPortal(f("div",{...f$1,ref:h,className:g.className,style:{position:"fixed",left:p?.left??16,top:(p?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},yd=({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)},Cd=({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)}),xd=({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 Sd=({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()})},wd=({value:t,referenceDate:o,onChange:r,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>f(Wn,{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:f=>r?.(f)}):void 0,...d}),kd=({children:t})=>f(e,{children:t}),Ua=class{};var ph=(t,o)=>o!==void 0?o:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,Ce=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:ph(r,n),className:u.className,style:u.style,"aria-label":d$1["aria-label"]??l,...d$1})},Cr=Ce("tree"),Fr=Ce("add"),Pd=Ce("duplicate"),Xs=Ce("down"),Td=Ce("navigationRight"),Id=Ce("navigationRight"),Ys=Ce("up"),Md=Ce("delete"),Rd=Ce("camera"),Dd=Ce("accept"),Nd=Ce("accept"),Za=Ce("navigationRight"),Ad=Ce("dimension"),Ed=Ce("decline"),xr=Ce("decline"),Ld=Ce("decline"),Od=Ce("decline"),Qa=Ce("delete"),ja=Ce("delete"),Fd=Ce("download"),Bd=Ce("move"),Hd=Ce("edit"),rn=Ce("slimDown"),zd=Ce("filter"),nn=Ce("sum"),Vd=Ce("lineChart"),Wd=Ce("document"),zo=Ce("slimDown"),$d=Ce("navigationLeft"),Sr=Ce("navigationRight"),Ja=Ce("slimUp"),ei=Ce("navigationLeft"),ti=Ce("navigationRight"),_d=Ce("dimension"),Gd=Ce("splitOne"),oi=Ce("menu"),Ud=Ce("microphone"),Kd=Ce("microphone"),qd=Ce("microphone"),Xd=Ce("qrCode"),wr=Ce("save"),Br=Ce("search"),Yd=Ce("search"),Zd=Ce("paperPlane"),Qd=Ce("paperPlane"),jd=Ce("wrench"),Jd=Ce("sort"),ri=Ce("splitTwo"),ep=Ce("favorite"),tp=Ce("favorite"),op=Ce("stop"),rp=Ce("tableRow"),ni=Ce("collapseAll"),ai=Ce("expandAll"),an=Ce("tableColumn"),np=Ce("overview"),ap=Ce("hide");var mh=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],sp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],wo=t=>String(t),lp=(t,o)=>t[o],cp=t=>{let o=t.value??t.id??t.key??t.code;return typeof o=="number"||typeof o=="string"?o:""},gh=t=>{let o=t.label??t.description??t.name??t.title;return String(typeof o=="number"||typeof o=="string"?o:cp(t))},fh=t=>{let o=t.description??t.subtitle;return typeof o=="number"||typeof o=="string"?String(o):void 0},dp=({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:f$1=false,clearable:h=true,allowManualInput:p=true,validateManualInput:v=true,manualInputErrorText:y="Enter a valid value.",selectedItems:g$1=[],displayValue:x,getOptionValue:b=cp,getOptionLabel:C=gh,getOptionDescription:k=fh,onChange:w,onSearch:P,disabled:I,InputProps:S,onFocus:N,onBlur:M,onKeyDown:T,error:D,helperText:A,...L})=>{let O=yo(),_=n==="multiple",[F,X]=useState(false),[V,Z]=useState(false),[z,H]=useState(""),[U,K]=useState(null),[ge,ie]=useState(false),[pe,xe]=useState(()=>sp(t)),[We,we]=useState(""),[se,Ae]=useState(""),Ie=useMemo(()=>r&&r.length>0?r:mh,[r]),ke=U??o,ze=useMemo(()=>{let ee=[...g$1,...o,...U??[]],he=new Map;return ee.forEach(De=>{he.set(wo(b(De)),De);}),he},[b,o,U,g$1]),et=useMemo(()=>sp(t),[t]),rt=useMemo(()=>et.map(String).join(", "),[et]);useEffect(()=>{F||xe(et);},[F,et]),useEffect(()=>{!V&&!se&&we(rt);},[V,rt,se]);let at=useMemo(()=>{let ee=z.trim().toLowerCase();if(!ee||P)return ke;let he=Ie.filter(De=>De.searchable!==false);return ke.filter(De=>[b(De),C(De),k(De),...he.map(it=>lp(De,it.field))].some(it=>String(it??"").toLowerCase().includes(ee)))},[ke,k,C,b,P,z,Ie]),q=useMemo(()=>{if(x!==void 0)return x;if(et.length===0)return "";let ee=he=>{let De=ze.get(wo(he));if(!De)return String(he);let je=C(De);return je&&je!==String(he)?`${he} - ${je}`:String(he)};return _?et.length>2?`${et.length} selected`:et.map(ee).join(", "):ee(et[0])},[x,C,_,ze,et]),Re=useCallback(async()=>{if(P){ie(true);try{let ee=await P(z);Array.isArray(ee)&&K(ee);}finally{ie(false);}}},[P,z]),ve=()=>{I||(xe(et),X(true));},Fe=()=>{X(false);},nt=()=>{w?.(_?[]:null,_?[]:null),xe([]),we(""),Ae("");},Ye=ee=>{let he=b(ee);if(_){xe(De=>De.some(it=>wo(it)===wo(he))?De.filter(it=>wo(it)!==wo(he)):[...De,he]);return}xe([he]);},xt=()=>{let ee=pe.map(he=>ze.get(wo(he))).filter(he=>!!he);_?w?.(pe,ee):w?.(pe[0]??null,ee[0]??null),Ae(""),X(false);},It=ee=>{if(ee.key==="F4"){ee.preventDefault(),ve();return}if(ee.key==="Enter"&&p&&!Nt(We,true)){ee.preventDefault();return}T?.(ee);},Lt=ee=>v?ee.every(he=>ze.has(wo(he))):true,Nt=(ee,he)=>{if(_){let je=ee.split(/[,;\n]/).map(dt=>dt.trim()).filter(Boolean);if(je.length===0)return Ae(""),w?.([],[]),true;if(!Lt(je))return he&&Ae(y),false;Ae("");let it=je.map(dt=>ze.get(wo(dt))).filter(dt=>!!dt);return w?.(je,it),true}let De=ee.trim();return De?Lt([De])?(Ae(""),w?.(De,ze.get(wo(De))??null),true):(he&&Ae(y),false):(Ae(""),w?.(null,null),true)},te=ee=>{if(!p)return;let he=ee.target.value;we(he),Ae(""),Nt(he,false);},Ge=f$1||ge,Oe=et.length>0,be=p&&(V||!!se)?We:q;return g(e,{children:[f(He,{...L,className:["orb-value-help-field",h&&Oe&&!I?"orb-value-help-has-clear":"",L.className??""].filter(Boolean).join(" "),disabled:I,value:be,error:!!se||D,helperText:se||A,onChange:te,onFocus:ee=>{Z(true),we(rt),N?.(ee);},onBlur:ee=>{p&&Nt(We,true),Z(false),M?.(ee);},onKeyDown:It,InputProps:{...S,readOnly:!p,endAdornment:g("span",{className:"orb-value-help-actions",children:[Ge?f(qo,{size:18}):null,h&&Oe&&!I?f(ne,{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(ne,{className:"orb-value-help-search-trigger",size:"small",tooltip:u,"aria-label":u,onMouseDown:ee=>ee.preventDefault(),onClick:ee=>{ee.stopPropagation(),ve();},disabled:I,children:f(Pt,{name:"search",size:16})})]})}}),g(Et,{open:F,onClose:Fe,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:ee=>({borderRadius:2,overflow:"hidden",border:`1px solid ${ee.palette.divider}`,boxShadow:O==="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}),_?f(E,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${pe.length} selected`}):null]}),f(ne,{"aria-label":"Close",onClick:Fe,size:"small",children:f(xr,{fontSize:"small"})})]}),g("div",{className:"orb-dialog-content",sx:{p:0},children:[g(ae,{direction:{xs:"column",sm:"row"},spacing:1,sx:ee=>({px:2.5,py:1.5,borderBottom:`1px solid ${ee.palette.divider}`,bgcolor:O==="dark"?tt(ee.palette.common.white,.025):tt(ee.palette.primary.main,.035)}),children:[f(He,{size:"small",fullWidth:true,autoFocus:true,value:z,placeholder:i,onChange:ee=>H(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"&&(ee.preventDefault(),Re());},InputProps:{startAdornment:f(ir,{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,O==="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(qo,{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:O==="dark"?"var(--orb-canvas)":ee.palette.background.paper,borderBottom:`1px solid ${ee.palette.divider}`})}),Ie.map(ee=>f("td",{align:ee.align==="inherit"?void 0:ee.align,sx:he=>({minWidth:ee.minWidth,width:ee.width,fontSize:"0.78rem",fontWeight:800,bgcolor:O==="dark"?"var(--orb-canvas)":he.palette.background.paper,borderBottom:`1px solid ${he.palette.divider}`}),children:ee.label},String(ee.field)))]})}),g("tbody",{children:[at.map(ee=>{let he=b(ee),De=pe.some(je=>wo(je)===wo(he));return g("tr",{hover:true,selected:De,onClick:()=>Ye(ee),onDoubleClick:()=>{_||(xe([he]),w?.(he,ee),X(false));},sx:je=>({cursor:"pointer","&.orb-selected":{bgcolor:tt(je.palette.primary.main,O==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:tt(je.palette.primary.main,O==="dark"?.28:.18)}}),children:[f("td",{padding:"checkbox",children:f(Tt,{size:"small",checked:De})}),Ie.map(je=>{let it=lp(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))})]},wo(he))}),at.length===0?f("tr",{children:f("td",{colSpan:Ie.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:[h&&(Oe||pe.length>0)?f(Se,{onClick:nt,children:l}):null,f("div",{sx:{flex:1}}),f(Se,{onClick:Fe,children:d}),f(Se,{variant:"contained",onClick:xt,disabled:!_&&pe.length===0,children:s})]})]})]})};var ii=({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 Zs={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"},Qs={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}},Zn={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},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 hh={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"}},si=({rowsPerPage:t=20,rowsPerPageOptions:o=[20,50,100,-1],page:r=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=de(),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),f$1=d>0,h=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:hh,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(ne,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(d-1,0)),disabled:!f$1,sx:co,children:f($d,{})}),g(E,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:m,total:u}),children:[m," / ",u]}),f(ne,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,u-1)),disabled:!h,sx:co,children:f(Sr,{})})]})};var li=({value:t="",onChange:o})=>{let{t:r}=de();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(ir,{position:"start",children:f(Br,{size:16})})}})})};var ci=t=>{let{t:o}=de(),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(bd,{className:"orb-table-toolbar",role:"toolbar","aria-label":o("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(li,{value:t.filterText,onChange:l=>{t.setFilterText(l),t.onPageChange?.(0);}}),f(si,{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(ne,{className:"orb-table-tool-button",sx:co,onClick:l=>t.setGroupAnchorEl(t.groupAnchorEl?null:l.currentTarget),children:f(qa,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:f(Cr,{})})})}),f(lt,{title:o("table.toolbar.summary"),children:f(ne,{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(ne,{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(ne,{className:"orb-table-tool-button",sx:co,onClick:t.handleExport,children:f(Fd,{})})})]}),i&&g("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&f(lt,{title:o("table.toolbar.newItem"),children:f(ne,{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(ne,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:co,children:f(Hd,{})})})}),t.showDeleteButton&&f(lt,{title:o("table.toolbar.deleteItem"),children:f("span",{children:f(ne,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...co,color:"error.main"},children:f(Qa,{})})})})]}),s&&g("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&f(lt,{title:o("table.toolbar.graphicReport"),children:f(ne,{className:"orb-table-tool-button",sx:co,onClick:t.onOpenGraphReport,children:f(Vd,{})})}),t.onLayoutSave&&!t.layoutManager&&f(lt,{title:o("table.toolbar.saveLayout"),children:f(ne,{className:"orb-table-tool-button",sx:co,onClick:l=>t.onLayoutSave(l),children:f(wr,{})})}),t.layoutManager]})]})]})})};var di=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 [di.Translate.toString(t),di.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:o,duration:r,easing:n}=t;return o+" "+r+"ms "+n}}});var pi=t=>{let{t:o}=de(),{onSelectAllClick:r,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:l=0,onRequestSort:d,onContextMenu:u,columns:m,visibleColumns:f$1,selectionMode:h,grouping:p=[],isAllExpanded:v=false,handleToggleAll:y,onColumnResize:g$1,columnWidths:x,enableColumnReorder:b=false,disableSorting:C=false}=t,[k,w]=useState(null),P=useRef(null),I=V=>Z=>{C||k||d(V);},S=(V,Z,z)=>{V.preventDefault(),V.stopPropagation(),w(Z),P.current={startX:V.clientX,startWidth:z,colId:Z},document.addEventListener("mousemove",N),document.addEventListener("mouseup",M),document.body.style.cursor="col-resize";},N=V=>{if(!P.current)return;let{startX:Z,startWidth:z,colId:H}=P.current,U=V.clientX-Z,K=Math.max(50,z+U);g$1&&g$1(H,K);},M=()=>{w(null),P.current=null,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",M),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",M);},[]);let T=h==="multiple"||h==="single",D=p.length>0&&!!y,A=o(v?"table.group.collapseAll":"table.group.expandAll"),L=m.filter(V=>f$1.includes(V.id)),O=new Map(i.map((V,Z)=>[V.field,{...V,priority:Z+1}])),_=L.map(V=>{let Z=x?.[V.id]||V.minWidth||100,z=O.get(V.id);return f(kh,{headCell:V,width:typeof Z=="number"?Z:100,order:n,orderBy:a,multiSortInfo:C?void 0:z,onRequestSort:I(V.id),onContextMenu:u,onResizeMouseDown:H=>S(H,V.id,typeof Z=="number"?Z:100),enableColumnReorder:b,disableSorting:C},V.id)}),F=L.map(V=>V.id),X=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:h==="single",sx:Yn})}),D&&f("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:f(lt,{title:A,children:f(ne,{size:"small",onClick:V=>{V.stopPropagation(),y?.(!v);},sx:Zn,children:v?f(ni,{}):f(ai,{})})})}),b?f(SortableContext,{items:F,strategy:horizontalListSortingStrategy,children:_}):_]});return f("thead",{children:X})},kh=({headCell:t,width:o,order:r,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:l,enableColumnReorder:d,disableSorting:u})=>{let{setNodeRef:m,attributes:f$1,listeners:h,transform:p,transition:v,isDragging:y}=useSortable({id:t.id,disabled:!d}),g$1=d?{transform:di.Transform.toString(p),transition:v,opacity:y?.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":""} ${y?"orb-is-dragging":""}`,"aria-sort":b?x==="asc"?"ascending":"descending":"none",onContextMenu:s?C=>s(C,t.id):void 0,style:{width:o,minWidth:o,maxWidth:o,...g$1},...d?f$1:{},...d?h:{},children:[u?f("span",{className:"orb-table-head-label",children:t.label}):f(vd,{className:"orb-table-head-sort",active:b,direction:x,onClick:i,children:g("span",{className:"orb-table-head-label",children:[t.label,a&&f("span",{className:"orb-table-sort-priority",children:a.priority})]})}),f("div",{className:"orb-table-resize-handle",onMouseDown:l,onPointerDown:C=>C.stopPropagation(),onClick:C=>C.stopPropagation()})]})};var ui=t=>{let{t:o}=de(),{visibleRows:r,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:l,expandedGroups:d=new Set,selectionMode:u,grouping:m=[],isGroupFullyExpanded:f$1,handleExpandGroupRecursively:h,handleCollapseGroupRecursively:p,emptyLabel:v,getRowDataKey:y,getRowProps:g$1,getGroupRowProps:x}=t,b=P=>a.indexOf(P)!==-1,C=u==="multiple"||u==="single",k=m.length>0,w=n.length+(C?1:0)+(k?1:0);return g("tbody",{children:[r.map((P,I)=>{if(P.type==="group"){let S=d.has(P.id),N=P.childIds||[],M=N.filter(V=>b(V)).length,T=N.length>0&&M===N.length,D=M>0&&M<N.length,A={entry:P,data:P,id:P.id,index:I,selected:T,group:true},L=x?.(A)||{},{className:O,onClick:_,...F}=L,X=V=>{if(V.stopPropagation(),!!t.onSelectionChange)if(T){let Z=a.filter(z=>!N.includes(z));t.onSelectionChange(Z);}else {let Z=Array.from(new Set([...a,...N]));t.onSelectionChange(Z);}};return g("tr",{...F,"data-ctable-row-key":y?.(A),className:["orb-table-group-row",O].filter(Boolean).join(" "),onClick:_,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:[C&&f("td",{padding:"checkbox",sx:Zs,children:f(Tt,{size:"small",checked:T,indeterminate:D,onChange:X,onClick:V=>V.stopPropagation(),sx:Yn})}),k&&f("td",{padding:"checkbox",sx:Qs,children:g("div",{sx:pp,children:[m.length>1&&P.level<m.length-1&&f(lt,{title:f$1?.(P.id)?o("table.group.collapseAll"):o("table.group.expandAll"),children:f(ne,{size:"small",onClick:()=>{f$1?.(P.id)?p?.(P.id):h?.(P.id);},sx:Zn,children:f$1?.(P.id)?f(ni,{}):f(ai,{})})}),f(ne,{size:"small",onClick:()=>l&&l(P.id),sx:Zn,children:S?f(zo,{}):f(Sr,{})})]})}),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 S=P.data||P,N=P.id||S.id||I,M=b(N),T=`enhanced-table-checkbox-${I}`,D={entry:P,data:S,id:N,index:I,selected:M,group:false},A=g$1?.(D)||{},{className:L,onClick:O,..._}=A,X=(P.level!==void 0?P.level:0)*4;return g("tr",{..._,"data-ctable-row-key":y?.(D),className:[M?"orb-is-selected":"",L].filter(Boolean).join(" "),onClick:V=>{O?.(V),V.defaultPrevented||i?.(V,S);},role:C?"checkbox":_.role,"aria-checked":C?M:_["aria-checked"],tabIndex:_.tabIndex??-1,children:[C&&f("td",{padding:"checkbox",sx:Zs,children:f(Tt,{color:"primary",checked:M,inputProps:{"aria-labelledby":T},sx:Yn})}),k&&f("td",{padding:"checkbox",sx:Qs}),s.filter(V=>n.includes(V.id)).map((V,Z)=>{let H=Z===0&&X>0?{pl:X+2}:{};return f("td",{className:V.numeric?"orb-num":void 0,align:V.numeric?"right":"left",sx:H,children:V.render?V.render(S[V.id],S):(function(){let K=S[V.id];if(V.numeric){if(typeof K=="number")return K.toLocaleString();if(typeof K=="string"&&K.trim()!==""&&!isNaN(Number(K)))return Number(K).toLocaleString()}return K})()},V.id)})]},N)}}),r.length===0&&f("tr",{children:f("td",{colSpan:w,align:"center",children:v??o("common.noData")})})]})};var up=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 h=n[m.id];return h==null||h===""?"":typeof h=="number"?h.toLocaleString():typeof h=="string"&&h.trim()!==""&&!isNaN(Number(h))?Number(h).toLocaleString():h})()},m.id))]})})};var mp=t=>{let{t:o}=de();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}=de(),[s,l]=useState(r);useEffect(()=>{t&&l(r);},[t,r]);let d=()=>{l(r),o(null);},u=f=>{l(h=>h.includes(f)?h.filter(p=>p!==f):[...h,f]);},m=()=>{n(s),o(null);};return g(Zt,{anchorEl:t,open:!!t,onClose:d,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[g("div",{className:"orb-table-group-menu-header",onClick:f=>f.stopPropagation(),children:[f(E,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&f(Se,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:f=>{f.stopPropagation(),l([]);},children:i("table.menu.clearAll")})]}),f(Rt,{className:"orb-table-group-menu-divider"}),a.map(f$1=>{let h=s.includes(f$1.id),p=s.indexOf(f$1.id)+1;return f("option",{className:"orb-table-group-menu-option",selected:h,onClick:v=>{v.stopPropagation(),u(f$1.id);},children:g("div",{className:"orb-table-group-menu-option-content",children:[f(Tt,{className:"orb-table-group-menu-checkbox",checked:h,size:"small"}),f($t,{className:"orb-table-group-menu-label",primary:f$1.label}),h&&f("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${p}`,children:p})]})},f$1.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}=de();return g(Zt,{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))]})},mi=({anchorEl:t,setAnchorEl:o,showSummary:r,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:l}=de();return g(Zt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{children:f(Xn,{control:f(Xa,{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")})})]})},gi=({contextMenu:t,handleCloseContextMenu:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return g(Zt,{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(Ho,{children:n.includes(s.id)&&f(Dd,{fontSize:"small"})}),f($t,{children:s.label})]},s.id))]})},bp=({contextMenu:t,handleClose:o,columns:r,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:l,orderBy:d,order:u,onSortAsc:m,onSortDesc:f$1,onClearSort:h,onHideColumn:p,onToggleGroup:v,onToggleSummary:y,onOpenSortDialog:g$1})=>{let{t:x}=de(),b=t?.columnId??"",C=r.find(T=>T.id===b),k=a.includes(b),w=i.includes(b),P=!!C?.numeric,I=l.find(T=>T.field===b),S=I?I.direction==="asc":d===b&&u==="asc",N=I?I.direction==="desc":d===b&&u==="desc",M=S||N;return g(Zt,{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:C?.label??b})}),f(Rt,{}),g("option",{onClick:()=>{m(b),o();},selected:S,children:[f(Ho,{children:f(Ys,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.sortAsc")})]}),g("option",{onClick:()=>{f$1(b),o();},selected:N,children:[f(Ho,{children:f(Xs,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.sortDesc")})]}),M&&g("option",{onClick:()=>{h(b),o();},children:[f(Ho,{children:f(Ad,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.clearSort")})]}),g("option",{onClick:()=>{g$1(),o();},children:[f(Ho,{children:f(Fr,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.configureSort")})]}),f(Rt,{}),g("option",{onClick:()=>{v(b),o();},selected:k,children:[f(Ho,{children:f(Cr,{fontSize:"small"})}),f($t,{primary:x(k?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),P&&s&&g("option",{onClick:()=>{y(b),o();},selected:w,children:[f(Ho,{children:f(nn,{fontSize:"small"})}),f($t,{primary:x(w?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),f(Rt,{}),g("option",{onClick:()=>{p(b),o();},children:[f(Ho,{children:f(ap,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.hideColumn")})]})]})},vp=({open:t,onClose:o,columns:r,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=de(),[l,d]=useState([]);useEffect(()=>{t&&d(n.length>0?n.map(y=>({...y})):[]);},[t,n]);let u=useMemo(()=>new Set(l.map(y=>y.field)),[l]),m=useMemo(()=>r.filter(y=>!u.has(y.id)),[r,u]),f$1=()=>{let y=m[0];y&&d(g=>[...g,{field:y.id,direction:"asc"}]);},h=y=>{d(g=>g.filter((x,b)=>b!==y));},p=(y,g)=>{d(x=>x.map((b,C)=>C===y?{...b,...g}:b));},v=(y,g)=>{d(x=>{let b=y+g;if(b<0||b>=x.length)return x;let C=[...x],[k]=C.splice(y,1);return C.splice(b,0,k),C});};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(ae,{className:"orb-table-sort-rules",spacing:1,children:l.map((y,g$1)=>{let x=new Set(l.filter((C,k)=>k!==g$1).map(C=>C.field)),b=r.filter(C=>!x.has(C.id));return g("div",{className:"orb-table-sort-rule",children:[f(qa,{className:"orb-table-sort-order",badgeContent:g$1+1,color:"primary"}),f(Ht,{size:"small",value:y.field,onChange:C=>p(g$1,{field:C.target.value}),options:b.map(C=>({value:C.id,label:C.label}))}),f(Ht,{size:"small",value:y.direction,onChange:C=>p(g$1,{direction:C.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),f(ne,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,-1),disabled:g$1===0,children:f(Ys,{fontSize:"small"})}),f(ne,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,1),disabled:g$1===l.length-1,children:f(Xs,{fontSize:"small"})}),f(ne,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>h(g$1),children:f(ja,{fontSize:"small"})})]},`sort-rule-${g$1}`)})}),f(Se,{size:"small",onClick:f$1,disabled:m.length===0,startIcon:f(Fr,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};var Qn=(t,o=2)=>t.toLocaleString(void 0,{maximumFractionDigits:o}),yp=({kpis:t})=>{let{t:o}=de(),r=[{label:o("graph.kpi.totalRecords"),value:Qn(t.totalRecords,0),color:"var(--orb-fg)"},{label:o("graph.kpi.totalReport"),value:Qn(t.totalReportHours),color:"var(--orb-fg)"},{label:o("graph.kpi.totalBillable"),value:Qn(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:Qn(t.totalAmount),color:"var(--orb-primary)"},{label:o("graph.kpi.flagged"),value:Qn(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 fi=({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(ae,{spacing:1,children:t.map(l=>g("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[f(E,{variant:"caption",muted:true,title:l.name,children:l.name}),f("div",{onClick:()=>i?.(l),sx:{alignSelf:"center",background:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1},children:f("div",{style:{width:`${l.value/s*100}%`,height:"100%",background:l.name===a?"primary.dark":"primary.main"}})}),g(E,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[l.value.toFixed(1),r]})]},l.name))})};var Cp=({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(h=>h.value),l=Math.min(...s,0),u=Math.max(...s,1)-l||1,m=t.map((h,p)=>{let v=i+p*(a-i*2)/Math.max(t.length-1,1),y=n-i-(h.value-l)/u*(n-i*2);return {x:v,y,...h}}),f$1=m.map(h=>`${h.x},${h.y}`).join(" ");return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[f("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),f("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:f$1}),m.map(h=>f("circle",{cx:h.x,cy:h.y,r:4,style:{fill:o}},h.name))]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(h=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:h.name,sx:{display:"block"},children:h.name}),g(E,{variant:"caption",muted:true,children:[h.value.toFixed(1),r]})]},h.name))})]})};var xp=({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,f)=>{let h=(a-i*2)/t.length,p=Math.max(h*.5,8),v=i+f*h+(h-p)/2,y=m.barValue/s*(n-i*2),g=n-i-y;return {x:v,y:g,barHeight:y,barWidth:p,item:m}}),u=t.map((m,f)=>{let h=(a-i*2)/t.length,p=i+f*h+h/2,v=n-i-m.lineValue/l*(n-i*2);return {x:p,y:v,item:m}});return g(ae,{spacing:1.25,children:[g("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[f("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),d.map(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 Ph=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)`},Sp=({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:Ph(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 Th=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],hi=({data:t,variant:o="donut",colors:r=Th,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(ae,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[f("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${l.join(", ")})`,position:"relative",flexShrink:0},children:o==="donut"&&f("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),f(ae,{spacing:1,sx:{minWidth:180},children:t.map((d,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 wp=({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(ae,{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 kp=({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(f=>{let h=f.type==="total"?0:r,p=f.type==="total"?f.value:r+f.value;return f.type!=="total"&&(r=p),{...f,start:h,end:p,delta:p-h}}),a=n.flatMap(f=>[f.start,f.end]),i=Math.min(...a,0),s=Math.max(...a,1),l=680,d=30,u=s-i||1,m=f=>o-d-(f-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((f$1,h)=>{let p=(l-d*2)/n.length,v=Math.max(p*.55,8),y=d+h*p+(p-v)/2,g$1=m(Math.max(f$1.start,f$1.end)),x=m(Math.min(f$1.start,f$1.end)),b=f$1.type==="total"?"var(--orb-chart-1)":f$1.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return g("g",{children:[f("rect",{x:y,y:g$1,width:v,height:Math.max(x-g$1,4),rx:6,style:{fill:b}}),f("text",{x:y+v/2,y:g$1-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:f$1.end.toFixed(1)})]},f$1.name)})]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(f$1=>f(E,{variant:"caption",title:f$1.name,children:f$1.name},f$1.name))})]})};var Jn=({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}`},MM=(t,o=360)=>{let r=Jn(t);return `<iframe width="100%" height="${o}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${r}"></iframe>`};var Pp=({apiKey:t,query:o,embedUrl:r,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=r||(t&&o?Jn({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 bi=({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 Tp=({keyword:t,location:o,embedUrl:r,height:n=320})=>{let a=r||bi({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 Ip=({billableByPrimary:t,efficiencyBySecondary:o,statusDistribution:r,interaction:n})=>{let{t:a}=de();return g("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[f(fi,{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(fi,{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(fi,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:f(hi,{data:r,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};var Mh=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Rh=["zh","en","de","fr","ja","ko"],Mp=({open:t,onClose:o,value:r,onSaveAll:n,modelOptions:a=Mh,promptLangOptions:i=Rh,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:u})=>{let[m,f$1]=useState(r),[h,p]=useState(d||""),[v,y]=useState(u||""),[g$1,x]=useState(false);useEffect(()=>{t&&(f$1(r),p(d||""),y(u||""));},[t,r,d,u]);let b=(k,w)=>{f$1(P=>({...P,[k]:w}));},C=async()=>{if(n)try{x(!0),await n({settings:m,analysisTemplateId:h||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(ne,{onClick:o,sx:{position:"absolute",right:12,top:12},children:f(xr,{})})]}),f("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:g(ae,{spacing:2.2,children:[g("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[f("div",{children:f(He,{size:"small",value: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:h,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(Bn,{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=>y(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(Bn,{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:C,disabled:!n||g$1,children:"Save"})]})]})};var yi=({open:t,onClose:o,model:r,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=de(),[d,u]=useState(s?.defaultPrompt||""),[m,f$1]=useState(false),[h,p]=useState(false),v=i?.enabled!==false&&!!i,y=s?.enabled!==false,g$1=i?.filters||{},x=!!(g$1.primaryDimension||g$1.secondaryDimension||g$1.status),b=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{t&&u(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let C=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},k=async()=>{let w=d.trim();if(!(!w||!s?.onSubmit))try{f$1(!0),await s.onSubmit(w,{filters:g$1,model:r});}finally{f$1(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(ae,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[g(ae,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[f(E,{variant:"h3",sx:{fontWeight:800},children: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(ae,{direction:"row",spacing:10,alignItems:"center",children:[y&&g("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",borderRadius:999,border:"1px solid var(--orb-border)",background:"var(--orb-surface)",minWidth:320},children:[f(ne,{size:"small",onClick:s?.onVoiceInput,children:f(Ma,{size:16,strokeWidth:1.8})}),f("input",{className:"orb-inp orb-inp-dense",value:d,onChange:w=>u(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),k());},placeholder:b,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),f(ne,{size:"small",onClick:k,disabled:m||!d.trim(),children:f(Lc,{size:16,strokeWidth:1.8})}),f(ne,{size:"small",onClick:()=>p(true),children:f(Jr,{size:16,strokeWidth:1.8})})]}),f(ne,{onClick:o,children:f(Yt,{size:18,strokeWidth:2})})]})]})}),g("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[f(yp,{kpis:r.kpis}),f(Ip,{billableByPrimary:r.charts.billableByPrimary,efficiencyBySecondary:r.charts.efficiencyBySecondary,statusDistribution:r.charts.statusDistribution,interaction:v?{filters:g$1,onPrimaryDimensionClick:w=>i?.onPrimaryDimensionClick(w),onSecondaryDimensionClick:w=>i?.onSecondaryDimensionClick(w),onStatusClick:w=>i?.onStatusClick(w)}:void 0}),a,n]}),f(Mp,{open:h,onClose:()=>p(false),value:C,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var 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"]},Nh=5,Rp=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=>[Rp(s),s]));for(let s of r){let l=i.get(Rp(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},mo=(t,o)=>t==null||t===""?o:String(t),Ah=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let l=mo(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)},Eh=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=mo(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)},Lh=(t,o,r)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=mo(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}))},Dp=(t,o,r)=>{let n=new Map;return t.forEach(a=>{let i=mo(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}))},Oh=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=mo(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)},Fh=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let l=mo(s[o],a),d=mo(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}})},Bh=(t,o,r)=>{let n=Dp(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"}]},Hh=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=mo(l[o],i),u=`${mo(l[r],i)} / ${mo(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}=de(),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,f)=>{let h=ko(m[a.reportHours]),p=ko(m[a.billableHours]),v=ko(m[a.amount]),y=h>0?p/h*100:0;return {id:`graph-row-${f}`,Date:mo(m[a.date],""),Primary:mo(m[a.primaryDimension],n),Secondary:mo(m[a.secondaryDimension],n),Description:mo(m[a.description],""),ReportHours:h,BillableHours:p,Amount:v,Efficiency:y,Status:mo(m[a.status],n)}}),[t,a,n]),s=useMemo(()=>{let m=i.length,f=i.reduce((x,b)=>x+ko(b.ReportHours),0),h=i.reduce((x,b)=>x+ko(b.BillableHours),0),p=i.reduce((x,b)=>x+ko(b.Amount),0),v=f>0?h/f*100:0,y=o?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>y.includes(mo(x.Status,"").toLowerCase())).length;return {totalRecords:m,totalReportHours:f,totalBillableHours:h,efficiency:v,totalAmount:p,flaggedCount:g}},[i,o?.statusFlagValues]),l=o?.topN||Nh,d=useMemo(()=>({billableByPrimary:Ah(i,"Primary","BillableHours",l,n),efficiencyBySecondary:Eh(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:Lh(i,"Status",n),lineByDate:Dp(i,"Date","BillableHours"),comboByPrimary:Oh(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:Fh(i,"Primary","Secondary","BillableHours",n),waterfallBillable:Bh(i,"Date","BillableHours"),fishboneStatusCauses:Hh(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(),xi=(t={})=>{let[o,r]=useState(t),n=useCallback((d,u)=>{r(m=>{let f=u?.trim();if(!f){let h={...m};return delete h[d],h}if(m[d]===f){let h={...m};return delete h[d],h}return {...m,[d]:f}});},[]),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 wi=({variants:t,currentVariantId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[l,d]=useState(false),[u,m]=useState(""),[f$1,h]=useState(false),[p,v]=useState(false),y=t.find(b=>b.id===o),g$1=()=>{m(y?.name||s("variant.newVariant")),h(y?.isDefault||false),v(y?.isPublic||false),d(true);},x=()=>{n({name:u,isDefault:f$1,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 C=t.find(k=>k.id===b.target.value);C&&r(C);}}),f(lt,{title:s("variant.saveView"),children:f(ne,{className:"orb-variant-save-button",onClick:g$1,size:"small",color:"primary",children:f(wr,{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(Xn,{control:f(Tt,{checked:f$1,onChange:b=>h(b.target.checked)}),label:s("variant.setDefault")}),f(Xn,{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 Ap=({appId:t,tableKey:o="default",currentFilters:r,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:l,onError:d,onSuccess:u,currentVariantId:m,onVariantChange:f$1})=>{let{t:h}=de(),[p,v]=useState([]),[y,g]=useState(""),x=`orbcafe.variants.${t}.${o}`,b=m!==void 0?m:y,C=D=>{m===void 0&&g(D),f$1&&f$1(D);},k=useCallback(()=>{try{let D=localStorage.getItem(x);if(!D)return [];let A=JSON.parse(D);return Array.isArray(A)?A:[]}catch{return []}},[x]),w=useCallback(D=>{try{localStorage.setItem(x,JSON.stringify(D));}catch{}},[x]),P=useCallback(D=>{v(D);let A=D.find(L=>L.isDefault);A&&!b&&(C(A.id),i(A));},[b,i,C]),I=useCallback(async()=>{if(!t)return [];try{let D=[];if(s)D=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(h("variant.toast.fetchFailed"));D=await A.json();}else D=k();return P(D),D}catch(D){console.error("Error fetching variants",D);let A=k();return P(A),d&&d(h("variant.toast.fetchFailed")),A}},[t,o,s,l,k,P,d,h]);return useEffect(()=>{I();},[t,o]),f(wi,{variants:p,currentVariantId:b,onLoad:D=>{C(D.id),i(D);},onSave:async D=>{let A=Date.now().toString(),L;try{let O=D.scope||"Both",_=p.find(Z=>Z.name===D.name);A=_?_.id:Date.now().toString();let F=[];if(_&&(Array.isArray(_.filters)?F=[..._.filters]:_.filters&&(F=[{scope:"default",filters:_.filters}])),O==="Search"||O==="Both"){let Z=(Array.isArray(r),r);if(Z)if(Array.isArray(Z)&&Z.length>0&&Z[0].scope)Z.forEach(z=>{let H=F.findIndex(U=>U.scope===z.scope);H>=0?F[H]=z:F.push(z);});else {let z={scope:o,filters:Z},H=F.findIndex(U=>U.scope===o);H>=0?F[H]=z:F.push(z);}}let X=_?.layout||{},V=[];if(_&&Array.isArray(_.layoutRefs)&&(V=[..._.layoutRefs]),O==="Layout"||O==="Both")if(a&&a.length>0)a.forEach(Z=>{let z=V.findIndex(H=>H.tableKey===Z.tableKey);z>=0?V[z]=Z:V.push(Z);});else {let Z={tableKey:o,layoutId:n||null},z=V.findIndex(H=>H.tableKey===o);z>=0?V[z]=Z:V.push(Z);}if(L={appId:t,tableKey:o,...D,scope:O,id:A,createdAt:new Date().toISOString(),filters:F,layout:X,layoutRefs:V},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(h("variant.toast.saveFailed"))}else {let z=p.some(H=>H.id===A)?p.map(H=>H.id===A?L:H):[...p,L];v(z),w(z);}u&&u(h("variant.toast.saveSuccess")),(s||l)&&await I(),C(A),i(L);}catch(O){console.error("Error saving variant",O);let F=p.some(X=>X.id===A)?p.map(X=>X.id===A?L:X):[...p,L];v(F),w(F),C(A),i(L),d&&d(h("variant.toast.saveFailed"));}},onDelete:async D=>{try{if(s)await s.deleteVariant(D);else if(l){if(!(await fetch(`${l}/api/variants/${D}`,{method:"DELETE"})).ok)throw new Error(h("variant.toast.deleteFailed"))}else {let A=p.filter(L=>L.id!==D);v(A),w(A);}b===D&&C(""),(s||l)&&I(),u&&u(h("variant.toast.deleteSuccess"));}catch(A){console.error("Error deleting variant",A);let L=p.filter(O=>O.id!==D);v(L),w(L),b===D&&C(""),d&&d(h("variant.toast.deleteFailed"));}},onSetDefault:async D=>{try{let A=p.find(O=>O.id===D);if(!A)return;let L={appId:t,tableKey:o,...A,isDefault:!0};if(s)await s.setDefaultVariant(D,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(h("variant.toast.defaultFailed"))}else {let O=p.map(_=>({..._,isDefault:_.id===D}));v(O),w(O);}(s||l)&&await I(),u&&u(h("variant.toast.defaultSuccess"));}catch(A){console.error("Error setting default variant",A);let L=p.map(O=>({...O,isDefault:O.id===D}));v(L),w(L),d&&d(h("variant.toast.defaultFailed"));}}})};or.extend(Gh);or.extend(Uh);or.extend(Df);var ta="YYYY-MM-DD",qh=[null,null],Hr="0.85rem",Xh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Yh=({isInRange:t,isStart:o,isEnd:r,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=ao();return f(Sd,{...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%"}:{}]})},Lp=({label:t,value:o=qh,onChange:r})=>{let{t:n,locale:a}=de(),i=Xh[a]||"en",s=t||n("dateRange.label"),[l,d]=useState(null),[u,m]=useState(o),[f$1,h]=useState("start"),[p,v]=useState(null),[y,g$1]=useState((o[0]||or()).locale(i)),[x,b]=useState(""),[C,k]=useState(""),[w,P]=useState(false),[I,S]=useState(false),N=jt__default.useRef(o);useEffect(()=>{let[Z,z]=o,[H,U]=N.current,K=pe=>pe&&typeof pe.isSame=="function",ge=!(Z===null&&H===null||K(Z)&&K(H)&&Z.isSame(H,"day")),ie=!(z===null&&U===null||K(z)&&K(U)&&z.isSame(U,"day"));(ge||ie)&&(m(o),o[0]&&K(o[0])&&g$1(o[0].locale(i))),N.current=o;},[o,i]),useEffect(()=>{b(u[0]?u[0].locale(i).format(ta):""),k(u[1]?u[1].locale(i).format(ta):""),P(false),S(false);},[u,i]);let M=(Z,z)=>{let H=z.trim(),U=Z==="start"?P:S;if(!H){let ie=Z==="start"?[null,u[1]]:[u[0],null];U(false),m(ie);return}let K=or(H,ta,true).locale(i);if(!K.isValid()){U(true);return}U(false);let ge=[...u];if(Z==="start")ge[0]=K,ge[1]&&K.isAfter(ge[1],"day")&&(ge[1]=null),h(ge[1]?"start":"end");else {let ie=ge[0];ie&&K.isBefore(ie,"day")?(ge=[K,null],h("end")):(ge[1]=K,h("start"));}m(ge),g$1(K);},T=Z=>{d(Z.currentTarget);},D=()=>{d(null),h("start"),v(null);},A=!!l,L=Z=>{if(!Z)return;let z=[...u];if(f$1==="start")z=[Z,null],h("end");else {let H=z[0];H&&Z.isBefore(H)?(z=[Z,null],h("end")):(z=[H,Z],h("start"));}m(z);},O=Z=>{let z=or().locale(i),H=[null,null];switch(Z){case "today":H=[z,z];break;case "week":H=[z.startOf("week"),z.endOf("week")];break;case "month":H=[z.startOf("month"),z.endOf("month")];break}m(H),h("start"),g$1(z);},_=()=>{r&&r(u),D();},F=()=>{m(o),h("start"),D();},X=useCallback(Z=>{let{day:z,...H}=Z,[U,K]=u,ge=U?z.isSame(U,"day"):false,ie=K?z.isSame(K,"day"):false,pe=U&&K?z.isBetween(U,K,"day","()"):false,xe=false;return f$1==="end"&&U&&!K&&p&&z.isAfter(U,"day")&&z.isBefore(p.add(1,"day"),"day")&&(xe=true),f(Yh,{...H,day:z,disableMargin:true,isStart:ge,isEnd:ie,isInRange:pe||xe,onMouseEnter:()=>v(z)})},[u,f$1,p]),V=Z=>Z?Z.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:Hr}},InputProps:{readOnly:true,sx:{fontSize:Hr,"& .orb-inp":{fontSize:Hr},paddingRight:"4px"},endAdornment:f(ne,{className:"orb-date-range-calendar-trigger",size:"small",onClick:T,tooltip:s,children:f(Pt,{name:"calendar",size:16})})}}),g(Ya,{open:A,anchorEl:l,onClose:D,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[f("div",{className:"orb-date-range-inputs",children:g(ae,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[f(He,{className:"orb-date-range-manual-field",label:n("dateRange.startDate"),placeholder:ta,value:x,error:w,size:"small",onFocus:()=>h("start"),onChange:Z=>{b(Z.target.value),w&&P(false);},onBlur:()=>M("start",x),onKeyDown:Z=>{Z.key==="Enter"&&(Z.preventDefault(),M("start",x));},sx:{"& .orb-inp":{fontSize:Hr,py:.75},"& label":{fontSize:Hr}}}),f(Td,{color:"action",fontSize:"small"}),f(He,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:ta,value:C,error:I,size:"small",onFocus:()=>{u[0]&&h("end");},onChange:Z=>{k(Z.target.value),I&&S(false);},onBlur:()=>M("end",C),onKeyDown:Z=>{Z.key==="Enter"&&(Z.preventDefault(),M("end",C));},sx:{"& .orb-inp":{fontSize:Hr,py:.75},"& label":{fontSize:Hr}}})]})}),f("div",{className:"orb-date-range-shortcuts",children:g(ae,{direction:"row",spacing:1,justifyContent:"center",children:[f(Ct,{label:n("dateRange.today"),onClick:()=>O("today"),clickable:true,size:"small",variant:"outlined"}),f(Ct,{label:n("dateRange.thisWeek"),onClick:()=>O("week"),clickable:true,size:"small",variant:"outlined"}),f(Ct,{label:n("dateRange.thisMonth"),onClick:()=>O("month"),clickable:true,size:"small",variant:"outlined"})]})}),f("div",{className:"orb-date-range-calendar",children:f(kd,{dateAdapter:Ua,adapterLocale:i,children:f(wd,{value:null,referenceDate:y,onMonthChange:g$1,onYearChange:g$1,onChange:L,slots:{day:X},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),f(Rt,{}),g(ae,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[f(Se,{size:"small",onClick:F,color:"inherit",children:n("common.cancel")}),f(Se,{size:"small",variant:"contained",onClick:_,children:n("common.done")})]})]})]})};var Pi={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},jh={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"},Jh=["contains","notContains",">",">=","<","<=","equals"],Fp=["=","!=",">","<",">=","<=","between"],to="0.85rem",eb=({field:t,value:o,onChange:r})=>{let{t:n}=de(),[a,i]=useState(null),[s,l]=useState(null),[d,u]=useState(null),[m,f$1]=useState(""),[h,p]=useState(""),[v,y]=useState(""),[g$1,x]=useState("");useEffect(()=>{let T=setTimeout(()=>{x(v);},1e3);return ()=>clearTimeout(T)},[v]);let b=o?.operator||(t.type==="number"?"=":"equals"),C=o?.value,k=T=>{let D=jh[T];return D?n(D):T},w=T=>{i(a?null:T.currentTarget);},P=T=>{r({...o,operator:T,value:C}),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"}}}}}},S=t.type||"text";if(S==="date"){let D=(A=>{if(!A)return [null,null];if(Array.isArray(A)&&A.length===2){let L=A[0]?or.isDayjs(A[0])?A[0]:or(A[0]):null,O=A[1]?or.isDayjs(A[1])?A[1]:or(A[1]):null;return [L,O]}return or.isDayjs(A)||typeof A=="string"?[or.isDayjs(A)?A:or(A),null]:[null,null]})(C);return f(Lp,{label:t.label,value:D,onChange:A=>r({value:A,operator:"between"})})}if(S==="number"&&b==="between"){let T=()=>{r({value:[m,h],operator:"between"}),l(null);},D=Array.isArray(C)?`${C[0]||""} - ${C[1]||""}`:"";return g(e,{children:[f(He,{...I,label:t.label,value:D,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...I.InputProps,startAdornment:f(ir,{position:"start",children:f(lt,{title:k("between"),children:f(ne,{size:"small",onClick:w,sx:{width:24,height:24,fontSize:to},children:Pi.between})})}),readOnly:true},onClick:A=>l(s?null:A.currentTarget)}),f(Zt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:to,minHeight:"auto",py:.5}}},children:Fp.map(A=>g("option",{selected:A===b,onClick:()=>P(A),children:[f("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Pi[A]}),f($t,{primary:k(A),primaryTypographyProps:{fontSize:to}})]},A))}),f(Ya,{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=>f$1(A.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:to}},InputProps:{sx:{fontSize:to}}}),f(Id,{color:"action"}),f(He,{size:"small",label:n("smartFilter.max"),type:"number",value:h,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||S==="value-help"){let T=t.valueHelp?.mode||"single";return f(dp,{...I,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:C??(T==="multiple"?[]:null),mode:T,onChange:D=>r({value:D,operator:T==="multiple"?"anyOf":"equals"})})}if(S==="select")return g(Ht,{size:"small",fullWidth:true,label:t.label,value:C||"",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(S==="multi-select"){let T=Array.isArray(C)?C:[],D=t.options?.filter(X=>X.label.toLowerCase().includes(g$1.toLowerCase()))||[],A=X=>t.options?.find(V=>V.value===X)?.label||X,L=T.map(A),O=L.length===0?n("common.none"):L.length>2?`${L.slice(0,2).join(", ")} +${L.length-2}`:L.join(", "),_=()=>{u(null),y(""),x("");},F=X=>{let V=T.includes(X)?T.filter(Z=>Z!==X):[...T,X];r({...o,value:V,operator:"anyOf"});};return g("div",{className:"orb-fld",children:[f("label",{children:t.label}),g(Se,{variant:"outlined",size:"small",onClick:X=>u(d?null:X.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:to,fontWeight:400},children:[f("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:O}),f(zo,{fontSize:"small"})]}),f(Zt,{anchorEl:d,open:!!d,onClose:_,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:g("div",{onClick:X=>X.stopPropagation(),sx:{display:"grid",gap:.35},children:[f(He,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:f(ir,{position:"start",children:f(Br,{fontSize:"small"})}),sx:{fontSize:to}},value:v,onChange:X=>y(X.target.value),onKeyDown:X=>X.stopPropagation()}),D.length>0?D.map(X=>{let V=T.includes(X.value);return g("div",{role:"option","aria-selected":V,tabIndex:0,className:`orb-menu-item ${V?"orb-selected":""}`,onClick:()=>F(X.value),onKeyDown:Z=>{(Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),F(X.value));},children:[f(Tt,{checked:V,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),f($t,{primary:X.label})]},String(X.value))}):f("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let N=S==="number"?Fp:Jh;return g(e,{children:[f(He,{...I,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:C||"",type:S==="number"?"number":"text",onChange:T=>r({...o,value:T.target.value,operator:b}),InputProps:{...I.InputProps,startAdornment:f(ir,{position:"start",children:f(lt,{title:k(b),children:f(ne,{className:"orb-filter-operator-trigger",size:"small",onClick:w,onMouseDown:T=>T.preventDefault(),sx:{width:24,height:24,fontSize:to,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Pi[b]})})}),endAdornment:t.hasSearchIcon?f(ir,{position:"end",children:f(Br,{color:"action"})}):void 0}}),f(Zt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:to,minHeight:"auto",py:.5}}},children:N.map(T=>g("option",{selected:T===b,onClick:()=>P(T),children:[f("span",{className:"orb-filter-operator-symbol",children:Pi[T]}),f($t,{primary:k(T),primaryTypographyProps:{fontSize:to}})]},T))})]})},Vo=({fields:t,filters:o,onFilterChange:r,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:l,onVariantSetDefault:d,onSearch:u,loading:m=false,appId:f$1,tableKey:h,currentLayout:p,currentLayoutId:v,layoutRefs:y,variantService:g$1,serviceUrl:x})=>{let{t:b}=de(),[C,k]=useState(true),[w,P]=useState(null),[I,S]=useState(t.filter(D=>!D.hidden).map(D=>D.id)),N=(D,A)=>{r({...o,[D]:A});},M=D=>{I.includes(D)?S(I.filter(A=>A!==D)):S([...I,D]);};return g(Ne,{className:`orb-smart-filter ${C?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[C?g(e,{children:[g("div",{className:"orb-smart-filter-header",children:[f$1?f(Ap,{appId:f$1,tableKey:h,currentFilters:{values:o,visibleFields:I},currentLayout:p,currentLayoutId:v,layoutRefs:y,onLoad:D=>{if(!D.filters)return;let A=null;if(Array.isArray(D.filters)){let L=h||"default",O=D.filters.find(_=>_.scope===L);A=O?O.filters:null;}else A=D.filters;A&&(A.values||A.visibleFields?(A.visibleFields&&Array.isArray(A.visibleFields)&&S(A.visibleFields),A.values&&r(A.values)):r(A)),i&&i(D);},variantService:g$1,serviceUrl:x,currentVariantId:a}):f(wi,{variants:n,currentVariantId:a,onLoad:i,onSave:D=>{s&&s({...D,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:D=>P(w?null:D.currentTarget),size:"small",color:"primary",startIcon:f(jd,{fontSize:"small"}),sx:{textTransform:"none",fontSize:to,whiteSpace:"nowrap",minWidth:"fit-content"},children:b("smartFilter.adaptFilters")})}),f(ne,{className:"orb-smart-filter-go",tooltip:b("smartFilter.go"),"aria-label":b("smartFilter.go"),onClick:u,disabled:m,children:m?f(qo,{size:16}):f(Pt,{name:"play",size:16})}),g(Zt,{anchorEl:w,open:!!w,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(D=>g("option",{onClick:()=>M(D.id),children:[f(Tt,{checked:I.includes(D.id),size:"small"}),f($t,{primary:D.label,primaryTypographyProps:{fontSize:to}})]},D.id))]})]})]}),f("div",{className:"orb-smart-filter-grid",children:f(qs,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(D=>I.includes(D.id)).map(D=>f(qs,{size:1,children:f(eb,{field:D,value:o[D.id]||{value:"",operator:D.type==="number"?"=":"equals"},onChange:A=>N(D.id,A)})},D.id))})})]}):null,f("div",{className:"orb-smart-filter-toggle",children:f(ne,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>k(!C),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:C?f(Ja,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):f(zo,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};var Bp=({layouts:t,currentLayoutId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[l,d]=useState(null),[u,m]=useState(false),[f$1,h]=useState(""),[p,v]=useState(""),[y,g$1]=useState({isDefault:false,isPublic:false}),x=t.find(I=>I.id===o),b=I=>{d(I.currentTarget);},C=()=>{d(null);},k=I=>{r(I),C();},w=()=>{h(""),v(""),g$1({isDefault:false,isPublic:false}),m(true),C();},P=()=>{f$1.trim()&&(n({name:f$1,description:p,...y}),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(ne,{onClick:b,color:x?"primary":"default",size:"small",children:f(np,{fontSize:"small"})})}),g(Zt,{anchorEl:l,open:!!l,onClose:C,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[f("option",{disabled:true,children:f(E,{variant:"caption",children:s("layout.selectLayout")})}),g("option",{onClick:w,children:[f(Ho,{children:f(wr,{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,S)=>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:N=>N.stopPropagation(),children:[f(lt,{title:I.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:f(ne,{size:"small",onClick:N=>{N.stopPropagation(),i(I.id);},children:I.isDefault?f(tp,{fontSize:"small",color:"warning"}):f(ep,{fontSize:"small"})})}),f(lt,{title:s("common.delete"),children:f(ne,{size:"small",color:"error",onClick:N=>{N.stopPropagation(),a(I.id);},children:f(Qa,{fontSize:"small"})})})]})]})},I.id||S))]}),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:!f$1.trim(),children:s("common.save")})]}),children:g("div",{className:"orb-layout-save-form",children:[f(He,{label:s("layout.layoutName"),value:f$1,onChange:I=>h(I.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(I=>I.name===f$1)&&f(E,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),f(He,{label:s("layout.layoutDescription"),value:p,onChange:I=>v(I.target.value),fullWidth:true,size:"small"}),f(Tt,{className:"orb-layout-save-option",checked:y.isDefault,onChange:I=>g$1({...y,isDefault:I.target.checked}),label:s("layout.useAsDefault")}),f(Tt,{className:"orb-layout-save-option",checked:y.isPublic,onChange:I=>g$1({...y,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}=de(),[m,f$1]=useState([]),[h,p]=useState(""),v=`orbcafe.layouts.${t}.${o}`,y=S=>({id:S.layoutId,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt??new Date().toISOString(),layoutData:S.layout??{}}),g=S=>({appId:t,tableKey:o,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),x=useCallback(()=>{try{let S=localStorage.getItem(v);if(!S)return [];let N=JSON.parse(S);return Array.isArray(N)?N:[]}catch{return []}},[v]),b=useCallback(S=>{try{localStorage.setItem(v,JSON.stringify(S));}catch{}},[v]);useEffect(()=>{i!==void 0&&p(i);},[i]),useEffect(()=>{if(a&&m.length>0){let S=m.find(N=>N.id===a);S&&(p(S.id),n(S));}},[a,m,n]);let C=useCallback(async()=>{if(t){if(!s){let S=x();f$1(S);let N=S.find(M=>M.isDefault);N&&!h&&!a&&(p(N.id),n(N));return}try{let S=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let M=(await S.json()).map(y);f$1(M);let T=M.find(D=>D.isDefault);T&&!h&&!a&&(p(T.id),n(T));}catch(S){console.error("Error fetching layouts",S);let N=x();f$1(N);let M=N.find(T=>T.isDefault);M&&!h&&!a&&(p(M.id),n(M)),l&&l(u("layout.toast.loadFallback"));}}},[t,o,s,l,h,n,a,x,u]);return useEffect(()=>{C();},[t,o]),f(Bp,{layouts:m,currentLayoutId:h,onLoad:S=>{p(S.id),n(S);},onSave:async S=>{let N=m.find(D=>D.name===S.name),M=N?N.id:Date.now().toString(),T={id:M,...S,createdAt:new Date().toISOString(),layoutData:r,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!s){let A=m.some(L=>L.id===M)?m.map(L=>L.id===M?T:L):[...m,T];f$1(A),b(A),p(M),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 C(),p(M),n(T);}catch(D){console.error("Error saving layout",D);let L=m.some(O=>O.id===M)?m.map(O=>O.id===M?T:O):[...m,T];f$1(L),b(L),p(M),n(T),d&&d(u("layout.toast.saveLocalSuccess")),l&&l(u("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!s){let N=m.filter(M=>M.id!==S);f$1(N),b(N),h===S&&p(""),d&&d(u("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");h===S&&p(""),d&&d(u("layout.toast.deleteSuccess")),await C();}catch(N){console.error("Error deleting layout",N);let M=m.filter(T=>T.id!==S);f$1(M),b(M),h===S&&p(""),d&&d(u("layout.toast.deleteLocalSuccess")),l&&l(u("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!s){let N=m.map(M=>({...M,isDefault:M.id===S}));f$1(N),b(N),d&&d(u("layout.toast.defaultLocalSuccess"));return}try{let N=m.find(T=>T.id===S);if(!N)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...N,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(u("layout.toast.defaultSuccess")),await C();}catch(N){console.error("Error setting default",N);let M=m.map(T=>({...T,isDefault:T.id===S}));f$1(M),b(M),d&&d(u("layout.toast.defaultLocalSuccess")),l&&l(u("layout.toast.backendUnavailableDefaultLocal"));}}})};var Ti=(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},Ii=(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 zp(t,o,r){return o[r]<t[r]?-1:o[r]>t[r]?1:0}function tb(t,o){return t==="desc"?(r,n)=>zp(r,n,o):(r,n)=>-zp(r,n,o)}function ob(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(Y=>{let Q=String(Y?.label??Y?.id??"").length*9+64,fe=typeof Y?.minWidth=="number"?Y.minWidth:0;return Math.max(100,fe,Q)},[]),a=useCallback(()=>(t.columns||[]).filter(Y=>!!Y?.numeric).map(Y=>Y.id),[t.columns]),[i,s]=useState(""),[l,d]=useState(t.order||"asc"),[u,m]=useState(t.orderBy||""),[f,h]=useState([]),[p,v]=useState(t.page||0),[y,g]=useState(t.rowsPerPage||20),[x,b]=useState(t.selected||[]),[C,k]=useState(t.columns?t.columns.map(Y=>Y.id):[]),[w,P]=useState(t.columns?t.columns.map(Y=>Y.id):[]),[I,S]=useState(t.showSummary||false),[N,M]=useState(()=>a()),[T,D]=useState([]),[A,L]=useState(new Set),[O,_]=useState(()=>{let Y={};return (t.columns||[]).forEach(W=>{Y[W.id]=n(W);}),Y}),[F,X]=useState(null),[V,Z]=useState(null),[z,H]=useState(null),[U,K]=useState(null),[ge,ie]=useState(false),[pe,xe]=useState(""),[We,we]=useState(""),se=o?[]:T,Ae=useCallback(Y=>{if(o){D([]),L(new Set),Z(null);return}D(Y);},[o]);useEffect(()=>{o&&(D([]),L(new Set),Z(null));},[o]),useEffect(()=>{r&&(d("asc"),m(""),h([]));},[r]),useEffect(()=>{t.layout&&St(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 Y=a();M(W=>W.filter(fe=>Y.includes(fe)));},[a]),useEffect(()=>{_(Y=>{let W={...Y};return (t.columns||[]).forEach(Q=>{W[Q.id]===void 0&&(W[Q.id]=n(Q));}),W});},[t.columns,n]),useEffect(()=>{P(Y=>{let W=(t.columns||[]).map(Ke=>Ke.id),Q=new Set(W),fe=Y.filter(Ke=>Q.has(Ke)),ye=new Set(fe),Ee=W.filter(Ke=>!ye.has(Ke)),$e=[...fe,...Ee];return $e.length===Y.length&&$e.every((Ke,Ze)=>Ke===Y[Ze])?Y:$e});},[t.columns]);let Ie=useMemo(()=>{let Y=t.columns||[];if(w.length===0)return Y;let W=new Map(Y.map(ye=>[ye.id,ye])),Q=[],fe=new Set;return w.forEach(ye=>{let Ee=W.get(ye);Ee&&(Q.push(Ee),fe.add(ye));}),Y.forEach(ye=>{fe.has(ye.id)||Q.push(ye);}),Q},[t.columns,w]),ke=useMemo(()=>{let Y=t.rows||[];return i&&(Y=Y.filter(W=>Object.keys(W).some(Q=>String(W[Q]).toLowerCase().includes(i.toLowerCase())))),Y},[t.rows,i]),ze=useMemo(()=>{if(r||t.onSortChange)return ke;if(f.length>0){let Y=[...ke];return Y.sort((W,Q)=>{for(let fe of f){let ye=W?.[fe.field],Ee=Q?.[fe.field];if(!(ye==null&&Ee==null)){if(ye==null)return fe.direction==="asc"?-1:1;if(Ee==null)return fe.direction==="asc"?1:-1;if(ye<Ee)return fe.direction==="asc"?-1:1;if(ye>Ee)return fe.direction==="asc"?1:-1}}return 0}),Y}return u?ob(ke,tb(l,u)):ke},[ke,l,u,f,t.onSortChange,r]),et=useCallback(Y=>{if(se.length===0)return Y.map(Ee=>({type:"row",data:Ee,id:Ee[t.rowKey||"id"]}));let W=[...Y].sort((Ee,$e)=>{for(let Ke of se){if(Ee[Ke]<$e[Ke])return -1;if(Ee[Ke]>$e[Ke])return 1}return 0}),Q=(Ee,$e=0)=>{if($e>=se.length)return Ee;let Ke=se[$e],Ze={},ut=[];return Ee.forEach(gt=>{let Mt=gt[Ke],bt=`${Ke}:${Mt}`;Ze[bt]||(Ze[bt]={key:bt,field:Ke,value:Mt,children:[],count:0,level:$e},ut.push(Ze[bt])),Ze[bt].children.push(gt),Ze[bt].count++;}),ut.forEach(gt=>{gt.children&&(gt.children=Q(gt.children,$e+1));}),ut},fe=Q(W),ye=(Ee,$e="")=>{let Ke=[];return Ee.forEach(Ze=>{if(Ze.children){let ut=$e?`${$e}>${Ze.key}`:Ze.key,gt=A.has(ut);Ke.push({type:"group",id:ut,field:Ze.field,value:Ze.value,level:Ze.level,count:Ze.count,isExpanded:gt,childIds:(function Mt(bt){let B=[];return bt.children.forEach(j=>{j.children?B=B.concat(Mt(j)):B.push(j[t.rowKey||"id"]);}),B})(Ze)}),gt&&(Ke=Ke.concat(ye(Ze.children,ut)));}else Ke.push({type:"row",data:Ze,id:Ze[t.rowKey||"id"],level:se.length});}),Ke};return ye(fe)},[se,A,t.rowKey]),rt=useCallback(Y=>{if(se.length===0)return [];let W=[...Y].sort((ye,Ee)=>{for(let $e of se){if(ye[$e]<Ee[$e])return -1;if(ye[$e]>Ee[$e])return 1}return 0}),Q=[],fe=(ye,Ee,$e)=>{if(Ee>=se.length)return;let Ke=se[Ee],Ze=new Map;ye.forEach(ut=>{let gt=ut[Ke],Mt=Ze.get(gt);Mt?Mt.push(ut):Ze.set(gt,[ut]);}),Ze.forEach((ut,gt)=>{let Mt=`${Ke}:${gt}`,bt=$e?`${$e}>${Mt}`:Mt;Q.push(bt),fe(ut,Ee+1,bt);});};return fe(W,0,""),Q},[se]),at=useMemo(()=>et(ze),[ze,et]),q=useMemo(()=>rt(ze),[ze,rt]),Re=useMemo(()=>{let Y=(t.rows||[]).length;return typeof t.count=="number"&&t.count>Y},[t.count,t.rows]),ve=useMemo(()=>Re?at:y>0?at.slice(p*y,p*y+y):at,[at,p,y,Re]),Fe=useMemo(()=>Re&&typeof t.count=="number"?t.count:at.length,[at.length,Re,t.count]),nt=Y=>{L(W=>{let Q=new Set(W);return Q.has(Y)?Q.delete(Y):Q.add(Y),Q});},Ye=Y=>{let W=q.filter(Q=>Q===Y||Q.startsWith(`${Y}>`));L(Q=>{let fe=new Set(Q);return W.forEach(ye=>fe.add(ye)),fe});},xt=Y=>{L(W=>{let Q=new Set(W);return Array.from(Q).forEach(fe=>{(fe===Y||fe.startsWith(`${Y}>`))&&Q.delete(fe);}),Q});},It=Y=>{if(!Y){L(new Set);return}L(new Set(q));},Lt=Y=>{let W=q.filter(Q=>Q.startsWith(`${Y}>`));return W.length===0?A.has(Y):A.has(Y)&&W.every(Q=>A.has(Q))},Nt=Y=>{if(r)return;f.length>0&&h([]);let W=u===Y&&l==="asc",Q=u===Y&&l==="desc";if(t.onSortChange){W?t.onSortChange(Y,"desc"):Q?t.onSortChange("","asc"):t.onSortChange(Y,"asc");return}W?(d("desc"),m(Y)):Q?(d("asc"),m("")):(d("asc"),m(Y));},te=Y=>{if(r){d("asc"),m(""),h([]);return}let W=Y.filter(Q=>Q&&Q.field);h(W),W.length>0&&m("");},Ge=()=>{h([]);},Oe=(Y,W)=>{_(Q=>({...Q,[Y]:W}));},le=Y=>{if(Y.target.checked){let W=ke.map(Q=>Q[t.rowKey||"id"]);b(W),t.onSelectionChange&&t.onSelectionChange(W);return}b([]),t.onSelectionChange&&t.onSelectionChange([]);},be=(Y,W)=>{let Q=W[t.rowKey||"id"],fe=x.indexOf(Q),ye=[];fe===-1?ye=ye.concat(x,Q):fe===0?ye=ye.concat(x.slice(1)):fe===x.length-1?ye=ye.concat(x.slice(0,-1)):fe>0&&(ye=ye.concat(x.slice(0,fe),x.slice(fe+1))),b(ye),t.onSelectionChange&&t.onSelectionChange(ye);},ee=Y=>{v(Y),t.onPageChange&&t.onPageChange(Y);},he=Y=>{g(Y),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(Y);},De=Y=>{let W=C.indexOf(Y),Q=[...C];W===-1?Q.push(Y):Q.splice(W,1),k(Q);},je=Y=>{if(o)return;let W=se.indexOf(Y),Q=[...se];W===-1?Q.push(Y):Q.splice(W,1),Ae(Q);},it=Y=>{a().includes(Y)&&M(Q=>Q.includes(Y)?Q.filter(fe=>fe!==Y):[...Q,Y]);},dt=(Y,W)=>{!Y||!W||Y===W||P(Q=>{let fe=Q.indexOf(Y),ye=Q.indexOf(W);if(fe===-1||ye===-1)return Q;let Ee=[...Q];return Ee.splice(fe,1),Ee.splice(ye,0,Y),Ee});},Ft=Y=>{let W=Y?.active?.id,Q=Y?.over?.id;typeof W=="string"&&typeof Q=="string"&&dt(W,Q);},Kt=Y=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:C,columnOrder:w,order:r?"asc":l,orderBy:r?"":u,sortBy:r?[]:f,grouping:se,columnWidths:O,showSummary:I,summaryColumns:N});},zt=Y=>{let{layout:W,layoutId:Q}=Ii(Y,t.tableKey||"default");Q?(we(Q),xe(Q)):(we(""),xe("")),W&&(W.visibleColumns&&k(W.visibleColumns),Array.isArray(W.columnOrder)&&P(W.columnOrder),r?(d("asc"),m(""),h([])):(W.order&&d(W.order),W.orderBy&&m(W.orderBy),Array.isArray(W.sortBy)&&h(W.sortBy)),W.grouping&&Ae(W.grouping),W.columnWidths&&_(W.columnWidths),W.showSummary!==void 0&&S(!!W.showSummary),Array.isArray(W.summaryColumns)&&M(W.summaryColumns));},St=Y=>{let W=Y?.layoutData||Y?.layout||Y||{};W.visibleColumns&&k(W.visibleColumns),Array.isArray(W.columnOrder)&&P(W.columnOrder),r?(d("asc"),m(""),h([])):(W.order&&d(W.order),W.orderBy!==void 0&&m(W.orderBy),Array.isArray(W.sortBy)&&h(W.sortBy)),W.grouping&&Ae(W.grouping),W.columnWidths&&_(W.columnWidths),W.showSummary!==void 0&&S(!!W.showSummary),Array.isArray(W.summaryColumns)&&M(W.summaryColumns),L(new Set),v(0),Y?.id&&xe(Y.id),we("");};useEffect(()=>{t.layout&&zt({layout:t.layout});},[t.layout]);let Vt=Y=>{Y.preventDefault(),K(U===null?{mouseX:Y.clientX+2,mouseY:Y.clientY-6}:null);},ht=()=>{K(null);},Dt=useMemo(()=>{if(!I)return {};let Y={};t.columns.forEach(Q=>{if(Q.numeric&&N.includes(Q.id)){let fe=ke.reduce((ye,Ee)=>{let $e=parseFloat(Ee[Q.id]);return ye+(isNaN($e)?0:$e)},0);Y[Q.id]=fe.toFixed(2);}else Y[Q.id]="";});let W=t.columns.find(Q=>C.includes(Q.id)&&!Q.numeric);return W&&!W.numeric&&(Y[W.id]="Total"),Y},[ke,t.columns,I,N,C]),st=()=>{if(!t.columns||!ke)return;let Y=t.columns.map(Ee=>Ee.label).join(","),W=ke.map(Ee=>t.columns.map($e=>{let Ke=Ee[$e.id];return `"${(Ke==null?"":String(Ke)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
2
|
-
`),
|
|
3
|
-
${W}`,fe=encodeURI(Q),ye=document.createElement("a");ye.setAttribute("href",fe),ye.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(ye),ye.click(),document.body.removeChild(ye);},Ot=()=>{ie(true);},qt=()=>{ie(false);};return {isMobile:false,columns:Ie,order:l,setOrder:d,orderBy:u,setOrderBy:m,sortBy:f,setSortBy:h,applyMultiSort:te,clearMultiSort:Ge,columnOrder:w,setColumnOrder:P,filterText:i,setFilterText:s,visibleColumns:C,setVisibleColumns:k,showSummary:I,setShowSummary:S,summaryColumns:N,grouping:se,setGrouping:Ae,expandedGroups:A,setExpandedGroups:L,groupAnchorEl:V,setGroupAnchorEl:Z,summaryAnchorEl:z,setSummaryAnchorEl:H,columnWidths:O,setColumnWidths:_,anchorEl:F,setAnchorEl:X,contextMenu:U,setContextMenu:K,sensors:void 0,sortedAndFilteredRows:ze,visibleRows:ve,summaryRow:Dt,page:p,setPage:ee,rowsPerPage:y,setRowsPerPage:he,totalDisplayCount:Fe,selected:x,setSelected:b,isAllExpanded:q.length>0&&q.every(Y=>A.has(Y)),handleColumnResize:Oe,handleRequestSort:Nt,handleSelectAllClick:le,handleClick:be,toggleSummaryColumn:it,handleDragEnd:Ft,handleColumnReorder:dt,handleExport:st,handleContextMenu:Vt,handleCloseContextMenu:ht,toggleColumnVisibility:De,toggleGroupExpand:nt,toggleGroupField:je,handleToggleAll:It,handleExpandGroupRecursively:Ye,handleCollapseGroupRecursively:xt,isGroupFullyExpanded:Lt,handleLayoutLoad:St,handleVariantLoad:zt,handleLayoutSave:Kt,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:C,order:r?"asc":l,orderBy:r?"":u,sortBy:r?[]:f,columnOrder:w,grouping:se,columnWidths:O,showSummary:I,summaryColumns:N},currentLayoutId:pe,layoutIdToLoad:We,onPageChange:ee,onRowsPerPageChange:he,graphReportOpen:ge,handleOpenGraphReport:Ot,handleCloseGraphReport:qt}};var A1=t=>f("tbody",{...t}),E1=({align:t,...o})=>f("td",{align:t==="inherit"?void 0:t,...o}),L1=t=>f("div",{...t}),O1=t=>f("thead",{...t}),F1=t=>f("tr",{...t}),jo=t=>{let{t:o}=de(),r="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:u,fitContainer:m=false,fullWidth:f$1=false,maxHeight:h,loading:p=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g$1,rowKey:x,tableKey:b="default",graphReport:C,quickCreate:k,quickEdit:w,quickDelete:P,serviceUrl:I,disableGrouping:S=false,disableSorting:N=false}=t,M=n||o("table.title.default"),{isMobile:T,columns:D,order:A,orderBy:L,filterText:O,setFilterText:_,visibleColumns:F,showSummary:X,setShowSummary:V,summaryColumns:Z,grouping:z,setGrouping:H,expandedGroups:U,groupAnchorEl:K,setGroupAnchorEl:ge,summaryAnchorEl:ie,setSummaryAnchorEl:pe,columnWidths:xe,anchorEl:We,setAnchorEl:we,contextMenu:se,sensors:Ae,sortedAndFilteredRows:Ie,summaryRow:ke,visibleRows:ze,isAllExpanded:et,page:rt,setPage:at,rowsPerPage:q,setRowsPerPage:Re,totalDisplayCount:ve,setSelected:Fe,handleColumnResize:nt,handleRequestSort:Ye,handleSelectAllClick:xt,handleClick:It,toggleSummaryColumn:Lt,handleDragEnd:Nt,handleExport:te,handleContextMenu:Ge,handleCloseContextMenu:Oe,toggleColumnVisibility:le,toggleGroupExpand:be,handleToggleAll:ee,handleExpandGroupRecursively:he,handleCollapseGroupRecursively:De,isGroupFullyExpanded:je,handleLayoutLoad:it,handleVariantLoad:dt,handleLayoutSave:Ft,effectiveAppId:Kt,currentLayoutData:zt,currentLayoutId:St,layoutIdToLoad:Vt,graphReportOpen:ht,handleOpenGraphReport:Dt,handleCloseGraphReport:st}=fn(t),Ot=C?.enabled??false,qt=Ot&&(C?.interaction?.enabled??true),Y=xi(),W=!!k?.enabled,Q=!!w?.enabled,fe=!!P?.enabled,ye=k?.fields,Ee=k?.excludeFields||[],$e=k?.initialValues||{},[Ke,Ze]=jt__default.useState(false),[ut,gt]=jt__default.useState(false),[Mt,bt]=jt__default.useState({}),[B,j]=jt__default.useState(false),[me,Pe]=jt__default.useState(false),[Je,qe]=jt__default.useState({}),[wt,ft]=jt__default.useState(false),[mt,yt]=jt__default.useState(false),oo=p||ut||me||mt,At=jt__default.useMemo(()=>{let oe=[...D];if(Array.isArray(ye)&&ye.length>0){let ue=new Set(ye);oe=oe.filter(J=>ue.has(J.id));}if(Ee.length>0){let ue=new Set(Ee);oe=oe.filter(J=>!ue.has(J.id));}return oe.filter(ue=>!!ue?.id)},[D,Ee,ye]),Xt=x||"id",Bt=jt__default.useMemo(()=>{let oe=new Set(s);return Ie.filter(ue=>oe.has(ue?.[Xt]))},[s,Ie,Xt]),Gt=Bt.length===1?Bt[0]:null,Wt=w?.fields,eo=w?.excludeFields||[],ro=w?.editableFields||[],go=w?.nonEditableFields||[],To=w?.primaryKeys?.length?w.primaryKeys:[Xt],Io=jt__default.useMemo(()=>{let oe=[...D];if(Array.isArray(Wt)&&Wt.length>0){let ue=new Set(Wt);oe=oe.filter(J=>ue.has(J.id));}if(eo.length>0){let ue=new Set(eo);oe=oe.filter(J=>!ue.has(J.id));}return oe.filter(ue=>!!ue?.id)},[D,eo,Wt]),rr=jt__default.useMemo(()=>new Set(To),[To]),vo=jt__default.useMemo(()=>new Set(ro),[ro]),Lo=jt__default.useMemo(()=>new Set(go),[go]),Ur=jt__default.useCallback(oe=>vo.size>0?vo.has(oe):!(Lo.has(oe)||rr.has(oe)),[vo,Lo,rr]);jt__default.useEffect(()=>{!ht&&Y.hasActiveFilters&&Y.clearAll();},[ht,Y.hasActiveFilters,Y.clearAll]);let Kr=()=>{let oe={};At.forEach(ue=>{oe[ue.id]=$e[ue.id]??"";}),bt(oe),Ze(true);},Ar=()=>{ut||Ze(false);},qr=(oe,ue)=>{bt(J=>({...J,[oe]:ue}));},Xr=async()=>{if(!k?.onSubmit){Ze(false);return}try{gt(!0),await k.onSubmit(Mt),Ze(!1);}finally{gt(false);}},Mo=()=>{if(!Gt)return;let oe={};Io.forEach(J=>{oe[J.id]=Gt[J.id]??"";});let ue=w?.getInitialValues?{...oe,...w.getInitialValues(Gt)}:oe;qe(ue),j(true);},Er=()=>{me||j(false);},Yr=(oe,ue)=>{qe(J=>({...J,[oe]:ue}));},Uo=async()=>{if(Gt){if(!w?.onSubmit){j(false);return}try{Pe(!0),await w.onSubmit(Je,Gt),j(!1);}finally{Pe(false);}}},nr=()=>{Bt.length!==0&&ft(true);},Nn=()=>{mt||ft(false);},Lr=async()=>{if(Bt.length===0){ft(false);return}if(!P?.onConfirm){ft(false),Fe([]),l?.([]);return}try{yt(!0),await P.onConfirm(Bt),ft(!1),Fe([]),l?.([]);}finally{yt(false);}},R=Ie,{fieldMapping:$}=pn({rows:R,config:{...C,title:C?.title||`${M} ${o("graph.reportTitle")}`}}),G=jt__default.useMemo(()=>qt?Y.applyRows(R,$):R,[qt,Y.applyRows,R,$]),{model:ce}=pn({rows:G,config:{...C,title:C?.title||`${M} ${o("graph.reportTitle")}`,fieldMapping:$}}),Be=ce.table.columns.map(oe=>({id:oe.id,label:oe.label,align:oe.align||"left",minWidth:120,numeric:oe.align==="right"})),ot=Kt?f(gn,{appId:Kt,tableKey:b,currentLayoutData:zt,onLayoutLoad:it,targetLayoutId:Vt,activeLayoutId:St,serviceUrl:I??g$1?.serviceUrl}):null,_e=g(e,{children:[!S&&f(cn,{groupAnchorEl:K,setGroupAnchorEl:ge,grouping:z,setGrouping:H,columns:D}),f(dn,{anchorEl:We,setAnchorEl:we,columns:D,visibleColumns:F,toggleColumnVisibility:le}),f(mi,{anchorEl:ie,setAnchorEl:pe,showSummary:X,setShowSummary:V,columns:D,summaryColumns:Z,toggleSummaryColumn:Lt}),f(gi,{contextMenu:se,handleCloseContextMenu:Oe,columns:D,visibleColumns:F,toggleColumnVisibility:le})]});return T?g("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g$1&&f(Vo,{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(mp,{title:M,loading:p,showSummary:X,setShowSummary:V,setAnchorEl:we,setSummaryAnchorEl:pe,filterText:O,setFilterText:_,sortedAndFilteredRows:Ie,selected:s,columns:D,visibleColumns:F,summaryRow:ke,handleClick:It,selectionMode:i}),_e]}):g("div",{sx:{width:f$1?"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(Vo,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:oe=>{dt(oe),g$1.onVariantLoad&&g$1.onVariantLoad(oe);},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:St,layoutRefs:[{tableKey:b,layoutId:St}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl})}),g(Ne,{className:"orb-ctable-surface",sx:{width:f$1?"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"}},...h?{height:h}:m?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&f(ci,{filterText:O,setFilterText:_,onRowsPerPageChange:Re,rowsPerPage:q,rowsPerPageOptions:v,page:rt,count:ve,onPageChange:at,actions:d,extraTools:u,grouping:z,disableGrouping:S,groupAnchorEl:K,setGroupAnchorEl:ge,showSummary:X,setShowSummary:V,anchorEl:We,setAnchorEl:we,summaryAnchorEl:ie,setSummaryAnchorEl:pe,handleExport:te,showCreateButton:W,onOpenCreateDialog:Kr,showEditButton:Q,onOpenEditDialog:Mo,editDisabled:Bt.length!==1,showDeleteButton:fe,onOpenDeleteConfirm:nr,deleteDisabled:Bt.length===0,onLayoutSave:y||g$1?.variantService&&g$1?.appId?Ft:void 0,loading:p,layoutManager:ot,onOpenGraphReport:Ot?Dt:void 0}),f("div",{sx:{flex:1,...h?{maxHeight:h,height:h}:m?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:f(DndContext,{sensors:Ae,collisionDetection:closestCenter,onDragEnd:Nt,modifiers:[restrictToHorizontalAxis],children:g("table",{className:"orb-tbl orb-ctable",style:{minWidth:f$1?750:void 0,width:f$1?"100%":"auto",tableLayout:Object.keys(xe).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:r},"aria-labelledby":"tableTitle",children:[f(pi,{columns:D,visibleColumns:F,order:A,orderBy:L,onRequestSort:Ye,disableSorting:N,onContextMenu:Ge,selectionMode:i,grouping:z,isAllExpanded:et,handleToggleAll:ee,rowCount:Ie.length,numSelected:s.length,onSelectAllClick:xt,columnWidths:xe,onColumnResize:nt}),f(ui,{visibleRows:ze,columns:D,visibleColumns:F,selectionMode:i,selected:s,orderBy:L,loading:p,expandedGroups:U,toggleGroupExpand:be,handleExpandGroupRecursively:he,handleCollapseGroupRecursively:De,isGroupFullyExpanded:je,handleClick:It,onSelectionChange:l,grouping:z,rowKeyProp:x,page:rt,rowsPerPage:q}),X&&f(up,{showSummary:X,columns:D,visibleColumns:F,summaryRow:ke,selectionMode:i?.toString(),grouping:z,columnWidths:xe,orderBy:L,zIndex:3})]})})})]}),W&&g(Et,{open:Ke,onClose:Ar,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||o("quickCreate.createWithTitle",{title:M})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[At.map(oe=>{let ue=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",J=oe.label||oe.id;return f(He,{label:J,value:Mt[oe.id]??"",onChange:Le=>qr(oe.id,Le.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-${oe.id}`)}),k?.description&&f(Zo,{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")})]})]}),Q&&g(Et,{open:B,onClose:Er,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:w?.title||o("quickEdit.editWithTitle",{title:M})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Io.map(oe=>{let ue=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",J=oe.label||oe.id,Le=Ur(oe.id);return f(He,{label:J,value:Je[oe.id]??"",onChange:Qe=>Yr(oe.id,Qe.target.value),type:ue,size:"small",fullWidth:true,disabled:!Le,InputLabelProps:{shrink:ue==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${oe.id}`)}),w?.description&&f(Zo,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:w.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Se,{onClick:Er,sx:{fontSize:"0.85rem"},disabled:me,children:w?.cancelLabel||o("common.cancel")}),f(Se,{onClick:Uo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:me||!Gt,children:w?.submitLabel||o("common.save")})]})]}),fe&&f(qn,{open:wt,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:Nn,onConfirm:Lr}),_e,Ot&&f(yi,{open:ht,onClose:st,model:ce,aiAssistant:C?.aiAssistant,interaction:qt?{enabled:true,filters:Y.filters,fieldMapping:$,onPrimaryDimensionClick:oe=>Y.setFilter("primaryDimension",oe),onSecondaryDimensionClick:oe=>Y.setFilter("secondaryDimension",oe),onStatusClick:oe=>Y.setFilter("status",oe),onClearFilter:Y.clearFilter,onClearAll:Y.clearAll}:void 0,tableContent:f(jo,{appId:Kt||"graph-report-internal",title:o("graph.dataBody"),columns:Be,rows:ce.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},B1=jo;var G1=({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(ii,{title:o,hideHeader:r,children:[g(ae,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l==="separated"&&d&&f("div",{sx:{flexShrink:0},children:f(Vo,{...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 Z1=({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}=de(),[u,m]=useState(false),[f,h]=useState([]),[p,v]=useState({}),[y,g]=useState(t.variants||[]),[x,b]=useState(t.layout||null),[C,k]=useState(""),[w,P]=useState(0),[I,S]=useState(0),[N,M]=useState(r),[T,D]=useState([]),[A,L]=useState("asc"),[O,_]=useState("");useEffect(()=>{let ie={};t.filters.forEach(pe=>{pe.defaultValue!==void 0&&(ie[pe.id]=pe.defaultValue);}),v(ie);},[t.filters]);let F=useCallback(async(ie,pe,xe,We,we)=>{m(true);try{let se={...ie,page:pe+1,limit:xe,sort:we,order:We},Ae;o?Ae=await o(se):typeof t.api=="function"?Ae=await t.api(se):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,se),Ae={rows:[],total:0}):(console.warn("No API configured for report"),Ae={rows:[],total:0}),Ae&&(h(Ae.rows||[]),P(Ae.total||0));}catch(se){console.error("Failed to fetch report data",se);}finally{m(false);}},[t.api,o]);useEffect(()=>{F(p,I,N,A,O);},[F,I,N,A,O]);let X=()=>{S(0),F(p,0,N,A,O);},V=ie=>{S(0),M(ie);},Z=(ie,pe)=>{L(pe),_(ie);},z=ie=>{v(ie);},H=ie=>{k(ie?.id||"");let pe=Ti(ie,a);if(pe){let We=pe.values??pe;v(We),F(We,0,N,A,O),S(0);}let{layout:xe}=Ii(ie,a);xe&&b(xe);},U=ie=>{let pe={...ie,id:Date.now().toString(),createdAt:new Date().toISOString()};g(xe=>[...xe,pe]);},K=ie=>{b(ie);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:p,onFilterChange:z,onSearch:X,onVariantLoad:H,onVariantSave:U,onVariantDelete:ie=>g(pe=>pe.filter(xe=>xe.id!==ie)),onVariantSetDefault:ie=>{g(pe=>pe.map(xe=>({...xe,isDefault:xe.id===ie})));},variants:y,currentVariantId:C,variantService:l,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:f,loading:u,rowKey:"id",count:w,page:I,rowsPerPage:N,rowsPerPageOptions:n,onPageChange:S,onRowsPerPageChange:V,selectionMode:"multiple",selected:T,onSelectionChange:D,onLayoutSave:K,layout:x,title:t.title,showSummary:true,order:A,orderBy:O,serviceUrl:s,onSortChange:Z,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:p,rows:f,loading:u,refresh:X}};var cb=new Set(["id","title","description","icon","iconNode","meta"]),db=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,o=>o.toUpperCase()).trim(),pb=t=>Object.entries(t).filter(([o,r])=>!cb.has(o)&&r!==null&&r!==void 0&&["string","number","boolean"].includes(typeof r)).map(([o,r])=>({key:o,label:db(o),value:String(r)})),Wp=({item:t,open:o,onClose:r,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=de(),u=yo()==="dark"?"var(--orb-p300)":"var(--orb-primary)";jt__default.useEffect(()=>{if(!o)return;let f=h=>{h.key==="Escape"&&r();};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[o,r]);let m=pb(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(ae,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[f("div",{sx:{width:56,height:56,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:t.iconNode??f(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(ne,{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(f$1=>g("div",{children:[f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:f$1.label}),f(E,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:f$1.value})]},f$1.key))}):null]})}),n?f("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:f(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 ub={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},mb=({item:t,onDetailClick:o,onDownloadClick:r,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=de(),l=yo()==="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(ae,{direction:"row",spacing:1.5,alignItems:"center",children:[f("div",{sx:{width:48,height:48,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:d}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?f(E,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),f("div",{sx:{mt:1.5,flex:1,minHeight:0},children:f(E,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...ub},children:t.description||"\xA0"})}),g(ae,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[f(ne,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>o?.(t),children:f(Pt,{name:"show",size:18})}),f(ne,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>r?.(t),children:f(Pt,{name:"download",size:18})})]})]})},_p=({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}=de(),[f$1,h]=jt__default.useState(null),[p,v]=jt__default.useState(false),y=x=>{r?.(x),d&&(h(x),requestAnimationFrame(()=>requestAnimationFrame(()=>v(true))));},g$1=()=>{v(false),setTimeout(()=>h(null),260);};return o?f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(qo,{})}):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(mb,{item:x,onDetailClick:y,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&f$1?f(Wp,{item:f$1,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 vD=({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(ii,{title:o,hideHeader:r,children:[g(ae,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l&&f("div",{sx:{flexShrink:0},children:f(Vo,{...l})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(_p,{...a})})]}),i]})};var wD=({metadata:t,fetchData:o,tableKey:r="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,u]=useState(false),[m,f]=useState([]),[h,p]=useState(0),[v,y]=useState({}),[g,x]=useState(t.variants||[]),[b,C]=useState("");useEffect(()=>{let M={};t.filters.forEach(T=>{T.defaultValue!==void 0&&(M[T.id]=T.defaultValue);}),y(M);},[t.filters]);let k=useCallback(async M=>{u(true);try{let T=o?await o({...M}):{rows:[],total:0};f(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 w=()=>{k(v);},P=M=>{y(M);},I=M=>{C(M?.id||"");let T=Ti(M,r);if(T){let D=T.values??T;y(D),k(D);}},S=M=>{let T={...M,id:Date.now().toString(),createdAt:new Date().toISOString()};x(D=>[...D,T]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:r,fields:t.filters,filters:v,onFilterChange:P,onSearch:w,onVariantLoad:I,onVariantSave:S,onVariantDelete:M=>x(T=>T.filter(D=>D.id!==M)),onVariantSetDefault:M=>{x(T=>T.map(D=>({...D,isDefault:D.id===M})));},variants:g,currentVariantId:b,variantService:n,serviceUrl:a},gridProps:{items:m,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:l}},items:m,total:h,filters:v,loading:d,refresh:w}};var fb=t=>[...t].sort((o,r)=>r.value-o.value),TD=({bars:t=[],lines:o=[],combos:r=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=useMemo(()=>fb(t),[t]),l=useMemo(()=>[...o],[o]),d=useMemo(()=>[...r],[r]),u=useMemo(()=>[...n],[n]),m=useMemo(()=>{let h=a.reduce((p,v)=>p+v.value,0);return a.map(p=>({...p,percent:h>0?p.value/h*100:p.percent}))},[a]),f=useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:u,pies:m,waterfalls:f}};var ND=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>useMemo(()=>!t||!o?"":Jn({apiKey:t,query:o,zoom:r,mapType:n}),[t,o,r,n]),AD=({keyword:t,location:o})=>useMemo(()=>bi({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0}),[t,o]);var na=({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 Ao from'@radix-ui/react-dropdown-menu';import*as Yo from'@radix-ui/react-tooltip';import {createPortal}from'react-dom';import*as So from'@radix-ui/react-dialog';import*as br from'@radix-ui/react-popover';import rr 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 lb from'dayjs/plugin/isBetween';import cb 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 gy from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import PC from'react-markdown';import TC from'remark-gfm';import IC from'remark-math';import MC from'rehype-katex';import RC from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import xm from'mermaid';import aw from'dayjs/plugin/isoWeek';var Ug={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"},Kg={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"},Bs={light:Ug,dark:Kg},kw='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',Pw=t=>{let o=Bs[t];return [o.primary,o.p300,o.muted,o.p700]},Tw=10,Iw="0.2s ease";var Tc=createContext({mode:"light",setting:"light"}),Yg=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;},Ln=({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(()=>{Yg(d);},[d]);let p=useMemo(()=>({mode:d,setting:n}),[d,n]);return f(Tc.Provider,{value:p,children:r})},go=()=>useContext(Tc).mode,Hs=()=>Bs[go()];var tt=(t,o)=>{let r=Math.min(1,Math.max(0,o)),n=t.trim(),a=d=>d.split("").map(p=>p+p).join(""),i=n.startsWith("#")?n.slice(1):"",s=i.length===3?a(i):i;if(/^[0-9a-fA-F]{6}$/.test(s)){let d=parseInt(s.slice(0,2),16),p=parseInt(s.slice(2,4),16),m=parseInt(s.slice(4,6),16);return `rgba(${d}, ${p}, ${m}, ${r})`}let l=`${Math.round(r*100)}%`;return `color-mix(in oklch, ${t} ${l}, 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 Jg={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},eh=t=>typeof t=="number"?`${t}px`:t,th={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},oh=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?th[o[1]]:void 0},Pt=forwardRef(({name:t,size:o,title:r,className:n,style:a,strokeWidth:i,fill:s,...l},d)=>{let p=l["aria-label"]??r,m=eh(o??oh(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:p?"img":void 0,"aria-hidden":p?void 0:true,title:r,className:n,"data-sap-icon":t,style:h,...l,children:String.fromCodePoint(Jg[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 Mc=ae("activity","Activity"),Ia=ae("error","AlertCircle"),Rc=ae("warning","AlertTriangle"),Uw=ae("down","ArrowDown"),Kw=ae("navigationRight","ArrowRight"),Dc=ae("up","ArrowUp"),zs=ae("barChart","BarChart"),qw=ae("activate","Bot"),Vs=ae("calendar","Calendar"),Xw=Vs,Zw=ae("camera","Camera"),Yw=ae("lineChart","ChartNoAxesCombined"),xo=ae("accept","Check"),Ma=ae("accept","CheckCircle"),Bo=ae("slimDown","ChevronDown"),Ra=ae("navigationLeft","ChevronLeft"),Ho=ae("navigationRight","ChevronRight"),Qw=ae("slimUp","ChevronUp"),jw=ae("expandAll","ChevronsDown"),Jw=ae("collapseAll","ChevronsUp"),Da=ae("error","CircleAlert"),On=ae("accept","CircleCheck"),e0=On,Ws=ae("stop","CircleStop"),Nc=ae("copy","Clipboard"),t0=ae("checklist","ClipboardCheck"),o0=ae("checklist","ClipboardList"),Ac=ae("time","Clock"),r0=ae("tableColumn","Columns3"),No=ae("copy","Copy"),n0=ae("duplicate","CopyPlus"),a0=ae("delete","Delete"),Fn=ae("download","Download"),Ec=ae("edit","Edit"),Lc=ae("fullScreen","Expand"),i0=ae("show","Eye"),s0=ae("hide","EyeOff"),Na=ae("document","File"),Oc=ae("document","FileText"),l0=ae("filter","Filter"),Bn=ae("tree","FolderTree"),Fc=ae("process","GitBranch"),Hn=ae("world","Globe"),Bc=ae("grid","Grid"),c0=ae("move","GripVertical"),d0=ae("wrench","Hammer"),Hc=ae("picture","Image"),Aa=ae("information","Info"),p0=ae("translate","Languages"),u0=ae("dimension","Layers"),m0=ae("home","LayoutDashboard"),Ea=ae("lightbulb","Lightbulb"),zc=ae("lineChart","LineChart"),Vc=ae("synchronize","Loader2"),La=ae("locked","Lock"),g0=La,Wc=ae("log","LogOut"),$s=ae("email","Mail"),$c=ae("map","MapPin"),_c=ae("menu","Menu"),rh=ae("message","MessageCircle"),Gc=rh,Oa=ae("microphone","Mic"),h0=ae("microphone","MicOff"),Uc=ae("darkMode","Moon"),f0=ae("overflow","MoreHorizontal"),b0=ae("accept","PackageCheck"),v0=ae("product","PackageSearch"),Fa=ae("splitOne","PanelLeftOpen"),Ba=ae("splitTwo","PanelRight"),y0=ae("overview","PanelsTopLeft"),Kc=ae("pieChart","PieChart"),Qr=ae("pushpin","Pin"),C0=ae("play","Play"),jr=ae("add","Plus"),x0=ae("qrCode","QrCode"),w0=ae("receipt","ReceiptText"),Ha=ae("refresh","RefreshCw"),S0=ae("activate","Rocket"),k0=ae("refresh","RotateCcw"),qc=ae("refresh","RotateCw"),P0=ae("tableRow","Rows3"),T0=ae("save","Save"),I0=ae("qrCode","ScanLine"),zo=ae("search","Search"),nh=ae("paperPlane","Send"),Xc=nh,Jr=ae("wrench","Settings"),M0=ae("accept","ShieldCheck"),R0=ae("sum","Sigma"),D0=ae("sort","SortAsc"),N0=ae("splitTwo","SquareSplitHorizontal"),A0=ae("favorite","Star"),Zc=ae("lightMode","Sun"),E0=ae("table","Table2"),L0=ae("ipad","TabletSmartphone"),zn=ae("command","Terminal"),Yc=ae("thumbDown","ThumbsDown"),Qc=ae("thumbUp","ThumbsUp"),jc=ae("delete","Trash2"),O0=ae("tree","TreePine"),Jc=ae("trendDown","TrendingDown"),za=ae("warning","TriangleAlert"),F0=ae("shipping","Truck"),ed=ae("upload","UploadCloud"),_s=ae("employee","User"),td=ae("sound","Volume2"),B0=ae("factory","Warehouse"),H0=ae("process","Workflow"),Kt=ae("decline","X"),Va=ae("error","XCircle");var ih={contained:"primary",outlined:"secondary",text:"ghost"},sh={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:l,sx:d$1,className:p,children:m,disabled:h,type:f$1="button",...u},b)=>{let C=ih[t]??t,g$1=["orb-btn",`orb-btn-${C}`,sh[o],r?"orb-btn-block":void 0,n?"orb-is-loading":void 0,p].filter(Boolean).join(" "),x=d(d$1,g$1),v=s??(l?"a":"button");return g(v,{ref:b,type:v==="button"?f$1:void 0,href:l,className:x.className,style:x.style,disabled:v==="button"?h||n:void 0,"aria-disabled":v!=="button"&&(h||n)?true:void 0,...u,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:l="text",placeholder:d$1,disabled:p,readOnly:m,required:h,autoFocus:f$1,autoComplete:u,name:b,id:C,error:g$1,helperText:x,dense:v=false,size:y,fullWidth:k=true,select:w=false,multiline:P=false,rows:I,children:S,variant:R,margin:N,onClick:T,startAdornment:M,endAdornment:A,InputProps:L,inputProps:W,InputLabelProps:ee,SelectProps:O,sx:_,className:V},Q)=>{let H=useId(),B=C??`orb-tf-${H}`,q=M??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:k?void 0:{width:"auto"},value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:d$1,disabled:p,required:h,autoFocus:f$1,autoComplete:u,name:b,onClick:T,"aria-invalid":!!g$1},ze=w?f("select",{...he,ref:Q,onChange:n,children:S}):P?f("textarea",{...he,ref:Q,onChange:n,rows:I,readOnly:m||L?.readOnly}):f("input",{...he,ref:Q,onChange:n,type:l,readOnly:m||L?.readOnly,...W}),be=d(_,`orb-fld ${g$1?"orb-is-error":""} ${V??""}`,{width:k?"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 Vn=forwardRef(({label:t,value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l,minRows:d$1=3,multiline:p,error:m,helperText:h,fullWidth:f$1=true,name:u,id:b,inputProps:C,sx:g$1,className:x},v)=>{let y=useId(),k=b??`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:v,id:k,className:"orb-inp",value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l??d$1,name:u,"aria-invalid":!!m,...C}),P&&f("span",{className:"orb-fld-msg",children:P})]})});Vn.displayName="CTextArea";var zt=forwardRef(({label:t,options:o,children:r,value:n,defaultValue:a,onChange:i,disabled:s,size:l,dense:d$1=true,fullWidth:p=true,minWidth:m,placeholder:h,displayEmpty:f$1,renderValue:u,multiple:b,MenuProps:C,variant:g$1,disableUnderline:x,onClick:v,onMouseDown:y,error:k,helperText:w,name:P,id:I,"aria-label":S,sx:R,className:N},T)=>{let M=useId(),A=I??`orb-sel-${M}`,W=(typeof k=="string"?k:void 0)??w,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=u?u(J):ze?.label??(he||(h??"")),Ce=d(R,`orb-fld ${k?"orb-is-error":""} ${N??""}`,{width:p?"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||l==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:P,multiple:true,onClick:v,onMouseDown:y,"aria-invalid":!!k,"aria-label":S,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:P,value:he,disabled:s,onChange:()=>{},children:Y.map(de=>f("option",{value:de.value,disabled:de.disabled,children:de.label},String(de.value)))}),g(Ao.Root,{open:_,onOpenChange:de=>{de&&H(O.current?.getBoundingClientRect().width??180),V(de);},children:[f(Ao.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":S,"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(Ao.Portal,{children:f(Ao.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:Q},children:f(Ao.RadioGroup,{value:he,onValueChange:Be,children:Y.map(de=>g(Ao.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:l,id:d$1,size:p,color:m,onClick:h,inputProps:f$1,sx:u,className:b},C)=>{let g$1=d([{...p==="small"?{fontSize:13}:void 0,...m?{color:m}:void 0},...Array.isArray(u)?u:u?[u]:[]],`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: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 Ch=({label:t,options:o,value:r,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:p})=>{let m=useId(),h=i??`orb-rdo-${m}`;return g("div",{className:`orb-fld ${p??""}`,style:d,role:"radiogroup",children:[t&&f("span",{className:"orb-fld-label",children:t}),f("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children: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?u=>a(u,f$1.value):void 0,disabled:l||f$1.disabled}),f("span",{children:f$1.label})]},f$1.value))})]})};var Wa=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,name:i,id:s,size:l,sx:d$1,className:p},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 ${p??""}`),f$1=f("input",{ref:m,type:"checkbox",role:"switch",id:s,checked:o,defaultChecked:r,onChange:n?u=>n(u,u.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})]})});Wa.displayName="CSwitch";var Sh={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:p,onClick:m,sx:h,className:f$1},u)=>{let b=r??(a==="outlined"&&n==="default"?"outline":Sh[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:u,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}),p&&f("button",{type:"button","aria-label":"Remove",onClick:x=>{x.stopPropagation(),p(x);},style:{background:"none",border:"none",padding:0,display:"inline-flex",cursor:"pointer",color:"inherit"},children:f(Kt,{size:13,strokeWidth:2})})]})});Ct.displayName="CChip";var $a=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})});$a.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 Wn=({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%; } }"})]})},Ih=({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}}),Zo=({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(Yo.Provider,{delayDuration:r,skipDelayDuration:200,children:g(Yo.Root,{children:[f(Yo.Trigger,{asChild:true,children:o}),f(Yo.Portal,{children:f(Yo.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:l,type:d$1="button",...p},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,...p,children:l});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 l=useRef([]),d$1=o.findIndex(u=>!u.disabled),p=o.findIndex(u=>u.value===t),m=(u,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;u.key==="Home"&&(x=C[0]),u.key==="End"&&(x=C[C.length-1]),(u.key==="ArrowRight"||u.key==="ArrowDown")&&(x=C[(g+1+C.length)%C.length]),(u.key==="ArrowLeft"||u.key==="ArrowUp")&&(x=C[(g-1+C.length)%C.length]),x!==void 0&&(u.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(p,0)};return g("div",{role:"radiogroup",className:h.className,style:f$1,"data-has-selection":p>=0?"true":"false",...s,children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),o.map((u,b)=>{let C=u.value===t;return f(ie,{ref:g=>{l.current[b]=g;},className:["orb-segmented-control-item",u.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:u.label,role:"radio","aria-label":u.label,"aria-checked":C,"data-selected":C?"true":void 0,disabled:u.disabled,tabIndex:C||t==null&&b===d$1?0:-1,onClick:()=>r(u.value),onKeyDown:g=>m(g,b),children:u.icon??f("span",{className:"orb-segmented-control-label",children:u.label})},u.value)})]})};var Qt=({triggerLabel:t,items:o=[],trigger:r,align:n="start",anchorEl:a,open:i,onClose:s,children:l,slotProps:d$1,PaperProps:p,anchorPosition:m,sx:h})=>{let f$1=useRef(null);if(useEffect(()=>{if(i!==true)return;let u=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",u,true),document.addEventListener("keydown",b,true),()=>{document.removeEventListener("pointerdown",u,true),document.removeEventListener("keydown",b,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let u=a?.getBoundingClientRect(),b=window.innerWidth,C=u?.left??16,g=u?.right??C,x=d$1?.paper?.sx??p?.sx,v=d([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(h)?h:h?[h]:[]],"orb-pop orb-menu",d$1?.paper?.style??p?.style),y=Children.map(l,k=>{if(!isValidElement(k)||k.type!=="option")return k;let w=k.props,{children:P,disabled:I,selected:S}=w,R=d(w.sx,`orb-menu-item ${S?"orb-selected":""} ${w.className??""}`,w.style);return f("div",{role:"menuitem","aria-disabled":I||void 0,"aria-selected":S||void 0,tabIndex:I?-1:0,id:w.id,title:w.title,className:R.className,style:R.style,onClick:I?void 0:w.onClick,onKeyDown:N=>{!I&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),w.onClick?.(N));},children:P})});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??(u?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:y}),document.body)}return g(Ao.Root,{children:[f(Ao.Trigger,{asChild:true,children:r??f(Pe,{variant:"primary",children:t})}),f(Ao.Portal,{children:f(Ao.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:o.map((u,b)=>g(Ao.Item,{className:"orb-menu-item",disabled:u.disabled,onSelect:()=>u.onClick?.(),children:[u.icon,u.label]},b))})})]})};var Ne=forwardRef(({elevation:t=1,variant:o,component:r,sx:n,style:a,className:i,children:s,...l},d$1)=>{let p=r??"div",m=d(n,`orb-card ${t>0&&o!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return f(p,{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 Hh={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"},zh={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:p,...m},h)=>{let f$1=o??zh[t]??"span",b=[t==="inherit"?void 0:Hh[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]:[]],b);return f(f$1,{ref:h,className:C.className,style:C.style,...m,children:p})});E.displayName="CTypography";var Wh=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:l,className:d$1,children:p,...m},h)=>{let f$1=d([{display:"flex",flexDirection:t,gap:Wh(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:p})});se.displayName="CStack";var Lt=({open:t,onClose:o,title:r,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:l=false,PaperProps:d$1,slotProps:p,disableRestoreFocus:m,keepMounted:h,hideCloseButton:f$1=false,sx:u,className:b})=>{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??p?.paper?.sx)?d$1?.sx??p?.paper?.sx:d$1?.sx??p?.paper?.sx?[d$1?.sx??p?.paper?.sx]:[],...Array.isArray(u)?u:u?[u]:[]],`orb-dialog ${b??""}`);return f(So.Root,{open:t,onOpenChange:g=>{g||o?.();},children:g(So.Portal,{children:[f(So.Overlay,{className:"orb-overlay"}),g(So.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(So.Title,{className:"orb-dialog-title",children:r}):f(So.Title,{className:"orb-visually-hidden",children:"Dialog"}),!f$1&&f(So.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 Us=({open:t,defaultOpen:o,onOpenChange:r,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:l=6,matchTriggerWidth:d=false,sx:p,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,...p},onOpenAutoFocus:h=>h.preventDefault(),children:a})})]});var Gh=({items:t,value:o,defaultValue:r,onChange:n,sx:a,className:i})=>{let s=o!==void 0,[l,d]=useState(r??t[0]?.value),p=s?o:l,m=useRef([]),h=u=>{s||d(u),n?.(u);},f$1=u=>{if(u.key!=="ArrowRight"&&u.key!=="ArrowLeft")return;u.preventDefault();let b=t.filter(v=>!v.disabled),C=b.findIndex(v=>v.value===p),g=u.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((u,b)=>{let C=u.value===p;return g("button",{ref:g=>{m.current[b]=g;},type:"button",role:"tab","aria-selected":C,disabled:u.disabled,className:`orb-tab ${C?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>h(u.value),children:[u.icon,u.label]},u.value)})})};var Kh=["su","mo","tu","we","th","fr","sa"],_n=(t,o)=>!!(t&&o&&t.isSame(o,"day")),Gn=({value:t,rangeStart:o,rangeEnd:r,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:l,maxDate:d,locale:p,renderDay:m})=>{let h=a!==void 0,[f$1,u]=useState(()=>i??t??o??rr()),b=(h?a:f$1).startOf("month"),C=w=>{h||u(w),s?.(w);},g$1=useMemo(()=>p?b.locale(p):b,[b,p]),x=useMemo(()=>{let P=b.startOf("month").startOf("week"),I=[],S=P;for(let R=0;R<6;R+=1){let N=[];for(let T=0;T<7;T+=1)N.push(S),S=S.add(1,"day");if(I.push(N),S.isAfter(b.endOf("month"))&&R>=3)break}return I},[b]),v=useMemo(()=>{let w=p?rr().locale(p):rr();return Kh.map((P,I)=>w.startOf("week").add(I,"day").format("dd"))},[p]),y=w=>!!(l&&w.isBefore(l.startOf("day"))||d&&w.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(b.subtract(1,"month")),children:f(Ra,{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(Ho,{size:16,strokeWidth:2})})]}),g("div",{className:"orb-cal-grid",role:"grid",children:[v.map((w,P)=>f("span",{className:"orb-cal-dow",children:w},`${w}-${P}`)),x.flat().map(w=>{let P=!w.isSame(b,"month"),I=y(w),S=k?_n(w,o)||_n(w,r):_n(w,t),R=w.isSame(rr(),"day"),N=k&&o&&r&&w.isAfter(o.startOf("day"))&&w.isBefore(r.startOf("day")),T=k&&_n(w,o)&&!!r,M=k&&_n(w,r)&&!!o,A=["orb-cal-day",P?"orb-is-outside":void 0,R?"orb-is-today":void 0,S?"orb-is-selected":void 0,N?"orb-is-in-range":void 0,T?"orb-is-range-start":void 0,M?"orb-is-range-end":void 0].filter(Boolean).join(" ");return m?f("span",{className:"orb-cal-day-slot",children:m(w,{outsideCurrentMonth:P,selected:S,today:R,disabled:I})},w.format("YYYY-MM-DD")):f("button",{type:"button",role:"gridcell","aria-selected":S,"aria-current":R?"date":void 0,className:A,disabled:I,onClick:()=>n?.(w),children:w.date()},w.format("YYYY-MM-DD"))})]})]})};rr.extend(qh);var Xh=({label:t,value:o,defaultValue:r,onChange:n,minDate:a,maxDate:i,disabled:s,format:l="YYYY-MM-DD",placeholder:d,locale:p,dense:m=false,error:h,helperText:f$1,sx:u,className:b})=>{let C=o!==void 0,[g$1,x]=useState(r??null),v=C?o:g$1,[y,k]=useState(false),[w,P]=useState(null),I=M=>{C||x(M),n?.(M);},S=w??(v?(p?v.locale(p):v).format(l):""),R=()=>{if(w===null)return;let M=w.trim();if(!M)I(null);else {let A=rr(M,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":""} ${b??""}`,style:u,children:[t&&f("label",{children:t}),f(Us,{open:y,onOpenChange:k,trigger:g("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[f("span",{className:"orb-inp-adornment",children:f(Vs,{size:15,strokeWidth:1.8})}),f("input",{className:`orb-inp ${m?"orb-inp-dense":""}`,value:S,placeholder:d??l,disabled:s,onFocus:()=>k(true),onChange:M=>P(M.target.value),onBlur:R,onKeyDown:M=>{M.key==="Enter"&&(R(),k(false)),M.key==="Escape"&&k(false);}})]}),children:f(Gn,{value:v,onChange:M=>{I(M),P(null),k(false);},minDate:a,maxDate:i,locale:p,defaultMonth:v??void 0})}),T&&f("span",{className:"orb-fld-msg",children:T})]})};var Yh=({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),[p,m]=useState([]),h=useRef(null),f$1=v=>{v.preventDefault(),d(true);},u=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(w=>w.size<=n):v;y.length<v.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let k=o?[...p,...y]:y;o&&(k=k.filter((w,P,I)=>P===I.findIndex(S=>S.name===w.name&&S.size===w.size&&S.lastModified===w.lastModified))),m(k),t?.(k),h.current&&(h.current.value="");},x=v=>{let y=p.filter((k,w)=>w!==v);m(y),t?.(y);};return g("div",{style:{width:"100%",...s},children:[g("div",{onClick:()=>h.current?.click(),onDragOver:f$1,onDragLeave:u,onDrop:b,role:"button",tabIndex:0,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.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(ed,{size:40,strokeWidth:1.5,color:l?"var(--orb-primary)":"var(--orb-muted)"}),f("span",{className:"orb-subtitle",children:a}),f("span",{className:"orb-meta",children:i})]})]}),p.length>0&&f("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:p.map((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(Oc,{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(jc,{size:15,strokeWidth:1.8})})]},`${v.name}-${y}`))})]})};function bo(...t){return twMerge(clsx(t))}var Ga={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"},Un={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},ad=()=>"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 tf=cva(ad(),{variants:{variant:{default:`${Ga.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${Ga.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:Ga.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:Un.none,sm:Un.sm,md:Un.md,full:Un.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Xs=Jt.forwardRef(({className:t,variant:o,size:r,asChild:n=false,...a},i)=>f(n?Slot:"button",{className:bo(tf({variant:o,size:r,className:t})),ref:i,...a}));Xs.displayName="Button";var of={"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.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.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"},rf={"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.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.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"},nf={"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.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.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"},af={"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.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.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"},sf={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.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.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.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"},lf={"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.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.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"},Kn={en:of,zh:rf,fr:nf,de:af,ja:sf,ko:lf};var sd=(t,o)=>o?t.replace(/\{(\w+)\}/g,(r,n)=>{let a=o[n];return a==null?"":String(a)}):t,uf={locale:"en",t:(t,o)=>sd(Kn.en[t]||t,o)},ld=createContext(uf),Ua=({locale:t="en",messages:o,children:r})=>{let n=useMemo(()=>{let a=Kn[t]||Kn.en,i=o?.[t]||{},s={...Kn.en,...a,...i};return {locale:t,t:(l,d)=>sd(s[l]||l,d)}},[t,o]);return f(ld.Provider,{value:n,children:r})},ce=()=>useContext(ld);function qn({items:t,onItemClick:o,className:r="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:l=false,pinnedIds:d,onTogglePin:p}){let{t:m}=ce(),h=s==="dark",f$1=usePathname(),[u,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=w=>{if(x)i(w);else {let P=new Set(C);P.has(w)?P.delete(w):P.add(w),g$1(P);}},k=w=>{w.children&&w.children.length>0&&y(w.id),o&&o(w);};return !t||!Array.isArray(t)?f("div",{className:bo("tree-menu",r),children:f("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:m("navigation.noItems")})}):f("div",{className:bo("tree-menu",r),children:t.map(w=>{let P=v.has(w.id)||w.isExpanded,I=w.children&&w.children.length>0,R=56+Math.max(0,n-1)*8,N=n===0?12:I?R-24:R,T=w.appurl||w.href,M=u&&T?f$1===T:false,A=d?.has(w.id)??false,L=l&&w.pinnable!==false&&!!T&&!I;return g("div",{className:"tree-menu-item relative",children:[M&&f("div",{className:bo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),g(Xs,{variant:"ghost",className:bo("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",I&&P&&!M?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",M?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(w),children:[I&&f("div",{className:bo("flex-shrink-0 transition-transform duration-200",P&&"rotate-90",M?"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(Ho,{className:"h-4 w-4"})}),w.icon&&f("div",{className:bo("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",M?"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:w.icon}),g("div",{className:"flex-1 text-left overflow-hidden z-10",children:[f("div",{className:bo("text-sm truncate transition-colors duration-200",M?"font-semibold":"font-medium"),children:w.title||w.label}),w.description&&f("div",{className:bo("text-xs truncate transition-colors duration-200",M?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:w.description,children:w.description})]})]}),L&&p&&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(),p(w);},className:bo("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:bo("h-3.5 w-3.5",A&&"fill-current")})}),I&&f("div",{className:bo("grid transition-[grid-template-rows] duration-300 ease-in-out",P?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:f("div",{className:bo("overflow-hidden",P&&"pt-1"),children:f(qn,{items:w.children,onItemClick:o,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:p})})})]},w.id)})})}var ff="orbcafe:navigation-island:pinned-items",Zs="orbcafe-navigation-pinned",bf=t=>t.appurl||t.href,dd=t=>{let o=[];return t.forEach(r=>{let n=!!r.children?.length;r.pinnable!==false&&bf(r)&&!n&&o.push({...r,children:void 0}),r.children?.length&&o.push(...dd(r.children));}),o},pd=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:p=true,pinStorageKey:m=ff,pinnedItemIds:h,defaultPinnedItemIds:f$1=[],onPinnedItemIdsChange:u,pinnedSectionTitle:b})=>{let{t:C}=ce(),g$1=i==="dark",x=s==="floating",v=useRouter(),[y,k]=useState(""),[w,P]=useState(new Set),[I,S]=useState(f$1),[R,N]=useState(false),T=h!==void 0,M=useMemo(()=>h??I,[h,I]),A=useMemo(()=>new Set(M),[M]);useEffect(()=>{t&&P(new Set);},[t]),useEffect(()=>{if(!p||T){N(true);return}try{let B=window.localStorage.getItem(m);if(B){let q=JSON.parse(B);Array.isArray(q)&&S(q.filter(Z=>typeof Z=="string"));}}catch{}finally{N(true);}},[p,T,m]),useEffect(()=>{if(!(!p||T||!R))try{window.localStorage.setItem(m,JSON.stringify(M));}catch{}},[M,p,T,m,R]),useEffect(()=>{!p||t||M.length===0||P(B=>{if(B.has(Zs))return B;let q=new Set(B);return q.add(Zs),q});},[t,M.length,p]);let L=useCallback(B=>{let q=Array.from(new Set(B));T||S(q),u?.(q);},[T,u]),W=useCallback(B=>{let q=B.id,Z=A.has(q)?M.filter(Y=>Y!==q):[...M,q];L(Z);},[M,A,L]),ee=useMemo(()=>{if(!p||M.length===0)return a;let B=new Map(dd(a).map(Z=>[Z.id,Z])),q=M.map(Z=>B.get(Z)).filter(Z=>!!Z);return q.length===0?a:[{id:Zs,title:b||C("navigation.pinned"),icon:f(Qr,{className:"w-4 h-4"}),children:q,pinnable:false},...a]},[M,p,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)):w,[y,ee,w,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(()=>{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(zo,{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(zo,{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(Bn,{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(qn,{items:_,onItemClick:Q,className:"space-y-1",expandedIds:V,colorMode:i,enablePinning:p,pinnedIds:A,onTogglePin:W,onToggleExpand:B=>{let q=new Set(w);_.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),P(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]);P(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(Fa,{className:"h-4 w-4"}):f(Ba,{className:"h-4 w-4"})})]})};var yf="orbcafe:navigation-island:pinned-items",Ys="orbcafe-navigation-pinned",ud=t=>t.appurl||t.href,md=t=>t.flatMap(o=>{let r=!!o.children?.length,n=o.pinnable!==false&&ud(o)&&!r?[{...o,children:void 0}]:[];return o.children?.length?[...n,...md(o.children)]:n}),gd=t=>t.flatMap(o=>[o.id,...o.children?gd(o.children):[]]),hd=(t,o)=>t.reduce((r,n)=>{let a=n.children?hd(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},[]),Qs=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:p=true,pinStorageKey:m=yf,pinnedItemIds:h,defaultPinnedItemIds:f$1=[],onPinnedItemIdsChange:u,pinnedSectionTitle:b})=>{let{t:C}=ce(),g$1=useRouter(),x=s==="floating",[v,y]=useState(""),[k,w]=useState(new Set),[P,I]=useState(f$1),[S,R]=useState(false),N=h!==void 0,T=h??P,M=useMemo(()=>new Set(T),[T]);useEffect(()=>{t&&w(new Set);},[t]),useEffect(()=>{if(!p||N){R(true);return}try{let B=window.localStorage.getItem(m);if(B){let q=JSON.parse(B);Array.isArray(q)&&I(q.filter(Z=>typeof Z=="string"));}}catch{}finally{R(true);}},[p,N,m]),useEffect(()=>{if(!(!p||N||!S))try{window.localStorage.setItem(m,JSON.stringify(T));}catch{}},[T,p,N,m,S]),useEffect(()=>{!p||t||T.length===0||w(B=>{if(B.has(Ys))return B;let q=new Set(B);return q.add(Ys),q});},[t,T.length,p]);let A=useCallback(B=>{let q=Array.from(new Set(B));N||I(q),u?.(q);},[N,u]),L=useCallback(B=>{A(M.has(B.id)?T.filter(q=>q!==B.id):[...T,B.id]);},[T,M,A]),W=useMemo(()=>{if(!p||T.length===0)return a;let B=new Map(md(a).map(Z=>[Z.id,Z])),q=T.map(Z=>B.get(Z)).filter(Z=>!!Z);return q.length===0?a:[{id:Ys,title:b||C("navigation.pinned"),icon:f(Qr,{className:"h-4 w-4"}),children:q,pinnable:false},...a]},[T,p,a,b,C]),ee=v.trim().toLocaleLowerCase(),O=useMemo(()=>ee?hd(W,ee):W,[W,ee]),_=useMemo(()=>ee?new Set(gd(O)):k,[k,O,ee]),V=useCallback(B=>{w(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=ud(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(),w(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(zo,{className:"h-5 w-5"})}):g("label",{className:"relative block",children:[f("span",{className:"orb-visually-hidden",children:C("navigation.searchPlaceholder")}),f(zo,{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(Bn,{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(Bn,{className:"h-5 w-5"})},B.id))}):f(qn,{items:O,onItemClick:Q,className:"space-y-1",expandedIds:_,onToggleExpand:V,colorMode:i,enablePinning:p,pinnedIds:M,onTogglePin:L})}),d&&t&&f("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:f("button",{type:"button",onClick:()=>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(Fa,{className:"h-4 w-4"}):f(Ba,{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}})})})]})};Qs.displayName="NavigationIsland2";var bd=(t={})=>{let{initialCollapsed:o=false,initialDisplayMode:r="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}=t,[m,h]=useState(o),[f,u]=useState(r),[b,C]=useState(n),g=useCallback(()=>{h(y=>!y);},[]),x=useCallback(()=>{u(y=>y==="fixed"?"floating":"fixed");},[]),v=useMemo(()=>({collapsed:m,onToggle:g,menuData:b,displayMode:f,onDisplayModeChange:u,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}),[m,g,b,f,u,a,i,s,l,d,p]);return {collapsed:m,setCollapsed:h,toggleCollapsed:g,displayMode:f,setDisplayMode:u,toggleDisplayMode:x,menuData:b,setMenuData:C,navigationIslandProps:v}};var Js=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 Js,aT={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 xf={success:{icon:f(On,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:f(za,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:f(Da,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:f(Aa,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},Yn=({open:t,title:o,message:r,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:l=true,maxWidth:d="xs",type:p="default"})=>{let{t:m}=ce(),h=i||m("messageBox.confirm"),f$1=s||m("messageBox.cancel"),u=()=>{a?a():n();},b=xf[p],C=p!=="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:[l&&f(Pe,{onClick:n,variant:"text",children:f$1}),f(Pe,{onClick:u,variant:"contained",color:C&&p==="error"?"error":"primary",autoFocus:true,children:h})]})]})},mT=()=>{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(Yn,{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 vT=({status:t,showIcon:o=true})=>{let r="gray",n,a=t;return t==="OK"?(r="blue",n=f(On,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(r="orange",n=f(Da,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(r="orange",n=f(za,{size:14,strokeWidth:2}),a="Warning"),f(Ct,{label:a,tone:r,icon:o&&n?n:void 0})};var xT=({dense:t,sx:o,className:r,children:n,...a})=>f("ul",{...a,className:r,style:{listStyle:"none",margin:0,padding:0,...o},children:n}),wT=({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}),kT=({children:t,sx:o})=>f("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...o},children:t}),PT=({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})]}),TT=({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}),IT=({children:t,sx:o})=>f("div",{style:{marginRight:12,display:"flex",alignItems:"center",...o},children:t});var DT=({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 Eo=tt,ao=(t,o)=>forwardRef(({component:r,sx:n,className:a,style:i,children:s,...l},d$1)=>{let p=r??t,m=d(n,[o,a].filter(Boolean).join(" "),i);return f(p,{ref:d$1,className:m.className,style:m.style,...l,children:s})}),Ie=ao("div"),yd=ao("a","orb-link"),Or=Ne,Cd=se,vo=E;var xd=ie;var wd=Rt,jo=tn,Ja=en,ei=$a;var ti=Wa,Sd=Zo,kd=({value:t,variant:o,color:r,sx:n})=>f(Wn,{value:o==="determinate"?t:void 0,color:r,sx:n}),Pd=ao("table","orb-tbl"),Td=ao("tbody"),ol=ao("td"),Id=ao("div","orb-table-container"),Md=ao("thead"),rl=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 sr=ao("span","orb-input-adornment"),Rd=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=ao("div","orb-form-control"),Qn=({control:t,label:o,...r})=>g("label",{className:"orb-form-control-label",...r,children:[t,f("span",{children:o})]}),If=({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]}),Mf=ao("span","orb-list-item-icon"),_t=If,Vo=Mf;ao("div","orb-list-subheader");var nl=({container:t,item:o,spacing:r,xs:n,sm:a,md:i,lg:s,xl:l,sx:d,...p})=>{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,{...p,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}),Dd=({children:t,container:o})=>typeof document>"u"?null:createPortal(t,o??document.body),Nd=ao("div","orb-toolbar"),Ad=({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})]})},oi=({open:t,anchorEl:o,onClose:r,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:l,sx:d$1,className:p,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?.();},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 u=o?.getBoundingClientRect(),b=s?.paper??l,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,p].filter(Boolean).join(" "),{...b?.style,...m});return createPortal(f("div",{...h,ref:f$1,className:g.className,style:{position:"fixed",left:u?.left??16,top:(u?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},Ed=({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)},Ld=({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)}),Od=({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(),yr=(t,o)=>Do(t);var Fd=({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()})},Bd=({value:t,referenceDate:o,onChange:r,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>f(Gn,{value:t,month:o,onChange:p=>r?.(p),onMonthChange:p=>{n?.(p),a?.(p);},minDate:i,maxDate:s,renderDay:l?.day?(p,m)=>l.day?.({day:p,selected:m.selected,outsideCurrentMonth:m.outsideCurrentMonth,onDaySelect:h=>r?.(h)}):void 0,...d}),Hd=({children:t})=>f(e,{children:t}),ja=class{};var Rf=(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:l,...d$1})=>{let p=d(a,i,s);return f(Pt,{name:t,size:Rf(r,n),className:p.className,style:p.style,"aria-label":d$1["aria-label"]??l,...d$1})},Cr=ke("tree"),Fr=ke("add"),zd=ke("duplicate"),al=ke("down"),Vd=ke("navigationRight"),Wd=ke("navigationRight"),il=ke("up"),$d=ke("delete"),_d=ke("camera"),Gd=ke("accept"),Ud=ke("accept"),ri=ke("navigationRight"),Kd=ke("dimension"),sl=ke("decline"),xr=ke("decline"),qd=ke("decline"),Xd=ke("decline"),ni=ke("delete"),ai=ke("delete"),Zd=ke("download"),Yd=ke("move"),Qd=ke("edit"),rn=ke("slimDown"),jd=ke("filter"),nn=ke("sum"),Jd=ke("lineChart"),ep=ke("document"),Wo=ke("slimDown"),tp=ke("navigationLeft"),wr=ke("navigationRight"),ii=ke("slimUp"),si=ke("navigationLeft"),li=ke("navigationRight"),op=ke("dimension"),rp=ke("splitOne"),ci=ke("menu"),np=ke("microphone"),ap=ke("microphone"),ip=ke("microphone"),sp=ke("qrCode"),Sr=ke("save"),Br=ke("search"),lp=ke("search"),cp=ke("paperPlane"),dp=ke("paperPlane"),pp=ke("wrench"),up=ke("sort"),di=ke("splitTwo"),mp=ke("favorite"),gp=ke("favorite"),ll=ke("stop"),hp=ke("tableRow"),pi=ke("collapseAll"),ui=ke("expandAll"),an=ke("tableColumn"),fp=ke("overview"),bp=ke("hide");var Nf=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],yp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],ko=t=>String(t),Cp=(t,o)=>t[o],xp=t=>{let o=t.value??t.id??t.key??t.code;return typeof o=="number"||typeof o=="string"?o:""},Af=t=>{let o=t.label??t.description??t.name??t.title;return String(typeof o=="number"||typeof o=="string"?o:xp(t))},Ef=t=>{let o=t.description??t.subtitle;return typeof o=="number"||typeof o=="string"?String(o):void 0},wp=({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:p="Open value help",noResultsText:m="No matching values",loading:h=false,clearable:f$1=true,allowManualInput:u=true,validateManualInput:b=true,manualInputErrorText:C="Enter a valid value.",selectedItems:g$1=[],displayValue:x,getOptionValue:v=xp,getOptionLabel:y=Af,getOptionDescription:k=Ef,onChange:w,onSearch:P,disabled:I,InputProps:S,onFocus:R,onBlur:N,onKeyDown:T,error:M,helperText:A,...L})=>{let W=go(),ee=n==="multiple",[O,_]=useState(false),[V,Q]=useState(false),[H,B]=useState(""),[q,Z]=useState(null),[Y,J]=useState(false),[le,he]=useState(()=>yp(t)),[ze,be]=useState(""),[Ce,Be]=useState(""),de=useMemo(()=>r&&r.length>0?r:Nf,[r]),ve=q??o,We=useMemo(()=>{let oe=[...g$1,...o,...q??[]],ye=new Map;return oe.forEach(De=>{ye.set(ko(v(De)),De);}),ye},[v,o,q,g$1]),et=useMemo(()=>yp(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||P)return ve;let ye=de.filter(De=>De.searchable!==false);return ve.filter(De=>[v(De),y(De),k(De),...ye.map(st=>Cp(De,st.field))].some(st=>String(st??"").toLowerCase().includes(oe)))},[ve,k,y,v,P,H,de]),U=useMemo(()=>{if(x!==void 0)return x;if(et.length===0)return "";let oe=ye=>{let De=We.get(ko(ye));if(!De)return String(ye);let je=y(De);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(P){J(true);try{let oe=await P(H);Array.isArray(oe)&&Z(oe);}finally{J(false);}}},[P,H]),we=()=>{I||(he(et),_(true));},Oe=()=>{_(false);},at=()=>{w?.(ee?[]:null,ee?[]:null),he([]),be(""),Be("");},Ze=oe=>{let ye=v(oe);if(ee){he(De=>De.some(st=>ko(st)===ko(ye))?De.filter(st=>ko(st)!==ko(ye)):[...De,ye]);return}he([ye]);},xt=()=>{let oe=le.map(ye=>We.get(ko(ye))).filter(ye=>!!ye);ee?w?.(le,oe):w?.(le[0]??null,oe[0]??null),Be(""),_(false);},It=oe=>{if(oe.key==="F4"){oe.preventDefault(),we();return}if(oe.key==="Enter"&&u&&!At(ze,true)){oe.preventDefault();return}T?.(oe);},Ot=oe=>b?oe.every(ye=>We.has(ko(ye))):true,At=(oe,ye)=>{if(ee){let je=oe.split(/[,;\n]/).map(pt=>pt.trim()).filter(Boolean);if(je.length===0)return Be(""),w?.([],[]),true;if(!Ot(je))return ye&&Be(C),false;Be("");let st=je.map(pt=>We.get(ko(pt))).filter(pt=>!!pt);return w?.(je,st),true}let De=oe.trim();return De?Ot([De])?(Be(""),w?.(De,We.get(ko(De))??null),true):(ye&&Be(C),false):(Be(""),w?.(null,null),true)},re=oe=>{if(!u)return;let ye=oe.target.value;be(ye),Be(""),At(ye,false);},Ge=h||Y,Le=et.length>0,xe=u&&(V||!!Ce)?ze:U;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:xe,error:!!Ce||M,helperText:Ce||A,onChange:re,onFocus:oe=>{Q(true),be(nt),R?.(oe);},onBlur:oe=>{u&&At(ze,true),Q(false),N?.(oe);},onKeyDown:It,InputProps:{...S,readOnly:!u,endAdornment:g("span",{className:"orb-value-help-actions",children:[Ge?f(Zo,{size:18}):null,f$1&&Le&&!I?f(ie,{className:"orb-value-help-clear-trigger",size:"small",tooltip:l,"aria-label":l,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:p,"aria-label":p,onMouseDown:oe=>oe.preventDefault(),onClick:oe=>{oe.stopPropagation(),we();},disabled:I,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(xr,{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(sr,{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}})}}),P?f(Pe,{variant:"outlined",onClick:()=>{Re();},disabled:Ge,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:Ge?f(Zo,{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),De=le.some(je=>ko(je)===ko(ye));return g("tr",{hover:true,selected:De,onClick:()=>Ze(oe),onDoubleClick:()=>{ee||(he([ye]),w?.(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:De})}),de.map(je=>{let st=Cp(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))})]},ko(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:l}):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 mi=({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 cl={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"},dl={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}},Jn={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Sp={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 Lf={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"}},gi=({rowsPerPage:t=20,rowsPerPageOptions:o=[20,50,100,-1],page:r=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=ce(),l=o.length>0?o:[20,50,100,-1],d=Math.max(0,r),p=t===-1?1:Math.max(1,Math.ceil(n/t)),m=Math.min(d+1,p),h=d>0,f$1=d<p-1&&t!==-1;return g("div",{className:"orb-table-pager",children:[f(E,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),f(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:u=>a?.(Number(u.target.value)),sx:Lf,children:l.map(u=>f("option",{value:u,children:u===-1?s("common.all"):u},`rows-per-page-${u}`))})}),f("span",{className:"orb-table-pager-divider"}),f(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(tp,{})}),g(E,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:m,total:p}),children:[m," / ",p]}),f(ie,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,p-1)),disabled:!f$1,sx:po,children:f(wr,{})})]})};var hi=({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(sr,{position:"start",children:f(Br,{size:16})})}})})};var fi=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(Nd,{className:"orb-table-toolbar",role:"toolbar","aria-label":o("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(hi,{value:t.filterText,onChange:l=>{t.setFilterText(l),t.onPageChange?.(0);}}),f(gi,{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(ct,{title:o("table.toolbar.groupBy"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:l=>t.setGroupAnchorEl(t.groupAnchorEl?null:l.currentTarget),children:f(ei,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:f(Cr,{})})})}),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:l=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:l.currentTarget),children:f(nn,{})})}),f(ct,{title:o("table.toolbar.columns"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:l=>t.setAnchorEl(t.anchorEl?null:l.currentTarget),children:f(an,{})})}),f(ct,{title:o("table.toolbar.export"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:t.handleExport,children:f(Zd,{})})})]}),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(Fr,{})})}),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(Qd,{})})})}),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(ni,{})})})})]}),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(Jd,{})})}),t.onLayoutSave&&!t.layoutManager&&f(ct,{title:o("table.toolbar.saveLayout"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:l=>t.onLayoutSave(l),children:f(Sr,{})})}),t.layoutManager]})]})]})})};var bi=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 [bi.Translate.toString(t),bi.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:o,duration:r,easing:n}=t;return o+" "+r+"ms "+n}}});var vi=t=>{let{t:o}=ce(),{onSelectAllClick:r,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:l=0,onRequestSort:d,onContextMenu:p,columns:m,visibleColumns:h,selectionMode:f$1,grouping:u=[],isAllExpanded:b=false,handleToggleAll:C,onColumnResize:g$1,columnWidths:x,enableColumnReorder:v=false,disableSorting:y=false}=t,[k,w]=useState(null),P=useRef(null),I=V=>Q=>{y||k||d(V);},S=(V,Q,H)=>{V.preventDefault(),V.stopPropagation(),w(Q),P.current={startX:V.clientX,startWidth:H,colId:Q},document.addEventListener("mousemove",R),document.addEventListener("mouseup",N),document.body.style.cursor="col-resize";},R=V=>{if(!P.current)return;let{startX:Q,startWidth:H,colId:B}=P.current,q=V.clientX-Q,Z=Math.max(50,H+q);g$1&&g$1(B,Z);},N=()=>{w(null),P.current=null,document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",N),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",N);},[]);let T=f$1==="multiple"||f$1==="single",M=u.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($f,{headCell:V,width:typeof Q=="number"?Q:100,order:n,orderBy:a,multiSortInfo:y?void 0:H,onRequestSort:I(V.id),onContextMenu:p,onResizeMouseDown:B=>S(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<l,checked:l>0&&s===l,onChange:r,disabled:f$1==="single",sx:jn})}),M&&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:Jn,children:b?f(pi,{}):f(ui,{})})})}),v?f(SortableContext,{items:O,strategy:horizontalListSortingStrategy,children:ee}):ee]});return f("thead",{children:_})},$f=({headCell:t,width:o,order:r,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:l,enableColumnReorder:d,disableSorting:p})=>{let{setNodeRef:m,attributes:h,listeners:f$1,transform:u,transition:b,isDragging:C}=useSortable({id:t.id,disabled:!d}),g$1=d?{transform:bi.Transform.toString(u),transition:b,opacity:C?.6:1}:{},x=p?"asc":a?.direction??(n===t.id?r:"asc"),v=!p&&(!!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:[p?f("span",{className:"orb-table-head-label",children:t.label}):f(Ad,{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:l,onPointerDown:y=>y.stopPropagation(),onClick:y=>y.stopPropagation()})]})};var yi=t=>{let{t:o}=ce(),{visibleRows:r,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:l,expandedGroups:d=new Set,selectionMode:p,grouping:m=[],isGroupFullyExpanded:h,handleExpandGroupRecursively:f$1,handleCollapseGroupRecursively:u,emptyLabel:b,getRowDataKey:C,getRowProps:g$1,getGroupRowProps:x}=t,v=P=>a.indexOf(P)!==-1,y=p==="multiple"||p==="single",k=m.length>0,w=n.length+(y?1:0)+(k?1:0);return g("tbody",{children:[r.map((P,I)=>{if(P.type==="group"){let S=d.has(P.id),R=P.childIds||[],N=R.filter(V=>v(V)).length,T=R.length>0&&N===R.length,M=N>0&&N<R.length,A={entry:P,data:P,id:P.id,index:I,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=>!R.includes(H));t.onSelectionChange(Q);}else {let Q=Array.from(new Set([...a,...R]));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:cl,children:f(Tt,{size:"small",checked:T,indeterminate:M,onChange:_,onClick:V=>V.stopPropagation(),sx:jn})}),k&&f("td",{padding:"checkbox",sx:dl,children:g("div",{sx:Sp,children:[m.length>1&&P.level<m.length-1&&f(ct,{title:h?.(P.id)?o("table.group.collapseAll"):o("table.group.expandAll"),children:f(ie,{size:"small",onClick:()=>{h?.(P.id)?u?.(P.id):f$1?.(P.id);},sx:Jn,children:h?.(P.id)?f(pi,{}):f(ui,{})})}),f(ie,{size:"small",onClick:()=>l&&l(P.id),sx:Jn,children:S?f(Wo,{}):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 S=P.data||P,R=P.id||S.id||I,N=v(R),T=`enhanced-table-checkbox-${I}`,M={entry:P,data:S,id:R,index:I,selected:N,group:false},A=g$1?.(M)||{},{className:L,onClick:W,...ee}=A,_=(P.level!==void 0?P.level:0)*4;return g("tr",{...ee,"data-ctable-row-key":C?.(M),className:[N?"orb-is-selected":"",L].filter(Boolean).join(" "),onClick:V=>{W?.(V),V.defaultPrevented||i?.(V,S);},role:y?"checkbox":ee.role,"aria-checked":y?N:ee["aria-checked"],tabIndex:ee.tabIndex??-1,children:[y&&f("td",{padding:"checkbox",sx:cl,children:f(Tt,{color:"primary",checked:N,inputProps:{"aria-labelledby":T},sx:jn})}),k&&f("td",{padding:"checkbox",sx:dl}),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(S[V.id],S):(function(){let Z=S[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)})]},R)}}),r.length===0&&f("tr",{children:f("td",{colSpan:w,align:"center",children:b??o("common.noData")})})]})};var kp=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,p=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}}),p.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 Pp=t=>{let{t:o}=ce();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}=ce(),[s,l]=useState(r);useEffect(()=>{t&&l(r);},[t,r]);let d=()=>{l(r),o(null);},p=h=>{l(f=>f.includes(h)?f.filter(u=>u!==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(),l([]);},children:i("table.menu.clearAll")})]}),f(Rt,{className:"orb-table-group-menu-divider"}),a.map(h=>{let f$1=s.includes(h.id),u=s.indexOf(h.id)+1;return f("option",{className:"orb-table-group-menu-option",selected:f$1,onClick:b=>{b.stopPropagation(),p(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")} ${u}`,children:u})]})},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")})]})]})},dn=({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))]})},Ci=({anchorEl:t,setAnchorEl:o,showSummary:r,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:l}=ce();return g(Qt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{children:f(Qn,{control:f(ti,{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")})})]})},xi=({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(Vo,{children:n.includes(s.id)&&f(Gd,{fontSize:"small"})}),f(_t,{children:s.label})]},s.id))]})},Rp=({contextMenu:t,handleClose:o,columns:r,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:l,orderBy:d,order:p,onSortAsc:m,onSortDesc:h,onClearSort:f$1,onHideColumn:u,onToggleGroup:b,onToggleSummary:C,onOpenSortDialog:g$1})=>{let{t:x}=ce(),v=t?.columnId??"",y=r.find(T=>T.id===v),k=a.includes(v),w=i.includes(v),P=!!y?.numeric,I=l.find(T=>T.field===v),S=I?I.direction==="asc":d===v&&p==="asc",R=I?I.direction==="desc":d===v&&p==="desc",N=S||R;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:S,children:[f(Vo,{children:f(il,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.sortAsc")})]}),g("option",{onClick:()=>{h(v),o();},selected:R,children:[f(Vo,{children:f(al,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.sortDesc")})]}),N&&g("option",{onClick:()=>{f$1(v),o();},children:[f(Vo,{children:f(Kd,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.clearSort")})]}),g("option",{onClick:()=>{g$1(),o();},children:[f(Vo,{children:f(Fr,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.configureSort")})]}),f(Rt,{}),g("option",{onClick:()=>{b(v),o();},selected:k,children:[f(Vo,{children:f(Cr,{fontSize:"small"})}),f(_t,{primary:x(k?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),P&&s&&g("option",{onClick:()=>{C(v),o();},selected:w,children:[f(Vo,{children:f(nn,{fontSize:"small"})}),f(_t,{primary:x(w?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),f(Rt,{}),g("option",{onClick:()=>{u(v),o();},children:[f(Vo,{children:f(bp,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.hideColumn")})]})]})},Dp=({open:t,onClose:o,columns:r,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=ce(),[l,d]=useState([]);useEffect(()=>{t&&d(n.length>0?n.map(C=>({...C})):[]);},[t,n]);let p=useMemo(()=>new Set(l.map(C=>C.field)),[l]),m=useMemo(()=>r.filter(C=>!p.has(C.id)),[r,p]),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));},u=(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],[k]=y.splice(C,1);return y.splice(v,0,k),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:l.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(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(se,{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)),v=r.filter(y=>!x.has(y.id));return g("div",{className:"orb-table-sort-rule",children:[f(ei,{className:"orb-table-sort-order",badgeContent:g$1+1,color:"primary"}),f(zt,{size:"small",value:C.field,onChange:y=>u(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=>u(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(il,{fontSize:"small"})}),f(ie,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>b(g$1,1),disabled:g$1===l.length-1,children:f(al,{fontSize:"small"})}),f(ie,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>f$1(g$1),children:f(ai,{fontSize:"small"})})]},`sort-rule-${g$1}`)})}),f(Pe,{size:"small",onClick:h,disabled:m.length===0,startIcon:f(Fr,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};var ea=(t,o=2)=>t.toLocaleString(void 0,{maximumFractionDigits:o}),Np=({kpis:t})=>{let{t:o}=ce(),r=[{label:o("graph.kpi.totalRecords"),value:ea(t.totalRecords,0),color:"var(--orb-fg)"},{label:o("graph.kpi.totalReport"),value:ea(t.totalReportHours),color:"var(--orb-fg)"},{label:o("graph.kpi.totalBillable"),value:ea(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:ea(t.totalAmount),color:"var(--orb-primary)"},{label:o("graph.kpi.flagged"),value:ea(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 wi=({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 ta=({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(se,{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 Ap=({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),p=Math.max(...s,1)-l||1,m=t.map((f,u)=>{let b=i+u*(a-i*2)/Math.max(t.length-1,1),C=n-i-(f.value-l)/p*(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 Ep=({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,u=Math.max(f*.5,8),b=i+h*f+(f-u)/2,C=m.barValue/s*(n-i*2),g=n-i-C;return {x:b,y:g,barHeight:C,barWidth:u,item:m}}),p=t.map((m,h)=>{let f=(a-i*2)/t.length,u=i+h*f+f/2,b=n-i-m.lineValue/l*(n-i*2);return {x:u,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:p.map(m=>`${m.x},${m.y}`).join(" ")}),p.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 _f=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)`},Lp=({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:_f(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 Gf=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],Si=({data:t,variant:o="donut",colors:r=Gf,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let s=0,l=t.map((d,p)=>{let m=s;return s+=d.percent,`${r[p%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(${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(se,{spacing:1,sx:{minWidth:180},children:t.map((d,p)=>g("div",{onClick:()=>i?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[f("div",{style:{width:10,height:10,borderRadius:"50%",background:r[p%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 Op=({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 Fp=({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,u=h.type==="total"?h.value:r+h.value;return h.type!=="total"&&(r=u),{...h,start:f,end:u,delta:u-f}}),a=n.flatMap(h=>[h.start,h.end]),i=Math.min(...a,0),s=Math.max(...a,1),l=680,d=30,p=s-i||1,m=h=>o-d-(h-i)/p*(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 u=(l-d*2)/n.length,b=Math.max(u*.55,8),C=d+f$1*u+(u-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 oa=({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}`},aR=(t,o=360)=>{let r=oa(t);return `<iframe width="100%" height="${o}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${r}"></iframe>`};var Bp=({apiKey:t,query:o,embedUrl:r,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=r||(t&&o?oa({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 ki=({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 Hp=({keyword:t,location:o,embedUrl:r,height:n=320})=>{let a=r||ki({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 zp=({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(wi,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:f(ta,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),f(wi,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:f(ta,{data:o,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),f(wi,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:f(Si,{data:r,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};var Kf=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],qf=["zh","en","de","fr","ja","ko"],Vp=({open:t,onClose:o,value:r,onSaveAll:n,modelOptions:a=Kf,promptLangOptions:i=qf,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:p})=>{let[m,h]=useState(r),[f$1,u]=useState(d||""),[b,C]=useState(p||""),[g$1,x]=useState(false);useEffect(()=>{t&&(h(r),u(d||""),C(p||""));},[t,r,d,p]);let v=(k,w)=>{h(P=>({...P,[k]:w}));},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(xr,{})})]}),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:k=>v("baseUrl",k.target.value),fullWidth:true,label:"Base URL"})}),f("div",{children:f(He,{size:"small",type:"password",value:m.apiKey,onChange:k=>v("apiKey",k.target.value),fullWidth:true,label:"API Key"})}),f("div",{children:f(He,{size:"small",value:m.model,onChange:k=>v("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=>v("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=>u(k.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[f("option",{value:"",children:"Default"}),s.map(k=>f("option",{value:k.id,children:k.label},k.id))]}),f(Vn,{multiline:true,minRows:8,value:m.analysisPrompt,onChange:k=>v("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:b,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(Vn,{multiline:true,minRows:8,value:m.responsePrompt,onChange:k=>v("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(Pe,{variant:"outlined",onClick:o,children:"Cancel"}),f(Pe,{variant:"contained",onClick:y,disabled:!n||g$1,children:"Save"})]})]})};var Ti=({open:t,onClose:o,model:r,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=ce(),[d,p]=useState(s?.defaultPrompt||""),[m,h]=useState(false),[f$1,u]=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&&p(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let y=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},k=async()=>{let w=d.trim();if(!(!w||!s?.onSubmit))try{h(!0),await s.onSubmit(w,{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:l("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(Oa,{size:16,strokeWidth:1.8})}),f("input",{className:"orb-inp orb-inp-dense",value:d,onChange:w=>p(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),k());},placeholder:v,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),f(ie,{size:"small",onClick:k,disabled:m||!d.trim(),children:f(Xc,{size:16,strokeWidth:1.8})}),f(ie,{size:"small",onClick:()=>u(true),children:f(Jr,{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(Np,{kpis:r.kpis}),f(zp,{billableByPrimary:r.charts.billableByPrimary,efficiencyBySecondary:r.charts.efficiencyBySecondary,statusDistribution:r.charts.statusDistribution,interaction:b?{filters:g$1,onPrimaryDimensionClick:w=>i?.onPrimaryDimensionClick(w),onSecondaryDimensionClick:w=>i?.onSecondaryDimensionClick(w),onStatusClick:w=>i?.onStatusClick(w)}:void 0}),a,n]}),f(Vp,{open:f$1,onClose:()=>u(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"]},Zf=5,Wp=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=>[Wp(s),s]));for(let s of r){let l=i.get(Wp(s));if(l)return l}return a[0]||n},Po=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},ho=(t,o)=>t==null||t===""?o:String(t),Yf=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let l=ho(s[o],a);i.set(l,(i.get(l)||0)+Po(s[r]));}),Array.from(i.entries()).map(([s,l])=>({name:s,value:l})).sort((s,l)=>l.value-s.value).slice(0,n)},Qf=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=ho(l[o],i),p=s.get(d)||{report:0,billable:0};p.report+=Po(l[r]),p.billable+=Po(l[n]),s.set(d,p);}),Array.from(s.entries()).map(([l,d])=>({name:l,value:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>l.value-d.value).slice(0,a)},jf=(t,o,r)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=ho(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}))},$p=(t,o,r)=>{let n=new Map;return t.forEach(a=>{let i=ho(a[o],"N/A");n.set(i,(n.get(i)||0)+Po(a[r]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},Jf=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=ho(l[o],i),p=s.get(d)||{report:0,billable:0};p.report+=Po(l[r]),p.billable+=Po(l[n]),s.set(d,p);}),Array.from(s.entries()).map(([l,d])=>({name:l,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>d.barValue-l.barValue).slice(0,a)},eb=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let l=ho(s[o],a),d=ho(s[r],a),p=`${l}__${d}`;i.set(p,(i.get(p)||0)+Po(s[n]));}),Array.from(i.entries()).map(([s,l])=>{let[d,p]=s.split("__");return {x:d,y:p,value:l}})},tb=(t,o,r)=>{let n=$p(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"}]},ob=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=ho(l[o],i),p=`${ho(l[r],i)} / ${ho(l[n],i)}`,m=s.get(d)||new Map;m.set(p,(m.get(p)||0)+1),s.set(d,m);}),Array.from(s.entries()).map(([l,d])=>({title:l,causes:Array.from(d.entries()).sort((p,m)=>m[1]-p[1]).slice(0,a).map(([p,m])=>`${p} (${m})`)})).slice(0,6)},pn=({rows:t,config:o})=>{let{t:r}=ce(),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=Po(m[a.reportHours]),u=Po(m[a.billableHours]),b=Po(m[a.amount]),C=f>0?u/f*100:0;return {id:`graph-row-${h}`,Date:ho(m[a.date],""),Primary:ho(m[a.primaryDimension],n),Secondary:ho(m[a.secondaryDimension],n),Description:ho(m[a.description],""),ReportHours:f,BillableHours:u,Amount:b,Efficiency:C,Status:ho(m[a.status],n)}}),[t,a,n]),s=useMemo(()=>{let m=i.length,h=i.reduce((x,v)=>x+Po(v.ReportHours),0),f=i.reduce((x,v)=>x+Po(v.BillableHours),0),u=i.reduce((x,v)=>x+Po(v.Amount),0),b=h>0?f/h*100:0,C=o?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>C.includes(ho(x.Status,"").toLowerCase())).length;return {totalRecords:m,totalReportHours:h,totalBillableHours:f,efficiency:b,totalAmount:u,flaggedCount:g}},[i,o?.statusFlagValues]),l=o?.topN||Zf,d=useMemo(()=>({billableByPrimary:Yf(i,"Primary","BillableHours",l,n),efficiencyBySecondary:Qf(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:jf(i,"Status",n),lineByDate:$p(i,"Date","BillableHours"),comboByPrimary:Jf(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:eb(i,"Primary","Secondary","BillableHours",n),waterfallBillable:tb(i,"Date","BillableHours"),fishboneStatusCauses:ob(i,"Status","Primary","Secondary",3,n)}),[i,l,n]),p=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:p}};var un=t=>String(t??"").trim(),Mi=(t={})=>{let[o,r]=useState(t),n=useCallback((d,p)=>{r(m=>{let h=p?.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(p=>{if(!p[d])return p;let m={...p};return delete m[d],m});},[]),i=useCallback(()=>{r({});},[]),s=useMemo(()=>!!(o.primaryDimension||o.secondaryDimension||o.status),[o]),l=useCallback((d,p)=>d.filter(m=>!(o.primaryDimension&&un(m[p.primaryDimension])!==un(o.primaryDimension)||o.secondaryDimension&&un(m[p.secondaryDimension])!==un(o.secondaryDimension)||o.status&&un(m[p.status])!==un(o.status))),[o]);return {filters:o,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:l}};var Di=({variants:t,currentVariantId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=ce(),[l,d]=useState(false),[p,m]=useState(""),[h,f$1]=useState(false),[u,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:p,isDefault:h,isPublic:u,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(k=>k.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(Sr,{fontSize:"small"})})}),g(Lt,{open:l,onClose:()=>d(false),children:[f("div",{className:"orb-dialog-title",children:s("variant.saveView")}),g("div",{className:"orb-dialog-content",children:[f(He,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:p,onChange:v=>m(v.target.value)}),f(Qn,{control:f(Tt,{checked:h,onChange:v=>f$1(v.target.checked)}),label:s("variant.setDefault")}),f(Qn,{control:f(Tt,{checked:u,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 Gp=({appId:t,tableKey:o="default",currentFilters:r,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:l,onError:d,onSuccess:p,currentVariantId:m,onVariantChange:h})=>{let{t:f$1}=ce(),[u,b]=useState([]),[C,g]=useState(""),x=`orbcafe.variants.${t}.${o}`,v=m!==void 0?m:C,y=M=>{m===void 0&&g(M),h&&h(M);},k=useCallback(()=>{try{let M=localStorage.getItem(x);if(!M)return [];let A=JSON.parse(M);return Array.isArray(A)?A:[]}catch{return []}},[x]),w=useCallback(M=>{try{localStorage.setItem(x,JSON.stringify(M));}catch{}},[x]),P=useCallback(M=>{b(M);let A=M.find(L=>L.isDefault);A&&!v&&(y(A.id),i(A));},[v,i,y]),I=useCallback(async()=>{if(!t)return [];try{let M=[];if(s)M=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"));M=await A.json();}else M=k();return P(M),M}catch(M){console.error("Error fetching variants",M);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(Di,{variants:u,currentVariantId:v,onLoad:M=>{y(M.id),i(M);},onSave:async M=>{let A=Date.now().toString(),L;try{let W=M.scope||"Both",ee=u.find(Q=>Q.name===M.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,...M,scope:W,id:A,createdAt:new Date().toISOString(),filters:O,layout:_,layoutRefs:V},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 H=u.some(B=>B.id===A)?u.map(B=>B.id===A?L:B):[...u,L];b(H),w(H);}p&&p(f$1("variant.toast.saveSuccess")),(s||l)&&await I(),y(A),i(L);}catch(W){console.error("Error saving variant",W);let O=u.some(_=>_.id===A)?u.map(_=>_.id===A?L:_):[...u,L];b(O),w(O),y(A),i(L),d&&d(f$1("variant.toast.saveFailed"));}},onDelete:async M=>{try{if(s)await s.deleteVariant(M);else if(l){if(!(await fetch(`${l}/api/variants/${M}`,{method:"DELETE"})).ok)throw new Error(f$1("variant.toast.deleteFailed"))}else {let A=u.filter(L=>L.id!==M);b(A),w(A);}v===M&&y(""),(s||l)&&I(),p&&p(f$1("variant.toast.deleteSuccess"));}catch(A){console.error("Error deleting variant",A);let L=u.filter(W=>W.id!==M);b(L),w(L),v===M&&y(""),d&&d(f$1("variant.toast.deleteFailed"));}},onSetDefault:async M=>{try{let A=u.find(W=>W.id===M);if(!A)return;let L={appId:t,tableKey:o,...A,isDefault:!0};if(s)await s.setDefaultVariant(M,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 W=u.map(ee=>({...ee,isDefault:ee.id===M}));b(W),w(W);}(s||l)&&await I(),p&&p(f$1("variant.toast.defaultSuccess"));}catch(A){console.error("Error setting default variant",A);let L=u.map(W=>({...W,isDefault:W.id===M}));b(L),w(L),d&&d(f$1("variant.toast.defaultFailed"));}}})};rr.extend(lb);rr.extend(cb);rr.extend(qh);var na="YYYY-MM-DD",pb=[null,null],Hr="0.85rem",ub={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},mb=({isInRange:t,isStart:o,isEnd:r,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=io();return f(Fd,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:l.palette.primary.light,color:l.palette.primary.contrastText}:{},n&&!t&&!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%"}:{}]})},Kp=({label:t,value:o=pb,onChange:r})=>{let{t:n,locale:a}=ce(),i=ub[a]||"en",s=t||n("dateRange.label"),[l,d]=useState(null),[p,m]=useState(o),[h,f$1]=useState("start"),[u,b]=useState(null),[C,g$1]=useState((o[0]||rr()).locale(i)),[x,v]=useState(""),[y,k]=useState(""),[w,P]=useState(false),[I,S]=useState(false),R=Jt__default.useRef(o);useEffect(()=>{let[Q,H]=o,[B,q]=R.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))),R.current=o;},[o,i]),useEffect(()=>{v(p[0]?p[0].locale(i).format(na):""),k(p[1]?p[1].locale(i).format(na):""),P(false),S(false);},[p,i]);let N=(Q,H)=>{let B=H.trim(),q=Q==="start"?P:S;if(!B){let J=Q==="start"?[null,p[1]]:[p[0],null];q(false),m(J);return}let Z=rr(B,na,true).locale(i);if(!Z.isValid()){q(true);return}q(false);let Y=[...p];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);},M=()=>{d(null),f$1("start"),b(null);},A=!!l,L=Q=>{if(!Q)return;let H=[...p];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=rr().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(p),M();},O=()=>{m(o),f$1("start"),M();},_=useCallback(Q=>{let{day:H,...B}=Q,[q,Z]=p,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&&u&&H.isAfter(q,"day")&&H.isBefore(u.add(1,"day"),"day")&&(he=true),f(mb,{...B,day:H,disableMargin:true,isStart:Y,isEnd:J,isInRange:le||he,onMouseEnter:()=>b(H)})},[p,h,u]),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:p[0]?`${V(p[0])} - ${V(p[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(ie,{className:"orb-date-range-calendar-trigger",size:"small",onClick:T,tooltip:s,children:f(Pt,{name:"calendar",size:16})})}}),g(oi,{open:A,anchorEl:l,onClose:M,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[f("div",{className:"orb-date-range-inputs",children:g(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:na,value:x,error:w,size:"small",onFocus:()=>f$1("start"),onChange:Q=>{v(Q.target.value),w&&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(Vd,{color:"action",fontSize:"small"}),f(He,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:na,value:y,error:I,size:"small",onFocus:()=>{p[0]&&f$1("end");},onChange:Q=>{k(Q.target.value),I&&S(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(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(Hd,{dateAdapter:ja,adapterLocale:i,children:f(Bd,{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 Ai={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},fb={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"},bb=["contains","notContains",">",">=","<","<=","equals"],Xp=["=","!=",">","<",">=","<=","between"],oo="0.85rem",vb=({field:t,value:o,onChange:r})=>{let{t:n}=ce(),[a,i]=useState(null),[s,l]=useState(null),[d,p]=useState(null),[m,h]=useState(""),[f$1,u]=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,k=T=>{let M=fb[T];return M?n(M):T},w=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:oo}},InputProps:{sx:{fontSize:oo}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:oo,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=t.type||"text";if(S==="date"){let M=(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,W=A[1]?rr.isDayjs(A[1])?A[1]:rr(A[1]):null;return [L,W]}return rr.isDayjs(A)||typeof A=="string"?[rr.isDayjs(A)?A:rr(A),null]:[null,null]})(y);return f(Kp,{label:t.label,value:M,onChange:A=>r({value:A,operator:"between"})})}if(S==="number"&&v==="between"){let T=()=>{r({value:[m,f$1],operator:"between"}),l(null);},M=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return g(e,{children:[f(He,{...I,label:t.label,value:M,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...I.InputProps,startAdornment:f(sr,{position:"start",children:f(ct,{title:k("between"),children:f(ie,{size:"small",onClick:w,sx:{width:24,height:24,fontSize:oo},children:Ai.between})})}),readOnly:true},onClick:A=>l(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:Xp.map(A=>g("option",{selected:A===v,onClick:()=>P(A),children:[f("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ai[A]}),f(_t,{primary:k(A),primaryTypographyProps:{fontSize:oo}})]},A))}),f(oi,{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:oo}},InputProps:{sx:{fontSize:oo}}}),f(Wd,{color:"action"}),f(He,{size:"small",label:n("smartFilter.max"),type:"number",value:f$1,onChange:A=>u(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||S==="value-help"){let T=t.valueHelp?.mode||"single";return f(wp,{...I,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:y??(T==="multiple"?[]:null),mode:T,onChange:M=>r({value:M,operator:T==="multiple"?"anyOf":"equals"})})}if(S==="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(S==="multi-select"){let T=Array.isArray(y)?y:[],M=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=()=>{p(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:_=>p(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(Wo,{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(sr,{position:"start",children:f(Br,{fontSize:"small"})}),sx:{fontSize:oo}},value:b,onChange:_=>C(_.target.value),onKeyDown:_=>_.stopPropagation()}),M.length>0?M.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 R=S==="number"?Xp:bb;return g(e,{children:[f(He,{...I,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:y||"",type:S==="number"?"number":"text",onChange:T=>r({...o,value:T.target.value,operator:v}),InputProps:{...I.InputProps,startAdornment:f(sr,{position:"start",children:f(ct,{title:k(v),children:f(ie,{className:"orb-filter-operator-trigger",size:"small",onClick:w,onMouseDown:T=>T.preventDefault(),sx:{width:24,height:24,fontSize:oo,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Ai[v]})})}),endAdornment:t.hasSearchIcon?f(sr,{position:"end",children:f(Br,{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:R.map(T=>g("option",{selected:T===v,onClick:()=>P(T),children:[f("span",{className:"orb-filter-operator-symbol",children:Ai[T]}),f(_t,{primary:k(T),primaryTypographyProps:{fontSize:oo}})]},T))})]})},$o=({fields:t,filters:o,onFilterChange:r,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:l,onVariantSetDefault:d,onSearch:p,loading:m=false,appId:h,tableKey:f$1,currentLayout:u,currentLayoutId:b,layoutRefs:C,variantService:g$1,serviceUrl:x})=>{let{t:v}=ce(),[y,k]=useState(true),[w,P]=useState(null),[I,S]=useState(t.filter(M=>!M.hidden).map(M=>M.id)),R=(M,A)=>{r({...o,[M]:A});},N=M=>{I.includes(M)?S(I.filter(A=>A!==M)):S([...I,M]);};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(Gp,{appId:h,tableKey:f$1,currentFilters:{values:o,visibleFields:I},currentLayout:u,currentLayoutId:b,layoutRefs:C,onLoad:M=>{if(!M.filters)return;let A=null;if(Array.isArray(M.filters)){let L=f$1||"default",W=M.filters.find(ee=>ee.scope===L);A=W?W.filters:null;}else A=M.filters;A&&(A.values||A.visibleFields?(A.visibleFields&&Array.isArray(A.visibleFields)&&S(A.visibleFields),A.values&&r(A.values)):r(A)),i&&i(M);},variantService:g$1,serviceUrl:x,currentVariantId:a}):f(Di,{variants:n,currentVariantId:a,onLoad:i,onSave:M=>{s&&s({...M,filters:{values:o,visibleFields:I}});},onDelete:l,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:M=>P(w?null:M.currentTarget),size:"small",color:"primary",startIcon:f(pp,{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:p,disabled:m,children:m?f(Zo,{size:16}):f(Pt,{name:"play",size:16})}),g(Qt,{anchorEl:w,open:!!w,onClose:()=>P(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(M=>g("option",{onClick:()=>N(M.id),children:[f(Tt,{checked:I.includes(M.id),size:"small"}),f(_t,{primary:M.label,primaryTypographyProps:{fontSize:oo}})]},M.id))]})]})]}),f("div",{className:"orb-smart-filter-grid",children:f(nl,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(M=>I.includes(M.id)).map(M=>f(nl,{size:1,children:f(vb,{field:M,value:o[M.id]||{value:"",operator:M.type==="number"?"=":"equals"},onChange:A=>R(M.id,A)})},M.id))})})]}):null,f("div",{className:"orb-smart-filter-toggle",children:f(ie,{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(ii,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):f(Wo,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};var Zp=({layouts:t,currentLayoutId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=ce(),[l,d]=useState(null),[p,m]=useState(false),[h,f$1]=useState(""),[u,b]=useState(""),[C,g$1]=useState({isDefault:false,isPublic:false}),x=t.find(I=>I.id===o),v=I=>{d(I.currentTarget);},y=()=>{d(null);},k=I=>{r(I),y();},w=()=>{f$1(""),b(""),g$1({isDefault:false,isPublic:false}),m(true),y();},P=()=>{h.trim()&&(n({name:h,description:u,...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(fp,{fontSize:"small"})})}),g(Qt,{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:w,children:[f(Vo,{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,S)=>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:R=>R.stopPropagation(),children:[f(ct,{title:I.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:f(ie,{size:"small",onClick:R=>{R.stopPropagation(),i(I.id);},children:I.isDefault?f(gp,{fontSize:"small",color:"warning"}):f(mp,{fontSize:"small"})})}),f(ct,{title:s("common.delete"),children:f(ie,{size:"small",color:"error",onClick:R=>{R.stopPropagation(),a(I.id);},children:f(ni,{fontSize:"small"})})})]})]})},I.id||S))]}),f(Lt,{open:p,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: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:u,onChange:I=>b(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:p}=ce(),[m,h]=useState([]),[f$1,u]=useState(""),b=`orbcafe.layouts.${t}.${o}`,C=S=>({id:S.layoutId,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt??new Date().toISOString(),layoutData:S.layout??{}}),g=S=>({appId:t,tableKey:o,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),x=useCallback(()=>{try{let S=localStorage.getItem(b);if(!S)return [];let R=JSON.parse(S);return Array.isArray(R)?R:[]}catch{return []}},[b]),v=useCallback(S=>{try{localStorage.setItem(b,JSON.stringify(S));}catch{}},[b]);useEffect(()=>{i!==void 0&&u(i);},[i]),useEffect(()=>{if(a&&m.length>0){let S=m.find(R=>R.id===a);S&&(u(S.id),n(S));}},[a,m,n]);let y=useCallback(async()=>{if(t){if(!s){let S=x();h(S);let R=S.find(N=>N.isDefault);R&&!f$1&&!a&&(u(R.id),n(R));return}try{let S=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let N=(await S.json()).map(C);h(N);let T=N.find(M=>M.isDefault);T&&!f$1&&!a&&(u(T.id),n(T));}catch(S){console.error("Error fetching layouts",S);let R=x();h(R);let N=R.find(T=>T.isDefault);N&&!f$1&&!a&&(u(N.id),n(N)),l&&l(p("layout.toast.loadFallback"));}}},[t,o,s,l,f$1,n,a,x,p]);return useEffect(()=>{y();},[t,o]),f(Zp,{layouts:m,currentLayoutId:f$1,onLoad:S=>{u(S.id),n(S);},onSave:async S=>{let R=m.find(M=>M.name===S.name),N=R?R.id:Date.now().toString(),T={id:N,...S,createdAt:new Date().toISOString(),layoutData:r,isDefault:S.isDefault??false,isPublic:S.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),u(N),n(T),d&&d(p("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g(T))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(p("layout.toast.saveSuccess")),await y(),u(N),n(T);}catch(M){console.error("Error saving layout",M);let L=m.some(W=>W.id===N)?m.map(W=>W.id===N?T:W):[...m,T];h(L),v(L),u(N),n(T),d&&d(p("layout.toast.saveLocalSuccess")),l&&l(p("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!s){let R=m.filter(N=>N.id!==S);h(R),v(R),f$1===S&&u(""),d&&d(p("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f$1===S&&u(""),d&&d(p("layout.toast.deleteSuccess")),await y();}catch(R){console.error("Error deleting layout",R);let N=m.filter(T=>T.id!==S);h(N),v(N),f$1===S&&u(""),d&&d(p("layout.toast.deleteLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!s){let R=m.map(N=>({...N,isDefault:N.id===S}));h(R),v(R),d&&d(p("layout.toast.defaultLocalSuccess"));return}try{let R=m.find(T=>T.id===S);if(!R)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...R,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(p("layout.toast.defaultSuccess")),await y();}catch(R){console.error("Error setting default",R);let N=m.map(T=>({...T,isDefault:T.id===S}));h(N),v(N),d&&d(p("layout.toast.defaultLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDefaultLocal"));}}})};var Ei=(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},Li=(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 Qp(t,o,r){return o[r]<t[r]?-1:o[r]>t[r]?1:0}function yb(t,o){return t==="desc"?(r,n)=>Qp(r,n,o):(r,n)=>-Qp(r,n,o)}function Cb(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(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(""),[l,d]=useState(t.order||"asc"),[p,m]=useState(t.orderBy||""),[h,f]=useState([]),[u,b]=useState(t.page||0),[C,g]=useState(t.rowsPerPage||20),[x,v]=useState(t.selected||[]),[y,k]=useState(t.columns?t.columns.map(K=>K.id):[]),[w,P]=useState(t.columns?t.columns.map(K=>K.id):[]),[I,S]=useState(t.showSummary||false),[R,N]=useState(()=>a()),[T,M]=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){M([]),L(new Set),Q(null);return}M(K);},[o]);useEffect(()=>{o&&(M([]),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(()=>{P(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(w.length===0)return K;let z=new Map(K.map(Se=>[Se.id,Se])),X=[],fe=new Set;return w.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,w]),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 p?Cb(ve,yb(l,p)):ve},[ve,l,p,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(u*C,u*C+C):it,[it,u,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=p===K&&l==="asc",X=p===K&&l==="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);},De=K=>{let z=y.indexOf(K),X=[...y];z===-1?X.push(K):X.splice(z,1),k(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||P(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:w,order:r?"asc":l,orderBy:r?"":p,sortBy:r?[]:h,grouping:Ce,columnWidths:W,showSummary:I,summaryColumns:R});},Vt=K=>{let{layout:z,layoutId:X}=Li(K,t.tableKey||"default");X?(be(X),he(X)):(be(""),he("")),z&&(z.visibleColumns&&k(z.visibleColumns),Array.isArray(z.columnOrder)&&P(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&&S(!!z.showSummary),Array.isArray(z.summaryColumns)&&N(z.summaryColumns));},wt=K=>{let z=K?.layoutData||K?.layout||K||{};z.visibleColumns&&k(z.visibleColumns),Array.isArray(z.columnOrder)&&P(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&&S(!!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);},Nt=useMemo(()=>{if(!I)return {};let K={};t.columns.forEach(X=>{if(X.numeric&&R.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,I,R,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:l,setOrder:d,orderBy:p,setOrderBy:m,sortBy:h,setSortBy:f,applyMultiSort:re,clearMultiSort:Ge,columnOrder:w,setColumnOrder:P,filterText:i,setFilterText:s,visibleColumns:y,setVisibleColumns:k,showSummary:I,setShowSummary:S,summaryColumns:R,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:Nt,page:u,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:De,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":l,orderBy:r?"":p,sortBy:r?[]:h,columnOrder:w,grouping:Ce,columnWidths:W,showSummary:I,summaryColumns:R},currentLayoutId:le,layoutIdToLoad:ze,onPageChange:oe,onRowsPerPageChange:ye,graphReportOpen:Y,handleOpenGraphReport:Ft,handleCloseGraphReport:Zt}};var cD=t=>f("tbody",{...t}),dD=({align:t,...o})=>f("td",{align:t==="inherit"?void 0:t,...o}),pD=t=>f("div",{...t}),uD=t=>f("thead",{...t}),mD=t=>f("tr",{...t}),er=t=>{let{t:o}=ce(),r="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:m=false,fullWidth:h=false,maxHeight:f$1,loading:u=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:C,filterConfig:g$1,rowKey:x,tableKey:v="default",graphReport:y,quickCreate:k,quickEdit:w,quickDelete:P,serviceUrl:I,disableGrouping:S=false,disableSorting:R=false}=t,N=n||o("table.title.default"),{isMobile:T,columns:M,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:De,isGroupFullyExpanded:je,handleLayoutLoad:st,handleVariantLoad:pt,handleLayoutSave:Bt,effectiveAppId:Xt,currentLayoutData:Vt,currentLayoutId:wt,layoutIdToLoad:Wt,graphReportOpen:ft,handleOpenGraphReport:Nt,handleCloseGraphReport:lt}=hn(t),Ft=y?.enabled??false,Zt=Ft&&(y?.interaction?.enabled??true),K=Mi(),z=!!k?.enabled,X=!!w?.enabled,fe=!!P?.enabled,Se=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,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=u||ut||ge||mt,Et=Jt__default.useMemo(()=>{let ne=[...M];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)},[M,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=w?.fields,to=w?.excludeFields||[],no=w?.editableFields||[],fo=w?.nonEditableFields||[],Io=w?.primaryKeys?.length?w.primaryKeys:[Yt],Mo=Jt__default.useMemo(()=>{let ne=[...M];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)},[M,to,$t]),nr=Jt__default.useMemo(()=>new Set(Io),[Io]),Co=Jt__default.useMemo(()=>new Set(no),[no]),Fo=Jt__default.useMemo(()=>new Set(fo),[fo]),Ur=Jt__default.useCallback(ne=>Co.size>0?Co.has(ne):!(Fo.has(ne)||nr.has(ne)),[Co,Fo,nr]);Jt__default.useEffect(()=>{!ft&&K.hasActiveFilters&&K.clearAll();},[ft,K.hasActiveFilters,K.clearAll]);let Kr=()=>{let ne={};Et.forEach(me=>{ne[me.id]=$e[me.id]??"";}),bt(ne),Ye(true);},Ar=()=>{ut||Ye(false);},qr=(ne,me)=>{bt(te=>({...te,[ne]:me}));},Xr=async()=>{if(!k?.onSubmit){Ye(false);return}try{gt(!0),await k.onSubmit(Mt),Ye(!1);}finally{gt(false);}},Ro=()=>{if(!Ut)return;let ne={};Mo.forEach(te=>{ne[te.id]=Ut[te.id]??"";});let me=w?.getInitialValues?{...ne,...w.getInitialValues(Ut)}:ne;qe(me),j(true);},Er=()=>{ge||j(false);},Zr=(ne,me)=>{qe(te=>({...te,[ne]:me}));},Xo=async()=>{if(Ut){if(!w?.onSubmit){j(false);return}try{Te(!0),await w.onSubmit(Je,Ut),j(!1);}finally{Te(false);}}},ar=()=>{Ht.length!==0&&ht(true);},En=()=>{mt||ht(false);},Lr=async()=>{if(Ht.length===0){ht(false);return}if(!P?.onConfirm){ht(false),Oe([]),l?.([]);return}try{yt(!0),await P.onConfirm(Ht),ht(!1),Oe([]),l?.([]);}finally{yt(false);}},D=de,{fieldMapping:$}=pn({rows:D,config:{...y,title:y?.title||`${N} ${o("graph.reportTitle")}`}}),G=Jt__default.useMemo(()=>Zt?K.applyRows(D,$):D,[Zt,K.applyRows,D,$]),{model:ue}=pn({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(gn,{appId:Xt,tableKey:v,currentLayoutData:Vt,onLayoutLoad:st,targetLayoutId:Wt,activeLayoutId:wt,serviceUrl:I??g$1?.serviceUrl}):null,_e=g(e,{children:[!S&&f(cn,{groupAnchorEl:Z,setGroupAnchorEl:Y,grouping:H,setGrouping:B,columns:M}),f(dn,{anchorEl:ze,setAnchorEl:be,columns:M,visibleColumns:O,toggleColumnVisibility:pe}),f(Ci,{anchorEl:J,setAnchorEl:le,showSummary:_,setShowSummary:V,columns:M,summaryColumns:Q,toggleSummaryColumn:Ot}),f(xi,{contextMenu:Ce,handleCloseContextMenu:Le,columns:M,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:I??g$1.serviceUrl}),f(Pp,{title:N,loading:u,showSummary:_,setShowSummary:V,setAnchorEl:be,setSummaryAnchorEl:le,filterText:W,setFilterText:ee,sortedAndFilteredRows:de,selected:s,columns:M,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:u,appId:g$1.appId,tableKey:v,currentLayout:[{tableKey:v,layoutData:Vt}],currentLayoutId:wt,layoutRefs:[{tableKey:v,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":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(fi,{filterText:W,setFilterText:ee,onRowsPerPageChange:Re,rowsPerPage:U,rowsPerPageOptions:b,page:nt,count:we,onPageChange:it,actions:d,extraTools:p,grouping:H,disableGrouping:S,groupAnchorEl:Z,setGroupAnchorEl:Y,showSummary:_,setShowSummary:V,anchorEl:ze,setAnchorEl:be,summaryAnchorEl:J,setSummaryAnchorEl:le,handleExport:re,showCreateButton:z,onOpenCreateDialog:Kr,showEditButton:X,onOpenEditDialog:Ro,editDisabled:Ht.length!==1,showDeleteButton:fe,onOpenDeleteConfirm:ar,deleteDisabled:Ht.length===0,onLayoutSave:C||g$1?.variantService&&g$1?.appId?Bt:void 0,loading:u,layoutManager:rt,onOpenGraphReport:Ft?Nt: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(vi,{columns:M,visibleColumns:O,order:A,orderBy:L,onRequestSort:Ze,disableSorting:R,onContextMenu:Ge,selectionMode:i,grouping:H,isAllExpanded:et,handleToggleAll:oe,rowCount:de.length,numSelected:s.length,onSelectAllClick:xt,columnWidths:he,onColumnResize:at}),f(yi,{visibleRows:We,columns:M,visibleColumns:O,selectionMode:i,selected:s,orderBy:L,loading:u,expandedGroups:q,toggleGroupExpand:xe,handleExpandGroupRecursively:ye,handleCollapseGroupRecursively:De,isGroupFullyExpanded:je,handleClick:It,onSelectionChange:l,grouping:H,rowKeyProp:x,page:nt,rowsPerPage:U}),_&&f(kp,{showSummary:_,columns:M,visibleColumns:O,summaryRow:ve,selectionMode:i?.toString(),grouping:H,columnWidths:he,orderBy:L,zIndex:3})]})})})]}),z&&g(Lt,{open:Ke,onClose:Ar,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: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:[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=>qr(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}`)}),k?.description&&f(jo,{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(Pe,{onClick:Ar,sx:{fontSize:"0.85rem"},disabled:ut,children:k?.cancelLabel||o("common.cancel")}),f(Pe,{onClick:Xr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ut,children:k?.submitLabel||o("common.save")})]})]}),X&&g(Lt,{open:F,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:w?.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:[Mo.map(ne=>{let me=ne.type==="number"||ne.numeric?"number":ne.type==="date"?"date":"text",te=ne.label||ne.id,Ee=Ur(ne.id);return f(He,{label:te,value:Je[ne.id]??"",onChange:Qe=>Zr(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}`)}),w?.description&&f(jo,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:w.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Pe,{onClick:Er,sx:{fontSize:"0.85rem"},disabled:ge,children:w?.cancelLabel||o("common.cancel")}),f(Pe,{onClick:Xo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ge||!Ut,children:w?.submitLabel||o("common.save")})]})]}),fe&&f(Yn,{open:St,type:"warning",title:P?.title||o("quickDelete.confirmTitle"),message:P?.message||(Ht.length>1?o("quickDelete.confirmMessageMultiple",{count:Ht.length}):o("quickDelete.confirmMessageSingle")),confirmText:P?.confirmText||o("common.delete"),cancelText:P?.cancelText||o("common.cancel"),onClose:En,onConfirm:Lr}),_e,Ft&&f(Ti,{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(er,{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}})})]})},gD=er;var xD=({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,p={...a,appId:a.appId||t};return g(mi,{title:o,hideHeader:r,children:[g(se,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l==="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(er,{...p,fitContainer:true,filterConfig:l==="integrated"?d:void 0})})]}),i]})};var ID=({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}=ce(),[p,m]=useState(false),[h,f]=useState([]),[u,b]=useState({}),[C,g]=useState(t.variants||[]),[x,v]=useState(t.layout||null),[y,k]=useState(""),[w,P]=useState(0),[I,S]=useState(0),[R,N]=useState(r),[T,M]=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||[]),P(Be.total||0));}catch(Ce){console.error("Failed to fetch report data",Ce);}finally{m(false);}},[t.api,o]);useEffect(()=>{O(u,I,R,A,W);},[O,I,R,A,W]);let _=()=>{S(0),O(u,0,R,A,W);},V=J=>{S(0),N(J);},Q=(J,le)=>{L(le),ee(J);},H=J=>{b(J);},B=J=>{k(J?.id||"");let le=Ei(J,a);if(le){let ze=le.values??le;b(ze),O(ze,0,R,A,W),S(0);}let{layout:he}=Li(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:u,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:l,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:h,loading:p,rowKey:"id",count:w,page:I,rowsPerPage:R,rowsPerPageOptions:n,onPageChange:S,onRowsPerPageChange:V,selectionMode:"multiple",selected:T,onSelectionChange:M,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:u,rows:h,loading:p,refresh:_}};var Ib=new Set(["id","title","description","icon","iconNode","meta"]),Mb=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,o=>o.toUpperCase()).trim(),Rb=t=>Object.entries(t).filter(([o,r])=>!Ib.has(o)&&r!==null&&r!==void 0&&["string","number","boolean"].includes(typeof r)).map(([o,r])=>({key:o,label:Mb(o),value:String(r)})),Jp=({item:t,open:o,onClose:r,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=ce(),p=go()==="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=Rb(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:p}})}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?f(E,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),f(ie,{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(Pe,{variant:"contained",sx:{width:"100%"},startIcon:f(Pt,{name:"download",size:16}),onClick:()=>n(t),children:i??l("cardPage.download")})}):null]})]}),document.body)};var Db={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},Nb=({item:t,onDetailClick:o,onDownloadClick:r,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=ce(),l=go()==="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(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",...Db},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})})]})]})},tu=({items:t,loading:o=false,onDetailClick:r,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:l,detailPanel:d=true,renderDetailContent:p})=>{let{t:m}=ce(),[h,f$1]=Jt__default.useState(null),[u,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(Zo,{})}):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(Nb,{item:x,onDetailClick:C,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&h?f(Jp,{item:h,open:u,onClose:g$1,onDownloadClick:n,renderContent:p,downloadTooltip:s}):null]}):f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(E,{sx:{color:"text.secondary"},children:l??m("cardPage.empty")})})};var ZD=({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(mi,{title:o,hideHeader:r,children:[g(se,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l&&f("div",{sx:{flexShrink:0},children:f($o,{...l})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(tu,{...a})})]}),i]})};var eN=({metadata:t,fetchData:o,tableKey:r="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,p]=useState(false),[m,h]=useState([]),[f,u]=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 k=useCallback(async N=>{p(true);try{let T=o?await o({...N}):{rows:[],total:0};h(T?.rows||[]),u(T?.total||0);}catch(T){console.error("Failed to fetch card page data",T);}finally{p(false);}},[o]);useEffect(()=>{k(b);},[k]);let w=()=>{k(b);},P=N=>{C(N);},I=N=>{y(N?.id||"");let T=Ei(N,r);if(T){let M=T.values??T;C(M),k(M);}},S=N=>{let T={...N,id:Date.now().toString(),createdAt:new Date().toISOString()};x(M=>[...M,T]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:r,fields:t.filters,filters:b,onFilterChange:P,onSearch:w,onVariantLoad:I,onVariantSave:S,onVariantDelete:N=>x(T=>T.filter(M=>M.id!==N)),onVariantSetDefault:N=>{x(T=>T.map(M=>({...M,isDefault:M.id===N})));},variants:g,currentVariantId:v,variantService:n,serviceUrl:a},gridProps:{items:m,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:l}},items:m,total:f,filters:b,loading:d,refresh:w}};var Eb=t=>[...t].sort((o,r)=>r.value-o.value),rN=({bars:t=[],lines:o=[],combos:r=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=useMemo(()=>Eb(t),[t]),l=useMemo(()=>[...o],[o]),d=useMemo(()=>[...r],[r]),p=useMemo(()=>[...n],[n]),m=useMemo(()=>{let f=a.reduce((u,b)=>u+b.value,0);return a.map(u=>({...u,percent:f>0?u.value/f*100:u.percent}))},[a]),h=useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:p,pies:m,waterfalls:h}};var lN=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>useMemo(()=>!t||!o?"":oa({apiKey:t,query:o,zoom:r,mapType:n}),[t,o,r,n]),cN=({keyword:t,location:o})=>useMemo(()=>ki({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0}),[t,o]);var sa=({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(ie,{size:"small",tooltip:s?"Copied":"Copy",onClick:async()=>{try{await navigator.clipboard.writeText(t),l(!0),window.setTimeout(()=>l(!1),1400);}catch{l(false);}},children:s?f(xo,{size:14,strokeWidth:1.8}):f(No,{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 zb=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},Vb=async t=>new Function("m","return import(m)")(t),la=({expression:t,inline:o=false,allowKatex:r=false})=>{let n=useMemo(()=>zb(t),[t]),[a,i]=useState("");return useEffect(()=>{let s=true;return (async()=>{if(!r||!n){i("");return}try{let d=await Vb("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(vo,{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 _b=async t=>new Function("m","return import(m)")(t),hl=({code:t,title:o="Mermaid Diagram",height:r=320,enabled:n=true})=>{let[a,i]=useState(""),[s,l]=useState(""),[d,p]=useState(false),m=useMemo(()=>t.trim(),[t]);return useEffect(()=>{let h=true;return (async()=>{if(!n||!m){i(""),l("");return}p(true),l(""),i("");try{let u=await _b("mermaid"),b=u?.default||u;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(u){if(h){let b=u instanceof Error?u.message:"Failed to render Mermaid diagram";l(b);}}finally{h&&p(false);}})(),()=>{h=false;}},[n,m]),g(Or,{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(vo,{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(Sd,{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(sa,{code:m,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var fl=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(r=>r.trim()),Ub=t=>/^:?-{3,}:?$/.test(t.trim()),Kb=t=>{let o=t.trim(),r=o.startsWith(":"),n=o.endsWith(":");return r&&n?"center":n?"right":"left"},Oi=t=>{let o=t.split(`
|
|
5
|
+
`).map(s=>s.trim()).filter(Boolean);if(o.length<2)return null;let r=fl(o[0]),n=fl(o[1]);if(r.length===0||n.length!==r.length||!n.every(Ub))return null;let a=n.map(Kb),i=o.slice(2).filter(s=>s.includes("|")).map(s=>{let l=fl(s);return l.length<r.length?[...l,...Array.from({length:r.length-l.length},()=>"")]:l.slice(0,r.length)});return {headers:r,aligns:a,rows:i}},bl=({markdown:t,table:o,maxHeight:r=360})=>{let n=useMemo(()=>o||(t?Oi(t):null),[o,t]);return !n||n.headers.length===0?f(Or,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:f(vo,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):f(Or,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:f(Id,{sx:{maxHeight:r},children:g(Pd,{size:"small",stickyHeader:true,children:[f(Md,{children:f(rl,{children:n.headers.map((a,i)=>f(ol,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),f(Td,{children:n.rows.map((a,i)=>f(rl,{hover:true,children:a.map((s,l)=>f(ol,{align:n.aligns[l],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||f(Ie,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${l}`))},`row-${i}`))})]})})})};var Fi=({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(Cd,{direction:"row",alignItems:"center",spacing:.6,children:[f(xd,{size:"small",onClick:()=>i(s=>!s),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:f(rn,{fontSize:"inherit"})}),g(vo,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[o,n?" ...":""]})]}),f(on,{in:a,children:f(vo,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};var vl=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Bi=t=>t.trim().startsWith("```"),au=t=>/^#{1,6}\s+/.test(t.trim()),yl=t=>/^[-*+]\s+/.test(t.trim()),Cl=t=>/^\d+\.\s+/.test(t.trim()),iu=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),xl=t=>t.trim().startsWith(">"),su=(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())},lu=t=>t.trim().startsWith("<think>")||t.trim()===":::think",ca=(t,o,r)=>{let n=[],a=0,i=0;vl.lastIndex=0;let s=vl.exec(t);for(;s;){s.index>a&&n.push(t.slice(a,s.index));let l=s[0],d=`${r}-${i}`;if(l.startsWith("**")&&l.endsWith("**"))n.push(f("strong",{children:l.slice(2,-2)},d));else if(l.startsWith("*")&&l.endsWith("*"))n.push(f("em",{children:l.slice(1,-1)},d));else if(l.startsWith("`")&&l.endsWith("`"))n.push(f(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:l.slice(1,-1)},d));else if(l.startsWith("[")&&l.includes("](")&&l.endsWith(")")){let p=l.match(/^\[([^\]]+)\]\(([^)]+)\)$/);p?n.push(f(yd,{href:p[2],target:"_blank",rel:"noreferrer",children:p[1]},d)):n.push(l);}else l.startsWith("$")&&l.endsWith("$")&&o.enableMath?n.push(f(la,{expression:l,inline:true,allowKatex:true},d)):n.push(l);a=s.index+l.length,i+=1,s=vl.exec(t);}return a<t.length&&n.push(t.slice(a)),n.length>0?n:[t]},da=({markdown:t,content:o,className:r,enableMath:n=true,enableMermaid:a=true,enableThinkBlock:i=true,codeCopyable:s=true,codeLineNumbers:l=false})=>{let d=t??o??"",p=useMemo(()=>{let m=[],h=d.replace(/\r\n/g,`
|
|
6
6
|
`).split(`
|
|
7
|
-
`),
|
|
8
|
-
`).trim()},`think-tag-${
|
|
9
|
-
`).trim()},`think-fence-${
|
|
10
|
-
`);if(a&&x==="mermaid"){m.push(f(
|
|
11
|
-
`).trim(),allowKatex:true},`math-${
|
|
12
|
-
`),C=Mi(b);if(C){m.push(f(nl,{table:C},`table-${p}`)),p=x;continue}}if(ll(v)){let x=[];for(;p<f$1.length&&ll(f$1[p]);)x.push(f$1[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(ho,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((b,C)=>g(Fragment,{children:[C>0&&f("br",{}),ia(b,h,`q-${p}-${C}`)]},`quote-line-${C}`))})},`quote-${p}`));continue}if(il(v)){let x=[];for(;p<f$1.length&&il(f$1[p]);)x.push(f$1[p].trim().replace(/^[-*+]\s+/,"")),p+=1;m.push(f(Te,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((b,C)=>f(Te,{component:"li",sx:{mb:.45},children:f(ho,{variant:"body2",children:ia(b,h,`ul-${p}-${C}`)})},`ul-item-${C}`))},`ul-${p}`));continue}if(sl(v)){let x=[];for(;p<f$1.length&&sl(f$1[p]);)x.push(f$1[p].trim().replace(/^\d+\.\s+/,"")),p+=1;m.push(f(Te,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((b,C)=>f(Te,{component:"li",sx:{mb:.45},children:f(ho,{variant:"body2",children:ia(b,h,`ol-${p}-${C}`)})},`ol-item-${C}`))},`ol-${p}`));continue}let g$1=[];for(;p<f$1.length;){let x=f$1[p],b=x.trim();if(!b||Di(x)||qp(x)||Xp(x)||il(x)||sl(x)||ll(x)||Yp(f$1,p)||i&&Zp(x)||n&&b.startsWith("$$"))break;g$1.push(x),p+=1;}g$1.length>0?m.push(f(ho,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g$1.map((x,b)=>g(Fragment,{children:[b>0&&f("br",{}),ia(x,h,`p-${p}-${b}`)]},`p-line-${b}`))},`p-${p}`)):p+=1;}return m},[d,n,a,i,s,l]);return f(Te,{className:r,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:u})};var uN=(t,o)=>f(sa,{markdown:t,...o});var Qp=({value:t,onChange:o,onSubmit:r,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:l=false,compact:d=false,showStatusText:u=true})=>g(ae,{spacing:.75,children:[g("div",{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[f(Br,{sx:{fontSize:d?16:18,color:"text.secondary"}}),f(fd,{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(ne,{size:"small",onClick:a,children:f(xr,{sx:{fontSize:d?16:18}})}),n&&f(ne,{size:"small",onClick:n,children:f(Ud,{sx:{fontSize:d?16:18}})}),f(ne,{size:"small",onClick:r,disabled:l||!t.trim(),children:f(Zd,{sx:{fontSize:d?16:18}})})]}),u&&s&&f(E,{variant:"caption",color:"text.secondary",children:s})]});var jp=(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)]})},Ni=({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:jp(n.label,o)}),f(E,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?jp(a,o):n.value})]},n.id)})})]})};var cl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",Ei=t=>t.trim().toLowerCase(),Eb=(t,o)=>{let r=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||cl(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:Ei(`${n.title} ${a.label} ${i}`)});});}),o.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||cl(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Ei(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||cl(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:Ei(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),r},Jp=({sections:t,tabs:o=[],defaultTabId:r,ai:n})=>{let{t:a}=de(),[i,s]=useState(""),[l,d]=useState(r||o[0]?.id),[u,m]=useState("idle"),[f,h]=useState([]),[p,v]=useState(""),[y,g]=useState(""),[x,b]=useState(false),C=useMemo(()=>Eb(t,o),[t,o]);useEffect(()=>{if(o.length===0){d(void 0);return}o.some(N=>N.id===l)||d(r||o[0]?.id);},[o,l,r]);let k=useCallback(()=>{m("idle"),h([]),v(""),g("");},[]),w=useCallback(S=>{s(S),S.trim()||(m("idle"),h([]),v(""),g(""));},[]),P=useCallback(S=>{let N=Ei(S);return N?C.filter(M=>M.text.includes(N)).map(M=>M.hit):[]},[C]),I=useCallback(async()=>{let S=i.trim();if(!S)return;b(true);let N=P(S);if(h(N),N.length>0){m("search"),g(""),v(a("detail.searchAi.matches",{count:N.length})),b(false);return}if(n?.enabled!==false&&n?.onSubmit){m("ai"),v(a("detail.searchAi.autoAiFallback"));try{let T=await n.onSubmit(S,{query:S,hits:N,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:w,activeTabId:l,setActiveTabId:d,searchMode:u,hits:f,statusText:p,aiResponse:y,searching:x,handleSubmit:I,clearResult:k}};var VN=({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:f$1}=de(),{query:h,setQuery:p,activeTabId:v,setActiveTabId:y,searchMode:g$1,hits:x,statusText:b,aiResponse:C,searching:k,handleSubmit:w,clearResult:P}=Jp({sections:r,tabs:n,defaultTabId:a,ai:s}),I=useMemo(()=>n.find(M=>M.id===v)||n[0],[n,v]),S=useCallback(M=>{let T=D=>{let A=document.getElementById(M);if(A){A.scrollIntoView({behavior:"smooth",block:"center"});return}D<4&&setTimeout(()=>T(D+1),60);};requestAnimationFrame(()=>T(0));},[]),N=useCallback((M,T)=>{if(n.some(D=>D.id===M)){y(M),S(T?`detail-tab-${M}-section-${T}`:`detail-tab-${M}`);return}S(`detail-section-${M}`);},[n,y,S]);return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[g(ae,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[g("div",{sx:{minWidth:0},children:[f(E,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),o&&f(E,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:o})]}),g(ae,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[f("div",{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:f(Qp,{value:h,onChange:p,onSubmit:w,onVoiceInput:s?.onVoiceInput,onClear:()=>{p(""),P();},placeholder:s?.placeholder||f$1("detail.searchAi.placeholder"),statusText:b,loading:k,compact:true,showStatusText:false})}),u&&f(lt,{title:m,children:f(ne,{size:"small",onClick:u,children:f(Ld,{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:f$1("detail.searchAi.matches",{count:x.length})}),f(ae,{spacing:.35,children:x.slice(0,8).map(M=>f("div",{component:"button",type:"button",onClick:()=>N(M.sourceId,M.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:M.sourceTitle})," \xB7 ",f("div",{component:"span",sx:{fontWeight:700},children:M.fieldLabel})," = ",f("div",{component:"span",children:M.fieldValue||"-"})]})},`${M.source}|${M.sourceId}|${M.fieldId}`))})]}),g$1==="ai"&&C&&g(Ne,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:f$1("detail.searchAi.aiResultTitle")}),f("div",{sx:{fontSize:"0.9rem",lineHeight:1.6,"& p":{m:0,mb:.8},"& h1, & h2, & h3, & h4":{mt:1.2,mb:.6,lineHeight:1.3},"& ul, & ol":{mt:.4,mb:.8,pl:2.6},"& code":{px:.5,py:.1,borderRadius:.8,bgcolor:"action.hover",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"& pre":{m:0,mt:.8,mb:.8,p:1.1,borderRadius:1.2,bgcolor:"action.hover",overflowX:"auto"},"& pre code":{p:0,bgcolor:"transparent"}},children:f(sa,{markdown:C})})]}),f("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:r.map(M=>f("div",{id:`detail-section-${M.id}`,children:f(Ni,{section:M,highlightQuery:h})},M.id))}),n.length>0&&g(Ne,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[f(Cd,{value:I?.id||false,onChange:(M,T)=>y(String(T)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(M=>f(xd,{value:M.id,label:M.label,sx:{textTransform:"none"}},M.id))}),g("div",{sx:{p:1.5},children:[f("div",{id:`detail-tab-${I?.id||""}`}),I?.description&&f(E,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:I.description}),I?.content?I.content:g(ae,{spacing:1.5,children:[(I?.sections||[]).map(M=>f("div",{id:`detail-tab-${I?.id}-section-${M.id}`,children:f(Ni,{section:M,highlightQuery:h})},M.id)),I?.fields&&I.fields.length>0&&f(Ni,{section:{id:`${I.id}-fields`,title:I.label,fields:I.fields,columns:2},highlightQuery:h})]})]})]}),i&&f(jo,{title:i.title||f$1("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};var ou=({bucket:t,cardCount:o,highlighted:r=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:l,renameLabel:d,sx:u})=>{let{t:m}=de(),[f$1,h]=useState(false),[p,v]=useState(t.title),y=()=>{v(t.title),h(false);},g$1=x=>{x.preventDefault();let b=p.trim();b&&(b!==t.title&&l?.(b),v(b),h(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(ae,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[g(Te,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[f(Te,{sx:{minWidth:0,flex:1},children:g(Te,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&f(Te,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),f$1?g(Te,{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(),y());},inputProps:{"aria-label":d??m("kanban.bucket.rename")},error:!p.trim(),sx:{flex:1,minWidth:0}}),f(ne,{type:"submit",size:"small",tooltip:m("kanban.bucket.saveRename"),"aria-label":m("kanban.bucket.saveRename"),disabled:!p.trim(),children:f(Ko,{size:14})}),f(ne,{size:"small",tooltip:m("kanban.bucket.cancelRename"),"aria-label":m("kanban.bucket.cancelRename"),onClick:y,children:f(Yt,{size:14})})]}):f(E,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!f$1&&g(ae,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[f(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(ne,{size:"small",tooltip:d??m("kanban.bucket.rename"),"aria-label":d??m("kanban.bucket.rename"),onClick:()=>{v(t.title),h(true);},sx:{width:26,height:26},children:f(yc,{size:14})})]})]}),r&&f(E,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:m("kanban.bucket.dropHere")}),f(Te,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:o>0?n:f(Te,{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 Ob={success:"success",warning:"warning",info:"info",error:"error"},Fb={critical:"error",high:"warning",medium:"info",low:"success"},Bb={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},Hb=(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}},zb=t=>t?t.split(/\s+/).map(o=>o.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",dl=({card:t,bucket:o,dragging:r=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=de(),l=!!(a&&o),d=t.tone??(t.priority?Fb[t.priority]:"default"),u=d==="default"?"primary":Ob[d],m=Bb[d],f$1=o?{card:t,bucket:o}:void 0;return f(Ne,{onClick:l?()=>f$1&&a?.(f$1):void 0,onKeyDown:l?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f$1&&a?.(f$1));}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,sx:[{position:"relative",minWidth:0,overflow:"hidden",p:1.5,pl:1.75,borderRadius:"var(--orb-r-container)",border:`1px solid ${tt(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(ae,{spacing:1.25,children:[g(Te,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[g(Te,{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:Hb(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(Te,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(h=>g(Te,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[f(E,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:h.label}),f(E,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:h.value})]},h.id))}),typeof t.progress=="number"&&g(Te,{children:[g(Te,{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(dd,{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(ae,{spacing:.9,children:[t.tags&&t.tags.length>0&&f(Te,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(h=>f(Ct,{size:"small",label:h.label,color:h.color??"default",variant:"outlined"},h.id))}),g(Te,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[g(Te,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&g(e,{children:[f(Ka,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??zb(t.assignee.name)}),g(Te,{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 ru=(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:[]}]}},nu=(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)}},Vb=(t,o)=>Number.isNaN(t)||t<0?0:t>o?o:t,au=({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}}},Li=(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=Vb(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,f)=>({...m,bucketId:u.id,position:f}))}))}};var ml="kanban-card|",gl="kanban-bucket|",lu=t=>`${ml}${t}`,Qb=t=>`${gl}${t}`,Oi=t=>t?.startsWith(ml)?t.slice(ml.length):void 0,su=t=>t?.startsWith(gl)?t.slice(gl.length):void 0,jb=({card:t,bucket:o,onCardClick:r})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=useSortable({id:lu(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(dl,{card:t,bucket:o,dragging:d,onClick:r})})},Jb=({bucket:t,highlighted:o,bucketHeight:r,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=useDroppable({id:Qb(t.id)});return f(Te,{ref:l,sx:{minWidth:0,minHeight:0,height:r},children:f(ou,{bucket:t,cardCount:t.cards.length,highlighted:o||s,emptyLabel:n,height:r,onRename:a,children:f(SortableContext,{items:t.cards.map(d=>lu(d.id)),strategy:verticalListSortingStrategy,children:f(ae,{spacing:1,children:t.cards.map(d=>f(jb,{card:d,bucket:t,onCardClick:i},d.id))})})})})},cu=t=>String(t??"").toLocaleLowerCase(),ev=(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=>cu(n).includes(o)),gA=({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:f$1,defaultSearchValue:h="",onSearchValueChange:p,searchPlaceholder:v,emptyBucketLabel:y,sx:g$1})=>{let{t:x}=de(),[b,C]=useState(null),[k,w]=useState(),[P,I]=useState(h),S=f$1??P,N=S.trim().toLocaleLowerCase(),M=d??u??560,T=useMemo(()=>({buckets:t.buckets.map(z=>{let H=n?z.cards.filter(K=>n(K,z)):z.cards;if(!N)return {...z,cards:H};let U=[z.id,z.title,z.description].some(K=>cu(K).includes(N));return {...z,cards:U?H:H.filter(K=>ev(K,N))}})}),[n,t,N]),D=useMemo(()=>T.buckets.reduce((z,H)=>z+H.cards.length,0),[T]),A=useCallback(z=>{f$1===void 0&&I(z),p?.(z);},[p,f$1]),L=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),O=useMemo(()=>b?$o(t,b):void 0,[b,t]),_=useCallback(()=>{C(null),w(void 0);},[]),F=useCallback(z=>{if(!z)return;let H=Oi(z);return H?$o(t,H)?.bucket.id:su(z)},[t]),X=useCallback(z=>{C(Oi(String(z.active.id))??null);},[]),V=useCallback(z=>{w(F(z.over?String(z.over.id):void 0));},[F]),Z=useCallback(z=>{let H=Oi(String(z.active.id)),U=z.over?String(z.over.id):void 0;if(!H||!U){_();return}let K=$o(t,H);if(!K){_();return}let ge=K.bucket.id,ie=K.cardIndex,pe=Oi(U);if(pe){let we=$o(t,pe);if(!we){_();return}ge=we.bucket.id,ie=we.cardIndex;}else {let we=su(U),se=t.buckets.find(Ae=>Ae.id===we);if(!we||!se){_();return}ge=we,ie=se.cards.length;}if(K.bucket.id===ge&&K.cardIndex===ie){_();return}let xe=Li(t,{cardId:H,fromBucketId:K.bucket.id,toBucketId:ge,targetIndex:ie}),We=$o(xe,H);We&&!(We.bucket.id===K.bucket.id&&We.cardIndex===K.cardIndex)&&o?.({cardId:H,fromBucketId:K.bucket.id,toBucketId:We.bucket.id,targetIndex:We.cardIndex,card:We.card,model:xe}),_();},[t,o,_]);return g(DndContext,{sensors:L,collisionDetection:closestCorners,onDragStart:X,onDragOver:V,onDragEnd:Z,onDragCancel:_,children:[g(Te,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(m||a)&&g(Te,{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(Te,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:f(He,{dense:true,value:S,onChange:z=>A(z.target.value),placeholder:v??x("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:S?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:f(Bo,{size:16,"aria-hidden":"true"}),endAdornment:S?f(ne,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>A(""),sx:{width:26,height:26},children:f(Yt,{size:15})}):void 0})}),g(Te,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[N&&f(E,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:D>0?x("kanban.search.results",{count:D}):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(Te,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${l}px, ${Math.max(l,360)}px)`,gap:1.5,gridAutoRows:M==="100%"?"minmax(0, 1fr)":void 0,alignItems:"stretch",justifyContent:"start",flex:"1 1 0",height:"100%",minHeight:0,overflowX:"auto",overflowY:"hidden",overscrollBehavior:"contain",scrollbarGutter:"stable both-edges",pb:.5},...Array.isArray(g$1)?g$1:g$1?[g$1]:[]],children:T.buckets.map(z=>f(Jb,{bucket:z,highlighted:z.id===k,bucketHeight:M,emptyBucketLabel:N?x("kanban.search.noMatch"):y,onBucketRename:i?H=>i(z.id,H):void 0,onCardClick:r},z.id))})]}),f(DragOverlay,{children:O?f(Te,{sx:{width:Math.max(l-24,260)},children:f(dl,{card:O.card,bucket:O.bucket,overlay:true})}):null})]})};var rv=({initialModel:t,initialBuckets:o,initialCards:r})=>t||au({buckets:o??[],cards:r??[]}),yA=t=>{let{onCardMove:o,onCardClick:r}=t,[n,a]=useState(()=>rv(t)),i=useCallback(h=>{a(p=>typeof h=="function"?h(p):h);},[]),s=useCallback(h=>$o(n,h),[n]),l=useCallback((h,p,v)=>{let y=$o(n,h);if(!y)return;let g=Li(n,{cardId:h,fromBucketId:y.bucket.id,toBucketId:p,targetIndex:v}),x=$o(g,h);if(!x||x.bucket.id===y.bucket.id&&x.cardIndex===y.cardIndex)return;a(g);let b={cardId:h,fromBucketId:y.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return o?.(b),b},[n,o]),d=useCallback((h,p)=>{a(v=>({buckets:v.buckets.map(y=>({...y,cards:y.cards.map(g=>g.id!==h?g:typeof p=="function"?p(g):{...g,...p})}))}));},[]),u=useCallback(h=>{let p=ru(n,h);return p===n?false:(a(p),true)},[n]),m=useCallback((h,p)=>{let v=nu(n,h,p);return v===n?false:(a(v),true)},[n]),f=useMemo(()=>({model:n,onCardMove:h=>{l(h.cardId,h.toBucketId,h.targetIndex);},onCardClick:r}),[n,l,r]);return {model:n,actions:{replaceModel:i,moveCard:l,updateCard:d,addBucket:u,renameBucket:m,getCard:s},boardProps:f}};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),f=useRef(null),h=useRef(null),p=useRef(0),v=useRef(false),y=useRef(false),g=useCallback(()=>{d.current&&(d.current.close(),d.current=null),f.current&&(f.current.disconnect(),f.current=null),h.current&&(h.current.disconnect(),h.current=null),u.current&&(u.current.getTracks().forEach(C=>C.stop()),u.current=null),m.current&&(m.current.close(),m.current=null),y.current=false,l(false);},[]),x=useCallback(()=>{v.current||(v.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),b=useCallback(async()=>{if(!(s||y.current)){y.current=true,v.current=false,p.current=Date.now();try{let C=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});u.current=C;let k=new WebSocket(n);d.current=k,k.onopen=()=>{l(!0),y.current=!1;},k.onmessage=N=>{try{let M=JSON.parse(N.data);if(M.type==="recognition")M.is_final?o(M.text):t?.(M.text);else if(M.type==="error"){let T=M.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 w=window.AudioContext||window.webkitAudioContext;if(!w)throw new Error("AudioContext is not supported in this browser");let P=new w({sampleRate:16e3});m.current=P;let I=P.createMediaStreamSource(C);h.current=I;let S=P.createScriptProcessor(4096,1,1);f.current=S,S.onaudioprocess=N=>{if(d.current?.readyState!==WebSocket.OPEN)return;let M=N.inputBuffer.getChannelData(0),T=0;for(let L=0;L<M.length;L+=1)T+=M[L]*M[L];if(Math.sqrt(T/M.length)>i)p.current=Date.now();else if(Date.now()-p.current>a&&!v.current){x();return}let A=new Int16Array(M.length);for(let L=0;L<M.length;L+=1){let O=Math.max(-1,Math.min(1,M[L]));A[L]=O<0?O*32768:O*32767;}d.current.send(A.buffer);},I.connect(S),S.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 sv=["en","zh","fr","de","ja","ko"],pu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},hl=({searchPlaceholder:t,onSearch:o,onSearchAdd:r,onOpenPanel:n,panelOpen:a=false,maxWidth:i=540,sx:s})=>{let{t:l}=de(),[d,u]=useState(""),m=useCallback((x=d)=>{let b=x.trim();b&&(u(""),o?.(b));},[o,d]),f$1=x=>{x.preventDefault(),m();},{isRecording:h,startRecording:p,stopRecording:v}=Cn({onTextUpdate:u,onComplete:x=>{u(x),m(x);},onError:x=>{console.error("Header voice input error:",x);}}),y=useCallback(async()=>{if(h){v();return}await p();},[h,p,v]),g$1=t||l("header.searchPlaceholder");return f("form",{className:"orb-app-header-search",onSubmit:f$1,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(ne,{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(ne,{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(ne,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{y();},tooltip:l(h?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:h?"var(--orb-err)":void 0},children:f(Pt,{name:"microphone",size:16})})]})]})})},Fi=({appTitle:t,logo:o,onToggleMode:r,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:l,showSearch:d=false,onSearch:u,onSearchAdd:m,onOpenPanel:f$1,panelOpen:h,user:p,onUserRefresh:v,onUserSetting:y,onUserLogout:g$1,userMenuItems:x,leftSlot:b,rightSlot:C})=>{let{t:k,locale:w}=de(),P=yo(),I=n||w,S=a||pu[I],N=i||sv,M=P==="dark"?f(Nc,{size:15}):f(Oc,{size:15}),T=k(P==="dark"?"header.theme.dark":"header.theme.light"),D=[...v?[{key:"refresh",label:k("header.menu.refresh"),icon:f(Na,{size:15}),onClick:v}]:[],...y?[{key:"settings",label:k("header.menu.setting"),icon:f(Jr,{size:16}),onClick:y}]:[],...g$1?[{key:"logout",label:k("header.menu.logout"),icon:f(Ic,{size:16}),onClick:g$1}]:[]],A=x||D,L=N.map(O=>({label:pu[O],onClick:()=>{s?.(O),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:O===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(hl,{searchPlaceholder:l,onSearch:u,onSearchAdd:m,onOpenPanel:f$1,panelOpen:h})}),g("div",{className:"orb-app-header-actions",children:[g("div",{className:"orb-app-header-utilities",children:[s?f(Zt,{triggerLabel:S,trigger:g("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[f(On,{size:15}),f("span",{className:"orb-label",children:S})]}),items:L,align:"end"}):g("div",{className:"orb-app-header-locale","aria-label":S,children:[f(On,{size:15}),f("span",{className:"orb-label",children:S})]}),f(ne,{className:"orb-app-header-theme",size:"small",onClick:r,tooltip:T,children:M})]}),p&&f("span",{className:"orb-app-header-divider","aria-hidden":"true"}),p&&f(Zt,{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(O=>({label:O.label,onClick:O.onClick,disabled:O.disabled,icon:O.icon})),align:"end"}),C]})]})};var uu=({menuData:t=[],initialNavigationCollapsed:o=false,initialNavigationMode:r="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:u}=rd({initialCollapsed:o,initialDisplayMode:r,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[m,f]=useState(900);useEffect(()=>{let p=()=>f(window.innerHeight);return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);let h=useMemo(()=>Math.max(280,m-100),[m]);return {navigationIslandProps:u,navigationMaxHeight:h}};var Eo=12,gu=56,fu=234,uv="orbcafe:page-layout-locale",hu=["en","zh","fr","de","ja","ko"],mv=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",Bi=(t,o)=>`orbcafe:page-layout:${mv(t)}:${o}`,gv=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,fv=t=>t==="system"?"dark":t==="dark"?"light":"system",Hi=(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,$A=({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:f$1,user:h,onUserRefresh:p,onUserSetting:v,onUserLogout:y,userMenuItems:g$1,logo:x,searchPlaceholder:b,searchPlacement:C="hidden",floatingSearchSx:k,onSearch:w,onSearchAdd:P,onOpenPanel:I,panelOpen:S,rightHeaderSlot:N,leftHeaderSlot:M,contentSx:T,navigationVariant:D="classic",navigationMode:A,defaultNavigationMode:L="fixed",onNavigationModeChange:O,showNavigationModeToggle:_=true,enableNavigationPinning:F=true,navigationPinStorageKey:X,pinnedNavigationItemIds:V,defaultPinnedNavigationItemIds:Z,onPinnedNavigationItemIdsChange:z,pinnedNavigationSectionTitle:H})=>{let U=t?Bi(t,"mode"):"orbcafe:page-layout-mode",K=t?Bi(t,"locale"):uv,ge=t?Bi(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[ie,pe]=useState(m),[xe,We]=useState("light"),[we,se]=useState(false),[Ae,Ie]=useState(i),[ke,ze]=useState(false),[et,rt]=useState(false),[at,q]=useState(L),[Re,ve]=useState({x:Eo,y:Eo}),[Fe,nt]=useState("left"),[Ye,xt]=useState(false),It=useRef(null),Lt=useRef(null),Nt=u!==void 0,te=u??ie,Ge=d!==void 0,Oe=Ge?i:Ae,le=l?.join("|")??"",be=A!==void 0,ee=A??at,he=ee==="floating",De=D==="v2"?Vs:Qc,je=C==="header",it=te==="system"?we?xe:"light":te;useEffect(()=>{if(!Nt)try{let fe=window.localStorage.getItem(U);(fe==="light"||fe==="dark"||fe==="system")&&pe(fe);}catch{}se(true);let W=window.matchMedia("(prefers-color-scheme: dark)"),Q=()=>{We(W.matches?"dark":"light");};return Q(),W.addEventListener("change",Q),()=>W.removeEventListener("change",Q)},[Nt,U]),useEffect(()=>{if(!(Nt||!we))try{window.localStorage.setItem(U,te);}catch{}},[we,Nt,te,U]),useEffect(()=>{if(Ge){ze(true);return}try{let W=window.localStorage.getItem(K),Q=l??hu;W&&hu.includes(W)&&Q.includes(W)&&Ie(W);}catch{}finally{ze(true);}},[Ge,le,K]),useEffect(()=>{if(!(Ge||!ke))try{window.localStorage.setItem(K,Oe);}catch{}},[Oe,Ge,ke,K]),useEffect(()=>{if(be){rt(true);return}try{let W=window.localStorage.getItem(ge);(W==="fixed"||W==="floating")&&q(W);}catch{}finally{rt(true);}},[be]),useEffect(()=>{if(et)try{window.localStorage.setItem(ge,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=>{be||q(W),O?.(W);},[be,O]),Ft=useCallback(W=>{Nt||pe(W),f$1?.(W);},[Nt,f$1]),Kt=useCallback(W=>{Ge||Ie(W),d?.(W);},[Ge,d]),{navigationIslandProps:zt,navigationMaxHeight:St}=uu({menuData:r,initialNavigationCollapsed:false,initialNavigationMode:ee,enableNavigationPinning:F,navigationPinStorageKey:X??(t?Bi(t,"pinned-navigation-items"):gv(o)),pinnedNavigationItemIds:V,defaultPinnedNavigationItemIds:Z,onPinnedNavigationItemIdsChange:z,pinnedNavigationSectionTitle:H}),Vt=zt.collapsed,ht=useCallback(W=>{let Q=It.current,fe=Q?.parentElement;if(!Q||!fe)return W;let ye=fe.getBoundingClientRect(),Ee=Q.getBoundingClientRect(),$e=Eo,Ke=Eo,Ze=Math.max($e,ye.width-Ee.width-Eo),ut=Math.max(Ke,ye.height-Ee.height-Eo);return {x:Hi(W.x,$e,Ze),y:Hi(W.y,Ke,ut)}},[]),Dt=useCallback(W=>{let Q=It.current,fe=Q?.parentElement;if(!Q||!fe)return W;let ye=fe.getBoundingClientRect(),Ee=Q.getBoundingClientRect(),$e=Eo,Ke=Eo,Ze=Math.max($e,ye.width-Ee.width-Eo),ut=Math.max(Ke,ye.height-Ee.height-Eo),gt={x:Hi(W.x,$e,Ze),y:Hi(W.y,Ke,ut)},bt=[{distance:Math.abs(gt.x-$e),position:{x:$e,y:gt.y}},{distance:Math.abs(gt.x-Ze),position:{x:Ze,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((B,j)=>j.distance<B.distance?j:B).position;return nt(bt.x>=($e+Ze)/2?"right":"left"),bt},[]),st=useMemo(()=>{if(!he||Ye)return Re.x;if(Fe==="right"){let fe=It.current?.parentElement?.getBoundingClientRect().width,ye=Vt?gu:fu;return fe?Math.max(Eo,fe-ye-Eo):Vt?Re.x:Re.x-(fu-gu)}return Re.x},[Fe,Re.x,Ye,he,Vt]),Ot=useCallback(W=>{if(!he||!Vt||hv(W.target))return;W.preventDefault(),W.currentTarget.setPointerCapture(W.pointerId);let Q=ht({x:st,y:Re.y});nt("left"),ve(Q),Lt.current={pointerId:W.pointerId,startClientX:W.clientX,startClientY:W.clientY,startX:Q.x,startY:Q.y,currentX:Q.x,currentY:Q.y},xt(true);},[ht,st,Re.y,he,Vt]),qt=useCallback(W=>{let Q=Lt.current;if(!Q||Q.pointerId!==W.pointerId)return;let fe=ht({x:Q.startX+W.clientX-Q.startClientX,y:Q.startY+W.clientY-Q.startClientY});Q.currentX=fe.x,Q.currentY=fe.y,ve(fe);},[ht]),Y=useCallback(W=>{let Q=Lt.current;if(!(!Q||Q.pointerId!==W.pointerId)){try{W.currentTarget.releasePointerCapture(W.pointerId);}catch{}Lt.current=null,ve(Dt({x:Q.currentX,y:Q.currentY})),xt(false);}},[Dt]);return useEffect(()=>{if(!he)return;let W=()=>{ve(ye=>ht(ye));},Q=window.requestAnimationFrame(W),fe=window.setTimeout(W,430);return ()=>{window.cancelAnimationFrame(Q),window.clearTimeout(fe);}},[ht,he,Vt,St]),f(An,{mode:te,children:f(Ha,{locale:Oe,children:g("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[f(Fi,{appTitle:o,logo:x,mode:te,onToggleMode:()=>Ft(fv(te)),locale:Oe,localeLabel:Ge||Oe===i?s:void 0,localeOptions:l,onLocaleChange:Kt,user:h,onUserRefresh:p,onUserSetting:v,onUserLogout:y,userMenuItems:g$1,searchPlaceholder:b,showSearch:je,onSearch:w,onSearchAdd:P,onOpenPanel:I,panelOpen:S,leftSlot:M,rightSlot:N}),C==="floating"&&f("div",{className:"orb-float-search",style:k,children:f(hl,{searchPlaceholder:b,onSearch:w,onSearchAdd:P,onOpenPanel:I,panelOpen:S,maxWidth:"100%"})}),g("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!he&&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:St,colorMode:it,displayMode:ee,onDisplayModeChange:dt,showDisplayModeToggle:_&&Vt})}),a&&he&&f("div",{ref:It,onPointerDown:Ot,onPointerMove:qt,onPointerUp:Y,onPointerCancel:Y,style:{position:"absolute",top:Re.y,left:st,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:Vt?Ye?"grabbing":"grab":"default",touchAction:Vt?"none":"auto",userSelect:Ye?"none":void 0,transition:Ye?"none":"left 180ms ease-out, top 180ms ease-out"},children:f(De,{...zt,maxHeight:St,colorMode:it,displayMode:ee,onDisplayModeChange:dt,showDisplayModeToggle:_&&Vt})}),f("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!he&&Vt?4:12,...T},children:n})]})]})})})};var zi="(blank)",bu="Result",vu="Grand Total",yu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Cu=["sum","count","avg","min","max"];var xu=["palette","rows","columns","filters","values"];var Su=t=>xu.includes(t),wu=t=>t==="rows"||t==="columns"||t==="filters",Vi=t=>{let o=t.split("|");return o.length===2&&o[0]==="container"&&Su(o[1])?{kind:"container",zone:o[1]}:o.length===3&&o[0]==="item"&&Su(o[1])&&o[2]?{kind:"item",zone:o[1],key:o[2]}:null},cr=t=>t==null||t===""?zi:t instanceof Date?t.toISOString().slice(0,10):String(t),Wr=t=>JSON.stringify(t),ku=(t,o)=>{let r=t.join(""),n=o.join("");return r.localeCompare(n,void 0,{sensitivity:"base"})},bv=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=>bv(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},dr=(t,o)=>t.length!==o.length?false:t.every((r,n)=>r===o[n]),Pu=(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 dr(i,s)})},Wi=(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}),bl=t=>!t?.aggregations||t.aggregations.length===0?Cu:t.aggregations,bo=(t,o)=>{let r=bl(o);return t&&r.includes(t)?t:o?.type==="number"&&r.includes("sum")?"sum":r.includes("count")?"count":r[0]},la=(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 Iu=({options:t,selectedValues:o,onChange:r,minWidth:n=96})=>{let{t:a}=de(),[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,f$1=t.length===0?a("pivot.filter.na"):o.length===0?a("common.none"):m?a("common.all"):`${o.length}/${t.length}`,h=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:f$1}),f(Zt,{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:()=>h(p),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),h(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 Sn=({size:t=18,subtle:o=false})=>{let r=Math.max(2,Math.round(t/6));return f(Te,{"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(Te,{sx:{width:r,height:r,borderRadius:999,bgcolor:"currentColor"}},a))})};var vl=({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(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})]})]})}),Mu=({id:t,label:o,subtitle:r})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=useDraggable({id:t});return f(vl,{label:o,subtitle:r,isDragging:s,dragRef:n,listeners:a,attributes:i})};var wn=({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}=de();return g(Ne,{ref:u,sx:f=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:d?"var(--orb-primary)":"var(--orb-p200)",bgcolor:d?"var(--orb-p100)":f.palette.mode==="dark"?"var(--orb-surface-2)":"var(--orb-p50)",transition:"border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease",boxShadow:d?"0 0 0 3px var(--orb-focus-ring)":"none",minHeight:120,display:"flex",flexDirection:"column"}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[g("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[n,f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children: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(ne,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:f(_d,{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 Ru={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:Ru,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(ne,{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(Ja,{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:Ru,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});var $i=({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(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(ne,{size:"small",onClick:u=>{u.stopPropagation(),r();},sx:{width:24,height:24,p:0},children:f(xr,{size:13})})]})}),ca=({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}),f$1={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:u,zIndex:m?999:"auto"};return f($i,{label:o,caption:r,onRemove:n,trailing:a,isDragging:m,dragRef:i,listeners:l,attributes:s,style:f$1})};var Ui={rows:f(rp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:f(an,{size:16,sx:{color:"var(--orb-primary)"}}),filters:f(zd,{size:16,sx:{color:"var(--orb-primary)"}}),values:f(nn,{size:16,sx:{color:"var(--orb-accent)"}})},Du=({isConfiguratorCollapsed:t,onToggleCollapse:o,availableFields:r,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:l,clearZone:d,removeFieldFromZone:u,getFilterSelectionSummary:m,renderDimensionFilterSelect:f$1,renderAggregationSelect:h,getAggregationLabel:p})=>{let{t:v}=de(),y=[`${v("pivot.zone.rows")} ${s.length}`,`${v("pivot.zone.columns")} ${i.length}`,`${v("pivot.zone.filters")} ${a.length}`,`${v("pivot.zone.values")} ${l.length}`].join(" \xB7 ");return f(kn,{title:v("pivot.config.title"),subtitle:y,collapsed:t,onToggleCollapse:o,expandAriaLabel:v("pivot.collapse.ariaExpand"),collapseAriaLabel:v("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[f(wn,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:r.length,icon:f(Sn,{size:18,subtle:true}),children:g(ae,{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(Mu,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),g(ae,{spacing:2,children:[g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(wn,{zone:"filters",title:v("pivot.zone.filters"),hint:v("pivot.hint.filters"),icon:Ui.filters,itemCount:a.length,onClear:()=>d("filters"),children:f(SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:a.map(g=>f(ca,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:m(g),trailing:f$1(g),onRemove:()=>u("filters",g)},g))})})}),f(wn,{zone:"columns",title:v("pivot.zone.columns"),hint:v("pivot.hint.columns"),icon:Ui.columns,itemCount:i.length,onClear:()=>d("columns"),children:f(SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:i.map(g=>f(ca,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:f$1(g),onRemove:()=>u("columns",g)},g))})})})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(wn,{zone:"rows",title:v("pivot.zone.rows"),hint:v("pivot.hint.rows"),icon:Ui.rows,itemCount:s.length,onClear:()=>d("rows"),children:f(SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:s.map(g=>f(ca,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:f$1(g),onRemove:()=>u("rows",g)},g))})})}),f(wn,{zone:"values",title:v("pivot.zone.values"),hint:v("pivot.hint.values"),icon:Ui.values,itemCount:l.length,onClear:()=>d("values"),children:f(SortableContext,{items:l.map(g=>`item|values|${g.tokenId}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:l.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,b=`${p(g.aggregation)}(${x})`;return f(ca,{id:`item|values|${g.tokenId}`,label:x,caption:b,trailing:h(g),onRemove:()=>u("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};var Nu=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Au=({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),f$1=Math.max(...u,1),h=Math.max(...m,1),p=s-d.left-d.right,v=l-d.top-d.bottom,y=t.map((g,x)=>{let b=r?g.primaryValue:x+1,C=r?g.secondaryValue??0:g.primaryValue,k=d.left+b/f$1*p,w=l-d.bottom-C/h*v;return {...g,x:k,y:w,rawX:b,rawY:C}});return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[f("div",{sx:{overflowX:"auto"},children:g("div",{component:"svg",viewBox:`0 0 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[f("line",{x1:d.left,y1:l-d.bottom,x2:s-d.right,y2:l-d.bottom,stroke:No(i.palette.text.secondary,.35)}),f("line",{x1:d.left,y1:d.top,x2:d.left,y2:l-d.bottom,stroke:No(i.palette.text.secondary,.35)}),y.map(g$1=>g("g",{children:[f("circle",{cx:g$1.x,cy:g$1.y,r:7,fill:No(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},u=0;for(;u<h.length;){let b=h[u],C=b.trim();if(!C){u+=1;continue}if(i&&lu(b)){if(C.startsWith("<think>")){let v=[],y=b;for(;;){let k=y.indexOf("<think>"),w=k>=0?y.slice(k+7):y,P=w.indexOf("</think>");if(P>=0){v.push(w.slice(0,P)),u+=1;break}if(v.push(w),u+=1,u>=h.length)break;y=h[u];}m.push(f(Fi,{content:v.join(`
|
|
8
|
+
`).trim()},`think-tag-${u}`));continue}u+=1;let x=[];for(;u<h.length&&h[u].trim()!==":::";)x.push(h[u]),u+=1;u<h.length&&h[u].trim()===":::"&&(u+=1),m.push(f(Fi,{content:x.join(`
|
|
9
|
+
`).trim()},`think-fence-${u}`));continue}if(Bi(b)){let x=C.slice(3).trim().toLowerCase(),v=[];for(u+=1;u<h.length&&!Bi(h[u]);)v.push(h[u]),u+=1;u<h.length&&Bi(h[u])&&(u+=1);let y=v.join(`
|
|
10
|
+
`);if(a&&x==="mermaid"){m.push(f(hl,{code:y},`mermaid-${u}`));continue}if(n&&["math","latex","katex"].includes(x)){m.push(f(la,{expression:y,allowKatex:true},`math-fence-${u}`));continue}m.push(f(sa,{code:y,language:x||"text",copyable:s,showLineNumbers:l,wrapLongLines:true},`code-${u}`));continue}if(n&&C.startsWith("$$")){let x=[];if(C.endsWith("$$")&&C!=="$$")x.push(C.slice(2,-2)),u+=1;else {let y=b.slice(b.indexOf("$$")+2);for(y.trim()&&x.push(y),u+=1;u<h.length;){let k=h[u],w=k.indexOf("$$");if(w>=0){x.push(k.slice(0,w)),u+=1;break}x.push(k),u+=1;}}m.push(f(la,{expression:x.join(`
|
|
11
|
+
`).trim(),allowKatex:true},`math-${u}`));continue}if(au(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(vo,{variant:y,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:ca(v,f$1,`h-${u}`)},`heading-${u}`)),u+=1;continue}if(iu(b)){m.push(f(wd,{sx:{my:1.2}},`hr-${u}`)),u+=1;continue}if(su(h,u)){let x=u+2;for(;x<h.length&&h[x].trim()&&h[x].includes("|");)x+=1;let v=h.slice(u,x).join(`
|
|
12
|
+
`),y=Oi(v);if(y){m.push(f(bl,{table:y},`table-${u}`)),u=x;continue}}if(xl(b)){let x=[];for(;u<h.length&&xl(h[u]);)x.push(h[u].replace(/^\s*>\s?/,"")),u+=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(vo,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((v,y)=>g(Fragment,{children:[y>0&&f("br",{}),ca(v,f$1,`q-${u}-${y}`)]},`quote-line-${y}`))})},`quote-${u}`));continue}if(yl(b)){let x=[];for(;u<h.length&&yl(h[u]);)x.push(h[u].trim().replace(/^[-*+]\s+/,"")),u+=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(vo,{variant:"body2",children:ca(v,f$1,`ul-${u}-${y}`)})},`ul-item-${y}`))},`ul-${u}`));continue}if(Cl(b)){let x=[];for(;u<h.length&&Cl(h[u]);)x.push(h[u].trim().replace(/^\d+\.\s+/,"")),u+=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(vo,{variant:"body2",children:ca(v,f$1,`ol-${u}-${y}`)})},`ol-item-${y}`))},`ol-${u}`));continue}let g$1=[];for(;u<h.length;){let x=h[u],v=x.trim();if(!v||Bi(x)||au(x)||iu(x)||yl(x)||Cl(x)||xl(x)||su(h,u)||i&&lu(x)||n&&v.startsWith("$$"))break;g$1.push(x),u+=1;}g$1.length>0?m.push(f(vo,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g$1.map((x,v)=>g(Fragment,{children:[v>0&&f("br",{}),ca(x,f$1,`p-${u}-${v}`)]},`p-line-${v}`))},`p-${u}`)):u+=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:p})};var _N=(t,o)=>f(da,{markdown:t,...o});var cu=({value:t,onChange:o,onSubmit:r,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:l=false,compact:d=false,showStatusText:p=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(Br,{sx:{fontSize:d?16:18,color:"text.secondary"}}),f(Rd,{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(xr,{sx:{fontSize:d?16:18}})}),n&&f(ie,{size:"small",onClick:n,children:f(np,{sx:{fontSize:d?16:18}})}),f(ie,{size:"small",onClick:r,disabled:l||!t.trim(),children:f(cp,{sx:{fontSize:d?16:18}})})]}),p&&s&&f(E,{variant:"caption",color:"text.secondary",children:s})]});var du=(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)]})},Hi=({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:du(n.label,o)}),f(E,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?du(a,o):n.value})]},n.id)})})]})};var wl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",Vi=t=>t.trim().toLowerCase(),Qb=(t,o)=>{let r=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||wl(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:Vi(`${n.title} ${a.label} ${i}`)});});}),o.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||wl(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Vi(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||wl(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:Vi(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),r},pu=({sections:t,tabs:o=[],defaultTabId:r,ai:n})=>{let{t:a}=ce(),[i,s]=useState(""),[l,d]=useState(r||o[0]?.id),[p,m]=useState("idle"),[h,f]=useState([]),[u,b]=useState(""),[C,g]=useState(""),[x,v]=useState(false),y=useMemo(()=>Qb(t,o),[t,o]);useEffect(()=>{if(o.length===0){d(void 0);return}o.some(R=>R.id===l)||d(r||o[0]?.id);},[o,l,r]);let k=useCallback(()=>{m("idle"),f([]),b(""),g("");},[]),w=useCallback(S=>{s(S),S.trim()||(m("idle"),f([]),b(""),g(""));},[]),P=useCallback(S=>{let R=Vi(S);return R?y.filter(N=>N.text.includes(R)).map(N=>N.hit):[]},[y]),I=useCallback(async()=>{let S=i.trim();if(!S)return;v(true);let R=P(S);if(f(R),R.length>0){m("search"),g(""),b(a("detail.searchAi.matches",{count:R.length})),v(false);return}if(n?.enabled!==false&&n?.onSubmit){m("ai"),b(a("detail.searchAi.autoAiFallback"));try{let T=await n.onSubmit(S,{query:S,hits:R,activeTabId:l,sections:t,tabs:o});g(typeof T=="string"?T:"");}finally{v(false);}return}m("search"),g(""),b(a("detail.searchAi.noMatch")),v(false);},[i,P,a,n,l,t,o]);return {query:i,setQuery:w,activeTabId:l,setActiveTabId:d,searchMode:p,hits:h,statusText:u,aiResponse:C,searching:x,handleSubmit:I,clearResult:k}};var bA=({title:t,subtitle:o,sections:r,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:l,searchBarWidth:d=460,onClose:p,closeLabel:m="Close"})=>{let{t:h}=ce(),{query:f$1,setQuery:u,activeTabId:b,setActiveTabId:C,searchMode:g$1,hits:x,statusText:v,aiResponse:y,searching:k,handleSubmit:w,clearResult:P}=pu({sections:r,tabs:n,defaultTabId:a,ai:s}),I=useMemo(()=>n.find(N=>N.id===b)||n[0],[n,b]),S=useCallback(N=>{let T=M=>{let A=document.getElementById(N);if(A){A.scrollIntoView({behavior:"smooth",block:"center"});return}M<4&&setTimeout(()=>T(M+1),60);};requestAnimationFrame(()=>T(0));},[]),R=useCallback((N,T)=>{if(n.some(M=>M.id===N)){C(N),S(T?`detail-tab-${N}-section-${T}`:`detail-tab-${N}`);return}S(`detail-section-${N}`);},[n,C,S]);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(cu,{value:f$1,onChange:u,onSubmit:w,onVoiceInput:s?.onVoiceInput,onClear:()=>{u(""),P();},placeholder:s?.placeholder||h("detail.searchAi.placeholder"),statusText:v,loading:k,compact:true,showStatusText:false})}),p&&f(ct,{title:m,children:f(ie,{size:"small",onClick:p,children:f(qd,{fontSize:"small"})})}),l]})]}),v&&f(E,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:v}),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(se,{spacing:.35,children:x.slice(0,8).map(N=>f("div",{component:"button",type:"button",onClick:()=>R(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(da,{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(Hi,{section:N,highlightQuery:f$1})},N.id))}),n.length>0&&g(Ne,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[f(Ld,{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(Od,{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(se,{spacing:1.5,children:[(I?.sections||[]).map(N=>f("div",{id:`detail-tab-${I?.id}-section-${N.id}`,children:f(Hi,{section:N,highlightQuery:f$1})},N.id)),I?.fields&&I.fields.length>0&&f(Hi,{section:{id:`${I.id}-fields`,title:I.label,fields:I.fields,columns:2},highlightQuery:f$1})]})]})]}),i&&f(er,{title:i.title||h("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};var gu=({bucket:t,cardCount:o,highlighted:r=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:l,renameLabel:d,sx:p})=>{let{t:m}=ce(),[h,f$1]=useState(false),[u,b]=useState(t.title),C=()=>{b(t.title),f$1(false);},g$1=x=>{x.preventDefault();let v=u.trim();v&&(v!==t.title&&l?.(v),b(v),f$1(false));};return f(Ne,{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(p)?p:p?[p]:[]],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:u,onChange:x=>b(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),C());},inputProps:{"aria-label":d??m("kanban.bucket.rename")},error:!u.trim(),sx:{flex:1,minWidth:0}}),f(ie,{type:"submit",size:"small",tooltip:m("kanban.bucket.saveRename"),"aria-label":m("kanban.bucket.saveRename"),disabled:!u.trim(),children:f(xo,{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"}),l&&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(Ec,{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 Jb={success:"success",warning:"warning",info:"info",error:"error"},ev={critical:"error",high:"warning",medium:"info",low:"success"},tv={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},ov=(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}},rv=t=>t?t.split(/\s+/).map(o=>o.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Sl=({card:t,bucket:o,dragging:r=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=ce(),l=!!(a&&o),d=t.tone??(t.priority?ev[t.priority]:"default"),p=d==="default"?"primary":Jb[d],m=tv[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(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:p,label:ov(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(kd,{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(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(Ja,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??rv(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 hu=(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:[]}]}},fu=(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)}},nv=(t,o)=>Number.isNaN(t)||t<0?0:t>o?o:t,bu=({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}})}},Go=(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}}},Wi=(t,o)=>{let r=Go(t,o.cardId);if(!r)return t;let n=t.buckets.findIndex(p=>p.id===o.toBucketId);if(n<0)return t;let a=t.buckets.map(p=>({...p,cards:p.cards.map(m=>({...m}))})),i=a[r.bucketIndex],[s]=i.cards.splice(r.cardIndex,1);if(!s)return t;let l=a[n],d=nv(o.targetIndex??l.cards.length,l.cards.length);return l.cards.splice(d,0,{...s,bucketId:o.toBucketId}),{buckets:a.map(p=>({...p,cards:p.cards.map((m,h)=>({...m,bucketId:p.id,position:h}))}))}};var Tl="kanban-card|",Il="kanban-bucket|",Cu=t=>`${Tl}${t}`,hv=t=>`${Il}${t}`,$i=t=>t?.startsWith(Tl)?t.slice(Tl.length):void 0,yu=t=>t?.startsWith(Il)?t.slice(Il.length):void 0,fv=({card:t,bucket:o,onCardClick:r})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=useSortable({id:Cu(t.id)}),p={transform:s?`translate3d(${s.x}px, ${s.y}px, 0)`:void 0,transition:l,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return f("div",{ref:n,style:p,...a,...i,children:f(Sl,{card:t,bucket:o,dragging:d,onClick:r})})},bv=({bucket:t,highlighted:o,bucketHeight:r,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=useDroppable({id:hv(t.id)});return f(Ie,{ref:l,sx:{minWidth:0,minHeight:0,height:r},children:f(gu,{bucket:t,cardCount:t.cards.length,highlighted:o||s,emptyLabel:n,height:r,onRename:a,children:f(SortableContext,{items:t.cards.map(d=>Cu(d.id)),strategy:verticalListSortingStrategy,children:f(se,{spacing:1,children:t.cards.map(d=>f(fv,{card:d,bucket:t,onCardClick:i},d.id))})})})})},xu=t=>String(t??"").toLocaleLowerCase(),vv=(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=>xu(n).includes(o)),UA=({model:t,onCardMove:o,onCardClick:r,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:l=320,bucketHeight:d,bucketMaxHeight:p,searchable:m=false,searchValue:h,defaultSearchValue:f$1="",onSearchValueChange:u,searchPlaceholder:b,emptyBucketLabel:C,sx:g$1})=>{let{t:x}=ce(),[v,y]=useState(null),[k,w]=useState(),[P,I]=useState(f$1),S=h??P,R=S.trim().toLocaleLowerCase(),N=d??p??560,T=useMemo(()=>({buckets:t.buckets.map(H=>{let B=n?H.cards.filter(Z=>n(Z,H)):H.cards;if(!R)return {...H,cards:B};let q=[H.id,H.title,H.description].some(Z=>xu(Z).includes(R));return {...H,cards:q?B:B.filter(Z=>vv(Z,R))}})}),[n,t,R]),M=useMemo(()=>T.buckets.reduce((H,B)=>H+B.cards.length,0),[T]),A=useCallback(H=>{h===void 0&&I(H),u?.(H);},[u,h]),L=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),W=useMemo(()=>v?Go(t,v):void 0,[v,t]),ee=useCallback(()=>{y(null),w(void 0);},[]),O=useCallback(H=>{if(!H)return;let B=$i(H);return B?Go(t,B)?.bucket.id:yu(H)},[t]),_=useCallback(H=>{y($i(String(H.active.id))??null);},[]),V=useCallback(H=>{w(O(H.over?String(H.over.id):void 0));},[O]),Q=useCallback(H=>{let B=$i(String(H.active.id)),q=H.over?String(H.over.id):void 0;if(!B||!q){ee();return}let Z=Go(t,B);if(!Z){ee();return}let Y=Z.bucket.id,J=Z.cardIndex,le=$i(q);if(le){let be=Go(t,le);if(!be){ee();return}Y=be.bucket.id,J=be.cardIndex;}else {let be=yu(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=Wi(t,{cardId:B,fromBucketId:Z.bucket.id,toBucketId:Y,targetIndex:J}),ze=Go(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:S,onChange:H=>A(H.target.value),placeholder:b??x("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:S?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:f(zo,{size:16,"aria-hidden":"true"}),endAdornment:S?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:[R&&f(E,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:M>0?x("kanban.search.results",{count:M}):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(${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(H=>f(bv,{bucket:H,highlighted:H.id===k,bucketHeight:N,emptyBucketLabel:R?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(l-24,260)},children:f(Sl,{card:W.card,bucket:W.bucket,overlay:true})}):null})]})};var xv=({initialModel:t,initialBuckets:o,initialCards:r})=>t||bu({buckets:o??[],cards:r??[]}),YA=t=>{let{onCardMove:o,onCardClick:r}=t,[n,a]=useState(()=>xv(t)),i=useCallback(f=>{a(u=>typeof f=="function"?f(u):f);},[]),s=useCallback(f=>Go(n,f),[n]),l=useCallback((f,u,b)=>{let C=Go(n,f);if(!C)return;let g=Wi(n,{cardId:f,fromBucketId:C.bucket.id,toBucketId:u,targetIndex:b}),x=Go(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,u)=>{a(b=>({buckets:b.buckets.map(C=>({...C,cards:C.cards.map(g=>g.id!==f?g:typeof u=="function"?u(g):{...g,...u})}))}));},[]),p=useCallback(f=>{let u=hu(n,f);return u===n?false:(a(u),true)},[n]),m=useCallback((f,u)=>{let b=fu(n,f,u);return b===n?false:(a(b),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:p,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),p=useRef(null),m=useRef(null),h=useRef(null),f=useRef(null),u=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),p.current&&(p.current.getTracks().forEach(y=>y.stop()),p.current=null),m.current&&(m.current.close(),m.current=null),C.current=false,l(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,u.current=Date.now();try{let y=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});p.current=y;let k=new WebSocket(n);d.current=k,k.onopen=()=>{l(!0),C.current=!1;},k.onmessage=R=>{try{let N=JSON.parse(R.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 w=window.AudioContext||window.webkitAudioContext;if(!w)throw new Error("AudioContext is not supported in this browser");let P=new w({sampleRate:16e3});m.current=P;let I=P.createMediaStreamSource(y);f.current=I;let S=P.createScriptProcessor(4096,1,1);h.current=S,S.onaudioprocess=R=>{if(d.current?.readyState!==WebSocket.OPEN)return;let N=R.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)u.current=Date.now();else if(Date.now()-u.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);},I.connect(S),S.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:v,stopRecording:x}}var Pv=["en","zh","fr","de","ja","ko"],Su={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Rl=({searchPlaceholder:t,onSearch:o,onSearchAdd:r,onOpenPanel:n,panelOpen:a=false,maxWidth:i=540,sx:s})=>{let{t:l}=ce(),[d,p]=useState(""),m=useCallback((x=d)=>{let v=x.trim();v&&(p(""),o?.(v));},[o,d]),h=x=>{x.preventDefault(),m();},{isRecording:f$1,startRecording:u,stopRecording:b}=Cn({onTextUpdate:p,onComplete:x=>{p(x),m(x);},onError:x=>{console.error("Header voice input error:",x);}}),C=useCallback(async()=>{if(f$1){b();return}await u();},[f$1,u,b]),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(ie,{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=>p(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":l("header.searchOpenPanel"),tooltip:l("header.searchOpenPanel"),onClick:n,children:f(Pt,{name:"message",size:16})}),f(ie,{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})})]})]})})},_i=({appTitle:t,logo:o,onToggleMode:r,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:l,showSearch:d=false,onSearch:p,onSearchAdd:m,onOpenPanel:h,panelOpen:f$1,user:u,onUserRefresh:b,onUserSetting:C,onUserLogout:g$1,userMenuItems:x,leftSlot:v,rightSlot:y})=>{let{t:k,locale:w}=ce(),P=go(),I=n||w,S=a||Su[I],R=i||Pv,N=P==="dark"?f(Uc,{size:15}):f(Zc,{size:15}),T=k(P==="dark"?"header.theme.dark":"header.theme.light"),M=[...b?[{key:"refresh",label:k("header.menu.refresh"),icon:f(Ha,{size:15}),onClick:b}]:[],...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(Wc,{size:16}),onClick:g$1}]:[]],A=x||M,L=R.map(W=>({label:Su[W],onClick:()=>{s?.(W),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:W===I}));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(Rl,{searchPlaceholder:l,onSearch:p,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:S,trigger:g("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[f(Hn,{size:15}),f("span",{className:"orb-label",children:S})]}),items:L,align:"end"}):g("div",{className:"orb-app-header-locale","aria-label":S,children:[f(Hn,{size:15}),f("span",{className:"orb-label",children:S})]}),f(ie,{className:"orb-app-header-theme",size:"small",onClick:r,tooltip:T,children:N})]}),u&&f("span",{className:"orb-app-header-divider","aria-hidden":"true"}),u&&f(Qt,{triggerLabel:u.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:u.name}),u.subtitle&&f(E,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:u.subtitle,children:u.subtitle})]}),f(en,{src:u.avatarSrc,alt:u.name,size:32,children:u.avatarText||u.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 ku=({menuData:t=[],initialNavigationCollapsed:o=false,initialNavigationMode:r="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:p}=bd({initialCollapsed:o,initialDisplayMode:r,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[m,h]=useState(900);useEffect(()=>{let u=()=>h(window.innerHeight);return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]);let f=useMemo(()=>Math.max(280,m-100),[m]);return {navigationIslandProps:p,navigationMaxHeight:f}};var Oo=12,Tu=56,Iu=234,Dv="orbcafe:page-layout-locale",Mu=["en","zh","fr","de","ja","ko"],Nv=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",Gi=(t,o)=>`orbcafe:page-layout:${Nv(t)}:${o}`,Av=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,Ev=t=>t==="system"?"dark":t==="dark"?"light":"system",Ui=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),Lv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,yE=({appId:t,appTitle:o,menuData:r=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:l,onLocaleChange:d,mode:p,defaultMode:m="system",onModeChange:h,user:f$1,onUserRefresh:u,onUserSetting:b,onUserLogout:C,userMenuItems:g$1,logo:x,searchPlaceholder:v,searchPlacement:y="hidden",floatingSearchSx:k,onSearch:w,onSearchAdd:P,onOpenPanel:I,panelOpen:S,rightHeaderSlot:R,leftHeaderSlot:N,contentSx:T,navigationVariant:M="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?Gi(t,"mode"):"orbcafe:page-layout-mode",Z=t?Gi(t,"locale"):Dv,Y=t?Gi(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:Oo,y:Oo}),[Oe,at]=useState("left"),[Ze,xt]=useState(false),It=useRef(null),Ot=useRef(null),At=p!==void 0,re=p??J,Ge=d!==void 0,Le=Ge?i:Be,pe=l?.join("|")??"",xe=A!==void 0,oe=A??it,ye=oe==="floating",De=M==="v2"?Qs:pd,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=l??Mu;z&&Mu.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}=ku({menuData:r,initialNavigationCollapsed:false,initialNavigationMode:oe,enableNavigationPinning:O,navigationPinStorageKey:_??(t?Gi(t,"pinned-navigation-items"):Av(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=Oo,Ke=Oo,Ye=Math.max($e,Se.width-Ae.width-Oo),ut=Math.max(Ke,Se.height-Ae.height-Oo);return {x:Ui(z.x,$e,Ye),y:Ui(z.y,Ke,ut)}},[]),Nt=useCallback(z=>{let X=It.current,fe=X?.parentElement;if(!X||!fe)return z;let Se=fe.getBoundingClientRect(),Ae=X.getBoundingClientRect(),$e=Oo,Ke=Oo,Ye=Math.max($e,Se.width-Ae.width-Oo),ut=Math.max(Ke,Se.height-Ae.height-Oo),gt={x:Ui(z.x,$e,Ye),y:Ui(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?Tu:Iu;return fe?Math.max(Oo,fe-Se-Oo):Wt?Re.x:Re.x-(Iu-Tu)}return Re.x},[Oe,Re.x,Ze,ye,Wt]),Ft=useCallback(z=>{if(!ye||!Wt||Lv(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(Nt({x:X.currentX,y:X.currentY})),xt(false);}},[Nt]);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(Ln,{mode:re,children:f(Ua,{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(_i,{appTitle:o,logo:x,mode:re,onToggleMode:()=>Bt(Ev(re)),locale:Le,localeLabel:Ge||Le===i?s:void 0,localeOptions:l,onLocaleChange:Xt,user:f$1,onUserRefresh:u,onUserSetting:b,onUserLogout:C,userMenuItems:g$1,searchPlaceholder:v,showSearch:je,onSearch:w,onSearchAdd:P,onOpenPanel:I,panelOpen:S,leftSlot:N,rightSlot:R}),y==="floating"&&f("div",{className:"orb-float-search",style:k,children:f(Rl,{searchPlaceholder:v,onSearch:w,onSearchAdd:P,onOpenPanel:I,panelOpen:S,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(De,{...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(De,{...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 Ki="(blank)",Ru="Result",Du="Grand Total",Nu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Au=["sum","count","avg","min","max"];var Eu=["palette","rows","columns","filters","values"];var Lu=t=>Eu.includes(t),Ou=t=>t==="rows"||t==="columns"||t==="filters",qi=t=>{let o=t.split("|");return o.length===2&&o[0]==="container"&&Lu(o[1])?{kind:"container",zone:o[1]}:o.length===3&&o[0]==="item"&&Lu(o[1])&&o[2]?{kind:"item",zone:o[1],key:o[2]}:null},dr=t=>t==null||t===""?Ki:t instanceof Date?t.toISOString().slice(0,10):String(t),Wr=t=>JSON.stringify(t),Fu=(t,o)=>{let r=t.join(""),n=o.join("");return r.localeCompare(n,void 0,{sensitivity:"base"})},Ov=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=>Ov(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},pr=(t,o)=>t.length!==o.length?false:t.every((r,n)=>r===o[n]),Bu=(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)})},Xi=(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}),Dl=t=>!t?.aggregations||t.aggregations.length===0?Au:t.aggregations,yo=(t,o)=>{let r=Dl(o);return t&&r.includes(t)?t:o?.type==="number"&&r.includes("sum")?"sum":r.includes("count")?"count":r[0]},pa=(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 zu=({options:t,selectedValues:o,onChange:r,minWidth:n=96})=>{let{t:a}=ce(),[i,s]=useState(""),[l,d]=useState(null),p=useMemo(()=>{let u=i.trim().toLowerCase();return u?t.filter(b=>b.toLowerCase().includes(u)):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=u=>{r(o.includes(u)?o.filter(b=>b!==u):[...o,u]);};return g("div",{sx:{minWidth:n},onClick:u=>u.stopPropagation(),onMouseDown:u=>u.stopPropagation(),children:[f(Pe,{variant:"outlined",size:"small",onClick:u=>d(u.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:h}),f(Qt,{anchorEl:l,open:!!l,onClose:()=>d(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:g("div",{onClick:u=>u.stopPropagation(),sx:{display:"grid",gap:.4},children:[f(He,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:u=>s(u.target.value),onKeyDown:u=>u.stopPropagation(),onClick:u=>u.stopPropagation(),sx:{m:0,"& .orb-inp":{fontSize:"0.75rem",py:.7}}}),f("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:f(Pe,{variant:"text",size:"small",onClick:u=>{u.preventDefault(),u.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")})}),p.length===0&&f("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),p.map(u=>{let b=o.includes(u);return g("div",{role:"option","aria-selected":b,tabIndex:0,className:`orb-menu-item ${b?"orb-selected":""}`,onClick:()=>f$1(u),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),f$1(u));},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:u})]},u)})]})})]})};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 Nl=({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})]})]})}),Vu=({id:t,label:o,subtitle:r})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=useDraggable({id:t});return f(Nl,{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:p}=useDroppable({id:l}),{t:m}=ce();return g(Ne,{ref:p,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(op,{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 Wu={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:p})=>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:Wu,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:[p,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(ii,{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:Wu,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});var Zi=({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(ie,{size:"small",onClick:p=>{p.stopPropagation(),r();},sx:{width:24,height:24,p:0},children:f(xr,{size:13})})]})}),ua=({id:t,label:o,caption:r,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:l,transform:d,transition:p,isDragging:m}=useSortable({id:t}),h={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:p,zIndex:m?999:"auto"};return f(Zi,{label:o,caption:r,onRemove:n,trailing:a,isDragging:m,dragRef:i,listeners:l,attributes:s,style:h})};var ji={rows:f(hp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:f(an,{size:16,sx:{color:"var(--orb-primary)"}}),filters:f(jd,{size:16,sx:{color:"var(--orb-primary)"}}),values:f(nn,{size:16,sx:{color:"var(--orb-accent)"}})},$u=({isConfiguratorCollapsed:t,onToggleCollapse:o,availableFields:r,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:l,clearZone:d,removeFieldFromZone:p,getFilterSelectionSummary:m,renderDimensionFilterSelect:h,renderAggregationSelect:f$1,getAggregationLabel:u})=>{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")} ${l.length}`].join(" \xB7 ");return f(kn,{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(Sn,{zone:"palette",title:b("pivot.fieldList"),hint:b("pivot.availableDimensions"),itemCount:r.length,icon:f(wn,{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(Vu,{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(Sn,{zone:"filters",title:b("pivot.zone.filters"),hint:b("pivot.hint.filters"),icon:ji.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(ua,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:m(g),trailing:h(g),onRemove:()=>p("filters",g)},g))})})}),f(Sn,{zone:"columns",title:b("pivot.zone.columns"),hint:b("pivot.hint.columns"),icon:ji.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(ua,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:h(g),onRemove:()=>p("columns",g)},g))})})})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(Sn,{zone:"rows",title:b("pivot.zone.rows"),hint:b("pivot.hint.rows"),icon:ji.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(ua,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:h(g),onRemove:()=>p("rows",g)},g))})})}),f(Sn,{zone:"values",title:b("pivot.zone.values"),hint:b("pivot.hint.values"),icon:ji.values,itemCount:l.length,onClear:()=>d("values"),children:f(SortableContext,{items:l.map(g=>`item|values|${g.tokenId}`),strategy:verticalListSortingStrategy,children:f(se,{spacing:.7,children:l.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,v=`${u(g.aggregation)}(${x})`;return f(ua,{id:`item|values|${g.tokenId}`,label:x,caption:v,trailing:f$1(g),onRemove:()=>p("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};var _u=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Gu=({data:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=io();if(t.length===0)return null;let s=720,l=250,d={top:20,right:24,bottom:40,left:52},p=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(...p,1),f$1=Math.max(...m,1),u=s-d.left-d.right,b=l-d.top-d.bottom,C=t.map((g,x)=>{let v=r?g.primaryValue:x+1,y=r?g.secondaryValue??0:g.primaryValue,k=d.left+v/h*u,w=l-d.bottom-y/f$1*b;return {...g,x:k,y:w,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} ${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:Eo(i.palette.text.secondary,.35)}),f("line",{x1:d.left,y1:d.top,x2:d.left,y2:l-d.bottom,stroke:Eo(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:Eo(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:l-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:r?o:"Index"}),f("text",{x:16,y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/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:
|
|
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:C=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${No(C.palette.divider,.7)}`,bgcolor:No(C.palette.background.default,.35)}),children:[f(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:b.name,children:b.name}),f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(b.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(b.secondaryValue??0)})]},b.name))})]})};var Lu=(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},Ou=(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}}),Fu=({rows:t,dimensionFieldId:o,primaryValue:r,secondaryValue:n})=>{if(!o)return [];let a=new Map;return t.forEach(i=>{let s=cr(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 Bu=({rows:t,fieldMap:o,rowFields:r,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:l,chartType:d,isCollapsed:u,onChartDimensionFieldIdChange:m,onChartPrimaryValueFieldIdChange:f$1,onChartSecondaryValueFieldIdChange:h,onChartTypeChange:p,onToggleCollapse:v,getAggregationLabel:y})=>{let{t:g$1}=de(),x=useMemo(()=>Lu(r,n,o),[n,o,r]),b=useMemo(()=>Ou(a,o,y),[o,y,a]),C=b.find(T=>T.fieldId===s)??b[0],k=b.find(T=>T.fieldId===l&&T.fieldId!==C?.fieldId)??null,w=x.find(T=>T.fieldId===i)??x[0],P=w&&C?g$1("pivot.chart.subtitleReady",{dimension:w.label,measure:k?`${C.label} / ${k.label}`:C.label}):g$1("pivot.chart.subtitle"),I=useMemo(()=>!w||!C?[]:Fu({rows:t,dimensionFieldId:w.fieldId,primaryValue:C.item,secondaryValue:k?.item}),[C,t,k,w]),S=T=>C?la(T,C.item,o):T.toLocaleString(),N=T=>k?la(T,k.item,o):T.toLocaleString(),M=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:[M&&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:w?.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:C?.fieldId??"",onChange:T=>f$1(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:b.map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))})]}),g(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=>h(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("common.none")}),b.filter(T=>T.fieldId!==C?.fieldId).map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))]})]}),g(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:w?C?I.length===0?f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoData")})}):d==="scatter"?f(Au,{data:I,primaryLabel:C.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:N}):f(Eu,{data:I,chartType:d,primaryLabel:C.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:N}):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 Ki=({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,f$1=u?800:m?700:d?600:500,h=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:f$1},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(ne,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:l?f(zo,{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:h},sx:{fontSize:"0.76rem",borderBottom:v=>`1px solid ${v.palette.divider}`,whiteSpace:"nowrap"},children:la(s?s(t,p.id):t.aggregatedValues[p.id]??0,p.valueItem,r)},`${t.key}-${p.id}`))]}),l&&t.children.map(p=>f(Ki,{node:p,dataColumns:o,fieldMap:r,level:n+1,expandedKeys:a,onToggle:i,getValue:s},p.key))]})};var xl=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},Xi=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",Sl=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",zu=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},Vu=(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,Vu(a.children,o,r+1)),r),Mv=(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},DL=({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:f$1,defaultPresets:h,onPresetsChange:p,initialPresetId:v,onPresetApplied:y})=>{let{t:g$1}=de(),x=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),b$1=useRef(0),C=useRef(false),k=t??g$1("pivot.title.default"),w=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(R=>P[R]??yu[R],[P]),S=useMemo(()=>new Set(r.map(R=>R.id)),[r]),N=useMemo(()=>new Map(r.map(R=>[R.id,R])),[r]),[M,T]=useState(()=>io(n?.rows,S)),[D,A]=useState(()=>io(n?.columns,S)),[L,O]=useState(()=>io(n?.filters,S)),[_,F]=useState(()=>{let R=n?.values??[],$=new Set,G=[];return R.forEach(ce=>{if(!S.has(ce.fieldId)||$.has(ce.fieldId))return;$.add(ce.fieldId),b$1.current+=1;let Be=N.get(ce.fieldId);G.push({tokenId:`v${b$1.current}`,fieldId:ce.fieldId,aggregation:bo(ce.aggregation,Be)});}),G}),[X,V]=useState({}),[Z,z]=useState(true),[H,U]=useState(false),[K,ge]=useState(()=>xl(io(n?.rows,S),io(n?.columns,S),a?.dimensionFieldId)),[ie,pe]=useState(()=>{let R=(n?.values??[]).filter(($,G,ce)=>S.has($.fieldId)&&ce.findIndex(Be=>Be.fieldId===$.fieldId)===G).map($=>({tokenId:$.fieldId,fieldId:$.fieldId,aggregation:bo($.aggregation,N.get($.fieldId))}));return Xi(R,a?.primaryValueFieldId)}),[xe,We]=useState(()=>{let R=(n?.values??[]).filter((G,ce,Be)=>S.has(G.fieldId)&&Be.findIndex(ot=>ot.fieldId===G.fieldId)===ce).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:bo(G.aggregation,N.get(G.fieldId))})),$=Xi(R,a?.primaryValueFieldId);return Sl(R,$,a?.secondaryValueFieldId)}),[we,se]=useState(a?.chartType??"bar-vertical"),[Ae,Ie]=useState(l),[ke,ze]=useState(d),[et,rt]=useState(()=>h??[]),[at,q]=useState(""),[Re,ve]=useState(false),[Fe,nt]=useState(""),[Ye,xt]=useState(null),[It,Lt]=useState(new Set(["__grand_total__"])),[Nt,te]=useState(new Set),Ge=u?.rowFields??M,Oe=u?.columnFields??D,le=u?.filterFields??L,be=u?.valueFields??_,ee=u?.filterSelections??X,he=u?.showGrandTotal??Z,De=u?.isConfiguratorCollapsed??H,je=u?.chartDimensionFieldId??K,it=u?.chartPrimaryValueFieldId??ie,dt=u?.chartSecondaryValueFieldId??xe,Ft=u?.chartType??we,Kt=u?.isChartCollapsed??Ae,zt=u?.isTableCollapsed??ke,St=f$1??et,Vt=m||St.length>0||!!p,ht=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]),st=useCallback(R=>{if(u?.setFilterFields){u.setFilterFields(R);return}O(R);},[u]),Ot=useCallback(R=>{if(u?.setValueFields){u.setValueFields(R);return}F(R);},[u]),qt=useCallback(R=>{if(u?.setFilterSelections){u.setFilterSelections(R);return}V(R);},[u]),Y=useCallback(R=>{if(u?.setShowGrandTotal){u.setShowGrandTotal(R);return}z(R);},[u]),W=useCallback(R=>{if(u?.setIsConfiguratorCollapsed){u.setIsConfiguratorCollapsed(R);return}U(R);},[u]),Q=useCallback(R=>{if(u?.setChartDimensionFieldId){u.setChartDimensionFieldId(R);return}ge(R);},[u]),fe=useCallback(R=>{if(u?.setChartPrimaryValueFieldId){u.setChartPrimaryValueFieldId(R);return}pe(R);},[u]),ye=useCallback(R=>{if(u?.setChartSecondaryValueFieldId){u.setChartSecondaryValueFieldId(R);return}We(R);},[u]),Ee=useCallback(R=>{if(u?.setChartType){u.setChartType(R);return}se(R);},[u]),$e=useCallback(R=>{if(u?.setIsChartCollapsed){u.setIsChartCollapsed(R);return}Ie(R);},[u]),Ke=useCallback(R=>{if(u?.setIsTableCollapsed){u.setIsTableCollapsed(R);return}ze(R);},[u]),Ze=useCallback(R=>{let $=typeof R=="function"?R(St):R;f$1||rt($),p?.($);},[p,St,f$1]),ut=useMemo(()=>new Set([...Ge,...Oe,...le]),[Ge,Oe,le]),gt=useMemo(()=>r.filter(R=>!ut.has(R.id)),[r,ut]),Mt=useMemo(()=>{let R=[...Ge,...Oe,...le],$=new Set,G=[];return R.forEach(ce=>{$.has(ce)||($.add(ce),G.push(ce));}),G},[Oe,le,Ge]);useEffect(()=>{ht(R=>{let $=R.filter(G=>S.has(G));return dr(R,$)?R:$}),Dt(R=>{let $=R.filter(G=>S.has(G));return dr(R,$)?R:$}),st(R=>{let $=R.filter(G=>S.has(G));return dr(R,$)?R:$}),Ot(R=>{let $=R.filter(G=>S.has(G.fieldId)).map(G=>({...G,aggregation:bo(G.aggregation,N.get(G.fieldId))}));return Wi(R,$)?R:$});},[N,S]);let bt=useMemo(()=>{let R={};return Mt.forEach($=>{let G=new Set;o.forEach(ce=>{G.add(cr(ce[$]));}),R[$]=Array.from(G).sort((ce,Be)=>ce.localeCompare(Be));}),R},[Mt,o]);useEffect(()=>{qt(R=>{let $={};return Mt.forEach(G=>{let ce=bt[G]??[],ot=(R[G]??[]).filter(oe=>ce.includes(oe)),_e=Object.prototype.hasOwnProperty.call(R,G);$[G]=_e?ot:ce;}),Pu(R,$)?R:$});},[Mt,bt]),useEffect(()=>{Q(R=>xl(Ge,Oe,R));},[Oe,Ge,Q]),useEffect(()=>{fe(R=>Xi(be,R));},[fe,be]),useEffect(()=>{ye(R=>Sl(be,it,R));},[it,ye,be]);let B=useMemo(()=>o.filter(R=>Mt.every($=>{let G=ee[$]??[],ce=bt[$]??[];if(G.length===ce.length)return true;if(G.length===0)return false;let Be=cr(R[$]);return G.includes(Be)})),[Mt,bt,ee,o]),j=useMemo(()=>{if(be.length===0)return null;let R=new Map;if(B.forEach(_e=>{let oe=Oe.length>0?Oe.map(J=>cr(_e[J])):[g$1("pivot.valueLabel")],ue=Wr(oe);R.set(ue,oe);}),R.size===0){let _e=Oe.length>0?Oe.map(()=>zi):[g$1("pivot.valueLabel")];R.set(Wr(_e),_e);}let $=Array.from(R.entries()).sort((_e,oe)=>ku(_e[1],oe[1])),G=$.flatMap(([_e,oe])=>be.map(ue=>{let J=N.get(ue.fieldId),Le=`${I(ue.aggregation)} ${J?.label??ue.fieldId}`,Qe=Oe.length===0||be.length>1?`${oe.join(" / ")} \u2022 ${Le}`:oe.join(" / ");return {id:`${_e}::${ue.tokenId}`,colKey:_e,valueItem:ue,label:Qe}})),ce=[];Oe.length>0&&$.forEach(([_e,oe])=>{let ue=G.filter(Qe=>Qe.colKey===_e),J=ce,Le=[];oe.forEach((Qe,Me)=>{Le.push(`d${Me}:${Qe}`);let Xe=`col::${Wr(Le)}`,kt=J.find(Zr=>Zr.key===Xe);kt||(kt={key:Xe,label:Qe,children:[],leafColumnIds:[],path:oe.slice(0,Me+1),depth:Me},J.push(kt)),ue.forEach(Zr=>{kt.leafColumnIds.includes(Zr.id)||kt.leafColumnIds.push(Zr.id);}),J=kt.children;});});let Be=_e=>{let oe={};return G.forEach(ue=>{let J=_e.filter(Le=>{let Qe=Oe.length>0?Oe.map(Me=>cr(Le[Me])):[g$1("pivot.valueLabel")];return Wr(Qe)===ue.colKey});oe[ue.id]=xn(J,ue.valueItem.fieldId,ue.valueItem.aggregation);}),oe},ot=[];if(Ge.length===0)ot.push({key:"root",value:g$1("pivot.resultLabel")||bu,children:[],isLeaf:true,aggregatedValues:Be(B),path:[],depth:0});else {let _e=(oe,ue,J)=>{if(ue>=Ge.length)return [];let Le=Ge[ue],Qe=new Map;return oe.forEach(Me=>{let Xe=cr(Me[Le]);Qe.has(Xe)||Qe.set(Xe,[]),Qe.get(Xe).push(Me);}),Array.from(Qe.keys()).sort().map(Me=>{let Xe=Qe.get(Me),kt=[...J,Me];return {key:Wr(kt),value:Me,fieldId:Le,aggregatedValues:Be(Xe),children:_e(Xe,ue+1,kt),isLeaf:ue===Ge.length-1,path:kt,depth:ue}})};ot.push(..._e(B,0,[]));}return {dataColumns:G,columnTree:ce,rowTree:ot}},[Oe,N,B,I,Ge,g$1,be]),me=useCallback((R,$)=>(b$1.current+=1,{tokenId:`v${b$1.current}`,fieldId:R,aggregation:bo($,N.get(R))}),[N]),Pe=useCallback(R=>{if(R==="rows")return ht([]);if(R==="columns")return Dt([]);if(R==="filters")return st([]);Ot([]);},[]),Je=useCallback((R,$)=>{if(R==="rows")return ht(G=>G.filter(ce=>ce!==$));if(R==="columns")return Dt(G=>G.filter(ce=>ce!==$));if(R==="filters")return st(G=>G.filter(ce=>ce!==$));Ot(G=>G.filter(ce=>ce.tokenId!==$));},[]),qe=useCallback((R,$)=>{Ot(G=>G.map(ce=>ce.tokenId===R?{...ce,aggregation:bo($,N.get(ce.fieldId))}:ce));},[N]),wt=useCallback(R=>{xt(String(R.active.id));},[]),ft=useCallback(R=>{if(xt(null),!R.over)return;let $=Vi(String(R.active.id)),G=Vi(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&&ht(kt=>arrayMove(kt,Me,Xe));return}if($.zone==="columns"){let Me=Oe.indexOf($.key),Xe=Oe.indexOf(G.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&Dt(kt=>arrayMove(kt,Me,Xe));return}if($.zone==="filters"){let Me=le.indexOf($.key),Xe=le.indexOf(G.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&st(kt=>arrayMove(kt,Me,Xe));return}if($.zone==="values"){let Me=be.findIndex(kt=>kt.tokenId===$.key),Xe=be.findIndex(kt=>kt.tokenId===(G.key??""));Me!==-1&&Xe!==-1&&Me!==Xe&&Ot(kt=>arrayMove(kt,Me,Xe));}return}let ce=G.zone,Be=[...Ge],ot=[...Oe],_e=[...le],oe=[...be],ue="",J=null;if($.zone==="palette")ue=$.key;else if($.zone==="values"){let Me=oe.find(Xe=>Xe.tokenId===$.key);if(!Me)return;ue=Me.fieldId,J=Me,oe=oe.filter(Xe=>Xe.tokenId!==$.key);}else $.zone==="rows"?(ue=$.key,Be=Be.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 Le=()=>{Be=Be.filter(Me=>Me!==ue),ot=ot.filter(Me=>Me!==ue),_e=_e.filter(Me=>Me!==ue);},Qe=Me=>{if(G.kind!=="item"||!G.key)return Me==="rows"?Be.length:Me==="columns"?ot.length:Me==="filters"?_e.length:Me==="values"?oe.length:0;if(Me==="rows"){let Xe=Be.indexOf(G.key);return Xe>=0?Xe:Be.length}if(Me==="columns"){let Xe=ot.indexOf(G.key);return Xe>=0?Xe:ot.length}if(Me==="filters"){let Xe=_e.indexOf(G.key);return Xe>=0?Xe:_e.length}if(Me==="values"){let Xe=oe.findIndex(kt=>kt.tokenId===G.key);return Xe>=0?Xe:oe.length}return 0};if(ce==="palette"){ht(Be),Dt(ot),st(_e),Ot(oe);return}if(ce==="values"){let Me=Qe("values"),Xe=J??me(ue);oe.splice(Me,0,Xe),ht(Be),Dt(ot),st(_e),Ot(oe);return}if(wu(ce)){Le();let Me=Qe(ce);ce==="rows"?Be.splice(Me,0,ue):ce==="columns"?ot.splice(Me,0,ue):_e.splice(Me,0,ue),ht(Be),Dt(ot),st(_e),Ot(oe);}},[Oe,me,le,Ge,be]),mt=useCallback((R,$)=>{qt(G=>({...G,[R]:$}));},[]),yt=useCallback(R=>{Lt($=>{let G=new Set($);return G.has(R)?G.delete(R):G.add(R),G});},[]),oo=useCallback(R=>{te($=>{let G=new Set($);return G.has(R)?G.delete(R):G.add(R),G});},[]),At=useCallback(R=>{let $=N.get(R.fieldId),G=bl($);return f(vr,{size:"small",sx:{minWidth:98},children:f(Ht,{value:R.aggregation,onChange:ce=>qe(R.tokenId,ce.target.value),onClick:ce=>ce.stopPropagation(),onMouseDown:ce=>ce.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:G.map(ce=>f("option",{value:ce,sx:{fontSize:"0.75rem"},children:I(ce)},ce))})})},[N,I,qe]),Xt=useCallback(R=>{let $=bt[R]??[],G=ee[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,ee,g$1]),Bt=useCallback(R=>{let $=bt[R]??[],G=ee[R]??$;return f(Iu,{options:$,selectedValues:G,onChange:ce=>mt(R,ce)})},[bt,ee,mt]),Gt=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Wt=useCallback(()=>{let R={};return new Set([...Mt,...Object.keys(ee)]).forEach(G=>{if(!S.has(G))return;let ce=ee[G]??[];R[G]=[...ce];}),{layout:{rows:[...Ge],columns:[...Oe],filters:[...le],values:be.map(G=>({fieldId:G.fieldId,aggregation:G.aggregation}))},filterSelections:R,showGrandTotal:he,chart:{dimensionFieldId:je,primaryValueFieldId:it,secondaryValueFieldId:dt,chartType:Ft}}},[Mt,je,it,dt,Ft,Oe,le,ee,Ge,he,S,be]),eo=useCallback(R=>{let $=io(R.layout.rows,S),G=io(R.layout.columns,S),ce=io(R.layout.filters,S),Be=new Set,ot=(R.layout.values??[]).filter(ue=>!S.has(ue.fieldId)||Be.has(ue.fieldId)?false:(Be.add(ue.fieldId),true)).map(ue=>me(ue.fieldId,ue.aggregation)),_e={};Object.entries(R.filterSelections??{}).forEach(([ue,J])=>{!S.has(ue)||!Array.isArray(J)||(_e[ue]=Array.from(new Set(J.map(Le=>String(Le)))));}),ht($),Dt(G),st(ce),Ot(ot),qt(_e),typeof R.showGrandTotal=="boolean"&&Y(R.showGrandTotal),Q(xl($,G,R.chart?.dimensionFieldId));let oe=Xi(ot,R.chart?.primaryValueFieldId);fe(oe),ye(Sl(ot,oe,R.chart?.secondaryValueFieldId)),Ee(R.chart?.chartType??"bar-vertical"),q(R.id),y?.(R);},[me,y,Q,fe,ye,Ee,Dt,st,qt,ht,Y,Ot,S]),ro=useCallback(R=>{if(!R){q("");return}let $=St.find(G=>G.id===R);if(!$){q("");return}eo($);},[eo,St]),go=useCallback(()=>{let R=g$1("pivot.preset.defaultName",{index:St.length+1});nt(R),ve(true);},[St.length,g$1]),To=useCallback(()=>{let R=Fe.trim();if(!R)return;let $={id:Gt(),name:R,...Wt()};Ze(G=>[...G,$]),q($.id),ve(false);},[Wt,Gt,Fe,Ze]),Io=useCallback(()=>{at&&(Ze(R=>R.filter($=>$.id!==at)),q(""));},[at,Ze]);useEffect(()=>{if(!v||C.current)return;let R=St.find($=>$.id===v);R&&(C.current=true,eo(R));},[eo,v,St]),useEffect(()=>{at&&(St.some(R=>R.id===at)||q(""));},[at,St]);let rr=useMemo(()=>{if(!he||!j||!Ge.length)return null;let R={};return j.dataColumns.forEach($=>{let G=B.filter(ce=>{let Be=Oe.length>0?Oe.map(ot=>cr(ce[ot])):[g$1("pivot.valueLabel")];return Wr(Be)===$.colKey});R[$.id]=xn(G,$.valueItem.fieldId,$.valueItem.aggregation);}),{key:"__grand_total__",value:g$1("pivot.grandTotal")||vu,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:R,path:[],depth:-1}},[he,j,B,Oe,Ge.length,g$1]),vo=useMemo(()=>zu(j?.rowTree??[]),[j]),Lo=useMemo(()=>zu(j?.columnTree??[]),[j]);useEffect(()=>{Lt(R=>{let $=new Set;return R.has("__grand_total__")&&$.add("__grand_total__"),vo.forEach(G=>{R.has(G)&&$.add(G);}),$});},[vo]),useEffect(()=>{te(R=>{let $=new Set;return Lo.forEach(G=>{R.has(G)&&$.add(G);}),$});},[Lo]);let Ur=useCallback(()=>{Lt(R=>{let $=new Set(R);return vo.forEach(G=>$.add(G)),$});},[vo]),Kr=useCallback(()=>{Lt(R=>{let $=new Set;return R.has("__grand_total__")&&$.add("__grand_total__"),$});},[]),Ar=useCallback(()=>{te(new Set(Lo));},[Lo]),qr=useCallback(()=>{te(new Set);},[]),Xr=useMemo(()=>!j||Oe.length===0?[]:Mv(j.columnTree,Nt),[Oe.length,Nt,j]),Mo=useMemo(()=>{if(!j)return [];if(Oe.length===0)return j.dataColumns.map($=>({id:$.id,label:$.label,leafColumnIds:[$.id],valueItem:$.valueItem}));let R=new Map(j.dataColumns.map($=>[$.id,$]));return Xr.flatMap($=>{let G=new Map;return $.leafColumnIds.forEach(ce=>{let Be=R.get(ce);if(!Be)return;let ot=Be.valueItem.tokenId,_e=`${I(Be.valueItem.aggregation)} ${N.get(Be.valueItem.fieldId)?.label??Be.valueItem.fieldId}`,oe=G.get(ot);if(oe){oe.leafColumnIds.push(ce);return}G.set(ot,{id:`${$.key}::${ot}`,label:be.length>1?_e:$.label,leafColumnIds:[ce],valueItem:Be.valueItem});}),Array.from(G.values())})},[Oe.length,N,I,j,be.length,Xr]),Er=useMemo(()=>new Map(Mo.map(R=>[R.id,R])),[Mo]),Yr=useMemo(()=>Mo.map(R=>({id:R.id,colKey:R.id,valueItem:R.valueItem,label:R.label})),[Mo]),Uo=useMemo(()=>{if(!j||Oe.length===0)return [];let R=[],$=Vu(j.columnTree,Nt),G=$+(be.length>1?1:0),ce=(Be,ot)=>{R[ot]??(R[ot]=[]),Be.forEach(_e=>{let oe=_e.children.length>0&&Nt.has(_e.key),ue=Mo.filter(Le=>_e.leafColumnIds.some(Qe=>Le.leafColumnIds.includes(Qe))).length,J=oe||be.length>1?1:G-ot;R[ot].push({key:_e.key,label:_e.label,colSpan:ue,rowSpan:J,expandable:_e.children.length>0,expanded:oe}),oe&&ce(_e.children,ot+1);});};return ce(j.columnTree,0),be.length>1&&(R[$]=Mo.map(Be=>({key:Be.id,label:Be.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),R},[Oe.length,Nt,j,be.length,Mo]),nr=useCallback((R,$)=>$.leafColumnIds.reduce((G,ce)=>G+(R.aggregatedValues[ce]??0),0),[]),Nn=useMemo(()=>g(e,{children:[f(Se,{size:"small",variant:"text",onClick:Ur,disabled:vo.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:vo.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:Lo.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:Oe.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseColumnsAll")})]}),[Oe.length,Lo.size,vo.size,qr,Kr,Ar,Ur,g$1]),Lr=()=>{if(!Ye)return null;let R=Vi(Ye);if(!R||R.kind!=="item"||!R.key)return null;if(R.zone==="palette"){let Be=N.get(R.key);return Be?f(vl,{label:Be.label,subtitle:Be.type}):null}if(R.zone==="values"){let Be=be.find(ue=>ue.tokenId===R.key);if(!Be)return null;let _e=N.get(Be.fieldId)?.label??Be.fieldId,oe=`${I(Be.aggregation)}(${_e})`;return f($i,{label:_e,caption:oe})}let G=N.get(R.key)?.label??R.key,ce=Xt(R.key);return f($i,{label:G,caption:ce})};return g(Ne,{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:k}),f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.subtitle.default")})]}),g(ae,{direction:"row",spacing:1.5,alignItems:"center",children:[Vt&&g(e,{children:[f(vr,{size:"small",sx:{minWidth:200},children:g(Ht,{value:at,displayEmpty:true,onChange:R=>ro(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")}),St.map(R=>f("option",{value:R.id,sx:{fontSize:"0.75rem"},children:R.name},R.id))]})}),f(lt,{title:g$1("pivot.preset.save"),children:f(ne,{size:"small",onClick:go,"aria-label":g$1("pivot.preset.save"),sx:{width:28,height:28,p:0},children:f(wr,{size:15})})}),f(lt,{title:g$1("pivot.preset.delete"),children:f("span",{children:f(ne,{size:"small",onClick:Io,disabled:!at,"aria-label":g$1("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:f(ja,{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:B.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(Xa,{size:"small",checked:he,onChange:R=>Y(R.target.checked)})]})]})]}),f(Rt,{}),g(DndContext,{sensors:x,collisionDetection:closestCenter,onDragStart:wt,onDragEnd:ft,children:[f(Du,{isConfiguratorCollapsed:De,onToggleCollapse:()=>W(R=>!R),availableFields:gt,fieldMap:N,filterFields:le,columnFields:Oe,rowFields:Ge,valueFields:be,clearZone:Pe,removeFieldFromZone:Je,getFilterSelectionSummary:Xt,renderDimensionFilterSelect:Bt,renderAggregationSelect:At,getAggregationLabel:I}),f(hd,{children:f(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Lr()})})]}),f(Bu,{rows:B,fieldMap:N,rowFields:Ge,columnFields:Oe,valueFields:be,chartDimensionFieldId:je,chartPrimaryValueFieldId:it,chartSecondaryValueFieldId:dt,chartType:Ft,isCollapsed:Kt,onChartDimensionFieldIdChange:R=>Q(R),onChartPrimaryValueFieldIdChange:R=>fe(R),onChartSecondaryValueFieldIdChange:R=>ye(R),onChartTypeChange:R=>Ee(R),onToggleCollapse:()=>$e(R=>!R),getAggregationLabel:I}),f(kn,{title:g$1("pivot.table.sectionTitle"),subtitle:Ge.length>0?Ge.map(R=>N.get(R)?.label??R).join(" > "):g$1("pivot.table.dimensions"),collapsed:zt,onToggleCollapse:()=>Ke(R=>!R),expandAriaLabel:g$1("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Nn,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:w})}):f("div",{sx:{maxHeight:s},children:g("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[f("thead",{children:(Uo.length>0?Uo:[[]]).map((R,$)=>g("tr",{children:[$===0&&f("td",{rowSpan:Math.max(Uo.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=>N.get(G)?.label).join(" > "):g$1("pivot.table.dimensions")}),(R.length>0?R:Mo.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:ce=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${ce.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:g("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[G.expandable&&f(ne,{size:"small",onClick:()=>oo(G.key),sx:{width:22,height:22,p:0,ml:-0.2},children:G.expanded?f(zo,{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(Ki,{node:R,dataColumns:Yr,fieldMap:N,level:0,expandedKeys:It,onToggle:yt,getValue:($,G)=>{let ce=Er.get(G);return ce?nr($,ce):0}},R.key)),rr&&f(Ki,{node:rr,dataColumns:Yr,fieldMap:N,level:0,expandedKeys:It,onToggle:yt,getValue:(R,$)=>{let G=Er.get($);return G?nr(R,G):0}})]})]})})}),g(Et,{open:Re,onClose:()=>ve(false),maxWidth:"xs",fullWidth:true,children:[f("div",{className:"orb-dialog-title",children:g$1("pivot.preset.saveDialogTitle")}),f("div",{className:"orb-dialog-content",children:f(He,{autoFocus:true,fullWidth:true,margin:"dense",label:g$1("pivot.preset.nameLabel"),value:Fe,onChange:R=>nt(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),To());}})}),g("div",{className:"orb-dialog-actions",children:[f(Se,{onClick:()=>ve(false),children:g$1("common.cancel")}),f(Se,{variant:"contained",onClick:To,disabled:!Fe.trim(),children:g$1("common.save")})]})]})]})};var Wu=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},kl=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",$u=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",OL=({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(q=>q.id)),[t]),m=useMemo(()=>new Map(t.map(q=>[q.id,q])),[t]),[f,h]=useState(()=>io(o?.rows,u)),[p,v]=useState(()=>io(o?.columns,u)),[y,g]=useState(()=>io(o?.filters,u)),[x,b]=useState(()=>{let q=o?.values??[],Re=new Set,ve=[];return q.forEach(Fe=>{!u.has(Fe.fieldId)||Re.has(Fe.fieldId)||(Re.add(Fe.fieldId),d.current+=1,ve.push({tokenId:`v${d.current}`,fieldId:Fe.fieldId,aggregation:bo(Fe.aggregation,m.get(Fe.fieldId))}));}),ve}),[C,k]=useState(r),[w,P]=useState(n),[I,S]=useState(a),[N,M]=useState(()=>Wu(io(o?.rows,u),io(o?.columns,u),i?.dimensionFieldId)),[T,D]=useState(()=>{let q=(()=>{let Re=o?.values??[],ve=new Set,Fe=[];return Re.forEach(nt=>{!u.has(nt.fieldId)||ve.has(nt.fieldId)||(ve.add(nt.fieldId),Fe.push({tokenId:nt.fieldId,fieldId:nt.fieldId,aggregation:bo(nt.aggregation,m.get(nt.fieldId))}));}),Fe})();return kl(q,i?.primaryValueFieldId)}),[A,L]=useState(()=>{let q=(()=>{let ve=o?.values??[],Fe=new Set,nt=[];return ve.forEach(Ye=>{!u.has(Ye.fieldId)||Fe.has(Ye.fieldId)||(Fe.add(Ye.fieldId),nt.push({tokenId:Ye.fieldId,fieldId:Ye.fieldId,aggregation:bo(Ye.aggregation,m.get(Ye.fieldId))}));}),nt})(),Re=kl(q,i?.primaryValueFieldId);return $u(q,Re,i?.secondaryValueFieldId)}),[O,_]=useState(i?.chartType??"bar-vertical"),[F,X]=useState(s),[V,Z]=useState(l);useEffect(()=>{h(q=>{let Re=q.filter(ve=>u.has(ve));return dr(q,Re)?q:Re}),v(q=>{let Re=q.filter(ve=>u.has(ve));return dr(q,Re)?q:Re}),g(q=>{let Re=q.filter(ve=>u.has(ve));return dr(q,Re)?q:Re}),b(q=>{let Re=q.filter(ve=>u.has(ve.fieldId)).map(ve=>({...ve,aggregation:bo(ve.aggregation,m.get(ve.fieldId))}));return Wi(q,Re)?q:Re});},[m,u]),useEffect(()=>{M(q=>Wu(f,p,q));},[p,f]),useEffect(()=>{D(q=>kl(x,q));},[x]),useEffect(()=>{L(q=>$u(x,T,q));},[T,x]);let z=useCallback(q=>{h(io(q,u));},[u]),H=useCallback(q=>{v(io(q,u));},[u]),U=useCallback(q=>{g(io(q,u));},[u]),K=useCallback(q=>{b(Re=>{let ve=q??[],Fe=new Set,nt=[];return ve.forEach(Ye=>{if(!u.has(Ye.fieldId)||Fe.has(Ye.fieldId))return;Fe.add(Ye.fieldId);let xt=Re.find(It=>It.fieldId===Ye.fieldId);if(xt){nt.push({...xt,aggregation:bo(Ye.aggregation??xt.aggregation,m.get(Ye.fieldId))});return}d.current+=1,nt.push({tokenId:`v${d.current}`,fieldId:Ye.fieldId,aggregation:bo(Ye.aggregation,m.get(Ye.fieldId))});}),nt});},[m,u]),ge=useCallback(q=>{z(q.rows??[]),H(q.columns??[]),U(q.filters??[]),K(q.values??[]);},[H,U,z,K]),ie=useCallback(q=>{if(q==="rows")return h([]);if(q==="columns")return v([]);if(q==="filters")return g([]);b([]);},[]),pe=useCallback((q,Re)=>{if(q==="rows")return h(ve=>ve.filter(Fe=>Fe!==Re));if(q==="columns")return v(ve=>ve.filter(Fe=>Fe!==Re));if(q==="filters")return g(ve=>ve.filter(Fe=>Fe!==Re));b(ve=>ve.filter(Fe=>Fe.tokenId!==Re));},[]),xe=useCallback((q,Re)=>{b(ve=>ve.map(Fe=>Fe.tokenId===q?{...Fe,aggregation:bo(Re,m.get(Fe.fieldId))}:Fe));},[m]),We=useCallback((q,Re)=>{k(ve=>({...ve,[q]:Re}));},[]),we=useCallback(()=>{k({});},[]),se=useCallback(()=>{P(q=>!q);},[]),Ae=useCallback(()=>{S(q=>!q);},[]),Ie=useCallback(q=>{M(q);},[]),ke=useCallback(q=>{D(q);},[]),ze=useCallback(q=>{L(q);},[]),et=useCallback(()=>{X(q=>!q);},[]),rt=useCallback(()=>{Z(q=>!q);},[]);return {model:useMemo(()=>({rowFields:f,setRowFields:h,columnFields:p,setColumnFields:v,filterFields:y,setFilterFields:g,valueFields:x,setValueFields:b,filterSelections:C,setFilterSelections:k,showGrandTotal:w,setShowGrandTotal:P,isConfiguratorCollapsed:I,setIsConfiguratorCollapsed:S,chartDimensionFieldId:N,setChartDimensionFieldId:M,chartPrimaryValueFieldId:T,setChartPrimaryValueFieldId:D,chartSecondaryValueFieldId:A,setChartSecondaryValueFieldId:L,chartType:O,setChartType:_,isChartCollapsed:F,setIsChartCollapsed:X,isTableCollapsed:V,setIsTableCollapsed:Z}),[N,T,A,O,p,y,C,F,I,V,f,w,x]),actions:{setRows:z,setColumns:H,setFilters:U,setValues:K,setLayout:ge,clearZone:ie,removeFieldFromZone:pe,setAggregationForValue:xe,setFilterSelection:We,resetFilterSelections:we,toggleGrandTotal:se,toggleConfigurator:Ae,setChartDimension:Ie,setChartPrimaryValue:ke,setChartSecondaryValue:ze,setChartType:_,toggleChart:et,toggleTable:rt}}};var zL=({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=f=>{d(f),r?.(f);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:l,setNavigationOpen:u,toggleNavigationOpen:()=>u(!l)}};var Lv=t=>{let o=Number(t||0);return Number.isFinite(o)?o:0},$L=({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 y=p[r];m(y==null?"0":String(y));},applyEditorValue:p=>{if(s===void 0)return;let v=Lv(u),y=t.map(g=>g[o]===s?{...g,[r]:v}:g);p(y);}}};var Ov=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Gu=(t,o,r,n)=>{o?.(t),n&&r?.();},XL=({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=Ov,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:l=true,scanIntervalMs:d=600,confirmLabel:u="Use code",cancelLabel:m="Close",manualPlaceholder:f$1="Enter barcode manually",onDetected:h,onError:p,sx:v})=>{let y=jt__default.useRef(null),g$1=jt__default.useRef(null),x=jt__default.useRef(null),b$1=jt__default.useRef(null),[C,k]=jt__default.useState("idle"),[w,P]=jt__default.useState(""),[I,S]=jt__default.useState(null),[N,M]=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),y.current&&(y.current.srcObject=null);},[]),D=jt__default.useCallback(L=>{M(L),k("error"),p?.(L);},[p]);jt__default.useEffect(()=>{if(!t){T(),k("idle"),M(null),P("");return}let L=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){k("unsupported"),M("Camera access is not supported in this browser.");return}k("starting"),M(null);try{let _=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(L){_.getTracks().forEach(F=>F.stop());return}if(g$1.current=_,y.current&&(y.current.srcObject=_,await y.current.play()),!window.BarcodeDetector){k("unsupported"),M("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(!(!y.current||!b$1.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let X=(await b$1.current.detect(y.current)).find(Z=>Z.rawValue);if(!X?.rawValue)return;let V={rawValue:X.rawValue,format:X.format};S(V),T(),Gu(V,h,o,l);}catch(F){D(F instanceof Error?F.message:"Failed to detect barcode.");}},d);}catch(_){D(_ instanceof Error?_.message:"Unable to start camera.");}}})(),()=>{L=true,T();}},[l,i,a,o,h,t,D,d,T]);let A=()=>{let L=w.trim();if(!L)return;let O={rawValue:L,format:"manual"};S(O),Gu(O,h,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(ae,{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:y,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),f("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:f("div",{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:f("div",{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"var(--orb-ai-accent)",boxShadow:"0 0 18px color-mix(in oklch, var(--orb-ai-accent) 85%, transparent)"}})})}),g("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[f(Ct,{icon:f(Rd,{}),label:C==="ready"?"Camera ready":C==="starting"?"Starting camera":C==="unsupported"?"Preview only":C==="error"?"Scanner error":"Idle",size:"small",color:C==="error"?"error":"primary",variant:"filled"}),I?f(Ct,{icon:f(Xd,{}),label:`${I.format||"barcode"}: ${I.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),N?f(Zo,{severity:C==="unsupported"?"info":"warning",children:N}):null,s?g(ae,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[f(He,{fullWidth:true,label:"Barcode",placeholder:f$1,value:w,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 Fv={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)"},tO=({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:f$1=88,startAction:h,endAction:p,dragHandleProps:v,onClick:y,onSwipe:g$1,sx:x})=>{let[b$1,C]=useState(0),[k,w]=useState(false),P=useRef(null),I=useRef(0),S=useRef(0),N=!!(h||p),M=132,T=()=>{C(0),w(false),P.current=null,I.current=0,S.current=0;},D=F=>{(F==="start"?h:p)?.onTrigger?.(),g$1?.(F),T();},A=F=>{!N||F.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(P.current=F.pointerId,I.current=F.clientX,S.current=F.clientX,w(true),F.currentTarget.setPointerCapture(F.pointerId));},L=F=>{if(!k||P.current!==F.pointerId)return;S.current=F.clientX;let X=S.current-I.current,V=Math.max(-M,Math.min(M,X));C(V);},O=F=>{if(!k||P.current!==F.pointerId)return;let X=S.current-I.current;if(X>=f$1&&h){D("start");return}if(X<=-f$1&&p){D("end");return}Math.abs(X)<12&&y?.(),T();},_=(F,X)=>{if(!F)return null;let V=F.backgroundColor||Fv[F.tone||"default"];return f("div",{sx:{position:"absolute",top:0,bottom:0,[X]:0,width:M,px:2,display:"flex",alignItems:"center",justifyContent:X==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${V}, rgba(15,23,42,0.92))`},children:g(ae,{direction:"row",spacing:1,alignItems:"center",children:[F.icon,f(E,{sx:{fontWeight:700,fontSize:"0.95rem"},children:F.label})]})})};return g("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[_(h,"left"),_(p,"right"),f(Ne,{elevation:0,onPointerDown:A,onPointerMove:L,onPointerUp:O,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:y?"pointer":"default",opacity:m?.9:1},children:g(ae,{spacing:1.5,children:[g(ae,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[n?f("div",{sx:{mt:.25},children:n}):null,g("div",{sx:{flex:1,minWidth:0},children:[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(ne,{size:"small",children:f(Bd,{})})}):null]}),a.length>0?f(ae,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((F,X)=>f(Ct,{label:F,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},X))}):null,i.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(F=>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:F.label}),f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:F.value})]},F.id))}):null,l,s]})})]})};var da=({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}),cO=({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:f$1,onSubmit:h,onClose:p,sx:v})=>{let{t:y}=de(),[g$1,x]=useState(o),b=t??g$1,C=T=>{t===void 0&&x(T),f$1?.(T);},k=T=>{l&&b.length>=l||C(`${b}${T}`);},w=T=>{if(T==="00"){if(!b){C("0");return}k("00");return}k(T);},P=()=>{!i||b.includes(".")||C(b?`${b}.`:"0.");},I=()=>{if(s){if(b.startsWith("-")){C(b.slice(1));return}C(b?`-${b}`:"-");}},S=()=>{C(b.slice(0,-1));},N=()=>{C("");},M=()=>{h?.(b);};return f(Ne,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...v},children:g(ae,{spacing:2,children:[g(ae,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[g("div",{sx:{minWidth:0},children:[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(ne,{onClick:p,size:"small",children:f(Od,{})}):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(da,{label:T,onPress:()=>w(T)},T)),f(da,{label:s?"+/-":"00",onPress:s?I:()=>w("00")}),f(da,{label:"0",onPress:()=>w("0")}),f(da,{label:i?".":m?String(m):"DEL",onPress:i?P:S})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[f("div",{component:"button",type:"button",onClick:S,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:g(ae,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Md,{}),f(E,{sx:{fontWeight:700},children:m||"DEL"})]})}),f(da,{label:String(u||"CLR"),onPress:N,emphasis:"danger"}),f("div",{component:"button",type:"button",onClick:M,sx:T=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:T.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:g(ae,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Nd,{}),f(E,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};var Ku=({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(Vo,{...r})})};var Wv=(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);}},qu=({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,f$1=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(h=>{let p=h.id===o,v=h.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:h.disabled,onClick:()=>Wv(f$1,h,n),sx:{width:"100%",p:2,minHeight:m==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:h.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:g(ae,{spacing:1.5,sx:{height:"100%"},children:[g(ae,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[f("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:p?"var(--orb-on-primary)":"text.primary",background:p?v:"action.hover"},children:h.icon||f(E,{sx:{fontSize:"1rem",fontWeight:900},children:h.title.slice(0,1).toUpperCase()})}),h.badge!==void 0?f("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:p?"primary.main":"action.hover",color:p?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:h.badge}):null]}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:h.title}),h.caption?f(E,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:h.caption}):null,h.description?f(E,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:h.description}):null]})]})})},h.id)})})};var Zu=(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?Zu(n.children,o):[];return (a||i.length>0)&&r.push({...n,children:i.length>0?i:n.children}),r},[]):t,Uv=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children?.length&&(o.add(a.id),r(a.children));});};return r(t),o},Qu=({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:f$1}=de(),h=ao(),p=Ro("(orientation: portrait)"),v=Ro(h.breakpoints.down("md")),y=s==="auto"?p||v?"portrait":"landscape":s,g$1=i==="dark",x=useRouter(),b=usePathname(),[C,k]=useState(""),[w,P]=useState(new Set),I=useMemo(()=>Zu(a,C),[a,C]),S=useMemo(()=>C.trim()?Uv(I):w,[w,I,C]);useEffect(()=>{t&&P(new Set);},[t]);let N=L=>L.appurl||L.href||"",M=L=>{m?.(L);let O=N(L);if(O){if(O.startsWith("http://")||O.startsWith("https://")){window.open(O,"_blank");return}x.push(O);}},T=L=>{let O=!!L.children?.length;if(t&&O){o?.();return}if(O){P(_=>{let F=new Set(_);return F.has(L.id)?F.delete(L.id):F.add(L.id),F});return}M(L);},D=L=>{let O=u||b,_=N(L);return !!(_&&O===_)},A=(L,O=0)=>{let _=!!L.children?.length,F=S.has(L.id),X=D(L);return f("div",{sx:{pl:O===0?0:1.5},children:g(Ne,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:X?"primary.main":"divider",bgcolor:X?"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(Ka,{variant:"rounded",sx:{width:40,height:40,bgcolor:X?"primary.main":"action.hover",color:X?"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]}),_?f(rn,{sx:{transform:F?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):f(Za,{color:"action"})]}),_?f(on,{in:F,children:f("div",{sx:{px:1.25,pb:1.25},children:L.children?.map(V=>A(V,O+1))})}):null]})},L.id)};return t?f(Ne,{elevation:0,className:r,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflowY:"auto"},children:g(ae,{spacing:1,children:[f(ne,{onClick:o,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:f$1("navigation.expand"),children:f(oi,{})}),a.map(L=>f(ne,{onClick:()=>T(L),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:D(L)?"primary.main":"action.hover",color:D(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:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:g(ae,{spacing:1.25,sx:{flex:1,minHeight:0},children:[g(ae,{direction:"row",spacing:1,alignItems:"center",children:[f(He,{value:C,onChange:L=>k(L.target.value),placeholder:f$1("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:f(Yd,{fontSize:"small",color:"action"})}}),y==="landscape"&&!t?f(ne,{onClick:o,sx:{bgcolor:"action.hover"},children:f(Gd,{})}):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:f$1("navigation.noMatch")})}),d]})})};var ju=(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)},Kv=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}),qv=(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)},Xv=({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(ae,{spacing:1,children:[f(E,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:n.map(a=>g(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}`))})]})})},Yv=t=>{let{t:o}=de(),r=ao(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:u,fitContainer:m=false,fullWidth:f$1=false,maxHeight:h,loading:p=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g$1,rowKey:x,tableKey:b$1="default",graphReport:C,quickCreate:k,quickEdit:w,quickDelete:P,serviceUrl:I,orientation:S="auto",cardTitleField:N,cardSubtitleFields:M,toolbarSlot:T,emptyState:D,rowHeight:A="comfortable",cardActionSlot:L,renderCardFooter:O,onRowClick:_}=t,F=n||o("table.title.default"),X=Ro("(orientation: portrait)"),V=Ro(r.breakpoints.down("md")),Z=S==="auto"?X||V?"portrait":"landscape":S,{columns:z,filterText:H,setFilterText:U,visibleColumns:K,showSummary:ge,setShowSummary:ie,summaryColumns:pe,grouping:xe,setGrouping:We,expandedGroups:we,groupAnchorEl:se,setGroupAnchorEl:Ae,summaryAnchorEl:Ie,setSummaryAnchorEl:ke,anchorEl:ze,setAnchorEl:et,contextMenu:rt,sortedAndFilteredRows:at,summaryRow:q,visibleRows:Re,page:ve,setPage:Fe,rowsPerPage:nt,setRowsPerPage:Ye,totalDisplayCount:xt,setSelected:It,handleClick:Lt,toggleSummaryColumn:Nt,handleExport:te,handleCloseContextMenu:Ge,toggleColumnVisibility:Oe,toggleGroupExpand:le,handleExpandGroupRecursively:be,handleCollapseGroupRecursively:ee,handleLayoutLoad:he,handleVariantLoad:De,handleLayoutSave:je,effectiveAppId:it,currentLayoutData:dt,currentLayoutId:Ft,layoutIdToLoad:Kt,graphReportOpen:zt,handleOpenGraphReport:St,handleCloseGraphReport:Vt}=fn(t),ht=C?.enabled??false,Dt=ht&&(C?.interaction?.enabled??true),st=xi(),Ot=x||"id",qt=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]),Y=jt__default.useMemo(()=>({...qt,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)}),[qt,r]),W=jt__default.useMemo(()=>{let J=new Set(s);return at.filter(Le=>J.has(Le?.[Ot]))},[Ot,s,at]),Q=W.length===1?W[0]:null,fe=!!k?.enabled,ye=!!w?.enabled,Ee=!!P?.enabled,$e=k?.fields,Ke=k?.excludeFields||[],Ze=k?.initialValues||{},ut=w?.fields,gt=w?.excludeFields||[],Mt=w?.editableFields||[],bt=w?.nonEditableFields||[],B=w?.primaryKeys?.length?w.primaryKeys:[Ot],[j,me]=jt__default.useState(false),[Pe,Je]=jt__default.useState(false),[qe,wt]=jt__default.useState({}),[ft,mt]=jt__default.useState(false),[yt,oo]=jt__default.useState(false),[At,Xt]=jt__default.useState({}),[Bt,Gt]=jt__default.useState(false),[Wt,eo]=jt__default.useState(false),ro=p||Pe||yt||Wt,go=jt__default.useMemo(()=>{let J=[...z];if(Array.isArray($e)&&$e.length>0){let Le=new Set($e);J=J.filter(Qe=>Le.has(Qe.id));}if(Ke.length>0){let Le=new Set(Ke);J=J.filter(Qe=>!Le.has(Qe.id));}return J.filter(Le=>!!Le?.id)},[z,Ke,$e]),To=jt__default.useMemo(()=>{let J=[...z];if(Array.isArray(ut)&&ut.length>0){let Le=new Set(ut);J=J.filter(Qe=>Le.has(Qe.id));}if(gt.length>0){let Le=new Set(gt);J=J.filter(Qe=>!Le.has(Qe.id));}return J.filter(Le=>!!Le?.id)},[z,gt,ut]),Io=jt__default.useMemo(()=>new Set(B),[B]),rr=jt__default.useMemo(()=>new Set(Mt),[Mt]),vo=jt__default.useMemo(()=>new Set(bt),[bt]),Lo=jt__default.useCallback(J=>rr.size>0?rr.has(J):!(vo.has(J)||Io.has(J)),[rr,vo,Io]);jt__default.useEffect(()=>{!zt&&st.hasActiveFilters&&st.clearAll();},[st,zt]);let Ur=()=>{let J={};go.forEach(Le=>{J[Le.id]=Ze[Le.id]??"";}),wt(J),me(true);},Kr=(J,Le)=>{wt(Qe=>({...Qe,[J]:Le}));},Ar=async()=>{if(!k?.onSubmit){me(false);return}try{Je(!0),await k.onSubmit(qe),me(!1);}finally{Je(false);}},qr=()=>{if(!Q)return;let J={};To.forEach(Qe=>{J[Qe.id]=Q[Qe.id]??"";});let Le=w?.getInitialValues?{...J,...w.getInitialValues(Q)}:J;Xt(Le),mt(true);},Xr=(J,Le)=>{Xt(Qe=>({...Qe,[J]:Le}));},Mo=async()=>{if(Q){if(!w?.onSubmit){mt(false);return}try{oo(!0),await w.onSubmit(At,Q),mt(!1);}finally{oo(false);}}},Er=()=>{W.length!==0&&Gt(true);},Yr=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);}},Uo=at,{fieldMapping:nr}=pn({rows:Uo,config:{...C,title:C?.title||`${F} ${o("graph.reportTitle")}`}}),Nn=jt__default.useMemo(()=>Dt?st.applyRows(Uo,nr):Uo,[nr,st,Dt,Uo]),{model:Lr}=pn({rows:Nn,config:{...C,title:C?.title||`${F} ${o("graph.reportTitle")}`,fieldMapping:nr}}),R=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:he,targetLayoutId:Kt,activeLayoutId:Ft,serviceUrl:I??g$1?.serviceUrl}):null,G=z.filter(J=>K.includes(J.id)),ce=G.find(J=>J.id===N)||G[0],Be=M?.map(J=>G.find(Le=>Le.id===J)).filter(Boolean)||G.filter(J=>J.id!==ce?.id).slice(0,Z==="portrait"?2:3),ot=G.filter(J=>J.id!==ce?.id&&!Be.some(Le=>Le.id===J.id)),_e=[T,u].filter(Boolean),oe=g(e,{children:[f(cn,{groupAnchorEl:se,setGroupAnchorEl:Ae,grouping:xe,setGrouping:We,columns:z}),f(dn,{anchorEl:ze,setAnchorEl:et,columns:z,visibleColumns:K,toggleColumnVisibility:Oe}),f(mi,{anchorEl:Ie,setAnchorEl:ke,showSummary:ge,setShowSummary:ie,columns:z,summaryColumns:pe,toggleSummaryColumn:Nt}),f(gi,{contextMenu:rt,handleCloseContextMenu:Ge,columns:z,visibleColumns:K,toggleColumnVisibility:Oe})]}),ue=(J,Le,Qe)=>{let Me=s.includes(Le),Xe=Z==="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),Zr=tt(r.palette.divider,.22);return f(Ne,{elevation:0,onClick:()=>{Lt({},J),_?.(J);},sx:{p:A==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Me?tt(r.palette.primary.main,.38):Zr,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(ae,{spacing:1.25,children:[g(ae,{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:[ce?f(E,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:ju(ce,J)}):null,Be.length>0?f(ae,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Be.map(xo=>f(Ct,{label:`${xo.label}: ${qv(xo,J)}`,size:"small",variant:"outlined",sx:qt},`${Le}-${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}),Kv(ju(xo,J))]},`${Le}-${xo.id}-detail`))}):null,O?g(e,{children:[f(Rt,{}),f("div",{onClick:xo=>xo.stopPropagation(),children:O(J)})]}):null]})},Le)};return g("div",{sx:{width:f$1?"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(Ku,{...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:Z==="portrait"?"expanded":"comfortable"})}):null,g(Ne,{sx:{width:f$1?"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"}},...h?{height:h}: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(ci,{filterText:H,setFilterText:U,onRowsPerPageChange:Ye,rowsPerPage:nt,rowsPerPageOptions:v,page:ve,count:xt,onPageChange:Fe,actions:d,extraTools:_e,grouping:xe,setGroupAnchorEl:Ae,showSummary:ge,setShowSummary:ie,setAnchorEl:et,setSummaryAnchorEl:ke,handleExport:te,showCreateButton:fe,onOpenCreateDialog:Ur,showEditButton:ye,onOpenEditDialog:qr,editDisabled:W.length!==1,showDeleteButton:Ee,onOpenDeleteConfirm:Er,deleteDisabled:W.length===0,onLayoutSave:y||g$1?.variantService&&g$1?.appId?je:void 0,loading:p,layoutManager:$,onOpenGraphReport:ht?St:void 0})}):null,f("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:g(ae,{spacing:1.25,children:[Re.length===0&&!p?D||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,Le)=>{if(J.type==="group"){let Xe=we.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:()=>le(J.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[Xe?f(rn,{}):f(Za,{}),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(ae,{direction:"row",spacing:.5,children:[f(Ct,{size:"small",label:o("table.group.expandAll"),onClick:kt=>{kt.stopPropagation(),be(J.id);},sx:Y}),f(Ct,{size:"small",label:o("table.group.collapseAll"),onClick:kt=>{kt.stopPropagation(),ee(J.id);},sx:Y})]}):null]})},J.id)}let Qe=J.data||J,Me=J.id||Qe[Ot]||Le;return ue(Qe,Me,Le)}),ge?f(Xv,{summaryRow:q,visibleColumns:K,columns:z}):null,p?f(E,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:o("common.loading")}):null]})})]}),fe?g(Et,{open:j,onClose:()=>!Pe&&me(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:k?.title||o("quickCreate.createWithTitle",{title:F})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[go.map(J=>{let Le=J.type==="number"||J.numeric?"number":J.type==="date"?"date":"text";return f(He,{label:J.label||J.id,value:qe[J.id]??"",onChange:Qe=>Kr(J.id,Qe.target.value),type:Le,fullWidth:true,InputLabelProps:{shrink:Le==="date"?true:void 0}},`quick-create-${J.id}`)}),k?.description?f(Zo,{severity:"info",children:k.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Se,{onClick:()=>me(false),disabled:Pe,children:k?.cancelLabel||o("common.cancel")}),f(Se,{onClick:Ar,variant:"contained",disabled:Pe,children:k?.submitLabel||o("common.save")})]})]}):null,ye?g(Et,{open:ft,onClose:()=>!yt&&mt(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:w?.title||o("quickEdit.editWithTitle",{title:F})}),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 Le=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:Le,disabled:!Lo(J.id),fullWidth:true,InputLabelProps:{shrink:Le==="date"?true:void 0}},`quick-edit-${J.id}`)}),w?.description?f(Zo,{severity:"info",children:w.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Se,{onClick:()=>mt(false),disabled:yt,children:w?.cancelLabel||o("common.cancel")}),f(Se,{onClick:Mo,variant:"contained",disabled:yt||!Q,children:w?.submitLabel||o("common.save")})]})]}):null,Ee?f(qn,{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:Yr}):null,oe,ht?f(yi,{open:zt,onClose:Vt,model:Lr,aiAssistant:C?.aiAssistant,interaction:Dt?{enabled:true,filters:st.filters,fieldMapping:nr,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(Yv,{appId:it||"graph-report-internal",title:o("graph.dataBody"),columns:R,rows:Lr.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var rF=({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:f$1,contentSx:h,containerSx:p,user:v,onSearch:y,onSearchAdd:g$1,defaultNavigationOpen:x,navOpen:b,onNavOpenChange:C,onWorkloadSelect:k,locale:w="en",localeLabel:P,localeOptions:I,onLocaleChange:S,onUserSetting:N,onUserLogout:M,userMenuItems:T,leftHeaderSlot:D,rightHeaderSlot:A})=>{let L="orbcafe:page-layout-mode",[O,_]=useState("system"),[F,X]=useState("light"),[V,Z]=useState(false),[z,H]=useState(false),U=O==="system"?z?F:"light":O;useEffect(()=>{Z(true);},[]),useEffect(()=>{try{let rt=window.localStorage.getItem(L);(rt==="light"||rt==="dark"||rt==="system")&&_(rt);}catch{}H(true);let ze=window.matchMedia("(prefers-color-scheme: dark)"),et=()=>{X(ze.matches?"dark":"light");};return et(),ze.addEventListener("change",et),()=>ze.removeEventListener("change",et)},[]),useEffect(()=>{if(z)try{window.localStorage.setItem(L,O);}catch{}},[z,O]),useEffect(()=>{U==="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");},[U]);let K=Ro("(orientation: portrait)"),ge=Ro("(max-width: 899.95px)"),ie=l==="auto"?!V||K||ge?"portrait":"landscape":l,[pe,xe]=useState({landscape:x??true,portrait:false}),We=pe[ie],we=b??We,se=ze=>{b===void 0&&xe(et=>({...et,[ie]:ze})),C?.(ze);},Ae=g(ae,{direction:"row",spacing:1,alignItems:"center",children:[!V||i&&ie==="portrait"?f(ne,{onClick:()=>se(!we),sx:{bgcolor:"action.hover"},children:f(oi,{})}):null,D]}),Ie=g(ae,{direction:"row",spacing:1,alignItems:"center",children:[m,A]}),ke=f(Qu,{collapsed:ie==="landscape"?!we:false,onToggle:()=>se(!we),menuData:r,orientation:ie,colorMode:U,maxHeight:ie==="landscape"?900:void 0});return f(An,{mode:O,children:f(Ha,{locale:w,children:g("div",{sx:[ze=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:ze.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":ze.palette.background.default}),...Array.isArray(p)?p:[p]],children:[f(Fi,{appTitle:t,logo:d===void 0?null:d,mode:O,onToggleMode:()=>_(ze=>ze==="system"?"dark":ze==="dark"?"light":"system"),locale:w,localeLabel:P,localeOptions:I,onLocaleChange:S,user:v,onUserSetting:N,onUserLogout:M,userMenuItems:T,onSearch:y,onSearchAdd:g$1,leftSlot:Ae,rightSlot:Ie}),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&&ie==="landscape"?f("div",{sx:{p:1.5,pr:0,flexShrink:0},children:ke}):null,!V||i&&ie==="portrait"?f(yd,{open:we,onClose:()=>se(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:ke}):null,f("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...h},children:g(ae,{spacing:1.5,children:[s&&n.length>0?f(qu,{items:n,selectedId:a,orientation:ie,onItemSelect:k}):null,f(Ne,{elevation:0,sx:{flex:1,minHeight:ie==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:"color-mix(in oklch, var(--orb-canvas) 72%, transparent)",backdropFilter:"blur(12px)",color:"text.primary"},children:o})]})})]}),ie==="portrait"&&f$1?g(e,{children:[f(Rt,{}),f("div",{sx:{p:1.5},children:f$1})]}):null]})})})};var Ju=Zv(()=>import('./COrbCanvas-4PZFJUYO.mjs').then(t=>t.COrbCanvas),{ssr:false,loading:()=>f("div",{className:"h-full w-full bg-transparent"})});function Tl({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(Ju,{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(Ju,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var lF=Tl;var tm=createContext(null);function ry(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 ny({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[f$1,h]=useState(false),[p,v]=useState(false),y=useRef(null),g$1=useRef(false),x=useRef(false),b=useCallback(()=>{x.current=false,h(false);},[]),{isRecording:C,startRecording:k,stopRecording:w}=Cn({wsUrl:d,silenceThresholdMs:u,minVolumeRms:m,onTextUpdate:N=>{r?.(N);},onComplete:async N=>{try{N.trim()&&(v(!0),await o(N.trim()));}catch(M){let T=M instanceof Error?M.message:"Failed to process voice command";n?.(T);}finally{v(!1),b();}},onError:N=>{n?.(N),v(!1),g$1.current||b();}}),P=useCallback(async()=>{x.current=false,await k();},[k]),I=useCallback(()=>{w();},[w]);useEffect(()=>{if(i)return;let N=T=>{T.isComposing||(T.code==="Space"||T.key===" ")&&(g$1.current||T.repeat||s&&ry(document.activeElement)||(g$1.current=true,T.preventDefault(),y.current=setTimeout(()=>{x.current=true,h(true),k();},a)));},M=T=>{(T.code==="Space"||T.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),g$1.current=false,x.current&&(T.preventDefault(),h(false),w()));};return window.addEventListener("keydown",N),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",M),y.current&&(clearTimeout(y.current),y.current=null);}},[i,s,a,k,w]);let S=useMemo(()=>({isRecording:C,isHotkeyRecording:f$1,isSubmitting:p,startRecording:P,stopRecording:I}),[f$1,C,p,P,I]);return g(tm.Provider,{value:S,children:[l?f(Tl,{isRecording:f$1}):null,t]})}function ay(){let t=useContext(tm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var gF=ny,fF=ay;function pt(...t){return twMerge(clsx(t))}var dy=({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(Ta,{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(Oo,{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})]})},om=dy;var fy=({content:t,language:o="text",isStreaming:r=false,className:n=""})=>{let a=yo(),[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(Ko,{size:14,className:"text-[var(--orb-status-success)]"}):f(hc,{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})})]})},rm=fy;var nm="orb-html-demo",Cy=160,xy=560,Sy=220,Rl=`<script>(function(){var post=function(){var height=Math.ceil(document.documentElement.scrollHeight);parent.postMessage({source:${JSON.stringify(nm)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);new MutationObserver(post).observe(document.documentElement,{subtree:true,childList:true,attributes:true,characterData:true});post()})()</script>`,wy="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",ky=t=>/<html[\s>]/i.test(t),Py=t=>{let o=t.trim();return ky(o)?/<\/body>/i.test(o)?o.replace(/<\/body>/i,`${Rl}</body>`):`${o}${Rl}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${wy}</style></head><body>${o}${Rl}</body></html>`},Ty=({content:t,title:o="Interactive HTML"})=>{let r=useRef(null),[n,a]=useState(Sy),i=useMemo(()=>Py(t),[t]);return useEffect(()=>{let s=l=>{if(l.source!==r.current?.contentWindow)return;let d=l.data;!d||d.source!==nm||typeof d.height!="number"||!Number.isFinite(d.height)||a(Math.min(xy,Math.max(Cy,Math.ceil(d.height))));};return window.addEventListener("message",s),()=>window.removeEventListener("message",s)},[]),g("figure",{className:"orb-html-demo-frame",children:[f("figcaption",{className:"orb-html-demo-caption",children:o}),f("iframe",{ref:r,className:"orb-html-demo",title:o,sandbox:"allow-scripts",srcDoc:i,style:{height:n}})]})},am=Ty;var Ry=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"},Dy=({content:t,isLoading:o,className:r="",style:n})=>{let a=useRef(null),[i,s]=useState(false),[l,d]=useState(null),u=yo();return useEffect(()=>{let m=false,f=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{sm.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:y,bindFunctions:g}=await sm.render(p,v);!m&&a.current&&(a.current.innerHTML=y,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);}}},h=setTimeout(()=>{f();},100);return ()=>{m=true,clearTimeout(h);}},[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:Ry(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":""}`})]})},lm=Dy;var Ny=({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,f$1]=useState(false),[h,p]=useState(false),v=async()=>{if(l){p(true);try{await l();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}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(Ca,{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:h,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[f(Ec,{className:`w-3.5 h-3.5 mr-1.5 ${h?"animate-spin":""}`}),h?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&g("button",{onClick:()=>f$1(!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(Oo,{className:"w-3.5 h-3.5 mr-1"}):f(Fo,{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(Yt,{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})})]})},Qi=Ny;var Ay=({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="",...f$1})=>{let h=()=>{switch(n){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-[var(--orb-primary)]",bgColor:"bg-[var(--orb-p50)]"};case "error":return {borderLeftColor:"border-l-[var(--orb-status-error)]",iconColor:"text-[var(--orb-status-error)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-[var(--orb-status-success)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-[var(--orb-status-warning)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-warning)_8%,transparent)]"}}},p=()=>{switch(n){case "info":return f(Pa,{className:"w-5 h-5"});case "error":return f(Ea,{className:"w-5 h-5"});case "success":return f(xa,{className:"w-5 h-5"});default:return f(mc,{className:"w-5 h-5"})}},v=h();return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${m}`,...f$1,children:[g("div",{className:`flex p-4 border-l-4 ${v.borderLeftColor} ${v.bgColor}`,children:[f("div",{className:`flex-shrink-0 mr-3 ${v.iconColor}`,children:i||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((y,g$1)=>g("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[f("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),f("span",{children:y})]},g$1))})]}),s&&l&&f("button",{onClick:l,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:f(Yt,{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"})})]})},ji=Ay;var Ey=({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,f$1]=useState(false),[h,p]=useState(""),[v,y]=useState(false),g$1=useMemo(()=>h.trim()?r.filter(C=>C.toLowerCase().includes(h.toLowerCase())):r,[r,h]),x=useMemo(()=>m?g$1:g$1.slice(0,a),[g$1,m,a]),b=C=>{n?.(C);};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(Ta,{className:"w-5 h-5"})}),g("div",{className:"flex flex-col",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),o&&f("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:o})]})]}),g("div",{className:"flex items-center space-x-1",children:[r.length>3&&f("button",{onClick:()=>y(!v),className:`p-1.5 rounded-md transition-colors ${v?"bg-[var(--orb-p100)] text-[var(--orb-status-primary)]":"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]"}`,title:v?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:f(Bo,{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(Yt,{className:"w-4 h-4"})})]})]}),v&&f("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:g("div",{className:"relative",children:[f("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:h,onChange:C=>p(C.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] focus:ring-1 focus:ring-[var(--orb-primary)] focus:border-[var(--orb-primary)] outline-none transition-shadow",autoFocus:true}),f(Bo,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),g("div",{className:"p-2",children:[f("ul",{className:"space-y-1",children:x.map((C,k)=>f("li",{children:g("button",{onClick:()=>b(C),className:"w-full text-left px-3 py-2 rounded-md text-sm text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] hover:text-[var(--orb-status-primary)] transition-colors group flex items-start justify-between",children:[f("span",{children:C}),f(Fo,{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:()=>f$1(!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&&h&&f("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},Ji=Ey;var Ly=({title:t,content:o,toolName:r,parameters:n,result:a,status:i,duration:s,icon:l,closable:d=false,onClose:u,onAction:m,actionText:f$1,className:h="",...p})=>{let[v,y]=useState(false),[g$1,x]=useState(true),b=()=>{switch(i){case "pending":return {iconColor:"text-[var(--orb-primary)]",badgeBg:"bg-[var(--orb-p50)]",badgeText:"text-[var(--orb-status-primary)]",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-[var(--orb-status-error)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-error)_10%,transparent)]",badgeText:"text-[var(--orb-status-error)]",label:"\u5931\u8D25"};default:return {iconColor:"text-[var(--orb-status-success)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]",badgeText:"text-[var(--orb-status-success)]",label:"\u6210\u529F"}}},C=()=>{switch(i){case "pending":return f(Tc,{className:"w-5 h-5 animate-spin"});case "error":return f(Ea,{className:"w-5 h-5"});default:return f(xa,{className:"w-5 h-5"})}},k=I=>I?I<1e3?`${I}ms`:`${(I/1e3).toFixed(2)}s`:"",w=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 ${h}`,...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 ${w.iconColor}`,children:l||C()}),g("div",{children:[g("div",{className:"flex items-center space-x-2",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:P}),f("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${w.badgeBg} ${w.badgeText}`,children:w.label})]}),r&&t&&g("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[f(Fn,{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(bc,{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(Yt,{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:()=>y(!v),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[v?f(Oo,{className:"w-3.5 h-3.5 mr-1"}):f(Fo,{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(Oo,{className:"w-3.5 h-3.5 mr-1"}):f(Fo,{className:"w-3.5 h-3.5 mr-1"}),f(Fn,{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:f$1||"\u6267\u884C\u64CD\u4F5C"})})]})]})},es=Ly;var Fy=({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]})})},ts=Fy;var By=({title:t,subtitle:o,data:r,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return f(Rs,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return f(Pc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return f(Ac,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return f(uc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return f(wc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return f(Sc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return f(zc,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return f(On,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return f(Mc,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return f(Rs,{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(Cp,{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(hi,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return f(xp,{data:r,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return f(Sp,{data:r});case "fishbone-chart-card":return f(wp,{branches:r,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return f(kp,{data:r,height:a.height});case "google-map-card":return f(Pp,{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(Tp,{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)})]})})]})]})},os=By;var ss=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],Hy={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},as=480,Pn=214,_t={top:18,right:16,bottom:38,left:30},Jt=t=>typeof t=="number"&&Number.isFinite(t)?t:0,gm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Go=(t,o)=>`${t.id||t.label}-${o}`,fm=(t,o=13)=>t.length>o?`${t.slice(0,Math.max(1,o-1))}\u2026`:t,is=(t,o,r)=>Math.min(r,Math.max(o,t)),ur=(t,o,r)=>t.color??r[o%r.length],mr=(t,o)=>o?{onMouseEnter:()=>o.onItemHoverStart?.(t),onMouseMove:()=>o.onItemHoverStart?.(t),onMouseLeave:()=>o.onItemHoverEnd?.(t),onContextMenu:r=>o.onItemContextMenu?.(r,t)}:{},hm=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}},zy=(t,o,r)=>{let n=as-_t.left-_t.right,a=Pn-_t.top-_t.bottom,{max:i,range:s}=hm(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}},ns=(t,o,r,n)=>{let a=(n-90)*Math.PI/180;return {x:t+r*Math.cos(a),y:o+r*Math.sin(a)}},Vy=(t,o,r,n,a,i)=>{let s=ns(t,o,r,i),l=ns(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=ns(t,o,n,i),m=ns(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`},Wy=({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})]}),$y=()=>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"})]}),Al=({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());}}:{},...mr(t,r),style:{cursor:o||r?"pointer":"default"}}},_y=({loading:t,error:o,hasData:r,emptyState:n,children:a})=>t?f($y,{}):o?f("div",{className:"orb-metric-error",role:"alert",children:o}):r?f(e,{children:a}):f(Wy,{children:n??"No data for the current selection."}),Gy=({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=`${is(Math.abs(u)/s*100,0,100)}%`,f$1=o===l.id,h=g(e,{children:[f("span",{className:"orb-metric-bar-label",title:l.label,children:l.label}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:`orb-metric-bar-fill${f$1?" is-active":""}`,style:{width:m,backgroundColor:ur(l,d,i)}})}),f("span",{className:"orb-metric-bar-value",children:a(u)})]});return r?f("button",{type:"button",className:`orb-metric-bar-row${f$1?" is-active":""}`,onClick:()=>r(l),title:`${l.label}: ${a(u)}`,"aria-pressed":f$1,...mr(l,n),children:h},Go(l,d)):f("div",{className:`orb-metric-bar-row${f$1?" is-active":""}`,role:"listitem",...mr(l,n),children:h},Go(l,d))})})},Uy=({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=is(u/s*100,0,100),f$1=o===l.id,h=g(e,{children:[g("span",{className:"orb-metric-progress-heading",children:[f("span",{title:l.label,children:l.label}),f("strong",{children:a(u)})]}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:"orb-metric-bar-fill",style:{width:`${m}%`,backgroundColor:ur(l,d,i)}})})]});return r?f("button",{type:"button",className:`orb-metric-progress-row${f$1?" is-active":""}`,onClick:()=>r(l),"aria-pressed":f$1,...mr(l,n),children:h},Go(l,d)):f("div",{className:`orb-metric-progress-row${f$1?" is-active":""}`,role:"listitem",...mr(l,n),children:h},Go(l,d))})})},Ky=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:l,ariaLabel:d})=>{let{min:u,max:m,range:f$1}=hm(o),h=as-_t.left-_t.right,p=Pn-_t.top-_t.bottom,v=_t.top+m/f$1*p,y=Math.max(1,Math.ceil(o.length/6)),g$1=o.map((C,k)=>zy(k,C,o)),x=g$1.map(C=>`${C.x},${C.y}`).join(" "),b=Math.max(...o.map(C=>Math.max(Jt(C.secondaryValue),0)),1);return f("div",{className:"orb-metric-svg-wrap",children:g("svg",{className:"orb-metric-svg",viewBox:`0 0 ${as} ${Pn}`,role:"img","aria-label":d,children:[f("line",{className:"orb-metric-axis",x1:_t.left,y1:v,x2:as-_t.right,y2:v}),f("line",{className:"orb-metric-grid",x1:_t.left,y1:_t.top,x2:_t.left,y2:Pn-_t.bottom}),t==="column"&&o.map((C,k)=>{let w=g$1[k],P=Jt(C.value),I=Math.max(Math.abs(w.y-v),P===0?2:0),S=w.x-Math.min(18,h/Math.max(o.length*2,1)),N=Math.min(36,Math.max(10,h/Math.max(o.length*1.8,1))),M=r===C.id;return g("g",{...Al({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(P)}`,children:[f("rect",{className:`orb-metric-column${M?" is-active":""}`,x:S,y:Math.min(w.y,v),width:N,height:I,rx:4,fill:ur(C,k,l)}),g("title",{children:[C.label,": ",i(P)]}),(k%y===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:w.x,y:Pn-14,textAnchor:"middle",children:fm(C.label)})]},Go(C,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((C,k)=>{let w=g$1[k],P=r===C.id,I=t==="bubble"?7+Math.max(Jt(C.secondaryValue),0)/b*12:t==="scatter"?5:4;return g("g",{...Al({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(Jt(C.value))}`,children:[t==="line"&&f("circle",{className:`orb-metric-point${P?" is-active":""}`,cx:w.x,cy:w.y,r:P?6:4,fill:ur(C,k,l)}),t!=="line"&&f("circle",{className:`orb-metric-point${P?" is-active":""}`,cx:w.x,cy:w.y,r:I,fill:ur(C,k,l),opacity:t==="bubble"?.82:.9}),g("title",{children:[C.label,": ",i(Jt(C.value)),t==="bubble"&&C.secondaryValue!==void 0?` \xB7 Size: ${s(Jt(C.secondaryValue))}`:""]}),(k%y===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:w.x,y:Math.max(_t.top+8,w.y-I-7),textAnchor:"middle",children:fm(C.label)})]},Go(C,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:Pn-_t.bottom+14,children:i(u)})]})})},qy=({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,f$1=92,h=0;return g("div",{className:"orb-metric-circular",children:[g("svg",{className:"orb-metric-donut",viewBox:"0 0 184 184",role:"img","aria-label":l,children:[d.map((p,v)=>{let y=p.value/u*360,g$1=h;h+=y;let x=r===p.id,b=y>=359.9?void 0:Vy(f$1,f$1,m,t==="donut"?46:0,g$1,g$1+y),C=Al({item:p,onItemClick:n,interactions:a});return b?f("path",{className:`orb-metric-slice${x?" is-active":""}`,d:b,fill:ur(p,v,s),...C,children:g("title",{children:[p.label,": ",i(p.value)," (",(p.value/u*100).toFixed(1),"%)"]})},Go(p,v)):f("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:f$1,cy:f$1,r:t==="donut"?60:m,fill:t==="donut"?"none":ur(p,v,s),stroke:t==="donut"?ur(p,v,s):void 0,strokeWidth:28,...C,children:g("title",{children:[p.label,": ",i(p.value)," (100%)"]})},Go(p,v))}),t==="donut"&&f("circle",{cx:f$1,cy:f$1,r:44,fill:"var(--orb-surface)"}),t==="donut"&&f("text",{className:"orb-metric-donut-total",x:f$1,y:f$1+5,textAnchor:"middle",children:i(u)})]}),f("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((p,v)=>{let y=r===p.id;return g("button",{type:"button",className:`orb-metric-legend-item${y?" is-active":""}`,onClick:()=>n?.(p),disabled:!n,title:p.label,...mr(p,a),children:[f("span",{className:"orb-metric-legend-dot",style:{backgroundColor:ur(p,v,s)}}),f("span",{className:"orb-metric-legend-label",children:p.label}),g("strong",{children:[(p.value/u*100).toFixed(0),"%"]})]},Go(p,v))})})]})},Xy=({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,...mr(s,n),children:d},Go(s,l)):f("div",{className:`orb-metric-list-row${o===s.id?" is-active":""}`,role:"listitem",...mr(s,n),children:d},Go(s,l))})}),ls=({title:t,subtitle:o,data:r=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:l,valueFormatter:d=gm,secondaryValueFormatter:u=gm,valueLabel:m,secondaryValueLabel:f$1,emptyState:h,loading:p=false,error:v,maxItems:y=8,showChartTypeControl:g$1=true,showDataDetails:x=true,dataRevealDelayMs:b=1e3,chartTypeOptions:C,chartTypeLabels:k,footer:w,ariaLabel:P,className:I,style:S,sx:N})=>{let M=Ms(),T=useRef(null),D=useRef(null),[A,L]=useState(n),[O,_]=useState(false),[F,X]=useState(null),[V,Z]=useState(null);useEffect(()=>L(n),[n]);let z=useCallback(()=>{D.current!==null&&(window.clearTimeout(D.current),D.current=null);},[]);useEffect(()=>z,[z]),useEffect(()=>{if(!V)return;let q=Re=>{let ve=Re.target;ve instanceof HTMLElement&&ve.closest(".orb-metric-context-menu")||Z(null);};return document.addEventListener("pointerdown",q),()=>document.removeEventListener("pointerdown",q)},[V]);let H=A,U=useMemo(()=>[M.chart1,M.chart2,M.chart3,M.chart4,M.chart5,M.chart6],[M]),K=useMemo(()=>O?r:r.slice(0,Math.max(1,y)),[r,y,O]),ge=Math.max(0,r.length-K.length),ie=K.some(q=>Jt(q.value)>0),pe=K.length>0&&(H!=="pie"&&H!=="donut"?true:ie),xe=(C??[H,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((q,Re,ve)=>ss.includes(q)&&ve.indexOf(q)===Re),We={...Hy,...k},we=K[0],se=P??`${t} ${We[H]} chart`,Ae=q=>{L(q),a?.(q);},Ie=useCallback((q,Re)=>{X({item:q,source:Re}),Z(null),s?.(q,Re);},[s]),ke=useCallback(q=>{z(),!(!x||V)&&(D.current=window.setTimeout(()=>{Ie(q,"hover"),D.current=null;},Math.max(0,b)));},[z,V,b,Ie,x]),ze=useCallback(()=>{z();},[z]),et=useCallback((q,Re)=>{if(!x)return;q.preventDefault(),z();let ve=T.current?.getBoundingClientRect(),Fe=ve?is(q.clientX-ve.left,8,Math.max(8,ve.width-164)):8,nt=ve?is(q.clientY-ve.top,8,Math.max(8,ve.height-72)):8;Z({item:Re,left:Fe,top:nt});},[z,x]),rt=x?{onItemHoverStart:ke,onItemHoverEnd:ze,onItemContextMenu:et}:void 0,at=H==="metric"?g("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>we&&i?.(we),onKeyDown:q=>{we&&i&&(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),i(we));},"aria-label":se,...we?mr(we,rt):{},children:[f("span",{className:"orb-metric-kpi-label",children:we?.label??m??"Value"}),f("strong",{children:we?d(Jt(we.value)):"\u2014"}),we?.secondaryValue!==void 0&&g("span",{className:"orb-metric-kpi-secondary",children:[f$1??"Compared with"," \xB7 ",u(Jt(we.secondaryValue))]})]}):H==="progress"?f(Uy,{data:K,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,colors:U}):H==="bar"?f(Gy,{data:K,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,colors:U}):H==="list"?f(Xy,{data:K,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,secondaryValueFormatter:u}):H==="pie"||H==="donut"?f(qy,{type:H,data:K,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,colors:U,ariaLabel:se}):f(Ky,{type:H,data:K,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,secondaryValueFormatter:u,colors:U,ariaLabel:se});return g("div",{ref:T,className:"orb-metric-chart-shell",onMouseLeave:()=>{z(),F?.source==="hover"&&X(null);},children:[g(Ne,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${I??""}`,style:S,sx:N,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:H,options:xe.map(q=>({value:q,label:We[q]})),onChange:q=>Ae(q.target.value),minWidth:108,fullWidth:false,size:"small"})]}),g("div",{className:"orb-metric-chart-body",children:[f(_y,{loading:p,error:v,hasData:pe,emptyState:h,children:at}),ge>0&&!p&&!v&&f("button",{type:"button",className:"orb-metric-more",onClick:()=>_(q=>!q),children:O?"Show fewer":`Show all ${r.length}`})]}),w&&f("div",{className:"orb-metric-chart-footer",children:w})]}),V&&g("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:z,onKeyDown:q=>{q.key==="Escape"&&Z(null);},style:{left:V.left,top:V.top},onPointerDown:q=>q.stopPropagation(),children:[f("div",{className:"orb-metric-context-label",children:V.item.label}),f("button",{type:"button",role:"menuitem",onClick:q=>{q.preventDefault(),q.stopPropagation(),Ie(V.item,"contextmenu");},children:"Show data"})]}),F&&g("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${F.item.label} data details`,onPointerDown:q=>q.stopPropagation(),children:[g("div",{className:"orb-metric-data-details-header",children:[f("strong",{children:F.item.label}),f("button",{type:"button","aria-label":"Close data details",onClick:()=>X(null),children:"\xD7"})]}),g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:m??"Value"}),f("strong",{children:d(Jt(F.item.value))})]}),F.item.secondaryValue!==void 0&&g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:f$1??"Secondary value"}),f("strong",{children:u(Jt(F.item.secondaryValue))})]}),f("span",{className:"orb-metric-data-details-hint",children:F.source==="hover"?`Shown after ${Math.max(0,b)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};ls.displayName="CMetricChartCard";var Yy=({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(ls,{...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})})},cs=Yy;var Zy=({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)})})})]}),ds=Zy;var Qy=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}:{}}]}):[],ps=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=ss.includes(o.chartType)?o.chartType:"bar";return {...o,type:"metric-chart-card",chartType:r,data:Qy(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 nC=({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:y=>d.current?.onCardEvent?.(y)}:void 0,[u]),f$1=useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(y,g)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(g.trim())}"></div>`):"",[t]),h=(y,g,x,b,C)=>{m?.onCardEvent?.({messageId:s,cardType:y,action:g,title:x,payload:b,rawData:C});},p=(y,g,x,b,C,k)=>{if(!(!C&&!m?.onCardEvent))return (...w)=>{let P=C?.(...w),I=k?k(...w):void 0;return h(y,g,x,I,b),P}},v=useMemo(()=>({div(y){let{"data-component":g,"data-think-content":x,...b}=y;return g==="thinkbox"&&x?f(om,{content:decodeURIComponent(x),theme:o,size:r,defaultExpanded:false}):f("div",{...b})},table({children:y}){return f("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:f("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:y})})},thead({children:y}){return f("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:y})},tbody({children:y}){return f("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:y})},tr({children:y}){return f("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:y})},th({children:y,align:g}){return f("th",{className:`px-3 py-2 font-semibold text-[var(--orb-fg)] ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:y})},td({children:y,align:g}){return f("td",{className:`px-3 py-2 text-[var(--orb-fg)] align-top ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:y})},code({className:y,children:g,...x}){let b=/language-([\w-]+)/.exec(y||""),C=b?b[1]:"",k=String(g);if(!b&&!k.includes(`
|
|
17
|
-
`))return f("code",{children:g});let P=k.replace(/\n$/,"");if(i&&C==="mermaid")return f(lm,{content:P});if(C==="html"||C==="htm")return f(am,{content:P});if(C==="json"){let I=ps(P);if(I)switch(I.type){case "table":return f(ts,{data:I.data});case "metric-chart-card":return f(cs,{...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(os,{...I});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(ds,{...I});case "error-card":{let S=I;return f(Qi,{...S,onClose:p("error-card","close",S.title,S,S.onClose),onRetry:p("error-card","retry",S.title,S,S.onRetry)})}case "warning-card":{let S=I,N=S.onConfirm?p("warning-card","confirm",S.title,S,S.onConfirm):S.actionText&&m?.onCardEvent?p("warning-card","confirm",S.title,S):void 0;return f(ji,{...S,onClose:p("warning-card","close",S.title,S,S.onClose),onConfirm:N})}case "suggestions-card":{let S=I;return f(Ji,{...S,onClose:p("suggestions-card","close",S.title,S,S.onClose),onSuggestionClick:p("suggestions-card","suggestion-click",S.title,S,S.onSuggestionClick,N=>({suggestion:N}))})}case "tool-result-card":{let S=I;return f(es,{...S,onClose:p("tool-result-card","close",S.title,S,S.onClose),onAction:p("tool-result-card","action",S.title,S,S.onAction)})}}}return a?f(rm,{content:P,language:C,className:"not-prose"}):f("code",{className:y,...x,children:g})}}),[o,r,i,a,m,s]);return f("div",{className:pt("markdown-body max-w-none",n),children:f(Jy,{remarkPlugins:[eC,tC],rehypePlugins:[oC,rC],components:v,children:f$1})})},Tn=nC;var aC=({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,f)=>{if(!(!m&&!r?.onCardEvent))return (...h)=>{let p=m?.(...h),v=f?f(...h):void 0;return n(s,l,d,v,u),p}},i=ps(t);if(i)switch(i.type){case "table":return f(ts,{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(os,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(ds,{...i});case "error-card":{let s=i;return f(Qi,{...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(ji,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:l})}case "suggestions-card":{let s=i;return f(Ji,{...s,onClose:a("suggestions-card","close",s.title,s,s.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",s.title,s,s.onSuggestionClick,l=>({suggestion:l}))})}case "tool-result-card":{let s=i;return f(es,{...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(Tn,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r})})},bm=aC;var Ll=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"}}},sC=({content:t,className:o="",messageId:r,cardHooks:n})=>{let a=jt__default.useMemo(()=>Ll.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(bm,{content:i.content,messageId:r,cardHooks:n},`block-${s}`):f(Tn,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:n},`block-${s}`))})},us=sC;var lC=({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,f$1]=useState(!o);useEffect(()=>{if(o){u(0),f$1(false);return}u(t.length),f$1(true);},[t,o]),useEffect(()=>{if(!o||m)return;if(d>=t.length){f$1(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 h=()=>{o&&!m&&(u(t.length),f$1(true),r?.());},p=o?t.slice(0,d):t,v=o&&!m,y=o&&!m;return g("div",{className:`streaming-markdown ${n}`,onClick:h,style:{cursor:o?"pointer":"default"},children:[g("div",{className:"relative",children:[f(us,{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)"}})]}),y&&f("div",{className:"streaming-hint",style:{fontSize:"9px",color:"var(--orb-muted)",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},Cm=lC;var xm=({buttons:t,className:o})=>{let r=n=>{switch(n){case "copy":return f(hr,{size:14});case "refresh":return f(Na,{size:14});case "volume":return f(Wc,{size:14});case "like":return f(Bc,{size:14});case "dislike":return f(Fc,{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 ms=({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(Cm,{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(xm,{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 Sm=({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(Kd,{size:16}):f(qd,{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")},dC={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},pC=({enabled:t,onClick:o})=>f("button",{className:pt(lo.buttonBase,lo.buttonSmall,lo.buttonNormal),onClick:o,disabled:!t,"aria-label":"Upload file",type:"button",children:f(Pd,{size:16})}),uC=({canSend:t,isResponding:o,onSend:r,onStop:n})=>o?f("button",{className:pt(lo.buttonBase,lo.buttonSmall,lo.stopButton),onClick:n,"aria-label":"Stop generating",type:"button",children:f(op,{size:15})}):f("button",{className:pt(lo.buttonBase,lo.buttonSmall,t?lo.sendButton:lo.sendButtonDisabled),onClick:r,disabled:!t,"aria-label":"Send message",type:"button",children:f(Qd,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})}),Ol=({onSend:t,onStop:o,isResponding:r=false,placeholder:n,getText:a})=>{let[i,s]=useState(""),[l,d]=useState([]),[u,m]=useState(false),[f$1,h]=useState(false),p=useRef(null),v=n||(a?a("00019","Type a message..."):"Type a message..."),y=(i.trim().length>0||l.length>0)&&!r,g$1={enabled:true},x=useCallback(O=>{s(O.target.value),O.target.style.height="auto",O.target.style.height=`${Math.min(O.target.scrollHeight,200)}px`;},[]),b=useCallback(O=>{if(O.target.files&&O.target.files.length>0){let _=Array.from(O.target.files);d(F=>{let X=_.filter(Z=>F.some(z=>z.name===Z.name&&z.size===Z.size));X.length>0&&console.warn("Duplicate files ignored:",X.map(Z=>Z.name));let V=_.filter(Z=>!F.some(z=>z.name===Z.name&&z.size===Z.size));return [...F,...V]}),p.current&&(p.current.value="");}},[]),C=useCallback(O=>{d(_=>_.filter((F,X)=>X!==O));},[]),k=useCallback(()=>{p.current?.click();},[]),w=useCallback(async()=>{if(!y)return;let O=i,_=[...l];s(""),d([]),p.current&&(p.current.value="");try{await t(O,_);}catch(F){console.error("Failed to send message:",F),s(O),d(_);}},[i,y,t,l]),P=useCallback(O=>{O.key==="Enter"&&!O.shiftKey&&!u&&(O.preventDefault(),w());},[w,u]),I=useCallback(()=>{m(true);},[]),S=useCallback(()=>{m(false);},[]),N=useCallback(O=>{s(O);},[]),M=useCallback(O=>{s(O);},[]),T=useCallback(()=>{},[]),D=useCallback(O=>{O.preventDefault(),h(true);},[]),A=useCallback(O=>{O.preventDefault(),h(false);},[]),L=useCallback(O=>{if(O.preventDefault(),h(false),O.dataTransfer.files&&O.dataTransfer.files.length>0){let _=Array.from(O.dataTransfer.files);d(F=>[...F,..._]);}},[]);return f("div",{className:lo.container,children:g("div",{className:"relative",children:[f("input",{type:"file",multiple:true,className:"hidden",ref:p,onChange:b}),g("div",{className:pt(lo.inputContainer,f$1&&lo.dragActive),onDragOver:D,onDragLeave:A,onDrop:L,children:[l.length>0&&f("div",{className:lo.filePreviewArea,children:l.map((O,_)=>g("div",{className:lo.fileTag,children:[f(Wd,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),f("span",{className:"truncate max-w-[150px]",children:O.name}),f("button",{onClick:()=>C(_),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:f(Ed,{sx:{fontSize:16}})})]},`${O.name}-${_}`))}),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:v,value:i,onChange:x,onKeyDown:P,onCompositionStart:I,onCompositionEnd:S,style:dC,"aria-label":"Message input",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":"Input tools",children:f(pC,{enabled:g$1.enabled,onClick:k})}),g("div",{className:"flex items-center gap-1",children:[f(Sm,{onTextUpdate:N,onComplete:M,onCancel:T,disabled:r,className:lo.buttonSmall}),f(uC,{canSend:y,isResponding:r,onSend:w,onStop:o})]})]})]})]})]})})};var km=({messages:t,onSend:o,onStop:r,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:l,streamChunkSize:d,onMessageStreamingComplete:u,cardHooks:m,showInput:f$1=true,statusLine:h})=>{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((y,g)=>{let x=y.type==="assistant"&&g===t.length-1,b=y.type==="assistant"?{isLatestAssistant:x,isResponding:a,onRegenerate:n?()=>n(y.id):void 0}:void 0;return f(ms,{message:y,assistantActions:b,onStreamingComplete:()=>u?.(y.id),streamIntervalMs:l,streamChunkSize:d,cardHooks:m},y.id)}),h,f("div",{ref:p})]}),f$1&&f("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:f(Ol,{onSend:o||(async()=>{}),onStop:r||(()=>{}),isResponding:a,placeholder:s})})]})};var Pm={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},Tm=({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",f$1=[Pm[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:f$1||"Agent"})]})]}),r&&f("div",{className:"ml-auto flex flex-none items-center gap-1",children:r})]}),f("div",{className:"relative min-h-0 flex-1",children:f(km,{...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??`${Pm[u]}\u2026`})]}):void 0})})]})};var hC=t=>Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t),Mm=({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(),f$1=!!a;useEffect(()=>{if(!i)return;let p=y=>{l.current?.contains(y.target)||s(false);},v=y=>{y.key==="Escape"&&(y.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 h=p=>{let v=Array.from(d.current?.querySelectorAll('[role="option"]')??[]);if(v.length===0)return;let y=v.findIndex(x=>x===document.activeElement),g=y<0?p===1?0:v.length-1:(y+p+v.length)%v.length;v[g]?.focus();};return !n&&!f$1?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})}),f$1&&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(Rc,{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(),h(1)):p.key==="ArrowUp"&&(p.preventDefault(),h(-1));},children:t.length===0?f("p",{className:"orb-omph-conversation-empty",children:r.noConversations}):t.map(p=>{let v=p.updatedAt?hC(p.updatedAt):"",y=[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}),y&&f("span",{className:"orb-omph-conversation-meta",children:y})]},p.id)})})]})]})};var SC=2e3,wC=1/3,fs=[.25,.5,.75,1,1.5,2,3,4],kC=100,Rm={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},Dm=({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:f,total:m.length}},[t]),d=useCallback(m=>{let f=n??r,h=r!==void 0&&f!==void 0&&m>=r&&m<=f;return {className:"orb-omph-code-line","data-line":m,...h?{"data-hit":"true"}:{}}},[n,r]);useEffect(()=>{let m=s.current,f=m?.closest(".orb-omph-pv-body");if(!m||!f)return;if(r===void 0){f.scrollTop=0;return}let h=m.querySelector(`[data-line="${r}"]`);if(!h)return;let p=h.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop;f.scrollTop=Math.max(0,p-f.clientHeight*wC);},[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:Rm,codeTagProps:{className:`language-${o}`,style:Rm},children:l.shown}),l.total>l.shownCount&&f("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},Nm=({text:t})=>f("div",{className:"orb-omph-pv-doc",children:f(Tn,{content:t})}),Am=({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=fs.some(v=>v>u),f$1=fs.some(v=>v<u),h=v=>a(y=>{let g=y==="fit"?1:y;return (v>0?fs.find(b=>b>g):[...fs].reverse().find(b=>b<g))??y}),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:!f$1,onClick:()=>h(-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*kC)}%`}),f("button",{type:"button","aria-label":r.zoomIn,disabled:!m,onClick:()=>h(1),children:"+"})]})]})};var PC=/^[a-z][a-z0-9+.-]*:/i,TC=/^L(\d+)(?:-L?(\d+))?$/i;var Em=["B","KB","MB","GB"];var IC=t=>{try{return decodeURIComponent(t)}catch{return t}},Hl=t=>{let o=t.trim();if(!o||o.startsWith("#")||o.startsWith("//")||PC.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=IC(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=TC.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)}},hs=t=>t.split("/").filter(Boolean).pop()??t,Om=t=>{let o=t.split("/");return o.pop(),o.join("/")},zl=t=>{let o=hs(t),r=o.lastIndexOf(".");return r>0?o.slice(r+1).toLowerCase():""},Fm={prism:"text",label:"Text"},Lm={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:Fm},Vl=(t,o)=>o?Object.values(Lm).find(n=>n.prism===o)??{prism:o,label:o}:Lm[zl(t)]??Fm,Bm=t=>{let o=t,r=0;for(;o>=1024&&r<Em.length-1;)o/=1024,r+=1;return `${r>0&&o<10?o.toFixed(1):Math.round(o).toString()} ${Em[r]}`};var MC=1e3,RC=9,er=16,DC={markdown:"text/markdown;charset=utf-8",code:"text/plain;charset=utf-8"},Vm=(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);},Wl=({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]}),Wm=({state:t,placement:o,expanded:r,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:l,onRetry:d,onToggleExpand:u,onOpenExternally:m})=>{let[f$1,h]=useState(true),[p,v]=useState(false),{open:y,ref:g$1,phase:x,data:b}=t,C=b?.body;useEffect(()=>{if(!p)return;let _=window.setTimeout(()=>v(false),MC);return ()=>window.clearTimeout(_)},[p]),useEffect(()=>{y&&s.current?.focus({preventScroll:true});},[y,s,g$1?.path]);let k=b?.absolutePath??g$1?.path??"",w=C&&(C.kind==="markdown"||C.kind==="code")?C.text:k,P=w===k?a.previewCopyPath:a.previewCopyContent,I=C?.kind==="code"&&g$1?Vl(g$1.path,C.language):null,S=!!(g$1&&C&&(C.kind==="markdown"||C.kind==="code"||C.kind==="image"||C.kind==="embed")),N=()=>{if(!C||!g$1)return;let _=hs(g$1.path);if(C.kind==="markdown"||C.kind==="code"){Vm(new Blob([C.text],{type:DC[C.kind]}),_);return}(C.kind==="image"||C.kind==="embed")&&fetch(C.url).then(F=>{if(!F.ok)throw new Error(`HTTP ${F.status}`);return F.blob()}).then(F=>Vm(F,_)).catch(()=>window.open(C.url,"_blank","noopener"));},M=[];I&&M.push(I.label),C?.kind==="markdown"&&M.push("Markdown"),C?.kind==="image"&&g$1&&M.push(zl(g$1.path).toUpperCase()),b?.size!==void 0&&M.push(Bm(b.size)),C?.kind==="code"&&g$1?.startLine!==void 0&&M.push(a.previewLines(g$1.startLine,g$1.endLine??g$1.startLine));let T=_=>{_.key==="Escape"&&(_.stopPropagation(),l(true));},D=f("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),A=()=>{if(!g$1)return null;if(x==="loading")return f("div",{className:"orb-omph-pv-skel",role:"status","aria-label":a.previewLoading,children:Array.from({length:RC},(_,F)=>f("span",{},F))});if(x==="error"||!C)return f(Wl,{tone:"error",icon:f(Ca,{size:er}),title:a.previewFailed,text:k,action:D});switch(C.kind){case "missing":return f(Wl,{tone:"neutral",icon:f(ka,{size:er}),title:a.previewMissing,text:C.message??k});case "unsupported":return f(Wl,{tone:"neutral",icon:f(ka,{size:er}),title:a.previewUnsupported,text:C.message??k,action:m&&f("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>m(g$1),children:a.previewOpenExternal})});case "markdown":return f(Nm,{text:C.text},g$1.path);case "code":return f(Dm,{text:C.text,language:Vl(g$1.path,C.language).prism,startLine:g$1.startLine,endLine:g$1.endLine,wrap:f$1,labels:a},g$1.path);case "image":return f(Am,{url:C.url,alt:C.alt,labels:a},C.url);case "embed":return f("iframe",{src:C.url,title:C.caption??"Embedded document",className:"orb-omph-pv-embed"},C.url);default:return null}},L=o==="overlay",O=C?.kind==="image"?kc:ka;return g("aside",{ref:s,className:"orb-omph-preview","data-open":y||void 0,"data-placement":o,role:L?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!y||void 0,tabIndex:-1,onKeyDown:T,children:[!L&&y&&f("div",{className:"orb-omph-pv-grip","aria-label":a.previewResize,...i}),g("div",{className:"orb-omph-pv",children:[g("header",{className:"orb-omph-pv-head",children:[L&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:f(Sa,{size:er})}),f("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:f(O,{size:er})}),g("div",{className:"orb-omph-pv-titles",children:[f("div",{className:"orb-omph-pv-name",title:k,children:g$1?hs(g$1.path):""}),f("div",{className:"orb-omph-pv-path",title:k,children:f("bdi",{children:Om(k)})})]}),g("div",{className:"orb-omph-pv-actions",children:[C?.kind==="code"&&f("button",{type:"button",className:"orb-omph-text-button","aria-pressed":f$1,onClick:()=>h(_=>!_),children:a.previewWrap}),S&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewDownload,title:a.previewDownload,onClick:N,children:f(vc,{size:er})}),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(w).then(()=>v(true));},children:p?f(Ko,{size:er}):f(hr,{size:er})}),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(Cc,{size:er})}),!L&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:f(Yt,{size:er})})]})]}),f("div",{className:"orb-omph-pv-meta",children:M.join(" \xB7 ")}),f("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?C?.kind:void 0,children:A()})]})]})};var AC=1e3,$m=50,EC=1e3,LC=t=>t==="tool"?Jr:t==="command"?Fn:Dc,Gm=t=>!!t.streaming||t.status==="running"||t.status==="pending",OC=(t,o)=>o==="expanded"?true:Gm(t),FC=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),BC=(t,o)=>`${Math.max(1,Math.round(t/EC))}${o.secondUnit}`,HC=({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})},zC=({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),AC);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()}),FC(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(Ko,{size:14}):f(hr,{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," ",BC(l.durationMs,o)]})]})]})},VC=({item:t,display:o,open:r,onToggle:n})=>{let a=LC(t.kind),i=Gm(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(Oo,{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(HC,{content:t.content}),r&&t.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},$l=t=>{let o=t.user?.content||t.assistant?.content||t.id,r=o.split(`
|
|
20
|
-
`).find(n=>n.trim())??o;return r.length>$m?`${r.slice(0,$m)}\u2026`:r},WC=0,Um=({turns:t,labels:o,processDisplay:r,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=useState({}),d=u=>{if(!i||u.defaultPrevented||u.button!==WC||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey)return;let m=u.target.closest("a[href]");if(!m)return;let f=a(m.getAttribute("href")??"");f&&(u.preventDefault(),i(f,m));};return f(e,{children:t.map((u,m)=>{let f$1=!!(u.assistant&&!u.assistant.streaming),p=m===t.length-1&&f$1?"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 y=v.id in s?s[v.id]:OC(v,r);return f(VC,{item:v,display:r,open:y,onToggle:()=>l(g=>({...g,[v.id]:!y}))},v.id)})}),u.assistant&&g("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[f(us,{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}),f$1&&f(zC,{turn:u,labels:o})]},u.id)})})};var $C={idle:"Idle",pending:"Pending",running:"Working",success:"Success",error:"Error",working:"Working",workingFor:t=>`Working for ${t}`,loadOlder:"Load earlier",loadingOlder:"Loading earlier\u2026",toBottom:"Back to bottom",copy:"Copy",copied:"Copied",turnActions:"Reply actions",usage:"Usage",inputTokens:"Input",outputTokens:"Output",duration:"Duration",send:"Send",stop:"Stop",turnRail:"Turns",secondUnit:"s",minuteUnit:"m",previewTitle:"File preview",previewClose:"Close preview",previewBack:"Back to conversation",previewExpand:"Expand preview",previewCollapse:"Restore preview size",previewCopyContent:"Copy content",previewCopyPath:"Copy path",previewDownload:"Download",previewOpenExternal:"Open externally",previewWrap:"Wrap",previewLoading:"Loading file",previewMissing:"File not found",previewFailed:"Could not load this file",previewUnsupported:"No preview for this file type",previewRetry:"Try again",previewResize:"Resize preview",previewLines:(t,o)=>t===o?`Line ${t}`:`Lines ${t}\u2013${o}`,previewTruncated:(t,o)=>`Showing the first ${t.toLocaleString()} of ${o.toLocaleString()} lines`,imageFailed:"The image could not be displayed",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomFit:"Fit to width",newConversation:"New conversation",conversationList:"Conversation list",conversations:"Conversations",noConversations:"No conversations yet"},qm=t=>({...$C,...t}),_C={waiting:"Waiting for approval",choose:"Choose an action",details:"Approval details",choices:"Actions",reject:"Reject",allowOnce:"Allow once",confirm:"Continue",other:"Other",otherPlaceholder:"Describe the action to take",escalation:t=>`Tool ${t} requests privileged execution`},Xm=t=>({..._C,...t}),GC=1e3,Km=60,UC=1e3,Ym=(t,o)=>{let r=Math.max(1,Math.round(Math.max(t,UC)/GC)),n=Math.floor(r/Km),a=r%Km;return n<=0?`${r}${o.secondUnit}`:`${n}${o.minuteUnit} ${a}${o.secondUnit}`};var XC={open:false,ref:null,phase:"loading",data:null},Zm=t=>{let[o,r]=useState(XC),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(h=>{let p=a.current;if(!p)return;i.current?.abort();let v=new AbortController;i.current=v,s.current+=1;let y=s.current;r({open:true,ref:h,phase:"loading",data:null}),p(h,v.signal).then(g=>{y===s.current&&r(x=>({...x,phase:"ready",data:g}));},()=>{y!==s.current||v.signal.aborted||r(g=>({...g,phase:"error",data:null}));});},[]),u=useCallback((h,p)=>{l.current=p??null;let v=n.current;if(v.ref?.path===h.path&&v.phase==="ready"){r({...v,open:true,ref:h});return}d(h);},[d]),m=useCallback((h=false)=>{s.current+=1,i.current?.abort(),r(v=>({...v,open:false}));let p=l.current;h&&p?.isConnected&&p.focus({preventScroll:true});},[]),f=useCallback(()=>{let{ref:h}=n.current;h&&d(h);},[d]);return useEffect(()=>()=>{i.current?.abort();},[]),{state:o,open:u,close:m,reload:f}};var Gl="--orb-omph-pv-w",Ul="--orb-omph-pv-pref",QC=880,jC=560,jm=400,$r=320,JC=.45,ex=.7,Jm=24,_l=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),eg=({open:t,layout:o})=>{let r=useRef(null),n=useRef(null),[a,i]=useState(0),[s,l]=useState(null),[d,u]=useState(false),[m,f]=useState(false);useLayoutEffect(()=>{let P=r.current;if(!P)return;let I=()=>i(P.getBoundingClientRect().width);I();let S=new ResizeObserver(I);return S.observe(P),()=>S.disconnect()},[]),useEffect(()=>{t||u(false);},[t]);let h=o==="overlay"?false:o==="split"?a>=jm+$r:a>=QC,p=h&&!d?"split":"overlay",v=Math.max($r,Math.min(a*ex,a-jm)),y=_l(s??a*JC,$r,v),g=a>0&&a<jC,x=useCallback(P=>{let I=r.current;I&&(I.style.setProperty(Ul,`${P}px`),I.dataset.placement==="split"&&I.dataset.open==="true"&&I.style.setProperty(Gl,`${P}px`));},[]),b=useCallback(P=>{P.button===0&&(P.preventDefault(),P.currentTarget.setPointerCapture(P.pointerId),n.current={pointerId:P.pointerId,startX:P.clientX,startWidth:y,latest:y},f(true));},[y]),C=useCallback(P=>{let I=n.current;!I||I.pointerId!==P.pointerId||(I.latest=_l(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),f(false));},[]),w=useCallback(P=>{let I={ArrowLeft:y+Jm,ArrowRight:y-Jm,Home:$r,End:v};P.key in I&&(P.preventDefault(),l(_l(I[P.key],$r,v)));},[v,y]);return {mainRef:r,placement:p,width:y,compact:g,dragging:m,expanded:d,canExpand:h,toggleExpanded:()=>u(P=>!P),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":$r,"aria-valuemax":Math.round(v),"aria-valuenow":Math.round(y),tabIndex:0,onPointerDown:b,onPointerMove:C,onPointerUp:k,onPointerCancel:k,onKeyDown:w}}};var Cs=48,ox=900,og=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,rg=({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),[f,h]=useState(true),[p,v]=useState(false),[y,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,S=P.querySelector("[data-omph-turn]")?.dataset.omphTurn;P.querySelectorAll("[data-omph-turn]").forEach(N=>{N.getBoundingClientRect().top-I<=Cs&&(S=N.dataset.omphTurn);}),g(S);},[]);useEffect(()=>{let P=i.current,I=s.current;if(!P||!I)return;let S=()=>{v(P.clientWidth>ox),l.current&&(P.scrollTop=P.scrollHeight),x();};S();let N=new ResizeObserver(S);return N.observe(P),N.observe(I),()=>N.disconnect()},[x]),useLayoutEffect(()=>{let P=i.current;if(!P)return;let I=t[0]?.id,S=u.current,N=S!==void 0&&t.some(D=>D.id===S),M=N&&I!==void 0&&I!==S,T=S!==void 0&&!N;if(u.current=I,T){l.current=true,h(true),P.scrollTop=P.scrollHeight,x(),b();return}if(M){l.current=false,h(false);let D=P.scrollHeight-d.current.height;P.scrollTop=d.current.top+Math.max(0,D),x(),b();return}l.current&&(P.scrollTop=P.scrollHeight),x(),b();},[o,x,t,b]),useEffect(()=>{n||(m.current=false);},[n]);let C=useCallback(()=>{let P=i.current;if(!P)return;let S=P.scrollHeight-P.scrollTop-P.clientHeight<=Cs;S!==l.current&&(l.current=S,h(S)),x(),b();let N=P.scrollHeight-P.clientHeight>Cs,M=P.scrollTop<=Cs;!N||!M||S||!r||n||!a||m.current||(m.current=true,a());},[r,n,a,x,b]),k=useCallback(()=>{let P=i.current;P&&(l.current=true,h(true),P.scrollTo({top:P.scrollHeight,behavior:og()?"auto":"smooth"}));},[]),w=useCallback(P=>{let S=i.current?.querySelector(`[data-omph-turn="${CSS.escape(P)}"]`);S&&(l.current=false,h(false),S.scrollIntoView({block:"start",behavior:og()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:f,railVisible:p,activeTurnId:y,onScroll:C,returnToBottom:k,scrollToTurn:w}};var nx=1e3,ax=(t,o)=>o[t],ix=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("|"),sx=({startedAt:t,labels:o})=>{let[r,n]=useState(()=>Date.now());useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),nx);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?o.working:o.workingFor(Ym(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})]})]})},HH=({turns:t,title:o="OMPH Agent",description:r,headerActions:n,agentStatus:a,isResponding:i=false,labels:s,processDisplay:l="standard",showInput:d=false,placeholder:u,className:m,cardHooks:f$1,hasOlder:h=false,loadingOlder:p=false,onLoadOlder:v,onSend:y,onStop:g$1,onHeaderPointerDown:x,conversations:b=[],activeConversationId:C,onNewConversation:k,onSelectConversation:w,loadFilePreview:P,resolveFileLink:I=Hl,filePreviewLayout:S="auto",onOpenFileExternally:N})=>{let M=qm(s),T=a??(i?"running":"idle"),D=T==="running"||T==="pending",A=[ax(T,M),r].filter(Boolean).join(" \xB7 "),L=useMemo(()=>ix(t),[t]),O=rg({turns:t,contentVersion:L,hasOlder:h,loadingOlder:p,onLoadOlder:v}),[_,F]=useState(""),X=_.trim(),V=i&&X.length===0,Z=[...t].reverse().find(se=>!!se.assistant?.streaming||se.process?.some(Ae=>Ae.streaming||Ae.status==="running"||Ae.status==="pending")),z=D?Z?.startedAt:void 0,H=!!P,U=Zm(P),K=eg({open:U.state.open,layout:S}),ge=useRef(null),ie=useRef(null),pe=H&&U.state.open&&K.placement==="overlay",xe=K.placement==="split"&&U.state.open,We={[Ul]:`${K.width}px`,[Gl]:xe?`${K.width}px`:"0px"};useEffect(()=>{ie.current?.toggleAttribute("inert",pe);},[pe]);let we=async()=>{if(!X||!y)return;let se=X;F("");try{await y(se);}catch{F(Ae=>Ae.trim().length===0?se:Ae);}};return g("div",{className:pt("orb-omph-panel",m),"data-omph-panel":"","data-status":T,"data-compact":K.compact||void 0,children:[g("div",{className:pt("orb-omph-header",x&&"cursor-grab active:cursor-grabbing"),onPointerDown:x,children:[f("span",{className:"orb-omph-avatar","aria-hidden":"true",children:"AI"}),g("div",{className:"min-w-0 flex-1",children:[f("div",{className:"orb-omph-title",children:o}),g("div",{className:"orb-omph-subtitle",children:[f("span",{className:"orb-omph-dot","data-active":D||void 0}),f("span",{className:"truncate",children:A||M.idle})]})]}),(k||w||n)&&g("div",{className:"orb-omph-header-actions",onPointerDown:se=>se.stopPropagation(),children:[f(Mm,{conversations:b,activeConversationId:C,labels:M,onNewConversation:k,onSelectConversation:w}),n]})]}),g("div",{ref:K.mainRef,className:"orb-omph-main","data-placement":K.placement,"data-open":String(U.state.open),"data-dragging":K.dragging||void 0,style:We,children:[g("div",{ref:ie,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:[h&&v&&f("button",{type:"button",className:"orb-omph-older",disabled:p,onClick:v,children:p?M.loadingOlder:M.loadOlder}),f(Um,{turns:t,labels:M,processDisplay:l,cardHooks:f$1,resolveFileLink:I,onOpenFile:H?U.open:void 0}),D&&f(sx,{startedAt:z,labels:M})]})}),O.railVisible&&t.length>0&&f("nav",{className:"orb-omph-rail","aria-label":M.turnRail,children:t.map(se=>f("button",{type:"button",className:"orb-omph-rail-mark","data-active":O.activeTurnId===se.id||void 0,"aria-label":$l(se),title:$l(se),onClick:()=>O.scrollToTurn(se.id)},se.id))}),!O.following&&f("button",{type:"button",className:"orb-omph-to-bottom","aria-label":M.toBottom,onClick:O.returnToBottom,children:f(Oo,{size:16})})]}),d&&g("form",{className:"orb-omph-composer",onSubmit:se=>{se.preventDefault(),V?g$1?.():we();},children:[f("textarea",{className:"orb-omph-input",value:_,placeholder:u,rows:1,onChange:se=>F(se.target.value),onKeyDown:se=>{se.key!=="Enter"||se.shiftKey||se.nativeEvent.isComposing||(se.preventDefault(),V?g$1?.():we());}}),f("button",{type:"submit",className:V?"orb-omph-stop":"orb-omph-send","aria-label":V?M.stop:M.send,disabled:!V&&X.length===0,children:V?f(fc,{size:16}):f(gc,{size:16})})]})]}),H&&f(Wm,{state:U.state,placement:K.placement,expanded:K.expanded,canExpand:K.canExpand,labels:M,gripProps:K.gripProps,paneRef:ge,onClose:U.close,onRetry:U.reload,onToggleExpand:K.toggleExpanded,onOpenExternally:N})]})]})};var gr="other",lx=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,cx=({request:t,onDecide:o,labels:r})=>{let n=Xm(r),a=useRef(null),i=useRef(null),s=useRef(false),l=useRef(false),[d,u]=useState(false),[m,f$1]=useState(null),[h,p]=useState(""),v=t.choices??[],y=t.allowOther??v.length>0,g$1=v.length>0||y,x=t.reason?.trim()||n.escalation(t.toolName),b=t.detail?.trim(),C=m===gr&&h.trim().length>0,k=!g$1||m!==null&&m!==gr||C;useEffect(()=>{u(false),f$1(null),p(""),a.current?.focus();},[t.id]),useEffect(()=>{m===gr&&i.current?.focus();},[m]);let w=S=>{d||(u(true),o(S,t));},P=()=>{if(k){if(!g$1){w({kind:"allowed-once"});return}if(m===gr){let S=h.trim();if(!S)return;w({kind:"other",text:S});return}m&&w({kind:"choice",choiceId:m});}},I=S=>{if(!(d||lx(S.target))&&!(S.key!=="Enter"&&S.key!=="Escape")&&!(S.key==="Enter"&&S.target instanceof HTMLElement&&S.target.closest('button, a[href], [role="button"]'))&&!(S.ctrlKey||S.metaKey||S.altKey||S.shiftKey)&&(S.preventDefault(),S.stopPropagation(),!(S.repeat||s.current||l.current||S.nativeEvent.isComposing))){if(S.key==="Escape"){w({kind:"rejected"});return}P();}};return f("div",{className:"orb-omph-approval","data-omph-approval":t.id,"aria-busy":d,onKeyDown:I,onKeyUpCapture:()=>{l.current=false;},onCompositionStartCapture:()=>{s.current=true;},onCompositionEndCapture:()=>{s.current=false,l.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"}),g$1?n.choose:n.waiting]}),g("div",{ref:a,className:"orb-omph-approval-body",tabIndex:0,role:"group","aria-label":n.details,children:[f("div",{className:"orb-omph-approval-headline",children:x}),b&&f("div",{className:"orb-omph-approval-detail",children:b}),g$1&&g("fieldset",{className:"orb-omph-approval-choices",disabled:d,children:[f("legend",{className:"orb-visually-hidden",children:n.choices}),v.map(S=>{let N=m===S.id;return g("label",{className:"orb-omph-approval-choice","data-selected":N,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:S.id,checked:N,onChange:()=>f$1(S.id)}),g("span",{className:"orb-omph-approval-choice-copy",children:[f("span",{children:S.label}),S.description&&f("span",{className:"orb-omph-approval-choice-description",children:S.description})]})]},S.id)}),y&&g("label",{className:"orb-omph-approval-choice","data-selected":m===gr,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:gr,checked:m===gr,onChange:()=>f$1(gr)}),f("span",{className:"orb-omph-approval-choice-copy",children:f("span",{children:n.other})})]}),y&&m===gr&&f("textarea",{ref:i,className:"orb-omph-approval-other",value:h,placeholder:n.otherPlaceholder,rows:3,"aria-label":n.other,onChange:S=>p(S.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:d,onClick:()=>w({kind:"rejected"}),children:n.reject}),f("button",{type:"button",className:"orb-btn orb-btn-primary",disabled:d||!k,onClick:P,children:g$1?n.confirm:n.allowOnce})]})]})})};var dg=520,ux=88,mx=88,gx=24,Ss=640,pg=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),Xl=t=>typeof t=="number"?`${t}px`:t,fx=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,YH=({anchor:t,defaultAnchor:o="right",onAnchorChange:r,width:n=dg,top:a=ux,bottom:i=mx,inset:s=gx,zIndex:l=1300,shellClassName:d,shellStyle:u,className:m,onHeaderPointerDown:f$1,...h})=>{let p=useRef(null),v=useRef(null),[y,g]=useState(o),[x,b]=useState(0),[C,k]=useState(typeof n=="number"?n:dg),[w,P]=useState(0),[I,S]=useState(false),N=t??y;useEffect(()=>{let F=()=>b(window.innerWidth);return F(),window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)},[]),useLayoutEffect(()=>{let F=()=>{let V=p.current?.getBoundingClientRect();V?.width?k(V.width):typeof n=="number"&&k(n);};if(F(),!p.current||typeof ResizeObserver>"u")return;let X=new ResizeObserver(F);return X.observe(p.current),()=>X.disconnect()},[n]);let M=useCallback(F=>{if(!x)return s;let X=x<Ss?12:s,V=Math.max(X,x-C-X);return x<Ss||F==="left"?X:F==="center"?pg((x-C)/2,X,V):V},[s,C,x]),T=useCallback(F=>["left","center","right"].reduce((V,Z)=>{let z=Math.abs(F-M(V));return Math.abs(F-M(Z))<z?Z:V},"right"),[M]),D=useCallback(F=>{t===void 0&&g(F),r?.(F);},[t,r]);useEffect(()=>{I||P(M(N));},[M,I,N]);let A=useCallback(F=>{f$1?.(F),!(F.defaultPrevented||fx(F.target))&&(F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),v.current={pointerId:F.pointerId,startClientX:F.clientX,startX:w,currentX:w,captureElement:F.currentTarget},S(true));},[f$1,w]),L=useCallback(F=>{let X=v.current;if(!X||X.pointerId!==F.pointerId)return;let V=x<Ss?12:s,Z=Math.max(V,x-C-V),z=pg(X.startX+F.clientX-X.startClientX,V,Z);X.currentX=z,P(z);},[s,C,x]),O=useCallback(F=>{let X=v.current;if(!X||X.pointerId!==F.pointerId)return;try{X.captureElement.releasePointerCapture(F.pointerId);}catch{}let V=T(X.currentX);v.current=null,S(false),D(V),P(M(V));},[M,D,T]),_=useMemo(()=>({position:"fixed",top:Xl(a),bottom:Xl(i),left:w,width:Xl(n),maxWidth:`calc(100vw - ${x<Ss?24:s*2}px)`,zIndex:l,pointerEvents:"auto",transition:I?"none":"left 180ms ease-out",touchAction:"none",...u}),[i,s,I,w,u,a,x,n,l]);return f("div",{ref:p,className:pt("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":N,"data-dragging":I?"true":"false",style:_,onPointerMove:L,onPointerUp:O,onPointerCancel:O,children:f(Tm,{...h,className:m,onHeaderPointerDown:A})})};var vx={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},rz=({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:f$1,streamIntervalMs:h,streamChunkSize:p,onMessageStreamingComplete:v,cardHooks:y})=>{let[g$1,x]=useState(""),[b,C]=useState(false),k=useRef(null),w=vx[l];useEffect(()=>{k.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let P=useCallback(async()=>{let S=g$1.trim();!S||n||(x(""),await o(S));},[n,o,g$1]),I=useCallback(async S=>{S.key==="Enter"&&!b&&(S.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",w==="top-left"&&"-left-2 -top-2",w==="top-right"&&"-right-2 -top-2",w==="bottom-left"&&"-bottom-2 -left-2",w==="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)]",w==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",w==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",w==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",w==="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((S,N)=>{let M=S.type==="assistant"&&N===t.length-1,T=S.type==="assistant"?{isLatestAssistant:M,isResponding:n,onRegenerate:r?()=>r(S.id):void 0}:void 0;return f(ms,{message:S,assistantActions:T,onStreamingComplete:()=>v?.(S.id),streamIntervalMs:h,streamChunkSize:p,cardHooks:y},S.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:S=>x(S.target.value),onCompositionStart:()=>C(true),onCompositionEnd:()=>C(false),onKeyDown:I,"aria-label":"Copilot input",spellCheck:false}),f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:f$1,type:"button","aria-label":"Microphone",children:f(Ma,{className:"h-4 w-4"})})]})})]})};var yx=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],Cx=`
|
|
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:l-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:r?o:"Index"}),f("text",{x:16,y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/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:_u(f$1)}),f("text",{x:s-d.right,y:l-d.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:_u(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 ${Eo(x.palette.divider,.7)}`,bgcolor:Eo(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 Al=t=>Math.max(...t,1),Uu=({data:t,chartType:o,primaryLabel:r,secondaryLabel:n,formatPrimaryValue:a,formatSecondaryValue:i})=>{let s=io(),l=s.palette.primary.main,d=s.palette.warning.main;if(t.length===0)return null;if(o==="bar-horizontal"){let v=Al(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:Eo(s.palette.action.active,.08)},children:f("div",{sx:{width:`${y.primaryValue/v*100}%`,height:"100%",bgcolor:l}})}),n&&f("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:Eo(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=Al(t.flatMap(k=>[k.primaryValue,k.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(k=>g("div",{sx:{minWidth:0},children:[g("div",{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[f("div",{sx:{width:n?16:26,minHeight:8,height:`${Math.max(k.primaryValue/v*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:l},title:`${r}: ${a(k.primaryValue)}`}),n&&f("div",{sx:{width:16,minHeight:8,height:`${Math.max((k.secondaryValue??0)/v*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${n}: ${(i??a)(k.secondaryValue??0)}`})]}),f(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:k.name,children:k.name}),f(E,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:a(k.primaryValue),children:a(k.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:(i??a)(k.secondaryValue??0),children:(i??a)(k.secondaryValue??0)})]},k.name))})})}let p=Math.max(680,t.length*74),m=240,h={top:20,right:18,bottom:36,left:18},f$1=Al(t.flatMap(v=>[v.primaryValue,v.secondaryValue??0])),u=p-h.left-h.right,b=m-h.top-h.bottom,C=v=>t.map((y,k)=>{let w=h.left+k*u/Math.max(t.length-1,1),P=m-h.bottom-v(y)/f$1*b;return {x:w,y:P,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 ${p} ${m}`,sx:{width:"100%",minWidth:p,height:m},children:[f("line",{x1:h.left,y1:m-h.bottom,x2:p-h.right,y2:m-h.bottom,stroke:Eo(s.palette.text.secondary,.35)}),f("polyline",{fill:"none",stroke:l,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:l,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 ${Eo(y.palette.divider,.7)}`,bgcolor:Eo(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 Ku=(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},qu=(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}}),Xu=({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 Zu=({rows:t,fieldMap:o,rowFields:r,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:l,chartType:d,isCollapsed:p,onChartDimensionFieldIdChange:m,onChartPrimaryValueFieldIdChange:h,onChartSecondaryValueFieldIdChange:f$1,onChartTypeChange:u,onToggleCollapse:b,getAggregationLabel:C})=>{let{t:g$1}=ce(),x=useMemo(()=>Ku(r,n,o),[n,o,r]),v=useMemo(()=>qu(a,o,C),[o,C,a]),y=v.find(T=>T.fieldId===s)??v[0],k=v.find(T=>T.fieldId===l&&T.fieldId!==y?.fieldId)??null,w=x.find(T=>T.fieldId===i)??x[0],P=w&&y?g$1("pivot.chart.subtitleReady",{dimension:w.label,measure:k?`${y.label} / ${k.label}`:y.label}):g$1("pivot.chart.subtitle"),I=useMemo(()=>!w||!y?[]:Xu({rows:t,dimensionFieldId:w.fieldId,primaryValue:y.item,secondaryValue:k?.item}),[y,t,k,w]),S=T=>y?pa(T,y.item,o):T.toLocaleString(),R=T=>k?pa(T,k.item,o):T.toLocaleString(),N=x.length>1||v.length>1;return g(kn,{title:g$1("pivot.chart.title"),subtitle:P,collapsed:p,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(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(zt,{value:w?.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(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(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(zt,{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")}),v.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(zt,{value:d,onChange:T=>u(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:w?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(Gu,{data:I,primaryLabel:y.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:R}):f(Uu,{data:I,chartType:d,primaryLabel:y.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:R}):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 Ji=({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,p=t.isGrandTotal,m=d&&!l&&!p,h=p?800:m?700:d?600:500,f$1=p?800:m?600:500;return g(e,{children:[g("tr",{sx:{bgcolor:p?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":b()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:p?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[g("td",{style:{fontWeight:h},sx:u=>({fontSize:"0.76rem",borderBottom:`1px solid ${u.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!p&&f(ie,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:l?f(Wo,{size:12}):f(wr,{size:12})}),!d&&!p&&n>0&&f("div",{sx:{width:18}}),t.value]}),o.map(u=>f("td",{align:"right",style:{fontWeight:f$1},sx:{fontSize:"0.76rem",borderBottom:b=>`1px solid ${b.palette.divider}`,whiteSpace:"nowrap"},children:pa(s?s(t,u.id):t.aggregatedValues[u.id]??0,u.valueItem,r)},`${t.key}-${u.id}`))]}),l&&t.children.map(u=>f(Ji,{node:u,dataColumns:o,fieldMap:r,level:n+1,expandedKeys:a,onToggle:i,getValue:s},u.key))]})};var Ll=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},ts=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",Ol=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",Qu=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},ju=(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,ju(a.children,o,r+1)),r),Kv=(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},sO=({title:t,rows:o,fields:r,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:l=false,initialTableCollapsed:d=false,model:p,enablePresetManagement:m=false,presets:h,defaultPresets:f$1,onPresetsChange:u,initialPresetId:b$1,onPresetApplied:C})=>{let{t:g$1}=ce(),x=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),v=useRef(0),y=useRef(false),k=t??g$1("pivot.title.default"),w=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]??Nu[D],[P]),S=useMemo(()=>new Set(r.map(D=>D.id)),[r]),R=useMemo(()=>new Map(r.map(D=>[D.id,D])),[r]),[N,T]=useState(()=>so(n?.rows,S)),[M,A]=useState(()=>so(n?.columns,S)),[L,W]=useState(()=>so(n?.filters,S)),[ee,O]=useState(()=>{let D=n?.values??[],$=new Set,G=[];return D.forEach(ue=>{if(!S.has(ue.fieldId)||$.has(ue.fieldId))return;$.add(ue.fieldId),v.current+=1;let Fe=R.get(ue.fieldId);G.push({tokenId:`v${v.current}`,fieldId:ue.fieldId,aggregation:yo(ue.aggregation,Fe)});}),G}),[_,V]=useState({}),[Q,H]=useState(true),[B,q]=useState(false),[Z,Y]=useState(()=>Ll(so(n?.rows,S),so(n?.columns,S),a?.dimensionFieldId)),[J,le]=useState(()=>{let D=(n?.values??[]).filter(($,G,ue)=>S.has($.fieldId)&&ue.findIndex(Fe=>Fe.fieldId===$.fieldId)===G).map($=>({tokenId:$.fieldId,fieldId:$.fieldId,aggregation:yo($.aggregation,R.get($.fieldId))}));return ts(D,a?.primaryValueFieldId)}),[he,ze]=useState(()=>{let D=(n?.values??[]).filter((G,ue,Fe)=>S.has(G.fieldId)&&Fe.findIndex(rt=>rt.fieldId===G.fieldId)===ue).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:yo(G.aggregation,R.get(G.fieldId))})),$=ts(D,a?.primaryValueFieldId);return Ol(D,$,a?.secondaryValueFieldId)}),[be,Ce]=useState(a?.chartType??"bar-vertical"),[Be,de]=useState(l),[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=p?.rowFields??N,Le=p?.columnFields??M,pe=p?.filterFields??L,xe=p?.valueFields??ee,oe=p?.filterSelections??_,ye=p?.showGrandTotal??Q,De=p?.isConfiguratorCollapsed??B,je=p?.chartDimensionFieldId??Z,st=p?.chartPrimaryValueFieldId??J,pt=p?.chartSecondaryValueFieldId??he,Bt=p?.chartType??be,Xt=p?.isChartCollapsed??Be,Vt=p?.isTableCollapsed??ve,wt=h??et,Wt=m||wt.length>0||!!u,ft=useCallback(D=>{if(p?.setRowFields){p.setRowFields(D);return}T(D);},[p]),Nt=useCallback(D=>{if(p?.setColumnFields){p.setColumnFields(D);return}A(D);},[p]),lt=useCallback(D=>{if(p?.setFilterFields){p.setFilterFields(D);return}W(D);},[p]),Ft=useCallback(D=>{if(p?.setValueFields){p.setValueFields(D);return}O(D);},[p]),Zt=useCallback(D=>{if(p?.setFilterSelections){p.setFilterSelections(D);return}V(D);},[p]),K=useCallback(D=>{if(p?.setShowGrandTotal){p.setShowGrandTotal(D);return}H(D);},[p]),z=useCallback(D=>{if(p?.setIsConfiguratorCollapsed){p.setIsConfiguratorCollapsed(D);return}q(D);},[p]),X=useCallback(D=>{if(p?.setChartDimensionFieldId){p.setChartDimensionFieldId(D);return}Y(D);},[p]),fe=useCallback(D=>{if(p?.setChartPrimaryValueFieldId){p.setChartPrimaryValueFieldId(D);return}le(D);},[p]),Se=useCallback(D=>{if(p?.setChartSecondaryValueFieldId){p.setChartSecondaryValueFieldId(D);return}ze(D);},[p]),Ae=useCallback(D=>{if(p?.setChartType){p.setChartType(D);return}Ce(D);},[p]),$e=useCallback(D=>{if(p?.setIsChartCollapsed){p.setIsChartCollapsed(D);return}de(D);},[p]),Ke=useCallback(D=>{if(p?.setIsTableCollapsed){p.setIsTableCollapsed(D);return}We(D);},[p]),Ye=useCallback(D=>{let $=typeof D=="function"?D(wt):D;h||nt($),u?.($);},[u,wt,h]),ut=useMemo(()=>new Set([...Ge,...Le,...pe]),[Ge,Le,pe]),gt=useMemo(()=>r.filter(D=>!ut.has(D.id)),[r,ut]),Mt=useMemo(()=>{let D=[...Ge,...Le,...pe],$=new Set,G=[];return D.forEach(ue=>{$.has(ue)||($.add(ue),G.push(ue));}),G},[Le,pe,Ge]);useEffect(()=>{ft(D=>{let $=D.filter(G=>S.has(G));return pr(D,$)?D:$}),Nt(D=>{let $=D.filter(G=>S.has(G));return pr(D,$)?D:$}),lt(D=>{let $=D.filter(G=>S.has(G));return pr(D,$)?D:$}),Ft(D=>{let $=D.filter(G=>S.has(G.fieldId)).map(G=>({...G,aggregation:yo(G.aggregation,R.get(G.fieldId))}));return Xi(D,$)?D:$});},[R,S]);let bt=useMemo(()=>{let D={};return Mt.forEach($=>{let G=new Set;o.forEach(ue=>{G.add(dr(ue[$]));}),D[$]=Array.from(G).sort((ue,Fe)=>ue.localeCompare(Fe));}),D},[Mt,o]);useEffect(()=>{Zt(D=>{let $={};return Mt.forEach(G=>{let ue=bt[G]??[],rt=(D[G]??[]).filter(ne=>ue.includes(ne)),_e=Object.prototype.hasOwnProperty.call(D,G);$[G]=_e?rt:ue;}),Bu(D,$)?D:$});},[Mt,bt]),useEffect(()=>{X(D=>Ll(Ge,Le,D));},[Le,Ge,X]),useEffect(()=>{fe(D=>ts(xe,D));},[fe,xe]),useEffect(()=>{Se(D=>Ol(xe,st,D));},[st,Se,xe]);let F=useMemo(()=>o.filter(D=>Mt.every($=>{let G=oe[$]??[],ue=bt[$]??[];if(G.length===ue.length)return true;if(G.length===0)return false;let Fe=dr(D[$]);return G.includes(Fe)})),[Mt,bt,oe,o]),j=useMemo(()=>{if(xe.length===0)return null;let D=new Map;if(F.forEach(_e=>{let ne=Le.length>0?Le.map(te=>dr(_e[te])):[g$1("pivot.valueLabel")],me=Wr(ne);D.set(me,ne);}),D.size===0){let _e=Le.length>0?Le.map(()=>Ki):[g$1("pivot.valueLabel")];D.set(Wr(_e),_e);}let $=Array.from(D.entries()).sort((_e,ne)=>Fu(_e[1],ne[1])),G=$.flatMap(([_e,ne])=>xe.map(me=>{let te=R.get(me.fieldId),Ee=`${I(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::${Wr(Ee)}`,kt=te.find(Yr=>Yr.key===Xe);kt||(kt={key:Xe,label:Qe,children:[],leafColumnIds:[],path:ne.slice(0,Me+1),depth:Me},te.push(kt)),me.forEach(Yr=>{kt.leafColumnIds.includes(Yr.id)||kt.leafColumnIds.push(Yr.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=>dr(Ee[Me])):[g$1("pivot.valueLabel")];return Wr(Qe)===me.colKey});ne[me.id]=xn(te,me.valueItem.fieldId,me.valueItem.aggregation);}),ne},rt=[];if(Ge.length===0)rt.push({key:"root",value:g$1("pivot.resultLabel")||Ru,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=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=[...te,Me];return {key:Wr(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,R,F,I,Ge,g$1,xe]),ge=useCallback((D,$)=>(v.current+=1,{tokenId:`v${v.current}`,fieldId:D,aggregation:yo($,R.get(D))}),[R]),Te=useCallback(D=>{if(D==="rows")return ft([]);if(D==="columns")return Nt([]);if(D==="filters")return lt([]);Ft([]);},[]),Je=useCallback((D,$)=>{if(D==="rows")return ft(G=>G.filter(ue=>ue!==$));if(D==="columns")return Nt(G=>G.filter(ue=>ue!==$));if(D==="filters")return lt(G=>G.filter(ue=>ue!==$));Ft(G=>G.filter(ue=>ue.tokenId!==$));},[]),qe=useCallback((D,$)=>{Ft(G=>G.map(ue=>ue.tokenId===D?{...ue,aggregation:yo($,R.get(ue.fieldId))}:ue));},[R]),St=useCallback(D=>{xt(String(D.active.id));},[]),ht=useCallback(D=>{if(xt(null),!D.over)return;let $=qi(String(D.active.id)),G=qi(String(D.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&&Nt(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),Nt(rt),lt(_e),Ft(ne);return}if(ue==="values"){let Me=Qe("values"),Xe=te??ge(me);ne.splice(Me,0,Xe),ft(Fe),Nt(rt),lt(_e),Ft(ne);return}if(Ou(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),Nt(rt),lt(_e),Ft(ne);}},[Le,ge,pe,Ge,xe]),mt=useCallback((D,$)=>{Zt(G=>({...G,[D]:$}));},[]),yt=useCallback(D=>{Ot($=>{let G=new Set($);return G.has(D)?G.delete(D):G.add(D),G});},[]),ro=useCallback(D=>{re($=>{let G=new Set($);return G.has(D)?G.delete(D):G.add(D),G});},[]),Et=useCallback(D=>{let $=R.get(D.fieldId),G=Dl($);return f(vr,{size:"small",sx:{minWidth:98},children:f(zt,{value:D.aggregation,onChange:ue=>qe(D.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:I(ue)},ue))})})},[R,I,qe]),Yt=useCallback(D=>{let $=bt[D]??[],G=oe[D]??$;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(D=>{let $=bt[D]??[],G=oe[D]??$;return f(zu,{options:$,selectedValues:G,onChange:ue=>mt(D,ue)})},[bt,oe,mt]),Ut=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),$t=useCallback(()=>{let D={};return new Set([...Mt,...Object.keys(oe)]).forEach(G=>{if(!S.has(G))return;let ue=oe[G]??[];D[G]=[...ue];}),{layout:{rows:[...Ge],columns:[...Le],filters:[...pe],values:xe.map(G=>({fieldId:G.fieldId,aggregation:G.aggregation}))},filterSelections:D,showGrandTotal:ye,chart:{dimensionFieldId:je,primaryValueFieldId:st,secondaryValueFieldId:pt,chartType:Bt}}},[Mt,je,st,pt,Bt,Le,pe,oe,Ge,ye,S,xe]),to=useCallback(D=>{let $=so(D.layout.rows,S),G=so(D.layout.columns,S),ue=so(D.layout.filters,S),Fe=new Set,rt=(D.layout.values??[]).filter(me=>!S.has(me.fieldId)||Fe.has(me.fieldId)?false:(Fe.add(me.fieldId),true)).map(me=>ge(me.fieldId,me.aggregation)),_e={};Object.entries(D.filterSelections??{}).forEach(([me,te])=>{!S.has(me)||!Array.isArray(te)||(_e[me]=Array.from(new Set(te.map(Ee=>String(Ee)))));}),ft($),Nt(G),lt(ue),Ft(rt),Zt(_e),typeof D.showGrandTotal=="boolean"&&K(D.showGrandTotal),X(Ll($,G,D.chart?.dimensionFieldId));let ne=ts(rt,D.chart?.primaryValueFieldId);fe(ne),Se(Ol(rt,ne,D.chart?.secondaryValueFieldId)),Ae(D.chart?.chartType??"bar-vertical"),U(D.id),C?.(D);},[ge,C,X,fe,Se,Ae,Nt,lt,Zt,ft,K,Ft,S]),no=useCallback(D=>{if(!D){U("");return}let $=wt.find(G=>G.id===D);if(!$){U("");return}to($);},[to,wt]),fo=useCallback(()=>{let D=g$1("pivot.preset.defaultName",{index:wt.length+1});at(D),we(true);},[wt.length,g$1]),Io=useCallback(()=>{let D=Oe.trim();if(!D)return;let $={id:Ut(),name:D,...$t()};Ye(G=>[...G,$]),U($.id),we(false);},[$t,Ut,Oe,Ye]),Mo=useCallback(()=>{it&&(Ye(D=>D.filter($=>$.id!==it)),U(""));},[it,Ye]);useEffect(()=>{if(!b$1||y.current)return;let D=wt.find($=>$.id===b$1);D&&(y.current=true,to(D));},[to,b$1,wt]),useEffect(()=>{it&&(wt.some(D=>D.id===it)||U(""));},[it,wt]);let nr=useMemo(()=>{if(!ye||!j||!Ge.length)return null;let D={};return j.dataColumns.forEach($=>{let G=F.filter(ue=>{let Fe=Le.length>0?Le.map(rt=>dr(ue[rt])):[g$1("pivot.valueLabel")];return Wr(Fe)===$.colKey});D[$.id]=xn(G,$.valueItem.fieldId,$.valueItem.aggregation);}),{key:"__grand_total__",value:g$1("pivot.grandTotal")||Du,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:D,path:[],depth:-1}},[ye,j,F,Le,Ge.length,g$1]),Co=useMemo(()=>Qu(j?.rowTree??[]),[j]),Fo=useMemo(()=>Qu(j?.columnTree??[]),[j]);useEffect(()=>{Ot(D=>{let $=new Set;return D.has("__grand_total__")&&$.add("__grand_total__"),Co.forEach(G=>{D.has(G)&&$.add(G);}),$});},[Co]),useEffect(()=>{re(D=>{let $=new Set;return Fo.forEach(G=>{D.has(G)&&$.add(G);}),$});},[Fo]);let Ur=useCallback(()=>{Ot(D=>{let $=new Set(D);return Co.forEach(G=>$.add(G)),$});},[Co]),Kr=useCallback(()=>{Ot(D=>{let $=new Set;return D.has("__grand_total__")&&$.add("__grand_total__"),$});},[]),Ar=useCallback(()=>{re(new Set(Fo));},[Fo]),qr=useCallback(()=>{re(new Set);},[]),Xr=useMemo(()=>!j||Le.length===0?[]:Kv(j.columnTree,At),[Le.length,At,j]),Ro=useMemo(()=>{if(!j)return [];if(Le.length===0)return j.dataColumns.map($=>({id:$.id,label:$.label,leafColumnIds:[$.id],valueItem:$.valueItem}));let D=new Map(j.dataColumns.map($=>[$.id,$]));return Xr.flatMap($=>{let G=new Map;return $.leafColumnIds.forEach(ue=>{let Fe=D.get(ue);if(!Fe)return;let rt=Fe.valueItem.tokenId,_e=`${I(Fe.valueItem.aggregation)} ${R.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,R,I,j,xe.length,Xr]),Er=useMemo(()=>new Map(Ro.map(D=>[D.id,D])),[Ro]),Zr=useMemo(()=>Ro.map(D=>({id:D.id,colKey:D.id,valueItem:D.valueItem,label:D.label})),[Ro]),Xo=useMemo(()=>{if(!j||Le.length===0)return [];let D=[],$=ju(j.columnTree,At),G=$+(xe.length>1?1:0),ue=(Fe,rt)=>{D[rt]??(D[rt]=[]),Fe.forEach(_e=>{let ne=_e.children.length>0&&At.has(_e.key),me=Ro.filter(Ee=>_e.leafColumnIds.some(Qe=>Ee.leafColumnIds.includes(Qe))).length,te=ne||xe.length>1?1:G-rt;D[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&&(D[$]=Ro.map(Fe=>({key:Fe.id,label:Fe.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),D},[Le.length,At,j,xe.length,Ro]),ar=useCallback((D,$)=>$.leafColumnIds.reduce((G,ue)=>G+(D.aggregatedValues[ue]??0),0),[]),En=useMemo(()=>g(e,{children:[f(Pe,{size:"small",variant:"text",onClick:Ur,disabled:Co.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandRowsAll")}),f(Pe,{size:"small",variant:"text",onClick:Kr,disabled:Co.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:Ar,disabled:Fo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandColumnsAll")}),f(Pe,{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,Fo.size,Co.size,qr,Kr,Ar,Ur,g$1]),Lr=()=>{if(!Ze)return null;let D=qi(Ze);if(!D||D.kind!=="item"||!D.key)return null;if(D.zone==="palette"){let Fe=R.get(D.key);return Fe?f(Nl,{label:Fe.label,subtitle:Fe.type}):null}if(D.zone==="values"){let Fe=xe.find(me=>me.tokenId===D.key);if(!Fe)return null;let _e=R.get(Fe.fieldId)?.label??Fe.fieldId,ne=`${I(Fe.aggregation)}(${_e})`;return f(Zi,{label:_e,caption:ne})}let G=R.get(D.key)?.label??D.key,ue=Yt(D.key);return f(Zi,{label:G,caption:ue})};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(se,{direction:"row",spacing:1.5,alignItems:"center",children:[Wt&&g(e,{children:[f(vr,{size:"small",sx:{minWidth:200},children:g(zt,{value:it,displayEmpty:true,onChange:D=>no(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(ct,{title:g$1("pivot.preset.save"),children:f(ie,{size:"small",onClick:fo,"aria-label":g$1("pivot.preset.save"),sx:{width:28,height:28,p:0},children:f(Sr,{size:15})})}),f(ct,{title:g$1("pivot.preset.delete"),children:f("span",{children:f(ie,{size:"small",onClick:Mo,disabled:!it,"aria-label":g$1("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:f(ai,{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(ti,{size:"small",checked:ye,onChange:D=>K(D.target.checked)})]})]})]}),f(Rt,{}),g(DndContext,{sensors:x,collisionDetection:closestCenter,onDragStart:St,onDragEnd:ht,children:[f($u,{isConfiguratorCollapsed:De,onToggleCollapse:()=>z(D=>!D),availableFields:gt,fieldMap:R,filterFields:pe,columnFields:Le,rowFields:Ge,valueFields:xe,clearZone:Te,removeFieldFromZone:Je,getFilterSelectionSummary:Yt,renderDimensionFilterSelect:Ht,renderAggregationSelect:Et,getAggregationLabel:I}),f(Dd,{children:f(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Lr()})})]}),f(Zu,{rows:F,fieldMap:R,rowFields:Ge,columnFields:Le,valueFields:xe,chartDimensionFieldId:je,chartPrimaryValueFieldId:st,chartSecondaryValueFieldId:pt,chartType:Bt,isCollapsed:Xt,onChartDimensionFieldIdChange:D=>X(D),onChartPrimaryValueFieldIdChange:D=>fe(D),onChartSecondaryValueFieldIdChange:D=>Se(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=>R.get(D)?.label??D).join(" > "):g$1("pivot.table.dimensions"),collapsed:Vt,onToggleCollapse:()=>Ke(D=>!D),expandAriaLabel:g$1("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:En,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:w})}):f("div",{sx:{maxHeight:s},children:g("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[f("thead",{children:(Xo.length>0?Xo:[[]]).map((D,$)=>g("tr",{children:[$===0&&f("td",{rowSpan:Math.max(Xo.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=>R.get(G)?.label).join(" > "):g$1("pivot.table.dimensions")}),(D.length>0?D:Ro.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(Wo,{size:12}):f(wr,{size:12})}),f("div",{component:"span",children:G.label})]})},G.key))]},`pivot-header-row-${$}`))}),g("tbody",{children:[j.rowTree.map(D=>f(Ji,{node:D,dataColumns:Zr,fieldMap:R,level:0,expandedKeys:It,onToggle:yt,getValue:($,G)=>{let ue=Er.get(G);return ue?ar($,ue):0}},D.key)),nr&&f(Ji,{node:nr,dataColumns:Zr,fieldMap:R,level:0,expandedKeys:It,onToggle:yt,getValue:(D,$)=>{let G=Er.get($);return G?ar(D,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:D=>at(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),Io());}})}),g("div",{className:"orb-dialog-actions",children:[f(Pe,{onClick:()=>we(false),children:g$1("common.cancel")}),f(Pe,{variant:"contained",onClick:Io,disabled:!Oe.trim(),children:g$1("common.save")})]})]})]})};var Ju=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},Bl=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",em=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",uO=({fields:t,initialLayout:o,initialFilterSelections:r={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:l=false})=>{let d=useRef(0),p=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,p)),[u,b]=useState(()=>so(o?.columns,p)),[C,g]=useState(()=>so(o?.filters,p)),[x,v]=useState(()=>{let U=o?.values??[],Re=new Set,we=[];return U.forEach(Oe=>{!p.has(Oe.fieldId)||Re.has(Oe.fieldId)||(Re.add(Oe.fieldId),d.current+=1,we.push({tokenId:`v${d.current}`,fieldId:Oe.fieldId,aggregation:yo(Oe.aggregation,m.get(Oe.fieldId))}));}),we}),[y,k]=useState(r),[w,P]=useState(n),[I,S]=useState(a),[R,N]=useState(()=>Ju(so(o?.rows,p),so(o?.columns,p),i?.dimensionFieldId)),[T,M]=useState(()=>{let U=(()=>{let Re=o?.values??[],we=new Set,Oe=[];return Re.forEach(at=>{!p.has(at.fieldId)||we.has(at.fieldId)||(we.add(at.fieldId),Oe.push({tokenId:at.fieldId,fieldId:at.fieldId,aggregation:yo(at.aggregation,m.get(at.fieldId))}));}),Oe})();return Bl(U,i?.primaryValueFieldId)}),[A,L]=useState(()=>{let U=(()=>{let we=o?.values??[],Oe=new Set,at=[];return we.forEach(Ze=>{!p.has(Ze.fieldId)||Oe.has(Ze.fieldId)||(Oe.add(Ze.fieldId),at.push({tokenId:Ze.fieldId,fieldId:Ze.fieldId,aggregation:yo(Ze.aggregation,m.get(Ze.fieldId))}));}),at})(),Re=Bl(U,i?.primaryValueFieldId);return em(U,Re,i?.secondaryValueFieldId)}),[W,ee]=useState(i?.chartType??"bar-vertical"),[O,_]=useState(s),[V,Q]=useState(l);useEffect(()=>{f(U=>{let Re=U.filter(we=>p.has(we));return pr(U,Re)?U:Re}),b(U=>{let Re=U.filter(we=>p.has(we));return pr(U,Re)?U:Re}),g(U=>{let Re=U.filter(we=>p.has(we));return pr(U,Re)?U:Re}),v(U=>{let Re=U.filter(we=>p.has(we.fieldId)).map(we=>({...we,aggregation:yo(we.aggregation,m.get(we.fieldId))}));return Xi(U,Re)?U:Re});},[m,p]),useEffect(()=>{N(U=>Ju(h,u,U));},[u,h]),useEffect(()=>{M(U=>Bl(x,U));},[x]),useEffect(()=>{L(U=>em(x,T,U));},[T,x]);let H=useCallback(U=>{f(so(U,p));},[p]),B=useCallback(U=>{b(so(U,p));},[p]),q=useCallback(U=>{g(so(U,p));},[p]),Z=useCallback(U=>{v(Re=>{let we=U??[],Oe=new Set,at=[];return we.forEach(Ze=>{if(!p.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:yo(Ze.aggregation??xt.aggregation,m.get(Ze.fieldId))});return}d.current+=1,at.push({tokenId:`v${d.current}`,fieldId:Ze.fieldId,aggregation:yo(Ze.aggregation,m.get(Ze.fieldId))});}),at});},[m,p]),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:yo(Re,m.get(Oe.fieldId))}:Oe));},[m]),ze=useCallback((U,Re)=>{k(we=>({...we,[U]:Re}));},[]),be=useCallback(()=>{k({});},[]),Ce=useCallback(()=>{P(U=>!U);},[]),Be=useCallback(()=>{S(U=>!U);},[]),de=useCallback(U=>{N(U);},[]),ve=useCallback(U=>{M(U);},[]),We=useCallback(U=>{L(U);},[]),et=useCallback(()=>{_(U=>!U);},[]),nt=useCallback(()=>{Q(U=>!U);},[]);return {model:useMemo(()=>({rowFields:h,setRowFields:f,columnFields:u,setColumnFields:b,filterFields:C,setFilterFields:g,valueFields:x,setValueFields:v,filterSelections:y,setFilterSelections:k,showGrandTotal:w,setShowGrandTotal:P,isConfiguratorCollapsed:I,setIsConfiguratorCollapsed:S,chartDimensionFieldId:R,setChartDimensionFieldId:N,chartPrimaryValueFieldId:T,setChartPrimaryValueFieldId:M,chartSecondaryValueFieldId:A,setChartSecondaryValueFieldId:L,chartType:W,setChartType:ee,isChartCollapsed:O,setIsChartCollapsed:_,isTableCollapsed:V,setIsTableCollapsed:Q}),[R,T,A,W,u,C,y,O,I,V,h,w,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 fO=({orientation:t="auto",defaultNavigationOpen:o,onNavOpenChange:r}={})=>{let n=io(),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 p=h=>{d(h),r?.(h);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:l,setNavigationOpen:p,toggleNavigationOpen:()=>p(!l)}};var jv=t=>{let o=Number(t||0);return Number.isFinite(o)?o:0},yO=({rows:t,rowKey:o="id",numericField:r,defaultSelectedId:n})=>{let i=t[0]?.[o],[s,l]=useState(n??i),d=useMemo(()=>t.find(u=>u[o]===s)||t[0],[o,t,s]),[p,m]=useState(()=>{let u=d?.[r];return u==null?"0":String(u)});return {selectedId:s,selectedRecord:d,editorValue:p,setEditorValue:m,selectRecord:u=>{let b=u[o];l(b);let C=u[r];m(C==null?"0":String(C));},applyEditorValue:u=>{if(s===void 0)return;let b=jv(p),C=t.map(g=>g[o]===s?{...g,[r]:b}:g);u(C);}}};var Jv=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],om=(t,o,r,n)=>{o?.(t),n&&r?.();},PO=({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=Jv,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:l=true,scanIntervalMs:d=600,confirmLabel:p="Use code",cancelLabel:m="Close",manualPlaceholder:h="Enter barcode manually",onDetected:f$1,onError:u,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,k]=Jt__default.useState("idle"),[w,P]=Jt__default.useState(""),[I,S]=Jt__default.useState(null),[R,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);},[]),M=Jt__default.useCallback(L=>{N(L),k("error"),u?.(L);},[u]);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 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){k("unsupported"),N("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}v.current=new window.BarcodeDetector({formats:a}),k("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};S(V),T(),om(V,f$1,o,l);}catch(O){M(O instanceof Error?O.message:"Failed to detect barcode.");}},d);}catch(ee){M(ee instanceof Error?ee.message:"Unable to start camera.");}}})(),()=>{L=true,T();}},[l,i,a,o,f$1,t,M,d,T]);let A=()=>{let L=w.trim();if(!L)return;let W={rawValue:L,format:"manual"};S(W),om(W,f$1,o,l);};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(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(_d,{}),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(sp,{}),label:`${I.format||"barcode"}: ${I.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),R?f(jo,{severity:y==="unsupported"?"info":"warning",children:R}):null,s?g(se,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[f(He,{fullWidth:true,label:"Barcode",placeholder:h,value:w,onChange:L=>P(L.target.value)}),f(Pe,{variant:"contained",onClick:A,sx:{minHeight:56,px:2.5},children:p})]}):null]})}),f("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:f(Pe,{onClick:o,children:m})})]})};var ey={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)"},AO=({title:t,description:o,kicker:r,icon:n,badges:a=[],metrics:i=[],footer:s,children:l,selected:d=false,draggable:p=false,isDragging:m=false,swipeThreshold:h=88,startAction:f$1,endAction:u,dragHandleProps:b$1,onClick:C,onSwipe:g$1,sx:x})=>{let[v,y]=useState(0),[k,w]=useState(false),P=useRef(null),I=useRef(0),S=useRef(0),R=!!(f$1||u),N=132,T=()=>{y(0),w(false),P.current=null,I.current=0,S.current=0;},M=O=>{(O==="start"?f$1:u)?.onTrigger?.(),g$1?.(O),T();},A=O=>{!R||O.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(P.current=O.pointerId,I.current=O.clientX,S.current=O.clientX,w(true),O.currentTarget.setPointerCapture(O.pointerId));},L=O=>{if(!k||P.current!==O.pointerId)return;S.current=O.clientX;let _=S.current-I.current,V=Math.max(-N,Math.min(N,_));y(V);},W=O=>{if(!k||P.current!==O.pointerId)return;let _=S.current-I.current;if(_>=h&&f$1){M("start");return}if(_<=-h&&u){M("end");return}Math.abs(_)<12&&C?.(),T();},ee=(O,_)=>{if(!O)return null;let V=O.backgroundColor||ey[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(u,"right"),f(Ne,{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: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(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]}),p?f("div",{"data-no-swipe":"true",...b$1,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:f(ie,{size:"small",children:f(Yd,{})})}):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(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 ma=({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}),VO=({value:t,defaultValue:o="",title:r,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:l,confirmLabel:d,clearLabel:p,backspaceLabel:m,onChange:h,onSubmit:f$1,onClose:u,sx:b})=>{let{t:C}=ce(),[g$1,x]=useState(o),v=t??g$1,y=T=>{t===void 0&&x(T),h?.(T);},k=T=>{l&&v.length>=l||y(`${v}${T}`);},w=T=>{if(T==="00"){if(!v){y("0");return}k("00");return}k(T);},P=()=>{!i||v.includes(".")||y(v?`${v}.`:"0.");},I=()=>{if(s){if(v.startsWith("-")){y(v.slice(1));return}y(v?`-${v}`:"-");}},S=()=>{y(v.slice(0,-1));},R=()=>{y("");},N=()=>{f$1?.(v);};return f(Ne,{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]}),u?f(ie,{onClick:u,size:"small",children:f(Xd,{})}):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: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(ma,{label:T,onPress:()=>w(T)},T)),f(ma,{label:s?"+/-":"00",onPress:s?I:()=>w("00")}),f(ma,{label:"0",onPress:()=>w("0")}),f(ma,{label:i?".":m?String(m):"DEL",onPress:i?P:S})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[f("div",{component:"button",type:"button",onClick:S,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($d,{}),f(E,{sx:{fontWeight:700},children:m||"DEL"})]})}),f(ma,{label:String(p||"CLR"),onPress:R,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(Ud,{}),f(E,{sx:{fontWeight:800},children:d||C("common.ok")})]})})]})]})})};var nm=({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 ay=(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);}},am=({items:t,selectedId:o,orientation:r="auto",onItemSelect:n,sx:a})=>{let i=io(),[s,l]=useState(false);useEffect(()=>{l(true);},[]);let d=yr("(orientation: portrait)"),p=yr(i.breakpoints.down("md")),m=r==="auto"?d||p?"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 u=f$1.id===o,b$1=f$1.color||(u?i.palette.primary.main:i.palette.divider);return f(Ne,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:u?"primary.main":"divider",boxShadow:u?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:b()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:f("div",{component:"button",type:"button",disabled:f$1.disabled,onClick:()=>ay(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:u?"var(--orb-on-primary)":"text.primary",background:u?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:u?"primary.main":"action.hover",color:u?"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 lm=(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?lm(n.children,o):[];return (a||i.length>0)&&r.push({...n,children:i.length>0?i:n.children}),r},[]):t,cy=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children?.length&&(o.add(a.id),r(a.children));});};return r(t),o},cm=({collapsed:t=false,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:l,footerSlot:d,activeHref:p,onItemSelect:m})=>{let{t:h}=ce(),f$1=io(),u=Do("(orientation: portrait)"),b=Do(f$1.breakpoints.down("md")),C=s==="auto"?u||b?"portrait":"landscape":s,g$1=i==="dark",x=useRouter(),v=usePathname(),[y,k]=useState(""),[w,P]=useState(new Set),I=useMemo(()=>lm(a,y),[a,y]),S=useMemo(()=>y.trim()?cy(I):w,[w,I,y]);useEffect(()=>{t&&P(new Set);},[t]);let R=L=>L.appurl||L.href||"",N=L=>{m?.(L);let W=R(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){P(ee=>{let O=new Set(ee);return O.has(L.id)?O.delete(L.id):O.add(L.id),O});return}N(L);},M=L=>{let W=p||v,ee=R(L);return !!(ee&&W===ee)},A=(L,W=0)=>{let ee=!!L.children?.length,O=S.has(L.id),_=M(L);return f("div",{sx:{pl:W===0?0:1.5},children:g(Ne,{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(Ja,{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(rn,{sx:{transform:O?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):f(ri,{color:"action"})]}),ee?f(on,{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(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(se,{spacing:1,children:[f(ie,{onClick:o,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:h("navigation.expand"),children:f(ci,{})}),a.map(L=>f(ie,{onClick:()=>T(L),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:M(L)?"primary.main":"action.hover",color:M(L)?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()},L.id))]})}):f(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(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=>k(L.target.value),placeholder:h("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:f(lp,{fontSize:"small",color:"action"})}}),C==="landscape"&&!t?f(ie,{onClick:o,sx:{bgcolor:"action.hover"},children:f(rp,{})}):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 dm=(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)},dy=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}),py=(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)},uy=({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(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(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}`))})]})})},my=t=>{let{t:o}=ce(),r=io(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:m=false,fullWidth:h=false,maxHeight:f$1,loading:u=false,rowsPerPageOptions:b$1=[20,50,100,-1],onLayoutSave:C,filterConfig:g$1,rowKey:x,tableKey:v="default",graphReport:y,quickCreate:k,quickEdit:w,quickDelete:P,serviceUrl:I,orientation:S="auto",cardTitleField:R,cardSubtitleFields:N,toolbarSlot:T,emptyState:M,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=S==="auto"?_||V?"portrait":"landscape":S,{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:De,handleLayoutSave:je,effectiveAppId:st,currentLayoutData:pt,currentLayoutId:Bt,layoutIdToLoad:Xt,graphReportOpen:Vt,handleOpenGraphReport:wt,handleCloseGraphReport:Wt}=hn(t),ft=y?.enabled??false,Nt=ft&&(y?.interaction?.enabled??true),lt=Mi(),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=!!k?.enabled,Se=!!w?.enabled,Ae=!!P?.enabled,$e=k?.fields,Ke=k?.excludeFields||[],Ye=k?.initialValues||{},ut=w?.fields,gt=w?.excludeFields||[],Mt=w?.editableFields||[],bt=w?.nonEditableFields||[],F=w?.primaryKeys?.length?w.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=u||Te||yt||$t,fo=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]),Io=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]),Mo=Jt__default.useMemo(()=>new Set(F),[F]),nr=Jt__default.useMemo(()=>new Set(Mt),[Mt]),Co=Jt__default.useMemo(()=>new Set(bt),[bt]),Fo=Jt__default.useCallback(te=>nr.size>0?nr.has(te):!(Co.has(te)||Mo.has(te)),[nr,Co,Mo]);Jt__default.useEffect(()=>{!Vt&<.hasActiveFilters&<.clearAll();},[lt,Vt]);let Ur=()=>{let te={};fo.forEach(Ee=>{te[Ee.id]=Ye[Ee.id]??"";}),St(te),ge(true);},Kr=(te,Ee)=>{St(Qe=>({...Qe,[te]:Ee}));},Ar=async()=>{if(!k?.onSubmit){ge(false);return}try{Je(!0),await k.onSubmit(qe),ge(!1);}finally{Je(false);}},qr=()=>{if(!X)return;let te={};Io.forEach(Qe=>{te[Qe.id]=X[Qe.id]??"";});let Ee=w?.getInitialValues?{...te,...w.getInitialValues(X)}:te;Yt(Ee),mt(true);},Xr=(te,Ee)=>{Yt(Qe=>({...Qe,[te]:Ee}));},Ro=async()=>{if(X){if(!w?.onSubmit){mt(false);return}try{ro(!0),await w.onSubmit(Et,X),mt(!1);}finally{ro(false);}}},Er=()=>{z.length!==0&&Ut(true);},Zr=async()=>{if(z.length===0){Ut(false);return}if(!P?.onConfirm){Ut(false),It([]),l?.([]);return}try{to(!0),await P.onConfirm(z),Ut(!1),It([]),l?.([]);}finally{to(false);}},Xo=it,{fieldMapping:ar}=pn({rows:Xo,config:{...y,title:y?.title||`${O} ${o("graph.reportTitle")}`}}),En=Jt__default.useMemo(()=>Nt?lt.applyRows(Xo,ar):Xo,[ar,lt,Nt,Xo]),{model:Lr}=pn({rows:En,config:{...y,title:y?.title||`${O} ${o("graph.reportTitle")}`,fieldMapping:ar}}),D=Lr.table.columns.map(te=>({id:te.id,label:te.label,align:te.align||"left",minWidth:120,numeric:te.align==="right"})),$=st?f(gn,{appId:st,tableKey:v,currentLayoutData:pt,onLayoutLoad:ye,targetLayoutId:Xt,activeLayoutId:Bt,serviceUrl:I??g$1?.serviceUrl}):null,G=H.filter(te=>Z.includes(te.id)),ue=G.find(te=>te.id===R)||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,p].filter(Boolean),ne=g(e,{children:[f(cn,{groupAnchorEl:Ce,setGroupAnchorEl:Be,grouping:he,setGrouping:ze,columns:H}),f(dn,{anchorEl:We,setAnchorEl:et,columns:H,visibleColumns:Z,toggleColumnVisibility:Le}),f(Ci,{anchorEl:de,setAnchorEl:ve,showSummary:Y,setShowSummary:J,columns:H,summaryColumns:le,toggleSummaryColumn:At}),f(xi,{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),Yr=tt(r.palette.divider,.22);return f(Ne,{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):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(se,{spacing:1.25,children:[g(se,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?f(Tt,{checked:Me,onClick:wo=>wo.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:dm(ue,te)}):null,Fe.length>0?f(se,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Fe.map(wo=>f(Ct,{label:`${wo.label}: ${py(wo,te)}`,size:"small",variant:"outlined",sx:Zt},`${Ee}-${wo.id}`))}):null]}),L?f("div",{onClick:wo=>wo.stopPropagation(),children:L(te)}):null]}),rt.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:Xe,gap:1},children:rt.map(wo=>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:wo.label}),dy(dm(wo,te))]},`${Ee}-${wo.id}-detail`))}):null,W?g(e,{children:[f(Rt,{}),f("div",{onClick:wo=>wo.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(nm,{...g$1,onVariantLoad:te=>{De(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: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":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(fi,{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:Ur,showEditButton:Se,onOpenEditDialog:qr,editDisabled:z.length!==1,showDeleteButton:Ae,onOpenDeleteConfirm:Er,deleteDisabled:z.length===0,onLayoutSave:C||g$1?.variantService&&g$1?.appId?je:void 0,loading:u,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&&!u?M||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((te,Ee)=>{if(te.type==="group"){let Xe=be.has(te.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:()=>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(rn,{}):f(ri,{}),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(uy,{summaryRow:U,visibleColumns:Z,columns:H}):null,u?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: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:[fo.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=>Kr(te.id,Qe.target.value),type:Ee,fullWidth:true,InputLabelProps:{shrink:Ee==="date"?true:void 0}},`quick-create-${te.id}`)}),k?.description?f(jo,{severity:"info",children:k.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Pe,{onClick:()=>ge(false),disabled:Te,children:k?.cancelLabel||o("common.cancel")}),f(Pe,{onClick:Ar,variant:"contained",disabled:Te,children:k?.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:w?.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:[Io.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=>Xr(te.id,Qe.target.value),type:Ee,disabled:!Fo(te.id),fullWidth:true,InputLabelProps:{shrink:Ee==="date"?true:void 0}},`quick-edit-${te.id}`)}),w?.description?f(jo,{severity:"info",children:w.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Pe,{onClick:()=>mt(false),disabled:yt,children:w?.cancelLabel||o("common.cancel")}),f(Pe,{onClick:Ro,variant:"contained",disabled:yt||!X,children:w?.submitLabel||o("common.save")})]})]}):null,Ae?f(Yn,{open:Ht,type:"warning",title:P?.title||o("quickDelete.confirmTitle"),message:P?.message||(z.length>1?o("quickDelete.confirmMessageMultiple",{count:z.length}):o("quickDelete.confirmMessageSingle")),confirmText:P?.confirmText||o("common.delete"),cancelText:P?.cancelText||o("common.cancel"),onClose:()=>!$t&&Ut(false),onConfirm:Zr}):null,ne,ft?f(Ti,{open:Vt,onClose:Wt,model:Lr,aiAssistant:y?.aiAssistant,interaction:Nt?{enabled:true,filters:lt.filters,fieldMapping:ar,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(my,{appId:st||"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 LF=({appTitle:t,children:o,menuData:r=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:l="auto",logo:d,headerSlot:p,actionSlot:m,portraitBottomSlot:h,contentSx:f$1,containerSx:u,user:b,onSearch:C,onSearchAdd:g$1,defaultNavigationOpen:x,navOpen:v,onNavOpenChange:y,onWorkloadSelect:k,locale:w="en",localeLabel:P,localeOptions:I,onLocaleChange:S,onUserSetting:R,onUserLogout:N,userMenuItems:T,leftHeaderSlot:M,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=l==="auto"?!V||Z||Y?"portrait":"landscape":l,[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(ci,{})}):null,M]}),de=g(se,{direction:"row",spacing:1,alignItems:"center",children:[m,A]}),ve=f(cm,{collapsed:J==="landscape"?!be:false,onToggle:()=>Ce(!be),menuData:r,orientation:J,colorMode:q,maxHeight:J==="landscape"?900:void 0});return f(Ln,{mode:W,children:f(Ua,{locale:w,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(u)?u:[u]],children:[f(_i,{appTitle:t,logo:d===void 0?null:d,mode:W,onToggleMode:()=>ee(We=>We==="system"?"dark":We==="dark"?"light":"system"),locale:w,localeLabel:P,localeOptions:I,onLocaleChange:S,user:b,onUserSetting:R,onUserLogout:N,userMenuItems:T,onSearch:C,onSearchAdd:g$1,leftSlot:Be,rightSlot:de}),p?f("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:p}):null,g("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[V&&i&&J==="landscape"?f("div",{sx:{p:1.5,pr:0,flexShrink:0},children:ve}):null,!V||i&&J==="portrait"?f(Ed,{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(am,{items:n,selectedId:a,orientation:J,onItemSelect:k}):null,f(Ne,{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 pm=gy(()=>import('./COrbCanvas-4PZFJUYO.mjs').then(t=>t.COrbCanvas),{ssr:false,loading:()=>f("div",{className:"h-full w-full bg-transparent"})});function zl({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(pm,{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(pm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var zF=zl;var mm=createContext(null);function xy(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 wy({children:t,onVoiceSubmit:o,onVoicePartial:r,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:l=true,wsUrl:d,silenceThresholdMs:p,minVolumeRms:m}){let[h,f$1]=useState(false),[u,b]=useState(false),C=useRef(null),g$1=useRef(false),x=useRef(false),v=useCallback(()=>{x.current=false,f$1(false);},[]),{isRecording:y,startRecording:k,stopRecording:w}=Cn({wsUrl:d,silenceThresholdMs:p,minVolumeRms:m,onTextUpdate:R=>{r?.(R);},onComplete:async R=>{try{R.trim()&&(b(!0),await o(R.trim()));}catch(N){let T=N instanceof Error?N.message:"Failed to process voice command";n?.(T);}finally{b(!1),v();}},onError:R=>{n?.(R),b(!1),g$1.current||v();}}),P=useCallback(async()=>{x.current=false,await k();},[k]),I=useCallback(()=>{w();},[w]);useEffect(()=>{if(i)return;let R=T=>{T.isComposing||(T.code==="Space"||T.key===" ")&&(g$1.current||T.repeat||s&&xy(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),w()));};return window.addEventListener("keydown",R),window.addEventListener("keyup",N),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",N),C.current&&(clearTimeout(C.current),C.current=null);}},[i,s,a,k,w]);let S=useMemo(()=>({isRecording:y,isHotkeyRecording:h,isSubmitting:u,startRecording:P,stopRecording:I}),[h,y,u,P,I]);return g(mm.Provider,{value:S,children:[l?f(zl,{isRecording:h}):null,t]})}function Sy(){let t=useContext(mm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var UF=wy,KF=Sy;function ot(...t){return twMerge(clsx(t))}var My=({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(Ea,{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(Bo,{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})]})},gm=My;var Ey=({content:t,language:o="text",isStreaming:r=false,className:n=""})=>{let a=go(),[i,s]=useState(false),l=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3);}catch(p){console.error("\u590D\u5236\u5931\u8D25:",p);}},d=a==="dark"?oneDark:oneLight;return g("div",{className: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:l,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:r,title:i?"Copied":"Copy code",children:i?f(xo,{size:14,className:"text-[var(--orb-status-success)]"}):f(Nc,{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})})]})},hm=Ey;var bm="orb-html-demo",vm="orb-html-demo-ping",ns=16,By=2,Hy=2e3,zy=300,Vy=96,Wy=200,$y=560,_y=320,$l=`<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(bm)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);addEventListener('message',function(event){if(event.data&&event.data.source===${JSON.stringify(vm)})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>`,Gy="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",Uy=t=>/<html[\s>]/i.test(t),Ky=t=>{let o=t.trim();return Uy(o)?/<\/body>/i.test(o)?o.replace(/<\/body>/i,`${$l}</body>`):`${o}${$l}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${Gy}</style></head><body>${o}${$l}</body></html>`},qy=t=>{let o=/<title[^>]*>([^<]+)<\/title>/i.exec(t)?.[1]?.trim();return o||(/<h1[^>]*>([^<]+)<\/h1>/i.exec(t)?.[1]?.trim()??null)},Xy=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`},Zy=t=>`${t.toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"interactive-demo"}.html`,Yy=(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);},ba=new Map,Gl="orb-html-demo-store",Qy=t=>t.replace(/^\s+/,"").slice(0,Vy),_l=(t,o)=>{ba.set(t,o),window.dispatchEvent(new CustomEvent(Gl));},jy=({content:t,title:o})=>{let{t:r}=ce(),n=go(),a=Qy(t),[i,s]=useState(()=>ba.get(a)?.open??false),[l,d]=useState(()=>ba.get(a)?.view??"preview"),[p,m]=useState(false),[h,f$1]=useState(_y),u=useRef(null),b=useRef(null),C=useRef(false),g$1=useRef(false),x=useRef(t),v=M=>_l(a,{open:M,view:l}),y=M=>_l(a,{open:i,view:M}),k=()=>{g$1.current=true,v(false);};useEffect(()=>{let M=()=>{let A=ba.get(a);s(A?.open??false),d(A?.view??"preview");};return window.addEventListener(Gl,M),()=>window.removeEventListener(Gl,M)},[a]),useEffect(()=>{x.current!==t&&(x.current=t,ba.has(a)||_l(a,{open:true,view:"preview"}));},[t,a]);let[w,P]=useState(t);useEffect(()=>{if(t===w)return;let M=window.setTimeout(()=>P(t),zy);return ()=>window.clearTimeout(M)},[t,w]);let I=useMemo(()=>Ky(w),[w]);useEffect(()=>{if(!i)return;let M=A=>{let L=A.data;!L||L.source!==bm||typeof L.height!="number"||b.current&&A.source!==b.current.contentWindow||f$1(Math.max(Wy,Math.min($y,Math.ceil(L.height))));};return window.addEventListener("message",M),b.current?.contentWindow?.postMessage({source:vm},"*"),()=>window.removeEventListener("message",M)},[i]);let S=o??qy(t)??r("agentui.html.defaultTitle"),R=useMemo(()=>new TextEncoder().encode(t).length,[t]);useEffect(()=>{if(!p)return;let M=window.setTimeout(()=>m(false),Hy);return ()=>window.clearTimeout(M)},[p]),useEffect(()=>{if(i){C.current=true;return}C.current&&(C.current=false,g$1.current&&(g$1.current=false,u.current?.focus()));},[i]);let N=()=>{navigator.clipboard.writeText(t).then(()=>m(true));},T=()=>Yy(new Blob([t],{type:"text/html;charset=utf-8"}),Zy(S));return i?g("section",{className:"orb-html-demo","aria-label":S,"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:S,children:S}),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":By,"--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(p?"agentui.html.copied":"agentui.html.copy"),title:r(p?"agentui.html.copied":"agentui.html.copy"),onClick:N,children:p?f(xo,{size:ns}):f(No,{size:ns})}),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(Fn,{size:ns})}),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(Kt,{size:ns})})]})]}),g("div",{className:"orb-html-demo-body",children:[f("iframe",{ref:b,className:"orb-html-demo-frame",title:S,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:u,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:S}),g("span",{className:"orb-html-demo-meta",children:["HTML \xB7 ",Xy(R)]})]}),f("span",{className:"orb-html-demo-openpill",children:r("agentui.html.open")})]})},ym=jy;var tC=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"},oC=({content:t,isLoading:o,className:r="",style:n})=>{let a=useRef(null),[i,s]=useState(false),[l,d]=useState(null),p=go();return useEffect(()=>{let m=false,h=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{xm.initialize({startOnLoad:!1,theme:p==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit",flowchart:{htmlLabels:!1}});let u=`mermaid-${Math.random().toString(36).substr(2,9)}`,b=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:C,bindFunctions:g}=await xm.render(u,b);!m&&a.current&&(a.current.innerHTML=C,g?.(a.current));}catch(u){if(m)return;console.error("Mermaid render failed:",u),d(u instanceof Error?u.message:"Render failed");}finally{m||s(false);}}},f=setTimeout(()=>{h();},100);return ()=>{m=true,clearTimeout(f);}},[t,p]),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:tC(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":""}`})]})},wm=oC;var rC=({title:t="\u53D1\u751F\u9519\u8BEF",content:o,errorCode:r,stack:n,icon:a,closable:i=true,onClose:s,onRetry:l,className:d="",...p})=>{let[m,h]=useState(false),[f$1,u]=useState(false),b=async()=>{if(l){u(true);try{await l();}catch(C){console.error("\u91CD\u8BD5\u5931\u8D25:",C);}finally{u(false);}}};return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...p,children:[g("div",{className:"flex p-4 border-l-4 border-l-[var(--orb-status-error)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]",children:[f("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:a||f(Ia,{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: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(qc,{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(Bo,{className:"w-3.5 h-3.5 mr-1"}):f(Ho,{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})})]})},as=rC;var nC=({title:t="\u8B66\u544A",content:o,warningType:r,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:l,onConfirm:d,actionText:p,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)]"}}},u=()=>{switch(n){case "info":return f(Aa,{className:"w-5 h-5"});case "error":return f(Va,{className:"w-5 h-5"});case "success":return f(Ma,{className:"w-5 h-5"});default:return f(Rc,{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||u()}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center justify-between mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&f("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:r})]}),o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:o}),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(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:p||"\u786E\u8BA4"})})]})},is=nC;var aC=({title:t="\u76F8\u5173\u63A8\u8350",content:o,suggestions:r,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:l,className:d="",...p})=>{let[m,h]=useState(false),[f$1,u]=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}`,...p,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[g("div",{className:"flex items-center space-x-2.5",children:[f("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||f(Ea,{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(zo,{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(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=>u(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(zo,{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:()=>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(Ho,{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"})]})]})},ss=aC;var iC=({title:t,content:o,toolName:r,parameters:n,result:a,status:i,duration:s,icon:l,closable:d=false,onClose:p,onAction:m,actionText:h,className:f$1="",...u})=>{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(Vc,{className:"w-5 h-5 animate-spin"});case "error":return f(Va,{className:"w-5 h-5"});default:return f(Ma,{className:"w-5 h-5"})}},k=I=>I?I<1e3?`${I}ms`:`${(I/1e3).toFixed(2)}s`:"",w=v(),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}`,...u,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[g("div",{className:"flex items-center space-x-3",children:[f("div",{className:`flex-shrink-0 ${w.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 ${w.badgeBg} ${w.badgeText}`,children:w.label})]}),r&&t&&g("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[f(zn,{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(Ac,{className:"w-3 h-3 mr-1"}),k(s)]}),d&&p&&f("button",{onClick:p,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(Bo,{className:"w-3.5 h-3.5 mr-1"}):f(Ho,{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(Bo,{className:"w-3.5 h-3.5 mr-1"}):f(Ho,{className:"w-3.5 h-3.5 mr-1"}),f(zn,{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"})})]})]})},ls=iC;var lC=({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(er,{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]})})},cs=lC;var cC=({title:t,subtitle:o,data:r,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return f(zs,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return f(zc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return f(Kc,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return f(Mc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return f(Bc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return f(Fc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return f(Jc,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return f(Hn,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return f($c,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return f(zs,{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(ta,{data:r,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return f(Ap,{data:r,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let l=r.reduce((p,m)=>p+(Number(m.value)||0),0),d=r.map(p=>({name:p.name,value:Number(p.value)||0,percent:typeof p.percent=="number"?p.percent:l>0?(Number(p.value)||0)/l*100:0}));return f(Si,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return f(Ep,{data:r,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return f(Lp,{data:r});case "fishbone-chart-card":return f(Op,{branches:r,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return f(Fp,{data:r,height:a.height});case "google-map-card":return f(Bp,{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(Hp,{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)})]})})]})]})},ds=cC;var hs=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],dC={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},ms=480,Tn=214,Gt={top:18,right:16,bottom:38,left:30},eo=t=>typeof t=="number"&&Number.isFinite(t)?t:0,Mm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Ko=(t,o)=>`${t.id||t.label}-${o}`,Rm=(t,o=13)=>t.length>o?`${t.slice(0,Math.max(1,o-1))}\u2026`:t,gs=(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)}:{},Dm=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}},pC=(t,o,r)=>{let n=ms-Gt.left-Gt.right,a=Tn-Gt.top-Gt.bottom,{max:i,range:s}=Dm(r),l=Gt.left+t*n/Math.max(r.length-1,1),d=Gt.top+(i-eo(o.value))/s*a,p=Gt.top+i/s*a;return {x:l,y:d,zeroY:p}},us=(t,o,r,n)=>{let a=(n-90)*Math.PI/180;return {x:t+r*Math.cos(a),y:o+r*Math.sin(a)}},uC=(t,o,r,n,a,i)=>{let s=us(t,o,r,i),l=us(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 p=us(t,o,n,i),m=us(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 ${p.x} ${p.y} Z`},mC=({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})]}),gC=()=>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());}}:{},...gr(t,r),style:{cursor:o||r?"pointer":"default"}}},hC=({loading:t,error:o,hasData:r,emptyState:n,children:a})=>t?f(gC,{}):o?f("div",{className:"orb-metric-error",role:"alert",children:o}):r?f(e,{children:a}):f(mC,{children:n??"No data for the current selection."}),fC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(l=>Math.abs(eo(l.value))),1);return f("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=eo(l.value),m=`${gs(Math.abs(p)/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(p)})]});return r?f("button",{type:"button",className:`orb-metric-bar-row${h?" is-active":""}`,onClick:()=>r(l),title:`${l.label}: ${a(p)}`,"aria-pressed":h,...gr(l,n),children:f$1},Ko(l,d)):f("div",{className:`orb-metric-bar-row${h?" is-active":""}`,role:"listitem",...gr(l,n),children:f$1},Ko(l,d))})})},bC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((l,d)=>l+Math.max(eo(d.value),0),0),1);return f("div",{className:"orb-metric-progress",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=Math.max(eo(l.value),0),m=gs(p/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(p)})]}),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},Ko(l,d)):f("div",{className:`orb-metric-progress-row${h?" is-active":""}`,role:"listitem",...gr(l,n),children:f$1},Ko(l,d))})})},vC=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:l,ariaLabel:d})=>{let{min:p,max:m,range:h}=Dm(o),f$1=ms-Gt.left-Gt.right,u=Tn-Gt.top-Gt.bottom,b=Gt.top+m/h*u,C=Math.max(1,Math.ceil(o.length/6)),g$1=o.map((y,k)=>pC(k,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 ${ms} ${Tn}`,role:"img","aria-label":d,children:[f("line",{className:"orb-metric-axis",x1:Gt.left,y1:b,x2:ms-Gt.right,y2:b}),f("line",{className:"orb-metric-grid",x1:Gt.left,y1:Gt.top,x2:Gt.left,y2:Tn-Gt.bottom}),t==="column"&&o.map((y,k)=>{let w=g$1[k],P=eo(y.value),I=Math.max(Math.abs(w.y-b),P===0?2:0),S=w.x-Math.min(18,f$1/Math.max(o.length*2,1)),R=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(P)}`,children:[f("rect",{className:`orb-metric-column${N?" is-active":""}`,x:S,y:Math.min(w.y,b),width:R,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:w.x,y:Tn-14,textAnchor:"middle",children:Rm(y.label)})]},Ko(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 w=g$1[k],P=r===y.id,I=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${P?" is-active":""}`,cx:w.x,cy:w.y,r:P?6:4,fill:mr(y,k,l)}),t!=="line"&&f("circle",{className:`orb-metric-point${P?" is-active":""}`,cx:w.x,cy:w.y,r:I,fill:mr(y,k,l),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))}`:""]}),(k%C===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:w.x,y:Math.max(Gt.top+8,w.y-I-7),textAnchor:"middle",children:Rm(y.label)})]},Ko(y,k))})]}),f("text",{className:"orb-metric-axis-label",x:Gt.left,y:Gt.top-5,children:i(m)}),p<0&&f("text",{className:"orb-metric-axis-label",x:Gt.left,y:Tn-Gt.bottom+14,children:i(p)})]})})},yC=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,colors:s,ariaLabel:l})=>{let d=o.map(u=>({...u,value:Math.max(eo(u.value),0)})),p=d.reduce((u,b)=>u+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":l,children:[d.map((u,b)=>{let C=u.value/p*360,g$1=f$1;f$1+=C;let x=r===u.id,v=C>=359.9?void 0:uC(h,h,m,t==="donut"?46:0,g$1,g$1+C),y=ql({item:u,onItemClick:n,interactions:a});return v?f("path",{className:`orb-metric-slice${x?" is-active":""}`,d:v,fill:mr(u,b,s),...y,children:g("title",{children:[u.label,": ",i(u.value)," (",(u.value/p*100).toFixed(1),"%)"]})},Ko(u,b)):f("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:h,cy:h,r:t==="donut"?60:m,fill:t==="donut"?"none":mr(u,b,s),stroke:t==="donut"?mr(u,b,s):void 0,strokeWidth:28,...y,children:g("title",{children:[u.label,": ",i(u.value)," (100%)"]})},Ko(u,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(p)})]}),f("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((u,b)=>{let C=r===u.id;return g("button",{type:"button",className:`orb-metric-legend-item${C?" is-active":""}`,onClick:()=>n?.(u),disabled:!n,title:u.label,...gr(u,a),children:[f("span",{className:"orb-metric-legend-dot",style:{backgroundColor:mr(u,b,s)}}),f("span",{className:"orb-metric-legend-label",children:u.label}),g("strong",{children:[(u.value/p*100).toFixed(0),"%"]})]},Ko(u,b))})})]})},CC=({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(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,...gr(s,n),children:d},Ko(s,l)):f("div",{className:`orb-metric-list-row${o===s.id?" is-active":""}`,role:"listitem",...gr(s,n),children:d},Ko(s,l))})}),fs=({title:t,subtitle:o,data:r=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:l,valueFormatter:d=Mm,secondaryValueFormatter:p=Mm,valueLabel:m,secondaryValueLabel:h,emptyState:f$1,loading:u=false,error:b,maxItems:C=8,showChartTypeControl:g$1=true,showDataDetails:x=true,dataRevealDelayMs:v=1e3,chartTypeOptions:y,chartTypeLabels:k,footer:w,ariaLabel:P,className:I,style:S,sx:R})=>{let N=Hs(),T=useRef(null),M=useRef(null),[A,L]=useState(n),[W,ee]=useState(false),[O,_]=useState(null),[V,Q]=useState(null);useEffect(()=>L(n),[n]);let H=useCallback(()=>{M.current!==null&&(window.clearTimeout(M.current),M.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)=>hs.includes(U)&&we.indexOf(U)===Re),ze={...dC,...k},be=Z[0],Ce=P??`${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)&&(M.current=window.setTimeout(()=>{de(U,"hover"),M.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?gs(U.clientX-we.left,8,Math.max(8,we.width-164)):8,at=we?gs(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?gr(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 ",p(eo(be.secondaryValue))]})]}):B==="progress"?f(bC,{data:Z,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:q}):B==="bar"?f(fC,{data:Z,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:q}):B==="list"?f(CC,{data:Z,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:p}):B==="pie"||B==="donut"?f(yC,{type:B,data:Z,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:q,ariaLabel:Ce}):f(vC,{type:B,data:Z,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:p,colors:q,ariaLabel:Ce});return g("div",{ref:T,className:"orb-metric-chart-shell",onMouseLeave:()=>{H(),O?.source==="hover"&&_(null);},children:[g(Ne,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${I??""}`,style:S,sx:R,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(hC,{loading:u,error:b,hasData:le,emptyState:f$1,children:it}),Y>0&&!u&&!b&&f("button",{type:"button",className:"orb-metric-more",onClick:()=>ee(U=>!U),children:W?"Show fewer":`Show all ${r.length}`})]}),w&&f("div",{className:"orb-metric-chart-footer",children:w})]}),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:p(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"})]})]})};fs.displayName="CMetricChartCard";var xC=({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(fs,{...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})})},bs=xC;var wC=({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)})})})]}),vs=wC;var SC=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}:{}}]}):[],ys=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=hs.includes(o.chartType)?o.chartType:"bar";return {...o,type:"metric-chart-card",chartType:r,data:SC(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 DC=({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 p=!!l?.onCardEvent,m=useMemo(()=>p?{onCardEvent:C=>d.current?.onCardEvent?.(C)}:void 0,[p]),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});},u=(C,g,x,v,y,k)=>{if(!(!y&&!m?.onCardEvent))return (...w)=>{let P=y?.(...w),I=k?k(...w):void 0;return f$1(C,g,x,I,v),P}},b=useMemo(()=>({div(C){let{"data-component":g,"data-think-content":x,...v}=C;return g==="thinkbox"&&x?f(gm,{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]:"",k=String(g);if(!v&&!k.includes(`
|
|
17
|
+
`))return f("code",{children:g});let P=k.replace(/\n$/,"");if(i&&y==="mermaid")return f(wm,{content:P});if(y==="html"||y==="htm")return f(ym,{content:P});if(y==="json"){let I=ys(P);if(I)switch(I.type){case "table":return f(cs,{data:I.data});case "metric-chart-card":return f(bs,{...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(ds,{...I});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(vs,{...I});case "error-card":{let S=I;return f(as,{...S,onClose:u("error-card","close",S.title,S,S.onClose),onRetry:u("error-card","retry",S.title,S,S.onRetry)})}case "warning-card":{let S=I,R=S.onConfirm?u("warning-card","confirm",S.title,S,S.onConfirm):S.actionText&&m?.onCardEvent?u("warning-card","confirm",S.title,S):void 0;return f(is,{...S,onClose:u("warning-card","close",S.title,S,S.onClose),onConfirm:R})}case "suggestions-card":{let S=I;return f(ss,{...S,onClose:u("suggestions-card","close",S.title,S,S.onClose),onSuggestionClick:u("suggestions-card","suggestion-click",S.title,S,S.onSuggestionClick,R=>({suggestion:R}))})}case "tool-result-card":{let S=I;return f(ls,{...S,onClose:u("tool-result-card","close",S.title,S,S.onClose),onAction:u("tool-result-card","action",S.title,S,S.onAction)})}}}return a?f(hm,{content:P,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(PC,{remarkPlugins:[TC,IC],rehypePlugins:[MC,RC],components:b,children:h})})},In=DC;var NC=({content:t,messageId:o,cardHooks:r})=>{let n=(s,l,d,p,m)=>{r?.onCardEvent?.({messageId:o,cardType:s,action:l,title:d,payload:p,rawData:m});},a=(s,l,d,p,m,h)=>{if(!(!m&&!r?.onCardEvent))return (...f)=>{let u=m?.(...f),b=h?h(...f):void 0;return n(s,l,d,b,p),u}},i=ys(t);if(i)switch(i.type){case "table":return f(cs,{data:i.data});case "metric-chart-card":return f(bs,{...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(ds,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(vs,{...i});case "error-card":{let s=i;return f(as,{...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(is,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:l})}case "suggestions-card":{let s=i;return f(ss,{...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(ls,{...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})})},Nm=NC;var Zl=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"}}},EC=({content:t,className:o="",messageId:r,cardHooks:n})=>{let a=Jt__default.useMemo(()=>Zl.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(Nm,{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}`))})},Cs=EC;var LC=({content:t,isStreaming:o=true,onComplete:r,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:l})=>{let[d,p]=useState(o?0:t.length),[m,h]=useState(!o);useEffect(()=>{if(o){p(0),h(false);return}p(t.length),h(true);},[t,o]),useEffect(()=>{if(!o||m)return;if(d>=t.length){h(true),r?.();return}let g=window.setTimeout(()=>{p(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&&(p(t.length),h(true),r?.());},u=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(Cs,{content:u,messageId:s,cardHooks:l}),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"})]})},Lm=LC;var Om=({buttons:t,className:o})=>{let r=n=>{switch(n){case "copy":return f(No,{size:14});case "refresh":return f(Ha,{size:14});case "volume":return f(td,{size:14});case "like":return f(Qc,{size:14});case "dislike":return f(Yc,{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 xs=({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(Lm,{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(Om,{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 Fm=({onTextUpdate:t,onComplete:o,onCancel:r,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:l}=Cn({onTextUpdate:t,onComplete:p=>{o?.(p);},onError:p=>{console.error("Voice input error:",p),r?.();}});return f("button",{onClick:async()=>{i?l():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(ap,{size:16}):f(ip,{size:16})})};var Dt={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")},FC={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},BC=({enabled:t,onClick:o})=>{let{t:r}=ce();return f("button",{className:ot(Dt.buttonBase,Dt.buttonSmall,Dt.buttonNormal),onClick:o,disabled:!t,"aria-label":r("omph.input.upload"),type:"button",children:f(zd,{size:16})})},HC=({canSend:t,isResponding:o,onSend:r,onStop:n})=>{let{t:a}=ce();return o&&!t?f("button",{className:ot(Dt.buttonBase,Dt.buttonSmall,Dt.stopButton),onClick:n,"aria-label":a("omph.input.stop"),type:"button",children:f(ll,{size:15})}):g(e,{children:[o&&f("button",{className:ot(Dt.buttonBase,Dt.buttonSmall,Dt.stopSecondary),onClick:n,"aria-label":a("omph.input.stop"),type:"button",children:f(ll,{size:14})}),f("button",{className:ot(Dt.buttonBase,Dt.buttonSmall,t?Dt.sendButton:Dt.sendButtonDisabled),onClick:r,disabled:!t,"aria-label":a("omph.input.send"),type:"button",children:f(dp,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})})]})},Yl=({onSend:t,onStop:o,isResponding:r=false,placeholder:n,getText:a})=>{let[i,s]=useState(""),[l,d]=useState([]),[p,m]=useState(false),[h,f$1]=useState(false),[u,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...",k=n||(a?a("00019",y):y),w=i.trim().length>0||l.length>0,P={enabled:true},I=useCallback(Y=>{s(Y.target.value),Y.target.style.height="auto",Y.target.style.height=`${Math.min(Y.target.scrollHeight,200)}px`;},[]),S=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="");}},[]),R=useCallback(Y=>{d(J=>J.filter((le,he)=>he!==Y));},[]),N=useCallback(()=>{C.current?.click();},[]),T=useCallback(async()=>{if(!w)return;let Y=i,J=[...l];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,w,r,t,l]),M=useCallback(Y=>{let J=u.find(le=>le.id===Y);J&&(b(le=>le.filter(he=>he.id!==Y)),t(J.content,J.files).catch(()=>s(J.content)));},[u,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||u.length===0)return;let Y=u;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,u,t]);let W=useCallback(()=>{b([]),o();},[o]),ee=useCallback(Y=>{Y.key==="Enter"&&!Y.shiftKey&&!p&&(Y.preventDefault(),T());},[T,p]),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:Dt.container,children:g("div",{className:"relative",children:[f("input",{type:"file",multiple:true,className:"hidden",ref:C,onChange:S}),g("div",{className:ot(Dt.inputContainer,h&&Dt.dragActive),onDragOver:B,onDragLeave:q,onDrop:Z,children:[u.length>0&&f("div",{className:Dt.queueArea,children:u.map(Y=>g("div",{className:Dt.queueCard,"data-omph-queue":Y.id,children:[f("span",{className:Dt.queueContent,title:Y.content,children:Y.content}),Y.confirmed?f("span",{className:Dt.queueHint,children:x("omph.input.queue.queued")}):f("span",{className:Dt.queueHint,children:x("omph.input.queue.ask")}),f("button",{className:Dt.queueButton,onClick:()=>M(Y.id),type:"button",children:x("omph.input.queue.sendNow")}),!Y.confirmed&&f("button",{className:Dt.queueButton,onClick:()=>A(Y.id),type:"button",children:x("omph.input.queue.afterTurn")}),f("button",{className:Dt.queueCancelButton,onClick:()=>L(Y.id),"aria-label":x("omph.input.queue.cancel"),type:"button",children:f(sl,{sx:{fontSize:14}})})]},Y.id))}),l.length>0&&f("div",{className:Dt.filePreviewArea,children:l.map((Y,J)=>g("div",{className:Dt.fileTag,children:[f(ep,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),f("span",{className:"truncate max-w-[150px]",children:Y.name}),f("button",{onClick:()=>R(J),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:f(sl,{sx:{fontSize:16}})})]},`${Y.name}-${J}`))}),g("div",{className:"flex w-full flex-col p-2",children:[f("div",{className:ot(Dt.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:f("textarea",{className:ot(Dt.textarea,"min-h-[24px] py-0 px-0"),placeholder:k,value:i,onChange:I,onKeyDown:ee,onCompositionStart:O,onCompositionEnd:_,style:FC,"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(BC,{enabled:P.enabled,onClick:N})}),g("div",{className:"flex items-center gap-1",children:[f(Fm,{onTextUpdate:V,onComplete:Q,onCancel:H,disabled:r,className:Dt.buttonSmall}),f(HC,{canSend:w,isResponding:r,onSend:T,onStop:W})]})]})]})]})]})})};var zm=({messages:t,onSend:o,onStop:r,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:l,streamChunkSize:d,onMessageStreamingComplete:p,cardHooks:m,showInput:h=true,statusLine:f$1})=>{let u=useRef(null),b=useRef(t.length);return useEffect(()=>{t.length>b.current&&u.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(xs,{message:C,assistantActions:v,onStreamingComplete:()=>p?.(C.id),streamIntervalMs:l,streamChunkSize:d,cardHooks:m},C.id)}),f$1,f("div",{ref:u})]}),h&&f("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:f(Yl,{onSend:o||(async()=>{}),onStop:r||(()=>{}),isResponding:a,placeholder:s})})]})};var Vm={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},Wm=({title:t="AI Agent",description:o,headerActions:r,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:l=false,...d})=>{let p=a??(d.isResponding?"running":"idle"),m=p==="running"||p==="pending",h=[Vm[p],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(zm,{...d,showInput:l,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??`${Vm[p]}\u2026`})]}):void 0})})]})};var $C=t=>Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t),_m=({conversations:t,activeConversationId:o,labels:r,onNewConversation:n,onSelectConversation:a})=>{let[i,s]=useState(false),l=useRef(null),d=useRef(null),p=useRef(null),m=useId(),h=!!a;useEffect(()=>{if(!i)return;let u=C=>{l.current?.contains(C.target)||s(false);},b=C=>{C.key==="Escape"&&(C.stopPropagation(),s(false),p.current?.focus());};return document.addEventListener("pointerdown",u),document.addEventListener("keydown",b),()=>{document.removeEventListener("pointerdown",u),document.removeEventListener("keydown",b);}},[i]),useEffect(()=>{if(!i)return;let u=d.current?.querySelector('[aria-selected="true"]'),b=d.current?.querySelector('[role="option"]');(u??b)?.focus();},[i]);let f$1=u=>{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?u===1?0:b.length-1:(C+u+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:l,children:[f("button",{ref:p,type:"button",className:"orb-omph-icon-btn","aria-label":r.conversationList,"aria-expanded":i,"aria-controls":m,onClick:()=>s(u=>!u),children:f(_c,{size:16})}),i&&f("div",{ref:d,id:m,className:"orb-omph-conversations",role:"listbox","aria-label":r.conversations,onKeyDown:u=>{u.key==="ArrowDown"?(u.preventDefault(),f$1(1)):u.key==="ArrowUp"&&(u.preventDefault(),f$1(-1));},children:t.length===0?f("p",{className:"orb-omph-conversation-empty",children:r.noConversations}):t.map(u=>{let b=u.updatedAt?$C(u.updatedAt):"",C=[u.preview,b].filter(x=>x&&x.length>0).join(" \xB7 "),g$1=u.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(u.id),s(false);},children:[f("span",{className:"orb-omph-conversation-title",children:u.title}),C&&f("span",{className:"orb-omph-conversation-meta",children:C})]},u.id)})})]})]})};var _C=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},GC=/^\$?([A-Za-z]+)\$?\d+$/,Gm=t=>{let o=[];return t.querySelectorAll("t").forEach(r=>o.push(r.textContent??"")),o.join("")},ws=t=>new DOMParser().parseFromString(t,"application/xml"),UC="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Um=async t=>{let{default:o}=await import('jszip'),r=await o.loadAsync(t),n=[],a=r.file("xl/sharedStrings.xml");a&&ws(await a.async("string")).querySelectorAll("si").forEach(u=>n.push(Gm(u)));let i=r.file("xl/workbook.xml");if(!i)throw new Error("Not an xlsx workbook");let s=ws(await i.async("string")),l=new Map,d=r.file("xl/_rels/workbook.xml.rels");d&&ws(await d.async("string")).querySelectorAll("Relationship").forEach(u=>{let b=u.getAttribute("Id"),C=u.getAttribute("Target");b&&C&&l.set(b,C.startsWith("xl/")?C:`xl/${C.replace(/^\//,"")}`);});let p=2e5,m=[],h=Array.from(s.querySelectorAll("sheet"));for(let f of h){let u=f.getAttribute("name")??`Sheet${m.length+1}`,b=f.getAttributeNS(UC,"id"),C=b&&l.get(b)||`xl/worksheets/sheet${m.length+1}.xml`,g=r.file(C);if(!g)continue;let x=ws(await g.async("string")),v=[],y=false;for(x.querySelectorAll("row").forEach(k=>{if(v.length>=5e3||p<=0){y=true;return}let w=[];k.querySelectorAll("c").forEach(P=>{if(p<=0)return;let I=P.getAttribute("r")??"",S=GC.exec(I),R=S?_C(S[1].toUpperCase()):w.length;if(R<0)return;let N=P.getAttribute("t"),T="";if(N==="inlineStr"){let M=P.querySelector("is");T=M?Gm(M):"";}else {let M=P.querySelector("v")?.textContent??"";N==="s"?T=n[Number(M)]??"":N==="b"?T=M==="1"?"TRUE":"FALSE":T=M;}T!==""&&(w[R]=T,p-=1);}),v.push(Array.from(w,P=>P??""));});v.length>0&&v[v.length-1].every(k=>k==="");)v.pop();m.push({name:u,rows:v,truncated:y});}if(m.length===0)throw new Error("No worksheets found");return m},Km=t=>t.map(o=>{let r=[...o];for(;r.length>0&&r[r.length-1]==="";)r.pop();return r.join(" ")}).join(`
|
|
18
|
+
`);var ZC=2e3,YC=1/3,Ss=[.25,.5,.75,1,1.5,2,3,4],QC=100,jC=500,JC=100,ex=9,tx=1e3,qm=14,Xm={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},Ym=({text:t,language:o,startLine:r,endLine:n,wrap:a,labels:i})=>{let s=useRef(null),l=useMemo(()=>{let m=t.split(`
|
|
19
|
+
`);m.length>1&&m[m.length-1]===""&&m.pop();let h=Math.min(m.length,ZC);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 u=f.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop;h.scrollTop=Math.max(0,u-h.clientHeight*YC);},[r,l.shown]);let p={"--orb-omph-digits":String(l.shownCount).length};return g("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:p,children:[f(Prism,{language:o,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:d,customStyle:Xm,codeTagProps:{className:`language-${o}`,style:Xm},children:l.shown}),l.total>l.shownCount&&f("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},Qm=({text:t})=>f("div",{className:"orb-omph-pv-doc",children:f(In,{content:t})}),jm=({url:t,alt:o,labels:r})=>{let[n,a]=useState("fit"),[i,s]=useState(null),[l,d]=useState(false),p=n==="fit"?1:n,m=Ss.some(b=>b>p),h=Ss.some(b=>b<p),f$1=b=>a(C=>{let g=C==="fit"?1:C;return (b>0?Ss.find(v=>v>g):[...Ss].reverse().find(v=>v<g))??C}),u=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:u,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*QC)}%`}),f("button",{type:"button","aria-label":r.zoomIn,disabled:!m,onClick:()=>f$1(1),children:"+"})]})]})},ox=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},Jm=({body:t,labels:o})=>{let[r,n]=useState({status:"parsing"}),[a,i]=useState(0),[s,l]=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=>Um(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(()=>l(false),tx);return ()=>window.clearTimeout(h)},[s]);let d=r.status==="ready"?r.sheets[Math.min(a,r.sheets.length-1)]:null,p=useMemo(()=>{if(!d)return null;let h=Math.min(d.rows.reduce((u,b)=>Math.max(u,b.length),0),JC),f=d.rows.slice(0,jC);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:ex},(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||!p)return null;let m=d.truncated||d.rows.length>p.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(Km(d.rows)).then(()=>l(true));},children:s?f(xo,{size:qm}):f(No,{size:qm})})]}),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:p.columnCount},(h,f$1)=>f("th",{scope:"col",children:ox(f$1)},f$1))]})}),f("tbody",{children:p.shownRows.map((h,f$1)=>g("tr",{children:[f("th",{scope:"row",children:f$1+1}),Array.from({length:p.columnCount},(u,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(p.shownRows.length,d.rows.length)})]})]})};var rx=/^[a-z][a-z0-9+.-]*:/i,nx=/^L(\d+)(?:-L?(\d+))?$/i;var eg=["B","KB","MB","GB"];var ax=t=>{try{return decodeURIComponent(t)}catch{return t}},Jl=t=>{let o=t.trim();if(!o||o.startsWith("#")||o.startsWith("//")||rx.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=ax(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=nx.exec(a);if(!l)return {path:s};let d=Number(l[1]);if(d<1)return {path:s};let p=l[2]?Number(l[2]):d;return {path:s,startLine:d,endLine:Math.max(d,p)}},ks=t=>t.split("/").filter(Boolean).pop()??t,og=t=>{let o=t.split("/");return o.pop(),o.join("/")},Ps=t=>{let o=ks(t),r=o.lastIndexOf(".");return r>0?o.slice(r+1).toLowerCase():""},rg={prism:"text",label:"Text"},tg={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:rg},ec=(t,o)=>o?Object.values(tg).find(n=>n.prism===o)??{prism:o,label:o}:tg[Ps(t)]??rg,ng=t=>{let o=t,r=0;for(;o>=1024&&r<eg.length-1;)o/=1024,r+=1;return `${r>0&&o<10?o.toFixed(1):Math.round(o).toString()} ${eg[r]}`};var ix=1e3,sx=9,qo=16,lx={markdown:"text/markdown;charset=utf-8",code:"text/plain;charset=utf-8"},cx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",Ts=(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);},tc=({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]}),sg=({state:t,placement:o,expanded:r,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:l,onRetry:d,onToggleExpand:p,onOpenExternally:m})=>{let[h,f$1]=useState(true),[u,b]=useState(false),{open:C,ref:g$1,phase:x,data:v}=t,y=v?.body;useEffect(()=>{if(!u)return;let O=window.setTimeout(()=>b(false),ix);return ()=>window.clearTimeout(O)},[u]),useEffect(()=>{C&&s.current?.focus({preventScroll:true});},[C,s,g$1?.path]);let k=v?.absolutePath??g$1?.path??"",w=y&&(y.kind==="markdown"||y.kind==="code")?y.text:k,P=w===k?a.previewCopyPath:a.previewCopyContent,I=y?.kind==="code"&&g$1?ec(g$1.path,y.language):null,S=!!(y&&(y.kind==="markdown"||y.kind==="code")&&y.previewOnly),R=!!(g$1&&y&&!S&&(y.kind==="markdown"||y.kind==="code"||y.kind==="image"||y.kind==="embed"||y.kind==="sheet")),N=()=>{if(!y||!g$1)return;let O=ks(k);if(y.kind==="markdown"&&!/\.(md|markdown|txt)$/i.test(O)&&(O=`${O}.md`),y.kind==="markdown"||y.kind==="code"){Ts(new Blob([y.text],{type:lx[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;Ts(new Blob([_],{type:cx}),O);return}y.url&&fetch(y.url).then(_=>{if(!_.ok)throw new Error(`HTTP ${_.status}`);return _.blob()}).then(_=>Ts(_,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(_=>Ts(_,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(Ps(g$1.path).toUpperCase()),y?.kind==="sheet"&&g$1&&T.push(Ps(g$1.path).toUpperCase()||"XLSX"),v?.size!==void 0&&T.push(ng(v.size)),y?.kind==="code"&&g$1?.startLine!==void 0&&T.push(a.previewLines(g$1.startLine,g$1.endLine??g$1.startLine));let M=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:sx},(O,_)=>f("span",{},_))});if(x==="error"||!y)return f(tc,{tone:"error",icon:f(Ia,{size:qo}),title:a.previewFailed,text:k,action:A});switch(y.kind){case "missing":return f(tc,{tone:"neutral",icon:f(Na,{size:qo}),title:a.previewMissing,text:y.message??k});case "unsupported":return f(tc,{tone:"neutral",icon:f(Na,{size:qo}),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(Qm,{text:y.text},g$1.path);case "code":return f(Ym,{text:y.text,language:ec(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(Jm,{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"?Hc:Na;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:M,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:()=>l(true),children:f(Ra,{size:qo})}),f("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:f(ee,{size:qo})}),g("div",{className:"orb-omph-pv-titles",children:[f("div",{className:"orb-omph-pv-name",title:k,children:g$1?ks(k):""}),f("div",{className:"orb-omph-pv-path",title:k,children:f("bdi",{children:og(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}),R&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewDownload,title:a.previewDownload,onClick:N,children:f(Fn,{size:qo})}),S&&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(Fn,{size:qo})}),g$1&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":u?a.copied:P,title:u?a.copied:P,onClick:()=>{navigator.clipboard.writeText(w).then(()=>b(true));},children:u?f(xo,{size:qo}):f(No,{size:qo})}),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:p,children:f(Lc,{size:qo})}),!W&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:f(Kt,{size:qo})})]})]}),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 px=1e3,lg=50,ux=1e3,mx=t=>t==="tool"?Jr:t==="command"?zn:Gc,dg=t=>!!t.streaming||t.status==="running"||t.status==="pending",gx=(t,o)=>o==="expanded"?true:dg(t),hx=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),fx=(t,o)=>`${Math.max(1,Math.round(t/ux))}${o.secondUnit}`,bx=({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})},vx=({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),px);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()}),hx(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(xo,{size:14}):f(No,{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," ",fx(l.durationMs,o)]})]})]})},yx=({item:t,display:o,open:r,onToggle:n})=>{let a=mx(t.kind),i=dg(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(Bo,{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(bx,{content:t.content}),r&&t.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},oc=t=>{let o=t.user?.content||t.assistant?.content||t.id,r=o.split(`
|
|
21
|
+
`).find(n=>n.trim())??o;return r.length>lg?`${r.slice(0,lg)}\u2026`:r},Cx=0,pg=({turns:t,labels:o,processDisplay:r,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=useState({}),d=p=>{if(!i||p.defaultPrevented||p.button!==Cx||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey)return;let m=p.target.closest("a[href]");if(!m)return;let h=a(m.getAttribute("href")??"");h&&(p.preventDefault(),i(h,m));};return f(e,{children:t.map((p,m)=>{let h=!!(p.assistant&&!p.assistant.streaming),u=m===t.length-1&&h?"always":"hover";return g("article",{className:"orb-omph-turn","data-omph-turn":p.id,"data-actions-reveal":u,children:[p.user&&g("div",{className:"orb-omph-user",children:[f("div",{className:"orb-omph-user-bubble","data-queued":p.user.queued||void 0,children:p.user.content}),g("div",{className:"orb-omph-user-meta",children:[p.user.queued&&f("span",{className:"orb-omph-user-queued",children:o.supplementQueued}),f("span",{className:"orb-omph-clock",children:p.user.timestamp.toLocaleTimeString()})]})]}),p.process&&p.process.length>0&&f("div",{className:"orb-omph-process-list",children:p.process.map(b=>{let C=b.id in s?s[b.id]:gx(b,r);return f(yx,{item:b,display:r,open:C,onToggle:()=>l(g=>({...g,[b.id]:!C}))},b.id)})}),p.assistant&&g("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[f(Cs,{content:p.assistant.content,messageId:p.assistant.id,cardHooks:n}),p.assistant.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),p.failure&&f("div",{className:"orb-omph-failure","data-severity":p.failure.severity,children:p.failure.content}),h&&f(vx,{turn:p,labels:o})]},p.id)})})};var rc=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")}),nc=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 xx=1e3,ug=60,wx=1e3,mg=(t,o)=>{let r=Math.max(1,Math.round(Math.max(t,wx)/xx)),n=Math.floor(r/ug),a=r%ug;return n<=0?`${r}${o.secondUnit}`:`${n}${o.minuteUnit} ${a}${o.secondUnit}`};var Px={open:false,ref:null,phase:"loading",data:null},gg=t=>{let[o,r]=useState(Px),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 u=a.current;if(!u)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}),u(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}));});},[]),p=useCallback((f,u)=>{l.current=u??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 u=l.current;f&&u?.isConnected&&u.focus({preventScroll:true});},[]),h=useCallback(()=>{let{ref:f}=n.current;f&&d(f);},[d]);return useEffect(()=>()=>{i.current?.abort();},[]),{state:o,open:p,close:m,reload:h}};var ic="--orb-omph-pv-w",sc="--orb-omph-pv-pref",Mx=880,Rx=560,fg=400,$r=320,Dx=.45,Nx=.7,bg=24,ac=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),vg=({open:t,layout:o})=>{let r=useRef(null),n=useRef(null),[a,i]=useState(0),[s,l]=useState(null),[d,p]=useState(false),[m,h]=useState(false);useLayoutEffect(()=>{let P=r.current;if(!P)return;let I=()=>i(P.getBoundingClientRect().width);I();let S=new ResizeObserver(I);return S.observe(P),()=>S.disconnect()},[]),useEffect(()=>{t||p(false);},[t]);let f=o==="overlay"?false:o==="split"?a>=fg+$r:a>=Mx,u=f&&!d?"split":"overlay",b=Math.max($r,Math.min(a*Nx,a-fg)),C=ac(s??a*Dx,$r,b),g=a>0&&a<Rx,x=useCallback(P=>{let I=r.current;I&&(I.style.setProperty(sc,`${P}px`),I.dataset.placement==="split"&&I.dataset.open==="true"&&I.style.setProperty(ic,`${P}px`));},[]),v=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=ac(I.startWidth+(I.startX-P.clientX),$r,b),x(I.latest));},[b,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));},[]),w=useCallback(P=>{let I={ArrowLeft:C+bg,ArrowRight:C-bg,Home:$r,End:b};P.key in I&&(P.preventDefault(),l(ac(I[P.key],$r,b)));},[b,C]);return {mainRef:r,placement:u,width:C,compact:g,dragging:m,expanded:d,canExpand:f,toggleExpanded:()=>p(P=>!P),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:k,onPointerCancel:k,onKeyDown:w}}};var Ds=48,Ex=900,Cg=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,xg=({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}),p=useRef(void 0),m=useRef(false),[h,f]=useState(true),[u,b]=useState(false),[C,g]=useState(t[0]?.id),x=useCallback(()=>{let P=i.current;P&&(d.current={height:P.scrollHeight,top:P.scrollTop});},[]),v=useCallback(()=>{let P=i.current;if(!P)return;let I=P.getBoundingClientRect().top,S=P.querySelector("[data-omph-turn]")?.dataset.omphTurn;P.querySelectorAll("[data-omph-turn]").forEach(R=>{R.getBoundingClientRect().top-I<=Ds&&(S=R.dataset.omphTurn);}),g(S);},[]);useEffect(()=>{let P=i.current,I=s.current;if(!P||!I)return;let S=()=>{b(P.clientWidth>Ex),l.current&&(P.scrollTop=P.scrollHeight),x();};S();let R=new ResizeObserver(S);return R.observe(P),R.observe(I),()=>R.disconnect()},[x]),useLayoutEffect(()=>{let P=i.current;if(!P)return;let I=t[0]?.id,S=p.current,R=S!==void 0&&t.some(M=>M.id===S),N=R&&I!==void 0&&I!==S,T=S!==void 0&&!R;if(p.current=I,T){l.current=true,f(true),P.scrollTop=P.scrollHeight,x(),v();return}if(N){l.current=false,f(false);let M=P.scrollHeight-d.current.height;P.scrollTop=d.current.top+Math.max(0,M),x(),v();return}l.current&&(P.scrollTop=P.scrollHeight),x(),v();},[o,x,t,v]),useEffect(()=>{n||(m.current=false);},[n]);let y=useCallback(()=>{let P=i.current;if(!P)return;let S=P.scrollHeight-P.scrollTop-P.clientHeight<=Ds;S!==l.current&&(l.current=S,f(S)),x(),v();let R=P.scrollHeight-P.clientHeight>Ds,N=P.scrollTop<=Ds;!R||!N||S||!r||n||!a||m.current||(m.current=true,a());},[r,n,a,x,v]),k=useCallback(()=>{let P=i.current;P&&(l.current=true,f(true),P.scrollTo({top:P.scrollHeight,behavior:Cg()?"auto":"smooth"}));},[]),w=useCallback(P=>{let S=i.current?.querySelector(`[data-omph-turn="${CSS.escape(P)}"]`);S&&(l.current=false,f(false),S.scrollIntoView({block:"start",behavior:Cg()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:h,railVisible:u,activeTurnId:C,onScroll:y,returnToBottom:k,scrollToTurn:w}};var Ox=1e3,Fx=(t,o)=>o[t],Bx=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("|"),Hx=({startedAt:t,labels:o})=>{let[r,n]=useState(()=>Date.now());useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),Ox);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?o.working:o.workingFor(mg(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})]})]})},Pz=({turns:t,title:o,avatar:r,description:n,headerActions:a,agentStatus:i,isResponding:s=false,labels:l,processDisplay:d="standard",showInput:p=false,placeholder:m,className:h,cardHooks:f$1,hasOlder:u=false,loadingOlder:b=false,onLoadOlder:C,onSend:g$1,onStop:x,onHeaderPointerDown:v,conversations:y=[],activeConversationId:k,onNewConversation:w,onSelectConversation:P,loadFilePreview:I,resolveFileLink:S=Jl,filePreviewLayout:R="auto",onOpenFileExternally:N})=>{let{t:T}=ce(),M={...rc(T),...l},A=i??(s?"running":"idle"),L=A==="running"||A==="pending",W=[Fx(A,M),n].filter(Boolean).join(" \xB7 "),ee=useMemo(()=>Bx(t),[t]),O=xg({turns:t,contentVersion:ee,hasOlder:u,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=!!I,Y=gg(I),J=vg({open:Y.state.open,layout:R}),le=useRef(null),he=useRef(null),ze=Z&&Y.state.open&&J.placement==="overlay",be=J.placement==="split"&&Y.state.open,Ce={[sc]:`${J.width}px`,[ic]: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||M.idle})]})]}),(w||P||a)&&g("div",{className:"orb-omph-header-actions",onPointerDown:de=>de.stopPropagation(),children:[f(_m,{conversations:y,activeConversationId:k,labels:M,onNewConversation:w,onSelectConversation:P}),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:[u&&C&&f("button",{type:"button",className:"orb-omph-older",disabled:b,onClick:C,children:b?M.loadingOlder:M.loadOlder}),f(pg,{turns:t,labels:M,processDisplay:d,cardHooks:f$1,resolveFileLink:S,onOpenFile:Z?Y.open:void 0}),L&&f(Hx,{startedAt:q,labels:M})]})}),O.railVisible&&t.length>0&&f("nav",{className:"orb-omph-rail","aria-label":M.turnRail,children:t.map(de=>f("button",{type:"button",className:"orb-omph-rail-mark","data-active":O.activeTurnId===de.id||void 0,"aria-label":oc(de),title:oc(de),onClick:()=>O.scrollToTurn(de.id)},de.id))}),!O.following&&f("button",{type:"button",className:"orb-omph-to-bottom","aria-label":M.toBottom,onClick:O.returnToBottom,children:f(Bo,{size:16})})]}),p&&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":M.stop,title:M.stop,onClick:x,children:f(Ws,{size:14})}),f("button",{type:"submit",className:H?"orb-omph-stop":"orb-omph-send","aria-label":H?M.stop:M.send,disabled:!H&&Q.length===0,children:H?f(Ws,{size:16}):f(Dc,{size:16})})]})]}),Z&&f(sg,{state:Y.state,placement:J.placement,expanded:J.expanded,canExpand:J.canExpand,labels:M,gripProps:J.gripProps,paneRef:le,onClose:Y.close,onRetry:Y.reload,onToggleExpand:J.toggleExpanded,onOpenExternally:N})]})]})};var hr="other",zx=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,Vx=({request:t,onDecide:o,labels:r})=>{let{t:n}=ce(),a={...nc(n),...r},i=useRef(null),s=useRef(null),l=useRef(false),d=useRef(false),[p,m]=useState(false),[h,f$1]=useState(null),[u,b]=useState(""),C=t.choices??[],g$1=t.allowOther??C.length>0,x=C.length>0||g$1,v=t.reason?.trim()||a.escalation(t.toolName),y=t.detail?.trim(),k=h===hr&&u.trim().length>0,w=!x||h!==null&&h!==hr||k;useEffect(()=>{m(false),f$1(null),b(""),i.current?.focus();},[t.id]),useEffect(()=>{h===hr&&s.current?.focus();},[h]);let P=R=>{p||(m(true),o(R,t));},I=()=>{if(w){if(!x){P({kind:"allowed-once"});return}if(h===hr){let R=u.trim();if(!R)return;P({kind:"other",text:R});return}h&&P({kind:"choice",choiceId:h});}},S=R=>{if(!(p||zx(R.target))&&!(R.key!=="Enter"&&R.key!=="Escape")&&!(R.key==="Enter"&&R.target instanceof HTMLElement&&R.target.closest('button, a[href], [role="button"]'))&&!(R.ctrlKey||R.metaKey||R.altKey||R.shiftKey)&&(R.preventDefault(),R.stopPropagation(),!(R.repeat||l.current||d.current||R.nativeEvent.isComposing))){if(R.key==="Escape"){P({kind:"rejected"});return}I();}};return f("div",{className:"orb-omph-approval","data-omph-approval":t.id,"aria-busy":p,onKeyDown:S,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:v}),y&&f("div",{className:"orb-omph-approval-detail",children:y}),x&&g("fieldset",{className:"orb-omph-approval-choices",disabled:p,children:[f("legend",{className:"orb-visually-hidden",children:a.choices}),C.map(R=>{let N=h===R.id;return g("label",{className:"orb-omph-approval-choice","data-selected":N,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:R.id,checked:N,onChange:()=>f$1(R.id)}),g("span",{className:"orb-omph-approval-choice-copy",children:[f("span",{children:R.label}),R.description&&f("span",{className:"orb-omph-approval-choice-description",children:R.description})]})]},R.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:u,placeholder:a.otherPlaceholder,rows:3,"aria-label":a.other,onChange:R=>b(R.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:p,onClick:()=>P({kind:"rejected"}),children:a.reject}),f("button",{type:"button",className:"orb-btn orb-btn-primary",disabled:p||!w,onClick:I,children:x?a.confirm:a.allowOnce})]})]})})};var Mg=520,_x=88,Gx=88,Ux=24,As=640,Rg=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),dc=t=>typeof t=="number"?`${t}px`:t,Kx=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,Bz=({anchor:t,defaultAnchor:o="right",onAnchorChange:r,width:n=Mg,top:a=_x,bottom:i=Gx,inset:s=Ux,zIndex:l=1300,shellClassName:d,shellStyle:p,className:m,onHeaderPointerDown:h,...f$1})=>{let u=useRef(null),b=useRef(null),[C,g]=useState(o),[x,v]=useState(0),[y,k]=useState(typeof n=="number"?n:Mg),[w,P]=useState(0),[I,S]=useState(false),R=t??C;useEffect(()=>{let O=()=>v(window.innerWidth);return O(),window.addEventListener("resize",O),()=>window.removeEventListener("resize",O)},[]),useLayoutEffect(()=>{let O=()=>{let V=u.current?.getBoundingClientRect();V?.width?k(V.width):typeof n=="number"&&k(n);};if(O(),!u.current||typeof ResizeObserver>"u")return;let _=new ResizeObserver(O);return _.observe(u.current),()=>_.disconnect()},[n]);let N=useCallback(O=>{if(!x)return s;let _=x<As?12:s,V=Math.max(_,x-y-_);return x<As||O==="left"?_:O==="center"?Rg((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]),M=useCallback(O=>{t===void 0&&g(O),r?.(O);},[t,r]);useEffect(()=>{I||P(N(R));},[N,I,R]);let A=useCallback(O=>{h?.(O),!(O.defaultPrevented||Kx(O.target))&&(O.preventDefault(),O.currentTarget.setPointerCapture(O.pointerId),b.current={pointerId:O.pointerId,startClientX:O.clientX,startX:w,currentX:w,captureElement:O.currentTarget},S(true));},[h,w]),L=useCallback(O=>{let _=b.current;if(!_||_.pointerId!==O.pointerId)return;let V=x<As?12:s,Q=Math.max(V,x-y-V),H=Rg(_.startX+O.clientX-_.startClientX,V,Q);_.currentX=H,P(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,S(false),M(V),P(N(V));},[N,M,T]),ee=useMemo(()=>({position:"fixed",top:dc(a),bottom:dc(i),left:w,width:dc(n),maxWidth:`calc(100vw - ${x<As?24:s*2}px)`,zIndex:l,pointerEvents:"auto",transition:I?"none":"left 180ms ease-out",touchAction:"none",...p}),[i,s,I,w,p,a,x,n,l]);return f("div",{ref:u,className:ot("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":R,"data-dragging":I?"true":"false",style:ee,onPointerMove:L,onPointerUp:W,onPointerCancel:W,children:f(Wm,{...f$1,className:m,onHeaderPointerDown:A})})};var Zx={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},Uz=({messages:t,onSend:o,onRegenerate:r,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:l="bottom-right",onCollapse:d,onHeaderPointerDown:p,onPlusClick:m,onMicClick:h,streamIntervalMs:f$1,streamChunkSize:u,onMessageStreamingComplete:b,cardHooks:C})=>{let[g$1,x]=useState(""),[v,y]=useState(false),k=useRef(null),w=Zx[l];useEffect(()=>{k.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let P=useCallback(async()=>{let S=g$1.trim();!S||n||(x(""),await o(S));},[n,o,g$1]),I=useCallback(async S=>{S.key==="Enter"&&!v&&(S.preventDefault(),await P());},[P,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",w==="top-left"&&"-left-2 -top-2",w==="top-right"&&"-right-2 -top-2",w==="bottom-left"&&"-bottom-2 -left-2",w==="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)]",w==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",w==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",w==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",w==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),g("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:p,children:[f("div",{className:"flex items-center",children:f("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),f("div",{})]}),g("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((S,R)=>{let N=S.type==="assistant"&&R===t.length-1,T=S.type==="assistant"?{isLatestAssistant:N,isResponding:n,onRegenerate:r?()=>r(S.id):void 0}:void 0;return f(xs,{message:S,assistantActions:T,onStreamingComplete:()=>b?.(S.id),streamIntervalMs:f$1,streamChunkSize:u,cardHooks:C},S.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:S=>x(S.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(Oa,{className:"h-4 w-4"})})]})})]})};var Yx=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],Qx=`
|
|
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
|
-
`,iz=({active:t=false,colors:o=yx,zIndex:r=2147483e3})=>{let n={"--orbcafe-ai-glow-line":o[0],"--orbcafe-ai-glow-z-index":r};return g(e,{children:[f("style",{children:Cx}),f("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var Cz=({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]),f=useCallback(p=>d(()=>n?.(p)),[n,d]),h=useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:u,onRegister:m,onForgotPassword:f}),[f,u,m,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:h}};var wx={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."},Rz=({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,[f$1,h]=useState(o),p=t??f$1,v=useMemo(()=>({...wx,...d}),[d]),[y,g$1]=useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,b]=useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[C,k]=useState({email:""}),[w,P]=useState(""),I=A=>{m||h(A),P(""),r?.(A);},S=async A=>{A.preventDefault(),await n?.(y),P("Demo login accepted. No real authentication request was sent.");},N=async A=>{A.preventDefault(),await a?.(x),P("Demo registration saved locally for this screen.");},M=async A=>{A.preventDefault(),await i?.(C),P("Demo reset link request created. No email was sent.");},T=p==="login"?v.loginTitle:p==="register"?v.registerTitle:v.forgotTitle,D=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:D}),w&&f(tn,{severity:"success",children:w}),p==="login"&&g("form",{onSubmit:S,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Email",type:"email",autoComplete:"username",value:y.username,onChange:A=>g$1(L=>({...L,username:A.target.value})),startAdornment:f(As,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"current-password",value:y.password,onChange:A=>g$1(L=>({...L,password:A.target.value})),startAdornment:f(Ia,{size:15,strokeWidth:1.8})}),g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[f(Tt,{label:"Remember me",checked:y.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:N,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(As,{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(Ns,{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(Ia,{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:M,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Work email",type:"email",autoComplete:"username",value:C.email,onChange:A=>k({email:A.target.value}),startAdornment:f(Ns,{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 Px={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},Tx=[{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"}],fg=({tasks:t,appId:o,tableKey:r,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:l,filterTableKey:d,serviceUrl:u,variantService:m,layout:f,columns:h,page:p,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:b,onFilterSearch:C,onFilterVariantLoad:k,enableRowReorder:w,onTaskReorder:P,onLayoutIdChange:I,onLayoutSave:S})=>{let N=o??l??"planning-gantt",M=r??d??"planning",[T,D]=useState(n),[A,L]=useState(a??t[0]?.id??""),[O,_]=useState(""),[F,X]=useState(null),[V,Z]=useState({...Px,...i}),z=useMemo(()=>{let pe=String(V.keyword?.value??"").trim().toLowerCase(),xe=String(V.status?.value??"").trim(),We=String(V.owner?.value??"").trim().toLowerCase(),we=String(V.workCenter?.value??"").trim().toLowerCase(),se=V.dateRange?.value,Ae=se?.[0]?or(se[0]):null,Ie=se?.[1]?or(se[1]):null;return t.filter(ke=>{if(pe&&![ke.id,ke.code,ke.title,ke.project,ke.workCenter,ke.owner?.name].join(" ").toLowerCase().includes(pe)||xe&&ke.status!==xe||We&&!String(ke.owner?.name??"").toLowerCase().includes(We)||we&&!String(ke.workCenter??"").toLowerCase().includes(we))return false;if(Ae||Ie){let ze=or(ke.startDate),et=or(ke.endDate),rt=Ae?et.isAfter(Ae)||et.isSame(Ae,"day"):true,at=Ie?ze.isBefore(Ie)||ze.isSame(Ie,"day"):true;if(!rt||!at)return false}return true})},[V,t]);useEffect(()=>{z.length!==0&&(z.some(pe=>pe.id===A)||L(z[0].id));},[z,A]);let H=useCallback(pe=>{L(pe.id);},[]),U=useCallback(pe=>{_(pe),I?.(pe);},[I]),K=useCallback(pe=>{X(xe=>({key:(xe?.key??0)+1,variant:pe})),k?.(pe);},[k]),ge=useMemo(()=>({appId:N,tableKey:M,fields:s??Tx,filters:V,onFilterChange:Z,onVariantLoad:K,onSearch:C??(()=>{}),currentLayoutId:O,layoutRefs:[{tableKey:M,layoutId:O||null}],variantService:m,serviceUrl:u}),[O,s,V,K,C,N,M,u,m]),ie=useMemo(()=>({appId:N,tableKey:M,serviceUrl:u,tasks:z,columns:h,scale:T,onScaleChange:D,page:p,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:b,selectedTaskId:A,onTaskSelect:H,enableRowReorder:w,onTaskReorder:P,layout:f,layoutVariant:F?.variant,layoutVariantLoadKey:F?.key,onLayoutIdChange:U,onLayoutSave:S}),[h,g,w,z,U,f,F?.key,F?.variant,x,b,S,P,H,p,N,M,v,y,T,u,A]);return {scale:T,setScale:D,selectedTaskId:A,setSelectedTaskId:L,filters:V,setFilters:Z,filteredTasks:z,smartFilterProps:ge,planningGanttProps:ie}};var Bz=t=>{let o=fg(t),r=useMemo(()=>({filterProps:o.smartFilterProps,ganttProps:o.planningGanttProps}),[o.planningGanttProps,o.smartFilterProps]);return {...o,layoutProps:r}};or.extend(Mx);var jl=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],Jl=36,ec=58,ya=8,tc=260,Ox=320,_r="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"}},Fx=t=>t?hg[t]?.label??t:"Planned",Bx=t=>t?hg[t]?.color??"default":"info",bg=t=>Math.min(100,Math.max(0,t??0)),vg=(t,o=0)=>t.flatMap(r=>[{...r,level:o},...vg(r.children??[],o+1)]),Hx=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:Fx(t.status),statusTone:t.status??"planned",progress:bg(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),yg=(t,o)=>o==="month"?t.startOf("month"):o==="week"?t.startOf("week"):o==="day"?t.startOf("day"):t.startOf("hour"),Cg=(t,o)=>o==="month"?t.endOf("month"):o==="week"?t.endOf("week"):o==="day"?t.endOf("day"):t.endOf("hour"),zx=(t,o,r)=>{let n=[],a=yg(t,r),i=Cg(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},oc=(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},xg=({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:f$1=20,rowsPerPageOptions:h=[20,50,100,-1],count:p,onPageChange:v,onRowsPerPageChange:y,timelineStart:g$1,timelineEnd:x,selectedTaskId:b$1,onTaskSelect:C,enableRowReorder:k=true,onTaskReorder:w,layout:P,layoutVariant:I,layoutVariantLoadKey:S,onLayoutIdChange:N,onLayoutSave:M,emptyLabel:T="No planning tasks available.",sx:D})=>{let A=ao(),{t:L}=de(),O=useRef(null),_=useRef(null),F=useRef(null),X=useRef(false),[V,Z]=useState(null),[z,H]=useState("content"),[U,K]=useState(null),[ge,ie]=useState(0),[pe,xe]=useState({}),[We,we]=useState(Jl),[se,Ae]=useState([]),Ie=useRef(void 0),[ke,ze]=useState({activeId:null,overId:null}),[et,rt]=useState(null),[at,q]=useState(false),Re=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}})),ve=useRef(null),Fe=useMemo(()=>vg(s),[s]),nt=useMemo(()=>{if(se.length===0)return Fe;let B=new Map(Fe.map(Pe=>[Pe.id,Pe])),j=se.map(Pe=>B.get(Pe)).filter(Pe=>!!Pe),me=new Set(j.map(Pe=>Pe.id));return [...j,...Fe.filter(Pe=>!me.has(Pe.id))]},[Fe,se]),Ye=useMemo(()=>new Map(nt.map(B=>[B.id,B])),[nt]),xt=useMemo(()=>nt.map(B=>Hx(B)),[nt]),It=useMemo(()=>new Map(xt.map(B=>[B.id,B])),[xt]),Lt=useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(B,j)=>g(ae,{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:(B,j)=>f(Ct,{label:j.status,color:Bx(j.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:B=>g(ae,{spacing:.6,children:[g(E,{variant:"caption",sx:{color:"text.secondary"},children:[B,"%"]}),f(Hn,{variant:"determinate",value:B,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 B=new Map(Lt.map(j=>[j.id,j]));return l.map(j=>{let me=B.get(j.id),Pe=j.width??me?.minWidth??120,Je={id:j.id,label:j.label,minWidth:Pe};if(me?.numeric&&(Je.numeric=true),j.render){let qe=j.render;return Je.render=(wt,ft)=>{let mt=Ye.get(ft.id);return qe(mt||ft)},Je}return me?.render?(Je.render=me.render,Je):(Je.render=(qe,wt)=>{let ft=wt[j.id];if(ft!=null&&String(ft).length>0)return String(ft);let yt=Ye.get(wt.id)?.[j.id];return yt!=null&&String(yt).length>0?String(yt):"-"},Je)})},[l,Lt,Ye]),te=fn({appId:t,tableKey:o,title:n,columns:Nt,rows:xt,rowKey:"id",page:m,rowsPerPage:f$1,rowsPerPageOptions:h,count:p??xt.length,onPageChange:v,onRowsPerPageChange:y,showSummary:false,layout:P,onLayoutSave:M}),Ge=t?f(gn,{appId:t,tableKey:o,currentLayoutData:te.currentLayoutData,onLayoutLoad:te.handleLayoutLoad,targetLayoutId:te.layoutIdToLoad,activeLayoutId:te.currentLayoutId,serviceUrl:r}):null,Oe=te.visibleRows;useEffect(()=>{let B=Fe.map(j=>j.id);Ae(j=>{let me=new Set(B),Pe=j.filter(ft=>me.has(ft)),Je=new Set(Pe),qe=B.filter(ft=>!Je.has(ft)),wt=[...Pe,...qe];return wt.length===j.length&&wt.every((ft,mt)=>ft===j[mt])?j:wt});},[Fe]),useEffect(()=>{S===void 0||!I||Ie.current!==S&&(Ie.current=S,te.handleVariantLoad(I));},[te,I,S]),useEffect(()=>{N?.(te.currentLayoutId);},[te.currentLayoutId,N]);let le=B=>B.type==="group"?`group-${B.id}`:`row-${(B.data||B)?.id}`,be=useMemo(()=>{let B=xt.map(mt=>or(mt.startDate)),j=xt.map(mt=>or(mt.endDate)),me=g$1?or(g$1):B.reduce((mt,yt)=>yt.isBefore(mt)?yt:mt,B[0]??or()),Pe=x?or(x):j.reduce((mt,yt)=>yt.isAfter(mt)?yt:mt,j[0]??or().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",wt=d==="hour"?12:1,ft=d==="hour"?12:1;return {start:yg(me.subtract(wt,Je),d),end:Cg(Pe.add(ft,qe),d)}},[xt,d,x,g$1]),ee=jl.find(B=>B.value===d)??jl[1],he=Array.isArray(a)?a:a?[a]:[],De=useMemo(()=>zx(be.start,be.end,d),[be.end,be.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%",Kt=(te.columns||[]).filter(B=>te.visibleColumns.includes(B.id)).reduce((B,j)=>B+(te.columnWidths?.[j.id]||j.minWidth||100),0)+(te.grouping.length>0?72:0),zt=z==="manual"&&V!==null?V:Kt,St=U==="table",Vt=U==="timeline",ht=U==="timeline",Dt=U==="table",st=!ht&&!Dt,Ot=()=>{let B=ge||O.current?.clientWidth||0;return B>0?Math.max(tc,B-ya-Ox):Math.max(tc,Kt)},qt=B=>Math.min(Math.max(B,tc),Ot()),W=(()=>{if(ge<=0)return null;let B=st?ya:0;if(St)return {tableWidth:ge,splitterWidth:B,timelineWidth:0};if(Vt)return {tableWidth:0,splitterWidth:B,timelineWidth:ge};if(z==="even"){let me=Math.max(0,(ge-B)/2);return {tableWidth:me,splitterWidth:B,timelineWidth:Math.max(0,ge-B-me)}}let j=qt(zt);return {tableWidth:j,splitterWidth:B,timelineWidth:Math.max(0,ge-B-j)}})(),Q=W?`${W.tableWidth}px ${W.splitterWidth}px ${W.timelineWidth}px`:St?"minmax(0, 1fr) 0px 0px":Vt?"0px 0px minmax(0, 1fr)":z==="even"?`minmax(0, 1fr) ${ya}px minmax(0, 1fr)`:`${zt}px ${ya}px minmax(0, 1fr)`;useEffect(()=>{z==="manual"&&Z(B=>B===null?null:qt(B));},[z,Kt,ge]);let fe=B=>{B.preventDefault(),B.currentTarget.setPointerCapture(B.pointerId),K(null),H("manual"),ve.current={startX:B.clientX,startWidth:_.current?.getBoundingClientRect().width??zt};let j=Pe=>{let Je=ve.current;if(!Je)return;let qe=qt(Je.startWidth+Pe.clientX-Je.startX);Z(qe);},me=()=>{ve.current=null,window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",me),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",me);},ye=()=>{K(null),H("even"),Z(null);},Ee=B=>!k||!B?false:It.get(B)?.reorderable!==false,$e=(B,j)=>{if(!B||!j||B===j||!Ee(B)||!Ee(j))return false;if(te.grouping.length===0)return true;let me=It.get(B),Pe=It.get(j);return !me||!Pe?false:te.grouping.every(Je=>me[Je]===Pe[Je])},Ke=(B,j)=>{if(!$e(B,j))return;let me=Oe.filter(At=>At.type!=="group").map(At=>String((At.data||At)?.id)),Pe=me.indexOf(B),Je=me.indexOf(j);if(Pe<0||Je<0)return;let qe=[...me];[qe[Pe],qe[Je]]=[qe[Je],qe[Pe]];let wt=new Set(me),ft=nt.map(At=>At.id),mt=[...qe,...ft.filter(At=>!wt.has(At))],yt=Ye.get(B),oo=Ye.get(j);if(te.setOrder("asc"),te.setOrderBy(""),Ae(mt),yt&&oo){let{level:At,...Xt}=yt,{level:Bt,...Gt}=oo,Wt=mt.reduce((eo,ro)=>{let go=Ye.get(ro);if(go){let{level:To,...Io}=go;eo.push(Io);}return eo},[]);w?.(Wt,{activeTask:Xt,targetTask:Gt});}},Ze=(B,j)=>{if(!Ee(j.id)){B.preventDefault();return}B.stopPropagation(),B.dataTransfer.effectAllowed="move",B.dataTransfer.setData("text/plain",j.id),ze({activeId:j.id,overId:null}),C?.(Ye.get(j.id)||j);},ut=(B,j)=>{if(!$e(ke.activeId,j)){ze(me=>me.overId===null?me:{...me,overId:null});return}B.preventDefault(),B.stopPropagation(),B.dataTransfer.dropEffect="move",ze(me=>me.overId===j?me:{...me,overId:j});},gt=(B,j)=>{let me=ke.activeId||B.dataTransfer.getData("text/plain");if(!$e(me,j)){ze({activeId:null,overId:null});return}B.preventDefault(),B.stopPropagation(),Ke(me,j),ze({activeId:null,overId:null});},Mt=()=>{ze({activeId:null,overId:null});},bt=B=>{if(X.current)return;let j=B==="table"?_.current:F.current,me=B==="table"?F.current:_.current;!j||!me||(X.current=true,me.scrollTop=j.scrollTop,window.requestAnimationFrame(()=>{X.current=false;}));};return useLayoutEffect(()=>{let B=O.current;if(!B){ie(0);return}let j=0,me=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(()=>{let Je=B.clientWidth;ie(qe=>Math.abs(qe-Je)<.5?qe:Je);});};if(me(),typeof ResizeObserver>"u")return window.addEventListener("resize",me),()=>{window.cancelAnimationFrame(j),window.removeEventListener("resize",me);};let Pe=new ResizeObserver(me);return Pe.observe(B),window.addEventListener("resize",me),()=>{window.cancelAnimationFrame(j),Pe.disconnect(),window.removeEventListener("resize",me);}},[xt.length]),useLayoutEffect(()=>{if(!b$1||Dt)return;let B=F.current,j=_.current;if(!B)return;let me=`row-${b$1}`,Pe=Array.from(B.querySelectorAll("[data-planning-timeline-row-key]")).find(wt=>wt.dataset.planningTimelineRowKey===me),Je=It.get(b$1);if(!Pe||!Je)return;let qe=window.requestAnimationFrame(()=>{let wt=B.getBoundingClientRect(),ft=Pe.getBoundingClientRect(),mt=Math.max(1,B.clientHeight-We),yt=B.scrollTop+ft.top-wt.top-We-(mt-ft.height)/2;X.current=true,B.scrollTop=Math.max(0,yt),j&&!ht&&(j.scrollTop=B.scrollTop);let oo=Math.max(1,B.scrollWidth),At=De.length>0?oo/De.length:ee.width,Xt=oc(or(Je.startDate),De,At),Bt=Math.max(0,Xt-At);B.scrollLeft=Math.min(Bt,Math.max(0,oo-B.clientWidth)),window.requestAnimationFrame(()=>{X.current=false;});});return ()=>window.cancelAnimationFrame(qe)},[ee.width,We,b$1,ht,It,Dt,Oe,De]),useLayoutEffect(()=>{let B=_.current;if(!B)return;let j=0,me=0,Pe=false,Je=()=>{if(Pe)return;let Bt=B.querySelector("thead"),Gt=Array.from(B.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Gt.length===0)return;let Wt=Bt?.getBoundingClientRect().height||Jl,eo={};Gt.forEach(ro=>{let go=ro.dataset.ctableRowKey;go&&(eo[go]=ro.getBoundingClientRect().height);}),we(ro=>Math.abs(ro-Wt)<.01?ro:Wt),xe(ro=>{let go=Object.keys(ro),To=Object.keys(eo);return go.length===To.length&&To.every(Io=>Math.abs((ro[Io]??0)-eo[Io])<.01)?ro:eo});},qe=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(Je);};if(Je(),window.cancelAnimationFrame(me),me=window.requestAnimationFrame(()=>{me=window.requestAnimationFrame(Je);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{Pe||qe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",qe),()=>{Pe=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(me),window.removeEventListener("resize",qe);};let wt=new ResizeObserver(qe),ft=B.querySelector("table"),mt=B.querySelector("tbody"),yt=B.querySelector("thead");ft&&wt.observe(ft),yt&&wt.observe(yt);let oo=new WeakSet,At=()=>{B.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Bt=>{oo.has(Bt)||(wt.observe(Bt),oo.add(Bt));});};At();let Xt=null;return mt&&typeof MutationObserver<"u"&&(Xt=new MutationObserver(()=>{At(),qe();}),Xt.observe(mt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",qe),()=>{Pe=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(me),wt.disconnect(),Xt?.disconnect(),window.removeEventListener("resize",qe);}},[Oe,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}`,...D},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(li,{value:te.filterText,onChange:B=>{te.setFilterText(B),te.setPage(0);}}),f(si,{rowsPerPage:te.rowsPerPage,rowsPerPageOptions:h,page:te.page,count:te.totalDisplayCount,onRowsPerPageChange:te.setRowsPerPage,onPageChange:te.setPage}),he.length>0&&f("div",{className:"orb-table-toolbar-custom",children:he.map((B,j)=>f("div",{className:"orb-planning-extra-tool",children:B},`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(ne,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:B=>te.setAnchorEl(B.currentTarget),sx:co,children:f(an,{fontSize:"small"})}),f(ne,{className:"orb-table-tool-button",tooltip:"Group by",onClick:B=>te.setGroupAnchorEl(B.currentTarget),sx:co,children:f(Cr,{fontSize:"small"})}),f(ne,{className:`orb-table-tool-button ${te.sortBy.length>0||te.orderBy?"orb-is-active":""}`,tooltip:"Sort by...",active:te.sortBy.length>0||!!te.orderBy,onClick:()=>q(true),sx:co,children:f(Jd,{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(zn,{"aria-label":"Planning pane layout",size:"small",value:U??(z==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:f(ti,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(ri,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:f(ei,{fontSize:"small"})}],onValueChange:B=>{B==="split"?ye():K(B);}})}),f("div",{className:"orb-table-tool-group orb-planning-scale-control",children:f(Ht,{label:"",value:d,options:jl.map(B=>({value:B.value,label:B.label})),onChange:B=>u?.(B.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:O,sx:{height:"100%",display:"grid",gridTemplateColumns:Q,minWidth:0,transition:`grid-template-columns ${_r}`},children:[f("div",{"data-planning-scroll-pane":"table",ref:_,onScroll:()=>bt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:ht?0:1,transform:ht?"translateX(-10px)":"translateX(0)",pointerEvents:ht?"none":"auto",transition:`opacity ${_r}, transform ${_r}`},children:f(DndContext,{sensors:Re,collisionDetection:closestCenter,modifiers:[restrictToHorizontalAxis],onDragEnd:B=>{let j=B?.active?.id,me=B?.over?.id;typeof j=="string"&&typeof me=="string"&&te.handleColumnReorder(j,me);},children:g("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:Kt,"& thead th":{height:Jl,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[f(pi,{columns:te.columns,visibleColumns:te.visibleColumns,order:te.order,orderBy:te.orderBy,sortBy:te.sortBy,onRequestSort:te.handleRequestSort,onContextMenu:(B,j)=>{B.preventDefault(),B.stopPropagation(),rt({mouseX:B.clientX+2,mouseY:B.clientY-6,columnId:j});},grouping:te.grouping,isAllExpanded:te.isAllExpanded,handleToggleAll:te.handleToggleAll,columnWidths:te.columnWidths,onColumnResize:te.handleColumnResize,enableColumnReorder:true}),f(ui,{visibleRows:Oe,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:(B,j)=>{C?.(Ye.get(j.id)||j);},getRowDataKey:({entry:B})=>le(B),getGroupRowProps:()=>({style:{height:ec}}),getRowProps:({data:B})=>{let j=B,me=Ee(j.id),Pe=ke.activeId===j.id,Je=ke.overId===j.id&&$e(ke.activeId,j.id);return {draggable:me,className:Je?"orb-is-drop-target":void 0,style:{cursor:Pe?"grabbing":me?"grab":C?"pointer":"default",height:ec,opacity:Pe?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:qe=>Ze(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:st?fe:void 0,role:"separator","aria-orientation":"vertical",sx:{width:st?ya: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:F,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:We,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`,position:"sticky",top:0,zIndex:2},children:De.map(B=>g("div",{title:B.title,sx:{px:.75,display:"flex",flexDirection:B.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:B.contextLabel?.15:0,borderRight:`1px solid ${A.palette.divider}`,color:B.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[B.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:B.contextLabel}),f(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:B.label})]},B.key))}),f(ae,{sx:{position:"relative"},children:Oe.map(B=>{let j=le(B),me=pe[j]??ec;if(B.type==="group")return f("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":j,sx:{position:"relative",height:me,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`}},B.id);let Pe=B.data||B,Je=or(Pe.startDate),qe=or(Pe.endDate),wt=oc(Je,De,it),ft=oc(qe,De,it),mt=Math.max(0,ft-wt),yt=bg(Pe.progress),oo=Pe.id===b$1,At=Ee(Pe.id),Xt=ke.activeId===Pe.id,Bt=ke.overId===Pe.id&&$e(ke.activeId,Pe.id),Gt=Pe.color??(Pe.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":j,draggable:At,onDragStart:Wt=>Ze(Wt,Pe),onDragOver:Wt=>ut(Wt,Pe.id),onDragEnter:Wt=>ut(Wt,Pe.id),onDrop:Wt=>gt(Wt,Pe.id),onDragEnd:Mt,onClick:()=>C?.(Ye.get(Pe.id)||Pe),sx:{position:"relative",height:me,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`,opacity:Xt?.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:Xt?"grabbing":At?"grab":C?"pointer":"default",transition:"opacity 120ms ease"},children:f(lt,{title:`${Pe.title}: ${Je.format("MMM D HH:mm")} - ${qe.format("MMM D HH:mm")}`,children:g("div",{sx:{position:"absolute",left:`${wt}%`,top:Math.max(8,(me-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:Pe.code})]})})},Pe.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(bp,{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:B=>{te.applyMultiSort([{field:B,direction:"asc"}]);},onSortDesc:B=>{te.applyMultiSort([{field:B,direction:"desc"}]);},onClearSort:B=>{let j=te.sortBy.filter(me=>me.field!==B);j.length>0?te.applyMultiSort(j):(te.clearMultiSort(),te.orderBy===B&&te.setOrderBy(""));},onHideColumn:B=>{te.visibleColumns.includes(B)&&te.toggleColumnVisibility(B);},onToggleGroup:B=>te.toggleGroupField(B),onToggleSummary:B=>te.toggleSummaryColumn(B),onOpenSortDialog:()=>q(true)}),f(vp,{open:at,onClose:()=>q(false),columns:te.columns,initialRules:te.sortBy.length>0?te.sortBy:te.orderBy?[{field:te.orderBy,direction:te.order}]:[],onApply:B=>te.applyMultiSort(B),onClear:()=>{te.clearMultiSort(),te.setOrderBy("");}})]})};var h5=({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(ae,{spacing:r,sx:i,children:[f("div",{sx:{flexShrink:0},children:f(Vo,{...t})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:f(xg,{...o,bodyHeight:o.bodyHeight??"100%",sx:s})}),a]})};var Sg=640,Vx=360,Wx=360,Ts=8,Dn="220ms cubic-bezier(0.2, 0, 0, 1)",ac=(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,...ac(i,o,r+1,[...n,a.id])]:s}),kg=t=>t.flatMap(o=>[o,...kg(o.children??[])]),Pg=(t,o=0,r=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:o,hasChildren:a.length>0,parentIds:r},...Pg(a,o+1,[...r,n.id])]}),Tg=t=>t.flatMap(o=>{let r=o.children??[];return r.length===0?[]:[o.id,...Tg(r)]}),wg=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(),I5=({title:t,subtitle:o,nodes:r,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:l,expandedNodeIds:d,defaultExpandedNodeIds:u,onExpandedNodeIdsChange:m,defaultPaneMode:f$1="split",minTreePaneWidth:h=Vx,minDetailPaneWidth:p=Wx,tableAppId:v="ctree-comp",tableKey:y="default",tableTitle:g$1,filterConfig:x,searchQuery:b$1,searchToken:C,defaultRowsPerPage:k=-1,rowsPerPageOptions:w=[20,50,100,-1],serviceUrl:P,emptyLabel:I="No tree items available.",headerAction:S,sx:N,className:M})=>{let T=ao(),D=useRef(null),A=useRef(null),L=useRef(null),[O,_]=useState(s??r[0]?.id??null),[F,X]=useState(u??Tg(r).slice(0,3)),[V,Z]=useState(f$1),[z,H]=useState(Sg),[U,K]=useState(0),[ge,ie]=useState(0),[pe,xe]=useState(k),We=useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:le=>g(ae,{spacing:.3,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:le.label}),le.subtitle&&f(E,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:le.subtitle})]})}],[n]),we=useMemo(()=>new Set(d??F),[d,F]),se=useMemo(()=>ac(r,we),[r,we]),Ae=useMemo(()=>kg(r),[r]),Ie=useMemo(()=>Pg(r),[r]),ke=i===void 0?O:i,ze=useMemo(()=>Ae.find(le=>le.id===ke)??null,[ke,Ae]),et=le=>{let be=A.current?.clientWidth??0,ee=be>0?Math.max(h,be-Ts-p):Math.max(h,le);return Math.min(Math.max(le,h),ee)},rt=V==="detail",at=V==="tree"||!a,q=V==="split"&&!!a,ve=(()=>{if(U<=0)return null;if(V==="tree"||!a)return {treeWidth:U,splitterWidth:0,detailWidth:0};if(V==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:U};let le=q?Ts:0,be=et(z);return {treeWidth:be,splitterWidth:le,detailWidth:Math.max(0,U-le-be)}})(),Fe=ve?`${ve.treeWidth}px ${ve.splitterWidth}px ${ve.detailWidth}px`:V==="tree"||!a?"minmax(0, 1fr) 0px 0px":V==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${h}px, ${z}px) ${Ts}px minmax(${p}px, 1fr)`;useEffect(()=>{let le=A.current;if(!le){K(0);return}let be=0,ee=()=>{window.cancelAnimationFrame(be),be=window.requestAnimationFrame(()=>{let De=le.clientWidth;K(je=>Math.abs(je-De)<.5?je:De);});};if(ee(),typeof ResizeObserver>"u")return window.addEventListener("resize",ee),()=>{window.cancelAnimationFrame(be),window.removeEventListener("resize",ee);};let he=new ResizeObserver(ee);return he.observe(le),window.addEventListener("resize",ee),()=>{window.cancelAnimationFrame(be),he.disconnect(),window.removeEventListener("resize",ee);}},[]);let nt=le=>{d===void 0&&X(le),m?.(le);},Ye=le=>{let be=new Set(we);be.has(le)?be.delete(le):be.add(le),nt(Array.from(be));},xt=le=>{i===void 0&&_(le.id),l?.(le);};useEffect(()=>{ie(0);},[r]),useEffect(()=>{let le=b$1?.trim().toLowerCase();if(!le)return;let be=Ie.find(({node:dt})=>wg(dt).includes(le));if(!be)return;let ee=new Set(we);be.parentIds.forEach(dt=>ee.add(dt)),nt(Array.from(ee)),xt(be.node);let De=ac(r,ee).findIndex(({node:dt})=>dt.id===be.node.id);De>=0&&pe>0&&ie(Math.floor(De/pe));let je=0,it=0;return je=window.requestAnimationFrame(()=>{it=window.requestAnimationFrame(()=>{let dt=D.current?.querySelector("tr.orb-selected"),Ft=dt?.closest(".orb-table-container");if(dt&&Ft){let Kt=Ft.getBoundingClientRect(),zt=dt.getBoundingClientRect(),St=zt.top-Kt.top+Ft.scrollTop;Ft.scrollTo({top:St-Ft.clientHeight/2+zt.height/2,behavior:"smooth"});return}dt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(je),window.cancelAnimationFrame(it);}},[b$1,C,Ie,r,pe]);let It=useMemo(()=>se.map(({node:le,level:be,hasChildren:ee})=>({...le,id:le.id,__node:le,__level:be,__hasChildren:ee,__expanded:we.has(le.id),__searchText:wg(le)})),[we,se]),Lt=useMemo(()=>We.map((le,be)=>({id:le.id,label:le.label,minWidth:typeof le.width=="number"?le.width:le.minWidth??(be===0?320:120),numeric:le.numeric??le.align==="right",render:(ee,he)=>{let De=he.__node,je=le.render?le.render(De):De[le.id];if(be!==0)return f(Te,{sx:{minWidth:0,color:le.align==="right"?"text.primary":"text.secondary",fontWeight:le.align==="right"?750:500,textAlign:le.align??"left"},children:je});let it=Number(he.__level??0),dt=!!he.__hasChildren,Ft=!!he.__expanded;return g(ae,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${it*24}px`},children:[f(ne,{tooltip:dt?Ft?"Collapse":"Expand":"",onClick:Kt=>{Kt.stopPropagation(),dt&&Ye(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(zo,{sx:{fontSize:20}})}),f(Te,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:De.markerColor??T.palette.primary.main}}),f(Te,{sx:{minWidth:0},children:je})]})}})),[We,we,T.palette.primary.main]),Nt=le=>{if(!q)return;le.preventDefault(),le.currentTarget.setPointerCapture(le.pointerId),L.current={startX:le.clientX,startWidth:z};let be=he=>{let De=L.current;De&&H(et(De.startWidth+he.clientX-De.startX));},ee=()=>{L.current=null,window.removeEventListener("pointermove",be),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",be),window.addEventListener("pointerup",ee);},te=()=>{let le=A.current?.clientWidth??0,be=le>0?Math.max(h,(le-Ts)/2):Sg;Z("split"),H(et(be));},Ge=()=>a?typeof a=="function"?a(ze):a:null,Oe=a?f(zn,{"aria-label":"Tree pane layout",value:V,options:[{value:"tree",label:"Expand tree",icon:f(ti,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(ri,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:f(ei,{fontSize:"small"})}],onValueChange:le=>{le==="split"?te():Z(le);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return g(Te,{ref:D,className:["ctree_comp",M].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)}`,...N},children:[Oe,g(Te,{ref:A,sx:{height:"100%",display:"grid",gridTemplateColumns:Fe,transition:`grid-template-columns ${Dn}`,minWidth:0},children:[g(Te,{"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 ${Dn}, transform ${Dn}`,willChange:"opacity, transform"},children:[g(ae,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${T.palette.divider}`},children:[g(ae,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[f(Cr,{sx:{color:"primary.main",fontSize:28}}),g(Te,{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})]})]}),S!==void 0?S:f(ne,{tooltip:"Add node",color:"default",children:f(Fr,{fontSize:"small"})})]}),g(Te,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[f(jo,{appId:v,tableKey:y,title:g$1??(typeof t=="string"?t:"Tree"),columns:Lt,rows:It,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:ke?[ke]:[],onSelectionChange:le=>{let be=le[le.length-1],ee=Ae.find(he=>he.id===be);ee&&xt(ee);},page:ge,rowsPerPage:pe,rowsPerPageOptions:w,count:It.length,onPageChange:ie,onRowsPerPageChange:le=>{ie(0),xe(le);},filterConfig:x,serviceUrl:P,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),It.length===0&&f(Te,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:I})]})]}),f(Te,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:q?Nt:void 0,sx:{width:"100%",cursor:q?"col-resize":"default",backgroundColor:q?tt(T.palette.text.primary,b()==="dark"?.16:.08):"transparent",opacity:q?1:0,pointerEvents:q?"auto":"none",position:"relative",transition:`opacity ${Dn}, background-color 120ms ease`,"&:hover":{backgroundColor:q?tt(T.palette.primary.main,b()==="dark"?.35:.18):"transparent"}}}),g(Te,{"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 ${Dn}, transform ${Dn}`,willChange:"opacity, transform"},children:[f(Te,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:f(Rt,{sx:{width:"100%"}})}),f(Te,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:Ge()})]})]})]})};var Ux={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)"}}},A5=({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"),f$1=!s&&!d&&r!=="none";useEffect(()=>{if(!f$1){m("to");return}m("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{m("to");});});return ()=>cancelAnimationFrame(v)},[o,f$1]);let h=Ux[r],p=useMemo(()=>f$1?u==="from"?h.from:h.to:{opacity:1,transform:"none"},[f$1,u,h.from,h.to]);return f(Te,{sx:{willChange:f$1?"opacity, transform":"auto",transition:f$1?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...p,...l},children:t})},E5={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};export{iz as AIBrowserGlow,uc as Activity,Tm as AgentPanel,Ca as AlertCircle,mc as AlertTriangle,g0 as ArrowDown,f0 as ArrowRight,gc as ArrowUp,Rs as BarChart,h0 as Bot,Bs as Button,ny as CAINavProvider,tn as CAlert,Tp as CAmapChart,Fi as CAppHeader,hl as CAppHeaderSearch,$A as CAppPageLayout,Rz as CAuthPage,en as CAvatar,Oa as CBadge,jn as CBarChart,Se as CButton,Wn as CCalendar,Wp as CCardDetailPanel,_p as CCardGrid,mb as CCardGridCard,vD as CCardPage,fi as CChartCard,Tt as CCheckbox,Ct as CChip,xp as CComboChart,Mp as CCustomizeAgent,Nf as CDatePicker,VN as CDetailInfoPage,Qp as CDetailSearchAiBar,Ni as CDetailSectionCard,Et as CDialog,Rt as CDivider,Ef as CFileUpload,JP as CFilterField,wp as CFishboneChart,Pp as CGoogleMapChart,Ip as CGraphCharts,yp as CGraphKpiCards,yi as CGraphReport,Sp as CHeatmapChart,ne as CIconButton,gA as CKanbanBoard,ou as CKanbanBucket,dl as CKanbanCard,Bp as CLayoutManagement,gn as CLayoutManager,Cp as CLineChart,GP as CList,UP as CListItem,ZP as CListItemAvatar,KP as CListItemButton,qP as CListItemIcon,XP as CListItemText,YP as CListSubheader,Zt as CMenu,qn as CMessageBox,ls as CMetricChartCard,ii as CPageLayout,A5 as CPageTransition,Ne as CPaper,hi as CPieChart,DL as CPivotTable,xg as CPlanningGantt,h5 as CPlanningLayout,Ls as CPopover,Hn as CProgress,of as CRadioGroup,zn as CSegmentedControl,Ht as CSelect,df as CSkeleton,Vo as CSmartFilter,B1 as CSmartTable,qo as CSpinner,ae as CStack,G1 as CStandardPage,WP as CStatusBadge,La as CSwitch,jo as CTable,A1 as CTableBody,E1 as CTableCell,L1 as CTableContainer,O1 as CTableHead,F1 as CTableRow,If as CTabs,Bn as CTextArea,He as CTextField,lt as CTooltip,I5 as CTreeComp,E as CTypography,dp as CValueHelp,wi as CVariantManagement,Ap as CVariantManager,Tl as CVoiceWaveOverlay,kp as CWaterfallChart,Ds as Calendar,b0 as CalendarDays,v0 as Camera,y0 as ChartNoAxesCombined,Ko as Check,xa as CheckCircle,Oo as ChevronDown,Sa as ChevronLeft,Fo as ChevronRight,C0 as ChevronUp,x0 as ChevronsDown,S0 as ChevronsUp,wa as CircleAlert,En as CircleCheck,w0 as CircleCheckBig,fc as CircleStop,hc as Clipboard,k0 as ClipboardCheck,P0 as ClipboardList,bc as Clock,na as CodeBlock,T0 as Columns3,rz as CopilotChat,hr as Copy,I0 as CopyPlus,M0 as Delete,vc as Download,yc as Edit,Cc as Expand,R0 as Eye,D0 as EyeOff,ka as File,xc as FileText,N0 as Filter,YH as FloatingAgentPanel,Ln as FolderTree,Sc as GitBranch,FP as GlobalMessage,On as Globe,wc as Grid,A0 as GripVertical,E0 as Hammer,kc as Image,Pa as Info,Ol as InputArea,L0 as Languages,O0 as Layers,F0 as LayoutDashboard,Ta as Lightbulb,Pc as LineChart,Tc as Loader2,Ia as Lock,B0 as LockKeyhole,Ic as LogOut,ss as METRIC_CHART_TYPES,Ns as Mail,Mc as MapPin,sa as MarkdownRenderer,aa as MathBlock,Rc as Menu,ol as MermaidBlock,zg as MessageCircle,Dc as MessageSquare,Ma as Mic,H0 as MicOff,Nc as Moon,z0 as MoreHorizontal,Qc as NavigationIsland,Vs as NavigationIsland2,cx as OMPHApprovalCard,HH as OMPHPanel,_n as ORBCAFE_I18N_MESSAGES,Mg as ORB_DARK,qx as ORB_FONT_STACK,Ig as ORB_LIGHT,Yx as ORB_RADIUS,Is as ORB_TOKENS,Zx as ORB_TRANSITION_FAST,Ha as OrbcafeI18nProvider,An as OrbisModeProvider,E5 as PAGE_TRANSITION_PRESETS,rF as PAppPageLayout,XL as PBarcodeScanner,Qu as PNavIsland,cO as PNumericKeypad,Ku as PSmartFilter,Yv as PTable,tO as PTouchCard,qu as PWorkloadNav,V0 as PackageCheck,W0 as PackageSearch,Ra as PanelLeftOpen,Da as PanelRight,$0 as PanelsTopLeft,Ac as PieChart,Qr as Pin,Bu as PivotChartPanel,_0 as Play,jr as Plus,G0 as QrCode,U0 as ReceiptText,Na as RefreshCw,K0 as Rocket,q0 as RotateCcw,Ec as RotateCw,X0 as Rows3,Pt as SapIcon,Y0 as Save,Z0 as ScanLine,Bo as Search,Vg as Send,Lc as SendHorizontal,Jr as Settings,Q0 as ShieldCheck,j0 as Sigma,J0 as SortAsc,eS as SquareSplitHorizontal,tS as Star,km as StdChat,Oc as Sun,oS as Table2,nl as TableBlock,rS as TabletSmartphone,Fn as Terminal,Ri as ThinkBlock,Fc as ThumbsDown,Bc as ThumbsUp,Hc as Trash2,Gn as TreeMenu,nS as TreePine,zc as TrendingDown,Aa as TriangleAlert,aS as Truck,Vc as UploadCloud,As as User,gF as VoiceNavigatorProvider,lF as VoiceWaveOverlay,Wc as Volume2,iS as Warehouse,sS as Workflow,Yt as X,Ea as XCircle,ru as addKanbanBucket,bi as buildAmapEmbedUrl,Jn as buildGoogleMapEmbedUrl,MM as buildGoogleMapIframe,Hf as buttonVariants,au as createKanbanBoardModel,re as createSapIcon,$o as findKanbanCard,MP as message,ar as messageManager,Li as moveKanbanCard,tt as orbAlpha,Xx as orbChartSeries,Mi as parseMarkdownTable,Hl as parseOmphFileHref,nu as renameKanbanBucket,uN as renderMarkdown,Ti as resolveVariantFilters,Ii as resolveVariantLayout,ay as useAINav,AD as useAmapEmbedUrl,Cz as useAuthPage,wD as useCardPage,Jp as useDetailInfo,ND as useGoogleMapEmbedUrl,TD as useGraphChartData,xi as useGraphInteraction,pn as useGraphReport,yA as useKanbanBoard,Ro as useMediaQuery,rd as useNavigationIsland,yo as useOrbMode,Ms as useOrbTokens,de as useOrbcafeI18n,zL as usePadLayout,$L as usePadRecordEditor,uu as usePageLayout,OL as usePivotTable,fg as usePlanningGantt,Bz as usePlanningLayout,Z1 as useStandardReport,Cn as useVoiceInput,fF as useVoiceNavigator};
|
|
53
|
+
`,Xz=({active:t=false,colors:o=Yx,zIndex:r=2147483e3})=>{let n={"--orbcafe-ai-glow-line":o[0],"--orbcafe-ai-glow-z-index":r};return g(e,{children:[f("style",{children:Qx}),f("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var c5=({defaultMode:t="login",onLogin:o,onRegister:r,onForgotPassword:n}={})=>{let[a,i]=useState(t),[s,l]=useState(false),d=useCallback(async u=>{l(true);try{await u?.();}finally{l(false);}},[]),p=useCallback(u=>d(()=>o?.(u)),[o,d]),m=useCallback(u=>d(()=>r?.(u)),[r,d]),h=useCallback(u=>d(()=>n?.(u)),[n,d]),f=useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:p,onRegister:m,onForgotPassword:h}),[h,p,m,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:f}};var ew={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."},v5=({mode:t,defaultMode:o="login",onModeChange:r,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:l,copy:d,sx:p})=>{let m=t!==void 0,[h,f$1]=useState(o),u=t??h,b=useMemo(()=>({...ew,...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,k]=useState({email:""}),[w,P]=useState(""),I=A=>{m||f$1(A),P(""),r?.(A);},S=async A=>{A.preventDefault(),await n?.(C),P("Demo login accepted. No real authentication request was sent.");},R=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=u==="login"?b.loginTitle:u==="register"?b.registerTitle:b.forgotTitle,M=u==="login"?b.loginSubtitle:u==="register"?b.registerSubtitle:b.forgotSubtitle;return g("div",{className:"orb-auth-frame orb-root",style:p,children:[g("div",{className:"orb-auth-brand",children:[f("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:140,height:140,right:120,bottom:80,borderColor:"rgba(255,255,255,.09)"}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:76,height:76,right:60,bottom:170,background:"color-mix(in oklch, var(--orb-primary) 35%, transparent)",borderColor:"rgba(255,255,255,.2)"}}),l?f("span",{style:{alignSelf:"flex-start",position:"relative"},children:l}):f("span",{className:"orb-logo-slot",children:"Host logo"}),g("div",{className:"orb-auth-claim",children:[f("div",{className:"orb-auth-rule"}),f("h2",{children: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:M}),w&&f(tn,{severity:"success",children:w}),u==="login"&&g("form",{onSubmit:S,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(_s,{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(La,{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(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:()=>I("register"),children:"Register"})]})]}),u==="register"&&g("form",{onSubmit:R,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(_s,{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($s,{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(La,{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:()=>I("login"),children:"Sign in"})]})]}),u==="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($s,{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:()=>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(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 ow={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},rw=[{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"}],Eg=({tasks:t,appId:o,tableKey:r,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:l,filterTableKey:d,serviceUrl:p,variantService:m,layout:h,columns:f,page:u,rowsPerPage:b,rowsPerPageOptions:C,count:g,onPageChange:x,onRowsPerPageChange:v,onFilterSearch:y,onFilterVariantLoad:k,enableRowReorder:w,onTaskReorder:P,onLayoutIdChange:I,onLayoutSave:S})=>{let R=o??l??"planning-gantt",N=r??d??"planning",[T,M]=useState(n),[A,L]=useState(a??t[0]?.id??""),[W,ee]=useState(""),[O,_]=useState(null),[V,Q]=useState({...ow,...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]?rr(Ce[0]):null,de=Ce?.[1]?rr(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=rr(ve.startDate),et=rr(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),I?.(le);},[I]),Z=useCallback(le=>{_(he=>({key:(he?.key??0)+1,variant:le})),k?.(le);},[k]),Y=useMemo(()=>({appId:R,tableKey:N,fields:s??rw,filters:V,onFilterChange:Q,onVariantLoad:Z,onSearch:y??(()=>{}),currentLayoutId:W,layoutRefs:[{tableKey:N,layoutId:W||null}],variantService:m,serviceUrl:p}),[W,s,V,Z,y,R,N,p,m]),J=useMemo(()=>({appId:R,tableKey:N,serviceUrl:p,tasks:H,columns:f,scale:T,onScaleChange:M,page:u,rowsPerPage:b,rowsPerPageOptions:C,count:g,onPageChange:x,onRowsPerPageChange:v,selectedTaskId:A,onTaskSelect:B,enableRowReorder:w,onTaskReorder:P,layout:h,layoutVariant:O?.variant,layoutVariantLoadKey:O?.key,onLayoutIdChange:q,onLayoutSave:S}),[f,g,w,H,q,h,O?.key,O?.variant,x,v,S,P,B,u,R,N,b,C,T,p,A]);return {scale:T,setScale:M,selectedTaskId:A,setSelectedTaskId:L,filters:V,setFilters:Q,filteredTasks:H,smartFilterProps:Y,planningGanttProps:J}};var T5=t=>{let o=Eg(t),r=useMemo(()=>({filterProps:o.smartFilterProps,ganttProps:o.planningGanttProps}),[o.planningGanttProps,o.smartFilterProps]);return {...o,layoutProps:r}};rr.extend(aw);var gc=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],hc=36,fc=58,Ta=8,bc=260,uw=320,_r="220ms cubic-bezier(0.2, 0, 0, 1)",Lg={"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"}},mw=t=>t?Lg[t]?.label??t:"Planned",gw=t=>t?Lg[t]?.color??"default":"info",Og=t=>Math.min(100,Math.max(0,t??0)),Fg=(t,o=0)=>t.flatMap(r=>[{...r,level:o},...Fg(r.children??[],o+1)]),hw=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:mw(t.status),statusTone:t.status??"planned",progress:Og(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Bg=(t,o)=>o==="month"?t.startOf("month"):o==="week"?t.startOf("week"):o==="day"?t.startOf("day"):t.startOf("hour"),Hg=(t,o)=>o==="month"?t.endOf("month"):o==="week"?t.endOf("week"):o==="day"?t.endOf("day"):t.endOf("hour"),fw=(t,o,r)=>{let n=[],a=Bg(t,r),i=Hg(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},vc=(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},zg=({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:p,page:m,rowsPerPage:h=20,rowsPerPageOptions:f$1=[20,50,100,-1],count:u,onPageChange:b$1,onRowsPerPageChange:C,timelineStart:g$1,timelineEnd:x,selectedTaskId:v,onTaskSelect:y,enableRowReorder:k=true,onTaskReorder:w,layout:P,layoutVariant:I,layoutVariantLoadKey:S,onLayoutIdChange:R,onLayoutSave:N,emptyLabel:T="No planning tasks available.",sx:M})=>{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(hc),[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(()=>Fg(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=>hw(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:gw(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(Wn,{variant:"determinate",value:F,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),At=useMemo(()=>{if(!l||l.length===0)return Ot;let F=new Map(Ot.map(j=>[j.id,j]));return l.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)})},[l,Ot,Ze]),re=hn({appId:t,tableKey:o,title:n,columns:At,rows:xt,rowKey:"id",page:m,rowsPerPage:h,rowsPerPageOptions:f$1,count:u??xt.length,onPageChange:b$1,onRowsPerPageChange:C,showSummary:false,layout:P,onLayoutSave:N}),Ge=t?f(gn,{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(()=>{S===void 0||!I||de.current!==S&&(de.current=S,re.handleVariantLoad(I));},[re,I,S]),useEffect(()=>{R?.(re.currentLayoutId);},[re.currentLayoutId,R]);let pe=F=>F.type==="group"?`group-${F.id}`:`row-${(F.data||F)?.id}`,xe=useMemo(()=>{let F=xt.map(mt=>rr(mt.startDate)),j=xt.map(mt=>rr(mt.endDate)),ge=g$1?rr(g$1):F.reduce((mt,yt)=>yt.isBefore(mt)?yt:mt,F[0]??rr()),Te=x?rr(x):j.reduce((mt,yt)=>yt.isAfter(mt)?yt:mt,j[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:Bg(ge.subtract(St,Je),d),end:Hg(Te.add(ht,qe),d)}},[xt,d,x,g$1]),oe=gc.find(F=>F.value===d)??gc[1],ye=Array.isArray(a)?a:a?[a]:[],De=useMemo(()=>fw(xe.start,xe.end,d),[xe.end,xe.start,d]),je=De.length*oe.width,st=De.length>0?100/De.length:100,pt=De.length>0?`repeat(${De.length}, minmax(${oe.width}px, 1fr))`:"1fr",Bt=De.length>0?`calc(100% / ${De.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",Nt=q==="table",lt=!ft&&!Nt,Ft=()=>{let F=Y||W.current?.clientWidth||0;return F>0?Math.max(bc,F-Ta-uw):Math.max(bc,Xt)},Zt=F=>Math.min(Math.max(F,bc),Ft()),z=(()=>{if(Y<=0)return null;let F=lt?Ta: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) ${Ta}px minmax(0, 1fr)`:`${Vt}px ${Ta}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=>!k||!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 fo=Ze.get(no);if(fo){let{level:Io,...Mo}=fo;to.push(Mo);}return to},[]);w?.($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||Nt)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=De.length>0?ro/De.length:oe.width,Yt=vc(rr(Je.startDate),De,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,Nt,Le,De]),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||hc,to={};Ut.forEach(no=>{let fo=no.dataset.ctableRowKey;fo&&(to[fo]=no.getBoundingClientRect().height);}),be(no=>Math.abs(no-$t)<.01?no:$t),he(no=>{let fo=Object.keys(no),Io=Object.keys(to);return fo.length===Io.length&&Io.every(Mo=>Math.abs((no[Mo]??0)-to[Mo])<.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(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}`,...M},children:[f("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":L("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(hi,{value:re.filterText,onChange:F=>{re.setFilterText(F),re.setPage(0);}}),f(gi,{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(an,{fontSize:"small"})}),f(ie,{className:"orb-table-tool-button",tooltip:"Group by",onClick:F=>re.setGroupAnchorEl(F.currentTarget),sx:po,children:f(Cr,{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(up,{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(li,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(di,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:f(si,{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:gc.map(F=>({value:F.value,label:F.label})),onChange:F=>p?.(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 ${_r}`},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 ${_r}, transform ${_r}`},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:hc,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[f(vi,{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(yi,{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:fc}}),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:fc,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?Ta: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 ${_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:lt?"col-resize":"default"}}}),f("div",{sx:{minWidth:0,overflow:"hidden",opacity:Nt?0:1,transform:Nt?"translateX(10px)":"translateX(0)",pointerEvents:Nt?"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:pt,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(se,{sx:{position:"relative"},children:Le.map(F=>{let j=pe(F),ge=le[j]??fc;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=rr(Te.startDate),qe=rr(Te.endDate),St=vc(Je,De,st),ht=vc(qe,De,st),mt=Math.max(0,ht-St),yt=Og(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(cn,{groupAnchorEl:re.groupAnchorEl,setGroupAnchorEl:re.setGroupAnchorEl,grouping:re.grouping,setGrouping:re.setGrouping,columns:re.columns}),f(dn,{anchorEl:re.anchorEl,setAnchorEl:re.setAnchorEl,columns:re.columns,visibleColumns:re.visibleColumns,toggleColumnVisibility:re.toggleColumnVisibility}),f(Rp,{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(Dp,{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 aV=({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(zg,{...o,bodyHeight:o.bodyHeight??"100%",sx:s})}),a]})};var Vg=640,bw=360,vw=360,Fs=8,An="220ms cubic-bezier(0.2, 0, 0, 1)",xc=(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,...xc(i,o,r+1,[...n,a.id])]:s}),$g=t=>t.flatMap(o=>[o,...$g(o.children??[])]),_g=(t,o=0,r=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:o,hasChildren:a.length>0,parentIds:r},..._g(a,o+1,[...r,n.id])]}),Gg=t=>t.flatMap(o=>{let r=o.children??[];return r.length===0?[]:[o.id,...Gg(r)]}),Wg=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(),fV=({title:t,subtitle:o,nodes:r,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:l,expandedNodeIds:d,defaultExpandedNodeIds:p,onExpandedNodeIdsChange:m,defaultPaneMode:h="split",minTreePaneWidth:f$1=bw,minDetailPaneWidth:u=vw,tableAppId:b$1="ctree-comp",tableKey:C="default",tableTitle:g$1,filterConfig:x,searchQuery:v,searchToken:y,defaultRowsPerPage:k=-1,rowsPerPageOptions:w=[20,50,100,-1],serviceUrl:P,emptyLabel:I="No tree items available.",headerAction:S,sx:R,className:N})=>{let T=io(),M=useRef(null),A=useRef(null),L=useRef(null),[W,ee]=useState(s??r[0]?.id??null),[O,_]=useState(p??Gg(r).slice(0,3)),[V,Q]=useState(h),[H,B]=useState(Vg),[q,Z]=useState(0),[Y,J]=useState(0),[le,he]=useState(k),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(()=>xc(r,be),[r,be]),Be=useMemo(()=>$g(r),[r]),de=useMemo(()=>_g(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-Fs-u):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?Fs: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) ${Fs}px minmax(${u}px, 1fr)`;useEffect(()=>{let pe=A.current;if(!pe){Z(0);return}let xe=0,oe=()=>{window.cancelAnimationFrame(xe),xe=window.requestAnimationFrame(()=>{let De=pe.clientWidth;Z(je=>Math.abs(je-De)<.5?je:De);});};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),l?.(pe);};useEffect(()=>{J(0);},[r]),useEffect(()=>{let pe=v?.trim().toLowerCase();if(!pe)return;let xe=de.find(({node:pt})=>Wg(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 De=xc(r,oe).findIndex(({node:pt})=>pt.id===xe.node.id);De>=0&&le>0&&J(Math.floor(De/le));let je=0,st=0;return je=window.requestAnimationFrame(()=>{st=window.requestAnimationFrame(()=>{let pt=M.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:Wg(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 De=ye.__node,je=pe.render?pe.render(De):De[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(De.id);},disabled:!pt,sx:{width:24,height:24,visibility:pt?"visible":"hidden",transform:Bt?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:f(Wo,{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,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 De=L.current;De&&B(et(De.startWidth+ye.clientX-De.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-Fs)/2):Vg;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(li,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(di,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:f(si,{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:M,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)}`,...R},children:[Le,g(Ie,{ref:A,sx:{height:"100%",display:"grid",gridTemplateColumns:Oe,transition:`grid-template-columns ${An}`,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 ${An}, transform ${An}`,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(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})]})]}),S!==void 0?S:f(ie,{tooltip:"Add node",color:"default",children:f(Fr,{fontSize:"small"})})]}),g(Ie,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[f(er,{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:w,count:It.length,onPageChange:J,onRowsPerPageChange:pe=>{J(0),he(pe);},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: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 ${An}, 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 ${An}, transform ${An}`,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 ww={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)"}}},xV=({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)"),[p,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=ww[r],u=useMemo(()=>h?p==="from"?f$1.from:f$1.to:{opacity:1,transform:"none"},[h,p,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",...u,...l},children:t})},wV={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};export{Xz as AIBrowserGlow,Mc as Activity,Wm as AgentPanel,Ia as AlertCircle,Rc as AlertTriangle,Uw as ArrowDown,Kw as ArrowRight,Dc as ArrowUp,zs as BarChart,qw as Bot,Xs as Button,wy as CAINavProvider,tn as CAlert,Hp as CAmapChart,_i as CAppHeader,Rl as CAppHeaderSearch,yE as CAppPageLayout,v5 as CAuthPage,en as CAvatar,$a as CBadge,ta as CBarChart,Pe as CButton,Gn as CCalendar,Jp as CCardDetailPanel,tu as CCardGrid,Nb as CCardGridCard,ZD as CCardPage,wi as CChartCard,Tt as CCheckbox,Ct as CChip,Ep as CComboChart,Vp as CCustomizeAgent,Xh as CDatePicker,bA as CDetailInfoPage,cu as CDetailSearchAiBar,Hi as CDetailSectionCard,Lt as CDialog,Rt as CDivider,Yh as CFileUpload,DT as CFilterField,Op as CFishboneChart,Bp as CGoogleMapChart,zp as CGraphCharts,Np as CGraphKpiCards,Ti as CGraphReport,Lp as CHeatmapChart,ie as CIconButton,UA as CKanbanBoard,gu as CKanbanBucket,Sl as CKanbanCard,Zp as CLayoutManagement,gn as CLayoutManager,Ap as CLineChart,xT as CList,wT as CListItem,IT as CListItemAvatar,ST as CListItemButton,kT as CListItemIcon,PT as CListItemText,TT as CListSubheader,Qt as CMenu,Yn as CMessageBox,fs as CMetricChartCard,mi as CPageLayout,xV as CPageTransition,Ne as CPaper,Si as CPieChart,sO as CPivotTable,zg as CPlanningGantt,aV as CPlanningLayout,Us as CPopover,Wn as CProgress,Ch as CRadioGroup,$n as CSegmentedControl,zt as CSelect,Ih as CSkeleton,$o as CSmartFilter,gD as CSmartTable,Zo as CSpinner,se as CStack,xD as CStandardPage,vT as CStatusBadge,Wa as CSwitch,er as CTable,cD as CTableBody,dD as CTableCell,pD as CTableContainer,uD as CTableHead,mD as CTableRow,Gh as CTabs,Vn as CTextArea,He as CTextField,ct as CTooltip,fV as CTreeComp,E as CTypography,wp as CValueHelp,Di as CVariantManagement,Gp as CVariantManager,zl as CVoiceWaveOverlay,Fp as CWaterfallChart,Vs as Calendar,Xw as CalendarDays,Zw as Camera,Yw as ChartNoAxesCombined,xo as Check,Ma as CheckCircle,Bo as ChevronDown,Ra as ChevronLeft,Ho as ChevronRight,Qw as ChevronUp,jw as ChevronsDown,Jw as ChevronsUp,Da as CircleAlert,On as CircleCheck,e0 as CircleCheckBig,Ws as CircleStop,Nc as Clipboard,t0 as ClipboardCheck,o0 as ClipboardList,Ac as Clock,sa as CodeBlock,r0 as Columns3,Uz as CopilotChat,No as Copy,n0 as CopyPlus,a0 as Delete,Fn as Download,Ec as Edit,Lc as Expand,i0 as Eye,s0 as EyeOff,Na as File,Oc as FileText,l0 as Filter,Bz as FloatingAgentPanel,Bn as FolderTree,Fc as GitBranch,mT as GlobalMessage,Hn as Globe,Bc as Grid,c0 as GripVertical,d0 as Hammer,Hc as Image,Aa as Info,Yl as InputArea,p0 as Languages,u0 as Layers,m0 as LayoutDashboard,Ea as Lightbulb,zc as LineChart,Vc as Loader2,La as Lock,g0 as LockKeyhole,Wc as LogOut,hs as METRIC_CHART_TYPES,$s as Mail,$c as MapPin,da as MarkdownRenderer,la as MathBlock,_c as Menu,hl as MermaidBlock,rh as MessageCircle,Gc as MessageSquare,Oa as Mic,h0 as MicOff,Uc as Moon,f0 as MoreHorizontal,pd as NavigationIsland,Qs as NavigationIsland2,Vx as OMPHApprovalCard,Pz as OMPHPanel,Kn as ORBCAFE_I18N_MESSAGES,Kg as ORB_DARK,kw as ORB_FONT_STACK,Ug as ORB_LIGHT,Tw as ORB_RADIUS,Bs as ORB_TOKENS,Iw as ORB_TRANSITION_FAST,Ua as OrbcafeI18nProvider,Ln as OrbisModeProvider,wV as PAGE_TRANSITION_PRESETS,LF as PAppPageLayout,PO as PBarcodeScanner,cm as PNavIsland,VO as PNumericKeypad,nm as PSmartFilter,my as PTable,AO as PTouchCard,am as PWorkloadNav,b0 as PackageCheck,v0 as PackageSearch,Fa as PanelLeftOpen,Ba as PanelRight,y0 as PanelsTopLeft,Kc as PieChart,Qr as Pin,Zu as PivotChartPanel,C0 as Play,jr as Plus,x0 as QrCode,w0 as ReceiptText,Ha as RefreshCw,S0 as Rocket,k0 as RotateCcw,qc as RotateCw,P0 as Rows3,Pt as SapIcon,T0 as Save,I0 as ScanLine,zo as Search,nh as Send,Xc as SendHorizontal,Jr as Settings,M0 as ShieldCheck,R0 as Sigma,D0 as SortAsc,N0 as SquareSplitHorizontal,A0 as Star,zm as StdChat,Zc as Sun,E0 as Table2,bl as TableBlock,L0 as TabletSmartphone,zn as Terminal,Fi as ThinkBlock,Yc as ThumbsDown,Qc as ThumbsUp,jc as Trash2,qn as TreeMenu,O0 as TreePine,Jc as TrendingDown,za as TriangleAlert,F0 as Truck,ed as UploadCloud,_s as User,UF as VoiceNavigatorProvider,zF as VoiceWaveOverlay,td as Volume2,B0 as Warehouse,H0 as Workflow,Kt as X,Va as XCircle,hu as addKanbanBucket,ki as buildAmapEmbedUrl,oa as buildGoogleMapEmbedUrl,aR as buildGoogleMapIframe,tf as buttonVariants,bu as createKanbanBoardModel,ae as createSapIcon,Go as findKanbanCard,aT as message,ir as messageManager,Wi as moveKanbanCard,nc as omphApprovalLabelsFromI18n,rc as omphLabelsFromI18n,tt as orbAlpha,Pw as orbChartSeries,Oi as parseMarkdownTable,Jl as parseOmphFileHref,fu as renameKanbanBucket,_N as renderMarkdown,Ei as resolveVariantFilters,Li as resolveVariantLayout,Sy as useAINav,cN as useAmapEmbedUrl,c5 as useAuthPage,eN as useCardPage,pu as useDetailInfo,lN as useGoogleMapEmbedUrl,rN as useGraphChartData,Mi as useGraphInteraction,pn as useGraphReport,YA as useKanbanBoard,Do as useMediaQuery,bd as useNavigationIsland,go as useOrbMode,Hs as useOrbTokens,ce as useOrbcafeI18n,fO as usePadLayout,yO as usePadRecordEditor,ku as usePageLayout,uO as usePivotTable,Eg as usePlanningGantt,T5 as usePlanningLayout,ID as useStandardReport,Cn as useVoiceInput,KF as useVoiceNavigator};
|