orbcafe-ui 3.1.3 → 3.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var jsxRuntime=require('react/jsx-runtime'),ogl=require('ogl'),er=require('react'),Nr=require('@radix-ui/react-dropdown-menu'),Yr=require('@radix-ui/react-tooltip'),reactDom=require('react-dom'),wr=require('@radix-ui/react-dialog'),yo=require('@radix-ui/react-popover'),ro=require('dayjs'),eb=require('dayjs/plugin/customParseFormat'),navigation=require('next/navigation'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),sortable=require('@dnd-kit/sortable'),gh=require('dayjs/plugin/isBetween'),fh=require('dayjs/plugin/localizedFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var My=require('next/dynamic'),framerMotion=require('framer-motion'),NC=require('react-markdown'),AC=require('remark-gfm'),EC=require('remark-math'),LC=require('rehype-katex'),OC=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),Sm=require('mermaid'),a0=require('dayjs/plugin/isoWeek');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var er__namespace=/*#__PURE__*/_interopNamespace(er);var Nr__namespace=/*#__PURE__*/_interopNamespace(Nr);var Yr__namespace=/*#__PURE__*/_interopNamespace(Yr);var wr__namespace=/*#__PURE__*/_interopNamespace(wr);var yo__namespace=/*#__PURE__*/_interopNamespace(yo);var ro__default=/*#__PURE__*/_interopDefault(ro);var eb__default=/*#__PURE__*/_interopDefault(eb);var gh__default=/*#__PURE__*/_interopDefault(gh);var fh__default=/*#__PURE__*/_interopDefault(fh);var My__default=/*#__PURE__*/_interopDefault(My);var NC__default=/*#__PURE__*/_interopDefault(NC);var AC__default=/*#__PURE__*/_interopDefault(AC);var EC__default=/*#__PURE__*/_interopDefault(EC);var LC__default=/*#__PURE__*/_interopDefault(LC);var OC__default=/*#__PURE__*/_interopDefault(OC);var Sm__default=/*#__PURE__*/_interopDefault(Sm);var a0__default=/*#__PURE__*/_interopDefault(a0);var gc=Object.defineProperty;var Wg=(t,r,o)=>r in t?gc(t,r,{enumerable:true,configurable:true,writable:true,value:o}):t[r]=o;var As=(t,r,o)=>()=>{if(o)throw o[0];try{return t&&(r=t(t=0)),r}catch(n){throw o=[n],n}};var $g=(t,r)=>{for(var o in r)gc(t,o,{get:r[o],enumerable:true});};var fc=(t,r,o)=>Wg(t,r+"",o);var ka,Ug,vt,Pa,bc,Kg,qg,hc,vc,Xg,Ls,Yg,yc,Zg,On,Ue,_t=As(()=>{"use strict";ka={xs:0,sm:600,md:900,lg:1200,xl:1536},Ug=t=>({palette:{mode:t,primary:{main:"var(--orb-primary)",light:"var(--orb-p300)",dark:"var(--orb-p700)",contrastText:"var(--orb-on-primary)"},secondary:{main:t==="dark"?"var(--orb-p300)":"var(--orb-fg)",contrastText:t==="dark"?"var(--orb-canvas)":"var(--orb-on-primary)"},error:{main:"var(--orb-err)",contrastText:"var(--orb-on-primary)"},warning:{main:"var(--orb-accent)",contrastText:"var(--orb-on-primary)"},info:{main:t==="dark"?"var(--orb-p300)":"var(--orb-primary)",contrastText:"var(--orb-on-primary)"},success:{main:t==="dark"?"var(--orb-p300)":"var(--orb-primary)",contrastText:"var(--orb-on-primary)"},text:{primary:"var(--orb-fg)",secondary:"var(--orb-muted)",disabled:"var(--orb-disabled-fg)"},background:{default:"var(--orb-canvas)",paper:"var(--orb-surface)"},action:{hover:"var(--orb-hover)",selected:"var(--orb-selected)",focus:"var(--orb-focus-ring)",disabled:"var(--orb-disabled-fg)",disabledBackground:"var(--orb-disabled-bg)",active:t==="dark"?"var(--orb-p300)":"var(--orb-primary)"},divider:"var(--orb-border)",common:{white:"#ffffff",black:"#01091a"},grey:{50:"var(--orb-surface)",100:"var(--orb-surface)",200:"var(--orb-border)",300:"var(--orb-border)",400:"var(--orb-muted)",500:"var(--orb-muted)",600:"var(--orb-fg)",700:"var(--orb-fg)",800:"var(--orb-surface-3)",900:"var(--orb-canvas)"}},shape:{borderRadius:10},breakpoints:{up:r=>`@media (min-width:${ka[r]}px)`,down:r=>`@media (max-width:${Math.max(0,ka[r]-.05)}px)`},spacing:(...r)=>r.map(o=>`${o*8}px`).join(" "),transitions:{create:(r="all",o={})=>(Array.isArray(r)?r:[r]).map(a=>`${a} ${o.duration??200}ms ${o.easing??"ease"}`).join(", "),duration:{shortest:150,shorter:180,short:200,standard:300}},zIndex:{modal:1300,drawer:1200,appBar:1100,tooltip:1500}}),vt=()=>typeof document>"u"?"light":document.documentElement.dataset.orbMode==="dark"||document.documentElement.classList.contains("orb-dark")?"dark":"light",Pa=()=>Ug(vt()),bc={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"],bgcolor:["backgroundColor"]},Kg=new Set(["animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","gridRow","gridRowEnd","gridRowSpan","gridRowStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom"]),qg=(t,r)=>{if(typeof r!="string")return r;let o={"background.default":"var(--orb-canvas)","background.paper":"var(--orb-surface)","text.primary":"var(--orb-fg)","text.secondary":"var(--orb-muted)","text.disabled":"var(--orb-disabled-fg)","primary.main":"var(--orb-primary)","primary.light":"var(--orb-p300)","primary.dark":"var(--orb-p700)","secondary.main":"var(--orb-muted)",divider:"var(--orb-border)","error.main":"var(--orb-err)","warning.main":"var(--orb-accent)","success.main":"var(--orb-primary)","info.main":"var(--orb-primary)","action.hover":"var(--orb-hover)","action.selected":"var(--orb-selected)","action.disabled":"var(--orb-disabled-fg)"};return o[r]?o[r]:r},hc=t=>t.startsWith("--")?t:t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),vc=(t,r)=>{if(r==null||r===!1)return null;let o=qg(t,r);return typeof o=="number"&&o!==0&&!Kg.has(t)?["margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","gap","rowGap","columnGap"].includes(t)?`${o*8}px`:`${o}px`:String(o)},Xg=t=>t?(Array.isArray(t)?t:[t]).reduce((o,n)=>{if(!n)return o;let a=typeof n=="function"?n(Pa()):n;return {...o,...a}},{}):{},Ls=t=>!t||typeof t!="object"?JSON.stringify(t):Array.isArray(t)?`[${t.map(Ls).join(",")}]`:`{${Object.keys(t).sort().map(r=>`${JSON.stringify(r)}:${Ls(t[r])}`).join(",")}}`,Yg=t=>{let r=2166136261;for(let o=0;o<t.length;o+=1)r^=t.charCodeAt(o),r=Math.imul(r,16777619);return (r>>>0).toString(36)},yc=new Set,Zg=t=>{if(typeof document>"u"||yc.has(t))return;yc.add(t);let r=document.querySelector("style[data-orb-sx]");r||(r=document.createElement("style"),r.dataset.orbSx="true",document.head.appendChild(r)),r.appendChild(document.createTextNode(t));},On=(t,r)=>{let o=[],n=[];return Object.entries(r).forEach(([a,i])=>{let s=typeof i=="function"?i(Pa()):i;if(s==null||s===!1)return;if(a.startsWith("@media")&&typeof s=="object"){n.push(`${a}{${On(t,s)}}`);return}if(a.startsWith("&")&&typeof s=="object"){n.push(On(a.split("&").join(t),s));return}if((a.startsWith(":")||a.startsWith(">")||a.startsWith("["))&&typeof s=="object"){n.push(On(`${t}${a}`,s));return}if(typeof s=="object"){let d=s,u=Object.keys(d).filter(p=>p in ka);u.length>0?u.forEach(p=>{let b=(bc[a]??[a]).map(m=>{let v=vc(m,d[p]);return v===null?"":`${hc(m)}:${v};`}).join("");b&&(p==="xs"?n.push(`${t}{${b}}`):n.push(`@media (min-width:${ka[p]}px){${t}{${b}}}`));}):n.push(On(`${t} ${a}`,d));return}(bc[a]??[a]).forEach(d=>{let u=vc(d,s);u!==null&&o.push(`${hc(d)}:${u};`);});}),`${o.length?`${t}{${o.join("")}}`:""}${n.join("")}`},Ue=(t,r,o)=>{let n=Xg(t);if(Object.keys(n).length===0)return {className:r,style:o};let a=`orb-sx-${Yg(Ls(n))}`;return Zg(On(`.${a}`,n)),{className:[a,r].filter(Boolean).join(" "),style:o}};});var Cc,e,c,P=As(()=>{"use strict";_t();Cc=(t,r)=>{if(!r||typeof t!="string")return [t,r];let o={...r},n=o.component??t;delete o.component;let a=o.sx;delete o.sx;let i=Ue(a,o.className,o.style);return o.className=[i.className,o.hover?"orb-hoverable":void 0,o.selected?"orb-selected":void 0,o.noWrap?"orb-nowrap":void 0,o.padding==="checkbox"?"orb-cell-checkbox":void 0].filter(Boolean).join(" ")||void 0,o.style=i.style,["hover","selected","noWrap","stickyHeader","padding","flexItem","item","container","xs","sm","md","lg","xl","sortDirection","scrollButtons","disableSticky","columns","primaryTypographyProps","secondaryTypographyProps","position"].forEach(s=>delete o[s]),[n,o]},e=(t,r,o)=>{let[n,a]=Cc(t,r);return jsxRuntime.jsx(n,a,o)},c=(t,r,o)=>{let[n,a]=Cc(t,r);return jsxRuntime.jsxs(n,a,o)};});var um={};$g(um,{COrbCanvas:()=>Ty});function Ty({hue:t=0,hoverIntensity:r=.2,rotateOnHover:o=true,forceHoverState:n=false,backgroundColor:a="transparent"}){let i=er.useRef(null),s=`
1
+ 'use strict';var jsxRuntime=require('react/jsx-runtime'),ogl=require('ogl'),eo=require('react'),Eo=require('@radix-ui/react-dropdown-menu'),jo=require('@radix-ui/react-tooltip'),reactDom=require('react-dom'),ko=require('@radix-ui/react-dialog'),yr=require('@radix-ui/react-popover'),ar=require('dayjs'),ph=require('dayjs/plugin/customParseFormat'),navigation=require('next/navigation'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),sortable=require('@dnd-kit/sortable'),Pb=require('dayjs/plugin/isBetween'),Tb=require('dayjs/plugin/localizedFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var zy=require('next/dynamic'),framerMotion=require('framer-motion'),ZC=require('react-markdown'),jC=require('remark-gfm'),QC=require('remark-math'),JC=require('rehype-katex'),ex=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),Lm=require('mermaid'),S0=require('dayjs/plugin/isoWeek');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var eo__namespace=/*#__PURE__*/_interopNamespace(eo);var Eo__namespace=/*#__PURE__*/_interopNamespace(Eo);var jo__namespace=/*#__PURE__*/_interopNamespace(jo);var ko__namespace=/*#__PURE__*/_interopNamespace(ko);var yr__namespace=/*#__PURE__*/_interopNamespace(yr);var ar__default=/*#__PURE__*/_interopDefault(ar);var ph__default=/*#__PURE__*/_interopDefault(ph);var Pb__default=/*#__PURE__*/_interopDefault(Pb);var Tb__default=/*#__PURE__*/_interopDefault(Tb);var zy__default=/*#__PURE__*/_interopDefault(zy);var ZC__default=/*#__PURE__*/_interopDefault(ZC);var jC__default=/*#__PURE__*/_interopDefault(jC);var QC__default=/*#__PURE__*/_interopDefault(QC);var JC__default=/*#__PURE__*/_interopDefault(JC);var ex__default=/*#__PURE__*/_interopDefault(ex);var Lm__default=/*#__PURE__*/_interopDefault(Lm);var S0__default=/*#__PURE__*/_interopDefault(S0);var kc=Object.defineProperty;var Qg=(t,o,r)=>o in t?kc(t,o,{enumerable:true,configurable:true,writable:true,value:r}):t[o]=r;var zs=(t,o,r)=>()=>{if(r)throw r[0];try{return t&&(o=t(t=0)),o}catch(n){throw r=[n],n}};var Jg=(t,o)=>{for(var r in o)kc(t,r,{get:o[r],enumerable:true});};var Pc=(t,o,r)=>Qg(t,o+"",r);var Ra,of,vt,Ma,Tc,rf,nf,Ic,Rc,af,Ws,sf,Mc,lf,Fn,Ue,_t=zs(()=>{"use strict";Ra={xs:0,sm:600,md:900,lg:1200,xl:1536},of=t=>({palette:{mode:t,primary:{main:"var(--orb-primary)",light:"var(--orb-p300)",dark:"var(--orb-p700)",contrastText:"var(--orb-on-primary)"},secondary:{main:t==="dark"?"var(--orb-p300)":"var(--orb-fg)",contrastText:t==="dark"?"var(--orb-canvas)":"var(--orb-on-primary)"},error:{main:"var(--orb-err)",contrastText:"var(--orb-on-primary)"},warning:{main:"var(--orb-accent)",contrastText:"var(--orb-on-primary)"},info:{main:t==="dark"?"var(--orb-p300)":"var(--orb-primary)",contrastText:"var(--orb-on-primary)"},success:{main:t==="dark"?"var(--orb-p300)":"var(--orb-primary)",contrastText:"var(--orb-on-primary)"},text:{primary:"var(--orb-fg)",secondary:"var(--orb-muted)",disabled:"var(--orb-disabled-fg)"},background:{default:"var(--orb-canvas)",paper:"var(--orb-surface)"},action:{hover:"var(--orb-hover)",selected:"var(--orb-selected)",focus:"var(--orb-focus-ring)",disabled:"var(--orb-disabled-fg)",disabledBackground:"var(--orb-disabled-bg)",active:t==="dark"?"var(--orb-p300)":"var(--orb-primary)"},divider:"var(--orb-border)",common:{white:"#ffffff",black:"#01091a"},grey:{50:"var(--orb-surface)",100:"var(--orb-surface)",200:"var(--orb-border)",300:"var(--orb-border)",400:"var(--orb-muted)",500:"var(--orb-muted)",600:"var(--orb-fg)",700:"var(--orb-fg)",800:"var(--orb-surface-3)",900:"var(--orb-canvas)"}},shape:{borderRadius:10},breakpoints:{up:o=>`@media (min-width:${Ra[o]}px)`,down:o=>`@media (max-width:${Math.max(0,Ra[o]-.05)}px)`},spacing:(...o)=>o.map(r=>`${r*8}px`).join(" "),transitions:{create:(o="all",r={})=>(Array.isArray(o)?o:[o]).map(a=>`${a} ${r.duration??200}ms ${r.easing??"ease"}`).join(", "),duration:{shortest:150,shorter:180,short:200,standard:300}},zIndex:{modal:1300,drawer:1200,appBar:1100,tooltip:1500}}),vt=()=>typeof document>"u"?"light":document.documentElement.dataset.orbMode==="dark"||document.documentElement.classList.contains("orb-dark")?"dark":"light",Ma=()=>of(vt()),Tc={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"],bgcolor:["backgroundColor"]},rf=new Set(["animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","gridRow","gridRowEnd","gridRowSpan","gridRowStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom"]),nf=(t,o)=>{if(typeof o!="string")return o;let r={"background.default":"var(--orb-canvas)","background.paper":"var(--orb-surface)","text.primary":"var(--orb-fg)","text.secondary":"var(--orb-muted)","text.disabled":"var(--orb-disabled-fg)","primary.main":"var(--orb-primary)","primary.light":"var(--orb-p300)","primary.dark":"var(--orb-p700)","secondary.main":"var(--orb-muted)",divider:"var(--orb-border)","error.main":"var(--orb-err)","warning.main":"var(--orb-accent)","success.main":"var(--orb-primary)","info.main":"var(--orb-primary)","action.hover":"var(--orb-hover)","action.selected":"var(--orb-selected)","action.disabled":"var(--orb-disabled-fg)"};return r[o]?r[o]:o},Ic=t=>t.startsWith("--")?t:t.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`),Rc=(t,o)=>{if(o==null||o===!1)return null;let r=nf(t,o);return typeof r=="number"&&r!==0&&!rf.has(t)?["margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","gap","rowGap","columnGap"].includes(t)?`${r*8}px`:`${r}px`:String(r)},af=t=>t?(Array.isArray(t)?t:[t]).reduce((r,n)=>{if(!n)return r;let a=typeof n=="function"?n(Ma()):n;return {...r,...a}},{}):{},Ws=t=>!t||typeof t!="object"?JSON.stringify(t):Array.isArray(t)?`[${t.map(Ws).join(",")}]`:`{${Object.keys(t).sort().map(o=>`${JSON.stringify(o)}:${Ws(t[o])}`).join(",")}}`,sf=t=>{let o=2166136261;for(let r=0;r<t.length;r+=1)o^=t.charCodeAt(r),o=Math.imul(o,16777619);return (o>>>0).toString(36)},Mc=new Set,lf=t=>{if(typeof document>"u"||Mc.has(t))return;Mc.add(t);let o=document.querySelector("style[data-orb-sx]");o||(o=document.createElement("style"),o.dataset.orbSx="true",document.head.appendChild(o)),o.appendChild(document.createTextNode(t));},Fn=(t,o)=>{let r=[],n=[];return Object.entries(o).forEach(([a,i])=>{let s=typeof i=="function"?i(Ma()):i;if(s==null||s===!1)return;if(a.startsWith("@media")&&typeof s=="object"){n.push(`${a}{${Fn(t,s)}}`);return}if(a.startsWith("&")&&typeof s=="object"){n.push(Fn(a.split("&").join(t),s));return}if((a.startsWith(":")||a.startsWith(">")||a.startsWith("["))&&typeof s=="object"){n.push(Fn(`${t}${a}`,s));return}if(typeof s=="object"){let d=s,p=Object.keys(d).filter(m=>m in Ra);p.length>0?p.forEach(m=>{let h=(Tc[a]??[a]).map(u=>{let v=Rc(u,d[m]);return v===null?"":`${Ic(u)}:${v};`}).join("");h&&(m==="xs"?n.push(`${t}{${h}}`):n.push(`@media (min-width:${Ra[m]}px){${t}{${h}}}`));}):n.push(Fn(`${t} ${a}`,d));return}(Tc[a]??[a]).forEach(d=>{let p=Rc(d,s);p!==null&&r.push(`${Ic(d)}:${p};`);});}),`${r.length?`${t}{${r.join("")}}`:""}${n.join("")}`},Ue=(t,o,r)=>{let n=af(t);if(Object.keys(n).length===0)return {className:o,style:r};let a=`orb-sx-${sf(Ws(n))}`;return lf(Fn(`.${a}`,n)),{className:[a,o].filter(Boolean).join(" "),style:r}};});var Dc,e,c,P=zs(()=>{"use strict";_t();Dc=(t,o)=>{if(!o||typeof t!="string")return [t,o];let r={...o},n=r.component??t;delete r.component;let a=r.sx;delete r.sx;let i=Ue(a,r.className,r.style);return r.className=[i.className,r.hover?"orb-hoverable":void 0,r.selected?"orb-selected":void 0,r.noWrap?"orb-nowrap":void 0,r.padding==="checkbox"?"orb-cell-checkbox":void 0].filter(Boolean).join(" ")||void 0,r.style=i.style,["hover","selected","noWrap","stickyHeader","padding","flexItem","item","container","xs","sm","md","lg","xl","sortDirection","scrollButtons","disableSticky","columns","primaryTypographyProps","secondaryTypographyProps","position"].forEach(s=>delete r[s]),[n,r]},e=(t,o,r)=>{let[n,a]=Dc(t,o);return jsxRuntime.jsx(n,a,r)},c=(t,o,r)=>{let[n,a]=Dc(t,o);return jsxRuntime.jsxs(n,a,r)};});var wm={};Jg(wm,{COrbCanvas:()=>By});function By({hue:t=0,hoverIntensity:o=.2,rotateOnHover:r=true,forceHoverState:n=false,backgroundColor:a="transparent"}){let i=eo.useRef(null),s=`
2
2
  precision highp float;
3
3
  attribute vec2 position;
4
4
  attribute vec2 uv;
@@ -180,26 +180,26 @@
180
180
  vec4 col = mainImage(fragCoord);
181
181
  gl_FragColor = vec4(col.rgb * col.a, col.a);
182
182
  }
183
- `;return er.useEffect(()=>{let d=i.current;if(!d)return;let u=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),p=u.gl;p.clearColor(0,0,0,0),d.appendChild(p.canvas);let f=new ogl.Triangle(p),b=new ogl.Program(p,{vertex:s,fragment:l,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(p.canvas.width,p.canvas.height,p.canvas.width/p.canvas.height)},hue:{value:t},hover:{value:0},rot:{value:0},hoverIntensity:{value:r},backgroundColor:{value:pm(a)}}}),m=new ogl.Mesh(p,{geometry:f,program:b});function v(){if(!d)return;let I=window.devicePixelRatio||1,S=d.clientWidth,A=d.clientHeight;u.setSize(S*I,A*I),p.canvas.style.width=S+"px",p.canvas.style.height=A+"px",b.uniforms.iResolution.value.set(p.canvas.width,p.canvas.height,p.canvas.width/p.canvas.height);}window.addEventListener("resize",v),v();let y=0,g=0,x=0,h=.3,C=I=>{let S=d.getBoundingClientRect(),A=I.clientX-S.left,D=I.clientY-S.top,M=S.width,N=S.height,E=Math.min(M,N),O=M/2,F=N/2,X=(A-O)/E*2,H=(D-F)/E*2;Math.sqrt(X*X+H*H)<.8?y=1:y=0;},k=()=>{y=0;};d.addEventListener("mousemove",C),d.addEventListener("mouseleave",k);let w,T=I=>{w=requestAnimationFrame(T);let S=(I-g)*.001;g=I,b.uniforms.iTime.value=I*.001,b.uniforms.hue.value=t,b.uniforms.hoverIntensity.value=r,b.uniforms.backgroundColor.value=pm(a);let A=n?1:y;b.uniforms.hover.value+=(A-b.uniforms.hover.value)*.1,o&&A>.5&&(x+=S*h),b.uniforms.rot.value=x,u.render({scene:m});};return w=requestAnimationFrame(T),()=>{cancelAnimationFrame(w),window.removeEventListener("resize",v),d.removeEventListener("mousemove",C),d.removeEventListener("mouseleave",k),p.canvas.parentNode===d&&d.removeChild(p.canvas),p.getExtension("WEBGL_lose_context")?.loseContext();}},[t,r,o,n,a]),e("div",{ref:i,className:"w-full h-full"})}function Iy(t,r,o){let n,a,i;if(r===0)n=a=i=o;else {let s=(u,p,f)=>(f<0&&(f+=1),f>1&&(f-=1),f<.16666666666666666?u+(p-u)*6*f:f<.5?p:f<.6666666666666666?u+(p-u)*(.6666666666666666-f)*6:u),l=o<.5?o*(1+r):o+r-o*r,d=2*o-l;n=s(d,l,t+1/3),a=s(d,l,t),i=s(d,l,t-1/3);}return new ogl.Vec3(n,a,i)}function pm(t){if(t==="transparent")return new ogl.Vec3(0,0,0);if(t.startsWith("#")){let n=parseInt(t.slice(1,3),16)/255,a=parseInt(t.slice(3,5),16)/255,i=parseInt(t.slice(5,7),16)/255;return new ogl.Vec3(n,a,i)}let r=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(r)return new ogl.Vec3(parseInt(r[1])/255,parseInt(r[2])/255,parseInt(r[3])/255);let o=t.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(o){let n=parseInt(o[1])/360,a=parseInt(o[2])/100,i=parseInt(o[3])/100;return Iy(n,a,i)}return new ogl.Vec3(0,0,0)}var mm=As(()=>{"use strict";"use client";P();});var _g={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"},Gg={canvas:"#01091a",surface:"#0a1526",surface2:"#061324",surface3:"#0e1b2b",fg:"#ffffff",muted:"rgba(255,255,255,0.7)",border:"rgba(255,255,255,0.12)",primary:"#154194",onPrimary:"#ffffff",link:"#91a8d1",p50:"#021432",p100:"#021a3d",p200:"#bac9e3",p300:"#91a8d1",p600:"#375ea5",p700:"#6e8cc1",accent:"#fc4c02",err:"#d53f01",errBg:"#16163b",warnBg:"#19173f",hover:"rgba(255,255,255,0.08)",selected:"rgba(21, 65, 148, 0.45)",focusRing:"rgba(145, 168, 209, 0.45)",focusSolid:"#91a8d1",disabledFg:"rgba(255,255,255,0.38)",disabledBg:"rgba(255,255,255,0.07)",chartGrid:"rgba(255,255,255,0.12)",chartText:"rgba(255,255,255,0.7)",track:"rgba(255,255,255,0.1)",shadow1:"0 1px 2px rgba(0,0,0,.4),0 2px 8px rgba(0,0,0,.35)",shadow2:"0 4px 16px rgba(0,0,0,.5)",shadow3:"0 12px 32px rgba(0,0,0,.55)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#94a3b8",statusPrimary:"#60a5fa",statusSuccess:"#34d399",statusWarning:"#fbbf24",statusError:"#f87171",statusInfo:"#38bdf8",chart1:"#154194",chart2:"#91a8d1",chart3:"rgba(255,255,255,0.7)",chart4:"#a4b8dd",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Es={light:_g,dark:Gg},k0='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',P0=t=>{let r=Es[t];return [r.primary,r.p300,r.muted,r.p700]},T0=10,I0="0.2s ease";P();var wc=er.createContext({mode:"light",setting:"light"}),rf=t=>{if(typeof document>"u")return;let r=document.documentElement;r.classList.toggle("orb-dark",t==="dark"),r.dataset.orbMode=t,r.style.colorScheme=t;},Fn=({mode:t,defaultMode:r="light",children:o})=>{let n=t??r,[a,i]=er.useState("light"),[s,l]=er.useState(false);er.useEffect(()=>{l(true);let p=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>i(p.matches?"dark":"light");return f(),p.addEventListener("change",f),()=>p.removeEventListener("change",f)},[]);let d=n==="system"?s?a:"light":n;er.useEffect(()=>{rf(d);},[d]);let u=er.useMemo(()=>({mode:d,setting:n}),[d,n]);return e(wc.Provider,{value:u,children:o})},Cr=()=>er.useContext(wc).mode,Os=()=>Es[Cr()];var rt=(t,r)=>{let o=Math.min(1,Math.max(0,r)),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),p=parseInt(s.slice(4,6),16);return `rgba(${d}, ${u}, ${p}, ${o})`}let l=`${Math.round(o*100)}%`;return `color-mix(in oklch, ${t} ${l}, transparent)`};var Dr=t=>{let r=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[o,n]=er.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(r).matches);return er.useEffect(()=>{if(typeof window.matchMedia!="function")return;let a=window.matchMedia(r),i=()=>n(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[r]),o};P();var af={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},sf=t=>typeof t=="number"?`${t}px`:t,lf={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},cf=t=>{if(!t)return;let r=t.match(/(?:^|\s)(?:h|w)-(2\.5|3(?:\.5)?|4|5|6|7|8|10|12)(?:\s|$)/);return r?lf[r[1]]:void 0},Tt=er.forwardRef(({name:t,size:r,title:o,className:n,style:a,strokeWidth:i,fill:s,...l},d)=>{let u=l["aria-label"]??o,p=sf(r??cf(n)??"1em"),f={fontFamily:"SAP-icons",fontSize:p,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:p,height:p,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...a};return e("span",{ref:d,role:u?"img":void 0,"aria-hidden":u?void 0:true,title:o,className:n,"data-sap-icon":t,style:f,...l,children:String.fromCodePoint(af[t])})});Tt.displayName="SapIcon";var ne=(t,r)=>{let o=er.forwardRef((n,a)=>e(Tt,{ref:a,name:t,...n}));return o.displayName=r??`SapIcon(${t})`,o};var Pc=ne("activity","Activity"),Ta=ne("error","AlertCircle"),Tc=ne("warning","AlertTriangle"),Y0=ne("down","ArrowDown"),Z0=ne("navigationRight","ArrowRight"),Ic=ne("up","ArrowUp"),Fs=ne("barChart","BarChart"),j0=ne("activate","Bot"),Bs=ne("calendar","Calendar"),Q0=Bs,J0=ne("camera","Camera"),eS=ne("lineChart","ChartNoAxesCombined"),qr=ne("accept","Check"),Ia=ne("accept","CheckCircle"),Fr=ne("slimDown","ChevronDown"),Ma=ne("navigationLeft","ChevronLeft"),Br=ne("navigationRight","ChevronRight"),tS=ne("slimUp","ChevronUp"),rS=ne("expandAll","ChevronsDown"),oS=ne("collapseAll","ChevronsUp"),Ra=ne("error","CircleAlert"),Bn=ne("accept","CircleCheck"),nS=Bn,Mc=ne("stop","CircleStop"),Rc=ne("copy","Clipboard"),aS=ne("checklist","ClipboardCheck"),iS=ne("checklist","ClipboardList"),Dc=ne("time","Clock"),sS=ne("tableColumn","Columns3"),vo=ne("copy","Copy"),lS=ne("duplicate","CopyPlus"),cS=ne("delete","Delete"),dS=ne("download","Download"),Nc=ne("edit","Edit"),Ac=ne("fullScreen","Expand"),pS=ne("show","Eye"),uS=ne("hide","EyeOff"),Da=ne("document","File"),Ec=ne("document","FileText"),mS=ne("filter","Filter"),Hn=ne("tree","FolderTree"),Lc=ne("process","GitBranch"),zn=ne("world","Globe"),Oc=ne("grid","Grid"),gS=ne("move","GripVertical"),fS=ne("wrench","Hammer"),Fc=ne("picture","Image"),Na=ne("information","Info"),bS=ne("translate","Languages"),hS=ne("dimension","Layers"),vS=ne("home","LayoutDashboard"),Aa=ne("lightbulb","Lightbulb"),Bc=ne("lineChart","LineChart"),Hc=ne("synchronize","Loader2"),Ea=ne("locked","Lock"),yS=Ea,zc=ne("log","LogOut"),Hs=ne("email","Mail"),Vc=ne("map","MapPin"),Wc=ne("menu","Menu"),df=ne("message","MessageCircle"),$c=df,La=ne("microphone","Mic"),CS=ne("microphone","MicOff"),_c=ne("darkMode","Moon"),xS=ne("overflow","MoreHorizontal"),SS=ne("accept","PackageCheck"),wS=ne("product","PackageSearch"),Oa=ne("splitOne","PanelLeftOpen"),Fa=ne("splitTwo","PanelRight"),kS=ne("overview","PanelsTopLeft"),Gc=ne("pieChart","PieChart"),Jo=ne("pushpin","Pin"),PS=ne("play","Play"),en=ne("add","Plus"),TS=ne("qrCode","QrCode"),IS=ne("receipt","ReceiptText"),Ba=ne("refresh","RefreshCw"),MS=ne("activate","Rocket"),RS=ne("refresh","RotateCcw"),Uc=ne("refresh","RotateCw"),DS=ne("tableRow","Rows3"),NS=ne("save","Save"),AS=ne("qrCode","ScanLine"),Hr=ne("search","Search"),pf=ne("paperPlane","Send"),Kc=pf,tn=ne("wrench","Settings"),ES=ne("accept","ShieldCheck"),LS=ne("sum","Sigma"),OS=ne("sort","SortAsc"),FS=ne("splitTwo","SquareSplitHorizontal"),BS=ne("favorite","Star"),qc=ne("lightMode","Sun"),HS=ne("table","Table2"),zS=ne("ipad","TabletSmartphone"),Vn=ne("command","Terminal"),Xc=ne("thumbDown","ThumbsDown"),Yc=ne("thumbUp","ThumbsUp"),Zc=ne("delete","Trash2"),VS=ne("tree","TreePine"),jc=ne("trendDown","TrendingDown"),Ha=ne("warning","TriangleAlert"),WS=ne("shipping","Truck"),Qc=ne("upload","UploadCloud"),zs=ne("employee","User"),Jc=ne("sound","Volume2"),$S=ne("factory","Warehouse"),_S=ne("process","Workflow"),jt=ne("decline","X"),za=ne("error","XCircle");_t();P();var mf={contained:"primary",outlined:"secondary",text:"ghost"},gf={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},we=er.forwardRef(({variant:t="primary",size:r="medium",block:o=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:l,sx:d,className:u,children:p,disabled:f,type:b="button",...m},v)=>{let y=mf[t]??t,g=["orb-btn",`orb-btn-${y}`,gf[r],o?"orb-btn-block":void 0,n?"orb-is-loading":void 0,u].filter(Boolean).join(" "),x=Ue(d,g),h=s??(l?"a":"button");return c(h,{ref:v,type:h==="button"?b:void 0,href:l,className:x.className,style:x.style,disabled:h==="button"?f||n:void 0,"aria-disabled":h!=="button"&&(f||n)?true:void 0,...m,children:[n&&e("span",{className:`orb-spin ${y==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,p,!n&&i]})});we.displayName="CButton";_t();P();var ze=er.forwardRef(({label:t,value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:l="text",placeholder:d,disabled:u,readOnly:p,required:f,autoFocus:b,autoComplete:m,name:v,id:y,error:g,helperText:x,dense:h=false,size:C,fullWidth:k=true,select:w=false,multiline:T=false,rows:I,children:S,variant:A,margin:D,onClick:M,startAdornment:N,endAdornment:E,InputProps:O,inputProps:F,InputLabelProps:X,SelectProps:H,sx:Y,className:W},j)=>{let V=er.useId(),z=y??`orb-tf-${V}`,U=N??O?.startAdornment,K=E??O?.endAdornment,se=(typeof g=="string"?g:void 0)??x,Se={id:z,className:`orb-inp ${h||C==="small"?"orb-inp-dense":""}`,style:k?void 0:{width:"auto"},value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:d,disabled:u,required:f,autoFocus:b,autoComplete:m,name:v,onClick:M,"aria-invalid":!!g},$e=w?e("select",{...Se,ref:j,onChange:n,children:S}):T?e("textarea",{...Se,ref:j,onChange:n,rows:I,readOnly:p||O?.readOnly}):e("input",{...Se,ref:j,onChange:n,type:l,readOnly:p||O?.readOnly,...F}),ke=Ue(Y,`orb-fld ${g?"orb-is-error":""} ${W??""}`,{width:k?"100%":void 0});return c("div",{className:ke.className,style:ke.style,children:[t&&e("label",{htmlFor:z,children:t}),U||K?c("div",{className:"orb-inp-adornment-wrap",children:[U&&e("span",{className:"orb-inp-adornment",children:U}),K&&e("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:K}),$e]}):$e,se&&e("span",{className:"orb-fld-msg",children:se})]})});ze.displayName="CTextField";_t();P();var Wn=er.forwardRef(({label:t,value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l,minRows:d=3,multiline:u,error:p,helperText:f,fullWidth:b=true,name:m,id:v,inputProps:y,sx:g,className:x},h)=>{let C=er.useId(),k=v??`orb-ta-${C}`,T=(typeof p=="string"?p:void 0)??f,I=Ue(g,`orb-fld ${p?"orb-is-error":""} ${x??""}`,{width:b?"100%":void 0});return c("div",{className:I.className,style:I.style,children:[t&&e("label",{htmlFor:k,children:t}),e("textarea",{ref:h,id:k,className:"orb-inp",value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l??d,name:m,"aria-invalid":!!p,...y}),T&&e("span",{className:"orb-fld-msg",children:T})]})});Wn.displayName="CTextArea";_t();P();var zt=er.forwardRef(({label:t,options:r,children:o,value:n,defaultValue:a,onChange:i,disabled:s,size:l,dense:d=true,fullWidth:u=true,minWidth:p,placeholder:f,displayEmpty:b,renderValue:m,multiple:v,MenuProps:y,variant:g,disableUnderline:x,onClick:h,onMouseDown:C,error:k,helperText:w,name:T,id:I,"aria-label":S,sx:A,className:D},M)=>{let N=er.useId(),E=I??`orb-sel-${N}`,F=(typeof k=="string"?k:void 0)??w,X=er.useRef(null),H=er.useRef(null),[Y,W]=er.useState(false),[j,V]=er.useState(180),[z,U]=er.useState(a??"");er.useImperativeHandle(M,()=>X.current);let K=er.useMemo(()=>er.Children.toArray(o).flatMap(Me=>{if(!er.isValidElement(Me)||Me.type!=="option")return [];let Pe=Me;return [{value:Array.isArray(Pe.props.value)?Pe.props.value[0]??"":Pe.props.value??"",label:Pe.props.children,disabled:Pe.props.disabled}]}),[o]),fe=r??K,se=n??z,ue=Array.isArray(se)?se[0]??"":se,Se=String(ue??""),$e=fe.find(Me=>String(Me.value)===Se),ke=m?m(se):$e?.label??(Se||(f??"")),le=Ue(A,`orb-fld ${k?"orb-is-error":""} ${D??""}`,{width:u?"100%":void 0,minWidth:typeof p=="number"?`${p}px`:p});if(v)return c("div",{className:le.className,style:le.style,children:[t&&e("label",{htmlFor:E,children:t}),c("select",{ref:M,id:E,className:`orb-inp ${d||l==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:T,multiple:true,onClick:h,onMouseDown:C,"aria-invalid":!!k,"aria-label":S,children:[f!==void 0&&e("option",{value:"",children:f}),r?r.map(Me=>e("option",{value:Me.value,disabled:Me.disabled,children:Me.label},Me.value)):o]}),F&&e("span",{className:"orb-fld-msg",children:F})]});let Ee=Me=>{n===void 0&&U(Me);let Pe=X.current;Pe&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(Pe,Me),i?.({target:Pe,currentTarget:Pe}));};return c("div",{className:le.className,style:le.style,children:[t&&e("label",{htmlFor:E,children:t}),e("select",{ref:X,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:T,value:Se,disabled:s,onChange:()=>{},children:fe.map(Me=>e("option",{value:Me.value,disabled:Me.disabled,children:Me.label},String(Me.value)))}),c(Nr__namespace.Root,{open:Y,onOpenChange:Me=>{Me&&V(H.current?.getBoundingClientRect().width??180),W(Me);},children:[e(Nr__namespace.Trigger,{asChild:true,children:c("button",{ref:H,id:E,type:"button",className:`orb-inp orb-select-trigger ${d||l==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!k,"aria-label":S,"aria-haspopup":"listbox","data-placeholder":!$e&&!Se?"":void 0,onClick:h,onMouseDown:C,children:[e("span",{className:"orb-select-value",children:ke}),e(Tt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),e(Nr__namespace.Portal,{children:e(Nr__namespace.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:j},children:e(Nr__namespace.RadioGroup,{value:Se,onValueChange:Ee,children:fe.map(Me=>c(Nr__namespace.RadioItem,{className:"orb-select-option",value:String(Me.value),disabled:Me.disabled,children:[e("span",{className:"orb-select-check","aria-hidden":"true",children:String(Me.value)===Se?e(Tt,{name:"accept",size:13}):null}),e("span",{children:Me.label})]},String(Me.value)))})})})]}),F&&e("span",{className:"orb-fld-msg",children:F})]})});zt.displayName="CSelect";_t();P();var It=er.forwardRef(({label:t,checked:r,defaultChecked:o,onChange:n,disabled:a,indeterminate:i,name:s,value:l,id:d,size:u,color:p,onClick:f,inputProps:b,sx:m,className:v},y)=>{let g=Ue([{...u==="small"?{fontSize:13}:void 0,...p?{color:p}:void 0},...Array.isArray(m)?m:m?[m]:[]],`orb-chk ${v??""}`),x=e("input",{ref:h=>{h&&(h.indeterminate=!!i),typeof y=="function"?y(h):y&&(y.current=h);},type:"checkbox",id:d,checked:r,defaultChecked:o,onChange:n,readOnly:r!==void 0&&n===void 0,disabled:a,name:s,value:l,onClick:f,...b});return t==null?e("span",{className:g.className,style:g.style,children:x}):c("label",{className:g.className,style:g.style,children:[x,e("span",{children:t})]})});It.displayName="CCheckbox";P();var If=({label:t,options:r,value:o,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:u})=>{let p=er.useId(),f=i??`orb-rdo-${p}`;return c("div",{className:`orb-fld ${u??""}`,style:d,role:"radiogroup",children:[t&&e("span",{className:"orb-fld-label",children:t}),e("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children:r.map(b=>c("label",{className:"orb-rdo",children:[e("input",{type:"radio",name:f,value:b.value,checked:o!==void 0?o===b.value:void 0,defaultChecked:n!==void 0?n===b.value:void 0,onChange:a?m=>a(m,b.value):void 0,disabled:l||b.disabled}),e("span",{children:b.label})]},b.value))})]})};_t();P();var Va=er.forwardRef(({label:t,checked:r,defaultChecked:o,onChange:n,disabled:a,name:i,id:s,size:l,sx:d,className:u},p)=>{let f=Ue([{...l==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d)?d:d?[d]:[]],`orb-sw ${u??""}`),b=e("input",{ref:p,type:"checkbox",role:"switch",id:s,checked:r,defaultChecked:o,onChange:n?m=>n(m,m.target.checked):void 0,disabled:a,name:i});return t==null?e("span",{className:f.className,style:f.style,children:b}):c("label",{className:f.className,style:f.style,children:[b,e("span",{children:t})]})});Va.displayName="CSwitch";_t();P();var Df={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},xt=er.forwardRef(({label:t,children:r,tone:o,color:n="default",variant:a,size:i="medium",clickable:s,avatar:l,icon:d,onDelete:u,onClick:p,sx:f,className:b},m)=>{let v=o??(a==="outlined"&&n==="default"?"outline":Df[n]??"gray"),y=s??!!p,g=Ue([{cursor:y?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(f)?f:f?[f]:[]],`orb-chip orb-chip-${v} ${b??""}`);return c("span",{ref:m,className:g.className,style:g.style,onClick:p,role:y?"button":void 0,tabIndex:y?0:void 0,onKeyDown:y?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),p?.(x));}:void 0,children:[l??d,e("span",{className:"orb-chip-label",children:r??t}),u&&e("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:e(jt,{size:13,strokeWidth:2})})]})});xt.displayName="CChip";_t();P();var Wa=er.forwardRef(({badgeContent:t,color:r="primary",children:o,invisible:n=false,sx:a,className:i},s)=>{let l=Ue(a,i,{display:"inline-flex",position:o?"relative":void 0}),d=!n&&t!==void 0&&t!==null&&e("span",{className:`orb-badge ${r==="error"?"orb-badge-err":r==="muted"?"orb-badge-muted":""}`,style:o?{position:"absolute",top:-6,right:-6,zIndex:1}:void 0,children:t});return o?c("span",{ref:s,className:l.className,style:l.style,children:[o,d]}):e("span",{ref:s,className:l.className,style:l.style,children:d})});Wa.displayName="CBadge";_t();P();var rn=er.forwardRef(({children:t,src:r,alt:o,size:n=28,sx:a,className:i},s)=>{let l=Ue([{width:n,height:n,fontSize:n*.4},...Array.isArray(a)?a:a?[a]:[]],`orb-avatar ${i??""}`);return e("span",{ref:s,className:l.className,style:l.style,children:r?e("img",{src:r,alt:o??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});rn.displayName="CAvatar";_t();P();var on=er.forwardRef(({severity:t="info",title:r,children:o,onClose:n,sx:a,className:i},s)=>{let l=Ue(a,`orb-alert orb-alert-${t} ${i??""}`);return c("div",{ref:s,role:"alert",className:l.className,style:l.style,children:[c("div",{style:{flex:1,minWidth:0},children:[r&&e("b",{children:r}),o&&e("span",{children:o})]}),n&&e("button",{type:"button","aria-label":"Close",onClick:n,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit",font:"500 14px/1 var(--orb-font)",opacity:.7},children:"\u2715"})]})});on.displayName="CAlert";_t();P();var $n=({value:t,variant:r,color:o,sx:n,className:a})=>{let i=r==="indeterminate"||t===void 0,s=Ue(n,`orb-prog ${a??""}`);return c("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:[e("i",{style:i?{width:"40%",animation:"orb-prog-ind 1.2s ease-in-out infinite"}:{width:`${Math.min(100,Math.max(0,t))}%`,background:o}}),i&&e("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},Lf=({width:t,height:r=14,variant:o="rectangular",sx:n,className:a})=>e("div",{className:`orb-skel ${a??""}`,style:{width:t,height:r,borderRadius:o==="circular"?"50%":o==="text"?6:"var(--orb-r)",...n}}),Xr=({size:t=12,onPrimary:r=false,sx:o,className:n})=>e("span",{className:`orb-spin ${r?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...o},role:"status","aria-label":"Loading"});P();var ct=({title:t,children:r,enterDelay:o=300,side:n="top",align:a="center",disabled:i})=>!t||i?e(jsxRuntime.Fragment,{children:r}):e(Yr__namespace.Provider,{delayDuration:o,skipDelayDuration:200,children:c(Yr__namespace.Root,{children:[e(Yr__namespace.Trigger,{asChild:true,children:r}),e(Yr__namespace.Portal,{children:e(Yr__namespace.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});_t();P();var ae=er.forwardRef(({tooltip:t,size:r="small",active:o=false,edge:n,color:a,sx:i,className:s,children:l,type:d="button",...u},p)=>{let f=Ue([{color:o?"var(--orb-primary)":a,...n==="start"?{marginLeft:-8}:n==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${r==="small"?"orb-icon-btn-sm":""} ${s??""}`),b=e("button",{ref:p,type:d,className:f.className,style:f.style,...u,children:l});return t?e(ct,{title:t,children:b}):b});ae.displayName="CIconButton";_t();P();var _n=({value:t,options:r,onValueChange:o,size:n="medium",sx:a,className:i,...s})=>{let l=er.useRef([]),d=r.findIndex(m=>!m.disabled),u=r.findIndex(m=>m.value===t),p=(m,v)=>{let y=r.map((h,C)=>h.disabled?-1:C).filter(h=>h>=0);if(y.length===0)return;let g=y.indexOf(v),x;m.key==="Home"&&(x=y[0]),m.key==="End"&&(x=y[y.length-1]),(m.key==="ArrowRight"||m.key==="ArrowDown")&&(x=y[(g+1+y.length)%y.length]),(m.key==="ArrowLeft"||m.key==="ArrowUp")&&(x=y[(g-1+y.length)%y.length]),x!==void 0&&(m.preventDefault(),l.current[x]?.focus(),o(r[x].value));},f=Ue(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),b={...f.style,"--orb-segmented-count":Math.max(r.length,1),"--orb-segmented-index":Math.max(u,0)};return c("div",{role:"radiogroup",className:f.className,style:b,"data-has-selection":u>=0?"true":"false",...s,children:[e("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),r.map((m,v)=>{let y=m.value===t;return e(ae,{ref:g=>{l.current[v]=g;},className:["orb-segmented-control-item",m.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:m.label,role:"radio","aria-label":m.label,"aria-checked":y,"data-selected":y?"true":void 0,disabled:m.disabled,tabIndex:y||t==null&&v===d?0:-1,onClick:()=>o(m.value),onKeyDown:g=>p(g,v),children:m.icon??e("span",{className:"orb-segmented-control-label",children:m.label})},m.value)})]})};_t();P();var Qt=({triggerLabel:t,items:r=[],trigger:o,align:n="start",anchorEl:a,open:i,onClose:s,children:l,slotProps:d,PaperProps:u,anchorPosition:p,sx:f})=>{let b=er.useRef(null);if(er.useEffect(()=>{if(i!==true)return;let m=y=>{let g=y.composedPath();b.current&&g.includes(b.current)||a&&g.includes(a)||s?.();},v=y=>{y.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",m,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",m,true),document.removeEventListener("keydown",v,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let m=a?.getBoundingClientRect(),v=window.innerWidth,y=m?.left??16,g=m?.right??y,x=d?.paper?.sx??u?.sx,h=Ue([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(f)?f:f?[f]:[]],"orb-pop orb-menu",d?.paper?.style??u?.style),C=er.Children.map(l,k=>{if(!er.isValidElement(k)||k.type!=="option")return k;let w=k.props,{children:T,disabled:I,selected:S}=w,A=Ue(w.sx,`orb-menu-item ${S?"orb-selected":""} ${w.className??""}`,w.style);return e("div",{role:"menuitem","aria-disabled":I||void 0,"aria-selected":S||void 0,tabIndex:I?-1:0,id:w.id,title:w.title,className:A.className,style:A.style,onClick:I?void 0:w.onClick,onKeyDown:D=>{!I&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),w.onClick?.(D));},children:T})});return reactDom.createPortal(e("div",{ref:b,role:"menu",className:h.className,style:{...h.style,position:"fixed",left:n==="end"&&!p?void 0:p?.left??y,right:n==="end"&&!p?Math.max(16,v-g):void 0,top:p?.top??(m?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:C}),document.body)}return c(Nr__namespace.Root,{children:[e(Nr__namespace.Trigger,{asChild:true,children:o??e(we,{variant:"primary",children:t})}),e(Nr__namespace.Portal,{children:e(Nr__namespace.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:r.map((m,v)=>c(Nr__namespace.Item,{className:"orb-menu-item",disabled:m.disabled,onSelect:()=>m.onClick?.(),children:[m.icon,m.label]},v))})})]})};_t();P();var Ae=er.forwardRef(({elevation:t=1,variant:r,component:o,sx:n,style:a,className:i,children:s,...l},d)=>{let u=o??"div",p=Ue(n,`orb-card ${t>0&&r!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return e(u,{ref:d,className:p.className,style:p.style,...l,children:s})});Ae.displayName="CPaper";_t();P();var Dt=er.forwardRef(({orientation:t="horizontal",flexItem:r,sx:o,className:n},a)=>{let i=Ue([{...t==="vertical"?{alignSelf:"stretch",height:"auto"}:{width:"100%"},...r?{alignSelf:"stretch"}:void 0},...Array.isArray(o)?o:o?[o]:[]],`${t==="vertical"?"orb-divider-v":"orb-divider"} ${n??""}`);return e("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});Dt.displayName="CDivider";_t();P();var Uf={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"},Kf={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},L=er.forwardRef(({variant:t="body1",component:r,muted:o=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:l,className:d,children:u,...p},f)=>{let b=r??Kf[t]??"span",v=[t==="inherit"?void 0:Uf[t],d].filter(Boolean).join(" "),y=Ue([{...o?{color:"var(--orb-muted)"}:void 0,...a?{color:a}:void 0,...n?{fontVariantNumeric:"tabular-nums"}:void 0,...s?{fontWeight:s}:void 0,...i?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0},...Array.isArray(l)?l:l?[l]:[]],v);return e(b,{ref:f,className:y.className,style:y.style,...p,children:u})});L.displayName="CTypography";_t();P();var Xf=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},ie=er.forwardRef(({direction:t="column",spacing:r,alignItems:o,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:l,className:d,children:u,...p},f)=>{let b=Ue([{display:"flex",flexDirection:t,gap:Xf(r),alignItems:o,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(l)?l:l?[l]:[]],d);return e("div",{ref:f,className:b.className,style:b.style,...p,children:u})});ie.displayName="CStack";_t();P();var Lt=({open:t,onClose:r,title:o,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:l=false,PaperProps:d,slotProps:u,disableRestoreFocus:p,keepMounted:f,hideCloseButton:b=false,sx:m,className:v})=>{let y=Ue([{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?.sx??u?.paper?.sx)?d?.sx??u?.paper?.sx:d?.sx??u?.paper?.sx?[d?.sx??u?.paper?.sx]:[],...Array.isArray(m)?m:m?[m]:[]],`orb-dialog ${v??""}`);return e(wr__namespace.Root,{open:t,onOpenChange:g=>{g||r?.();},children:c(wr__namespace.Portal,{children:[e(wr__namespace.Overlay,{className:"orb-overlay"}),c(wr__namespace.Content,{className:y.className,style:y.style,children:[(o||!b)&&c("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[o?e(wr__namespace.Title,{className:"orb-dialog-title",children:o}):e(wr__namespace.Title,{className:"orb-visually-hidden",children:"Dialog"}),!b&&e(wr__namespace.Close,{asChild:true,children:e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Close",style:{marginTop:-4,marginRight:-4},children:e(jt,{size:16,strokeWidth:2})})})]}),e("div",{style:{minWidth:0},children:n}),a&&e("div",{className:"orb-dialog-actions",children:a})]})]})})};P();var Ws=({open:t,defaultOpen:r,onOpenChange:o,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:l=6,matchTriggerWidth:d=false,sx:u,className:p})=>c(yo__namespace.Root,{open:t,defaultOpen:r,onOpenChange:o,children:[e(yo__namespace.Trigger,{asChild:true,children:n}),e(yo__namespace.Portal,{children:e(yo__namespace.Content,{className:`orb-pop ${p??""}`,align:i,side:s,sideOffset:l,style:{minWidth:d?"var(--radix-popover-trigger-width)":void 0,...u},onOpenAutoFocus:f=>f.preventDefault(),children:a})})]});P();var jf=({items:t,value:r,defaultValue:o,onChange:n,sx:a,className:i})=>{let s=r!==void 0,[l,d]=er.useState(o??t[0]?.value),u=s?r:l,p=er.useRef([]),f=m=>{s||d(m),n?.(m);},b=m=>{if(m.key!=="ArrowRight"&&m.key!=="ArrowLeft")return;m.preventDefault();let v=t.filter(h=>!h.disabled),y=v.findIndex(h=>h.value===u),g=m.key==="ArrowRight"?1:-1,x=v[(y+g+v.length)%v.length];if(x){f(x.value);let h=t.findIndex(C=>C.value===x.value);p.current[h]?.focus();}};return e("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:b,children:t.map((m,v)=>{let y=m.value===u;return c("button",{ref:g=>{p.current[v]=g;},type:"button",role:"tab","aria-selected":y,disabled:m.disabled,className:`orb-tab ${y?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>f(m.value),children:[m.icon,m.label]},m.value)})})};P();var Jf=["su","mo","tu","we","th","fr","sa"],Gn=(t,r)=>!!(t&&r&&t.isSame(r,"day")),Un=({value:t,rangeStart:r,rangeEnd:o,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:l,maxDate:d,locale:u,renderDay:p})=>{let f=a!==void 0,[b,m]=er.useState(()=>i??t??r??ro__default.default()),v=(f?a:b).startOf("month"),y=w=>{f||m(w),s?.(w);},g=er.useMemo(()=>u?v.locale(u):v,[v,u]),x=er.useMemo(()=>{let T=v.startOf("month").startOf("week"),I=[],S=T;for(let A=0;A<6;A+=1){let D=[];for(let M=0;M<7;M+=1)D.push(S),S=S.add(1,"day");if(I.push(D),S.isAfter(v.endOf("month"))&&A>=3)break}return I},[v]),h=er.useMemo(()=>{let w=u?ro__default.default().locale(u):ro__default.default();return Jf.map((T,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=r!==void 0||o!==void 0;return c("div",{className:"orb-cal",children:[c("div",{className:"orb-cal-head",children:[e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>y(v.subtract(1,"month")),children:e(Ma,{size:16,strokeWidth:2})}),e("span",{className:"orb-cal-title","aria-live":"polite",children:g.format("MMMM YYYY")}),e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>y(v.add(1,"month")),children:e(Br,{size:16,strokeWidth:2})})]}),c("div",{className:"orb-cal-grid",role:"grid",children:[h.map((w,T)=>e("span",{className:"orb-cal-dow",children:w},`${w}-${T}`)),x.flat().map(w=>{let T=!w.isSame(v,"month"),I=C(w),S=k?Gn(w,r)||Gn(w,o):Gn(w,t),A=w.isSame(ro__default.default(),"day"),D=k&&r&&o&&w.isAfter(r.startOf("day"))&&w.isBefore(o.startOf("day")),M=k&&Gn(w,r)&&!!o,N=k&&Gn(w,o)&&!!r,E=["orb-cal-day",T?"orb-is-outside":void 0,A?"orb-is-today":void 0,S?"orb-is-selected":void 0,D?"orb-is-in-range":void 0,M?"orb-is-range-start":void 0,N?"orb-is-range-end":void 0].filter(Boolean).join(" ");return p?e("span",{className:"orb-cal-day-slot",children:p(w,{outsideCurrentMonth:T,selected:S,today:A,disabled:I})},w.format("YYYY-MM-DD")):e("button",{type:"button",role:"gridcell","aria-selected":S,"aria-current":A?"date":void 0,className:E,disabled:I,onClick:()=>n?.(w),children:w.date()},w.format("YYYY-MM-DD"))})]})]})};P();ro__default.default.extend(eb__default.default);var tb=({label:t,value:r,defaultValue:o,onChange:n,minDate:a,maxDate:i,disabled:s,format:l="YYYY-MM-DD",placeholder:d,locale:u,dense:p=false,error:f,helperText:b,sx:m,className:v})=>{let y=r!==void 0,[g,x]=er.useState(o??null),h=y?r:g,[C,k]=er.useState(false),[w,T]=er.useState(null),I=N=>{y||x(N),n?.(N);},S=w??(h?(u?h.locale(u):h).format(l):""),A=()=>{if(w===null)return;let N=w.trim();if(!N)I(null);else {let E=ro__default.default(N,l,true);E.isValid()&&!(a&&E.isBefore(a.startOf("day")))&&!(i&&E.isAfter(i.startOf("day")))&&I(E);}T(null);},M=(typeof f=="string"?f:void 0)??b;return c("div",{className:`orb-fld ${f?"orb-is-error":""} ${v??""}`,style:m,children:[t&&e("label",{children:t}),e(Ws,{open:C,onOpenChange:k,trigger:c("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[e("span",{className:"orb-inp-adornment",children:e(Bs,{size:15,strokeWidth:1.8})}),e("input",{className:`orb-inp ${p?"orb-inp-dense":""}`,value:S,placeholder:d??l,disabled:s,onFocus:()=>k(true),onChange:N=>T(N.target.value),onBlur:A,onKeyDown:N=>{N.key==="Enter"&&(A(),k(false)),N.key==="Escape"&&k(false);}})]}),children:e(Un,{value:h,onChange:N=>{I(N),T(null),k(false);},minDate:a,maxDate:i,locale:u,defaultMonth:h??void 0})}),M&&e("span",{className:"orb-fld-msg",children:M})]})};P();var ob=({onFilesSelected:t,multiple:r=false,accept:o="*",maxSize:n,title:a="Drag and drop files here or click to upload",subtitle:i="Support for bulk upload",sx:s})=>{let[l,d]=er.useState(false),[u,p]=er.useState([]),f=er.useRef(null),b=h=>{h.preventDefault(),d(true);},m=h=>{h.preventDefault(),d(false);},v=h=>{h.preventDefault(),d(false),g(Array.from(h.dataTransfer.files));},y=h=>{h.target.files&&g(Array.from(h.target.files));},g=h=>{let C=n?h.filter(w=>w.size<=n):h;C.length<h.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let k=r?[...u,...C]:C;r&&(k=k.filter((w,T,I)=>T===I.findIndex(S=>S.name===w.name&&S.size===w.size&&S.lastModified===w.lastModified))),p(k),t?.(k),f.current&&(f.current.value="");},x=h=>{let C=u.filter((k,w)=>w!==h);p(C),t?.(C);};return c("div",{style:{width:"100%",...s},children:[c("div",{onClick:()=>f.current?.click(),onDragOver:b,onDragLeave:m,onDrop:v,role:"button",tabIndex:0,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f.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:[e("input",{type:"file",ref:f,style:{display:"none"},multiple:r,accept:o,onChange:y}),c("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[e(Qc,{size:40,strokeWidth:1.5,color:l?"var(--orb-primary)":"var(--orb-muted)"}),e("span",{className:"orb-subtitle",children:a}),e("span",{className:"orb-meta",children:i})]})]}),u.length>0&&e("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:u.map((h,C)=>c("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:[c("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[e(Ec,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),e("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.name}),c("span",{className:"orb-meta",children:["(",(h.size/1024).toFixed(1)," KB)"]})]}),e(ae,{"aria-label":`Remove ${h.name}`,onClick:()=>x(C),children:e(Zc,{size:15,strokeWidth:1.8})})]},`${h.name}-${C}`))})]})};function br(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var _a={primary:"bg-primary text-primary-foreground hover:bg-primary/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"},Kn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},od=()=>"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";P();var lb=classVarianceAuthority.cva(od(),{variants:{variant:{default:`${_a.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${_a.outline} shadow-sm`,secondary:"bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] active:bg-[var(--orb-selected)] shadow-sm",ghost:_a.ghost,link:"text-[var(--orb-status-primary)] underline-offset-4 hover:underline hover:text-[var(--orb-status-primary)] active:text-[var(--orb-p700)]","chat-tool":"bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-text-2)] hover:bg-[var(--orbai-surface-3)] hover:border-[var(--orbai-border-strong)] hover:text-[var(--orbai-text-1)] active:scale-95 transition-all duration-200","chat-send":"bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] text-[var(--orb-on-primary)] border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200","chat-stop":"bg-[var(--orb-status-error)] hover:opacity-90 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-[var(--orb-on-primary)] transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:Kn.none,sm:Kn.sm,md:Kn.md,full:Kn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Gs=er__namespace.forwardRef(({className:t,variant:r,size:o,asChild:n=false,...a},i)=>e(n?reactSlot.Slot:"button",{className:br(lb({variant:r,size:o,className:t})),ref:i,...a}));Gs.displayName="Button";var cb={"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"},db={"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"},pb={"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"},ub={"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"},mb={"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"},gb={"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"},qn={en:cb,zh:db,fr:pb,de:ub,ja:mb,ko:gb};P();var ad=(t,r)=>r?t.replace(/\{(\w+)\}/g,(o,n)=>{let a=r[n];return a==null?"":String(a)}):t,vb={locale:"en",t:(t,r)=>ad(qn.en[t]||t,r)},id=er.createContext(vb),Ga=({locale:t="en",messages:r,children:o})=>{let n=er.useMemo(()=>{let a=qn[t]||qn.en,i=r?.[t]||{},s={...qn.en,...a,...i};return {locale:t,t:(l,d)=>ad(s[l]||l,d)}},[t,r]);return e(id.Provider,{value:n,children:o})},pe=()=>er.useContext(id);P();function Xn({items:t,onItemClick:r,className:o="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:l=false,pinnedIds:d,onTogglePin:u}){let{t:p}=pe(),f=s==="dark",b=navigation.usePathname(),[m,v]=er.useState(false),[y,g]=er.useState(new Set),x=a!==void 0&&i!==void 0,h=x?a:y;er.useEffect(()=>{v(true);},[]);let C=w=>{if(x)i(w);else {let T=new Set(y);T.has(w)?T.delete(w):T.add(w),g(T);}},k=w=>{w.children&&w.children.length>0&&C(w.id),r&&r(w);};return !t||!Array.isArray(t)?e("div",{className:br("tree-menu",o),children:e("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:p("navigation.noItems")})}):e("div",{className:br("tree-menu",o),children:t.map(w=>{let T=h.has(w.id)||w.isExpanded,I=w.children&&w.children.length>0,A=56+Math.max(0,n-1)*8,D=n===0?12:I?A-24:A,M=w.appurl||w.href,N=m&&M?b===M:false,E=d?.has(w.id)??false,O=l&&w.pinnable!==false&&!!M&&!I;return c("div",{className:"tree-menu-item relative",children:[N&&e("div",{className:br("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),c(Gs,{variant:"ghost",className:br("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",I&&T&&!N?f?"bg-[color-mix(in_oklch,var(--orb-inverse-fg)_5%,transparent)] text-[var(--orb-fg)] hover:bg-[color-mix(in_oklch,var(--orb-inverse-fg)_8%,transparent)]":"bg-[color-mix(in_oklch,var(--orb-surface)_70%,transparent)] text-[var(--orb-fg)] hover:bg-[var(--orb-surface)]":"",n>=2?"min-h-9 py-1.5 rounded-md":n>0?"min-h-10 rounded-lg":"rounded-lg",N?f?"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?"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:`${D}px`,paddingRight:O?"34px":"10px"},onClick:()=>k(w),children:[I&&e("div",{className:br("flex-shrink-0 transition-transform duration-200",T&&"rotate-90",N?"text-[var(--orb-nav-active-fg)]":f?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:e(Br,{className:"h-4 w-4"})}),w.icon&&e("div",{className:br("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",N?"text-[var(--orb-nav-active-fg)]":f?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:w.icon}),c("div",{className:"flex-1 text-left overflow-hidden z-10",children:[e("div",{className:br("text-sm truncate transition-colors duration-200",N?"font-semibold":"font-medium"),children:w.title||w.label}),w.description&&e("div",{className:br("text-xs truncate transition-colors duration-200",N?f?"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})]})]}),O&&u&&e("button",{type:"button","aria-label":p(E?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":E,title:p(E?"navigation.pin.remove":"navigation.pin.add"),onClick:F=>{F.preventDefault(),F.stopPropagation(),u(w);},className:br("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",E&&"orb-is-pinned"),children:e(Jo,{className:br("h-3.5 w-3.5",E&&"fill-current")})}),I&&e("div",{className:br("grid transition-[grid-template-rows] duration-300 ease-in-out",T?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:e("div",{className:br("overflow-hidden",T&&"pt-1"),children:e(Xn,{items:w.children,onItemClick:r,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:u})})})]},w.id)})})}P();var Sb="orbcafe:navigation-island:pinned-items",Us="orbcafe-navigation-pinned",wb=t=>t.appurl||t.href,ld=t=>{let r=[];return t.forEach(o=>{let n=!!o.children?.length;o.pinnable!==false&&wb(o)&&!n&&r.push({...o,children:void 0}),o.children?.length&&r.push(...ld(o.children));}),r},cd=({collapsed:t,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:u=true,pinStorageKey:p=Sb,pinnedItemIds:f,defaultPinnedItemIds:b=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=pe(),g=i==="dark",x=s==="floating",h=navigation.useRouter(),[C,k]=er.useState(""),[w,T]=er.useState(new Set),[I,S]=er.useState(b),[A,D]=er.useState(false),M=f!==void 0,N=er.useMemo(()=>f??I,[f,I]),E=er.useMemo(()=>new Set(N),[N]);er.useEffect(()=>{t&&T(new Set);},[t]),er.useEffect(()=>{if(!u||M){D(true);return}try{let z=window.localStorage.getItem(p);if(z){let U=JSON.parse(z);Array.isArray(U)&&S(U.filter(K=>typeof K=="string"));}}catch{}finally{D(true);}},[u,M,p]),er.useEffect(()=>{if(!(!u||M||!A))try{window.localStorage.setItem(p,JSON.stringify(N));}catch{}},[N,u,M,p,A]),er.useEffect(()=>{!u||t||N.length===0||T(z=>{if(z.has(Us))return z;let U=new Set(z);return U.add(Us),U});},[t,N.length,u]);let O=er.useCallback(z=>{let U=Array.from(new Set(z));M||S(U),m?.(U);},[M,m]),F=er.useCallback(z=>{let U=z.id,K=E.has(U)?N.filter(fe=>fe!==U):[...N,U];O(K);},[N,E,O]),X=er.useMemo(()=>{if(!u||N.length===0)return a;let z=new Map(ld(a).map(K=>[K.id,K])),U=N.map(K=>z.get(K)).filter(K=>!!K);return U.length===0?a:[{id:Us,title:v||y("navigation.pinned"),icon:e(Jo,{className:"w-4 h-4"}),children:U,pinnable:false},...a]},[N,u,a,v,y]),H=er.useCallback(z=>{let U=[],K=fe=>{fe.forEach(se=>{U.push(se.id),se.children&&K(se.children);});};return K(z),U},[]),Y=er.useMemo(()=>{if(!C.trim())return X;let z=U=>U.reduce((K,fe)=>{let se=fe.title?.toLowerCase().includes(C.toLowerCase())||fe.description?.toLowerCase().includes(C.toLowerCase()),ue=fe.children?z(fe.children):[];return (se||ue.length>0)&&K.push({...fe,children:ue.length>0?ue:fe.children}),K},[]);return z(X)},[C,X]),W=er.useMemo(()=>C.trim()?new Set(H(X)):w,[C,X,w,H]),j=er.useCallback(async z=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",z),z.id==="chat"||z.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{h.push("/chat?new=true");}catch(K){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",K),h.push("/chat");}return}let U=z.appurl||z.href;U&&(U.startsWith("http://")||U.startsWith("https://")?window.open(U,"_blank"):h.push(U));},[h]),V=er.useCallback(()=>{l?.(s==="fixed"?"floating":"fixed");},[s,l]);return c("div",{className:`flex flex-col backdrop-blur-xl border ${x?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${t?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${g?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?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:x?g?"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?"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:[e("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${t?"px-1":"px-2"}`,children:t?e("div",{className:"flex justify-center",children:e("button",{onClick:r,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${g?"text-[var(--orb-fg)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expand"),children:e(Hr,{className:"h-5 w-5"})})}):c("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[e("input",{type:"text",placeholder:y("navigation.searchPlaceholder"),value:C,onChange:z=>k(z.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?"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)]"}`}),e("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:e(Hr,{className:"h-4 w-4 text-[var(--orb-muted)]"})})]})}),e("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:Y.length===0?e("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?e(Hn,{className:"h-5 w-5"}):y(C?"navigation.noMatch":"navigation.noAccessibleApp")}):c(jsxRuntime.Fragment,{children:[!t&&e("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:e(Xn,{items:Y,onItemClick:j,className:"space-y-1",expandedIds:W,colorMode:i,enablePinning:u,pinnedIds:E,onTogglePin:F,onToggleExpand:z=>{let U=new Set(w);Y.some(fe=>fe.id===z)?U.has(z)?U.delete(z):(Y.forEach(fe=>{fe.id!==z&&U.has(fe.id)&&U.delete(fe.id);}),U.add(z)):U.has(z)?U.delete(z):U.add(z),T(U);}})}),t&&e("div",{className:"space-y-2",children:X.map(z=>e("div",{className:"space-y-1",children:e("button",{onClick:()=>{r();let U=new Set([z.id]);T(U);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g?"text-[var(--orb-muted)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expandView",{title:z.title||""}),children:z.icon||e("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${g?"bg-[var(--orb-nav-active-fg)] text-[#0b0b0b]":"bg-[var(--orb-primary)] text-[var(--orb-on-primary)]"}`,children:z.title?.charAt(0)||"?"})})},z.id))})]})}),!t&&e("button",{onClick:r,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${g?"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:e("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:e("div",{className:g?"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&&e("button",{type:"button",onClick:V,className:`absolute -bottom-4 left-1/2 z-30 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border shadow-md transition-colors focus:outline-none focus:ring-2 focus:ring-[color-mix(in_oklch,var(--orb-primary)_45%,transparent)] ${g?"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?e(Oa,{className:"h-4 w-4"}):e(Fa,{className:"h-4 w-4"})})]})};P();var Pb="orbcafe:navigation-island:pinned-items",Ks="orbcafe-navigation-pinned",dd=t=>t.appurl||t.href,pd=t=>t.flatMap(r=>{let o=!!r.children?.length,n=r.pinnable!==false&&dd(r)&&!o?[{...r,children:void 0}]:[];return r.children?.length?[...n,...pd(r.children)]:n}),ud=t=>t.flatMap(r=>[r.id,...r.children?ud(r.children):[]]),md=(t,r)=>t.reduce((o,n)=>{let a=n.children?md(n.children,r):[];return ([n.title,n.label,n.description].some(s=>s?.toLocaleLowerCase().includes(r))||a.length>0)&&o.push({...n,children:a.length>0?a:n.children}),o},[]),qs=({collapsed:t,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:u=true,pinStorageKey:p=Pb,pinnedItemIds:f,defaultPinnedItemIds:b=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=pe(),g=navigation.useRouter(),x=s==="floating",[h,C]=er.useState(""),[k,w]=er.useState(new Set),[T,I]=er.useState(b),[S,A]=er.useState(false),D=f!==void 0,M=f??T,N=er.useMemo(()=>new Set(M),[M]);er.useEffect(()=>{t&&w(new Set);},[t]),er.useEffect(()=>{if(!u||D){A(true);return}try{let z=window.localStorage.getItem(p);if(z){let U=JSON.parse(z);Array.isArray(U)&&I(U.filter(K=>typeof K=="string"));}}catch{}finally{A(true);}},[u,D,p]),er.useEffect(()=>{if(!(!u||D||!S))try{window.localStorage.setItem(p,JSON.stringify(M));}catch{}},[M,u,D,p,S]),er.useEffect(()=>{!u||t||M.length===0||w(z=>{if(z.has(Ks))return z;let U=new Set(z);return U.add(Ks),U});},[t,M.length,u]);let E=er.useCallback(z=>{let U=Array.from(new Set(z));D||I(U),m?.(U);},[D,m]),O=er.useCallback(z=>{E(N.has(z.id)?M.filter(U=>U!==z.id):[...M,z.id]);},[M,N,E]),F=er.useMemo(()=>{if(!u||M.length===0)return a;let z=new Map(pd(a).map(K=>[K.id,K])),U=M.map(K=>z.get(K)).filter(K=>!!K);return U.length===0?a:[{id:Ks,title:v||y("navigation.pinned"),icon:e(Jo,{className:"h-4 w-4"}),children:U,pinnable:false},...a]},[M,u,a,v,y]),X=h.trim().toLocaleLowerCase(),H=er.useMemo(()=>X?md(F,X):F,[F,X]),Y=er.useMemo(()=>X?new Set(ud(H)):k,[k,H,X]),W=er.useCallback(z=>{w(U=>{let K=new Set(U),fe=H.some(se=>se.id===z);return K.has(z)?K.delete(z):(fe&&H.forEach(se=>K.delete(se.id)),K.add(z)),K});},[H]),j=er.useCallback(z=>{let U=dd(z);U&&(z.id==="chat"||z.appurl==="/chat"?g.push("/chat?new=true"):/^https?:\/\//.test(U)?window.open(U,"_blank","noopener,noreferrer"):g.push(U));},[g]),V=z=>{r(),w(new Set([z.id]));};return c("aside",{"data-navigation-island":"v2","data-collapsed":t||void 0,className:`orb-navigation-island-v2 relative flex flex-col border ${t?"w-14":"w-[234px]"} ${o}`,style:{maxHeight:n?`${n}px`:void 0,transition:"width 320ms cubic-bezier(0.4, 0, 0.2, 1), border-radius 220ms ease, box-shadow 220ms ease"},"aria-label":"Navigation",children:[e("div",{className:`orb-navigation-island-v2-search ${t?"px-1":"px-2"}`,children:t?e("button",{type:"button",onClick:r,className:"mx-auto flex h-10 w-10 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expand"),"aria-label":y("navigation.expand"),children:e(Hr,{className:"h-5 w-5"})}):c("label",{className:"relative block",children:[e("span",{className:"orb-visually-hidden",children:y("navigation.searchPlaceholder")}),e(Hr,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--orb-muted)]"}),e("input",{type:"search",value:h,onChange:z=>C(z.target.value),placeholder:y("navigation.searchPlaceholder"),className:"w-full py-2 pl-10 pr-3 text-sm outline-none"})]})}),e("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:H.length===0?e("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?e(Hn,{className:"h-5 w-5"}):y(X?"navigation.noMatch":"navigation.noAccessibleApp")}):t?e("div",{className:"space-y-1",children:F.map(z=>e("button",{type:"button",onClick:()=>V(z),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:z.title||z.label||""}),children:z.icon||e(Hn,{className:"h-5 w-5"})},z.id))}):e(Xn,{items:H,onItemClick:j,className:"space-y-1",expandedIds:Y,onToggleExpand:W,colorMode:i,enablePinning:u,pinnedIds:N,onTogglePin:O})}),d&&t&&e("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:e("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?e(Oa,{className:"h-4 w-4"}):e(Fa,{className:"h-4 w-4"})})}),!t&&e("button",{type:"button",onClick:r,className:"absolute -bottom-1 -right-1 z-20 flex h-6 w-6 items-center justify-center rounded-full bg-transparent transition-all duration-300 ease-in-out",title:y("navigation.collapse"),"aria-label":y("navigation.collapse"),children:e("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:e("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 fd=(t={})=>{let{initialCollapsed:r=false,initialDisplayMode:o="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:u}=t,[p,f]=er.useState(r),[b,m]=er.useState(o),[v,y]=er.useState(n),g=er.useCallback(()=>{f(C=>!C);},[]),x=er.useCallback(()=>{m(C=>C==="fixed"?"floating":"fixed");},[]),h=er.useMemo(()=>({collapsed:p,onToggle:g,menuData:v,displayMode:b,onDisplayModeChange:m,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:u}),[p,g,v,b,m,a,i,s,l,d,u]);return {collapsed:p,setCollapsed:f,toggleCollapsed:g,displayMode:b,setDisplayMode:m,toggleDisplayMode:x,menuData:v,setMenuData:y,navigationIslandProps:h}};var Ys=class{constructor(){fc(this,"listener",null);}register(r){this.listener=r;}unregister(){this.listener=null;}show(r,o,n){this.listener&&this.listener({type:r,content:o,options:n});}hide(){this.listener&&this.listener(null);}},ao=new Ys,dT={success:(t,r)=>ao.show("success",t,r),error:(t,r)=>ao.show("error",t,r),warning:(t,r)=>ao.show("warning",t,r),info:(t,r)=>ao.show("info",t,r),show:(t,r,o)=>ao.show(t,r,o),hide:()=>ao.hide()};P();var Ib={success:{icon:e(Bn,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:e(Ha,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:e(Ra,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:e(Na,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},jn=({open:t,title:r,message:o,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:l=true,maxWidth:d="xs",type:u="default"})=>{let{t:p}=pe(),f=i||p("messageBox.confirm"),b=s||p("messageBox.cancel"),m=()=>{a?a():n();},v=Ib[u],y=u!=="default";return c(Lt,{open:t,onClose:n,maxWidth:d,sx:y?{borderTop:`6px solid ${v.iconColor}`}:void 0,children:[y&&e("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:v.iconColor},children:v.icon}),r&&e("div",{className:"orb-dialog-title",style:{textAlign:y?"center":"left",paddingTop:y?8:16},children:r}),e("div",{className:"orb-dialog-content",style:{textAlign:y?"center":"left"},children:typeof o=="string"?e("p",{style:{margin:0,color:"var(--orb-muted)"},children:o}):o}),c("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:y?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[l&&e(we,{onClick:n,variant:"text",children:b}),e(we,{onClick:m,variant:"contained",color:y&&u==="error"?"error":"primary",autoFocus:true,children:f})]})]})},vT=()=>{let[t,r]=er__namespace.default.useState(null),[o,n]=er__namespace.default.useState(false);er__namespace.default.useEffect(()=>{let s=l=>{l?(r(l),n(true)):(n(false),r(null));};return ao.register(s),()=>ao.unregister()},[]);let a=()=>{n(false),t?.options?.onClose&&t.options.onClose(),r(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),n(false),r(null);};return t?e(jn,{open:o,type:t.type,message:t.content,title:t.options?.title,onClose:a,onConfirm:i,confirmText:t.options?.confirmText,cancelText:t.options?.cancelText,showCancel:t.options?.showCancel,maxWidth:t.options?.maxWidth}):null};P();var wT=({status:t,showIcon:r=true})=>{let o="gray",n,a=t;return t==="OK"?(o="blue",n=e(Bn,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(o="orange",n=e(Ra,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(o="orange",n=e(Ha,{size:14,strokeWidth:2}),a="Warning"),e(xt,{label:a,tone:o,icon:r&&n?n:void 0})};P();var TT=({dense:t,sx:r,className:o,children:n,...a})=>e("ul",{...a,className:o,style:{listStyle:"none",margin:0,padding:0,...r},children:n}),IT=({button:t,divider:r,sx:o,className:n,children:a,...i})=>e("li",{...i,className:n,style:{display:"flex",alignItems:"center",padding:"8px 16px",minHeight:40,borderBottom:r?"1px solid var(--orb-border)":void 0,cursor:t?"pointer":void 0,transition:"var(--orb-t-fast)",...o},onMouseEnter:t?s=>{s.currentTarget.style.background="var(--orb-hover)";}:void 0,onMouseLeave:t?s=>{s.currentTarget.style.background="";}:void 0,children:a}),MT=({sx:t,className:r,children:o,...n})=>e("button",{...n,type:"button",className:r,style:{width:"100%",display:"flex",alignItems:"center",padding:"8px 16px",border:"none",background:"transparent",textAlign:"left",cursor:"pointer",transition:"var(--orb-t-fast)",...t},children:o}),RT=({children:t,sx:r})=>e("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...r},children:t}),DT=({primary:t,secondary:r,sx:o})=>c("div",{style:{flex:1,minWidth:0,...o},children:[e("div",{className:"orb-body",style:{fontWeight:500},children:t}),r&&e("div",{className:"orb-meta",style:{marginTop:2},children:r})]}),NT=({sx:t,className:r,children:o,...n})=>e("li",{...n,className:r,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:o}),AT=({children:t,sx:r})=>e("div",{style:{marginRight:12,display:"flex",alignItems:"center",...r},children:t});P();var OT=({xs:t,md:r,lg:o,sx:n,children:a,className:i,...s})=>{let l=o?`span ${o}`:r?`span ${r}`:t?`span ${t}`:"span 12";return e("div",{...s,className:i,style:{gridColumn:l,minWidth:0,...n},children:a})};_t();P();var Ar=rt,ir=(t,r)=>er.forwardRef(({component:o,sx:n,className:a,style:i,children:s,...l},d)=>{let u=o??t,p=Ue(n,[r,a].filter(Boolean).join(" "),i);return e(u,{ref:d,className:p.className,style:p.style,...l,children:s})}),Ie=ir("div"),hd=ir("a","orb-link"),Bo=Ae,vd=ie,hr=L;var yd=ae;var Cd=Dt,jr=on,Qa=rn,Ja=Wa;var ei=Va,xd=Xr,Sd=({value:t,variant:r,color:o,sx:n})=>e($n,{value:r==="determinate"?t:void 0,color:o,sx:n}),wd=ir("table","orb-tbl"),kd=ir("tbody"),Qs=ir("td"),Pd=ir("div","orb-table-container"),Td=ir("thead"),Js=ir("tr");ir("tfoot");ir("div","orb-dialog-title");ir("div","orb-dialog-content");ir("div","orb-dialog-actions");ir("p","orb-body-dense");var io=ir("span","orb-input-adornment"),Id=er.forwardRef(({sx:t,fullWidth:r,className:o,style:n,...a},i)=>{let s=Ue(t,["orb-input-base",o].filter(Boolean).join(" "),n);return e("input",{ref:i,className:s.className,style:{width:r?"100%":void 0,...s.style},...a})});var Co=ir("div","orb-form-control"),Qn=({control:t,label:r,...o})=>c("label",{className:"orb-form-control-label",...o,children:[t,e("span",{children:r})]}),Eb=({primary:t,secondary:r,children:o,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>c("span",{className:"orb-list-item-text",...i,children:[t??o,r?e("small",{children:r}):null]}),Lb=ir("span","orb-list-item-icon"),Gt=Eb,zr=Lb;ir("div","orb-list-subheader");var el=({container:t,item:r,spacing:o,xs:n,sm:a,md:i,lg:s,xl:l,sx:d,...u})=>{let p={},f=b=>typeof b=="number"?`${b/12*100}%`:b?"100%":void 0;return n!==void 0&&(p.xs=f(n)),a!==void 0&&(p.sm=f(a)),i!==void 0&&(p.md=f(i)),s!==void 0&&(p.lg=f(s)),l!==void 0&&(p.xl=f(l)),e(Ie,{...u,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&o?o:void 0,width:r?p:void 0,...d??{}}})},nn=({in:t,children:r,unmountOnExit:o,...n})=>!t&&o?null:e("div",{hidden:!t,...n,children:r}),Md=({children:t,container:r})=>typeof document>"u"?null:reactDom.createPortal(t,r??document.body),Rd=ir("div","orb-toolbar"),Dd=({active:t,direction:r="asc",children:o,sx:n,className:a,style:i,...s})=>{let l=Ue(n,["orb-table-sort-label",t?"orb-is-active":"",a].filter(Boolean).join(" "),i);return c("button",{type:"button",className:l.className,style:l.style,"data-direction":r,...s,children:[e("span",{className:"orb-table-sort-content",children:o}),e(Tt,{className:"orb-table-sort-icon",name:r==="desc"?"down":"up",size:11})]})},ti=({open:t,anchorEl:r,onClose:o,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:l,sx:d,className:u,style:p,...f})=>{let b=er.useRef(null);if(er.useEffect(()=>{if(!t)return;let x=C=>{let k=C.composedPath();b.current&&k.includes(b.current)||r&&k.includes(r)||o?.();},h=C=>{C.key==="Escape"&&o?.();};return document.addEventListener("pointerdown",x,true),document.addEventListener("keydown",h,true),()=>{document.removeEventListener("pointerdown",x,true),document.removeEventListener("keydown",h,true);}},[r,o,t]),!t||typeof document>"u")return null;let m=r?.getBoundingClientRect(),v=s?.paper??l,y=[...Array.isArray(v?.sx)?v.sx:v?.sx?[v.sx]:[],...Array.isArray(d)?d:d?[d]:[]],g=Ue(y,["orb-pop",v?.className,u].filter(Boolean).join(" "),{...v?.style,...p});return reactDom.createPortal(e("div",{...f,ref:b,className:g.className,style:{position:"fixed",left:m?.left??16,top:(m?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},Nd=({open:t,onClose:r,anchor:o="left",children:n,PaperProps:a})=>{if(!t||typeof document>"u")return null;let i=o==="right"?{right:0,top:0,bottom:0}:o==="top"?{left:0,right:0,top:0}:o==="bottom"?{left:0,right:0,bottom:0}:{left:0,top:0,bottom:0},s=Ue(a?.sx,"orb-drawer");return reactDom.createPortal(c(jsxRuntime.Fragment,{children:[e("button",{type:"button",className:"orb-overlay","aria-label":"Close drawer",onClick:r}),e("aside",{className:s.className,style:{position:"fixed",zIndex:1201,...i},children:n})]}),document.body)},Ad=({value:t,onChange:r,children:o,variant:n,scrollButtons:a,...i})=>e("div",{role:"tablist",className:"orb-tabs",...i,children:er.Children.map(o,s=>er.isValidElement(s)?er.cloneElement(s,{selected:s.props.value===t,onSelect:l=>r?.(null,l)}):s)}),Ed=({value:t,label:r,children:o,selected:n,onSelect:a,...i})=>e("button",{type:"button",role:"tab","aria-selected":n,className:`orb-tab ${n?"orb-is-active":""}`,onClick:()=>a?.(t),...i,children:r??o});var sr=()=>Pa(),xo=(t,r)=>Dr(t);var Ld=({day:t,onDaySelect:r,selected:o,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...l})=>{let d=Ue(i,`orb-cal-day ${o?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return e("button",{type:"button",className:d.className,style:d.style,onClick:()=>r?.(t),...l,children:t.date()})},Od=({value:t,referenceDate:r,onChange:o,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>e(Un,{value:t,month:r,onChange:u=>o?.(u),onMonthChange:u=>{n?.(u),a?.(u);},minDate:i,maxDate:s,renderDay:l?.day?(u,p)=>l.day?.({day:u,selected:p.selected,outsideCurrentMonth:p.outsideCurrentMonth,onDaySelect:f=>o?.(f)}):void 0,...d}),Fd=({children:t})=>e(jsxRuntime.Fragment,{children:t}),ja=class{};_t();P();var Ob=(t,r)=>r!==void 0?r:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,xe=t=>({fontSize:o,size:n,sx:a,className:i,style:s,titleAccess:l,...d})=>{let u=Ue(a,i,s);return e(Tt,{name:t,size:Ob(o,n),className:u.className,style:u.style,"aria-label":d["aria-label"]??l,...d})},So=xe("tree"),Ho=xe("add"),Bd=xe("duplicate"),tl=xe("down"),Hd=xe("navigationRight"),zd=xe("navigationRight"),rl=xe("up"),Vd=xe("delete"),Wd=xe("camera"),$d=xe("accept"),_d=xe("accept"),ri=xe("navigationRight"),Gd=xe("dimension"),Ud=xe("decline"),wo=xe("decline"),Kd=xe("decline"),qd=xe("decline"),oi=xe("delete"),ni=xe("delete"),Xd=xe("download"),Yd=xe("move"),Zd=xe("edit"),an=xe("slimDown"),jd=xe("filter"),sn=xe("sum"),Qd=xe("lineChart"),Jd=xe("document"),Vr=xe("slimDown"),ep=xe("navigationLeft"),ko=xe("navigationRight"),ai=xe("slimUp"),ii=xe("navigationLeft"),si=xe("navigationRight"),tp=xe("dimension"),rp=xe("splitOne"),li=xe("menu"),op=xe("microphone"),np=xe("microphone"),ap=xe("microphone"),ip=xe("qrCode"),Po=xe("save"),zo=xe("search"),sp=xe("search"),lp=xe("paperPlane"),cp=xe("paperPlane"),dp=xe("wrench"),pp=xe("sort"),ci=xe("splitTwo"),up=xe("favorite"),mp=xe("favorite"),gp=xe("stop"),fp=xe("tableRow"),di=xe("collapseAll"),pi=xe("expandAll"),ln=xe("tableColumn"),bp=xe("overview"),hp=xe("hide");P();var Bb=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],yp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],kr=t=>String(t),Cp=(t,r)=>t[r],xp=t=>{let r=t.value??t.id??t.key??t.code;return typeof r=="number"||typeof r=="string"?r:""},Hb=t=>{let r=t.label??t.description??t.name??t.title;return String(typeof r=="number"||typeof r=="string"?r:xp(t))},zb=t=>{let r=t.description??t.subtitle;return typeof r=="number"||typeof r=="string"?String(r):void 0},Sp=({value:t=null,items:r=[],columns:o,mode:n="single",dialogTitle:a="Value Help",searchPlaceholder:i="Search values...",selectLabel:s="Select",clearLabel:l="Clear",cancelLabel:d="Cancel",valueHelpLabel:u="Open value help",noResultsText:p="No matching values",loading:f=false,clearable:b=true,allowManualInput:m=true,validateManualInput:v=true,manualInputErrorText:y="Enter a valid value.",selectedItems:g=[],displayValue:x,getOptionValue:h=xp,getOptionLabel:C=Hb,getOptionDescription:k=zb,onChange:w,onSearch:T,disabled:I,InputProps:S,onFocus:A,onBlur:D,onKeyDown:M,error:N,helperText:E,...O})=>{let F=Cr(),X=n==="multiple",[H,Y]=er.useState(false),[W,j]=er.useState(false),[V,z]=er.useState(""),[U,K]=er.useState(null),[fe,se]=er.useState(false),[ue,Se]=er.useState(()=>yp(t)),[$e,ke]=er.useState(""),[le,Ee]=er.useState(""),Me=er.useMemo(()=>o&&o.length>0?o:Bb,[o]),Pe=U??r,Ve=er.useMemo(()=>{let te=[...g,...r,...U??[]],he=new Map;return te.forEach(Ne=>{he.set(kr(h(Ne)),Ne);}),he},[h,r,U,g]),tt=er.useMemo(()=>yp(t),[t]),nt=er.useMemo(()=>tt.map(String).join(", "),[tt]);er.useEffect(()=>{H||Se(tt);},[H,tt]),er.useEffect(()=>{!W&&!le&&ke(nt);},[W,nt,le]);let it=er.useMemo(()=>{let te=V.trim().toLowerCase();if(!te||T)return Pe;let he=Me.filter(Ne=>Ne.searchable!==false);return Pe.filter(Ne=>[h(Ne),C(Ne),k(Ne),...he.map(st=>Cp(Ne,st.field))].some(st=>String(st??"").toLowerCase().includes(te)))},[Pe,k,C,h,T,V,Me]),q=er.useMemo(()=>{if(x!==void 0)return x;if(tt.length===0)return "";let te=he=>{let Ne=Ve.get(kr(he));if(!Ne)return String(he);let Je=C(Ne);return Je&&Je!==String(he)?`${he} - ${Je}`:String(he)};return X?tt.length>2?`${tt.length} selected`:tt.map(te).join(", "):te(tt[0])},[x,C,X,Ve,tt]),De=er.useCallback(async()=>{if(T){se(true);try{let te=await T(V);Array.isArray(te)&&K(te);}finally{se(false);}}},[T,V]),ye=()=>{I||(Se(tt),Y(true));},Be=()=>{Y(false);},at=()=>{w?.(X?[]:null,X?[]:null),Se([]),ke(""),Ee("");},Ze=te=>{let he=h(te);if(X){Se(Ne=>Ne.some(st=>kr(st)===kr(he))?Ne.filter(st=>kr(st)!==kr(he)):[...Ne,he]);return}Se([he]);},St=()=>{let te=ue.map(he=>Ve.get(kr(he))).filter(he=>!!he);X?w?.(ue,te):w?.(ue[0]??null,te[0]??null),Ee(""),Y(false);},Mt=te=>{if(te.key==="F4"){te.preventDefault(),ye();return}if(te.key==="Enter"&&m&&!At($e,true)){te.preventDefault();return}M?.(te);},Ot=te=>v?te.every(he=>Ve.has(kr(he))):true,At=(te,he)=>{if(X){let Je=te.split(/[,;\n]/).map(pt=>pt.trim()).filter(Boolean);if(Je.length===0)return Ee(""),w?.([],[]),true;if(!Ot(Je))return he&&Ee(y),false;Ee("");let st=Je.map(pt=>Ve.get(kr(pt))).filter(pt=>!!pt);return w?.(Je,st),true}let Ne=te.trim();return Ne?Ot([Ne])?(Ee(""),w?.(Ne,Ve.get(kr(Ne))??null),true):(he&&Ee(y),false):(Ee(""),w?.(null,null),true)},re=te=>{if(!m)return;let he=te.target.value;ke(he),Ee(""),At(he,false);},Ke=f||fe,Fe=tt.length>0,ve=m&&(W||!!le)?$e:q;return c(jsxRuntime.Fragment,{children:[e(ze,{...O,className:["orb-value-help-field",b&&Fe&&!I?"orb-value-help-has-clear":"",O.className??""].filter(Boolean).join(" "),disabled:I,value:ve,error:!!le||N,helperText:le||E,onChange:re,onFocus:te=>{j(true),ke(nt),A?.(te);},onBlur:te=>{m&&At($e,true),j(false),D?.(te);},onKeyDown:Mt,InputProps:{...S,readOnly:!m,endAdornment:c("span",{className:"orb-value-help-actions",children:[Ke?e(Xr,{size:18}):null,b&&Fe&&!I?e(ae,{className:"orb-value-help-clear-trigger",size:"small",tooltip:l,"aria-label":l,onMouseDown:te=>te.preventDefault(),onClick:te=>{te.stopPropagation(),at();},children:e(Tt,{name:"decline",size:14})}):null,e(ae,{className:"orb-value-help-search-trigger",size:"small",tooltip:u,"aria-label":u,onMouseDown:te=>te.preventDefault(),onClick:te=>{te.stopPropagation(),ye();},disabled:I,children:e(Tt,{name:"search",size:16})})]})}}),c(Lt,{open:H,onClose:Be,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:te=>({borderRadius:2,overflow:"hidden",border:`1px solid ${te.palette.divider}`,boxShadow:F==="dark"?`0 24px 80px ${rt(te.palette.common.black,.72)}`:`0 24px 80px ${rt(te.palette.common.black,.18)}`})},children:[c("div",{className:"orb-dialog-title",sx:te=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${te.palette.divider}`,bgcolor:te.palette.background.paper}),children:[c("div",{children:[e(L,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),X?e(L,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${ue.length} selected`}):null]}),e(ae,{"aria-label":"Close",onClick:Be,size:"small",children:e(wo,{fontSize:"small"})})]}),c("div",{className:"orb-dialog-content",sx:{p:0},children:[c(ie,{direction:{xs:"column",sm:"row"},spacing:1,sx:te=>({px:2.5,py:1.5,borderBottom:`1px solid ${te.palette.divider}`,bgcolor:F==="dark"?rt(te.palette.common.white,.025):rt(te.palette.primary.main,.035)}),children:[e(ze,{size:"small",fullWidth:true,autoFocus:true,value:V,placeholder:i,onChange:te=>z(te.target.value),onKeyDown:te=>{te.key==="Enter"&&(te.preventDefault(),De());},InputProps:{startAdornment:e(io,{position:"start",children:e(Tt,{name:"search",size:16})}),sx:te=>({borderRadius:1,bgcolor:te.palette.background.paper,"& fieldset":{borderColor:rt(te.palette.text.primary,F==="dark"?.2:.16)},"&:hover fieldset":{borderColor:rt(te.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:te.palette.primary.main}})}}),T?e(we,{variant:"outlined",onClick:()=>{De();},disabled:Ke,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:Ke?e(Xr,{size:18}):"Search"}):null]}),e("div",{sx:{maxHeight:420},children:c("table",{className:"orb-tbl",stickyHeader:true,size:"small",children:[e("thead",{children:c("tr",{children:[e("td",{padding:"checkbox",sx:te=>({bgcolor:F==="dark"?"var(--orb-canvas)":te.palette.background.paper,borderBottom:`1px solid ${te.palette.divider}`})}),Me.map(te=>e("td",{align:te.align==="inherit"?void 0:te.align,sx:he=>({minWidth:te.minWidth,width:te.width,fontSize:"0.78rem",fontWeight:800,bgcolor:F==="dark"?"var(--orb-canvas)":he.palette.background.paper,borderBottom:`1px solid ${he.palette.divider}`}),children:te.label},String(te.field)))]})}),c("tbody",{children:[it.map(te=>{let he=h(te),Ne=ue.some(Je=>kr(Je)===kr(he));return c("tr",{hover:true,selected:Ne,onClick:()=>Ze(te),onDoubleClick:()=>{X||(Se([he]),w?.(he,te),Y(false));},sx:Je=>({cursor:"pointer","&.orb-selected":{bgcolor:rt(Je.palette.primary.main,F==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:rt(Je.palette.primary.main,F==="dark"?.28:.18)}}),children:[e("td",{padding:"checkbox",children:e(It,{size:"small",checked:Ne})}),Me.map(Je=>{let st=Cp(te,Je.field);return e("td",{align:Je.align==="inherit"?void 0:Je.align,sx:{fontSize:"0.82rem",py:1},children:Je.render?Je.render(st,te):String(st??"")},String(Je.field))})]},kr(he))}),it.length===0?e("tr",{children:e("td",{colSpan:Me.length+1,children:e("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:p})})}):null]})]})})]}),c("div",{className:"orb-dialog-actions",sx:te=>({px:2.5,py:1.5,borderTop:`1px solid ${te.palette.divider}`,bgcolor:te.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[b&&(Fe||ue.length>0)?e(we,{onClick:at,children:l}):null,e("div",{sx:{flex:1}}),e(we,{onClick:Be,children:d}),e(we,{variant:"contained",onClick:St,disabled:!X&&ue.length===0,children:s})]})]})]})};P();var ui=({title:t,hideHeader:r,children:o})=>c("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!r&&e("div",{sx:{mb:2},children:e(L,{variant:"h4",children:t})}),e("div",{sx:{flex:1,overflow:"hidden"},children:o})]});var ol={width:56,minWidth:56,maxWidth:56,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},nl={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},Jn={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},ea={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},wp={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},pr={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}};P();var Vb={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"}},mi=({rowsPerPage:t=20,rowsPerPageOptions:r=[20,50,100,-1],page:o=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=pe(),l=r.length>0?r:[20,50,100,-1],d=Math.max(0,o),u=t===-1?1:Math.max(1,Math.ceil(n/t)),p=Math.min(d+1,u),f=d>0,b=d<u-1&&t!==-1;return c("div",{className:"orb-table-pager",children:[e(L,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),e(ct,{title:s("table.toolbar.itemsPerPage"),children:e(zt,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:m=>a?.(Number(m.target.value)),sx:Vb,children:l.map(m=>e("option",{value:m,children:m===-1?s("common.all"):m},`rows-per-page-${m}`))})}),e("span",{className:"orb-table-pager-divider"}),e(ae,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(d-1,0)),disabled:!f,sx:pr,children:e(ep,{})}),c(L,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:p,total:u}),children:[p," / ",u]}),e(ae,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,u-1)),disabled:!b,sx:pr,children:e(ko,{})})]})};P();var gi=({value:t="",onChange:r})=>{let{t:o}=pe();return e("div",{className:"orb-table-toolbar-search",children:e(ze,{className:"orb-table-toolbar-search-field",size:"small",placeholder:o("table.toolbar.searchPlaceholder"),value:t,onChange:n=>r?.(n.target.value),InputProps:{startAdornment:e(io,{position:"start",children:e(zo,{size:16})})}})})};P();var fi=t=>{let{t:r}=pe(),o=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],n=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],a=[...o,...n],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return e(Rd,{className:"orb-table-toolbar",role:"toolbar","aria-label":r("table.title.default"),children:c("div",{className:"orb-table-toolbar-primary",children:[e(gi,{value:t.filterText,onChange:l=>{t.setFilterText(l),t.onPageChange?.(0);}}),e(mi,{rowsPerPage:t.rowsPerPage,rowsPerPageOptions:t.rowsPerPageOptions,page:t.page,count:t.count,onRowsPerPageChange:t.onRowsPerPageChange,onPageChange:t.onPageChange}),a.length>0?e("div",{className:"orb-table-toolbar-custom",children:a.map((l,d)=>e(er__namespace.default.Fragment,{children:l},`toolbar-custom-${d}`))}):null,e("span",{className:"orb-table-toolbar-spacer"}),c("div",{className:"orb-table-toolbar-actions",children:[c("div",{className:"orb-table-tool-group",children:[!t.disableGrouping&&e(ct,{title:r("table.toolbar.groupBy"),children:e(ae,{className:"orb-table-tool-button",sx:pr,onClick:l=>t.setGroupAnchorEl(t.groupAnchorEl?null:l.currentTarget),children:e(Ja,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:e(So,{})})})}),e(ct,{title:r("table.toolbar.summary"),children:e(ae,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:pr,onClick:l=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:l.currentTarget),children:e(sn,{})})}),e(ct,{title:r("table.toolbar.columns"),children:e(ae,{className:"orb-table-tool-button",sx:pr,onClick:l=>t.setAnchorEl(t.anchorEl?null:l.currentTarget),children:e(ln,{})})}),e(ct,{title:r("table.toolbar.export"),children:e(ae,{className:"orb-table-tool-button",sx:pr,onClick:t.handleExport,children:e(Xd,{})})})]}),i&&c("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&e(ct,{title:r("table.toolbar.newItem"),children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:pr,children:e(Ho,{})})}),t.showEditButton&&e(ct,{title:r("table.toolbar.editItem"),children:e("span",{children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:pr,children:e(Zd,{})})})}),t.showDeleteButton&&e(ct,{title:r("table.toolbar.deleteItem"),children:e("span",{children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...pr,color:"error.main"},children:e(oi,{})})})})]}),s&&c("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&e(ct,{title:r("table.toolbar.graphicReport"),children:e(ae,{className:"orb-table-tool-button",sx:pr,onClick:t.onOpenGraphReport,children:e(Qd,{})})}),t.onLayoutSave&&!t.layoutManager&&e(ct,{title:r("table.toolbar.saveLayout"),children:e(ae,{className:"orb-table-tool-button",sx:pr,onClick:l=>t.onLayoutSave(l),children:e(Po,{})})}),t.layoutManager]})]})]})})};var bi=Object.freeze({Translate:{toString(t){if(!t)return;let{x:r,y:o}=t;return "translate3d("+(r?Math.round(r):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:r,scaleY:o}=t;return "scaleX("+r+") scaleY("+o+")"}},Transform:{toString(t){if(t)return [bi.Translate.toString(t),bi.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:r,duration:o,easing:n}=t;return r+" "+o+"ms "+n}}});P();var hi=t=>{let{t:r}=pe(),{onSelectAllClick:o,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:l=0,onRequestSort:d,onContextMenu:u,columns:p,visibleColumns:f,selectionMode:b,grouping:m=[],isAllExpanded:v=false,handleToggleAll:y,onColumnResize:g,columnWidths:x,enableColumnReorder:h=false,disableSorting:C=false}=t,[k,w]=er.useState(null),T=er.useRef(null),I=W=>j=>{C||k||d(W);},S=(W,j,V)=>{W.preventDefault(),W.stopPropagation(),w(j),T.current={startX:W.clientX,startWidth:V,colId:j},document.addEventListener("mousemove",A),document.addEventListener("mouseup",D),document.body.style.cursor="col-resize";},A=W=>{if(!T.current)return;let{startX:j,startWidth:V,colId:z}=T.current,U=W.clientX-j,K=Math.max(50,V+U);g&&g(z,K);},D=()=>{w(null),T.current=null,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",D),document.body.style.cursor="";};er.useEffect(()=>()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",D);},[]);let M=b==="multiple"||b==="single",N=m.length>0&&!!y,E=r(v?"table.group.collapseAll":"table.group.expandAll"),O=p.filter(W=>f.includes(W.id)),F=new Map(i.map((W,j)=>[W.field,{...W,priority:j+1}])),X=O.map(W=>{let j=x?.[W.id]||W.minWidth||100,V=F.get(W.id);return e(Xb,{headCell:W,width:typeof j=="number"?j:100,order:n,orderBy:a,multiSortInfo:C?void 0:V,onRequestSort:I(W.id),onContextMenu:u,onResizeMouseDown:z=>S(z,W.id,typeof j=="number"?j:100),enableColumnReorder:h,disableSorting:C},W.id)}),H=O.map(W=>W.id),Y=c("tr",{children:[M&&e("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:e(It,{color:"primary",indeterminate:s>0&&s<l,checked:l>0&&s===l,onChange:o,disabled:b==="single",sx:Jn})}),N&&e("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:e(ct,{title:E,children:e(ae,{size:"small",onClick:W=>{W.stopPropagation(),y?.(!v);},sx:ea,children:v?e(di,{}):e(pi,{})})})}),h?e(sortable.SortableContext,{items:H,strategy:sortable.horizontalListSortingStrategy,children:X}):X]});return e("thead",{children:Y})},Xb=({headCell:t,width:r,order:o,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:l,enableColumnReorder:d,disableSorting:u})=>{let{setNodeRef:p,attributes:f,listeners:b,transform:m,transition:v,isDragging:y}=sortable.useSortable({id:t.id,disabled:!d}),g=d?{transform:bi.Transform.toString(m),transition:v,opacity:y?.6:1}:{},x=u?"asc":a?.direction??(n===t.id?o:"asc"),h=!u&&(!!a||n===t.id);return c("th",{ref:d?p:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${d?"orb-is-reorderable":""} ${y?"orb-is-dragging":""}`,"aria-sort":h?x==="asc"?"ascending":"descending":"none",onContextMenu:s?C=>s(C,t.id):void 0,style:{width:r,minWidth:r,maxWidth:r,...g},...d?f:{},...d?b:{},children:[u?e("span",{className:"orb-table-head-label",children:t.label}):e(Dd,{className:"orb-table-head-sort",active:h,direction:x,onClick:i,children:c("span",{className:"orb-table-head-label",children:[t.label,a&&e("span",{className:"orb-table-sort-priority",children:a.priority})]})}),e("div",{className:"orb-table-resize-handle",onMouseDown:l,onPointerDown:C=>C.stopPropagation(),onClick:C=>C.stopPropagation()})]})};P();var vi=t=>{let{t:r}=pe(),{visibleRows:o,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:l,expandedGroups:d=new Set,selectionMode:u,grouping:p=[],isGroupFullyExpanded:f,handleExpandGroupRecursively:b,handleCollapseGroupRecursively:m,emptyLabel:v,getRowDataKey:y,getRowProps:g,getGroupRowProps:x}=t,h=T=>a.indexOf(T)!==-1,C=u==="multiple"||u==="single",k=p.length>0,w=n.length+(C?1:0)+(k?1:0);return c("tbody",{children:[o.map((T,I)=>{if(T.type==="group"){let S=d.has(T.id),A=T.childIds||[],D=A.filter(W=>h(W)).length,M=A.length>0&&D===A.length,N=D>0&&D<A.length,E={entry:T,data:T,id:T.id,index:I,selected:M,group:true},O=x?.(E)||{},{className:F,onClick:X,...H}=O,Y=W=>{if(W.stopPropagation(),!!t.onSelectionChange)if(M){let j=a.filter(V=>!A.includes(V));t.onSelectionChange(j);}else {let j=Array.from(new Set([...a,...A]));t.onSelectionChange(j);}};return c("tr",{...H,"data-ctable-row-key":y?.(E),className:["orb-table-group-row",F].filter(Boolean).join(" "),onClick:X,sx:W=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:W.palette.text.primary,borderBottomColor:W.palette.divider},"& .orb-icon-btn":{color:W.palette.text.primary},"& .orb-chk":{color:W.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:W.palette.primary.main}}),children:[C&&e("td",{padding:"checkbox",sx:ol,children:e(It,{size:"small",checked:M,indeterminate:N,onChange:Y,onClick:W=>W.stopPropagation(),sx:Jn})}),k&&e("td",{padding:"checkbox",sx:nl,children:c("div",{sx:wp,children:[p.length>1&&T.level<p.length-1&&e(ct,{title:f?.(T.id)?r("table.group.collapseAll"):r("table.group.expandAll"),children:e(ae,{size:"small",onClick:()=>{f?.(T.id)?m?.(T.id):b?.(T.id);},sx:ea,children:f?.(T.id)?e(di,{}):e(pi,{})})}),e(ae,{size:"small",onClick:()=>l&&l(T.id),sx:ea,children:S?e(Vr,{}):e(ko,{})})]})}),e("td",{colSpan:n.length,sx:{py:1,pl:T.level*3+1},children:c(L,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[T.field,": ",T.value," (",T.count,")"]})})]},T.id)}else {let S=T.data||T,A=T.id||S.id||I,D=h(A),M=`enhanced-table-checkbox-${I}`,N={entry:T,data:S,id:A,index:I,selected:D,group:false},E=g?.(N)||{},{className:O,onClick:F,...X}=E,Y=(T.level!==void 0?T.level:0)*4;return c("tr",{...X,"data-ctable-row-key":y?.(N),className:[D?"orb-is-selected":"",O].filter(Boolean).join(" "),onClick:W=>{F?.(W),W.defaultPrevented||i?.(W,S);},role:C?"checkbox":X.role,"aria-checked":C?D:X["aria-checked"],tabIndex:X.tabIndex??-1,children:[C&&e("td",{padding:"checkbox",sx:ol,children:e(It,{color:"primary",checked:D,inputProps:{"aria-labelledby":M},sx:Jn})}),k&&e("td",{padding:"checkbox",sx:nl}),s.filter(W=>n.includes(W.id)).map((W,j)=>{let z=j===0&&Y>0?{pl:Y+2}:{};return e("td",{className:W.numeric?"orb-num":void 0,align:W.numeric?"right":"left",sx:z,children:W.render?W.render(S[W.id],S):(function(){let K=S[W.id];if(W.numeric){if(typeof K=="number")return K.toLocaleString();if(typeof K=="string"&&K.trim()!==""&&!isNaN(Number(K)))return Number(K).toLocaleString()}return K})()},W.id)})]},A)}}),o.length===0&&e("tr",{children:e("td",{colSpan:w,align:"center",children:v??r("common.noData")})})]})};P();var kp=t=>{let{columns:r=[],visibleColumns:o,summaryRow:n,selectionMode:a,grouping:i=[],columnWidths:s={}}=t;if(!t.showSummary)return null;let l=a==="multiple"||a==="single",d=i.length>0,u=r.filter(p=>o.includes(p.id));return e("tfoot",{className:"orb-table-footer",style:{zIndex:t.zIndex},children:c("tr",{children:[l&&e("td",{className:"orb-table-footer-control",style:{width:56,minWidth:56,maxWidth:56}}),d&&e("td",{className:"orb-table-footer-control",style:{width:72,minWidth:72,maxWidth:72}}),u.map(p=>e("td",{className:`orb-table-footer-cell ${p.numeric?"orb-num":""}`,style:{width:s[p.id]||p.minWidth||100,minWidth:s[p.id]||p.minWidth||100,maxWidth:s[p.id]||p.minWidth||100},children:(function(){let b=n[p.id];return b==null||b===""?"":typeof b=="number"?b.toLocaleString():typeof b=="string"&&b.trim()!==""&&!isNaN(Number(b))?Number(b).toLocaleString():b})()},p.id))]})})};P();var Pp=t=>{let{t:r}=pe();return e("div",{sx:{p:2},children:e(L,{children:r("table.mobile.notImplemented")})})};P();var pn=({groupAnchorEl:t,setGroupAnchorEl:r,grouping:o,setGrouping:n,columns:a})=>{let{t:i}=pe(),[s,l]=er.useState(o);er.useEffect(()=>{t&&l(o);},[t,o]);let d=()=>{l(o),r(null);},u=f=>{l(b=>b.includes(f)?b.filter(m=>m!==f):[...b,f]);},p=()=>{n(s),r(null);};return c(Qt,{anchorEl:t,open:!!t,onClose:d,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[c("div",{className:"orb-table-group-menu-header",onClick:f=>f.stopPropagation(),children:[e(L,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&e(we,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:f=>{f.stopPropagation(),l([]);},children:i("table.menu.clearAll")})]}),e(Dt,{className:"orb-table-group-menu-divider"}),a.map(f=>{let b=s.includes(f.id),m=s.indexOf(f.id)+1;return e("option",{className:"orb-table-group-menu-option",selected:b,onClick:v=>{v.stopPropagation(),u(f.id);},children:c("div",{className:"orb-table-group-menu-option-content",children:[e(It,{className:"orb-table-group-menu-checkbox",checked:b,size:"small"}),e(Gt,{className:"orb-table-group-menu-label",primary:f.label}),b&&e("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${m}`,children:m})]})},f.id)}),c("div",{className:"orb-table-group-menu-footer",children:[e(we,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),e(we,{size:"small",variant:"primary",onClick:p,children:i("common.ok")})]})]})},un=({anchorEl:t,setAnchorEl:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=pe();return c(Qt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[e("option",{disabled:true,children:e(Gt,{primary:i("table.menu.visibleColumns")})}),e(Dt,{}),o.map(s=>c("option",{onClick:()=>a(s.id),children:[e(It,{checked:n.includes(s.id),size:"small"}),e(Gt,{primary:s.label})]},s.id))]})},yi=({anchorEl:t,setAnchorEl:r,showSummary:o,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:l}=pe();return c(Qt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[e("option",{children:e(Qn,{control:e(ei,{checked:o,onChange:d=>n(d.target.checked),size:"small"}),label:l("table.menu.showSummaryRow")})}),e(Dt,{}),a.filter(d=>d.numeric).map(d=>c("option",{onClick:()=>s(d.id),disabled:!o,children:[e(It,{checked:i.includes(d.id),size:"small"}),e(Gt,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&e("option",{disabled:true,children:e(Gt,{primary:l("table.menu.noNumericColumns")})})]})},Ci=({contextMenu:t,handleCloseContextMenu:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=pe();return c(Qt,{open:t!==null,onClose:r,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[e("option",{onClick:r,children:i("common.copy")}),e(Dt,{}),e("option",{disabled:true,children:i("table.menu.visibleColumns")}),o.map(s=>c("option",{onClick:()=>a(s.id),children:[e(zr,{children:n.includes(s.id)&&e($d,{fontSize:"small"})}),e(Gt,{children:s.label})]},s.id))]})},Rp=({contextMenu:t,handleClose:r,columns:o,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:l,orderBy:d,order:u,onSortAsc:p,onSortDesc:f,onClearSort:b,onHideColumn:m,onToggleGroup:v,onToggleSummary:y,onOpenSortDialog:g})=>{let{t:x}=pe(),h=t?.columnId??"",C=o.find(M=>M.id===h),k=a.includes(h),w=i.includes(h),T=!!C?.numeric,I=l.find(M=>M.field===h),S=I?I.direction==="asc":d===h&&u==="asc",A=I?I.direction==="desc":d===h&&u==="desc",D=S||A;return c(Qt,{open:t!==null,onClose:r,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[e("option",{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:e(Gt,{primary:C?.label??h})}),e(Dt,{}),c("option",{onClick:()=>{p(h),r();},selected:S,children:[e(zr,{children:e(rl,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.sortAsc")})]}),c("option",{onClick:()=>{f(h),r();},selected:A,children:[e(zr,{children:e(tl,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.sortDesc")})]}),D&&c("option",{onClick:()=>{b(h),r();},children:[e(zr,{children:e(Gd,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.clearSort")})]}),c("option",{onClick:()=>{g(),r();},children:[e(zr,{children:e(Ho,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.configureSort")})]}),e(Dt,{}),c("option",{onClick:()=>{v(h),r();},selected:k,children:[e(zr,{children:e(So,{fontSize:"small"})}),e(Gt,{primary:x(k?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),T&&s&&c("option",{onClick:()=>{y(h),r();},selected:w,children:[e(zr,{children:e(sn,{fontSize:"small"})}),e(Gt,{primary:x(w?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),e(Dt,{}),c("option",{onClick:()=>{m(h),r();},children:[e(zr,{children:e(hp,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.hideColumn")})]})]})},Dp=({open:t,onClose:r,columns:o,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=pe(),[l,d]=er.useState([]);er.useEffect(()=>{t&&d(n.length>0?n.map(y=>({...y})):[]);},[t,n]);let u=er.useMemo(()=>new Set(l.map(y=>y.field)),[l]),p=er.useMemo(()=>o.filter(y=>!u.has(y.id)),[o,u]),f=()=>{let y=p[0];y&&d(g=>[...g,{field:y.id,direction:"asc"}]);},b=y=>{d(g=>g.filter((x,h)=>h!==y));},m=(y,g)=>{d(x=>x.map((h,C)=>C===y?{...h,...g}:h));},v=(y,g)=>{d(x=>{let h=y+g;if(h<0||h>=x.length)return x;let C=[...x],[k]=C.splice(y,1);return C.splice(h,0,k),C});};return e(Lt,{open:t,onClose:r,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:c(jsxRuntime.Fragment,{children:[e(we,{className:"orb-table-sort-clear",variant:"neutral",disabled:l.length===0&&n.length===0,onClick:()=>{i(),r();},children:s("table.sortDialog.clearAll")}),e("span",{className:"orb-table-sort-action-spacer"}),e(we,{variant:"neutral",onClick:r,children:s("common.cancel")}),e(we,{variant:"primary",onClick:()=>{a(l),r();},children:s("common.ok")})]}),children:c("div",{className:"orb-table-sort-dialog-content",children:[l.length===0?e(L,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):e(ie,{className:"orb-table-sort-rules",spacing:1,children:l.map((y,g)=>{let x=new Set(l.filter((C,k)=>k!==g).map(C=>C.field)),h=o.filter(C=>!x.has(C.id));return c("div",{className:"orb-table-sort-rule",children:[e(Ja,{className:"orb-table-sort-order",badgeContent:g+1,color:"primary"}),e(zt,{size:"small",value:y.field,onChange:C=>m(g,{field:C.target.value}),options:h.map(C=>({value:C.id,label:C.label}))}),e(zt,{size:"small",value:y.direction,onChange:C=>m(g,{direction:C.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),e(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g,-1),disabled:g===0,children:e(rl,{fontSize:"small"})}),e(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g,1),disabled:g===l.length-1,children:e(tl,{fontSize:"small"})}),e(ae,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>b(g),children:e(ni,{fontSize:"small"})})]},`sort-rule-${g}`)})}),e(we,{size:"small",onClick:f,disabled:p.length===0,startIcon:e(Ho,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};P();var ta=(t,r=2)=>t.toLocaleString(void 0,{maximumFractionDigits:r}),Np=({kpis:t})=>{let{t:r}=pe(),o=[{label:r("graph.kpi.totalRecords"),value:ta(t.totalRecords,0),color:"var(--orb-fg)"},{label:r("graph.kpi.totalReport"),value:ta(t.totalReportHours),color:"var(--orb-fg)"},{label:r("graph.kpi.totalBillable"),value:ta(t.totalBillableHours),color:"var(--orb-primary)"},{label:r("graph.kpi.efficiency"),value:`${t.efficiency.toFixed(2)}%`,color:"var(--orb-accent)"},{label:r("graph.kpi.amount"),value:ta(t.totalAmount),color:"var(--orb-primary)"},{label:r("graph.kpi.flagged"),value:ta(t.flaggedCount,0),color:"var(--orb-err)"}];return e("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:12},children:o.map(n=>c(Ae,{elevation:0,sx:{padding:12,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[e(L,{variant:"caption",muted:true,children:n.label}),e(L,{variant:"h3",sx:{fontWeight:800,color:n.color,fontVariantNumeric:"tabular-nums"},children:n.value})]},n.label))})};P();var xi=({title:t,subtitle:r,children:o})=>c(Ae,{elevation:0,sx:{padding:16},children:[e(L,{variant:"h4",sx:{fontWeight:700},children:t}),r&&e(L,{variant:"body2",muted:true,sx:{marginBottom:16},children:r}),o]});P();var ra=({data:t,orientation:r="horizontal",valueSuffix:o="",minHeight:n=210,activeName:a,onItemClick:i})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let s=Math.max(...t.map(l=>l.value),1);return r==="vertical"?e("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:n},children:t.map(l=>c("div",{style:{flex:1,minWidth:0},children:[e("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}}),e(L,{variant:"caption",title:l.name,sx:{display:"block",mt:.5},children:l.name}),c(L,{variant:"caption",muted:true,children:[l.value.toFixed(1),o]})]},l.name))}):e(ie,{spacing:1,children:t.map(l=>c("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[e(L,{variant:"caption",muted:true,title:l.name,children:l.name}),e("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:e("div",{style:{width:`${l.value/s*100}%`,height:"100%",background:l.name===a?"primary.dark":"primary.main"}})}),c(L,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[l.value.toFixed(1),o]})]},l.name))})};P();var Ap=({data:t,color:r="var(--orb-chart-1)",valueSuffix:o="",height:n=220})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=t.map(b=>b.value),l=Math.min(...s,0),u=Math.max(...s,1)-l||1,p=t.map((b,m)=>{let v=i+m*(a-i*2)/Math.max(t.length-1,1),y=n-i-(b.value-l)/u*(n-i*2);return {x:v,y,...b}}),f=p.map(b=>`${b.x},${b.y}`).join(" ");return c("div",{children:[c("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[e("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),e("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:f}),p.map(b=>e("circle",{cx:b.x,cy:b.y,r:4,style:{fill:r}},b.name))]}),e("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(b=>c("div",{style:{minWidth:0},children:[e(L,{variant:"caption",title:b.name,sx:{display:"block"},children:b.name}),c(L,{variant:"caption",muted:true,children:[b.value.toFixed(1),o]})]},b.name))})]})};P();var Ep=({data:t,barColor:r="var(--orb-chart-1)",lineColor:o="var(--orb-chart-5)",height:n=220})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=Math.max(...t.map(p=>p.barValue),1),l=Math.max(...t.map(p=>p.lineValue),1),d=t.map((p,f)=>{let b=(a-i*2)/t.length,m=Math.max(b*.5,8),v=i+f*b+(b-m)/2,y=p.barValue/s*(n-i*2),g=n-i-y;return {x:v,y:g,barHeight:y,barWidth:m,item:p}}),u=t.map((p,f)=>{let b=(a-i*2)/t.length,m=i+f*b+b/2,v=n-i-p.lineValue/l*(n-i*2);return {x:m,y:v,item:p}});return c(ie,{spacing:1.25,children:[c("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[e("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),d.map(p=>e("rect",{x:p.x,y:p.y,width:p.barWidth,height:Math.max(p.barHeight,4),rx:6,style:{fill:r}},p.item.name)),e("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:u.map(p=>`${p.x},${p.y}`).join(" ")}),u.map(p=>e("circle",{cx:p.x,cy:p.y,r:3.5,style:{fill:o}},`${p.item.name}-line`))]}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(p=>c("div",{style:{minWidth:0},children:[e(L,{variant:"caption",title:p.name,sx:{display:"block"},children:p.name}),c(L,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",p.barValue.toFixed(1)]}),c(L,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",p.lineValue.toFixed(1)]})]},p.name))})]})};P();var Yb=t=>{let o=.2+Math.max(0,Math.min(1,t))*.8;return `color-mix(in oklch, var(--orb-chart-1) ${Math.round(o*100)}%, transparent)`},Lp=({data:t})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let r=Array.from(new Set(t.map(i=>i.x))),o=Array.from(new Set(t.map(i=>i.y))),n=Math.max(...t.map(i=>i.value),1),a=new Map(t.map(i=>[`${i.y}__${i.x}`,i.value]));return e("div",{style:{overflowX:"auto"},children:c("div",{style:{display:"grid",gridTemplateColumns:`120px repeat(${r.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+r.length*64},children:[e("div",{}),r.map(i=>e(L,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),o.map(i=>c("div",{style:{display:"contents"},children:[e(L,{variant:"caption",sx:{alignSelf:"center"},children:i}),r.map(s=>{let l=a.get(`${i}__${s}`)||0,d=l/n;return e("div",{sx:{height:36,borderRadius:1,background:Yb(d),border:"1px solid color-mix(in oklch, var(--orb-muted) 20%, transparent)",display:"flex",alignItems:"center",justifyContent:"center"},children:e(L,{variant:"caption",sx:{fontWeight:700},children:l.toFixed(1)})},`${i}-${s}`)})]},i))]})})};P();var Zb=["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:r="donut",colors:o=Zb,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let s=0,l=t.map((d,u)=>{let p=s;return s+=d.percent,`${o[u%o.length]} ${p}% ${s}%`});return c(ie,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[e("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${l.join(", ")})`,position:"relative",flexShrink:0},children:r==="donut"&&e("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),e(ie,{spacing:1,sx:{minWidth:180},children:t.map((d,u)=>c("div",{onClick:()=>i?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[e("div",{style:{width:10,height:10,borderRadius:"50%",background:o[u%o.length]}}),e(L,{variant:"caption",sx:{flex:1},children:d.name}),c(L,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};P();var Op=({effect:t,branches:r})=>{if(r.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let o=r.filter((a,i)=>i%2===0),n=r.filter((a,i)=>i%2===1);return c(ie,{spacing:1.5,children:[e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(a=>c("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[e(L,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>e(L,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))}),c("div",{style:{position:"relative",height:32},children:[e("div",{style:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),e("div",{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,background:"primary.main",color:"primary.contrastText"},children:e(L,{variant:"caption",sx:{fontWeight:700},children:t})})]}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(n.length,1)}, minmax(0, 1fr))`,gap:1},children:n.map(a=>c("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[e(L,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>e(L,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))})]})};P();var Fp=({data:t,height:r=240})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let o=0,n=t.map(f=>{let b=f.type==="total"?0:o,m=f.type==="total"?f.value:o+f.value;return f.type!=="total"&&(o=m),{...f,start:b,end:m,delta:m-b}}),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,p=f=>r-d-(f-i)/u*(r-d*2);return c("div",{children:[c("div",{component:"svg",viewBox:`0 0 ${l} ${r}`,style:{width:"100%",height:r},children:[e("line",{x1:d,y1:p(0),x2:l-d,y2:p(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((f,b)=>{let m=(l-d*2)/n.length,v=Math.max(m*.55,8),y=d+b*m+(m-v)/2,g=p(Math.max(f.start,f.end)),x=p(Math.min(f.start,f.end)),h=f.type==="total"?"var(--orb-chart-1)":f.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return c("g",{children:[e("rect",{x:y,y:g,width:v,height:Math.max(x-g,4),rx:6,style:{fill:h}}),e("text",{x:y+v/2,y:g-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:f.end.toFixed(1)})]},f.name)})]}),e("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(f=>e(L,{variant:"caption",title:f.name,children:f.name},f.name))})]})};var oa=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>{let a=encodeURIComponent(r);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${a}&zoom=${o}&maptype=${n}`},dR=(t,r=360)=>{let o=oa(t);return `<iframe width="100%" height="${r}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};P();var Bp=({apiKey:t,query:r,embedUrl:o,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=o||(t&&r?oa({apiKey:t,query:r,zoom:n,mapType:a}):"");return s?c("div",{children:[e("div",{component:"iframe",src:s,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),c(L,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",e("a",{href:s,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):e("div",{children:e(L,{variant:"body2",muted:true,children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var wi=({keyword:t,location:r,src:o="orbcafe-ui"})=>{if(r){let n=encodeURIComponent(r.name||t||"Location");return `https://uri.amap.com/marker?position=${r.lng},${r.lat}&name=${n}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return t?`https://uri.amap.com/search?keyword=${encodeURIComponent(t)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};P();var Hp=({keyword:t,location:r,embedUrl:o,height:n=320})=>{let a=o||wi({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0});return c("div",{children:[e("div",{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),c(L,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",e("a",{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};P();var zp=({billableByPrimary:t,efficiencyBySecondary:r,statusDistribution:o,interaction:n})=>{let{t:a}=pe();return c("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[e(xi,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:e(ra,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),e(xi,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:e(ra,{data:r,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),e(xi,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:e(Si,{data:o,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};P();var Qb=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Jb=["zh","en","de","fr","ja","ko"],Vp=({open:t,onClose:r,value:o,onSaveAll:n,modelOptions:a=Qb,promptLangOptions:i=Jb,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:u})=>{let[p,f]=er.useState(o),[b,m]=er.useState(d||""),[v,y]=er.useState(u||""),[g,x]=er.useState(false);er.useEffect(()=>{t&&(f(o),m(d||""),y(u||""));},[t,o,d,u]);let h=(k,w)=>{f(T=>({...T,[k]:w}));},C=async()=>{if(n)try{x(!0),await n({settings:p,analysisTemplateId:b||void 0,responseTemplateId:v||void 0});}finally{x(false);}};return c(Lt,{open:t,onClose:r,fullWidth:true,maxWidth:"lg",children:[c("div",{className:"orb-dialog-title",sx:{pr:7,pb:2.2},children:[e(L,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),e(L,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),e(ae,{onClick:r,sx:{position:"absolute",right:12,top:12},children:e(wo,{})})]}),e("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:c(ie,{spacing:2.2,children:[c("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[e("div",{children:e(ze,{size:"small",value:p.baseUrl,onChange:k=>h("baseUrl",k.target.value),fullWidth:true,label:"Base URL"})}),e("div",{children:e(ze,{size:"small",type:"password",value:p.apiKey,onChange:k=>h("apiKey",k.target.value),fullWidth:true,label:"API Key"})}),e("div",{children:e(ze,{size:"small",value:p.model,onChange:k=>h("model",k.target.value),fullWidth:true,select:true,label:"Model",children:a.map(k=>e("option",{value:k,children:k},k))})}),e("div",{children:e(ze,{size:"small",value:p.promptLang,onChange:k=>h("promptLang",k.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(k=>e("option",{value:k,children:k},k))})})]}),c("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[c(ze,{size:"small",value:b,onChange:k=>m(k.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[e("option",{value:"",children:"Default"}),s.map(k=>e("option",{value:k.id,children:k.label},k.id))]}),e(Wn,{multiline:true,minRows:8,value:p.analysisPrompt,onChange:k=>h("analysisPrompt",k.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),c(ze,{size:"small",value:v,onChange:k=>y(k.target.value),fullWidth:true,select:true,label:"Response Template",children:[e("option",{value:"",children:"Default"}),l.map(k=>e("option",{value:k.id,children:k.label},k.id))]}),e(Wn,{multiline:true,minRows:8,value:p.responsePrompt,onChange:k=>h("responsePrompt",k.target.value),fullWidth:true,label:"Response Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[e(we,{variant:"outlined",onClick:r,children:"Cancel"}),e(we,{variant:"contained",onClick:C,disabled:!n||g,children:"Save"})]})]})};P();var Pi=({open:t,onClose:r,model:o,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=pe(),[d,u]=er.useState(s?.defaultPrompt||""),[p,f]=er.useState(false),[b,m]=er.useState(false),v=i?.enabled!==false&&!!i,y=s?.enabled!==false,g=i?.filters||{},x=!!(g.primaryDimension||g.secondaryDimension||g.status),h=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";er.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(!0),await s.onSubmit(w,{filters:g,model:o});}finally{f(false);}};return e(Lt,{open:t,onClose:r,fullWidth:true,maxWidth:1400,hideCloseButton:true,children:c("div",{style:{height:"80vh",display:"flex",flexDirection:"column",background:"var(--orb-canvas)"},children:[e("div",{style:{padding:16,borderBottom:"1px solid var(--orb-border)"},children:c(ie,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[c(ie,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[e(L,{variant:"h3",sx:{fontWeight:800},children:o.title}),e(xt,{label:l("graph.records",{count:o.kpis.totalRecords})}),v&&g.primaryDimension&&e(xt,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),v&&g.secondaryDimension&&e(xt,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),v&&g.status&&e(xt,{tone:"outline",label:`${i?.fieldMapping.status}: ${g.status}`,onDelete:()=>i?.onClearFilter("status")}),v&&x&&e(we,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),c(ie,{direction:"row",spacing:10,alignItems:"center",children:[y&&c("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:[e(ae,{size:"small",onClick:s?.onVoiceInput,children:e(La,{size:16,strokeWidth:1.8})}),e("input",{className:"orb-inp orb-inp-dense",value:d,onChange:w=>u(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),k());},placeholder:h,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),e(ae,{size:"small",onClick:k,disabled:p||!d.trim(),children:e(Kc,{size:16,strokeWidth:1.8})}),e(ae,{size:"small",onClick:()=>m(true),children:e(tn,{size:16,strokeWidth:1.8})})]}),e(ae,{onClick:r,children:e(jt,{size:18,strokeWidth:2})})]})]})}),c("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[e(Np,{kpis:o.kpis}),e(zp,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:v?{filters:g,onPrimaryDimensionClick:w=>i?.onPrimaryDimensionClick(w),onSecondaryDimensionClick:w=>i?.onSecondaryDimensionClick(w),onStatusClick:w=>i?.onStatusClick(w)}:void 0}),a,n]}),e(Vp,{open:b,onClose:()=>m(false),value:C,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var Mo={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"]},th=5,Wp=t=>t.toLowerCase().replace(/[\s_-]/g,""),Ro=(t,r,o,n)=>{if(r)return r;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[Wp(s),s]));for(let s of o){let l=i.get(Wp(s));if(l)return l}return a[0]||n},Pr=t=>{if(typeof t=="number")return Number.isFinite(t)?t:0;if(typeof t=="string"){let r=Number(t.replace(/,/g,"").trim());return Number.isFinite(r)?r:0}return 0},gr=(t,r)=>t==null||t===""?r:String(t),rh=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let l=gr(s[r],a);i.set(l,(i.get(l)||0)+Pr(s[o]));}),Array.from(i.entries()).map(([s,l])=>({name:s,value:l})).sort((s,l)=>l.value-s.value).slice(0,n)},oh=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=gr(l[r],i),u=s.get(d)||{report:0,billable:0};u.report+=Pr(l[o]),u.billable+=Pr(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)},nh=(t,r,o)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=gr(i[r],o);a.set(s,(a.get(s)||0)+1);}),Array.from(a.entries()).map(([i,s])=>({name:i,value:s,percent:s/n*100}))},$p=(t,r,o)=>{let n=new Map;return t.forEach(a=>{let i=gr(a[r],"N/A");n.set(i,(n.get(i)||0)+Pr(a[o]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},ah=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=gr(l[r],i),u=s.get(d)||{report:0,billable:0};u.report+=Pr(l[o]),u.billable+=Pr(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)},ih=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let l=gr(s[r],a),d=gr(s[o],a),u=`${l}__${d}`;i.set(u,(i.get(u)||0)+Pr(s[n]));}),Array.from(i.entries()).map(([s,l])=>{let[d,u]=s.split("__");return {x:d,y:u,value:l}})},sh=(t,r,o)=>{let n=$p(t,r,o),a=n.map(s=>({name:s.name,value:s.value,type:"delta"})),i=n.reduce((s,l)=>s+l.value,0);return [...a,{name:"Total",value:i,type:"total"}]},lh=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=gr(l[r],i),u=`${gr(l[o],i)} / ${gr(l[n],i)}`,p=s.get(d)||new Map;p.set(u,(p.get(u)||0)+1),s.set(d,p);}),Array.from(s.entries()).map(([l,d])=>({title:l,causes:Array.from(d.entries()).sort((u,p)=>p[1]-u[1]).slice(0,a).map(([u,p])=>`${u} (${p})`)})).slice(0,6)},mn=({rows:t,config:r})=>{let{t:o}=pe(),n=o("graph.unassigned"),a=er.useMemo(()=>{let p=r?.fieldMapping;return {primaryDimension:Ro(t,p?.primaryDimension,Mo.primaryDimension,"Category"),secondaryDimension:Ro(t,p?.secondaryDimension,Mo.secondaryDimension,"Owner"),status:Ro(t,p?.status,Mo.status,"Status"),date:Ro(t,p?.date,Mo.date,"Date"),description:Ro(t,p?.description,Mo.description,"Description"),reportHours:Ro(t,p?.reportHours,Mo.reportHours,"ReportHours"),billableHours:Ro(t,p?.billableHours,Mo.billableHours,"BillableHours"),amount:Ro(t,p?.amount,Mo.amount,"Amount")}},[t,r?.fieldMapping]),i=er.useMemo(()=>t.map((p,f)=>{let b=Pr(p[a.reportHours]),m=Pr(p[a.billableHours]),v=Pr(p[a.amount]),y=b>0?m/b*100:0;return {id:`graph-row-${f}`,Date:gr(p[a.date],""),Primary:gr(p[a.primaryDimension],n),Secondary:gr(p[a.secondaryDimension],n),Description:gr(p[a.description],""),ReportHours:b,BillableHours:m,Amount:v,Efficiency:y,Status:gr(p[a.status],n)}}),[t,a,n]),s=er.useMemo(()=>{let p=i.length,f=i.reduce((x,h)=>x+Pr(h.ReportHours),0),b=i.reduce((x,h)=>x+Pr(h.BillableHours),0),m=i.reduce((x,h)=>x+Pr(h.Amount),0),v=f>0?b/f*100:0,y=r?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>y.includes(gr(x.Status,"").toLowerCase())).length;return {totalRecords:p,totalReportHours:f,totalBillableHours:b,efficiency:v,totalAmount:m,flaggedCount:g}},[i,r?.statusFlagValues]),l=r?.topN||th,d=er.useMemo(()=>({billableByPrimary:rh(i,"Primary","BillableHours",l,n),efficiencyBySecondary:oh(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:nh(i,"Status",n),lineByDate:$p(i,"Date","BillableHours"),comboByPrimary:ah(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:ih(i,"Primary","Secondary","BillableHours",n),waterfallBillable:sh(i,"Date","BillableHours"),fishboneStatusCauses:lh(i,"Status","Primary","Secondary",3,n)}),[i,l,n]),u=er.useMemo(()=>({title:r?.title||o("graph.reportTitle"),kpis:s,charts:d,table:{columns:[{id:"Date",label:a.date},{id:"Primary",label:a.primaryDimension},{id:"Secondary",label:a.secondaryDimension},{id:"Description",label:a.description},{id:"ReportHours",label:o("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:o("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:a.status}],rows:i}}),[d,r?.title,a,s,i,o]);return {fieldMapping:a,model:u}};var gn=t=>String(t??"").trim(),Ii=(t={})=>{let[r,o]=er.useState(t),n=er.useCallback((d,u)=>{o(p=>{let f=u?.trim();if(!f){let b={...p};return delete b[d],b}if(p[d]===f){let b={...p};return delete b[d],b}return {...p,[d]:f}});},[]),a=er.useCallback(d=>{o(u=>{if(!u[d])return u;let p={...u};return delete p[d],p});},[]),i=er.useCallback(()=>{o({});},[]),s=er.useMemo(()=>!!(r.primaryDimension||r.secondaryDimension||r.status),[r]),l=er.useCallback((d,u)=>d.filter(p=>!(r.primaryDimension&&gn(p[u.primaryDimension])!==gn(r.primaryDimension)||r.secondaryDimension&&gn(p[u.secondaryDimension])!==gn(r.secondaryDimension)||r.status&&gn(p[u.status])!==gn(r.status))),[r]);return {filters:r,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:l}};P();var Ri=({variants:t,currentVariantId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=pe(),[l,d]=er.useState(false),[u,p]=er.useState(""),[f,b]=er.useState(false),[m,v]=er.useState(false),y=t.find(h=>h.id===r),g=()=>{p(y?.name||s("variant.newVariant")),b(y?.isDefault||false),v(y?.isPublic||false),d(true);},x=()=>{n({name:u,isDefault:f,isPublic:m,description:""}),d(false);};return c("div",{className:"orb-variant-management",children:[e(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:r||"",options:[{value:"",label:s("variant.selectVariant"),disabled:true},...t.map(h=>({value:h.id,label:h.name+(h.isDefault?` (${s("variant.defaultSuffix")})`:"")}))],onChange:h=>{let C=t.find(k=>k.id===h.target.value);C&&o(C);}}),e(ct,{title:s("variant.saveView"),children:e(ae,{className:"orb-variant-save-button",onClick:g,size:"small",color:"primary",children:e(Po,{fontSize:"small"})})}),c(Lt,{open:l,onClose:()=>d(false),children:[e("div",{className:"orb-dialog-title",children:s("variant.saveView")}),c("div",{className:"orb-dialog-content",children:[e(ze,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:u,onChange:h=>p(h.target.value)}),e(Qn,{control:e(It,{checked:f,onChange:h=>b(h.target.checked)}),label:s("variant.setDefault")}),e(Qn,{control:e(It,{checked:m,onChange:h=>v(h.target.checked)}),label:s("variant.publicAllUsers")})]}),c("div",{className:"orb-dialog-actions",children:[e(we,{onClick:()=>d(false),children:s("common.cancel")}),e(we,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};P();var Gp=({appId:t,tableKey:r="default",currentFilters:o,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:l,onError:d,onSuccess:u,currentVariantId:p,onVariantChange:f})=>{let{t:b}=pe(),[m,v]=er.useState([]),[y,g]=er.useState(""),x=`orbcafe.variants.${t}.${r}`,h=p!==void 0?p:y,C=N=>{p===void 0&&g(N),f&&f(N);},k=er.useCallback(()=>{try{let N=localStorage.getItem(x);if(!N)return [];let E=JSON.parse(N);return Array.isArray(E)?E:[]}catch{return []}},[x]),w=er.useCallback(N=>{try{localStorage.setItem(x,JSON.stringify(N));}catch{}},[x]),T=er.useCallback(N=>{v(N);let E=N.find(O=>O.isDefault);E&&!h&&(C(E.id),i(E));},[h,i,C]),I=er.useCallback(async()=>{if(!t)return [];try{let N=[];if(s)N=await s.getVariants(t,r);else if(l){let E=await fetch(`${l}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!E.ok)throw new Error(b("variant.toast.fetchFailed"));N=await E.json();}else N=k();return T(N),N}catch(N){console.error("Error fetching variants",N);let E=k();return T(E),d&&d(b("variant.toast.fetchFailed")),E}},[t,r,s,l,k,T,d,b]);return er.useEffect(()=>{I();},[t,r]),e(Ri,{variants:m,currentVariantId:h,onLoad:N=>{C(N.id),i(N);},onSave:async N=>{let E=Date.now().toString(),O;try{let F=N.scope||"Both",X=m.find(j=>j.name===N.name);E=X?X.id:Date.now().toString();let H=[];if(X&&(Array.isArray(X.filters)?H=[...X.filters]:X.filters&&(H=[{scope:"default",filters:X.filters}])),F==="Search"||F==="Both"){let j=(Array.isArray(o),o);if(j)if(Array.isArray(j)&&j.length>0&&j[0].scope)j.forEach(V=>{let z=H.findIndex(U=>U.scope===V.scope);z>=0?H[z]=V:H.push(V);});else {let V={scope:r,filters:j},z=H.findIndex(U=>U.scope===r);z>=0?H[z]=V:H.push(V);}}let Y=X?.layout||{},W=[];if(X&&Array.isArray(X.layoutRefs)&&(W=[...X.layoutRefs]),F==="Layout"||F==="Both")if(a&&a.length>0)a.forEach(j=>{let V=W.findIndex(z=>z.tableKey===j.tableKey);V>=0?W[V]=j:W.push(j);});else {let j={tableKey:r,layoutId:n||null},V=W.findIndex(z=>z.tableKey===r);V>=0?W[V]=j:W.push(j);}if(O={appId:t,tableKey:r,...N,scope:F,id:E,createdAt:new Date().toISOString(),filters:H,layout:Y,layoutRefs:W},s)await s.saveVariant(O,t,r);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})).ok)throw new Error(b("variant.toast.saveFailed"))}else {let V=m.some(z=>z.id===E)?m.map(z=>z.id===E?O:z):[...m,O];v(V),w(V);}u&&u(b("variant.toast.saveSuccess")),(s||l)&&await I(),C(E),i(O);}catch(F){console.error("Error saving variant",F);let H=m.some(Y=>Y.id===E)?m.map(Y=>Y.id===E?O:Y):[...m,O];v(H),w(H),C(E),i(O),d&&d(b("variant.toast.saveFailed"));}},onDelete:async N=>{try{if(s)await s.deleteVariant(N);else if(l){if(!(await fetch(`${l}/api/variants/${N}`,{method:"DELETE"})).ok)throw new Error(b("variant.toast.deleteFailed"))}else {let E=m.filter(O=>O.id!==N);v(E),w(E);}h===N&&C(""),(s||l)&&I(),u&&u(b("variant.toast.deleteSuccess"));}catch(E){console.error("Error deleting variant",E);let O=m.filter(F=>F.id!==N);v(O),w(O),h===N&&C(""),d&&d(b("variant.toast.deleteFailed"));}},onSetDefault:async N=>{try{let E=m.find(F=>F.id===N);if(!E)return;let O={appId:t,tableKey:r,...E,isDefault:!0};if(s)await s.setDefaultVariant(N,t,r);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})).ok)throw new Error(b("variant.toast.defaultFailed"))}else {let F=m.map(X=>({...X,isDefault:X.id===N}));v(F),w(F);}(s||l)&&await I(),u&&u(b("variant.toast.defaultSuccess"));}catch(E){console.error("Error setting default variant",E);let O=m.map(F=>({...F,isDefault:F.id===N}));v(O),w(O),d&&d(b("variant.toast.defaultFailed"));}}})};P();ro__default.default.extend(gh__default.default);ro__default.default.extend(fh__default.default);ro__default.default.extend(eb__default.default);var aa="YYYY-MM-DD",hh=[null,null],Vo="0.85rem",vh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},yh=({isInRange:t,isStart:r,isEnd:o,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=sr();return e(Ld,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:l.palette.primary.light,color:l.palette.primary.contrastText}:{},n&&!t&&!r&&!o?{borderRadius:0,backgroundColor:l.palette.action.hover,border:`1px dashed ${l.palette.primary.main}`}:{},r?{borderRadius:"50% 0 0 50%",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},o?{borderRadius:"0 50% 50% 0",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},r&&o?{borderRadius:"50%"}:{}]})},Kp=({label:t,value:r=hh,onChange:o})=>{let{t:n,locale:a}=pe(),i=vh[a]||"en",s=t||n("dateRange.label"),[l,d]=er.useState(null),[u,p]=er.useState(r),[f,b]=er.useState("start"),[m,v]=er.useState(null),[y,g]=er.useState((r[0]||ro__default.default()).locale(i)),[x,h]=er.useState(""),[C,k]=er.useState(""),[w,T]=er.useState(false),[I,S]=er.useState(false),A=er__namespace.default.useRef(r);er.useEffect(()=>{let[j,V]=r,[z,U]=A.current,K=ue=>ue&&typeof ue.isSame=="function",fe=!(j===null&&z===null||K(j)&&K(z)&&j.isSame(z,"day")),se=!(V===null&&U===null||K(V)&&K(U)&&V.isSame(U,"day"));(fe||se)&&(p(r),r[0]&&K(r[0])&&g(r[0].locale(i))),A.current=r;},[r,i]),er.useEffect(()=>{h(u[0]?u[0].locale(i).format(aa):""),k(u[1]?u[1].locale(i).format(aa):""),T(false),S(false);},[u,i]);let D=(j,V)=>{let z=V.trim(),U=j==="start"?T:S;if(!z){let se=j==="start"?[null,u[1]]:[u[0],null];U(false),p(se);return}let K=ro__default.default(z,aa,true).locale(i);if(!K.isValid()){U(true);return}U(false);let fe=[...u];if(j==="start")fe[0]=K,fe[1]&&K.isAfter(fe[1],"day")&&(fe[1]=null),b(fe[1]?"start":"end");else {let se=fe[0];se&&K.isBefore(se,"day")?(fe=[K,null],b("end")):(fe[1]=K,b("start"));}p(fe),g(K);},M=j=>{d(j.currentTarget);},N=()=>{d(null),b("start"),v(null);},E=!!l,O=j=>{if(!j)return;let V=[...u];if(f==="start")V=[j,null],b("end");else {let z=V[0];z&&j.isBefore(z)?(V=[j,null],b("end")):(V=[z,j],b("start"));}p(V);},F=j=>{let V=ro__default.default().locale(i),z=[null,null];switch(j){case "today":z=[V,V];break;case "week":z=[V.startOf("week"),V.endOf("week")];break;case "month":z=[V.startOf("month"),V.endOf("month")];break}p(z),b("start"),g(V);},X=()=>{o&&o(u),N();},H=()=>{p(r),b("start"),N();},Y=er.useCallback(j=>{let{day:V,...z}=j,[U,K]=u,fe=U?V.isSame(U,"day"):false,se=K?V.isSame(K,"day"):false,ue=U&&K?V.isBetween(U,K,"day","()"):false,Se=false;return f==="end"&&U&&!K&&m&&V.isAfter(U,"day")&&V.isBefore(m.add(1,"day"),"day")&&(Se=true),e(yh,{...z,day:V,disableMargin:true,isStart:fe,isEnd:se,isInRange:ue||Se,onMouseEnter:()=>v(V)})},[u,f,m]),W=j=>j?j.locale(i).format("YYYY-MM-DD"):"";return c("div",{className:"orb-date-range-picker",children:[e(ze,{className:"orb-date-range-field",label:s,value:u[0]?`${W(u[0])} - ${W(u[1])}`:"",onClick:M,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Vo}},InputProps:{readOnly:true,sx:{fontSize:Vo,"& .orb-inp":{fontSize:Vo},paddingRight:"4px"},endAdornment:e(ae,{className:"orb-date-range-calendar-trigger",size:"small",onClick:M,tooltip:s,children:e(Tt,{name:"calendar",size:16})})}}),c(ti,{open:E,anchorEl:l,onClose:N,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[e("div",{className:"orb-date-range-inputs",children:c(ie,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[e(ze,{className:"orb-date-range-manual-field",label:n("dateRange.startDate"),placeholder:aa,value:x,error:w,size:"small",onFocus:()=>b("start"),onChange:j=>{h(j.target.value),w&&T(false);},onBlur:()=>D("start",x),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),D("start",x));},sx:{"& .orb-inp":{fontSize:Vo,py:.75},"& label":{fontSize:Vo}}}),e(Hd,{color:"action",fontSize:"small"}),e(ze,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:aa,value:C,error:I,size:"small",onFocus:()=>{u[0]&&b("end");},onChange:j=>{k(j.target.value),I&&S(false);},onBlur:()=>D("end",C),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),D("end",C));},sx:{"& .orb-inp":{fontSize:Vo,py:.75},"& label":{fontSize:Vo}}})]})}),e("div",{className:"orb-date-range-shortcuts",children:c(ie,{direction:"row",spacing:1,justifyContent:"center",children:[e(xt,{label:n("dateRange.today"),onClick:()=>F("today"),clickable:true,size:"small",variant:"outlined"}),e(xt,{label:n("dateRange.thisWeek"),onClick:()=>F("week"),clickable:true,size:"small",variant:"outlined"}),e(xt,{label:n("dateRange.thisMonth"),onClick:()=>F("month"),clickable:true,size:"small",variant:"outlined"})]})}),e("div",{className:"orb-date-range-calendar",children:e(Fd,{dateAdapter:ja,adapterLocale:i,children:e(Od,{value:null,referenceDate:y,onMonthChange:g,onYearChange:g,onChange:O,slots:{day:Y},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),e(Dt,{}),c(ie,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[e(we,{size:"small",onClick:H,color:"inherit",children:n("common.cancel")}),e(we,{size:"small",variant:"contained",onClick:X,children:n("common.done")})]})]})]})};P();var Ni={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Sh={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"},wh=["contains","notContains",">",">=","<","<=","equals"],Xp=["=","!=",">","<",">=","<=","between"],or="0.85rem",kh=({field:t,value:r,onChange:o})=>{let{t:n}=pe(),[a,i]=er.useState(null),[s,l]=er.useState(null),[d,u]=er.useState(null),[p,f]=er.useState(""),[b,m]=er.useState(""),[v,y]=er.useState(""),[g,x]=er.useState("");er.useEffect(()=>{let M=setTimeout(()=>{x(v);},1e3);return ()=>clearTimeout(M)},[v]);let h=r?.operator||(t.type==="number"?"=":"equals"),C=r?.value,k=M=>{let N=Sh[M];return N?n(N):M},w=M=>{i(a?null:M.currentTarget);},T=M=>{o({...r,operator:M,value:C}),i(null);},I={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:or}},InputProps:{sx:{fontSize:or}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:or,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=t.type||"text";if(S==="date"){let N=(E=>{if(!E)return [null,null];if(Array.isArray(E)&&E.length===2){let O=E[0]?ro__default.default.isDayjs(E[0])?E[0]:ro__default.default(E[0]):null,F=E[1]?ro__default.default.isDayjs(E[1])?E[1]:ro__default.default(E[1]):null;return [O,F]}return ro__default.default.isDayjs(E)||typeof E=="string"?[ro__default.default.isDayjs(E)?E:ro__default.default(E),null]:[null,null]})(C);return e(Kp,{label:t.label,value:N,onChange:E=>o({value:E,operator:"between"})})}if(S==="number"&&h==="between"){let M=()=>{o({value:[p,b],operator:"between"}),l(null);},N=Array.isArray(C)?`${C[0]||""} - ${C[1]||""}`:"";return c(jsxRuntime.Fragment,{children:[e(ze,{...I,label:t.label,value:N,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...I.InputProps,startAdornment:e(io,{position:"start",children:e(ct,{title:k("between"),children:e(ae,{size:"small",onClick:w,sx:{width:24,height:24,fontSize:or},children:Ni.between})})}),readOnly:true},onClick:E=>l(s?null:E.currentTarget)}),e(Qt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:or,minHeight:"auto",py:.5}}},children:Xp.map(E=>c("option",{selected:E===h,onClick:()=>T(E),children:[e("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ni[E]}),e(Gt,{primary:k(E),primaryTypographyProps:{fontSize:or}})]},E))}),e(ti,{open:!!s,anchorEl:s,onClose:()=>l(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:c("div",{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[e(ze,{size:"small",label:n("smartFilter.min"),type:"number",value:p,onChange:E=>f(E.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:or}},InputProps:{sx:{fontSize:or}}}),e(zd,{color:"action"}),e(ze,{size:"small",label:n("smartFilter.max"),type:"number",value:b,onChange:E=>m(E.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:or}},InputProps:{sx:{fontSize:or}}}),e(we,{variant:"contained",size:"small",onClick:M,children:n("common.ok")})]})})]})}if(t.isValueHelp||S==="value-help"){let M=t.valueHelp?.mode||"single";return e(Sp,{...I,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:C??(M==="multiple"?[]:null),mode:M,onChange:N=>o({value:N,operator:M==="multiple"?"anyOf":"equals"})})}if(S==="select")return c(zt,{size:"small",fullWidth:true,label:t.label,value:C||"",onChange:M=>o({...r,value:M.target.value,operator:"equals"}),children:[e("option",{value:"",children:n("common.none")}),t.options?.map(M=>e("option",{value:M.value,children:M.label},M.value))]});if(S==="multi-select"){let M=Array.isArray(C)?C:[],N=t.options?.filter(Y=>Y.label.toLowerCase().includes(g.toLowerCase()))||[],E=Y=>t.options?.find(W=>W.value===Y)?.label||Y,O=M.map(E),F=O.length===0?n("common.none"):O.length>2?`${O.slice(0,2).join(", ")} +${O.length-2}`:O.join(", "),X=()=>{u(null),y(""),x("");},H=Y=>{let W=M.includes(Y)?M.filter(j=>j!==Y):[...M,Y];o({...r,value:W,operator:"anyOf"});};return c("div",{className:"orb-fld",children:[e("label",{children:t.label}),c(we,{variant:"outlined",size:"small",onClick:Y=>u(d?null:Y.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:or,fontWeight:400},children:[e("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F}),e(Vr,{fontSize:"small"})]}),e(Qt,{anchorEl:d,open:!!d,onClose:X,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:c("div",{onClick:Y=>Y.stopPropagation(),sx:{display:"grid",gap:.35},children:[e(ze,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:e(io,{position:"start",children:e(zo,{fontSize:"small"})}),sx:{fontSize:or}},value:v,onChange:Y=>y(Y.target.value),onKeyDown:Y=>Y.stopPropagation()}),N.length>0?N.map(Y=>{let W=M.includes(Y.value);return c("div",{role:"option","aria-selected":W,tabIndex:0,className:`orb-menu-item ${W?"orb-selected":""}`,onClick:()=>H(Y.value),onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),H(Y.value));},children:[e(It,{checked:W,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),e(Gt,{primary:Y.label})]},String(Y.value))}):e("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let A=S==="number"?Xp:wh;return c(jsxRuntime.Fragment,{children:[e(ze,{...I,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:C||"",type:S==="number"?"number":"text",onChange:M=>o({...r,value:M.target.value,operator:h}),InputProps:{...I.InputProps,startAdornment:e(io,{position:"start",children:e(ct,{title:k(h),children:e(ae,{className:"orb-filter-operator-trigger",size:"small",onClick:w,onMouseDown:M=>M.preventDefault(),sx:{width:24,height:24,fontSize:or,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Ni[h]})})}),endAdornment:t.hasSearchIcon?e(io,{position:"end",children:e(zo,{color:"action"})}):void 0}}),e(Qt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:or,minHeight:"auto",py:.5}}},children:A.map(M=>c("option",{selected:M===h,onClick:()=>T(M),children:[e("span",{className:"orb-filter-operator-symbol",children:Ni[M]}),e(Gt,{primary:k(M),primaryTypographyProps:{fontSize:or}})]},M))})]})},Wr=({fields:t,filters:r,onFilterChange:o,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:l,onVariantSetDefault:d,onSearch:u,loading:p=false,appId:f,tableKey:b,currentLayout:m,currentLayoutId:v,layoutRefs:y,variantService:g,serviceUrl:x})=>{let{t:h}=pe(),[C,k]=er.useState(true),[w,T]=er.useState(null),[I,S]=er.useState(t.filter(N=>!N.hidden).map(N=>N.id)),A=(N,E)=>{o({...r,[N]:E});},D=N=>{I.includes(N)?S(I.filter(E=>E!==N)):S([...I,N]);};return c(Ae,{className:`orb-smart-filter ${C?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[C?c(jsxRuntime.Fragment,{children:[c("div",{className:"orb-smart-filter-header",children:[f?e(Gp,{appId:f,tableKey:b,currentFilters:{values:r,visibleFields:I},currentLayout:m,currentLayoutId:v,layoutRefs:y,onLoad:N=>{if(!N.filters)return;let E=null;if(Array.isArray(N.filters)){let O=b||"default",F=N.filters.find(X=>X.scope===O);E=F?F.filters:null;}else E=N.filters;E&&(E.values||E.visibleFields?(E.visibleFields&&Array.isArray(E.visibleFields)&&S(E.visibleFields),E.values&&o(E.values)):o(E)),i&&i(N);},variantService:g,serviceUrl:x,currentVariantId:a}):e(Ri,{variants:n,currentVariantId:a,onLoad:i,onSave:N=>{s&&s({...N,filters:{values:r,visibleFields:I}});},onDelete:l,onSetDefault:d}),c("div",{className:"orb-smart-filter-actions",children:[e(ct,{title:h("smartFilter.addFilters"),children:e(we,{className:"orb-smart-filter-adapt",onClick:N=>T(w?null:N.currentTarget),size:"small",color:"primary",startIcon:e(dp,{fontSize:"small"}),sx:{textTransform:"none",fontSize:or,whiteSpace:"nowrap",minWidth:"fit-content"},children:h("smartFilter.adaptFilters")})}),e(ae,{className:"orb-smart-filter-go",tooltip:h("smartFilter.go"),"aria-label":h("smartFilter.go"),onClick:u,disabled:p,children:p?e(Xr,{size:16}):e(Tt,{name:"play",size:16})}),c(Qt,{anchorEl:w,open:!!w,onClose:()=>T(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:or,minHeight:32}}}},children:[e("option",{disabled:true,children:e(Gt,{primary:h("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:or}})}),e(Dt,{}),t.map(N=>c("option",{onClick:()=>D(N.id),children:[e(It,{checked:I.includes(N.id),size:"small"}),e(Gt,{primary:N.label,primaryTypographyProps:{fontSize:or}})]},N.id))]})]})]}),e("div",{className:"orb-smart-filter-grid",children:e(el,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(N=>I.includes(N.id)).map(N=>e(el,{size:1,children:e(kh,{field:N,value:r[N.id]||{value:"",operator:N.type==="number"?"=":"equals"},onChange:E=>A(N.id,E)})},N.id))})})]}):null,e("div",{className:"orb-smart-filter-toggle",children:e(ae,{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?e(ai,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):e(Vr,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};P();var Yp=({layouts:t,currentLayoutId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=pe(),[l,d]=er.useState(null),[u,p]=er.useState(false),[f,b]=er.useState(""),[m,v]=er.useState(""),[y,g]=er.useState({isDefault:false,isPublic:false}),x=t.find(I=>I.id===r),h=I=>{d(I.currentTarget);},C=()=>{d(null);},k=I=>{o(I),C();},w=()=>{b(""),v(""),g({isDefault:false,isPublic:false}),p(true),C();},T=()=>{f.trim()&&(n({name:f,description:m,...y}),p(false));};return c("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[e(ct,{title:s("layout.layoutOptions"),children:e(ae,{onClick:h,color:x?"primary":"default",size:"small",children:e(bp,{fontSize:"small"})})}),c(Qt,{anchorEl:l,open:!!l,onClose:C,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[e("option",{disabled:true,children:e(L,{variant:"caption",children:s("layout.selectLayout")})}),c("option",{onClick:w,children:[e(zr,{children:e(Po,{fontSize:"small"})}),e(Gt,{children:s("layout.saveCurrentLayout")})]}),e(Dt,{}),t.length===0&&e("option",{disabled:true,children:e(L,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((I,S)=>e("option",{onClick:()=>k(I),selected:I.id===r,children:c("div",{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[c("div",{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[e("div",{sx:{display:"flex",alignItems:"center",gap:1},children:e(L,{variant:"body2",fontWeight:I.id===r?"bold":"normal",noWrap:true,children:I.name})}),I.description&&e(L,{variant:"caption",color:"text.secondary",noWrap:true,children:I.description})]}),c("div",{sx:{display:"flex",alignItems:"center"},onClick:A=>A.stopPropagation(),children:[e(ct,{title:I.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:e(ae,{size:"small",onClick:A=>{A.stopPropagation(),i(I.id);},children:I.isDefault?e(mp,{fontSize:"small",color:"warning"}):e(up,{fontSize:"small"})})}),e(ct,{title:s("common.delete"),children:e(ae,{size:"small",color:"error",onClick:A=>{A.stopPropagation(),a(I.id);},children:e(oi,{fontSize:"small"})})})]})]})},I.id||S))]}),e(Lt,{open:u,onClose:()=>p(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:c(jsxRuntime.Fragment,{children:[e(we,{variant:"ghost",onClick:()=>p(false),children:s("common.cancel")}),e(we,{onClick:T,variant:"primary",disabled:!f.trim(),children:s("common.save")})]}),children:c("div",{className:"orb-layout-save-form",children:[e(ze,{label:s("layout.layoutName"),value:f,onChange:I=>b(I.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(I=>I.name===f)&&e(L,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),e(ze,{label:s("layout.layoutDescription"),value:m,onChange:I=>v(I.target.value),fullWidth:true,size:"small"}),e(It,{className:"orb-layout-save-option",checked:y.isDefault,onChange:I=>g({...y,isDefault:I.target.checked}),label:s("layout.useAsDefault")}),e(It,{className:"orb-layout-save-option",checked:y.isPublic,onChange:I=>g({...y,isPublic:I.target.checked}),label:s("layout.publicAllUsers")})]})})]})};P();var bn=({appId:t,tableKey:r="default",currentLayoutData:o,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:l,onSuccess:d})=>{let{t:u}=pe(),[p,f]=er.useState([]),[b,m]=er.useState(""),v=`orbcafe.layouts.${t}.${r}`,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:r,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),x=er.useCallback(()=>{try{let S=localStorage.getItem(v);if(!S)return [];let A=JSON.parse(S);return Array.isArray(A)?A:[]}catch{return []}},[v]),h=er.useCallback(S=>{try{localStorage.setItem(v,JSON.stringify(S));}catch{}},[v]);er.useEffect(()=>{i!==void 0&&m(i);},[i]),er.useEffect(()=>{if(a&&p.length>0){let S=p.find(A=>A.id===a);S&&(m(S.id),n(S));}},[a,p,n]);let C=er.useCallback(async()=>{if(t){if(!s){let S=x();f(S);let A=S.find(D=>D.isDefault);A&&!b&&!a&&(m(A.id),n(A));return}try{let S=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let D=(await S.json()).map(y);f(D);let M=D.find(N=>N.isDefault);M&&!b&&!a&&(m(M.id),n(M));}catch(S){console.error("Error fetching layouts",S);let A=x();f(A);let D=A.find(M=>M.isDefault);D&&!b&&!a&&(m(D.id),n(D)),l&&l(u("layout.toast.loadFallback"));}}},[t,r,s,l,b,n,a,x,u]);return er.useEffect(()=>{C();},[t,r]),e(Yp,{layouts:p,currentLayoutId:b,onLoad:S=>{m(S.id),n(S);},onSave:async S=>{let A=p.find(N=>N.name===S.name),D=A?A.id:Date.now().toString(),M={id:D,...S,createdAt:new Date().toISOString(),layoutData:o,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!s){let E=p.some(O=>O.id===D)?p.map(O=>O.id===D?M:O):[...p,M];f(E),h(E),m(D),n(M),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(M))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(u("layout.toast.saveSuccess")),await C(),m(D),n(M);}catch(N){console.error("Error saving layout",N);let O=p.some(F=>F.id===D)?p.map(F=>F.id===D?M:F):[...p,M];f(O),h(O),m(D),n(M),d&&d(u("layout.toast.saveLocalSuccess")),l&&l(u("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!s){let A=p.filter(D=>D.id!==S);f(A),h(A),b===S&&m(""),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");b===S&&m(""),d&&d(u("layout.toast.deleteSuccess")),await C();}catch(A){console.error("Error deleting layout",A);let D=p.filter(M=>M.id!==S);f(D),h(D),b===S&&m(""),d&&d(u("layout.toast.deleteLocalSuccess")),l&&l(u("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!s){let A=p.map(D=>({...D,isDefault:D.id===S}));f(A),h(A),d&&d(u("layout.toast.defaultLocalSuccess"));return}try{let A=p.find(M=>M.id===S);if(!A)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...A,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(u("layout.toast.defaultSuccess")),await C();}catch(A){console.error("Error setting default",A);let D=p.map(M=>({...M,isDefault:M.id===S}));f(D),h(D),d&&d(u("layout.toast.defaultLocalSuccess")),l&&l(u("layout.toast.backendUnavailableDefaultLocal"));}}})};var Ai=(t,r)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let o=t.filters.find(a=>a.scope===r);if(o)return o.filters;let n=t.filters.find(a=>a.scope==="default");return n?n.filters:null}return typeof t.filters=="object"?t.filters:null},Ei=(t,r)=>{if(!t)return {layout:null,layoutId:null};let o=null,n=null;if(Array.isArray(t.layoutRefs)){let a=t.layoutRefs.find(i=>i.tableKey===r);a&&(o=a.layoutId);}return !o&&t.layoutId&&(o=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(n=t.layout),{layoutId:o,layout:n}};function jp(t,r,o){return r[o]<t[o]?-1:r[o]>t[o]?1:0}function Ph(t,r){return t==="desc"?(o,n)=>jp(o,n,r):(o,n)=>-jp(o,n,r)}function Th(t,r){let o=t.map((n,a)=>[n,a]);return o.sort((n,a)=>{let i=r(n[0],a[0]);return i!==0?i:n[1]-a[1]}),o.map(n=>n[0])}var hn=t=>{let r=!!t.disableGrouping,o=!!t.disableSorting,n=er.useCallback(Z=>{let Q=String(Z?.label??Z?.id??"").length*9+64,be=typeof Z?.minWidth=="number"?Z.minWidth:0;return Math.max(100,be,Q)},[]),a=er.useCallback(()=>(t.columns||[]).filter(Z=>!!Z?.numeric).map(Z=>Z.id),[t.columns]),[i,s]=er.useState(""),[l,d]=er.useState(t.order||"asc"),[u,p]=er.useState(t.orderBy||""),[f,b]=er.useState([]),[m,v]=er.useState(t.page||0),[y,g]=er.useState(t.rowsPerPage||20),[x,h]=er.useState(t.selected||[]),[C,k]=er.useState(t.columns?t.columns.map(Z=>Z.id):[]),[w,T]=er.useState(t.columns?t.columns.map(Z=>Z.id):[]),[I,S]=er.useState(t.showSummary||false),[A,D]=er.useState(()=>a()),[M,N]=er.useState([]),[E,O]=er.useState(new Set),[F,X]=er.useState(()=>{let Z={};return (t.columns||[]).forEach($=>{Z[$.id]=n($);}),Z}),[H,Y]=er.useState(null),[W,j]=er.useState(null),[V,z]=er.useState(null),[U,K]=er.useState(null),[fe,se]=er.useState(false),[ue,Se]=er.useState(""),[$e,ke]=er.useState(""),le=r?[]:M,Ee=er.useCallback(Z=>{if(r){N([]),O(new Set),j(null);return}N(Z);},[r]);er.useEffect(()=>{r&&(N([]),O(new Set),j(null));},[r]),er.useEffect(()=>{o&&(d("asc"),p(""),b([]));},[o]),er.useEffect(()=>{t.layout&&wt(t.layout);},[t.layout]),er.useEffect(()=>{if(o){d("asc"),p("");return}t.order!==void 0&&d(t.order),t.orderBy!==void 0&&p(t.orderBy);},[t.order,t.orderBy,o]),er.useEffect(()=>{t.selected!==void 0&&h(t.selected);},[t.selected]),er.useEffect(()=>{t.page!==void 0&&v(t.page);},[t.page]),er.useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),er.useEffect(()=>{let Z=a();D($=>$.filter(be=>Z.includes(be)));},[a]),er.useEffect(()=>{X(Z=>{let $={...Z};return (t.columns||[]).forEach(Q=>{$[Q.id]===void 0&&($[Q.id]=n(Q));}),$});},[t.columns,n]),er.useEffect(()=>{T(Z=>{let $=(t.columns||[]).map(qe=>qe.id),Q=new Set($),be=Z.filter(qe=>Q.has(qe)),Ce=new Set(be),Le=$.filter(qe=>!Ce.has(qe)),_e=[...be,...Le];return _e.length===Z.length&&_e.every((qe,je)=>qe===Z[je])?Z:_e});},[t.columns]);let Me=er.useMemo(()=>{let Z=t.columns||[];if(w.length===0)return Z;let $=new Map(Z.map(Ce=>[Ce.id,Ce])),Q=[],be=new Set;return w.forEach(Ce=>{let Le=$.get(Ce);Le&&(Q.push(Le),be.add(Ce));}),Z.forEach(Ce=>{be.has(Ce.id)||Q.push(Ce);}),Q},[t.columns,w]),Pe=er.useMemo(()=>{let Z=t.rows||[];return i&&(Z=Z.filter($=>Object.keys($).some(Q=>String($[Q]).toLowerCase().includes(i.toLowerCase())))),Z},[t.rows,i]),Ve=er.useMemo(()=>{if(o||t.onSortChange)return Pe;if(f.length>0){let Z=[...Pe];return Z.sort(($,Q)=>{for(let be of f){let Ce=$?.[be.field],Le=Q?.[be.field];if(!(Ce==null&&Le==null)){if(Ce==null)return be.direction==="asc"?-1:1;if(Le==null)return be.direction==="asc"?1:-1;if(Ce<Le)return be.direction==="asc"?-1:1;if(Ce>Le)return be.direction==="asc"?1:-1}}return 0}),Z}return u?Th(Pe,Ph(l,u)):Pe},[Pe,l,u,f,t.onSortChange,o]),tt=er.useCallback(Z=>{if(le.length===0)return Z.map(Le=>({type:"row",data:Le,id:Le[t.rowKey||"id"]}));let $=[...Z].sort((Le,_e)=>{for(let qe of le){if(Le[qe]<_e[qe])return -1;if(Le[qe]>_e[qe])return 1}return 0}),Q=(Le,_e=0)=>{if(_e>=le.length)return Le;let qe=le[_e],je={},mt=[];return Le.forEach(ft=>{let Rt=ft[qe],yt=`${qe}:${Rt}`;je[yt]||(je[yt]={key:yt,field:qe,value:Rt,children:[],count:0,level:_e},mt.push(je[yt])),je[yt].children.push(ft),je[yt].count++;}),mt.forEach(ft=>{ft.children&&(ft.children=Q(ft.children,_e+1));}),mt},be=Q($),Ce=(Le,_e="")=>{let qe=[];return Le.forEach(je=>{if(je.children){let mt=_e?`${_e}>${je.key}`:je.key,ft=E.has(mt);qe.push({type:"group",id:mt,field:je.field,value:je.value,level:je.level,count:je.count,isExpanded:ft,childIds:(function Rt(yt){let B=[];return yt.children.forEach(J=>{J.children?B=B.concat(Rt(J)):B.push(J[t.rowKey||"id"]);}),B})(je)}),ft&&(qe=qe.concat(Ce(je.children,mt)));}else qe.push({type:"row",data:je,id:je[t.rowKey||"id"],level:le.length});}),qe};return Ce(be)},[le,E,t.rowKey]),nt=er.useCallback(Z=>{if(le.length===0)return [];let $=[...Z].sort((Ce,Le)=>{for(let _e of le){if(Ce[_e]<Le[_e])return -1;if(Ce[_e]>Le[_e])return 1}return 0}),Q=[],be=(Ce,Le,_e)=>{if(Le>=le.length)return;let qe=le[Le],je=new Map;Ce.forEach(mt=>{let ft=mt[qe],Rt=je.get(ft);Rt?Rt.push(mt):je.set(ft,[mt]);}),je.forEach((mt,ft)=>{let Rt=`${qe}:${ft}`,yt=_e?`${_e}>${Rt}`:Rt;Q.push(yt),be(mt,Le+1,yt);});};return be($,0,""),Q},[le]),it=er.useMemo(()=>tt(Ve),[Ve,tt]),q=er.useMemo(()=>nt(Ve),[Ve,nt]),De=er.useMemo(()=>{let Z=(t.rows||[]).length;return typeof t.count=="number"&&t.count>Z},[t.count,t.rows]),ye=er.useMemo(()=>De?it:y>0?it.slice(m*y,m*y+y):it,[it,m,y,De]),Be=er.useMemo(()=>De&&typeof t.count=="number"?t.count:it.length,[it.length,De,t.count]),at=Z=>{O($=>{let Q=new Set($);return Q.has(Z)?Q.delete(Z):Q.add(Z),Q});},Ze=Z=>{let $=q.filter(Q=>Q===Z||Q.startsWith(`${Z}>`));O(Q=>{let be=new Set(Q);return $.forEach(Ce=>be.add(Ce)),be});},St=Z=>{O($=>{let Q=new Set($);return Array.from(Q).forEach(be=>{(be===Z||be.startsWith(`${Z}>`))&&Q.delete(be);}),Q});},Mt=Z=>{if(!Z){O(new Set);return}O(new Set(q));},Ot=Z=>{let $=q.filter(Q=>Q.startsWith(`${Z}>`));return $.length===0?E.has(Z):E.has(Z)&&$.every(Q=>E.has(Q))},At=Z=>{if(o)return;f.length>0&&b([]);let $=u===Z&&l==="asc",Q=u===Z&&l==="desc";if(t.onSortChange){$?t.onSortChange(Z,"desc"):Q?t.onSortChange("","asc"):t.onSortChange(Z,"asc");return}$?(d("desc"),p(Z)):Q?(d("asc"),p("")):(d("asc"),p(Z));},re=Z=>{if(o){d("asc"),p(""),b([]);return}let $=Z.filter(Q=>Q&&Q.field);b($),$.length>0&&p("");},Ke=()=>{b([]);},Fe=(Z,$)=>{X(Q=>({...Q,[Z]:$}));},ce=Z=>{if(Z.target.checked){let $=Pe.map(Q=>Q[t.rowKey||"id"]);h($),t.onSelectionChange&&t.onSelectionChange($);return}h([]),t.onSelectionChange&&t.onSelectionChange([]);},ve=(Z,$)=>{let Q=$[t.rowKey||"id"],be=x.indexOf(Q),Ce=[];be===-1?Ce=Ce.concat(x,Q):be===0?Ce=Ce.concat(x.slice(1)):be===x.length-1?Ce=Ce.concat(x.slice(0,-1)):be>0&&(Ce=Ce.concat(x.slice(0,be),x.slice(be+1))),h(Ce),t.onSelectionChange&&t.onSelectionChange(Ce);},te=Z=>{v(Z),t.onPageChange&&t.onPageChange(Z);},he=Z=>{g(Z),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(Z);},Ne=Z=>{let $=C.indexOf(Z),Q=[...C];$===-1?Q.push(Z):Q.splice($,1),k(Q);},Je=Z=>{if(r)return;let $=le.indexOf(Z),Q=[...le];$===-1?Q.push(Z):Q.splice($,1),Ee(Q);},st=Z=>{a().includes(Z)&&D(Q=>Q.includes(Z)?Q.filter(be=>be!==Z):[...Q,Z]);},pt=(Z,$)=>{!Z||!$||Z===$||T(Q=>{let be=Q.indexOf(Z),Ce=Q.indexOf($);if(be===-1||Ce===-1)return Q;let Le=[...Q];return Le.splice(be,1),Le.splice(Ce,0,Z),Le});},Bt=Z=>{let $=Z?.active?.id,Q=Z?.over?.id;typeof $=="string"&&typeof Q=="string"&&pt($,Q);},Xt=Z=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:C,columnOrder:w,order:o?"asc":l,orderBy:o?"":u,sortBy:o?[]:f,grouping:le,columnWidths:F,showSummary:I,summaryColumns:A});},Vt=Z=>{let{layout:$,layoutId:Q}=Ei(Z,t.tableKey||"default");Q?(ke(Q),Se(Q)):(ke(""),Se("")),$&&($.visibleColumns&&k($.visibleColumns),Array.isArray($.columnOrder)&&T($.columnOrder),o?(d("asc"),p(""),b([])):($.order&&d($.order),$.orderBy&&p($.orderBy),Array.isArray($.sortBy)&&b($.sortBy)),$.grouping&&Ee($.grouping),$.columnWidths&&X($.columnWidths),$.showSummary!==void 0&&S(!!$.showSummary),Array.isArray($.summaryColumns)&&D($.summaryColumns));},wt=Z=>{let $=Z?.layoutData||Z?.layout||Z||{};$.visibleColumns&&k($.visibleColumns),Array.isArray($.columnOrder)&&T($.columnOrder),o?(d("asc"),p(""),b([])):($.order&&d($.order),$.orderBy!==void 0&&p($.orderBy),Array.isArray($.sortBy)&&b($.sortBy)),$.grouping&&Ee($.grouping),$.columnWidths&&X($.columnWidths),$.showSummary!==void 0&&S(!!$.showSummary),Array.isArray($.summaryColumns)&&D($.summaryColumns),O(new Set),v(0),Z?.id&&Se(Z.id),ke("");};er.useEffect(()=>{t.layout&&Vt({layout:t.layout});},[t.layout]);let Wt=Z=>{Z.preventDefault(),K(U===null?{mouseX:Z.clientX+2,mouseY:Z.clientY-6}:null);},ht=()=>{K(null);},Nt=er.useMemo(()=>{if(!I)return {};let Z={};t.columns.forEach(Q=>{if(Q.numeric&&A.includes(Q.id)){let be=Pe.reduce((Ce,Le)=>{let _e=parseFloat(Le[Q.id]);return Ce+(isNaN(_e)?0:_e)},0);Z[Q.id]=be.toFixed(2);}else Z[Q.id]="";});let $=t.columns.find(Q=>C.includes(Q.id)&&!Q.numeric);return $&&!$.numeric&&(Z[$.id]="Total"),Z},[Pe,t.columns,I,A,C]),lt=()=>{if(!t.columns||!Pe)return;let Z=t.columns.map(Le=>Le.label).join(","),$=Pe.map(Le=>t.columns.map(_e=>{let qe=Le[_e.id];return `"${(qe==null?"":String(qe)).replace(/"/g,'""')}"`}).join(",")).join(`
184
- `),Q=`data:text/csv;charset=utf-8,${Z}
185
- ${$}`,be=encodeURI(Q),Ce=document.createElement("a");Ce.setAttribute("href",be),Ce.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce);},Ft=()=>{se(true);},Yt=()=>{se(false);};return {isMobile:false,columns:Me,order:l,setOrder:d,orderBy:u,setOrderBy:p,sortBy:f,setSortBy:b,applyMultiSort:re,clearMultiSort:Ke,columnOrder:w,setColumnOrder:T,filterText:i,setFilterText:s,visibleColumns:C,setVisibleColumns:k,showSummary:I,setShowSummary:S,summaryColumns:A,grouping:le,setGrouping:Ee,expandedGroups:E,setExpandedGroups:O,groupAnchorEl:W,setGroupAnchorEl:j,summaryAnchorEl:V,setSummaryAnchorEl:z,columnWidths:F,setColumnWidths:X,anchorEl:H,setAnchorEl:Y,contextMenu:U,setContextMenu:K,sensors:void 0,sortedAndFilteredRows:Ve,visibleRows:ye,summaryRow:Nt,page:m,setPage:te,rowsPerPage:y,setRowsPerPage:he,totalDisplayCount:Be,selected:x,setSelected:h,isAllExpanded:q.length>0&&q.every(Z=>E.has(Z)),handleColumnResize:Fe,handleRequestSort:At,handleSelectAllClick:ce,handleClick:ve,toggleSummaryColumn:st,handleDragEnd:Bt,handleColumnReorder:pt,handleExport:lt,handleContextMenu:Wt,handleCloseContextMenu:ht,toggleColumnVisibility:Ne,toggleGroupExpand:at,toggleGroupField:Je,handleToggleAll:Mt,handleExpandGroupRecursively:Ze,handleCollapseGroupRecursively:St,isGroupFullyExpanded:Ot,handleLayoutLoad:wt,handleVariantLoad:Vt,handleLayoutSave:Xt,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:C,order:o?"asc":l,orderBy:o?"":u,sortBy:o?[]:f,columnOrder:w,grouping:le,columnWidths:F,showSummary:I,summaryColumns:A},currentLayoutId:ue,layoutIdToLoad:$e,onPageChange:te,onRowsPerPageChange:he,graphReportOpen:fe,handleOpenGraphReport:Ft,handleCloseGraphReport:Yt}};P();var gD=t=>e("tbody",{...t}),fD=({align:t,...r})=>e("td",{align:t==="inherit"?void 0:t,...r}),bD=t=>e("div",{...t}),hD=t=>e("thead",{...t}),vD=t=>e("tr",{...t}),Jr=t=>{let{t:r}=pe(),o="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:u,fitContainer:p=false,fullWidth:f=false,maxHeight:b,loading:m=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g,rowKey:x,tableKey:h="default",graphReport:C,quickCreate:k,quickEdit:w,quickDelete:T,serviceUrl:I,disableGrouping:S=false,disableSorting:A=false}=t,D=n||r("table.title.default"),{isMobile:M,columns:N,order:E,orderBy:O,filterText:F,setFilterText:X,visibleColumns:H,showSummary:Y,setShowSummary:W,summaryColumns:j,grouping:V,setGrouping:z,expandedGroups:U,groupAnchorEl:K,setGroupAnchorEl:fe,summaryAnchorEl:se,setSummaryAnchorEl:ue,columnWidths:Se,anchorEl:$e,setAnchorEl:ke,contextMenu:le,sensors:Ee,sortedAndFilteredRows:Me,summaryRow:Pe,visibleRows:Ve,isAllExpanded:tt,page:nt,setPage:it,rowsPerPage:q,setRowsPerPage:De,totalDisplayCount:ye,setSelected:Be,handleColumnResize:at,handleRequestSort:Ze,handleSelectAllClick:St,handleClick:Mt,toggleSummaryColumn:Ot,handleDragEnd:At,handleExport:re,handleContextMenu:Ke,handleCloseContextMenu:Fe,toggleColumnVisibility:ce,toggleGroupExpand:ve,handleToggleAll:te,handleExpandGroupRecursively:he,handleCollapseGroupRecursively:Ne,isGroupFullyExpanded:Je,handleLayoutLoad:st,handleVariantLoad:pt,handleLayoutSave:Bt,effectiveAppId:Xt,currentLayoutData:Vt,currentLayoutId:wt,layoutIdToLoad:Wt,graphReportOpen:ht,handleOpenGraphReport:Nt,handleCloseGraphReport:lt}=hn(t),Ft=C?.enabled??false,Yt=Ft&&(C?.interaction?.enabled??true),Z=Ii(),$=!!k?.enabled,Q=!!w?.enabled,be=!!T?.enabled,Ce=k?.fields,Le=k?.excludeFields||[],_e=k?.initialValues||{},[qe,je]=er__namespace.default.useState(false),[mt,ft]=er__namespace.default.useState(false),[Rt,yt]=er__namespace.default.useState({}),[B,J]=er__namespace.default.useState(false),[ge,Te]=er__namespace.default.useState(false),[et,Xe]=er__namespace.default.useState({}),[kt,bt]=er__namespace.default.useState(false),[gt,Ct]=er__namespace.default.useState(false),nr=m||mt||ge||gt,Et=er__namespace.default.useMemo(()=>{let oe=[...N];if(Array.isArray(Ce)&&Ce.length>0){let me=new Set(Ce);oe=oe.filter(ee=>me.has(ee.id));}if(Le.length>0){let me=new Set(Le);oe=oe.filter(ee=>!me.has(ee.id));}return oe.filter(me=>!!me?.id)},[N,Le,Ce]),Zt=x||"id",Ht=er__namespace.default.useMemo(()=>{let oe=new Set(s);return Me.filter(me=>oe.has(me?.[Zt]))},[s,Me,Zt]),Kt=Ht.length===1?Ht[0]:null,$t=w?.fields,rr=w?.excludeFields||[],ar=w?.editableFields||[],fr=w?.nonEditableFields||[],Ir=w?.primaryKeys?.length?w.primaryKeys:[Zt],Mr=er__namespace.default.useMemo(()=>{let oe=[...N];if(Array.isArray($t)&&$t.length>0){let me=new Set($t);oe=oe.filter(ee=>me.has(ee.id));}if(rr.length>0){let me=new Set(rr);oe=oe.filter(ee=>!me.has(ee.id));}return oe.filter(me=>!!me?.id)},[N,rr,$t]),oo=er__namespace.default.useMemo(()=>new Set(Ir),[Ir]),yr=er__namespace.default.useMemo(()=>new Set(ar),[ar]),Or=er__namespace.default.useMemo(()=>new Set(fr),[fr]),qo=er__namespace.default.useCallback(oe=>yr.size>0?yr.has(oe):!(Or.has(oe)||oo.has(oe)),[yr,Or,oo]);er__namespace.default.useEffect(()=>{!ht&&Z.hasActiveFilters&&Z.clearAll();},[ht,Z.hasActiveFilters,Z.clearAll]);let Xo=()=>{let oe={};Et.forEach(me=>{oe[me.id]=_e[me.id]??"";}),yt(oe),je(true);},Lo=()=>{mt||je(false);},Yo=(oe,me)=>{yt(ee=>({...ee,[oe]:me}));},Zo=async()=>{if(!k?.onSubmit){je(false);return}try{ft(!0),await k.onSubmit(Rt),je(!1);}finally{ft(false);}},Rr=()=>{if(!Kt)return;let oe={};Mr.forEach(ee=>{oe[ee.id]=Kt[ee.id]??"";});let me=w?.getInitialValues?{...oe,...w.getInitialValues(Kt)}:oe;Xe(me),J(true);},Oo=()=>{ge||J(false);},jo=(oe,me)=>{Xe(ee=>({...ee,[oe]:me}));},Kr=async()=>{if(Kt){if(!w?.onSubmit){J(false);return}try{Te(!0),await w.onSubmit(et,Kt),J(!1);}finally{Te(false);}}},no=()=>{Ht.length!==0&&bt(true);},Ln=()=>{gt||bt(false);},Fo=async()=>{if(Ht.length===0){bt(false);return}if(!T?.onConfirm){bt(false),Be([]),l?.([]);return}try{Ct(!0),await T.onConfirm(Ht),bt(!1),Be([]),l?.([]);}finally{Ct(false);}},R=Me,{fieldMapping:_}=mn({rows:R,config:{...C,title:C?.title||`${D} ${r("graph.reportTitle")}`}}),G=er__namespace.default.useMemo(()=>Yt?Z.applyRows(R,_):R,[Yt,Z.applyRows,R,_]),{model:de}=mn({rows:G,config:{...C,title:C?.title||`${D} ${r("graph.reportTitle")}`,fieldMapping:_}}),He=de.table.columns.map(oe=>({id:oe.id,label:oe.label,align:oe.align||"left",minWidth:120,numeric:oe.align==="right"})),ot=Xt?e(bn,{appId:Xt,tableKey:h,currentLayoutData:Vt,onLayoutLoad:st,targetLayoutId:Wt,activeLayoutId:wt,serviceUrl:I??g?.serviceUrl}):null,Ge=c(jsxRuntime.Fragment,{children:[!S&&e(pn,{groupAnchorEl:K,setGroupAnchorEl:fe,grouping:V,setGrouping:z,columns:N}),e(un,{anchorEl:$e,setAnchorEl:ke,columns:N,visibleColumns:H,toggleColumnVisibility:ce}),e(yi,{anchorEl:se,setAnchorEl:ue,showSummary:Y,setShowSummary:W,columns:N,summaryColumns:j,toggleSummaryColumn:Ot}),e(Ci,{contextMenu:le,handleCloseContextMenu:Fe,columns:N,visibleColumns:H,toggleColumnVisibility:ce})]});return M?c("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g&&e(Wr,{fields:g.fields,filters:g.filters,onFilterChange:g.onFilterChange,onSearch:g.onSearch,variants:g.variants||[],currentVariantId:g.currentVariantId,onVariantLoad:g.onVariantLoad,onVariantSave:g.onVariantSave,onVariantDelete:g.onVariantDelete,onVariantSetDefault:g.onVariantSetDefault,appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:Vt}],variantService:g.variantService,serviceUrl:I??g.serviceUrl}),e(Pp,{title:D,loading:m,showSummary:Y,setShowSummary:W,setAnchorEl:ke,setSummaryAnchorEl:ue,filterText:F,setFilterText:X,sortedAndFilteredRows:Me,selected:s,columns:N,visibleColumns:H,summaryRow:Pe,handleClick:Mt,selectionMode:i}),Ge]}):c("div",{sx:{width:f?"100%":"auto",mb:p?0:2,...p?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g&&e("div",{sx:{mb:2},children:e(Wr,{fields:g.fields,filters:g.filters,onFilterChange:g.onFilterChange,onSearch:g.onSearch,variants:g.variants||[],currentVariantId:g.currentVariantId,onVariantLoad:oe=>{pt(oe),g.onVariantLoad&&g.onVariantLoad(oe);},onVariantSave:g.onVariantSave,onVariantDelete:g.onVariantDelete,onVariantSetDefault:g.onVariantSetDefault,loading:m,appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:Vt}],currentLayoutId:wt,layoutRefs:[{tableKey:h,layoutId:wt}],variantService:g.variantService,serviceUrl:I??g.serviceUrl})}),c(Ae,{className:"orb-ctable-surface",sx:{width:f?"100%":"auto",mb:p?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":nr?{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"}},...b?{height:b}:p?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&e(fi,{filterText:F,setFilterText:X,onRowsPerPageChange:De,rowsPerPage:q,rowsPerPageOptions:v,page:nt,count:ye,onPageChange:it,actions:d,extraTools:u,grouping:V,disableGrouping:S,groupAnchorEl:K,setGroupAnchorEl:fe,showSummary:Y,setShowSummary:W,anchorEl:$e,setAnchorEl:ke,summaryAnchorEl:se,setSummaryAnchorEl:ue,handleExport:re,showCreateButton:$,onOpenCreateDialog:Xo,showEditButton:Q,onOpenEditDialog:Rr,editDisabled:Ht.length!==1,showDeleteButton:be,onOpenDeleteConfirm:no,deleteDisabled:Ht.length===0,onLayoutSave:y||g?.variantService&&g?.appId?Bt:void 0,loading:m,layoutManager:ot,onOpenGraphReport:Ft?Nt:void 0}),e("div",{sx:{flex:1,...b?{maxHeight:b,height:b}:p?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:e(core.DndContext,{sensors:Ee,collisionDetection:core.closestCenter,onDragEnd:At,modifiers:[modifiers.restrictToHorizontalAxis],children:c("table",{className:"orb-tbl orb-ctable",style:{minWidth:f?750:void 0,width:f?"100%":"auto",tableLayout:Object.keys(Se).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:o},"aria-labelledby":"tableTitle",children:[e(hi,{columns:N,visibleColumns:H,order:E,orderBy:O,onRequestSort:Ze,disableSorting:A,onContextMenu:Ke,selectionMode:i,grouping:V,isAllExpanded:tt,handleToggleAll:te,rowCount:Me.length,numSelected:s.length,onSelectAllClick:St,columnWidths:Se,onColumnResize:at}),e(vi,{visibleRows:Ve,columns:N,visibleColumns:H,selectionMode:i,selected:s,orderBy:O,loading:m,expandedGroups:U,toggleGroupExpand:ve,handleExpandGroupRecursively:he,handleCollapseGroupRecursively:Ne,isGroupFullyExpanded:Je,handleClick:Mt,onSelectionChange:l,grouping:V,rowKeyProp:x,page:nt,rowsPerPage:q}),Y&&e(kp,{showSummary:Y,columns:N,visibleColumns:H,summaryRow:Pe,selectionMode:i?.toString(),grouping:V,columnWidths:Se,orderBy:O,zIndex:3})]})})})]}),$&&c(Lt,{open:qe,onClose:Lo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||r("quickCreate.createWithTitle",{title:D})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Et.map(oe=>{let me=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",ee=oe.label||oe.id;return e(ze,{label:ee,value:Rt[oe.id]??"",onChange:Oe=>Yo(oe.id,Oe.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-${oe.id}`)}),k?.description&&e(jr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:k.description})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(we,{onClick:Lo,sx:{fontSize:"0.85rem"},disabled:mt,children:k?.cancelLabel||r("common.cancel")}),e(we,{onClick:Zo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:mt,children:k?.submitLabel||r("common.save")})]})]}),Q&&c(Lt,{open:B,onClose:Oo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:w?.title||r("quickEdit.editWithTitle",{title:D})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Mr.map(oe=>{let me=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",ee=oe.label||oe.id,Oe=qo(oe.id);return e(ze,{label:ee,value:et[oe.id]??"",onChange:Qe=>jo(oe.id,Qe.target.value),type:me,size:"small",fullWidth:true,disabled:!Oe,InputLabelProps:{shrink:me==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${oe.id}`)}),w?.description&&e(jr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:w.description})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(we,{onClick:Oo,sx:{fontSize:"0.85rem"},disabled:ge,children:w?.cancelLabel||r("common.cancel")}),e(we,{onClick:Kr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ge||!Kt,children:w?.submitLabel||r("common.save")})]})]}),be&&e(jn,{open:kt,type:"warning",title:T?.title||r("quickDelete.confirmTitle"),message:T?.message||(Ht.length>1?r("quickDelete.confirmMessageMultiple",{count:Ht.length}):r("quickDelete.confirmMessageSingle")),confirmText:T?.confirmText||r("common.delete"),cancelText:T?.cancelText||r("common.cancel"),onClose:Ln,onConfirm:Fo}),Ge,Ft&&e(Pi,{open:ht,onClose:lt,model:de,aiAssistant:C?.aiAssistant,interaction:Yt?{enabled:true,filters:Z.filters,fieldMapping:_,onPrimaryDimensionClick:oe=>Z.setFilter("primaryDimension",oe),onSecondaryDimensionClick:oe=>Z.setFilter("secondaryDimension",oe),onStatusClick:oe=>Z.setFilter("status",oe),onClearFilter:Z.clearFilter,onClearAll:Z.clearAll}:void 0,tableContent:e(Jr,{appId:Xt||"graph-report-internal",title:r("graph.dataBody"),columns:He,rows:de.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},yD=Jr;P();var TD=({id:t,title:r,hideHeader:o=true,filterConfig:n,tableProps:a,children:i,spacing:s=1,mode:l="separated"})=>{let d=n?{...n,appId:n.appId||t}:void 0,u={...a,appId:a.appId||t};return c(ui,{title:r,hideHeader:o,children:[c(ie,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l==="separated"&&d&&e("div",{sx:{flexShrink:0},children:e(Wr,{...d})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:e(Jr,{...u,fitContainer:true,filterConfig:l==="integrated"?d:void 0})})]}),i]})};var AD=({metadata:t,fetchData:r,initialRowsPerPage:o=20,rowsPerPageOptions:n=[20,50,100,-1],tableKey:a="default",mode:i="integrated",serviceUrl:s,variantService:l})=>{let{t:d}=pe(),[u,p]=er.useState(false),[f,b]=er.useState([]),[m,v]=er.useState({}),[y,g]=er.useState(t.variants||[]),[x,h]=er.useState(t.layout||null),[C,k]=er.useState(""),[w,T]=er.useState(0),[I,S]=er.useState(0),[A,D]=er.useState(o),[M,N]=er.useState([]),[E,O]=er.useState("asc"),[F,X]=er.useState("");er.useEffect(()=>{let se={};t.filters.forEach(ue=>{ue.defaultValue!==void 0&&(se[ue.id]=ue.defaultValue);}),v(se);},[t.filters]);let H=er.useCallback(async(se,ue,Se,$e,ke)=>{p(true);try{let le={...se,page:ue+1,limit:Se,sort:ke,order:$e},Ee;r?Ee=await r(le):typeof t.api=="function"?Ee=await t.api(le):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,le),Ee={rows:[],total:0}):(console.warn("No API configured for report"),Ee={rows:[],total:0}),Ee&&(b(Ee.rows||[]),T(Ee.total||0));}catch(le){console.error("Failed to fetch report data",le);}finally{p(false);}},[t.api,r]);er.useEffect(()=>{H(m,I,A,E,F);},[H,I,A,E,F]);let Y=()=>{S(0),H(m,0,A,E,F);},W=se=>{S(0),D(se);},j=(se,ue)=>{O(ue),X(se);},V=se=>{v(se);},z=se=>{k(se?.id||"");let ue=Ai(se,a);if(ue){let $e=ue.values??ue;v($e),H($e,0,A,E,F),S(0);}let{layout:Se}=Ei(se,a);Se&&h(Se);},U=se=>{let ue={...se,id:Date.now().toString(),createdAt:new Date().toISOString()};g(Se=>[...Se,ue]);},K=se=>{h(se);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:m,onFilterChange:V,onSearch:Y,onVariantLoad:z,onVariantSave:U,onVariantDelete:se=>g(ue=>ue.filter(Se=>Se.id!==se)),onVariantSetDefault:se=>{g(ue=>ue.map(Se=>({...Se,isDefault:Se.id===se})));},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:A,rowsPerPageOptions:n,onPageChange:S,onRowsPerPageChange:W,selectionMode:"multiple",selected:M,onSelectionChange:N,onLayoutSave:K,layout:x,title:t.title,showSummary:true,order:E,orderBy:F,serviceUrl:s,onSortChange:j,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:m,rows:f,loading:u,refresh:Y}};P();var Eh=new Set(["id","title","description","icon","iconNode","meta"]),Lh=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,r=>r.toUpperCase()).trim(),Oh=t=>Object.entries(t).filter(([r,o])=>!Eh.has(r)&&o!==null&&o!==void 0&&["string","number","boolean"].includes(typeof o)).map(([r,o])=>({key:r,label:Lh(r),value:String(o)})),Jp=({item:t,open:r,onClose:o,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=pe(),u=Cr()==="dark"?"var(--orb-p300)":"var(--orb-primary)";er__namespace.default.useEffect(()=>{if(!r)return;let f=b=>{b.key==="Escape"&&o();};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[r,o]);let p=Oh(t);return typeof document>"u"?null:reactDom.createPortal(c(jsxRuntime.Fragment,{children:[e("div",{"aria-hidden":"true",onClick:o,sx:{position:"fixed",inset:0,zIndex:1299,backgroundColor:"rgba(1, 9, 26, 0.4)",opacity:r?1:0,pointerEvents:r?"auto":"none",transition:"opacity 200ms ease"}}),c("div",{role:"dialog","aria-modal":"true","aria-label":t.title,sx:{position:"fixed",top:"50%",left:"50%",zIndex:1300,width:"min(520px, 92vw)",maxHeight:"82vh",display:"flex",flexDirection:"column",bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 24px 64px rgba(1, 9, 26, 0.3)",transform:r?"translate(-50%, -50%) scale(1)":"translate(-50%, -47%) scale(0.96)",opacity:r?1:0,transition:"transform 200ms ease, opacity 180ms ease"},children:[c(ie,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[e("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??e(Tt,{name:t.icon??"product",size:30,style:{color:u}})}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?e(L,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),e(ae,{tooltip:s??l("cardPage.close"),"aria-label":s??l("cardPage.close"),onClick:o,children:e(Tt,{name:"decline",size:18})})]}),e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",p:2.5},children:a?a(t):c(jsxRuntime.Fragment,{children:[t.description?e(L,{component:"div",sx:{fontSize:"0.9rem",lineHeight:1.6,color:"text.primary"},children:t.description}):null,p.length>0?e("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:p.map(f=>c("div",{children:[e(L,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:f.label}),e(L,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:f.value})]},f.key))}):null]})}),n?e("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:e(we,{variant:"contained",sx:{width:"100%"},startIcon:e(Tt,{name:"download",size:16}),onClick:()=>n(t),children:i??l("cardPage.download")})}):null]})]}),document.body)};P();var Fh={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},Bh=({item:t,onDetailClick:r,onDownloadClick:o,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=pe(),l=Cr()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??e(Tt,{name:t.icon??"product",size:26,style:{color:l}});return c(Ae,{elevation:0,sx:{p:2,height:"100%",display:"flex",flexDirection:"column",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",boxShadow:"0 8px 20px rgba(15, 23, 42, 0.06)",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease","&:hover":{transform:"translateY(-2px)",borderColor:"primary.main",boxShadow:"0 14px 32px rgba(15, 23, 42, 0.12)"}},children:[c(ie,{direction:"row",spacing:1.5,alignItems:"center",children:[e("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}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?e(L,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),e("div",{sx:{mt:1.5,flex:1,minHeight:0},children:e(L,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...Fh},children:t.description||"\xA0"})}),c(ie,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[e(ae,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>r?.(t),children:e(Tt,{name:"show",size:18})}),e(ae,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>o?.(t),children:e(Tt,{name:"download",size:18})})]})]})},tu=({items:t,loading:r=false,onDetailClick:o,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:l,detailPanel:d=true,renderDetailContent:u})=>{let{t:p}=pe(),[f,b]=er__namespace.default.useState(null),[m,v]=er__namespace.default.useState(false),y=x=>{o?.(x),d&&(b(x),requestAnimationFrame(()=>requestAnimationFrame(()=>v(true))));},g=()=>{v(false),setTimeout(()=>b(null),260);};return r?e("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:e(Xr,{})}):t.length?c(jsxRuntime.Fragment,{children:[e("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=>e(Bh,{item:x,onDetailClick:y,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&f?e(Jp,{item:f,open:m,onClose:g,onDownloadClick:n,renderContent:u,downloadTooltip:s}):null]}):e("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:e(L,{sx:{color:"text.secondary"},children:l??p("cardPage.empty")})})};P();var eN=({id:t,title:r,hideHeader:o=true,filterConfig:n,gridProps:a,children:i,spacing:s=1})=>{let l=n?{...n,appId:n.appId||t}:void 0;return c(ui,{title:r,hideHeader:o,children:[c(ie,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l&&e("div",{sx:{flexShrink:0},children:e(Wr,{...l})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:e(tu,{...a})})]}),i]})};var aN=({metadata:t,fetchData:r,tableKey:o="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,u]=er.useState(false),[p,f]=er.useState([]),[b,m]=er.useState(0),[v,y]=er.useState({}),[g,x]=er.useState(t.variants||[]),[h,C]=er.useState("");er.useEffect(()=>{let D={};t.filters.forEach(M=>{M.defaultValue!==void 0&&(D[M.id]=M.defaultValue);}),y(D);},[t.filters]);let k=er.useCallback(async D=>{u(true);try{let M=r?await r({...D}):{rows:[],total:0};f(M?.rows||[]),m(M?.total||0);}catch(M){console.error("Failed to fetch card page data",M);}finally{u(false);}},[r]);er.useEffect(()=>{k(v);},[k]);let w=()=>{k(v);},T=D=>{y(D);},I=D=>{C(D?.id||"");let M=Ai(D,o);if(M){let N=M.values??M;y(N),k(N);}},S=D=>{let M={...D,id:Date.now().toString(),createdAt:new Date().toISOString()};x(N=>[...N,M]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:o,fields:t.filters,filters:v,onFilterChange:T,onSearch:w,onVariantLoad:I,onVariantSave:S,onVariantDelete:D=>x(M=>M.filter(N=>N.id!==D)),onVariantSetDefault:D=>{x(M=>M.map(N=>({...N,isDefault:N.id===D})));},variants:g,currentVariantId:h,variantService:n,serviceUrl:a},gridProps:{items:p,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:l}},items:p,total:b,filters:v,loading:d,refresh:w}};var zh=t=>[...t].sort((r,o)=>o.value-r.value),lN=({bars:t=[],lines:r=[],combos:o=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=er.useMemo(()=>zh(t),[t]),l=er.useMemo(()=>[...r],[r]),d=er.useMemo(()=>[...o],[o]),u=er.useMemo(()=>[...n],[n]),p=er.useMemo(()=>{let b=a.reduce((m,v)=>m+v.value,0);return a.map(m=>({...m,percent:b>0?m.value/b*100:m.percent}))},[a]),f=er.useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:u,pies:p,waterfalls:f}};var mN=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>er.useMemo(()=>!t||!r?"":oa({apiKey:t,query:r,zoom:o,mapType:n}),[t,r,o,n]),gN=({keyword:t,location:r})=>er.useMemo(()=>wi({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0}),[t,r]);P();var la=({code:t,language:r="text",copyable:o=true,showLineNumbers:n=false,wrapLongLines:a=false,maxHeight:i})=>{let[s,l]=er.useState(false),d=er.useMemo(()=>t.replace(/\n$/,"").split(`
186
- `),[t]);return c("div",{style:{border:"1px solid var(--orb-border)",borderRadius:12,overflow:"hidden",background:"var(--orb-canvas)"},children:[c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4.8px 8px",background:"var(--orb-hover)",borderBottom:"1px solid var(--orb-border)"},children:[e("span",{style:{fontSize:12,fontWeight:500,textTransform:"uppercase",letterSpacing:.5,color:"var(--orb-muted)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r}),o&&e(ae,{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?e(qr,{size:14,strokeWidth:1.8}):e(vo,{size:14,strokeWidth:1.8})})]}),e("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((p,f)=>c("div",{style:{display:"flex"},children:[e("span",{style:{width:34,flexShrink:0,textAlign:"right",paddingRight:8,color:"var(--orb-disabled-fg)",userSelect:"none"},children:f+1}),e("span",{style:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:p})]},`${f}-${p}`)):e("code",{style:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:t})})]})};P();var Uh=t=>{let r=t.trim();return r.startsWith("$$")&&r.endsWith("$$")&&r.length>=4&&(r=r.slice(2,-2).trim()),r.startsWith("$")&&r.endsWith("$")&&r.length>=2&&(r=r.slice(1,-1).trim()),r},Kh=async t=>new Function("m","return import(m)")(t),ca=({expression:t,inline:r=false,allowKatex:o=false})=>{let n=er.useMemo(()=>Uh(t),[t]),[a,i]=er.useState("");return er.useEffect(()=>{let s=true;return (async()=>{if(!o||!n){i("");return}try{let d=await Kh("katex"),p=(d?.default||d)?.renderToString?.(n,{displayMode:!r,throwOnError:!1,strict:"warn"});s&&typeof p=="string"&&i(p);}catch{s&&i("");}})(),()=>{s=false;}},[o,n,r]),n?a?e(Ie,{component:r?"span":"div",sx:{display:r?"inline-flex":"block",my:r?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):r?e(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}):e(Ie,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:e(hr,{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};P();var Yh=async t=>new Function("m","return import(m)")(t),cl=({code:t,title:r="Mermaid Diagram",height:o=320,enabled:n=true})=>{let[a,i]=er.useState(""),[s,l]=er.useState(""),[d,u]=er.useState(false),p=er.useMemo(()=>t.trim(),[t]);return er.useEffect(()=>{let f=true;return (async()=>{if(!n||!p){i(""),l("");return}u(true),l(""),i("");try{let m=await Yh("mermaid"),v=m?.default||m;if(!v||typeof v.render!="function")throw new Error("Mermaid runtime is not available");v.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let y=await v.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,p),g=typeof y=="string"?y:y?.svg;f&&typeof g=="string"&&i(g);}catch(m){if(f){let v=m instanceof Error?m.message:"Failed to render Mermaid diagram";l(v);}}finally{f&&u(false);}})(),()=>{f=false;}},[n,p]),c(Bo,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[e(Ie,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:e(hr,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:r})}),c(Ie,{sx:{p:1},children:[d&&e(Ie,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:e(xd,{size:20})}),!d&&a&&e(Ie,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&c(Ie,{children:[s&&e(jr,{severity:"info",sx:{mb:1},children:s}),e(la,{code:p,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};P();var dl=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),jh=t=>/^:?-{3,}:?$/.test(t.trim()),Qh=t=>{let r=t.trim(),o=r.startsWith(":"),n=r.endsWith(":");return o&&n?"center":n?"right":"left"},Li=t=>{let r=t.split(`
187
- `).map(s=>s.trim()).filter(Boolean);if(r.length<2)return null;let o=dl(r[0]),n=dl(r[1]);if(o.length===0||n.length!==o.length||!n.every(jh))return null;let a=n.map(Qh),i=r.slice(2).filter(s=>s.includes("|")).map(s=>{let l=dl(s);return l.length<o.length?[...l,...Array.from({length:o.length-l.length},()=>"")]:l.slice(0,o.length)});return {headers:o,aligns:a,rows:i}},pl=({markdown:t,table:r,maxHeight:o=360})=>{let n=er.useMemo(()=>r||(t?Li(t):null),[r,t]);return !n||n.headers.length===0?e(Bo,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:e(hr,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):e(Bo,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:e(Pd,{sx:{maxHeight:o},children:c(wd,{size:"small",stickyHeader:true,children:[e(Td,{children:e(Js,{children:n.headers.map((a,i)=>e(Qs,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),e(kd,{children:n.rows.map((a,i)=>e(Js,{hover:true,children:a.map((s,l)=>e(Qs,{align:n.aligns[l],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||e(Ie,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${l}`))},`row-${i}`))})]})})})};P();var Oi=({content:t,title:r="Thinking",defaultExpanded:o=false,isStreaming:n=false})=>{let[a,i]=er.useState(o);return c(Ie,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[c(vd,{direction:"row",alignItems:"center",spacing:.6,children:[e(yd,{size:"small",onClick:()=>i(s=>!s),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:e(an,{fontSize:"inherit"})}),c(hr,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[r,n?" ...":""]})]}),e(nn,{in:a,children:e(hr,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};P();var ul=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Fi=t=>t.trim().startsWith("```"),au=t=>/^#{1,6}\s+/.test(t.trim()),ml=t=>/^[-*+]\s+/.test(t.trim()),gl=t=>/^\d+\.\s+/.test(t.trim()),iu=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),fl=t=>t.trim().startsWith(">"),su=(t,r)=>{if(r+1>=t.length)return false;let o=t[r],n=t[r+1];return !o.includes("|")||!n.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(n.trim())},lu=t=>t.trim().startsWith("<think>")||t.trim()===":::think",da=(t,r,o)=>{let n=[],a=0,i=0;ul.lastIndex=0;let s=ul.exec(t);for(;s;){s.index>a&&n.push(t.slice(a,s.index));let l=s[0],d=`${o}-${i}`;if(l.startsWith("**")&&l.endsWith("**"))n.push(e("strong",{children:l.slice(2,-2)},d));else if(l.startsWith("*")&&l.endsWith("*"))n.push(e("em",{children:l.slice(1,-1)},d));else if(l.startsWith("`")&&l.endsWith("`"))n.push(e(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 u=l.match(/^\[([^\]]+)\]\(([^)]+)\)$/);u?n.push(e(hd,{href:u[2],target:"_blank",rel:"noreferrer",children:u[1]},d)):n.push(l);}else l.startsWith("$")&&l.endsWith("$")&&r.enableMath?n.push(e(ca,{expression:l,inline:true,allowKatex:true},d)):n.push(l);a=s.index+l.length,i+=1,s=ul.exec(t);}return a<t.length&&n.push(t.slice(a)),n.length>0?n:[t]},pa=({markdown:t,content:r,className:o,enableMath:n=true,enableMermaid:a=true,enableThinkBlock:i=true,codeCopyable:s=true,codeLineNumbers:l=false})=>{let d=t??r??"",u=er.useMemo(()=>{let p=[],f=d.replace(/\r\n/g,`
183
+ `;return eo.useEffect(()=>{let d=i.current;if(!d)return;let p=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),m=p.gl;m.clearColor(0,0,0,0),d.appendChild(m.canvas);let f=new ogl.Triangle(m),h=new ogl.Program(m,{vertex:s,fragment:l,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(m.canvas.width,m.canvas.height,m.canvas.width/m.canvas.height)},hue:{value:t},hover:{value:0},rot:{value:0},hoverIntensity:{value:o},backgroundColor:{value:xm(a)}}}),u=new ogl.Mesh(m,{geometry:f,program:h});function v(){if(!d)return;let I=window.devicePixelRatio||1,w=d.clientWidth,M=d.clientHeight;p.setSize(w*I,M*I),m.canvas.style.width=w+"px",m.canvas.style.height=M+"px",h.uniforms.iResolution.value.set(m.canvas.width,m.canvas.height,m.canvas.width/m.canvas.height);}window.addEventListener("resize",v),v();let y=0,g=0,x=0,b=.3,C=I=>{let w=d.getBoundingClientRect(),M=I.clientX-w.left,A=I.clientY-w.top,R=w.width,D=w.height,E=Math.min(R,D),O=R/2,_=D/2,J=(M-O)/E*2,F=(A-_)/E*2;Math.sqrt(J*J+F*F)<.8?y=1:y=0;},k=()=>{y=0;};d.addEventListener("mousemove",C),d.addEventListener("mouseleave",k);let S,T=I=>{S=requestAnimationFrame(T);let w=(I-g)*.001;g=I,h.uniforms.iTime.value=I*.001,h.uniforms.hue.value=t,h.uniforms.hoverIntensity.value=o,h.uniforms.backgroundColor.value=xm(a);let M=n?1:y;h.uniforms.hover.value+=(M-h.uniforms.hover.value)*.1,r&&M>.5&&(x+=w*b),h.uniforms.rot.value=x,p.render({scene:u});};return S=requestAnimationFrame(T),()=>{cancelAnimationFrame(S),window.removeEventListener("resize",v),d.removeEventListener("mousemove",C),d.removeEventListener("mouseleave",k),m.canvas.parentNode===d&&d.removeChild(m.canvas),m.getExtension("WEBGL_lose_context")?.loseContext();}},[t,o,r,n,a]),e("div",{ref:i,className:"w-full h-full"})}function Hy(t,o,r){let n,a,i;if(o===0)n=a=i=r;else {let s=(p,m,f)=>(f<0&&(f+=1),f>1&&(f-=1),f<.16666666666666666?p+(m-p)*6*f:f<.5?m:f<.6666666666666666?p+(m-p)*(.6666666666666666-f)*6:p),l=r<.5?r*(1+o):r+o-r*o,d=2*r-l;n=s(d,l,t+1/3),a=s(d,l,t),i=s(d,l,t-1/3);}return new ogl.Vec3(n,a,i)}function xm(t){if(t==="transparent")return new ogl.Vec3(0,0,0);if(t.startsWith("#")){let n=parseInt(t.slice(1,3),16)/255,a=parseInt(t.slice(3,5),16)/255,i=parseInt(t.slice(5,7),16)/255;return new ogl.Vec3(n,a,i)}let o=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o)return new ogl.Vec3(parseInt(o[1])/255,parseInt(o[2])/255,parseInt(o[3])/255);let r=t.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(r){let n=parseInt(r[1])/360,a=parseInt(r[2])/100,i=parseInt(r[3])/100;return Hy(n,a,i)}return new ogl.Vec3(0,0,0)}var Sm=zs(()=>{"use strict";"use client";P();});var ef={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"},tf={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"},Vs={light:ef,dark:tf},$0='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',_0=t=>{let o=Vs[t];return [o.primary,o.p300,o.muted,o.p700]},G0=10,U0="0.2s ease";P();var Ec=eo.createContext({mode:"light",setting:"light"}),gf=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;},Bn=({mode:t,defaultMode:o="light",children:r})=>{let n=t??o,[a,i]=eo.useState("light"),[s,l]=eo.useState(false);eo.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;eo.useEffect(()=>{gf(d);},[d]);let p=eo.useMemo(()=>({mode:d,setting:n}),[d,n]);return e(Ec.Provider,{value:p,children:r})},fo=()=>eo.useContext(Ec).mode,$s=()=>Vs[fo()];var ot=(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 No=t=>{let o=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[r,n]=eo.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(o).matches);return eo.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};P();var bf={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},vf=t=>typeof t=="number"?`${t}px`:t,yf={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},Cf=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?yf[o[1]]:void 0},Tt=eo.forwardRef(({name:t,size:o,title:r,className:n,style:a,strokeWidth:i,fill:s,...l},d)=>{let p=l["aria-label"]??r,m=vf(o??Cf(n)??"1em"),f={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 e("span",{ref:d,role:p?"img":void 0,"aria-hidden":p?void 0:true,title:r,className:n,"data-sap-icon":t,style:f,...l,children:String.fromCodePoint(bf[t])})});Tt.displayName="SapIcon";var ae=(t,o)=>{let r=eo.forwardRef((n,a)=>e(Tt,{ref:a,name:t,...n}));return r.displayName=o??`SapIcon(${t})`,r};var Oc=ae("activity","Activity"),Da=ae("error","AlertCircle"),Fc=ae("warning","AlertTriangle"),mw=ae("down","ArrowDown"),gw=ae("navigationRight","ArrowRight"),Bc=ae("up","ArrowUp"),_s=ae("barChart","BarChart"),fw=ae("activate","Bot"),Gs=ae("calendar","Calendar"),hw=Gs,bw=ae("camera","Camera"),vw=ae("lineChart","ChartNoAxesCombined"),Ao=ae("accept","Check"),Na=ae("accept","CheckCircle"),Ho=ae("slimDown","ChevronDown"),Aa=ae("navigationLeft","ChevronLeft"),zo=ae("navigationRight","ChevronRight"),yw=ae("slimUp","ChevronUp"),Cw=ae("expandAll","ChevronsDown"),xw=ae("collapseAll","ChevronsUp"),Ea=ae("error","CircleAlert"),Hn=ae("accept","CircleCheck"),ww=Hn,Hc=ae("stop","CircleStop"),zc=ae("copy","Clipboard"),Sw=ae("checklist","ClipboardCheck"),kw=ae("checklist","ClipboardList"),Vc=ae("time","Clock"),Pw=ae("tableColumn","Columns3"),Yo=ae("copy","Copy"),Tw=ae("duplicate","CopyPlus"),Iw=ae("delete","Delete"),La=ae("download","Download"),Wc=ae("edit","Edit"),$c=ae("fullScreen","Expand"),Rw=ae("show","Eye"),Mw=ae("hide","EyeOff"),Oa=ae("document","File"),_c=ae("document","FileText"),Dw=ae("filter","Filter"),zn=ae("tree","FolderTree"),Gc=ae("process","GitBranch"),Vn=ae("world","Globe"),Uc=ae("grid","Grid"),Nw=ae("move","GripVertical"),Aw=ae("wrench","Hammer"),Kc=ae("picture","Image"),Fa=ae("information","Info"),Ew=ae("translate","Languages"),Lw=ae("dimension","Layers"),Ow=ae("home","LayoutDashboard"),Ba=ae("lightbulb","Lightbulb"),qc=ae("lineChart","LineChart"),Xc=ae("synchronize","Loader2"),Ha=ae("locked","Lock"),Fw=Ha,Yc=ae("log","LogOut"),Us=ae("email","Mail"),Zc=ae("map","MapPin"),jc=ae("menu","Menu"),xf=ae("message","MessageCircle"),Qc=xf,za=ae("microphone","Mic"),Bw=ae("microphone","MicOff"),Jc=ae("darkMode","Moon"),Hw=ae("overflow","MoreHorizontal"),zw=ae("accept","PackageCheck"),Vw=ae("product","PackageSearch"),Va=ae("splitOne","PanelLeftOpen"),Wa=ae("splitTwo","PanelRight"),Ww=ae("overview","PanelsTopLeft"),ed=ae("pieChart","PieChart"),Jr=ae("pushpin","Pin"),$w=ae("play","Play"),en=ae("add","Plus"),_w=ae("qrCode","QrCode"),Gw=ae("receipt","ReceiptText"),$a=ae("refresh","RefreshCw"),Uw=ae("activate","Rocket"),Kw=ae("refresh","RotateCcw"),td=ae("refresh","RotateCw"),qw=ae("tableRow","Rows3"),Xw=ae("save","Save"),Yw=ae("qrCode","ScanLine"),Vo=ae("search","Search"),wf=ae("paperPlane","Send"),od=wf,tn=ae("wrench","Settings"),Zw=ae("accept","ShieldCheck"),jw=ae("sum","Sigma"),Qw=ae("sort","SortAsc"),Jw=ae("splitTwo","SquareSplitHorizontal"),eS=ae("favorite","Star"),rd=ae("lightMode","Sun"),tS=ae("table","Table2"),oS=ae("ipad","TabletSmartphone"),Wn=ae("command","Terminal"),nd=ae("thumbDown","ThumbsDown"),ad=ae("thumbUp","ThumbsUp"),id=ae("delete","Trash2"),rS=ae("tree","TreePine"),sd=ae("trendDown","TrendingDown"),_a=ae("warning","TriangleAlert"),nS=ae("shipping","Truck"),ld=ae("upload","UploadCloud"),Ks=ae("employee","User"),cd=ae("sound","Volume2"),aS=ae("factory","Warehouse"),iS=ae("process","Workflow"),qt=ae("decline","X"),Ga=ae("error","XCircle");_t();P();var kf={contained:"primary",outlined:"secondary",text:"ghost"},Pf={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},ke=eo.forwardRef(({variant:t="primary",size:o="medium",block:r=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:l,sx:d,className:p,children:m,disabled:f,type:h="button",...u},v)=>{let y=kf[t]??t,g=["orb-btn",`orb-btn-${y}`,Pf[o],r?"orb-btn-block":void 0,n?"orb-is-loading":void 0,p].filter(Boolean).join(" "),x=Ue(d,g),b=s??(l?"a":"button");return c(b,{ref:v,type:b==="button"?h:void 0,href:l,className:x.className,style:x.style,disabled:b==="button"?f||n:void 0,"aria-disabled":b!=="button"&&(f||n)?true:void 0,...u,children:[n&&e("span",{className:`orb-spin ${y==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,m,!n&&i]})});ke.displayName="CButton";_t();P();var ze=eo.forwardRef(({label:t,value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:l="text",placeholder:d,disabled:p,readOnly:m,required:f,autoFocus:h,autoComplete:u,name:v,id:y,error:g,helperText:x,dense:b=false,size:C,fullWidth:k=true,select:S=false,multiline:T=false,rows:I,children:w,variant:M,margin:A,onClick:R,startAdornment:D,endAdornment:E,InputProps:O,inputProps:_,InputLabelProps:J,SelectProps:F,sx:V,className:z},X)=>{let W=eo.useId(),H=y??`orb-tf-${W}`,U=D??O?.startAdornment,Y=E??O?.endAdornment,re=(typeof g=="string"?g:void 0)??x,we={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,disabled:p,required:f,autoFocus:h,autoComplete:u,name:v,onClick:R,"aria-invalid":!!g},Ve=S?e("select",{...we,ref:X,onChange:n,children:w}):T?e("textarea",{...we,ref:X,onChange:n,rows:I,readOnly:m||O?.readOnly}):e("input",{...we,ref:X,onChange:n,type:l,readOnly:m||O?.readOnly,..._}),Te=Ue(V,`orb-fld ${g?"orb-is-error":""} ${z??""}`,{width:k?"100%":void 0});return c("div",{className:Te.className,style:Te.style,children:[t&&e("label",{htmlFor:H,children:t}),U||Y?c("div",{className:"orb-inp-adornment-wrap",children:[U&&e("span",{className:"orb-inp-adornment",children:U}),Y&&e("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:Y}),Ve]}):Ve,re&&e("span",{className:"orb-fld-msg",children:re})]})});ze.displayName="CTextField";_t();P();var $n=eo.forwardRef(({label:t,value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l,minRows:d=3,multiline:p,error:m,helperText:f,fullWidth:h=true,name:u,id:v,inputProps:y,sx:g,className:x},b)=>{let C=eo.useId(),k=v??`orb-ta-${C}`,T=(typeof m=="string"?m:void 0)??f,I=Ue(g,`orb-fld ${m?"orb-is-error":""} ${x??""}`,{width:h?"100%":void 0});return c("div",{className:I.className,style:I.style,children:[t&&e("label",{htmlFor:k,children:t}),e("textarea",{ref:b,id:k,className:"orb-inp",value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l??d,name:u,"aria-invalid":!!m,...y}),T&&e("span",{className:"orb-fld-msg",children:T})]})});$n.displayName="CTextArea";_t();P();var zt=eo.forwardRef(({label:t,options:o,children:r,value:n,defaultValue:a,onChange:i,disabled:s,size:l,dense:d=true,fullWidth:p=true,minWidth:m,placeholder:f,displayEmpty:h,renderValue:u,multiple:v,MenuProps:y,variant:g,disableUnderline:x,onClick:b,onMouseDown:C,error:k,helperText:S,name:T,id:I,"aria-label":w,sx:M,className:A},R)=>{let D=eo.useId(),E=I??`orb-sel-${D}`,_=(typeof k=="string"?k:void 0)??S,J=eo.useRef(null),F=eo.useRef(null),[V,z]=eo.useState(false),[X,W]=eo.useState(180),[H,U]=eo.useState(a??"");eo.useImperativeHandle(R,()=>J.current);let Y=eo.useMemo(()=>eo.Children.toArray(r).flatMap(ce=>{if(!eo.isValidElement(ce)||ce.type!=="option")return [];let be=ce;return [{value:Array.isArray(be.props.value)?be.props.value[0]??"":be.props.value??"",label:be.props.children,disabled:be.props.disabled}]}),[r]),ue=o??Y,re=n??H,ge=Array.isArray(re)?re[0]??"":re,we=String(ge??""),Ve=ue.find(ce=>String(ce.value)===we),Te=u?u(re):Ve?.label??(we||(f??"")),Ie=Ue(M,`orb-fld ${k?"orb-is-error":""} ${A??""}`,{width:p?"100%":void 0,minWidth:typeof m=="number"?`${m}px`:m});if(v)return c("div",{className:Ie.className,style:Ie.style,children:[t&&e("label",{htmlFor:E,children:t}),c("select",{ref:R,id:E,className:`orb-inp ${d||l==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:T,multiple:true,onClick:b,onMouseDown:C,"aria-invalid":!!k,"aria-label":w,children:[f!==void 0&&e("option",{value:"",children:f}),o?o.map(ce=>e("option",{value:ce.value,disabled:ce.disabled,children:ce.label},ce.value)):r]}),_&&e("span",{className:"orb-fld-msg",children:_})]});let He=ce=>{n===void 0&&U(ce);let be=J.current;be&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(be,ce),i?.({target:be,currentTarget:be}));};return c("div",{className:Ie.className,style:Ie.style,children:[t&&e("label",{htmlFor:E,children:t}),e("select",{ref:J,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:T,value:we,disabled:s,onChange:()=>{},children:ue.map(ce=>e("option",{value:ce.value,disabled:ce.disabled,children:ce.label},String(ce.value)))}),c(Eo__namespace.Root,{open:V,onOpenChange:ce=>{ce&&W(F.current?.getBoundingClientRect().width??180),z(ce);},children:[e(Eo__namespace.Trigger,{asChild:true,children:c("button",{ref:F,id:E,type:"button",className:`orb-inp orb-select-trigger ${d||l==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!k,"aria-label":w,"aria-haspopup":"listbox","data-placeholder":!Ve&&!we?"":void 0,onClick:b,onMouseDown:C,children:[e("span",{className:"orb-select-value",children:Te}),e(Tt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),e(Eo__namespace.Portal,{children:e(Eo__namespace.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:X},children:e(Eo__namespace.RadioGroup,{value:we,onValueChange:He,children:ue.map(ce=>c(Eo__namespace.RadioItem,{className:"orb-select-option",value:String(ce.value),disabled:ce.disabled,children:[e("span",{className:"orb-select-check","aria-hidden":"true",children:String(ce.value)===we?e(Tt,{name:"accept",size:13}):null}),e("span",{children:ce.label})]},String(ce.value)))})})})]}),_&&e("span",{className:"orb-fld-msg",children:_})]})});zt.displayName="CSelect";_t();P();var It=eo.forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,indeterminate:i,name:s,value:l,id:d,size:p,color:m,onClick:f,inputProps:h,sx:u,className:v},y)=>{let g=Ue([{...p==="small"?{fontSize:13}:void 0,...m?{color:m}:void 0},...Array.isArray(u)?u:u?[u]:[]],`orb-chk ${v??""}`),x=e("input",{ref:b=>{b&&(b.indeterminate=!!i),typeof y=="function"?y(b):y&&(y.current=b);},type:"checkbox",id:d,checked:o,defaultChecked:r,onChange:n,readOnly:o!==void 0&&n===void 0,disabled:a,name:s,value:l,onClick:f,...h});return t==null?e("span",{className:g.className,style:g.style,children:x}):c("label",{className:g.className,style:g.style,children:[x,e("span",{children:t})]})});It.displayName="CCheckbox";P();var Hf=({label:t,options:o,value:r,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:p})=>{let m=eo.useId(),f=i??`orb-rdo-${m}`;return c("div",{className:`orb-fld ${p??""}`,style:d,role:"radiogroup",children:[t&&e("span",{className:"orb-fld-label",children:t}),e("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children:o.map(h=>c("label",{className:"orb-rdo",children:[e("input",{type:"radio",name:f,value:h.value,checked:r!==void 0?r===h.value:void 0,defaultChecked:n!==void 0?n===h.value:void 0,onChange:a?u=>a(u,h.value):void 0,disabled:l||h.disabled}),e("span",{children:h.label})]},h.value))})]})};_t();P();var Ua=eo.forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,name:i,id:s,size:l,sx:d,className:p},m)=>{let f=Ue([{...l==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d)?d:d?[d]:[]],`orb-sw ${p??""}`),h=e("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?e("span",{className:f.className,style:f.style,children:h}):c("label",{className:f.className,style:f.style,children:[h,e("span",{children:t})]})});Ua.displayName="CSwitch";_t();P();var Wf={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},xt=eo.forwardRef(({label:t,children:o,tone:r,color:n="default",variant:a,size:i="medium",clickable:s,avatar:l,icon:d,onDelete:p,onClick:m,sx:f,className:h},u)=>{let v=r??(a==="outlined"&&n==="default"?"outline":Wf[n]??"gray"),y=s??!!m,g=Ue([{cursor:y?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(f)?f:f?[f]:[]],`orb-chip orb-chip-${v} ${h??""}`);return c("span",{ref:u,className:g.className,style:g.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,e("span",{className:"orb-chip-label",children:o??t}),p&&e("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:e(qt,{size:13,strokeWidth:2})})]})});xt.displayName="CChip";_t();P();var Ka=eo.forwardRef(({badgeContent:t,color:o="primary",children:r,invisible:n=false,sx:a,className:i},s)=>{let l=Ue(a,i,{display:"inline-flex",position:r?"relative":void 0}),d=!n&&t!==void 0&&t!==null&&e("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?c("span",{ref:s,className:l.className,style:l.style,children:[r,d]}):e("span",{ref:s,className:l.className,style:l.style,children:d})});Ka.displayName="CBadge";_t();P();var on=eo.forwardRef(({children:t,src:o,alt:r,size:n=28,sx:a,className:i},s)=>{let l=Ue([{width:n,height:n,fontSize:n*.4},...Array.isArray(a)?a:a?[a]:[]],`orb-avatar ${i??""}`);return e("span",{ref:s,className:l.className,style:l.style,children:o?e("img",{src:o,alt:r??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});on.displayName="CAvatar";_t();P();var rn=eo.forwardRef(({severity:t="info",title:o,children:r,onClose:n,sx:a,className:i},s)=>{let l=Ue(a,`orb-alert orb-alert-${t} ${i??""}`);return c("div",{ref:s,role:"alert",className:l.className,style:l.style,children:[c("div",{style:{flex:1,minWidth:0},children:[o&&e("b",{children:o}),r&&e("span",{children:r})]}),n&&e("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"})]})});rn.displayName="CAlert";_t();P();var _n=({value:t,variant:o,color:r,sx:n,className:a})=>{let i=o==="indeterminate"||t===void 0,s=Ue(n,`orb-prog ${a??""}`);return c("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:[e("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&&e("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},Uf=({width:t,height:o=14,variant:r="rectangular",sx:n,className:a})=>e("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})=>e("span",{className:`orb-spin ${o?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...r},role:"status","aria-label":"Loading"});P();var ct=({title:t,children:o,enterDelay:r=300,side:n="top",align:a="center",disabled:i})=>!t||i?e(jsxRuntime.Fragment,{children:o}):e(jo__namespace.Provider,{delayDuration:r,skipDelayDuration:200,children:c(jo__namespace.Root,{children:[e(jo__namespace.Trigger,{asChild:true,children:o}),e(jo__namespace.Portal,{children:e(jo__namespace.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});_t();P();var ie=eo.forwardRef(({tooltip:t,size:o="small",active:r=false,edge:n,color:a,sx:i,className:s,children:l,type:d="button",...p},m)=>{let f=Ue([{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=e("button",{ref:m,type:d,className:f.className,style:f.style,...p,children:l});return t?e(ct,{title:t,children:h}):h});ie.displayName="CIconButton";_t();P();var Gn=({value:t,options:o,onValueChange:r,size:n="medium",sx:a,className:i,...s})=>{let l=eo.useRef([]),d=o.findIndex(u=>!u.disabled),p=o.findIndex(u=>u.value===t),m=(u,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;u.key==="Home"&&(x=y[0]),u.key==="End"&&(x=y[y.length-1]),(u.key==="ArrowRight"||u.key==="ArrowDown")&&(x=y[(g+1+y.length)%y.length]),(u.key==="ArrowLeft"||u.key==="ArrowUp")&&(x=y[(g-1+y.length)%y.length]),x!==void 0&&(u.preventDefault(),l.current[x]?.focus(),r(o[x].value));},f=Ue(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),h={...f.style,"--orb-segmented-count":Math.max(o.length,1),"--orb-segmented-index":Math.max(p,0)};return c("div",{role:"radiogroup",className:f.className,style:h,"data-has-selection":p>=0?"true":"false",...s,children:[e("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),o.map((u,v)=>{let y=u.value===t;return e(ie,{ref:g=>{l.current[v]=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":y,"data-selected":y?"true":void 0,disabled:u.disabled,tabIndex:y||t==null&&v===d?0:-1,onClick:()=>r(u.value),onKeyDown:g=>m(g,v),children:u.icon??e("span",{className:"orb-segmented-control-label",children:u.label})},u.value)})]})};_t();P();var Qt=({triggerLabel:t,items:o=[],trigger:r,align:n="start",anchorEl:a,open:i,onClose:s,children:l,slotProps:d,PaperProps:p,anchorPosition:m,sx:f})=>{let h=eo.useRef(null);if(eo.useEffect(()=>{if(i!==true)return;let u=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",u,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",u,true),document.removeEventListener("keydown",v,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let u=a?.getBoundingClientRect(),v=window.innerWidth,y=u?.left??16,g=u?.right??y,x=d?.paper?.sx??p?.sx,b=Ue([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(f)?f:f?[f]:[]],"orb-pop orb-menu",d?.paper?.style??p?.style),C=eo.Children.map(l,k=>{if(!eo.isValidElement(k)||k.type!=="option")return k;let S=k.props,{children:T,disabled:I,selected:w}=S,M=Ue(S.sx,`orb-menu-item ${w?"orb-selected":""} ${S.className??""}`,S.style);return e("div",{role:"menuitem","aria-disabled":I||void 0,"aria-selected":w||void 0,tabIndex:I?-1:0,id:S.id,title:S.title,className:M.className,style:M.style,onClick:I?void 0:S.onClick,onKeyDown:A=>{!I&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),S.onClick?.(A));},children:T})});return reactDom.createPortal(e("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??(u?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:C}),document.body)}return c(Eo__namespace.Root,{children:[e(Eo__namespace.Trigger,{asChild:true,children:r??e(ke,{variant:"primary",children:t})}),e(Eo__namespace.Portal,{children:e(Eo__namespace.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:o.map((u,v)=>c(Eo__namespace.Item,{className:"orb-menu-item",disabled:u.disabled,onSelect:()=>u.onClick?.(),children:[u.icon,u.label]},v))})})]})};_t();P();var Ae=eo.forwardRef(({elevation:t=1,variant:o,component:r,sx:n,style:a,className:i,children:s,...l},d)=>{let p=r??"div",m=Ue(n,`orb-card ${t>0&&o!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return e(p,{ref:d,className:m.className,style:m.style,...l,children:s})});Ae.displayName="CPaper";_t();P();var Dt=eo.forwardRef(({orientation:t="horizontal",flexItem:o,sx:r,className:n},a)=>{let i=Ue([{...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 e("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});Dt.displayName="CDivider";_t();P();var oh={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"},rh={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},L=eo.forwardRef(({variant:t="body1",component:o,muted:r=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:l,className:d,children:p,...m},f)=>{let h=o??rh[t]??"span",v=[t==="inherit"?void 0:oh[t],d].filter(Boolean).join(" "),y=Ue([{...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 e(h,{ref:f,className:y.className,style:y.style,...m,children:p})});L.displayName="CTypography";_t();P();var ah=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},se=eo.forwardRef(({direction:t="column",spacing:o,alignItems:r,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:l,className:d,children:p,...m},f)=>{let h=Ue([{display:"flex",flexDirection:t,gap:ah(o),alignItems:r,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(l)?l:l?[l]:[]],d);return e("div",{ref:f,className:h.className,style:h.style,...m,children:p})});se.displayName="CStack";_t();P();var Lt=({open:t,onClose:o,title:r,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:l=false,PaperProps:d,slotProps:p,disableRestoreFocus:m,keepMounted:f,hideCloseButton:h=false,sx:u,className:v})=>{let y=Ue([{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?.sx??p?.paper?.sx)?d?.sx??p?.paper?.sx:d?.sx??p?.paper?.sx?[d?.sx??p?.paper?.sx]:[],...Array.isArray(u)?u:u?[u]:[]],`orb-dialog ${v??""}`);return e(ko__namespace.Root,{open:t,onOpenChange:g=>{g||o?.();},children:c(ko__namespace.Portal,{children:[e(ko__namespace.Overlay,{className:"orb-overlay"}),c(ko__namespace.Content,{className:y.className,style:y.style,children:[(r||!h)&&c("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[r?e(ko__namespace.Title,{className:"orb-dialog-title",children:r}):e(ko__namespace.Title,{className:"orb-visually-hidden",children:"Dialog"}),!h&&e(ko__namespace.Close,{asChild:true,children:e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Close",style:{marginTop:-4,marginRight:-4},children:e(qt,{size:16,strokeWidth:2})})})]}),e("div",{style:{minWidth:0},children:n}),a&&e("div",{className:"orb-dialog-actions",children:a})]})]})})};P();var Xs=({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})=>c(yr__namespace.Root,{open:t,defaultOpen:o,onOpenChange:r,children:[e(yr__namespace.Trigger,{asChild:true,children:n}),e(yr__namespace.Portal,{children:e(yr__namespace.Content,{className:`orb-pop ${m??""}`,align:i,side:s,sideOffset:l,style:{minWidth:d?"var(--radix-popover-trigger-width)":void 0,...p},onOpenAutoFocus:f=>f.preventDefault(),children:a})})]});P();var lh=({items:t,value:o,defaultValue:r,onChange:n,sx:a,className:i})=>{let s=o!==void 0,[l,d]=eo.useState(r??t[0]?.value),p=s?o:l,m=eo.useRef([]),f=u=>{s||d(u),n?.(u);},h=u=>{if(u.key!=="ArrowRight"&&u.key!=="ArrowLeft")return;u.preventDefault();let v=t.filter(b=>!b.disabled),y=v.findIndex(b=>b.value===p),g=u.key==="ArrowRight"?1:-1,x=v[(y+g+v.length)%v.length];if(x){f(x.value);let b=t.findIndex(C=>C.value===x.value);m.current[b]?.focus();}};return e("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:h,children:t.map((u,v)=>{let y=u.value===p;return c("button",{ref:g=>{m.current[v]=g;},type:"button",role:"tab","aria-selected":y,disabled:u.disabled,className:`orb-tab ${y?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>f(u.value),children:[u.icon,u.label]},u.value)})})};P();var dh=["su","mo","tu","we","th","fr","sa"],Un=(t,o)=>!!(t&&o&&t.isSame(o,"day")),Kn=({value:t,rangeStart:o,rangeEnd:r,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:l,maxDate:d,locale:p,renderDay:m})=>{let f=a!==void 0,[h,u]=eo.useState(()=>i??t??o??ar__default.default()),v=(f?a:h).startOf("month"),y=S=>{f||u(S),s?.(S);},g=eo.useMemo(()=>p?v.locale(p):v,[v,p]),x=eo.useMemo(()=>{let T=v.startOf("month").startOf("week"),I=[],w=T;for(let M=0;M<6;M+=1){let A=[];for(let R=0;R<7;R+=1)A.push(w),w=w.add(1,"day");if(I.push(A),w.isAfter(v.endOf("month"))&&M>=3)break}return I},[v]),b=eo.useMemo(()=>{let S=p?ar__default.default().locale(p):ar__default.default();return dh.map((T,I)=>S.startOf("week").add(I,"day").format("dd"))},[p]),C=S=>!!(l&&S.isBefore(l.startOf("day"))||d&&S.isAfter(d.startOf("day"))),k=o!==void 0||r!==void 0;return c("div",{className:"orb-cal",children:[c("div",{className:"orb-cal-head",children:[e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>y(v.subtract(1,"month")),children:e(Aa,{size:16,strokeWidth:2})}),e("span",{className:"orb-cal-title","aria-live":"polite",children:g.format("MMMM YYYY")}),e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>y(v.add(1,"month")),children:e(zo,{size:16,strokeWidth:2})})]}),c("div",{className:"orb-cal-grid",role:"grid",children:[b.map((S,T)=>e("span",{className:"orb-cal-dow",children:S},`${S}-${T}`)),x.flat().map(S=>{let T=!S.isSame(v,"month"),I=C(S),w=k?Un(S,o)||Un(S,r):Un(S,t),M=S.isSame(ar__default.default(),"day"),A=k&&o&&r&&S.isAfter(o.startOf("day"))&&S.isBefore(r.startOf("day")),R=k&&Un(S,o)&&!!r,D=k&&Un(S,r)&&!!o,E=["orb-cal-day",T?"orb-is-outside":void 0,M?"orb-is-today":void 0,w?"orb-is-selected":void 0,A?"orb-is-in-range":void 0,R?"orb-is-range-start":void 0,D?"orb-is-range-end":void 0].filter(Boolean).join(" ");return m?e("span",{className:"orb-cal-day-slot",children:m(S,{outsideCurrentMonth:T,selected:w,today:M,disabled:I})},S.format("YYYY-MM-DD")):e("button",{type:"button",role:"gridcell","aria-selected":w,"aria-current":M?"date":void 0,className:E,disabled:I,onClick:()=>n?.(S),children:S.date()},S.format("YYYY-MM-DD"))})]})]})};P();ar__default.default.extend(ph__default.default);var uh=({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:f,helperText:h,sx:u,className:v})=>{let y=o!==void 0,[g,x]=eo.useState(r??null),b=y?o:g,[C,k]=eo.useState(false),[S,T]=eo.useState(null),I=D=>{y||x(D),n?.(D);},w=S??(b?(p?b.locale(p):b).format(l):""),M=()=>{if(S===null)return;let D=S.trim();if(!D)I(null);else {let E=ar__default.default(D,l,true);E.isValid()&&!(a&&E.isBefore(a.startOf("day")))&&!(i&&E.isAfter(i.startOf("day")))&&I(E);}T(null);},R=(typeof f=="string"?f:void 0)??h;return c("div",{className:`orb-fld ${f?"orb-is-error":""} ${v??""}`,style:u,children:[t&&e("label",{children:t}),e(Xs,{open:C,onOpenChange:k,trigger:c("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[e("span",{className:"orb-inp-adornment",children:e(Gs,{size:15,strokeWidth:1.8})}),e("input",{className:`orb-inp ${m?"orb-inp-dense":""}`,value:w,placeholder:d??l,disabled:s,onFocus:()=>k(true),onChange:D=>T(D.target.value),onBlur:M,onKeyDown:D=>{D.key==="Enter"&&(M(),k(false)),D.key==="Escape"&&k(false);}})]}),children:e(Kn,{value:b,onChange:D=>{I(D),T(null),k(false);},minDate:a,maxDate:i,locale:p,defaultMonth:b??void 0})}),R&&e("span",{className:"orb-fld-msg",children:R})]})};P();var gh=({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]=eo.useState(false),[p,m]=eo.useState([]),f=eo.useRef(null),h=b=>{b.preventDefault(),d(true);},u=b=>{b.preventDefault(),d(false);},v=b=>{b.preventDefault(),d(false),g(Array.from(b.dataTransfer.files));},y=b=>{b.target.files&&g(Array.from(b.target.files));},g=b=>{let C=n?b.filter(S=>S.size<=n):b;C.length<b.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let k=o?[...p,...C]:C;o&&(k=k.filter((S,T,I)=>T===I.findIndex(w=>w.name===S.name&&w.size===S.size&&w.lastModified===S.lastModified))),m(k),t?.(k),f.current&&(f.current.value="");},x=b=>{let C=p.filter((k,S)=>S!==b);m(C),t?.(C);};return c("div",{style:{width:"100%",...s},children:[c("div",{onClick:()=>f.current?.click(),onDragOver:h,onDragLeave:u,onDrop:v,role:"button",tabIndex:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f.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:[e("input",{type:"file",ref:f,style:{display:"none"},multiple:o,accept:r,onChange:y}),c("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[e(ld,{size:40,strokeWidth:1.5,color:l?"var(--orb-primary)":"var(--orb-muted)"}),e("span",{className:"orb-subtitle",children:a}),e("span",{className:"orb-meta",children:i})]})]}),p.length>0&&e("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:p.map((b,C)=>c("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:[c("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[e(_c,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),e("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.name}),c("span",{className:"orb-meta",children:["(",(b.size/1024).toFixed(1)," KB)"]})]}),e(ie,{"aria-label":`Remove ${b.name}`,onClick:()=>x(C),children:e(id,{size:15,strokeWidth:1.8})})]},`${b.name}-${C}`))})]})};function vo(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var Xa={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"},qn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},md=()=>"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";P();var yh=classVarianceAuthority.cva(md(),{variants:{variant:{default:`${Xa.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${Xa.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:Xa.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:qn.none,sm:qn.sm,md:qn.md,full:qn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),js=eo__namespace.forwardRef(({className:t,variant:o,size:r,asChild:n=false,...a},i)=>e(n?reactSlot.Slot:"button",{className:vo(yh({variant:o,size:r,className:t})),ref:i,...a}));js.displayName="Button";var Ch={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.searchAddFeature":"Add feature","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.searchOpenPanel":"Open conversation","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.refresh":"Refresh","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","navigation.pinned":"Pinned","navigation.pin.add":"Pin to top","navigation.pin.remove":"Unpin","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.bucket.add":"Add bucket","kanban.bucket.rename":"Rename bucket","kanban.bucket.saveRename":"Save bucket name","kanban.bucket.cancelRename":"Cancel renaming","kanban.search.placeholder":"Search cards and buckets","kanban.search.clear":"Clear search","kanban.search.results":"{count} matching cards","kanban.search.noMatch":"No matching cards","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","cardPage.viewDetails":"View Details","cardPage.download":"Download","cardPage.close":"Close","cardPage.empty":"No items found","messageBox.confirm":"OK","messageBox.cancel":"Cancel","omph.status.idle":"Idle","omph.status.pending":"Pending","omph.status.running":"Working","omph.status.success":"Success","omph.status.error":"Error","omph.working":"Working","omph.workingFor":"Working for {duration}","omph.loadOlder":"Load earlier","omph.loadingOlder":"Loading earlier\u2026","omph.toBottom":"Back to bottom","omph.copy":"Copy","omph.copied":"Copied","omph.turnActions":"Reply actions","omph.usage":"Usage","omph.inputTokens":"Input","omph.outputTokens":"Output","omph.duration":"Duration","omph.send":"Send","omph.stop":"Stop","omph.turnRail":"Turns","omph.secondUnit":"s","omph.minuteUnit":"m","omph.preview.title":"File preview","omph.preview.close":"Close preview","omph.preview.back":"Back to conversation","omph.preview.expand":"Expand preview","omph.preview.collapse":"Restore preview size","omph.preview.copyContent":"Copy content","omph.preview.copyPath":"Copy path","omph.preview.download":"Download","omph.preview.openExternal":"Open externally","omph.preview.wrap":"Wrap","omph.preview.loading":"Loading file","omph.preview.missing":"File not found","omph.preview.failed":"Could not load this file","omph.preview.unsupported":"No preview for this file type","omph.preview.retry":"Try again","omph.preview.resize":"Resize preview","omph.preview.line":"Line {start}","omph.preview.lines":"Lines {start}\u2013{end}","omph.preview.truncated":"Showing the first {shown} of {total} lines","omph.preview.imageFailed":"The image could not be displayed","omph.preview.zoomIn":"Zoom in","omph.preview.zoomOut":"Zoom out","omph.preview.zoomFit":"Fit to width","omph.newConversation":"New conversation","omph.conversationList":"Conversation list","omph.conversations":"Conversations","omph.noConversations":"No conversations yet","omph.approval.waiting":"Waiting for approval","omph.approval.choose":"Choose an action","omph.approval.details":"Approval details","omph.approval.choices":"Actions","omph.approval.reject":"Reject","omph.approval.allowOnce":"Allow once","omph.approval.confirm":"Continue","omph.approval.other":"Other","omph.approval.otherPlaceholder":"Describe the action to take","omph.approval.escalation":"Tool {toolName} requests privileged execution","omph.input.placeholder":"Type a message...","omph.input.upload":"Upload file","omph.input.send":"Send message","omph.input.stop":"Stop generating","omph.input.message":"Message input","omph.input.tools":"Input tools","agentui.html.defaultTitle":"Interactive HTML","agentui.html.open":"Open","agentui.html.preview":"Preview","agentui.html.code":"Code","agentui.html.toggle":"Switch between code and preview","agentui.html.copy":"Copy code","agentui.html.copied":"Copied","agentui.html.download":"Download","agentui.html.close":"Close"},xh={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.searchOpenPanel":"\u6253\u5F00\u5BF9\u8BDD","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.refresh":"\u5237\u65B0","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","navigation.pinned":"\u5DF2\u56FA\u5B9A","navigation.pin.add":"\u56FA\u5B9A\u5230\u9876\u90E8","navigation.pin.remove":"\u53D6\u6D88\u56FA\u5B9A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.bucket.add":"\u65B0\u589E bucket","kanban.bucket.rename":"\u91CD\u547D\u540D bucket","kanban.bucket.saveRename":"\u4FDD\u5B58 bucket \u540D\u79F0","kanban.bucket.cancelRename":"\u53D6\u6D88\u91CD\u547D\u540D","kanban.search.placeholder":"\u641C\u7D22\u5361\u7247\u548C bucket","kanban.search.clear":"\u6E05\u9664\u641C\u7D22","kanban.search.results":"{count} \u5F20\u5339\u914D\u5361\u7247","kanban.search.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u5361\u7247","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","cardPage.viewDetails":"\u67E5\u770B\u8BE6\u60C5","cardPage.download":"\u4E0B\u8F7D","cardPage.close":"\u5173\u95ED","cardPage.empty":"\u672A\u627E\u5230\u6761\u76EE","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88","omph.status.idle":"\u7A7A\u95F2","omph.status.pending":"\u7B49\u5F85\u4E2D","omph.status.running":"\u5904\u7406\u4E2D","omph.status.success":"\u5DF2\u5B8C\u6210","omph.status.error":"\u51FA\u9519","omph.working":"\u5904\u7406\u4E2D","omph.workingFor":"\u5DF2\u5904\u7406 {duration}","omph.loadOlder":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","omph.loadingOlder":"\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F\u2026","omph.toBottom":"\u56DE\u5230\u5E95\u90E8","omph.copy":"\u590D\u5236","omph.copied":"\u5DF2\u590D\u5236","omph.turnActions":"\u56DE\u590D\u64CD\u4F5C","omph.usage":"\u7528\u91CF","omph.inputTokens":"\u8F93\u5165","omph.outputTokens":"\u8F93\u51FA","omph.duration":"\u7528\u65F6","omph.send":"\u53D1\u9001","omph.stop":"\u505C\u6B62","omph.turnRail":"\u8F6E\u6B21","omph.secondUnit":"\u79D2","omph.minuteUnit":"\u5206","omph.preview.title":"\u6587\u4EF6\u9884\u89C8","omph.preview.close":"\u5173\u95ED\u9884\u89C8","omph.preview.back":"\u8FD4\u56DE\u5BF9\u8BDD","omph.preview.expand":"\u5C55\u5F00\u9884\u89C8","omph.preview.collapse":"\u8FD8\u539F\u9884\u89C8\u5927\u5C0F","omph.preview.copyContent":"\u590D\u5236\u5185\u5BB9","omph.preview.copyPath":"\u590D\u5236\u8DEF\u5F84","omph.preview.download":"\u4E0B\u8F7D","omph.preview.openExternal":"\u5728\u5916\u90E8\u6253\u5F00","omph.preview.wrap":"\u81EA\u52A8\u6362\u884C","omph.preview.loading":"\u6B63\u5728\u52A0\u8F7D\u6587\u4EF6","omph.preview.missing":"\u6587\u4EF6\u4E0D\u5B58\u5728","omph.preview.failed":"\u65E0\u6CD5\u52A0\u8F7D\u6B64\u6587\u4EF6","omph.preview.unsupported":"\u6B64\u6587\u4EF6\u7C7B\u578B\u4E0D\u652F\u6301\u9884\u89C8","omph.preview.retry":"\u91CD\u8BD5","omph.preview.resize":"\u8C03\u6574\u9884\u89C8\u5927\u5C0F","omph.preview.line":"\u7B2C {start} \u884C","omph.preview.lines":"\u7B2C {start}\u2013{end} \u884C","omph.preview.truncated":"\u5171 {total} \u884C\uFF0C\u4EC5\u663E\u793A\u524D {shown} \u884C","omph.preview.imageFailed":"\u56FE\u7247\u65E0\u6CD5\u663E\u793A","omph.preview.zoomIn":"\u653E\u5927","omph.preview.zoomOut":"\u7F29\u5C0F","omph.preview.zoomFit":"\u9002\u5E94\u5BBD\u5EA6","omph.newConversation":"\u65B0\u5EFA\u4F1A\u8BDD","omph.conversationList":"\u4F1A\u8BDD\u5217\u8868","omph.conversations":"\u4F1A\u8BDD","omph.noConversations":"\u8FD8\u6CA1\u6709\u4F1A\u8BDD","omph.approval.waiting":"\u7B49\u5F85\u5BA1\u6279","omph.approval.choose":"\u8BF7\u9009\u62E9\u64CD\u4F5C","omph.approval.details":"\u5BA1\u6279\u8BE6\u60C5","omph.approval.choices":"\u53EF\u9009\u64CD\u4F5C","omph.approval.reject":"\u62D2\u7EDD","omph.approval.allowOnce":"\u4EC5\u6B64\u4E00\u6B21","omph.approval.confirm":"\u7EE7\u7EED","omph.approval.other":"\u5176\u4ED6","omph.approval.otherPlaceholder":"\u63CF\u8FF0\u8981\u6267\u884C\u7684\u64CD\u4F5C","omph.approval.escalation":"\u5DE5\u5177 {toolName} \u8BF7\u6C42\u7279\u6743\u6267\u884C","omph.input.placeholder":"\u8F93\u5165\u6D88\u606F\u2026","omph.input.upload":"\u4E0A\u4F20\u6587\u4EF6","omph.input.send":"\u53D1\u9001\u6D88\u606F","omph.input.stop":"\u505C\u6B62\u751F\u6210","omph.input.message":"\u6D88\u606F\u8F93\u5165","omph.input.tools":"\u8F93\u5165\u5DE5\u5177","agentui.html.defaultTitle":"\u4EA4\u4E92\u5F0F HTML","agentui.html.open":"\u6253\u5F00","agentui.html.preview":"\u9884\u89C8","agentui.html.code":"\u4EE3\u7801","agentui.html.toggle":"\u5207\u6362\u4EE3\u7801\u4E0E\u9884\u89C8","agentui.html.copy":"\u590D\u5236\u4EE3\u7801","agentui.html.copied":"\u5DF2\u590D\u5236","agentui.html.download":"\u4E0B\u8F7D","agentui.html.close":"\u5173\u95ED"},wh={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.searchOpenPanel":"Ouvrir la conversation","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.refresh":"Actualiser","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","navigation.pinned":"\xC9pingl\xE9s","navigation.pin.add":"\xC9pingler en haut","navigation.pin.remove":"D\xE9s\xE9pingler","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.bucket.add":"Ajouter une colonne","kanban.bucket.rename":"Renommer la colonne","kanban.bucket.saveRename":"Enregistrer le nom","kanban.bucket.cancelRename":"Annuler le renommage","kanban.search.placeholder":"Rechercher des cartes et colonnes","kanban.search.clear":"Effacer la recherche","kanban.search.results":"{count} cartes correspondantes","kanban.search.noMatch":"Aucune carte correspondante","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","cardPage.viewDetails":"Voir les d\xE9tails","cardPage.download":"T\xE9l\xE9charger","cardPage.close":"Fermer","cardPage.empty":"Aucun \xE9l\xE9ment trouv\xE9","messageBox.confirm":"OK","messageBox.cancel":"Annuler","omph.status.idle":"Inactif","omph.status.pending":"En attente","omph.status.running":"En cours","omph.status.success":"Termin\xE9","omph.status.error":"Erreur","omph.working":"En cours","omph.workingFor":"En cours depuis {duration}","omph.loadOlder":"Charger les messages pr\xE9c\xE9dents","omph.loadingOlder":"Chargement des messages pr\xE9c\xE9dents\u2026","omph.toBottom":"Revenir en bas","omph.copy":"Copier","omph.copied":"Copi\xE9","omph.turnActions":"Actions de r\xE9ponse","omph.usage":"Utilisation","omph.inputTokens":"Entr\xE9e","omph.outputTokens":"Sortie","omph.duration":"Dur\xE9e","omph.send":"Envoyer","omph.stop":"Arr\xEAter","omph.turnRail":"Tours","omph.secondUnit":"s","omph.minuteUnit":"min","omph.preview.title":"Aper\xE7u du fichier","omph.preview.close":"Fermer l'aper\xE7u","omph.preview.back":"Retour \xE0 la conversation","omph.preview.expand":"Agrandir l\u2019aper\xE7u","omph.preview.collapse":"R\xE9duire l\u2019aper\xE7u","omph.preview.copyContent":"Copier le contenu","omph.preview.copyPath":"Copier le chemin","omph.preview.download":"T\xE9l\xE9charger","omph.preview.openExternal":"Ouvrir \xE0 l\u2019ext\xE9rieur","omph.preview.wrap":"Retour \xE0 la ligne","omph.preview.loading":"Chargement du fichier","omph.preview.missing":"Fichier introuvable","omph.preview.failed":"Impossible de charger ce fichier","omph.preview.unsupported":"Aucun aper\xE7u pour ce type de fichier","omph.preview.retry":"R\xE9essayer","omph.preview.resize":"Redimensionner l\u2019aper\xE7u","omph.preview.line":"Ligne {start}","omph.preview.lines":"Lignes {start}\u2013{end}","omph.preview.truncated":"Affichage des {shown} premi\xE8res lignes sur {total}","omph.preview.imageFailed":"Impossible d'afficher l'image","omph.preview.zoomIn":"Zoom avant","omph.preview.zoomOut":"Zoom arri\xE8re","omph.preview.zoomFit":"Ajuster \xE0 la largeur","omph.newConversation":"Nouvelle conversation","omph.conversationList":"Liste des conversations","omph.conversations":"Conversations","omph.noConversations":"Aucune conversation","omph.approval.waiting":"En attente d'approbation","omph.approval.choose":"Choisir une action","omph.approval.details":"D\xE9tails de l'approbation","omph.approval.choices":"Actions","omph.approval.reject":"Refuser","omph.approval.allowOnce":"Autoriser une fois","omph.approval.confirm":"Continuer","omph.approval.other":"Autre","omph.approval.otherPlaceholder":"D\xE9crire l'action \xE0 effectuer","omph.approval.escalation":"L'outil {toolName} demande une ex\xE9cution privil\xE9gi\xE9e","omph.input.placeholder":"Saisir un message\u2026","omph.input.upload":"T\xE9l\xE9verser un fichier","omph.input.send":"Envoyer le message","omph.input.stop":"Arr\xEAter la g\xE9n\xE9ration","omph.input.message":"Saisie de message","omph.input.tools":"Outils de saisie","agentui.html.defaultTitle":"HTML interactif","agentui.html.open":"Ouvrir","agentui.html.preview":"Aper\xE7u","agentui.html.code":"Code","agentui.html.toggle":"Basculer entre code et aper\xE7u","agentui.html.copy":"Copier le code","agentui.html.copied":"Copi\xE9","agentui.html.download":"T\xE9l\xE9charger","agentui.html.close":"Fermer"},Sh={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.searchOpenPanel":"Unterhaltung \xF6ffnen","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.refresh":"Aktualisieren","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","navigation.pinned":"Angeheftet","navigation.pin.add":"Oben anheften","navigation.pin.remove":"L\xF6sen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.bucket.add":"Spalte hinzuf\xFCgen","kanban.bucket.rename":"Spalte umbenennen","kanban.bucket.saveRename":"Spaltennamen speichern","kanban.bucket.cancelRename":"Umbenennen abbrechen","kanban.search.placeholder":"Karten und Spalten durchsuchen","kanban.search.clear":"Suche l\xF6schen","kanban.search.results":"{count} passende Karten","kanban.search.noMatch":"Keine passenden Karten","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","cardPage.viewDetails":"Details anzeigen","cardPage.download":"Herunterladen","cardPage.close":"Schlie\xDFen","cardPage.empty":"Keine Eintr\xE4ge gefunden","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen","omph.status.idle":"Inaktiv","omph.status.pending":"Ausstehend","omph.status.running":"L\xE4uft","omph.status.success":"Erfolgt","omph.status.error":"Fehler","omph.working":"In Arbeit","omph.workingFor":"In Arbeit seit {duration}","omph.loadOlder":"Fr\xFChere Nachrichten laden","omph.loadingOlder":"Fr\xFChere Nachrichten werden geladen\u2026","omph.toBottom":"Nach unten","omph.copy":"Kopieren","omph.copied":"Kopiert","omph.turnActions":"Antwortaktionen","omph.usage":"Nutzung","omph.inputTokens":"Eingabe","omph.outputTokens":"Ausgabe","omph.duration":"Dauer","omph.send":"Senden","omph.stop":"Stoppen","omph.turnRail":"Runden","omph.secondUnit":"s","omph.minuteUnit":"min","omph.preview.title":"Dateivorschau","omph.preview.close":"Vorschau schlie\xDFen","omph.preview.back":"Zur\xFCck zur Konversation","omph.preview.expand":"Vorschau vergr\xF6\xDFern","omph.preview.collapse":"Vorschau wiederherstellen","omph.preview.copyContent":"Inhalt kopieren","omph.preview.copyPath":"Pfad kopieren","omph.preview.download":"Herunterladen","omph.preview.openExternal":"Extern \xF6ffnen","omph.preview.wrap":"Zeilenumbruch","omph.preview.loading":"Datei wird geladen","omph.preview.missing":"Datei nicht gefunden","omph.preview.failed":"Datei konnte nicht geladen werden","omph.preview.unsupported":"Keine Vorschau f\xFCr diesen Dateityp","omph.preview.retry":"Erneut versuchen","omph.preview.resize":"Vorschaugr\xF6\xDFe \xE4ndern","omph.preview.line":"Zeile {start}","omph.preview.lines":"Zeilen {start}\u2013{end}","omph.preview.truncated":"Die ersten {shown} von {total} Zeilen werden angezeigt","omph.preview.imageFailed":"Bild konnte nicht angezeigt werden","omph.preview.zoomIn":"Vergr\xF6\xDFern","omph.preview.zoomOut":"Verkleinern","omph.preview.zoomFit":"An Breite anpassen","omph.newConversation":"Neue Konversation","omph.conversationList":"Konversationsliste","omph.conversations":"Konversationen","omph.noConversations":"Noch keine Konversationen","omph.approval.waiting":"Auf Genehmigung wartend","omph.approval.choose":"Aktion w\xE4hlen","omph.approval.details":"Genehmigungsdetails","omph.approval.choices":"Aktionen","omph.approval.reject":"Ablehnen","omph.approval.allowOnce":"Einmal erlauben","omph.approval.confirm":"Fortfahren","omph.approval.other":"Sonstiges","omph.approval.otherPlaceholder":"Aktion beschreiben","omph.approval.escalation":"Tool {toolName} fordert privilegierte Ausf\xFChrung","omph.input.placeholder":"Nachricht eingeben\u2026","omph.input.upload":"Datei hochladen","omph.input.send":"Nachricht senden","omph.input.stop":"Generierung stoppen","omph.input.message":"Nachrichteneingabe","omph.input.tools":"Eingabewerkzeuge","agentui.html.defaultTitle":"Interaktives HTML","agentui.html.open":"\xD6ffnen","agentui.html.preview":"Vorschau","agentui.html.code":"Code","agentui.html.toggle":"Zwischen Code und Vorschau wechseln","agentui.html.copy":"Code kopieren","agentui.html.copied":"Kopiert","agentui.html.download":"Herunterladen","agentui.html.close":"Schlie\xDFen"},kh={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.searchOpenPanel":"\u4F1A\u8A71\u3092\u958B\u304F","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.refresh":"\u518D\u8AAD\u307F\u8FBC\u307F","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.pinned":"\u30D4\u30F3\u7559\u3081","navigation.pin.add":"\u4E0A\u90E8\u306B\u30D4\u30F3\u7559\u3081","navigation.pin.remove":"\u30D4\u30F3\u7559\u3081\u3092\u89E3\u9664","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.bucket.add":"bucket \u3092\u8FFD\u52A0","kanban.bucket.rename":"bucket \u540D\u3092\u5909\u66F4","kanban.bucket.saveRename":"bucket \u540D\u3092\u4FDD\u5B58","kanban.bucket.cancelRename":"\u540D\u524D\u5909\u66F4\u3092\u30AD\u30E3\u30F3\u30BB\u30EB","kanban.search.placeholder":"\u30AB\u30FC\u30C9\u3068 bucket \u3092\u691C\u7D22","kanban.search.clear":"\u691C\u7D22\u3092\u30AF\u30EA\u30A2","kanban.search.results":"{count} \u4EF6\u306E\u30AB\u30FC\u30C9\u304C\u4E00\u81F4","kanban.search.noMatch":"\u4E00\u81F4\u3059\u308B\u30AB\u30FC\u30C9\u306F\u3042\u308A\u307E\u305B\u3093","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","cardPage.viewDetails":"\u8A73\u7D30\u3092\u8868\u793A","cardPage.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","cardPage.close":"\u9589\u3058\u308B","cardPage.empty":"\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","omph.status.idle":"\u5F85\u6A5F\u4E2D","omph.status.pending":"\u51E6\u7406\u5F85\u3061","omph.status.running":"\u51E6\u7406\u4E2D","omph.status.success":"\u5B8C\u4E86","omph.status.error":"\u30A8\u30E9\u30FC","omph.working":"\u51E6\u7406\u4E2D","omph.workingFor":"\u51E6\u7406\u4E2D\uFF08{duration} \u7D4C\u904E\uFF09","omph.loadOlder":"\u904E\u53BB\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8AAD\u307F\u8FBC\u3080","omph.loadingOlder":"\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026","omph.toBottom":"\u4E00\u756A\u4E0B\u3078","omph.copy":"\u30B3\u30D4\u30FC","omph.copied":"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F","omph.turnActions":"\u8FD4\u4FE1\u30A2\u30AF\u30B7\u30E7\u30F3","omph.usage":"\u4F7F\u7528\u91CF","omph.inputTokens":"\u5165\u529B","omph.outputTokens":"\u51FA\u529B","omph.duration":"\u6240\u8981\u6642\u9593","omph.send":"\u9001\u4FE1","omph.stop":"\u505C\u6B62","omph.turnRail":"\u30BF\u30FC\u30F3","omph.secondUnit":"\u79D2","omph.minuteUnit":"\u5206","omph.preview.title":"\u30D5\u30A1\u30A4\u30EB\u30D7\u30EC\u30D3\u30E5\u30FC","omph.preview.close":"\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u9589\u3058\u308B","omph.preview.back":"\u4F1A\u8A71\u306B\u623B\u308B","omph.preview.expand":"\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u62E1\u5927","omph.preview.collapse":"\u30D7\u30EC\u30D3\u30E5\u30FC\u306E\u30B5\u30A4\u30BA\u3092\u623B\u3059","omph.preview.copyContent":"\u5185\u5BB9\u3092\u30B3\u30D4\u30FC","omph.preview.copyPath":"\u30D1\u30B9\u3092\u30B3\u30D4\u30FC","omph.preview.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","omph.preview.openExternal":"\u5916\u90E8\u3067\u958B\u304F","omph.preview.wrap":"\u6298\u308A\u8FD4\u3057","omph.preview.loading":"\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D","omph.preview.missing":"\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","omph.preview.failed":"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F","omph.preview.unsupported":"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u306F\u30D7\u30EC\u30D3\u30E5\u30FC\u3067\u304D\u307E\u305B\u3093","omph.preview.retry":"\u518D\u8A66\u884C","omph.preview.resize":"\u30D7\u30EC\u30D3\u30E5\u30FC\u30B5\u30A4\u30BA\u306E\u5909\u66F4","omph.preview.line":"{start} \u884C\u76EE","omph.preview.lines":"{start}\u2013{end} \u884C","omph.preview.truncated":"\u5168 {total} \u884C\u4E2D\u5148\u982D {shown} \u884C\u3092\u8868\u793A","omph.preview.imageFailed":"\u753B\u50CF\u3092\u8868\u793A\u3067\u304D\u307E\u305B\u3093","omph.preview.zoomIn":"\u62E1\u5927","omph.preview.zoomOut":"\u7E2E\u5C0F","omph.preview.zoomFit":"\u5E45\u306B\u5408\u308F\u305B\u308B","omph.newConversation":"\u65B0\u3057\u3044\u4F1A\u8A71","omph.conversationList":"\u4F1A\u8A71\u30EA\u30B9\u30C8","omph.conversations":"\u4F1A\u8A71","omph.noConversations":"\u4F1A\u8A71\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093","omph.approval.waiting":"\u627F\u8A8D\u5F85\u3061","omph.approval.choose":"\u64CD\u4F5C\u3092\u9078\u629E","omph.approval.details":"\u627F\u8A8D\u306E\u8A73\u7D30","omph.approval.choices":"\u64CD\u4F5C","omph.approval.reject":"\u62D2\u5426","omph.approval.allowOnce":"\u4ECA\u56DE\u306E\u307F\u8A31\u53EF","omph.approval.confirm":"\u7D9A\u884C","omph.approval.other":"\u305D\u306E\u4ED6","omph.approval.otherPlaceholder":"\u5B9F\u884C\u3059\u308B\u64CD\u4F5C\u3092\u5165\u529B","omph.approval.escalation":"\u30C4\u30FC\u30EB {toolName} \u304C\u7279\u6A29\u5B9F\u884C\u3092\u8981\u6C42\u3057\u3066\u3044\u307E\u3059","omph.input.placeholder":"\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u5165\u529B\u2026","omph.input.upload":"\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9","omph.input.send":"\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u9001\u4FE1","omph.input.stop":"\u751F\u6210\u3092\u505C\u6B62","omph.input.message":"\u30E1\u30C3\u30BB\u30FC\u30B8\u5165\u529B","omph.input.tools":"\u5165\u529B\u30C4\u30FC\u30EB","agentui.html.defaultTitle":"\u30A4\u30F3\u30BF\u30E9\u30AF\u30C6\u30A3\u30D6 HTML","agentui.html.open":"\u958B\u304F","agentui.html.preview":"\u30D7\u30EC\u30D3\u30E5\u30FC","agentui.html.code":"\u30B3\u30FC\u30C9","agentui.html.toggle":"\u30B3\u30FC\u30C9\u3068\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u5207\u308A\u66FF\u3048\u308B","agentui.html.copy":"\u30B3\u30FC\u30C9\u3092\u30B3\u30D4\u30FC","agentui.html.copied":"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F","agentui.html.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","agentui.html.close":"\u9589\u3058\u308B"},Ph={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.searchOpenPanel":"\uB300\uD654 \uC5F4\uAE30","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.refresh":"\uC0C8\uB85C \uACE0\uCE68","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.pinned":"\uACE0\uC815\uB428","navigation.pin.add":"\uC0C1\uB2E8\uC5D0 \uACE0\uC815","navigation.pin.remove":"\uACE0\uC815 \uD574\uC81C","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.bucket.add":"\uBC84\uD0B7 \uCD94\uAC00","kanban.bucket.rename":"\uBC84\uD0B7 \uC774\uB984 \uBCC0\uACBD","kanban.bucket.saveRename":"\uBC84\uD0B7 \uC774\uB984 \uC800\uC7A5","kanban.bucket.cancelRename":"\uC774\uB984 \uBCC0\uACBD \uCDE8\uC18C","kanban.search.placeholder":"\uCE74\uB4DC \uBC0F \uBC84\uD0B7 \uAC80\uC0C9","kanban.search.clear":"\uAC80\uC0C9 \uC9C0\uC6B0\uAE30","kanban.search.results":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC {count}\uAC1C","kanban.search.noMatch":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","cardPage.viewDetails":"\uC0C1\uC138 \uBCF4\uAE30","cardPage.download":"\uB2E4\uC6B4\uB85C\uB4DC","cardPage.close":"\uB2EB\uAE30","cardPage.empty":"\uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C","omph.status.idle":"\uB300\uAE30","omph.status.pending":"\uB300\uAE30 \uC911","omph.status.running":"\uCC98\uB9AC \uC911","omph.status.success":"\uC644\uB8CC","omph.status.error":"\uC624\uB958","omph.working":"\uCC98\uB9AC \uC911","omph.workingFor":"\uCC98\uB9AC \uC911 {duration} \uACBD\uACFC","omph.loadOlder":"\uC774\uC804 \uBA54\uC2DC\uC9C0 \uBD88\uB7EC\uC624\uAE30","omph.loadingOlder":"\uBD88\uB7EC\uC624\uB294 \uC911\u2026","omph.toBottom":"\uB9E8 \uC544\uB798\uB85C","omph.copy":"\uBCF5\uC0AC","omph.copied":"\uBCF5\uC0AC\uB428","omph.turnActions":"\uC751\uB2F5 \uC791\uC5C5","omph.usage":"\uC0AC\uC6A9\uB7C9","omph.inputTokens":"\uC785\uB825","omph.outputTokens":"\uCD9C\uB825","omph.duration":"\uC18C\uC694 \uC2DC\uAC04","omph.send":"\uBCF4\uB0B4\uAE30","omph.stop":"\uC911\uC9C0","omph.turnRail":"\uD134","omph.secondUnit":"\uCD08","omph.minuteUnit":"\uBD84","omph.preview.title":"\uD30C\uC77C \uBBF8\uB9AC\uBCF4\uAE30","omph.preview.close":"\uBBF8\uB9AC\uBCF4\uAE30 \uB2EB\uAE30","omph.preview.back":"\uB300\uD654\uB85C \uB3CC\uC544\uAC00\uAE30","omph.preview.expand":"\uBBF8\uB9AC\uBCF4\uAE30 \uD655\uB300","omph.preview.collapse":"\uBBF8\uB9AC\uBCF4\uAE30 \uD06C\uAE30 \uBCF5\uC6D0","omph.preview.copyContent":"\uB0B4\uC6A9 \uBCF5\uC0AC","omph.preview.copyPath":"\uACBD\uB85C \uBCF5\uC0AC","omph.preview.download":"\uB2E4\uC6B4\uB85C\uB4DC","omph.preview.openExternal":"\uC678\uBD80\uC5D0\uC11C \uC5F4\uAE30","omph.preview.wrap":"\uC904 \uBC14\uAFC8","omph.preview.loading":"\uD30C\uC77C \uB85C\uB4DC \uC911","omph.preview.missing":"\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C","omph.preview.failed":"\uC774 \uD30C\uC77C\uC744 \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.unsupported":"\uC774 \uD30C\uC77C \uD615\uC2DD\uC740 \uBBF8\uB9AC\uBCFC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.retry":"\uB2E4\uC2DC \uC2DC\uB3C4","omph.preview.resize":"\uBBF8\uB9AC\uBCF4\uAE30 \uD06C\uAE30 \uC870\uC815","omph.preview.line":"{start}\uC904","omph.preview.lines":"{start}\u2013{end}\uC904","omph.preview.truncated":"\uC804\uCCB4 {total}\uC904 \uC911 \uCC98\uC74C {shown}\uC904 \uD45C\uC2DC","omph.preview.imageFailed":"\uC774\uBBF8\uC9C0\uB97C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.zoomIn":"\uD655\uB300","omph.preview.zoomOut":"\uCD95\uC18C","omph.preview.zoomFit":"\uB108\uBE44\uC5D0 \uB9DE\uCD94\uAE30","omph.newConversation":"\uC0C8 \uB300\uD654","omph.conversationList":"\uB300\uD654 \uBAA9\uB85D","omph.conversations":"\uB300\uD654","omph.noConversations":"\uC544\uC9C1 \uB300\uD654\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","omph.approval.waiting":"\uC2B9\uC778 \uB300\uAE30 \uC911","omph.approval.choose":"\uC791\uC5C5\uC744 \uC120\uD0DD\uD558\uC138\uC694","omph.approval.details":"\uC2B9\uC778 \uC138\uBD80 \uC815\uBCF4","omph.approval.choices":"\uC791\uC5C5","omph.approval.reject":"\uAC70\uBD80","omph.approval.allowOnce":"\uD55C \uBC88\uB9CC \uD5C8\uC6A9","omph.approval.confirm":"\uACC4\uC18D","omph.approval.other":"\uAE30\uD0C0","omph.approval.otherPlaceholder":"\uC218\uD589\uD560 \uC791\uC5C5\uC744 \uC124\uBA85\uD558\uC138\uC694","omph.approval.escalation":"\uB3C4\uAD6C {toolName}\uC774(\uAC00) \uAD8C\uD55C \uC788\uB294 \uC2E4\uD589\uC744 \uC694\uCCAD\uD569\uB2C8\uB2E4","omph.input.placeholder":"\uBA54\uC2DC\uC9C0 \uC785\uB825\u2026","omph.input.upload":"\uD30C\uC77C \uC5C5\uB85C\uB4DC","omph.input.send":"\uBA54\uC2DC\uC9C0 \uBCF4\uB0B4\uAE30","omph.input.stop":"\uC0DD\uC131 \uC911\uC9C0","omph.input.message":"\uBA54\uC2DC\uC9C0 \uC785\uB825","omph.input.tools":"\uC785\uB825 \uB3C4\uAD6C","agentui.html.defaultTitle":"\uC778\uD130\uB799\uD2F0\uBE0C HTML","agentui.html.open":"\uC5F4\uAE30","agentui.html.preview":"\uBBF8\uB9AC \uBCF4\uAE30","agentui.html.code":"\uCF54\uB4DC","agentui.html.toggle":"\uCF54\uB4DC\uC640 \uBBF8\uB9AC \uBCF4\uAE30 \uC804\uD658","agentui.html.copy":"\uCF54\uB4DC \uBCF5\uC0AC","agentui.html.copied":"\uBCF5\uC0AC\uB428","agentui.html.download":"\uB2E4\uC6B4\uB85C\uB4DC","agentui.html.close":"\uB2EB\uAE30"},Xn={en:Ch,zh:xh,fr:wh,de:Sh,ja:kh,ko:Ph};P();var fd=(t,o)=>o?t.replace(/\{(\w+)\}/g,(r,n)=>{let a=o[n];return a==null?"":String(a)}):t,Mh={locale:"en",t:(t,o)=>fd(Xn.en[t]||t,o)},hd=eo.createContext(Mh),Ya=({locale:t="en",messages:o,children:r})=>{let n=eo.useMemo(()=>{let a=Xn[t]||Xn.en,i=o?.[t]||{},s={...Xn.en,...a,...i};return {locale:t,t:(l,d)=>fd(s[l]||l,d)}},[t,o]);return e(hd.Provider,{value:n,children:r})},le=()=>eo.useContext(hd);P();function Yn({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}=le(),f=s==="dark",h=navigation.usePathname(),[u,v]=eo.useState(false),[y,g]=eo.useState(new Set),x=a!==void 0&&i!==void 0,b=x?a:y;eo.useEffect(()=>{v(true);},[]);let C=S=>{if(x)i(S);else {let T=new Set(y);T.has(S)?T.delete(S):T.add(S),g(T);}},k=S=>{S.children&&S.children.length>0&&C(S.id),o&&o(S);};return !t||!Array.isArray(t)?e("div",{className:vo("tree-menu",r),children:e("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:m("navigation.noItems")})}):e("div",{className:vo("tree-menu",r),children:t.map(S=>{let T=b.has(S.id)||S.isExpanded,I=S.children&&S.children.length>0,M=56+Math.max(0,n-1)*8,A=n===0?12:I?M-24:M,R=S.appurl||S.href,D=u&&R?h===R:false,E=d?.has(S.id)??false,O=l&&S.pinnable!==false&&!!R&&!I;return c("div",{className:"tree-menu-item relative",children:[D&&e("div",{className:vo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),c(js,{variant:"ghost",className:vo("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",I&&T&&!D?f?"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?"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?"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:`${A}px`,paddingRight:O?"34px":"10px"},onClick:()=>k(S),children:[I&&e("div",{className:vo("flex-shrink-0 transition-transform duration-200",T&&"rotate-90",D?"text-[var(--orb-nav-active-fg)]":f?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:e(zo,{className:"h-4 w-4"})}),S.icon&&e("div",{className:vo("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",D?"text-[var(--orb-nav-active-fg)]":f?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:S.icon}),c("div",{className:"flex-1 text-left overflow-hidden z-10",children:[e("div",{className:vo("text-sm truncate transition-colors duration-200",D?"font-semibold":"font-medium"),children:S.title||S.label}),S.description&&e("div",{className:vo("text-xs truncate transition-colors duration-200",D?f?"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_70%,transparent)]":"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_75%,transparent)]":"text-[var(--orb-muted)]"),title:S.description,children:S.description})]})]}),O&&p&&e("button",{type:"button","aria-label":m(E?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":E,title:m(E?"navigation.pin.remove":"navigation.pin.add"),onClick:_=>{_.preventDefault(),_.stopPropagation(),p(S);},className:vo("orb-navigation-pin-button absolute right-1 top-1/2 z-20 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md transition-colors duration-150",E&&"orb-is-pinned"),children:e(Jr,{className:vo("h-3.5 w-3.5",E&&"fill-current")})}),I&&e("div",{className:vo("grid transition-[grid-template-rows] duration-300 ease-in-out",T?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:e("div",{className:vo("overflow-hidden",T&&"pt-1"),children:e(Yn,{items:S.children,onItemClick:o,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:p})})})]},S.id)})})}P();var Eh="orbcafe:navigation-island:pinned-items",Qs="orbcafe-navigation-pinned",Lh=t=>t.appurl||t.href,vd=t=>{let o=[];return t.forEach(r=>{let n=!!r.children?.length;r.pinnable!==false&&Lh(r)&&!n&&o.push({...r,children:void 0}),r.children?.length&&o.push(...vd(r.children));}),o},yd=({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=Eh,pinnedItemIds:f,defaultPinnedItemIds:h=[],onPinnedItemIdsChange:u,pinnedSectionTitle:v})=>{let{t:y}=le(),g=i==="dark",x=s==="floating",b=navigation.useRouter(),[C,k]=eo.useState(""),[S,T]=eo.useState(new Set),[I,w]=eo.useState(h),[M,A]=eo.useState(false),R=f!==void 0,D=eo.useMemo(()=>f??I,[f,I]),E=eo.useMemo(()=>new Set(D),[D]);eo.useEffect(()=>{t&&T(new Set);},[t]),eo.useEffect(()=>{if(!p||R){A(true);return}try{let H=window.localStorage.getItem(m);if(H){let U=JSON.parse(H);Array.isArray(U)&&w(U.filter(Y=>typeof Y=="string"));}}catch{}finally{A(true);}},[p,R,m]),eo.useEffect(()=>{if(!(!p||R||!M))try{window.localStorage.setItem(m,JSON.stringify(D));}catch{}},[D,p,R,m,M]),eo.useEffect(()=>{!p||t||D.length===0||T(H=>{if(H.has(Qs))return H;let U=new Set(H);return U.add(Qs),U});},[t,D.length,p]);let O=eo.useCallback(H=>{let U=Array.from(new Set(H));R||w(U),u?.(U);},[R,u]),_=eo.useCallback(H=>{let U=H.id,Y=E.has(U)?D.filter(ue=>ue!==U):[...D,U];O(Y);},[D,E,O]),J=eo.useMemo(()=>{if(!p||D.length===0)return a;let H=new Map(vd(a).map(Y=>[Y.id,Y])),U=D.map(Y=>H.get(Y)).filter(Y=>!!Y);return U.length===0?a:[{id:Qs,title:v||y("navigation.pinned"),icon:e(Jr,{className:"w-4 h-4"}),children:U,pinnable:false},...a]},[D,p,a,v,y]),F=eo.useCallback(H=>{let U=[],Y=ue=>{ue.forEach(re=>{U.push(re.id),re.children&&Y(re.children);});};return Y(H),U},[]),V=eo.useMemo(()=>{if(!C.trim())return J;let H=U=>U.reduce((Y,ue)=>{let re=ue.title?.toLowerCase().includes(C.toLowerCase())||ue.description?.toLowerCase().includes(C.toLowerCase()),ge=ue.children?H(ue.children):[];return (re||ge.length>0)&&Y.push({...ue,children:ge.length>0?ge:ue.children}),Y},[]);return H(J)},[C,J]),z=eo.useMemo(()=>C.trim()?new Set(F(J)):S,[C,J,S,F]),X=eo.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(Y){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",Y),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]),W=eo.useCallback(()=>{l?.(s==="fixed"?"floating":"fixed");},[s,l]);return c("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?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?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:x?g?"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?"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:[e("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${t?"px-1":"px-2"}`,children:t?e("div",{className:"flex justify-center",children:e("button",{onClick:o,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${g?"text-[var(--orb-fg)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expand"),children:e(Vo,{className:"h-5 w-5"})})}):c("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[e("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?"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)]"}`}),e("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:e(Vo,{className:"h-4 w-4 text-[var(--orb-muted)]"})})]})}),e("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:V.length===0?e("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?e(zn,{className:"h-5 w-5"}):y(C?"navigation.noMatch":"navigation.noAccessibleApp")}):c(jsxRuntime.Fragment,{children:[!t&&e("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:e(Yn,{items:V,onItemClick:X,className:"space-y-1",expandedIds:z,colorMode:i,enablePinning:p,pinnedIds:E,onTogglePin:_,onToggleExpand:H=>{let U=new Set(S);V.some(ue=>ue.id===H)?U.has(H)?U.delete(H):(V.forEach(ue=>{ue.id!==H&&U.has(ue.id)&&U.delete(ue.id);}),U.add(H)):U.has(H)?U.delete(H):U.add(H),T(U);}})}),t&&e("div",{className:"space-y-2",children:J.map(H=>e("div",{className:"space-y-1",children:e("button",{onClick:()=>{o();let U=new Set([H.id]);T(U);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g?"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||e("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${g?"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&&e("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?"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:e("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:e("div",{className:g?"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&&e("button",{type:"button",onClick:W,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?"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?e(Va,{className:"h-4 w-4"}):e(Wa,{className:"h-4 w-4"})})]})};P();var Fh="orbcafe:navigation-island:pinned-items",Js="orbcafe-navigation-pinned",Cd=t=>t.appurl||t.href,xd=t=>t.flatMap(o=>{let r=!!o.children?.length,n=o.pinnable!==false&&Cd(o)&&!r?[{...o,children:void 0}]:[];return o.children?.length?[...n,...xd(o.children)]:n}),wd=t=>t.flatMap(o=>[o.id,...o.children?wd(o.children):[]]),Sd=(t,o)=>t.reduce((r,n)=>{let a=n.children?Sd(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},[]),el=({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=Fh,pinnedItemIds:f,defaultPinnedItemIds:h=[],onPinnedItemIdsChange:u,pinnedSectionTitle:v})=>{let{t:y}=le(),g=navigation.useRouter(),x=s==="floating",[b,C]=eo.useState(""),[k,S]=eo.useState(new Set),[T,I]=eo.useState(h),[w,M]=eo.useState(false),A=f!==void 0,R=f??T,D=eo.useMemo(()=>new Set(R),[R]);eo.useEffect(()=>{t&&S(new Set);},[t]),eo.useEffect(()=>{if(!p||A){M(true);return}try{let H=window.localStorage.getItem(m);if(H){let U=JSON.parse(H);Array.isArray(U)&&I(U.filter(Y=>typeof Y=="string"));}}catch{}finally{M(true);}},[p,A,m]),eo.useEffect(()=>{if(!(!p||A||!w))try{window.localStorage.setItem(m,JSON.stringify(R));}catch{}},[R,p,A,m,w]),eo.useEffect(()=>{!p||t||R.length===0||S(H=>{if(H.has(Js))return H;let U=new Set(H);return U.add(Js),U});},[t,R.length,p]);let E=eo.useCallback(H=>{let U=Array.from(new Set(H));A||I(U),u?.(U);},[A,u]),O=eo.useCallback(H=>{E(D.has(H.id)?R.filter(U=>U!==H.id):[...R,H.id]);},[R,D,E]),_=eo.useMemo(()=>{if(!p||R.length===0)return a;let H=new Map(xd(a).map(Y=>[Y.id,Y])),U=R.map(Y=>H.get(Y)).filter(Y=>!!Y);return U.length===0?a:[{id:Js,title:v||y("navigation.pinned"),icon:e(Jr,{className:"h-4 w-4"}),children:U,pinnable:false},...a]},[R,p,a,v,y]),J=b.trim().toLocaleLowerCase(),F=eo.useMemo(()=>J?Sd(_,J):_,[_,J]),V=eo.useMemo(()=>J?new Set(wd(F)):k,[k,F,J]),z=eo.useCallback(H=>{S(U=>{let Y=new Set(U),ue=F.some(re=>re.id===H);return Y.has(H)?Y.delete(H):(ue&&F.forEach(re=>Y.delete(re.id)),Y.add(H)),Y});},[F]),X=eo.useCallback(H=>{let U=Cd(H);U&&(H.id==="chat"||H.appurl==="/chat"?g.push("/chat?new=true"):/^https?:\/\//.test(U)?window.open(U,"_blank","noopener,noreferrer"):g.push(U));},[g]),W=H=>{o(),S(new Set([H.id]));};return c("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:[e("div",{className:`orb-navigation-island-v2-search ${t?"px-1":"px-2"}`,children:t?e("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:e(Vo,{className:"h-5 w-5"})}):c("label",{className:"relative block",children:[e("span",{className:"orb-visually-hidden",children:y("navigation.searchPlaceholder")}),e(Vo,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--orb-muted)]"}),e("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"})]})}),e("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:F.length===0?e("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?e(zn,{className:"h-5 w-5"}):y(J?"navigation.noMatch":"navigation.noAccessibleApp")}):t?e("div",{className:"space-y-1",children:_.map(H=>e("button",{type:"button",onClick:()=>W(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||e(zn,{className:"h-5 w-5"})},H.id))}):e(Yn,{items:F,onItemClick:X,className:"space-y-1",expandedIds:V,onToggleExpand:z,colorMode:i,enablePinning:p,pinnedIds:D,onTogglePin:O})}),d&&t&&e("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:e("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?e(Va,{className:"h-4 w-4"}):e(Wa,{className:"h-4 w-4"})})}),!t&&e("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:e("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:e("span",{className:"absolute rounded-full border-[3px] border-[var(--orb-ai-accent)]",style:{width:32,height:32,top:-16,left:-16}})})})]})};el.displayName="NavigationIsland2";var Pd=(t={})=>{let{initialCollapsed:o=false,initialDisplayMode:r="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}=t,[m,f]=eo.useState(o),[h,u]=eo.useState(r),[v,y]=eo.useState(n),g=eo.useCallback(()=>{f(C=>!C);},[]),x=eo.useCallback(()=>{u(C=>C==="fixed"?"floating":"fixed");},[]),b=eo.useMemo(()=>({collapsed:m,onToggle:g,menuData:v,displayMode:h,onDisplayModeChange:u,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}),[m,g,v,h,u,a,i,s,l,d,p]);return {collapsed:m,setCollapsed:f,toggleCollapsed:g,displayMode:h,setDisplayMode:u,toggleDisplayMode:x,menuData:v,setMenuData:y,navigationIslandProps:b}};var ol=class{constructor(){Pc(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);}},lr=new ol,IT={success:(t,o)=>lr.show("success",t,o),error:(t,o)=>lr.show("error",t,o),warning:(t,o)=>lr.show("warning",t,o),info:(t,o)=>lr.show("info",t,o),show:(t,o,r)=>lr.show(t,o,r),hide:()=>lr.hide()};P();var Hh={success:{icon:e(Hn,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:e(_a,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:e(Ea,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:e(Fa,{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:p="default"})=>{let{t:m}=le(),f=i||m("messageBox.confirm"),h=s||m("messageBox.cancel"),u=()=>{a?a():n();},v=Hh[p],y=p!=="default";return c(Lt,{open:t,onClose:n,maxWidth:d,sx:y?{borderTop:`6px solid ${v.iconColor}`}:void 0,children:[y&&e("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:v.iconColor},children:v.icon}),o&&e("div",{className:"orb-dialog-title",style:{textAlign:y?"center":"left",paddingTop:y?8:16},children:o}),e("div",{className:"orb-dialog-content",style:{textAlign:y?"center":"left"},children:typeof r=="string"?e("p",{style:{margin:0,color:"var(--orb-muted)"},children:r}):r}),c("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:y?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[l&&e(ke,{onClick:n,variant:"text",children:h}),e(ke,{onClick:u,variant:"contained",color:y&&p==="error"?"error":"primary",autoFocus:true,children:f})]})]})},OT=()=>{let[t,o]=eo__namespace.default.useState(null),[r,n]=eo__namespace.default.useState(false);eo__namespace.default.useEffect(()=>{let s=l=>{l?(o(l),n(true)):(n(false),o(null));};return lr.register(s),()=>lr.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?e(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};P();var VT=({status:t,showIcon:o=true})=>{let r="gray",n,a=t;return t==="OK"?(r="blue",n=e(Hn,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(r="orange",n=e(Ea,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(r="orange",n=e(_a,{size:14,strokeWidth:2}),a="Warning"),e(xt,{label:a,tone:r,icon:o&&n?n:void 0})};P();var _T=({dense:t,sx:o,className:r,children:n,...a})=>e("ul",{...a,className:r,style:{listStyle:"none",margin:0,padding:0,...o},children:n}),GT=({button:t,divider:o,sx:r,className:n,children:a,...i})=>e("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}),UT=({sx:t,className:o,children:r,...n})=>e("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})=>e("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...o},children:t}),qT=({primary:t,secondary:o,sx:r})=>c("div",{style:{flex:1,minWidth:0,...r},children:[e("div",{className:"orb-body",style:{fontWeight:500},children:t}),o&&e("div",{className:"orb-meta",style:{marginTop:2},children:o})]}),XT=({sx:t,className:o,children:r,...n})=>e("li",{...n,className:o,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:r}),YT=({children:t,sx:o})=>e("div",{style:{marginRight:12,display:"flex",alignItems:"center",...o},children:t});P();var QT=({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 e("div",{...s,className:i,style:{gridColumn:l,minWidth:0,...n},children:a})};_t();P();var Lo=ot,io=(t,o)=>eo.forwardRef(({component:r,sx:n,className:a,style:i,children:s,...l},d)=>{let p=r??t,m=Ue(n,[o,a].filter(Boolean).join(" "),i);return e(p,{ref:d,className:m.className,style:m.style,...l,children:s})}),Re=io("div"),Id=io("a","orb-link"),Br=Ae,Rd=se,yo=L;var Md=ie;var Dd=Dt,Jo=rn,ri=on,ni=Ka;var ai=Ua,Nd=Zo,Ad=({value:t,variant:o,color:r,sx:n})=>e(_n,{value:o==="determinate"?t:void 0,color:r,sx:n}),Ed=io("table","orb-tbl"),Ld=io("tbody"),al=io("td"),Od=io("div","orb-table-container"),Fd=io("thead"),il=io("tr");io("tfoot");io("div","orb-dialog-title");io("div","orb-dialog-content");io("div","orb-dialog-actions");io("p","orb-body-dense");var cr=io("span","orb-input-adornment"),Bd=eo.forwardRef(({sx:t,fullWidth:o,className:r,style:n,...a},i)=>{let s=Ue(t,["orb-input-base",r].filter(Boolean).join(" "),n);return e("input",{ref:i,className:s.className,style:{width:o?"100%":void 0,...s.style},...a})});var Cr=io("div","orb-form-control"),Jn=({control:t,label:o,...r})=>c("label",{className:"orb-form-control-label",...r,children:[t,e("span",{children:o})]}),Gh=({primary:t,secondary:o,children:r,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>c("span",{className:"orb-list-item-text",...i,children:[t??r,o?e("small",{children:o}):null]}),Uh=io("span","orb-list-item-icon"),Gt=Gh,Wo=Uh;io("div","orb-list-subheader");var sl=({container:t,item:o,spacing:r,xs:n,sm:a,md:i,lg:s,xl:l,sx:d,...p})=>{let m={},f=h=>typeof h=="number"?`${h/12*100}%`:h?"100%":void 0;return n!==void 0&&(m.xs=f(n)),a!==void 0&&(m.sm=f(a)),i!==void 0&&(m.md=f(i)),s!==void 0&&(m.lg=f(s)),l!==void 0&&(m.xl=f(l)),e(Re,{...p,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&r?r:void 0,width:o?m:void 0,...d??{}}})},nn=({in:t,children:o,unmountOnExit:r,...n})=>!t&&r?null:e("div",{hidden:!t,...n,children:o}),Hd=({children:t,container:o})=>typeof document>"u"?null:reactDom.createPortal(t,o??document.body),zd=io("div","orb-toolbar"),Vd=({active:t,direction:o="asc",children:r,sx:n,className:a,style:i,...s})=>{let l=Ue(n,["orb-table-sort-label",t?"orb-is-active":"",a].filter(Boolean).join(" "),i);return c("button",{type:"button",className:l.className,style:l.style,"data-direction":o,...s,children:[e("span",{className:"orb-table-sort-content",children:r}),e(Tt,{className:"orb-table-sort-icon",name:o==="desc"?"down":"up",size:11})]})},ii=({open:t,anchorEl:o,onClose:r,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:l,sx:d,className:p,style:m,...f})=>{let h=eo.useRef(null);if(eo.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 u=o?.getBoundingClientRect(),v=s?.paper??l,y=[...Array.isArray(v?.sx)?v.sx:v?.sx?[v.sx]:[],...Array.isArray(d)?d:d?[d]:[]],g=Ue(y,["orb-pop",v?.className,p].filter(Boolean).join(" "),{...v?.style,...m});return reactDom.createPortal(e("div",{...f,ref:h,className:g.className,style:{position:"fixed",left:u?.left??16,top:(u?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},Wd=({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=Ue(a?.sx,"orb-drawer");return reactDom.createPortal(c(jsxRuntime.Fragment,{children:[e("button",{type:"button",className:"orb-overlay","aria-label":"Close drawer",onClick:o}),e("aside",{className:s.className,style:{position:"fixed",zIndex:1201,...i},children:n})]}),document.body)},$d=({value:t,onChange:o,children:r,variant:n,scrollButtons:a,...i})=>e("div",{role:"tablist",className:"orb-tabs",...i,children:eo.Children.map(r,s=>eo.isValidElement(s)?eo.cloneElement(s,{selected:s.props.value===t,onSelect:l=>o?.(null,l)}):s)}),_d=({value:t,label:o,children:r,selected:n,onSelect:a,...i})=>e("button",{type:"button",role:"tab","aria-selected":n,className:`orb-tab ${n?"orb-is-active":""}`,onClick:()=>a?.(t),...i,children:o??r});var so=()=>Ma(),xr=(t,o)=>No(t);var Gd=({day:t,onDaySelect:o,selected:r,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...l})=>{let d=Ue(i,`orb-cal-day ${r?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return e("button",{type:"button",className:d.className,style:d.style,onClick:()=>o?.(t),...l,children:t.date()})},Ud=({value:t,referenceDate:o,onChange:r,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>e(Kn,{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:f=>r?.(f)}):void 0,...d}),Kd=({children:t})=>e(jsxRuntime.Fragment,{children:t}),oi=class{};_t();P();var Kh=(t,o)=>o!==void 0?o:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,Se=t=>({fontSize:r,size:n,sx:a,className:i,style:s,titleAccess:l,...d})=>{let p=Ue(a,i,s);return e(Tt,{name:t,size:Kh(r,n),className:p.className,style:p.style,"aria-label":d["aria-label"]??l,...d})},wr=Se("tree"),Hr=Se("add"),qd=Se("duplicate"),ll=Se("down"),Xd=Se("navigationRight"),Yd=Se("navigationRight"),cl=Se("up"),Zd=Se("delete"),jd=Se("camera"),Qd=Se("accept"),Jd=Se("accept"),si=Se("navigationRight"),ep=Se("dimension"),tp=Se("decline"),Sr=Se("decline"),op=Se("decline"),rp=Se("decline"),li=Se("delete"),ci=Se("delete"),np=Se("download"),ap=Se("move"),ip=Se("edit"),an=Se("slimDown"),sp=Se("filter"),sn=Se("sum"),lp=Se("lineChart"),cp=Se("document"),$o=Se("slimDown"),dp=Se("navigationLeft"),kr=Se("navigationRight"),di=Se("slimUp"),pi=Se("navigationLeft"),ui=Se("navigationRight"),pp=Se("dimension"),up=Se("splitOne"),mi=Se("menu"),mp=Se("microphone"),gp=Se("microphone"),fp=Se("microphone"),hp=Se("qrCode"),Pr=Se("save"),zr=Se("search"),bp=Se("search"),vp=Se("paperPlane"),yp=Se("paperPlane"),Cp=Se("wrench"),xp=Se("sort"),gi=Se("splitTwo"),wp=Se("favorite"),Sp=Se("favorite"),kp=Se("stop"),Pp=Se("tableRow"),fi=Se("collapseAll"),hi=Se("expandAll"),ln=Se("tableColumn"),Tp=Se("overview"),Ip=Se("hide");P();var Xh=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],Mp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],Po=t=>String(t),Dp=(t,o)=>t[o],Np=t=>{let o=t.value??t.id??t.key??t.code;return typeof o=="number"||typeof o=="string"?o:""},Yh=t=>{let o=t.label??t.description??t.name??t.title;return String(typeof o=="number"||typeof o=="string"?o:Np(t))},Zh=t=>{let o=t.description??t.subtitle;return typeof o=="number"||typeof o=="string"?String(o):void 0},Ap=({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:f=false,clearable:h=true,allowManualInput:u=true,validateManualInput:v=true,manualInputErrorText:y="Enter a valid value.",selectedItems:g=[],displayValue:x,getOptionValue:b=Np,getOptionLabel:C=Yh,getOptionDescription:k=Zh,onChange:S,onSearch:T,disabled:I,InputProps:w,onFocus:M,onBlur:A,onKeyDown:R,error:D,helperText:E,...O})=>{let _=fo(),J=n==="multiple",[F,V]=eo.useState(false),[z,X]=eo.useState(false),[W,H]=eo.useState(""),[U,Y]=eo.useState(null),[ue,re]=eo.useState(false),[ge,we]=eo.useState(()=>Mp(t)),[Ve,Te]=eo.useState(""),[Ie,He]=eo.useState(""),ce=eo.useMemo(()=>r&&r.length>0?r:Xh,[r]),be=U??o,We=eo.useMemo(()=>{let te=[...g,...o,...U??[]],ve=new Map;return te.forEach(Ne=>{ve.set(Po(b(Ne)),Ne);}),ve},[b,o,U,g]),tt=eo.useMemo(()=>Mp(t),[t]),nt=eo.useMemo(()=>tt.map(String).join(", "),[tt]);eo.useEffect(()=>{F||we(tt);},[F,tt]),eo.useEffect(()=>{!z&&!Ie&&Te(nt);},[z,nt,Ie]);let it=eo.useMemo(()=>{let te=W.trim().toLowerCase();if(!te||T)return be;let ve=ce.filter(Ne=>Ne.searchable!==false);return be.filter(Ne=>[b(Ne),C(Ne),k(Ne),...ve.map(st=>Dp(Ne,st.field))].some(st=>String(st??"").toLowerCase().includes(te)))},[be,k,C,b,T,W,ce]),q=eo.useMemo(()=>{if(x!==void 0)return x;if(tt.length===0)return "";let te=ve=>{let Ne=We.get(Po(ve));if(!Ne)return String(ve);let Je=C(Ne);return Je&&Je!==String(ve)?`${ve} - ${Je}`:String(ve)};return J?tt.length>2?`${tt.length} selected`:tt.map(te).join(", "):te(tt[0])},[x,C,J,We,tt]),De=eo.useCallback(async()=>{if(T){re(true);try{let te=await T(W);Array.isArray(te)&&Y(te);}finally{re(false);}}},[T,W]),Ce=()=>{I||(we(tt),V(true));},Fe=()=>{V(false);},at=()=>{S?.(J?[]:null,J?[]:null),we([]),Te(""),He("");},Ze=te=>{let ve=b(te);if(J){we(Ne=>Ne.some(st=>Po(st)===Po(ve))?Ne.filter(st=>Po(st)!==Po(ve)):[...Ne,ve]);return}we([ve]);},wt=()=>{let te=ge.map(ve=>We.get(Po(ve))).filter(ve=>!!ve);J?S?.(ge,te):S?.(ge[0]??null,te[0]??null),He(""),V(false);},Rt=te=>{if(te.key==="F4"){te.preventDefault(),Ce();return}if(te.key==="Enter"&&u&&!At(Ve,true)){te.preventDefault();return}R?.(te);},Ot=te=>v?te.every(ve=>We.has(Po(ve))):true,At=(te,ve)=>{if(J){let Je=te.split(/[,;\n]/).map(pt=>pt.trim()).filter(Boolean);if(Je.length===0)return He(""),S?.([],[]),true;if(!Ot(Je))return ve&&He(y),false;He("");let st=Je.map(pt=>We.get(Po(pt))).filter(pt=>!!pt);return S?.(Je,st),true}let Ne=te.trim();return Ne?Ot([Ne])?(He(""),S?.(Ne,We.get(Po(Ne))??null),true):(ve&&He(y),false):(He(""),S?.(null,null),true)},oe=te=>{if(!u)return;let ve=te.target.value;Te(ve),He(""),At(ve,false);},Ke=f||ue,Oe=tt.length>0,ye=u&&(z||!!Ie)?Ve:q;return c(jsxRuntime.Fragment,{children:[e(ze,{...O,className:["orb-value-help-field",h&&Oe&&!I?"orb-value-help-has-clear":"",O.className??""].filter(Boolean).join(" "),disabled:I,value:ye,error:!!Ie||D,helperText:Ie||E,onChange:oe,onFocus:te=>{X(true),Te(nt),M?.(te);},onBlur:te=>{u&&At(Ve,true),X(false),A?.(te);},onKeyDown:Rt,InputProps:{...w,readOnly:!u,endAdornment:c("span",{className:"orb-value-help-actions",children:[Ke?e(Zo,{size:18}):null,h&&Oe&&!I?e(ie,{className:"orb-value-help-clear-trigger",size:"small",tooltip:l,"aria-label":l,onMouseDown:te=>te.preventDefault(),onClick:te=>{te.stopPropagation(),at();},children:e(Tt,{name:"decline",size:14})}):null,e(ie,{className:"orb-value-help-search-trigger",size:"small",tooltip:p,"aria-label":p,onMouseDown:te=>te.preventDefault(),onClick:te=>{te.stopPropagation(),Ce();},disabled:I,children:e(Tt,{name:"search",size:16})})]})}}),c(Lt,{open:F,onClose:Fe,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:te=>({borderRadius:2,overflow:"hidden",border:`1px solid ${te.palette.divider}`,boxShadow:_==="dark"?`0 24px 80px ${ot(te.palette.common.black,.72)}`:`0 24px 80px ${ot(te.palette.common.black,.18)}`})},children:[c("div",{className:"orb-dialog-title",sx:te=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${te.palette.divider}`,bgcolor:te.palette.background.paper}),children:[c("div",{children:[e(L,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),J?e(L,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${ge.length} selected`}):null]}),e(ie,{"aria-label":"Close",onClick:Fe,size:"small",children:e(Sr,{fontSize:"small"})})]}),c("div",{className:"orb-dialog-content",sx:{p:0},children:[c(se,{direction:{xs:"column",sm:"row"},spacing:1,sx:te=>({px:2.5,py:1.5,borderBottom:`1px solid ${te.palette.divider}`,bgcolor:_==="dark"?ot(te.palette.common.white,.025):ot(te.palette.primary.main,.035)}),children:[e(ze,{size:"small",fullWidth:true,autoFocus:true,value:W,placeholder:i,onChange:te=>H(te.target.value),onKeyDown:te=>{te.key==="Enter"&&(te.preventDefault(),De());},InputProps:{startAdornment:e(cr,{position:"start",children:e(Tt,{name:"search",size:16})}),sx:te=>({borderRadius:1,bgcolor:te.palette.background.paper,"& fieldset":{borderColor:ot(te.palette.text.primary,_==="dark"?.2:.16)},"&:hover fieldset":{borderColor:ot(te.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:te.palette.primary.main}})}}),T?e(ke,{variant:"outlined",onClick:()=>{De();},disabled:Ke,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:Ke?e(Zo,{size:18}):"Search"}):null]}),e("div",{sx:{maxHeight:420},children:c("table",{className:"orb-tbl",stickyHeader:true,size:"small",children:[e("thead",{children:c("tr",{children:[e("td",{padding:"checkbox",sx:te=>({bgcolor:_==="dark"?"var(--orb-canvas)":te.palette.background.paper,borderBottom:`1px solid ${te.palette.divider}`})}),ce.map(te=>e("td",{align:te.align==="inherit"?void 0:te.align,sx:ve=>({minWidth:te.minWidth,width:te.width,fontSize:"0.78rem",fontWeight:800,bgcolor:_==="dark"?"var(--orb-canvas)":ve.palette.background.paper,borderBottom:`1px solid ${ve.palette.divider}`}),children:te.label},String(te.field)))]})}),c("tbody",{children:[it.map(te=>{let ve=b(te),Ne=ge.some(Je=>Po(Je)===Po(ve));return c("tr",{hover:true,selected:Ne,onClick:()=>Ze(te),onDoubleClick:()=>{J||(we([ve]),S?.(ve,te),V(false));},sx:Je=>({cursor:"pointer","&.orb-selected":{bgcolor:ot(Je.palette.primary.main,_==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:ot(Je.palette.primary.main,_==="dark"?.28:.18)}}),children:[e("td",{padding:"checkbox",children:e(It,{size:"small",checked:Ne})}),ce.map(Je=>{let st=Dp(te,Je.field);return e("td",{align:Je.align==="inherit"?void 0:Je.align,sx:{fontSize:"0.82rem",py:1},children:Je.render?Je.render(st,te):String(st??"")},String(Je.field))})]},Po(ve))}),it.length===0?e("tr",{children:e("td",{colSpan:ce.length+1,children:e("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:m})})}):null]})]})})]}),c("div",{className:"orb-dialog-actions",sx:te=>({px:2.5,py:1.5,borderTop:`1px solid ${te.palette.divider}`,bgcolor:te.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[h&&(Oe||ge.length>0)?e(ke,{onClick:at,children:l}):null,e("div",{sx:{flex:1}}),e(ke,{onClick:Fe,children:d}),e(ke,{variant:"contained",onClick:wt,disabled:!J&&ge.length===0,children:s})]})]})]})};P();var bi=({title:t,hideHeader:o,children:r})=>c("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!o&&e("div",{sx:{mb:2},children:e(L,{variant:"h4",children:t})}),e("div",{sx:{flex:1,overflow:"hidden"},children:r})]});var dl={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"},pl={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},ea={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},ta={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Ep={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},uo={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}};P();var jh={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"}},vi=({rowsPerPage:t=20,rowsPerPageOptions:o=[20,50,100,-1],page:r=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=le(),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),f=d>0,h=d<p-1&&t!==-1;return c("div",{className:"orb-table-pager",children:[e(L,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),e(ct,{title:s("table.toolbar.itemsPerPage"),children:e(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:jh,children:l.map(u=>e("option",{value:u,children:u===-1?s("common.all"):u},`rows-per-page-${u}`))})}),e("span",{className:"orb-table-pager-divider"}),e(ie,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(d-1,0)),disabled:!f,sx:uo,children:e(dp,{})}),c(L,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:m,total:p}),children:[m," / ",p]}),e(ie,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,p-1)),disabled:!h,sx:uo,children:e(kr,{})})]})};P();var yi=({value:t="",onChange:o})=>{let{t:r}=le();return e("div",{className:"orb-table-toolbar-search",children:e(ze,{className:"orb-table-toolbar-search-field",size:"small",placeholder:r("table.toolbar.searchPlaceholder"),value:t,onChange:n=>o?.(n.target.value),InputProps:{startAdornment:e(cr,{position:"start",children:e(zr,{size:16})})}})})};P();var Ci=t=>{let{t:o}=le(),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 e(zd,{className:"orb-table-toolbar",role:"toolbar","aria-label":o("table.title.default"),children:c("div",{className:"orb-table-toolbar-primary",children:[e(yi,{value:t.filterText,onChange:l=>{t.setFilterText(l),t.onPageChange?.(0);}}),e(vi,{rowsPerPage:t.rowsPerPage,rowsPerPageOptions:t.rowsPerPageOptions,page:t.page,count:t.count,onRowsPerPageChange:t.onRowsPerPageChange,onPageChange:t.onPageChange}),a.length>0?e("div",{className:"orb-table-toolbar-custom",children:a.map((l,d)=>e(eo__namespace.default.Fragment,{children:l},`toolbar-custom-${d}`))}):null,e("span",{className:"orb-table-toolbar-spacer"}),c("div",{className:"orb-table-toolbar-actions",children:[c("div",{className:"orb-table-tool-group",children:[!t.disableGrouping&&e(ct,{title:o("table.toolbar.groupBy"),children:e(ie,{className:"orb-table-tool-button",sx:uo,onClick:l=>t.setGroupAnchorEl(t.groupAnchorEl?null:l.currentTarget),children:e(ni,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:e(wr,{})})})}),e(ct,{title:o("table.toolbar.summary"),children:e(ie,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:uo,onClick:l=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:l.currentTarget),children:e(sn,{})})}),e(ct,{title:o("table.toolbar.columns"),children:e(ie,{className:"orb-table-tool-button",sx:uo,onClick:l=>t.setAnchorEl(t.anchorEl?null:l.currentTarget),children:e(ln,{})})}),e(ct,{title:o("table.toolbar.export"),children:e(ie,{className:"orb-table-tool-button",sx:uo,onClick:t.handleExport,children:e(np,{})})})]}),i&&c("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&e(ct,{title:o("table.toolbar.newItem"),children:e(ie,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:uo,children:e(Hr,{})})}),t.showEditButton&&e(ct,{title:o("table.toolbar.editItem"),children:e("span",{children:e(ie,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:uo,children:e(ip,{})})})}),t.showDeleteButton&&e(ct,{title:o("table.toolbar.deleteItem"),children:e("span",{children:e(ie,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...uo,color:"error.main"},children:e(li,{})})})})]}),s&&c("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&e(ct,{title:o("table.toolbar.graphicReport"),children:e(ie,{className:"orb-table-tool-button",sx:uo,onClick:t.onOpenGraphReport,children:e(lp,{})})}),t.onLayoutSave&&!t.layoutManager&&e(ct,{title:o("table.toolbar.saveLayout"),children:e(ie,{className:"orb-table-tool-button",sx:uo,onClick:l=>t.onLayoutSave(l),children:e(Pr,{})})}),t.layoutManager]})]})]})})};var xi=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 [xi.Translate.toString(t),xi.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:o,duration:r,easing:n}=t;return o+" "+r+"ms "+n}}});P();var wi=t=>{let{t:o}=le(),{onSelectAllClick:r,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:l=0,onRequestSort:d,onContextMenu:p,columns:m,visibleColumns:f,selectionMode:h,grouping:u=[],isAllExpanded:v=false,handleToggleAll:y,onColumnResize:g,columnWidths:x,enableColumnReorder:b=false,disableSorting:C=false}=t,[k,S]=eo.useState(null),T=eo.useRef(null),I=z=>X=>{C||k||d(z);},w=(z,X,W)=>{z.preventDefault(),z.stopPropagation(),S(X),T.current={startX:z.clientX,startWidth:W,colId:X},document.addEventListener("mousemove",M),document.addEventListener("mouseup",A),document.body.style.cursor="col-resize";},M=z=>{if(!T.current)return;let{startX:X,startWidth:W,colId:H}=T.current,U=z.clientX-X,Y=Math.max(50,W+U);g&&g(H,Y);},A=()=>{S(null),T.current=null,document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",A),document.body.style.cursor="";};eo.useEffect(()=>()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",A);},[]);let R=h==="multiple"||h==="single",D=u.length>0&&!!y,E=o(v?"table.group.collapseAll":"table.group.expandAll"),O=m.filter(z=>f.includes(z.id)),_=new Map(i.map((z,X)=>[z.field,{...z,priority:X+1}])),J=O.map(z=>{let X=x?.[z.id]||z.minWidth||100,W=_.get(z.id);return e(ab,{headCell:z,width:typeof X=="number"?X:100,order:n,orderBy:a,multiSortInfo:C?void 0:W,onRequestSort:I(z.id),onContextMenu:p,onResizeMouseDown:H=>w(H,z.id,typeof X=="number"?X:100),enableColumnReorder:b,disableSorting:C},z.id)}),F=O.map(z=>z.id),V=c("tr",{children:[R&&e("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:e(It,{color:"primary",indeterminate:s>0&&s<l,checked:l>0&&s===l,onChange:r,disabled:h==="single",sx:ea})}),D&&e("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:e(ct,{title:E,children:e(ie,{size:"small",onClick:z=>{z.stopPropagation(),y?.(!v);},sx:ta,children:v?e(fi,{}):e(hi,{})})})}),b?e(sortable.SortableContext,{items:F,strategy:sortable.horizontalListSortingStrategy,children:J}):J]});return e("thead",{children:V})},ab=({headCell:t,width:o,order:r,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:l,enableColumnReorder:d,disableSorting:p})=>{let{setNodeRef:m,attributes:f,listeners:h,transform:u,transition:v,isDragging:y}=sortable.useSortable({id:t.id,disabled:!d}),g=d?{transform:xi.Transform.toString(u),transition:v,opacity:y?.6:1}:{},x=p?"asc":a?.direction??(n===t.id?r:"asc"),b=!p&&(!!a||n===t.id);return c("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},...d?f:{},...d?h:{},children:[p?e("span",{className:"orb-table-head-label",children:t.label}):e(Vd,{className:"orb-table-head-sort",active:b,direction:x,onClick:i,children:c("span",{className:"orb-table-head-label",children:[t.label,a&&e("span",{className:"orb-table-sort-priority",children:a.priority})]})}),e("div",{className:"orb-table-resize-handle",onMouseDown:l,onPointerDown:C=>C.stopPropagation(),onClick:C=>C.stopPropagation()})]})};P();var Si=t=>{let{t:o}=le(),{visibleRows:r,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:l,expandedGroups:d=new Set,selectionMode:p,grouping:m=[],isGroupFullyExpanded:f,handleExpandGroupRecursively:h,handleCollapseGroupRecursively:u,emptyLabel:v,getRowDataKey:y,getRowProps:g,getGroupRowProps:x}=t,b=T=>a.indexOf(T)!==-1,C=p==="multiple"||p==="single",k=m.length>0,S=n.length+(C?1:0)+(k?1:0);return c("tbody",{children:[r.map((T,I)=>{if(T.type==="group"){let w=d.has(T.id),M=T.childIds||[],A=M.filter(z=>b(z)).length,R=M.length>0&&A===M.length,D=A>0&&A<M.length,E={entry:T,data:T,id:T.id,index:I,selected:R,group:true},O=x?.(E)||{},{className:_,onClick:J,...F}=O,V=z=>{if(z.stopPropagation(),!!t.onSelectionChange)if(R){let X=a.filter(W=>!M.includes(W));t.onSelectionChange(X);}else {let X=Array.from(new Set([...a,...M]));t.onSelectionChange(X);}};return c("tr",{...F,"data-ctable-row-key":y?.(E),className:["orb-table-group-row",_].filter(Boolean).join(" "),onClick:J,sx:z=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:z.palette.text.primary,borderBottomColor:z.palette.divider},"& .orb-icon-btn":{color:z.palette.text.primary},"& .orb-chk":{color:z.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:z.palette.primary.main}}),children:[C&&e("td",{padding:"checkbox",sx:dl,children:e(It,{size:"small",checked:R,indeterminate:D,onChange:V,onClick:z=>z.stopPropagation(),sx:ea})}),k&&e("td",{padding:"checkbox",sx:pl,children:c("div",{sx:Ep,children:[m.length>1&&T.level<m.length-1&&e(ct,{title:f?.(T.id)?o("table.group.collapseAll"):o("table.group.expandAll"),children:e(ie,{size:"small",onClick:()=>{f?.(T.id)?u?.(T.id):h?.(T.id);},sx:ta,children:f?.(T.id)?e(fi,{}):e(hi,{})})}),e(ie,{size:"small",onClick:()=>l&&l(T.id),sx:ta,children:w?e($o,{}):e(kr,{})})]})}),e("td",{colSpan:n.length,sx:{py:1,pl:T.level*3+1},children:c(L,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[T.field,": ",T.value," (",T.count,")"]})})]},T.id)}else {let w=T.data||T,M=T.id||w.id||I,A=b(M),R=`enhanced-table-checkbox-${I}`,D={entry:T,data:w,id:M,index:I,selected:A,group:false},E=g?.(D)||{},{className:O,onClick:_,...J}=E,V=(T.level!==void 0?T.level:0)*4;return c("tr",{...J,"data-ctable-row-key":y?.(D),className:[A?"orb-is-selected":"",O].filter(Boolean).join(" "),onClick:z=>{_?.(z),z.defaultPrevented||i?.(z,w);},role:C?"checkbox":J.role,"aria-checked":C?A:J["aria-checked"],tabIndex:J.tabIndex??-1,children:[C&&e("td",{padding:"checkbox",sx:dl,children:e(It,{color:"primary",checked:A,inputProps:{"aria-labelledby":R},sx:ea})}),k&&e("td",{padding:"checkbox",sx:pl}),s.filter(z=>n.includes(z.id)).map((z,X)=>{let H=X===0&&V>0?{pl:V+2}:{};return e("td",{className:z.numeric?"orb-num":void 0,align:z.numeric?"right":"left",sx:H,children:z.render?z.render(w[z.id],w):(function(){let Y=w[z.id];if(z.numeric){if(typeof Y=="number")return Y.toLocaleString();if(typeof Y=="string"&&Y.trim()!==""&&!isNaN(Number(Y)))return Number(Y).toLocaleString()}return Y})()},z.id)})]},M)}}),r.length===0&&e("tr",{children:e("td",{colSpan:S,align:"center",children:v??o("common.noData")})})]})};P();var Lp=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 e("tfoot",{className:"orb-table-footer",style:{zIndex:t.zIndex},children:c("tr",{children:[l&&e("td",{className:"orb-table-footer-control",style:{width:56,minWidth:56,maxWidth:56}}),d&&e("td",{className:"orb-table-footer-control",style:{width:72,minWidth:72,maxWidth:72}}),p.map(m=>e("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))]})})};P();var Op=t=>{let{t:o}=le();return e("div",{sx:{p:2},children:e(L,{children:o("table.mobile.notImplemented")})})};P();var pn=({groupAnchorEl:t,setGroupAnchorEl:o,grouping:r,setGrouping:n,columns:a})=>{let{t:i}=le(),[s,l]=eo.useState(r);eo.useEffect(()=>{t&&l(r);},[t,r]);let d=()=>{l(r),o(null);},p=f=>{l(h=>h.includes(f)?h.filter(u=>u!==f):[...h,f]);},m=()=>{n(s),o(null);};return c(Qt,{anchorEl:t,open:!!t,onClose:d,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[c("div",{className:"orb-table-group-menu-header",onClick:f=>f.stopPropagation(),children:[e(L,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&e(ke,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:f=>{f.stopPropagation(),l([]);},children:i("table.menu.clearAll")})]}),e(Dt,{className:"orb-table-group-menu-divider"}),a.map(f=>{let h=s.includes(f.id),u=s.indexOf(f.id)+1;return e("option",{className:"orb-table-group-menu-option",selected:h,onClick:v=>{v.stopPropagation(),p(f.id);},children:c("div",{className:"orb-table-group-menu-option-content",children:[e(It,{className:"orb-table-group-menu-checkbox",checked:h,size:"small"}),e(Gt,{className:"orb-table-group-menu-label",primary:f.label}),h&&e("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${u}`,children:u})]})},f.id)}),c("div",{className:"orb-table-group-menu-footer",children:[e(ke,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),e(ke,{size:"small",variant:"primary",onClick:m,children:i("common.ok")})]})]})},un=({anchorEl:t,setAnchorEl:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=le();return c(Qt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[e("option",{disabled:true,children:e(Gt,{primary:i("table.menu.visibleColumns")})}),e(Dt,{}),r.map(s=>c("option",{onClick:()=>a(s.id),children:[e(It,{checked:n.includes(s.id),size:"small"}),e(Gt,{primary:s.label})]},s.id))]})},ki=({anchorEl:t,setAnchorEl:o,showSummary:r,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:l}=le();return c(Qt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[e("option",{children:e(Jn,{control:e(ai,{checked:r,onChange:d=>n(d.target.checked),size:"small"}),label:l("table.menu.showSummaryRow")})}),e(Dt,{}),a.filter(d=>d.numeric).map(d=>c("option",{onClick:()=>s(d.id),disabled:!r,children:[e(It,{checked:i.includes(d.id),size:"small"}),e(Gt,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&e("option",{disabled:true,children:e(Gt,{primary:l("table.menu.noNumericColumns")})})]})},Pi=({contextMenu:t,handleCloseContextMenu:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=le();return c(Qt,{open:t!==null,onClose:o,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[e("option",{onClick:o,children:i("common.copy")}),e(Dt,{}),e("option",{disabled:true,children:i("table.menu.visibleColumns")}),r.map(s=>c("option",{onClick:()=>a(s.id),children:[e(Wo,{children:n.includes(s.id)&&e(Qd,{fontSize:"small"})}),e(Gt,{children:s.label})]},s.id))]})},zp=({contextMenu:t,handleClose:o,columns:r,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:l,orderBy:d,order:p,onSortAsc:m,onSortDesc:f,onClearSort:h,onHideColumn:u,onToggleGroup:v,onToggleSummary:y,onOpenSortDialog:g})=>{let{t:x}=le(),b=t?.columnId??"",C=r.find(R=>R.id===b),k=a.includes(b),S=i.includes(b),T=!!C?.numeric,I=l.find(R=>R.field===b),w=I?I.direction==="asc":d===b&&p==="asc",M=I?I.direction==="desc":d===b&&p==="desc",A=w||M;return c(Qt,{open:t!==null,onClose:o,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[e("option",{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:e(Gt,{primary:C?.label??b})}),e(Dt,{}),c("option",{onClick:()=>{m(b),o();},selected:w,children:[e(Wo,{children:e(cl,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.sortAsc")})]}),c("option",{onClick:()=>{f(b),o();},selected:M,children:[e(Wo,{children:e(ll,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.sortDesc")})]}),A&&c("option",{onClick:()=>{h(b),o();},children:[e(Wo,{children:e(ep,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.clearSort")})]}),c("option",{onClick:()=>{g(),o();},children:[e(Wo,{children:e(Hr,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.configureSort")})]}),e(Dt,{}),c("option",{onClick:()=>{v(b),o();},selected:k,children:[e(Wo,{children:e(wr,{fontSize:"small"})}),e(Gt,{primary:x(k?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),T&&s&&c("option",{onClick:()=>{y(b),o();},selected:S,children:[e(Wo,{children:e(sn,{fontSize:"small"})}),e(Gt,{primary:x(S?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),e(Dt,{}),c("option",{onClick:()=>{u(b),o();},children:[e(Wo,{children:e(Ip,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.hideColumn")})]})]})},Vp=({open:t,onClose:o,columns:r,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=le(),[l,d]=eo.useState([]);eo.useEffect(()=>{t&&d(n.length>0?n.map(y=>({...y})):[]);},[t,n]);let p=eo.useMemo(()=>new Set(l.map(y=>y.field)),[l]),m=eo.useMemo(()=>r.filter(y=>!p.has(y.id)),[r,p]),f=()=>{let y=m[0];y&&d(g=>[...g,{field:y.id,direction:"asc"}]);},h=y=>{d(g=>g.filter((x,b)=>b!==y));},u=(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 e(Lt,{open:t,onClose:o,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:c(jsxRuntime.Fragment,{children:[e(ke,{className:"orb-table-sort-clear",variant:"neutral",disabled:l.length===0&&n.length===0,onClick:()=>{i(),o();},children:s("table.sortDialog.clearAll")}),e("span",{className:"orb-table-sort-action-spacer"}),e(ke,{variant:"neutral",onClick:o,children:s("common.cancel")}),e(ke,{variant:"primary",onClick:()=>{a(l),o();},children:s("common.ok")})]}),children:c("div",{className:"orb-table-sort-dialog-content",children:[l.length===0?e(L,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):e(se,{className:"orb-table-sort-rules",spacing:1,children:l.map((y,g)=>{let x=new Set(l.filter((C,k)=>k!==g).map(C=>C.field)),b=r.filter(C=>!x.has(C.id));return c("div",{className:"orb-table-sort-rule",children:[e(ni,{className:"orb-table-sort-order",badgeContent:g+1,color:"primary"}),e(zt,{size:"small",value:y.field,onChange:C=>u(g,{field:C.target.value}),options:b.map(C=>({value:C.id,label:C.label}))}),e(zt,{size:"small",value:y.direction,onChange:C=>u(g,{direction:C.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),e(ie,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g,-1),disabled:g===0,children:e(cl,{fontSize:"small"})}),e(ie,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g,1),disabled:g===l.length-1,children:e(ll,{fontSize:"small"})}),e(ie,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>h(g),children:e(ci,{fontSize:"small"})})]},`sort-rule-${g}`)})}),e(ke,{size:"small",onClick:f,disabled:m.length===0,startIcon:e(Hr,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};P();var oa=(t,o=2)=>t.toLocaleString(void 0,{maximumFractionDigits:o}),Wp=({kpis:t})=>{let{t:o}=le(),r=[{label:o("graph.kpi.totalRecords"),value:oa(t.totalRecords,0),color:"var(--orb-fg)"},{label:o("graph.kpi.totalReport"),value:oa(t.totalReportHours),color:"var(--orb-fg)"},{label:o("graph.kpi.totalBillable"),value:oa(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:oa(t.totalAmount),color:"var(--orb-primary)"},{label:o("graph.kpi.flagged"),value:oa(t.flaggedCount,0),color:"var(--orb-err)"}];return e("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:12},children:r.map(n=>c(Ae,{elevation:0,sx:{padding:12,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[e(L,{variant:"caption",muted:true,children:n.label}),e(L,{variant:"h3",sx:{fontWeight:800,color:n.color,fontVariantNumeric:"tabular-nums"},children:n.value})]},n.label))})};P();var Ti=({title:t,subtitle:o,children:r})=>c(Ae,{elevation:0,sx:{padding:16},children:[e(L,{variant:"h4",sx:{fontWeight:700},children:t}),o&&e(L,{variant:"body2",muted:true,sx:{marginBottom:16},children:o}),r]});P();var ra=({data:t,orientation:o="horizontal",valueSuffix:r="",minHeight:n=210,activeName:a,onItemClick:i})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let s=Math.max(...t.map(l=>l.value),1);return o==="vertical"?e("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:n},children:t.map(l=>c("div",{style:{flex:1,minWidth:0},children:[e("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}}),e(L,{variant:"caption",title:l.name,sx:{display:"block",mt:.5},children:l.name}),c(L,{variant:"caption",muted:true,children:[l.value.toFixed(1),r]})]},l.name))}):e(se,{spacing:1,children:t.map(l=>c("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[e(L,{variant:"caption",muted:true,title:l.name,children:l.name}),e("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:e("div",{style:{width:`${l.value/s*100}%`,height:"100%",background:l.name===a?"primary.dark":"primary.main"}})}),c(L,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[l.value.toFixed(1),r]})]},l.name))})};P();var $p=({data:t,color:o="var(--orb-chart-1)",valueSuffix:r="",height:n=220})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=t.map(h=>h.value),l=Math.min(...s,0),p=Math.max(...s,1)-l||1,m=t.map((h,u)=>{let v=i+u*(a-i*2)/Math.max(t.length-1,1),y=n-i-(h.value-l)/p*(n-i*2);return {x:v,y,...h}}),f=m.map(h=>`${h.x},${h.y}`).join(" ");return c("div",{children:[c("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[e("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),e("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:f}),m.map(h=>e("circle",{cx:h.x,cy:h.y,r:4,style:{fill:o}},h.name))]}),e("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(h=>c("div",{style:{minWidth:0},children:[e(L,{variant:"caption",title:h.name,sx:{display:"block"},children:h.name}),c(L,{variant:"caption",muted:true,children:[h.value.toFixed(1),r]})]},h.name))})]})};P();var _p=({data:t,barColor:o="var(--orb-chart-1)",lineColor:r="var(--orb-chart-5)",height:n=220})=>{if(t.length===0)return e(L,{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,u=Math.max(h*.5,8),v=i+f*h+(h-u)/2,y=m.barValue/s*(n-i*2),g=n-i-y;return {x:v,y:g,barHeight:y,barWidth:u,item:m}}),p=t.map((m,f)=>{let h=(a-i*2)/t.length,u=i+f*h+h/2,v=n-i-m.lineValue/l*(n-i*2);return {x:u,y:v,item:m}});return c(se,{spacing:1.25,children:[c("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[e("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),d.map(m=>e("rect",{x:m.x,y:m.y,width:m.barWidth,height:Math.max(m.barHeight,4),rx:6,style:{fill:o}},m.item.name)),e("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:p.map(m=>`${m.x},${m.y}`).join(" ")}),p.map(m=>e("circle",{cx:m.x,cy:m.y,r:3.5,style:{fill:r}},`${m.item.name}-line`))]}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(m=>c("div",{style:{minWidth:0},children:[e(L,{variant:"caption",title:m.name,sx:{display:"block"},children:m.name}),c(L,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",m.barValue.toFixed(1)]}),c(L,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",m.lineValue.toFixed(1)]})]},m.name))})]})};P();var ib=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)`},Gp=({data:t})=>{if(t.length===0)return e(L,{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 e("div",{style:{overflowX:"auto"},children:c("div",{style:{display:"grid",gridTemplateColumns:`120px repeat(${o.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+o.length*64},children:[e("div",{}),o.map(i=>e(L,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),r.map(i=>c("div",{style:{display:"contents"},children:[e(L,{variant:"caption",sx:{alignSelf:"center"},children:i}),o.map(s=>{let l=a.get(`${i}__${s}`)||0,d=l/n;return e("div",{sx:{height:36,borderRadius:1,background:ib(d),border:"1px solid color-mix(in oklch, var(--orb-muted) 20%, transparent)",display:"flex",alignItems:"center",justifyContent:"center"},children:e(L,{variant:"caption",sx:{fontWeight:700},children:l.toFixed(1)})},`${i}-${s}`)})]},i))]})})};P();var sb=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],Ii=({data:t,variant:o="donut",colors:r=sb,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return e(L,{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 c(se,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[e("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${l.join(", ")})`,position:"relative",flexShrink:0},children:o==="donut"&&e("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),e(se,{spacing:1,sx:{minWidth:180},children:t.map((d,p)=>c("div",{onClick:()=>i?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[e("div",{style:{width:10,height:10,borderRadius:"50%",background:r[p%r.length]}}),e(L,{variant:"caption",sx:{flex:1},children:d.name}),c(L,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};P();var Up=({effect:t,branches:o})=>{if(o.length===0)return e(L,{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 c(se,{spacing:1.5,children:[e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.map(a=>c("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[e(L,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>e(L,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))}),c("div",{style:{position:"relative",height:32},children:[e("div",{style:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),e("div",{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,background:"primary.main",color:"primary.contrastText"},children:e(L,{variant:"caption",sx:{fontWeight:700},children:t})})]}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(n.length,1)}, minmax(0, 1fr))`,gap:1},children:n.map(a=>c("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[e(L,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>e(L,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))})]})};P();var Kp=({data:t,height:o=240})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let r=0,n=t.map(f=>{let h=f.type==="total"?0:r,u=f.type==="total"?f.value:r+f.value;return f.type!=="total"&&(r=u),{...f,start:h,end:u,delta:u-h}}),a=n.flatMap(f=>[f.start,f.end]),i=Math.min(...a,0),s=Math.max(...a,1),l=680,d=30,p=s-i||1,m=f=>o-d-(f-i)/p*(o-d*2);return c("div",{children:[c("div",{component:"svg",viewBox:`0 0 ${l} ${o}`,style:{width:"100%",height:o},children:[e("line",{x1:d,y1:m(0),x2:l-d,y2:m(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((f,h)=>{let u=(l-d*2)/n.length,v=Math.max(u*.55,8),y=d+h*u+(u-v)/2,g=m(Math.max(f.start,f.end)),x=m(Math.min(f.start,f.end)),b=f.type==="total"?"var(--orb-chart-1)":f.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return c("g",{children:[e("rect",{x:y,y:g,width:v,height:Math.max(x-g,4),rx:6,style:{fill:b}}),e("text",{x:y+v/2,y:g-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:f.end.toFixed(1)})]},f.name)})]}),e("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(f=>e(L,{variant:"caption",title:f.name,children:f.name},f.name))})]})};var na=({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}`},IM=(t,o=360)=>{let r=na(t);return `<iframe width="100%" height="${o}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${r}"></iframe>`};P();var qp=({apiKey:t,query:o,embedUrl:r,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=r||(t&&o?na({apiKey:t,query:o,zoom:n,mapType:a}):"");return s?c("div",{children:[e("div",{component:"iframe",src:s,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),c(L,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",e("a",{href:s,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):e("div",{children:e(L,{variant:"body2",muted:true,children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var Ri=({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"};P();var Xp=({keyword:t,location:o,embedUrl:r,height:n=320})=>{let a=r||Ri({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0});return c("div",{children:[e("div",{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),c(L,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",e("a",{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};P();var Yp=({billableByPrimary:t,efficiencyBySecondary:o,statusDistribution:r,interaction:n})=>{let{t:a}=le();return c("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[e(Ti,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:e(ra,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),e(Ti,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:e(ra,{data:o,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),e(Ti,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:e(Ii,{data:r,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};P();var cb=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],db=["zh","en","de","fr","ja","ko"],Zp=({open:t,onClose:o,value:r,onSaveAll:n,modelOptions:a=cb,promptLangOptions:i=db,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:p})=>{let[m,f]=eo.useState(r),[h,u]=eo.useState(d||""),[v,y]=eo.useState(p||""),[g,x]=eo.useState(false);eo.useEffect(()=>{t&&(f(r),u(d||""),y(p||""));},[t,r,d,p]);let b=(k,S)=>{f(T=>({...T,[k]:S}));},C=async()=>{if(n)try{x(!0),await n({settings:m,analysisTemplateId:h||void 0,responseTemplateId:v||void 0});}finally{x(false);}};return c(Lt,{open:t,onClose:o,fullWidth:true,maxWidth:"lg",children:[c("div",{className:"orb-dialog-title",sx:{pr:7,pb:2.2},children:[e(L,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),e(L,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),e(ie,{onClick:o,sx:{position:"absolute",right:12,top:12},children:e(Sr,{})})]}),e("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:c(se,{spacing:2.2,children:[c("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[e("div",{children:e(ze,{size:"small",value:m.baseUrl,onChange:k=>b("baseUrl",k.target.value),fullWidth:true,label:"Base URL"})}),e("div",{children:e(ze,{size:"small",type:"password",value:m.apiKey,onChange:k=>b("apiKey",k.target.value),fullWidth:true,label:"API Key"})}),e("div",{children:e(ze,{size:"small",value:m.model,onChange:k=>b("model",k.target.value),fullWidth:true,select:true,label:"Model",children:a.map(k=>e("option",{value:k,children:k},k))})}),e("div",{children:e(ze,{size:"small",value:m.promptLang,onChange:k=>b("promptLang",k.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(k=>e("option",{value:k,children:k},k))})})]}),c("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[c(ze,{size:"small",value:h,onChange:k=>u(k.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[e("option",{value:"",children:"Default"}),s.map(k=>e("option",{value:k.id,children:k.label},k.id))]}),e($n,{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"}}}),c(ze,{size:"small",value:v,onChange:k=>y(k.target.value),fullWidth:true,select:true,label:"Response Template",children:[e("option",{value:"",children:"Default"}),l.map(k=>e("option",{value:k.id,children:k.label},k.id))]}),e($n,{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"}}})]})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[e(ke,{variant:"outlined",onClick:o,children:"Cancel"}),e(ke,{variant:"contained",onClick:C,disabled:!n||g,children:"Save"})]})]})};P();var Di=({open:t,onClose:o,model:r,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=le(),[d,p]=eo.useState(s?.defaultPrompt||""),[m,f]=eo.useState(false),[h,u]=eo.useState(false),v=i?.enabled!==false&&!!i,y=s?.enabled!==false,g=i?.filters||{},x=!!(g.primaryDimension||g.secondaryDimension||g.status),b=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";eo.useEffect(()=>{t&&p(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let C=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},k=async()=>{let S=d.trim();if(!(!S||!s?.onSubmit))try{f(!0),await s.onSubmit(S,{filters:g,model:r});}finally{f(false);}};return e(Lt,{open:t,onClose:o,fullWidth:true,maxWidth:1400,hideCloseButton:true,children:c("div",{style:{height:"80vh",display:"flex",flexDirection:"column",background:"var(--orb-canvas)"},children:[e("div",{style:{padding:16,borderBottom:"1px solid var(--orb-border)"},children:c(se,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[c(se,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[e(L,{variant:"h3",sx:{fontWeight:800},children:r.title}),e(xt,{label:l("graph.records",{count:r.kpis.totalRecords})}),v&&g.primaryDimension&&e(xt,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),v&&g.secondaryDimension&&e(xt,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),v&&g.status&&e(xt,{tone:"outline",label:`${i?.fieldMapping.status}: ${g.status}`,onDelete:()=>i?.onClearFilter("status")}),v&&x&&e(ke,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),c(se,{direction:"row",spacing:10,alignItems:"center",children:[y&&c("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:[e(ie,{size:"small",onClick:s?.onVoiceInput,children:e(za,{size:16,strokeWidth:1.8})}),e("input",{className:"orb-inp orb-inp-dense",value:d,onChange:S=>p(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),k());},placeholder:b,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),e(ie,{size:"small",onClick:k,disabled:m||!d.trim(),children:e(od,{size:16,strokeWidth:1.8})}),e(ie,{size:"small",onClick:()=>u(true),children:e(tn,{size:16,strokeWidth:1.8})})]}),e(ie,{onClick:o,children:e(qt,{size:18,strokeWidth:2})})]})]})}),c("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[e(Wp,{kpis:r.kpis}),e(Yp,{billableByPrimary:r.charts.billableByPrimary,efficiencyBySecondary:r.charts.efficiencyBySecondary,statusDistribution:r.charts.statusDistribution,interaction:v?{filters:g,onPrimaryDimensionClick:S=>i?.onPrimaryDimensionClick(S),onSecondaryDimensionClick:S=>i?.onSecondaryDimensionClick(S),onStatusClick:S=>i?.onStatusClick(S)}:void 0}),a,n]}),e(Zp,{open:h,onClose:()=>u(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 Rr={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"]},ub=5,jp=t=>t.toLowerCase().replace(/[\s_-]/g,""),Mr=(t,o,r,n)=>{if(o)return o;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[jp(s),s]));for(let s of r){let l=i.get(jp(s));if(l)return l}return a[0]||n},To=t=>{if(typeof t=="number")return Number.isFinite(t)?t:0;if(typeof t=="string"){let o=Number(t.replace(/,/g,"").trim());return Number.isFinite(o)?o:0}return 0},ho=(t,o)=>t==null||t===""?o:String(t),mb=(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)+To(s[r]));}),Array.from(i.entries()).map(([s,l])=>({name:s,value:l})).sort((s,l)=>l.value-s.value).slice(0,n)},gb=(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+=To(l[r]),p.billable+=To(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)},fb=(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}))},Qp=(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)+To(a[r]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},hb=(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+=To(l[r]),p.billable+=To(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)},bb=(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)+To(s[n]));}),Array.from(i.entries()).map(([s,l])=>{let[d,p]=s.split("__");return {x:d,y:p,value:l}})},vb=(t,o,r)=>{let n=Qp(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"}]},yb=(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)},mn=({rows:t,config:o})=>{let{t:r}=le(),n=r("graph.unassigned"),a=eo.useMemo(()=>{let m=o?.fieldMapping;return {primaryDimension:Mr(t,m?.primaryDimension,Rr.primaryDimension,"Category"),secondaryDimension:Mr(t,m?.secondaryDimension,Rr.secondaryDimension,"Owner"),status:Mr(t,m?.status,Rr.status,"Status"),date:Mr(t,m?.date,Rr.date,"Date"),description:Mr(t,m?.description,Rr.description,"Description"),reportHours:Mr(t,m?.reportHours,Rr.reportHours,"ReportHours"),billableHours:Mr(t,m?.billableHours,Rr.billableHours,"BillableHours"),amount:Mr(t,m?.amount,Rr.amount,"Amount")}},[t,o?.fieldMapping]),i=eo.useMemo(()=>t.map((m,f)=>{let h=To(m[a.reportHours]),u=To(m[a.billableHours]),v=To(m[a.amount]),y=h>0?u/h*100:0;return {id:`graph-row-${f}`,Date:ho(m[a.date],""),Primary:ho(m[a.primaryDimension],n),Secondary:ho(m[a.secondaryDimension],n),Description:ho(m[a.description],""),ReportHours:h,BillableHours:u,Amount:v,Efficiency:y,Status:ho(m[a.status],n)}}),[t,a,n]),s=eo.useMemo(()=>{let m=i.length,f=i.reduce((x,b)=>x+To(b.ReportHours),0),h=i.reduce((x,b)=>x+To(b.BillableHours),0),u=i.reduce((x,b)=>x+To(b.Amount),0),v=f>0?h/f*100:0,y=o?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>y.includes(ho(x.Status,"").toLowerCase())).length;return {totalRecords:m,totalReportHours:f,totalBillableHours:h,efficiency:v,totalAmount:u,flaggedCount:g}},[i,o?.statusFlagValues]),l=o?.topN||ub,d=eo.useMemo(()=>({billableByPrimary:mb(i,"Primary","BillableHours",l,n),efficiencyBySecondary:gb(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:fb(i,"Status",n),lineByDate:Qp(i,"Date","BillableHours"),comboByPrimary:hb(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:bb(i,"Primary","Secondary","BillableHours",n),waterfallBillable:vb(i,"Date","BillableHours"),fishboneStatusCauses:yb(i,"Status","Primary","Secondary",3,n)}),[i,l,n]),p=eo.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 gn=t=>String(t??"").trim(),Ai=(t={})=>{let[o,r]=eo.useState(t),n=eo.useCallback((d,p)=>{r(m=>{let f=p?.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=eo.useCallback(d=>{r(p=>{if(!p[d])return p;let m={...p};return delete m[d],m});},[]),i=eo.useCallback(()=>{r({});},[]),s=eo.useMemo(()=>!!(o.primaryDimension||o.secondaryDimension||o.status),[o]),l=eo.useCallback((d,p)=>d.filter(m=>!(o.primaryDimension&&gn(m[p.primaryDimension])!==gn(o.primaryDimension)||o.secondaryDimension&&gn(m[p.secondaryDimension])!==gn(o.secondaryDimension)||o.status&&gn(m[p.status])!==gn(o.status))),[o]);return {filters:o,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:l}};P();var Li=({variants:t,currentVariantId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=le(),[l,d]=eo.useState(false),[p,m]=eo.useState(""),[f,h]=eo.useState(false),[u,v]=eo.useState(false),y=t.find(b=>b.id===o),g=()=>{m(y?.name||s("variant.newVariant")),h(y?.isDefault||false),v(y?.isPublic||false),d(true);},x=()=>{n({name:p,isDefault:f,isPublic:u,description:""}),d(false);};return c("div",{className:"orb-variant-management",children:[e(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(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);}}),e(ct,{title:s("variant.saveView"),children:e(ie,{className:"orb-variant-save-button",onClick:g,size:"small",color:"primary",children:e(Pr,{fontSize:"small"})})}),c(Lt,{open:l,onClose:()=>d(false),children:[e("div",{className:"orb-dialog-title",children:s("variant.saveView")}),c("div",{className:"orb-dialog-content",children:[e(ze,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:p,onChange:b=>m(b.target.value)}),e(Jn,{control:e(It,{checked:f,onChange:b=>h(b.target.checked)}),label:s("variant.setDefault")}),e(Jn,{control:e(It,{checked:u,onChange:b=>v(b.target.checked)}),label:s("variant.publicAllUsers")})]}),c("div",{className:"orb-dialog-actions",children:[e(ke,{onClick:()=>d(false),children:s("common.cancel")}),e(ke,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};P();var eu=({appId:t,tableKey:o="default",currentFilters:r,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:l,onError:d,onSuccess:p,currentVariantId:m,onVariantChange:f})=>{let{t:h}=le(),[u,v]=eo.useState([]),[y,g]=eo.useState(""),x=`orbcafe.variants.${t}.${o}`,b=m!==void 0?m:y,C=D=>{m===void 0&&g(D),f&&f(D);},k=eo.useCallback(()=>{try{let D=localStorage.getItem(x);if(!D)return [];let E=JSON.parse(D);return Array.isArray(E)?E:[]}catch{return []}},[x]),S=eo.useCallback(D=>{try{localStorage.setItem(x,JSON.stringify(D));}catch{}},[x]),T=eo.useCallback(D=>{v(D);let E=D.find(O=>O.isDefault);E&&!b&&(C(E.id),i(E));},[b,i,C]),I=eo.useCallback(async()=>{if(!t)return [];try{let D=[];if(s)D=await s.getVariants(t,o);else if(l){let E=await fetch(`${l}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!E.ok)throw new Error(h("variant.toast.fetchFailed"));D=await E.json();}else D=k();return T(D),D}catch(D){console.error("Error fetching variants",D);let E=k();return T(E),d&&d(h("variant.toast.fetchFailed")),E}},[t,o,s,l,k,T,d,h]);return eo.useEffect(()=>{I();},[t,o]),e(Li,{variants:u,currentVariantId:b,onLoad:D=>{C(D.id),i(D);},onSave:async D=>{let E=Date.now().toString(),O;try{let _=D.scope||"Both",J=u.find(X=>X.name===D.name);E=J?J.id:Date.now().toString();let F=[];if(J&&(Array.isArray(J.filters)?F=[...J.filters]:J.filters&&(F=[{scope:"default",filters:J.filters}])),_==="Search"||_==="Both"){let X=(Array.isArray(r),r);if(X)if(Array.isArray(X)&&X.length>0&&X[0].scope)X.forEach(W=>{let H=F.findIndex(U=>U.scope===W.scope);H>=0?F[H]=W:F.push(W);});else {let W={scope:o,filters:X},H=F.findIndex(U=>U.scope===o);H>=0?F[H]=W:F.push(W);}}let V=J?.layout||{},z=[];if(J&&Array.isArray(J.layoutRefs)&&(z=[...J.layoutRefs]),_==="Layout"||_==="Both")if(a&&a.length>0)a.forEach(X=>{let W=z.findIndex(H=>H.tableKey===X.tableKey);W>=0?z[W]=X:z.push(X);});else {let X={tableKey:o,layoutId:n||null},W=z.findIndex(H=>H.tableKey===o);W>=0?z[W]=X:z.push(X);}if(O={appId:t,tableKey:o,...D,scope:_,id:E,createdAt:new Date().toISOString(),filters:F,layout:V,layoutRefs:z},s)await s.saveVariant(O,t,o);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})).ok)throw new Error(h("variant.toast.saveFailed"))}else {let W=u.some(H=>H.id===E)?u.map(H=>H.id===E?O:H):[...u,O];v(W),S(W);}p&&p(h("variant.toast.saveSuccess")),(s||l)&&await I(),C(E),i(O);}catch(_){console.error("Error saving variant",_);let F=u.some(V=>V.id===E)?u.map(V=>V.id===E?O:V):[...u,O];v(F),S(F),C(E),i(O),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 E=u.filter(O=>O.id!==D);v(E),S(E);}b===D&&C(""),(s||l)&&I(),p&&p(h("variant.toast.deleteSuccess"));}catch(E){console.error("Error deleting variant",E);let O=u.filter(_=>_.id!==D);v(O),S(O),b===D&&C(""),d&&d(h("variant.toast.deleteFailed"));}},onSetDefault:async D=>{try{let E=u.find(_=>_.id===D);if(!E)return;let O={appId:t,tableKey:o,...E,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(O)})).ok)throw new Error(h("variant.toast.defaultFailed"))}else {let _=u.map(J=>({...J,isDefault:J.id===D}));v(_),S(_);}(s||l)&&await I(),p&&p(h("variant.toast.defaultSuccess"));}catch(E){console.error("Error setting default variant",E);let O=u.map(_=>({..._,isDefault:_.id===D}));v(O),S(O),d&&d(h("variant.toast.defaultFailed"));}}})};P();ar__default.default.extend(Pb__default.default);ar__default.default.extend(Tb__default.default);ar__default.default.extend(ph__default.default);var ia="YYYY-MM-DD",Rb=[null,null],Vr="0.85rem",Mb={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Db=({isInRange:t,isStart:o,isEnd:r,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=so();return e(Gd,{...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%"}:{}]})},ou=({label:t,value:o=Rb,onChange:r})=>{let{t:n,locale:a}=le(),i=Mb[a]||"en",s=t||n("dateRange.label"),[l,d]=eo.useState(null),[p,m]=eo.useState(o),[f,h]=eo.useState("start"),[u,v]=eo.useState(null),[y,g]=eo.useState((o[0]||ar__default.default()).locale(i)),[x,b]=eo.useState(""),[C,k]=eo.useState(""),[S,T]=eo.useState(false),[I,w]=eo.useState(false),M=eo__namespace.default.useRef(o);eo.useEffect(()=>{let[X,W]=o,[H,U]=M.current,Y=ge=>ge&&typeof ge.isSame=="function",ue=!(X===null&&H===null||Y(X)&&Y(H)&&X.isSame(H,"day")),re=!(W===null&&U===null||Y(W)&&Y(U)&&W.isSame(U,"day"));(ue||re)&&(m(o),o[0]&&Y(o[0])&&g(o[0].locale(i))),M.current=o;},[o,i]),eo.useEffect(()=>{b(p[0]?p[0].locale(i).format(ia):""),k(p[1]?p[1].locale(i).format(ia):""),T(false),w(false);},[p,i]);let A=(X,W)=>{let H=W.trim(),U=X==="start"?T:w;if(!H){let re=X==="start"?[null,p[1]]:[p[0],null];U(false),m(re);return}let Y=ar__default.default(H,ia,true).locale(i);if(!Y.isValid()){U(true);return}U(false);let ue=[...p];if(X==="start")ue[0]=Y,ue[1]&&Y.isAfter(ue[1],"day")&&(ue[1]=null),h(ue[1]?"start":"end");else {let re=ue[0];re&&Y.isBefore(re,"day")?(ue=[Y,null],h("end")):(ue[1]=Y,h("start"));}m(ue),g(Y);},R=X=>{d(X.currentTarget);},D=()=>{d(null),h("start"),v(null);},E=!!l,O=X=>{if(!X)return;let W=[...p];if(f==="start")W=[X,null],h("end");else {let H=W[0];H&&X.isBefore(H)?(W=[X,null],h("end")):(W=[H,X],h("start"));}m(W);},_=X=>{let W=ar__default.default().locale(i),H=[null,null];switch(X){case "today":H=[W,W];break;case "week":H=[W.startOf("week"),W.endOf("week")];break;case "month":H=[W.startOf("month"),W.endOf("month")];break}m(H),h("start"),g(W);},J=()=>{r&&r(p),D();},F=()=>{m(o),h("start"),D();},V=eo.useCallback(X=>{let{day:W,...H}=X,[U,Y]=p,ue=U?W.isSame(U,"day"):false,re=Y?W.isSame(Y,"day"):false,ge=U&&Y?W.isBetween(U,Y,"day","()"):false,we=false;return f==="end"&&U&&!Y&&u&&W.isAfter(U,"day")&&W.isBefore(u.add(1,"day"),"day")&&(we=true),e(Db,{...H,day:W,disableMargin:true,isStart:ue,isEnd:re,isInRange:ge||we,onMouseEnter:()=>v(W)})},[p,f,u]),z=X=>X?X.locale(i).format("YYYY-MM-DD"):"";return c("div",{className:"orb-date-range-picker",children:[e(ze,{className:"orb-date-range-field",label:s,value:p[0]?`${z(p[0])} - ${z(p[1])}`:"",onClick:R,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Vr}},InputProps:{readOnly:true,sx:{fontSize:Vr,"& .orb-inp":{fontSize:Vr},paddingRight:"4px"},endAdornment:e(ie,{className:"orb-date-range-calendar-trigger",size:"small",onClick:R,tooltip:s,children:e(Tt,{name:"calendar",size:16})})}}),c(ii,{open:E,anchorEl:l,onClose:D,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[e("div",{className:"orb-date-range-inputs",children:c(se,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[e(ze,{className:"orb-date-range-manual-field",label:n("dateRange.startDate"),placeholder:ia,value:x,error:S,size:"small",onFocus:()=>h("start"),onChange:X=>{b(X.target.value),S&&T(false);},onBlur:()=>A("start",x),onKeyDown:X=>{X.key==="Enter"&&(X.preventDefault(),A("start",x));},sx:{"& .orb-inp":{fontSize:Vr,py:.75},"& label":{fontSize:Vr}}}),e(Xd,{color:"action",fontSize:"small"}),e(ze,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:ia,value:C,error:I,size:"small",onFocus:()=>{p[0]&&h("end");},onChange:X=>{k(X.target.value),I&&w(false);},onBlur:()=>A("end",C),onKeyDown:X=>{X.key==="Enter"&&(X.preventDefault(),A("end",C));},sx:{"& .orb-inp":{fontSize:Vr,py:.75},"& label":{fontSize:Vr}}})]})}),e("div",{className:"orb-date-range-shortcuts",children:c(se,{direction:"row",spacing:1,justifyContent:"center",children:[e(xt,{label:n("dateRange.today"),onClick:()=>_("today"),clickable:true,size:"small",variant:"outlined"}),e(xt,{label:n("dateRange.thisWeek"),onClick:()=>_("week"),clickable:true,size:"small",variant:"outlined"}),e(xt,{label:n("dateRange.thisMonth"),onClick:()=>_("month"),clickable:true,size:"small",variant:"outlined"})]})}),e("div",{className:"orb-date-range-calendar",children:e(Kd,{dateAdapter:oi,adapterLocale:i,children:e(Ud,{value:null,referenceDate:y,onMonthChange:g,onYearChange:g,onChange:O,slots:{day:V},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),e(Dt,{}),c(se,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[e(ke,{size:"small",onClick:F,color:"inherit",children:n("common.cancel")}),e(ke,{size:"small",variant:"contained",onClick:J,children:n("common.done")})]})]})]})};P();var Fi={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Eb={equals:"smartFilter.operator.equals",contains:"smartFilter.operator.contains",notContains:"smartFilter.operator.notContains",wildcard:"smartFilter.operator.wildcard","=":"smartFilter.operator.equals","!=":"smartFilter.operator.notEquals",">":"smartFilter.operator.greaterThan","<":"smartFilter.operator.lessThan",">=":"smartFilter.operator.greaterOrEqual","<=":"smartFilter.operator.lessOrEqual",between:"smartFilter.operator.between"},Lb=["contains","notContains",">",">=","<","<=","equals"],nu=["=","!=",">","<",">=","<=","between"],ro="0.85rem",Ob=({field:t,value:o,onChange:r})=>{let{t:n}=le(),[a,i]=eo.useState(null),[s,l]=eo.useState(null),[d,p]=eo.useState(null),[m,f]=eo.useState(""),[h,u]=eo.useState(""),[v,y]=eo.useState(""),[g,x]=eo.useState("");eo.useEffect(()=>{let R=setTimeout(()=>{x(v);},1e3);return ()=>clearTimeout(R)},[v]);let b=o?.operator||(t.type==="number"?"=":"equals"),C=o?.value,k=R=>{let D=Eb[R];return D?n(D):R},S=R=>{i(a?null:R.currentTarget);},T=R=>{r({...o,operator:R,value:C}),i(null);},I={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:ro}},InputProps:{sx:{fontSize:ro}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:ro,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},w=t.type||"text";if(w==="date"){let D=(E=>{if(!E)return [null,null];if(Array.isArray(E)&&E.length===2){let O=E[0]?ar__default.default.isDayjs(E[0])?E[0]:ar__default.default(E[0]):null,_=E[1]?ar__default.default.isDayjs(E[1])?E[1]:ar__default.default(E[1]):null;return [O,_]}return ar__default.default.isDayjs(E)||typeof E=="string"?[ar__default.default.isDayjs(E)?E:ar__default.default(E),null]:[null,null]})(C);return e(ou,{label:t.label,value:D,onChange:E=>r({value:E,operator:"between"})})}if(w==="number"&&b==="between"){let R=()=>{r({value:[m,h],operator:"between"}),l(null);},D=Array.isArray(C)?`${C[0]||""} - ${C[1]||""}`:"";return c(jsxRuntime.Fragment,{children:[e(ze,{...I,label:t.label,value:D,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...I.InputProps,startAdornment:e(cr,{position:"start",children:e(ct,{title:k("between"),children:e(ie,{size:"small",onClick:S,sx:{width:24,height:24,fontSize:ro},children:Fi.between})})}),readOnly:true},onClick:E=>l(s?null:E.currentTarget)}),e(Qt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:ro,minHeight:"auto",py:.5}}},children:nu.map(E=>c("option",{selected:E===b,onClick:()=>T(E),children:[e("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Fi[E]}),e(Gt,{primary:k(E),primaryTypographyProps:{fontSize:ro}})]},E))}),e(ii,{open:!!s,anchorEl:s,onClose:()=>l(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:c("div",{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[e(ze,{size:"small",label:n("smartFilter.min"),type:"number",value:m,onChange:E=>f(E.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:ro}},InputProps:{sx:{fontSize:ro}}}),e(Yd,{color:"action"}),e(ze,{size:"small",label:n("smartFilter.max"),type:"number",value:h,onChange:E=>u(E.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:ro}},InputProps:{sx:{fontSize:ro}}}),e(ke,{variant:"contained",size:"small",onClick:R,children:n("common.ok")})]})})]})}if(t.isValueHelp||w==="value-help"){let R=t.valueHelp?.mode||"single";return e(Ap,{...I,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:C??(R==="multiple"?[]:null),mode:R,onChange:D=>r({value:D,operator:R==="multiple"?"anyOf":"equals"})})}if(w==="select")return c(zt,{size:"small",fullWidth:true,label:t.label,value:C||"",onChange:R=>r({...o,value:R.target.value,operator:"equals"}),children:[e("option",{value:"",children:n("common.none")}),t.options?.map(R=>e("option",{value:R.value,children:R.label},R.value))]});if(w==="multi-select"){let R=Array.isArray(C)?C:[],D=t.options?.filter(V=>V.label.toLowerCase().includes(g.toLowerCase()))||[],E=V=>t.options?.find(z=>z.value===V)?.label||V,O=R.map(E),_=O.length===0?n("common.none"):O.length>2?`${O.slice(0,2).join(", ")} +${O.length-2}`:O.join(", "),J=()=>{p(null),y(""),x("");},F=V=>{let z=R.includes(V)?R.filter(X=>X!==V):[...R,V];r({...o,value:z,operator:"anyOf"});};return c("div",{className:"orb-fld",children:[e("label",{children:t.label}),c(ke,{variant:"outlined",size:"small",onClick:V=>p(d?null:V.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:ro,fontWeight:400},children:[e("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:_}),e($o,{fontSize:"small"})]}),e(Qt,{anchorEl:d,open:!!d,onClose:J,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:c("div",{onClick:V=>V.stopPropagation(),sx:{display:"grid",gap:.35},children:[e(ze,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:e(cr,{position:"start",children:e(zr,{fontSize:"small"})}),sx:{fontSize:ro}},value:v,onChange:V=>y(V.target.value),onKeyDown:V=>V.stopPropagation()}),D.length>0?D.map(V=>{let z=R.includes(V.value);return c("div",{role:"option","aria-selected":z,tabIndex:0,className:`orb-menu-item ${z?"orb-selected":""}`,onClick:()=>F(V.value),onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),F(V.value));},children:[e(It,{checked:z,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),e(Gt,{primary:V.label})]},String(V.value))}):e("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let M=w==="number"?nu:Lb;return c(jsxRuntime.Fragment,{children:[e(ze,{...I,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:C||"",type:w==="number"?"number":"text",onChange:R=>r({...o,value:R.target.value,operator:b}),InputProps:{...I.InputProps,startAdornment:e(cr,{position:"start",children:e(ct,{title:k(b),children:e(ie,{className:"orb-filter-operator-trigger",size:"small",onClick:S,onMouseDown:R=>R.preventDefault(),sx:{width:24,height:24,fontSize:ro,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Fi[b]})})}),endAdornment:t.hasSearchIcon?e(cr,{position:"end",children:e(zr,{color:"action"})}):void 0}}),e(Qt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:ro,minHeight:"auto",py:.5}}},children:M.map(R=>c("option",{selected:R===b,onClick:()=>T(R),children:[e("span",{className:"orb-filter-operator-symbol",children:Fi[R]}),e(Gt,{primary:k(R),primaryTypographyProps:{fontSize:ro}})]},R))})]})},_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:f,tableKey:h,currentLayout:u,currentLayoutId:v,layoutRefs:y,variantService:g,serviceUrl:x})=>{let{t:b}=le(),[C,k]=eo.useState(true),[S,T]=eo.useState(null),[I,w]=eo.useState(t.filter(D=>!D.hidden).map(D=>D.id)),M=(D,E)=>{r({...o,[D]:E});},A=D=>{I.includes(D)?w(I.filter(E=>E!==D)):w([...I,D]);};return c(Ae,{className:`orb-smart-filter ${C?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[C?c(jsxRuntime.Fragment,{children:[c("div",{className:"orb-smart-filter-header",children:[f?e(eu,{appId:f,tableKey:h,currentFilters:{values:o,visibleFields:I},currentLayout:u,currentLayoutId:v,layoutRefs:y,onLoad:D=>{if(!D.filters)return;let E=null;if(Array.isArray(D.filters)){let O=h||"default",_=D.filters.find(J=>J.scope===O);E=_?_.filters:null;}else E=D.filters;E&&(E.values||E.visibleFields?(E.visibleFields&&Array.isArray(E.visibleFields)&&w(E.visibleFields),E.values&&r(E.values)):r(E)),i&&i(D);},variantService:g,serviceUrl:x,currentVariantId:a}):e(Li,{variants:n,currentVariantId:a,onLoad:i,onSave:D=>{s&&s({...D,filters:{values:o,visibleFields:I}});},onDelete:l,onSetDefault:d}),c("div",{className:"orb-smart-filter-actions",children:[e(ct,{title:b("smartFilter.addFilters"),children:e(ke,{className:"orb-smart-filter-adapt",onClick:D=>T(S?null:D.currentTarget),size:"small",color:"primary",startIcon:e(Cp,{fontSize:"small"}),sx:{textTransform:"none",fontSize:ro,whiteSpace:"nowrap",minWidth:"fit-content"},children:b("smartFilter.adaptFilters")})}),e(ie,{className:"orb-smart-filter-go",tooltip:b("smartFilter.go"),"aria-label":b("smartFilter.go"),onClick:p,disabled:m,children:m?e(Zo,{size:16}):e(Tt,{name:"play",size:16})}),c(Qt,{anchorEl:S,open:!!S,onClose:()=>T(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:ro,minHeight:32}}}},children:[e("option",{disabled:true,children:e(Gt,{primary:b("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:ro}})}),e(Dt,{}),t.map(D=>c("option",{onClick:()=>A(D.id),children:[e(It,{checked:I.includes(D.id),size:"small"}),e(Gt,{primary:D.label,primaryTypographyProps:{fontSize:ro}})]},D.id))]})]})]}),e("div",{className:"orb-smart-filter-grid",children:e(sl,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(D=>I.includes(D.id)).map(D=>e(sl,{size:1,children:e(Ob,{field:D,value:o[D.id]||{value:"",operator:D.type==="number"?"=":"equals"},onChange:E=>M(D.id,E)})},D.id))})})]}):null,e("div",{className:"orb-smart-filter-toggle",children:e(ie,{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?e(di,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):e($o,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};P();var au=({layouts:t,currentLayoutId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=le(),[l,d]=eo.useState(null),[p,m]=eo.useState(false),[f,h]=eo.useState(""),[u,v]=eo.useState(""),[y,g]=eo.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();},S=()=>{h(""),v(""),g({isDefault:false,isPublic:false}),m(true),C();},T=()=>{f.trim()&&(n({name:f,description:u,...y}),m(false));};return c("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[e(ct,{title:s("layout.layoutOptions"),children:e(ie,{onClick:b,color:x?"primary":"default",size:"small",children:e(Tp,{fontSize:"small"})})}),c(Qt,{anchorEl:l,open:!!l,onClose:C,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[e("option",{disabled:true,children:e(L,{variant:"caption",children:s("layout.selectLayout")})}),c("option",{onClick:S,children:[e(Wo,{children:e(Pr,{fontSize:"small"})}),e(Gt,{children:s("layout.saveCurrentLayout")})]}),e(Dt,{}),t.length===0&&e("option",{disabled:true,children:e(L,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((I,w)=>e("option",{onClick:()=>k(I),selected:I.id===o,children:c("div",{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[c("div",{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[e("div",{sx:{display:"flex",alignItems:"center",gap:1},children:e(L,{variant:"body2",fontWeight:I.id===o?"bold":"normal",noWrap:true,children:I.name})}),I.description&&e(L,{variant:"caption",color:"text.secondary",noWrap:true,children:I.description})]}),c("div",{sx:{display:"flex",alignItems:"center"},onClick:M=>M.stopPropagation(),children:[e(ct,{title:I.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:e(ie,{size:"small",onClick:M=>{M.stopPropagation(),i(I.id);},children:I.isDefault?e(Sp,{fontSize:"small",color:"warning"}):e(wp,{fontSize:"small"})})}),e(ct,{title:s("common.delete"),children:e(ie,{size:"small",color:"error",onClick:M=>{M.stopPropagation(),a(I.id);},children:e(li,{fontSize:"small"})})})]})]})},I.id||w))]}),e(Lt,{open:p,onClose:()=>m(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:c(jsxRuntime.Fragment,{children:[e(ke,{variant:"ghost",onClick:()=>m(false),children:s("common.cancel")}),e(ke,{onClick:T,variant:"primary",disabled:!f.trim(),children:s("common.save")})]}),children:c("div",{className:"orb-layout-save-form",children:[e(ze,{label:s("layout.layoutName"),value:f,onChange:I=>h(I.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(I=>I.name===f)&&e(L,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),e(ze,{label:s("layout.layoutDescription"),value:u,onChange:I=>v(I.target.value),fullWidth:true,size:"small"}),e(It,{className:"orb-layout-save-option",checked:y.isDefault,onChange:I=>g({...y,isDefault:I.target.checked}),label:s("layout.useAsDefault")}),e(It,{className:"orb-layout-save-option",checked:y.isPublic,onChange:I=>g({...y,isPublic:I.target.checked}),label:s("layout.publicAllUsers")})]})})]})};P();var hn=({appId:t,tableKey:o="default",currentLayoutData:r,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:l,onSuccess:d})=>{let{t:p}=le(),[m,f]=eo.useState([]),[h,u]=eo.useState(""),v=`orbcafe.layouts.${t}.${o}`,y=w=>({id:w.layoutId,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt??new Date().toISOString(),layoutData:w.layout??{}}),g=w=>({appId:t,tableKey:o,layoutId:w.id,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt,layout:w.layoutData}),x=eo.useCallback(()=>{try{let w=localStorage.getItem(v);if(!w)return [];let M=JSON.parse(w);return Array.isArray(M)?M:[]}catch{return []}},[v]),b=eo.useCallback(w=>{try{localStorage.setItem(v,JSON.stringify(w));}catch{}},[v]);eo.useEffect(()=>{i!==void 0&&u(i);},[i]),eo.useEffect(()=>{if(a&&m.length>0){let w=m.find(M=>M.id===a);w&&(u(w.id),n(w));}},[a,m,n]);let C=eo.useCallback(async()=>{if(t){if(!s){let w=x();f(w);let M=w.find(A=>A.isDefault);M&&!h&&!a&&(u(M.id),n(M));return}try{let w=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!w.ok)throw new Error("LAYOUT_FETCH_FAILED");let A=(await w.json()).map(y);f(A);let R=A.find(D=>D.isDefault);R&&!h&&!a&&(u(R.id),n(R));}catch(w){console.error("Error fetching layouts",w);let M=x();f(M);let A=M.find(R=>R.isDefault);A&&!h&&!a&&(u(A.id),n(A)),l&&l(p("layout.toast.loadFallback"));}}},[t,o,s,l,h,n,a,x,p]);return eo.useEffect(()=>{C();},[t,o]),e(au,{layouts:m,currentLayoutId:h,onLoad:w=>{u(w.id),n(w);},onSave:async w=>{let M=m.find(D=>D.name===w.name),A=M?M.id:Date.now().toString(),R={id:A,...w,createdAt:new Date().toISOString(),layoutData:r,isDefault:w.isDefault??false,isPublic:w.isPublic??false};if(!s){let E=m.some(O=>O.id===A)?m.map(O=>O.id===A?R:O):[...m,R];f(E),b(E),u(A),n(R),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(R))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(p("layout.toast.saveSuccess")),await C(),u(A),n(R);}catch(D){console.error("Error saving layout",D);let O=m.some(_=>_.id===A)?m.map(_=>_.id===A?R:_):[...m,R];f(O),b(O),u(A),n(R),d&&d(p("layout.toast.saveLocalSuccess")),l&&l(p("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async w=>{if(!s){let M=m.filter(A=>A.id!==w);f(M),b(M),h===w&&u(""),d&&d(p("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(w)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");h===w&&u(""),d&&d(p("layout.toast.deleteSuccess")),await C();}catch(M){console.error("Error deleting layout",M);let A=m.filter(R=>R.id!==w);f(A),b(A),h===w&&u(""),d&&d(p("layout.toast.deleteLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async w=>{if(!s){let M=m.map(A=>({...A,isDefault:A.id===w}));f(M),b(M),d&&d(p("layout.toast.defaultLocalSuccess"));return}try{let M=m.find(R=>R.id===w);if(!M)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...M,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(p("layout.toast.defaultSuccess")),await C();}catch(M){console.error("Error setting default",M);let A=m.map(R=>({...R,isDefault:R.id===w}));f(A),b(A),d&&d(p("layout.toast.defaultLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDefaultLocal"));}}})};var Bi=(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},Hi=(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 su(t,o,r){return o[r]<t[r]?-1:o[r]>t[r]?1:0}function Fb(t,o){return t==="desc"?(r,n)=>su(r,n,o):(r,n)=>-su(r,n,o)}function Bb(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 bn=t=>{let o=!!t.disableGrouping,r=!!t.disableSorting,n=eo.useCallback(Z=>{let j=String(Z?.label??Z?.id??"").length*9+64,he=typeof Z?.minWidth=="number"?Z.minWidth:0;return Math.max(100,he,j)},[]),a=eo.useCallback(()=>(t.columns||[]).filter(Z=>!!Z?.numeric).map(Z=>Z.id),[t.columns]),[i,s]=eo.useState(""),[l,d]=eo.useState(t.order||"asc"),[p,m]=eo.useState(t.orderBy||""),[f,h]=eo.useState([]),[u,v]=eo.useState(t.page||0),[y,g]=eo.useState(t.rowsPerPage||20),[x,b]=eo.useState(t.selected||[]),[C,k]=eo.useState(t.columns?t.columns.map(Z=>Z.id):[]),[S,T]=eo.useState(t.columns?t.columns.map(Z=>Z.id):[]),[I,w]=eo.useState(t.showSummary||false),[M,A]=eo.useState(()=>a()),[R,D]=eo.useState([]),[E,O]=eo.useState(new Set),[_,J]=eo.useState(()=>{let Z={};return (t.columns||[]).forEach($=>{Z[$.id]=n($);}),Z}),[F,V]=eo.useState(null),[z,X]=eo.useState(null),[W,H]=eo.useState(null),[U,Y]=eo.useState(null),[ue,re]=eo.useState(false),[ge,we]=eo.useState(""),[Ve,Te]=eo.useState(""),Ie=o?[]:R,He=eo.useCallback(Z=>{if(o){D([]),O(new Set),X(null);return}D(Z);},[o]);eo.useEffect(()=>{o&&(D([]),O(new Set),X(null));},[o]),eo.useEffect(()=>{r&&(d("asc"),m(""),h([]));},[r]),eo.useEffect(()=>{t.layout&&St(t.layout);},[t.layout]),eo.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]),eo.useEffect(()=>{t.selected!==void 0&&b(t.selected);},[t.selected]),eo.useEffect(()=>{t.page!==void 0&&v(t.page);},[t.page]),eo.useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),eo.useEffect(()=>{let Z=a();A($=>$.filter(he=>Z.includes(he)));},[a]),eo.useEffect(()=>{J(Z=>{let $={...Z};return (t.columns||[]).forEach(j=>{$[j.id]===void 0&&($[j.id]=n(j));}),$});},[t.columns,n]),eo.useEffect(()=>{T(Z=>{let $=(t.columns||[]).map(qe=>qe.id),j=new Set($),he=Z.filter(qe=>j.has(qe)),xe=new Set(he),Ee=$.filter(qe=>!xe.has(qe)),_e=[...he,...Ee];return _e.length===Z.length&&_e.every((qe,je)=>qe===Z[je])?Z:_e});},[t.columns]);let ce=eo.useMemo(()=>{let Z=t.columns||[];if(S.length===0)return Z;let $=new Map(Z.map(xe=>[xe.id,xe])),j=[],he=new Set;return S.forEach(xe=>{let Ee=$.get(xe);Ee&&(j.push(Ee),he.add(xe));}),Z.forEach(xe=>{he.has(xe.id)||j.push(xe);}),j},[t.columns,S]),be=eo.useMemo(()=>{let Z=t.rows||[];return i&&(Z=Z.filter($=>Object.keys($).some(j=>String($[j]).toLowerCase().includes(i.toLowerCase())))),Z},[t.rows,i]),We=eo.useMemo(()=>{if(r||t.onSortChange)return be;if(f.length>0){let Z=[...be];return Z.sort(($,j)=>{for(let he of f){let xe=$?.[he.field],Ee=j?.[he.field];if(!(xe==null&&Ee==null)){if(xe==null)return he.direction==="asc"?-1:1;if(Ee==null)return he.direction==="asc"?1:-1;if(xe<Ee)return he.direction==="asc"?-1:1;if(xe>Ee)return he.direction==="asc"?1:-1}}return 0}),Z}return p?Bb(be,Fb(l,p)):be},[be,l,p,f,t.onSortChange,r]),tt=eo.useCallback(Z=>{if(Ie.length===0)return Z.map(Ee=>({type:"row",data:Ee,id:Ee[t.rowKey||"id"]}));let $=[...Z].sort((Ee,_e)=>{for(let qe of Ie){if(Ee[qe]<_e[qe])return -1;if(Ee[qe]>_e[qe])return 1}return 0}),j=(Ee,_e=0)=>{if(_e>=Ie.length)return Ee;let qe=Ie[_e],je={},mt=[];return Ee.forEach(ft=>{let Mt=ft[qe],yt=`${qe}:${Mt}`;je[yt]||(je[yt]={key:yt,field:qe,value:Mt,children:[],count:0,level:_e},mt.push(je[yt])),je[yt].children.push(ft),je[yt].count++;}),mt.forEach(ft=>{ft.children&&(ft.children=j(ft.children,_e+1));}),mt},he=j($),xe=(Ee,_e="")=>{let qe=[];return Ee.forEach(je=>{if(je.children){let mt=_e?`${_e}>${je.key}`:je.key,ft=E.has(mt);qe.push({type:"group",id:mt,field:je.field,value:je.value,level:je.level,count:je.count,isExpanded:ft,childIds:(function Mt(yt){let B=[];return yt.children.forEach(Q=>{Q.children?B=B.concat(Mt(Q)):B.push(Q[t.rowKey||"id"]);}),B})(je)}),ft&&(qe=qe.concat(xe(je.children,mt)));}else qe.push({type:"row",data:je,id:je[t.rowKey||"id"],level:Ie.length});}),qe};return xe(he)},[Ie,E,t.rowKey]),nt=eo.useCallback(Z=>{if(Ie.length===0)return [];let $=[...Z].sort((xe,Ee)=>{for(let _e of Ie){if(xe[_e]<Ee[_e])return -1;if(xe[_e]>Ee[_e])return 1}return 0}),j=[],he=(xe,Ee,_e)=>{if(Ee>=Ie.length)return;let qe=Ie[Ee],je=new Map;xe.forEach(mt=>{let ft=mt[qe],Mt=je.get(ft);Mt?Mt.push(mt):je.set(ft,[mt]);}),je.forEach((mt,ft)=>{let Mt=`${qe}:${ft}`,yt=_e?`${_e}>${Mt}`:Mt;j.push(yt),he(mt,Ee+1,yt);});};return he($,0,""),j},[Ie]),it=eo.useMemo(()=>tt(We),[We,tt]),q=eo.useMemo(()=>nt(We),[We,nt]),De=eo.useMemo(()=>{let Z=(t.rows||[]).length;return typeof t.count=="number"&&t.count>Z},[t.count,t.rows]),Ce=eo.useMemo(()=>De?it:y>0?it.slice(u*y,u*y+y):it,[it,u,y,De]),Fe=eo.useMemo(()=>De&&typeof t.count=="number"?t.count:it.length,[it.length,De,t.count]),at=Z=>{O($=>{let j=new Set($);return j.has(Z)?j.delete(Z):j.add(Z),j});},Ze=Z=>{let $=q.filter(j=>j===Z||j.startsWith(`${Z}>`));O(j=>{let he=new Set(j);return $.forEach(xe=>he.add(xe)),he});},wt=Z=>{O($=>{let j=new Set($);return Array.from(j).forEach(he=>{(he===Z||he.startsWith(`${Z}>`))&&j.delete(he);}),j});},Rt=Z=>{if(!Z){O(new Set);return}O(new Set(q));},Ot=Z=>{let $=q.filter(j=>j.startsWith(`${Z}>`));return $.length===0?E.has(Z):E.has(Z)&&$.every(j=>E.has(j))},At=Z=>{if(r)return;f.length>0&&h([]);let $=p===Z&&l==="asc",j=p===Z&&l==="desc";if(t.onSortChange){$?t.onSortChange(Z,"desc"):j?t.onSortChange("","asc"):t.onSortChange(Z,"asc");return}$?(d("desc"),m(Z)):j?(d("asc"),m("")):(d("asc"),m(Z));},oe=Z=>{if(r){d("asc"),m(""),h([]);return}let $=Z.filter(j=>j&&j.field);h($),$.length>0&&m("");},Ke=()=>{h([]);},Oe=(Z,$)=>{J(j=>({...j,[Z]:$}));},de=Z=>{if(Z.target.checked){let $=be.map(j=>j[t.rowKey||"id"]);b($),t.onSelectionChange&&t.onSelectionChange($);return}b([]),t.onSelectionChange&&t.onSelectionChange([]);},ye=(Z,$)=>{let j=$[t.rowKey||"id"],he=x.indexOf(j),xe=[];he===-1?xe=xe.concat(x,j):he===0?xe=xe.concat(x.slice(1)):he===x.length-1?xe=xe.concat(x.slice(0,-1)):he>0&&(xe=xe.concat(x.slice(0,he),x.slice(he+1))),b(xe),t.onSelectionChange&&t.onSelectionChange(xe);},te=Z=>{v(Z),t.onPageChange&&t.onPageChange(Z);},ve=Z=>{g(Z),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(Z);},Ne=Z=>{let $=C.indexOf(Z),j=[...C];$===-1?j.push(Z):j.splice($,1),k(j);},Je=Z=>{if(o)return;let $=Ie.indexOf(Z),j=[...Ie];$===-1?j.push(Z):j.splice($,1),He(j);},st=Z=>{a().includes(Z)&&A(j=>j.includes(Z)?j.filter(he=>he!==Z):[...j,Z]);},pt=(Z,$)=>{!Z||!$||Z===$||T(j=>{let he=j.indexOf(Z),xe=j.indexOf($);if(he===-1||xe===-1)return j;let Ee=[...j];return Ee.splice(he,1),Ee.splice(xe,0,Z),Ee});},Bt=Z=>{let $=Z?.active?.id,j=Z?.over?.id;typeof $=="string"&&typeof j=="string"&&pt($,j);},Yt=Z=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:C,columnOrder:S,order:r?"asc":l,orderBy:r?"":p,sortBy:r?[]:f,grouping:Ie,columnWidths:_,showSummary:I,summaryColumns:M});},Vt=Z=>{let{layout:$,layoutId:j}=Hi(Z,t.tableKey||"default");j?(Te(j),we(j)):(Te(""),we("")),$&&($.visibleColumns&&k($.visibleColumns),Array.isArray($.columnOrder)&&T($.columnOrder),r?(d("asc"),m(""),h([])):($.order&&d($.order),$.orderBy&&m($.orderBy),Array.isArray($.sortBy)&&h($.sortBy)),$.grouping&&He($.grouping),$.columnWidths&&J($.columnWidths),$.showSummary!==void 0&&w(!!$.showSummary),Array.isArray($.summaryColumns)&&A($.summaryColumns));},St=Z=>{let $=Z?.layoutData||Z?.layout||Z||{};$.visibleColumns&&k($.visibleColumns),Array.isArray($.columnOrder)&&T($.columnOrder),r?(d("asc"),m(""),h([])):($.order&&d($.order),$.orderBy!==void 0&&m($.orderBy),Array.isArray($.sortBy)&&h($.sortBy)),$.grouping&&He($.grouping),$.columnWidths&&J($.columnWidths),$.showSummary!==void 0&&w(!!$.showSummary),Array.isArray($.summaryColumns)&&A($.summaryColumns),O(new Set),v(0),Z?.id&&we(Z.id),Te("");};eo.useEffect(()=>{t.layout&&Vt({layout:t.layout});},[t.layout]);let Wt=Z=>{Z.preventDefault(),Y(U===null?{mouseX:Z.clientX+2,mouseY:Z.clientY-6}:null);},bt=()=>{Y(null);},Nt=eo.useMemo(()=>{if(!I)return {};let Z={};t.columns.forEach(j=>{if(j.numeric&&M.includes(j.id)){let he=be.reduce((xe,Ee)=>{let _e=parseFloat(Ee[j.id]);return xe+(isNaN(_e)?0:_e)},0);Z[j.id]=he.toFixed(2);}else Z[j.id]="";});let $=t.columns.find(j=>C.includes(j.id)&&!j.numeric);return $&&!$.numeric&&(Z[$.id]="Total"),Z},[be,t.columns,I,M,C]),lt=()=>{if(!t.columns||!be)return;let Z=t.columns.map(Ee=>Ee.label).join(","),$=be.map(Ee=>t.columns.map(_e=>{let qe=Ee[_e.id];return `"${(qe==null?"":String(qe)).replace(/"/g,'""')}"`}).join(",")).join(`
184
+ `),j=`data:text/csv;charset=utf-8,${Z}
185
+ ${$}`,he=encodeURI(j),xe=document.createElement("a");xe.setAttribute("href",he),xe.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(xe),xe.click(),document.body.removeChild(xe);},Ft=()=>{re(true);},Zt=()=>{re(false);};return {isMobile:false,columns:ce,order:l,setOrder:d,orderBy:p,setOrderBy:m,sortBy:f,setSortBy:h,applyMultiSort:oe,clearMultiSort:Ke,columnOrder:S,setColumnOrder:T,filterText:i,setFilterText:s,visibleColumns:C,setVisibleColumns:k,showSummary:I,setShowSummary:w,summaryColumns:M,grouping:Ie,setGrouping:He,expandedGroups:E,setExpandedGroups:O,groupAnchorEl:z,setGroupAnchorEl:X,summaryAnchorEl:W,setSummaryAnchorEl:H,columnWidths:_,setColumnWidths:J,anchorEl:F,setAnchorEl:V,contextMenu:U,setContextMenu:Y,sensors:void 0,sortedAndFilteredRows:We,visibleRows:Ce,summaryRow:Nt,page:u,setPage:te,rowsPerPage:y,setRowsPerPage:ve,totalDisplayCount:Fe,selected:x,setSelected:b,isAllExpanded:q.length>0&&q.every(Z=>E.has(Z)),handleColumnResize:Oe,handleRequestSort:At,handleSelectAllClick:de,handleClick:ye,toggleSummaryColumn:st,handleDragEnd:Bt,handleColumnReorder:pt,handleExport:lt,handleContextMenu:Wt,handleCloseContextMenu:bt,toggleColumnVisibility:Ne,toggleGroupExpand:at,toggleGroupField:Je,handleToggleAll:Rt,handleExpandGroupRecursively:Ze,handleCollapseGroupRecursively:wt,isGroupFullyExpanded:Ot,handleLayoutLoad:St,handleVariantLoad:Vt,handleLayoutSave:Yt,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:C,order:r?"asc":l,orderBy:r?"":p,sortBy:r?[]:f,columnOrder:S,grouping:Ie,columnWidths:_,showSummary:I,summaryColumns:M},currentLayoutId:ge,layoutIdToLoad:Ve,onPageChange:te,onRowsPerPageChange:ve,graphReportOpen:ue,handleOpenGraphReport:Ft,handleCloseGraphReport:Zt}};P();var ND=t=>e("tbody",{...t}),AD=({align:t,...o})=>e("td",{align:t==="inherit"?void 0:t,...o}),ED=t=>e("div",{...t}),LD=t=>e("thead",{...t}),OD=t=>e("tr",{...t}),tr=t=>{let{t:o}=le(),r="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:m=false,fullWidth:f=false,maxHeight:h,loading:u=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g,rowKey:x,tableKey:b="default",graphReport:C,quickCreate:k,quickEdit:S,quickDelete:T,serviceUrl:I,disableGrouping:w=false,disableSorting:M=false}=t,A=n||o("table.title.default"),{isMobile:R,columns:D,order:E,orderBy:O,filterText:_,setFilterText:J,visibleColumns:F,showSummary:V,setShowSummary:z,summaryColumns:X,grouping:W,setGrouping:H,expandedGroups:U,groupAnchorEl:Y,setGroupAnchorEl:ue,summaryAnchorEl:re,setSummaryAnchorEl:ge,columnWidths:we,anchorEl:Ve,setAnchorEl:Te,contextMenu:Ie,sensors:He,sortedAndFilteredRows:ce,summaryRow:be,visibleRows:We,isAllExpanded:tt,page:nt,setPage:it,rowsPerPage:q,setRowsPerPage:De,totalDisplayCount:Ce,setSelected:Fe,handleColumnResize:at,handleRequestSort:Ze,handleSelectAllClick:wt,handleClick:Rt,toggleSummaryColumn:Ot,handleDragEnd:At,handleExport:oe,handleContextMenu:Ke,handleCloseContextMenu:Oe,toggleColumnVisibility:de,toggleGroupExpand:ye,handleToggleAll:te,handleExpandGroupRecursively:ve,handleCollapseGroupRecursively:Ne,isGroupFullyExpanded:Je,handleLayoutLoad:st,handleVariantLoad:pt,handleLayoutSave:Bt,effectiveAppId:Yt,currentLayoutData:Vt,currentLayoutId:St,layoutIdToLoad:Wt,graphReportOpen:bt,handleOpenGraphReport:Nt,handleCloseGraphReport:lt}=bn(t),Ft=C?.enabled??false,Zt=Ft&&(C?.interaction?.enabled??true),Z=Ai(),$=!!k?.enabled,j=!!S?.enabled,he=!!T?.enabled,xe=k?.fields,Ee=k?.excludeFields||[],_e=k?.initialValues||{},[qe,je]=eo__namespace.default.useState(false),[mt,ft]=eo__namespace.default.useState(false),[Mt,yt]=eo__namespace.default.useState({}),[B,Q]=eo__namespace.default.useState(false),[fe,Pe]=eo__namespace.default.useState(false),[et,Xe]=eo__namespace.default.useState({}),[kt,ht]=eo__namespace.default.useState(false),[gt,Ct]=eo__namespace.default.useState(false),no=u||mt||fe||gt,Et=eo__namespace.default.useMemo(()=>{let ne=[...D];if(Array.isArray(xe)&&xe.length>0){let me=new Set(xe);ne=ne.filter(ee=>me.has(ee.id));}if(Ee.length>0){let me=new Set(Ee);ne=ne.filter(ee=>!me.has(ee.id));}return ne.filter(me=>!!me?.id)},[D,Ee,xe]),jt=x||"id",Ht=eo__namespace.default.useMemo(()=>{let ne=new Set(s);return ce.filter(me=>ne.has(me?.[jt]))},[s,ce,jt]),Kt=Ht.length===1?Ht[0]:null,$t=S?.fields,oo=S?.excludeFields||[],ao=S?.editableFields||[],bo=S?.nonEditableFields||[],Ro=S?.primaryKeys?.length?S.primaryKeys:[jt],Mo=eo__namespace.default.useMemo(()=>{let ne=[...D];if(Array.isArray($t)&&$t.length>0){let me=new Set($t);ne=ne.filter(ee=>me.has(ee.id));}if(oo.length>0){let me=new Set(oo);ne=ne.filter(ee=>!me.has(ee.id));}return ne.filter(me=>!!me?.id)},[D,oo,$t]),ir=eo__namespace.default.useMemo(()=>new Set(Ro),[Ro]),xo=eo__namespace.default.useMemo(()=>new Set(ao),[ao]),Bo=eo__namespace.default.useMemo(()=>new Set(bo),[bo]),qr=eo__namespace.default.useCallback(ne=>xo.size>0?xo.has(ne):!(Bo.has(ne)||ir.has(ne)),[xo,Bo,ir]);eo__namespace.default.useEffect(()=>{!bt&&Z.hasActiveFilters&&Z.clearAll();},[bt,Z.hasActiveFilters,Z.clearAll]);let Xr=()=>{let ne={};Et.forEach(me=>{ne[me.id]=_e[me.id]??"";}),yt(ne),je(true);},Lr=()=>{mt||je(false);},Yr=(ne,me)=>{yt(ee=>({...ee,[ne]:me}));},Zr=async()=>{if(!k?.onSubmit){je(false);return}try{ft(!0),await k.onSubmit(Mt),je(!1);}finally{ft(false);}},Do=()=>{if(!Kt)return;let ne={};Mo.forEach(ee=>{ne[ee.id]=Kt[ee.id]??"";});let me=S?.getInitialValues?{...ne,...S.getInitialValues(Kt)}:ne;Xe(me),Q(true);},Or=()=>{fe||Q(false);},jr=(ne,me)=>{Xe(ee=>({...ee,[ne]:me}));},Xo=async()=>{if(Kt){if(!S?.onSubmit){Q(false);return}try{Pe(!0),await S.onSubmit(et,Kt),Q(!1);}finally{Pe(false);}}},sr=()=>{Ht.length!==0&&ht(true);},On=()=>{gt||ht(false);},Fr=async()=>{if(Ht.length===0){ht(false);return}if(!T?.onConfirm){ht(false),Fe([]),l?.([]);return}try{Ct(!0),await T.onConfirm(Ht),ht(!1),Fe([]),l?.([]);}finally{Ct(false);}},N=ce,{fieldMapping:G}=mn({rows:N,config:{...C,title:C?.title||`${A} ${o("graph.reportTitle")}`}}),K=eo__namespace.default.useMemo(()=>Zt?Z.applyRows(N,G):N,[Zt,Z.applyRows,N,G]),{model:pe}=mn({rows:K,config:{...C,title:C?.title||`${A} ${o("graph.reportTitle")}`,fieldMapping:G}}),Be=pe.table.columns.map(ne=>({id:ne.id,label:ne.label,align:ne.align||"left",minWidth:120,numeric:ne.align==="right"})),rt=Yt?e(hn,{appId:Yt,tableKey:b,currentLayoutData:Vt,onLayoutLoad:st,targetLayoutId:Wt,activeLayoutId:St,serviceUrl:I??g?.serviceUrl}):null,Ge=c(jsxRuntime.Fragment,{children:[!w&&e(pn,{groupAnchorEl:Y,setGroupAnchorEl:ue,grouping:W,setGrouping:H,columns:D}),e(un,{anchorEl:Ve,setAnchorEl:Te,columns:D,visibleColumns:F,toggleColumnVisibility:de}),e(ki,{anchorEl:re,setAnchorEl:ge,showSummary:V,setShowSummary:z,columns:D,summaryColumns:X,toggleSummaryColumn:Ot}),e(Pi,{contextMenu:Ie,handleCloseContextMenu:Oe,columns:D,visibleColumns:F,toggleColumnVisibility:de})]});return R?c("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g&&e(_o,{fields:g.fields,filters:g.filters,onFilterChange:g.onFilterChange,onSearch:g.onSearch,variants:g.variants||[],currentVariantId:g.currentVariantId,onVariantLoad:g.onVariantLoad,onVariantSave:g.onVariantSave,onVariantDelete:g.onVariantDelete,onVariantSetDefault:g.onVariantSetDefault,appId:g.appId,tableKey:b,currentLayout:[{tableKey:b,layoutData:Vt}],variantService:g.variantService,serviceUrl:I??g.serviceUrl}),e(Op,{title:A,loading:u,showSummary:V,setShowSummary:z,setAnchorEl:Te,setSummaryAnchorEl:ge,filterText:_,setFilterText:J,sortedAndFilteredRows:ce,selected:s,columns:D,visibleColumns:F,summaryRow:be,handleClick:Rt,selectionMode:i}),Ge]}):c("div",{sx:{width:f?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g&&e("div",{sx:{mb:2},children:e(_o,{fields:g.fields,filters:g.filters,onFilterChange:g.onFilterChange,onSearch:g.onSearch,variants:g.variants||[],currentVariantId:g.currentVariantId,onVariantLoad:ne=>{pt(ne),g.onVariantLoad&&g.onVariantLoad(ne);},onVariantSave:g.onVariantSave,onVariantDelete:g.onVariantDelete,onVariantSetDefault:g.onVariantSetDefault,loading:u,appId:g.appId,tableKey:b,currentLayout:[{tableKey:b,layoutData:Vt}],currentLayoutId:St,layoutRefs:[{tableKey:b,layoutId:St}],variantService:g.variantService,serviceUrl:I??g.serviceUrl})}),c(Ae,{className:"orb-ctable-surface",sx:{width:f?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":no?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, 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&&e(Ci,{filterText:_,setFilterText:J,onRowsPerPageChange:De,rowsPerPage:q,rowsPerPageOptions:v,page:nt,count:Ce,onPageChange:it,actions:d,extraTools:p,grouping:W,disableGrouping:w,groupAnchorEl:Y,setGroupAnchorEl:ue,showSummary:V,setShowSummary:z,anchorEl:Ve,setAnchorEl:Te,summaryAnchorEl:re,setSummaryAnchorEl:ge,handleExport:oe,showCreateButton:$,onOpenCreateDialog:Xr,showEditButton:j,onOpenEditDialog:Do,editDisabled:Ht.length!==1,showDeleteButton:he,onOpenDeleteConfirm:sr,deleteDisabled:Ht.length===0,onLayoutSave:y||g?.variantService&&g?.appId?Bt:void 0,loading:u,layoutManager:rt,onOpenGraphReport:Ft?Nt:void 0}),e("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:e(core.DndContext,{sensors:He,collisionDetection:core.closestCenter,onDragEnd:At,modifiers:[modifiers.restrictToHorizontalAxis],children:c("table",{className:"orb-tbl orb-ctable",style:{minWidth:f?750:void 0,width:f?"100%":"auto",tableLayout:Object.keys(we).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:r},"aria-labelledby":"tableTitle",children:[e(wi,{columns:D,visibleColumns:F,order:E,orderBy:O,onRequestSort:Ze,disableSorting:M,onContextMenu:Ke,selectionMode:i,grouping:W,isAllExpanded:tt,handleToggleAll:te,rowCount:ce.length,numSelected:s.length,onSelectAllClick:wt,columnWidths:we,onColumnResize:at}),e(Si,{visibleRows:We,columns:D,visibleColumns:F,selectionMode:i,selected:s,orderBy:O,loading:u,expandedGroups:U,toggleGroupExpand:ye,handleExpandGroupRecursively:ve,handleCollapseGroupRecursively:Ne,isGroupFullyExpanded:Je,handleClick:Rt,onSelectionChange:l,grouping:W,rowKeyProp:x,page:nt,rowsPerPage:q}),V&&e(Lp,{showSummary:V,columns:D,visibleColumns:F,summaryRow:be,selectionMode:i?.toString(),grouping:W,columnWidths:we,orderBy:O,zIndex:3})]})})})]}),$&&c(Lt,{open:qe,onClose:Lr,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:ne=>`1px solid ${ne.palette.divider}`,bgcolor:"background.paper"}}},children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||o("quickCreate.createWithTitle",{title:A})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("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",ee=ne.label||ne.id;return e(ze,{label:ee,value:Mt[ne.id]??"",onChange:Le=>Yr(ne.id,Le.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&&e(Jo,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:k.description})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(ke,{onClick:Lr,sx:{fontSize:"0.85rem"},disabled:mt,children:k?.cancelLabel||o("common.cancel")}),e(ke,{onClick:Zr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:mt,children:k?.submitLabel||o("common.save")})]})]}),j&&c(Lt,{open:B,onClose:Or,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:ne=>`1px solid ${ne.palette.divider}`,bgcolor:"background.paper"}}},children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:S?.title||o("quickEdit.editWithTitle",{title:A})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("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",ee=ne.label||ne.id,Le=qr(ne.id);return e(ze,{label:ee,value:et[ne.id]??"",onChange:Qe=>jr(ne.id,Qe.target.value),type:me,size:"small",fullWidth:true,disabled:!Le,InputLabelProps:{shrink:me==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${ne.id}`)}),S?.description&&e(Jo,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:S.description})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(ke,{onClick:Or,sx:{fontSize:"0.85rem"},disabled:fe,children:S?.cancelLabel||o("common.cancel")}),e(ke,{onClick:Xo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:fe||!Kt,children:S?.submitLabel||o("common.save")})]})]}),he&&e(Qn,{open:kt,type:"warning",title:T?.title||o("quickDelete.confirmTitle"),message:T?.message||(Ht.length>1?o("quickDelete.confirmMessageMultiple",{count:Ht.length}):o("quickDelete.confirmMessageSingle")),confirmText:T?.confirmText||o("common.delete"),cancelText:T?.cancelText||o("common.cancel"),onClose:On,onConfirm:Fr}),Ge,Ft&&e(Di,{open:bt,onClose:lt,model:pe,aiAssistant:C?.aiAssistant,interaction:Zt?{enabled:true,filters:Z.filters,fieldMapping:G,onPrimaryDimensionClick:ne=>Z.setFilter("primaryDimension",ne),onSecondaryDimensionClick:ne=>Z.setFilter("secondaryDimension",ne),onStatusClick:ne=>Z.setFilter("status",ne),onClearFilter:Z.clearFilter,onClearAll:Z.clearAll}:void 0,tableContent:e(tr,{appId:Yt||"graph-report-internal",title:o("graph.dataBody"),columns:Be,rows:pe.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},FD=tr;P();var _D=({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 c(bi,{title:o,hideHeader:r,children:[c(se,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l==="separated"&&d&&e("div",{sx:{flexShrink:0},children:e(_o,{...d})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:e(tr,{...p,fitContainer:true,filterConfig:l==="integrated"?d:void 0})})]}),i]})};var YD=({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}=le(),[p,m]=eo.useState(false),[f,h]=eo.useState([]),[u,v]=eo.useState({}),[y,g]=eo.useState(t.variants||[]),[x,b]=eo.useState(t.layout||null),[C,k]=eo.useState(""),[S,T]=eo.useState(0),[I,w]=eo.useState(0),[M,A]=eo.useState(r),[R,D]=eo.useState([]),[E,O]=eo.useState("asc"),[_,J]=eo.useState("");eo.useEffect(()=>{let re={};t.filters.forEach(ge=>{ge.defaultValue!==void 0&&(re[ge.id]=ge.defaultValue);}),v(re);},[t.filters]);let F=eo.useCallback(async(re,ge,we,Ve,Te)=>{m(true);try{let Ie={...re,page:ge+1,limit:we,sort:Te,order:Ve},He;o?He=await o(Ie):typeof t.api=="function"?He=await t.api(Ie):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,Ie),He={rows:[],total:0}):(console.warn("No API configured for report"),He={rows:[],total:0}),He&&(h(He.rows||[]),T(He.total||0));}catch(Ie){console.error("Failed to fetch report data",Ie);}finally{m(false);}},[t.api,o]);eo.useEffect(()=>{F(u,I,M,E,_);},[F,I,M,E,_]);let V=()=>{w(0),F(u,0,M,E,_);},z=re=>{w(0),A(re);},X=(re,ge)=>{O(ge),J(re);},W=re=>{v(re);},H=re=>{k(re?.id||"");let ge=Bi(re,a);if(ge){let Ve=ge.values??ge;v(Ve),F(Ve,0,M,E,_),w(0);}let{layout:we}=Hi(re,a);we&&b(we);},U=re=>{let ge={...re,id:Date.now().toString(),createdAt:new Date().toISOString()};g(we=>[...we,ge]);},Y=re=>{b(re);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:u,onFilterChange:W,onSearch:V,onVariantLoad:H,onVariantSave:U,onVariantDelete:re=>g(ge=>ge.filter(we=>we.id!==re)),onVariantSetDefault:re=>{g(ge=>ge.map(we=>({...we,isDefault:we.id===re})));},variants:y,currentVariantId:C,variantService:l,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:f,loading:p,rowKey:"id",count:S,page:I,rowsPerPage:M,rowsPerPageOptions:n,onPageChange:w,onRowsPerPageChange:z,selectionMode:"multiple",selected:R,onSelectionChange:D,onLayoutSave:Y,layout:x,title:t.title,showSummary:true,order:E,orderBy:_,serviceUrl:s,onSortChange:X,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:u,rows:f,loading:p,refresh:V}};P();var Gb=new Set(["id","title","description","icon","iconNode","meta"]),Ub=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,o=>o.toUpperCase()).trim(),Kb=t=>Object.entries(t).filter(([o,r])=>!Gb.has(o)&&r!==null&&r!==void 0&&["string","number","boolean"].includes(typeof r)).map(([o,r])=>({key:o,label:Ub(o),value:String(r)})),cu=({item:t,open:o,onClose:r,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=le(),p=fo()==="dark"?"var(--orb-p300)":"var(--orb-primary)";eo__namespace.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=Kb(t);return typeof document>"u"?null:reactDom.createPortal(c(jsxRuntime.Fragment,{children:[e("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"}}),c("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:[c(se,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[e("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??e(Tt,{name:t.icon??"product",size:30,style:{color:p}})}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?e(L,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),e(ie,{tooltip:s??l("cardPage.close"),"aria-label":s??l("cardPage.close"),onClick:r,children:e(Tt,{name:"decline",size:18})})]}),e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",p:2.5},children:a?a(t):c(jsxRuntime.Fragment,{children:[t.description?e(L,{component:"div",sx:{fontSize:"0.9rem",lineHeight:1.6,color:"text.primary"},children:t.description}):null,m.length>0?e("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:m.map(f=>c("div",{children:[e(L,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:f.label}),e(L,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:f.value})]},f.key))}):null]})}),n?e("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:e(ke,{variant:"contained",sx:{width:"100%"},startIcon:e(Tt,{name:"download",size:16}),onClick:()=>n(t),children:i??l("cardPage.download")})}):null]})]}),document.body)};P();var qb={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},Xb=({item:t,onDetailClick:o,onDownloadClick:r,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=le(),l=fo()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??e(Tt,{name:t.icon??"product",size:26,style:{color:l}});return c(Ae,{elevation:0,sx:{p:2,height:"100%",display:"flex",flexDirection:"column",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",boxShadow:"0 8px 20px rgba(15, 23, 42, 0.06)",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease","&:hover":{transform:"translateY(-2px)",borderColor:"primary.main",boxShadow:"0 14px 32px rgba(15, 23, 42, 0.12)"}},children:[c(se,{direction:"row",spacing:1.5,alignItems:"center",children:[e("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}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?e(L,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),e("div",{sx:{mt:1.5,flex:1,minHeight:0},children:e(L,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...qb},children:t.description||"\xA0"})}),c(se,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[e(ie,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>o?.(t),children:e(Tt,{name:"show",size:18})}),e(ie,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>r?.(t),children:e(Tt,{name:"download",size:18})})]})]})},pu=({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}=le(),[f,h]=eo__namespace.default.useState(null),[u,v]=eo__namespace.default.useState(false),y=x=>{r?.(x),d&&(h(x),requestAnimationFrame(()=>requestAnimationFrame(()=>v(true))));},g=()=>{v(false),setTimeout(()=>h(null),260);};return o?e("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:e(Zo,{})}):t.length?c(jsxRuntime.Fragment,{children:[e("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=>e(Xb,{item:x,onDetailClick:y,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&f?e(cu,{item:f,open:u,onClose:g,onDownloadClick:n,renderContent:p,downloadTooltip:s}):null]}):e("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:e(L,{sx:{color:"text.secondary"},children:l??m("cardPage.empty")})})};P();var bN=({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 c(bi,{title:o,hideHeader:r,children:[c(se,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l&&e("div",{sx:{flexShrink:0},children:e(_o,{...l})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:e(pu,{...a})})]}),i]})};var wN=({metadata:t,fetchData:o,tableKey:r="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,p]=eo.useState(false),[m,f]=eo.useState([]),[h,u]=eo.useState(0),[v,y]=eo.useState({}),[g,x]=eo.useState(t.variants||[]),[b,C]=eo.useState("");eo.useEffect(()=>{let A={};t.filters.forEach(R=>{R.defaultValue!==void 0&&(A[R.id]=R.defaultValue);}),y(A);},[t.filters]);let k=eo.useCallback(async A=>{p(true);try{let R=o?await o({...A}):{rows:[],total:0};f(R?.rows||[]),u(R?.total||0);}catch(R){console.error("Failed to fetch card page data",R);}finally{p(false);}},[o]);eo.useEffect(()=>{k(v);},[k]);let S=()=>{k(v);},T=A=>{y(A);},I=A=>{C(A?.id||"");let R=Bi(A,r);if(R){let D=R.values??R;y(D),k(D);}},w=A=>{let R={...A,id:Date.now().toString(),createdAt:new Date().toISOString()};x(D=>[...D,R]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:r,fields:t.filters,filters:v,onFilterChange:T,onSearch:S,onVariantLoad:I,onVariantSave:w,onVariantDelete:A=>x(R=>R.filter(D=>D.id!==A)),onVariantSetDefault:A=>{x(R=>R.map(D=>({...D,isDefault:D.id===A})));},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:S}};var Zb=t=>[...t].sort((o,r)=>r.value-o.value),PN=({bars:t=[],lines:o=[],combos:r=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=eo.useMemo(()=>Zb(t),[t]),l=eo.useMemo(()=>[...o],[o]),d=eo.useMemo(()=>[...r],[r]),p=eo.useMemo(()=>[...n],[n]),m=eo.useMemo(()=>{let h=a.reduce((u,v)=>u+v.value,0);return a.map(u=>({...u,percent:h>0?u.value/h*100:u.percent}))},[a]),f=eo.useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:p,pies:m,waterfalls:f}};var DN=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>eo.useMemo(()=>!t||!o?"":na({apiKey:t,query:o,zoom:r,mapType:n}),[t,o,r,n]),NN=({keyword:t,location:o})=>eo.useMemo(()=>Ri({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0}),[t,o]);P();var ca=({code:t,language:o="text",copyable:r=true,showLineNumbers:n=false,wrapLongLines:a=false,maxHeight:i})=>{let[s,l]=eo.useState(false),d=eo.useMemo(()=>t.replace(/\n$/,"").split(`
186
+ `),[t]);return c("div",{style:{border:"1px solid var(--orb-border)",borderRadius:12,overflow:"hidden",background:"var(--orb-canvas)"},children:[c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4.8px 8px",background:"var(--orb-hover)",borderBottom:"1px solid var(--orb-border)"},children:[e("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&&e(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?e(Ao,{size:14,strokeWidth:1.8}):e(Yo,{size:14,strokeWidth:1.8})})]}),e("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,f)=>c("div",{style:{display:"flex"},children:[e("span",{style:{width:34,flexShrink:0,textAlign:"right",paddingRight:8,color:"var(--orb-disabled-fg)",userSelect:"none"},children:f+1}),e("span",{style:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:m})]},`${f}-${m}`)):e("code",{style:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:t})})]})};P();var ov=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},rv=async t=>new Function("m","return import(m)")(t),da=({expression:t,inline:o=false,allowKatex:r=false})=>{let n=eo.useMemo(()=>ov(t),[t]),[a,i]=eo.useState("");return eo.useEffect(()=>{let s=true;return (async()=>{if(!r||!n){i("");return}try{let d=await rv("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?e(Re,{component:o?"span":"div",sx:{display:o?"inline-flex":"block",my:o?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):o?e(Re,{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}):e(Re,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:e(yo,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",fontSize:"0.9rem",lineHeight:1.5,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n})}):null};P();var iv=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]=eo.useState(""),[s,l]=eo.useState(""),[d,p]=eo.useState(false),m=eo.useMemo(()=>t.trim(),[t]);return eo.useEffect(()=>{let f=true;return (async()=>{if(!n||!m){i(""),l("");return}p(true),l(""),i("");try{let u=await iv("mermaid"),v=u?.default||u;if(!v||typeof v.render!="function")throw new Error("Mermaid runtime is not available");v.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let y=await v.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,m),g=typeof y=="string"?y:y?.svg;f&&typeof g=="string"&&i(g);}catch(u){if(f){let v=u instanceof Error?u.message:"Failed to render Mermaid diagram";l(v);}}finally{f&&p(false);}})(),()=>{f=false;}},[n,m]),c(Br,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[e(Re,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:e(yo,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:o})}),c(Re,{sx:{p:1},children:[d&&e(Re,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:e(Nd,{size:20})}),!d&&a&&e(Re,{sx:{maxHeight:r,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&c(Re,{children:[s&&e(Jo,{severity:"info",sx:{mb:1},children:s}),e(ca,{code:m,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};P();var bl=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(r=>r.trim()),lv=t=>/^:?-{3,}:?$/.test(t.trim()),cv=t=>{let o=t.trim(),r=o.startsWith(":"),n=o.endsWith(":");return r&&n?"center":n?"right":"left"},zi=t=>{let o=t.split(`
187
+ `).map(s=>s.trim()).filter(Boolean);if(o.length<2)return null;let r=bl(o[0]),n=bl(o[1]);if(r.length===0||n.length!==r.length||!n.every(lv))return null;let a=n.map(cv),i=o.slice(2).filter(s=>s.includes("|")).map(s=>{let l=bl(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}},vl=({markdown:t,table:o,maxHeight:r=360})=>{let n=eo.useMemo(()=>o||(t?zi(t):null),[o,t]);return !n||n.headers.length===0?e(Br,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:e(yo,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):e(Br,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:e(Od,{sx:{maxHeight:r},children:c(Ed,{size:"small",stickyHeader:true,children:[e(Fd,{children:e(il,{children:n.headers.map((a,i)=>e(al,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),e(Ld,{children:n.rows.map((a,i)=>e(il,{hover:true,children:a.map((s,l)=>e(al,{align:n.aligns[l],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||e(Re,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${l}`))},`row-${i}`))})]})})})};P();var Vi=({content:t,title:o="Thinking",defaultExpanded:r=false,isStreaming:n=false})=>{let[a,i]=eo.useState(r);return c(Re,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[c(Rd,{direction:"row",alignItems:"center",spacing:.6,children:[e(Md,{size:"small",onClick:()=>i(s=>!s),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:e(an,{fontSize:"inherit"})}),c(yo,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[o,n?" ...":""]})]}),e(nn,{in:a,children:e(yo,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};P();var yl=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Wi=t=>t.trim().startsWith("```"),fu=t=>/^#{1,6}\s+/.test(t.trim()),Cl=t=>/^[-*+]\s+/.test(t.trim()),xl=t=>/^\d+\.\s+/.test(t.trim()),hu=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),wl=t=>t.trim().startsWith(">"),bu=(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())},vu=t=>t.trim().startsWith("<think>")||t.trim()===":::think",pa=(t,o,r)=>{let n=[],a=0,i=0;yl.lastIndex=0;let s=yl.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(e("strong",{children:l.slice(2,-2)},d));else if(l.startsWith("*")&&l.endsWith("*"))n.push(e("em",{children:l.slice(1,-1)},d));else if(l.startsWith("`")&&l.endsWith("`"))n.push(e(Re,{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(e(Id,{href:p[2],target:"_blank",rel:"noreferrer",children:p[1]},d)):n.push(l);}else l.startsWith("$")&&l.endsWith("$")&&o.enableMath?n.push(e(da,{expression:l,inline:true,allowKatex:true},d)):n.push(l);a=s.index+l.length,i+=1,s=yl.exec(t);}return a<t.length&&n.push(t.slice(a)),n.length>0?n:[t]},ua=({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=eo.useMemo(()=>{let m=[],f=d.replace(/\r\n/g,`
188
188
  `).split(`
189
- `),b={enableMath:n},m=0;for(;m<f.length;){let v=f[m],y=v.trim();if(!y){m+=1;continue}if(i&&lu(v)){if(y.startsWith("<think>")){let h=[],C=v;for(;;){let k=C.indexOf("<think>"),w=k>=0?C.slice(k+7):C,T=w.indexOf("</think>");if(T>=0){h.push(w.slice(0,T)),m+=1;break}if(h.push(w),m+=1,m>=f.length)break;C=f[m];}p.push(e(Oi,{content:h.join(`
190
- `).trim()},`think-tag-${m}`));continue}m+=1;let x=[];for(;m<f.length&&f[m].trim()!==":::";)x.push(f[m]),m+=1;m<f.length&&f[m].trim()===":::"&&(m+=1),p.push(e(Oi,{content:x.join(`
191
- `).trim()},`think-fence-${m}`));continue}if(Fi(v)){let x=y.slice(3).trim().toLowerCase(),h=[];for(m+=1;m<f.length&&!Fi(f[m]);)h.push(f[m]),m+=1;m<f.length&&Fi(f[m])&&(m+=1);let C=h.join(`
192
- `);if(a&&x==="mermaid"){p.push(e(cl,{code:C},`mermaid-${m}`));continue}if(n&&["math","latex","katex"].includes(x)){p.push(e(ca,{expression:C,allowKatex:true},`math-fence-${m}`));continue}p.push(e(la,{code:C,language:x||"text",copyable:s,showLineNumbers:l,wrapLongLines:true},`code-${m}`));continue}if(n&&y.startsWith("$$")){let x=[];if(y.endsWith("$$")&&y!=="$$")x.push(y.slice(2,-2)),m+=1;else {let C=v.slice(v.indexOf("$$")+2);for(C.trim()&&x.push(C),m+=1;m<f.length;){let k=f[m],w=k.indexOf("$$");if(w>=0){x.push(k.slice(0,w)),m+=1;break}x.push(k),m+=1;}}p.push(e(ca,{expression:x.join(`
193
- `).trim(),allowKatex:true},`math-${m}`));continue}if(au(v)){let x=Math.min(6,v.match(/^#{1,6}/)?.[0]?.length||1),h=v.replace(/^#{1,6}\s+/,""),C=x===1?"h5":x===2?"h6":"subtitle1";p.push(e(hr,{variant:C,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:da(h,b,`h-${m}`)},`heading-${m}`)),m+=1;continue}if(iu(v)){p.push(e(Cd,{sx:{my:1.2}},`hr-${m}`)),m+=1;continue}if(su(f,m)){let x=m+2;for(;x<f.length&&f[x].trim()&&f[x].includes("|");)x+=1;let h=f.slice(m,x).join(`
194
- `),C=Li(h);if(C){p.push(e(pl,{table:C},`table-${m}`)),m=x;continue}}if(fl(v)){let x=[];for(;m<f.length&&fl(f[m]);)x.push(f[m].replace(/^\s*>\s?/,"")),m+=1;p.push(e(Bo,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:e(hr,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((h,C)=>c(er.Fragment,{children:[C>0&&e("br",{}),da(h,b,`q-${m}-${C}`)]},`quote-line-${C}`))})},`quote-${m}`));continue}if(ml(v)){let x=[];for(;m<f.length&&ml(f[m]);)x.push(f[m].trim().replace(/^[-*+]\s+/,"")),m+=1;p.push(e(Ie,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((h,C)=>e(Ie,{component:"li",sx:{mb:.45},children:e(hr,{variant:"body2",children:da(h,b,`ul-${m}-${C}`)})},`ul-item-${C}`))},`ul-${m}`));continue}if(gl(v)){let x=[];for(;m<f.length&&gl(f[m]);)x.push(f[m].trim().replace(/^\d+\.\s+/,"")),m+=1;p.push(e(Ie,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((h,C)=>e(Ie,{component:"li",sx:{mb:.45},children:e(hr,{variant:"body2",children:da(h,b,`ol-${m}-${C}`)})},`ol-item-${C}`))},`ol-${m}`));continue}let g=[];for(;m<f.length;){let x=f[m],h=x.trim();if(!h||Fi(x)||au(x)||iu(x)||ml(x)||gl(x)||fl(x)||su(f,m)||i&&lu(x)||n&&h.startsWith("$$"))break;g.push(x),m+=1;}g.length>0?p.push(e(hr,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g.map((x,h)=>c(er.Fragment,{children:[h>0&&e("br",{}),da(x,b,`p-${m}-${h}`)]},`p-line-${h}`))},`p-${m}`)):m+=1;}return p},[d,n,a,i,s,l]);return e(Ie,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:u})};P();var XN=(t,r)=>e(pa,{markdown:t,...r});P();var cu=({value:t,onChange:r,onSubmit:o,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:l=false,compact:d=false,showStatusText:u=true})=>c(ie,{spacing:.75,children:[c("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:[e(zo,{sx:{fontSize:d?16:18,color:"text.secondary"}}),e(Id,{fullWidth:true,value:t,onChange:p=>r(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),o());},placeholder:i,sx:{fontSize:d?"0.84rem":"0.9rem"}}),t&&a&&e(ae,{size:"small",onClick:a,children:e(wo,{sx:{fontSize:d?16:18}})}),n&&e(ae,{size:"small",onClick:n,children:e(op,{sx:{fontSize:d?16:18}})}),e(ae,{size:"small",onClick:o,disabled:l||!t.trim(),children:e(lp,{sx:{fontSize:d?16:18}})})]}),u&&s&&e(L,{variant:"caption",color:"text.secondary",children:s})]});P();var du=(t,r)=>{let o=r.trim();if(!o)return t;let n=t.toLowerCase(),a=o.toLowerCase(),i=n.indexOf(a);return i<0?t:c(jsxRuntime.Fragment,{children:[t.slice(0,i),e("div",{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:t.slice(i,i+o.length)}),t.slice(i+o.length)]})},Bi=({section:t,highlightQuery:r=""})=>{let o=t.columns||2;return c(Ae,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[e(L,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:t.title}),e("div",{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:o===3?"repeat(3, minmax(0, 1fr))":o===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:t.fields.map(n=>{let a=typeof n.value=="string"||typeof n.value=="number"?String(n.value):null;return c("div",{sx:{minWidth:0},children:[e(L,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:du(n.label,r)}),e(L,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?du(a,r):n.value})]},n.id)})})]})};var bl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",zi=t=>t.trim().toLowerCase(),ov=(t,r)=>{let o=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||bl(a.value),s={source:"section",sourceId:n.id,sourceSectionId:n.id,sourceTitle:n.title,fieldId:a.id,fieldLabel:a.label,fieldValue:i};o.push({hit:s,text:zi(`${n.title} ${a.label} ${i}`)});});}),r.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||bl(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};o.push({hit:s,text:zi(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||bl(i.value),l={source:"tab",sourceId:n.id,sourceSectionId:a.id,sourceTitle:`${n.label} / ${a.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};o.push({hit:l,text:zi(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),o},pu=({sections:t,tabs:r=[],defaultTabId:o,ai:n})=>{let{t:a}=pe(),[i,s]=er.useState(""),[l,d]=er.useState(o||r[0]?.id),[u,p]=er.useState("idle"),[f,b]=er.useState([]),[m,v]=er.useState(""),[y,g]=er.useState(""),[x,h]=er.useState(false),C=er.useMemo(()=>ov(t,r),[t,r]);er.useEffect(()=>{if(r.length===0){d(void 0);return}r.some(A=>A.id===l)||d(o||r[0]?.id);},[r,l,o]);let k=er.useCallback(()=>{p("idle"),b([]),v(""),g("");},[]),w=er.useCallback(S=>{s(S),S.trim()||(p("idle"),b([]),v(""),g(""));},[]),T=er.useCallback(S=>{let A=zi(S);return A?C.filter(D=>D.text.includes(A)).map(D=>D.hit):[]},[C]),I=er.useCallback(async()=>{let S=i.trim();if(!S)return;h(true);let A=T(S);if(b(A),A.length>0){p("search"),g(""),v(a("detail.searchAi.matches",{count:A.length})),h(false);return}if(n?.enabled!==false&&n?.onSubmit){p("ai"),v(a("detail.searchAi.autoAiFallback"));try{let M=await n.onSubmit(S,{query:S,hits:A,activeTabId:l,sections:t,tabs:r});g(typeof M=="string"?M:"");}finally{h(false);}return}p("search"),g(""),v(a("detail.searchAi.noMatch")),h(false);},[i,T,a,n,l,t,r]);return {query:i,setQuery:w,activeTabId:l,setActiveTabId:d,searchMode:u,hits:f,statusText:m,aiResponse:y,searching:x,handleSubmit:I,clearResult:k}};P();var SA=({title:t,subtitle:r,sections:o,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:l,searchBarWidth:d=460,onClose:u,closeLabel:p="Close"})=>{let{t:f}=pe(),{query:b,setQuery:m,activeTabId:v,setActiveTabId:y,searchMode:g,hits:x,statusText:h,aiResponse:C,searching:k,handleSubmit:w,clearResult:T}=pu({sections:o,tabs:n,defaultTabId:a,ai:s}),I=er.useMemo(()=>n.find(D=>D.id===v)||n[0],[n,v]),S=er.useCallback(D=>{let M=N=>{let E=document.getElementById(D);if(E){E.scrollIntoView({behavior:"smooth",block:"center"});return}N<4&&setTimeout(()=>M(N+1),60);};requestAnimationFrame(()=>M(0));},[]),A=er.useCallback((D,M)=>{if(n.some(N=>N.id===D)){y(D),S(M?`detail-tab-${D}-section-${M}`:`detail-tab-${D}`);return}S(`detail-section-${D}`);},[n,y,S]);return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[c(ie,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[c("div",{sx:{minWidth:0},children:[e(L,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),r&&e(L,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:r})]}),c(ie,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[e("div",{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:e(cu,{value:b,onChange:m,onSubmit:w,onVoiceInput:s?.onVoiceInput,onClear:()=>{m(""),T();},placeholder:s?.placeholder||f("detail.searchAi.placeholder"),statusText:h,loading:k,compact:true,showStatusText:false})}),u&&e(ct,{title:p,children:e(ae,{size:"small",onClick:u,children:e(Kd,{fontSize:"small"})})}),l]})]}),h&&e(L,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:h}),g==="search"&&x.length>0&&c(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[e(L,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:f("detail.searchAi.matches",{count:x.length})}),e(ie,{spacing:.35,children:x.slice(0,8).map(D=>e("div",{component:"button",type:"button",onClick:()=>A(D.sourceId,D.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:c(L,{variant:"body2",sx:{fontSize:"0.84rem"},children:[e("div",{component:"span",sx:{color:"text.secondary"},children:D.sourceTitle})," \xB7 ",e("div",{component:"span",sx:{fontWeight:700},children:D.fieldLabel})," = ",e("div",{component:"span",children:D.fieldValue||"-"})]})},`${D.source}|${D.sourceId}|${D.fieldId}`))})]}),g==="ai"&&C&&c(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[e(L,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:f("detail.searchAi.aiResultTitle")}),e("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:e(pa,{markdown:C})})]}),e("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(D=>e("div",{id:`detail-section-${D.id}`,children:e(Bi,{section:D,highlightQuery:b})},D.id))}),n.length>0&&c(Ae,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[e(Ad,{value:I?.id||false,onChange:(D,M)=>y(String(M)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(D=>e(Ed,{value:D.id,label:D.label,sx:{textTransform:"none"}},D.id))}),c("div",{sx:{p:1.5},children:[e("div",{id:`detail-tab-${I?.id||""}`}),I?.description&&e(L,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:I.description}),I?.content?I.content:c(ie,{spacing:1.5,children:[(I?.sections||[]).map(D=>e("div",{id:`detail-tab-${I?.id}-section-${D.id}`,children:e(Bi,{section:D,highlightQuery:b})},D.id)),I?.fields&&I.fields.length>0&&e(Bi,{section:{id:`${I.id}-fields`,title:I.label,fields:I.fields,columns:2},highlightQuery:b})]})]})]}),i&&e(Jr,{title:i.title||f("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};P();var gu=({bucket:t,cardCount:r,highlighted:o=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:l,renameLabel:d,sx:u})=>{let{t:p}=pe(),[f,b]=er.useState(false),[m,v]=er.useState(t.title),y=()=>{v(t.title),b(false);},g=x=>{x.preventDefault();let h=m.trim();h&&(h!==t.title&&l?.(h),v(h),b(false));};return e(Ae,{elevation:0,sx:[x=>{let h=t.accentColor??x.palette.primary.main;return {position:"relative",display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:i??s??560,maxHeight:s,borderRadius:"var(--orb-r-container)",overflow:"hidden",border:o?`1px solid ${rt(h,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:o?`0 0 0 2px ${rt(h,.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:h}}},...Array.isArray(u)?u:u?[u]:[]],children:c(ie,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[c(Ie,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[e(Ie,{sx:{minWidth:0,flex:1},children:c(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&e(Ie,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),f?c(Ie,{component:"form",onSubmit:g,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[e(ze,{dense:true,autoFocus:true,value:m,onChange:x=>v(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),y());},inputProps:{"aria-label":d??p("kanban.bucket.rename")},error:!m.trim(),sx:{flex:1,minWidth:0}}),e(ae,{type:"submit",size:"small",tooltip:p("kanban.bucket.saveRename"),"aria-label":p("kanban.bucket.saveRename"),disabled:!m.trim(),children:e(qr,{size:14})}),e(ae,{size:"small",tooltip:p("kanban.bucket.cancelRename"),"aria-label":p("kanban.bucket.cancelRename"),onClick:y,children:e(jt,{size:14})})]}):e(L,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!f&&c(ie,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[e(xt,{size:"small",label:r,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&e(xt,{size:"small",label:`${p("kanban.bucket.limit")} ${t.limit}`,color:r>t.limit?"warning":"default",variant:"outlined"}),l&&e(ae,{size:"small",tooltip:d??p("kanban.bucket.rename"),"aria-label":d??p("kanban.bucket.rename"),onClick:()=>{v(t.title),b(true);},sx:{width:26,height:26},children:e(Nc,{size:14})})]})]}),o&&e(L,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:p("kanban.bucket.dropHere")}),e(Ie,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:r>0?n:e(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:e(L,{sx:{fontSize:13,color:"text.secondary"},children:a??t.emptyLabel??p("kanban.empty")})})})]})})};P();var av={success:"success",warning:"warning",info:"info",error:"error"},iv={critical:"error",high:"warning",medium:"info",low:"success"},sv={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},lv=(t,r)=>{switch(t){case "critical":return r("kanban.priority.critical");case "high":return r("kanban.priority.high");case "medium":return r("kanban.priority.medium");case "low":return r("kanban.priority.low");default:return t}},cv=t=>t?t.split(/\s+/).map(r=>r.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",hl=({card:t,bucket:r,dragging:o=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=pe(),l=!!(a&&r),d=t.tone??(t.priority?iv[t.priority]:"default"),u=d==="default"?"primary":av[d],p=sv[d],f=r?{card:t,bucket:r}:void 0;return e(Ae,{onClick:l?()=>f&&a?.(f):void 0,onKeyDown:l?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f&&a?.(f));}: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 ${rt(p,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:n?"var(--orb-shadow-3)":o?"none":"var(--orb-shadow-1)",transform:n?"rotate(1deg) scale(1.01)":"none",transition:"transform var(--orb-t-fast), box-shadow var(--orb-t-fast), border-color var(--orb-t-fast)",cursor:l?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:p},"&:hover":l?{transform:"translateY(-1px)",borderColor:rt(p,.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:c(ie,{spacing:1.25,children:[c(Ie,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[c(Ie,{sx:{minWidth:0,flex:1},children:[(t.kicker||r?.title)&&e(L,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??r?.title}),e(L,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&e(xt,{size:"small",color:u,label:lv(t.priority,s),variant:d==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,fontWeight:500}})]}),t.summary&&e(L,{component:"div",sx:{fontSize:13,fontWeight:300,color:"text.secondary",lineHeight:1.5},children:t.summary}),t.metrics&&t.metrics.length>0&&e(Ie,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(b=>c(Ie,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[e(L,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:b.label}),e(L,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:b.value})]},b.id))}),typeof t.progress=="number"&&c(Ie,{children:[c(Ie,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[e(L,{sx:{fontSize:12,color:"text.secondary"},children:s("kanban.card.progress")}),c(L,{numeric:true,sx:{fontSize:12,fontWeight:600},children:[Math.round(t.progress),"%"]})]}),e(Sd,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:p,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||l)&&c(ie,{spacing:.9,children:[t.tags&&t.tags.length>0&&e(Ie,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(b=>e(xt,{size:"small",label:b.label,color:b.color??"default",variant:"outlined"},b.id))}),c(Ie,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[c(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&c(jsxRuntime.Fragment,{children:[e(Qa,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??cv(t.assignee.name)}),c(Ie,{sx:{minWidth:0},children:[e(L,{component:"div",sx:{fontSize:13,fontWeight:500,lineHeight:1.3},noWrap:true,children:t.assignee.name}),t.dueDate&&e(L,{component:"div",sx:{fontSize:11,color:"text.secondary",lineHeight:1.35},noWrap:true,children:t.dueDate})]})]}),!t.assignee&&t.dueDate&&e(L,{sx:{fontSize:12,color:"text.secondary"},children:t.dueDate})]}),l&&e(L,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var fu=(t,r)=>{let o=r.title.trim();return !r.id||!o||t.buckets.some(n=>n.id===r.id)?t:{buckets:[...t.buckets,{...r,title:o,cards:[]}]}},bu=(t,r,o)=>{let n=o.trim();if(!n)return t;let a=t.buckets.find(i=>i.id===r);return !a||a.title===n?t:{buckets:t.buckets.map(i=>i.id===r?{...i,title:n}:i)}},dv=(t,r)=>Number.isNaN(t)||t<0?0:t>r?r:t,hu=({buckets:t,cards:r})=>{let o=new Map;return r.forEach((n,a)=>{let i=o.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),o.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...o.get(n.id)??[]].sort((i,s)=>i.card.position===void 0&&s.card.position===void 0?i.sourceIndex-s.sourceIndex:i.card.position===void 0?1:s.card.position===void 0?-1:i.card.position-s.card.position||i.sourceIndex-s.sourceIndex).map(({card:i},s)=>({...i,bucketId:n.id,position:s}));return {...n,cards:a}})}},_r=(t,r)=>{for(let o=0;o<t.buckets.length;o+=1){let n=t.buckets[o],a=n.cards.findIndex(i=>i.id===r);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:o,cardIndex:a}}},Vi=(t,r)=>{let o=_r(t,r.cardId);if(!o)return t;let n=t.buckets.findIndex(u=>u.id===r.toBucketId);if(n<0)return t;let a=t.buckets.map(u=>({...u,cards:u.cards.map(p=>({...p}))})),i=a[o.bucketIndex],[s]=i.cards.splice(o.cardIndex,1);if(!s)return t;let l=a[n],d=dv(r.targetIndex??l.cards.length,l.cards.length);return l.cards.splice(d,0,{...s,bucketId:r.toBucketId}),{buckets:a.map(u=>({...u,cards:u.cards.map((p,f)=>({...p,bucketId:u.id,position:f}))}))}};P();var Cl="kanban-card|",xl="kanban-bucket|",Cu=t=>`${Cl}${t}`,xv=t=>`${xl}${t}`,Wi=t=>t?.startsWith(Cl)?t.slice(Cl.length):void 0,yu=t=>t?.startsWith(xl)?t.slice(xl.length):void 0,Sv=({card:t,bucket:r,onCardClick:o})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=sortable.useSortable({id:Cu(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 e("div",{ref:n,style:u,...a,...i,children:e(hl,{card:t,bucket:r,dragging:d,onClick:o})})},wv=({bucket:t,highlighted:r,bucketHeight:o,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=core.useDroppable({id:xv(t.id)});return e(Ie,{ref:l,sx:{minWidth:0,minHeight:0,height:o},children:e(gu,{bucket:t,cardCount:t.cards.length,highlighted:r||s,emptyLabel:n,height:o,onRename:a,children:e(sortable.SortableContext,{items:t.cards.map(d=>Cu(d.id)),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:1,children:t.cards.map(d=>e(Sv,{card:d,bucket:t,onCardClick:i},d.id))})})})})},xu=t=>String(t??"").toLocaleLowerCase(),kv=(t,r)=>[t.id,t.title,t.summary,t.kicker,t.priority,t.tone,t.progress,t.dueDate,t.assignee?.id,t.assignee?.name,...t.tags?.flatMap(n=>[n.id,n.label])??[],...t.metrics?.flatMap(n=>[n.label,n.value])??[]].some(n=>xu(n).includes(r)),ZA=({model:t,onCardMove:r,onCardClick:o,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:l=320,bucketHeight:d,bucketMaxHeight:u,searchable:p=false,searchValue:f,defaultSearchValue:b="",onSearchValueChange:m,searchPlaceholder:v,emptyBucketLabel:y,sx:g})=>{let{t:x}=pe(),[h,C]=er.useState(null),[k,w]=er.useState(),[T,I]=er.useState(b),S=f??T,A=S.trim().toLocaleLowerCase(),D=d??u??560,M=er.useMemo(()=>({buckets:t.buckets.map(V=>{let z=n?V.cards.filter(K=>n(K,V)):V.cards;if(!A)return {...V,cards:z};let U=[V.id,V.title,V.description].some(K=>xu(K).includes(A));return {...V,cards:U?z:z.filter(K=>kv(K,A))}})}),[n,t,A]),N=er.useMemo(()=>M.buckets.reduce((V,z)=>V+z.cards.length,0),[M]),E=er.useCallback(V=>{f===void 0&&I(V),m?.(V);},[m,f]),O=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),F=er.useMemo(()=>h?_r(t,h):void 0,[h,t]),X=er.useCallback(()=>{C(null),w(void 0);},[]),H=er.useCallback(V=>{if(!V)return;let z=Wi(V);return z?_r(t,z)?.bucket.id:yu(V)},[t]),Y=er.useCallback(V=>{C(Wi(String(V.active.id))??null);},[]),W=er.useCallback(V=>{w(H(V.over?String(V.over.id):void 0));},[H]),j=er.useCallback(V=>{let z=Wi(String(V.active.id)),U=V.over?String(V.over.id):void 0;if(!z||!U){X();return}let K=_r(t,z);if(!K){X();return}let fe=K.bucket.id,se=K.cardIndex,ue=Wi(U);if(ue){let ke=_r(t,ue);if(!ke){X();return}fe=ke.bucket.id,se=ke.cardIndex;}else {let ke=yu(U),le=t.buckets.find(Ee=>Ee.id===ke);if(!ke||!le){X();return}fe=ke,se=le.cards.length;}if(K.bucket.id===fe&&K.cardIndex===se){X();return}let Se=Vi(t,{cardId:z,fromBucketId:K.bucket.id,toBucketId:fe,targetIndex:se}),$e=_r(Se,z);$e&&!($e.bucket.id===K.bucket.id&&$e.cardIndex===K.cardIndex)&&r?.({cardId:z,fromBucketId:K.bucket.id,toBucketId:$e.bucket.id,targetIndex:$e.cardIndex,card:$e.card,model:Se}),X();},[t,r,X]);return c(core.DndContext,{sensors:O,collisionDetection:core.closestCorners,onDragStart:Y,onDragOver:W,onDragEnd:j,onDragCancel:X,children:[c(Ie,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(p||a)&&c(Ie,{role:p?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[p&&e(Ie,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:e(ze,{dense:true,value:S,onChange:V=>E(V.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:e(Hr,{size:16,"aria-hidden":"true"}),endAdornment:S?e(ae,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>E(""),sx:{width:26,height:26},children:e(jt,{size:15})}):void 0})}),c(Ie,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[A&&e(L,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:N>0?x("kanban.search.results",{count:N}):x("kanban.search.noMatch")}),a&&e(we,{size:"small",variant:"secondary",startIcon:e(en,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),e(Ie,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${l}px, ${Math.max(l,360)}px)`,gap:1.5,gridAutoRows:D==="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)?g:g?[g]:[]],children:M.buckets.map(V=>e(wv,{bucket:V,highlighted:V.id===k,bucketHeight:D,emptyBucketLabel:A?x("kanban.search.noMatch"):y,onBucketRename:i?z=>i(V.id,z):void 0,onCardClick:o},V.id))})]}),e(core.DragOverlay,{children:F?e(Ie,{sx:{width:Math.max(l-24,260)},children:e(hl,{card:F.card,bucket:F.bucket,overlay:true})}):null})]})};var Iv=({initialModel:t,initialBuckets:r,initialCards:o})=>t||hu({buckets:r??[],cards:o??[]}),tE=t=>{let{onCardMove:r,onCardClick:o}=t,[n,a]=er.useState(()=>Iv(t)),i=er.useCallback(b=>{a(m=>typeof b=="function"?b(m):b);},[]),s=er.useCallback(b=>_r(n,b),[n]),l=er.useCallback((b,m,v)=>{let y=_r(n,b);if(!y)return;let g=Vi(n,{cardId:b,fromBucketId:y.bucket.id,toBucketId:m,targetIndex:v}),x=_r(g,b);if(!x||x.bucket.id===y.bucket.id&&x.cardIndex===y.cardIndex)return;a(g);let h={cardId:b,fromBucketId:y.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return r?.(h),h},[n,r]),d=er.useCallback((b,m)=>{a(v=>({buckets:v.buckets.map(y=>({...y,cards:y.cards.map(g=>g.id!==b?g:typeof m=="function"?m(g):{...g,...m})}))}));},[]),u=er.useCallback(b=>{let m=fu(n,b);return m===n?false:(a(m),true)},[n]),p=er.useCallback((b,m)=>{let v=bu(n,b,m);return v===n?false:(a(v),true)},[n]),f=er.useMemo(()=>({model:n,onCardMove:b=>{l(b.cardId,b.toBucketId,b.targetIndex);},onCardClick:o}),[n,l,o]);return {model:n,actions:{replaceModel:i,moveCard:l,updateCard:d,addBucket:u,renameBucket:p,getCard:s},boardProps:f}};function Sn({onTextUpdate:t,onComplete:r,onError:o,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,l]=er.useState(false),d=er.useRef(null),u=er.useRef(null),p=er.useRef(null),f=er.useRef(null),b=er.useRef(null),m=er.useRef(0),v=er.useRef(false),y=er.useRef(false),g=er.useCallback(()=>{d.current&&(d.current.close(),d.current=null),f.current&&(f.current.disconnect(),f.current=null),b.current&&(b.current.disconnect(),b.current=null),u.current&&(u.current.getTracks().forEach(C=>C.stop()),u.current=null),p.current&&(p.current.close(),p.current=null),y.current=false,l(false);},[]),x=er.useCallback(()=>{v.current||(v.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),h=er.useCallback(async()=>{if(!(s||y.current)){y.current=true,v.current=false,m.current=Date.now();try{let C=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});u.current=C;let k=new WebSocket(n);d.current=k,k.onopen=()=>{l(!0),y.current=!1;},k.onmessage=A=>{try{let D=JSON.parse(A.data);if(D.type==="recognition")D.is_final?r(D.text):t?.(D.text);else if(D.type==="error"){let M=D.message||"Voice recognition error";o?.(M),x();}}catch{o?.("Failed to parse voice message");}},k.onerror=()=>{o?.("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 T=new w({sampleRate:16e3});p.current=T;let I=T.createMediaStreamSource(C);b.current=I;let S=T.createScriptProcessor(4096,1,1);f.current=S,S.onaudioprocess=A=>{if(d.current?.readyState!==WebSocket.OPEN)return;let D=A.inputBuffer.getChannelData(0),M=0;for(let O=0;O<D.length;O+=1)M+=D[O]*D[O];if(Math.sqrt(M/D.length)>i)m.current=Date.now();else if(Date.now()-m.current>a&&!v.current){x();return}let E=new Int16Array(D.length);for(let O=0;O<D.length;O+=1){let F=Math.max(-1,Math.min(1,D[O]));E[O]=F<0?F*32768:F*32767;}d.current.send(E.buffer);},I.connect(S),S.connect(T.destination);}catch{o?.("Cannot access microphone"),g();}}},[g,s,i,r,o,t,a,x,n]);return er.useEffect(()=>g,[g]),{isRecording:s,startRecording:h,stopRecording:x}}P();var Nv=["en","zh","fr","de","ja","ko"],wu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},wl=({searchPlaceholder:t,onSearch:r,onSearchAdd:o,onOpenPanel:n,panelOpen:a=false,maxWidth:i=540,sx:s})=>{let{t:l}=pe(),[d,u]=er.useState(""),p=er.useCallback((x=d)=>{let h=x.trim();h&&(u(""),r?.(h));},[r,d]),f=x=>{x.preventDefault(),p();},{isRecording:b,startRecording:m,stopRecording:v}=Sn({onTextUpdate:u,onComplete:x=>{u(x),p(x);},onError:x=>{console.error("Header voice input error:",x);}}),y=er.useCallback(async()=>{if(b){v();return}await m();},[b,m,v]),g=t||l("header.searchPlaceholder");return e("form",{className:"orb-app-header-search",onSubmit:f,style:{width:"100%",maxWidth:typeof i=="number"?`${i}px`:i,...s},children:c("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:[e("div",{className:"orb-inp-adornment",children:e(ae,{className:"orb-app-header-ai-action",size:"small",onClick:o,tooltip:l("header.searchAddFeature"),children:e(Tt,{name:"add",size:16})})}),e("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:d,onChange:x=>u(x.target.value),placeholder:g,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),c("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[n&&!a&&e(ae,{className:"orb-app-header-ai-action",size:"small","aria-label":l("header.searchOpenPanel"),tooltip:l("header.searchOpenPanel"),onClick:n,children:e(Tt,{name:"message",size:16})}),e(ae,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{y();},tooltip:l(b?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:b?"var(--orb-err)":void 0},children:e(Tt,{name:"microphone",size:16})})]})]})})},$i=({appTitle:t,logo:r,onToggleMode:o,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:l,showSearch:d=false,onSearch:u,onSearchAdd:p,onOpenPanel:f,panelOpen:b,user:m,onUserRefresh:v,onUserSetting:y,onUserLogout:g,userMenuItems:x,leftSlot:h,rightSlot:C})=>{let{t:k,locale:w}=pe(),T=Cr(),I=n||w,S=a||wu[I],A=i||Nv,D=T==="dark"?e(_c,{size:15}):e(qc,{size:15}),M=k(T==="dark"?"header.theme.dark":"header.theme.light"),N=[...v?[{key:"refresh",label:k("header.menu.refresh"),icon:e(Ba,{size:15}),onClick:v}]:[],...y?[{key:"settings",label:k("header.menu.setting"),icon:e(tn,{size:16}),onClick:y}]:[],...g?[{key:"logout",label:k("header.menu.logout"),icon:e(zc,{size:16}),onClick:g}]:[]],E=x||N,O=A.map(F=>({label:wu[F],onClick:()=>{s?.(F),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:F===I}));return c("header",{className:"orb-app-header",children:[c("div",{className:"orb-app-header-brand",children:[h,r===null?null:r||e("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:e(Tt,{name:"product",size:20})}),t&&e(L,{variant:"h4",sx:{fontWeight:700},children:t})]}),e("div",{className:"orb-app-header-center",children:d&&e(wl,{searchPlaceholder:l,onSearch:u,onSearchAdd:p,onOpenPanel:f,panelOpen:b})}),c("div",{className:"orb-app-header-actions",children:[c("div",{className:"orb-app-header-utilities",children:[s?e(Qt,{triggerLabel:S,trigger:c("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[e(zn,{size:15}),e("span",{className:"orb-label",children:S})]}),items:O,align:"end"}):c("div",{className:"orb-app-header-locale","aria-label":S,children:[e(zn,{size:15}),e("span",{className:"orb-label",children:S})]}),e(ae,{className:"orb-app-header-theme",size:"small",onClick:o,tooltip:M,children:D})]}),m&&e("span",{className:"orb-app-header-divider","aria-hidden":"true"}),m&&e(Qt,{triggerLabel:m.name,trigger:c("button",{type:"button",className:"orb-app-header-user-trigger",children:[c("span",{className:"orb-app-header-user-copy",children:[e(L,{variant:"body2",className:"orb-app-header-user-name",children:m.name}),m.subtitle&&e(L,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:m.subtitle,children:m.subtitle})]}),e(rn,{src:m.avatarSrc,alt:m.name,size:32,children:m.avatarText||m.name.slice(0,1).toUpperCase()})]}),items:E.map(F=>({label:F.label,onClick:F.onClick,disabled:F.disabled,icon:F.icon})),align:"end"}),C]})]})};var ku=({menuData:t=[],initialNavigationCollapsed:r=false,initialNavigationMode:o="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:u}=fd({initialCollapsed:r,initialDisplayMode:o,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[p,f]=er.useState(900);er.useEffect(()=>{let m=()=>f(window.innerHeight);return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);let b=er.useMemo(()=>Math.max(280,p-100),[p]);return {navigationIslandProps:u,navigationMaxHeight:b}};P();var Lr=12,Tu=56,Iu=234,Fv="orbcafe:page-layout-locale",Mu=["en","zh","fr","de","ja","ko"],Bv=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",_i=(t,r)=>`orbcafe:page-layout:${Bv(t)}:${r}`,Hv=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,zv=t=>t==="system"?"dark":t==="dark"?"light":"system",Gi=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),Vv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,kE=({appId:t,appTitle:r,menuData:o=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:l,onLocaleChange:d,mode:u,defaultMode:p="system",onModeChange:f,user:b,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g,logo:x,searchPlaceholder:h,searchPlacement:C="hidden",floatingSearchSx:k,onSearch:w,onSearchAdd:T,onOpenPanel:I,panelOpen:S,rightHeaderSlot:A,leftHeaderSlot:D,contentSx:M,navigationVariant:N="classic",navigationMode:E,defaultNavigationMode:O="fixed",onNavigationModeChange:F,showNavigationModeToggle:X=true,enableNavigationPinning:H=true,navigationPinStorageKey:Y,pinnedNavigationItemIds:W,defaultPinnedNavigationItemIds:j,onPinnedNavigationItemIdsChange:V,pinnedNavigationSectionTitle:z})=>{let U=t?_i(t,"mode"):"orbcafe:page-layout-mode",K=t?_i(t,"locale"):Fv,fe=t?_i(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[se,ue]=er.useState(p),[Se,$e]=er.useState("light"),[ke,le]=er.useState(false),[Ee,Me]=er.useState(i),[Pe,Ve]=er.useState(false),[tt,nt]=er.useState(false),[it,q]=er.useState(O),[De,ye]=er.useState({x:Lr,y:Lr}),[Be,at]=er.useState("left"),[Ze,St]=er.useState(false),Mt=er.useRef(null),Ot=er.useRef(null),At=u!==void 0,re=u??se,Ke=d!==void 0,Fe=Ke?i:Ee,ce=l?.join("|")??"",ve=E!==void 0,te=E??it,he=te==="floating",Ne=N==="v2"?qs:cd,Je=C==="header",st=re==="system"?ke?Se:"light":re;er.useEffect(()=>{if(!At)try{let be=window.localStorage.getItem(U);(be==="light"||be==="dark"||be==="system")&&ue(be);}catch{}le(true);let $=window.matchMedia("(prefers-color-scheme: dark)"),Q=()=>{$e($.matches?"dark":"light");};return Q(),$.addEventListener("change",Q),()=>$.removeEventListener("change",Q)},[At,U]),er.useEffect(()=>{if(!(At||!ke))try{window.localStorage.setItem(U,re);}catch{}},[ke,At,re,U]),er.useEffect(()=>{if(Ke){Ve(true);return}try{let $=window.localStorage.getItem(K),Q=l??Mu;$&&Mu.includes($)&&Q.includes($)&&Me($);}catch{}finally{Ve(true);}},[Ke,ce,K]),er.useEffect(()=>{if(!(Ke||!Pe))try{window.localStorage.setItem(K,Fe);}catch{}},[Fe,Ke,Pe,K]),er.useEffect(()=>{if(ve){nt(true);return}try{let $=window.localStorage.getItem(fe);($==="fixed"||$==="floating")&&q($);}catch{}finally{nt(true);}},[ve]),er.useEffect(()=>{if(tt)try{window.localStorage.setItem(fe,te);}catch{}},[te,tt]),er.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=er.useCallback($=>{ve||q($),F?.($);},[ve,F]),Bt=er.useCallback($=>{At||ue($),f?.($);},[At,f]),Xt=er.useCallback($=>{Ke||Me($),d?.($);},[Ke,d]),{navigationIslandProps:Vt,navigationMaxHeight:wt}=ku({menuData:o,initialNavigationCollapsed:false,initialNavigationMode:te,enableNavigationPinning:H,navigationPinStorageKey:Y??(t?_i(t,"pinned-navigation-items"):Hv(r)),pinnedNavigationItemIds:W,defaultPinnedNavigationItemIds:j,onPinnedNavigationItemIdsChange:V,pinnedNavigationSectionTitle:z}),Wt=Vt.collapsed,ht=er.useCallback($=>{let Q=Mt.current,be=Q?.parentElement;if(!Q||!be)return $;let Ce=be.getBoundingClientRect(),Le=Q.getBoundingClientRect(),_e=Lr,qe=Lr,je=Math.max(_e,Ce.width-Le.width-Lr),mt=Math.max(qe,Ce.height-Le.height-Lr);return {x:Gi($.x,_e,je),y:Gi($.y,qe,mt)}},[]),Nt=er.useCallback($=>{let Q=Mt.current,be=Q?.parentElement;if(!Q||!be)return $;let Ce=be.getBoundingClientRect(),Le=Q.getBoundingClientRect(),_e=Lr,qe=Lr,je=Math.max(_e,Ce.width-Le.width-Lr),mt=Math.max(qe,Ce.height-Le.height-Lr),ft={x:Gi($.x,_e,je),y:Gi($.y,qe,mt)},yt=[{distance:Math.abs(ft.x-_e),position:{x:_e,y:ft.y}},{distance:Math.abs(ft.x-je),position:{x:je,y:ft.y}},{distance:Math.abs(ft.y-qe),position:{x:ft.x,y:qe}},{distance:Math.abs(ft.y-mt),position:{x:ft.x,y:mt}}].reduce((B,J)=>J.distance<B.distance?J:B).position;return at(yt.x>=(_e+je)/2?"right":"left"),yt},[]),lt=er.useMemo(()=>{if(!he||Ze)return De.x;if(Be==="right"){let be=Mt.current?.parentElement?.getBoundingClientRect().width,Ce=Wt?Tu:Iu;return be?Math.max(Lr,be-Ce-Lr):Wt?De.x:De.x-(Iu-Tu)}return De.x},[Be,De.x,Ze,he,Wt]),Ft=er.useCallback($=>{if(!he||!Wt||Vv($.target))return;$.preventDefault(),$.currentTarget.setPointerCapture($.pointerId);let Q=ht({x:lt,y:De.y});at("left"),ye(Q),Ot.current={pointerId:$.pointerId,startClientX:$.clientX,startClientY:$.clientY,startX:Q.x,startY:Q.y,currentX:Q.x,currentY:Q.y},St(true);},[ht,lt,De.y,he,Wt]),Yt=er.useCallback($=>{let Q=Ot.current;if(!Q||Q.pointerId!==$.pointerId)return;let be=ht({x:Q.startX+$.clientX-Q.startClientX,y:Q.startY+$.clientY-Q.startClientY});Q.currentX=be.x,Q.currentY=be.y,ye(be);},[ht]),Z=er.useCallback($=>{let Q=Ot.current;if(!(!Q||Q.pointerId!==$.pointerId)){try{$.currentTarget.releasePointerCapture($.pointerId);}catch{}Ot.current=null,ye(Nt({x:Q.currentX,y:Q.currentY})),St(false);}},[Nt]);return er.useEffect(()=>{if(!he)return;let $=()=>{ye(Ce=>ht(Ce));},Q=window.requestAnimationFrame($),be=window.setTimeout($,430);return ()=>{window.cancelAnimationFrame(Q),window.clearTimeout(be);}},[ht,he,Wt,wt]),e(Fn,{mode:re,children:e(Ga,{locale:Fe,children:c("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[e($i,{appTitle:r,logo:x,mode:re,onToggleMode:()=>Bt(zv(re)),locale:Fe,localeLabel:Ke||Fe===i?s:void 0,localeOptions:l,onLocaleChange:Xt,user:b,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g,searchPlaceholder:h,showSearch:Je,onSearch:w,onSearchAdd:T,onOpenPanel:I,panelOpen:S,leftSlot:D,rightSlot:A}),C==="floating"&&e("div",{className:"orb-float-search",style:k,children:e(wl,{searchPlaceholder:h,onSearch:w,onSearchAdd:T,onOpenPanel:I,panelOpen:S,maxWidth:"100%"})}),c("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!he&&e("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:Wt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:e(Ne,{...Vt,maxHeight:wt,colorMode:st,displayMode:te,onDisplayModeChange:pt,showDisplayModeToggle:X&&Wt})}),a&&he&&e("div",{ref:Mt,onPointerDown:Ft,onPointerMove:Yt,onPointerUp:Z,onPointerCancel:Z,style:{position:"absolute",top:De.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:e(Ne,{...Vt,maxHeight:wt,colorMode:st,displayMode:te,onDisplayModeChange:pt,showDisplayModeToggle:X&&Wt})}),e("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!he&&Wt?4:12,...M},children:n})]})]})})})};var Ui="(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",Ki=t=>{let r=t.split("|");return r.length===2&&r[0]==="container"&&Lu(r[1])?{kind:"container",zone:r[1]}:r.length===3&&r[0]==="item"&&Lu(r[1])&&r[2]?{kind:"item",zone:r[1],key:r[2]}:null},co=t=>t==null||t===""?Ui:t instanceof Date?t.toISOString().slice(0,10):String(t),_o=t=>JSON.stringify(t),Fu=(t,r)=>{let o=t.join(""),n=r.join("");return o.localeCompare(n,void 0,{sensitivity:"base"})},Wv=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){let r=Number(t);return Number.isFinite(r)?r:null}return null},wn=(t,r,o)=>{if(o==="count")return t.length;let n=t.map(a=>Wv(a[r])).filter(a=>a!==null);return n.length===0?0:o==="sum"?n.reduce((a,i)=>a+i,0):o==="avg"?n.reduce((a,i)=>a+i,0)/n.length:o==="min"?Math.min(...n):Math.max(...n)},lr=(t,r)=>{if(!t||t.length===0)return [];let o=new Set,n=[];return t.forEach(a=>{!r.has(a)||o.has(a)||(o.add(a),n.push(a));}),n},po=(t,r)=>t.length!==r.length?false:t.every((o,n)=>o===r[n]),Bu=(t,r)=>{let o=Object.keys(t),n=Object.keys(r);return o.length!==n.length?false:o.every(a=>{let i=t[a]??[],s=r[a]??[];return po(i,s)})},qi=(t,r)=>t.length!==r.length?false:t.every((o,n)=>{let a=r[n];return o.tokenId===a.tokenId&&o.fieldId===a.fieldId&&o.aggregation===a.aggregation}),kl=t=>!t?.aggregations||t.aggregations.length===0?Au:t.aggregations,vr=(t,r)=>{let o=kl(r);return t&&o.includes(t)?t:r?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},ua=(t,r,o)=>{let n=o.get(r.fieldId);return n?.formatValue?n.formatValue(t):r.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};P();var zu=({options:t,selectedValues:r,onChange:o,minWidth:n=96})=>{let{t:a}=pe(),[i,s]=er.useState(""),[l,d]=er.useState(null),u=er.useMemo(()=>{let m=i.trim().toLowerCase();return m?t.filter(v=>v.toLowerCase().includes(m)):t},[t,i]),p=t.length>0&&r.length===t.length,f=t.length===0?a("pivot.filter.na"):r.length===0?a("common.none"):p?a("common.all"):`${r.length}/${t.length}`,b=m=>{o(r.includes(m)?r.filter(v=>v!==m):[...r,m]);};return c("div",{sx:{minWidth:n},onClick:m=>m.stopPropagation(),onMouseDown:m=>m.stopPropagation(),children:[e(we,{variant:"outlined",size:"small",onClick:m=>d(m.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:f}),e(Qt,{anchorEl:l,open:!!l,onClose:()=>d(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:c("div",{onClick:m=>m.stopPropagation(),sx:{display:"grid",gap:.4},children:[e(ze,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:m=>s(m.target.value),onKeyDown:m=>m.stopPropagation(),onClick:m=>m.stopPropagation(),sx:{m:0,"& .orb-inp":{fontSize:"0.75rem",py:.7}}}),e("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:e(we,{variant:"text",size:"small",onClick:m=>{m.preventDefault(),m.stopPropagation(),o(p?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(p?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),u.length===0&&e("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),u.map(m=>{let v=r.includes(m);return c("div",{role:"option","aria-selected":v,tabIndex:0,className:`orb-menu-item ${v?"orb-selected":""}`,onClick:()=>b(m),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),b(m));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[e(It,{size:"small",checked:v,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),e("span",{children:m})]},m)})]})})]})};P();var kn=({size:t=18,subtle:r=false})=>{let o=Math.max(2,Math.round(t/6));return e(Ie,{"aria-hidden":"true",sx:{display:"grid",gridTemplateColumns:`repeat(2, ${o}px)`,gridAutoRows:`${o}px`,gap:`${Math.max(2,Math.round(o/1.5))}px`,placeItems:"center",width:t,height:t,flexShrink:0,color:r?"var(--orb-muted)":"var(--orb-primary)"},children:Array.from({length:6},(n,a)=>e(Ie,{sx:{width:o,height:o,borderRadius:999,bgcolor:"currentColor"}},a))})};P();var Pl=({label:t,subtitle:r,isDragging:o,dragRef:n,listeners:a,attributes:i,style:s})=>e(Ae,{ref:n,...a,...i,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)",transform:"translateY(-1px)"}},style:{...s,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:c("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[e("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:e(kn,{size:13,subtle:true})}),c("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.15},children:[e(L,{component:"div",sx:{fontSize:"0.84rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),r&&e(L,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:r})]})]})}),Vu=({id:t,label:r,subtitle:o})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=core.useDraggable({id:t});return e(Pl,{label:r,subtitle:o,isDragging:s,dragRef:n,listeners:a,attributes:i})};P();var Pn=({zone:t,title:r,hint:o,icon:n,children:a,itemCount:i,onClear:s})=>{let l=`container|${t}`,{isOver:d,setNodeRef:u}=core.useDroppable({id:l}),{t:p}=pe();return c(Ae,{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:[c("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[c("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[n,e(L,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children:r}),c(L,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&e(ct,{title:p("pivot.clearArea"),children:e(ae,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:e(tp,{size:13})})})]}),e(L,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:o}),e("div",{sx:{flex:1},children:a})]})};P();var Wu={xs:1.2,md:1.6},Tn=({title:t,subtitle:r,collapsed:o,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:l,unmountOnExit:d=false,headerActions:u})=>c(Ae,{sx:p=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${p.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[c("div",{sx:p=>({px:Wu,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:o?"none":`1px solid ${p.palette.divider}`}),children:[c("div",{sx:{minWidth:0,flex:1},children:[e(L,{component:"div",sx:{fontSize:"0.92rem",fontWeight:700,color:"var(--orb-fg-strong)"},children:t}),e(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r})]}),c("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[u,e(ae,{size:"small","aria-label":o?a:i,onClick:n,sx:p=>({border:`1px solid ${p.palette.divider}`,bgcolor:"var(--orb-canvas)",color:"var(--orb-primary)",width:24,height:24,padding:0,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:"var(--orb-p50)",borderColor:"var(--orb-p200)"}}),children:e(ai,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),e(nn,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:e("div",{sx:[{px:Wu,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});P();var Xi=({label:t,caption:r,onRemove:o,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:l,style:d})=>e(Ae,{ref:i,style:d,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",opacity:a?0:1,transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)"}},children:c("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[e("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:e(kn,{size:13,subtle:true})}),c("div",{sx:{minWidth:0,flex:1,display:"flex",flexDirection:"column",gap:.15},children:[e(L,{component:"div",sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),r&&e(L,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:r})]}),n,o&&e(ae,{size:"small",onClick:u=>{u.stopPropagation(),o();},sx:{width:24,height:24,p:0},children:e(wo,{size:13})})]})}),ma=({id:t,label:r,caption:o,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:l,transform:d,transition:u,isDragging:p}=sortable.useSortable({id:t}),f={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:u,zIndex:p?999:"auto"};return e(Xi,{label:r,caption:o,onRemove:n,trailing:a,isDragging:p,dragRef:i,listeners:l,attributes:s,style:f})};P();var ji={rows:e(fp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:e(ln,{size:16,sx:{color:"var(--orb-primary)"}}),filters:e(jd,{size:16,sx:{color:"var(--orb-primary)"}}),values:e(sn,{size:16,sx:{color:"var(--orb-accent)"}})},$u=({isConfiguratorCollapsed:t,onToggleCollapse:r,availableFields:o,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:l,clearZone:d,removeFieldFromZone:u,getFilterSelectionSummary:p,renderDimensionFilterSelect:f,renderAggregationSelect:b,getAggregationLabel:m})=>{let{t:v}=pe(),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 e(Tn,{title:v("pivot.config.title"),subtitle:y,collapsed:t,onToggleCollapse:r,expandAriaLabel:v("pivot.collapse.ariaExpand"),collapseAriaLabel:v("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[e(Pn,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:o.length,icon:e(kn,{size:18,subtle:true}),children:c(ie,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&e(L,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:v("pivot.allFieldsInUse")}),o.map(g=>e(Vu,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),c(ie,{spacing:2,children:[c("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[e(Pn,{zone:"filters",title:v("pivot.zone.filters"),hint:v("pivot.hint.filters"),icon:ji.filters,itemCount:a.length,onClear:()=>d("filters"),children:e(sortable.SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:a.map(g=>e(ma,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:p(g),trailing:f(g),onRemove:()=>u("filters",g)},g))})})}),e(Pn,{zone:"columns",title:v("pivot.zone.columns"),hint:v("pivot.hint.columns"),icon:ji.columns,itemCount:i.length,onClear:()=>d("columns"),children:e(sortable.SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:i.map(g=>e(ma,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${p(g)}`,trailing:f(g),onRemove:()=>u("columns",g)},g))})})})]}),c("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[e(Pn,{zone:"rows",title:v("pivot.zone.rows"),hint:v("pivot.hint.rows"),icon:ji.rows,itemCount:s.length,onClear:()=>d("rows"),children:e(sortable.SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:s.map(g=>e(ma,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${p(g)}`,trailing:f(g),onRemove:()=>u("rows",g)},g))})})}),e(Pn,{zone:"values",title:v("pivot.zone.values"),hint:v("pivot.hint.values"),icon:ji.values,itemCount:l.length,onClear:()=>d("values"),children:e(sortable.SortableContext,{items:l.map(g=>`item|values|${g.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:l.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,h=`${m(g.aggregation)}(${x})`;return e(ma,{id:`item|values|${g.tokenId}`,label:x,caption:h,trailing:b(g),onRemove:()=>u("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};P();var _u=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Gu=({data:t,primaryLabel:r,secondaryLabel:o,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=sr();if(t.length===0)return null;let s=720,l=250,d={top:20,right:24,bottom:40,left:52},u=o?t.map(g=>g.primaryValue):t.map((g,x)=>x+1),p=o?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),f=Math.max(...u,1),b=Math.max(...p,1),m=s-d.left-d.right,v=l-d.top-d.bottom,y=t.map((g,x)=>{let h=o?g.primaryValue:x+1,C=o?g.secondaryValue??0:g.primaryValue,k=d.left+h/f*m,w=l-d.bottom-C/b*v;return {...g,x:k,y:w,rawX:h,rawY:C}});return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[e("div",{sx:{overflowX:"auto"},children:c("div",{component:"svg",viewBox:`0 0 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[e("line",{x1:d.left,y1:l-d.bottom,x2:s-d.right,y2:l-d.bottom,stroke:Ar(i.palette.text.secondary,.35)}),e("line",{x1:d.left,y1:d.top,x2:d.left,y2:l-d.bottom,stroke:Ar(i.palette.text.secondary,.35)}),y.map(g=>c("g",{children:[e("circle",{cx:g.x,cy:g.y,r:7,fill:Ar(i.palette.primary.main,.18)}),e("circle",{cx:g.x,cy:g.y,r:4.5,fill:i.palette.primary.main,children:c("title",{children:[g.name,`
195
- `,o?`${r}: ${n(g.primaryValue)}`:`${r}: ${n(g.primaryValue)}`,o?`
196
- ${o}: ${(a??n)(g.secondaryValue??0)}`:""]})}),e("text",{x:g.x,y:Math.max(g.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:i.palette.text.secondary,children:g.name})]},g.name)),e("text",{x:s/2,y:l-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:o?r:"Index"}),e("text",{x:16,y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/2})`,fontSize:"11",fill:i.palette.text.secondary,children:o??r}),e("text",{x:d.left,y:d.top-4,fontSize:"10",fill:i.palette.text.secondary,children:_u(b)}),e("text",{x:s-d.right,y:l-d.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:_u(f)})]})}),e("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=>c("div",{sx:x=>({borderRadius:"var(--orb-r-container)",px:1.25,py:1,border:`1px solid ${Ar(x.palette.divider,.7)}`,bgcolor:Ar(x.palette.background.default,.35)}),children:[e(L,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:g.name,children:g.name}),c(L,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[r,": ",n(g.primaryValue)]}),o&&c(L,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[o,": ",(a??n)(g.secondaryValue??0)]})]},g.name))})]})};P();var Tl=t=>Math.max(...t,1),Uu=({data:t,chartType:r,primaryLabel:o,secondaryLabel:n,formatPrimaryValue:a,formatSecondaryValue:i})=>{let s=sr(),l=s.palette.primary.main,d=s.palette.warning.main;if(t.length===0)return null;if(r==="bar-horizontal"){let h=Tl(t.flatMap(C=>[C.primaryValue,C.secondaryValue??0]));return e(ie,{spacing:1.1,children:t.map(C=>c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[e(L,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:C.name,children:C.name}),c(ie,{spacing:.65,children:[e("div",{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:Ar(s.palette.action.active,.08)},children:e("div",{sx:{width:`${C.primaryValue/h*100}%`,height:"100%",bgcolor:l}})}),n&&e("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:Ar(s.palette.action.active,.08)},children:e("div",{sx:{width:`${(C.secondaryValue??0)/h*100}%`,height:"100%",bgcolor:d}})})]}),c("div",{sx:{minWidth:0},children:[e(L,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700,color:"var(--orb-fg-strong)"},children:a(C.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"var(--orb-fg)"},children:(i??a)(C.secondaryValue??0)})]})]},C.name))})}if(r==="bar-vertical"){let h=Tl(t.flatMap(k=>[k.primaryValue,k.secondaryValue??0])),C=n?92:76;return e("div",{sx:{overflowX:"auto",pb:.5},children:e("div",{sx:{minWidth:Math.max(620,t.length*C),display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:t.map(k=>c("div",{sx:{minWidth:0},children:[c("div",{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[e("div",{sx:{width:n?16:26,minHeight:8,height:`${Math.max(k.primaryValue/h*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:l},title:`${o}: ${a(k.primaryValue)}`}),n&&e("div",{sx:{width:16,minHeight:8,height:`${Math.max((k.secondaryValue??0)/h*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${n}: ${(i??a)(k.secondaryValue??0)}`})]}),e(L,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:k.name,children:k.name}),e(L,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:a(k.primaryValue),children:a(k.primaryValue)}),n&&e(L,{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 u=Math.max(680,t.length*74),p=240,f={top:20,right:18,bottom:36,left:18},b=Tl(t.flatMap(h=>[h.primaryValue,h.secondaryValue??0])),m=u-f.left-f.right,v=p-f.top-f.bottom,y=h=>t.map((C,k)=>{let w=f.left+k*m/Math.max(t.length-1,1),T=p-f.bottom-h(C)/b*v;return {x:w,y:T,item:C}}),g=y(h=>h.primaryValue),x=n?y(h=>h.secondaryValue??0):[];return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[e("div",{sx:{overflowX:"auto"},children:c("div",{component:"svg",viewBox:`0 0 ${u} ${p}`,sx:{width:"100%",minWidth:u,height:p},children:[e("line",{x1:f.left,y1:p-f.bottom,x2:u-f.right,y2:p-f.bottom,stroke:Ar(s.palette.text.secondary,.35)}),e("polyline",{fill:"none",stroke:l,strokeWidth:3,points:g.map(h=>`${h.x},${h.y}`).join(" ")}),g.map(h=>e("circle",{cx:h.x,cy:h.y,r:4,fill:l,children:c("title",{children:[h.item.name,`
197
- `,o,": ",a(h.item.primaryValue)]})},`primary-${h.item.name}`)),n&&c(jsxRuntime.Fragment,{children:[e("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:x.map(h=>`${h.x},${h.y}`).join(" ")}),x.map(h=>e("circle",{cx:h.x,cy:h.y,r:3.5,fill:d,children:c("title",{children:[h.item.name,`
198
- `,n,": ",(i??a)(h.item.secondaryValue??0)]})},`secondary-${h.item.name}`))]})]})}),e("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:t.map(h=>c("div",{sx:C=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Ar(C.palette.divider,.7)}`,bgcolor:Ar(C.palette.background.default,.35)}),children:[e(L,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:h.name,children:h.name}),e(L,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(h.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(h.secondaryValue??0)})]},h.name))})]})};var Ku=(t,r,o)=>{let n=new Set,a=[];return t.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:o.get(i)?.label??i,zone:"rows"}));}),r.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:o.get(i)?.label??i,zone:"columns"}));}),a},qu=(t,r,o)=>t.map(n=>{let a=r.get(n.fieldId),i=a?.label??n.fieldId;return {fieldId:n.fieldId,label:`${o(n.aggregation)} \xB7 ${i}`,item:n,field:a}}),Xu=({rows:t,dimensionFieldId:r,primaryValue:o,secondaryValue:n})=>{if(!r)return [];let a=new Map;return t.forEach(i=>{let s=co(i[r]),l=a.get(s);if(l){l.push(i);return}a.set(s,[i]);}),Array.from(a.entries()).sort((i,s)=>i[0].localeCompare(s[0],void 0,{sensitivity:"base"})).map(([i,s])=>({name:i,primaryValue:wn(s,o.fieldId,o.aggregation),secondaryValue:n?wn(s,n.fieldId,n.aggregation):void 0}))};P();var Yu=({rows:t,fieldMap:r,rowFields:o,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:l,chartType:d,isCollapsed:u,onChartDimensionFieldIdChange:p,onChartPrimaryValueFieldIdChange:f,onChartSecondaryValueFieldIdChange:b,onChartTypeChange:m,onToggleCollapse:v,getAggregationLabel:y})=>{let{t:g}=pe(),x=er.useMemo(()=>Ku(o,n,r),[n,r,o]),h=er.useMemo(()=>qu(a,r,y),[r,y,a]),C=h.find(M=>M.fieldId===s)??h[0],k=h.find(M=>M.fieldId===l&&M.fieldId!==C?.fieldId)??null,w=x.find(M=>M.fieldId===i)??x[0],T=w&&C?g("pivot.chart.subtitleReady",{dimension:w.label,measure:k?`${C.label} / ${k.label}`:C.label}):g("pivot.chart.subtitle"),I=er.useMemo(()=>!w||!C?[]:Xu({rows:t,dimensionFieldId:w.fieldId,primaryValue:C.item,secondaryValue:k?.item}),[C,t,k,w]),S=M=>C?ua(M,C.item,r):M.toLocaleString(),A=M=>k?ua(M,k.item,r):M.toLocaleString(),D=x.length>1||h.length>1;return c(Tn,{title:g("pivot.chart.title"),subtitle:T,collapsed:u,onToggleCollapse:v,expandAriaLabel:g("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[D&&c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[c(Co,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.dimension")}),e(zt,{value:w?.fieldId??"",onChange:M=>p(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(M=>e("option",{value:M.fieldId,sx:{fontSize:"0.75rem"},children:M.label},M.fieldId))})]}),c(Co,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.primaryMeasure")}),e(zt,{value:C?.fieldId??"",onChange:M=>f(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:h.map(M=>e("option",{value:M.fieldId,sx:{fontSize:"0.75rem"},children:M.label},M.fieldId))})]}),c(Co,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.secondaryMeasure")}),c(zt,{value:k?.fieldId??"",onChange:M=>b(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("common.none")}),h.filter(M=>M.fieldId!==C?.fieldId).map(M=>e("option",{value:M.fieldId,sx:{fontSize:"0.75rem"},children:M.label},M.fieldId))]})]}),c(Co,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.chartType")}),c(zt,{value:d,onChange:M=>m(M.target.value),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.barVertical")}),e("option",{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.barHorizontal")}),e("option",{value:"line",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.line")}),e("option",{value:"scatter",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.scatter")})]})]})]}),e("div",{children:w?C?I.length===0?e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoData")})}):d==="scatter"?e(Gu,{data:I,primaryLabel:C.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:A}):e(Uu,{data:I,chartType:d,primaryLabel:C.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:A}):e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoValue")})}):e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoDimension")})})})]})};P();var Qi=({node:t,dataColumns:r,fieldMap:o,level:n,expandedKeys:a,onToggle:i,getValue:s})=>{let l=a.has(t.key),d=t.children.length>0,u=t.isGrandTotal,p=d&&!l&&!u,f=u?800:p?700:d?600:500,b=u?800:p?600:500;return c(jsxRuntime.Fragment,{children:[c("tr",{sx:{bgcolor:u?vt()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":vt()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:u?vt()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[c("td",{style:{fontWeight:f},sx:m=>({fontSize:"0.76rem",borderBottom:`1px solid ${m.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!u&&e(ae,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:l?e(Vr,{size:12}):e(ko,{size:12})}),!d&&!u&&n>0&&e("div",{sx:{width:18}}),t.value]}),r.map(m=>e("td",{align:"right",style:{fontWeight:b},sx:{fontSize:"0.76rem",borderBottom:v=>`1px solid ${v.palette.divider}`,whiteSpace:"nowrap"},children:ua(s?s(t,m.id):t.aggregatedValues[m.id]??0,m.valueItem,o)},`${t.key}-${m.id}`))]}),l&&t.children.map(m=>e(Qi,{node:m,dataColumns:r,fieldMap:o,level:n+1,expandedKeys:a,onToggle:i,getValue:s},m.key))]})};P();var Ml=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},es=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",Rl=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",ju=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children.length>0&&(r.add(a.key),o(a.children));});};return o(t),r},Qu=(t,r,o=0)=>t.length===0?o:t.reduce((n,a)=>a.children.length===0||!r.has(a.key)?Math.max(n,o+1):Math.max(n,Qu(a.children,r,o+1)),o),Qv=(t,r)=>{let o=[],n=a=>{a.forEach(i=>{if(i.children.length>0&&r.has(i.key)){n(i.children);return}o.push(i);});};return n(t),o},uO=({title:t,rows:r,fields:o,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:l=false,initialTableCollapsed:d=false,model:u,enablePresetManagement:p=false,presets:f,defaultPresets:b,onPresetsChange:m,initialPresetId:v,onPresetApplied:y})=>{let{t:g}=pe(),x=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),h=er.useRef(0),C=er.useRef(false),k=t??g("pivot.title.default"),w=i??g("pivot.empty"),T=er.useMemo(()=>({sum:g("pivot.agg.sum"),count:g("pivot.agg.count"),avg:g("pivot.agg.avg"),min:g("pivot.agg.min"),max:g("pivot.agg.max")}),[g]),I=er.useCallback(R=>T[R]??Nu[R],[T]),S=er.useMemo(()=>new Set(o.map(R=>R.id)),[o]),A=er.useMemo(()=>new Map(o.map(R=>[R.id,R])),[o]),[D,M]=er.useState(()=>lr(n?.rows,S)),[N,E]=er.useState(()=>lr(n?.columns,S)),[O,F]=er.useState(()=>lr(n?.filters,S)),[X,H]=er.useState(()=>{let R=n?.values??[],_=new Set,G=[];return R.forEach(de=>{if(!S.has(de.fieldId)||_.has(de.fieldId))return;_.add(de.fieldId),h.current+=1;let He=A.get(de.fieldId);G.push({tokenId:`v${h.current}`,fieldId:de.fieldId,aggregation:vr(de.aggregation,He)});}),G}),[Y,W]=er.useState({}),[j,V]=er.useState(true),[z,U]=er.useState(false),[K,fe]=er.useState(()=>Ml(lr(n?.rows,S),lr(n?.columns,S),a?.dimensionFieldId)),[se,ue]=er.useState(()=>{let R=(n?.values??[]).filter((_,G,de)=>S.has(_.fieldId)&&de.findIndex(He=>He.fieldId===_.fieldId)===G).map(_=>({tokenId:_.fieldId,fieldId:_.fieldId,aggregation:vr(_.aggregation,A.get(_.fieldId))}));return es(R,a?.primaryValueFieldId)}),[Se,$e]=er.useState(()=>{let R=(n?.values??[]).filter((G,de,He)=>S.has(G.fieldId)&&He.findIndex(ot=>ot.fieldId===G.fieldId)===de).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:vr(G.aggregation,A.get(G.fieldId))})),_=es(R,a?.primaryValueFieldId);return Rl(R,_,a?.secondaryValueFieldId)}),[ke,le]=er.useState(a?.chartType??"bar-vertical"),[Ee,Me]=er.useState(l),[Pe,Ve]=er.useState(d),[tt,nt]=er.useState(()=>b??[]),[it,q]=er.useState(""),[De,ye]=er.useState(false),[Be,at]=er.useState(""),[Ze,St]=er.useState(null),[Mt,Ot]=er.useState(new Set(["__grand_total__"])),[At,re]=er.useState(new Set),Ke=u?.rowFields??D,Fe=u?.columnFields??N,ce=u?.filterFields??O,ve=u?.valueFields??X,te=u?.filterSelections??Y,he=u?.showGrandTotal??j,Ne=u?.isConfiguratorCollapsed??z,Je=u?.chartDimensionFieldId??K,st=u?.chartPrimaryValueFieldId??se,pt=u?.chartSecondaryValueFieldId??Se,Bt=u?.chartType??ke,Xt=u?.isChartCollapsed??Ee,Vt=u?.isTableCollapsed??Pe,wt=f??tt,Wt=p||wt.length>0||!!m,ht=er.useCallback(R=>{if(u?.setRowFields){u.setRowFields(R);return}M(R);},[u]),Nt=er.useCallback(R=>{if(u?.setColumnFields){u.setColumnFields(R);return}E(R);},[u]),lt=er.useCallback(R=>{if(u?.setFilterFields){u.setFilterFields(R);return}F(R);},[u]),Ft=er.useCallback(R=>{if(u?.setValueFields){u.setValueFields(R);return}H(R);},[u]),Yt=er.useCallback(R=>{if(u?.setFilterSelections){u.setFilterSelections(R);return}W(R);},[u]),Z=er.useCallback(R=>{if(u?.setShowGrandTotal){u.setShowGrandTotal(R);return}V(R);},[u]),$=er.useCallback(R=>{if(u?.setIsConfiguratorCollapsed){u.setIsConfiguratorCollapsed(R);return}U(R);},[u]),Q=er.useCallback(R=>{if(u?.setChartDimensionFieldId){u.setChartDimensionFieldId(R);return}fe(R);},[u]),be=er.useCallback(R=>{if(u?.setChartPrimaryValueFieldId){u.setChartPrimaryValueFieldId(R);return}ue(R);},[u]),Ce=er.useCallback(R=>{if(u?.setChartSecondaryValueFieldId){u.setChartSecondaryValueFieldId(R);return}$e(R);},[u]),Le=er.useCallback(R=>{if(u?.setChartType){u.setChartType(R);return}le(R);},[u]),_e=er.useCallback(R=>{if(u?.setIsChartCollapsed){u.setIsChartCollapsed(R);return}Me(R);},[u]),qe=er.useCallback(R=>{if(u?.setIsTableCollapsed){u.setIsTableCollapsed(R);return}Ve(R);},[u]),je=er.useCallback(R=>{let _=typeof R=="function"?R(wt):R;f||nt(_),m?.(_);},[m,wt,f]),mt=er.useMemo(()=>new Set([...Ke,...Fe,...ce]),[Ke,Fe,ce]),ft=er.useMemo(()=>o.filter(R=>!mt.has(R.id)),[o,mt]),Rt=er.useMemo(()=>{let R=[...Ke,...Fe,...ce],_=new Set,G=[];return R.forEach(de=>{_.has(de)||(_.add(de),G.push(de));}),G},[Fe,ce,Ke]);er.useEffect(()=>{ht(R=>{let _=R.filter(G=>S.has(G));return po(R,_)?R:_}),Nt(R=>{let _=R.filter(G=>S.has(G));return po(R,_)?R:_}),lt(R=>{let _=R.filter(G=>S.has(G));return po(R,_)?R:_}),Ft(R=>{let _=R.filter(G=>S.has(G.fieldId)).map(G=>({...G,aggregation:vr(G.aggregation,A.get(G.fieldId))}));return qi(R,_)?R:_});},[A,S]);let yt=er.useMemo(()=>{let R={};return Rt.forEach(_=>{let G=new Set;r.forEach(de=>{G.add(co(de[_]));}),R[_]=Array.from(G).sort((de,He)=>de.localeCompare(He));}),R},[Rt,r]);er.useEffect(()=>{Yt(R=>{let _={};return Rt.forEach(G=>{let de=yt[G]??[],ot=(R[G]??[]).filter(oe=>de.includes(oe)),Ge=Object.prototype.hasOwnProperty.call(R,G);_[G]=Ge?ot:de;}),Bu(R,_)?R:_});},[Rt,yt]),er.useEffect(()=>{Q(R=>Ml(Ke,Fe,R));},[Fe,Ke,Q]),er.useEffect(()=>{be(R=>es(ve,R));},[be,ve]),er.useEffect(()=>{Ce(R=>Rl(ve,st,R));},[st,Ce,ve]);let B=er.useMemo(()=>r.filter(R=>Rt.every(_=>{let G=te[_]??[],de=yt[_]??[];if(G.length===de.length)return true;if(G.length===0)return false;let He=co(R[_]);return G.includes(He)})),[Rt,yt,te,r]),J=er.useMemo(()=>{if(ve.length===0)return null;let R=new Map;if(B.forEach(Ge=>{let oe=Fe.length>0?Fe.map(ee=>co(Ge[ee])):[g("pivot.valueLabel")],me=_o(oe);R.set(me,oe);}),R.size===0){let Ge=Fe.length>0?Fe.map(()=>Ui):[g("pivot.valueLabel")];R.set(_o(Ge),Ge);}let _=Array.from(R.entries()).sort((Ge,oe)=>Fu(Ge[1],oe[1])),G=_.flatMap(([Ge,oe])=>ve.map(me=>{let ee=A.get(me.fieldId),Oe=`${I(me.aggregation)} ${ee?.label??me.fieldId}`,Qe=Fe.length===0||ve.length>1?`${oe.join(" / ")} \u2022 ${Oe}`:oe.join(" / ");return {id:`${Ge}::${me.tokenId}`,colKey:Ge,valueItem:me,label:Qe}})),de=[];Fe.length>0&&_.forEach(([Ge,oe])=>{let me=G.filter(Qe=>Qe.colKey===Ge),ee=de,Oe=[];oe.forEach((Qe,Re)=>{Oe.push(`d${Re}:${Qe}`);let Ye=`col::${_o(Oe)}`,Pt=ee.find(Qo=>Qo.key===Ye);Pt||(Pt={key:Ye,label:Qe,children:[],leafColumnIds:[],path:oe.slice(0,Re+1),depth:Re},ee.push(Pt)),me.forEach(Qo=>{Pt.leafColumnIds.includes(Qo.id)||Pt.leafColumnIds.push(Qo.id);}),ee=Pt.children;});});let He=Ge=>{let oe={};return G.forEach(me=>{let ee=Ge.filter(Oe=>{let Qe=Fe.length>0?Fe.map(Re=>co(Oe[Re])):[g("pivot.valueLabel")];return _o(Qe)===me.colKey});oe[me.id]=wn(ee,me.valueItem.fieldId,me.valueItem.aggregation);}),oe},ot=[];if(Ke.length===0)ot.push({key:"root",value:g("pivot.resultLabel")||Ru,children:[],isLeaf:true,aggregatedValues:He(B),path:[],depth:0});else {let Ge=(oe,me,ee)=>{if(me>=Ke.length)return [];let Oe=Ke[me],Qe=new Map;return oe.forEach(Re=>{let Ye=co(Re[Oe]);Qe.has(Ye)||Qe.set(Ye,[]),Qe.get(Ye).push(Re);}),Array.from(Qe.keys()).sort().map(Re=>{let Ye=Qe.get(Re),Pt=[...ee,Re];return {key:_o(Pt),value:Re,fieldId:Oe,aggregatedValues:He(Ye),children:Ge(Ye,me+1,Pt),isLeaf:me===Ke.length-1,path:Pt,depth:me}})};ot.push(...Ge(B,0,[]));}return {dataColumns:G,columnTree:de,rowTree:ot}},[Fe,A,B,I,Ke,g,ve]),ge=er.useCallback((R,_)=>(h.current+=1,{tokenId:`v${h.current}`,fieldId:R,aggregation:vr(_,A.get(R))}),[A]),Te=er.useCallback(R=>{if(R==="rows")return ht([]);if(R==="columns")return Nt([]);if(R==="filters")return lt([]);Ft([]);},[]),et=er.useCallback((R,_)=>{if(R==="rows")return ht(G=>G.filter(de=>de!==_));if(R==="columns")return Nt(G=>G.filter(de=>de!==_));if(R==="filters")return lt(G=>G.filter(de=>de!==_));Ft(G=>G.filter(de=>de.tokenId!==_));},[]),Xe=er.useCallback((R,_)=>{Ft(G=>G.map(de=>de.tokenId===R?{...de,aggregation:vr(_,A.get(de.fieldId))}:de));},[A]),kt=er.useCallback(R=>{St(String(R.active.id));},[]),bt=er.useCallback(R=>{if(St(null),!R.over)return;let _=Ki(String(R.active.id)),G=Ki(String(R.over.id));if(!_||!G||_.kind!=="item"||!_.key)return;if(_.zone===G.zone&&G.kind==="item"){if(_.zone==="rows"){let Re=Ke.indexOf(_.key),Ye=Ke.indexOf(G.key??"");Re!==-1&&Ye!==-1&&Re!==Ye&&ht(Pt=>sortable.arrayMove(Pt,Re,Ye));return}if(_.zone==="columns"){let Re=Fe.indexOf(_.key),Ye=Fe.indexOf(G.key??"");Re!==-1&&Ye!==-1&&Re!==Ye&&Nt(Pt=>sortable.arrayMove(Pt,Re,Ye));return}if(_.zone==="filters"){let Re=ce.indexOf(_.key),Ye=ce.indexOf(G.key??"");Re!==-1&&Ye!==-1&&Re!==Ye&&lt(Pt=>sortable.arrayMove(Pt,Re,Ye));return}if(_.zone==="values"){let Re=ve.findIndex(Pt=>Pt.tokenId===_.key),Ye=ve.findIndex(Pt=>Pt.tokenId===(G.key??""));Re!==-1&&Ye!==-1&&Re!==Ye&&Ft(Pt=>sortable.arrayMove(Pt,Re,Ye));}return}let de=G.zone,He=[...Ke],ot=[...Fe],Ge=[...ce],oe=[...ve],me="",ee=null;if(_.zone==="palette")me=_.key;else if(_.zone==="values"){let Re=oe.find(Ye=>Ye.tokenId===_.key);if(!Re)return;me=Re.fieldId,ee=Re,oe=oe.filter(Ye=>Ye.tokenId!==_.key);}else _.zone==="rows"?(me=_.key,He=He.filter(Re=>Re!==me)):_.zone==="columns"?(me=_.key,ot=ot.filter(Re=>Re!==me)):_.zone==="filters"&&(me=_.key,Ge=Ge.filter(Re=>Re!==me));if(!me)return;let Oe=()=>{He=He.filter(Re=>Re!==me),ot=ot.filter(Re=>Re!==me),Ge=Ge.filter(Re=>Re!==me);},Qe=Re=>{if(G.kind!=="item"||!G.key)return Re==="rows"?He.length:Re==="columns"?ot.length:Re==="filters"?Ge.length:Re==="values"?oe.length:0;if(Re==="rows"){let Ye=He.indexOf(G.key);return Ye>=0?Ye:He.length}if(Re==="columns"){let Ye=ot.indexOf(G.key);return Ye>=0?Ye:ot.length}if(Re==="filters"){let Ye=Ge.indexOf(G.key);return Ye>=0?Ye:Ge.length}if(Re==="values"){let Ye=oe.findIndex(Pt=>Pt.tokenId===G.key);return Ye>=0?Ye:oe.length}return 0};if(de==="palette"){ht(He),Nt(ot),lt(Ge),Ft(oe);return}if(de==="values"){let Re=Qe("values"),Ye=ee??ge(me);oe.splice(Re,0,Ye),ht(He),Nt(ot),lt(Ge),Ft(oe);return}if(Ou(de)){Oe();let Re=Qe(de);de==="rows"?He.splice(Re,0,me):de==="columns"?ot.splice(Re,0,me):Ge.splice(Re,0,me),ht(He),Nt(ot),lt(Ge),Ft(oe);}},[Fe,ge,ce,Ke,ve]),gt=er.useCallback((R,_)=>{Yt(G=>({...G,[R]:_}));},[]),Ct=er.useCallback(R=>{Ot(_=>{let G=new Set(_);return G.has(R)?G.delete(R):G.add(R),G});},[]),nr=er.useCallback(R=>{re(_=>{let G=new Set(_);return G.has(R)?G.delete(R):G.add(R),G});},[]),Et=er.useCallback(R=>{let _=A.get(R.fieldId),G=kl(_);return e(Co,{size:"small",sx:{minWidth:98},children:e(zt,{value:R.aggregation,onChange:de=>Xe(R.tokenId,de.target.value),onClick:de=>de.stopPropagation(),onMouseDown:de=>de.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:G.map(de=>e("option",{value:de,sx:{fontSize:"0.75rem"},children:I(de)},de))})})},[A,I,Xe]),Zt=er.useCallback(R=>{let _=yt[R]??[],G=te[R]??_;return _.length===0?g("pivot.filter.noValues"):G.length===0?g("pivot.filter.noneSelected"):G.length===_.length?g("pivot.filter.allValues"):g("pivot.filter.selectedCount",{selected:G.length,total:_.length})},[yt,te,g]),Ht=er.useCallback(R=>{let _=yt[R]??[],G=te[R]??_;return e(zu,{options:_,selectedValues:G,onChange:de=>gt(R,de)})},[yt,te,gt]),Kt=er.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),$t=er.useCallback(()=>{let R={};return new Set([...Rt,...Object.keys(te)]).forEach(G=>{if(!S.has(G))return;let de=te[G]??[];R[G]=[...de];}),{layout:{rows:[...Ke],columns:[...Fe],filters:[...ce],values:ve.map(G=>({fieldId:G.fieldId,aggregation:G.aggregation}))},filterSelections:R,showGrandTotal:he,chart:{dimensionFieldId:Je,primaryValueFieldId:st,secondaryValueFieldId:pt,chartType:Bt}}},[Rt,Je,st,pt,Bt,Fe,ce,te,Ke,he,S,ve]),rr=er.useCallback(R=>{let _=lr(R.layout.rows,S),G=lr(R.layout.columns,S),de=lr(R.layout.filters,S),He=new Set,ot=(R.layout.values??[]).filter(me=>!S.has(me.fieldId)||He.has(me.fieldId)?false:(He.add(me.fieldId),true)).map(me=>ge(me.fieldId,me.aggregation)),Ge={};Object.entries(R.filterSelections??{}).forEach(([me,ee])=>{!S.has(me)||!Array.isArray(ee)||(Ge[me]=Array.from(new Set(ee.map(Oe=>String(Oe)))));}),ht(_),Nt(G),lt(de),Ft(ot),Yt(Ge),typeof R.showGrandTotal=="boolean"&&Z(R.showGrandTotal),Q(Ml(_,G,R.chart?.dimensionFieldId));let oe=es(ot,R.chart?.primaryValueFieldId);be(oe),Ce(Rl(ot,oe,R.chart?.secondaryValueFieldId)),Le(R.chart?.chartType??"bar-vertical"),q(R.id),y?.(R);},[ge,y,Q,be,Ce,Le,Nt,lt,Yt,ht,Z,Ft,S]),ar=er.useCallback(R=>{if(!R){q("");return}let _=wt.find(G=>G.id===R);if(!_){q("");return}rr(_);},[rr,wt]),fr=er.useCallback(()=>{let R=g("pivot.preset.defaultName",{index:wt.length+1});at(R),ye(true);},[wt.length,g]),Ir=er.useCallback(()=>{let R=Be.trim();if(!R)return;let _={id:Kt(),name:R,...$t()};je(G=>[...G,_]),q(_.id),ye(false);},[$t,Kt,Be,je]),Mr=er.useCallback(()=>{it&&(je(R=>R.filter(_=>_.id!==it)),q(""));},[it,je]);er.useEffect(()=>{if(!v||C.current)return;let R=wt.find(_=>_.id===v);R&&(C.current=true,rr(R));},[rr,v,wt]),er.useEffect(()=>{it&&(wt.some(R=>R.id===it)||q(""));},[it,wt]);let oo=er.useMemo(()=>{if(!he||!J||!Ke.length)return null;let R={};return J.dataColumns.forEach(_=>{let G=B.filter(de=>{let He=Fe.length>0?Fe.map(ot=>co(de[ot])):[g("pivot.valueLabel")];return _o(He)===_.colKey});R[_.id]=wn(G,_.valueItem.fieldId,_.valueItem.aggregation);}),{key:"__grand_total__",value:g("pivot.grandTotal")||Du,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:R,path:[],depth:-1}},[he,J,B,Fe,Ke.length,g]),yr=er.useMemo(()=>ju(J?.rowTree??[]),[J]),Or=er.useMemo(()=>ju(J?.columnTree??[]),[J]);er.useEffect(()=>{Ot(R=>{let _=new Set;return R.has("__grand_total__")&&_.add("__grand_total__"),yr.forEach(G=>{R.has(G)&&_.add(G);}),_});},[yr]),er.useEffect(()=>{re(R=>{let _=new Set;return Or.forEach(G=>{R.has(G)&&_.add(G);}),_});},[Or]);let qo=er.useCallback(()=>{Ot(R=>{let _=new Set(R);return yr.forEach(G=>_.add(G)),_});},[yr]),Xo=er.useCallback(()=>{Ot(R=>{let _=new Set;return R.has("__grand_total__")&&_.add("__grand_total__"),_});},[]),Lo=er.useCallback(()=>{re(new Set(Or));},[Or]),Yo=er.useCallback(()=>{re(new Set);},[]),Zo=er.useMemo(()=>!J||Fe.length===0?[]:Qv(J.columnTree,At),[Fe.length,At,J]),Rr=er.useMemo(()=>{if(!J)return [];if(Fe.length===0)return J.dataColumns.map(_=>({id:_.id,label:_.label,leafColumnIds:[_.id],valueItem:_.valueItem}));let R=new Map(J.dataColumns.map(_=>[_.id,_]));return Zo.flatMap(_=>{let G=new Map;return _.leafColumnIds.forEach(de=>{let He=R.get(de);if(!He)return;let ot=He.valueItem.tokenId,Ge=`${I(He.valueItem.aggregation)} ${A.get(He.valueItem.fieldId)?.label??He.valueItem.fieldId}`,oe=G.get(ot);if(oe){oe.leafColumnIds.push(de);return}G.set(ot,{id:`${_.key}::${ot}`,label:ve.length>1?Ge:_.label,leafColumnIds:[de],valueItem:He.valueItem});}),Array.from(G.values())})},[Fe.length,A,I,J,ve.length,Zo]),Oo=er.useMemo(()=>new Map(Rr.map(R=>[R.id,R])),[Rr]),jo=er.useMemo(()=>Rr.map(R=>({id:R.id,colKey:R.id,valueItem:R.valueItem,label:R.label})),[Rr]),Kr=er.useMemo(()=>{if(!J||Fe.length===0)return [];let R=[],_=Qu(J.columnTree,At),G=_+(ve.length>1?1:0),de=(He,ot)=>{R[ot]??(R[ot]=[]),He.forEach(Ge=>{let oe=Ge.children.length>0&&At.has(Ge.key),me=Rr.filter(Oe=>Ge.leafColumnIds.some(Qe=>Oe.leafColumnIds.includes(Qe))).length,ee=oe||ve.length>1?1:G-ot;R[ot].push({key:Ge.key,label:Ge.label,colSpan:me,rowSpan:ee,expandable:Ge.children.length>0,expanded:oe}),oe&&de(Ge.children,ot+1);});};return de(J.columnTree,0),ve.length>1&&(R[_]=Rr.map(He=>({key:He.id,label:He.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),R},[Fe.length,At,J,ve.length,Rr]),no=er.useCallback((R,_)=>_.leafColumnIds.reduce((G,de)=>G+(R.aggregatedValues[de]??0),0),[]),Ln=er.useMemo(()=>c(jsxRuntime.Fragment,{children:[e(we,{size:"small",variant:"text",onClick:qo,disabled:yr.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandRowsAll")}),e(we,{size:"small",variant:"text",onClick:Xo,disabled:yr.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseRowsAll")}),e(Dt,{orientation:"vertical",flexItem:true}),e(we,{size:"small",variant:"text",onClick:Lo,disabled:Or.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandColumnsAll")}),e(we,{size:"small",variant:"text",onClick:Yo,disabled:Fe.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseColumnsAll")})]}),[Fe.length,Or.size,yr.size,Yo,Xo,Lo,qo,g]),Fo=()=>{if(!Ze)return null;let R=Ki(Ze);if(!R||R.kind!=="item"||!R.key)return null;if(R.zone==="palette"){let He=A.get(R.key);return He?e(Pl,{label:He.label,subtitle:He.type}):null}if(R.zone==="values"){let He=ve.find(me=>me.tokenId===R.key);if(!He)return null;let Ge=A.get(He.fieldId)?.label??He.fieldId,oe=`${I(He.aggregation)}(${Ge})`;return e(Xi,{label:Ge,caption:oe})}let G=A.get(R.key)?.label??R.key,de=Zt(R.key);return e(Xi,{label:G,caption:de})};return c(Ae,{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:[c("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[c("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.35},children:[e(L,{component:"div",sx:{fontSize:"1.08rem",fontWeight:700,lineHeight:1.25,color:"var(--orb-fg-strong)"},children:k}),e(L,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.subtitle.default")})]}),c(ie,{direction:"row",spacing:1.5,alignItems:"center",children:[Wt&&c(jsxRuntime.Fragment,{children:[e(Co,{size:"small",sx:{minWidth:200},children:c(zt,{value:it,displayEmpty:true,onChange:R=>ar(String(R.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("pivot.preset.selectPlaceholder")}),wt.map(R=>e("option",{value:R.id,sx:{fontSize:"0.75rem"},children:R.name},R.id))]})}),e(ct,{title:g("pivot.preset.save"),children:e(ae,{size:"small",onClick:fr,"aria-label":g("pivot.preset.save"),sx:{width:28,height:28,p:0},children:e(Po,{size:15})})}),e(ct,{title:g("pivot.preset.delete"),children:e("span",{children:e(ae,{size:"small",onClick:Mr,disabled:!it,"aria-label":g("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:e(ni,{size:15})})})}),e(Dt,{flexItem:true,orientation:"vertical"})]}),c(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)"},children:[g("pivot.records"),": ",e("strong",{children:r.length.toLocaleString()})," / ",g("pivot.afterFilter"),":"," ",e("strong",{children:B.length.toLocaleString()})]}),e(Dt,{flexItem:true,orientation:"vertical"}),c("div",{sx:{display:"flex",alignItems:"center",gap:.6},children:[e(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:500,color:"var(--orb-fg-strong)"},children:g("pivot.grandTotal")}),e(ei,{size:"small",checked:he,onChange:R=>Z(R.target.checked)})]})]})]}),e(Dt,{}),c(core.DndContext,{sensors:x,collisionDetection:core.closestCenter,onDragStart:kt,onDragEnd:bt,children:[e($u,{isConfiguratorCollapsed:Ne,onToggleCollapse:()=>$(R=>!R),availableFields:ft,fieldMap:A,filterFields:ce,columnFields:Fe,rowFields:Ke,valueFields:ve,clearZone:Te,removeFieldFromZone:et,getFilterSelectionSummary:Zt,renderDimensionFilterSelect:Ht,renderAggregationSelect:Et,getAggregationLabel:I}),e(Md,{children:e(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Fo()})})]}),e(Yu,{rows:B,fieldMap:A,rowFields:Ke,columnFields:Fe,valueFields:ve,chartDimensionFieldId:Je,chartPrimaryValueFieldId:st,chartSecondaryValueFieldId:pt,chartType:Bt,isCollapsed:Xt,onChartDimensionFieldIdChange:R=>Q(R),onChartPrimaryValueFieldIdChange:R=>be(R),onChartSecondaryValueFieldIdChange:R=>Ce(R),onChartTypeChange:R=>Le(R),onToggleCollapse:()=>_e(R=>!R),getAggregationLabel:I}),e(Tn,{title:g("pivot.table.sectionTitle"),subtitle:Ke.length>0?Ke.map(R=>A.get(R)?.label??R).join(" > "):g("pivot.table.dimensions"),collapsed:Vt,onToggleCollapse:()=>qe(R=>!R),expandAriaLabel:g("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Ln,children:J===null?e("div",{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:w})}):e("div",{sx:{maxHeight:s},children:c("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[e("thead",{children:(Kr.length>0?Kr:[[]]).map((R,_)=>c("tr",{children:[_===0&&e("td",{rowSpan:Math.max(Kr.length,1),sx:G=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:vt()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${G.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:Ke.length>0?Ke.map(G=>A.get(G)?.label).join(" > "):g("pivot.table.dimensions")}),(R.length>0?R:Rr.map(G=>({key:G.id,label:G.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(G=>e("td",{align:"center",colSpan:G.colSpan,rowSpan:G.rowSpan,sx:de=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:vt()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${de.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:c("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[G.expandable&&e(ae,{size:"small",onClick:()=>nr(G.key),sx:{width:22,height:22,p:0,ml:-0.2},children:G.expanded?e(Vr,{size:12}):e(ko,{size:12})}),e("div",{component:"span",children:G.label})]})},G.key))]},`pivot-header-row-${_}`))}),c("tbody",{children:[J.rowTree.map(R=>e(Qi,{node:R,dataColumns:jo,fieldMap:A,level:0,expandedKeys:Mt,onToggle:Ct,getValue:(_,G)=>{let de=Oo.get(G);return de?no(_,de):0}},R.key)),oo&&e(Qi,{node:oo,dataColumns:jo,fieldMap:A,level:0,expandedKeys:Mt,onToggle:Ct,getValue:(R,_)=>{let G=Oo.get(_);return G?no(R,G):0}})]})]})})}),c(Lt,{open:De,onClose:()=>ye(false),maxWidth:"xs",fullWidth:true,children:[e("div",{className:"orb-dialog-title",children:g("pivot.preset.saveDialogTitle")}),e("div",{className:"orb-dialog-content",children:e(ze,{autoFocus:true,fullWidth:true,margin:"dense",label:g("pivot.preset.nameLabel"),value:Be,onChange:R=>at(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),Ir());}})}),c("div",{className:"orb-dialog-actions",children:[e(we,{onClick:()=>ye(false),children:g("common.cancel")}),e(we,{variant:"contained",onClick:Ir,disabled:!Be.trim(),children:g("common.save")})]})]})]})};var Ju=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},Nl=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",em=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",hO=({fields:t,initialLayout:r,initialFilterSelections:o={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:l=false})=>{let d=er.useRef(0),u=er.useMemo(()=>new Set(t.map(q=>q.id)),[t]),p=er.useMemo(()=>new Map(t.map(q=>[q.id,q])),[t]),[f,b]=er.useState(()=>lr(r?.rows,u)),[m,v]=er.useState(()=>lr(r?.columns,u)),[y,g]=er.useState(()=>lr(r?.filters,u)),[x,h]=er.useState(()=>{let q=r?.values??[],De=new Set,ye=[];return q.forEach(Be=>{!u.has(Be.fieldId)||De.has(Be.fieldId)||(De.add(Be.fieldId),d.current+=1,ye.push({tokenId:`v${d.current}`,fieldId:Be.fieldId,aggregation:vr(Be.aggregation,p.get(Be.fieldId))}));}),ye}),[C,k]=er.useState(o),[w,T]=er.useState(n),[I,S]=er.useState(a),[A,D]=er.useState(()=>Ju(lr(r?.rows,u),lr(r?.columns,u),i?.dimensionFieldId)),[M,N]=er.useState(()=>{let q=(()=>{let De=r?.values??[],ye=new Set,Be=[];return De.forEach(at=>{!u.has(at.fieldId)||ye.has(at.fieldId)||(ye.add(at.fieldId),Be.push({tokenId:at.fieldId,fieldId:at.fieldId,aggregation:vr(at.aggregation,p.get(at.fieldId))}));}),Be})();return Nl(q,i?.primaryValueFieldId)}),[E,O]=er.useState(()=>{let q=(()=>{let ye=r?.values??[],Be=new Set,at=[];return ye.forEach(Ze=>{!u.has(Ze.fieldId)||Be.has(Ze.fieldId)||(Be.add(Ze.fieldId),at.push({tokenId:Ze.fieldId,fieldId:Ze.fieldId,aggregation:vr(Ze.aggregation,p.get(Ze.fieldId))}));}),at})(),De=Nl(q,i?.primaryValueFieldId);return em(q,De,i?.secondaryValueFieldId)}),[F,X]=er.useState(i?.chartType??"bar-vertical"),[H,Y]=er.useState(s),[W,j]=er.useState(l);er.useEffect(()=>{b(q=>{let De=q.filter(ye=>u.has(ye));return po(q,De)?q:De}),v(q=>{let De=q.filter(ye=>u.has(ye));return po(q,De)?q:De}),g(q=>{let De=q.filter(ye=>u.has(ye));return po(q,De)?q:De}),h(q=>{let De=q.filter(ye=>u.has(ye.fieldId)).map(ye=>({...ye,aggregation:vr(ye.aggregation,p.get(ye.fieldId))}));return qi(q,De)?q:De});},[p,u]),er.useEffect(()=>{D(q=>Ju(f,m,q));},[m,f]),er.useEffect(()=>{N(q=>Nl(x,q));},[x]),er.useEffect(()=>{O(q=>em(x,M,q));},[M,x]);let V=er.useCallback(q=>{b(lr(q,u));},[u]),z=er.useCallback(q=>{v(lr(q,u));},[u]),U=er.useCallback(q=>{g(lr(q,u));},[u]),K=er.useCallback(q=>{h(De=>{let ye=q??[],Be=new Set,at=[];return ye.forEach(Ze=>{if(!u.has(Ze.fieldId)||Be.has(Ze.fieldId))return;Be.add(Ze.fieldId);let St=De.find(Mt=>Mt.fieldId===Ze.fieldId);if(St){at.push({...St,aggregation:vr(Ze.aggregation??St.aggregation,p.get(Ze.fieldId))});return}d.current+=1,at.push({tokenId:`v${d.current}`,fieldId:Ze.fieldId,aggregation:vr(Ze.aggregation,p.get(Ze.fieldId))});}),at});},[p,u]),fe=er.useCallback(q=>{V(q.rows??[]),z(q.columns??[]),U(q.filters??[]),K(q.values??[]);},[z,U,V,K]),se=er.useCallback(q=>{if(q==="rows")return b([]);if(q==="columns")return v([]);if(q==="filters")return g([]);h([]);},[]),ue=er.useCallback((q,De)=>{if(q==="rows")return b(ye=>ye.filter(Be=>Be!==De));if(q==="columns")return v(ye=>ye.filter(Be=>Be!==De));if(q==="filters")return g(ye=>ye.filter(Be=>Be!==De));h(ye=>ye.filter(Be=>Be.tokenId!==De));},[]),Se=er.useCallback((q,De)=>{h(ye=>ye.map(Be=>Be.tokenId===q?{...Be,aggregation:vr(De,p.get(Be.fieldId))}:Be));},[p]),$e=er.useCallback((q,De)=>{k(ye=>({...ye,[q]:De}));},[]),ke=er.useCallback(()=>{k({});},[]),le=er.useCallback(()=>{T(q=>!q);},[]),Ee=er.useCallback(()=>{S(q=>!q);},[]),Me=er.useCallback(q=>{D(q);},[]),Pe=er.useCallback(q=>{N(q);},[]),Ve=er.useCallback(q=>{O(q);},[]),tt=er.useCallback(()=>{Y(q=>!q);},[]),nt=er.useCallback(()=>{j(q=>!q);},[]);return {model:er.useMemo(()=>({rowFields:f,setRowFields:b,columnFields:m,setColumnFields:v,filterFields:y,setFilterFields:g,valueFields:x,setValueFields:h,filterSelections:C,setFilterSelections:k,showGrandTotal:w,setShowGrandTotal:T,isConfiguratorCollapsed:I,setIsConfiguratorCollapsed:S,chartDimensionFieldId:A,setChartDimensionFieldId:D,chartPrimaryValueFieldId:M,setChartPrimaryValueFieldId:N,chartSecondaryValueFieldId:E,setChartSecondaryValueFieldId:O,chartType:F,setChartType:X,isChartCollapsed:H,setIsChartCollapsed:Y,isTableCollapsed:W,setIsTableCollapsed:j}),[A,M,E,F,m,y,C,H,I,W,f,w,x]),actions:{setRows:V,setColumns:z,setFilters:U,setValues:K,setLayout:fe,clearZone:se,removeFieldFromZone:ue,setAggregationForValue:Se,setFilterSelection:$e,resetFilterSelections:ke,toggleGrandTotal:le,toggleConfigurator:Ee,setChartDimension:Me,setChartPrimaryValue:Pe,setChartSecondaryValue:Ve,setChartType:X,toggleChart:tt,toggleTable:nt}}};var xO=({orientation:t="auto",defaultNavigationOpen:r,onNavOpenChange:o}={})=>{let n=sr(),a=xo("(orientation: portrait)"),i=xo(n.breakpoints.down("md")),s=er.useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[l,d]=er.useState(r??s==="landscape");er.useEffect(()=>{d(r??s==="landscape");},[r,s]);let u=f=>{d(f),o?.(f);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:l,setNavigationOpen:u,toggleNavigationOpen:()=>u(!l)}};var ny=t=>{let r=Number(t||0);return Number.isFinite(r)?r:0},kO=({rows:t,rowKey:r="id",numericField:o,defaultSelectedId:n})=>{let i=t[0]?.[r],[s,l]=er.useState(n??i),d=er.useMemo(()=>t.find(m=>m[r]===s)||t[0],[r,t,s]),[u,p]=er.useState(()=>{let m=d?.[o];return m==null?"0":String(m)});return {selectedId:s,selectedRecord:d,editorValue:u,setEditorValue:p,selectRecord:m=>{let v=m[r];l(v);let y=m[o];p(y==null?"0":String(y));},applyEditorValue:m=>{if(s===void 0)return;let v=ny(u),y=t.map(g=>g[r]===s?{...g,[o]:v}:g);m(y);}}};P();var ay=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],rm=(t,r,o,n)=>{r?.(t),n&&o?.();},DO=({open:t,onClose:r,title:o="Scan barcode",subtitle:n="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=ay,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:l=true,scanIntervalMs:d=600,confirmLabel:u="Use code",cancelLabel:p="Close",manualPlaceholder:f="Enter barcode manually",onDetected:b,onError:m,sx:v})=>{let y=er__namespace.default.useRef(null),g=er__namespace.default.useRef(null),x=er__namespace.default.useRef(null),h=er__namespace.default.useRef(null),[C,k]=er__namespace.default.useState("idle"),[w,T]=er__namespace.default.useState(""),[I,S]=er__namespace.default.useState(null),[A,D]=er__namespace.default.useState(null),M=er__namespace.default.useCallback(()=>{x.current!==null&&(window.clearInterval(x.current),x.current=null),g.current&&(g.current.getTracks().forEach(O=>O.stop()),g.current=null),y.current&&(y.current.srcObject=null);},[]),N=er__namespace.default.useCallback(O=>{D(O),k("error"),m?.(O);},[m]);er__namespace.default.useEffect(()=>{if(!t){M(),k("idle"),D(null),T("");return}let O=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){k("unsupported"),D("Camera access is not supported in this browser.");return}k("starting"),D(null);try{let X=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(O){X.getTracks().forEach(H=>H.stop());return}if(g.current=X,y.current&&(y.current.srcObject=X,await y.current.play()),!window.BarcodeDetector){k("unsupported"),D("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}h.current=new window.BarcodeDetector({formats:a}),k("ready"),x.current=window.setInterval(async()=>{if(!(!y.current||!h.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let Y=(await h.current.detect(y.current)).find(j=>j.rawValue);if(!Y?.rawValue)return;let W={rawValue:Y.rawValue,format:Y.format};S(W),M(),rm(W,b,r,l);}catch(H){N(H instanceof Error?H.message:"Failed to detect barcode.");}},d);}catch(X){N(X instanceof Error?X.message:"Unable to start camera.");}}})(),()=>{O=true,M();}},[l,i,a,r,b,t,N,d,M]);let E=()=>{let O=w.trim();if(!O)return;let F={rawValue:O,format:"manual"};S(F),rm(F,b,r,l);};return c(Lt,{open:t,onClose:r,fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:900},children:o}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c(ie,{spacing:2,sx:v,children:[e(L,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),c(Ae,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:vt()==="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:[e("video",{ref:y,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),e("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:e("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:e("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)"}})})}),c("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[e(xt,{icon:e(Wd,{}),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?e(xt,{icon:e(ip,{}),label:`${I.format||"barcode"}: ${I.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),A?e(jr,{severity:C==="unsupported"?"info":"warning",children:A}):null,s?c(ie,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[e(ze,{fullWidth:true,label:"Barcode",placeholder:f,value:w,onChange:O=>T(O.target.value)}),e(we,{variant:"contained",onClick:E,sx:{minHeight:56,px:2.5},children:u})]}):null]})}),e("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:e(we,{onClick:r,children:p})})]})};P();var iy={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)"},BO=({title:t,description:r,kicker:o,icon:n,badges:a=[],metrics:i=[],footer:s,children:l,selected:d=false,draggable:u=false,isDragging:p=false,swipeThreshold:f=88,startAction:b,endAction:m,dragHandleProps:v,onClick:y,onSwipe:g,sx:x})=>{let[h,C]=er.useState(0),[k,w]=er.useState(false),T=er.useRef(null),I=er.useRef(0),S=er.useRef(0),A=!!(b||m),D=132,M=()=>{C(0),w(false),T.current=null,I.current=0,S.current=0;},N=H=>{(H==="start"?b:m)?.onTrigger?.(),g?.(H),M();},E=H=>{!A||H.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(T.current=H.pointerId,I.current=H.clientX,S.current=H.clientX,w(true),H.currentTarget.setPointerCapture(H.pointerId));},O=H=>{if(!k||T.current!==H.pointerId)return;S.current=H.clientX;let Y=S.current-I.current,W=Math.max(-D,Math.min(D,Y));C(W);},F=H=>{if(!k||T.current!==H.pointerId)return;let Y=S.current-I.current;if(Y>=f&&b){N("start");return}if(Y<=-f&&m){N("end");return}Math.abs(Y)<12&&y?.(),M();},X=(H,Y)=>{if(!H)return null;let W=H.backgroundColor||iy[H.tone||"default"];return e("div",{sx:{position:"absolute",top:0,bottom:0,[Y]:0,width:D,px:2,display:"flex",alignItems:"center",justifyContent:Y==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${W}, rgba(15,23,42,0.92))`},children:c(ie,{direction:"row",spacing:1,alignItems:"center",children:[H.icon,e(L,{sx:{fontWeight:700,fontSize:"0.95rem"},children:H.label})]})})};return c("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[X(b,"left"),X(m,"right"),e(Ae,{elevation:0,onPointerDown:E,onPointerMove:O,onPointerUp:F,onPointerCancel:M,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:vt()==="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(${h}px, 0, 0) scale(${p?.985:1})`,transition:k?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:y?"pointer":"default",opacity:p?.9:1},children:c(ie,{spacing:1.5,children:[c(ie,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[n?e("div",{sx:{mt:.25},children:n}):null,c("div",{sx:{flex:1,minWidth:0},children:[o?e(L,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,e(L,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),r?e(L,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:r}):null]}),u?e("div",{"data-no-swipe":"true",...v,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:e(ae,{size:"small",children:e(Yd,{})})}):null]}),a.length>0?e(ie,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((H,Y)=>e(xt,{label:H,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},Y))}):null,i.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(H=>c(Ae,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:H.label}),e(L,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:H.value})]},H.id))}):null,l,s]})})]})};P();var ga=({label:t,onPress:r,emphasis:o="default"})=>e("div",{component:"button",type:"button",onClick:r,sx:n=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?n.palette.primary.main:o==="danger"?vt()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":vt()==="dark"?"rgba(255,255,255,0.04)":"var(--orb-canvas)",color:o==="primary"?"var(--orb-on-primary)":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:t}),UO=({value:t,defaultValue:r="",title:o,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:l,confirmLabel:d,clearLabel:u,backspaceLabel:p,onChange:f,onSubmit:b,onClose:m,sx:v})=>{let{t:y}=pe(),[g,x]=er.useState(r),h=t??g,C=M=>{t===void 0&&x(M),f?.(M);},k=M=>{l&&h.length>=l||C(`${h}${M}`);},w=M=>{if(M==="00"){if(!h){C("0");return}k("00");return}k(M);},T=()=>{!i||h.includes(".")||C(h?`${h}.`:"0.");},I=()=>{if(s){if(h.startsWith("-")){C(h.slice(1));return}C(h?`-${h}`:"-");}},S=()=>{C(h.slice(0,-1));},A=()=>{C("");},D=()=>{b?.(h);};return e(Ae,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...v},children:c(ie,{spacing:2,children:[c(ie,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[c("div",{sx:{minWidth:0},children:[o?e(L,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,n?e(L,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),m?e(ae,{onClick:m,size:"small",children:e(qd,{})}):null]}),e(Ae,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:e(L,{sx:{minHeight:38,fontSize:h?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:h?"text.primary":"text.disabled"},children:h||a})}),c("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(M=>e(ga,{label:M,onPress:()=>w(M)},M)),e(ga,{label:s?"+/-":"00",onPress:s?I:()=>w("00")}),e(ga,{label:"0",onPress:()=>w("0")}),e(ga,{label:i?".":p?String(p):"DEL",onPress:i?T:S})]}),c("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[e("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:c(ie,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e(Vd,{}),e(L,{sx:{fontWeight:700},children:p||"DEL"})]})}),e(ga,{label:String(u||"CLR"),onPress:A,emphasis:"danger"}),e("div",{component:"button",type:"button",onClick:D,sx:M=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:M.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:c(ie,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e(_d,{}),e(L,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};P();var nm=({touchMode:t="comfortable",sx:r,...o})=>{let n=t==="expanded";return e("div",{sx:{"& .orb-card":{borderRadius:4},"& .orb-autocomplete":{minWidth:{xs:"100%",md:260}},"& .orb-autocomplete .orb-inp-adornment-wrap, & .orb-inp":{backgroundColor:"transparent !important"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:n?56:50,borderRadius:3,fontSize:n?"0.98rem":"0.92rem"},"& .orb-inp":{py:n?1.6:1.25,fontSize:n?"0.98rem":"0.92rem"},"& label":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-btn":{minHeight:n?48:44,px:n?2.25:1.75,borderRadius:3,fontSize:n?"0.95rem":"0.88rem",fontWeight:700},"& .orb-icon-btn":{width:n?40:36,height:n?40:36},"& .orb-menu-item, & option":{minHeight:n?44:38,fontSize:n?"0.95rem":"0.88rem"},"& .orb-list-subheader":{py:1},"& .orb-chk":{p:n?1:.75},"& .orb-form-control-label > span":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-dialog":{borderRadius:4},"& .orb-dialog-title":{fontSize:n?"1.05rem":"0.98rem",fontWeight:800},"& .orb-dialog-content .orb-inp-adornment-wrap, & .orb-inp":{minHeight:52},"& .orb-grid > *":{minWidth:0},...r},children:e(Wr,{...o})})};P();var py=(t,r,o)=>{if(o?.(r),!!r.href){if(r.href.startsWith("http://")||r.href.startsWith("https://")){window.open(r.href,"_blank");return}t.push(r.href);}},am=({items:t,selectedId:r,orientation:o="auto",onItemSelect:n,sx:a})=>{let i=sr(),[s,l]=er.useState(false);er.useEffect(()=>{l(true);},[]);let d=xo("(orientation: portrait)"),u=xo(i.breakpoints.down("md")),p=o==="auto"?d||u?"portrait":"landscape":o,f=navigation.useRouter();return e("div",{sx:{display:"grid",gridTemplateColumns:!s||p==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:t.map(b=>{let m=b.id===r,v=b.color||(m?i.palette.primary.main:i.palette.divider);return e(Ae,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:m?"primary.main":"divider",boxShadow:m?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:vt()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:e("div",{component:"button",type:"button",disabled:b.disabled,onClick:()=>py(f,b,n),sx:{width:"100%",p:2,minHeight:p==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:b.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:c(ie,{spacing:1.5,sx:{height:"100%"},children:[c(ie,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[e("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:m?"var(--orb-on-primary)":"text.primary",background:m?v:"action.hover"},children:b.icon||e(L,{sx:{fontSize:"1rem",fontWeight:900},children:b.title.slice(0,1).toUpperCase()})}),b.badge!==void 0?e("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:m?"primary.main":"action.hover",color:m?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:b.badge}):null]}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:b.title}),b.caption?e(L,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:b.caption}):null,b.description?e(L,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:b.description}):null]})]})})},b.id)})})};P();var lm=(t,r)=>r.trim()?t.reduce((o,n)=>{let a=n.title?.toLowerCase().includes(r.toLowerCase())||n.label?.toLowerCase().includes(r.toLowerCase())||n.description?.toLowerCase().includes(r.toLowerCase()),i=n.children?lm(n.children,r):[];return (a||i.length>0)&&o.push({...n,children:i.length>0?i:n.children}),o},[]):t,fy=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children?.length&&(r.add(a.id),o(a.children));});};return o(t),r},cm=({collapsed:t=false,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:l,footerSlot:d,activeHref:u,onItemSelect:p})=>{let{t:f}=pe(),b=sr(),m=Dr("(orientation: portrait)"),v=Dr(b.breakpoints.down("md")),y=s==="auto"?m||v?"portrait":"landscape":s,g=i==="dark",x=navigation.useRouter(),h=navigation.usePathname(),[C,k]=er.useState(""),[w,T]=er.useState(new Set),I=er.useMemo(()=>lm(a,C),[a,C]),S=er.useMemo(()=>C.trim()?fy(I):w,[w,I,C]);er.useEffect(()=>{t&&T(new Set);},[t]);let A=O=>O.appurl||O.href||"",D=O=>{p?.(O);let F=A(O);if(F){if(F.startsWith("http://")||F.startsWith("https://")){window.open(F,"_blank");return}x.push(F);}},M=O=>{let F=!!O.children?.length;if(t&&F){r?.();return}if(F){T(X=>{let H=new Set(X);return H.has(O.id)?H.delete(O.id):H.add(O.id),H});return}D(O);},N=O=>{let F=u||h,X=A(O);return !!(X&&F===X)},E=(O,F=0)=>{let X=!!O.children?.length,H=S.has(O.id),Y=N(O);return e("div",{sx:{pl:F===0?0:1.5},children:c(Ae,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:Y?"primary.main":"divider",bgcolor:Y?"action.selected":"background.paper"},children:[c("div",{component:"button",type:"button",onClick:()=>M(O),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:[e(Qa,{variant:"rounded",sx:{width:40,height:40,bgcolor:Y?"primary.main":"action.hover",color:Y?"var(--orb-on-primary)":"text.primary"},children:O.icon||(O.title||O.label||"?").slice(0,1).toUpperCase()}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:O.title||O.label}),O.description?e(L,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:O.description}):null]}),X?e(an,{sx:{transform:H?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):e(ri,{color:"action"})]}),X?e(nn,{in:H,children:e("div",{sx:{px:1.25,pb:1.25},children:O.children?.map(W=>E(W,F+1))})}):null]})},O.id)};return t?e(Ae,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflowY:"auto"},children:c(ie,{spacing:1,children:[e(ae,{onClick:r,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:f("navigation.expand"),children:e(li,{})}),a.map(O=>e(ae,{onClick:()=>M(O),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:N(O)?"primary.main":"action.hover",color:N(O)?"var(--orb-on-primary)":"text.primary"},children:O.icon||(O.title||O.label||"?").slice(0,1).toUpperCase()},O.id))]})}):e(Ae,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g?"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:c(ie,{spacing:1.25,sx:{flex:1,minHeight:0},children:[c(ie,{direction:"row",spacing:1,alignItems:"center",children:[e(ze,{value:C,onChange:O=>k(O.target.value),placeholder:f("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:e(sp,{fontSize:"small",color:"action"})}}),y==="landscape"&&!t?e(ae,{onClick:r,sx:{bgcolor:"action.hover"},children:e(rp,{})}):null]}),l,e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:I.length>0?I.map(O=>E(O)):e(L,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:f("navigation.noMatch")})}),d]})})};P();var dm=(t,r)=>{let o=r[t.id];if(t.render)return t.render(o,r);if(o==null||o==="")return "--";if(t.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},by=t=>er__namespace.default.isValidElement(t)?e("div",{sx:{display:"inline-flex",alignItems:"center"},children:t}):e(L,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:t}),hy=(t,r)=>{let o=r[t.id];if(o==null||o==="")return "--";if(t.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},vy=({summaryRow:t,visibleColumns:r,columns:o})=>{let n=o.filter(a=>r.includes(a.id)&&t[a.id]!=="");return n.length===0?null:e(Ae,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:c(ie,{spacing:1,children:[e(L,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:n.map(a=>c(Ae,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),e(L,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:t[a.id]})]},`summary-${a.id}`))})]})})},yy=t=>{let{t:r}=pe(),o=sr(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:u,fitContainer:p=false,fullWidth:f=false,maxHeight:b,loading:m=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g,rowKey:x,tableKey:h="default",graphReport:C,quickCreate:k,quickEdit:w,quickDelete:T,serviceUrl:I,orientation:S="auto",cardTitleField:A,cardSubtitleFields:D,toolbarSlot:M,emptyState:N,rowHeight:E="comfortable",cardActionSlot:O,renderCardFooter:F,onRowClick:X}=t,H=n||r("table.title.default"),Y=Dr("(orientation: portrait)"),W=Dr(o.breakpoints.down("md")),j=S==="auto"?Y||W?"portrait":"landscape":S,{columns:V,filterText:z,setFilterText:U,visibleColumns:K,showSummary:fe,setShowSummary:se,summaryColumns:ue,grouping:Se,setGrouping:$e,expandedGroups:ke,groupAnchorEl:le,setGroupAnchorEl:Ee,summaryAnchorEl:Me,setSummaryAnchorEl:Pe,anchorEl:Ve,setAnchorEl:tt,contextMenu:nt,sortedAndFilteredRows:it,summaryRow:q,visibleRows:De,page:ye,setPage:Be,rowsPerPage:at,setRowsPerPage:Ze,totalDisplayCount:St,setSelected:Mt,handleClick:Ot,toggleSummaryColumn:At,handleExport:re,handleCloseContextMenu:Ke,toggleColumnVisibility:Fe,toggleGroupExpand:ce,handleExpandGroupRecursively:ve,handleCollapseGroupRecursively:te,handleLayoutLoad:he,handleVariantLoad:Ne,handleLayoutSave:Je,effectiveAppId:st,currentLayoutData:pt,currentLayoutId:Bt,layoutIdToLoad:Xt,graphReportOpen:Vt,handleOpenGraphReport:wt,handleCloseGraphReport:Wt}=hn(t),ht=C?.enabled??false,Nt=ht&&(C?.interaction?.enabled??true),lt=Ii(),Ft=x||"id",Yt=er__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:rt(o.palette.divider,vt()==="dark"?.55:.3),bgcolor:vt()==="dark"?rt(o.palette.common.white,.06):rt(o.palette.background.paper,.92),color:o.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[o]),Z=er__namespace.default.useMemo(()=>({...Yt,borderColor:rt(o.palette.primary.main,vt()==="dark"?.42:.24),bgcolor:vt()==="dark"?rt(o.palette.primary.main,.16):rt(o.palette.primary.main,.08)}),[Yt,o]),$=er__namespace.default.useMemo(()=>{let ee=new Set(s);return it.filter(Oe=>ee.has(Oe?.[Ft]))},[Ft,s,it]),Q=$.length===1?$[0]:null,be=!!k?.enabled,Ce=!!w?.enabled,Le=!!T?.enabled,_e=k?.fields,qe=k?.excludeFields||[],je=k?.initialValues||{},mt=w?.fields,ft=w?.excludeFields||[],Rt=w?.editableFields||[],yt=w?.nonEditableFields||[],B=w?.primaryKeys?.length?w.primaryKeys:[Ft],[J,ge]=er__namespace.default.useState(false),[Te,et]=er__namespace.default.useState(false),[Xe,kt]=er__namespace.default.useState({}),[bt,gt]=er__namespace.default.useState(false),[Ct,nr]=er__namespace.default.useState(false),[Et,Zt]=er__namespace.default.useState({}),[Ht,Kt]=er__namespace.default.useState(false),[$t,rr]=er__namespace.default.useState(false),ar=m||Te||Ct||$t,fr=er__namespace.default.useMemo(()=>{let ee=[...V];if(Array.isArray(_e)&&_e.length>0){let Oe=new Set(_e);ee=ee.filter(Qe=>Oe.has(Qe.id));}if(qe.length>0){let Oe=new Set(qe);ee=ee.filter(Qe=>!Oe.has(Qe.id));}return ee.filter(Oe=>!!Oe?.id)},[V,qe,_e]),Ir=er__namespace.default.useMemo(()=>{let ee=[...V];if(Array.isArray(mt)&&mt.length>0){let Oe=new Set(mt);ee=ee.filter(Qe=>Oe.has(Qe.id));}if(ft.length>0){let Oe=new Set(ft);ee=ee.filter(Qe=>!Oe.has(Qe.id));}return ee.filter(Oe=>!!Oe?.id)},[V,ft,mt]),Mr=er__namespace.default.useMemo(()=>new Set(B),[B]),oo=er__namespace.default.useMemo(()=>new Set(Rt),[Rt]),yr=er__namespace.default.useMemo(()=>new Set(yt),[yt]),Or=er__namespace.default.useCallback(ee=>oo.size>0?oo.has(ee):!(yr.has(ee)||Mr.has(ee)),[oo,yr,Mr]);er__namespace.default.useEffect(()=>{!Vt&&lt.hasActiveFilters&&lt.clearAll();},[lt,Vt]);let qo=()=>{let ee={};fr.forEach(Oe=>{ee[Oe.id]=je[Oe.id]??"";}),kt(ee),ge(true);},Xo=(ee,Oe)=>{kt(Qe=>({...Qe,[ee]:Oe}));},Lo=async()=>{if(!k?.onSubmit){ge(false);return}try{et(!0),await k.onSubmit(Xe),ge(!1);}finally{et(false);}},Yo=()=>{if(!Q)return;let ee={};Ir.forEach(Qe=>{ee[Qe.id]=Q[Qe.id]??"";});let Oe=w?.getInitialValues?{...ee,...w.getInitialValues(Q)}:ee;Zt(Oe),gt(true);},Zo=(ee,Oe)=>{Zt(Qe=>({...Qe,[ee]:Oe}));},Rr=async()=>{if(Q){if(!w?.onSubmit){gt(false);return}try{nr(!0),await w.onSubmit(Et,Q),gt(!1);}finally{nr(false);}}},Oo=()=>{$.length!==0&&Kt(true);},jo=async()=>{if($.length===0){Kt(false);return}if(!T?.onConfirm){Kt(false),Mt([]),l?.([]);return}try{rr(!0),await T.onConfirm($),Kt(!1),Mt([]),l?.([]);}finally{rr(false);}},Kr=it,{fieldMapping:no}=mn({rows:Kr,config:{...C,title:C?.title||`${H} ${r("graph.reportTitle")}`}}),Ln=er__namespace.default.useMemo(()=>Nt?lt.applyRows(Kr,no):Kr,[no,lt,Nt,Kr]),{model:Fo}=mn({rows:Ln,config:{...C,title:C?.title||`${H} ${r("graph.reportTitle")}`,fieldMapping:no}}),R=Fo.table.columns.map(ee=>({id:ee.id,label:ee.label,align:ee.align||"left",minWidth:120,numeric:ee.align==="right"})),_=st?e(bn,{appId:st,tableKey:h,currentLayoutData:pt,onLayoutLoad:he,targetLayoutId:Xt,activeLayoutId:Bt,serviceUrl:I??g?.serviceUrl}):null,G=V.filter(ee=>K.includes(ee.id)),de=G.find(ee=>ee.id===A)||G[0],He=D?.map(ee=>G.find(Oe=>Oe.id===ee)).filter(Boolean)||G.filter(ee=>ee.id!==de?.id).slice(0,j==="portrait"?2:3),ot=G.filter(ee=>ee.id!==de?.id&&!He.some(Oe=>Oe.id===ee.id)),Ge=[M,u].filter(Boolean),oe=c(jsxRuntime.Fragment,{children:[e(pn,{groupAnchorEl:le,setGroupAnchorEl:Ee,grouping:Se,setGrouping:$e,columns:V}),e(un,{anchorEl:Ve,setAnchorEl:tt,columns:V,visibleColumns:K,toggleColumnVisibility:Fe}),e(yi,{anchorEl:Me,setAnchorEl:Pe,showSummary:fe,setShowSummary:se,columns:V,summaryColumns:ue,toggleSummaryColumn:At}),e(Ci,{contextMenu:nt,handleCloseContextMenu:Ke,columns:V,visibleColumns:K,toggleColumnVisibility:Fe})]}),me=(ee,Oe,Qe)=>{let Re=s.includes(Oe),Ye=j==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",Pt=Qe%2===0?rt(o.palette.primary.main,vt()==="dark"?.09:.04):rt(o.palette.primary.main,vt()==="dark"?.05:.022),Qo=rt(o.palette.divider,.22);return e(Ae,{elevation:0,onClick:()=>{Ot({},ee),X?.(ee);},sx:{p:E==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Re?rt(o.palette.primary.main,.38):Qo,background:Re?`linear-gradient(135deg, ${rt(o.palette.primary.main,.13)}, ${rt(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${Pt}, ${rt(o.palette.primary.main,.015)})`,boxShadow:Re?`0 12px 30px ${rt(o.palette.primary.main,.2)}`:`0 3px 10px ${rt(o.palette.common.black,.045)}`,cursor:"pointer",position:"relative",overflow:"hidden",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background 160ms ease","&::before":{content:'""',position:"absolute",left:0,top:0,bottom:0,width:4,background:Re?o.palette.primary.main:Qe%2===0?rt(o.palette.primary.main,.26):rt(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${rt(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:c(ie,{spacing:1.25,children:[c(ie,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?e(It,{checked:Re,onClick:Sr=>Sr.stopPropagation(),onChange:()=>Ot({},ee),sx:{mt:-0.6,ml:-0.6}}):null,c("div",{sx:{flex:1,minWidth:0},children:[de?e(L,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:dm(de,ee)}):null,He.length>0?e(ie,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:He.map(Sr=>e(xt,{label:`${Sr.label}: ${hy(Sr,ee)}`,size:"small",variant:"outlined",sx:Yt},`${Oe}-${Sr.id}`))}):null]}),O?e("div",{onClick:Sr=>Sr.stopPropagation(),children:O(ee)}):null]}),ot.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:Ye,gap:1},children:ot.map(Sr=>c(Ae,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:vt()==="dark"?rt(o.palette.background.default,.7):rt(o.palette.background.paper,.92),border:"0.1px solid",borderColor:rt(o.palette.divider,.24)},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:Sr.label}),by(dm(Sr,ee))]},`${Oe}-${Sr.id}-detail`))}):null,F?c(jsxRuntime.Fragment,{children:[e(Dt,{}),e("div",{onClick:Sr=>Sr.stopPropagation(),children:F(ee)})]}):null]})},Oe)};return c("div",{sx:{width:f?"100%":"auto",mb:p?0:2,...p?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g?e("div",{sx:{mb:2},children:e(nm,{...g,onVariantLoad:ee=>{Ne(ee),g.onVariantLoad?.(ee);},appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:pt}],currentLayoutId:Bt,layoutRefs:[{tableKey:h,layoutId:Bt}],variantService:g.variantService,serviceUrl:I??g.serviceUrl,touchMode:j==="portrait"?"expanded":"comfortable"})}):null,c(Ae,{sx:{width:f?"100%":"auto",mb:p?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":ar?{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"}},...b?{height:b}:p?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?e("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:e(fi,{filterText:z,setFilterText:U,onRowsPerPageChange:Ze,rowsPerPage:at,rowsPerPageOptions:v,page:ye,count:St,onPageChange:Be,actions:d,extraTools:Ge,grouping:Se,setGroupAnchorEl:Ee,showSummary:fe,setShowSummary:se,setAnchorEl:tt,setSummaryAnchorEl:Pe,handleExport:re,showCreateButton:be,onOpenCreateDialog:qo,showEditButton:Ce,onOpenEditDialog:Yo,editDisabled:$.length!==1,showDeleteButton:Le,onOpenDeleteConfirm:Oo,deleteDisabled:$.length===0,onLayoutSave:y||g?.variantService&&g?.appId?Je:void 0,loading:m,layoutManager:_,onOpenGraphReport:ht?wt:void 0})}):null,e("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:c(ie,{spacing:1.25,children:[De.length===0&&!m?N||e(Ae,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:e(L,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:r("common.noData")})}):null,De.map((ee,Oe)=>{if(ee.type==="group"){let Ye=ke.has(ee.id);return e(Ae,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:c("div",{component:"button",type:"button",onClick:()=>ce(ee.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[Ye?e(an,{}):e(ri,{}),c("div",{sx:{flex:1,minWidth:0},children:[c(L,{sx:{fontSize:"0.94rem",fontWeight:800},children:[ee.field,": ",ee.value]}),c(L,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[ee.count," records"]})]}),Se.length>1&&ee.level<Se.length-1?c(ie,{direction:"row",spacing:.5,children:[e(xt,{size:"small",label:r("table.group.expandAll"),onClick:Pt=>{Pt.stopPropagation(),ve(ee.id);},sx:Z}),e(xt,{size:"small",label:r("table.group.collapseAll"),onClick:Pt=>{Pt.stopPropagation(),te(ee.id);},sx:Z})]}):null]})},ee.id)}let Qe=ee.data||ee,Re=ee.id||Qe[Ft]||Oe;return me(Qe,Re,Oe)}),fe?e(vy,{summaryRow:q,visibleColumns:K,columns:V}):null,m?e(L,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:r("common.loading")}):null]})})]}),be?c(Lt,{open:J,onClose:()=>!Te&&ge(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:k?.title||r("quickCreate.createWithTitle",{title:H})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[fr.map(ee=>{let Oe=ee.type==="number"||ee.numeric?"number":ee.type==="date"?"date":"text";return e(ze,{label:ee.label||ee.id,value:Xe[ee.id]??"",onChange:Qe=>Xo(ee.id,Qe.target.value),type:Oe,fullWidth:true,InputLabelProps:{shrink:Oe==="date"?true:void 0}},`quick-create-${ee.id}`)}),k?.description?e(jr,{severity:"info",children:k.description}):null]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(we,{onClick:()=>ge(false),disabled:Te,children:k?.cancelLabel||r("common.cancel")}),e(we,{onClick:Lo,variant:"contained",disabled:Te,children:k?.submitLabel||r("common.save")})]})]}):null,Ce?c(Lt,{open:bt,onClose:()=>!Ct&&gt(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:w?.title||r("quickEdit.editWithTitle",{title:H})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ir.map(ee=>{let Oe=ee.type==="number"||ee.numeric?"number":ee.type==="date"?"date":"text";return e(ze,{label:ee.label||ee.id,value:Et[ee.id]??"",onChange:Qe=>Zo(ee.id,Qe.target.value),type:Oe,disabled:!Or(ee.id),fullWidth:true,InputLabelProps:{shrink:Oe==="date"?true:void 0}},`quick-edit-${ee.id}`)}),w?.description?e(jr,{severity:"info",children:w.description}):null]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(we,{onClick:()=>gt(false),disabled:Ct,children:w?.cancelLabel||r("common.cancel")}),e(we,{onClick:Rr,variant:"contained",disabled:Ct||!Q,children:w?.submitLabel||r("common.save")})]})]}):null,Le?e(jn,{open:Ht,type:"warning",title:T?.title||r("quickDelete.confirmTitle"),message:T?.message||($.length>1?r("quickDelete.confirmMessageMultiple",{count:$.length}):r("quickDelete.confirmMessageSingle")),confirmText:T?.confirmText||r("common.delete"),cancelText:T?.cancelText||r("common.cancel"),onClose:()=>!$t&&Kt(false),onConfirm:jo}):null,oe,ht?e(Pi,{open:Vt,onClose:Wt,model:Fo,aiAssistant:C?.aiAssistant,interaction:Nt?{enabled:true,filters:lt.filters,fieldMapping:no,onPrimaryDimensionClick:ee=>lt.setFilter("primaryDimension",ee),onSecondaryDimensionClick:ee=>lt.setFilter("secondaryDimension",ee),onStatusClick:ee=>lt.setFilter("status",ee),onClearFilter:lt.clearFilter,onClearAll:lt.clearAll}:void 0,tableContent:e(yy,{appId:st||"graph-report-internal",title:r("graph.dataBody"),columns:R,rows:Fo.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};P();var zF=({appTitle:t,children:r,menuData:o=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:l="auto",logo:d,headerSlot:u,actionSlot:p,portraitBottomSlot:f,contentSx:b,containerSx:m,user:v,onSearch:y,onSearchAdd:g,defaultNavigationOpen:x,navOpen:h,onNavOpenChange:C,onWorkloadSelect:k,locale:w="en",localeLabel:T,localeOptions:I,onLocaleChange:S,onUserSetting:A,onUserLogout:D,userMenuItems:M,leftHeaderSlot:N,rightHeaderSlot:E})=>{let O="orbcafe:page-layout-mode",[F,X]=er.useState("system"),[H,Y]=er.useState("light"),[W,j]=er.useState(false),[V,z]=er.useState(false),U=F==="system"?V?H:"light":F;er.useEffect(()=>{j(true);},[]),er.useEffect(()=>{try{let nt=window.localStorage.getItem(O);(nt==="light"||nt==="dark"||nt==="system")&&X(nt);}catch{}z(true);let Ve=window.matchMedia("(prefers-color-scheme: dark)"),tt=()=>{Y(Ve.matches?"dark":"light");};return tt(),Ve.addEventListener("change",tt),()=>Ve.removeEventListener("change",tt)},[]),er.useEffect(()=>{if(V)try{window.localStorage.setItem(O,F);}catch{}},[V,F]),er.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=Dr("(orientation: portrait)"),fe=Dr("(max-width: 899.95px)"),se=l==="auto"?!W||K||fe?"portrait":"landscape":l,[ue,Se]=er.useState({landscape:x??true,portrait:false}),$e=ue[se],ke=h??$e,le=Ve=>{h===void 0&&Se(tt=>({...tt,[se]:Ve})),C?.(Ve);},Ee=c(ie,{direction:"row",spacing:1,alignItems:"center",children:[!W||i&&se==="portrait"?e(ae,{onClick:()=>le(!ke),sx:{bgcolor:"action.hover"},children:e(li,{})}):null,N]}),Me=c(ie,{direction:"row",spacing:1,alignItems:"center",children:[p,E]}),Pe=e(cm,{collapsed:se==="landscape"?!ke:false,onToggle:()=>le(!ke),menuData:o,orientation:se,colorMode:U,maxHeight:se==="landscape"?900:void 0});return e(Fn,{mode:F,children:e(Ga,{locale:w,children:c("div",{sx:[Ve=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:Ve.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":Ve.palette.background.default}),...Array.isArray(m)?m:[m]],children:[e($i,{appTitle:t,logo:d===void 0?null:d,mode:F,onToggleMode:()=>X(Ve=>Ve==="system"?"dark":Ve==="dark"?"light":"system"),locale:w,localeLabel:T,localeOptions:I,onLocaleChange:S,user:v,onUserSetting:A,onUserLogout:D,userMenuItems:M,onSearch:y,onSearchAdd:g,leftSlot:Ee,rightSlot:Me}),u?e("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:u}):null,c("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[W&&i&&se==="landscape"?e("div",{sx:{p:1.5,pr:0,flexShrink:0},children:Pe}):null,!W||i&&se==="portrait"?e(Nd,{open:ke,onClose:()=>le(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Pe}):null,e("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...b},children:c(ie,{spacing:1.5,children:[s&&n.length>0?e(am,{items:n,selectedId:a,orientation:se,onItemSelect:k}):null,e(Ae,{elevation:0,sx:{flex:1,minHeight:se==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:"color-mix(in oklch, var(--orb-canvas) 72%, transparent)",backdropFilter:"blur(12px)",color:"text.primary"},children:r})]})})]}),se==="portrait"&&f?c(jsxRuntime.Fragment,{children:[e(Dt,{}),e("div",{sx:{p:1.5},children:f})]}):null]})})})};P();var gm=My__default.default(()=>Promise.resolve().then(()=>(mm(),um)).then(t=>t.COrbCanvas),{ssr:false,loading:()=>e("div",{className:"h-full w-full bg-transparent"})});function El({isRecording:t}){return e(framerMotion.AnimatePresence,{children:t&&e(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"pointer-events-none absolute inset-0 z-0 overflow-hidden",children:c("div",{className:"relative flex h-full w-full items-center justify-center",children:[e("div",{className:"absolute inset-0",children:e(gm,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),e("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:e(gm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var qF=El;P();var bm=er.createContext(null);function Oy(t){if(!t||!(t instanceof HTMLElement))return false;let r=t.tagName;return !!(r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||t.isContentEditable||t.closest('[data-voice-hotkey-ignore="true"]'))}function Fy({children:t,onVoiceSubmit:r,onVoicePartial:o,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:l=true,wsUrl:d,silenceThresholdMs:u,minVolumeRms:p}){let[f,b]=er.useState(false),[m,v]=er.useState(false),y=er.useRef(null),g=er.useRef(false),x=er.useRef(false),h=er.useCallback(()=>{x.current=false,b(false);},[]),{isRecording:C,startRecording:k,stopRecording:w}=Sn({wsUrl:d,silenceThresholdMs:u,minVolumeRms:p,onTextUpdate:A=>{o?.(A);},onComplete:async A=>{try{A.trim()&&(v(!0),await r(A.trim()));}catch(D){let M=D instanceof Error?D.message:"Failed to process voice command";n?.(M);}finally{v(!1),h();}},onError:A=>{n?.(A),v(!1),g.current||h();}}),T=er.useCallback(async()=>{x.current=false,await k();},[k]),I=er.useCallback(()=>{w();},[w]);er.useEffect(()=>{if(i)return;let A=M=>{M.isComposing||(M.code==="Space"||M.key===" ")&&(g.current||M.repeat||s&&Oy(document.activeElement)||(g.current=true,M.preventDefault(),y.current=setTimeout(()=>{x.current=true,b(true),k();},a)));},D=M=>{(M.code==="Space"||M.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),g.current=false,x.current&&(M.preventDefault(),b(false),w()));};return window.addEventListener("keydown",A),window.addEventListener("keyup",D),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",D),y.current&&(clearTimeout(y.current),y.current=null);}},[i,s,a,k,w]);let S=er.useMemo(()=>({isRecording:C,isHotkeyRecording:f,isSubmitting:m,startRecording:T,stopRecording:I}),[f,C,m,T,I]);return c(bm.Provider,{value:S,children:[l?e(El,{isRecording:f}):null,t]})}function By(){let t=er.useContext(bm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var JF=Fy,e2=By;function ut(...t){return tailwindMerge.twMerge(clsx.clsx(t))}P();var $y=({content:t,theme:r="light",size:o="base",defaultExpanded:n=false})=>{let[a,i]=er.useState(n),s=er.useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return c("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${r==="dark"?"bg-[var(--orb-surface-2)]":"bg-[var(--orb-canvas)]"}`,style:{border:"0.5px solid var(--orb-border)"},children:[c("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:[c("span",{className:"flex items-center",children:[e(Aa,{className:"mr-2 h-4 w-4"}),e("span",{className:"font-medium text-[var(--orb-fg)]",style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),e(Fr,{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} text-[var(--orb-muted)]`})]}),a&&e("div",{className:"p-4 whitespace-pre-wrap italic font-light text-[var(--orb-muted)]",style:{fontSize:s,lineHeight:"1.3 !important"},children:t})]})},hm=$y;P();var qy=({content:t,language:r="text",isStreaming:o=false,className:n=""})=>{let a=Cr(),[i,s]=er.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"?prism.oneDark:prism.oneLight;return c("div",{className:ut("rounded-lg overflow-hidden border border-[var(--orb-border)] my-4",n),children:[c("div",{className:"flex items-center justify-between px-4 py-2 bg-[var(--orb-surface)] border-b border-[var(--orb-border)]",children:[e("span",{className:"text-xs font-medium text-[var(--orb-muted)] uppercase",children:r}),e("button",{onClick:l,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:o,title:i?"Copied":"Copy code",children:i?e(qr,{size:14,className:"text-[var(--orb-status-success)]"}):e(Rc,{size:14,className:"text-[var(--orb-muted)]"})})]}),e("div",{className:"text-sm",children:e(reactSyntaxHighlighter.Prism,{language:r,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"var(--orb-surface-2)":"var(--orb-canvas)"},wrapLongLines:true,children:t})})]})},vm=qy;P();var ym="orb-html-demo",Qy=160,Jy=560,eC=220,Fl=`<script>(function(){var post=function(){var height=Math.ceil(document.documentElement.scrollHeight);parent.postMessage({source:${JSON.stringify(ym)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);new MutationObserver(post).observe(document.documentElement,{subtree:true,childList:true,attributes:true,characterData:true});post()})()</script>`,tC="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",rC=t=>/<html[\s>]/i.test(t),oC=t=>{let r=t.trim();return rC(r)?/<\/body>/i.test(r)?r.replace(/<\/body>/i,`${Fl}</body>`):`${r}${Fl}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${tC}</style></head><body>${r}${Fl}</body></html>`},nC=({content:t,title:r="Interactive HTML"})=>{let o=er.useRef(null),[n,a]=er.useState(eC),i=er.useMemo(()=>oC(t),[t]);return er.useEffect(()=>{let s=l=>{if(l.source!==o.current?.contentWindow)return;let d=l.data;!d||d.source!==ym||typeof d.height!="number"||!Number.isFinite(d.height)||a(Math.min(Jy,Math.max(Qy,Math.ceil(d.height))));};return window.addEventListener("message",s),()=>window.removeEventListener("message",s)},[]),c("figure",{className:"orb-html-demo-frame",children:[e("figcaption",{className:"orb-html-demo-caption",children:r}),e("iframe",{ref:o,className:"orb-html-demo",title:r,sandbox:"allow-scripts",srcDoc:i,style:{height:n}})]})},Cm=nC;P();var sC=t=>{let r=/line (\d+)/i.exec(t)?.[1];return r?`Mermaid syntax error around line ${r} \u2014 expand for details`:"Mermaid syntax error \u2014 expand for details"},lC=({content:t,isLoading:r,className:o="",style:n})=>{let a=er.useRef(null),[i,s]=er.useState(false),[l,d]=er.useState(null),u=Cr();return er.useEffect(()=>{let p=false,f=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{Sm__default.default.initialize({startOnLoad:!1,theme:u==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit",flowchart:{htmlLabels:!1}});let m=`mermaid-${Math.random().toString(36).substr(2,9)}`,v=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:y,bindFunctions:g}=await Sm__default.default.render(m,v);!p&&a.current&&(a.current.innerHTML=y,g?.(a.current));}catch(m){if(p)return;console.error("Mermaid render failed:",m),d(m instanceof Error?m.message:"Render failed");}finally{p||s(false);}}},b=setTimeout(()=>{f();},100);return ()=>{p=true,clearTimeout(b);}},[t,u]),c("div",{className:`mermaid-block ${o}`,style:n,children:[(r||i)&&c("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:[e("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-b-2 border-[var(--orb-primary)]"}),e("span",{className:"text-sm text-[var(--orb-muted)]",children:"Generating Diagram..."})]}),l&&c("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:[e("p",{className:"font-medium",children:sC(l)}),c("details",{className:"mt-1",children:[e("summary",{className:"cursor-pointer text-xs text-[var(--orb-muted)]",children:"Details & source"}),e("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words",children:l}),e("pre",{className:"mt-2 max-h-40 overflow-auto text-xs text-[var(--orb-muted)]",children:t})]})]}),e("div",{ref:a,className:`overflow-x-auto ${r||i||l?"hidden":""}`})]})},wm=lC;P();var cC=({title:t="\u53D1\u751F\u9519\u8BEF",content:r,errorCode:o,stack:n,icon:a,closable:i=true,onClose:s,onRetry:l,className:d="",...u})=>{let[p,f]=er.useState(false),[b,m]=er.useState(false),v=async()=>{if(l){m(true);try{await l();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}finally{m(false);}}};return c("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:[c("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:[e("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:a||e(Ta,{className:"w-5 h-5"})}),c("div",{className:"flex-1 min-w-0",children:[c("div",{className:"flex items-center space-x-2 mb-1",children:[e("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),o&&e("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-[color-mix(in_oklch,var(--orb-status-error)_14%,transparent)] text-[var(--orb-status-error)]",children:o})]}),r&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-3 leading-relaxed",children:typeof r=="string"?e("p",{className:"whitespace-pre-wrap",children:r}):r}),(l||n)&&c("div",{className:"flex items-center space-x-4 mt-2",children:[l&&c("button",{onClick:v,disabled:b,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[e(Uc,{className:`w-3.5 h-3.5 mr-1.5 ${b?"animate-spin":""}`}),b?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&c("button",{onClick:()=>f(!p),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] transition-colors",children:[p?e(Fr,{className:"w-3.5 h-3.5 mr-1"}):e(Br,{className:"w-3.5 h-3.5 mr-1"}),p?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&s&&e("button",{onClick:s,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors self-start",children:e(jt,{className:"w-4 h-4"})})]}),n&&p&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 border-t border-[var(--orb-border)]",children:e("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})})]})},os=cC;P();var dC=({title:t="\u8B66\u544A",content:r,warningType:o,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:l,onConfirm:d,actionText:u,className:p="",...f})=>{let b=()=>{switch(n){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-[var(--orb-primary)]",bgColor:"bg-[var(--orb-p50)]"};case "error":return {borderLeftColor:"border-l-[var(--orb-status-error)]",iconColor:"text-[var(--orb-status-error)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-[var(--orb-status-success)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-[var(--orb-status-warning)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-warning)_8%,transparent)]"}}},m=()=>{switch(n){case "info":return e(Na,{className:"w-5 h-5"});case "error":return e(za,{className:"w-5 h-5"});case "success":return e(Ia,{className:"w-5 h-5"});default:return e(Tc,{className:"w-5 h-5"})}},v=b();return c("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${p}`,...f,children:[c("div",{className:`flex p-4 border-l-4 ${v.borderLeftColor} ${v.bgColor}`,children:[e("div",{className:`flex-shrink-0 mr-3 ${v.iconColor}`,children:i||m()}),c("div",{className:"flex-1 min-w-0",children:[c("div",{className:"flex items-center justify-between mb-1",children:[e("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),o&&e("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:o})]}),r&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:r}),a&&a.length>0&&e("ul",{className:"mt-2 space-y-1",children:a.map((y,g)=>c("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[e("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),e("span",{children:y})]},g))})]}),s&&l&&e("button",{onClick:l,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:e(jt,{className:"w-4 h-4"})})]}),d&&e("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:e("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:u||"\u786E\u8BA4"})})]})},ns=dC;P();var pC=({title:t="\u76F8\u5173\u63A8\u8350",content:r,suggestions:o,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:l,className:d="",...u})=>{let[p,f]=er.useState(false),[b,m]=er.useState(""),[v,y]=er.useState(false),g=er.useMemo(()=>b.trim()?o.filter(C=>C.toLowerCase().includes(b.toLowerCase())):o,[o,b]),x=er.useMemo(()=>p?g:g.slice(0,a),[g,p,a]),h=C=>{n?.(C);};return !o||o.length===0?null:c("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:[c("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[c("div",{className:"flex items-center space-x-2.5",children:[e("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||e(Aa,{className:"w-5 h-5"})}),c("div",{className:"flex flex-col",children:[e("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),r&&e("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:r})]})]}),c("div",{className:"flex items-center space-x-1",children:[o.length>3&&e("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:e(Hr,{className:"w-4 h-4"})}),s&&l&&e("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:e(jt,{className:"w-4 h-4"})})]})]}),v&&e("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:c("div",{className:"relative",children:[e("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:b,onChange:C=>m(C.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] focus:ring-1 focus:ring-[var(--orb-primary)] focus:border-[var(--orb-primary)] outline-none transition-shadow",autoFocus:true}),e(Hr,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),c("div",{className:"p-2",children:[e("ul",{className:"space-y-1",children:x.map((C,k)=>e("li",{children:c("button",{onClick:()=>h(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:[e("span",{children:C}),e(Br,{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.length>a&&e("button",{onClick:()=>f(!p),className:"w-full text-center py-2 text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors border-t border-[var(--orb-border)] mt-1",children:p?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g.length})`}),g.length===0&&b&&e("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},as=pC;P();var uC=({title:t,content:r,toolName:o,parameters:n,result:a,status:i,duration:s,icon:l,closable:d=false,onClose:u,onAction:p,actionText:f,className:b="",...m})=>{let[v,y]=er.useState(false),[g,x]=er.useState(true),h=()=>{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 e(Hc,{className:"w-5 h-5 animate-spin"});case "error":return e(za,{className:"w-5 h-5"});default:return e(Ia,{className:"w-5 h-5"})}},k=I=>I?I<1e3?`${I}ms`:`${(I/1e3).toFixed(2)}s`:"",w=h(),T=t||o||"\u5DE5\u5177\u8C03\u7528";return c("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${b}`,...m,children:[c("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:[c("div",{className:"flex items-center space-x-3",children:[e("div",{className:`flex-shrink-0 ${w.iconColor}`,children:l||C()}),c("div",{children:[c("div",{className:"flex items-center space-x-2",children:[e("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:T}),e("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${w.badgeBg} ${w.badgeText}`,children:w.label})]}),o&&t&&c("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[e(Vn,{className:"w-3 h-3 mr-1"}),o]})]})]}),c("div",{className:"flex items-center space-x-2 text-xs text-[var(--orb-muted)]",children:[s&&c("div",{className:"flex items-center bg-[var(--orb-surface)] px-2 py-1 rounded",children:[e(Dc,{className:"w-3 h-3 mr-1"}),k(s)]}),d&&u&&e("button",{onClick:u,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:e(jt,{className:"w-4 h-4"})})]})]}),c("div",{className:"p-4",children:[r&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-4 leading-relaxed",children:r}),n&&c("div",{className:"mb-3",children:[c("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?e(Fr,{className:"w-3.5 h-3.5 mr-1"}):e(Br,{className:"w-3.5 h-3.5 mr-1"}),e("div",{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),v&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:e("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:JSON.stringify(n,null,2)})})]}),a&&c("div",{children:[c("button",{onClick:()=>x(!g),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?e(Fr,{className:"w-3.5 h-3.5 mr-1"}):e(Br,{className:"w-3.5 h-3.5 mr-1"}),e(Vn,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),g&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:e("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)})})]}),p&&e("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:e("button",{onClick:p,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:f||"\u6267\u884C\u64CD\u4F5C"})})]})]})},is=uC;P();var gC=({data:t})=>{if(!t)return null;let r=er.useMemo(()=>{let o=[],n=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(o=t,o.length>0&&(n=Object.keys(o[0]).map(i=>({id:i,label:i.charAt(0).toUpperCase()+i.slice(1),numeric:typeof o[0][i]=="number"})))):typeof t=="object"&&(a=t.title||a,o=Array.isArray(t.rows)?t.rows:Array.isArray(t.data)?t.data:[],Array.isArray(t.columns)?n=t.columns.map(s=>({id:s.key||s.id,label:s.title||s.label,numeric:s.dataType==="number"||s.numeric})):o.length>0&&(n=Object.keys(o[0]).map(s=>({id:s,label:s,numeric:typeof o[0][s]=="number"})))),o=o.map((i,s)=>({...i,id:i.id||`row_${s}`})),{title:a,columns:n,rows:o}},[t]);return r.rows.length===0?e("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"}):e("div",{className:"w-full my-4",children:e(Jr,{appId:"agent-ui-table-card",title:r.title,columns:r.columns,rows:r.rows,count:r.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},ss=gC;P();var fC=({title:t,subtitle:r,data:o,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return e(Fs,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return e(Bc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return e(Gc,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return e(Pc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return e(Oc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return e(Lc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return e(jc,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return e(zn,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return e(Vc,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return e(Fs,{className:"w-4 h-4"})}},s=()=>{if(!o&&n!=="google-map-card"&&n!=="amap-card")return e("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:"No data available"});try{switch(n){case "bar-chart-card":return e(ra,{data:o,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return e(Ap,{data:o,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let l=o.reduce((u,p)=>u+(Number(p.value)||0),0),d=o.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 e(Si,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return e(Ep,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return e(Lp,{data:o});case "fishbone-chart-card":return e(Op,{branches:o,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return e(Fp,{data:o,height:a.height});case "google-map-card":return e(Bp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,apiKey:a.apiKey,query:a.query||o&&o[0]?.query||t,height:a.height});case "amap-card":return e(Hp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,keyword:a.keyword||o&&o[0]?.keyword||t,height:a.height});default:return c("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),e("div",{className:"text-[var(--orb-status-error)] text-sm p-4 text-center",children:"Error rendering chart"})}};return c("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:[c("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:[e("div",{className:"mr-2 flex-shrink-0",children:i()}),c("div",{className:"flex-1 min-w-0",children:[e("h3",{className:"text-sm font-semibold text-[var(--orb-fg)] truncate",children:t}),r&&e("p",{className:"text-xs text-[var(--orb-muted)] mt-0.5 truncate",children:r})]})]}),c("div",{className:"p-4",children:[e("div",{className:"overflow-x-auto",children:s()}),e("div",{className:"mt-3",children:c("details",{className:"text-xs text-[var(--orb-muted)]",children:[e("summary",{className:"cursor-pointer hover:text-[var(--orb-fg)] transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),e("pre",{className:"mt-2 p-2 bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-x-auto max-h-40",children:JSON.stringify(o,null,2)})]})})]})]})},ls=fC;P();var ms=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],bC={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},ps=480,Mn=214,Ut={top:18,right:16,bottom:38,left:30},tr=t=>typeof t=="number"&&Number.isFinite(t)?t:0,Rm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Ur=(t,r)=>`${t.id||t.label}-${r}`,Dm=(t,r=13)=>t.length>r?`${t.slice(0,Math.max(1,r-1))}\u2026`:t,us=(t,r,o)=>Math.min(o,Math.max(r,t)),mo=(t,r,o)=>t.color??o[r%o.length],go=(t,r)=>r?{onMouseEnter:()=>r.onItemHoverStart?.(t),onMouseMove:()=>r.onItemHoverStart?.(t),onMouseLeave:()=>r.onItemHoverEnd?.(t),onContextMenu:o=>r.onItemContextMenu?.(o,t)}:{},Nm=t=>{let r=t.map(a=>tr(a.value)),o=Math.min(0,...r),n=Math.max(0,...r);return {min:o,max:n===o?o+1:n,range:n===o?1:n-o}},hC=(t,r,o)=>{let n=ps-Ut.left-Ut.right,a=Mn-Ut.top-Ut.bottom,{max:i,range:s}=Nm(o),l=Ut.left+t*n/Math.max(o.length-1,1),d=Ut.top+(i-tr(r.value))/s*a,u=Ut.top+i/s*a;return {x:l,y:d,zeroY:u}},ds=(t,r,o,n)=>{let a=(n-90)*Math.PI/180;return {x:t+o*Math.cos(a),y:r+o*Math.sin(a)}},vC=(t,r,o,n,a,i)=>{let s=ds(t,r,o,i),l=ds(t,r,o,a),d=i-a>180?1:0;if(n===0)return `M ${t} ${r} L ${s.x} ${s.y} A ${o} ${o} 0 ${d} 0 ${l.x} ${l.y} Z`;let u=ds(t,r,n,i),p=ds(t,r,n,a);return `M ${s.x} ${s.y} A ${o} ${o} 0 ${d} 0 ${l.x} ${l.y} L ${p.x} ${p.y} A ${n} ${n} 0 ${d} 1 ${u.x} ${u.y} Z`},yC=({children:t})=>c("div",{className:"orb-metric-empty",role:"status",children:[e("span",{className:"orb-metric-empty-mark","aria-hidden":"true",children:"\u2014"}),e(L,{variant:"body2",muted:true,children:t})]}),CC=()=>c("div",{className:"orb-metric-loading",role:"status","aria-label":"Loading chart",children:[e("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"}),e("span",{className:"orb-metric-skeleton"}),e("span",{className:"orb-metric-skeleton orb-metric-skeleton-short"}),e("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"})]}),zl=({item:t,onItemClick:r,interactions:o})=>{let n=()=>r?.(t);return {...r?{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{r&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n());}}:{},...go(t,o),style:{cursor:r||o?"pointer":"default"}}},xC=({loading:t,error:r,hasData:o,emptyState:n,children:a})=>t?e(CC,{}):r?e("div",{className:"orb-metric-error",role:"alert",children:r}):o?e(jsxRuntime.Fragment,{children:a}):e(yC,{children:n??"No data for the current selection."}),SC=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(l=>Math.abs(tr(l.value))),1);return e("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let u=tr(l.value),p=`${us(Math.abs(u)/s*100,0,100)}%`,f=r===l.id,b=c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-metric-bar-label",title:l.label,children:l.label}),e("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:e("span",{className:`orb-metric-bar-fill${f?" is-active":""}`,style:{width:p,backgroundColor:mo(l,d,i)}})}),e("span",{className:"orb-metric-bar-value",children:a(u)})]});return o?e("button",{type:"button",className:`orb-metric-bar-row${f?" is-active":""}`,onClick:()=>o(l),title:`${l.label}: ${a(u)}`,"aria-pressed":f,...go(l,n),children:b},Ur(l,d)):e("div",{className:`orb-metric-bar-row${f?" is-active":""}`,role:"listitem",...go(l,n),children:b},Ur(l,d))})})},wC=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((l,d)=>l+Math.max(tr(d.value),0),0),1);return e("div",{className:"orb-metric-progress",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let u=Math.max(tr(l.value),0),p=us(u/s*100,0,100),f=r===l.id,b=c(jsxRuntime.Fragment,{children:[c("span",{className:"orb-metric-progress-heading",children:[e("span",{title:l.label,children:l.label}),e("strong",{children:a(u)})]}),e("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:e("span",{className:"orb-metric-bar-fill",style:{width:`${p}%`,backgroundColor:mo(l,d,i)}})})]});return o?e("button",{type:"button",className:`orb-metric-progress-row${f?" is-active":""}`,onClick:()=>o(l),"aria-pressed":f,...go(l,n),children:b},Ur(l,d)):e("div",{className:`orb-metric-progress-row${f?" is-active":""}`,role:"listitem",...go(l,n),children:b},Ur(l,d))})})},kC=({type:t,data:r,activeId:o,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:l,ariaLabel:d})=>{let{min:u,max:p,range:f}=Nm(r),b=ps-Ut.left-Ut.right,m=Mn-Ut.top-Ut.bottom,v=Ut.top+p/f*m,y=Math.max(1,Math.ceil(r.length/6)),g=r.map((C,k)=>hC(k,C,r)),x=g.map(C=>`${C.x},${C.y}`).join(" "),h=Math.max(...r.map(C=>Math.max(tr(C.secondaryValue),0)),1);return e("div",{className:"orb-metric-svg-wrap",children:c("svg",{className:"orb-metric-svg",viewBox:`0 0 ${ps} ${Mn}`,role:"img","aria-label":d,children:[e("line",{className:"orb-metric-axis",x1:Ut.left,y1:v,x2:ps-Ut.right,y2:v}),e("line",{className:"orb-metric-grid",x1:Ut.left,y1:Ut.top,x2:Ut.left,y2:Mn-Ut.bottom}),t==="column"&&r.map((C,k)=>{let w=g[k],T=tr(C.value),I=Math.max(Math.abs(w.y-v),T===0?2:0),S=w.x-Math.min(18,b/Math.max(r.length*2,1)),A=Math.min(36,Math.max(10,b/Math.max(r.length*1.8,1))),D=o===C.id;return c("g",{...zl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(T)}`,children:[e("rect",{className:`orb-metric-column${D?" is-active":""}`,x:S,y:Math.min(w.y,v),width:A,height:I,rx:4,fill:mo(C,k,l)}),c("title",{children:[C.label,": ",i(T)]}),(k%y===0||r.length<=6)&&e("text",{className:"orb-metric-svg-label",x:w.x,y:Mn-14,textAnchor:"middle",children:Dm(C.label)})]},Ur(C,k))}),(t==="line"||t==="scatter"||t==="bubble")&&c(jsxRuntime.Fragment,{children:[t==="line"&&e("polyline",{className:"orb-metric-line",fill:"none",points:x,stroke:l[0]}),r.map((C,k)=>{let w=g[k],T=o===C.id,I=t==="bubble"?7+Math.max(tr(C.secondaryValue),0)/h*12:t==="scatter"?5:4;return c("g",{...zl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(tr(C.value))}`,children:[t==="line"&&e("circle",{className:`orb-metric-point${T?" is-active":""}`,cx:w.x,cy:w.y,r:T?6:4,fill:mo(C,k,l)}),t!=="line"&&e("circle",{className:`orb-metric-point${T?" is-active":""}`,cx:w.x,cy:w.y,r:I,fill:mo(C,k,l),opacity:t==="bubble"?.82:.9}),c("title",{children:[C.label,": ",i(tr(C.value)),t==="bubble"&&C.secondaryValue!==void 0?` \xB7 Size: ${s(tr(C.secondaryValue))}`:""]}),(k%y===0||r.length<=6)&&e("text",{className:"orb-metric-svg-label",x:w.x,y:Math.max(Ut.top+8,w.y-I-7),textAnchor:"middle",children:Dm(C.label)})]},Ur(C,k))})]}),e("text",{className:"orb-metric-axis-label",x:Ut.left,y:Ut.top-5,children:i(p)}),u<0&&e("text",{className:"orb-metric-axis-label",x:Ut.left,y:Mn-Ut.bottom+14,children:i(u)})]})})},PC=({type:t,data:r,activeId:o,onItemClick:n,interactions:a,valueFormatter:i,colors:s,ariaLabel:l})=>{let d=r.map(m=>({...m,value:Math.max(tr(m.value),0)})),u=d.reduce((m,v)=>m+v.value,0),p=72,f=92,b=0;return c("div",{className:"orb-metric-circular",children:[c("svg",{className:"orb-metric-donut",viewBox:"0 0 184 184",role:"img","aria-label":l,children:[d.map((m,v)=>{let y=m.value/u*360,g=b;b+=y;let x=o===m.id,h=y>=359.9?void 0:vC(f,f,p,t==="donut"?46:0,g,g+y),C=zl({item:m,onItemClick:n,interactions:a});return h?e("path",{className:`orb-metric-slice${x?" is-active":""}`,d:h,fill:mo(m,v,s),...C,children:c("title",{children:[m.label,": ",i(m.value)," (",(m.value/u*100).toFixed(1),"%)"]})},Ur(m,v)):e("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:f,cy:f,r:t==="donut"?60:p,fill:t==="donut"?"none":mo(m,v,s),stroke:t==="donut"?mo(m,v,s):void 0,strokeWidth:28,...C,children:c("title",{children:[m.label,": ",i(m.value)," (100%)"]})},Ur(m,v))}),t==="donut"&&e("circle",{cx:f,cy:f,r:44,fill:"var(--orb-surface)"}),t==="donut"&&e("text",{className:"orb-metric-donut-total",x:f,y:f+5,textAnchor:"middle",children:i(u)})]}),e("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((m,v)=>{let y=o===m.id;return c("button",{type:"button",className:`orb-metric-legend-item${y?" is-active":""}`,onClick:()=>n?.(m),disabled:!n,title:m.label,...go(m,a),children:[e("span",{className:"orb-metric-legend-dot",style:{backgroundColor:mo(m,v,s)}}),e("span",{className:"orb-metric-legend-label",children:m.label}),c("strong",{children:[(m.value/u*100).toFixed(0),"%"]})]},Ur(m,v))})})]})},TC=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,secondaryValueFormatter:i})=>e("div",{className:"orb-metric-list",role:"list","aria-label":"Chart data",children:t.map((s,l)=>{let d=c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-metric-list-label",title:s.label,children:s.label}),e("span",{className:"orb-metric-list-value",children:a(tr(s.value))}),s.secondaryValue!==void 0&&e("span",{className:"orb-metric-list-secondary",children:i(tr(s.secondaryValue))})]});return o?e("button",{type:"button",className:`orb-metric-list-row${r===s.id?" is-active":""}`,onClick:()=>o(s),"aria-pressed":r===s.id,...go(s,n),children:d},Ur(s,l)):e("div",{className:`orb-metric-list-row${r===s.id?" is-active":""}`,role:"listitem",...go(s,n),children:d},Ur(s,l))})}),gs=({title:t,subtitle:r,data:o=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:l,valueFormatter:d=Rm,secondaryValueFormatter:u=Rm,valueLabel:p,secondaryValueLabel:f,emptyState:b,loading:m=false,error:v,maxItems:y=8,showChartTypeControl:g=true,showDataDetails:x=true,dataRevealDelayMs:h=1e3,chartTypeOptions:C,chartTypeLabels:k,footer:w,ariaLabel:T,className:I,style:S,sx:A})=>{let D=Os(),M=er.useRef(null),N=er.useRef(null),[E,O]=er.useState(n),[F,X]=er.useState(false),[H,Y]=er.useState(null),[W,j]=er.useState(null);er.useEffect(()=>O(n),[n]);let V=er.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null);},[]);er.useEffect(()=>V,[V]),er.useEffect(()=>{if(!W)return;let q=De=>{let ye=De.target;ye instanceof HTMLElement&&ye.closest(".orb-metric-context-menu")||j(null);};return document.addEventListener("pointerdown",q),()=>document.removeEventListener("pointerdown",q)},[W]);let z=E,U=er.useMemo(()=>[D.chart1,D.chart2,D.chart3,D.chart4,D.chart5,D.chart6],[D]),K=er.useMemo(()=>F?o:o.slice(0,Math.max(1,y)),[o,y,F]),fe=Math.max(0,o.length-K.length),se=K.some(q=>tr(q.value)>0),ue=K.length>0&&(z!=="pie"&&z!=="donut"?true:se),Se=(C??[z,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((q,De,ye)=>ms.includes(q)&&ye.indexOf(q)===De),$e={...bC,...k},ke=K[0],le=T??`${t} ${$e[z]} chart`,Ee=q=>{O(q),a?.(q);},Me=er.useCallback((q,De)=>{Y({item:q,source:De}),j(null),s?.(q,De);},[s]),Pe=er.useCallback(q=>{V(),!(!x||W)&&(N.current=window.setTimeout(()=>{Me(q,"hover"),N.current=null;},Math.max(0,h)));},[V,W,h,Me,x]),Ve=er.useCallback(()=>{V();},[V]),tt=er.useCallback((q,De)=>{if(!x)return;q.preventDefault(),V();let ye=M.current?.getBoundingClientRect(),Be=ye?us(q.clientX-ye.left,8,Math.max(8,ye.width-164)):8,at=ye?us(q.clientY-ye.top,8,Math.max(8,ye.height-72)):8;j({item:De,left:Be,top:at});},[V,x]),nt=x?{onItemHoverStart:Pe,onItemHoverEnd:Ve,onItemContextMenu:tt}:void 0,it=z==="metric"?c("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>ke&&i?.(ke),onKeyDown:q=>{ke&&i&&(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),i(ke));},"aria-label":le,...ke?go(ke,nt):{},children:[e("span",{className:"orb-metric-kpi-label",children:ke?.label??p??"Value"}),e("strong",{children:ke?d(tr(ke.value)):"\u2014"}),ke?.secondaryValue!==void 0&&c("span",{className:"orb-metric-kpi-secondary",children:[f??"Compared with"," \xB7 ",u(tr(ke.secondaryValue))]})]}):z==="progress"?e(wC,{data:K,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:U}):z==="bar"?e(SC,{data:K,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:U}):z==="list"?e(TC,{data:K,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:u}):z==="pie"||z==="donut"?e(PC,{type:z,data:K,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:U,ariaLabel:le}):e(kC,{type:z,data:K,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:u,colors:U,ariaLabel:le});return c("div",{ref:M,className:"orb-metric-chart-shell",onMouseLeave:()=>{V(),H?.source==="hover"&&Y(null);},children:[c(Ae,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${I??""}`,style:S,sx:A,children:[c("div",{className:"orb-metric-chart-header",children:[c("div",{className:"orb-metric-chart-heading",children:[e(L,{variant:"subtitle1",component:"h3",noWrap:true,title:t,children:t}),r&&e(L,{variant:"caption",muted:true,component:"div",noWrap:true,children:r})]}),g&&Se.length>1&&e(zt,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:z,options:Se.map(q=>({value:q,label:$e[q]})),onChange:q=>Ee(q.target.value),minWidth:108,fullWidth:false,size:"small"})]}),c("div",{className:"orb-metric-chart-body",children:[e(xC,{loading:m,error:v,hasData:ue,emptyState:b,children:it}),fe>0&&!m&&!v&&e("button",{type:"button",className:"orb-metric-more",onClick:()=>X(q=>!q),children:F?"Show fewer":`Show all ${o.length}`})]}),w&&e("div",{className:"orb-metric-chart-footer",children:w})]}),W&&c("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:V,onKeyDown:q=>{q.key==="Escape"&&j(null);},style:{left:W.left,top:W.top},onPointerDown:q=>q.stopPropagation(),children:[e("div",{className:"orb-metric-context-label",children:W.item.label}),e("button",{type:"button",role:"menuitem",onClick:q=>{q.preventDefault(),q.stopPropagation(),Me(W.item,"contextmenu");},children:"Show data"})]}),H&&c("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${H.item.label} data details`,onPointerDown:q=>q.stopPropagation(),children:[c("div",{className:"orb-metric-data-details-header",children:[e("strong",{children:H.item.label}),e("button",{type:"button","aria-label":"Close data details",onClick:()=>Y(null),children:"\xD7"})]}),c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:p??"Value"}),e("strong",{children:d(tr(H.item.value))})]}),H.item.secondaryValue!==void 0&&c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:f??"Secondary value"}),e("strong",{children:u(tr(H.item.secondaryValue))})]}),e("span",{className:"orb-metric-data-details-hint",children:H.source==="hover"?`Shown after ${Math.max(0,h)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};gs.displayName="CMetricChartCard";P();var IC=({messageId:t,cardHooks:r,valueSuffix:o,secondaryValueSuffix:n,...a})=>{let i=(l,d)=>{r?.onCardEvent?.({messageId:t,cardType:"metric-chart-card",action:l,title:a.title,payload:d,rawData:a});},s=(l,d)=>`${l.toLocaleString()}${d??""}`;return e(gs,{...a,valueFormatter:l=>s(l,o),secondaryValueFormatter:l=>s(l,n),onChartTypeChange:l=>i("action",{chartType:l}),onItemClick:l=>i("action",{item:l}),onDataDetails:(l,d)=>i("show-data",{item:l,source:d})})},fs=IC;P();var MC=({type:t,manifest:r})=>c("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:[c("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[e("div",{className:"w-4 h-4 mr-2 text-[var(--orb-status-primary)]"}),c("h3",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:["SAP Card: ",t]})]}),e("div",{className:"p-4",children:e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 rounded border border-[var(--orb-border)] overflow-x-auto",children:e("pre",{className:"text-xs font-mono text-[var(--orb-muted)] whitespace-pre-wrap",children:JSON.stringify(r,null,2)})})})]}),bs=MC;var RC=t=>Array.isArray(t)?t.flatMap((r,o)=>{if(!r||typeof r!="object")return [];let n=r,a=String(n.label??n.name??n.id??`Item ${o+1}`),i=Number(n.value),s=Number.isFinite(i)?i:0,l=n.secondaryValue===void 0?void 0:Number(n.secondaryValue);return [{id:String(n.id??n.name??n.label??o),label:a,value:s,...l!==void 0&&Number.isFinite(l)?{secondaryValue:l}:{},...typeof n.color=="string"?{color:n.color}:{}}]}):[],hs=t=>{let r;try{r=JSON.parse(t);}catch{return null}if(r&&typeof r=="object"){if(r.type==="metric-chart-card"&&r.title&&Array.isArray(r.data)){let o=ms.includes(r.chartType)?r.chartType:"bar";return {...r,type:"metric-chart-card",chartType:o,data:RC(r.data)}}if((r.type==="bar-chart-card"||r.type==="line-chart-card"||r.type==="pie-chart-card"||r.type==="combo-chart-card"||r.type==="heatmap-chart-card"||r.type==="fishbone-chart-card"||r.type==="waterfall-chart-card"||r.type==="google-map-card"||r.type==="amap-card")&&r.title||(r.type==="sap-analytical-card"||r.type==="sap-list-card"||r.type==="sap-object-card"||r.type==="sap-component-card")&&r.manifest||r.type==="error-card"||r.type==="warning-card"||r.type==="suggestions-card"||r.type==="tool-result-card"||r.type==="table"&&r.data)return r}return null};P();var FC=({content:t,theme:r,size:o="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:l})=>{let d=er.useRef(l);d.current=l;let u=!!l?.onCardEvent,p=er.useMemo(()=>u?{onCardEvent:y=>d.current?.onCardEvent?.(y)}:void 0,[u]),f=er.useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(y,g)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(g.trim())}"></div>`):"",[t]),b=(y,g,x,h,C)=>{p?.onCardEvent?.({messageId:s,cardType:y,action:g,title:x,payload:h,rawData:C});},m=(y,g,x,h,C,k)=>{if(!(!C&&!p?.onCardEvent))return (...w)=>{let T=C?.(...w),I=k?k(...w):void 0;return b(y,g,x,I,h),T}},v=er.useMemo(()=>({div(y){let{"data-component":g,"data-think-content":x,...h}=y;return g==="thinkbox"&&x?e(hm,{content:decodeURIComponent(x),theme:r,size:o,defaultExpanded:false}):e("div",{...h})},table({children:y}){return e("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:e("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:y})})},thead({children:y}){return e("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:y})},tbody({children:y}){return e("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:y})},tr({children:y}){return e("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:y})},th({children:y,align:g}){return e("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 e("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 h=/language-([\w-]+)/.exec(y||""),C=h?h[1]:"",k=String(g);if(!h&&!k.includes(`
199
- `))return e("code",{children:g});let T=k.replace(/\n$/,"");if(i&&C==="mermaid")return e(wm,{content:T});if(C==="html"||C==="htm")return e(Cm,{content:T});if(C==="json"){let I=hs(T);if(I)switch(I.type){case "table":return e(ss,{data:I.data});case "metric-chart-card":return e(fs,{...I,messageId:s,cardHooks:p});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 e(ls,{...I});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return e(bs,{...I});case "error-card":{let S=I;return e(os,{...S,onClose:m("error-card","close",S.title,S,S.onClose),onRetry:m("error-card","retry",S.title,S,S.onRetry)})}case "warning-card":{let S=I,A=S.onConfirm?m("warning-card","confirm",S.title,S,S.onConfirm):S.actionText&&p?.onCardEvent?m("warning-card","confirm",S.title,S):void 0;return e(ns,{...S,onClose:m("warning-card","close",S.title,S,S.onClose),onConfirm:A})}case "suggestions-card":{let S=I;return e(as,{...S,onClose:m("suggestions-card","close",S.title,S,S.onClose),onSuggestionClick:m("suggestions-card","suggestion-click",S.title,S,S.onSuggestionClick,A=>({suggestion:A}))})}case "tool-result-card":{let S=I;return e(is,{...S,onClose:m("tool-result-card","close",S.title,S,S.onClose),onAction:m("tool-result-card","action",S.title,S,S.onAction)})}}}return a?e(vm,{content:T,language:C,className:"not-prose"}):e("code",{className:y,...x,children:g})}}),[r,o,i,a,p,s]);return e("div",{className:ut("markdown-body max-w-none",n),children:e(NC__default.default,{remarkPlugins:[AC__default.default,EC__default.default],rehypePlugins:[LC__default.default,OC__default.default],components:v,children:f})})},Rn=FC;P();var BC=({content:t,messageId:r,cardHooks:o})=>{let n=(s,l,d,u,p)=>{o?.onCardEvent?.({messageId:r,cardType:s,action:l,title:d,payload:u,rawData:p});},a=(s,l,d,u,p,f)=>{if(!(!p&&!o?.onCardEvent))return (...b)=>{let m=p?.(...b),v=f?f(...b):void 0;return n(s,l,d,v,u),m}},i=hs(t);if(i)switch(i.type){case "table":return e(ss,{data:i.data});case "metric-chart-card":return e(fs,{...i,messageId:r,cardHooks:o});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return e(ls,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return e(bs,{...i});case "error-card":{let s=i;return e(os,{...s,onClose:a("error-card","close",s.title,s,s.onClose),onRetry:a("error-card","retry",s.title,s,s.onRetry)})}case "warning-card":{let s=i,l=s.onConfirm?a("warning-card","confirm",s.title,s,s.onConfirm):s.actionText&&o?.onCardEvent?a("warning-card","confirm",s.title,s):void 0;return e(ns,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:l})}case "suggestions-card":{let s=i;return e(as,{...s,onClose:a("suggestions-card","close",s.title,s,s.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",s.title,s,s.onSuggestionClick,l=>({suggestion:l}))})}case "tool-result-card":{let s=i;return e(is,{...s,onClose:a("tool-result-card","close",s.title,s,s.onClose),onAction:a("tool-result-card","action",s.title,s,s.onAction)})}}return e("div",{className:"dynamic-card-fallback",children:e(Rn,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:o})})},Am=BC;P();var Wl=class{static analyze(r){if(!r.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let n=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(r),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(r),i=r.includes("NQ#")||r.includes("data-component");return n||a||i?{blocks:[{type:"mixed",content:r,startIndex:0,endIndex:r.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:r,startIndex:0,endIndex:r.length}],hasComplexContent:false,overallType:"simple"}}},zC=({content:t,className:r="",messageId:o,cardHooks:n})=>{let a=er__namespace.default.useMemo(()=>Wl.analyze(t),[t]);return e("div",{className:`universal-content-renderer ${r}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?e(Am,{content:i.content,messageId:o,cardHooks:n},`block-${s}`):e(Rn,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:n},`block-${s}`))})},vs=zC;P();var VC=({content:t,isStreaming:r=true,onComplete:o,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:l})=>{let[d,u]=er.useState(r?0:t.length),[p,f]=er.useState(!r);er.useEffect(()=>{if(r){u(0),f(false);return}u(t.length),f(true);},[t,r]),er.useEffect(()=>{if(!r||p)return;if(d>=t.length){f(true),o?.();return}let g=window.setTimeout(()=>{u(x=>Math.min(x+i,t.length));},a);return ()=>{window.clearTimeout(g);}},[t.length,p,r,o,i,a,d]);let b=()=>{r&&!p&&(u(t.length),f(true),o?.());},m=r?t.slice(0,d):t,v=r&&!p,y=r&&!p;return c("div",{className:`streaming-markdown ${n}`,onClick:b,style:{cursor:r?"pointer":"default"},children:[c("div",{className:"relative",children:[e(vs,{content:m,messageId:s,cardHooks:l}),v&&e("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),y&&e("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"})]})},Om=VC;P();var Fm=({buttons:t,className:r})=>{let o=n=>{switch(n){case "copy":return e(vo,{size:14});case "refresh":return e(Ba,{size:14});case "volume":return e(Jc,{size:14});case "like":return e(Yc,{size:14});case "dislike":return e(Xc,{size:14});default:return null}};return e("div",{className:ut("flex items-center gap-1",r),children:t.map((n,a)=>e("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:ut("p-1.5 rounded-md transition-colors","text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:text-[var(--orb-fg)]","hover:bg-[var(--orb-hover)]","disabled:opacity-50 disabled:cursor-not-allowed",n.active&&"text-[var(--orb-primary)] bg-[var(--orb-p50)]",n.type==="refresh"&&n.loading&&"animate-spin"),title:n.type,type:"button",children:o(n.type)},`${n.type}-${a}`))})};P();var ys=({message:t,onStreamingComplete:r,assistantActions:o,streamIntervalMs:n,streamChunkSize:a,cardHooks:i})=>{let s={lineHeight:1.55,fontSize:13,fontWeight:300,fontFamily:'var(--orb-font, "Montserrat", system-ui, sans-serif)',color:"var(--orb-fg, #555555)",borderRadius:"var(--orb-r, 10px)",padding:"10px 14px"},l={marginTop:6,fontSize:11,color:"var(--orb-muted, #8c8c8c)"};if(t.type==="assistant"){let d=!!(o?.isResponding||t.isStreaming);return e("div",{className:"mb-4 flex justify-start",children:c("div",{className:"mr-auto w-full",style:{...s,background:"var(--orb-surface, #f5f5f5)",border:"1px solid var(--orb-border, #dbdbdb)"},children:[e(Om,{content:t.content,isStreaming:t.isStreaming??false,onComplete:r,streamIntervalMs:n,streamChunkSize:a,messageId:t.id,cardHooks:i}),t.content&&o?.isLatestAssistant&&e("div",{className:"mt-3 flex flex-row justify-start gap-2 border-t pt-2",style:{borderColor:"var(--orb-border, #dbdbdb)"},children:e(Fm,{buttons:[{type:"refresh",onClick:()=>{o?.onRegenerate?.();},disabled:d||!o?.onRegenerate,loading:d},{type:"copy",onClick:()=>navigator.clipboard.writeText(t.content),disabled:false},{type:"volume",onClick:()=>console.log("\u8BED\u97F3\u64AD\u653E"),disabled:false},{type:"like",onClick:()=>console.log("\u70B9\u8D5E"),disabled:false},{type:"dislike",onClick:()=>console.log("\u70B9\u8E29"),disabled:false}],size:"sm",variant:"default"})}),e("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})}return e("div",{className:"mb-4 flex justify-end",children:c("div",{className:"ml-auto max-w-[80%]",style:{...s,background:"var(--orb-p50, #eef2f9)",border:"1px solid var(--orb-p100, #e4e9f5)"},children:[e("div",{className:"whitespace-pre-wrap",children:t.content}),e("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})};P();var Bm=({onTextUpdate:t,onComplete:r,onCancel:o,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:l}=Sn({onTextUpdate:t,onComplete:u=>{r?.(u);},onError:u=>{console.error("Voice input error:",u),o?.();}});return e("button",{onClick:async()=>{i?l():await s();},disabled:n,className:ut("transition-all duration-200 flex items-center justify-center rounded-full",i?"bg-[color-mix(in_oklch,var(--orb-status-error)_12%,transparent)] text-[var(--orb-status-error)] hover:bg-[color-mix(in_oklch,var(--orb-status-error)_20%,transparent)] animate-pulse":"bg-transparent hover:bg-[var(--orb-hover)] text-[var(--orb-muted)] active:scale-95",n&&"opacity-50 cursor-not-allowed",a),title:i?"Stop recording":"Start recording",type:"button",children:i?e(np,{size:16}):e(ap,{size:16})})};P();var dr={container:"w-full max-w-4xl mx-auto",inputContainer:ut("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:ut("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-3","placeholder:text-[var(--orb-muted,#8c8c8c)] placeholder:font-normal","text-[var(--orb-fg,#555555)] selection:bg-[var(--orb-p100,#e4e9f5)]","focus:ring-0 focus:outline-none focus:border-none focus:shadow-none","min-h-[44px] max-h-[12em] overflow-y-auto scrollbar-thin scrollbar-thumb-[var(--orb-border)]"),filePreviewArea:"px-4 pt-3 pb-1 flex flex-wrap gap-2",fileTag:ut("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-[var(--orb-surface,#f5f5f5)] text-[var(--orb-fg,#555555)]","border border-[var(--orb-border,#dbdbdb)]","transition-all hover:bg-[var(--orb-hover,#eef2f9)]"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"h-[38px] w-[38px] shrink-0 md:h-8 md:w-8",buttonNormal:ut("bg-transparent hover:bg-[var(--orb-hover,#eef2f9)] text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)]","cursor-pointer active:scale-95"),sendButton:ut("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:ut("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:ut("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95")},$C={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},_C=({enabled:t,onClick:r})=>e("button",{className:ut(dr.buttonBase,dr.buttonSmall,dr.buttonNormal),onClick:r,disabled:!t,"aria-label":"Upload file",type:"button",children:e(Bd,{size:16})}),GC=({canSend:t,isResponding:r,onSend:o,onStop:n})=>r?e("button",{className:ut(dr.buttonBase,dr.buttonSmall,dr.stopButton),onClick:n,"aria-label":"Stop generating",type:"button",children:e(gp,{size:15})}):e("button",{className:ut(dr.buttonBase,dr.buttonSmall,t?dr.sendButton:dr.sendButtonDisabled),onClick:o,disabled:!t,"aria-label":"Send message",type:"button",children:e(cp,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})}),$l=({onSend:t,onStop:r,isResponding:o=false,placeholder:n,getText:a})=>{let[i,s]=er.useState(""),[l,d]=er.useState([]),[u,p]=er.useState(false),[f,b]=er.useState(false),m=er.useRef(null),v=n||(a?a("00019","Type a message..."):"Type a message..."),y=(i.trim().length>0||l.length>0)&&!o,g={enabled:true},x=er.useCallback(F=>{s(F.target.value),F.target.style.height="auto",F.target.style.height=`${Math.min(F.target.scrollHeight,200)}px`;},[]),h=er.useCallback(F=>{if(F.target.files&&F.target.files.length>0){let X=Array.from(F.target.files);d(H=>{let Y=X.filter(j=>H.some(V=>V.name===j.name&&V.size===j.size));Y.length>0&&console.warn("Duplicate files ignored:",Y.map(j=>j.name));let W=X.filter(j=>!H.some(V=>V.name===j.name&&V.size===j.size));return [...H,...W]}),m.current&&(m.current.value="");}},[]),C=er.useCallback(F=>{d(X=>X.filter((H,Y)=>Y!==F));},[]),k=er.useCallback(()=>{m.current?.click();},[]),w=er.useCallback(async()=>{if(!y)return;let F=i,X=[...l];s(""),d([]),m.current&&(m.current.value="");try{await t(F,X);}catch(H){console.error("Failed to send message:",H),s(F),d(X);}},[i,y,t,l]),T=er.useCallback(F=>{F.key==="Enter"&&!F.shiftKey&&!u&&(F.preventDefault(),w());},[w,u]),I=er.useCallback(()=>{p(true);},[]),S=er.useCallback(()=>{p(false);},[]),A=er.useCallback(F=>{s(F);},[]),D=er.useCallback(F=>{s(F);},[]),M=er.useCallback(()=>{},[]),N=er.useCallback(F=>{F.preventDefault(),b(true);},[]),E=er.useCallback(F=>{F.preventDefault(),b(false);},[]),O=er.useCallback(F=>{if(F.preventDefault(),b(false),F.dataTransfer.files&&F.dataTransfer.files.length>0){let X=Array.from(F.dataTransfer.files);d(H=>[...H,...X]);}},[]);return e("div",{className:dr.container,children:c("div",{className:"relative",children:[e("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:h}),c("div",{className:ut(dr.inputContainer,f&&dr.dragActive),onDragOver:N,onDragLeave:E,onDrop:O,children:[l.length>0&&e("div",{className:dr.filePreviewArea,children:l.map((F,X)=>c("div",{className:dr.fileTag,children:[e(Jd,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),e("span",{className:"truncate max-w-[150px]",children:F.name}),e("button",{onClick:()=>C(X),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:e(Ud,{sx:{fontSize:16}})})]},`${F.name}-${X}`))}),c("div",{className:"flex w-full flex-col p-2",children:[e("div",{className:ut(dr.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:e("textarea",{className:ut(dr.textarea,"min-h-[24px] py-0 px-0"),placeholder:v,value:i,onChange:x,onKeyDown:T,onCompositionStart:I,onCompositionEnd:S,style:$C,"aria-label":"Message input",spellCheck:false,rows:1})}),c("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[e("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:e(_C,{enabled:g.enabled,onClick:k})}),c("div",{className:"flex items-center gap-1",children:[e(Bm,{onTextUpdate:A,onComplete:D,onCancel:M,disabled:o,className:dr.buttonSmall}),e(GC,{canSend:y,isResponding:o,onSend:w,onStop:r})]})]})]})]})]})})};P();var zm=({messages:t,onSend:r,onStop:o,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:l,streamChunkSize:d,onMessageStreamingComplete:u,cardHooks:p,showInput:f=true,statusLine:b})=>{let m=er.useRef(null),v=er.useRef(t.length);return er.useEffect(()=>{t.length>v.current&&m.current?.scrollIntoView({behavior:"smooth"}),v.current=t.length;},[t]),c("div",{className:ut("flex flex-col h-full w-full relative",i),children:[c("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,h=y.type==="assistant"?{isLatestAssistant:x,isResponding:a,onRegenerate:n?()=>n(y.id):void 0}:void 0;return e(ys,{message:y,assistantActions:h,onStreamingComplete:()=>u?.(y.id),streamIntervalMs:l,streamChunkSize:d,cardHooks:p},y.id)}),b,e("div",{ref:m})]}),f&&e("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:e($l,{onSend:r||(async()=>{}),onStop:o||(()=>{}),isResponding:a,placeholder:s})})]})};P();var Vm={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},Wm=({title:t="AI Agent",description:r,headerActions:o,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:l=false,...d})=>{let u=a??(d.isResponding?"running":"idle"),p=u==="running"||u==="pending",f=[Vm[u],r].filter(Boolean).join(" \xB7 ");return c("div",{className:ut("orb-agent-panel",n),children:[c("div",{className:ut("orb-agent-header",s&&"cursor-grab active:cursor-grabbing"),onPointerDown:s,children:[e("span",{className:"orb-agent-avatar","aria-hidden":"true",children:"AI"}),c("div",{className:"min-w-0 flex-1",children:[e("div",{className:"orb-agent-title",children:t}),c("div",{className:"orb-agent-subtitle",children:[e("span",{className:"orb-agent-dot","data-active":p||void 0}),e("span",{className:"truncate",children:f||"Agent"})]})]}),o&&e("div",{className:"ml-auto flex flex-none items-center gap-1",children:o})]}),e("div",{className:"relative min-h-0 flex-1",children:e(zm,{...d,showInput:l,statusLine:p?c("div",{className:ut("orb-agent-status-line","mb-1"),children:[e("span",{className:"orb-agent-spinner","aria-hidden":"true"}),e("span",{children:i??`${Vm[u]}\u2026`})]}):void 0})})]})};P();var XC=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:r,labels:o,onNewConversation:n,onSelectConversation:a})=>{let[i,s]=er.useState(false),l=er.useRef(null),d=er.useRef(null),u=er.useRef(null),p=er.useId(),f=!!a;er.useEffect(()=>{if(!i)return;let m=y=>{l.current?.contains(y.target)||s(false);},v=y=>{y.key==="Escape"&&(y.stopPropagation(),s(false),u.current?.focus());};return document.addEventListener("pointerdown",m),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",m),document.removeEventListener("keydown",v);}},[i]),er.useEffect(()=>{if(!i)return;let m=d.current?.querySelector('[aria-selected="true"]'),v=d.current?.querySelector('[role="option"]');(m??v)?.focus();},[i]);let b=m=>{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?m===1?0:v.length-1:(y+m+v.length)%v.length;v[g]?.focus();};return !n&&!f?null:c(jsxRuntime.Fragment,{children:[n&&e("button",{type:"button",className:"orb-omph-icon-btn","aria-label":o.newConversation,onClick:()=>{s(false),n();},children:e(en,{size:16})}),f&&a&&c("div",{className:"orb-omph-conversation-anchor",ref:l,children:[e("button",{ref:u,type:"button",className:"orb-omph-icon-btn","aria-label":o.conversationList,"aria-expanded":i,"aria-controls":p,onClick:()=>s(m=>!m),children:e(Wc,{size:16})}),i&&e("div",{ref:d,id:p,className:"orb-omph-conversations",role:"listbox","aria-label":o.conversations,onKeyDown:m=>{m.key==="ArrowDown"?(m.preventDefault(),b(1)):m.key==="ArrowUp"&&(m.preventDefault(),b(-1));},children:t.length===0?e("p",{className:"orb-omph-conversation-empty",children:o.noConversations}):t.map(m=>{let v=m.updatedAt?XC(m.updatedAt):"",y=[m.preview,v].filter(x=>x&&x.length>0).join(" \xB7 "),g=m.id===r;return c("button",{type:"button",role:"option",className:"orb-omph-conversation","aria-selected":g,"data-active":g||void 0,onClick:()=>{a(m.id),s(false);},children:[e("span",{className:"orb-omph-conversation-title",children:m.title}),y&&e("span",{className:"orb-omph-conversation-meta",children:y})]},m.id)})})]})]})};P();var ex=2e3,tx=1/3,xs=[.25,.5,.75,1,1.5,2,3,4],rx=100,Gm={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},Um=({text:t,language:r,startLine:o,endLine:n,wrap:a,labels:i})=>{let s=er.useRef(null),l=er.useMemo(()=>{let p=t.split(`
200
- `);p.length>1&&p[p.length-1]===""&&p.pop();let f=Math.min(p.length,ex);return {shown:p.slice(0,f).join(`
201
- `),shownCount:f,total:p.length}},[t]),d=er.useCallback(p=>{let f=n??o,b=o!==void 0&&f!==void 0&&p>=o&&p<=f;return {className:"orb-omph-code-line","data-line":p,...b?{"data-hit":"true"}:{}}},[n,o]);er.useEffect(()=>{let p=s.current,f=p?.closest(".orb-omph-pv-body");if(!p||!f)return;if(o===void 0){f.scrollTop=0;return}let b=p.querySelector(`[data-line="${o}"]`);if(!b)return;let m=b.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop;f.scrollTop=Math.max(0,m-f.clientHeight*tx);},[o,l.shown]);let u={"--orb-omph-digits":String(l.shownCount).length};return c("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:u,children:[e(reactSyntaxHighlighter.Prism,{language:r,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:d,customStyle:Gm,codeTagProps:{className:`language-${r}`,style:Gm},children:l.shown}),l.total>l.shownCount&&e("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},Km=({text:t})=>e("div",{className:"orb-omph-pv-doc",children:e(Rn,{content:t})}),qm=({url:t,alt:r,labels:o})=>{let[n,a]=er.useState("fit"),[i,s]=er.useState(null),[l,d]=er.useState(false),u=n==="fit"?1:n,p=xs.some(v=>v>u),f=xs.some(v=>v<u),b=v=>a(y=>{let g=y==="fit"?1:y;return (v>0?xs.find(h=>h>g):[...xs].reverse().find(h=>h<g))??y}),m=n==="fit"||i===null?{maxWidth:"100%",height:"auto"}:{width:i*n,maxWidth:"none",height:"auto"};return l?e("div",{className:"orb-omph-pv-note",role:"alert",children:r?`${o.imageFailed} \xB7 ${r}`:o.imageFailed}):c("div",{className:"orb-omph-img",children:[e("div",{className:"orb-omph-img-stage",children:e("img",{src:t,alt:r??"",draggable:false,style:m,onLoad:v=>s(v.currentTarget.naturalWidth),onError:()=>d(true)})}),c("div",{className:"orb-omph-img-zoom",role:"group","aria-label":o.zoomFit,children:[e("button",{type:"button","aria-label":o.zoomOut,disabled:!f,onClick:()=>b(-1),children:"\u2212"}),e("button",{type:"button","aria-label":o.zoomFit,"data-active":n==="fit"||void 0,onClick:()=>a("fit"),children:n==="fit"?o.zoomFit:`${Math.round(n*rx)}%`}),e("button",{type:"button","aria-label":o.zoomIn,disabled:!p,onClick:()=>b(1),children:"+"})]})]})};var ox=/^[a-z][a-z0-9+.-]*:/i,nx=/^L(\d+)(?:-L?(\d+))?$/i;var Xm=["B","KB","MB","GB"];var ax=t=>{try{return decodeURIComponent(t)}catch{return t}},Ul=t=>{let r=t.trim();if(!r||r.startsWith("#")||r.startsWith("//")||ox.test(r))return null;let o=r.indexOf("#"),n=o>=0?r.slice(0,o):r,a=o>=0?r.slice(o+1):"",i=n.indexOf("?"),s=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 u=l[2]?Number(l[2]):d;return {path:s,startLine:d,endLine:Math.max(d,u)}},Kl=t=>t.split("/").filter(Boolean).pop()??t,Zm=t=>{let r=t.split("/");return r.pop(),r.join("/")},ql=t=>{let r=Kl(t),o=r.lastIndexOf(".");return o>0?r.slice(o+1).toLowerCase():""},jm={prism:"text",label:"Text"},Ym={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:jm},Xl=(t,r)=>r?Object.values(Ym).find(n=>n.prism===r)??{prism:r,label:r}:Ym[ql(t)]??jm,Qm=t=>{let r=t,o=0;for(;r>=1024&&o<Xm.length-1;)r/=1024,o+=1;return `${o>0&&r<10?r.toFixed(1):Math.round(r).toString()} ${Xm[o]}`};P();var ix=1e3,sx=9,fo=16,Yl=({tone:t,icon:r,title:o,text:n,action:a})=>c("div",{className:"orb-omph-pv-notice","data-tone":t,role:t==="error"?"alert":void 0,children:[e("span",{className:"orb-omph-pv-notice-icon","aria-hidden":"true",children:r}),e("div",{className:"orb-omph-pv-notice-title",children:o}),n&&e("p",{className:"orb-omph-pv-notice-text",children:n}),a]}),tg=({state:t,placement:r,expanded:o,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:l,onRetry:d,onToggleExpand:u,onOpenExternally:p})=>{let[f,b]=er.useState(true),[m,v]=er.useState(false),{open:y,ref:g,phase:x,data:h}=t,C=h?.body;er.useEffect(()=>{if(!m)return;let O=window.setTimeout(()=>v(false),ix);return ()=>window.clearTimeout(O)},[m]),er.useEffect(()=>{y&&s.current?.focus({preventScroll:true});},[y,s,g?.path]);let k=h?.absolutePath??g?.path??"",w=C&&(C.kind==="markdown"||C.kind==="code")?C.text:k,T=w===k?a.previewCopyPath:a.previewCopyContent,I=C?.kind==="code"&&g?Xl(g.path,C.language):null,S=[];I&&S.push(I.label),C?.kind==="markdown"&&S.push("Markdown"),C?.kind==="image"&&g&&S.push(ql(g.path).toUpperCase()),h?.size!==void 0&&S.push(Qm(h.size)),C?.kind==="code"&&g?.startLine!==void 0&&S.push(a.previewLines(g.startLine,g.endLine??g.startLine));let A=O=>{O.key==="Escape"&&(O.stopPropagation(),l(true));},D=e("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),M=()=>{if(!g)return null;if(x==="loading")return e("div",{className:"orb-omph-pv-skel",role:"status","aria-label":a.previewLoading,children:Array.from({length:sx},(O,F)=>e("span",{},F))});if(x==="error"||!C)return e(Yl,{tone:"error",icon:e(Ta,{size:fo}),title:a.previewFailed,text:k,action:D});switch(C.kind){case "missing":return e(Yl,{tone:"neutral",icon:e(Da,{size:fo}),title:a.previewMissing,text:C.message??k});case "unsupported":return e(Yl,{tone:"neutral",icon:e(Da,{size:fo}),title:a.previewUnsupported,text:C.message??k,action:p&&e("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>p(g),children:a.previewOpenExternal})});case "markdown":return e(Km,{text:C.text},g.path);case "code":return e(Um,{text:C.text,language:Xl(g.path,C.language).prism,startLine:g.startLine,endLine:g.endLine,wrap:f,labels:a},g.path);case "image":return e(qm,{url:C.url,alt:C.alt,labels:a},C.url);case "embed":return e("iframe",{src:C.url,title:C.caption??"Embedded document",className:"orb-omph-pv-embed"},C.url);default:return null}},N=r==="overlay",E=C?.kind==="image"?Fc:Da;return c("aside",{ref:s,className:"orb-omph-preview","data-open":y||void 0,"data-placement":r,role:N?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!y||void 0,tabIndex:-1,onKeyDown:A,children:[!N&&y&&e("div",{className:"orb-omph-pv-grip","aria-label":a.previewResize,...i}),c("div",{className:"orb-omph-pv",children:[c("header",{className:"orb-omph-pv-head",children:[N&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:e(Ma,{size:fo})}),e("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:e(E,{size:fo})}),c("div",{className:"orb-omph-pv-titles",children:[e("div",{className:"orb-omph-pv-name",title:k,children:g?Kl(g.path):""}),e("div",{className:"orb-omph-pv-path",title:k,children:e("bdi",{children:Zm(k)})})]}),c("div",{className:"orb-omph-pv-actions",children:[C?.kind==="code"&&e("button",{type:"button",className:"orb-omph-text-button","aria-pressed":f,onClick:()=>b(O=>!O),children:a.previewWrap}),g&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":m?a.copied:T,title:m?a.copied:T,onClick:()=>{navigator.clipboard.writeText(w).then(()=>v(true));},children:m?e(qr,{size:fo}):e(vo,{size:fo})}),n&&e("button",{type:"button",className:"orb-omph-icon-button","aria-pressed":o,"aria-label":o?a.previewCollapse:a.previewExpand,title:o?a.previewCollapse:a.previewExpand,onClick:u,children:e(Ac,{size:fo})}),!N&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:e(jt,{size:fo})})]})]}),e("div",{className:"orb-omph-pv-meta",children:S.join(" \xB7 ")}),e("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?C?.kind:void 0,children:M()})]})]})};P();var cx=1e3,rg=50,dx=1e3,px=t=>t==="tool"?tn:t==="command"?Vn:$c,ng=t=>!!t.streaming||t.status==="running"||t.status==="pending",ux=(t,r)=>r==="expanded"?true:ng(t),mx=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),gx=(t,r)=>`${Math.max(1,Math.round(t/dx))}${r.secondUnit}`,fx=({content:t})=>{let r=er.useRef(null),[o,n]=er.useState(false);return er.useEffect(()=>{let a=r.current;if(!a)return;let i=()=>n(a.scrollHeight>a.clientHeight+1);i();let s=new ResizeObserver(i);return s.observe(a),()=>s.disconnect()},[t]),e("div",{ref:r,className:"orb-omph-process-body","data-overflow":o||void 0,children:t})},bx=({turn:t,labels:r})=>{let[o,n]=er.useState(false),[a,i]=er.useState(false),s=t.assistant?.content??"",l=t.usage;return er.useEffect(()=>{if(!o)return;let d=window.setTimeout(()=>n(false),cx);return ()=>window.clearTimeout(d)},[o]),c("div",{className:"orb-omph-turn-actions",role:"group","aria-label":r.turnActions,children:[e("span",{className:"orb-omph-actions-time",children:t.assistant?.timestamp.toLocaleTimeString()}),mx(l)&&c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-omph-actions-divider","aria-hidden":"true"}),e("button",{type:"button",className:"orb-omph-text-button","aria-expanded":a,onClick:()=>i(d=>!d),children:r.usage})]}),e("button",{type:"button",className:"orb-omph-icon-button orb-omph-actions-end","aria-label":o?r.copied:r.copy,onClick:()=>{navigator.clipboard.writeText(s).then(()=>n(true));},children:o?e(qr,{size:14}):e(vo,{size:14})}),a&&l&&c("div",{className:"orb-omph-usage",children:[l.inputTokens!==void 0&&c("span",{children:[r.inputTokens," ",l.inputTokens.toLocaleString()]}),l.outputTokens!==void 0&&c("span",{children:[r.outputTokens," ",l.outputTokens.toLocaleString()]}),l.durationMs!==void 0&&c("span",{children:[r.duration," ",gx(l.durationMs,r)]})]})]})},hx=({item:t,display:r,open:o,onToggle:n})=>{let a=px(t.kind),i=ng(t),s=r!=="compact"&&!!t.summary,l=o&&!!t.content;return c("div",{className:"orb-omph-process","data-status":t.status,"data-open":o||void 0,children:[c("button",{type:"button",className:"orb-omph-process-toggle","aria-expanded":o,onClick:n,children:[e(Fr,{size:12,className:"orb-omph-process-chevron"}),e(a,{size:14}),e("span",{className:i?"orb-omph-shimmer":void 0,children:t.title}),s&&e("span",{className:"orb-omph-process-summary",children:t.summary})]}),l&&t.content&&e(fx,{content:t.content}),o&&t.streaming&&e("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},Zl=t=>{let r=t.user?.content||t.assistant?.content||t.id,o=r.split(`
202
- `).find(n=>n.trim())??r;return o.length>rg?`${o.slice(0,rg)}\u2026`:o},vx=0,ag=({turns:t,labels:r,processDisplay:o,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=er.useState({}),d=u=>{if(!i||u.defaultPrevented||u.button!==vx||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey)return;let p=u.target.closest("a[href]");if(!p)return;let f=a(p.getAttribute("href")??"");f&&(u.preventDefault(),i(f,p));};return e(jsxRuntime.Fragment,{children:t.map((u,p)=>{let f=!!(u.assistant&&!u.assistant.streaming),m=p===t.length-1&&f?"always":"hover";return c("article",{className:"orb-omph-turn","data-omph-turn":u.id,"data-actions-reveal":m,children:[u.user&&c("div",{className:"orb-omph-user",children:[e("div",{className:"orb-omph-user-bubble",children:u.user.content}),e("div",{className:"orb-omph-clock",children:u.user.timestamp.toLocaleTimeString()})]}),u.process&&u.process.length>0&&e("div",{className:"orb-omph-process-list",children:u.process.map(v=>{let y=v.id in s?s[v.id]:ux(v,o);return e(hx,{item:v,display:o,open:y,onToggle:()=>l(g=>({...g,[v.id]:!y}))},v.id)})}),u.assistant&&c("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[e(vs,{content:u.assistant.content,messageId:u.assistant.id,cardHooks:n}),u.assistant.streaming&&e("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),u.failure&&e("div",{className:"orb-omph-failure","data-severity":u.failure.severity,children:u.failure.content}),f&&e(bx,{turn:u,labels:r})]},u.id)})})};var yx={idle:"Idle",pending:"Pending",running:"Working",success:"Success",error:"Error",working:"Working",workingFor:t=>`Working for ${t}`,loadOlder:"Load earlier",loadingOlder:"Loading earlier\u2026",toBottom:"Back to bottom",copy:"Copy",copied:"Copied",turnActions:"Reply actions",usage:"Usage",inputTokens:"Input",outputTokens:"Output",duration:"Duration",send:"Send",stop:"Stop",turnRail:"Turns",secondUnit:"s",minuteUnit:"m",previewTitle:"File preview",previewClose:"Close preview",previewBack:"Back to conversation",previewExpand:"Expand preview",previewCollapse:"Restore preview size",previewCopyContent:"Copy content",previewCopyPath:"Copy path",previewOpenExternal:"Open externally",previewWrap:"Wrap",previewLoading:"Loading file",previewMissing:"File not found",previewFailed:"Could not load this file",previewUnsupported:"No preview for this file type",previewRetry:"Try again",previewResize:"Resize preview",previewLines:(t,r)=>t===r?`Line ${t}`:`Lines ${t}\u2013${r}`,previewTruncated:(t,r)=>`Showing the first ${t.toLocaleString()} of ${r.toLocaleString()} lines`,imageFailed:"The image could not be displayed",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomFit:"Fit to width",newConversation:"New conversation",conversationList:"Conversation list",conversations:"Conversations",noConversations:"No conversations yet"},sg=t=>({...yx,...t}),Cx={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`},lg=t=>({...Cx,...t}),xx=1e3,ig=60,Sx=1e3,cg=(t,r)=>{let o=Math.max(1,Math.round(Math.max(t,Sx)/xx)),n=Math.floor(o/ig),a=o%ig;return n<=0?`${o}${r.secondUnit}`:`${n}${r.minuteUnit} ${a}${r.secondUnit}`};var Px={open:false,ref:null,phase:"loading",data:null},dg=t=>{let[r,o]=er.useState(Px),n=er.useRef(r);n.current=r;let a=er.useRef(t);a.current=t;let i=er.useRef(null),s=er.useRef(0),l=er.useRef(null),d=er.useCallback(b=>{let m=a.current;if(!m)return;i.current?.abort();let v=new AbortController;i.current=v,s.current+=1;let y=s.current;o({open:true,ref:b,phase:"loading",data:null}),m(b,v.signal).then(g=>{y===s.current&&o(x=>({...x,phase:"ready",data:g}));},()=>{y!==s.current||v.signal.aborted||o(g=>({...g,phase:"error",data:null}));});},[]),u=er.useCallback((b,m)=>{l.current=m??null;let v=n.current;if(v.ref?.path===b.path&&v.phase==="ready"){o({...v,open:true,ref:b});return}d(b);},[d]),p=er.useCallback((b=false)=>{s.current+=1,i.current?.abort(),o(v=>({...v,open:false}));let m=l.current;b&&m?.isConnected&&m.focus({preventScroll:true});},[]),f=er.useCallback(()=>{let{ref:b}=n.current;b&&d(b);},[d]);return er.useEffect(()=>()=>{i.current?.abort();},[]),{state:r,open:u,close:p,reload:f}};var Ql="--orb-omph-pv-w",Jl="--orb-omph-pv-pref",Mx=880,Rx=560,ug=400,Go=320,Dx=.45,Nx=.7,mg=24,jl=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),gg=({open:t,layout:r})=>{let o=er.useRef(null),n=er.useRef(null),[a,i]=er.useState(0),[s,l]=er.useState(null),[d,u]=er.useState(false),[p,f]=er.useState(false);er.useLayoutEffect(()=>{let T=o.current;if(!T)return;let I=()=>i(T.getBoundingClientRect().width);I();let S=new ResizeObserver(I);return S.observe(T),()=>S.disconnect()},[]),er.useEffect(()=>{t||u(false);},[t]);let b=r==="overlay"?false:r==="split"?a>=ug+Go:a>=Mx,m=b&&!d?"split":"overlay",v=Math.max(Go,Math.min(a*Nx,a-ug)),y=jl(s??a*Dx,Go,v),g=a>0&&a<Rx,x=er.useCallback(T=>{let I=o.current;I&&(I.style.setProperty(Jl,`${T}px`),I.dataset.placement==="split"&&I.dataset.open==="true"&&I.style.setProperty(Ql,`${T}px`));},[]),h=er.useCallback(T=>{T.button===0&&(T.preventDefault(),T.currentTarget.setPointerCapture(T.pointerId),n.current={pointerId:T.pointerId,startX:T.clientX,startWidth:y,latest:y},f(true));},[y]),C=er.useCallback(T=>{let I=n.current;!I||I.pointerId!==T.pointerId||(I.latest=jl(I.startWidth+(I.startX-T.clientX),Go,v),x(I.latest));},[v,x]),k=er.useCallback(T=>{let I=n.current;!I||I.pointerId!==T.pointerId||(n.current=null,T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId),l(I.latest),f(false));},[]),w=er.useCallback(T=>{let I={ArrowLeft:y+mg,ArrowRight:y-mg,Home:Go,End:v};T.key in I&&(T.preventDefault(),l(jl(I[T.key],Go,v)));},[v,y]);return {mainRef:o,placement:m,width:y,compact:g,dragging:p,expanded:d,canExpand:b,toggleExpanded:()=>u(T=>!T),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":Go,"aria-valuemax":Math.round(v),"aria-valuenow":Math.round(y),tabIndex:0,onPointerDown:h,onPointerMove:C,onPointerUp:k,onPointerCancel:k,onKeyDown:w}}};var Ps=48,Ex=900,bg=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,hg=({turns:t,contentVersion:r,hasOlder:o=false,loadingOlder:n=false,onLoadOlder:a})=>{let i=er.useRef(null),s=er.useRef(null),l=er.useRef(true),d=er.useRef({height:0,top:0}),u=er.useRef(void 0),p=er.useRef(false),[f,b]=er.useState(true),[m,v]=er.useState(false),[y,g]=er.useState(t[0]?.id),x=er.useCallback(()=>{let T=i.current;T&&(d.current={height:T.scrollHeight,top:T.scrollTop});},[]),h=er.useCallback(()=>{let T=i.current;if(!T)return;let I=T.getBoundingClientRect().top,S=T.querySelector("[data-omph-turn]")?.dataset.omphTurn;T.querySelectorAll("[data-omph-turn]").forEach(A=>{A.getBoundingClientRect().top-I<=Ps&&(S=A.dataset.omphTurn);}),g(S);},[]);er.useEffect(()=>{let T=i.current,I=s.current;if(!T||!I)return;let S=()=>{v(T.clientWidth>Ex),l.current&&(T.scrollTop=T.scrollHeight),x();};S();let A=new ResizeObserver(S);return A.observe(T),A.observe(I),()=>A.disconnect()},[x]),er.useLayoutEffect(()=>{let T=i.current;if(!T)return;let I=t[0]?.id,S=u.current,A=S!==void 0&&t.some(N=>N.id===S),D=A&&I!==void 0&&I!==S,M=S!==void 0&&!A;if(u.current=I,M){l.current=true,b(true),T.scrollTop=T.scrollHeight,x(),h();return}if(D){l.current=false,b(false);let N=T.scrollHeight-d.current.height;T.scrollTop=d.current.top+Math.max(0,N),x(),h();return}l.current&&(T.scrollTop=T.scrollHeight),x(),h();},[r,x,t,h]),er.useEffect(()=>{n||(p.current=false);},[n]);let C=er.useCallback(()=>{let T=i.current;if(!T)return;let S=T.scrollHeight-T.scrollTop-T.clientHeight<=Ps;S!==l.current&&(l.current=S,b(S)),x(),h();let A=T.scrollHeight-T.clientHeight>Ps,D=T.scrollTop<=Ps;!A||!D||S||!o||n||!a||p.current||(p.current=true,a());},[o,n,a,x,h]),k=er.useCallback(()=>{let T=i.current;T&&(l.current=true,b(true),T.scrollTo({top:T.scrollHeight,behavior:bg()?"auto":"smooth"}));},[]),w=er.useCallback(T=>{let S=i.current?.querySelector(`[data-omph-turn="${CSS.escape(T)}"]`);S&&(l.current=false,b(false),S.scrollIntoView({block:"start",behavior:bg()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:f,railVisible:m,activeTurnId:y,onScroll:C,returnToBottom:k,scrollToTurn:w}};P();var Ox=1e3,Fx=(t,r)=>r[t],Bx=t=>t.map(r=>[r.id,r.user?.content.length??0,r.assistant?.content.length??0,r.assistant?.streaming?"1":"0",r.failure?.id??"",(r.process??[]).map(o=>`${o.id}:${o.status}:${o.content?.length??0}`).join(",")].join(":")).join("|"),Hx=({startedAt:t,labels:r})=>{let[o,n]=er.useState(()=>Date.now());er.useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),Ox);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?r.working:r.workingFor(cg(Math.max(0,o-t),r));return c("div",{className:"orb-omph-running","data-omph-running":"true",children:[e("span",{className:"orb-visually-hidden",role:"status","aria-live":"polite",children:r.working}),e("span",{className:"orb-omph-running-rule","aria-hidden":"true"}),c("span",{className:"orb-omph-running-body",children:[e("span",{className:"orb-omph-spinner","aria-hidden":"true"}),e("span",{className:"orb-omph-shimmer",children:a})]})]})},wz=({turns:t,title:r="OMPH Agent",description:o,headerActions:n,agentStatus:a,isResponding:i=false,labels:s,processDisplay:l="standard",showInput:d=false,placeholder:u,className:p,cardHooks:f,hasOlder:b=false,loadingOlder:m=false,onLoadOlder:v,onSend:y,onStop:g,onHeaderPointerDown:x,conversations:h=[],activeConversationId:C,onNewConversation:k,onSelectConversation:w,loadFilePreview:T,resolveFileLink:I=Ul,filePreviewLayout:S="auto",onOpenFileExternally:A})=>{let D=sg(s),M=a??(i?"running":"idle"),N=M==="running"||M==="pending",E=[Fx(M,D),o].filter(Boolean).join(" \xB7 "),O=er.useMemo(()=>Bx(t),[t]),F=hg({turns:t,contentVersion:O,hasOlder:b,loadingOlder:m,onLoadOlder:v}),[X,H]=er.useState(""),Y=X.trim(),W=i&&Y.length===0,j=[...t].reverse().find(le=>!!le.assistant?.streaming||le.process?.some(Ee=>Ee.streaming||Ee.status==="running"||Ee.status==="pending")),V=N?j?.startedAt:void 0,z=!!T,U=dg(T),K=gg({open:U.state.open,layout:S}),fe=er.useRef(null),se=er.useRef(null),ue=z&&U.state.open&&K.placement==="overlay",Se=K.placement==="split"&&U.state.open,$e={[Jl]:`${K.width}px`,[Ql]:Se?`${K.width}px`:"0px"};er.useEffect(()=>{se.current?.toggleAttribute("inert",ue);},[ue]);let ke=async()=>{if(!Y||!y)return;let le=Y;H("");try{await y(le);}catch{H(Ee=>Ee.trim().length===0?le:Ee);}};return c("div",{className:ut("orb-omph-panel",p),"data-omph-panel":"","data-status":M,"data-compact":K.compact||void 0,children:[c("div",{className:ut("orb-omph-header",x&&"cursor-grab active:cursor-grabbing"),onPointerDown:x,children:[e("span",{className:"orb-omph-avatar","aria-hidden":"true",children:"AI"}),c("div",{className:"min-w-0 flex-1",children:[e("div",{className:"orb-omph-title",children:r}),c("div",{className:"orb-omph-subtitle",children:[e("span",{className:"orb-omph-dot","data-active":N||void 0}),e("span",{className:"truncate",children:E||D.idle})]})]}),(k||w||n)&&c("div",{className:"orb-omph-header-actions",onPointerDown:le=>le.stopPropagation(),children:[e(_m,{conversations:h,activeConversationId:C,labels:D,onNewConversation:k,onSelectConversation:w}),n]})]}),c("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:$e,children:[c("div",{ref:se,className:"orb-omph-center",children:[c("div",{className:"orb-omph-stage","data-rail":F.railVisible||void 0,children:[e("div",{ref:F.scrollerRef,className:"orb-omph-scroll",onScroll:F.onScroll,children:c("div",{ref:F.contentRef,className:"orb-omph-column",children:[b&&v&&e("button",{type:"button",className:"orb-omph-older",disabled:m,onClick:v,children:m?D.loadingOlder:D.loadOlder}),e(ag,{turns:t,labels:D,processDisplay:l,cardHooks:f,resolveFileLink:I,onOpenFile:z?U.open:void 0}),N&&e(Hx,{startedAt:V,labels:D})]})}),F.railVisible&&t.length>0&&e("nav",{className:"orb-omph-rail","aria-label":D.turnRail,children:t.map(le=>e("button",{type:"button",className:"orb-omph-rail-mark","data-active":F.activeTurnId===le.id||void 0,"aria-label":Zl(le),title:Zl(le),onClick:()=>F.scrollToTurn(le.id)},le.id))}),!F.following&&e("button",{type:"button",className:"orb-omph-to-bottom","aria-label":D.toBottom,onClick:F.returnToBottom,children:e(Fr,{size:16})})]}),d&&c("form",{className:"orb-omph-composer",onSubmit:le=>{le.preventDefault(),W?g?.():ke();},children:[e("textarea",{className:"orb-omph-input",value:X,placeholder:u,rows:1,onChange:le=>H(le.target.value),onKeyDown:le=>{le.key!=="Enter"||le.shiftKey||le.nativeEvent.isComposing||(le.preventDefault(),W?g?.():ke());}}),e("button",{type:"submit",className:W?"orb-omph-stop":"orb-omph-send","aria-label":W?D.stop:D.send,disabled:!W&&Y.length===0,children:W?e(Mc,{size:16}):e(Ic,{size:16})})]})]}),z&&e(tg,{state:U.state,placement:K.placement,expanded:K.expanded,canExpand:K.canExpand,labels:D,gripProps:K.gripProps,paneRef:fe,onClose:U.close,onRetry:U.reload,onToggleExpand:K.toggleExpanded,onOpenExternally:A})]})]})};P();var bo="other",zx=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,Vx=({request:t,onDecide:r,labels:o})=>{let n=lg(o),a=er.useRef(null),i=er.useRef(null),s=er.useRef(false),l=er.useRef(false),[d,u]=er.useState(false),[p,f]=er.useState(null),[b,m]=er.useState(""),v=t.choices??[],y=t.allowOther??v.length>0,g=v.length>0||y,x=t.reason?.trim()||n.escalation(t.toolName),h=t.detail?.trim(),C=p===bo&&b.trim().length>0,k=!g||p!==null&&p!==bo||C;er.useEffect(()=>{u(false),f(null),m(""),a.current?.focus();},[t.id]),er.useEffect(()=>{p===bo&&i.current?.focus();},[p]);let w=S=>{d||(u(true),r(S,t));},T=()=>{if(k){if(!g){w({kind:"allowed-once"});return}if(p===bo){let S=b.trim();if(!S)return;w({kind:"other",text:S});return}p&&w({kind:"choice",choiceId:p});}},I=S=>{if(!(d||zx(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}T();}};return e("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:c("div",{className:"orb-omph-approval-card",children:[c("div",{className:"orb-omph-approval-strip",children:[e("span",{className:"orb-omph-approval-dot","aria-hidden":"true"}),g?n.choose:n.waiting]}),c("div",{ref:a,className:"orb-omph-approval-body",tabIndex:0,role:"group","aria-label":n.details,children:[e("div",{className:"orb-omph-approval-headline",children:x}),h&&e("div",{className:"orb-omph-approval-detail",children:h}),g&&c("fieldset",{className:"orb-omph-approval-choices",disabled:d,children:[e("legend",{className:"orb-visually-hidden",children:n.choices}),v.map(S=>{let A=p===S.id;return c("label",{className:"orb-omph-approval-choice","data-selected":A,children:[e("input",{type:"radio",name:`omph-approval-${t.id}`,value:S.id,checked:A,onChange:()=>f(S.id)}),c("span",{className:"orb-omph-approval-choice-copy",children:[e("span",{children:S.label}),S.description&&e("span",{className:"orb-omph-approval-choice-description",children:S.description})]})]},S.id)}),y&&c("label",{className:"orb-omph-approval-choice","data-selected":p===bo,children:[e("input",{type:"radio",name:`omph-approval-${t.id}`,value:bo,checked:p===bo,onChange:()=>f(bo)}),e("span",{className:"orb-omph-approval-choice-copy",children:e("span",{children:n.other})})]}),y&&p===bo&&e("textarea",{ref:i,className:"orb-omph-approval-other",value:b,placeholder:n.otherPlaceholder,rows:3,"aria-label":n.other,onChange:S=>m(S.target.value)})]})]}),c("div",{className:"orb-omph-approval-actions",children:[e("button",{type:"button",className:"orb-btn orb-btn-neutral orb-omph-approval-reject",disabled:d,onClick:()=>w({kind:"rejected"}),children:n.reject}),e("button",{type:"button",className:"orb-btn orb-btn-primary",disabled:d||!k,onClick:T,children:g?n.confirm:n.allowOnce})]})]})})};P();var kg=520,_x=88,Gx=88,Ux=24,Is=640,Pg=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),rc=t=>typeof t=="number"?`${t}px`:t,Kx=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,Lz=({anchor:t,defaultAnchor:r="right",onAnchorChange:o,width:n=kg,top:a=_x,bottom:i=Gx,inset:s=Ux,zIndex:l=1300,shellClassName:d,shellStyle:u,className:p,onHeaderPointerDown:f,...b})=>{let m=er.useRef(null),v=er.useRef(null),[y,g]=er.useState(r),[x,h]=er.useState(0),[C,k]=er.useState(typeof n=="number"?n:kg),[w,T]=er.useState(0),[I,S]=er.useState(false),A=t??y;er.useEffect(()=>{let H=()=>h(window.innerWidth);return H(),window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[]),er.useLayoutEffect(()=>{let H=()=>{let W=m.current?.getBoundingClientRect();W?.width?k(W.width):typeof n=="number"&&k(n);};if(H(),!m.current||typeof ResizeObserver>"u")return;let Y=new ResizeObserver(H);return Y.observe(m.current),()=>Y.disconnect()},[n]);let D=er.useCallback(H=>{if(!x)return s;let Y=x<Is?12:s,W=Math.max(Y,x-C-Y);return x<Is||H==="left"?Y:H==="center"?Pg((x-C)/2,Y,W):W},[s,C,x]),M=er.useCallback(H=>["left","center","right"].reduce((W,j)=>{let V=Math.abs(H-D(W));return Math.abs(H-D(j))<V?j:W},"right"),[D]),N=er.useCallback(H=>{t===void 0&&g(H),o?.(H);},[t,o]);er.useEffect(()=>{I||T(D(A));},[D,I,A]);let E=er.useCallback(H=>{f?.(H),!(H.defaultPrevented||Kx(H.target))&&(H.preventDefault(),H.currentTarget.setPointerCapture(H.pointerId),v.current={pointerId:H.pointerId,startClientX:H.clientX,startX:w,currentX:w,captureElement:H.currentTarget},S(true));},[f,w]),O=er.useCallback(H=>{let Y=v.current;if(!Y||Y.pointerId!==H.pointerId)return;let W=x<Is?12:s,j=Math.max(W,x-C-W),V=Pg(Y.startX+H.clientX-Y.startClientX,W,j);Y.currentX=V,T(V);},[s,C,x]),F=er.useCallback(H=>{let Y=v.current;if(!Y||Y.pointerId!==H.pointerId)return;try{Y.captureElement.releasePointerCapture(H.pointerId);}catch{}let W=M(Y.currentX);v.current=null,S(false),N(W),T(D(W));},[D,N,M]),X=er.useMemo(()=>({position:"fixed",top:rc(a),bottom:rc(i),left:w,width:rc(n),maxWidth:`calc(100vw - ${x<Is?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 e("div",{ref:m,className:ut("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":A,"data-dragging":I?"true":"false",style:X,onPointerMove:O,onPointerUp:F,onPointerCancel:F,children:e(Wm,{...b,className:p,onHeaderPointerDown:E})})};P();var Yx={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},$z=({messages:t,onSend:r,onRegenerate:o,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:l="bottom-right",onCollapse:d,onHeaderPointerDown:u,onPlusClick:p,onMicClick:f,streamIntervalMs:b,streamChunkSize:m,onMessageStreamingComplete:v,cardHooks:y})=>{let[g,x]=er.useState(""),[h,C]=er.useState(false),k=er.useRef(null),w=Yx[l];er.useEffect(()=>{k.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let T=er.useCallback(async()=>{let S=g.trim();!S||n||(x(""),await r(S));},[n,r,g]),I=er.useCallback(async S=>{S.key==="Enter"&&!h&&(S.preventDefault(),await T());},[T,h]);return c("div",{className:ut("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-none dark:bg-[var(--orb-surface-2)]",a),children:[d&&e("button",{onClick:d,className:ut("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",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:e("span",{className:ut("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]")})}),c("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:u,children:[e("div",{className:"flex items-center",children:e("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),e("div",{})]}),c("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,A)=>{let D=S.type==="assistant"&&A===t.length-1,M=S.type==="assistant"?{isLatestAssistant:D,isResponding:n,onRegenerate:o?()=>o(S.id):void 0}:void 0;return e(ys,{message:S,assistantActions:M,onStreamingComplete:()=>v?.(S.id),streamIntervalMs:b,streamChunkSize:m,cardHooks:y},S.id)}),e("div",{ref:k})]}),e("div",{className:"border-t border-[var(--orb-border)] px-3 py-3",children:c("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:[e("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:p,type:"button","aria-label":"Add",children:e(en,{className:"h-4 w-4"})}),e("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,onChange:S=>x(S.target.value),onCompositionStart:()=>C(true),onCompositionEnd:()=>C(false),onKeyDown:I,"aria-label":"Copilot input",spellCheck:false}),e("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,type:"button","aria-label":"Microphone",children:e(La,{className:"h-4 w-4"})})]})})]})};P();var Zx=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],jx=`
189
+ `),h={enableMath:n},u=0;for(;u<f.length;){let v=f[u],y=v.trim();if(!y){u+=1;continue}if(i&&vu(v)){if(y.startsWith("<think>")){let b=[],C=v;for(;;){let k=C.indexOf("<think>"),S=k>=0?C.slice(k+7):C,T=S.indexOf("</think>");if(T>=0){b.push(S.slice(0,T)),u+=1;break}if(b.push(S),u+=1,u>=f.length)break;C=f[u];}m.push(e(Vi,{content:b.join(`
190
+ `).trim()},`think-tag-${u}`));continue}u+=1;let x=[];for(;u<f.length&&f[u].trim()!==":::";)x.push(f[u]),u+=1;u<f.length&&f[u].trim()===":::"&&(u+=1),m.push(e(Vi,{content:x.join(`
191
+ `).trim()},`think-fence-${u}`));continue}if(Wi(v)){let x=y.slice(3).trim().toLowerCase(),b=[];for(u+=1;u<f.length&&!Wi(f[u]);)b.push(f[u]),u+=1;u<f.length&&Wi(f[u])&&(u+=1);let C=b.join(`
192
+ `);if(a&&x==="mermaid"){m.push(e(hl,{code:C},`mermaid-${u}`));continue}if(n&&["math","latex","katex"].includes(x)){m.push(e(da,{expression:C,allowKatex:true},`math-fence-${u}`));continue}m.push(e(ca,{code:C,language:x||"text",copyable:s,showLineNumbers:l,wrapLongLines:true},`code-${u}`));continue}if(n&&y.startsWith("$$")){let x=[];if(y.endsWith("$$")&&y!=="$$")x.push(y.slice(2,-2)),u+=1;else {let C=v.slice(v.indexOf("$$")+2);for(C.trim()&&x.push(C),u+=1;u<f.length;){let k=f[u],S=k.indexOf("$$");if(S>=0){x.push(k.slice(0,S)),u+=1;break}x.push(k),u+=1;}}m.push(e(da,{expression:x.join(`
193
+ `).trim(),allowKatex:true},`math-${u}`));continue}if(fu(v)){let x=Math.min(6,v.match(/^#{1,6}/)?.[0]?.length||1),b=v.replace(/^#{1,6}\s+/,""),C=x===1?"h5":x===2?"h6":"subtitle1";m.push(e(yo,{variant:C,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:pa(b,h,`h-${u}`)},`heading-${u}`)),u+=1;continue}if(hu(v)){m.push(e(Dd,{sx:{my:1.2}},`hr-${u}`)),u+=1;continue}if(bu(f,u)){let x=u+2;for(;x<f.length&&f[x].trim()&&f[x].includes("|");)x+=1;let b=f.slice(u,x).join(`
194
+ `),C=zi(b);if(C){m.push(e(vl,{table:C},`table-${u}`)),u=x;continue}}if(wl(v)){let x=[];for(;u<f.length&&wl(f[u]);)x.push(f[u].replace(/^\s*>\s?/,"")),u+=1;m.push(e(Br,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:e(yo,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((b,C)=>c(eo.Fragment,{children:[C>0&&e("br",{}),pa(b,h,`q-${u}-${C}`)]},`quote-line-${C}`))})},`quote-${u}`));continue}if(Cl(v)){let x=[];for(;u<f.length&&Cl(f[u]);)x.push(f[u].trim().replace(/^[-*+]\s+/,"")),u+=1;m.push(e(Re,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((b,C)=>e(Re,{component:"li",sx:{mb:.45},children:e(yo,{variant:"body2",children:pa(b,h,`ul-${u}-${C}`)})},`ul-item-${C}`))},`ul-${u}`));continue}if(xl(v)){let x=[];for(;u<f.length&&xl(f[u]);)x.push(f[u].trim().replace(/^\d+\.\s+/,"")),u+=1;m.push(e(Re,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((b,C)=>e(Re,{component:"li",sx:{mb:.45},children:e(yo,{variant:"body2",children:pa(b,h,`ol-${u}-${C}`)})},`ol-item-${C}`))},`ol-${u}`));continue}let g=[];for(;u<f.length;){let x=f[u],b=x.trim();if(!b||Wi(x)||fu(x)||hu(x)||Cl(x)||xl(x)||wl(x)||bu(f,u)||i&&vu(x)||n&&b.startsWith("$$"))break;g.push(x),u+=1;}g.length>0?m.push(e(yo,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g.map((x,b)=>c(eo.Fragment,{children:[b>0&&e("br",{}),pa(x,h,`p-${u}-${b}`)]},`p-line-${b}`))},`p-${u}`)):u+=1;}return m},[d,n,a,i,s,l]);return e(Re,{className:r,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:p})};P();var pA=(t,o)=>e(ua,{markdown:t,...o});P();var yu=({value:t,onChange:o,onSubmit:r,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:l=false,compact:d=false,showStatusText:p=true})=>c(se,{spacing:.75,children:[c("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:[e(zr,{sx:{fontSize:d?16:18,color:"text.secondary"}}),e(Bd,{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&&e(ie,{size:"small",onClick:a,children:e(Sr,{sx:{fontSize:d?16:18}})}),n&&e(ie,{size:"small",onClick:n,children:e(mp,{sx:{fontSize:d?16:18}})}),e(ie,{size:"small",onClick:r,disabled:l||!t.trim(),children:e(vp,{sx:{fontSize:d?16:18}})})]}),p&&s&&e(L,{variant:"caption",color:"text.secondary",children:s})]});P();var Cu=(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:c(jsxRuntime.Fragment,{children:[t.slice(0,i),e("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)]})},$i=({section:t,highlightQuery:o=""})=>{let r=t.columns||2;return c(Ae,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[e(L,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:t.title}),e("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 c("div",{sx:{minWidth:0},children:[e(L,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:Cu(n.label,o)}),e(L,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?Cu(a,o):n.value})]},n.id)})})]})};var Sl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",Gi=t=>t.trim().toLowerCase(),gv=(t,o)=>{let r=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||Sl(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:Gi(`${n.title} ${a.label} ${i}`)});});}),o.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||Sl(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Gi(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||Sl(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:Gi(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),r},xu=({sections:t,tabs:o=[],defaultTabId:r,ai:n})=>{let{t:a}=le(),[i,s]=eo.useState(""),[l,d]=eo.useState(r||o[0]?.id),[p,m]=eo.useState("idle"),[f,h]=eo.useState([]),[u,v]=eo.useState(""),[y,g]=eo.useState(""),[x,b]=eo.useState(false),C=eo.useMemo(()=>gv(t,o),[t,o]);eo.useEffect(()=>{if(o.length===0){d(void 0);return}o.some(M=>M.id===l)||d(r||o[0]?.id);},[o,l,r]);let k=eo.useCallback(()=>{m("idle"),h([]),v(""),g("");},[]),S=eo.useCallback(w=>{s(w),w.trim()||(m("idle"),h([]),v(""),g(""));},[]),T=eo.useCallback(w=>{let M=Gi(w);return M?C.filter(A=>A.text.includes(M)).map(A=>A.hit):[]},[C]),I=eo.useCallback(async()=>{let w=i.trim();if(!w)return;b(true);let M=T(w);if(h(M),M.length>0){m("search"),g(""),v(a("detail.searchAi.matches",{count:M.length})),b(false);return}if(n?.enabled!==false&&n?.onSubmit){m("ai"),v(a("detail.searchAi.autoAiFallback"));try{let R=await n.onSubmit(w,{query:w,hits:M,activeTabId:l,sections:t,tabs:o});g(typeof R=="string"?R:"");}finally{b(false);}return}m("search"),g(""),v(a("detail.searchAi.noMatch")),b(false);},[i,T,a,n,l,t,o]);return {query:i,setQuery:S,activeTabId:l,setActiveTabId:d,searchMode:p,hits:f,statusText:u,aiResponse:y,searching:x,handleSubmit:I,clearResult:k}};P();var zA=({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:f}=le(),{query:h,setQuery:u,activeTabId:v,setActiveTabId:y,searchMode:g,hits:x,statusText:b,aiResponse:C,searching:k,handleSubmit:S,clearResult:T}=xu({sections:r,tabs:n,defaultTabId:a,ai:s}),I=eo.useMemo(()=>n.find(A=>A.id===v)||n[0],[n,v]),w=eo.useCallback(A=>{let R=D=>{let E=document.getElementById(A);if(E){E.scrollIntoView({behavior:"smooth",block:"center"});return}D<4&&setTimeout(()=>R(D+1),60);};requestAnimationFrame(()=>R(0));},[]),M=eo.useCallback((A,R)=>{if(n.some(D=>D.id===A)){y(A),w(R?`detail-tab-${A}-section-${R}`:`detail-tab-${A}`);return}w(`detail-section-${A}`);},[n,y,w]);return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[c(se,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[c("div",{sx:{minWidth:0},children:[e(L,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),o&&e(L,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:o})]}),c(se,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[e("div",{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:e(yu,{value:h,onChange:u,onSubmit:S,onVoiceInput:s?.onVoiceInput,onClear:()=>{u(""),T();},placeholder:s?.placeholder||f("detail.searchAi.placeholder"),statusText:b,loading:k,compact:true,showStatusText:false})}),p&&e(ct,{title:m,children:e(ie,{size:"small",onClick:p,children:e(op,{fontSize:"small"})})}),l]})]}),b&&e(L,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:b}),g==="search"&&x.length>0&&c(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[e(L,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:f("detail.searchAi.matches",{count:x.length})}),e(se,{spacing:.35,children:x.slice(0,8).map(A=>e("div",{component:"button",type:"button",onClick:()=>M(A.sourceId,A.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:c(L,{variant:"body2",sx:{fontSize:"0.84rem"},children:[e("div",{component:"span",sx:{color:"text.secondary"},children:A.sourceTitle})," \xB7 ",e("div",{component:"span",sx:{fontWeight:700},children:A.fieldLabel})," = ",e("div",{component:"span",children:A.fieldValue||"-"})]})},`${A.source}|${A.sourceId}|${A.fieldId}`))})]}),g==="ai"&&C&&c(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[e(L,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:f("detail.searchAi.aiResultTitle")}),e("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:e(ua,{markdown:C})})]}),e("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:r.map(A=>e("div",{id:`detail-section-${A.id}`,children:e($i,{section:A,highlightQuery:h})},A.id))}),n.length>0&&c(Ae,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[e($d,{value:I?.id||false,onChange:(A,R)=>y(String(R)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(A=>e(_d,{value:A.id,label:A.label,sx:{textTransform:"none"}},A.id))}),c("div",{sx:{p:1.5},children:[e("div",{id:`detail-tab-${I?.id||""}`}),I?.description&&e(L,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:I.description}),I?.content?I.content:c(se,{spacing:1.5,children:[(I?.sections||[]).map(A=>e("div",{id:`detail-tab-${I?.id}-section-${A.id}`,children:e($i,{section:A,highlightQuery:h})},A.id)),I?.fields&&I.fields.length>0&&e($i,{section:{id:`${I.id}-fields`,title:I.label,fields:I.fields,columns:2},highlightQuery:h})]})]})]}),i&&e(tr,{title:i.title||f("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};P();var ku=({bucket:t,cardCount:o,highlighted:r=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:l,renameLabel:d,sx:p})=>{let{t:m}=le(),[f,h]=eo.useState(false),[u,v]=eo.useState(t.title),y=()=>{v(t.title),h(false);},g=x=>{x.preventDefault();let b=u.trim();b&&(b!==t.title&&l?.(b),v(b),h(false));};return e(Ae,{elevation:0,sx:[x=>{let b=t.accentColor??x.palette.primary.main;return {position:"relative",display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:i??s??560,maxHeight:s,borderRadius:"var(--orb-r-container)",overflow:"hidden",border:r?`1px solid ${ot(b,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:r?`0 0 0 2px ${ot(b,.16)}, var(--orb-shadow-2)`:"none",transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",flexShrink:0,height:3,bgcolor:b}}},...Array.isArray(p)?p:p?[p]:[]],children:c(se,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[c(Re,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[e(Re,{sx:{minWidth:0,flex:1},children:c(Re,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&e(Re,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),f?c(Re,{component:"form",onSubmit:g,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[e(ze,{dense:true,autoFocus:true,value:u,onChange:x=>v(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),y());},inputProps:{"aria-label":d??m("kanban.bucket.rename")},error:!u.trim(),sx:{flex:1,minWidth:0}}),e(ie,{type:"submit",size:"small",tooltip:m("kanban.bucket.saveRename"),"aria-label":m("kanban.bucket.saveRename"),disabled:!u.trim(),children:e(Ao,{size:14})}),e(ie,{size:"small",tooltip:m("kanban.bucket.cancelRename"),"aria-label":m("kanban.bucket.cancelRename"),onClick:y,children:e(qt,{size:14})})]}):e(L,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!f&&c(se,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[e(xt,{size:"small",label:o,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&e(xt,{size:"small",label:`${m("kanban.bucket.limit")} ${t.limit}`,color:o>t.limit?"warning":"default",variant:"outlined"}),l&&e(ie,{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:e(Wc,{size:14})})]})]}),r&&e(L,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:m("kanban.bucket.dropHere")}),e(Re,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:o>0?n:e(Re,{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:e(L,{sx:{fontSize:13,color:"text.secondary"},children:a??t.emptyLabel??m("kanban.empty")})})})]})})};P();var hv={success:"success",warning:"warning",info:"info",error:"error"},bv={critical:"error",high:"warning",medium:"info",low:"success"},vv={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},yv=(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}},Cv=t=>t?t.split(/\s+/).map(o=>o.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",kl=({card:t,bucket:o,dragging:r=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=le(),l=!!(a&&o),d=t.tone??(t.priority?bv[t.priority]:"default"),p=d==="default"?"primary":hv[d],m=vv[d],f=o?{card:t,bucket:o}:void 0;return e(Ae,{onClick:l?()=>f&&a?.(f):void 0,onKeyDown:l?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f&&a?.(f));}: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 ${ot(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:ot(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:c(se,{spacing:1.25,children:[c(Re,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[c(Re,{sx:{minWidth:0,flex:1},children:[(t.kicker||o?.title)&&e(L,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??o?.title}),e(L,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&e(xt,{size:"small",color:p,label:yv(t.priority,s),variant:d==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,fontWeight:500}})]}),t.summary&&e(L,{component:"div",sx:{fontSize:13,fontWeight:300,color:"text.secondary",lineHeight:1.5},children:t.summary}),t.metrics&&t.metrics.length>0&&e(Re,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(h=>c(Re,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[e(L,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:h.label}),e(L,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:h.value})]},h.id))}),typeof t.progress=="number"&&c(Re,{children:[c(Re,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[e(L,{sx:{fontSize:12,color:"text.secondary"},children:s("kanban.card.progress")}),c(L,{numeric:true,sx:{fontSize:12,fontWeight:600},children:[Math.round(t.progress),"%"]})]}),e(Ad,{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)&&c(se,{spacing:.9,children:[t.tags&&t.tags.length>0&&e(Re,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(h=>e(xt,{size:"small",label:h.label,color:h.color??"default",variant:"outlined"},h.id))}),c(Re,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[c(Re,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&c(jsxRuntime.Fragment,{children:[e(ri,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??Cv(t.assignee.name)}),c(Re,{sx:{minWidth:0},children:[e(L,{component:"div",sx:{fontSize:13,fontWeight:500,lineHeight:1.3},noWrap:true,children:t.assignee.name}),t.dueDate&&e(L,{component:"div",sx:{fontSize:11,color:"text.secondary",lineHeight:1.35},noWrap:true,children:t.dueDate})]})]}),!t.assignee&&t.dueDate&&e(L,{sx:{fontSize:12,color:"text.secondary"},children:t.dueDate})]}),l&&e(L,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var Pu=(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:[]}]}},Tu=(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)}},xv=(t,o)=>Number.isNaN(t)||t<0?0:t>o?o:t,Iu=({buckets:t,cards:o})=>{let r=new Map;return o.forEach((n,a)=>{let i=r.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),r.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...r.get(n.id)??[]].sort((i,s)=>i.card.position===void 0&&s.card.position===void 0?i.sourceIndex-s.sourceIndex:i.card.position===void 0?1:s.card.position===void 0?-1:i.card.position-s.card.position||i.sourceIndex-s.sourceIndex).map(({card:i},s)=>({...i,bucketId:n.id,position:s}));return {...n,cards:a}})}},Uo=(t,o)=>{for(let r=0;r<t.buckets.length;r+=1){let n=t.buckets[r],a=n.cards.findIndex(i=>i.id===o);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:r,cardIndex:a}}},Ui=(t,o)=>{let r=Uo(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=xv(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,f)=>({...m,bucketId:p.id,position:f}))}))}};P();var Il="kanban-card|",Rl="kanban-bucket|",Du=t=>`${Il}${t}`,Av=t=>`${Rl}${t}`,Ki=t=>t?.startsWith(Il)?t.slice(Il.length):void 0,Mu=t=>t?.startsWith(Rl)?t.slice(Rl.length):void 0,Ev=({card:t,bucket:o,onCardClick:r})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=sortable.useSortable({id:Du(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 e("div",{ref:n,style:p,...a,...i,children:e(kl,{card:t,bucket:o,dragging:d,onClick:r})})},Lv=({bucket:t,highlighted:o,bucketHeight:r,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=core.useDroppable({id:Av(t.id)});return e(Re,{ref:l,sx:{minWidth:0,minHeight:0,height:r},children:e(ku,{bucket:t,cardCount:t.cards.length,highlighted:o||s,emptyLabel:n,height:r,onRename:a,children:e(sortable.SortableContext,{items:t.cards.map(d=>Du(d.id)),strategy:sortable.verticalListSortingStrategy,children:e(se,{spacing:1,children:t.cards.map(d=>e(Ev,{card:d,bucket:t,onCardClick:i},d.id))})})})})},Nu=t=>String(t??"").toLocaleLowerCase(),Ov=(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=>Nu(n).includes(o)),mE=({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:f,defaultSearchValue:h="",onSearchValueChange:u,searchPlaceholder:v,emptyBucketLabel:y,sx:g})=>{let{t:x}=le(),[b,C]=eo.useState(null),[k,S]=eo.useState(),[T,I]=eo.useState(h),w=f??T,M=w.trim().toLocaleLowerCase(),A=d??p??560,R=eo.useMemo(()=>({buckets:t.buckets.map(W=>{let H=n?W.cards.filter(Y=>n(Y,W)):W.cards;if(!M)return {...W,cards:H};let U=[W.id,W.title,W.description].some(Y=>Nu(Y).includes(M));return {...W,cards:U?H:H.filter(Y=>Ov(Y,M))}})}),[n,t,M]),D=eo.useMemo(()=>R.buckets.reduce((W,H)=>W+H.cards.length,0),[R]),E=eo.useCallback(W=>{f===void 0&&I(W),u?.(W);},[u,f]),O=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),_=eo.useMemo(()=>b?Uo(t,b):void 0,[b,t]),J=eo.useCallback(()=>{C(null),S(void 0);},[]),F=eo.useCallback(W=>{if(!W)return;let H=Ki(W);return H?Uo(t,H)?.bucket.id:Mu(W)},[t]),V=eo.useCallback(W=>{C(Ki(String(W.active.id))??null);},[]),z=eo.useCallback(W=>{S(F(W.over?String(W.over.id):void 0));},[F]),X=eo.useCallback(W=>{let H=Ki(String(W.active.id)),U=W.over?String(W.over.id):void 0;if(!H||!U){J();return}let Y=Uo(t,H);if(!Y){J();return}let ue=Y.bucket.id,re=Y.cardIndex,ge=Ki(U);if(ge){let Te=Uo(t,ge);if(!Te){J();return}ue=Te.bucket.id,re=Te.cardIndex;}else {let Te=Mu(U),Ie=t.buckets.find(He=>He.id===Te);if(!Te||!Ie){J();return}ue=Te,re=Ie.cards.length;}if(Y.bucket.id===ue&&Y.cardIndex===re){J();return}let we=Ui(t,{cardId:H,fromBucketId:Y.bucket.id,toBucketId:ue,targetIndex:re}),Ve=Uo(we,H);Ve&&!(Ve.bucket.id===Y.bucket.id&&Ve.cardIndex===Y.cardIndex)&&o?.({cardId:H,fromBucketId:Y.bucket.id,toBucketId:Ve.bucket.id,targetIndex:Ve.cardIndex,card:Ve.card,model:we}),J();},[t,o,J]);return c(core.DndContext,{sensors:O,collisionDetection:core.closestCorners,onDragStart:V,onDragOver:z,onDragEnd:X,onDragCancel:J,children:[c(Re,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(m||a)&&c(Re,{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&&e(Re,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:e(ze,{dense:true,value:w,onChange:W=>E(W.target.value),placeholder:v??x("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:w?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:e(Vo,{size:16,"aria-hidden":"true"}),endAdornment:w?e(ie,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>E(""),sx:{width:26,height:26},children:e(qt,{size:15})}):void 0})}),c(Re,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[M&&e(L,{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&&e(ke,{size:"small",variant:"secondary",startIcon:e(en,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),e(Re,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${l}px, ${Math.max(l,360)}px)`,gap:1.5,gridAutoRows:A==="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)?g:g?[g]:[]],children:R.buckets.map(W=>e(Lv,{bucket:W,highlighted:W.id===k,bucketHeight:A,emptyBucketLabel:M?x("kanban.search.noMatch"):y,onBucketRename:i?H=>i(W.id,H):void 0,onCardClick:r},W.id))})]}),e(core.DragOverlay,{children:_?e(Re,{sx:{width:Math.max(l-24,260)},children:e(kl,{card:_.card,bucket:_.bucket,overlay:true})}):null})]})};var Hv=({initialModel:t,initialBuckets:o,initialCards:r})=>t||Iu({buckets:o??[],cards:r??[]}),vE=t=>{let{onCardMove:o,onCardClick:r}=t,[n,a]=eo.useState(()=>Hv(t)),i=eo.useCallback(h=>{a(u=>typeof h=="function"?h(u):h);},[]),s=eo.useCallback(h=>Uo(n,h),[n]),l=eo.useCallback((h,u,v)=>{let y=Uo(n,h);if(!y)return;let g=Ui(n,{cardId:h,fromBucketId:y.bucket.id,toBucketId:u,targetIndex:v}),x=Uo(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=eo.useCallback((h,u)=>{a(v=>({buckets:v.buckets.map(y=>({...y,cards:y.cards.map(g=>g.id!==h?g:typeof u=="function"?u(g):{...g,...u})}))}));},[]),p=eo.useCallback(h=>{let u=Pu(n,h);return u===n?false:(a(u),true)},[n]),m=eo.useCallback((h,u)=>{let v=Tu(n,h,u);return v===n?false:(a(v),true)},[n]),f=eo.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:p,renameBucket:m,getCard:s},boardProps:f}};function wn({onTextUpdate:t,onComplete:o,onError:r,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,l]=eo.useState(false),d=eo.useRef(null),p=eo.useRef(null),m=eo.useRef(null),f=eo.useRef(null),h=eo.useRef(null),u=eo.useRef(0),v=eo.useRef(false),y=eo.useRef(false),g=eo.useCallback(()=>{d.current&&(d.current.close(),d.current=null),f.current&&(f.current.disconnect(),f.current=null),h.current&&(h.current.disconnect(),h.current=null),p.current&&(p.current.getTracks().forEach(C=>C.stop()),p.current=null),m.current&&(m.current.close(),m.current=null),y.current=false,l(false);},[]),x=eo.useCallback(()=>{v.current||(v.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),b=eo.useCallback(async()=>{if(!(s||y.current)){y.current=true,v.current=false,u.current=Date.now();try{let C=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});p.current=C;let k=new WebSocket(n);d.current=k,k.onopen=()=>{l(!0),y.current=!1;},k.onmessage=M=>{try{let A=JSON.parse(M.data);if(A.type==="recognition")A.is_final?o(A.text):t?.(A.text);else if(A.type==="error"){let R=A.message||"Voice recognition error";r?.(R),x();}}catch{r?.("Failed to parse voice message");}},k.onerror=()=>{r?.("Voice service connection failed"),g();},k.onclose=()=>{g();};let S=window.AudioContext||window.webkitAudioContext;if(!S)throw new Error("AudioContext is not supported in this browser");let T=new S({sampleRate:16e3});m.current=T;let I=T.createMediaStreamSource(C);h.current=I;let w=T.createScriptProcessor(4096,1,1);f.current=w,w.onaudioprocess=M=>{if(d.current?.readyState!==WebSocket.OPEN)return;let A=M.inputBuffer.getChannelData(0),R=0;for(let O=0;O<A.length;O+=1)R+=A[O]*A[O];if(Math.sqrt(R/A.length)>i)u.current=Date.now();else if(Date.now()-u.current>a&&!v.current){x();return}let E=new Int16Array(A.length);for(let O=0;O<A.length;O+=1){let _=Math.max(-1,Math.min(1,A[O]));E[O]=_<0?_*32768:_*32767;}d.current.send(E.buffer);},I.connect(w),w.connect(T.destination);}catch{r?.("Cannot access microphone"),g();}}},[g,s,i,o,r,t,a,x,n]);return eo.useEffect(()=>g,[g]),{isRecording:s,startRecording:b,stopRecording:x}}P();var $v=["en","zh","fr","de","ja","ko"],Eu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Dl=({searchPlaceholder:t,onSearch:o,onSearchAdd:r,onOpenPanel:n,panelOpen:a=false,maxWidth:i=540,sx:s})=>{let{t:l}=le(),[d,p]=eo.useState(""),m=eo.useCallback((x=d)=>{let b=x.trim();b&&(p(""),o?.(b));},[o,d]),f=x=>{x.preventDefault(),m();},{isRecording:h,startRecording:u,stopRecording:v}=wn({onTextUpdate:p,onComplete:x=>{p(x),m(x);},onError:x=>{console.error("Header voice input error:",x);}}),y=eo.useCallback(async()=>{if(h){v();return}await u();},[h,u,v]),g=t||l("header.searchPlaceholder");return e("form",{className:"orb-app-header-search",onSubmit:f,style:{width:"100%",maxWidth:typeof i=="number"?`${i}px`:i,...s},children:c("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:[e("div",{className:"orb-inp-adornment",children:e(ie,{className:"orb-app-header-ai-action",size:"small",onClick:r,tooltip:l("header.searchAddFeature"),children:e(Tt,{name:"add",size:16})})}),e("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:d,onChange:x=>p(x.target.value),placeholder:g,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),c("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[n&&!a&&e(ie,{className:"orb-app-header-ai-action",size:"small","aria-label":l("header.searchOpenPanel"),tooltip:l("header.searchOpenPanel"),onClick:n,children:e(Tt,{name:"message",size:16})}),e(ie,{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:e(Tt,{name:"microphone",size:16})})]})]})})},qi=({appTitle:t,logo:o,onToggleMode:r,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:l,showSearch:d=false,onSearch:p,onSearchAdd:m,onOpenPanel:f,panelOpen:h,user:u,onUserRefresh:v,onUserSetting:y,onUserLogout:g,userMenuItems:x,leftSlot:b,rightSlot:C})=>{let{t:k,locale:S}=le(),T=fo(),I=n||S,w=a||Eu[I],M=i||$v,A=T==="dark"?e(Jc,{size:15}):e(rd,{size:15}),R=k(T==="dark"?"header.theme.dark":"header.theme.light"),D=[...v?[{key:"refresh",label:k("header.menu.refresh"),icon:e($a,{size:15}),onClick:v}]:[],...y?[{key:"settings",label:k("header.menu.setting"),icon:e(tn,{size:16}),onClick:y}]:[],...g?[{key:"logout",label:k("header.menu.logout"),icon:e(Yc,{size:16}),onClick:g}]:[]],E=x||D,O=M.map(_=>({label:Eu[_],onClick:()=>{s?.(_),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:_===I}));return c("header",{className:"orb-app-header",children:[c("div",{className:"orb-app-header-brand",children:[b,o===null?null:o||e("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:e(Tt,{name:"product",size:20})}),t&&e(L,{variant:"h4",sx:{fontWeight:700},children:t})]}),e("div",{className:"orb-app-header-center",children:d&&e(Dl,{searchPlaceholder:l,onSearch:p,onSearchAdd:m,onOpenPanel:f,panelOpen:h})}),c("div",{className:"orb-app-header-actions",children:[c("div",{className:"orb-app-header-utilities",children:[s?e(Qt,{triggerLabel:w,trigger:c("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[e(Vn,{size:15}),e("span",{className:"orb-label",children:w})]}),items:O,align:"end"}):c("div",{className:"orb-app-header-locale","aria-label":w,children:[e(Vn,{size:15}),e("span",{className:"orb-label",children:w})]}),e(ie,{className:"orb-app-header-theme",size:"small",onClick:r,tooltip:R,children:A})]}),u&&e("span",{className:"orb-app-header-divider","aria-hidden":"true"}),u&&e(Qt,{triggerLabel:u.name,trigger:c("button",{type:"button",className:"orb-app-header-user-trigger",children:[c("span",{className:"orb-app-header-user-copy",children:[e(L,{variant:"body2",className:"orb-app-header-user-name",children:u.name}),u.subtitle&&e(L,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:u.subtitle,children:u.subtitle})]}),e(on,{src:u.avatarSrc,alt:u.name,size:32,children:u.avatarText||u.name.slice(0,1).toUpperCase()})]}),items:E.map(_=>({label:_.label,onClick:_.onClick,disabled:_.disabled,icon:_.icon})),align:"end"}),C]})]})};var Lu=({menuData:t=[],initialNavigationCollapsed:o=false,initialNavigationMode:r="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:p}=Pd({initialCollapsed:o,initialDisplayMode:r,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[m,f]=eo.useState(900);eo.useEffect(()=>{let u=()=>f(window.innerHeight);return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]);let h=eo.useMemo(()=>Math.max(280,m-100),[m]);return {navigationIslandProps:p,navigationMaxHeight:h}};P();var Fo=12,Fu=56,Bu=234,qv="orbcafe:page-layout-locale",Hu=["en","zh","fr","de","ja","ko"],Xv=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",Xi=(t,o)=>`orbcafe:page-layout:${Xv(t)}:${o}`,Yv=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,Zv=t=>t==="system"?"dark":t==="dark"?"light":"system",Yi=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),jv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,WE=({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:f,user:h,onUserRefresh:u,onUserSetting:v,onUserLogout:y,userMenuItems:g,logo:x,searchPlaceholder:b,searchPlacement:C="hidden",floatingSearchSx:k,onSearch:S,onSearchAdd:T,onOpenPanel:I,panelOpen:w,rightHeaderSlot:M,leftHeaderSlot:A,contentSx:R,navigationVariant:D="classic",navigationMode:E,defaultNavigationMode:O="fixed",onNavigationModeChange:_,showNavigationModeToggle:J=true,enableNavigationPinning:F=true,navigationPinStorageKey:V,pinnedNavigationItemIds:z,defaultPinnedNavigationItemIds:X,onPinnedNavigationItemIdsChange:W,pinnedNavigationSectionTitle:H})=>{let U=t?Xi(t,"mode"):"orbcafe:page-layout-mode",Y=t?Xi(t,"locale"):qv,ue=t?Xi(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[re,ge]=eo.useState(m),[we,Ve]=eo.useState("light"),[Te,Ie]=eo.useState(false),[He,ce]=eo.useState(i),[be,We]=eo.useState(false),[tt,nt]=eo.useState(false),[it,q]=eo.useState(O),[De,Ce]=eo.useState({x:Fo,y:Fo}),[Fe,at]=eo.useState("left"),[Ze,wt]=eo.useState(false),Rt=eo.useRef(null),Ot=eo.useRef(null),At=p!==void 0,oe=p??re,Ke=d!==void 0,Oe=Ke?i:He,de=l?.join("|")??"",ye=E!==void 0,te=E??it,ve=te==="floating",Ne=D==="v2"?el:yd,Je=C==="header",st=oe==="system"?Te?we:"light":oe;eo.useEffect(()=>{if(!At)try{let he=window.localStorage.getItem(U);(he==="light"||he==="dark"||he==="system")&&ge(he);}catch{}Ie(true);let $=window.matchMedia("(prefers-color-scheme: dark)"),j=()=>{Ve($.matches?"dark":"light");};return j(),$.addEventListener("change",j),()=>$.removeEventListener("change",j)},[At,U]),eo.useEffect(()=>{if(!(At||!Te))try{window.localStorage.setItem(U,oe);}catch{}},[Te,At,oe,U]),eo.useEffect(()=>{if(Ke){We(true);return}try{let $=window.localStorage.getItem(Y),j=l??Hu;$&&Hu.includes($)&&j.includes($)&&ce($);}catch{}finally{We(true);}},[Ke,de,Y]),eo.useEffect(()=>{if(!(Ke||!be))try{window.localStorage.setItem(Y,Oe);}catch{}},[Oe,Ke,be,Y]),eo.useEffect(()=>{if(ye){nt(true);return}try{let $=window.localStorage.getItem(ue);($==="fixed"||$==="floating")&&q($);}catch{}finally{nt(true);}},[ye]),eo.useEffect(()=>{if(tt)try{window.localStorage.setItem(ue,te);}catch{}},[te,tt]),eo.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=eo.useCallback($=>{ye||q($),_?.($);},[ye,_]),Bt=eo.useCallback($=>{At||ge($),f?.($);},[At,f]),Yt=eo.useCallback($=>{Ke||ce($),d?.($);},[Ke,d]),{navigationIslandProps:Vt,navigationMaxHeight:St}=Lu({menuData:r,initialNavigationCollapsed:false,initialNavigationMode:te,enableNavigationPinning:F,navigationPinStorageKey:V??(t?Xi(t,"pinned-navigation-items"):Yv(o)),pinnedNavigationItemIds:z,defaultPinnedNavigationItemIds:X,onPinnedNavigationItemIdsChange:W,pinnedNavigationSectionTitle:H}),Wt=Vt.collapsed,bt=eo.useCallback($=>{let j=Rt.current,he=j?.parentElement;if(!j||!he)return $;let xe=he.getBoundingClientRect(),Ee=j.getBoundingClientRect(),_e=Fo,qe=Fo,je=Math.max(_e,xe.width-Ee.width-Fo),mt=Math.max(qe,xe.height-Ee.height-Fo);return {x:Yi($.x,_e,je),y:Yi($.y,qe,mt)}},[]),Nt=eo.useCallback($=>{let j=Rt.current,he=j?.parentElement;if(!j||!he)return $;let xe=he.getBoundingClientRect(),Ee=j.getBoundingClientRect(),_e=Fo,qe=Fo,je=Math.max(_e,xe.width-Ee.width-Fo),mt=Math.max(qe,xe.height-Ee.height-Fo),ft={x:Yi($.x,_e,je),y:Yi($.y,qe,mt)},yt=[{distance:Math.abs(ft.x-_e),position:{x:_e,y:ft.y}},{distance:Math.abs(ft.x-je),position:{x:je,y:ft.y}},{distance:Math.abs(ft.y-qe),position:{x:ft.x,y:qe}},{distance:Math.abs(ft.y-mt),position:{x:ft.x,y:mt}}].reduce((B,Q)=>Q.distance<B.distance?Q:B).position;return at(yt.x>=(_e+je)/2?"right":"left"),yt},[]),lt=eo.useMemo(()=>{if(!ve||Ze)return De.x;if(Fe==="right"){let he=Rt.current?.parentElement?.getBoundingClientRect().width,xe=Wt?Fu:Bu;return he?Math.max(Fo,he-xe-Fo):Wt?De.x:De.x-(Bu-Fu)}return De.x},[Fe,De.x,Ze,ve,Wt]),Ft=eo.useCallback($=>{if(!ve||!Wt||jv($.target))return;$.preventDefault(),$.currentTarget.setPointerCapture($.pointerId);let j=bt({x:lt,y:De.y});at("left"),Ce(j),Ot.current={pointerId:$.pointerId,startClientX:$.clientX,startClientY:$.clientY,startX:j.x,startY:j.y,currentX:j.x,currentY:j.y},wt(true);},[bt,lt,De.y,ve,Wt]),Zt=eo.useCallback($=>{let j=Ot.current;if(!j||j.pointerId!==$.pointerId)return;let he=bt({x:j.startX+$.clientX-j.startClientX,y:j.startY+$.clientY-j.startClientY});j.currentX=he.x,j.currentY=he.y,Ce(he);},[bt]),Z=eo.useCallback($=>{let j=Ot.current;if(!(!j||j.pointerId!==$.pointerId)){try{$.currentTarget.releasePointerCapture($.pointerId);}catch{}Ot.current=null,Ce(Nt({x:j.currentX,y:j.currentY})),wt(false);}},[Nt]);return eo.useEffect(()=>{if(!ve)return;let $=()=>{Ce(xe=>bt(xe));},j=window.requestAnimationFrame($),he=window.setTimeout($,430);return ()=>{window.cancelAnimationFrame(j),window.clearTimeout(he);}},[bt,ve,Wt,St]),e(Bn,{mode:oe,children:e(Ya,{locale:Oe,children:c("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[e(qi,{appTitle:o,logo:x,mode:oe,onToggleMode:()=>Bt(Zv(oe)),locale:Oe,localeLabel:Ke||Oe===i?s:void 0,localeOptions:l,onLocaleChange:Yt,user:h,onUserRefresh:u,onUserSetting:v,onUserLogout:y,userMenuItems:g,searchPlaceholder:b,showSearch:Je,onSearch:S,onSearchAdd:T,onOpenPanel:I,panelOpen:w,leftSlot:A,rightSlot:M}),C==="floating"&&e("div",{className:"orb-float-search",style:k,children:e(Dl,{searchPlaceholder:b,onSearch:S,onSearchAdd:T,onOpenPanel:I,panelOpen:w,maxWidth:"100%"})}),c("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!ve&&e("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:Wt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:e(Ne,{...Vt,maxHeight:St,colorMode:st,displayMode:te,onDisplayModeChange:pt,showDisplayModeToggle:J&&Wt})}),a&&ve&&e("div",{ref:Rt,onPointerDown:Ft,onPointerMove:Zt,onPointerUp:Z,onPointerCancel:Z,style:{position:"absolute",top:De.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:e(Ne,{...Vt,maxHeight:St,colorMode:st,displayMode:te,onDisplayModeChange:pt,showDisplayModeToggle:J&&Wt})}),e("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!ve&&Wt?4:12,...R},children:n})]})]})})})};var Zi="(blank)",zu="Result",Vu="Grand Total",Wu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},$u=["sum","count","avg","min","max"];var _u=["palette","rows","columns","filters","values"];var Gu=t=>_u.includes(t),Uu=t=>t==="rows"||t==="columns"||t==="filters",ji=t=>{let o=t.split("|");return o.length===2&&o[0]==="container"&&Gu(o[1])?{kind:"container",zone:o[1]}:o.length===3&&o[0]==="item"&&Gu(o[1])&&o[2]?{kind:"item",zone:o[1],key:o[2]}:null},ur=t=>t==null||t===""?Zi:t instanceof Date?t.toISOString().slice(0,10):String(t),_r=t=>JSON.stringify(t),Ku=(t,o)=>{let r=t.join(""),n=o.join("");return r.localeCompare(n,void 0,{sensitivity:"base"})},Qv=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},Sn=(t,o,r)=>{if(r==="count")return t.length;let n=t.map(a=>Qv(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)},lo=(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},mr=(t,o)=>t.length!==o.length?false:t.every((r,n)=>r===o[n]),qu=(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 mr(i,s)})},Qi=(t,o)=>t.length!==o.length?false:t.every((r,n)=>{let a=o[n];return r.tokenId===a.tokenId&&r.fieldId===a.fieldId&&r.aggregation===a.aggregation}),Nl=t=>!t?.aggregations||t.aggregations.length===0?$u:t.aggregations,Co=(t,o)=>{let r=Nl(o);return t&&r.includes(t)?t:o?.type==="number"&&r.includes("sum")?"sum":r.includes("count")?"count":r[0]},ma=(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})};P();var Yu=({options:t,selectedValues:o,onChange:r,minWidth:n=96})=>{let{t:a}=le(),[i,s]=eo.useState(""),[l,d]=eo.useState(null),p=eo.useMemo(()=>{let u=i.trim().toLowerCase();return u?t.filter(v=>v.toLowerCase().includes(u)):t},[t,i]),m=t.length>0&&o.length===t.length,f=t.length===0?a("pivot.filter.na"):o.length===0?a("common.none"):m?a("common.all"):`${o.length}/${t.length}`,h=u=>{r(o.includes(u)?o.filter(v=>v!==u):[...o,u]);};return c("div",{sx:{minWidth:n},onClick:u=>u.stopPropagation(),onMouseDown:u=>u.stopPropagation(),children:[e(ke,{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:f}),e(Qt,{anchorEl:l,open:!!l,onClose:()=>d(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:c("div",{onClick:u=>u.stopPropagation(),sx:{display:"grid",gap:.4},children:[e(ze,{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}}}),e("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:e(ke,{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&&e("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),p.map(u=>{let v=o.includes(u);return c("div",{role:"option","aria-selected":v,tabIndex:0,className:`orb-menu-item ${v?"orb-selected":""}`,onClick:()=>h(u),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),h(u));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[e(It,{size:"small",checked:v,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),e("span",{children:u})]},u)})]})})]})};P();var kn=({size:t=18,subtle:o=false})=>{let r=Math.max(2,Math.round(t/6));return e(Re,{"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)=>e(Re,{sx:{width:r,height:r,borderRadius:999,bgcolor:"currentColor"}},a))})};P();var Al=({label:t,subtitle:o,isDragging:r,dragRef:n,listeners:a,attributes:i,style:s})=>e(Ae,{ref:n,...a,...i,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)",transform:"translateY(-1px)"}},style:{...s,opacity:r?.3:1,cursor:r?"grabbing":"grab"},children:c("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[e("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:e(kn,{size:13,subtle:true})}),c("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.15},children:[e(L,{component:"div",sx:{fontSize:"0.84rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),o&&e(L,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]})]})}),Zu=({id:t,label:o,subtitle:r})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=core.useDraggable({id:t});return e(Al,{label:o,subtitle:r,isDragging:s,dragRef:n,listeners:a,attributes:i})};P();var Pn=({zone:t,title:o,hint:r,icon:n,children:a,itemCount:i,onClear:s})=>{let l=`container|${t}`,{isOver:d,setNodeRef:p}=core.useDroppable({id:l}),{t:m}=le();return c(Ae,{ref:p,sx:f=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:d?"var(--orb-primary)":"var(--orb-p200)",bgcolor:d?"var(--orb-p100)":f.palette.mode==="dark"?"var(--orb-surface-2)":"var(--orb-p50)",transition:"border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease",boxShadow:d?"0 0 0 3px var(--orb-focus-ring)":"none",minHeight:120,display:"flex",flexDirection:"column"}),children:[c("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[c("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[n,e(L,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children:o}),c(L,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&e(ct,{title:m("pivot.clearArea"),children:e(ie,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:e(pp,{size:13})})})]}),e(L,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:r}),e("div",{sx:{flex:1},children:a})]})};P();var ju={xs:1.2,md:1.6},Tn=({title:t,subtitle:o,collapsed:r,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:l,unmountOnExit:d=false,headerActions:p})=>c(Ae,{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:[c("div",{sx:m=>({px:ju,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:[c("div",{sx:{minWidth:0,flex:1},children:[e(L,{component:"div",sx:{fontSize:"0.92rem",fontWeight:700,color:"var(--orb-fg-strong)"},children:t}),e(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),c("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[p,e(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:e(di,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:r?"rotate(180deg)":"rotate(0deg)"}})})]})]}),e(nn,{in:!r,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:e("div",{sx:[{px:ju,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});P();var Ji=({label:t,caption:o,onRemove:r,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:l,style:d})=>e(Ae,{ref:i,style:d,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",opacity:a?0:1,transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)"}},children:c("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[e("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:e(kn,{size:13,subtle:true})}),c("div",{sx:{minWidth:0,flex:1,display:"flex",flexDirection:"column",gap:.15},children:[e(L,{component:"div",sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),o&&e(L,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]}),n,r&&e(ie,{size:"small",onClick:p=>{p.stopPropagation(),r();},sx:{width:24,height:24,p:0},children:e(Sr,{size:13})})]})}),ga=({id:t,label:o,caption:r,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:l,transform:d,transition:p,isDragging:m}=sortable.useSortable({id:t}),f={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:p,zIndex:m?999:"auto"};return e(Ji,{label:o,caption:r,onRemove:n,trailing:a,isDragging:m,dragRef:i,listeners:l,attributes:s,style:f})};P();var os={rows:e(Pp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:e(ln,{size:16,sx:{color:"var(--orb-primary)"}}),filters:e(sp,{size:16,sx:{color:"var(--orb-primary)"}}),values:e(sn,{size:16,sx:{color:"var(--orb-accent)"}})},Qu=({isConfiguratorCollapsed:t,onToggleCollapse:o,availableFields:r,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:l,clearZone:d,removeFieldFromZone:p,getFilterSelectionSummary:m,renderDimensionFilterSelect:f,renderAggregationSelect:h,getAggregationLabel:u})=>{let{t:v}=le(),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 e(Tn,{title:v("pivot.config.title"),subtitle:y,collapsed:t,onToggleCollapse:o,expandAriaLabel:v("pivot.collapse.ariaExpand"),collapseAriaLabel:v("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[e(Pn,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:r.length,icon:e(kn,{size:18,subtle:true}),children:c(se,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[r.length===0&&e(L,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:v("pivot.allFieldsInUse")}),r.map(g=>e(Zu,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),c(se,{spacing:2,children:[c("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[e(Pn,{zone:"filters",title:v("pivot.zone.filters"),hint:v("pivot.hint.filters"),icon:os.filters,itemCount:a.length,onClear:()=>d("filters"),children:e(sortable.SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(se,{spacing:.7,children:a.map(g=>e(ga,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:m(g),trailing:f(g),onRemove:()=>p("filters",g)},g))})})}),e(Pn,{zone:"columns",title:v("pivot.zone.columns"),hint:v("pivot.hint.columns"),icon:os.columns,itemCount:i.length,onClear:()=>d("columns"),children:e(sortable.SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(se,{spacing:.7,children:i.map(g=>e(ga,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:f(g),onRemove:()=>p("columns",g)},g))})})})]}),c("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[e(Pn,{zone:"rows",title:v("pivot.zone.rows"),hint:v("pivot.hint.rows"),icon:os.rows,itemCount:s.length,onClear:()=>d("rows"),children:e(sortable.SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(se,{spacing:.7,children:s.map(g=>e(ga,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:f(g),onRemove:()=>p("rows",g)},g))})})}),e(Pn,{zone:"values",title:v("pivot.zone.values"),hint:v("pivot.hint.values"),icon:os.values,itemCount:l.length,onClear:()=>d("values"),children:e(sortable.SortableContext,{items:l.map(g=>`item|values|${g.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:e(se,{spacing:.7,children:l.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,b=`${u(g.aggregation)}(${x})`;return e(ga,{id:`item|values|${g.tokenId}`,label:x,caption:b,trailing:h(g),onRemove:()=>p("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};P();var Ju=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),em=({data:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=so();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),f=Math.max(...p,1),h=Math.max(...m,1),u=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*u,S=l-d.bottom-C/h*v;return {...g,x:k,y:S,rawX:b,rawY:C}});return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[e("div",{sx:{overflowX:"auto"},children:c("div",{component:"svg",viewBox:`0 0 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[e("line",{x1:d.left,y1:l-d.bottom,x2:s-d.right,y2:l-d.bottom,stroke:Lo(i.palette.text.secondary,.35)}),e("line",{x1:d.left,y1:d.top,x2:d.left,y2:l-d.bottom,stroke:Lo(i.palette.text.secondary,.35)}),y.map(g=>c("g",{children:[e("circle",{cx:g.x,cy:g.y,r:7,fill:Lo(i.palette.primary.main,.18)}),e("circle",{cx:g.x,cy:g.y,r:4.5,fill:i.palette.primary.main,children:c("title",{children:[g.name,`
195
+ `,r?`${o}: ${n(g.primaryValue)}`:`${o}: ${n(g.primaryValue)}`,r?`
196
+ ${r}: ${(a??n)(g.secondaryValue??0)}`:""]})}),e("text",{x:g.x,y:Math.max(g.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:i.palette.text.secondary,children:g.name})]},g.name)),e("text",{x:s/2,y:l-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:r?o:"Index"}),e("text",{x:16,y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/2})`,fontSize:"11",fill:i.palette.text.secondary,children:r??o}),e("text",{x:d.left,y:d.top-4,fontSize:"10",fill:i.palette.text.secondary,children:Ju(h)}),e("text",{x:s-d.right,y:l-d.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:Ju(f)})]})}),e("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=>c("div",{sx:x=>({borderRadius:"var(--orb-r-container)",px:1.25,py:1,border:`1px solid ${Lo(x.palette.divider,.7)}`,bgcolor:Lo(x.palette.background.default,.35)}),children:[e(L,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:g.name,children:g.name}),c(L,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[o,": ",n(g.primaryValue)]}),r&&c(L,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[r,": ",(a??n)(g.secondaryValue??0)]})]},g.name))})]})};P();var El=t=>Math.max(...t,1),tm=({data:t,chartType:o,primaryLabel:r,secondaryLabel:n,formatPrimaryValue:a,formatSecondaryValue:i})=>{let s=so(),l=s.palette.primary.main,d=s.palette.warning.main;if(t.length===0)return null;if(o==="bar-horizontal"){let b=El(t.flatMap(C=>[C.primaryValue,C.secondaryValue??0]));return e(se,{spacing:1.1,children:t.map(C=>c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[e(L,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:C.name,children:C.name}),c(se,{spacing:.65,children:[e("div",{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:Lo(s.palette.action.active,.08)},children:e("div",{sx:{width:`${C.primaryValue/b*100}%`,height:"100%",bgcolor:l}})}),n&&e("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:Lo(s.palette.action.active,.08)},children:e("div",{sx:{width:`${(C.secondaryValue??0)/b*100}%`,height:"100%",bgcolor:d}})})]}),c("div",{sx:{minWidth:0},children:[e(L,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700,color:"var(--orb-fg-strong)"},children:a(C.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"var(--orb-fg)"},children:(i??a)(C.secondaryValue??0)})]})]},C.name))})}if(o==="bar-vertical"){let b=El(t.flatMap(k=>[k.primaryValue,k.secondaryValue??0])),C=n?92:76;return e("div",{sx:{overflowX:"auto",pb:.5},children:e("div",{sx:{minWidth:Math.max(620,t.length*C),display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:t.map(k=>c("div",{sx:{minWidth:0},children:[c("div",{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[e("div",{sx:{width:n?16:26,minHeight:8,height:`${Math.max(k.primaryValue/b*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:l},title:`${r}: ${a(k.primaryValue)}`}),n&&e("div",{sx:{width:16,minHeight:8,height:`${Math.max((k.secondaryValue??0)/b*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${n}: ${(i??a)(k.secondaryValue??0)}`})]}),e(L,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:k.name,children:k.name}),e(L,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:a(k.primaryValue),children:a(k.primaryValue)}),n&&e(L,{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,f={top:20,right:18,bottom:36,left:18},h=El(t.flatMap(b=>[b.primaryValue,b.secondaryValue??0])),u=p-f.left-f.right,v=m-f.top-f.bottom,y=b=>t.map((C,k)=>{let S=f.left+k*u/Math.max(t.length-1,1),T=m-f.bottom-b(C)/h*v;return {x:S,y:T,item:C}}),g=y(b=>b.primaryValue),x=n?y(b=>b.secondaryValue??0):[];return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[e("div",{sx:{overflowX:"auto"},children:c("div",{component:"svg",viewBox:`0 0 ${p} ${m}`,sx:{width:"100%",minWidth:p,height:m},children:[e("line",{x1:f.left,y1:m-f.bottom,x2:p-f.right,y2:m-f.bottom,stroke:Lo(s.palette.text.secondary,.35)}),e("polyline",{fill:"none",stroke:l,strokeWidth:3,points:g.map(b=>`${b.x},${b.y}`).join(" ")}),g.map(b=>e("circle",{cx:b.x,cy:b.y,r:4,fill:l,children:c("title",{children:[b.item.name,`
197
+ `,r,": ",a(b.item.primaryValue)]})},`primary-${b.item.name}`)),n&&c(jsxRuntime.Fragment,{children:[e("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:x.map(b=>`${b.x},${b.y}`).join(" ")}),x.map(b=>e("circle",{cx:b.x,cy:b.y,r:3.5,fill:d,children:c("title",{children:[b.item.name,`
198
+ `,n,": ",(i??a)(b.item.secondaryValue??0)]})},`secondary-${b.item.name}`))]})]})}),e("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=>c("div",{sx:C=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Lo(C.palette.divider,.7)}`,bgcolor:Lo(C.palette.background.default,.35)}),children:[e(L,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:b.name,children:b.name}),e(L,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(b.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(b.secondaryValue??0)})]},b.name))})]})};var om=(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},rm=(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}}),nm=({rows:t,dimensionFieldId:o,primaryValue:r,secondaryValue:n})=>{if(!o)return [];let a=new Map;return t.forEach(i=>{let s=ur(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:Sn(s,r.fieldId,r.aggregation),secondaryValue:n?Sn(s,n.fieldId,n.aggregation):void 0}))};P();var am=({rows:t,fieldMap:o,rowFields:r,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:l,chartType:d,isCollapsed:p,onChartDimensionFieldIdChange:m,onChartPrimaryValueFieldIdChange:f,onChartSecondaryValueFieldIdChange:h,onChartTypeChange:u,onToggleCollapse:v,getAggregationLabel:y})=>{let{t:g}=le(),x=eo.useMemo(()=>om(r,n,o),[n,o,r]),b=eo.useMemo(()=>rm(a,o,y),[o,y,a]),C=b.find(R=>R.fieldId===s)??b[0],k=b.find(R=>R.fieldId===l&&R.fieldId!==C?.fieldId)??null,S=x.find(R=>R.fieldId===i)??x[0],T=S&&C?g("pivot.chart.subtitleReady",{dimension:S.label,measure:k?`${C.label} / ${k.label}`:C.label}):g("pivot.chart.subtitle"),I=eo.useMemo(()=>!S||!C?[]:nm({rows:t,dimensionFieldId:S.fieldId,primaryValue:C.item,secondaryValue:k?.item}),[C,t,k,S]),w=R=>C?ma(R,C.item,o):R.toLocaleString(),M=R=>k?ma(R,k.item,o):R.toLocaleString(),A=x.length>1||b.length>1;return c(Tn,{title:g("pivot.chart.title"),subtitle:T,collapsed:p,onToggleCollapse:v,expandAriaLabel:g("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[A&&c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[c(Cr,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.dimension")}),e(zt,{value:S?.fieldId??"",onChange:R=>m(String(R.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(R=>e("option",{value:R.fieldId,sx:{fontSize:"0.75rem"},children:R.label},R.fieldId))})]}),c(Cr,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.primaryMeasure")}),e(zt,{value:C?.fieldId??"",onChange:R=>f(String(R.target.value)),sx:{fontSize:"0.75rem",height:32},children:b.map(R=>e("option",{value:R.fieldId,sx:{fontSize:"0.75rem"},children:R.label},R.fieldId))})]}),c(Cr,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.secondaryMeasure")}),c(zt,{value:k?.fieldId??"",onChange:R=>h(String(R.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("common.none")}),b.filter(R=>R.fieldId!==C?.fieldId).map(R=>e("option",{value:R.fieldId,sx:{fontSize:"0.75rem"},children:R.label},R.fieldId))]})]}),c(Cr,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.chartType")}),c(zt,{value:d,onChange:R=>u(R.target.value),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.barVertical")}),e("option",{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.barHorizontal")}),e("option",{value:"line",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.line")}),e("option",{value:"scatter",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.scatter")})]})]})]}),e("div",{children:S?C?I.length===0?e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoData")})}):d==="scatter"?e(em,{data:I,primaryLabel:C.label,secondaryLabel:k?.label,formatPrimaryValue:w,formatSecondaryValue:M}):e(tm,{data:I,chartType:d,primaryLabel:C.label,secondaryLabel:k?.label,formatPrimaryValue:w,formatSecondaryValue:M}):e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoValue")})}):e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoDimension")})})})]})};P();var rs=({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,f=p?800:m?700:d?600:500,h=p?800:m?600:500;return c(jsxRuntime.Fragment,{children:[c("tr",{sx:{bgcolor:p?vt()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":vt()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:p?vt()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[c("td",{style:{fontWeight:f},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&&e(ie,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:l?e($o,{size:12}):e(kr,{size:12})}),!d&&!p&&n>0&&e("div",{sx:{width:18}}),t.value]}),o.map(u=>e("td",{align:"right",style:{fontWeight:h},sx:{fontSize:"0.76rem",borderBottom:v=>`1px solid ${v.palette.divider}`,whiteSpace:"nowrap"},children:ma(s?s(t,u.id):t.aggregatedValues[u.id]??0,u.valueItem,r)},`${t.key}-${u.id}`))]}),l&&t.children.map(u=>e(rs,{node:u,dataColumns:o,fieldMap:r,level:n+1,expandedKeys:a,onToggle:i,getValue:s},u.key))]})};P();var Ol=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},as=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",Fl=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",sm=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},lm=(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,lm(a.children,o,r+1)),r),cy=(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},MO=({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:f,defaultPresets:h,onPresetsChange:u,initialPresetId:v,onPresetApplied:y})=>{let{t:g}=le(),x=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),b=eo.useRef(0),C=eo.useRef(false),k=t??g("pivot.title.default"),S=i??g("pivot.empty"),T=eo.useMemo(()=>({sum:g("pivot.agg.sum"),count:g("pivot.agg.count"),avg:g("pivot.agg.avg"),min:g("pivot.agg.min"),max:g("pivot.agg.max")}),[g]),I=eo.useCallback(N=>T[N]??Wu[N],[T]),w=eo.useMemo(()=>new Set(r.map(N=>N.id)),[r]),M=eo.useMemo(()=>new Map(r.map(N=>[N.id,N])),[r]),[A,R]=eo.useState(()=>lo(n?.rows,w)),[D,E]=eo.useState(()=>lo(n?.columns,w)),[O,_]=eo.useState(()=>lo(n?.filters,w)),[J,F]=eo.useState(()=>{let N=n?.values??[],G=new Set,K=[];return N.forEach(pe=>{if(!w.has(pe.fieldId)||G.has(pe.fieldId))return;G.add(pe.fieldId),b.current+=1;let Be=M.get(pe.fieldId);K.push({tokenId:`v${b.current}`,fieldId:pe.fieldId,aggregation:Co(pe.aggregation,Be)});}),K}),[V,z]=eo.useState({}),[X,W]=eo.useState(true),[H,U]=eo.useState(false),[Y,ue]=eo.useState(()=>Ol(lo(n?.rows,w),lo(n?.columns,w),a?.dimensionFieldId)),[re,ge]=eo.useState(()=>{let N=(n?.values??[]).filter((G,K,pe)=>w.has(G.fieldId)&&pe.findIndex(Be=>Be.fieldId===G.fieldId)===K).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:Co(G.aggregation,M.get(G.fieldId))}));return as(N,a?.primaryValueFieldId)}),[we,Ve]=eo.useState(()=>{let N=(n?.values??[]).filter((K,pe,Be)=>w.has(K.fieldId)&&Be.findIndex(rt=>rt.fieldId===K.fieldId)===pe).map(K=>({tokenId:K.fieldId,fieldId:K.fieldId,aggregation:Co(K.aggregation,M.get(K.fieldId))})),G=as(N,a?.primaryValueFieldId);return Fl(N,G,a?.secondaryValueFieldId)}),[Te,Ie]=eo.useState(a?.chartType??"bar-vertical"),[He,ce]=eo.useState(l),[be,We]=eo.useState(d),[tt,nt]=eo.useState(()=>h??[]),[it,q]=eo.useState(""),[De,Ce]=eo.useState(false),[Fe,at]=eo.useState(""),[Ze,wt]=eo.useState(null),[Rt,Ot]=eo.useState(new Set(["__grand_total__"])),[At,oe]=eo.useState(new Set),Ke=p?.rowFields??A,Oe=p?.columnFields??D,de=p?.filterFields??O,ye=p?.valueFields??J,te=p?.filterSelections??V,ve=p?.showGrandTotal??X,Ne=p?.isConfiguratorCollapsed??H,Je=p?.chartDimensionFieldId??Y,st=p?.chartPrimaryValueFieldId??re,pt=p?.chartSecondaryValueFieldId??we,Bt=p?.chartType??Te,Yt=p?.isChartCollapsed??He,Vt=p?.isTableCollapsed??be,St=f??tt,Wt=m||St.length>0||!!u,bt=eo.useCallback(N=>{if(p?.setRowFields){p.setRowFields(N);return}R(N);},[p]),Nt=eo.useCallback(N=>{if(p?.setColumnFields){p.setColumnFields(N);return}E(N);},[p]),lt=eo.useCallback(N=>{if(p?.setFilterFields){p.setFilterFields(N);return}_(N);},[p]),Ft=eo.useCallback(N=>{if(p?.setValueFields){p.setValueFields(N);return}F(N);},[p]),Zt=eo.useCallback(N=>{if(p?.setFilterSelections){p.setFilterSelections(N);return}z(N);},[p]),Z=eo.useCallback(N=>{if(p?.setShowGrandTotal){p.setShowGrandTotal(N);return}W(N);},[p]),$=eo.useCallback(N=>{if(p?.setIsConfiguratorCollapsed){p.setIsConfiguratorCollapsed(N);return}U(N);},[p]),j=eo.useCallback(N=>{if(p?.setChartDimensionFieldId){p.setChartDimensionFieldId(N);return}ue(N);},[p]),he=eo.useCallback(N=>{if(p?.setChartPrimaryValueFieldId){p.setChartPrimaryValueFieldId(N);return}ge(N);},[p]),xe=eo.useCallback(N=>{if(p?.setChartSecondaryValueFieldId){p.setChartSecondaryValueFieldId(N);return}Ve(N);},[p]),Ee=eo.useCallback(N=>{if(p?.setChartType){p.setChartType(N);return}Ie(N);},[p]),_e=eo.useCallback(N=>{if(p?.setIsChartCollapsed){p.setIsChartCollapsed(N);return}ce(N);},[p]),qe=eo.useCallback(N=>{if(p?.setIsTableCollapsed){p.setIsTableCollapsed(N);return}We(N);},[p]),je=eo.useCallback(N=>{let G=typeof N=="function"?N(St):N;f||nt(G),u?.(G);},[u,St,f]),mt=eo.useMemo(()=>new Set([...Ke,...Oe,...de]),[Ke,Oe,de]),ft=eo.useMemo(()=>r.filter(N=>!mt.has(N.id)),[r,mt]),Mt=eo.useMemo(()=>{let N=[...Ke,...Oe,...de],G=new Set,K=[];return N.forEach(pe=>{G.has(pe)||(G.add(pe),K.push(pe));}),K},[Oe,de,Ke]);eo.useEffect(()=>{bt(N=>{let G=N.filter(K=>w.has(K));return mr(N,G)?N:G}),Nt(N=>{let G=N.filter(K=>w.has(K));return mr(N,G)?N:G}),lt(N=>{let G=N.filter(K=>w.has(K));return mr(N,G)?N:G}),Ft(N=>{let G=N.filter(K=>w.has(K.fieldId)).map(K=>({...K,aggregation:Co(K.aggregation,M.get(K.fieldId))}));return Qi(N,G)?N:G});},[M,w]);let yt=eo.useMemo(()=>{let N={};return Mt.forEach(G=>{let K=new Set;o.forEach(pe=>{K.add(ur(pe[G]));}),N[G]=Array.from(K).sort((pe,Be)=>pe.localeCompare(Be));}),N},[Mt,o]);eo.useEffect(()=>{Zt(N=>{let G={};return Mt.forEach(K=>{let pe=yt[K]??[],rt=(N[K]??[]).filter(ne=>pe.includes(ne)),Ge=Object.prototype.hasOwnProperty.call(N,K);G[K]=Ge?rt:pe;}),qu(N,G)?N:G});},[Mt,yt]),eo.useEffect(()=>{j(N=>Ol(Ke,Oe,N));},[Oe,Ke,j]),eo.useEffect(()=>{he(N=>as(ye,N));},[he,ye]),eo.useEffect(()=>{xe(N=>Fl(ye,st,N));},[st,xe,ye]);let B=eo.useMemo(()=>o.filter(N=>Mt.every(G=>{let K=te[G]??[],pe=yt[G]??[];if(K.length===pe.length)return true;if(K.length===0)return false;let Be=ur(N[G]);return K.includes(Be)})),[Mt,yt,te,o]),Q=eo.useMemo(()=>{if(ye.length===0)return null;let N=new Map;if(B.forEach(Ge=>{let ne=Oe.length>0?Oe.map(ee=>ur(Ge[ee])):[g("pivot.valueLabel")],me=_r(ne);N.set(me,ne);}),N.size===0){let Ge=Oe.length>0?Oe.map(()=>Zi):[g("pivot.valueLabel")];N.set(_r(Ge),Ge);}let G=Array.from(N.entries()).sort((Ge,ne)=>Ku(Ge[1],ne[1])),K=G.flatMap(([Ge,ne])=>ye.map(me=>{let ee=M.get(me.fieldId),Le=`${I(me.aggregation)} ${ee?.label??me.fieldId}`,Qe=Oe.length===0||ye.length>1?`${ne.join(" / ")} \u2022 ${Le}`:ne.join(" / ");return {id:`${Ge}::${me.tokenId}`,colKey:Ge,valueItem:me,label:Qe}})),pe=[];Oe.length>0&&G.forEach(([Ge,ne])=>{let me=K.filter(Qe=>Qe.colKey===Ge),ee=pe,Le=[];ne.forEach((Qe,Me)=>{Le.push(`d${Me}:${Qe}`);let Ye=`col::${_r(Le)}`,Pt=ee.find(Qr=>Qr.key===Ye);Pt||(Pt={key:Ye,label:Qe,children:[],leafColumnIds:[],path:ne.slice(0,Me+1),depth:Me},ee.push(Pt)),me.forEach(Qr=>{Pt.leafColumnIds.includes(Qr.id)||Pt.leafColumnIds.push(Qr.id);}),ee=Pt.children;});});let Be=Ge=>{let ne={};return K.forEach(me=>{let ee=Ge.filter(Le=>{let Qe=Oe.length>0?Oe.map(Me=>ur(Le[Me])):[g("pivot.valueLabel")];return _r(Qe)===me.colKey});ne[me.id]=Sn(ee,me.valueItem.fieldId,me.valueItem.aggregation);}),ne},rt=[];if(Ke.length===0)rt.push({key:"root",value:g("pivot.resultLabel")||zu,children:[],isLeaf:true,aggregatedValues:Be(B),path:[],depth:0});else {let Ge=(ne,me,ee)=>{if(me>=Ke.length)return [];let Le=Ke[me],Qe=new Map;return ne.forEach(Me=>{let Ye=ur(Me[Le]);Qe.has(Ye)||Qe.set(Ye,[]),Qe.get(Ye).push(Me);}),Array.from(Qe.keys()).sort().map(Me=>{let Ye=Qe.get(Me),Pt=[...ee,Me];return {key:_r(Pt),value:Me,fieldId:Le,aggregatedValues:Be(Ye),children:Ge(Ye,me+1,Pt),isLeaf:me===Ke.length-1,path:Pt,depth:me}})};rt.push(...Ge(B,0,[]));}return {dataColumns:K,columnTree:pe,rowTree:rt}},[Oe,M,B,I,Ke,g,ye]),fe=eo.useCallback((N,G)=>(b.current+=1,{tokenId:`v${b.current}`,fieldId:N,aggregation:Co(G,M.get(N))}),[M]),Pe=eo.useCallback(N=>{if(N==="rows")return bt([]);if(N==="columns")return Nt([]);if(N==="filters")return lt([]);Ft([]);},[]),et=eo.useCallback((N,G)=>{if(N==="rows")return bt(K=>K.filter(pe=>pe!==G));if(N==="columns")return Nt(K=>K.filter(pe=>pe!==G));if(N==="filters")return lt(K=>K.filter(pe=>pe!==G));Ft(K=>K.filter(pe=>pe.tokenId!==G));},[]),Xe=eo.useCallback((N,G)=>{Ft(K=>K.map(pe=>pe.tokenId===N?{...pe,aggregation:Co(G,M.get(pe.fieldId))}:pe));},[M]),kt=eo.useCallback(N=>{wt(String(N.active.id));},[]),ht=eo.useCallback(N=>{if(wt(null),!N.over)return;let G=ji(String(N.active.id)),K=ji(String(N.over.id));if(!G||!K||G.kind!=="item"||!G.key)return;if(G.zone===K.zone&&K.kind==="item"){if(G.zone==="rows"){let Me=Ke.indexOf(G.key),Ye=Ke.indexOf(K.key??"");Me!==-1&&Ye!==-1&&Me!==Ye&&bt(Pt=>sortable.arrayMove(Pt,Me,Ye));return}if(G.zone==="columns"){let Me=Oe.indexOf(G.key),Ye=Oe.indexOf(K.key??"");Me!==-1&&Ye!==-1&&Me!==Ye&&Nt(Pt=>sortable.arrayMove(Pt,Me,Ye));return}if(G.zone==="filters"){let Me=de.indexOf(G.key),Ye=de.indexOf(K.key??"");Me!==-1&&Ye!==-1&&Me!==Ye&&lt(Pt=>sortable.arrayMove(Pt,Me,Ye));return}if(G.zone==="values"){let Me=ye.findIndex(Pt=>Pt.tokenId===G.key),Ye=ye.findIndex(Pt=>Pt.tokenId===(K.key??""));Me!==-1&&Ye!==-1&&Me!==Ye&&Ft(Pt=>sortable.arrayMove(Pt,Me,Ye));}return}let pe=K.zone,Be=[...Ke],rt=[...Oe],Ge=[...de],ne=[...ye],me="",ee=null;if(G.zone==="palette")me=G.key;else if(G.zone==="values"){let Me=ne.find(Ye=>Ye.tokenId===G.key);if(!Me)return;me=Me.fieldId,ee=Me,ne=ne.filter(Ye=>Ye.tokenId!==G.key);}else G.zone==="rows"?(me=G.key,Be=Be.filter(Me=>Me!==me)):G.zone==="columns"?(me=G.key,rt=rt.filter(Me=>Me!==me)):G.zone==="filters"&&(me=G.key,Ge=Ge.filter(Me=>Me!==me));if(!me)return;let Le=()=>{Be=Be.filter(Me=>Me!==me),rt=rt.filter(Me=>Me!==me),Ge=Ge.filter(Me=>Me!==me);},Qe=Me=>{if(K.kind!=="item"||!K.key)return Me==="rows"?Be.length:Me==="columns"?rt.length:Me==="filters"?Ge.length:Me==="values"?ne.length:0;if(Me==="rows"){let Ye=Be.indexOf(K.key);return Ye>=0?Ye:Be.length}if(Me==="columns"){let Ye=rt.indexOf(K.key);return Ye>=0?Ye:rt.length}if(Me==="filters"){let Ye=Ge.indexOf(K.key);return Ye>=0?Ye:Ge.length}if(Me==="values"){let Ye=ne.findIndex(Pt=>Pt.tokenId===K.key);return Ye>=0?Ye:ne.length}return 0};if(pe==="palette"){bt(Be),Nt(rt),lt(Ge),Ft(ne);return}if(pe==="values"){let Me=Qe("values"),Ye=ee??fe(me);ne.splice(Me,0,Ye),bt(Be),Nt(rt),lt(Ge),Ft(ne);return}if(Uu(pe)){Le();let Me=Qe(pe);pe==="rows"?Be.splice(Me,0,me):pe==="columns"?rt.splice(Me,0,me):Ge.splice(Me,0,me),bt(Be),Nt(rt),lt(Ge),Ft(ne);}},[Oe,fe,de,Ke,ye]),gt=eo.useCallback((N,G)=>{Zt(K=>({...K,[N]:G}));},[]),Ct=eo.useCallback(N=>{Ot(G=>{let K=new Set(G);return K.has(N)?K.delete(N):K.add(N),K});},[]),no=eo.useCallback(N=>{oe(G=>{let K=new Set(G);return K.has(N)?K.delete(N):K.add(N),K});},[]),Et=eo.useCallback(N=>{let G=M.get(N.fieldId),K=Nl(G);return e(Cr,{size:"small",sx:{minWidth:98},children:e(zt,{value:N.aggregation,onChange:pe=>Xe(N.tokenId,pe.target.value),onClick:pe=>pe.stopPropagation(),onMouseDown:pe=>pe.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:K.map(pe=>e("option",{value:pe,sx:{fontSize:"0.75rem"},children:I(pe)},pe))})})},[M,I,Xe]),jt=eo.useCallback(N=>{let G=yt[N]??[],K=te[N]??G;return G.length===0?g("pivot.filter.noValues"):K.length===0?g("pivot.filter.noneSelected"):K.length===G.length?g("pivot.filter.allValues"):g("pivot.filter.selectedCount",{selected:K.length,total:G.length})},[yt,te,g]),Ht=eo.useCallback(N=>{let G=yt[N]??[],K=te[N]??G;return e(Yu,{options:G,selectedValues:K,onChange:pe=>gt(N,pe)})},[yt,te,gt]),Kt=eo.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),$t=eo.useCallback(()=>{let N={};return new Set([...Mt,...Object.keys(te)]).forEach(K=>{if(!w.has(K))return;let pe=te[K]??[];N[K]=[...pe];}),{layout:{rows:[...Ke],columns:[...Oe],filters:[...de],values:ye.map(K=>({fieldId:K.fieldId,aggregation:K.aggregation}))},filterSelections:N,showGrandTotal:ve,chart:{dimensionFieldId:Je,primaryValueFieldId:st,secondaryValueFieldId:pt,chartType:Bt}}},[Mt,Je,st,pt,Bt,Oe,de,te,Ke,ve,w,ye]),oo=eo.useCallback(N=>{let G=lo(N.layout.rows,w),K=lo(N.layout.columns,w),pe=lo(N.layout.filters,w),Be=new Set,rt=(N.layout.values??[]).filter(me=>!w.has(me.fieldId)||Be.has(me.fieldId)?false:(Be.add(me.fieldId),true)).map(me=>fe(me.fieldId,me.aggregation)),Ge={};Object.entries(N.filterSelections??{}).forEach(([me,ee])=>{!w.has(me)||!Array.isArray(ee)||(Ge[me]=Array.from(new Set(ee.map(Le=>String(Le)))));}),bt(G),Nt(K),lt(pe),Ft(rt),Zt(Ge),typeof N.showGrandTotal=="boolean"&&Z(N.showGrandTotal),j(Ol(G,K,N.chart?.dimensionFieldId));let ne=as(rt,N.chart?.primaryValueFieldId);he(ne),xe(Fl(rt,ne,N.chart?.secondaryValueFieldId)),Ee(N.chart?.chartType??"bar-vertical"),q(N.id),y?.(N);},[fe,y,j,he,xe,Ee,Nt,lt,Zt,bt,Z,Ft,w]),ao=eo.useCallback(N=>{if(!N){q("");return}let G=St.find(K=>K.id===N);if(!G){q("");return}oo(G);},[oo,St]),bo=eo.useCallback(()=>{let N=g("pivot.preset.defaultName",{index:St.length+1});at(N),Ce(true);},[St.length,g]),Ro=eo.useCallback(()=>{let N=Fe.trim();if(!N)return;let G={id:Kt(),name:N,...$t()};je(K=>[...K,G]),q(G.id),Ce(false);},[$t,Kt,Fe,je]),Mo=eo.useCallback(()=>{it&&(je(N=>N.filter(G=>G.id!==it)),q(""));},[it,je]);eo.useEffect(()=>{if(!v||C.current)return;let N=St.find(G=>G.id===v);N&&(C.current=true,oo(N));},[oo,v,St]),eo.useEffect(()=>{it&&(St.some(N=>N.id===it)||q(""));},[it,St]);let ir=eo.useMemo(()=>{if(!ve||!Q||!Ke.length)return null;let N={};return Q.dataColumns.forEach(G=>{let K=B.filter(pe=>{let Be=Oe.length>0?Oe.map(rt=>ur(pe[rt])):[g("pivot.valueLabel")];return _r(Be)===G.colKey});N[G.id]=Sn(K,G.valueItem.fieldId,G.valueItem.aggregation);}),{key:"__grand_total__",value:g("pivot.grandTotal")||Vu,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:N,path:[],depth:-1}},[ve,Q,B,Oe,Ke.length,g]),xo=eo.useMemo(()=>sm(Q?.rowTree??[]),[Q]),Bo=eo.useMemo(()=>sm(Q?.columnTree??[]),[Q]);eo.useEffect(()=>{Ot(N=>{let G=new Set;return N.has("__grand_total__")&&G.add("__grand_total__"),xo.forEach(K=>{N.has(K)&&G.add(K);}),G});},[xo]),eo.useEffect(()=>{oe(N=>{let G=new Set;return Bo.forEach(K=>{N.has(K)&&G.add(K);}),G});},[Bo]);let qr=eo.useCallback(()=>{Ot(N=>{let G=new Set(N);return xo.forEach(K=>G.add(K)),G});},[xo]),Xr=eo.useCallback(()=>{Ot(N=>{let G=new Set;return N.has("__grand_total__")&&G.add("__grand_total__"),G});},[]),Lr=eo.useCallback(()=>{oe(new Set(Bo));},[Bo]),Yr=eo.useCallback(()=>{oe(new Set);},[]),Zr=eo.useMemo(()=>!Q||Oe.length===0?[]:cy(Q.columnTree,At),[Oe.length,At,Q]),Do=eo.useMemo(()=>{if(!Q)return [];if(Oe.length===0)return Q.dataColumns.map(G=>({id:G.id,label:G.label,leafColumnIds:[G.id],valueItem:G.valueItem}));let N=new Map(Q.dataColumns.map(G=>[G.id,G]));return Zr.flatMap(G=>{let K=new Map;return G.leafColumnIds.forEach(pe=>{let Be=N.get(pe);if(!Be)return;let rt=Be.valueItem.tokenId,Ge=`${I(Be.valueItem.aggregation)} ${M.get(Be.valueItem.fieldId)?.label??Be.valueItem.fieldId}`,ne=K.get(rt);if(ne){ne.leafColumnIds.push(pe);return}K.set(rt,{id:`${G.key}::${rt}`,label:ye.length>1?Ge:G.label,leafColumnIds:[pe],valueItem:Be.valueItem});}),Array.from(K.values())})},[Oe.length,M,I,Q,ye.length,Zr]),Or=eo.useMemo(()=>new Map(Do.map(N=>[N.id,N])),[Do]),jr=eo.useMemo(()=>Do.map(N=>({id:N.id,colKey:N.id,valueItem:N.valueItem,label:N.label})),[Do]),Xo=eo.useMemo(()=>{if(!Q||Oe.length===0)return [];let N=[],G=lm(Q.columnTree,At),K=G+(ye.length>1?1:0),pe=(Be,rt)=>{N[rt]??(N[rt]=[]),Be.forEach(Ge=>{let ne=Ge.children.length>0&&At.has(Ge.key),me=Do.filter(Le=>Ge.leafColumnIds.some(Qe=>Le.leafColumnIds.includes(Qe))).length,ee=ne||ye.length>1?1:K-rt;N[rt].push({key:Ge.key,label:Ge.label,colSpan:me,rowSpan:ee,expandable:Ge.children.length>0,expanded:ne}),ne&&pe(Ge.children,rt+1);});};return pe(Q.columnTree,0),ye.length>1&&(N[G]=Do.map(Be=>({key:Be.id,label:Be.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),N},[Oe.length,At,Q,ye.length,Do]),sr=eo.useCallback((N,G)=>G.leafColumnIds.reduce((K,pe)=>K+(N.aggregatedValues[pe]??0),0),[]),On=eo.useMemo(()=>c(jsxRuntime.Fragment,{children:[e(ke,{size:"small",variant:"text",onClick:qr,disabled:xo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandRowsAll")}),e(ke,{size:"small",variant:"text",onClick:Xr,disabled:xo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseRowsAll")}),e(Dt,{orientation:"vertical",flexItem:true}),e(ke,{size:"small",variant:"text",onClick:Lr,disabled:Bo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandColumnsAll")}),e(ke,{size:"small",variant:"text",onClick:Yr,disabled:Oe.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseColumnsAll")})]}),[Oe.length,Bo.size,xo.size,Yr,Xr,Lr,qr,g]),Fr=()=>{if(!Ze)return null;let N=ji(Ze);if(!N||N.kind!=="item"||!N.key)return null;if(N.zone==="palette"){let Be=M.get(N.key);return Be?e(Al,{label:Be.label,subtitle:Be.type}):null}if(N.zone==="values"){let Be=ye.find(me=>me.tokenId===N.key);if(!Be)return null;let Ge=M.get(Be.fieldId)?.label??Be.fieldId,ne=`${I(Be.aggregation)}(${Ge})`;return e(Ji,{label:Ge,caption:ne})}let K=M.get(N.key)?.label??N.key,pe=jt(N.key);return e(Ji,{label:K,caption:pe})};return c(Ae,{sx:N=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${N.palette.divider}`,bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-2)",display:"flex",flexDirection:"column",gap:2.25}),children:[c("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[c("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.35},children:[e(L,{component:"div",sx:{fontSize:"1.08rem",fontWeight:700,lineHeight:1.25,color:"var(--orb-fg-strong)"},children:k}),e(L,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.subtitle.default")})]}),c(se,{direction:"row",spacing:1.5,alignItems:"center",children:[Wt&&c(jsxRuntime.Fragment,{children:[e(Cr,{size:"small",sx:{minWidth:200},children:c(zt,{value:it,displayEmpty:true,onChange:N=>ao(String(N.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("pivot.preset.selectPlaceholder")}),St.map(N=>e("option",{value:N.id,sx:{fontSize:"0.75rem"},children:N.name},N.id))]})}),e(ct,{title:g("pivot.preset.save"),children:e(ie,{size:"small",onClick:bo,"aria-label":g("pivot.preset.save"),sx:{width:28,height:28,p:0},children:e(Pr,{size:15})})}),e(ct,{title:g("pivot.preset.delete"),children:e("span",{children:e(ie,{size:"small",onClick:Mo,disabled:!it,"aria-label":g("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:e(ci,{size:15})})})}),e(Dt,{flexItem:true,orientation:"vertical"})]}),c(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)"},children:[g("pivot.records"),": ",e("strong",{children:o.length.toLocaleString()})," / ",g("pivot.afterFilter"),":"," ",e("strong",{children:B.length.toLocaleString()})]}),e(Dt,{flexItem:true,orientation:"vertical"}),c("div",{sx:{display:"flex",alignItems:"center",gap:.6},children:[e(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:500,color:"var(--orb-fg-strong)"},children:g("pivot.grandTotal")}),e(ai,{size:"small",checked:ve,onChange:N=>Z(N.target.checked)})]})]})]}),e(Dt,{}),c(core.DndContext,{sensors:x,collisionDetection:core.closestCenter,onDragStart:kt,onDragEnd:ht,children:[e(Qu,{isConfiguratorCollapsed:Ne,onToggleCollapse:()=>$(N=>!N),availableFields:ft,fieldMap:M,filterFields:de,columnFields:Oe,rowFields:Ke,valueFields:ye,clearZone:Pe,removeFieldFromZone:et,getFilterSelectionSummary:jt,renderDimensionFilterSelect:Ht,renderAggregationSelect:Et,getAggregationLabel:I}),e(Hd,{children:e(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Fr()})})]}),e(am,{rows:B,fieldMap:M,rowFields:Ke,columnFields:Oe,valueFields:ye,chartDimensionFieldId:Je,chartPrimaryValueFieldId:st,chartSecondaryValueFieldId:pt,chartType:Bt,isCollapsed:Yt,onChartDimensionFieldIdChange:N=>j(N),onChartPrimaryValueFieldIdChange:N=>he(N),onChartSecondaryValueFieldIdChange:N=>xe(N),onChartTypeChange:N=>Ee(N),onToggleCollapse:()=>_e(N=>!N),getAggregationLabel:I}),e(Tn,{title:g("pivot.table.sectionTitle"),subtitle:Ke.length>0?Ke.map(N=>M.get(N)?.label??N).join(" > "):g("pivot.table.dimensions"),collapsed:Vt,onToggleCollapse:()=>qe(N=>!N),expandAriaLabel:g("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:On,children:Q===null?e("div",{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:S})}):e("div",{sx:{maxHeight:s},children:c("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[e("thead",{children:(Xo.length>0?Xo:[[]]).map((N,G)=>c("tr",{children:[G===0&&e("td",{rowSpan:Math.max(Xo.length,1),sx:K=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:vt()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${K.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:Ke.length>0?Ke.map(K=>M.get(K)?.label).join(" > "):g("pivot.table.dimensions")}),(N.length>0?N:Do.map(K=>({key:K.id,label:K.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(K=>e("td",{align:"center",colSpan:K.colSpan,rowSpan:K.rowSpan,sx:pe=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:vt()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${pe.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:c("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[K.expandable&&e(ie,{size:"small",onClick:()=>no(K.key),sx:{width:22,height:22,p:0,ml:-0.2},children:K.expanded?e($o,{size:12}):e(kr,{size:12})}),e("div",{component:"span",children:K.label})]})},K.key))]},`pivot-header-row-${G}`))}),c("tbody",{children:[Q.rowTree.map(N=>e(rs,{node:N,dataColumns:jr,fieldMap:M,level:0,expandedKeys:Rt,onToggle:Ct,getValue:(G,K)=>{let pe=Or.get(K);return pe?sr(G,pe):0}},N.key)),ir&&e(rs,{node:ir,dataColumns:jr,fieldMap:M,level:0,expandedKeys:Rt,onToggle:Ct,getValue:(N,G)=>{let K=Or.get(G);return K?sr(N,K):0}})]})]})})}),c(Lt,{open:De,onClose:()=>Ce(false),maxWidth:"xs",fullWidth:true,children:[e("div",{className:"orb-dialog-title",children:g("pivot.preset.saveDialogTitle")}),e("div",{className:"orb-dialog-content",children:e(ze,{autoFocus:true,fullWidth:true,margin:"dense",label:g("pivot.preset.nameLabel"),value:Fe,onChange:N=>at(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),Ro());}})}),c("div",{className:"orb-dialog-actions",children:[e(ke,{onClick:()=>Ce(false),children:g("common.cancel")}),e(ke,{variant:"contained",onClick:Ro,disabled:!Fe.trim(),children:g("common.save")})]})]})]})};var cm=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},Hl=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",dm=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",LO=({fields:t,initialLayout:o,initialFilterSelections:r={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:l=false})=>{let d=eo.useRef(0),p=eo.useMemo(()=>new Set(t.map(q=>q.id)),[t]),m=eo.useMemo(()=>new Map(t.map(q=>[q.id,q])),[t]),[f,h]=eo.useState(()=>lo(o?.rows,p)),[u,v]=eo.useState(()=>lo(o?.columns,p)),[y,g]=eo.useState(()=>lo(o?.filters,p)),[x,b]=eo.useState(()=>{let q=o?.values??[],De=new Set,Ce=[];return q.forEach(Fe=>{!p.has(Fe.fieldId)||De.has(Fe.fieldId)||(De.add(Fe.fieldId),d.current+=1,Ce.push({tokenId:`v${d.current}`,fieldId:Fe.fieldId,aggregation:Co(Fe.aggregation,m.get(Fe.fieldId))}));}),Ce}),[C,k]=eo.useState(r),[S,T]=eo.useState(n),[I,w]=eo.useState(a),[M,A]=eo.useState(()=>cm(lo(o?.rows,p),lo(o?.columns,p),i?.dimensionFieldId)),[R,D]=eo.useState(()=>{let q=(()=>{let De=o?.values??[],Ce=new Set,Fe=[];return De.forEach(at=>{!p.has(at.fieldId)||Ce.has(at.fieldId)||(Ce.add(at.fieldId),Fe.push({tokenId:at.fieldId,fieldId:at.fieldId,aggregation:Co(at.aggregation,m.get(at.fieldId))}));}),Fe})();return Hl(q,i?.primaryValueFieldId)}),[E,O]=eo.useState(()=>{let q=(()=>{let Ce=o?.values??[],Fe=new Set,at=[];return Ce.forEach(Ze=>{!p.has(Ze.fieldId)||Fe.has(Ze.fieldId)||(Fe.add(Ze.fieldId),at.push({tokenId:Ze.fieldId,fieldId:Ze.fieldId,aggregation:Co(Ze.aggregation,m.get(Ze.fieldId))}));}),at})(),De=Hl(q,i?.primaryValueFieldId);return dm(q,De,i?.secondaryValueFieldId)}),[_,J]=eo.useState(i?.chartType??"bar-vertical"),[F,V]=eo.useState(s),[z,X]=eo.useState(l);eo.useEffect(()=>{h(q=>{let De=q.filter(Ce=>p.has(Ce));return mr(q,De)?q:De}),v(q=>{let De=q.filter(Ce=>p.has(Ce));return mr(q,De)?q:De}),g(q=>{let De=q.filter(Ce=>p.has(Ce));return mr(q,De)?q:De}),b(q=>{let De=q.filter(Ce=>p.has(Ce.fieldId)).map(Ce=>({...Ce,aggregation:Co(Ce.aggregation,m.get(Ce.fieldId))}));return Qi(q,De)?q:De});},[m,p]),eo.useEffect(()=>{A(q=>cm(f,u,q));},[u,f]),eo.useEffect(()=>{D(q=>Hl(x,q));},[x]),eo.useEffect(()=>{O(q=>dm(x,R,q));},[R,x]);let W=eo.useCallback(q=>{h(lo(q,p));},[p]),H=eo.useCallback(q=>{v(lo(q,p));},[p]),U=eo.useCallback(q=>{g(lo(q,p));},[p]),Y=eo.useCallback(q=>{b(De=>{let Ce=q??[],Fe=new Set,at=[];return Ce.forEach(Ze=>{if(!p.has(Ze.fieldId)||Fe.has(Ze.fieldId))return;Fe.add(Ze.fieldId);let wt=De.find(Rt=>Rt.fieldId===Ze.fieldId);if(wt){at.push({...wt,aggregation:Co(Ze.aggregation??wt.aggregation,m.get(Ze.fieldId))});return}d.current+=1,at.push({tokenId:`v${d.current}`,fieldId:Ze.fieldId,aggregation:Co(Ze.aggregation,m.get(Ze.fieldId))});}),at});},[m,p]),ue=eo.useCallback(q=>{W(q.rows??[]),H(q.columns??[]),U(q.filters??[]),Y(q.values??[]);},[H,U,W,Y]),re=eo.useCallback(q=>{if(q==="rows")return h([]);if(q==="columns")return v([]);if(q==="filters")return g([]);b([]);},[]),ge=eo.useCallback((q,De)=>{if(q==="rows")return h(Ce=>Ce.filter(Fe=>Fe!==De));if(q==="columns")return v(Ce=>Ce.filter(Fe=>Fe!==De));if(q==="filters")return g(Ce=>Ce.filter(Fe=>Fe!==De));b(Ce=>Ce.filter(Fe=>Fe.tokenId!==De));},[]),we=eo.useCallback((q,De)=>{b(Ce=>Ce.map(Fe=>Fe.tokenId===q?{...Fe,aggregation:Co(De,m.get(Fe.fieldId))}:Fe));},[m]),Ve=eo.useCallback((q,De)=>{k(Ce=>({...Ce,[q]:De}));},[]),Te=eo.useCallback(()=>{k({});},[]),Ie=eo.useCallback(()=>{T(q=>!q);},[]),He=eo.useCallback(()=>{w(q=>!q);},[]),ce=eo.useCallback(q=>{A(q);},[]),be=eo.useCallback(q=>{D(q);},[]),We=eo.useCallback(q=>{O(q);},[]),tt=eo.useCallback(()=>{V(q=>!q);},[]),nt=eo.useCallback(()=>{X(q=>!q);},[]);return {model:eo.useMemo(()=>({rowFields:f,setRowFields:h,columnFields:u,setColumnFields:v,filterFields:y,setFilterFields:g,valueFields:x,setValueFields:b,filterSelections:C,setFilterSelections:k,showGrandTotal:S,setShowGrandTotal:T,isConfiguratorCollapsed:I,setIsConfiguratorCollapsed:w,chartDimensionFieldId:M,setChartDimensionFieldId:A,chartPrimaryValueFieldId:R,setChartPrimaryValueFieldId:D,chartSecondaryValueFieldId:E,setChartSecondaryValueFieldId:O,chartType:_,setChartType:J,isChartCollapsed:F,setIsChartCollapsed:V,isTableCollapsed:z,setIsTableCollapsed:X}),[M,R,E,_,u,y,C,F,I,z,f,S,x]),actions:{setRows:W,setColumns:H,setFilters:U,setValues:Y,setLayout:ue,clearZone:re,removeFieldFromZone:ge,setAggregationForValue:we,setFilterSelection:Ve,resetFilterSelections:Te,toggleGrandTotal:Ie,toggleConfigurator:He,setChartDimension:ce,setChartPrimaryValue:be,setChartSecondaryValue:We,setChartType:J,toggleChart:tt,toggleTable:nt}}};var HO=({orientation:t="auto",defaultNavigationOpen:o,onNavOpenChange:r}={})=>{let n=so(),a=xr("(orientation: portrait)"),i=xr(n.breakpoints.down("md")),s=eo.useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[l,d]=eo.useState(o??s==="landscape");eo.useEffect(()=>{d(o??s==="landscape");},[o,s]);let p=f=>{d(f),r?.(f);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:l,setNavigationOpen:p,toggleNavigationOpen:()=>p(!l)}};var fy=t=>{let o=Number(t||0);return Number.isFinite(o)?o:0},WO=({rows:t,rowKey:o="id",numericField:r,defaultSelectedId:n})=>{let i=t[0]?.[o],[s,l]=eo.useState(n??i),d=eo.useMemo(()=>t.find(u=>u[o]===s)||t[0],[o,t,s]),[p,m]=eo.useState(()=>{let u=d?.[r];return u==null?"0":String(u)});return {selectedId:s,selectedRecord:d,editorValue:p,setEditorValue:m,selectRecord:u=>{let v=u[o];l(v);let y=u[r];m(y==null?"0":String(y));},applyEditorValue:u=>{if(s===void 0)return;let v=fy(p),y=t.map(g=>g[o]===s?{...g,[r]:v}:g);u(y);}}};P();var hy=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],um=(t,o,r,n)=>{o?.(t),n&&r?.();},qO=({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=hy,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:l=true,scanIntervalMs:d=600,confirmLabel:p="Use code",cancelLabel:m="Close",manualPlaceholder:f="Enter barcode manually",onDetected:h,onError:u,sx:v})=>{let y=eo__namespace.default.useRef(null),g=eo__namespace.default.useRef(null),x=eo__namespace.default.useRef(null),b=eo__namespace.default.useRef(null),[C,k]=eo__namespace.default.useState("idle"),[S,T]=eo__namespace.default.useState(""),[I,w]=eo__namespace.default.useState(null),[M,A]=eo__namespace.default.useState(null),R=eo__namespace.default.useCallback(()=>{x.current!==null&&(window.clearInterval(x.current),x.current=null),g.current&&(g.current.getTracks().forEach(O=>O.stop()),g.current=null),y.current&&(y.current.srcObject=null);},[]),D=eo__namespace.default.useCallback(O=>{A(O),k("error"),u?.(O);},[u]);eo__namespace.default.useEffect(()=>{if(!t){R(),k("idle"),A(null),T("");return}let O=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){k("unsupported"),A("Camera access is not supported in this browser.");return}k("starting"),A(null);try{let J=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(O){J.getTracks().forEach(F=>F.stop());return}if(g.current=J,y.current&&(y.current.srcObject=J,await y.current.play()),!window.BarcodeDetector){k("unsupported"),A("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}b.current=new window.BarcodeDetector({formats:a}),k("ready"),x.current=window.setInterval(async()=>{if(!(!y.current||!b.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let V=(await b.current.detect(y.current)).find(X=>X.rawValue);if(!V?.rawValue)return;let z={rawValue:V.rawValue,format:V.format};w(z),R(),um(z,h,o,l);}catch(F){D(F instanceof Error?F.message:"Failed to detect barcode.");}},d);}catch(J){D(J instanceof Error?J.message:"Unable to start camera.");}}})(),()=>{O=true,R();}},[l,i,a,o,h,t,D,d,R]);let E=()=>{let O=S.trim();if(!O)return;let _={rawValue:O,format:"manual"};w(_),um(_,h,o,l);};return c(Lt,{open:t,onClose:o,fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:900},children:r}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c(se,{spacing:2,sx:v,children:[e(L,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),c(Ae,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:vt()==="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:[e("video",{ref:y,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),e("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:e("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:e("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)"}})})}),c("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[e(xt,{icon:e(jd,{}),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?e(xt,{icon:e(hp,{}),label:`${I.format||"barcode"}: ${I.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),M?e(Jo,{severity:C==="unsupported"?"info":"warning",children:M}):null,s?c(se,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[e(ze,{fullWidth:true,label:"Barcode",placeholder:f,value:S,onChange:O=>T(O.target.value)}),e(ke,{variant:"contained",onClick:E,sx:{minHeight:56,px:2.5},children:p})]}):null]})}),e("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:e(ke,{onClick:o,children:m})})]})};P();var by={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)"},eF=({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:f=88,startAction:h,endAction:u,dragHandleProps:v,onClick:y,onSwipe:g,sx:x})=>{let[b,C]=eo.useState(0),[k,S]=eo.useState(false),T=eo.useRef(null),I=eo.useRef(0),w=eo.useRef(0),M=!!(h||u),A=132,R=()=>{C(0),S(false),T.current=null,I.current=0,w.current=0;},D=F=>{(F==="start"?h:u)?.onTrigger?.(),g?.(F),R();},E=F=>{!M||F.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(T.current=F.pointerId,I.current=F.clientX,w.current=F.clientX,S(true),F.currentTarget.setPointerCapture(F.pointerId));},O=F=>{if(!k||T.current!==F.pointerId)return;w.current=F.clientX;let V=w.current-I.current,z=Math.max(-A,Math.min(A,V));C(z);},_=F=>{if(!k||T.current!==F.pointerId)return;let V=w.current-I.current;if(V>=f&&h){D("start");return}if(V<=-f&&u){D("end");return}Math.abs(V)<12&&y?.(),R();},J=(F,V)=>{if(!F)return null;let z=F.backgroundColor||by[F.tone||"default"];return e("div",{sx:{position:"absolute",top:0,bottom:0,[V]:0,width:A,px:2,display:"flex",alignItems:"center",justifyContent:V==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${z}, rgba(15,23,42,0.92))`},children:c(se,{direction:"row",spacing:1,alignItems:"center",children:[F.icon,e(L,{sx:{fontWeight:700,fontSize:"0.95rem"},children:F.label})]})})};return c("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[J(h,"left"),J(u,"right"),e(Ae,{elevation:0,onPointerDown:E,onPointerMove:O,onPointerUp:_,onPointerCancel:R,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:vt()==="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}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:c(se,{spacing:1.5,children:[c(se,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[n?e("div",{sx:{mt:.25},children:n}):null,c("div",{sx:{flex:1,minWidth:0},children:[r?e(L,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:r}):null,e(L,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),o?e(L,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:o}):null]}),p?e("div",{"data-no-swipe":"true",...v,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:e(ie,{size:"small",children:e(ap,{})})}):null]}),a.length>0?e(se,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((F,V)=>e(xt,{label:F,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},V))}):null,i.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(F=>c(Ae,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:F.label}),e(L,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:F.value})]},F.id))}):null,l,s]})})]})};P();var fa=({label:t,onPress:o,emphasis:r="default"})=>e("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"?vt()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":vt()==="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}),lF=({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:f,onSubmit:h,onClose:u,sx:v})=>{let{t:y}=le(),[g,x]=eo.useState(o),b=t??g,C=R=>{t===void 0&&x(R),f?.(R);},k=R=>{l&&b.length>=l||C(`${b}${R}`);},S=R=>{if(R==="00"){if(!b){C("0");return}k("00");return}k(R);},T=()=>{!i||b.includes(".")||C(b?`${b}.`:"0.");},I=()=>{if(s){if(b.startsWith("-")){C(b.slice(1));return}C(b?`-${b}`:"-");}},w=()=>{C(b.slice(0,-1));},M=()=>{C("");},A=()=>{h?.(b);};return e(Ae,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...v},children:c(se,{spacing:2,children:[c(se,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[c("div",{sx:{minWidth:0},children:[r?e(L,{sx:{fontSize:"1rem",fontWeight:800},children:r}):null,n?e(L,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),u?e(ie,{onClick:u,size:"small",children:e(rp,{})}):null]}),e(Ae,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:e(L,{sx:{minHeight:38,fontSize:b?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:b?"text.primary":"text.disabled"},children:b||a})}),c("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(R=>e(fa,{label:R,onPress:()=>S(R)},R)),e(fa,{label:s?"+/-":"00",onPress:s?I:()=>S("00")}),e(fa,{label:"0",onPress:()=>S("0")}),e(fa,{label:i?".":m?String(m):"DEL",onPress:i?T:w})]}),c("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[e("div",{component:"button",type:"button",onClick:w,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:c(se,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e(Zd,{}),e(L,{sx:{fontWeight:700},children:m||"DEL"})]})}),e(fa,{label:String(p||"CLR"),onPress:M,emphasis:"danger"}),e("div",{component:"button",type:"button",onClick:A,sx:R=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:R.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:c(se,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e(Jd,{}),e(L,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};P();var gm=({touchMode:t="comfortable",sx:o,...r})=>{let n=t==="expanded";return e("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:e(_o,{...r})})};P();var wy=(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);}},fm=({items:t,selectedId:o,orientation:r="auto",onItemSelect:n,sx:a})=>{let i=so(),[s,l]=eo.useState(false);eo.useEffect(()=>{l(true);},[]);let d=xr("(orientation: portrait)"),p=xr(i.breakpoints.down("md")),m=r==="auto"?d||p?"portrait":"landscape":r,f=navigation.useRouter();return e("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 u=h.id===o,v=h.color||(u?i.palette.primary.main:i.palette.divider);return e(Ae,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:u?"primary.main":"divider",boxShadow:u?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:vt()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:e("div",{component:"button",type:"button",disabled:h.disabled,onClick:()=>wy(f,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:c(se,{spacing:1.5,sx:{height:"100%"},children:[c(se,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[e("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:u?"var(--orb-on-primary)":"text.primary",background:u?v:"action.hover"},children:h.icon||e(L,{sx:{fontSize:"1rem",fontWeight:900},children:h.title.slice(0,1).toUpperCase()})}),h.badge!==void 0?e("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:u?"primary.main":"action.hover",color:u?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:h.badge}):null]}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:h.title}),h.caption?e(L,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:h.caption}):null,h.description?e(L,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:h.description}):null]})]})})},h.id)})})};P();var vm=(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?vm(n.children,o):[];return (a||i.length>0)&&r.push({...n,children:i.length>0?i:n.children}),r},[]):t,Ty=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children?.length&&(o.add(a.id),r(a.children));});};return r(t),o},ym=({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:f}=le(),h=so(),u=No("(orientation: portrait)"),v=No(h.breakpoints.down("md")),y=s==="auto"?u||v?"portrait":"landscape":s,g=i==="dark",x=navigation.useRouter(),b=navigation.usePathname(),[C,k]=eo.useState(""),[S,T]=eo.useState(new Set),I=eo.useMemo(()=>vm(a,C),[a,C]),w=eo.useMemo(()=>C.trim()?Ty(I):S,[S,I,C]);eo.useEffect(()=>{t&&T(new Set);},[t]);let M=O=>O.appurl||O.href||"",A=O=>{m?.(O);let _=M(O);if(_){if(_.startsWith("http://")||_.startsWith("https://")){window.open(_,"_blank");return}x.push(_);}},R=O=>{let _=!!O.children?.length;if(t&&_){o?.();return}if(_){T(J=>{let F=new Set(J);return F.has(O.id)?F.delete(O.id):F.add(O.id),F});return}A(O);},D=O=>{let _=p||b,J=M(O);return !!(J&&_===J)},E=(O,_=0)=>{let J=!!O.children?.length,F=w.has(O.id),V=D(O);return e("div",{sx:{pl:_===0?0:1.5},children:c(Ae,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:V?"primary.main":"divider",bgcolor:V?"action.selected":"background.paper"},children:[c("div",{component:"button",type:"button",onClick:()=>R(O),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:[e(ri,{variant:"rounded",sx:{width:40,height:40,bgcolor:V?"primary.main":"action.hover",color:V?"var(--orb-on-primary)":"text.primary"},children:O.icon||(O.title||O.label||"?").slice(0,1).toUpperCase()}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:O.title||O.label}),O.description?e(L,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:O.description}):null]}),J?e(an,{sx:{transform:F?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):e(si,{color:"action"})]}),J?e(nn,{in:F,children:e("div",{sx:{px:1.25,pb:1.25},children:O.children?.map(z=>E(z,_+1))})}):null]})},O.id)};return t?e(Ae,{elevation:0,className:r,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflowY:"auto"},children:c(se,{spacing:1,children:[e(ie,{onClick:o,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:f("navigation.expand"),children:e(mi,{})}),a.map(O=>e(ie,{onClick:()=>R(O),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:D(O)?"primary.main":"action.hover",color:D(O)?"var(--orb-on-primary)":"text.primary"},children:O.icon||(O.title||O.label||"?").slice(0,1).toUpperCase()},O.id))]})}):e(Ae,{elevation:0,className:r,sx:{width:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g?"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:c(se,{spacing:1.25,sx:{flex:1,minHeight:0},children:[c(se,{direction:"row",spacing:1,alignItems:"center",children:[e(ze,{value:C,onChange:O=>k(O.target.value),placeholder:f("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:e(bp,{fontSize:"small",color:"action"})}}),y==="landscape"&&!t?e(ie,{onClick:o,sx:{bgcolor:"action.hover"},children:e(up,{})}):null]}),l,e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:I.length>0?I.map(O=>E(O)):e(L,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:f("navigation.noMatch")})}),d]})})};P();var Cm=(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)},Iy=t=>eo__namespace.default.isValidElement(t)?e("div",{sx:{display:"inline-flex",alignItems:"center"},children:t}):e(L,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:t}),Ry=(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)},My=({summaryRow:t,visibleColumns:o,columns:r})=>{let n=r.filter(a=>o.includes(a.id)&&t[a.id]!=="");return n.length===0?null:e(Ae,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:c(se,{spacing:1,children:[e(L,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:n.map(a=>c(Ae,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),e(L,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:t[a.id]})]},`summary-${a.id}`))})]})})},Dy=t=>{let{t:o}=le(),r=so(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:m=false,fullWidth:f=false,maxHeight:h,loading:u=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g,rowKey:x,tableKey:b="default",graphReport:C,quickCreate:k,quickEdit:S,quickDelete:T,serviceUrl:I,orientation:w="auto",cardTitleField:M,cardSubtitleFields:A,toolbarSlot:R,emptyState:D,rowHeight:E="comfortable",cardActionSlot:O,renderCardFooter:_,onRowClick:J}=t,F=n||o("table.title.default"),V=No("(orientation: portrait)"),z=No(r.breakpoints.down("md")),X=w==="auto"?V||z?"portrait":"landscape":w,{columns:W,filterText:H,setFilterText:U,visibleColumns:Y,showSummary:ue,setShowSummary:re,summaryColumns:ge,grouping:we,setGrouping:Ve,expandedGroups:Te,groupAnchorEl:Ie,setGroupAnchorEl:He,summaryAnchorEl:ce,setSummaryAnchorEl:be,anchorEl:We,setAnchorEl:tt,contextMenu:nt,sortedAndFilteredRows:it,summaryRow:q,visibleRows:De,page:Ce,setPage:Fe,rowsPerPage:at,setRowsPerPage:Ze,totalDisplayCount:wt,setSelected:Rt,handleClick:Ot,toggleSummaryColumn:At,handleExport:oe,handleCloseContextMenu:Ke,toggleColumnVisibility:Oe,toggleGroupExpand:de,handleExpandGroupRecursively:ye,handleCollapseGroupRecursively:te,handleLayoutLoad:ve,handleVariantLoad:Ne,handleLayoutSave:Je,effectiveAppId:st,currentLayoutData:pt,currentLayoutId:Bt,layoutIdToLoad:Yt,graphReportOpen:Vt,handleOpenGraphReport:St,handleCloseGraphReport:Wt}=bn(t),bt=C?.enabled??false,Nt=bt&&(C?.interaction?.enabled??true),lt=Ai(),Ft=x||"id",Zt=eo__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:ot(r.palette.divider,vt()==="dark"?.55:.3),bgcolor:vt()==="dark"?ot(r.palette.common.white,.06):ot(r.palette.background.paper,.92),color:r.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[r]),Z=eo__namespace.default.useMemo(()=>({...Zt,borderColor:ot(r.palette.primary.main,vt()==="dark"?.42:.24),bgcolor:vt()==="dark"?ot(r.palette.primary.main,.16):ot(r.palette.primary.main,.08)}),[Zt,r]),$=eo__namespace.default.useMemo(()=>{let ee=new Set(s);return it.filter(Le=>ee.has(Le?.[Ft]))},[Ft,s,it]),j=$.length===1?$[0]:null,he=!!k?.enabled,xe=!!S?.enabled,Ee=!!T?.enabled,_e=k?.fields,qe=k?.excludeFields||[],je=k?.initialValues||{},mt=S?.fields,ft=S?.excludeFields||[],Mt=S?.editableFields||[],yt=S?.nonEditableFields||[],B=S?.primaryKeys?.length?S.primaryKeys:[Ft],[Q,fe]=eo__namespace.default.useState(false),[Pe,et]=eo__namespace.default.useState(false),[Xe,kt]=eo__namespace.default.useState({}),[ht,gt]=eo__namespace.default.useState(false),[Ct,no]=eo__namespace.default.useState(false),[Et,jt]=eo__namespace.default.useState({}),[Ht,Kt]=eo__namespace.default.useState(false),[$t,oo]=eo__namespace.default.useState(false),ao=u||Pe||Ct||$t,bo=eo__namespace.default.useMemo(()=>{let ee=[...W];if(Array.isArray(_e)&&_e.length>0){let Le=new Set(_e);ee=ee.filter(Qe=>Le.has(Qe.id));}if(qe.length>0){let Le=new Set(qe);ee=ee.filter(Qe=>!Le.has(Qe.id));}return ee.filter(Le=>!!Le?.id)},[W,qe,_e]),Ro=eo__namespace.default.useMemo(()=>{let ee=[...W];if(Array.isArray(mt)&&mt.length>0){let Le=new Set(mt);ee=ee.filter(Qe=>Le.has(Qe.id));}if(ft.length>0){let Le=new Set(ft);ee=ee.filter(Qe=>!Le.has(Qe.id));}return ee.filter(Le=>!!Le?.id)},[W,ft,mt]),Mo=eo__namespace.default.useMemo(()=>new Set(B),[B]),ir=eo__namespace.default.useMemo(()=>new Set(Mt),[Mt]),xo=eo__namespace.default.useMemo(()=>new Set(yt),[yt]),Bo=eo__namespace.default.useCallback(ee=>ir.size>0?ir.has(ee):!(xo.has(ee)||Mo.has(ee)),[ir,xo,Mo]);eo__namespace.default.useEffect(()=>{!Vt&&lt.hasActiveFilters&&lt.clearAll();},[lt,Vt]);let qr=()=>{let ee={};bo.forEach(Le=>{ee[Le.id]=je[Le.id]??"";}),kt(ee),fe(true);},Xr=(ee,Le)=>{kt(Qe=>({...Qe,[ee]:Le}));},Lr=async()=>{if(!k?.onSubmit){fe(false);return}try{et(!0),await k.onSubmit(Xe),fe(!1);}finally{et(false);}},Yr=()=>{if(!j)return;let ee={};Ro.forEach(Qe=>{ee[Qe.id]=j[Qe.id]??"";});let Le=S?.getInitialValues?{...ee,...S.getInitialValues(j)}:ee;jt(Le),gt(true);},Zr=(ee,Le)=>{jt(Qe=>({...Qe,[ee]:Le}));},Do=async()=>{if(j){if(!S?.onSubmit){gt(false);return}try{no(!0),await S.onSubmit(Et,j),gt(!1);}finally{no(false);}}},Or=()=>{$.length!==0&&Kt(true);},jr=async()=>{if($.length===0){Kt(false);return}if(!T?.onConfirm){Kt(false),Rt([]),l?.([]);return}try{oo(!0),await T.onConfirm($),Kt(!1),Rt([]),l?.([]);}finally{oo(false);}},Xo=it,{fieldMapping:sr}=mn({rows:Xo,config:{...C,title:C?.title||`${F} ${o("graph.reportTitle")}`}}),On=eo__namespace.default.useMemo(()=>Nt?lt.applyRows(Xo,sr):Xo,[sr,lt,Nt,Xo]),{model:Fr}=mn({rows:On,config:{...C,title:C?.title||`${F} ${o("graph.reportTitle")}`,fieldMapping:sr}}),N=Fr.table.columns.map(ee=>({id:ee.id,label:ee.label,align:ee.align||"left",minWidth:120,numeric:ee.align==="right"})),G=st?e(hn,{appId:st,tableKey:b,currentLayoutData:pt,onLayoutLoad:ve,targetLayoutId:Yt,activeLayoutId:Bt,serviceUrl:I??g?.serviceUrl}):null,K=W.filter(ee=>Y.includes(ee.id)),pe=K.find(ee=>ee.id===M)||K[0],Be=A?.map(ee=>K.find(Le=>Le.id===ee)).filter(Boolean)||K.filter(ee=>ee.id!==pe?.id).slice(0,X==="portrait"?2:3),rt=K.filter(ee=>ee.id!==pe?.id&&!Be.some(Le=>Le.id===ee.id)),Ge=[R,p].filter(Boolean),ne=c(jsxRuntime.Fragment,{children:[e(pn,{groupAnchorEl:Ie,setGroupAnchorEl:He,grouping:we,setGrouping:Ve,columns:W}),e(un,{anchorEl:We,setAnchorEl:tt,columns:W,visibleColumns:Y,toggleColumnVisibility:Oe}),e(ki,{anchorEl:ce,setAnchorEl:be,showSummary:ue,setShowSummary:re,columns:W,summaryColumns:ge,toggleSummaryColumn:At}),e(Pi,{contextMenu:nt,handleCloseContextMenu:Ke,columns:W,visibleColumns:Y,toggleColumnVisibility:Oe})]}),me=(ee,Le,Qe)=>{let Me=s.includes(Le),Ye=X==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",Pt=Qe%2===0?ot(r.palette.primary.main,vt()==="dark"?.09:.04):ot(r.palette.primary.main,vt()==="dark"?.05:.022),Qr=ot(r.palette.divider,.22);return e(Ae,{elevation:0,onClick:()=>{Ot({},ee),J?.(ee);},sx:{p:E==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Me?ot(r.palette.primary.main,.38):Qr,background:Me?`linear-gradient(135deg, ${ot(r.palette.primary.main,.13)}, ${ot(r.palette.primary.main,.06)})`:`linear-gradient(135deg, ${Pt}, ${ot(r.palette.primary.main,.015)})`,boxShadow:Me?`0 12px 30px ${ot(r.palette.primary.main,.2)}`:`0 3px 10px ${ot(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?ot(r.palette.primary.main,.26):ot(r.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${ot(r.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:c(se,{spacing:1.25,children:[c(se,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?e(It,{checked:Me,onClick:So=>So.stopPropagation(),onChange:()=>Ot({},ee),sx:{mt:-0.6,ml:-0.6}}):null,c("div",{sx:{flex:1,minWidth:0},children:[pe?e(L,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Cm(pe,ee)}):null,Be.length>0?e(se,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Be.map(So=>e(xt,{label:`${So.label}: ${Ry(So,ee)}`,size:"small",variant:"outlined",sx:Zt},`${Le}-${So.id}`))}):null]}),O?e("div",{onClick:So=>So.stopPropagation(),children:O(ee)}):null]}),rt.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:Ye,gap:1},children:rt.map(So=>c(Ae,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:vt()==="dark"?ot(r.palette.background.default,.7):ot(r.palette.background.paper,.92),border:"0.1px solid",borderColor:ot(r.palette.divider,.24)},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:So.label}),Iy(Cm(So,ee))]},`${Le}-${So.id}-detail`))}):null,_?c(jsxRuntime.Fragment,{children:[e(Dt,{}),e("div",{onClick:So=>So.stopPropagation(),children:_(ee)})]}):null]})},Le)};return c("div",{sx:{width:f?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g?e("div",{sx:{mb:2},children:e(gm,{...g,onVariantLoad:ee=>{Ne(ee),g.onVariantLoad?.(ee);},appId:g.appId,tableKey:b,currentLayout:[{tableKey:b,layoutData:pt}],currentLayoutId:Bt,layoutRefs:[{tableKey:b,layoutId:Bt}],variantService:g.variantService,serviceUrl:I??g.serviceUrl,touchMode:X==="portrait"?"expanded":"comfortable"})}):null,c(Ae,{sx:{width:f?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":ao?{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?e("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:e(Ci,{filterText:H,setFilterText:U,onRowsPerPageChange:Ze,rowsPerPage:at,rowsPerPageOptions:v,page:Ce,count:wt,onPageChange:Fe,actions:d,extraTools:Ge,grouping:we,setGroupAnchorEl:He,showSummary:ue,setShowSummary:re,setAnchorEl:tt,setSummaryAnchorEl:be,handleExport:oe,showCreateButton:he,onOpenCreateDialog:qr,showEditButton:xe,onOpenEditDialog:Yr,editDisabled:$.length!==1,showDeleteButton:Ee,onOpenDeleteConfirm:Or,deleteDisabled:$.length===0,onLayoutSave:y||g?.variantService&&g?.appId?Je:void 0,loading:u,layoutManager:G,onOpenGraphReport:bt?St:void 0})}):null,e("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:c(se,{spacing:1.25,children:[De.length===0&&!u?D||e(Ae,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:e(L,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:o("common.noData")})}):null,De.map((ee,Le)=>{if(ee.type==="group"){let Ye=Te.has(ee.id);return e(Ae,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:c("div",{component:"button",type:"button",onClick:()=>de(ee.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[Ye?e(an,{}):e(si,{}),c("div",{sx:{flex:1,minWidth:0},children:[c(L,{sx:{fontSize:"0.94rem",fontWeight:800},children:[ee.field,": ",ee.value]}),c(L,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[ee.count," records"]})]}),we.length>1&&ee.level<we.length-1?c(se,{direction:"row",spacing:.5,children:[e(xt,{size:"small",label:o("table.group.expandAll"),onClick:Pt=>{Pt.stopPropagation(),ye(ee.id);},sx:Z}),e(xt,{size:"small",label:o("table.group.collapseAll"),onClick:Pt=>{Pt.stopPropagation(),te(ee.id);},sx:Z})]}):null]})},ee.id)}let Qe=ee.data||ee,Me=ee.id||Qe[Ft]||Le;return me(Qe,Me,Le)}),ue?e(My,{summaryRow:q,visibleColumns:Y,columns:W}):null,u?e(L,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:o("common.loading")}):null]})})]}),he?c(Lt,{open:Q,onClose:()=>!Pe&&fe(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:k?.title||o("quickCreate.createWithTitle",{title:F})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[bo.map(ee=>{let Le=ee.type==="number"||ee.numeric?"number":ee.type==="date"?"date":"text";return e(ze,{label:ee.label||ee.id,value:Xe[ee.id]??"",onChange:Qe=>Xr(ee.id,Qe.target.value),type:Le,fullWidth:true,InputLabelProps:{shrink:Le==="date"?true:void 0}},`quick-create-${ee.id}`)}),k?.description?e(Jo,{severity:"info",children:k.description}):null]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(ke,{onClick:()=>fe(false),disabled:Pe,children:k?.cancelLabel||o("common.cancel")}),e(ke,{onClick:Lr,variant:"contained",disabled:Pe,children:k?.submitLabel||o("common.save")})]})]}):null,xe?c(Lt,{open:ht,onClose:()=>!Ct&&gt(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:S?.title||o("quickEdit.editWithTitle",{title:F})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ro.map(ee=>{let Le=ee.type==="number"||ee.numeric?"number":ee.type==="date"?"date":"text";return e(ze,{label:ee.label||ee.id,value:Et[ee.id]??"",onChange:Qe=>Zr(ee.id,Qe.target.value),type:Le,disabled:!Bo(ee.id),fullWidth:true,InputLabelProps:{shrink:Le==="date"?true:void 0}},`quick-edit-${ee.id}`)}),S?.description?e(Jo,{severity:"info",children:S.description}):null]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(ke,{onClick:()=>gt(false),disabled:Ct,children:S?.cancelLabel||o("common.cancel")}),e(ke,{onClick:Do,variant:"contained",disabled:Ct||!j,children:S?.submitLabel||o("common.save")})]})]}):null,Ee?e(Qn,{open:Ht,type:"warning",title:T?.title||o("quickDelete.confirmTitle"),message:T?.message||($.length>1?o("quickDelete.confirmMessageMultiple",{count:$.length}):o("quickDelete.confirmMessageSingle")),confirmText:T?.confirmText||o("common.delete"),cancelText:T?.cancelText||o("common.cancel"),onClose:()=>!$t&&Kt(false),onConfirm:jr}):null,ne,bt?e(Di,{open:Vt,onClose:Wt,model:Fr,aiAssistant:C?.aiAssistant,interaction:Nt?{enabled:true,filters:lt.filters,fieldMapping:sr,onPrimaryDimensionClick:ee=>lt.setFilter("primaryDimension",ee),onSecondaryDimensionClick:ee=>lt.setFilter("secondaryDimension",ee),onStatusClick:ee=>lt.setFilter("status",ee),onClearFilter:lt.clearFilter,onClearAll:lt.clearAll}:void 0,tableContent:e(Dy,{appId:st||"graph-report-internal",title:o("graph.dataBody"),columns:N,rows:Fr.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};P();var o2=({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:f,contentSx:h,containerSx:u,user:v,onSearch:y,onSearchAdd:g,defaultNavigationOpen:x,navOpen:b,onNavOpenChange:C,onWorkloadSelect:k,locale:S="en",localeLabel:T,localeOptions:I,onLocaleChange:w,onUserSetting:M,onUserLogout:A,userMenuItems:R,leftHeaderSlot:D,rightHeaderSlot:E})=>{let O="orbcafe:page-layout-mode",[_,J]=eo.useState("system"),[F,V]=eo.useState("light"),[z,X]=eo.useState(false),[W,H]=eo.useState(false),U=_==="system"?W?F:"light":_;eo.useEffect(()=>{X(true);},[]),eo.useEffect(()=>{try{let nt=window.localStorage.getItem(O);(nt==="light"||nt==="dark"||nt==="system")&&J(nt);}catch{}H(true);let We=window.matchMedia("(prefers-color-scheme: dark)"),tt=()=>{V(We.matches?"dark":"light");};return tt(),We.addEventListener("change",tt),()=>We.removeEventListener("change",tt)},[]),eo.useEffect(()=>{if(W)try{window.localStorage.setItem(O,_);}catch{}},[W,_]),eo.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 Y=No("(orientation: portrait)"),ue=No("(max-width: 899.95px)"),re=l==="auto"?!z||Y||ue?"portrait":"landscape":l,[ge,we]=eo.useState({landscape:x??true,portrait:false}),Ve=ge[re],Te=b??Ve,Ie=We=>{b===void 0&&we(tt=>({...tt,[re]:We})),C?.(We);},He=c(se,{direction:"row",spacing:1,alignItems:"center",children:[!z||i&&re==="portrait"?e(ie,{onClick:()=>Ie(!Te),sx:{bgcolor:"action.hover"},children:e(mi,{})}):null,D]}),ce=c(se,{direction:"row",spacing:1,alignItems:"center",children:[m,E]}),be=e(ym,{collapsed:re==="landscape"?!Te:false,onToggle:()=>Ie(!Te),menuData:r,orientation:re,colorMode:U,maxHeight:re==="landscape"?900:void 0});return e(Bn,{mode:_,children:e(Ya,{locale:S,children:c("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:[e(qi,{appTitle:t,logo:d===void 0?null:d,mode:_,onToggleMode:()=>J(We=>We==="system"?"dark":We==="dark"?"light":"system"),locale:S,localeLabel:T,localeOptions:I,onLocaleChange:w,user:v,onUserSetting:M,onUserLogout:A,userMenuItems:R,onSearch:y,onSearchAdd:g,leftSlot:He,rightSlot:ce}),p?e("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:p}):null,c("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[z&&i&&re==="landscape"?e("div",{sx:{p:1.5,pr:0,flexShrink:0},children:be}):null,!z||i&&re==="portrait"?e(Wd,{open:Te,onClose:()=>Ie(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:be}):null,e("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...h},children:c(se,{spacing:1.5,children:[s&&n.length>0?e(fm,{items:n,selectedId:a,orientation:re,onItemSelect:k}):null,e(Ae,{elevation:0,sx:{flex:1,minHeight:re==="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})]})})]}),re==="portrait"&&f?c(jsxRuntime.Fragment,{children:[e(Dt,{}),e("div",{sx:{p:1.5},children:f})]}):null]})})})};P();var km=zy__default.default(()=>Promise.resolve().then(()=>(Sm(),wm)).then(t=>t.COrbCanvas),{ssr:false,loading:()=>e("div",{className:"h-full w-full bg-transparent"})});function Vl({isRecording:t}){return e(framerMotion.AnimatePresence,{children:t&&e(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"pointer-events-none absolute inset-0 z-0 overflow-hidden",children:c("div",{className:"relative flex h-full w-full items-center justify-center",children:[e("div",{className:"absolute inset-0",children:e(km,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),e("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:e(km,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var d2=Vl;P();var Tm=eo.createContext(null);function Ky(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 qy({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[f,h]=eo.useState(false),[u,v]=eo.useState(false),y=eo.useRef(null),g=eo.useRef(false),x=eo.useRef(false),b=eo.useCallback(()=>{x.current=false,h(false);},[]),{isRecording:C,startRecording:k,stopRecording:S}=wn({wsUrl:d,silenceThresholdMs:p,minVolumeRms:m,onTextUpdate:M=>{r?.(M);},onComplete:async M=>{try{M.trim()&&(v(!0),await o(M.trim()));}catch(A){let R=A instanceof Error?A.message:"Failed to process voice command";n?.(R);}finally{v(!1),b();}},onError:M=>{n?.(M),v(!1),g.current||b();}}),T=eo.useCallback(async()=>{x.current=false,await k();},[k]),I=eo.useCallback(()=>{S();},[S]);eo.useEffect(()=>{if(i)return;let M=R=>{R.isComposing||(R.code==="Space"||R.key===" ")&&(g.current||R.repeat||s&&Ky(document.activeElement)||(g.current=true,R.preventDefault(),y.current=setTimeout(()=>{x.current=true,h(true),k();},a)));},A=R=>{(R.code==="Space"||R.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),g.current=false,x.current&&(R.preventDefault(),h(false),S()));};return window.addEventListener("keydown",M),window.addEventListener("keyup",A),()=>{window.removeEventListener("keydown",M),window.removeEventListener("keyup",A),y.current&&(clearTimeout(y.current),y.current=null);}},[i,s,a,k,S]);let w=eo.useMemo(()=>({isRecording:C,isHotkeyRecording:f,isSubmitting:u,startRecording:T,stopRecording:I}),[f,C,u,T,I]);return c(Tm.Provider,{value:w,children:[l?e(Vl,{isRecording:f}):null,t]})}function Xy(){let t=eo.useContext(Tm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var h2=qy,b2=Xy;function ut(...t){return tailwindMerge.twMerge(clsx.clsx(t))}P();var Jy=({content:t,theme:o="light",size:r="base",defaultExpanded:n=false})=>{let[a,i]=eo.useState(n),s=eo.useMemo(()=>`${(r==="sm"?14:r==="lg"?18:16)-2}px`,[r]);return c("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:[c("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:[c("span",{className:"flex items-center",children:[e(Ba,{className:"mr-2 h-4 w-4"}),e("span",{className:"font-medium text-[var(--orb-fg)]",style:{fontSize:r==="sm"?"14px":r==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),e(Ho,{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} text-[var(--orb-muted)]`})]}),a&&e("div",{className:"p-4 whitespace-pre-wrap italic font-light text-[var(--orb-muted)]",style:{fontSize:s,lineHeight:"1.3 !important"},children:t})]})},Im=Jy;P();var nC=({content:t,language:o="text",isStreaming:r=false,className:n=""})=>{let a=fo(),[i,s]=eo.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"?prism.oneDark:prism.oneLight;return c("div",{className:ut("rounded-lg overflow-hidden border border-[var(--orb-border)] my-4",n),children:[c("div",{className:"flex items-center justify-between px-4 py-2 bg-[var(--orb-surface)] border-b border-[var(--orb-border)]",children:[e("span",{className:"text-xs font-medium text-[var(--orb-muted)] uppercase",children:o}),e("button",{onClick:l,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:r,title:i?"Copied":"Copy code",children:i?e(Ao,{size:14,className:"text-[var(--orb-status-success)]"}):e(zc,{size:14,className:"text-[var(--orb-muted)]"})})]}),e("div",{className:"text-sm",children:e(reactSyntaxHighlighter.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=nC;P();var Dm="orb-html-demo",Nm="orb-html-demo-ping",ls=16,lC=2,cC=2e3,dC=300,pC=96,uC=200,mC=560,gC=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(Dm)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);addEventListener('message',function(event){if(event.data&&event.data.source===${JSON.stringify(Nm)})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>`,fC="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",hC=t=>/<html[\s>]/i.test(t),bC=t=>{let o=t.trim();return hC(o)?/<\/body>/i.test(o)?o.replace(/<\/body>/i,`${_l}</body>`):`${o}${_l}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${fC}</style></head><body>${o}${_l}</body></html>`},vC=t=>{let o=/<title[^>]*>([^<]+)<\/title>/i.exec(t)?.[1]?.trim();return o||(/<h1[^>]*>([^<]+)<\/h1>/i.exec(t)?.[1]?.trim()??null)},yC=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`},CC=t=>`${t.toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"interactive-demo"}.html`,xC=(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);},ya=new Map,Ul="orb-html-demo-store",wC=t=>t.replace(/^\s+/,"").slice(0,pC),Gl=(t,o)=>{ya.set(t,o),window.dispatchEvent(new CustomEvent(Ul));},SC=({content:t,title:o})=>{let{t:r}=le(),n=fo(),a=wC(t),[i,s]=eo.useState(()=>ya.get(a)?.open??false),[l,d]=eo.useState(()=>ya.get(a)?.view??"preview"),[p,m]=eo.useState(false),[f,h]=eo.useState(gC),u=eo.useRef(null),v=eo.useRef(null),y=eo.useRef(false),g=eo.useRef(false),x=eo.useRef(t),b=D=>Gl(a,{open:D,view:l}),C=D=>Gl(a,{open:i,view:D}),k=()=>{g.current=true,b(false);};eo.useEffect(()=>{let D=()=>{let E=ya.get(a);s(E?.open??false),d(E?.view??"preview");};return window.addEventListener(Ul,D),()=>window.removeEventListener(Ul,D)},[a]),eo.useEffect(()=>{x.current!==t&&(x.current=t,ya.has(a)||Gl(a,{open:true,view:"preview"}));},[t,a]);let[S,T]=eo.useState(t);eo.useEffect(()=>{if(t===S)return;let D=window.setTimeout(()=>T(t),dC);return ()=>window.clearTimeout(D)},[t,S]);let I=eo.useMemo(()=>bC(S),[S]);eo.useEffect(()=>{if(!i)return;let D=E=>{let O=E.data;!O||O.source!==Dm||typeof O.height!="number"||v.current&&E.source!==v.current.contentWindow||h(Math.max(uC,Math.min(mC,Math.ceil(O.height))));};return window.addEventListener("message",D),v.current?.contentWindow?.postMessage({source:Nm},"*"),()=>window.removeEventListener("message",D)},[i]);let w=o??vC(t)??r("agentui.html.defaultTitle"),M=eo.useMemo(()=>new TextEncoder().encode(t).length,[t]);eo.useEffect(()=>{if(!p)return;let D=window.setTimeout(()=>m(false),cC);return ()=>window.clearTimeout(D)},[p]),eo.useEffect(()=>{if(i){y.current=true;return}y.current&&(y.current=false,g.current&&(g.current=false,u.current?.focus()));},[i]);let A=()=>{navigator.clipboard.writeText(t).then(()=>m(true));},R=()=>xC(new Blob([t],{type:"text/html;charset=utf-8"}),CC(w));return i?c("section",{className:"orb-html-demo","aria-label":w,"data-view":l,children:[c("header",{className:"orb-html-demo-head",children:[e("span",{className:"orb-html-demo-glyph","aria-hidden":"true",children:"</>"}),e("span",{className:"orb-html-demo-head-title",title:w,children:w}),c("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":lC,"--orb-segmented-index":l==="code"?0:1},children:[e("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),e("button",{type:"button",className:"orb-segmented-control-item orb-segmented-control-item-label","data-selected":l==="code","aria-pressed":l==="code",onClick:()=>C("code"),children:r("agentui.html.code")}),e("button",{type:"button",className:"orb-segmented-control-item orb-segmented-control-item-label","data-selected":l==="preview","aria-pressed":l==="preview",onClick:()=>C("preview"),children:r("agentui.html.preview")})]}),c("div",{className:"orb-html-demo-actions",children:[e("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:A,children:p?e(Ao,{size:ls}):e(Yo,{size:ls})}),e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r("agentui.html.download"),title:r("agentui.html.download"),onClick:R,children:e(La,{size:ls})}),e("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:e(qt,{size:ls})})]})]}),c("div",{className:"orb-html-demo-body",children:[e("iframe",{ref:v,className:"orb-html-demo-frame",title:w,sandbox:"allow-scripts",srcDoc:I,style:{height:f},hidden:l!=="preview"}),e("div",{className:"orb-html-demo-code",hidden:l!=="code",children:e(reactSyntaxHighlighter.Prism,{language:"html",style:n==="dark"?prism.oneDark:prism.oneLight,customStyle:{margin:0,padding:"16px 20px",background:"transparent",fontSize:"13px",lineHeight:"1.6"},wrapLongLines:true,children:t})})]})]}):c("button",{ref:u,type:"button",className:"orb-html-demo-card","aria-expanded":false,onClick:()=>b(true),children:[e("span",{className:"orb-html-demo-glyph","aria-hidden":"true",children:"</>"}),c("span",{className:"orb-html-demo-info",children:[e("span",{className:"orb-html-demo-title",children:w}),c("span",{className:"orb-html-demo-meta",children:["HTML \xB7 ",yC(M)]})]}),e("span",{className:"orb-html-demo-openpill",children:r("agentui.html.open")})]})},Am=SC;P();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"},IC=({content:t,isLoading:o,className:r="",style:n})=>{let a=eo.useRef(null),[i,s]=eo.useState(false),[l,d]=eo.useState(null),p=fo();return eo.useEffect(()=>{let m=false,f=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{Lm__default.default.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)}`,v=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:y,bindFunctions:g}=await Lm__default.default.render(u,v);!m&&a.current&&(a.current.innerHTML=y,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);}}},h=setTimeout(()=>{f();},100);return ()=>{m=true,clearTimeout(h);}},[t,p]),c("div",{className:`mermaid-block ${r}`,style:n,children:[(o||i)&&c("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:[e("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-b-2 border-[var(--orb-primary)]"}),e("span",{className:"text-sm text-[var(--orb-muted)]",children:"Generating Diagram..."})]}),l&&c("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:[e("p",{className:"font-medium",children:TC(l)}),c("details",{className:"mt-1",children:[e("summary",{className:"cursor-pointer text-xs text-[var(--orb-muted)]",children:"Details & source"}),e("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words",children:l}),e("pre",{className:"mt-2 max-h-40 overflow-auto text-xs text-[var(--orb-muted)]",children:t})]})]}),e("div",{ref:a,className:`overflow-x-auto ${o||i||l?"hidden":""}`})]})},Om=IC;P();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,f]=eo.useState(false),[h,u]=eo.useState(false),v=async()=>{if(l){u(true);try{await l();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}finally{u(false);}}};return c("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:[c("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:[e("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:a||e(Da,{className:"w-5 h-5"})}),c("div",{className:"flex-1 min-w-0",children:[c("div",{className:"flex items-center space-x-2 mb-1",children:[e("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&e("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&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-3 leading-relaxed",children:typeof o=="string"?e("p",{className:"whitespace-pre-wrap",children:o}):o}),(l||n)&&c("div",{className:"flex items-center space-x-4 mt-2",children:[l&&c("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:[e(td,{className:`w-3.5 h-3.5 mr-1.5 ${h?"animate-spin":""}`}),h?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&c("button",{onClick:()=>f(!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?e(Ho,{className:"w-3.5 h-3.5 mr-1"}):e(zo,{className:"w-3.5 h-3.5 mr-1"}),m?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&s&&e("button",{onClick:s,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors self-start",children:e(qt,{className:"w-4 h-4"})})]}),n&&m&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 border-t border-[var(--orb-border)]",children:e("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})})]})},cs=RC;P();var MC=({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="",...f})=>{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)]"}}},u=()=>{switch(n){case "info":return e(Fa,{className:"w-5 h-5"});case "error":return e(Ga,{className:"w-5 h-5"});case "success":return e(Na,{className:"w-5 h-5"});default:return e(Fc,{className:"w-5 h-5"})}},v=h();return c("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,children:[c("div",{className:`flex p-4 border-l-4 ${v.borderLeftColor} ${v.bgColor}`,children:[e("div",{className:`flex-shrink-0 mr-3 ${v.iconColor}`,children:i||u()}),c("div",{className:"flex-1 min-w-0",children:[c("div",{className:"flex items-center justify-between mb-1",children:[e("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&e("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:r})]}),o&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:o}),a&&a.length>0&&e("ul",{className:"mt-2 space-y-1",children:a.map((y,g)=>c("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[e("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),e("span",{children:y})]},g))})]}),s&&l&&e("button",{onClick:l,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:e(qt,{className:"w-4 h-4"})})]}),d&&e("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:e("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"})})]})},ds=MC;P();var DC=({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,f]=eo.useState(false),[h,u]=eo.useState(""),[v,y]=eo.useState(false),g=eo.useMemo(()=>h.trim()?r.filter(C=>C.toLowerCase().includes(h.toLowerCase())):r,[r,h]),x=eo.useMemo(()=>m?g:g.slice(0,a),[g,m,a]),b=C=>{n?.(C);};return !r||r.length===0?null:c("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:[c("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[c("div",{className:"flex items-center space-x-2.5",children:[e("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||e(Ba,{className:"w-5 h-5"})}),c("div",{className:"flex flex-col",children:[e("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),o&&e("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:o})]})]}),c("div",{className:"flex items-center space-x-1",children:[r.length>3&&e("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:e(Vo,{className:"w-4 h-4"})}),s&&l&&e("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:e(qt,{className:"w-4 h-4"})})]})]}),v&&e("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:c("div",{className:"relative",children:[e("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:h,onChange:C=>u(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}),e(Vo,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),c("div",{className:"p-2",children:[e("ul",{className:"space-y-1",children:x.map((C,k)=>e("li",{children:c("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:[e("span",{children:C}),e(zo,{className:"w-4 h-4 text-[var(--orb-muted)] group-hover:text-[var(--orb-status-primary)] opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},k))}),g.length>a&&e("button",{onClick:()=>f(!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.length})`}),g.length===0&&h&&e("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},ps=DC;P();var NC=({title:t,content:o,toolName:r,parameters:n,result:a,status:i,duration:s,icon:l,closable:d=false,onClose:p,onAction:m,actionText:f,className:h="",...u})=>{let[v,y]=eo.useState(false),[g,x]=eo.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 e(Xc,{className:"w-5 h-5 animate-spin"});case "error":return e(Ga,{className:"w-5 h-5"});default:return e(Na,{className:"w-5 h-5"})}},k=I=>I?I<1e3?`${I}ms`:`${(I/1e3).toFixed(2)}s`:"",S=b(),T=t||r||"\u5DE5\u5177\u8C03\u7528";return c("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${h}`,...u,children:[c("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:[c("div",{className:"flex items-center space-x-3",children:[e("div",{className:`flex-shrink-0 ${S.iconColor}`,children:l||C()}),c("div",{children:[c("div",{className:"flex items-center space-x-2",children:[e("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:T}),e("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${S.badgeBg} ${S.badgeText}`,children:S.label})]}),r&&t&&c("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[e(Wn,{className:"w-3 h-3 mr-1"}),r]})]})]}),c("div",{className:"flex items-center space-x-2 text-xs text-[var(--orb-muted)]",children:[s&&c("div",{className:"flex items-center bg-[var(--orb-surface)] px-2 py-1 rounded",children:[e(Vc,{className:"w-3 h-3 mr-1"}),k(s)]}),d&&p&&e("button",{onClick:p,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:e(qt,{className:"w-4 h-4"})})]})]}),c("div",{className:"p-4",children:[o&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-4 leading-relaxed",children:o}),n&&c("div",{className:"mb-3",children:[c("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?e(Ho,{className:"w-3.5 h-3.5 mr-1"}):e(zo,{className:"w-3.5 h-3.5 mr-1"}),e("div",{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),v&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:e("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:JSON.stringify(n,null,2)})})]}),a&&c("div",{children:[c("button",{onClick:()=>x(!g),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?e(Ho,{className:"w-3.5 h-3.5 mr-1"}):e(zo,{className:"w-3.5 h-3.5 mr-1"}),e(Wn,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),g&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:e("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&&e("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:e("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||"\u6267\u884C\u64CD\u4F5C"})})]})]})},us=NC;P();var EC=({data:t})=>{if(!t)return null;let o=eo.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?e("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"}):e("div",{className:"w-full my-4",children:e(tr,{appId:"agent-ui-table-card",title:o.title,columns:o.columns,rows:o.rows,count:o.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},ms=EC;P();var LC=({title:t,subtitle:o,data:r,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return e(_s,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return e(qc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return e(ed,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return e(Oc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return e(Uc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return e(Gc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return e(sd,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return e(Vn,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return e(Zc,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return e(_s,{className:"w-4 h-4"})}},s=()=>{if(!r&&n!=="google-map-card"&&n!=="amap-card")return e("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:"No data available"});try{switch(n){case "bar-chart-card":return e(ra,{data:r,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return e($p,{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 e(Ii,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return e(_p,{data:r,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return e(Gp,{data:r});case "fishbone-chart-card":return e(Up,{branches:r,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return e(Kp,{data:r,height:a.height});case "google-map-card":return e(qp,{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 e(Xp,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,keyword:a.keyword||r&&r[0]?.keyword||t,height:a.height});default:return c("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),e("div",{className:"text-[var(--orb-status-error)] text-sm p-4 text-center",children:"Error rendering chart"})}};return c("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:[c("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:[e("div",{className:"mr-2 flex-shrink-0",children:i()}),c("div",{className:"flex-1 min-w-0",children:[e("h3",{className:"text-sm font-semibold text-[var(--orb-fg)] truncate",children:t}),o&&e("p",{className:"text-xs text-[var(--orb-muted)] mt-0.5 truncate",children:o})]})]}),c("div",{className:"p-4",children:[e("div",{className:"overflow-x-auto",children:s()}),e("div",{className:"mt-3",children:c("details",{className:"text-xs text-[var(--orb-muted)]",children:[e("summary",{className:"cursor-pointer hover:text-[var(--orb-fg)] transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),e("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)})]})})]})]})},gs=LC;P();var ys=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],OC={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},bs=480,Mn=214,Ut={top:18,right:16,bottom:38,left:30},to=t=>typeof t=="number"&&Number.isFinite(t)?t:0,Wm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),qo=(t,o)=>`${t.id||t.label}-${o}`,$m=(t,o=13)=>t.length>o?`${t.slice(0,Math.max(1,o-1))}\u2026`:t,vs=(t,o,r)=>Math.min(r,Math.max(o,t)),fr=(t,o,r)=>t.color??r[o%r.length],hr=(t,o)=>o?{onMouseEnter:()=>o.onItemHoverStart?.(t),onMouseMove:()=>o.onItemHoverStart?.(t),onMouseLeave:()=>o.onItemHoverEnd?.(t),onContextMenu:r=>o.onItemContextMenu?.(r,t)}:{},_m=t=>{let o=t.map(a=>to(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}},FC=(t,o,r)=>{let n=bs-Ut.left-Ut.right,a=Mn-Ut.top-Ut.bottom,{max:i,range:s}=_m(r),l=Ut.left+t*n/Math.max(r.length-1,1),d=Ut.top+(i-to(o.value))/s*a,p=Ut.top+i/s*a;return {x:l,y:d,zeroY:p}},hs=(t,o,r,n)=>{let a=(n-90)*Math.PI/180;return {x:t+r*Math.cos(a),y:o+r*Math.sin(a)}},BC=(t,o,r,n,a,i)=>{let s=hs(t,o,r,i),l=hs(t,o,r,a),d=i-a>180?1:0;if(n===0)return `M ${t} ${o} L ${s.x} ${s.y} A ${r} ${r} 0 ${d} 0 ${l.x} ${l.y} Z`;let p=hs(t,o,n,i),m=hs(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`},HC=({children:t})=>c("div",{className:"orb-metric-empty",role:"status",children:[e("span",{className:"orb-metric-empty-mark","aria-hidden":"true",children:"\u2014"}),e(L,{variant:"body2",muted:true,children:t})]}),zC=()=>c("div",{className:"orb-metric-loading",role:"status","aria-label":"Loading chart",children:[e("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"}),e("span",{className:"orb-metric-skeleton"}),e("span",{className:"orb-metric-skeleton orb-metric-skeleton-short"}),e("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"})]}),Xl=({item:t,onItemClick:o,interactions:r})=>{let n=()=>o?.(t);return {...o?{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{o&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n());}}:{},...hr(t,r),style:{cursor:o||r?"pointer":"default"}}},VC=({loading:t,error:o,hasData:r,emptyState:n,children:a})=>t?e(zC,{}):o?e("div",{className:"orb-metric-error",role:"alert",children:o}):r?e(jsxRuntime.Fragment,{children:a}):e(HC,{children:n??"No data for the current selection."}),WC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(l=>Math.abs(to(l.value))),1);return e("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=to(l.value),m=`${vs(Math.abs(p)/s*100,0,100)}%`,f=o===l.id,h=c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-metric-bar-label",title:l.label,children:l.label}),e("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:e("span",{className:`orb-metric-bar-fill${f?" is-active":""}`,style:{width:m,backgroundColor:fr(l,d,i)}})}),e("span",{className:"orb-metric-bar-value",children:a(p)})]});return r?e("button",{type:"button",className:`orb-metric-bar-row${f?" is-active":""}`,onClick:()=>r(l),title:`${l.label}: ${a(p)}`,"aria-pressed":f,...hr(l,n),children:h},qo(l,d)):e("div",{className:`orb-metric-bar-row${f?" is-active":""}`,role:"listitem",...hr(l,n),children:h},qo(l,d))})})},$C=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((l,d)=>l+Math.max(to(d.value),0),0),1);return e("div",{className:"orb-metric-progress",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=Math.max(to(l.value),0),m=vs(p/s*100,0,100),f=o===l.id,h=c(jsxRuntime.Fragment,{children:[c("span",{className:"orb-metric-progress-heading",children:[e("span",{title:l.label,children:l.label}),e("strong",{children:a(p)})]}),e("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:e("span",{className:"orb-metric-bar-fill",style:{width:`${m}%`,backgroundColor:fr(l,d,i)}})})]});return r?e("button",{type:"button",className:`orb-metric-progress-row${f?" is-active":""}`,onClick:()=>r(l),"aria-pressed":f,...hr(l,n),children:h},qo(l,d)):e("div",{className:`orb-metric-progress-row${f?" is-active":""}`,role:"listitem",...hr(l,n),children:h},qo(l,d))})})},_C=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:l,ariaLabel:d})=>{let{min:p,max:m,range:f}=_m(o),h=bs-Ut.left-Ut.right,u=Mn-Ut.top-Ut.bottom,v=Ut.top+m/f*u,y=Math.max(1,Math.ceil(o.length/6)),g=o.map((C,k)=>FC(k,C,o)),x=g.map(C=>`${C.x},${C.y}`).join(" "),b=Math.max(...o.map(C=>Math.max(to(C.secondaryValue),0)),1);return e("div",{className:"orb-metric-svg-wrap",children:c("svg",{className:"orb-metric-svg",viewBox:`0 0 ${bs} ${Mn}`,role:"img","aria-label":d,children:[e("line",{className:"orb-metric-axis",x1:Ut.left,y1:v,x2:bs-Ut.right,y2:v}),e("line",{className:"orb-metric-grid",x1:Ut.left,y1:Ut.top,x2:Ut.left,y2:Mn-Ut.bottom}),t==="column"&&o.map((C,k)=>{let S=g[k],T=to(C.value),I=Math.max(Math.abs(S.y-v),T===0?2:0),w=S.x-Math.min(18,h/Math.max(o.length*2,1)),M=Math.min(36,Math.max(10,h/Math.max(o.length*1.8,1))),A=r===C.id;return c("g",{...Xl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(T)}`,children:[e("rect",{className:`orb-metric-column${A?" is-active":""}`,x:w,y:Math.min(S.y,v),width:M,height:I,rx:4,fill:fr(C,k,l)}),c("title",{children:[C.label,": ",i(T)]}),(k%y===0||o.length<=6)&&e("text",{className:"orb-metric-svg-label",x:S.x,y:Mn-14,textAnchor:"middle",children:$m(C.label)})]},qo(C,k))}),(t==="line"||t==="scatter"||t==="bubble")&&c(jsxRuntime.Fragment,{children:[t==="line"&&e("polyline",{className:"orb-metric-line",fill:"none",points:x,stroke:l[0]}),o.map((C,k)=>{let S=g[k],T=r===C.id,I=t==="bubble"?7+Math.max(to(C.secondaryValue),0)/b*12:t==="scatter"?5:4;return c("g",{...Xl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(to(C.value))}`,children:[t==="line"&&e("circle",{className:`orb-metric-point${T?" is-active":""}`,cx:S.x,cy:S.y,r:T?6:4,fill:fr(C,k,l)}),t!=="line"&&e("circle",{className:`orb-metric-point${T?" is-active":""}`,cx:S.x,cy:S.y,r:I,fill:fr(C,k,l),opacity:t==="bubble"?.82:.9}),c("title",{children:[C.label,": ",i(to(C.value)),t==="bubble"&&C.secondaryValue!==void 0?` \xB7 Size: ${s(to(C.secondaryValue))}`:""]}),(k%y===0||o.length<=6)&&e("text",{className:"orb-metric-svg-label",x:S.x,y:Math.max(Ut.top+8,S.y-I-7),textAnchor:"middle",children:$m(C.label)})]},qo(C,k))})]}),e("text",{className:"orb-metric-axis-label",x:Ut.left,y:Ut.top-5,children:i(m)}),p<0&&e("text",{className:"orb-metric-axis-label",x:Ut.left,y:Mn-Ut.bottom+14,children:i(p)})]})})},GC=({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(to(u.value),0)})),p=d.reduce((u,v)=>u+v.value,0),m=72,f=92,h=0;return c("div",{className:"orb-metric-circular",children:[c("svg",{className:"orb-metric-donut",viewBox:"0 0 184 184",role:"img","aria-label":l,children:[d.map((u,v)=>{let y=u.value/p*360,g=h;h+=y;let x=r===u.id,b=y>=359.9?void 0:BC(f,f,m,t==="donut"?46:0,g,g+y),C=Xl({item:u,onItemClick:n,interactions:a});return b?e("path",{className:`orb-metric-slice${x?" is-active":""}`,d:b,fill:fr(u,v,s),...C,children:c("title",{children:[u.label,": ",i(u.value)," (",(u.value/p*100).toFixed(1),"%)"]})},qo(u,v)):e("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:f,cy:f,r:t==="donut"?60:m,fill:t==="donut"?"none":fr(u,v,s),stroke:t==="donut"?fr(u,v,s):void 0,strokeWidth:28,...C,children:c("title",{children:[u.label,": ",i(u.value)," (100%)"]})},qo(u,v))}),t==="donut"&&e("circle",{cx:f,cy:f,r:44,fill:"var(--orb-surface)"}),t==="donut"&&e("text",{className:"orb-metric-donut-total",x:f,y:f+5,textAnchor:"middle",children:i(p)})]}),e("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((u,v)=>{let y=r===u.id;return c("button",{type:"button",className:`orb-metric-legend-item${y?" is-active":""}`,onClick:()=>n?.(u),disabled:!n,title:u.label,...hr(u,a),children:[e("span",{className:"orb-metric-legend-dot",style:{backgroundColor:fr(u,v,s)}}),e("span",{className:"orb-metric-legend-label",children:u.label}),c("strong",{children:[(u.value/p*100).toFixed(0),"%"]})]},qo(u,v))})})]})},UC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,secondaryValueFormatter:i})=>e("div",{className:"orb-metric-list",role:"list","aria-label":"Chart data",children:t.map((s,l)=>{let d=c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-metric-list-label",title:s.label,children:s.label}),e("span",{className:"orb-metric-list-value",children:a(to(s.value))}),s.secondaryValue!==void 0&&e("span",{className:"orb-metric-list-secondary",children:i(to(s.secondaryValue))})]});return r?e("button",{type:"button",className:`orb-metric-list-row${o===s.id?" is-active":""}`,onClick:()=>r(s),"aria-pressed":o===s.id,...hr(s,n),children:d},qo(s,l)):e("div",{className:`orb-metric-list-row${o===s.id?" is-active":""}`,role:"listitem",...hr(s,n),children:d},qo(s,l))})}),Cs=({title:t,subtitle:o,data:r=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:l,valueFormatter:d=Wm,secondaryValueFormatter:p=Wm,valueLabel:m,secondaryValueLabel:f,emptyState:h,loading:u=false,error:v,maxItems:y=8,showChartTypeControl:g=true,showDataDetails:x=true,dataRevealDelayMs:b=1e3,chartTypeOptions:C,chartTypeLabels:k,footer:S,ariaLabel:T,className:I,style:w,sx:M})=>{let A=$s(),R=eo.useRef(null),D=eo.useRef(null),[E,O]=eo.useState(n),[_,J]=eo.useState(false),[F,V]=eo.useState(null),[z,X]=eo.useState(null);eo.useEffect(()=>O(n),[n]);let W=eo.useCallback(()=>{D.current!==null&&(window.clearTimeout(D.current),D.current=null);},[]);eo.useEffect(()=>W,[W]),eo.useEffect(()=>{if(!z)return;let q=De=>{let Ce=De.target;Ce instanceof HTMLElement&&Ce.closest(".orb-metric-context-menu")||X(null);};return document.addEventListener("pointerdown",q),()=>document.removeEventListener("pointerdown",q)},[z]);let H=E,U=eo.useMemo(()=>[A.chart1,A.chart2,A.chart3,A.chart4,A.chart5,A.chart6],[A]),Y=eo.useMemo(()=>_?r:r.slice(0,Math.max(1,y)),[r,y,_]),ue=Math.max(0,r.length-Y.length),re=Y.some(q=>to(q.value)>0),ge=Y.length>0&&(H!=="pie"&&H!=="donut"?true:re),we=(C??[H,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((q,De,Ce)=>ys.includes(q)&&Ce.indexOf(q)===De),Ve={...OC,...k},Te=Y[0],Ie=T??`${t} ${Ve[H]} chart`,He=q=>{O(q),a?.(q);},ce=eo.useCallback((q,De)=>{V({item:q,source:De}),X(null),s?.(q,De);},[s]),be=eo.useCallback(q=>{W(),!(!x||z)&&(D.current=window.setTimeout(()=>{ce(q,"hover"),D.current=null;},Math.max(0,b)));},[W,z,b,ce,x]),We=eo.useCallback(()=>{W();},[W]),tt=eo.useCallback((q,De)=>{if(!x)return;q.preventDefault(),W();let Ce=R.current?.getBoundingClientRect(),Fe=Ce?vs(q.clientX-Ce.left,8,Math.max(8,Ce.width-164)):8,at=Ce?vs(q.clientY-Ce.top,8,Math.max(8,Ce.height-72)):8;X({item:De,left:Fe,top:at});},[W,x]),nt=x?{onItemHoverStart:be,onItemHoverEnd:We,onItemContextMenu:tt}:void 0,it=H==="metric"?c("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>Te&&i?.(Te),onKeyDown:q=>{Te&&i&&(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),i(Te));},"aria-label":Ie,...Te?hr(Te,nt):{},children:[e("span",{className:"orb-metric-kpi-label",children:Te?.label??m??"Value"}),e("strong",{children:Te?d(to(Te.value)):"\u2014"}),Te?.secondaryValue!==void 0&&c("span",{className:"orb-metric-kpi-secondary",children:[f??"Compared with"," \xB7 ",p(to(Te.secondaryValue))]})]}):H==="progress"?e($C,{data:Y,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:U}):H==="bar"?e(WC,{data:Y,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:U}):H==="list"?e(UC,{data:Y,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:p}):H==="pie"||H==="donut"?e(GC,{type:H,data:Y,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:U,ariaLabel:Ie}):e(_C,{type:H,data:Y,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:p,colors:U,ariaLabel:Ie});return c("div",{ref:R,className:"orb-metric-chart-shell",onMouseLeave:()=>{W(),F?.source==="hover"&&V(null);},children:[c(Ae,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${I??""}`,style:w,sx:M,children:[c("div",{className:"orb-metric-chart-header",children:[c("div",{className:"orb-metric-chart-heading",children:[e(L,{variant:"subtitle1",component:"h3",noWrap:true,title:t,children:t}),o&&e(L,{variant:"caption",muted:true,component:"div",noWrap:true,children:o})]}),g&&we.length>1&&e(zt,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:H,options:we.map(q=>({value:q,label:Ve[q]})),onChange:q=>He(q.target.value),minWidth:108,fullWidth:false,size:"small"})]}),c("div",{className:"orb-metric-chart-body",children:[e(VC,{loading:u,error:v,hasData:ge,emptyState:h,children:it}),ue>0&&!u&&!v&&e("button",{type:"button",className:"orb-metric-more",onClick:()=>J(q=>!q),children:_?"Show fewer":`Show all ${r.length}`})]}),S&&e("div",{className:"orb-metric-chart-footer",children:S})]}),z&&c("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:W,onKeyDown:q=>{q.key==="Escape"&&X(null);},style:{left:z.left,top:z.top},onPointerDown:q=>q.stopPropagation(),children:[e("div",{className:"orb-metric-context-label",children:z.item.label}),e("button",{type:"button",role:"menuitem",onClick:q=>{q.preventDefault(),q.stopPropagation(),ce(z.item,"contextmenu");},children:"Show data"})]}),F&&c("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${F.item.label} data details`,onPointerDown:q=>q.stopPropagation(),children:[c("div",{className:"orb-metric-data-details-header",children:[e("strong",{children:F.item.label}),e("button",{type:"button","aria-label":"Close data details",onClick:()=>V(null),children:"\xD7"})]}),c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:m??"Value"}),e("strong",{children:d(to(F.item.value))})]}),F.item.secondaryValue!==void 0&&c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:f??"Secondary value"}),e("strong",{children:p(to(F.item.secondaryValue))})]}),e("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"})]})]})};Cs.displayName="CMetricChartCard";P();var KC=({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 e(Cs,{...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})})},xs=KC;P();var qC=({type:t,manifest:o})=>c("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:[c("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[e("div",{className:"w-4 h-4 mr-2 text-[var(--orb-status-primary)]"}),c("h3",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:["SAP Card: ",t]})]}),e("div",{className:"p-4",children:e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 rounded border border-[var(--orb-border)] overflow-x-auto",children:e("pre",{className:"text-xs font-mono text-[var(--orb-muted)] whitespace-pre-wrap",children:JSON.stringify(o,null,2)})})})]}),ws=qC;var XC=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}:{}}]}):[],Ss=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=ys.includes(o.chartType)?o.chartType:"bar";return {...o,type:"metric-chart-card",chartType:r,data:XC(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};P();var tx=({content:t,theme:o,size:r="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:l})=>{let d=eo.useRef(l);d.current=l;let p=!!l?.onCardEvent,m=eo.useMemo(()=>p?{onCardEvent:y=>d.current?.onCardEvent?.(y)}:void 0,[p]),f=eo.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});},u=(y,g,x,b,C,k)=>{if(!(!C&&!m?.onCardEvent))return (...S)=>{let T=C?.(...S),I=k?k(...S):void 0;return h(y,g,x,I,b),T}},v=eo.useMemo(()=>({div(y){let{"data-component":g,"data-think-content":x,...b}=y;return g==="thinkbox"&&x?e(Im,{content:decodeURIComponent(x),theme:o,size:r,defaultExpanded:false}):e("div",{...b})},table({children:y}){return e("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:e("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:y})})},thead({children:y}){return e("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:y})},tbody({children:y}){return e("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:y})},tr({children:y}){return e("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:y})},th({children:y,align:g}){return e("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 e("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(`
199
+ `))return e("code",{children:g});let T=k.replace(/\n$/,"");if(i&&C==="mermaid")return e(Om,{content:T});if(C==="html"||C==="htm")return e(Am,{content:T});if(C==="json"){let I=Ss(T);if(I)switch(I.type){case "table":return e(ms,{data:I.data});case "metric-chart-card":return e(xs,{...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 e(gs,{...I});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return e(ws,{...I});case "error-card":{let w=I;return e(cs,{...w,onClose:u("error-card","close",w.title,w,w.onClose),onRetry:u("error-card","retry",w.title,w,w.onRetry)})}case "warning-card":{let w=I,M=w.onConfirm?u("warning-card","confirm",w.title,w,w.onConfirm):w.actionText&&m?.onCardEvent?u("warning-card","confirm",w.title,w):void 0;return e(ds,{...w,onClose:u("warning-card","close",w.title,w,w.onClose),onConfirm:M})}case "suggestions-card":{let w=I;return e(ps,{...w,onClose:u("suggestions-card","close",w.title,w,w.onClose),onSuggestionClick:u("suggestions-card","suggestion-click",w.title,w,w.onSuggestionClick,M=>({suggestion:M}))})}case "tool-result-card":{let w=I;return e(us,{...w,onClose:u("tool-result-card","close",w.title,w,w.onClose),onAction:u("tool-result-card","action",w.title,w,w.onAction)})}}}return a?e(Rm,{content:T,language:C,className:"not-prose"}):e("code",{className:y,...x,children:g})}}),[o,r,i,a,m,s]);return e("div",{className:ut("markdown-body max-w-none",n),children:e(ZC__default.default,{remarkPlugins:[jC__default.default,QC__default.default],rehypePlugins:[JC__default.default,ex__default.default],components:v,children:f})})},Dn=tx;P();var ox=({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,f)=>{if(!(!m&&!r?.onCardEvent))return (...h)=>{let u=m?.(...h),v=f?f(...h):void 0;return n(s,l,d,v,p),u}},i=Ss(t);if(i)switch(i.type){case "table":return e(ms,{data:i.data});case "metric-chart-card":return e(xs,{...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 e(gs,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return e(ws,{...i});case "error-card":{let s=i;return e(cs,{...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 e(ds,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:l})}case "suggestions-card":{let s=i;return e(ps,{...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 e(us,{...s,onClose:a("tool-result-card","close",s.title,s,s.onClose),onAction:a("tool-result-card","action",s.title,s,s.onAction)})}}return e("div",{className:"dynamic-card-fallback",children:e(Dn,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r})})},Gm=ox;P();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"}}},nx=({content:t,className:o="",messageId:r,cardHooks:n})=>{let a=eo__namespace.default.useMemo(()=>Zl.analyze(t),[t]);return e("div",{className:`universal-content-renderer ${o}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?e(Gm,{content:i.content,messageId:r,cardHooks:n},`block-${s}`):e(Dn,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:n},`block-${s}`))})},ks=nx;P();var ax=({content:t,isStreaming:o=true,onComplete:r,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:l})=>{let[d,p]=eo.useState(o?0:t.length),[m,f]=eo.useState(!o);eo.useEffect(()=>{if(o){p(0),f(false);return}p(t.length),f(true);},[t,o]),eo.useEffect(()=>{if(!o||m)return;if(d>=t.length){f(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 h=()=>{o&&!m&&(p(t.length),f(true),r?.());},u=o?t.slice(0,d):t,v=o&&!m,y=o&&!m;return c("div",{className:`streaming-markdown ${n}`,onClick:h,style:{cursor:o?"pointer":"default"},children:[c("div",{className:"relative",children:[e(ks,{content:u,messageId:s,cardHooks:l}),v&&e("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),y&&e("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"})]})},qm=ax;P();var Xm=({buttons:t,className:o})=>{let r=n=>{switch(n){case "copy":return e(Yo,{size:14});case "refresh":return e($a,{size:14});case "volume":return e(cd,{size:14});case "like":return e(ad,{size:14});case "dislike":return e(nd,{size:14});default:return null}};return e("div",{className:ut("flex items-center gap-1",o),children:t.map((n,a)=>e("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:ut("p-1.5 rounded-md transition-colors","text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:text-[var(--orb-fg)]","hover:bg-[var(--orb-hover)]","disabled:opacity-50 disabled:cursor-not-allowed",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}`))})};P();var Ps=({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 e("div",{className:"mb-4 flex justify-start",children:c("div",{className:"mr-auto w-full",style:{...s,background:"var(--orb-surface, #f5f5f5)",border:"1px solid var(--orb-border, #dbdbdb)"},children:[e(qm,{content:t.content,isStreaming:t.isStreaming??false,onComplete:o,streamIntervalMs:n,streamChunkSize:a,messageId:t.id,cardHooks:i}),t.content&&r?.isLatestAssistant&&e("div",{className:"mt-3 flex flex-row justify-start gap-2 border-t pt-2",style:{borderColor:"var(--orb-border, #dbdbdb)"},children:e(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"})}),e("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})}return e("div",{className:"mb-4 flex justify-end",children:c("div",{className:"ml-auto max-w-[80%]",style:{...s,background:"var(--orb-p50, #eef2f9)",border:"1px solid var(--orb-p100, #e4e9f5)"},children:[e("div",{className:"whitespace-pre-wrap",children:t.content}),e("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})};P();var Ym=({onTextUpdate:t,onComplete:o,onCancel:r,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:l}=wn({onTextUpdate:t,onComplete:p=>{o?.(p);},onError:p=>{console.error("Voice input error:",p),r?.();}});return e("button",{onClick:async()=>{i?l():await s();},disabled:n,className:ut("transition-all duration-200 flex items-center justify-center rounded-full",i?"bg-[color-mix(in_oklch,var(--orb-status-error)_12%,transparent)] text-[var(--orb-status-error)] hover:bg-[color-mix(in_oklch,var(--orb-status-error)_20%,transparent)] animate-pulse":"bg-transparent hover:bg-[var(--orb-hover)] text-[var(--orb-muted)] active:scale-95",n&&"opacity-50 cursor-not-allowed",a),title:i?"Stop recording":"Start recording",type:"button",children:i?e(gp,{size:16}):e(fp,{size:16})})};P();var po={container:"w-full max-w-4xl mx-auto",inputContainer:ut("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:ut("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-3","placeholder:text-[var(--orb-muted,#8c8c8c)] placeholder:font-normal","text-[var(--orb-fg,#555555)] selection:bg-[var(--orb-p100,#e4e9f5)]","focus:ring-0 focus:outline-none focus:border-none focus:shadow-none","min-h-[44px] max-h-[12em] overflow-y-auto scrollbar-thin scrollbar-thumb-[var(--orb-border)]"),filePreviewArea:"px-4 pt-3 pb-1 flex flex-wrap gap-2",fileTag:ut("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-[var(--orb-surface,#f5f5f5)] text-[var(--orb-fg,#555555)]","border border-[var(--orb-border,#dbdbdb)]","transition-all hover:bg-[var(--orb-hover,#eef2f9)]"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"h-[38px] w-[38px] shrink-0 md:h-8 md:w-8",buttonNormal:ut("bg-transparent hover:bg-[var(--orb-hover,#eef2f9)] text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)]","cursor-pointer active:scale-95"),sendButton:ut("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:ut("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:ut("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95")},sx={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},lx=({enabled:t,onClick:o})=>{let{t:r}=le();return e("button",{className:ut(po.buttonBase,po.buttonSmall,po.buttonNormal),onClick:o,disabled:!t,"aria-label":r("omph.input.upload"),type:"button",children:e(qd,{size:16})})},cx=({canSend:t,isResponding:o,onSend:r,onStop:n})=>{let{t:a}=le();return o?e("button",{className:ut(po.buttonBase,po.buttonSmall,po.stopButton),onClick:n,"aria-label":a("omph.input.stop"),type:"button",children:e(kp,{size:15})}):e("button",{className:ut(po.buttonBase,po.buttonSmall,t?po.sendButton:po.sendButtonDisabled),onClick:r,disabled:!t,"aria-label":a("omph.input.send"),type:"button",children:e(yp,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})})},jl=({onSend:t,onStop:o,isResponding:r=false,placeholder:n,getText:a})=>{let[i,s]=eo.useState(""),[l,d]=eo.useState([]),[p,m]=eo.useState(false),[f,h]=eo.useState(false),u=eo.useRef(null),{t:v}=le(),y=v("omph.input.placeholder"),g=y!=="omph.input.placeholder"?y:"Type a message...",x=n||(a?a("00019",g):g),b=(i.trim().length>0||l.length>0)&&!r,C={enabled:true},k=eo.useCallback(V=>{s(V.target.value),V.target.style.height="auto",V.target.style.height=`${Math.min(V.target.scrollHeight,200)}px`;},[]),S=eo.useCallback(V=>{if(V.target.files&&V.target.files.length>0){let z=Array.from(V.target.files);d(X=>{let W=z.filter(U=>X.some(Y=>Y.name===U.name&&Y.size===U.size));W.length>0&&console.warn("Duplicate files ignored:",W.map(U=>U.name));let H=z.filter(U=>!X.some(Y=>Y.name===U.name&&Y.size===U.size));return [...X,...H]}),u.current&&(u.current.value="");}},[]),T=eo.useCallback(V=>{d(z=>z.filter((X,W)=>W!==V));},[]),I=eo.useCallback(()=>{u.current?.click();},[]),w=eo.useCallback(async()=>{if(!b)return;let V=i,z=[...l];s(""),d([]),u.current&&(u.current.value="");try{await t(V,z);}catch(X){console.error("Failed to send message:",X),s(V),d(z);}},[i,b,t,l]),M=eo.useCallback(V=>{V.key==="Enter"&&!V.shiftKey&&!p&&(V.preventDefault(),w());},[w,p]),A=eo.useCallback(()=>{m(true);},[]),R=eo.useCallback(()=>{m(false);},[]),D=eo.useCallback(V=>{s(V);},[]),E=eo.useCallback(V=>{s(V);},[]),O=eo.useCallback(()=>{},[]),_=eo.useCallback(V=>{V.preventDefault(),h(true);},[]),J=eo.useCallback(V=>{V.preventDefault(),h(false);},[]),F=eo.useCallback(V=>{if(V.preventDefault(),h(false),V.dataTransfer.files&&V.dataTransfer.files.length>0){let z=Array.from(V.dataTransfer.files);d(X=>[...X,...z]);}},[]);return e("div",{className:po.container,children:c("div",{className:"relative",children:[e("input",{type:"file",multiple:true,className:"hidden",ref:u,onChange:S}),c("div",{className:ut(po.inputContainer,f&&po.dragActive),onDragOver:_,onDragLeave:J,onDrop:F,children:[l.length>0&&e("div",{className:po.filePreviewArea,children:l.map((V,z)=>c("div",{className:po.fileTag,children:[e(cp,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),e("span",{className:"truncate max-w-[150px]",children:V.name}),e("button",{onClick:()=>T(z),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:e(tp,{sx:{fontSize:16}})})]},`${V.name}-${z}`))}),c("div",{className:"flex w-full flex-col p-2",children:[e("div",{className:ut(po.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:e("textarea",{className:ut(po.textarea,"min-h-[24px] py-0 px-0"),placeholder:x,value:i,onChange:k,onKeyDown:M,onCompositionStart:A,onCompositionEnd:R,style:sx,"aria-label":v("omph.input.message"),spellCheck:false,rows:1})}),c("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[e("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":v("omph.input.tools"),children:e(lx,{enabled:C.enabled,onClick:I})}),c("div",{className:"flex items-center gap-1",children:[e(Ym,{onTextUpdate:D,onComplete:E,onCancel:O,disabled:r,className:po.buttonSmall}),e(cx,{canSend:b,isResponding:r,onSend:w,onStop:o})]})]})]})]})]})})};P();var jm=({messages:t,onSend:o,onStop:r,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:l,streamChunkSize:d,onMessageStreamingComplete:p,cardHooks:m,showInput:f=true,statusLine:h})=>{let u=eo.useRef(null),v=eo.useRef(t.length);return eo.useEffect(()=>{t.length>v.current&&u.current?.scrollIntoView({behavior:"smooth"}),v.current=t.length;},[t]),c("div",{className:ut("flex flex-col h-full w-full relative",i),children:[c("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 e(Ps,{message:y,assistantActions:b,onStreamingComplete:()=>p?.(y.id),streamIntervalMs:l,streamChunkSize:d,cardHooks:m},y.id)}),h,e("div",{ref:u})]}),f&&e("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:e(jl,{onSend:o||(async()=>{}),onStop:r||(()=>{}),isResponding:a,placeholder:s})})]})};P();var Qm={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},Jm=({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",f=[Qm[p],o].filter(Boolean).join(" \xB7 ");return c("div",{className:ut("orb-agent-panel",n),children:[c("div",{className:ut("orb-agent-header",s&&"cursor-grab active:cursor-grabbing"),onPointerDown:s,children:[e("span",{className:"orb-agent-avatar","aria-hidden":"true",children:"AI"}),c("div",{className:"min-w-0 flex-1",children:[e("div",{className:"orb-agent-title",children:t}),c("div",{className:"orb-agent-subtitle",children:[e("span",{className:"orb-agent-dot","data-active":m||void 0}),e("span",{className:"truncate",children:f||"Agent"})]})]}),r&&e("div",{className:"ml-auto flex flex-none items-center gap-1",children:r})]}),e("div",{className:"relative min-h-0 flex-1",children:e(jm,{...d,showInput:l,statusLine:m?c("div",{className:ut("orb-agent-status-line","mb-1"),children:[e("span",{className:"orb-agent-spinner","aria-hidden":"true"}),e("span",{children:i??`${Qm[p]}\u2026`})]}):void 0})})]})};P();var mx=t=>Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t),tg=({conversations:t,activeConversationId:o,labels:r,onNewConversation:n,onSelectConversation:a})=>{let[i,s]=eo.useState(false),l=eo.useRef(null),d=eo.useRef(null),p=eo.useRef(null),m=eo.useId(),f=!!a;eo.useEffect(()=>{if(!i)return;let u=y=>{l.current?.contains(y.target)||s(false);},v=y=>{y.key==="Escape"&&(y.stopPropagation(),s(false),p.current?.focus());};return document.addEventListener("pointerdown",u),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",u),document.removeEventListener("keydown",v);}},[i]),eo.useEffect(()=>{if(!i)return;let u=d.current?.querySelector('[aria-selected="true"]'),v=d.current?.querySelector('[role="option"]');(u??v)?.focus();},[i]);let h=u=>{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?u===1?0:v.length-1:(y+u+v.length)%v.length;v[g]?.focus();};return !n&&!f?null:c(jsxRuntime.Fragment,{children:[n&&e("button",{type:"button",className:"orb-omph-icon-btn","aria-label":r.newConversation,onClick:()=>{s(false),n();},children:e(en,{size:16})}),f&&a&&c("div",{className:"orb-omph-conversation-anchor",ref:l,children:[e("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:e(jc,{size:16})}),i&&e("div",{ref:d,id:m,className:"orb-omph-conversations",role:"listbox","aria-label":r.conversations,onKeyDown:u=>{u.key==="ArrowDown"?(u.preventDefault(),h(1)):u.key==="ArrowUp"&&(u.preventDefault(),h(-1));},children:t.length===0?e("p",{className:"orb-omph-conversation-empty",children:r.noConversations}):t.map(u=>{let v=u.updatedAt?mx(u.updatedAt):"",y=[u.preview,v].filter(x=>x&&x.length>0).join(" \xB7 "),g=u.id===o;return c("button",{type:"button",role:"option",className:"orb-omph-conversation","aria-selected":g,"data-active":g||void 0,onClick:()=>{a(u.id),s(false);},children:[e("span",{className:"orb-omph-conversation-title",children:u.title}),y&&e("span",{className:"orb-omph-conversation-meta",children:y})]},u.id)})})]})]})};P();var yx=2e3,Cx=1/3,Is=[.25,.5,.75,1,1.5,2,3,4],xx=100,og={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},rg=({text:t,language:o,startLine:r,endLine:n,wrap:a,labels:i})=>{let s=eo.useRef(null),l=eo.useMemo(()=>{let m=t.split(`
200
+ `);m.length>1&&m[m.length-1]===""&&m.pop();let f=Math.min(m.length,yx);return {shown:m.slice(0,f).join(`
201
+ `),shownCount:f,total:m.length}},[t]),d=eo.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]);eo.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 u=h.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop;f.scrollTop=Math.max(0,u-f.clientHeight*Cx);},[r,l.shown]);let p={"--orb-omph-digits":String(l.shownCount).length};return c("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:p,children:[e(reactSyntaxHighlighter.Prism,{language:o,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:d,customStyle:og,codeTagProps:{className:`language-${o}`,style:og},children:l.shown}),l.total>l.shownCount&&e("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},ng=({text:t})=>e("div",{className:"orb-omph-pv-doc",children:e(Dn,{content:t})}),ag=({url:t,alt:o,labels:r})=>{let[n,a]=eo.useState("fit"),[i,s]=eo.useState(null),[l,d]=eo.useState(false),p=n==="fit"?1:n,m=Is.some(v=>v>p),f=Is.some(v=>v<p),h=v=>a(y=>{let g=y==="fit"?1:y;return (v>0?Is.find(b=>b>g):[...Is].reverse().find(b=>b<g))??y}),u=n==="fit"||i===null?{maxWidth:"100%",height:"auto"}:{width:i*n,maxWidth:"none",height:"auto"};return l?e("div",{className:"orb-omph-pv-note",role:"alert",children:o?`${r.imageFailed} \xB7 ${o}`:r.imageFailed}):c("div",{className:"orb-omph-img",children:[e("div",{className:"orb-omph-img-stage",children:e("img",{src:t,alt:o??"",draggable:false,style:u,onLoad:v=>s(v.currentTarget.naturalWidth),onError:()=>d(true)})}),c("div",{className:"orb-omph-img-zoom",role:"group","aria-label":r.zoomFit,children:[e("button",{type:"button","aria-label":r.zoomOut,disabled:!f,onClick:()=>h(-1),children:"\u2212"}),e("button",{type:"button","aria-label":r.zoomFit,"data-active":n==="fit"||void 0,onClick:()=>a("fit"),children:n==="fit"?r.zoomFit:`${Math.round(n*xx)}%`}),e("button",{type:"button","aria-label":r.zoomIn,disabled:!m,onClick:()=>h(1),children:"+"})]})]})};var wx=/^[a-z][a-z0-9+.-]*:/i,Sx=/^L(\d+)(?:-L?(\d+))?$/i;var ig=["B","KB","MB","GB"];var kx=t=>{try{return decodeURIComponent(t)}catch{return t}},ec=t=>{let o=t.trim();if(!o||o.startsWith("#")||o.startsWith("//")||wx.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=kx(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=Sx.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)}},Rs=t=>t.split("/").filter(Boolean).pop()??t,lg=t=>{let o=t.split("/");return o.pop(),o.join("/")},tc=t=>{let o=Rs(t),r=o.lastIndexOf(".");return r>0?o.slice(r+1).toLowerCase():""},cg={prism:"text",label:"Text"},sg={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:cg},oc=(t,o)=>o?Object.values(sg).find(n=>n.prism===o)??{prism:o,label:o}:sg[tc(t)]??cg,dg=t=>{let o=t,r=0;for(;o>=1024&&r<ig.length-1;)o/=1024,r+=1;return `${r>0&&o<10?o.toFixed(1):Math.round(o).toString()} ${ig[r]}`};P();var Px=1e3,Tx=9,rr=16,Ix={markdown:"text/markdown;charset=utf-8",code:"text/plain;charset=utf-8"},mg=(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);},rc=({tone:t,icon:o,title:r,text:n,action:a})=>c("div",{className:"orb-omph-pv-notice","data-tone":t,role:t==="error"?"alert":void 0,children:[e("span",{className:"orb-omph-pv-notice-icon","aria-hidden":"true",children:o}),e("div",{className:"orb-omph-pv-notice-title",children:r}),n&&e("p",{className:"orb-omph-pv-notice-text",children:n}),a]}),gg=({state:t,placement:o,expanded:r,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:l,onRetry:d,onToggleExpand:p,onOpenExternally:m})=>{let[f,h]=eo.useState(true),[u,v]=eo.useState(false),{open:y,ref:g,phase:x,data:b}=t,C=b?.body;eo.useEffect(()=>{if(!u)return;let F=window.setTimeout(()=>v(false),Px);return ()=>window.clearTimeout(F)},[u]),eo.useEffect(()=>{y&&s.current?.focus({preventScroll:true});},[y,s,g?.path]);let k=b?.absolutePath??g?.path??"",S=C&&(C.kind==="markdown"||C.kind==="code")?C.text:k,T=S===k?a.previewCopyPath:a.previewCopyContent,I=C?.kind==="code"&&g?oc(g.path,C.language):null,w=!!(C&&(C.kind==="markdown"||C.kind==="code")&&C.previewOnly),M=!!(g&&C&&!w&&(C.kind==="markdown"||C.kind==="code"||C.kind==="image"||C.kind==="embed")),A=()=>{if(!C||!g)return;let F=Rs(k);if(C.kind==="markdown"&&!/\.(md|markdown|txt)$/i.test(F)&&(F=`${F}.md`),C.kind==="markdown"||C.kind==="code"){mg(new Blob([C.text],{type:Ix[C.kind]}),F);return}(C.kind==="image"||C.kind==="embed")&&fetch(C.url).then(V=>{if(!V.ok)throw new Error(`HTTP ${V.status}`);return V.blob()}).then(V=>mg(V,F)).catch(()=>window.open(C.url,"_blank","noopener"));},R=[];I&&R.push(I.label),C?.kind==="markdown"&&R.push("Markdown"),C?.kind==="image"&&g&&R.push(tc(g.path).toUpperCase()),b?.size!==void 0&&R.push(dg(b.size)),C?.kind==="code"&&g?.startLine!==void 0&&R.push(a.previewLines(g.startLine,g.endLine??g.startLine));let D=F=>{F.key==="Escape"&&(F.stopPropagation(),l(true));},E=e("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),O=()=>{if(!g)return null;if(x==="loading")return e("div",{className:"orb-omph-pv-skel",role:"status","aria-label":a.previewLoading,children:Array.from({length:Tx},(F,V)=>e("span",{},V))});if(x==="error"||!C)return e(rc,{tone:"error",icon:e(Da,{size:rr}),title:a.previewFailed,text:k,action:E});switch(C.kind){case "missing":return e(rc,{tone:"neutral",icon:e(Oa,{size:rr}),title:a.previewMissing,text:C.message??k});case "unsupported":return e(rc,{tone:"neutral",icon:e(Oa,{size:rr}),title:a.previewUnsupported,text:C.message??k,action:m&&e("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>m(g),children:a.previewOpenExternal})});case "markdown":return e(ng,{text:C.text},g.path);case "code":return e(rg,{text:C.text,language:oc(g.path,C.language).prism,startLine:g.startLine,endLine:g.endLine,wrap:f,labels:a},g.path);case "image":return e(ag,{url:C.url,alt:C.alt,labels:a},C.url);case "embed":return e("iframe",{src:C.url,title:C.caption??a.previewTitle,className:"orb-omph-pv-embed"},C.url);default:return null}},_=o==="overlay",J=C?.kind==="image"?Kc:Oa;return c("aside",{ref:s,className:"orb-omph-preview","data-open":y||void 0,"data-placement":o,role:_?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!y||void 0,tabIndex:-1,onKeyDown:D,children:[!_&&y&&e("div",{className:"orb-omph-pv-grip","aria-label":a.previewResize,...i}),c("div",{className:"orb-omph-pv",children:[c("header",{className:"orb-omph-pv-head",children:[_&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:e(Aa,{size:rr})}),e("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:e(J,{size:rr})}),c("div",{className:"orb-omph-pv-titles",children:[e("div",{className:"orb-omph-pv-name",title:k,children:g?Rs(g.path):""}),e("div",{className:"orb-omph-pv-path",title:k,children:e("bdi",{children:lg(k)})})]}),c("div",{className:"orb-omph-pv-actions",children:[C?.kind==="code"&&e("button",{type:"button",className:"orb-omph-text-button","aria-pressed":f,onClick:()=>h(F=>!F),children:a.previewWrap}),M&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewDownload,title:a.previewDownload,onClick:A,children:e(La,{size:rr})}),g&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":u?a.copied:T,title:u?a.copied:T,onClick:()=>{navigator.clipboard.writeText(S).then(()=>v(true));},children:u?e(Ao,{size:rr}):e(Yo,{size:rr})}),n&&e("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:e($c,{size:rr})}),!_&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:e(qt,{size:rr})})]})]}),e("div",{className:"orb-omph-pv-meta",children:R.join(" \xB7 ")}),e("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?C?.kind:void 0,children:O()})]})]})};P();var Mx=1e3,fg=50,Dx=1e3,Nx=t=>t==="tool"?tn:t==="command"?Wn:Qc,bg=t=>!!t.streaming||t.status==="running"||t.status==="pending",Ax=(t,o)=>o==="expanded"?true:bg(t),Ex=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),Lx=(t,o)=>`${Math.max(1,Math.round(t/Dx))}${o.secondUnit}`,Ox=({content:t})=>{let o=eo.useRef(null),[r,n]=eo.useState(false);return eo.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]),e("div",{ref:o,className:"orb-omph-process-body","data-overflow":r||void 0,children:t})},Fx=({turn:t,labels:o})=>{let[r,n]=eo.useState(false),[a,i]=eo.useState(false),s=t.assistant?.content??"",l=t.usage;return eo.useEffect(()=>{if(!r)return;let d=window.setTimeout(()=>n(false),Mx);return ()=>window.clearTimeout(d)},[r]),c("div",{className:"orb-omph-turn-actions",role:"group","aria-label":o.turnActions,children:[e("span",{className:"orb-omph-actions-time",children:t.assistant?.timestamp.toLocaleTimeString()}),Ex(l)&&c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-omph-actions-divider","aria-hidden":"true"}),e("button",{type:"button",className:"orb-omph-text-button","aria-expanded":a,onClick:()=>i(d=>!d),children:o.usage})]}),e("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?e(Ao,{size:14}):e(Yo,{size:14})}),a&&l&&c("div",{className:"orb-omph-usage",children:[l.inputTokens!==void 0&&c("span",{children:[o.inputTokens," ",l.inputTokens.toLocaleString()]}),l.outputTokens!==void 0&&c("span",{children:[o.outputTokens," ",l.outputTokens.toLocaleString()]}),l.durationMs!==void 0&&c("span",{children:[o.duration," ",Lx(l.durationMs,o)]})]})]})},Bx=({item:t,display:o,open:r,onToggle:n})=>{let a=Nx(t.kind),i=bg(t),s=o!=="compact"&&!!t.summary,l=r&&!!t.content;return c("div",{className:"orb-omph-process","data-status":t.status,"data-open":r||void 0,children:[c("button",{type:"button",className:"orb-omph-process-toggle","aria-expanded":r,onClick:n,children:[e(Ho,{size:12,className:"orb-omph-process-chevron"}),e(a,{size:14}),e("span",{className:i?"orb-omph-shimmer":void 0,children:t.title}),s&&e("span",{className:"orb-omph-process-summary",children:t.summary})]}),l&&t.content&&e(Ox,{content:t.content}),r&&t.streaming&&e("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},nc=t=>{let o=t.user?.content||t.assistant?.content||t.id,r=o.split(`
202
+ `).find(n=>n.trim())??o;return r.length>fg?`${r.slice(0,fg)}\u2026`:r},Hx=0,vg=({turns:t,labels:o,processDisplay:r,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=eo.useState({}),d=p=>{if(!i||p.defaultPrevented||p.button!==Hx||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey)return;let m=p.target.closest("a[href]");if(!m)return;let f=a(m.getAttribute("href")??"");f&&(p.preventDefault(),i(f,m));};return e(jsxRuntime.Fragment,{children:t.map((p,m)=>{let f=!!(p.assistant&&!p.assistant.streaming),u=m===t.length-1&&f?"always":"hover";return c("article",{className:"orb-omph-turn","data-omph-turn":p.id,"data-actions-reveal":u,children:[p.user&&c("div",{className:"orb-omph-user",children:[e("div",{className:"orb-omph-user-bubble",children:p.user.content}),e("div",{className:"orb-omph-clock",children:p.user.timestamp.toLocaleTimeString()})]}),p.process&&p.process.length>0&&e("div",{className:"orb-omph-process-list",children:p.process.map(v=>{let y=v.id in s?s[v.id]:Ax(v,r);return e(Bx,{item:v,display:r,open:y,onToggle:()=>l(g=>({...g,[v.id]:!y}))},v.id)})}),p.assistant&&c("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[e(ks,{content:p.assistant.content,messageId:p.assistant.id,cardHooks:n}),p.assistant.streaming&&e("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),p.failure&&e("div",{className:"orb-omph-failure","data-severity":p.failure.severity,children:p.failure.content}),f&&e(Fx,{turn:p,labels:o})]},p.id)})})};var ac=t=>({idle:t("omph.status.idle"),pending:t("omph.status.pending"),running:t("omph.status.running"),success:t("omph.status.success"),error:t("omph.status.error"),working:t("omph.working"),workingFor:o=>t("omph.workingFor",{duration:o}),loadOlder:t("omph.loadOlder"),loadingOlder:t("omph.loadingOlder"),toBottom:t("omph.toBottom"),copy:t("omph.copy"),copied:t("omph.copied"),turnActions:t("omph.turnActions"),usage:t("omph.usage"),inputTokens:t("omph.inputTokens"),outputTokens:t("omph.outputTokens"),duration:t("omph.duration"),send:t("omph.send"),stop:t("omph.stop"),turnRail:t("omph.turnRail"),secondUnit:t("omph.secondUnit"),minuteUnit:t("omph.minuteUnit"),previewTitle:t("omph.preview.title"),previewClose:t("omph.preview.close"),previewBack:t("omph.preview.back"),previewExpand:t("omph.preview.expand"),previewCollapse:t("omph.preview.collapse"),previewCopyContent:t("omph.preview.copyContent"),previewCopyPath:t("omph.preview.copyPath"),previewDownload:t("omph.preview.download"),previewOpenExternal:t("omph.preview.openExternal"),previewWrap:t("omph.preview.wrap"),previewLoading:t("omph.preview.loading"),previewMissing:t("omph.preview.missing"),previewFailed:t("omph.preview.failed"),previewUnsupported:t("omph.preview.unsupported"),previewRetry:t("omph.preview.retry"),previewResize:t("omph.preview.resize"),previewLines:(o,r)=>t(o===r?"omph.preview.line":"omph.preview.lines",{start:o,end:r}),previewTruncated:(o,r)=>t("omph.preview.truncated",{shown:o,total:r}),imageFailed:t("omph.preview.imageFailed"),zoomIn:t("omph.preview.zoomIn"),zoomOut:t("omph.preview.zoomOut"),zoomFit:t("omph.preview.zoomFit"),newConversation:t("omph.newConversation"),conversationList:t("omph.conversationList"),conversations:t("omph.conversations"),noConversations:t("omph.noConversations")}),ic=t=>({waiting:t("omph.approval.waiting"),choose:t("omph.approval.choose"),details:t("omph.approval.details"),choices:t("omph.approval.choices"),reject:t("omph.approval.reject"),allowOnce:t("omph.approval.allowOnce"),confirm:t("omph.approval.confirm"),other:t("omph.approval.other"),otherPlaceholder:t("omph.approval.otherPlaceholder"),escalation:o=>t("omph.approval.escalation",{toolName:o})});var zx=1e3,yg=60,Vx=1e3,Cg=(t,o)=>{let r=Math.max(1,Math.round(Math.max(t,Vx)/zx)),n=Math.floor(r/yg),a=r%yg;return n<=0?`${r}${o.secondUnit}`:`${n}${o.minuteUnit} ${a}${o.secondUnit}`};var _x={open:false,ref:null,phase:"loading",data:null},xg=t=>{let[o,r]=eo.useState(_x),n=eo.useRef(o);n.current=o;let a=eo.useRef(t);a.current=t;let i=eo.useRef(null),s=eo.useRef(0),l=eo.useRef(null),d=eo.useCallback(h=>{let u=a.current;if(!u)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}),u(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}));});},[]),p=eo.useCallback((h,u)=>{l.current=u??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=eo.useCallback((h=false)=>{s.current+=1,i.current?.abort(),r(v=>({...v,open:false}));let u=l.current;h&&u?.isConnected&&u.focus({preventScroll:true});},[]),f=eo.useCallback(()=>{let{ref:h}=n.current;h&&d(h);},[d]);return eo.useEffect(()=>()=>{i.current?.abort();},[]),{state:o,open:p,close:m,reload:f}};var lc="--orb-omph-pv-w",cc="--orb-omph-pv-pref",Kx=880,qx=560,Sg=400,Gr=320,Xx=.45,Yx=.7,kg=24,sc=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),Pg=({open:t,layout:o})=>{let r=eo.useRef(null),n=eo.useRef(null),[a,i]=eo.useState(0),[s,l]=eo.useState(null),[d,p]=eo.useState(false),[m,f]=eo.useState(false);eo.useLayoutEffect(()=>{let T=r.current;if(!T)return;let I=()=>i(T.getBoundingClientRect().width);I();let w=new ResizeObserver(I);return w.observe(T),()=>w.disconnect()},[]),eo.useEffect(()=>{t||p(false);},[t]);let h=o==="overlay"?false:o==="split"?a>=Sg+Gr:a>=Kx,u=h&&!d?"split":"overlay",v=Math.max(Gr,Math.min(a*Yx,a-Sg)),y=sc(s??a*Xx,Gr,v),g=a>0&&a<qx,x=eo.useCallback(T=>{let I=r.current;I&&(I.style.setProperty(cc,`${T}px`),I.dataset.placement==="split"&&I.dataset.open==="true"&&I.style.setProperty(lc,`${T}px`));},[]),b=eo.useCallback(T=>{T.button===0&&(T.preventDefault(),T.currentTarget.setPointerCapture(T.pointerId),n.current={pointerId:T.pointerId,startX:T.clientX,startWidth:y,latest:y},f(true));},[y]),C=eo.useCallback(T=>{let I=n.current;!I||I.pointerId!==T.pointerId||(I.latest=sc(I.startWidth+(I.startX-T.clientX),Gr,v),x(I.latest));},[v,x]),k=eo.useCallback(T=>{let I=n.current;!I||I.pointerId!==T.pointerId||(n.current=null,T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId),l(I.latest),f(false));},[]),S=eo.useCallback(T=>{let I={ArrowLeft:y+kg,ArrowRight:y-kg,Home:Gr,End:v};T.key in I&&(T.preventDefault(),l(sc(I[T.key],Gr,v)));},[v,y]);return {mainRef:r,placement:u,width:y,compact:g,dragging:m,expanded:d,canExpand:h,toggleExpanded:()=>p(T=>!T),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":Gr,"aria-valuemax":Math.round(v),"aria-valuenow":Math.round(y),tabIndex:0,onPointerDown:b,onPointerMove:C,onPointerUp:k,onPointerCancel:k,onKeyDown:S}}};var As=48,jx=900,Ig=()=>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=eo.useRef(null),s=eo.useRef(null),l=eo.useRef(true),d=eo.useRef({height:0,top:0}),p=eo.useRef(void 0),m=eo.useRef(false),[f,h]=eo.useState(true),[u,v]=eo.useState(false),[y,g]=eo.useState(t[0]?.id),x=eo.useCallback(()=>{let T=i.current;T&&(d.current={height:T.scrollHeight,top:T.scrollTop});},[]),b=eo.useCallback(()=>{let T=i.current;if(!T)return;let I=T.getBoundingClientRect().top,w=T.querySelector("[data-omph-turn]")?.dataset.omphTurn;T.querySelectorAll("[data-omph-turn]").forEach(M=>{M.getBoundingClientRect().top-I<=As&&(w=M.dataset.omphTurn);}),g(w);},[]);eo.useEffect(()=>{let T=i.current,I=s.current;if(!T||!I)return;let w=()=>{v(T.clientWidth>jx),l.current&&(T.scrollTop=T.scrollHeight),x();};w();let M=new ResizeObserver(w);return M.observe(T),M.observe(I),()=>M.disconnect()},[x]),eo.useLayoutEffect(()=>{let T=i.current;if(!T)return;let I=t[0]?.id,w=p.current,M=w!==void 0&&t.some(D=>D.id===w),A=M&&I!==void 0&&I!==w,R=w!==void 0&&!M;if(p.current=I,R){l.current=true,h(true),T.scrollTop=T.scrollHeight,x(),b();return}if(A){l.current=false,h(false);let D=T.scrollHeight-d.current.height;T.scrollTop=d.current.top+Math.max(0,D),x(),b();return}l.current&&(T.scrollTop=T.scrollHeight),x(),b();},[o,x,t,b]),eo.useEffect(()=>{n||(m.current=false);},[n]);let C=eo.useCallback(()=>{let T=i.current;if(!T)return;let w=T.scrollHeight-T.scrollTop-T.clientHeight<=As;w!==l.current&&(l.current=w,h(w)),x(),b();let M=T.scrollHeight-T.clientHeight>As,A=T.scrollTop<=As;!M||!A||w||!r||n||!a||m.current||(m.current=true,a());},[r,n,a,x,b]),k=eo.useCallback(()=>{let T=i.current;T&&(l.current=true,h(true),T.scrollTo({top:T.scrollHeight,behavior:Ig()?"auto":"smooth"}));},[]),S=eo.useCallback(T=>{let w=i.current?.querySelector(`[data-omph-turn="${CSS.escape(T)}"]`);w&&(l.current=false,h(false),w.scrollIntoView({block:"start",behavior:Ig()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:f,railVisible:u,activeTurnId:y,onScroll:C,returnToBottom:k,scrollToTurn:S}};P();var Jx=1e3,e0=(t,o)=>o[t],t0=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("|"),o0=({startedAt:t,labels:o})=>{let[r,n]=eo.useState(()=>Date.now());eo.useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),Jx);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?o.working:o.workingFor(Cg(Math.max(0,r-t),o));return c("div",{className:"orb-omph-running","data-omph-running":"true",children:[e("span",{className:"orb-visually-hidden",role:"status","aria-live":"polite",children:o.working}),e("span",{className:"orb-omph-running-rule","aria-hidden":"true"}),c("span",{className:"orb-omph-running-body",children:[e("span",{className:"orb-omph-spinner","aria-hidden":"true"}),e("span",{className:"orb-omph-shimmer",children:a})]})]})},qz=({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:f,cardHooks:h,hasOlder:u=false,loadingOlder:v=false,onLoadOlder:y,onSend:g,onStop:x,onHeaderPointerDown:b,conversations:C=[],activeConversationId:k,onNewConversation:S,onSelectConversation:T,loadFilePreview:I,resolveFileLink:w=ec,filePreviewLayout:M="auto",onOpenFileExternally:A})=>{let{t:R}=le(),D={...ac(R),...l},E=i??(s?"running":"idle"),O=E==="running"||E==="pending",_=[e0(E,D),n].filter(Boolean).join(" \xB7 "),J=eo.useMemo(()=>t0(t),[t]),F=Rg({turns:t,contentVersion:J,hasOlder:u,loadingOlder:v,onLoadOlder:y}),[V,z]=eo.useState(""),X=V.trim(),W=s&&X.length===0,H=[...t].reverse().find(ce=>!!ce.assistant?.streaming||ce.process?.some(be=>be.streaming||be.status==="running"||be.status==="pending")),U=O?H?.startedAt:void 0,Y=!!I,ue=xg(I),re=Pg({open:ue.state.open,layout:M}),ge=eo.useRef(null),we=eo.useRef(null),Ve=Y&&ue.state.open&&re.placement==="overlay",Te=re.placement==="split"&&ue.state.open,Ie={[cc]:`${re.width}px`,[lc]:Te?`${re.width}px`:"0px"};eo.useEffect(()=>{we.current?.toggleAttribute("inert",Ve);},[Ve]);let He=async()=>{if(!X||!g)return;let ce=X;z("");try{await g(ce);}catch{z(be=>be.trim().length===0?ce:be);}};return c("div",{className:ut("orb-omph-panel",f),"data-omph-panel":"","data-status":E,"data-compact":re.compact||void 0,children:[c("div",{className:ut("orb-omph-header",b&&"cursor-grab active:cursor-grabbing"),onPointerDown:b,children:[e("span",{className:"orb-omph-avatar","aria-hidden":"true",children:r??"AI"}),c("div",{className:"min-w-0 flex-1",children:[o&&e("div",{className:"orb-omph-title",children:o}),c("div",{className:"orb-omph-subtitle",children:[e("span",{className:"orb-omph-dot","data-active":O||void 0}),e("span",{className:"truncate",children:_||D.idle})]})]}),(S||T||a)&&c("div",{className:"orb-omph-header-actions",onPointerDown:ce=>ce.stopPropagation(),children:[e(tg,{conversations:C,activeConversationId:k,labels:D,onNewConversation:S,onSelectConversation:T}),a]})]}),c("div",{ref:re.mainRef,className:"orb-omph-main","data-placement":re.placement,"data-open":String(ue.state.open),"data-dragging":re.dragging||void 0,style:Ie,children:[c("div",{ref:we,className:"orb-omph-center",children:[c("div",{className:"orb-omph-stage","data-rail":F.railVisible||void 0,children:[e("div",{ref:F.scrollerRef,className:"orb-omph-scroll",onScroll:F.onScroll,children:c("div",{ref:F.contentRef,className:"orb-omph-column",children:[u&&y&&e("button",{type:"button",className:"orb-omph-older",disabled:v,onClick:y,children:v?D.loadingOlder:D.loadOlder}),e(vg,{turns:t,labels:D,processDisplay:d,cardHooks:h,resolveFileLink:w,onOpenFile:Y?ue.open:void 0}),O&&e(o0,{startedAt:U,labels:D})]})}),F.railVisible&&t.length>0&&e("nav",{className:"orb-omph-rail","aria-label":D.turnRail,children:t.map(ce=>e("button",{type:"button",className:"orb-omph-rail-mark","data-active":F.activeTurnId===ce.id||void 0,"aria-label":nc(ce),title:nc(ce),onClick:()=>F.scrollToTurn(ce.id)},ce.id))}),!F.following&&e("button",{type:"button",className:"orb-omph-to-bottom","aria-label":D.toBottom,onClick:F.returnToBottom,children:e(Ho,{size:16})})]}),p&&c("form",{className:"orb-omph-composer",onSubmit:ce=>{ce.preventDefault(),W?x?.():He();},children:[e("textarea",{className:"orb-omph-input",value:V,placeholder:m,rows:1,onChange:ce=>z(ce.target.value),onKeyDown:ce=>{ce.key!=="Enter"||ce.shiftKey||ce.nativeEvent.isComposing||(ce.preventDefault(),W?x?.():He());}}),e("button",{type:"submit",className:W?"orb-omph-stop":"orb-omph-send","aria-label":W?D.stop:D.send,disabled:!W&&X.length===0,children:W?e(Hc,{size:16}):e(Bc,{size:16})})]})]}),Y&&e(gg,{state:ue.state,placement:re.placement,expanded:re.expanded,canExpand:re.canExpand,labels:D,gripProps:re.gripProps,paneRef:ge,onClose:ue.close,onRetry:ue.reload,onToggleExpand:re.toggleExpanded,onOpenExternally:A})]})]})};P();var br="other",r0=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,n0=({request:t,onDecide:o,labels:r})=>{let{t:n}=le(),a={...ic(n),...r},i=eo.useRef(null),s=eo.useRef(null),l=eo.useRef(false),d=eo.useRef(false),[p,m]=eo.useState(false),[f,h]=eo.useState(null),[u,v]=eo.useState(""),y=t.choices??[],g=t.allowOther??y.length>0,x=y.length>0||g,b=t.reason?.trim()||a.escalation(t.toolName),C=t.detail?.trim(),k=f===br&&u.trim().length>0,S=!x||f!==null&&f!==br||k;eo.useEffect(()=>{m(false),h(null),v(""),i.current?.focus();},[t.id]),eo.useEffect(()=>{f===br&&s.current?.focus();},[f]);let T=M=>{p||(m(true),o(M,t));},I=()=>{if(S){if(!x){T({kind:"allowed-once"});return}if(f===br){let M=u.trim();if(!M)return;T({kind:"other",text:M});return}f&&T({kind:"choice",choiceId:f});}},w=M=>{if(!(p||r0(M.target))&&!(M.key!=="Enter"&&M.key!=="Escape")&&!(M.key==="Enter"&&M.target instanceof HTMLElement&&M.target.closest('button, a[href], [role="button"]'))&&!(M.ctrlKey||M.metaKey||M.altKey||M.shiftKey)&&(M.preventDefault(),M.stopPropagation(),!(M.repeat||l.current||d.current||M.nativeEvent.isComposing))){if(M.key==="Escape"){T({kind:"rejected"});return}I();}};return e("div",{className:"orb-omph-approval","data-omph-approval":t.id,"aria-busy":p,onKeyDown:w,onKeyUpCapture:()=>{d.current=false;},onCompositionStartCapture:()=>{l.current=true;},onCompositionEndCapture:()=>{l.current=false,d.current=true;},children:c("div",{className:"orb-omph-approval-card",children:[c("div",{className:"orb-omph-approval-strip",children:[e("span",{className:"orb-omph-approval-dot","aria-hidden":"true"}),x?a.choose:a.waiting]}),c("div",{ref:i,className:"orb-omph-approval-body",tabIndex:0,role:"group","aria-label":a.details,children:[e("div",{className:"orb-omph-approval-headline",children:b}),C&&e("div",{className:"orb-omph-approval-detail",children:C}),x&&c("fieldset",{className:"orb-omph-approval-choices",disabled:p,children:[e("legend",{className:"orb-visually-hidden",children:a.choices}),y.map(M=>{let A=f===M.id;return c("label",{className:"orb-omph-approval-choice","data-selected":A,children:[e("input",{type:"radio",name:`omph-approval-${t.id}`,value:M.id,checked:A,onChange:()=>h(M.id)}),c("span",{className:"orb-omph-approval-choice-copy",children:[e("span",{children:M.label}),M.description&&e("span",{className:"orb-omph-approval-choice-description",children:M.description})]})]},M.id)}),g&&c("label",{className:"orb-omph-approval-choice","data-selected":f===br,children:[e("input",{type:"radio",name:`omph-approval-${t.id}`,value:br,checked:f===br,onChange:()=>h(br)}),e("span",{className:"orb-omph-approval-choice-copy",children:e("span",{children:a.other})})]}),g&&f===br&&e("textarea",{ref:s,className:"orb-omph-approval-other",value:u,placeholder:a.otherPlaceholder,rows:3,"aria-label":a.other,onChange:M=>v(M.target.value)})]})]}),c("div",{className:"orb-omph-approval-actions",children:[e("button",{type:"button",className:"orb-btn orb-btn-neutral orb-omph-approval-reject",disabled:p,onClick:()=>T({kind:"rejected"}),children:a.reject}),e("button",{type:"button",className:"orb-btn orb-btn-primary",disabled:p||!S,onClick:I,children:x?a.confirm:a.allowOnce})]})]})})};P();var Og=520,s0=88,l0=88,c0=24,Ls=640,Fg=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),uc=t=>typeof t=="number"?`${t}px`:t,d0=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,a5=({anchor:t,defaultAnchor:o="right",onAnchorChange:r,width:n=Og,top:a=s0,bottom:i=l0,inset:s=c0,zIndex:l=1300,shellClassName:d,shellStyle:p,className:m,onHeaderPointerDown:f,...h})=>{let u=eo.useRef(null),v=eo.useRef(null),[y,g]=eo.useState(o),[x,b]=eo.useState(0),[C,k]=eo.useState(typeof n=="number"?n:Og),[S,T]=eo.useState(0),[I,w]=eo.useState(false),M=t??y;eo.useEffect(()=>{let F=()=>b(window.innerWidth);return F(),window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)},[]),eo.useLayoutEffect(()=>{let F=()=>{let z=u.current?.getBoundingClientRect();z?.width?k(z.width):typeof n=="number"&&k(n);};if(F(),!u.current||typeof ResizeObserver>"u")return;let V=new ResizeObserver(F);return V.observe(u.current),()=>V.disconnect()},[n]);let A=eo.useCallback(F=>{if(!x)return s;let V=x<Ls?12:s,z=Math.max(V,x-C-V);return x<Ls||F==="left"?V:F==="center"?Fg((x-C)/2,V,z):z},[s,C,x]),R=eo.useCallback(F=>["left","center","right"].reduce((z,X)=>{let W=Math.abs(F-A(z));return Math.abs(F-A(X))<W?X:z},"right"),[A]),D=eo.useCallback(F=>{t===void 0&&g(F),r?.(F);},[t,r]);eo.useEffect(()=>{I||T(A(M));},[A,I,M]);let E=eo.useCallback(F=>{f?.(F),!(F.defaultPrevented||d0(F.target))&&(F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),v.current={pointerId:F.pointerId,startClientX:F.clientX,startX:S,currentX:S,captureElement:F.currentTarget},w(true));},[f,S]),O=eo.useCallback(F=>{let V=v.current;if(!V||V.pointerId!==F.pointerId)return;let z=x<Ls?12:s,X=Math.max(z,x-C-z),W=Fg(V.startX+F.clientX-V.startClientX,z,X);V.currentX=W,T(W);},[s,C,x]),_=eo.useCallback(F=>{let V=v.current;if(!V||V.pointerId!==F.pointerId)return;try{V.captureElement.releasePointerCapture(F.pointerId);}catch{}let z=R(V.currentX);v.current=null,w(false),D(z),T(A(z));},[A,D,R]),J=eo.useMemo(()=>({position:"fixed",top:uc(a),bottom:uc(i),left:S,width:uc(n),maxWidth:`calc(100vw - ${x<Ls?24:s*2}px)`,zIndex:l,pointerEvents:"auto",transition:I?"none":"left 180ms ease-out",touchAction:"none",...p}),[i,s,I,S,p,a,x,n,l]);return e("div",{ref:u,className:ut("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":M,"data-dragging":I?"true":"false",style:J,onPointerMove:O,onPointerUp:_,onPointerCancel:_,children:e(Jm,{...h,className:m,onHeaderPointerDown:E})})};P();var m0={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},m5=({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:f,streamIntervalMs:h,streamChunkSize:u,onMessageStreamingComplete:v,cardHooks:y})=>{let[g,x]=eo.useState(""),[b,C]=eo.useState(false),k=eo.useRef(null),S=m0[l];eo.useEffect(()=>{k.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let T=eo.useCallback(async()=>{let w=g.trim();!w||n||(x(""),await o(w));},[n,o,g]),I=eo.useCallback(async w=>{w.key==="Enter"&&!b&&(w.preventDefault(),await T());},[T,b]);return c("div",{className:ut("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-none dark:bg-[var(--orb-surface-2)]",a),children:[d&&e("button",{onClick:d,className:ut("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",S==="top-left"&&"-left-2 -top-2",S==="top-right"&&"-right-2 -top-2",S==="bottom-left"&&"-bottom-2 -left-2",S==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:e("span",{className:ut("block h-4 w-4 border-[var(--orb-ai-accent)]",S==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",S==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",S==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",S==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),c("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:p,children:[e("div",{className:"flex items-center",children:e("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),e("div",{})]}),c("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((w,M)=>{let A=w.type==="assistant"&&M===t.length-1,R=w.type==="assistant"?{isLatestAssistant:A,isResponding:n,onRegenerate:r?()=>r(w.id):void 0}:void 0;return e(Ps,{message:w,assistantActions:R,onStreamingComplete:()=>v?.(w.id),streamIntervalMs:h,streamChunkSize:u,cardHooks:y},w.id)}),e("div",{ref:k})]}),e("div",{className:"border-t border-[var(--orb-border)] px-3 py-3",children:c("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:[e("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:e(en,{className:"h-4 w-4"})}),e("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,onChange:w=>x(w.target.value),onCompositionStart:()=>C(true),onCompositionEnd:()=>C(false),onKeyDown:I,"aria-label":"Copilot input",spellCheck:false}),e("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,type:"button","aria-label":"Microphone",children:e(za,{className:"h-4 w-4"})})]})})]})};P();var g0=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],f0=`
203
203
  .orbcafe-ai-browser-glow {
204
204
  position: fixed;
205
205
  inset: 0;
@@ -231,4 +231,4 @@ ${o}: ${(a??n)(g.secondaryValue??0)}`:""]})}),e("text",{x:g.x,y:Math.max(g.y-12,
231
231
  0%, 100% { opacity: 0.5; }
232
232
  50% { opacity: 1; }
233
233
  }
234
- `,Uz=({active:t=false,colors:r=Zx,zIndex:o=2147483e3})=>{let n={"--orbcafe-ai-glow-line":r[0],"--orbcafe-ai-glow-z-index":o};return c(jsxRuntime.Fragment,{children:[e("style",{children:jx}),e("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var a5=({defaultMode:t="login",onLogin:r,onRegister:o,onForgotPassword:n}={})=>{let[a,i]=er.useState(t),[s,l]=er.useState(false),d=er.useCallback(async m=>{l(true);try{await m?.();}finally{l(false);}},[]),u=er.useCallback(m=>d(()=>r?.(m)),[r,d]),p=er.useCallback(m=>d(()=>o?.(m)),[o,d]),f=er.useCallback(m=>d(()=>n?.(m)),[n,d]),b=er.useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:u,onRegister:p,onForgotPassword:f}),[f,u,p,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:b}};P();var e0={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."},g5=({mode:t,defaultMode:r="login",onModeChange:o,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:l,copy:d,sx:u})=>{let p=t!==void 0,[f,b]=er.useState(r),m=t??f,v=er.useMemo(()=>({...e0,...d}),[d]),[y,g]=er.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,h]=er.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[C,k]=er.useState({email:""}),[w,T]=er.useState(""),I=E=>{p||b(E),T(""),o?.(E);},S=async E=>{E.preventDefault(),await n?.(y),T("Demo login accepted. No real authentication request was sent.");},A=async E=>{E.preventDefault(),await a?.(x),T("Demo registration saved locally for this screen.");},D=async E=>{E.preventDefault(),await i?.(C),T("Demo reset link request created. No email was sent.");},M=m==="login"?v.loginTitle:m==="register"?v.registerTitle:v.forgotTitle,N=m==="login"?v.loginSubtitle:m==="register"?v.registerSubtitle:v.forgotSubtitle;return c("div",{className:"orb-auth-frame orb-root",style:u,children:[c("div",{className:"orb-auth-brand",children:[e("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),e("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)"}}),e("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?e("span",{style:{alignSelf:"flex-start",position:"relative"},children:l}):e("span",{className:"orb-logo-slot",children:"Host logo"}),c("div",{className:"orb-auth-claim",children:[e("div",{className:"orb-auth-rule"}),e("h2",{children:v.headline}),e("p",{children:v.subheadline})]}),e("div",{className:"orb-auth-meta",children:v.brandMeta})]}),e("div",{className:"orb-auth-form",children:c("div",{className:"orb-auth-card",children:[e("span",{className:"orb-overline",style:{letterSpacing:"0.12em"},children:v.productName}),e("h1",{className:"orb-h2",style:{margin:0},children:M}),e("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:N}),w&&e(on,{severity:"success",children:w}),m==="login"&&c("form",{onSubmit:S,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Email",type:"email",autoComplete:"username",value:y.username,onChange:E=>g(O=>({...O,username:E.target.value})),startAdornment:e(zs,{size:15,strokeWidth:1.8})}),e(ze,{label:"Password",type:"password",autoComplete:"current-password",value:y.password,onChange:E=>g(O=>({...O,password:E.target.value})),startAdornment:e(Ea,{size:15,strokeWidth:1.8})}),c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[e(It,{label:"Remember me",checked:y.remember,onChange:E=>g(O=>({...O,remember:E.target.checked}))}),e("button",{type:"button",className:"orb-link",onClick:()=>I("forgot"),children:"Forgot password?"})]}),e(we,{type:"submit",size:"large",block:true,loading:s,children:s?"Signing in\u2026":"Sign in"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["New user?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>I("register"),children:"Register"})]})]}),m==="register"&&c("form",{onSubmit:A,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Full name",value:x.name,onChange:E=>h(O=>({...O,name:E.target.value})),startAdornment:e(zs,{size:15,strokeWidth:1.8})}),e(ze,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:E=>h(O=>({...O,email:E.target.value})),startAdornment:e(Hs,{size:15,strokeWidth:1.8})}),e(ze,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:E=>h(O=>({...O,password:E.target.value})),startAdornment:e(Ea,{size:15,strokeWidth:1.8})}),e(ze,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:E=>h(O=>({...O,confirmPassword:E.target.value}))}),e(It,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:E=>h(O=>({...O,acceptedTerms:E.target.checked}))}),e(we,{type:"submit",size:"large",block:true,loading:s,children:"Create demo account"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Already have an account?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Sign in"})]})]}),m==="forgot"&&c("form",{onSubmit:D,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Work email",type:"email",autoComplete:"username",value:C.email,onChange:E=>k({email:E.target.value}),startAdornment:e(Hs,{size:15,strokeWidth:1.8})}),e(we,{type:"submit",size:"large",block:true,loading:s,children:"Send reset request"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Remember your password?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Back to sign in"})]})]}),c("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:[e("span",{style:{flex:1,height:1,background:"var(--orb-border)"}}),"or",e("span",{style:{flex:1,height:1,background:"var(--orb-border)"}})]}),e(we,{variant:"neutral",size:"large",block:true,children:"Continue with corporate SSO"}),c("p",{className:"orb-meta",style:{textAlign:"center",fontWeight:300,margin:0},children:["Protected by corporate single sign-on.",e("br",{}),"Demo credentials: demo@orbcafe.local / orbcafe-demo"]})]})})]})};var r0={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},o0=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],Rg=({tasks:t,appId:r,tableKey:o,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:l,filterTableKey:d,serviceUrl:u,variantService:p,layout:f,columns:b,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:h,onFilterSearch:C,onFilterVariantLoad:k,enableRowReorder:w,onTaskReorder:T,onLayoutIdChange:I,onLayoutSave:S})=>{let A=r??l??"planning-gantt",D=o??d??"planning",[M,N]=er.useState(n),[E,O]=er.useState(a??t[0]?.id??""),[F,X]=er.useState(""),[H,Y]=er.useState(null),[W,j]=er.useState({...r0,...i}),V=er.useMemo(()=>{let ue=String(W.keyword?.value??"").trim().toLowerCase(),Se=String(W.status?.value??"").trim(),$e=String(W.owner?.value??"").trim().toLowerCase(),ke=String(W.workCenter?.value??"").trim().toLowerCase(),le=W.dateRange?.value,Ee=le?.[0]?ro__default.default(le[0]):null,Me=le?.[1]?ro__default.default(le[1]):null;return t.filter(Pe=>{if(ue&&![Pe.id,Pe.code,Pe.title,Pe.project,Pe.workCenter,Pe.owner?.name].join(" ").toLowerCase().includes(ue)||Se&&Pe.status!==Se||$e&&!String(Pe.owner?.name??"").toLowerCase().includes($e)||ke&&!String(Pe.workCenter??"").toLowerCase().includes(ke))return false;if(Ee||Me){let Ve=ro__default.default(Pe.startDate),tt=ro__default.default(Pe.endDate),nt=Ee?tt.isAfter(Ee)||tt.isSame(Ee,"day"):true,it=Me?Ve.isBefore(Me)||Ve.isSame(Me,"day"):true;if(!nt||!it)return false}return true})},[W,t]);er.useEffect(()=>{V.length!==0&&(V.some(ue=>ue.id===E)||O(V[0].id));},[V,E]);let z=er.useCallback(ue=>{O(ue.id);},[]),U=er.useCallback(ue=>{X(ue),I?.(ue);},[I]),K=er.useCallback(ue=>{Y(Se=>({key:(Se?.key??0)+1,variant:ue})),k?.(ue);},[k]),fe=er.useMemo(()=>({appId:A,tableKey:D,fields:s??o0,filters:W,onFilterChange:j,onVariantLoad:K,onSearch:C??(()=>{}),currentLayoutId:F,layoutRefs:[{tableKey:D,layoutId:F||null}],variantService:p,serviceUrl:u}),[F,s,W,K,C,A,D,u,p]),se=er.useMemo(()=>({appId:A,tableKey:D,serviceUrl:u,tasks:V,columns:b,scale:M,onScaleChange:N,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:h,selectedTaskId:E,onTaskSelect:z,enableRowReorder:w,onTaskReorder:T,layout:f,layoutVariant:H?.variant,layoutVariantLoadKey:H?.key,onLayoutIdChange:U,onLayoutSave:S}),[b,g,w,V,U,f,H?.key,H?.variant,x,h,S,T,z,m,A,D,v,y,M,u,E]);return {scale:M,setScale:N,selectedTaskId:E,setSelectedTaskId:O,filters:W,setFilters:j,filteredTasks:V,smartFilterProps:fe,planningGanttProps:se}};var S5=t=>{let r=Rg(t),o=er.useMemo(()=>({filterProps:r.smartFilterProps,ganttProps:r.planningGanttProps}),[r.planningGanttProps,r.smartFilterProps]);return {...r,layoutProps:o}};P();ro__default.default.extend(a0__default.default);var ic=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],sc=36,lc=58,wa=8,cc=260,u0=320,Uo="220ms cubic-bezier(0.2, 0, 0, 1)",Dg={"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"}},m0=t=>t?Dg[t]?.label??t:"Planned",g0=t=>t?Dg[t]?.color??"default":"info",Ng=t=>Math.min(100,Math.max(0,t??0)),Ag=(t,r=0)=>t.flatMap(o=>[{...o,level:r},...Ag(o.children??[],r+1)]),f0=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:m0(t.status),statusTone:t.status??"planned",progress:Ng(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Eg=(t,r)=>r==="month"?t.startOf("month"):r==="week"?t.startOf("week"):r==="day"?t.startOf("day"):t.startOf("hour"),Lg=(t,r)=>r==="month"?t.endOf("month"):r==="week"?t.endOf("week"):r==="day"?t.endOf("day"):t.endOf("hour"),b0=(t,r,o)=>{let n=[],a=Eg(t,o),i=Lg(r,o);for(;a.isBefore(i)||a.isSame(i);){let s=o==="month"?a.add(1,"month"):o==="week"?a.add(1,"week"):o==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${o}-${a.valueOf()}`,label:o==="month"?a.format("MMM YYYY"):o==="week"?a.format("MMM D"):o==="day"?a.format("D"):a.format("HH:mm"),contextLabel:o==="hour"?a.format("MMM D"):o==="day"?a.format("MMM"):o==="week"?`W${a.isoWeek()}`:void 0,title:o==="hour"?a.format("MMM D, YYYY HH:mm"):o==="day"?a.format("MMM D, YYYY"):o==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},dc=(t,r,o)=>{let n=0;for(let a of r){if(t.isBefore(a.start))return n;if(t.isBefore(a.end)){let i=Math.max(1,a.end.valueOf()-a.start.valueOf()),s=Math.max(0,t.valueOf()-a.start.valueOf());return n+s/i*o}n+=o;}return n},Og=({appId:t="planning-gantt",tableKey:r="planning",serviceUrl:o,title:n="Project Plan",extraTools:a,bodyHeight:i=560,tasks:s,columns:l,scale:d="week",onScaleChange:u,page:p,rowsPerPage:f=20,rowsPerPageOptions:b=[20,50,100,-1],count:m,onPageChange:v,onRowsPerPageChange:y,timelineStart:g,timelineEnd:x,selectedTaskId:h,onTaskSelect:C,enableRowReorder:k=true,onTaskReorder:w,layout:T,layoutVariant:I,layoutVariantLoadKey:S,onLayoutIdChange:A,onLayoutSave:D,emptyLabel:M="No planning tasks available.",sx:N})=>{let E=sr(),{t:O}=pe(),F=er.useRef(null),X=er.useRef(null),H=er.useRef(null),Y=er.useRef(false),[W,j]=er.useState(null),[V,z]=er.useState("content"),[U,K]=er.useState(null),[fe,se]=er.useState(0),[ue,Se]=er.useState({}),[$e,ke]=er.useState(sc),[le,Ee]=er.useState([]),Me=er.useRef(void 0),[Pe,Ve]=er.useState({activeId:null,overId:null}),[tt,nt]=er.useState(null),[it,q]=er.useState(false),De=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),ye=er.useRef(null),Be=er.useMemo(()=>Ag(s),[s]),at=er.useMemo(()=>{if(le.length===0)return Be;let B=new Map(Be.map(Te=>[Te.id,Te])),J=le.map(Te=>B.get(Te)).filter(Te=>!!Te),ge=new Set(J.map(Te=>Te.id));return [...J,...Be.filter(Te=>!ge.has(Te.id))]},[Be,le]),Ze=er.useMemo(()=>new Map(at.map(B=>[B.id,B])),[at]),St=er.useMemo(()=>at.map(B=>f0(B)),[at]),Mt=er.useMemo(()=>new Map(St.map(B=>[B.id,B])),[St]),Ot=er.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(B,J)=>c(ie,{spacing:.2,children:[e(L,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:J.title}),e(L,{sx:{fontSize:13,color:"text.secondary"},children:J.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(B,J)=>e(xt,{label:J.status,color:g0(J.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:B=>c(ie,{spacing:.6,children:[c(L,{variant:"caption",sx:{color:"text.secondary"},children:[B,"%"]}),e($n,{variant:"determinate",value:B,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),At=er.useMemo(()=>{if(!l||l.length===0)return Ot;let B=new Map(Ot.map(J=>[J.id,J]));return l.map(J=>{let ge=B.get(J.id),Te=J.width??ge?.minWidth??120,et={id:J.id,label:J.label,minWidth:Te};if(ge?.numeric&&(et.numeric=true),J.render){let Xe=J.render;return et.render=(kt,bt)=>{let gt=Ze.get(bt.id);return Xe(gt||bt)},et}return ge?.render?(et.render=ge.render,et):(et.render=(Xe,kt)=>{let bt=kt[J.id];if(bt!=null&&String(bt).length>0)return String(bt);let Ct=Ze.get(kt.id)?.[J.id];return Ct!=null&&String(Ct).length>0?String(Ct):"-"},et)})},[l,Ot,Ze]),re=hn({appId:t,tableKey:r,title:n,columns:At,rows:St,rowKey:"id",page:p,rowsPerPage:f,rowsPerPageOptions:b,count:m??St.length,onPageChange:v,onRowsPerPageChange:y,showSummary:false,layout:T,onLayoutSave:D}),Ke=t?e(bn,{appId:t,tableKey:r,currentLayoutData:re.currentLayoutData,onLayoutLoad:re.handleLayoutLoad,targetLayoutId:re.layoutIdToLoad,activeLayoutId:re.currentLayoutId,serviceUrl:o}):null,Fe=re.visibleRows;er.useEffect(()=>{let B=Be.map(J=>J.id);Ee(J=>{let ge=new Set(B),Te=J.filter(bt=>ge.has(bt)),et=new Set(Te),Xe=B.filter(bt=>!et.has(bt)),kt=[...Te,...Xe];return kt.length===J.length&&kt.every((bt,gt)=>bt===J[gt])?J:kt});},[Be]),er.useEffect(()=>{S===void 0||!I||Me.current!==S&&(Me.current=S,re.handleVariantLoad(I));},[re,I,S]),er.useEffect(()=>{A?.(re.currentLayoutId);},[re.currentLayoutId,A]);let ce=B=>B.type==="group"?`group-${B.id}`:`row-${(B.data||B)?.id}`,ve=er.useMemo(()=>{let B=St.map(gt=>ro__default.default(gt.startDate)),J=St.map(gt=>ro__default.default(gt.endDate)),ge=g?ro__default.default(g):B.reduce((gt,Ct)=>Ct.isBefore(gt)?Ct:gt,B[0]??ro__default.default()),Te=x?ro__default.default(x):J.reduce((gt,Ct)=>Ct.isAfter(gt)?Ct:gt,J[0]??ro__default.default().add(30,"day")),et=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",Xe=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",kt=d==="hour"?12:1,bt=d==="hour"?12:1;return {start:Eg(ge.subtract(kt,et),d),end:Lg(Te.add(bt,Xe),d)}},[St,d,x,g]),te=ic.find(B=>B.value===d)??ic[1],he=Array.isArray(a)?a:a?[a]:[],Ne=er.useMemo(()=>b0(ve.start,ve.end,d),[ve.end,ve.start,d]),Je=Ne.length*te.width,st=Ne.length>0?100/Ne.length:100,pt=Ne.length>0?`repeat(${Ne.length}, minmax(${te.width}px, 1fr))`:"1fr",Bt=Ne.length>0?`calc(100% / ${Ne.length}) 100%`:"100% 100%",Xt=(re.columns||[]).filter(B=>re.visibleColumns.includes(B.id)).reduce((B,J)=>B+(re.columnWidths?.[J.id]||J.minWidth||100),0)+(re.grouping.length>0?72:0),Vt=V==="manual"&&W!==null?W:Xt,wt=U==="table",Wt=U==="timeline",ht=U==="timeline",Nt=U==="table",lt=!ht&&!Nt,Ft=()=>{let B=fe||F.current?.clientWidth||0;return B>0?Math.max(cc,B-wa-u0):Math.max(cc,Xt)},Yt=B=>Math.min(Math.max(B,cc),Ft()),$=(()=>{if(fe<=0)return null;let B=lt?wa:0;if(wt)return {tableWidth:fe,splitterWidth:B,timelineWidth:0};if(Wt)return {tableWidth:0,splitterWidth:B,timelineWidth:fe};if(V==="even"){let ge=Math.max(0,(fe-B)/2);return {tableWidth:ge,splitterWidth:B,timelineWidth:Math.max(0,fe-B-ge)}}let J=Yt(Vt);return {tableWidth:J,splitterWidth:B,timelineWidth:Math.max(0,fe-B-J)}})(),Q=$?`${$.tableWidth}px ${$.splitterWidth}px ${$.timelineWidth}px`:wt?"minmax(0, 1fr) 0px 0px":Wt?"0px 0px minmax(0, 1fr)":V==="even"?`minmax(0, 1fr) ${wa}px minmax(0, 1fr)`:`${Vt}px ${wa}px minmax(0, 1fr)`;er.useEffect(()=>{V==="manual"&&j(B=>B===null?null:Yt(B));},[V,Xt,fe]);let be=B=>{B.preventDefault(),B.currentTarget.setPointerCapture(B.pointerId),K(null),z("manual"),ye.current={startX:B.clientX,startWidth:X.current?.getBoundingClientRect().width??Vt};let J=Te=>{let et=ye.current;if(!et)return;let Xe=Yt(et.startWidth+Te.clientX-et.startX);j(Xe);},ge=()=>{ye.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);},Ce=()=>{K(null),z("even"),j(null);},Le=B=>!k||!B?false:Mt.get(B)?.reorderable!==false,_e=(B,J)=>{if(!B||!J||B===J||!Le(B)||!Le(J))return false;if(re.grouping.length===0)return true;let ge=Mt.get(B),Te=Mt.get(J);return !ge||!Te?false:re.grouping.every(et=>ge[et]===Te[et])},qe=(B,J)=>{if(!_e(B,J))return;let ge=Fe.filter(Et=>Et.type!=="group").map(Et=>String((Et.data||Et)?.id)),Te=ge.indexOf(B),et=ge.indexOf(J);if(Te<0||et<0)return;let Xe=[...ge];[Xe[Te],Xe[et]]=[Xe[et],Xe[Te]];let kt=new Set(ge),bt=at.map(Et=>Et.id),gt=[...Xe,...bt.filter(Et=>!kt.has(Et))],Ct=Ze.get(B),nr=Ze.get(J);if(re.setOrder("asc"),re.setOrderBy(""),Ee(gt),Ct&&nr){let{level:Et,...Zt}=Ct,{level:Ht,...Kt}=nr,$t=gt.reduce((rr,ar)=>{let fr=Ze.get(ar);if(fr){let{level:Ir,...Mr}=fr;rr.push(Mr);}return rr},[]);w?.($t,{activeTask:Zt,targetTask:Kt});}},je=(B,J)=>{if(!Le(J.id)){B.preventDefault();return}B.stopPropagation(),B.dataTransfer.effectAllowed="move",B.dataTransfer.setData("text/plain",J.id),Ve({activeId:J.id,overId:null}),C?.(Ze.get(J.id)||J);},mt=(B,J)=>{if(!_e(Pe.activeId,J)){Ve(ge=>ge.overId===null?ge:{...ge,overId:null});return}B.preventDefault(),B.stopPropagation(),B.dataTransfer.dropEffect="move",Ve(ge=>ge.overId===J?ge:{...ge,overId:J});},ft=(B,J)=>{let ge=Pe.activeId||B.dataTransfer.getData("text/plain");if(!_e(ge,J)){Ve({activeId:null,overId:null});return}B.preventDefault(),B.stopPropagation(),qe(ge,J),Ve({activeId:null,overId:null});},Rt=()=>{Ve({activeId:null,overId:null});},yt=B=>{if(Y.current)return;let J=B==="table"?X.current:H.current,ge=B==="table"?H.current:X.current;!J||!ge||(Y.current=true,ge.scrollTop=J.scrollTop,window.requestAnimationFrame(()=>{Y.current=false;}));};return er.useLayoutEffect(()=>{let B=F.current;if(!B){se(0);return}let J=0,ge=()=>{window.cancelAnimationFrame(J),J=window.requestAnimationFrame(()=>{let et=B.clientWidth;se(Xe=>Math.abs(Xe-et)<.5?Xe:et);});};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(B),window.addEventListener("resize",ge),()=>{window.cancelAnimationFrame(J),Te.disconnect(),window.removeEventListener("resize",ge);}},[St.length]),er.useLayoutEffect(()=>{if(!h||Nt)return;let B=H.current,J=X.current;if(!B)return;let ge=`row-${h}`,Te=Array.from(B.querySelectorAll("[data-planning-timeline-row-key]")).find(kt=>kt.dataset.planningTimelineRowKey===ge),et=Mt.get(h);if(!Te||!et)return;let Xe=window.requestAnimationFrame(()=>{let kt=B.getBoundingClientRect(),bt=Te.getBoundingClientRect(),gt=Math.max(1,B.clientHeight-$e),Ct=B.scrollTop+bt.top-kt.top-$e-(gt-bt.height)/2;Y.current=true,B.scrollTop=Math.max(0,Ct),J&&!ht&&(J.scrollTop=B.scrollTop);let nr=Math.max(1,B.scrollWidth),Et=Ne.length>0?nr/Ne.length:te.width,Zt=dc(ro__default.default(et.startDate),Ne,Et),Ht=Math.max(0,Zt-Et);B.scrollLeft=Math.min(Ht,Math.max(0,nr-B.clientWidth)),window.requestAnimationFrame(()=>{Y.current=false;});});return ()=>window.cancelAnimationFrame(Xe)},[te.width,$e,h,ht,Mt,Nt,Fe,Ne]),er.useLayoutEffect(()=>{let B=X.current;if(!B)return;let J=0,ge=0,Te=false,et=()=>{if(Te)return;let Ht=B.querySelector("thead"),Kt=Array.from(B.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Kt.length===0)return;let $t=Ht?.getBoundingClientRect().height||sc,rr={};Kt.forEach(ar=>{let fr=ar.dataset.ctableRowKey;fr&&(rr[fr]=ar.getBoundingClientRect().height);}),ke(ar=>Math.abs(ar-$t)<.01?ar:$t),Se(ar=>{let fr=Object.keys(ar),Ir=Object.keys(rr);return fr.length===Ir.length&&Ir.every(Mr=>Math.abs((ar[Mr]??0)-rr[Mr])<.01)?ar:rr});},Xe=()=>{window.cancelAnimationFrame(J),J=window.requestAnimationFrame(et);};if(et(),window.cancelAnimationFrame(ge),ge=window.requestAnimationFrame(()=>{ge=window.requestAnimationFrame(et);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{Te||Xe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",Xe),()=>{Te=true,window.cancelAnimationFrame(J),window.cancelAnimationFrame(ge),window.removeEventListener("resize",Xe);};let kt=new ResizeObserver(Xe),bt=B.querySelector("table"),gt=B.querySelector("tbody"),Ct=B.querySelector("thead");bt&&kt.observe(bt),Ct&&kt.observe(Ct);let nr=new WeakSet,Et=()=>{B.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Ht=>{nr.has(Ht)||(kt.observe(Ht),nr.add(Ht));});};Et();let Zt=null;return gt&&typeof MutationObserver<"u"&&(Zt=new MutationObserver(()=>{Et(),Xe();}),Zt.observe(gt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",Xe),()=>{Te=true,window.cancelAnimationFrame(J),window.cancelAnimationFrame(ge),kt.disconnect(),Zt?.disconnect(),window.removeEventListener("resize",Xe);}},[Fe,re.visibleColumns,re.grouping,re.columnWidths]),c(Ae,{className:"orb-ctable-surface orb-planning-gantt",elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:"var(--orb-r-container)",border:`1px solid ${E.palette.divider}`,...N},children:[e("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":O("table.title.default"),children:c("div",{className:"orb-table-toolbar-primary",children:[e(gi,{value:re.filterText,onChange:B=>{re.setFilterText(B),re.setPage(0);}}),e(mi,{rowsPerPage:re.rowsPerPage,rowsPerPageOptions:b,page:re.page,count:re.totalDisplayCount,onRowsPerPageChange:re.setRowsPerPage,onPageChange:re.setPage}),he.length>0&&e("div",{className:"orb-table-toolbar-custom",children:he.map((B,J)=>e("div",{className:"orb-planning-extra-tool",children:B},`planning-extra-tool-${J}`))}),e("span",{className:"orb-table-toolbar-spacer"}),c("div",{className:"orb-table-toolbar-actions",children:[c("div",{className:"orb-table-tool-group",children:[e(ae,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:B=>re.setAnchorEl(B.currentTarget),sx:pr,children:e(ln,{fontSize:"small"})}),e(ae,{className:"orb-table-tool-button",tooltip:"Group by",onClick:B=>re.setGroupAnchorEl(B.currentTarget),sx:pr,children:e(So,{fontSize:"small"})}),e(ae,{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:()=>q(true),sx:pr,children:e(pp,{fontSize:"small"})})]}),Ke&&e("div",{className:"orb-table-tool-group",children:Ke}),e("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:e(_n,{"aria-label":"Planning pane layout",size:"small",value:U??(V==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:e(si,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:e(ci,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:e(ii,{fontSize:"small"})}],onValueChange:B=>{B==="split"?Ce():K(B);}})}),e("div",{className:"orb-table-tool-group orb-planning-scale-control",children:e(zt,{label:"",value:d,options:ic.map(B=>({value:B.value,label:B.label})),onChange:B=>u?.(B.target.value)})})]})]})}),St.length===0?e("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:M}):e("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:c("div",{ref:F,sx:{height:"100%",display:"grid",gridTemplateColumns:Q,minWidth:0,transition:`grid-template-columns ${Uo}`},children:[e("div",{"data-planning-scroll-pane":"table",ref:X,onScroll:()=>yt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:ht?0:1,transform:ht?"translateX(-10px)":"translateX(0)",pointerEvents:ht?"none":"auto",transition:`opacity ${Uo}, transform ${Uo}`},children:e(core.DndContext,{sensors:De,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:B=>{let J=B?.active?.id,ge=B?.over?.id;typeof J=="string"&&typeof ge=="string"&&re.handleColumnReorder(J,ge);},children:c("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:Xt,"& thead th":{height:sc,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[e(hi,{columns:re.columns,visibleColumns:re.visibleColumns,order:re.order,orderBy:re.orderBy,sortBy:re.sortBy,onRequestSort:re.handleRequestSort,onContextMenu:(B,J)=>{B.preventDefault(),B.stopPropagation(),nt({mouseX:B.clientX+2,mouseY:B.clientY-6,columnId:J});},grouping:re.grouping,isAllExpanded:re.isAllExpanded,handleToggleAll:re.handleToggleAll,columnWidths:re.columnWidths,onColumnResize:re.handleColumnResize,enableColumnReorder:true}),e(vi,{visibleRows:Fe,columns:re.columns,visibleColumns:re.visibleColumns,selected:h?[h]:[],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:M,handleClick:(B,J)=>{C?.(Ze.get(J.id)||J);},getRowDataKey:({entry:B})=>ce(B),getGroupRowProps:()=>({style:{height:lc}}),getRowProps:({data:B})=>{let J=B,ge=Le(J.id),Te=Pe.activeId===J.id,et=Pe.overId===J.id&&_e(Pe.activeId,J.id);return {draggable:ge,className:et?"orb-is-drop-target":void 0,style:{cursor:Te?"grabbing":ge?"grab":C?"pointer":"default",height:lc,opacity:Te?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:Xe=>je(Xe,J),onDragOver:Xe=>mt(Xe,J.id),onDragEnter:Xe=>mt(Xe,J.id),onDrop:Xe=>ft(Xe,J.id),onDragEnd:Rt}}})]})})}),e("div",{onPointerDown:lt?be:void 0,role:"separator","aria-orientation":"vertical",sx:{width:lt?wa:0,cursor:lt?"col-resize":"default",opacity:lt?1:0,pointerEvents:lt?"auto":"none",borderLeft:lt?`1px solid ${E.palette.divider}`:"0 solid transparent",borderRight:lt?`1px solid ${E.palette.divider}`:"0 solid transparent",backgroundColor:vt()==="dark"?"color-mix(in oklch, var(--orb-muted) 10%, transparent)":"color-mix(in oklch, var(--orb-fg) 4%, transparent)",transition:`width ${Uo}, opacity ${Uo}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:E.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:lt?"col-resize":"default"}}}),e("div",{sx:{minWidth:0,overflow:"hidden",opacity:Nt?0:1,transform:Nt?"translateX(10px)":"translateX(0)",pointerEvents:Nt?"none":"auto",transition:`opacity ${Uo}, transform ${Uo}`},children:e("div",{"data-planning-scroll-pane":"timeline",ref:H,onScroll:()=>yt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:c("div",{sx:{width:"100%",minWidth:Je||"100%"},children:[e("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:pt,height:$e,boxSizing:"border-box",borderBottom:`1px solid ${E.palette.divider}`,position:"sticky",top:0,zIndex:2},children:Ne.map(B=>c("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 ${E.palette.divider}`,color:B.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[B.contextLabel&&e(L,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:B.contextLabel}),e(L,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:B.label})]},B.key))}),e(ie,{sx:{position:"relative"},children:Fe.map(B=>{let J=ce(B),ge=ue[J]??lc;if(B.type==="group")return e("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 ${E.palette.divider}`}},B.id);let Te=B.data||B,et=ro__default.default(Te.startDate),Xe=ro__default.default(Te.endDate),kt=dc(et,Ne,st),bt=dc(Xe,Ne,st),gt=Math.max(0,bt-kt),Ct=Ng(Te.progress),nr=Te.id===h,Et=Le(Te.id),Zt=Pe.activeId===Te.id,Ht=Pe.overId===Te.id&&_e(Pe.activeId,Te.id),Kt=Te.color??(Te.statusTone==="blocked"?E.palette.error.main:E.palette.primary.main);return e("div",{className:`orb-planning-timeline-row ${nr?"orb-is-selected":""}`,"data-planning-timeline-row-key":J,draggable:Et,onDragStart:$t=>je($t,Te),onDragOver:$t=>mt($t,Te.id),onDragEnter:$t=>mt($t,Te.id),onDrop:$t=>ft($t,Te.id),onDragEnd:Rt,onClick:()=>C?.(Ze.get(Te.id)||Te),sx:{position:"relative",height:ge,boxSizing:"border-box",borderBottom:`1px solid ${E.palette.divider}`,opacity:Zt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:E.palette.primary.main,opacity:Ht?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:vt()==="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:Zt?"grabbing":Et?"grab":C?"pointer":"default",transition:"opacity 120ms ease"},children:e(ct,{title:`${Te.title}: ${et.format("MMM D HH:mm")} - ${Xe.format("MMM D HH:mm")}`,children:c("div",{sx:{position:"absolute",left:`${kt}%`,top:Math.max(8,(ge-24)/2),width:`max(18px, ${gt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:vt()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:nr?`2px solid ${E.palette.warning.main}`:"none",outlineOffset:2},children:[e("div",{sx:{height:"100%",width:`${Ct}%`,backgroundColor:Kt}}),e(L,{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)})})]})})})]})}),e(pn,{groupAnchorEl:re.groupAnchorEl,setGroupAnchorEl:re.setGroupAnchorEl,grouping:re.grouping,setGrouping:re.setGrouping,columns:re.columns}),e(un,{anchorEl:re.anchorEl,setAnchorEl:re.setAnchorEl,columns:re.columns,visibleColumns:re.visibleColumns,toggleColumnVisibility:re.toggleColumnVisibility}),e(Rp,{contextMenu:tt,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:B=>{re.applyMultiSort([{field:B,direction:"asc"}]);},onSortDesc:B=>{re.applyMultiSort([{field:B,direction:"desc"}]);},onClearSort:B=>{let J=re.sortBy.filter(ge=>ge.field!==B);J.length>0?re.applyMultiSort(J):(re.clearMultiSort(),re.orderBy===B&&re.setOrderBy(""));},onHideColumn:B=>{re.visibleColumns.includes(B)&&re.toggleColumnVisibility(B);},onToggleGroup:B=>re.toggleGroupField(B),onToggleSummary:B=>re.toggleSummaryColumn(B),onOpenSortDialog:()=>q(true)}),e(Dp,{open:it,onClose:()=>q(false),columns:re.columns,initialRules:re.sortBy.length>0?re.sortBy:re.orderBy?[{field:re.orderBy,direction:re.order}]:[],onApply:B=>re.applyMultiSort(B),onClear:()=>{re.clearMultiSort(),re.setOrderBy("");}})]})};P();var tV=({filterProps:t,ganttProps:r,spacing:o=2,sx:n,children:a})=>{let i=n?[{height:"100%",overflow:"hidden"},n]:{height:"100%",overflow:"hidden"},s=r.sx?[{height:"100%"},r.sx]:{height:"100%"};return c(ie,{spacing:o,sx:i,children:[e("div",{sx:{flexShrink:0},children:e(Wr,{...t})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:e(Og,{...r,bodyHeight:r.bodyHeight??"100%",sx:s})}),a]})};P();var Fg=640,h0=360,v0=360,Ns=8,En="220ms cubic-bezier(0.2, 0, 0, 1)",mc=(t,r,o=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:o,hasChildren:i.length>0,parentIds:n}];return r.has(a.id)?[...s,...mc(i,r,o+1,[...n,a.id])]:s}),Hg=t=>t.flatMap(r=>[r,...Hg(r.children??[])]),zg=(t,r=0,o=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:r,hasChildren:a.length>0,parentIds:o},...zg(a,r+1,[...o,n.id])]}),Vg=t=>t.flatMap(r=>{let o=r.children??[];return o.length===0?[]:[r.id,...Vg(o)]}),Bg=t=>Object.entries(t).filter(([r])=>r!=="children").map(([,r])=>r==null?"":typeof r=="string"||typeof r=="number"||typeof r=="boolean"?String(r):"").join(" ").toLowerCase(),uV=({title:t,subtitle:r,nodes:o,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:l,expandedNodeIds:d,defaultExpandedNodeIds:u,onExpandedNodeIdsChange:p,defaultPaneMode:f="split",minTreePaneWidth:b=h0,minDetailPaneWidth:m=v0,tableAppId:v="ctree-comp",tableKey:y="default",tableTitle:g,filterConfig:x,searchQuery:h,searchToken:C,defaultRowsPerPage:k=-1,rowsPerPageOptions:w=[20,50,100,-1],serviceUrl:T,emptyLabel:I="No tree items available.",headerAction:S,sx:A,className:D})=>{let M=sr(),N=er.useRef(null),E=er.useRef(null),O=er.useRef(null),[F,X]=er.useState(s??o[0]?.id??null),[H,Y]=er.useState(u??Vg(o).slice(0,3)),[W,j]=er.useState(f),[V,z]=er.useState(Fg),[U,K]=er.useState(0),[fe,se]=er.useState(0),[ue,Se]=er.useState(k),$e=er.useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:ce=>c(ie,{spacing:.3,children:[e(L,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:ce.label}),ce.subtitle&&e(L,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:ce.subtitle})]})}],[n]),ke=er.useMemo(()=>new Set(d??H),[d,H]),le=er.useMemo(()=>mc(o,ke),[o,ke]),Ee=er.useMemo(()=>Hg(o),[o]),Me=er.useMemo(()=>zg(o),[o]),Pe=i===void 0?F:i,Ve=er.useMemo(()=>Ee.find(ce=>ce.id===Pe)??null,[Pe,Ee]),tt=ce=>{let ve=E.current?.clientWidth??0,te=ve>0?Math.max(b,ve-Ns-m):Math.max(b,ce);return Math.min(Math.max(ce,b),te)},nt=W==="detail",it=W==="tree"||!a,q=W==="split"&&!!a,ye=(()=>{if(U<=0)return null;if(W==="tree"||!a)return {treeWidth:U,splitterWidth:0,detailWidth:0};if(W==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:U};let ce=q?Ns:0,ve=tt(V);return {treeWidth:ve,splitterWidth:ce,detailWidth:Math.max(0,U-ce-ve)}})(),Be=ye?`${ye.treeWidth}px ${ye.splitterWidth}px ${ye.detailWidth}px`:W==="tree"||!a?"minmax(0, 1fr) 0px 0px":W==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${b}px, ${V}px) ${Ns}px minmax(${m}px, 1fr)`;er.useEffect(()=>{let ce=E.current;if(!ce){K(0);return}let ve=0,te=()=>{window.cancelAnimationFrame(ve),ve=window.requestAnimationFrame(()=>{let Ne=ce.clientWidth;K(Je=>Math.abs(Je-Ne)<.5?Je:Ne);});};if(te(),typeof ResizeObserver>"u")return window.addEventListener("resize",te),()=>{window.cancelAnimationFrame(ve),window.removeEventListener("resize",te);};let he=new ResizeObserver(te);return he.observe(ce),window.addEventListener("resize",te),()=>{window.cancelAnimationFrame(ve),he.disconnect(),window.removeEventListener("resize",te);}},[]);let at=ce=>{d===void 0&&Y(ce),p?.(ce);},Ze=ce=>{let ve=new Set(ke);ve.has(ce)?ve.delete(ce):ve.add(ce),at(Array.from(ve));},St=ce=>{i===void 0&&X(ce.id),l?.(ce);};er.useEffect(()=>{se(0);},[o]),er.useEffect(()=>{let ce=h?.trim().toLowerCase();if(!ce)return;let ve=Me.find(({node:pt})=>Bg(pt).includes(ce));if(!ve)return;let te=new Set(ke);ve.parentIds.forEach(pt=>te.add(pt)),at(Array.from(te)),St(ve.node);let Ne=mc(o,te).findIndex(({node:pt})=>pt.id===ve.node.id);Ne>=0&&ue>0&&se(Math.floor(Ne/ue));let Je=0,st=0;return Je=window.requestAnimationFrame(()=>{st=window.requestAnimationFrame(()=>{let pt=N.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);}},[h,C,Me,o,ue]);let Mt=er.useMemo(()=>le.map(({node:ce,level:ve,hasChildren:te})=>({...ce,id:ce.id,__node:ce,__level:ve,__hasChildren:te,__expanded:ke.has(ce.id),__searchText:Bg(ce)})),[ke,le]),Ot=er.useMemo(()=>$e.map((ce,ve)=>({id:ce.id,label:ce.label,minWidth:typeof ce.width=="number"?ce.width:ce.minWidth??(ve===0?320:120),numeric:ce.numeric??ce.align==="right",render:(te,he)=>{let Ne=he.__node,Je=ce.render?ce.render(Ne):Ne[ce.id];if(ve!==0)return e(Ie,{sx:{minWidth:0,color:ce.align==="right"?"text.primary":"text.secondary",fontWeight:ce.align==="right"?750:500,textAlign:ce.align??"left"},children:Je});let st=Number(he.__level??0),pt=!!he.__hasChildren,Bt=!!he.__expanded;return c(ie,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${st*24}px`},children:[e(ae,{tooltip:pt?Bt?"Collapse":"Expand":"",onClick:Xt=>{Xt.stopPropagation(),pt&&Ze(Ne.id);},disabled:!pt,sx:{width:24,height:24,visibility:pt?"visible":"hidden",transform:Bt?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:e(Vr,{sx:{fontSize:20}})}),e(Ie,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:Ne.markerColor??M.palette.primary.main}}),e(Ie,{sx:{minWidth:0},children:Je})]})}})),[$e,ke,M.palette.primary.main]),At=ce=>{if(!q)return;ce.preventDefault(),ce.currentTarget.setPointerCapture(ce.pointerId),O.current={startX:ce.clientX,startWidth:V};let ve=he=>{let Ne=O.current;Ne&&z(tt(Ne.startWidth+he.clientX-Ne.startX));},te=()=>{O.current=null,window.removeEventListener("pointermove",ve),window.removeEventListener("pointerup",te),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",ve),window.addEventListener("pointerup",te);},re=()=>{let ce=E.current?.clientWidth??0,ve=ce>0?Math.max(b,(ce-Ns)/2):Fg;j("split"),z(tt(ve));},Ke=()=>a?typeof a=="function"?a(Ve):a:null,Fe=a?e(_n,{"aria-label":"Tree pane layout",value:W,options:[{value:"tree",label:"Expand tree",icon:e(si,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:e(ci,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:e(ii,{fontSize:"small"})}],onValueChange:ce=>{ce==="split"?re():j(ce);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return c(Ie,{ref:N,className:["ctree_comp",D].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${M.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${rt(M.palette.common.black,vt()==="dark"?.24:.08)}`,...A},children:[Fe,c(Ie,{ref:E,sx:{height:"100%",display:"grid",gridTemplateColumns:Be,transition:`grid-template-columns ${En}`,minWidth:0},children:[c(Ie,{"aria-hidden":nt?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:nt?0:1,transform:nt?"translateX(-12px)":"translateX(0)",pointerEvents:nt?"none":"auto",transition:`opacity ${En}, transform ${En}`,willChange:"opacity, transform"},children:[c(ie,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${M.palette.divider}`},children:[c(ie,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[e(So,{sx:{color:"primary.main",fontSize:28}}),c(Ie,{sx:{minWidth:0},children:[e(L,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),r&&e(L,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:r})]})]}),S!==void 0?S:e(ae,{tooltip:"Add node",color:"default",children:e(Ho,{fontSize:"small"})})]}),c(Ie,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[e(Jr,{appId:v,tableKey:y,title:g??(typeof t=="string"?t:"Tree"),columns:Ot,rows:Mt,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:Pe?[Pe]:[],onSelectionChange:ce=>{let ve=ce[ce.length-1],te=Ee.find(he=>he.id===ve);te&&St(te);},page:fe,rowsPerPage:ue,rowsPerPageOptions:w,count:Mt.length,onPageChange:se,onRowsPerPageChange:ce=>{se(0),Se(ce);},filterConfig:x,serviceUrl:T,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),Mt.length===0&&e(Ie,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:I})]})]}),e(Ie,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:q?At:void 0,sx:{width:"100%",cursor:q?"col-resize":"default",backgroundColor:q?rt(M.palette.text.primary,vt()==="dark"?.16:.08):"transparent",opacity:q?1:0,pointerEvents:q?"auto":"none",position:"relative",transition:`opacity ${En}, background-color 120ms ease`,"&:hover":{backgroundColor:q?rt(M.palette.primary.main,vt()==="dark"?.35:.18):"transparent"}}}),c(Ie,{"aria-hidden":it?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:it?0:1,transform:it?"translateX(12px)":"translateX(0)",pointerEvents:it?"none":"auto",transition:`opacity ${En}, transform ${En}`,willChange:"opacity, transform"},children:[e(Ie,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:e(Dt,{sx:{width:"100%"}})}),e(Ie,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:Ke()})]})]})]})};P();var S0={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)"}}},hV=({children:t,transitionKey:r,variant:o="fade",durationMs:n=220,delayMs:a=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:l})=>{let d=xo("(prefers-reduced-motion: reduce)"),[u,p]=er.useState("to"),f=!s&&!d&&o!=="none";er.useEffect(()=>{if(!f){p("to");return}p("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{p("to");});});return ()=>cancelAnimationFrame(v)},[r,f]);let b=S0[o],m=er.useMemo(()=>f?u==="from"?b.from:b.to:{opacity:1,transform:"none"},[f,u,b.from,b.to]);return e(Ie,{sx:{willChange:f?"opacity, transform":"auto",transition:f?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...m,...l},children:t})},vV={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=Uz;exports.Activity=Pc;exports.AgentPanel=Wm;exports.AlertCircle=Ta;exports.AlertTriangle=Tc;exports.ArrowDown=Y0;exports.ArrowRight=Z0;exports.ArrowUp=Ic;exports.BarChart=Fs;exports.Bot=j0;exports.Button=Gs;exports.CAINavProvider=Fy;exports.CAlert=on;exports.CAmapChart=Hp;exports.CAppHeader=$i;exports.CAppHeaderSearch=wl;exports.CAppPageLayout=kE;exports.CAuthPage=g5;exports.CAvatar=rn;exports.CBadge=Wa;exports.CBarChart=ra;exports.CButton=we;exports.CCalendar=Un;exports.CCardDetailPanel=Jp;exports.CCardGrid=tu;exports.CCardGridCard=Bh;exports.CCardPage=eN;exports.CChartCard=xi;exports.CCheckbox=It;exports.CChip=xt;exports.CComboChart=Ep;exports.CCustomizeAgent=Vp;exports.CDatePicker=tb;exports.CDetailInfoPage=SA;exports.CDetailSearchAiBar=cu;exports.CDetailSectionCard=Bi;exports.CDialog=Lt;exports.CDivider=Dt;exports.CFileUpload=ob;exports.CFilterField=OT;exports.CFishboneChart=Op;exports.CGoogleMapChart=Bp;exports.CGraphCharts=zp;exports.CGraphKpiCards=Np;exports.CGraphReport=Pi;exports.CHeatmapChart=Lp;exports.CIconButton=ae;exports.CKanbanBoard=ZA;exports.CKanbanBucket=gu;exports.CKanbanCard=hl;exports.CLayoutManagement=Yp;exports.CLayoutManager=bn;exports.CLineChart=Ap;exports.CList=TT;exports.CListItem=IT;exports.CListItemAvatar=AT;exports.CListItemButton=MT;exports.CListItemIcon=RT;exports.CListItemText=DT;exports.CListSubheader=NT;exports.CMenu=Qt;exports.CMessageBox=jn;exports.CMetricChartCard=gs;exports.COrbCanvas=Ty;exports.CPageLayout=ui;exports.CPageTransition=hV;exports.CPaper=Ae;exports.CPieChart=Si;exports.CPivotTable=uO;exports.CPlanningGantt=Og;exports.CPlanningLayout=tV;exports.CPopover=Ws;exports.CProgress=$n;exports.CRadioGroup=If;exports.CSegmentedControl=_n;exports.CSelect=zt;exports.CSkeleton=Lf;exports.CSmartFilter=Wr;exports.CSmartTable=yD;exports.CSpinner=Xr;exports.CStack=ie;exports.CStandardPage=TD;exports.CStatusBadge=wT;exports.CSwitch=Va;exports.CTable=Jr;exports.CTableBody=gD;exports.CTableCell=fD;exports.CTableContainer=bD;exports.CTableHead=hD;exports.CTableRow=vD;exports.CTabs=jf;exports.CTextArea=Wn;exports.CTextField=ze;exports.CTooltip=ct;exports.CTreeComp=uV;exports.CTypography=L;exports.CValueHelp=Sp;exports.CVariantManagement=Ri;exports.CVariantManager=Gp;exports.CVoiceWaveOverlay=El;exports.CWaterfallChart=Fp;exports.Calendar=Bs;exports.CalendarDays=Q0;exports.Camera=J0;exports.ChartNoAxesCombined=eS;exports.Check=qr;exports.CheckCircle=Ia;exports.ChevronDown=Fr;exports.ChevronLeft=Ma;exports.ChevronRight=Br;exports.ChevronUp=tS;exports.ChevronsDown=rS;exports.ChevronsUp=oS;exports.CircleAlert=Ra;exports.CircleCheck=Bn;exports.CircleCheckBig=nS;exports.CircleStop=Mc;exports.Clipboard=Rc;exports.ClipboardCheck=aS;exports.ClipboardList=iS;exports.Clock=Dc;exports.CodeBlock=la;exports.Columns3=sS;exports.CopilotChat=$z;exports.Copy=vo;exports.CopyPlus=lS;exports.Delete=cS;exports.Download=dS;exports.Edit=Nc;exports.Expand=Ac;exports.Eye=pS;exports.EyeOff=uS;exports.File=Da;exports.FileText=Ec;exports.Filter=mS;exports.FloatingAgentPanel=Lz;exports.FolderTree=Hn;exports.GitBranch=Lc;exports.GlobalMessage=vT;exports.Globe=zn;exports.Grid=Oc;exports.GripVertical=gS;exports.Hammer=fS;exports.Image=Fc;exports.Info=Na;exports.InputArea=$l;exports.Languages=bS;exports.Layers=hS;exports.LayoutDashboard=vS;exports.Lightbulb=Aa;exports.LineChart=Bc;exports.Loader2=Hc;exports.Lock=Ea;exports.LockKeyhole=yS;exports.LogOut=zc;exports.METRIC_CHART_TYPES=ms;exports.Mail=Hs;exports.MapPin=Vc;exports.MarkdownRenderer=pa;exports.MathBlock=ca;exports.Menu=Wc;exports.MermaidBlock=cl;exports.MessageCircle=df;exports.MessageSquare=$c;exports.Mic=La;exports.MicOff=CS;exports.Moon=_c;exports.MoreHorizontal=xS;exports.NavigationIsland=cd;exports.NavigationIsland2=qs;exports.OMPHApprovalCard=Vx;exports.OMPHPanel=wz;exports.ORBCAFE_I18N_MESSAGES=qn;exports.ORB_DARK=Gg;exports.ORB_FONT_STACK=k0;exports.ORB_LIGHT=_g;exports.ORB_RADIUS=T0;exports.ORB_TOKENS=Es;exports.ORB_TRANSITION_FAST=I0;exports.OrbcafeI18nProvider=Ga;exports.OrbisModeProvider=Fn;exports.PAGE_TRANSITION_PRESETS=vV;exports.PAppPageLayout=zF;exports.PBarcodeScanner=DO;exports.PNavIsland=cm;exports.PNumericKeypad=UO;exports.PSmartFilter=nm;exports.PTable=yy;exports.PTouchCard=BO;exports.PWorkloadNav=am;exports.PackageCheck=SS;exports.PackageSearch=wS;exports.PanelLeftOpen=Oa;exports.PanelRight=Fa;exports.PanelsTopLeft=kS;exports.PieChart=Gc;exports.Pin=Jo;exports.PivotChartPanel=Yu;exports.Play=PS;exports.Plus=en;exports.QrCode=TS;exports.ReceiptText=IS;exports.RefreshCw=Ba;exports.Rocket=MS;exports.RotateCcw=RS;exports.RotateCw=Uc;exports.Rows3=DS;exports.SapIcon=Tt;exports.Save=NS;exports.ScanLine=AS;exports.Search=Hr;exports.Send=pf;exports.SendHorizontal=Kc;exports.Settings=tn;exports.ShieldCheck=ES;exports.Sigma=LS;exports.SortAsc=OS;exports.SquareSplitHorizontal=FS;exports.Star=BS;exports.StdChat=zm;exports.Sun=qc;exports.Table2=HS;exports.TableBlock=pl;exports.TabletSmartphone=zS;exports.Terminal=Vn;exports.ThinkBlock=Oi;exports.ThumbsDown=Xc;exports.ThumbsUp=Yc;exports.Trash2=Zc;exports.TreeMenu=Xn;exports.TreePine=VS;exports.TrendingDown=jc;exports.TriangleAlert=Ha;exports.Truck=WS;exports.UploadCloud=Qc;exports.User=zs;exports.VoiceNavigatorProvider=JF;exports.VoiceWaveOverlay=qF;exports.Volume2=Jc;exports.Warehouse=$S;exports.Workflow=_S;exports.X=jt;exports.XCircle=za;exports.addKanbanBucket=fu;exports.buildAmapEmbedUrl=wi;exports.buildGoogleMapEmbedUrl=oa;exports.buildGoogleMapIframe=dR;exports.buttonVariants=lb;exports.createKanbanBoardModel=hu;exports.createSapIcon=ne;exports.findKanbanCard=_r;exports.message=dT;exports.messageManager=ao;exports.moveKanbanCard=Vi;exports.orbAlpha=rt;exports.orbChartSeries=P0;exports.parseMarkdownTable=Li;exports.parseOmphFileHref=Ul;exports.renameKanbanBucket=bu;exports.renderMarkdown=XN;exports.resolveVariantFilters=Ai;exports.resolveVariantLayout=Ei;exports.useAINav=By;exports.useAmapEmbedUrl=gN;exports.useAuthPage=a5;exports.useCardPage=aN;exports.useDetailInfo=pu;exports.useGoogleMapEmbedUrl=mN;exports.useGraphChartData=lN;exports.useGraphInteraction=Ii;exports.useGraphReport=mn;exports.useKanbanBoard=tE;exports.useMediaQuery=Dr;exports.useNavigationIsland=fd;exports.useOrbMode=Cr;exports.useOrbTokens=Os;exports.useOrbcafeI18n=pe;exports.usePadLayout=xO;exports.usePadRecordEditor=kO;exports.usePageLayout=ku;exports.usePivotTable=hO;exports.usePlanningGantt=Rg;exports.usePlanningLayout=S5;exports.useStandardReport=AD;exports.useVoiceInput=Sn;exports.useVoiceNavigator=e2;
234
+ `,h5=({active:t=false,colors:o=g0,zIndex:r=2147483e3})=>{let n={"--orbcafe-ai-glow-line":o[0],"--orbcafe-ai-glow-z-index":r};return c(jsxRuntime.Fragment,{children:[e("style",{children:f0}),e("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var N5=({defaultMode:t="login",onLogin:o,onRegister:r,onForgotPassword:n}={})=>{let[a,i]=eo.useState(t),[s,l]=eo.useState(false),d=eo.useCallback(async u=>{l(true);try{await u?.();}finally{l(false);}},[]),p=eo.useCallback(u=>d(()=>o?.(u)),[o,d]),m=eo.useCallback(u=>d(()=>r?.(u)),[r,d]),f=eo.useCallback(u=>d(()=>n?.(u)),[n,d]),h=eo.useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:p,onRegister:m,onForgotPassword:f}),[f,p,m,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:h}};P();var v0={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,[f,h]=eo.useState(o),u=t??f,v=eo.useMemo(()=>({...v0,...d}),[d]),[y,g]=eo.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,b]=eo.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[C,k]=eo.useState({email:""}),[S,T]=eo.useState(""),I=E=>{m||h(E),T(""),r?.(E);},w=async E=>{E.preventDefault(),await n?.(y),T("Demo login accepted. No real authentication request was sent.");},M=async E=>{E.preventDefault(),await a?.(x),T("Demo registration saved locally for this screen.");},A=async E=>{E.preventDefault(),await i?.(C),T("Demo reset link request created. No email was sent.");},R=u==="login"?v.loginTitle:u==="register"?v.registerTitle:v.forgotTitle,D=u==="login"?v.loginSubtitle:u==="register"?v.registerSubtitle:v.forgotSubtitle;return c("div",{className:"orb-auth-frame orb-root",style:p,children:[c("div",{className:"orb-auth-brand",children:[e("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),e("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)"}}),e("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?e("span",{style:{alignSelf:"flex-start",position:"relative"},children:l}):e("span",{className:"orb-logo-slot",children:"Host logo"}),c("div",{className:"orb-auth-claim",children:[e("div",{className:"orb-auth-rule"}),e("h2",{children:v.headline}),e("p",{children:v.subheadline})]}),e("div",{className:"orb-auth-meta",children:v.brandMeta})]}),e("div",{className:"orb-auth-form",children:c("div",{className:"orb-auth-card",children:[e("span",{className:"orb-overline",style:{letterSpacing:"0.12em"},children:v.productName}),e("h1",{className:"orb-h2",style:{margin:0},children:R}),e("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:D}),S&&e(rn,{severity:"success",children:S}),u==="login"&&c("form",{onSubmit:w,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Email",type:"email",autoComplete:"username",value:y.username,onChange:E=>g(O=>({...O,username:E.target.value})),startAdornment:e(Ks,{size:15,strokeWidth:1.8})}),e(ze,{label:"Password",type:"password",autoComplete:"current-password",value:y.password,onChange:E=>g(O=>({...O,password:E.target.value})),startAdornment:e(Ha,{size:15,strokeWidth:1.8})}),c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[e(It,{label:"Remember me",checked:y.remember,onChange:E=>g(O=>({...O,remember:E.target.checked}))}),e("button",{type:"button",className:"orb-link",onClick:()=>I("forgot"),children:"Forgot password?"})]}),e(ke,{type:"submit",size:"large",block:true,loading:s,children:s?"Signing in\u2026":"Sign in"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["New user?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>I("register"),children:"Register"})]})]}),u==="register"&&c("form",{onSubmit:M,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Full name",value:x.name,onChange:E=>b(O=>({...O,name:E.target.value})),startAdornment:e(Ks,{size:15,strokeWidth:1.8})}),e(ze,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:E=>b(O=>({...O,email:E.target.value})),startAdornment:e(Us,{size:15,strokeWidth:1.8})}),e(ze,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:E=>b(O=>({...O,password:E.target.value})),startAdornment:e(Ha,{size:15,strokeWidth:1.8})}),e(ze,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:E=>b(O=>({...O,confirmPassword:E.target.value}))}),e(It,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:E=>b(O=>({...O,acceptedTerms:E.target.checked}))}),e(ke,{type:"submit",size:"large",block:true,loading:s,children:"Create demo account"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Already have an account?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Sign in"})]})]}),u==="forgot"&&c("form",{onSubmit:A,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Work email",type:"email",autoComplete:"username",value:C.email,onChange:E=>k({email:E.target.value}),startAdornment:e(Us,{size:15,strokeWidth:1.8})}),e(ke,{type:"submit",size:"large",block:true,loading:s,children:"Send reset request"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Remember your password?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Back to sign in"})]})]}),c("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:[e("span",{style:{flex:1,height:1,background:"var(--orb-border)"}}),"or",e("span",{style:{flex:1,height:1,background:"var(--orb-border)"}})]}),e(ke,{variant:"neutral",size:"large",block:true,children:"Continue with corporate SSO"}),c("p",{className:"orb-meta",style:{textAlign:"center",fontWeight:300,margin:0},children:["Protected by corporate single sign-on.",e("br",{}),"Demo credentials: demo@orbcafe.local / orbcafe-demo"]})]})})]})};var C0={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},x0=[{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"}],Vg=({tasks:t,appId:o,tableKey:r,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:l,filterTableKey:d,serviceUrl:p,variantService:m,layout:f,columns:h,page:u,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:b,onFilterSearch:C,onFilterVariantLoad:k,enableRowReorder:S,onTaskReorder:T,onLayoutIdChange:I,onLayoutSave:w})=>{let M=o??l??"planning-gantt",A=r??d??"planning",[R,D]=eo.useState(n),[E,O]=eo.useState(a??t[0]?.id??""),[_,J]=eo.useState(""),[F,V]=eo.useState(null),[z,X]=eo.useState({...C0,...i}),W=eo.useMemo(()=>{let ge=String(z.keyword?.value??"").trim().toLowerCase(),we=String(z.status?.value??"").trim(),Ve=String(z.owner?.value??"").trim().toLowerCase(),Te=String(z.workCenter?.value??"").trim().toLowerCase(),Ie=z.dateRange?.value,He=Ie?.[0]?ar__default.default(Ie[0]):null,ce=Ie?.[1]?ar__default.default(Ie[1]):null;return t.filter(be=>{if(ge&&![be.id,be.code,be.title,be.project,be.workCenter,be.owner?.name].join(" ").toLowerCase().includes(ge)||we&&be.status!==we||Ve&&!String(be.owner?.name??"").toLowerCase().includes(Ve)||Te&&!String(be.workCenter??"").toLowerCase().includes(Te))return false;if(He||ce){let We=ar__default.default(be.startDate),tt=ar__default.default(be.endDate),nt=He?tt.isAfter(He)||tt.isSame(He,"day"):true,it=ce?We.isBefore(ce)||We.isSame(ce,"day"):true;if(!nt||!it)return false}return true})},[z,t]);eo.useEffect(()=>{W.length!==0&&(W.some(ge=>ge.id===E)||O(W[0].id));},[W,E]);let H=eo.useCallback(ge=>{O(ge.id);},[]),U=eo.useCallback(ge=>{J(ge),I?.(ge);},[I]),Y=eo.useCallback(ge=>{V(we=>({key:(we?.key??0)+1,variant:ge})),k?.(ge);},[k]),ue=eo.useMemo(()=>({appId:M,tableKey:A,fields:s??x0,filters:z,onFilterChange:X,onVariantLoad:Y,onSearch:C??(()=>{}),currentLayoutId:_,layoutRefs:[{tableKey:A,layoutId:_||null}],variantService:m,serviceUrl:p}),[_,s,z,Y,C,M,A,p,m]),re=eo.useMemo(()=>({appId:M,tableKey:A,serviceUrl:p,tasks:W,columns:h,scale:R,onScaleChange:D,page:u,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:b,selectedTaskId:E,onTaskSelect:H,enableRowReorder:S,onTaskReorder:T,layout:f,layoutVariant:F?.variant,layoutVariantLoadKey:F?.key,onLayoutIdChange:U,onLayoutSave:w}),[h,g,S,W,U,f,F?.key,F?.variant,x,b,w,T,H,u,M,A,v,y,R,p,E]);return {scale:R,setScale:D,selectedTaskId:E,setSelectedTaskId:O,filters:z,setFilters:X,filteredTasks:W,smartFilterProps:ue,planningGanttProps:re}};var X5=t=>{let o=Vg(t),r=eo.useMemo(()=>({filterProps:o.smartFilterProps,ganttProps:o.planningGanttProps}),[o.planningGanttProps,o.smartFilterProps]);return {...o,layoutProps:r}};P();ar__default.default.extend(S0__default.default);var hc=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],bc=36,vc=58,Ia=8,yc=260,D0=320,Ur="220ms cubic-bezier(0.2, 0, 0, 1)",Wg={"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"}},N0=t=>t?Wg[t]?.label??t:"Planned",A0=t=>t?Wg[t]?.color??"default":"info",$g=t=>Math.min(100,Math.max(0,t??0)),_g=(t,o=0)=>t.flatMap(r=>[{...r,level:o},..._g(r.children??[],o+1)]),E0=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:N0(t.status),statusTone:t.status??"planned",progress:$g(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Gg=(t,o)=>o==="month"?t.startOf("month"):o==="week"?t.startOf("week"):o==="day"?t.startOf("day"):t.startOf("hour"),Ug=(t,o)=>o==="month"?t.endOf("month"):o==="week"?t.endOf("week"):o==="day"?t.endOf("day"):t.endOf("hour"),L0=(t,o,r)=>{let n=[],a=Gg(t,r),i=Ug(o,r);for(;a.isBefore(i)||a.isSame(i);){let s=r==="month"?a.add(1,"month"):r==="week"?a.add(1,"week"):r==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${r}-${a.valueOf()}`,label:r==="month"?a.format("MMM YYYY"):r==="week"?a.format("MMM D"):r==="day"?a.format("D"):a.format("HH:mm"),contextLabel:r==="hour"?a.format("MMM D"):r==="day"?a.format("MMM"):r==="week"?`W${a.isoWeek()}`:void 0,title:r==="hour"?a.format("MMM D, YYYY HH:mm"):r==="day"?a.format("MMM D, YYYY"):r==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},Cc=(t,o,r)=>{let n=0;for(let a of o){if(t.isBefore(a.start))return n;if(t.isBefore(a.end)){let i=Math.max(1,a.end.valueOf()-a.start.valueOf()),s=Math.max(0,t.valueOf()-a.start.valueOf());return n+s/i*r}n+=r;}return n},Kg=({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:f=20,rowsPerPageOptions:h=[20,50,100,-1],count:u,onPageChange:v,onRowsPerPageChange:y,timelineStart:g,timelineEnd:x,selectedTaskId:b,onTaskSelect:C,enableRowReorder:k=true,onTaskReorder:S,layout:T,layoutVariant:I,layoutVariantLoadKey:w,onLayoutIdChange:M,onLayoutSave:A,emptyLabel:R="No planning tasks available.",sx:D})=>{let E=so(),{t:O}=le(),_=eo.useRef(null),J=eo.useRef(null),F=eo.useRef(null),V=eo.useRef(false),[z,X]=eo.useState(null),[W,H]=eo.useState("content"),[U,Y]=eo.useState(null),[ue,re]=eo.useState(0),[ge,we]=eo.useState({}),[Ve,Te]=eo.useState(bc),[Ie,He]=eo.useState([]),ce=eo.useRef(void 0),[be,We]=eo.useState({activeId:null,overId:null}),[tt,nt]=eo.useState(null),[it,q]=eo.useState(false),De=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),Ce=eo.useRef(null),Fe=eo.useMemo(()=>_g(s),[s]),at=eo.useMemo(()=>{if(Ie.length===0)return Fe;let B=new Map(Fe.map(Pe=>[Pe.id,Pe])),Q=Ie.map(Pe=>B.get(Pe)).filter(Pe=>!!Pe),fe=new Set(Q.map(Pe=>Pe.id));return [...Q,...Fe.filter(Pe=>!fe.has(Pe.id))]},[Fe,Ie]),Ze=eo.useMemo(()=>new Map(at.map(B=>[B.id,B])),[at]),wt=eo.useMemo(()=>at.map(B=>E0(B)),[at]),Rt=eo.useMemo(()=>new Map(wt.map(B=>[B.id,B])),[wt]),Ot=eo.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(B,Q)=>c(se,{spacing:.2,children:[e(L,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:Q.title}),e(L,{sx:{fontSize:13,color:"text.secondary"},children:Q.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(B,Q)=>e(xt,{label:Q.status,color:A0(Q.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:B=>c(se,{spacing:.6,children:[c(L,{variant:"caption",sx:{color:"text.secondary"},children:[B,"%"]}),e(_n,{variant:"determinate",value:B,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),At=eo.useMemo(()=>{if(!l||l.length===0)return Ot;let B=new Map(Ot.map(Q=>[Q.id,Q]));return l.map(Q=>{let fe=B.get(Q.id),Pe=Q.width??fe?.minWidth??120,et={id:Q.id,label:Q.label,minWidth:Pe};if(fe?.numeric&&(et.numeric=true),Q.render){let Xe=Q.render;return et.render=(kt,ht)=>{let gt=Ze.get(ht.id);return Xe(gt||ht)},et}return fe?.render?(et.render=fe.render,et):(et.render=(Xe,kt)=>{let ht=kt[Q.id];if(ht!=null&&String(ht).length>0)return String(ht);let Ct=Ze.get(kt.id)?.[Q.id];return Ct!=null&&String(Ct).length>0?String(Ct):"-"},et)})},[l,Ot,Ze]),oe=bn({appId:t,tableKey:o,title:n,columns:At,rows:wt,rowKey:"id",page:m,rowsPerPage:f,rowsPerPageOptions:h,count:u??wt.length,onPageChange:v,onRowsPerPageChange:y,showSummary:false,layout:T,onLayoutSave:A}),Ke=t?e(hn,{appId:t,tableKey:o,currentLayoutData:oe.currentLayoutData,onLayoutLoad:oe.handleLayoutLoad,targetLayoutId:oe.layoutIdToLoad,activeLayoutId:oe.currentLayoutId,serviceUrl:r}):null,Oe=oe.visibleRows;eo.useEffect(()=>{let B=Fe.map(Q=>Q.id);He(Q=>{let fe=new Set(B),Pe=Q.filter(ht=>fe.has(ht)),et=new Set(Pe),Xe=B.filter(ht=>!et.has(ht)),kt=[...Pe,...Xe];return kt.length===Q.length&&kt.every((ht,gt)=>ht===Q[gt])?Q:kt});},[Fe]),eo.useEffect(()=>{w===void 0||!I||ce.current!==w&&(ce.current=w,oe.handleVariantLoad(I));},[oe,I,w]),eo.useEffect(()=>{M?.(oe.currentLayoutId);},[oe.currentLayoutId,M]);let de=B=>B.type==="group"?`group-${B.id}`:`row-${(B.data||B)?.id}`,ye=eo.useMemo(()=>{let B=wt.map(gt=>ar__default.default(gt.startDate)),Q=wt.map(gt=>ar__default.default(gt.endDate)),fe=g?ar__default.default(g):B.reduce((gt,Ct)=>Ct.isBefore(gt)?Ct:gt,B[0]??ar__default.default()),Pe=x?ar__default.default(x):Q.reduce((gt,Ct)=>Ct.isAfter(gt)?Ct:gt,Q[0]??ar__default.default().add(30,"day")),et=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",Xe=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",kt=d==="hour"?12:1,ht=d==="hour"?12:1;return {start:Gg(fe.subtract(kt,et),d),end:Ug(Pe.add(ht,Xe),d)}},[wt,d,x,g]),te=hc.find(B=>B.value===d)??hc[1],ve=Array.isArray(a)?a:a?[a]:[],Ne=eo.useMemo(()=>L0(ye.start,ye.end,d),[ye.end,ye.start,d]),Je=Ne.length*te.width,st=Ne.length>0?100/Ne.length:100,pt=Ne.length>0?`repeat(${Ne.length}, minmax(${te.width}px, 1fr))`:"1fr",Bt=Ne.length>0?`calc(100% / ${Ne.length}) 100%`:"100% 100%",Yt=(oe.columns||[]).filter(B=>oe.visibleColumns.includes(B.id)).reduce((B,Q)=>B+(oe.columnWidths?.[Q.id]||Q.minWidth||100),0)+(oe.grouping.length>0?72:0),Vt=W==="manual"&&z!==null?z:Yt,St=U==="table",Wt=U==="timeline",bt=U==="timeline",Nt=U==="table",lt=!bt&&!Nt,Ft=()=>{let B=ue||_.current?.clientWidth||0;return B>0?Math.max(yc,B-Ia-D0):Math.max(yc,Yt)},Zt=B=>Math.min(Math.max(B,yc),Ft()),$=(()=>{if(ue<=0)return null;let B=lt?Ia:0;if(St)return {tableWidth:ue,splitterWidth:B,timelineWidth:0};if(Wt)return {tableWidth:0,splitterWidth:B,timelineWidth:ue};if(W==="even"){let fe=Math.max(0,(ue-B)/2);return {tableWidth:fe,splitterWidth:B,timelineWidth:Math.max(0,ue-B-fe)}}let Q=Zt(Vt);return {tableWidth:Q,splitterWidth:B,timelineWidth:Math.max(0,ue-B-Q)}})(),j=$?`${$.tableWidth}px ${$.splitterWidth}px ${$.timelineWidth}px`:St?"minmax(0, 1fr) 0px 0px":Wt?"0px 0px minmax(0, 1fr)":W==="even"?`minmax(0, 1fr) ${Ia}px minmax(0, 1fr)`:`${Vt}px ${Ia}px minmax(0, 1fr)`;eo.useEffect(()=>{W==="manual"&&X(B=>B===null?null:Zt(B));},[W,Yt,ue]);let he=B=>{B.preventDefault(),B.currentTarget.setPointerCapture(B.pointerId),Y(null),H("manual"),Ce.current={startX:B.clientX,startWidth:J.current?.getBoundingClientRect().width??Vt};let Q=Pe=>{let et=Ce.current;if(!et)return;let Xe=Zt(et.startWidth+Pe.clientX-et.startX);X(Xe);},fe=()=>{Ce.current=null,window.removeEventListener("pointermove",Q),window.removeEventListener("pointerup",fe),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",Q),window.addEventListener("pointerup",fe);},xe=()=>{Y(null),H("even"),X(null);},Ee=B=>!k||!B?false:Rt.get(B)?.reorderable!==false,_e=(B,Q)=>{if(!B||!Q||B===Q||!Ee(B)||!Ee(Q))return false;if(oe.grouping.length===0)return true;let fe=Rt.get(B),Pe=Rt.get(Q);return !fe||!Pe?false:oe.grouping.every(et=>fe[et]===Pe[et])},qe=(B,Q)=>{if(!_e(B,Q))return;let fe=Oe.filter(Et=>Et.type!=="group").map(Et=>String((Et.data||Et)?.id)),Pe=fe.indexOf(B),et=fe.indexOf(Q);if(Pe<0||et<0)return;let Xe=[...fe];[Xe[Pe],Xe[et]]=[Xe[et],Xe[Pe]];let kt=new Set(fe),ht=at.map(Et=>Et.id),gt=[...Xe,...ht.filter(Et=>!kt.has(Et))],Ct=Ze.get(B),no=Ze.get(Q);if(oe.setOrder("asc"),oe.setOrderBy(""),He(gt),Ct&&no){let{level:Et,...jt}=Ct,{level:Ht,...Kt}=no,$t=gt.reduce((oo,ao)=>{let bo=Ze.get(ao);if(bo){let{level:Ro,...Mo}=bo;oo.push(Mo);}return oo},[]);S?.($t,{activeTask:jt,targetTask:Kt});}},je=(B,Q)=>{if(!Ee(Q.id)){B.preventDefault();return}B.stopPropagation(),B.dataTransfer.effectAllowed="move",B.dataTransfer.setData("text/plain",Q.id),We({activeId:Q.id,overId:null}),C?.(Ze.get(Q.id)||Q);},mt=(B,Q)=>{if(!_e(be.activeId,Q)){We(fe=>fe.overId===null?fe:{...fe,overId:null});return}B.preventDefault(),B.stopPropagation(),B.dataTransfer.dropEffect="move",We(fe=>fe.overId===Q?fe:{...fe,overId:Q});},ft=(B,Q)=>{let fe=be.activeId||B.dataTransfer.getData("text/plain");if(!_e(fe,Q)){We({activeId:null,overId:null});return}B.preventDefault(),B.stopPropagation(),qe(fe,Q),We({activeId:null,overId:null});},Mt=()=>{We({activeId:null,overId:null});},yt=B=>{if(V.current)return;let Q=B==="table"?J.current:F.current,fe=B==="table"?F.current:J.current;!Q||!fe||(V.current=true,fe.scrollTop=Q.scrollTop,window.requestAnimationFrame(()=>{V.current=false;}));};return eo.useLayoutEffect(()=>{let B=_.current;if(!B){re(0);return}let Q=0,fe=()=>{window.cancelAnimationFrame(Q),Q=window.requestAnimationFrame(()=>{let et=B.clientWidth;re(Xe=>Math.abs(Xe-et)<.5?Xe:et);});};if(fe(),typeof ResizeObserver>"u")return window.addEventListener("resize",fe),()=>{window.cancelAnimationFrame(Q),window.removeEventListener("resize",fe);};let Pe=new ResizeObserver(fe);return Pe.observe(B),window.addEventListener("resize",fe),()=>{window.cancelAnimationFrame(Q),Pe.disconnect(),window.removeEventListener("resize",fe);}},[wt.length]),eo.useLayoutEffect(()=>{if(!b||Nt)return;let B=F.current,Q=J.current;if(!B)return;let fe=`row-${b}`,Pe=Array.from(B.querySelectorAll("[data-planning-timeline-row-key]")).find(kt=>kt.dataset.planningTimelineRowKey===fe),et=Rt.get(b);if(!Pe||!et)return;let Xe=window.requestAnimationFrame(()=>{let kt=B.getBoundingClientRect(),ht=Pe.getBoundingClientRect(),gt=Math.max(1,B.clientHeight-Ve),Ct=B.scrollTop+ht.top-kt.top-Ve-(gt-ht.height)/2;V.current=true,B.scrollTop=Math.max(0,Ct),Q&&!bt&&(Q.scrollTop=B.scrollTop);let no=Math.max(1,B.scrollWidth),Et=Ne.length>0?no/Ne.length:te.width,jt=Cc(ar__default.default(et.startDate),Ne,Et),Ht=Math.max(0,jt-Et);B.scrollLeft=Math.min(Ht,Math.max(0,no-B.clientWidth)),window.requestAnimationFrame(()=>{V.current=false;});});return ()=>window.cancelAnimationFrame(Xe)},[te.width,Ve,b,bt,Rt,Nt,Oe,Ne]),eo.useLayoutEffect(()=>{let B=J.current;if(!B)return;let Q=0,fe=0,Pe=false,et=()=>{if(Pe)return;let Ht=B.querySelector("thead"),Kt=Array.from(B.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Kt.length===0)return;let $t=Ht?.getBoundingClientRect().height||bc,oo={};Kt.forEach(ao=>{let bo=ao.dataset.ctableRowKey;bo&&(oo[bo]=ao.getBoundingClientRect().height);}),Te(ao=>Math.abs(ao-$t)<.01?ao:$t),we(ao=>{let bo=Object.keys(ao),Ro=Object.keys(oo);return bo.length===Ro.length&&Ro.every(Mo=>Math.abs((ao[Mo]??0)-oo[Mo])<.01)?ao:oo});},Xe=()=>{window.cancelAnimationFrame(Q),Q=window.requestAnimationFrame(et);};if(et(),window.cancelAnimationFrame(fe),fe=window.requestAnimationFrame(()=>{fe=window.requestAnimationFrame(et);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{Pe||Xe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",Xe),()=>{Pe=true,window.cancelAnimationFrame(Q),window.cancelAnimationFrame(fe),window.removeEventListener("resize",Xe);};let kt=new ResizeObserver(Xe),ht=B.querySelector("table"),gt=B.querySelector("tbody"),Ct=B.querySelector("thead");ht&&kt.observe(ht),Ct&&kt.observe(Ct);let no=new WeakSet,Et=()=>{B.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Ht=>{no.has(Ht)||(kt.observe(Ht),no.add(Ht));});};Et();let jt=null;return gt&&typeof MutationObserver<"u"&&(jt=new MutationObserver(()=>{Et(),Xe();}),jt.observe(gt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",Xe),()=>{Pe=true,window.cancelAnimationFrame(Q),window.cancelAnimationFrame(fe),kt.disconnect(),jt?.disconnect(),window.removeEventListener("resize",Xe);}},[Oe,oe.visibleColumns,oe.grouping,oe.columnWidths]),c(Ae,{className:"orb-ctable-surface orb-planning-gantt",elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:"var(--orb-r-container)",border:`1px solid ${E.palette.divider}`,...D},children:[e("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":O("table.title.default"),children:c("div",{className:"orb-table-toolbar-primary",children:[e(yi,{value:oe.filterText,onChange:B=>{oe.setFilterText(B),oe.setPage(0);}}),e(vi,{rowsPerPage:oe.rowsPerPage,rowsPerPageOptions:h,page:oe.page,count:oe.totalDisplayCount,onRowsPerPageChange:oe.setRowsPerPage,onPageChange:oe.setPage}),ve.length>0&&e("div",{className:"orb-table-toolbar-custom",children:ve.map((B,Q)=>e("div",{className:"orb-planning-extra-tool",children:B},`planning-extra-tool-${Q}`))}),e("span",{className:"orb-table-toolbar-spacer"}),c("div",{className:"orb-table-toolbar-actions",children:[c("div",{className:"orb-table-tool-group",children:[e(ie,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:B=>oe.setAnchorEl(B.currentTarget),sx:uo,children:e(ln,{fontSize:"small"})}),e(ie,{className:"orb-table-tool-button",tooltip:"Group by",onClick:B=>oe.setGroupAnchorEl(B.currentTarget),sx:uo,children:e(wr,{fontSize:"small"})}),e(ie,{className:`orb-table-tool-button ${oe.sortBy.length>0||oe.orderBy?"orb-is-active":""}`,tooltip:"Sort by...",active:oe.sortBy.length>0||!!oe.orderBy,onClick:()=>q(true),sx:uo,children:e(xp,{fontSize:"small"})})]}),Ke&&e("div",{className:"orb-table-tool-group",children:Ke}),e("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:e(Gn,{"aria-label":"Planning pane layout",size:"small",value:U??(W==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:e(ui,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:e(gi,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:e(pi,{fontSize:"small"})}],onValueChange:B=>{B==="split"?xe():Y(B);}})}),e("div",{className:"orb-table-tool-group orb-planning-scale-control",children:e(zt,{label:"",value:d,options:hc.map(B=>({value:B.value,label:B.label})),onChange:B=>p?.(B.target.value)})})]})]})}),wt.length===0?e("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:R}):e("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:c("div",{ref:_,sx:{height:"100%",display:"grid",gridTemplateColumns:j,minWidth:0,transition:`grid-template-columns ${Ur}`},children:[e("div",{"data-planning-scroll-pane":"table",ref:J,onScroll:()=>yt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:bt?0:1,transform:bt?"translateX(-10px)":"translateX(0)",pointerEvents:bt?"none":"auto",transition:`opacity ${Ur}, transform ${Ur}`},children:e(core.DndContext,{sensors:De,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:B=>{let Q=B?.active?.id,fe=B?.over?.id;typeof Q=="string"&&typeof fe=="string"&&oe.handleColumnReorder(Q,fe);},children:c("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:Yt,"& thead th":{height:bc,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[e(wi,{columns:oe.columns,visibleColumns:oe.visibleColumns,order:oe.order,orderBy:oe.orderBy,sortBy:oe.sortBy,onRequestSort:oe.handleRequestSort,onContextMenu:(B,Q)=>{B.preventDefault(),B.stopPropagation(),nt({mouseX:B.clientX+2,mouseY:B.clientY-6,columnId:Q});},grouping:oe.grouping,isAllExpanded:oe.isAllExpanded,handleToggleAll:oe.handleToggleAll,columnWidths:oe.columnWidths,onColumnResize:oe.handleColumnResize,enableColumnReorder:true}),e(Si,{visibleRows:Oe,columns:oe.columns,visibleColumns:oe.visibleColumns,selected:b?[b]:[],expandedGroups:oe.expandedGroups,toggleGroupExpand:oe.toggleGroupExpand,handleExpandGroupRecursively:oe.handleExpandGroupRecursively,handleCollapseGroupRecursively:oe.handleCollapseGroupRecursively,isGroupFullyExpanded:oe.isGroupFullyExpanded,grouping:oe.grouping,rowKeyProp:"id",page:oe.page,rowsPerPage:oe.rowsPerPage,emptyLabel:R,handleClick:(B,Q)=>{C?.(Ze.get(Q.id)||Q);},getRowDataKey:({entry:B})=>de(B),getGroupRowProps:()=>({style:{height:vc}}),getRowProps:({data:B})=>{let Q=B,fe=Ee(Q.id),Pe=be.activeId===Q.id,et=be.overId===Q.id&&_e(be.activeId,Q.id);return {draggable:fe,className:et?"orb-is-drop-target":void 0,style:{cursor:Pe?"grabbing":fe?"grab":C?"pointer":"default",height:vc,opacity:Pe?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:Xe=>je(Xe,Q),onDragOver:Xe=>mt(Xe,Q.id),onDragEnter:Xe=>mt(Xe,Q.id),onDrop:Xe=>ft(Xe,Q.id),onDragEnd:Mt}}})]})})}),e("div",{onPointerDown:lt?he:void 0,role:"separator","aria-orientation":"vertical",sx:{width:lt?Ia:0,cursor:lt?"col-resize":"default",opacity:lt?1:0,pointerEvents:lt?"auto":"none",borderLeft:lt?`1px solid ${E.palette.divider}`:"0 solid transparent",borderRight:lt?`1px solid ${E.palette.divider}`:"0 solid transparent",backgroundColor:vt()==="dark"?"color-mix(in oklch, var(--orb-muted) 10%, transparent)":"color-mix(in oklch, var(--orb-fg) 4%, transparent)",transition:`width ${Ur}, opacity ${Ur}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:E.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:lt?"col-resize":"default"}}}),e("div",{sx:{minWidth:0,overflow:"hidden",opacity:Nt?0:1,transform:Nt?"translateX(10px)":"translateX(0)",pointerEvents:Nt?"none":"auto",transition:`opacity ${Ur}, transform ${Ur}`},children:e("div",{"data-planning-scroll-pane":"timeline",ref:F,onScroll:()=>yt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:c("div",{sx:{width:"100%",minWidth:Je||"100%"},children:[e("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:pt,height:Ve,boxSizing:"border-box",borderBottom:`1px solid ${E.palette.divider}`,position:"sticky",top:0,zIndex:2},children:Ne.map(B=>c("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 ${E.palette.divider}`,color:B.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[B.contextLabel&&e(L,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:B.contextLabel}),e(L,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:B.label})]},B.key))}),e(se,{sx:{position:"relative"},children:Oe.map(B=>{let Q=de(B),fe=ge[Q]??vc;if(B.type==="group")return e("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":Q,sx:{position:"relative",height:fe,boxSizing:"border-box",borderBottom:`1px solid ${E.palette.divider}`}},B.id);let Pe=B.data||B,et=ar__default.default(Pe.startDate),Xe=ar__default.default(Pe.endDate),kt=Cc(et,Ne,st),ht=Cc(Xe,Ne,st),gt=Math.max(0,ht-kt),Ct=$g(Pe.progress),no=Pe.id===b,Et=Ee(Pe.id),jt=be.activeId===Pe.id,Ht=be.overId===Pe.id&&_e(be.activeId,Pe.id),Kt=Pe.color??(Pe.statusTone==="blocked"?E.palette.error.main:E.palette.primary.main);return e("div",{className:`orb-planning-timeline-row ${no?"orb-is-selected":""}`,"data-planning-timeline-row-key":Q,draggable:Et,onDragStart:$t=>je($t,Pe),onDragOver:$t=>mt($t,Pe.id),onDragEnter:$t=>mt($t,Pe.id),onDrop:$t=>ft($t,Pe.id),onDragEnd:Mt,onClick:()=>C?.(Ze.get(Pe.id)||Pe),sx:{position:"relative",height:fe,boxSizing:"border-box",borderBottom:`1px solid ${E.palette.divider}`,opacity:jt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:E.palette.primary.main,opacity:Ht?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:vt()==="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:jt?"grabbing":Et?"grab":C?"pointer":"default",transition:"opacity 120ms ease"},children:e(ct,{title:`${Pe.title}: ${et.format("MMM D HH:mm")} - ${Xe.format("MMM D HH:mm")}`,children:c("div",{sx:{position:"absolute",left:`${kt}%`,top:Math.max(8,(fe-24)/2),width:`max(18px, ${gt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:vt()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:no?`2px solid ${E.palette.warning.main}`:"none",outlineOffset:2},children:[e("div",{sx:{height:"100%",width:`${Ct}%`,backgroundColor:Kt}}),e(L,{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)})})]})})})]})}),e(pn,{groupAnchorEl:oe.groupAnchorEl,setGroupAnchorEl:oe.setGroupAnchorEl,grouping:oe.grouping,setGrouping:oe.setGrouping,columns:oe.columns}),e(un,{anchorEl:oe.anchorEl,setAnchorEl:oe.setAnchorEl,columns:oe.columns,visibleColumns:oe.visibleColumns,toggleColumnVisibility:oe.toggleColumnVisibility}),e(zp,{contextMenu:tt,handleClose:()=>nt(null),columns:oe.columns,visibleColumns:oe.visibleColumns,grouping:oe.grouping,summaryColumns:oe.summaryColumns,showSummary:oe.showSummary,sortBy:oe.sortBy,orderBy:oe.orderBy,order:oe.order,onSortAsc:B=>{oe.applyMultiSort([{field:B,direction:"asc"}]);},onSortDesc:B=>{oe.applyMultiSort([{field:B,direction:"desc"}]);},onClearSort:B=>{let Q=oe.sortBy.filter(fe=>fe.field!==B);Q.length>0?oe.applyMultiSort(Q):(oe.clearMultiSort(),oe.orderBy===B&&oe.setOrderBy(""));},onHideColumn:B=>{oe.visibleColumns.includes(B)&&oe.toggleColumnVisibility(B);},onToggleGroup:B=>oe.toggleGroupField(B),onToggleSummary:B=>oe.toggleSummaryColumn(B),onOpenSortDialog:()=>q(true)}),e(Vp,{open:it,onClose:()=>q(false),columns:oe.columns,initialRules:oe.sortBy.length>0?oe.sortBy:oe.orderBy?[{field:oe.orderBy,direction:oe.order}]:[],onApply:B=>oe.applyMultiSort(B),onClear:()=>{oe.clearMultiSort(),oe.setOrderBy("");}})]})};P();var IV=({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 c(se,{spacing:r,sx:i,children:[e("div",{sx:{flexShrink:0},children:e(_o,{...t})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:e(Kg,{...o,bodyHeight:o.bodyHeight??"100%",sx:s})}),a]})};P();var qg=640,O0=360,F0=360,Hs=8,Ln="220ms cubic-bezier(0.2, 0, 0, 1)",Sc=(t,o,r=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:r,hasChildren:i.length>0,parentIds:n}];return o.has(a.id)?[...s,...Sc(i,o,r+1,[...n,a.id])]:s}),Yg=t=>t.flatMap(o=>[o,...Yg(o.children??[])]),Zg=(t,o=0,r=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:o,hasChildren:a.length>0,parentIds:r},...Zg(a,o+1,[...r,n.id])]}),jg=t=>t.flatMap(o=>{let r=o.children??[];return r.length===0?[]:[o.id,...jg(r)]}),Xg=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(),HV=({title:t,subtitle:o,nodes:r,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:l,expandedNodeIds:d,defaultExpandedNodeIds:p,onExpandedNodeIdsChange:m,defaultPaneMode:f="split",minTreePaneWidth:h=O0,minDetailPaneWidth:u=F0,tableAppId:v="ctree-comp",tableKey:y="default",tableTitle:g,filterConfig:x,searchQuery:b,searchToken:C,defaultRowsPerPage:k=-1,rowsPerPageOptions:S=[20,50,100,-1],serviceUrl:T,emptyLabel:I="No tree items available.",headerAction:w,sx:M,className:A})=>{let R=so(),D=eo.useRef(null),E=eo.useRef(null),O=eo.useRef(null),[_,J]=eo.useState(s??r[0]?.id??null),[F,V]=eo.useState(p??jg(r).slice(0,3)),[z,X]=eo.useState(f),[W,H]=eo.useState(qg),[U,Y]=eo.useState(0),[ue,re]=eo.useState(0),[ge,we]=eo.useState(k),Ve=eo.useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:de=>c(se,{spacing:.3,children:[e(L,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:de.label}),de.subtitle&&e(L,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:de.subtitle})]})}],[n]),Te=eo.useMemo(()=>new Set(d??F),[d,F]),Ie=eo.useMemo(()=>Sc(r,Te),[r,Te]),He=eo.useMemo(()=>Yg(r),[r]),ce=eo.useMemo(()=>Zg(r),[r]),be=i===void 0?_:i,We=eo.useMemo(()=>He.find(de=>de.id===be)??null,[be,He]),tt=de=>{let ye=E.current?.clientWidth??0,te=ye>0?Math.max(h,ye-Hs-u):Math.max(h,de);return Math.min(Math.max(de,h),te)},nt=z==="detail",it=z==="tree"||!a,q=z==="split"&&!!a,Ce=(()=>{if(U<=0)return null;if(z==="tree"||!a)return {treeWidth:U,splitterWidth:0,detailWidth:0};if(z==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:U};let de=q?Hs:0,ye=tt(W);return {treeWidth:ye,splitterWidth:de,detailWidth:Math.max(0,U-de-ye)}})(),Fe=Ce?`${Ce.treeWidth}px ${Ce.splitterWidth}px ${Ce.detailWidth}px`:z==="tree"||!a?"minmax(0, 1fr) 0px 0px":z==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${h}px, ${W}px) ${Hs}px minmax(${u}px, 1fr)`;eo.useEffect(()=>{let de=E.current;if(!de){Y(0);return}let ye=0,te=()=>{window.cancelAnimationFrame(ye),ye=window.requestAnimationFrame(()=>{let Ne=de.clientWidth;Y(Je=>Math.abs(Je-Ne)<.5?Je:Ne);});};if(te(),typeof ResizeObserver>"u")return window.addEventListener("resize",te),()=>{window.cancelAnimationFrame(ye),window.removeEventListener("resize",te);};let ve=new ResizeObserver(te);return ve.observe(de),window.addEventListener("resize",te),()=>{window.cancelAnimationFrame(ye),ve.disconnect(),window.removeEventListener("resize",te);}},[]);let at=de=>{d===void 0&&V(de),m?.(de);},Ze=de=>{let ye=new Set(Te);ye.has(de)?ye.delete(de):ye.add(de),at(Array.from(ye));},wt=de=>{i===void 0&&J(de.id),l?.(de);};eo.useEffect(()=>{re(0);},[r]),eo.useEffect(()=>{let de=b?.trim().toLowerCase();if(!de)return;let ye=ce.find(({node:pt})=>Xg(pt).includes(de));if(!ye)return;let te=new Set(Te);ye.parentIds.forEach(pt=>te.add(pt)),at(Array.from(te)),wt(ye.node);let Ne=Sc(r,te).findIndex(({node:pt})=>pt.id===ye.node.id);Ne>=0&&ge>0&&re(Math.floor(Ne/ge));let Je=0,st=0;return Je=window.requestAnimationFrame(()=>{st=window.requestAnimationFrame(()=>{let pt=D.current?.querySelector("tr.orb-selected"),Bt=pt?.closest(".orb-table-container");if(pt&&Bt){let Yt=Bt.getBoundingClientRect(),Vt=pt.getBoundingClientRect(),St=Vt.top-Yt.top+Bt.scrollTop;Bt.scrollTo({top:St-Bt.clientHeight/2+Vt.height/2,behavior:"smooth"});return}pt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(Je),window.cancelAnimationFrame(st);}},[b,C,ce,r,ge]);let Rt=eo.useMemo(()=>Ie.map(({node:de,level:ye,hasChildren:te})=>({...de,id:de.id,__node:de,__level:ye,__hasChildren:te,__expanded:Te.has(de.id),__searchText:Xg(de)})),[Te,Ie]),Ot=eo.useMemo(()=>Ve.map((de,ye)=>({id:de.id,label:de.label,minWidth:typeof de.width=="number"?de.width:de.minWidth??(ye===0?320:120),numeric:de.numeric??de.align==="right",render:(te,ve)=>{let Ne=ve.__node,Je=de.render?de.render(Ne):Ne[de.id];if(ye!==0)return e(Re,{sx:{minWidth:0,color:de.align==="right"?"text.primary":"text.secondary",fontWeight:de.align==="right"?750:500,textAlign:de.align??"left"},children:Je});let st=Number(ve.__level??0),pt=!!ve.__hasChildren,Bt=!!ve.__expanded;return c(se,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${st*24}px`},children:[e(ie,{tooltip:pt?Bt?"Collapse":"Expand":"",onClick:Yt=>{Yt.stopPropagation(),pt&&Ze(Ne.id);},disabled:!pt,sx:{width:24,height:24,visibility:pt?"visible":"hidden",transform:Bt?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:e($o,{sx:{fontSize:20}})}),e(Re,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:Ne.markerColor??R.palette.primary.main}}),e(Re,{sx:{minWidth:0},children:Je})]})}})),[Ve,Te,R.palette.primary.main]),At=de=>{if(!q)return;de.preventDefault(),de.currentTarget.setPointerCapture(de.pointerId),O.current={startX:de.clientX,startWidth:W};let ye=ve=>{let Ne=O.current;Ne&&H(tt(Ne.startWidth+ve.clientX-Ne.startX));},te=()=>{O.current=null,window.removeEventListener("pointermove",ye),window.removeEventListener("pointerup",te),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",ye),window.addEventListener("pointerup",te);},oe=()=>{let de=E.current?.clientWidth??0,ye=de>0?Math.max(h,(de-Hs)/2):qg;X("split"),H(tt(ye));},Ke=()=>a?typeof a=="function"?a(We):a:null,Oe=a?e(Gn,{"aria-label":"Tree pane layout",value:z,options:[{value:"tree",label:"Expand tree",icon:e(ui,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:e(gi,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:e(pi,{fontSize:"small"})}],onValueChange:de=>{de==="split"?oe():X(de);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return c(Re,{ref:D,className:["ctree_comp",A].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${R.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${ot(R.palette.common.black,vt()==="dark"?.24:.08)}`,...M},children:[Oe,c(Re,{ref:E,sx:{height:"100%",display:"grid",gridTemplateColumns:Fe,transition:`grid-template-columns ${Ln}`,minWidth:0},children:[c(Re,{"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 ${Ln}, transform ${Ln}`,willChange:"opacity, transform"},children:[c(se,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${R.palette.divider}`},children:[c(se,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[e(wr,{sx:{color:"primary.main",fontSize:28}}),c(Re,{sx:{minWidth:0},children:[e(L,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),o&&e(L,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:o})]})]}),w!==void 0?w:e(ie,{tooltip:"Add node",color:"default",children:e(Hr,{fontSize:"small"})})]}),c(Re,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[e(tr,{appId:v,tableKey:y,title:g??(typeof t=="string"?t:"Tree"),columns:Ot,rows:Rt,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:be?[be]:[],onSelectionChange:de=>{let ye=de[de.length-1],te=He.find(ve=>ve.id===ye);te&&wt(te);},page:ue,rowsPerPage:ge,rowsPerPageOptions:S,count:Rt.length,onPageChange:re,onRowsPerPageChange:de=>{re(0),we(de);},filterConfig:x,serviceUrl:T,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),Rt.length===0&&e(Re,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:I})]})]}),e(Re,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:q?At:void 0,sx:{width:"100%",cursor:q?"col-resize":"default",backgroundColor:q?ot(R.palette.text.primary,vt()==="dark"?.16:.08):"transparent",opacity:q?1:0,pointerEvents:q?"auto":"none",position:"relative",transition:`opacity ${Ln}, background-color 120ms ease`,"&:hover":{backgroundColor:q?ot(R.palette.primary.main,vt()==="dark"?.35:.18):"transparent"}}}),c(Re,{"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 ${Ln}, transform ${Ln}`,willChange:"opacity, transform"},children:[e(Re,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:e(Dt,{sx:{width:"100%"}})}),e(Re,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:Ke()})]})]})]})};P();var V0={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)"}}},_V=({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=xr("(prefers-reduced-motion: reduce)"),[p,m]=eo.useState("to"),f=!s&&!d&&r!=="none";eo.useEffect(()=>{if(!f){m("to");return}m("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{m("to");});});return ()=>cancelAnimationFrame(v)},[o,f]);let h=V0[r],u=eo.useMemo(()=>f?p==="from"?h.from:h.to:{opacity:1,transform:"none"},[f,p,h.from,h.to]);return e(Re,{sx:{willChange:f?"opacity, transform":"auto",transition:f?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...u,...l},children:t})},GV={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=h5;exports.Activity=Oc;exports.AgentPanel=Jm;exports.AlertCircle=Da;exports.AlertTriangle=Fc;exports.ArrowDown=mw;exports.ArrowRight=gw;exports.ArrowUp=Bc;exports.BarChart=_s;exports.Bot=fw;exports.Button=js;exports.CAINavProvider=qy;exports.CAlert=rn;exports.CAmapChart=Xp;exports.CAppHeader=qi;exports.CAppHeaderSearch=Dl;exports.CAppPageLayout=WE;exports.CAuthPage=V5;exports.CAvatar=on;exports.CBadge=Ka;exports.CBarChart=ra;exports.CButton=ke;exports.CCalendar=Kn;exports.CCardDetailPanel=cu;exports.CCardGrid=pu;exports.CCardGridCard=Xb;exports.CCardPage=bN;exports.CChartCard=Ti;exports.CCheckbox=It;exports.CChip=xt;exports.CComboChart=_p;exports.CCustomizeAgent=Zp;exports.CDatePicker=uh;exports.CDetailInfoPage=zA;exports.CDetailSearchAiBar=yu;exports.CDetailSectionCard=$i;exports.CDialog=Lt;exports.CDivider=Dt;exports.CFileUpload=gh;exports.CFilterField=QT;exports.CFishboneChart=Up;exports.CGoogleMapChart=qp;exports.CGraphCharts=Yp;exports.CGraphKpiCards=Wp;exports.CGraphReport=Di;exports.CHeatmapChart=Gp;exports.CIconButton=ie;exports.CKanbanBoard=mE;exports.CKanbanBucket=ku;exports.CKanbanCard=kl;exports.CLayoutManagement=au;exports.CLayoutManager=hn;exports.CLineChart=$p;exports.CList=_T;exports.CListItem=GT;exports.CListItemAvatar=YT;exports.CListItemButton=UT;exports.CListItemIcon=KT;exports.CListItemText=qT;exports.CListSubheader=XT;exports.CMenu=Qt;exports.CMessageBox=Qn;exports.CMetricChartCard=Cs;exports.COrbCanvas=By;exports.CPageLayout=bi;exports.CPageTransition=_V;exports.CPaper=Ae;exports.CPieChart=Ii;exports.CPivotTable=MO;exports.CPlanningGantt=Kg;exports.CPlanningLayout=IV;exports.CPopover=Xs;exports.CProgress=_n;exports.CRadioGroup=Hf;exports.CSegmentedControl=Gn;exports.CSelect=zt;exports.CSkeleton=Uf;exports.CSmartFilter=_o;exports.CSmartTable=FD;exports.CSpinner=Zo;exports.CStack=se;exports.CStandardPage=_D;exports.CStatusBadge=VT;exports.CSwitch=Ua;exports.CTable=tr;exports.CTableBody=ND;exports.CTableCell=AD;exports.CTableContainer=ED;exports.CTableHead=LD;exports.CTableRow=OD;exports.CTabs=lh;exports.CTextArea=$n;exports.CTextField=ze;exports.CTooltip=ct;exports.CTreeComp=HV;exports.CTypography=L;exports.CValueHelp=Ap;exports.CVariantManagement=Li;exports.CVariantManager=eu;exports.CVoiceWaveOverlay=Vl;exports.CWaterfallChart=Kp;exports.Calendar=Gs;exports.CalendarDays=hw;exports.Camera=bw;exports.ChartNoAxesCombined=vw;exports.Check=Ao;exports.CheckCircle=Na;exports.ChevronDown=Ho;exports.ChevronLeft=Aa;exports.ChevronRight=zo;exports.ChevronUp=yw;exports.ChevronsDown=Cw;exports.ChevronsUp=xw;exports.CircleAlert=Ea;exports.CircleCheck=Hn;exports.CircleCheckBig=ww;exports.CircleStop=Hc;exports.Clipboard=zc;exports.ClipboardCheck=Sw;exports.ClipboardList=kw;exports.Clock=Vc;exports.CodeBlock=ca;exports.Columns3=Pw;exports.CopilotChat=m5;exports.Copy=Yo;exports.CopyPlus=Tw;exports.Delete=Iw;exports.Download=La;exports.Edit=Wc;exports.Expand=$c;exports.Eye=Rw;exports.EyeOff=Mw;exports.File=Oa;exports.FileText=_c;exports.Filter=Dw;exports.FloatingAgentPanel=a5;exports.FolderTree=zn;exports.GitBranch=Gc;exports.GlobalMessage=OT;exports.Globe=Vn;exports.Grid=Uc;exports.GripVertical=Nw;exports.Hammer=Aw;exports.Image=Kc;exports.Info=Fa;exports.InputArea=jl;exports.Languages=Ew;exports.Layers=Lw;exports.LayoutDashboard=Ow;exports.Lightbulb=Ba;exports.LineChart=qc;exports.Loader2=Xc;exports.Lock=Ha;exports.LockKeyhole=Fw;exports.LogOut=Yc;exports.METRIC_CHART_TYPES=ys;exports.Mail=Us;exports.MapPin=Zc;exports.MarkdownRenderer=ua;exports.MathBlock=da;exports.Menu=jc;exports.MermaidBlock=hl;exports.MessageCircle=xf;exports.MessageSquare=Qc;exports.Mic=za;exports.MicOff=Bw;exports.Moon=Jc;exports.MoreHorizontal=Hw;exports.NavigationIsland=yd;exports.NavigationIsland2=el;exports.OMPHApprovalCard=n0;exports.OMPHPanel=qz;exports.ORBCAFE_I18N_MESSAGES=Xn;exports.ORB_DARK=tf;exports.ORB_FONT_STACK=$0;exports.ORB_LIGHT=ef;exports.ORB_RADIUS=G0;exports.ORB_TOKENS=Vs;exports.ORB_TRANSITION_FAST=U0;exports.OrbcafeI18nProvider=Ya;exports.OrbisModeProvider=Bn;exports.PAGE_TRANSITION_PRESETS=GV;exports.PAppPageLayout=o2;exports.PBarcodeScanner=qO;exports.PNavIsland=ym;exports.PNumericKeypad=lF;exports.PSmartFilter=gm;exports.PTable=Dy;exports.PTouchCard=eF;exports.PWorkloadNav=fm;exports.PackageCheck=zw;exports.PackageSearch=Vw;exports.PanelLeftOpen=Va;exports.PanelRight=Wa;exports.PanelsTopLeft=Ww;exports.PieChart=ed;exports.Pin=Jr;exports.PivotChartPanel=am;exports.Play=$w;exports.Plus=en;exports.QrCode=_w;exports.ReceiptText=Gw;exports.RefreshCw=$a;exports.Rocket=Uw;exports.RotateCcw=Kw;exports.RotateCw=td;exports.Rows3=qw;exports.SapIcon=Tt;exports.Save=Xw;exports.ScanLine=Yw;exports.Search=Vo;exports.Send=wf;exports.SendHorizontal=od;exports.Settings=tn;exports.ShieldCheck=Zw;exports.Sigma=jw;exports.SortAsc=Qw;exports.SquareSplitHorizontal=Jw;exports.Star=eS;exports.StdChat=jm;exports.Sun=rd;exports.Table2=tS;exports.TableBlock=vl;exports.TabletSmartphone=oS;exports.Terminal=Wn;exports.ThinkBlock=Vi;exports.ThumbsDown=nd;exports.ThumbsUp=ad;exports.Trash2=id;exports.TreeMenu=Yn;exports.TreePine=rS;exports.TrendingDown=sd;exports.TriangleAlert=_a;exports.Truck=nS;exports.UploadCloud=ld;exports.User=Ks;exports.VoiceNavigatorProvider=h2;exports.VoiceWaveOverlay=d2;exports.Volume2=cd;exports.Warehouse=aS;exports.Workflow=iS;exports.X=qt;exports.XCircle=Ga;exports.addKanbanBucket=Pu;exports.buildAmapEmbedUrl=Ri;exports.buildGoogleMapEmbedUrl=na;exports.buildGoogleMapIframe=IM;exports.buttonVariants=yh;exports.createKanbanBoardModel=Iu;exports.createSapIcon=ae;exports.findKanbanCard=Uo;exports.message=IT;exports.messageManager=lr;exports.moveKanbanCard=Ui;exports.omphApprovalLabelsFromI18n=ic;exports.omphLabelsFromI18n=ac;exports.orbAlpha=ot;exports.orbChartSeries=_0;exports.parseMarkdownTable=zi;exports.parseOmphFileHref=ec;exports.renameKanbanBucket=Tu;exports.renderMarkdown=pA;exports.resolveVariantFilters=Bi;exports.resolveVariantLayout=Hi;exports.useAINav=Xy;exports.useAmapEmbedUrl=NN;exports.useAuthPage=N5;exports.useCardPage=wN;exports.useDetailInfo=xu;exports.useGoogleMapEmbedUrl=DN;exports.useGraphChartData=PN;exports.useGraphInteraction=Ai;exports.useGraphReport=mn;exports.useKanbanBoard=vE;exports.useMediaQuery=No;exports.useNavigationIsland=Pd;exports.useOrbMode=fo;exports.useOrbTokens=$s;exports.useOrbcafeI18n=le;exports.usePadLayout=HO;exports.usePadRecordEditor=WO;exports.usePageLayout=Lu;exports.usePivotTable=LO;exports.usePlanningGantt=Vg;exports.usePlanningLayout=X5;exports.useStandardReport=YD;exports.useVoiceInput=wn;exports.useVoiceNavigator=b2;