@camstack/addon-admin-ui 0.1.36 → 0.1.37

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.
Files changed (49) hide show
  1. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-CeLhKMin.js → __mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-Cv6qLu_-.js} +1 -1
  2. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-DXPQtD9p.js → __mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-CChEG9e0.js} +1 -1
  3. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-OcRSBqRe.js → __mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-C1BmHlGM.js} +1 -1
  4. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-GvBGLFI2.js → __mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-Bxv_3KWz.js} +1 -1
  5. package/dist/assets/__mfe_internal__admin_ui_host__loadShare__konva__loadShare__.mjs-g85Oidc0.js +15 -0
  6. package/dist/assets/__mfe_internal__admin_ui_host__loadShare__konva__loadShare__.mjs_commonjs-proxy-Bqeq2Zwj.js +1 -0
  7. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-Dl4u0xYE.js → __mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-DC63qZbr.js} +1 -1
  8. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-CSyOECfO.js → __mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-D2C49VyZ.js} +1 -1
  9. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-CzO_Esxm.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-D3WbXy3O.js} +1 -1
  10. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-xw6c6JeS.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-Csg6EbPB.js} +1 -1
  11. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-DNpf5SLz.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-CUc0oFNo.js} +2 -2
  12. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-BEKtiDI3.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-vh0hhA5d.js} +1 -1
  13. package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs-CpGtTxci.js +35 -0
  14. package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs_commonjs-proxy-RUDPE9aM.js +1 -0
  15. package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-Cjyt3AKP.js +1 -0
  16. package/dist/assets/{devices-D4k34mru.js → devices-GLp7me2a.js} +1 -1
  17. package/dist/assets/hostInit-Cx72YpvD.js +1 -0
  18. package/dist/assets/index-ByRJWRUP.js +1 -0
  19. package/dist/assets/index-COoei6lw.css +1 -0
  20. package/dist/assets/index-CtHpLu0L.js +1 -0
  21. package/dist/assets/{index-D92THlot.js → index-CwF7Dxf8.js} +1 -1
  22. package/dist/assets/{index-BI3Z7SSi.js → index-D6khiudP.js} +1 -1
  23. package/dist/assets/index-DNY_otk4.js +151 -0
  24. package/dist/assets/index-DQFO9ZU6.js +1 -0
  25. package/dist/assets/index-G9qsQFtk.js +1150 -0
  26. package/dist/assets/{index-BGZqVJZt.js → index-JJ5NLHxC.js} +1 -1
  27. package/dist/assets/{index-Bwcmc2hW.js → index-TiJwCuZx.js} +1 -1
  28. package/dist/assets/index-WrAHDGEr.js +87 -0
  29. package/dist/assets/index-b0D9qthW.js +1 -0
  30. package/dist/assets/method-access-map-DLEhlu0x.js +1 -0
  31. package/dist/assets/{remoteEntry-BRybuw2S.js → remoteEntry-CbhqJYoN.js} +1 -1
  32. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DUkp33c_.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-I5siGnQL.js} +6 -6
  33. package/dist/index.html +6 -6
  34. package/dist/mf-entry-bootstrap-0.js +2 -2
  35. package/dist/server/addon.js +528 -96
  36. package/dist/server/addon.js.map +1 -1
  37. package/dist/sw.js +1 -1
  38. package/package.json +10 -2
  39. package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DYU-qDnu.js +0 -1
  40. package/dist/assets/hostInit-CBKchP1G.js +0 -1
  41. package/dist/assets/index-BEewR-UX.js +0 -1
  42. package/dist/assets/index-BRSAFSOw.css +0 -1
  43. package/dist/assets/index-BqMPfvQx.js +0 -1
  44. package/dist/assets/index-CP1R6E2R.js +0 -88
  45. package/dist/assets/index-CwjnPcOV.js +0 -152
  46. package/dist/assets/index-Dmon2mdO.js +0 -1
  47. package/dist/assets/index-KlKJOjpC.js +0 -1
  48. package/dist/assets/index-SyrojlmO.js +0 -1156
  49. package/dist/assets/method-access-map-BFPyQ2-G.js +0 -1
@@ -1,152 +0,0 @@
1
- import{b as EO,g as MO}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-C_6K4VBY.js";import{r as rm}from"./__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-CSyOECfO.js";import{r as nm}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs_commonjs-proxy-DrLZNXOX.js";import{r as DO}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-xw6c6JeS.js";import{r as AO}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-BEKtiDI3.js";import{r as zO}from"./__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-DXPQtD9p.js";import{r as TO}from"./__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs_commonjs-proxy-WD2WouMQ.js";import{r as RO}from"./__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-GvBGLFI2.js";import{r as ZO}from"./index-BI3Z7SSi.js";import{s as LO}from"./index-BGZqVJZt.js";function UO(t,f){for(var k=0;k<f.length;k++){const C=f[k];if(typeof C!="string"&&!Array.isArray(C)){for(const x in C)if(x!=="default"&&!(x in t)){const S=Object.getOwnPropertyDescriptor(C,x);S&&Object.defineProperty(t,x,S.get?S:{enumerable:!0,get:()=>C[x]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Ac={},zc={},Wf;function BO(){return Wf||(Wf=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),jm();let f=rm,k=nm;var C={frigate:"#3b82f6",scrypted:"#a855f7",reolink:"#06b6d4",homeAssistant:"#22d3ee",rtsp:"#78716c"},x={primary:"#f59e42",primaryForeground:"#0c0a09",background:"#0c0a09",backgroundElevated:"#1c1917",surface:"#1c1917",surfaceHover:"#292524",border:"#292524",borderSubtle:"#1c1917",foreground:"#fafaf9",foregroundMuted:"#a8a29e",foregroundSubtle:"#78716c",foregroundDisabled:"#57534e",success:"#4ade80",warning:"#fbbf24",danger:"#f87171",info:"#60a5fa",provider:C},S={primary:"#e67e22",primaryForeground:"#ffffff",background:"#fafaf9",backgroundElevated:"#ffffff",surface:"#f5f5f4",surfaceHover:"#e7e5e4",border:"#d6d3d1",borderSubtle:"#e7e5e4",foreground:"#1c1917",foregroundMuted:"#57534e",foregroundSubtle:"#78716c",foregroundDisabled:"#a8a29e",success:"#16a34a",warning:"#d97706",danger:"#dc2626",info:"#2563eb",provider:C},z={colors:{dark:x,light:S},spacing:{xs:2,sm:4,md:8,lg:12,xl:16,"2xl":24,"3xl":32},radius:{sm:4,md:6,lg:8,xl:12},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',sizes:{xs:{fontSize:10,lineHeight:14},sm:{fontSize:11,lineHeight:16},base:{fontSize:12,lineHeight:18},lg:{fontSize:13,lineHeight:18},xl:{fontSize:14,lineHeight:20},"2xl":{fontSize:16,lineHeight:22},"3xl":{fontSize:20,lineHeight:28}},weights:{regular:400,medium:500,semibold:600,bold:700}},table:{rowHeight:28,headerHeight:24,cellPaddingX:8,cellPaddingY:6},sidebar:{width:176,itemHeight:28,iconSize:14}};function U(be,Te){const Me={...be};for(const nt in Te){const ht=Te[nt],Ct=be[nt];ht!==void 0&&typeof ht=="object"&&ht!==null&&!Array.isArray(ht)&&typeof Ct=="object"&&Ct!==null?Me[nt]=U(Ct,ht):ht!==void 0&&(Me[nt]=ht)}return Me}function c(be){return be?U(structuredClone(z),be):structuredClone(z)}function s(be){return be.replace(/[A-Z]/g,Te=>`-${Te.toLowerCase()}`)}function u(be){return`--color-${s(be)}`}function g(be){const Te=[];for(const[Me,nt]of Object.entries(be))Me!=="provider"&&Te.push(` ${u(Me)}: ${nt};`);return Te.join(`
2
- `)}function n(be){const Te=[];for(const[Me,nt]of Object.entries(be))Te.push(` --color-provider-${s(Me)}: ${nt};`);return Te.join(`
3
- `)}function r(be){const Te=[];for(const[Me,nt]of Object.entries(be))Te.push(` --spacing-${Me}: ${nt}px;`);return Te.join(`
4
- `)}function _(be){const Te=[];for(const[Me,nt]of Object.entries(be))Te.push(` --radius-${Me}: ${nt}px;`);return Te.join(`
5
- `)}function M(be){const Te=g(be.colors.dark),Me=g(be.colors.light);return`@theme {
6
- ${n(be.colors.dark.provider)}
7
- ${r(be.spacing)}
8
- ${_(be.radius)}
9
- }
10
-
11
- .dark {
12
- ${Te}
13
- }
14
-
15
- .light {
16
- ${Me}
17
- }
18
-
19
- @media (prefers-color-scheme: dark) {
20
- :root {
21
- ${Te.replace(/^ {2}/gm," ")}
22
- }
23
- }
24
-
25
- @media (prefers-color-scheme: light) {
26
- :root {
27
- ${Me.replace(/^ {2}/gm," ")}
28
- }
29
- }
30
- `}var ee=(0,f.createContext)(null),X=["dark","light","system"];function ie(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Q(be,Te){if(typeof window>"u")return Te;const Me=localStorage.getItem(be);return Me==="dark"||Me==="light"||Me==="system"?Me:Te}function ge(be){return be==="system"?ie():be}function xe({children:be,defaultMode:Te="system",storageKey:Me="camstack-theme-mode"}){const[nt,ht]=(0,f.useState)(()=>Q(Me,Te)),[Ct,Bt]=(0,f.useState)(()=>ge(nt)),zt=(0,f.useCallback)(jt=>{ht(jt),Bt(ge(jt)),typeof window<"u"&&localStorage.setItem(Me,jt)},[Me]),Dt=(0,f.useCallback)(()=>{zt(X[(X.indexOf(nt)+1)%X.length]??"dark")},[nt,zt]);(0,f.useEffect)(()=>{if(typeof document>"u")return;const jt=document.documentElement;jt.classList.remove("dark","light"),jt.classList.add(Ct)},[nt,Ct]),(0,f.useEffect)(()=>{if(typeof window>"u"||nt!=="system")return;const jt=window.matchMedia("(prefers-color-scheme: dark)"),Ft=()=>{Bt(ie())};return jt.addEventListener("change",Ft),()=>jt.removeEventListener("change",Ft)},[nt]);const Lt=(0,f.useMemo)(()=>({mode:nt,resolvedMode:Ct,setMode:zt,toggleMode:Dt}),[nt,Ct,zt,Dt]);return(0,k.jsx)(ee.Provider,{value:Lt,children:be})}function he(){const be=(0,f.useContext)(ee);if(!be)throw new Error("useThemeMode must be used within a ThemeProvider");return be}t.ThemeProvider=xe,t.ThemeProvider$1=xe,t.createTheme=c,t.createTheme$1=c,t.darkColors=x,t.darkColors$1=x,t.defaultTheme=z,t.defaultTheme$1=z,t.lightColors=S,t.lightColors$1=S,t.themeToCss=M,t.themeToCss$1=M,t.useThemeMode=he,t.useThemeMode$1=he})(zc)),zc}const FO=EO(LO);var pr={},qt={},Nt={},Yr={};(function(t){var f;Object.defineProperty(t,"__esModule",{value:!0}),t.globalConfig=t.$ZodEncodeError=t.$ZodAsyncError=t.$brand=t.NEVER=void 0,t.$constructor=k,t.config=S,t.NEVER=Object.freeze({status:"aborted"});function k(z,U,c){function s(r,_){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:_,constr:n,traits:new Set},enumerable:!1}),r._zod.traits.has(z))return;r._zod.traits.add(z),U(r,_);const M=n.prototype,ee=Object.keys(M);for(let X=0;X<ee.length;X++){const ie=ee[X];ie in r||(r[ie]=M[ie].bind(r))}}const u=c?.Parent??Object;class g extends u{}Object.defineProperty(g,"name",{value:z});function n(r){var _;const M=c?.Parent?new g:this;s(M,r),(_=M._zod).deferred??(_.deferred=[]);for(const ee of M._zod.deferred)ee();return M}return Object.defineProperty(n,"init",{value:s}),Object.defineProperty(n,Symbol.hasInstance,{value:r=>c?.Parent&&r instanceof c.Parent?!0:r?._zod?.traits?.has(z)}),Object.defineProperty(n,"name",{value:z}),n}t.$brand=Symbol("zod_brand");class C extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}t.$ZodAsyncError=C;class x extends Error{constructor(U){super(`Encountered unidirectional transform during encode: ${U}`),this.name="ZodEncodeError"}}t.$ZodEncodeError=x,(f=globalThis).__zod_globalConfig??(f.__zod_globalConfig={}),t.globalConfig=globalThis.__zod_globalConfig;function S(z){return z&&Object.assign(t.globalConfig,z),t.globalConfig}})(Yr);var kr={},Et={},ae={};Object.defineProperty(ae,"__esModule",{value:!0});ae.Class=ae.BIGINT_FORMAT_RANGES=ae.NUMBER_FORMAT_RANGES=ae.primitiveTypes=ae.propertyKeyTypes=ae.getParsedType=ae.allowsEval=ae.captureStackTrace=void 0;ae.assertEqual=VO;ae.assertNotEqual=QO;ae.assertIs=WO;ae.assertNever=qO;ae.assert=HO;ae.getEnumValues=JO;ae.joinValues=KO;ae.jsonStringifyReplacer=XO;ae.cached=im;ae.nullish=YO;ae.cleanRegex=eC;ae.floatSafeRemainder=tC;ae.defineLazy=rC;ae.objectClone=nC;ae.assignProp=Rr;ae.mergeDefs=Or;ae.cloneDef=iC;ae.getElementAtPath=aC;ae.promiseAllObject=oC;ae.randomString=sC;ae.esc=cC;ae.slugify=lC;ae.isObject=Tc;ae.isPlainObject=qo;ae.shallowClone=uC;ae.numKeys=dC;ae.escapeRegex=mC;ae.clone=Zr;ae.normalizeParams=gC;ae.createTransparentProxy=pC;ae.stringifyPrimitive=am;ae.optionalKeys=vC;ae.pick=hC;ae.omit=bC;ae.extend=yC;ae.safeExtend=_C;ae.merge=xC;ae.partial=wC;ae.required=SC;ae.aborted=jC;ae.explicitlyAborted=$C;ae.prefixIssues=kC;ae.unwrapMessage=Ji;ae.finalizeIssue=PC;ae.getSizableOrigin=NC;ae.getLengthableOrigin=OC;ae.parsedType=CC;ae.issue=IC;ae.cleanEnum=EC;ae.base64ToUint8Array=om;ae.uint8ArrayToBase64=sm;ae.base64urlToUint8Array=MC;ae.uint8ArrayToBase64url=DC;ae.hexToUint8Array=AC;ae.uint8ArrayToHex=zC;const GO=Yr;function VO(t){return t}function QO(t){return t}function WO(t){}function qO(t){throw new Error("Unexpected value in exhaustive check")}function HO(t){}function JO(t){const f=Object.values(t).filter(C=>typeof C=="number");return Object.entries(t).filter(([C,x])=>f.indexOf(+C)===-1).map(([C,x])=>x)}function KO(t,f="|"){return t.map(k=>am(k)).join(f)}function XO(t,f){return typeof f=="bigint"?f.toString():f}function im(t){return{get value(){{const f=t();return Object.defineProperty(this,"value",{value:f}),f}}}}function YO(t){return t==null}function eC(t){const f=t.startsWith("^")?1:0,k=t.endsWith("$")?t.length-1:t.length;return t.slice(f,k)}function tC(t,f){const k=t/f,C=Math.round(k),x=Number.EPSILON*Math.max(Math.abs(k),1);return Math.abs(k-C)<x?0:k-C}const qf=Symbol("evaluating");function rC(t,f,k){let C;Object.defineProperty(t,f,{get(){if(C!==qf)return C===void 0&&(C=qf,C=k()),C},set(x){Object.defineProperty(t,f,{value:x})},configurable:!0})}function nC(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Rr(t,f,k){Object.defineProperty(t,f,{value:k,writable:!0,enumerable:!0,configurable:!0})}function Or(...t){const f={};for(const k of t){const C=Object.getOwnPropertyDescriptors(k);Object.assign(f,C)}return Object.defineProperties({},f)}function iC(t){return Or(t._zod.def)}function aC(t,f){return f?f.reduce((k,C)=>k?.[C],t):t}function oC(t){const f=Object.keys(t),k=f.map(C=>t[C]);return Promise.all(k).then(C=>{const x={};for(let S=0;S<f.length;S++)x[f[S]]=C[S];return x})}function sC(t=10){const f="abcdefghijklmnopqrstuvwxyz";let k="";for(let C=0;C<t;C++)k+=f[Math.floor(Math.random()*f.length)];return k}function cC(t){return JSON.stringify(t)}function lC(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}ae.captureStackTrace="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Tc(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}ae.allowsEval=im(()=>{if(GO.globalConfig.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function qo(t){if(Tc(t)===!1)return!1;const f=t.constructor;if(f===void 0||typeof f!="function")return!0;const k=f.prototype;return!(Tc(k)===!1||Object.prototype.hasOwnProperty.call(k,"isPrototypeOf")===!1)}function uC(t){return qo(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function dC(t){let f=0;for(const k in t)Object.prototype.hasOwnProperty.call(t,k)&&f++;return f}const fC=t=>{const f=typeof t;switch(f){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${f}`)}};ae.getParsedType=fC;ae.propertyKeyTypes=new Set(["string","number","symbol"]);ae.primitiveTypes=new Set(["string","number","bigint","boolean","symbol","undefined"]);function mC(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zr(t,f,k){const C=new t._zod.constr(f??t._zod.def);return(!f||k?.parent)&&(C._zod.parent=t),C}function gC(t){const f=t;if(!f)return{};if(typeof f=="string")return{error:()=>f};if(f?.message!==void 0){if(f?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");f.error=f.message}return delete f.message,typeof f.error=="string"?{...f,error:()=>f.error}:f}function pC(t){let f;return new Proxy({},{get(k,C,x){return f??(f=t()),Reflect.get(f,C,x)},set(k,C,x,S){return f??(f=t()),Reflect.set(f,C,x,S)},has(k,C){return f??(f=t()),Reflect.has(f,C)},deleteProperty(k,C){return f??(f=t()),Reflect.deleteProperty(f,C)},ownKeys(k){return f??(f=t()),Reflect.ownKeys(f)},getOwnPropertyDescriptor(k,C){return f??(f=t()),Reflect.getOwnPropertyDescriptor(f,C)},defineProperty(k,C,x){return f??(f=t()),Reflect.defineProperty(f,C,x)}})}function am(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function vC(t){return Object.keys(t).filter(f=>t[f]._zod.optin==="optional"&&t[f]._zod.optout==="optional")}ae.NUMBER_FORMAT_RANGES={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};ae.BIGINT_FORMAT_RANGES={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function hC(t,f){const k=t._zod.def,C=k.checks;if(C&&C.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const S=Or(t._zod.def,{get shape(){const z={};for(const U in f){if(!(U in k.shape))throw new Error(`Unrecognized key: "${U}"`);f[U]&&(z[U]=k.shape[U])}return Rr(this,"shape",z),z},checks:[]});return Zr(t,S)}function bC(t,f){const k=t._zod.def,C=k.checks;if(C&&C.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const S=Or(t._zod.def,{get shape(){const z={...t._zod.def.shape};for(const U in f){if(!(U in k.shape))throw new Error(`Unrecognized key: "${U}"`);f[U]&&delete z[U]}return Rr(this,"shape",z),z},checks:[]});return Zr(t,S)}function yC(t,f){if(!qo(f))throw new Error("Invalid input to extend: expected a plain object");const k=t._zod.def.checks;if(k&&k.length>0){const S=t._zod.def.shape;for(const z in f)if(Object.getOwnPropertyDescriptor(S,z)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const x=Or(t._zod.def,{get shape(){const S={...t._zod.def.shape,...f};return Rr(this,"shape",S),S}});return Zr(t,x)}function _C(t,f){if(!qo(f))throw new Error("Invalid input to safeExtend: expected a plain object");const k=Or(t._zod.def,{get shape(){const C={...t._zod.def.shape,...f};return Rr(this,"shape",C),C}});return Zr(t,k)}function xC(t,f){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const k=Or(t._zod.def,{get shape(){const C={...t._zod.def.shape,...f._zod.def.shape};return Rr(this,"shape",C),C},get catchall(){return f._zod.def.catchall},checks:f._zod.def.checks??[]});return Zr(t,k)}function wC(t,f,k){const x=f._zod.def.checks;if(x&&x.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const z=Or(f._zod.def,{get shape(){const U=f._zod.def.shape,c={...U};if(k)for(const s in k){if(!(s in U))throw new Error(`Unrecognized key: "${s}"`);k[s]&&(c[s]=t?new t({type:"optional",innerType:U[s]}):U[s])}else for(const s in U)c[s]=t?new t({type:"optional",innerType:U[s]}):U[s];return Rr(this,"shape",c),c},checks:[]});return Zr(f,z)}function SC(t,f,k){const C=Or(f._zod.def,{get shape(){const x=f._zod.def.shape,S={...x};if(k)for(const z in k){if(!(z in S))throw new Error(`Unrecognized key: "${z}"`);k[z]&&(S[z]=new t({type:"nonoptional",innerType:x[z]}))}else for(const z in x)S[z]=new t({type:"nonoptional",innerType:x[z]});return Rr(this,"shape",S),S}});return Zr(f,C)}function jC(t,f=0){if(t.aborted===!0)return!0;for(let k=f;k<t.issues.length;k++)if(t.issues[k]?.continue!==!0)return!0;return!1}function $C(t,f=0){if(t.aborted===!0)return!0;for(let k=f;k<t.issues.length;k++)if(t.issues[k]?.continue===!1)return!0;return!1}function kC(t,f){return f.map(k=>{var C;return(C=k).path??(C.path=[]),k.path.unshift(t),k})}function Ji(t){return typeof t=="string"?t:t?.message}function PC(t,f,k){const C=t.message?t.message:Ji(t.inst?._zod.def?.error?.(t))??Ji(f?.error?.(t))??Ji(k.customError?.(t))??Ji(k.localeError?.(t))??"Invalid input",{inst:x,continue:S,input:z,...U}=t;return U.path??(U.path=[]),U.message=C,f?.reportInput&&(U.input=z),U}function NC(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function OC(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function CC(t){const f=typeof t;switch(f){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";const k=t;if(k&&Object.getPrototypeOf(k)!==Object.prototype&&"constructor"in k&&k.constructor)return k.constructor.name}}return f}function IC(...t){const[f,k,C]=t;return typeof f=="string"?{message:f,code:"custom",input:k,inst:C}:{...f}}function EC(t){return Object.entries(t).filter(([f,k])=>Number.isNaN(Number.parseInt(f,10))).map(f=>f[1])}function om(t){const f=atob(t),k=new Uint8Array(f.length);for(let C=0;C<f.length;C++)k[C]=f.charCodeAt(C);return k}function sm(t){let f="";for(let k=0;k<t.length;k++)f+=String.fromCharCode(t[k]);return btoa(f)}function MC(t){const f=t.replace(/-/g,"+").replace(/_/g,"/"),k="=".repeat((4-f.length%4)%4);return om(f+k)}function DC(t){return sm(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function AC(t){const f=t.replace(/^0x/,"");if(f.length%2!==0)throw new Error("Invalid hex string length");const k=new Uint8Array(f.length/2);for(let C=0;C<f.length;C+=2)k[C/2]=Number.parseInt(f.slice(C,C+2),16);return k}function zC(t){return Array.from(t).map(f=>f.toString(16).padStart(2,"0")).join("")}class TC{constructor(...f){}}ae.Class=TC;var RC=Et&&Et.__createBinding||(Object.create?(function(t,f,k,C){C===void 0&&(C=k);var x=Object.getOwnPropertyDescriptor(f,k);(!x||("get"in x?!f.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return f[k]}}),Object.defineProperty(t,C,x)}):(function(t,f,k,C){C===void 0&&(C=k),t[C]=f[k]})),ZC=Et&&Et.__setModuleDefault||(Object.create?(function(t,f){Object.defineProperty(t,"default",{enumerable:!0,value:f})}):function(t,f){t.default=f}),LC=Et&&Et.__importStar||function(t){if(t&&t.__esModule)return t;var f={};if(t!=null)for(var k in t)k!=="default"&&Object.prototype.hasOwnProperty.call(t,k)&&RC(f,t,k);return ZC(f,t),f};Object.defineProperty(Et,"__esModule",{value:!0});Et.$ZodRealError=Et.$ZodError=void 0;Et.flattenError=BC;Et.formatError=FC;Et.treeifyError=GC;Et.toDotPath=um;Et.prettifyError=VC;const cm=Yr,UC=LC(ae),lm=(t,f)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:f,enumerable:!1}),t.message=JSON.stringify(f,UC.jsonStringifyReplacer,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})};Et.$ZodError=(0,cm.$constructor)("$ZodError",lm);Et.$ZodRealError=(0,cm.$constructor)("$ZodError",lm,{Parent:Error});function BC(t,f=k=>k.message){const k={},C=[];for(const x of t.issues)x.path.length>0?(k[x.path[0]]=k[x.path[0]]||[],k[x.path[0]].push(f(x))):C.push(f(x));return{formErrors:C,fieldErrors:k}}function FC(t,f=k=>k.message){const k={_errors:[]},C=(x,S=[])=>{for(const z of x.issues)if(z.code==="invalid_union"&&z.errors.length)z.errors.map(U=>C({issues:U},[...S,...z.path]));else if(z.code==="invalid_key")C({issues:z.issues},[...S,...z.path]);else if(z.code==="invalid_element")C({issues:z.issues},[...S,...z.path]);else{const U=[...S,...z.path];if(U.length===0)k._errors.push(f(z));else{let c=k,s=0;for(;s<U.length;){const u=U[s];s===U.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(f(z))):c[u]=c[u]||{_errors:[]},c=c[u],s++}}}};return C(t),k}function GC(t,f=k=>k.message){const k={errors:[]},C=(x,S=[])=>{var z,U;for(const c of x.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(s=>C({issues:s},[...S,...c.path]));else if(c.code==="invalid_key")C({issues:c.issues},[...S,...c.path]);else if(c.code==="invalid_element")C({issues:c.issues},[...S,...c.path]);else{const s=[...S,...c.path];if(s.length===0){k.errors.push(f(c));continue}let u=k,g=0;for(;g<s.length;){const n=s[g],r=g===s.length-1;typeof n=="string"?(u.properties??(u.properties={}),(z=u.properties)[n]??(z[n]={errors:[]}),u=u.properties[n]):(u.items??(u.items=[]),(U=u.items)[n]??(U[n]={errors:[]}),u=u.items[n]),r&&u.errors.push(f(c)),g++}}};return C(t),k}function um(t){const f=[],k=t.map(C=>typeof C=="object"?C.key:C);for(const C of k)typeof C=="number"?f.push(`[${C}]`):typeof C=="symbol"?f.push(`[${JSON.stringify(String(C))}]`):/[^\w$]/.test(C)?f.push(`[${JSON.stringify(C)}]`):(f.length&&f.push("."),f.push(C));return f.join("")}function VC(t){const f=[],k=[...t.issues].sort((C,x)=>(C.path??[]).length-(x.path??[]).length);for(const C of k)f.push(`✖ ${C.message}`),C.path?.length&&f.push(` → at ${um(C.path)}`);return f.join(`
31
- `)}(function(t){var f=kr&&kr.__createBinding||(Object.create?(function(Q,ge,xe,he){he===void 0&&(he=xe);var be=Object.getOwnPropertyDescriptor(ge,xe);(!be||("get"in be?!ge.__esModule:be.writable||be.configurable))&&(be={enumerable:!0,get:function(){return ge[xe]}}),Object.defineProperty(Q,he,be)}):(function(Q,ge,xe,he){he===void 0&&(he=xe),Q[he]=ge[xe]})),k=kr&&kr.__setModuleDefault||(Object.create?(function(Q,ge){Object.defineProperty(Q,"default",{enumerable:!0,value:ge})}):function(Q,ge){Q.default=ge}),C=kr&&kr.__importStar||function(Q){if(Q&&Q.__esModule)return Q;var ge={};if(Q!=null)for(var xe in Q)xe!=="default"&&Object.prototype.hasOwnProperty.call(Q,xe)&&f(ge,Q,xe);return k(ge,Q),ge};Object.defineProperty(t,"__esModule",{value:!0}),t.safeDecodeAsync=t._safeDecodeAsync=t.safeEncodeAsync=t._safeEncodeAsync=t.safeDecode=t._safeDecode=t.safeEncode=t._safeEncode=t.decodeAsync=t._decodeAsync=t.encodeAsync=t._encodeAsync=t.decode=t._decode=t.encode=t._encode=t.safeParseAsync=t._safeParseAsync=t.safeParse=t._safeParse=t.parseAsync=t._parseAsync=t.parse=t._parse=void 0;const x=C(Yr),S=C(Et),z=C(ae),U=Q=>(ge,xe,he,be)=>{const Te=he?{...he,async:!1}:{async:!1},Me=ge._zod.run({value:xe,issues:[]},Te);if(Me instanceof Promise)throw new x.$ZodAsyncError;if(Me.issues.length){const nt=new(be?.Err??Q)(Me.issues.map(ht=>z.finalizeIssue(ht,Te,x.config())));throw z.captureStackTrace(nt,be?.callee),nt}return Me.value};t._parse=U,t.parse=(0,t._parse)(S.$ZodRealError);const c=Q=>async(ge,xe,he,be)=>{const Te=he?{...he,async:!0}:{async:!0};let Me=ge._zod.run({value:xe,issues:[]},Te);if(Me instanceof Promise&&(Me=await Me),Me.issues.length){const nt=new(be?.Err??Q)(Me.issues.map(ht=>z.finalizeIssue(ht,Te,x.config())));throw z.captureStackTrace(nt,be?.callee),nt}return Me.value};t._parseAsync=c,t.parseAsync=(0,t._parseAsync)(S.$ZodRealError);const s=Q=>(ge,xe,he)=>{const be=he?{...he,async:!1}:{async:!1},Te=ge._zod.run({value:xe,issues:[]},be);if(Te instanceof Promise)throw new x.$ZodAsyncError;return Te.issues.length?{success:!1,error:new(Q??S.$ZodError)(Te.issues.map(Me=>z.finalizeIssue(Me,be,x.config())))}:{success:!0,data:Te.value}};t._safeParse=s,t.safeParse=(0,t._safeParse)(S.$ZodRealError);const u=Q=>async(ge,xe,he)=>{const be=he?{...he,async:!0}:{async:!0};let Te=ge._zod.run({value:xe,issues:[]},be);return Te instanceof Promise&&(Te=await Te),Te.issues.length?{success:!1,error:new Q(Te.issues.map(Me=>z.finalizeIssue(Me,be,x.config())))}:{success:!0,data:Te.value}};t._safeParseAsync=u,t.safeParseAsync=(0,t._safeParseAsync)(S.$ZodRealError);const g=Q=>(ge,xe,he)=>{const be=he?{...he,direction:"backward"}:{direction:"backward"};return(0,t._parse)(Q)(ge,xe,be)};t._encode=g,t.encode=(0,t._encode)(S.$ZodRealError);const n=Q=>(ge,xe,he)=>(0,t._parse)(Q)(ge,xe,he);t._decode=n,t.decode=(0,t._decode)(S.$ZodRealError);const r=Q=>async(ge,xe,he)=>{const be=he?{...he,direction:"backward"}:{direction:"backward"};return(0,t._parseAsync)(Q)(ge,xe,be)};t._encodeAsync=r,t.encodeAsync=(0,t._encodeAsync)(S.$ZodRealError);const _=Q=>async(ge,xe,he)=>(0,t._parseAsync)(Q)(ge,xe,he);t._decodeAsync=_,t.decodeAsync=(0,t._decodeAsync)(S.$ZodRealError);const M=Q=>(ge,xe,he)=>{const be=he?{...he,direction:"backward"}:{direction:"backward"};return(0,t._safeParse)(Q)(ge,xe,be)};t._safeEncode=M,t.safeEncode=(0,t._safeEncode)(S.$ZodRealError);const ee=Q=>(ge,xe,he)=>(0,t._safeParse)(Q)(ge,xe,he);t._safeDecode=ee,t.safeDecode=(0,t._safeDecode)(S.$ZodRealError);const X=Q=>async(ge,xe,he)=>{const be=he?{...he,direction:"backward"}:{direction:"backward"};return(0,t._safeParseAsync)(Q)(ge,xe,be)};t._safeEncodeAsync=X,t.safeEncodeAsync=(0,t._safeEncodeAsync)(S.$ZodRealError);const ie=Q=>async(ge,xe,he)=>(0,t._safeParseAsync)(Q)(ge,xe,he);t._safeDecodeAsync=ie,t.safeDecodeAsync=(0,t._safeDecodeAsync)(S.$ZodRealError)})(kr);var Pr={},vr={},hr={};(function(t){var f=hr&&hr.__createBinding||(Object.create?(function(ie,Q,ge,xe){xe===void 0&&(xe=ge);var he=Object.getOwnPropertyDescriptor(Q,ge);(!he||("get"in he?!Q.__esModule:he.writable||he.configurable))&&(he={enumerable:!0,get:function(){return Q[ge]}}),Object.defineProperty(ie,xe,he)}):(function(ie,Q,ge,xe){xe===void 0&&(xe=ge),ie[xe]=Q[ge]})),k=hr&&hr.__setModuleDefault||(Object.create?(function(ie,Q){Object.defineProperty(ie,"default",{enumerable:!0,value:Q})}):function(ie,Q){ie.default=Q}),C=hr&&hr.__importStar||function(ie){if(ie&&ie.__esModule)return ie;var Q={};if(ie!=null)for(var ge in ie)ge!=="default"&&Object.prototype.hasOwnProperty.call(ie,ge)&&f(Q,ie,ge);return k(Q,ie),Q};Object.defineProperty(t,"__esModule",{value:!0}),t.sha256_base64url=t.sha256_base64=t.sha256_hex=t.sha1_base64url=t.sha1_base64=t.sha1_hex=t.md5_base64url=t.md5_base64=t.md5_hex=t.hex=t.uppercase=t.lowercase=t.undefined=t.null=t.boolean=t.number=t.integer=t.bigint=t.string=t.date=t.e164=t.httpProtocol=t.domain=t.hostname=t.base64url=t.base64=t.cidrv6=t.cidrv4=t.mac=t.ipv6=t.ipv4=t.browserEmail=t.idnEmail=t.unicodeEmail=t.rfc5322Email=t.html5Email=t.email=t.uuid7=t.uuid6=t.uuid4=t.uuid=t.guid=t.extendedDuration=t.duration=t.nanoid=t.ksuid=t.xid=t.ulid=t.cuid2=t.cuid=void 0,t.sha512_base64url=t.sha512_base64=t.sha512_hex=t.sha384_base64url=t.sha384_base64=t.sha384_hex=void 0,t.emoji=U,t.time=g,t.datetime=n;const x=C(ae);t.cuid=/^[cC][0-9a-z]{6,}$/,t.cuid2=/^[0-9a-z]+$/,t.ulid=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,t.xid=/^[0-9a-vA-V]{20}$/,t.ksuid=/^[A-Za-z0-9]{27}$/,t.nanoid=/^[a-zA-Z0-9_-]{21}$/,t.duration=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,t.extendedDuration=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,t.guid=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;const S=ie=>ie?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${ie}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;t.uuid=S,t.uuid4=(0,t.uuid)(4),t.uuid6=(0,t.uuid)(6),t.uuid7=(0,t.uuid)(7),t.email=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,t.html5Email=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,t.rfc5322Email=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,t.unicodeEmail=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,t.idnEmail=t.unicodeEmail,t.browserEmail=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;const z="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function U(){return new RegExp(z,"u")}t.ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,t.ipv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;const c=ie=>{const Q=x.escapeRegex(ie??":");return new RegExp(`^(?:[0-9A-F]{2}${Q}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${Q}){5}[0-9a-f]{2}$`)};t.mac=c,t.cidrv4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,t.cidrv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,t.base64=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,t.base64url=/^[A-Za-z0-9_-]*$/,t.hostname=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,t.domain=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,t.httpProtocol=/^https?$/,t.e164=/^\+[1-9]\d{6,14}$/;const s="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";t.date=new RegExp(`^${s}$`);function u(ie){const Q="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof ie.precision=="number"?ie.precision===-1?`${Q}`:ie.precision===0?`${Q}:[0-5]\\d`:`${Q}:[0-5]\\d\\.\\d{${ie.precision}}`:`${Q}(?::[0-5]\\d(?:\\.\\d+)?)?`}function g(ie){return new RegExp(`^${u(ie)}$`)}function n(ie){const Q=u({precision:ie.precision}),ge=["Z"];ie.local&&ge.push(""),ie.offset&&ge.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const xe=`${Q}(?:${ge.join("|")})`;return new RegExp(`^${s}T(?:${xe})$`)}const r=ie=>{const Q=ie?`[\\s\\S]{${ie?.minimum??0},${ie?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Q}$`)};t.string=r,t.bigint=/^-?\d+n?$/,t.integer=/^-?\d+$/,t.number=/^-?\d+(?:\.\d+)?$/,t.boolean=/^(?:true|false)$/i;const _=/^null$/i;t.null=_;const M=/^undefined$/i;t.undefined=M,t.lowercase=/^[^A-Z]*$/,t.uppercase=/^[^a-z]*$/,t.hex=/^[0-9a-fA-F]*$/;function ee(ie,Q){return new RegExp(`^[A-Za-z0-9+/]{${ie}}${Q}$`)}function X(ie){return new RegExp(`^[A-Za-z0-9_-]{${ie}}$`)}t.md5_hex=/^[0-9a-fA-F]{32}$/,t.md5_base64=ee(22,"=="),t.md5_base64url=X(22),t.sha1_hex=/^[0-9a-fA-F]{40}$/,t.sha1_base64=ee(27,"="),t.sha1_base64url=X(27),t.sha256_hex=/^[0-9a-fA-F]{64}$/,t.sha256_base64=ee(43,"="),t.sha256_base64url=X(43),t.sha384_hex=/^[0-9a-fA-F]{96}$/,t.sha384_base64=ee(64,""),t.sha384_base64url=X(64),t.sha512_hex=/^[0-9a-fA-F]{128}$/,t.sha512_base64=ee(86,"=="),t.sha512_base64url=X(86)})(hr);(function(t){var f=vr&&vr.__createBinding||(Object.create?(function(s,u,g,n){n===void 0&&(n=g);var r=Object.getOwnPropertyDescriptor(u,g);(!r||("get"in r?!u.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return u[g]}}),Object.defineProperty(s,n,r)}):(function(s,u,g,n){n===void 0&&(n=g),s[n]=u[g]})),k=vr&&vr.__setModuleDefault||(Object.create?(function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}):function(s,u){s.default=u}),C=vr&&vr.__importStar||function(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var g in s)g!=="default"&&Object.prototype.hasOwnProperty.call(s,g)&&f(u,s,g);return k(u,s),u};Object.defineProperty(t,"__esModule",{value:!0}),t.$ZodCheckOverwrite=t.$ZodCheckMimeType=t.$ZodCheckProperty=t.$ZodCheckEndsWith=t.$ZodCheckStartsWith=t.$ZodCheckIncludes=t.$ZodCheckUpperCase=t.$ZodCheckLowerCase=t.$ZodCheckRegex=t.$ZodCheckStringFormat=t.$ZodCheckLengthEquals=t.$ZodCheckMinLength=t.$ZodCheckMaxLength=t.$ZodCheckSizeEquals=t.$ZodCheckMinSize=t.$ZodCheckMaxSize=t.$ZodCheckBigIntFormat=t.$ZodCheckNumberFormat=t.$ZodCheckMultipleOf=t.$ZodCheckGreaterThan=t.$ZodCheckLessThan=t.$ZodCheck=void 0;const x=C(Yr),S=C(hr),z=C(ae);t.$ZodCheck=x.$constructor("$ZodCheck",(s,u)=>{var g;s._zod??(s._zod={}),s._zod.def=u,(g=s._zod).onattach??(g.onattach=[])});const U={number:"number",bigint:"bigint",object:"date"};t.$ZodCheckLessThan=x.$constructor("$ZodCheckLessThan",(s,u)=>{t.$ZodCheck.init(s,u);const g=U[typeof u.value];s._zod.onattach.push(n=>{const r=n._zod.bag,_=(u.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;u.value<_&&(u.inclusive?r.maximum=u.value:r.exclusiveMaximum=u.value)}),s._zod.check=n=>{(u.inclusive?n.value<=u.value:n.value<u.value)||n.issues.push({origin:g,code:"too_big",maximum:typeof u.value=="object"?u.value.getTime():u.value,input:n.value,inclusive:u.inclusive,inst:s,continue:!u.abort})}}),t.$ZodCheckGreaterThan=x.$constructor("$ZodCheckGreaterThan",(s,u)=>{t.$ZodCheck.init(s,u);const g=U[typeof u.value];s._zod.onattach.push(n=>{const r=n._zod.bag,_=(u.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;u.value>_&&(u.inclusive?r.minimum=u.value:r.exclusiveMinimum=u.value)}),s._zod.check=n=>{(u.inclusive?n.value>=u.value:n.value>u.value)||n.issues.push({origin:g,code:"too_small",minimum:typeof u.value=="object"?u.value.getTime():u.value,input:n.value,inclusive:u.inclusive,inst:s,continue:!u.abort})}}),t.$ZodCheckMultipleOf=x.$constructor("$ZodCheckMultipleOf",(s,u)=>{t.$ZodCheck.init(s,u),s._zod.onattach.push(g=>{var n;(n=g._zod.bag).multipleOf??(n.multipleOf=u.value)}),s._zod.check=g=>{if(typeof g.value!=typeof u.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof g.value=="bigint"?g.value%u.value===BigInt(0):z.floatSafeRemainder(g.value,u.value)===0)||g.issues.push({origin:typeof g.value,code:"not_multiple_of",divisor:u.value,input:g.value,inst:s,continue:!u.abort})}}),t.$ZodCheckNumberFormat=x.$constructor("$ZodCheckNumberFormat",(s,u)=>{t.$ZodCheck.init(s,u),u.format=u.format||"float64";const g=u.format?.includes("int"),n=g?"int":"number",[r,_]=z.NUMBER_FORMAT_RANGES[u.format];s._zod.onattach.push(M=>{const ee=M._zod.bag;ee.format=u.format,ee.minimum=r,ee.maximum=_,g&&(ee.pattern=S.integer)}),s._zod.check=M=>{const ee=M.value;if(g){if(!Number.isInteger(ee)){M.issues.push({expected:n,format:u.format,code:"invalid_type",continue:!1,input:ee,inst:s});return}if(!Number.isSafeInteger(ee)){ee>0?M.issues.push({input:ee,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:s,origin:n,inclusive:!0,continue:!u.abort}):M.issues.push({input:ee,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:s,origin:n,inclusive:!0,continue:!u.abort});return}}ee<r&&M.issues.push({origin:"number",input:ee,code:"too_small",minimum:r,inclusive:!0,inst:s,continue:!u.abort}),ee>_&&M.issues.push({origin:"number",input:ee,code:"too_big",maximum:_,inclusive:!0,inst:s,continue:!u.abort})}}),t.$ZodCheckBigIntFormat=x.$constructor("$ZodCheckBigIntFormat",(s,u)=>{t.$ZodCheck.init(s,u);const[g,n]=z.BIGINT_FORMAT_RANGES[u.format];s._zod.onattach.push(r=>{const _=r._zod.bag;_.format=u.format,_.minimum=g,_.maximum=n}),s._zod.check=r=>{const _=r.value;_<g&&r.issues.push({origin:"bigint",input:_,code:"too_small",minimum:g,inclusive:!0,inst:s,continue:!u.abort}),_>n&&r.issues.push({origin:"bigint",input:_,code:"too_big",maximum:n,inclusive:!0,inst:s,continue:!u.abort})}}),t.$ZodCheckMaxSize=x.$constructor("$ZodCheckMaxSize",(s,u)=>{var g;t.$ZodCheck.init(s,u),(g=s._zod.def).when??(g.when=n=>{const r=n.value;return!z.nullish(r)&&r.size!==void 0}),s._zod.onattach.push(n=>{const r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;u.maximum<r&&(n._zod.bag.maximum=u.maximum)}),s._zod.check=n=>{const r=n.value;r.size<=u.maximum||n.issues.push({origin:z.getSizableOrigin(r),code:"too_big",maximum:u.maximum,inclusive:!0,input:r,inst:s,continue:!u.abort})}}),t.$ZodCheckMinSize=x.$constructor("$ZodCheckMinSize",(s,u)=>{var g;t.$ZodCheck.init(s,u),(g=s._zod.def).when??(g.when=n=>{const r=n.value;return!z.nullish(r)&&r.size!==void 0}),s._zod.onattach.push(n=>{const r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;u.minimum>r&&(n._zod.bag.minimum=u.minimum)}),s._zod.check=n=>{const r=n.value;r.size>=u.minimum||n.issues.push({origin:z.getSizableOrigin(r),code:"too_small",minimum:u.minimum,inclusive:!0,input:r,inst:s,continue:!u.abort})}}),t.$ZodCheckSizeEquals=x.$constructor("$ZodCheckSizeEquals",(s,u)=>{var g;t.$ZodCheck.init(s,u),(g=s._zod.def).when??(g.when=n=>{const r=n.value;return!z.nullish(r)&&r.size!==void 0}),s._zod.onattach.push(n=>{const r=n._zod.bag;r.minimum=u.size,r.maximum=u.size,r.size=u.size}),s._zod.check=n=>{const r=n.value,_=r.size;if(_===u.size)return;const M=_>u.size;n.issues.push({origin:z.getSizableOrigin(r),...M?{code:"too_big",maximum:u.size}:{code:"too_small",minimum:u.size},inclusive:!0,exact:!0,input:n.value,inst:s,continue:!u.abort})}}),t.$ZodCheckMaxLength=x.$constructor("$ZodCheckMaxLength",(s,u)=>{var g;t.$ZodCheck.init(s,u),(g=s._zod.def).when??(g.when=n=>{const r=n.value;return!z.nullish(r)&&r.length!==void 0}),s._zod.onattach.push(n=>{const r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;u.maximum<r&&(n._zod.bag.maximum=u.maximum)}),s._zod.check=n=>{const r=n.value;if(r.length<=u.maximum)return;const M=z.getLengthableOrigin(r);n.issues.push({origin:M,code:"too_big",maximum:u.maximum,inclusive:!0,input:r,inst:s,continue:!u.abort})}}),t.$ZodCheckMinLength=x.$constructor("$ZodCheckMinLength",(s,u)=>{var g;t.$ZodCheck.init(s,u),(g=s._zod.def).when??(g.when=n=>{const r=n.value;return!z.nullish(r)&&r.length!==void 0}),s._zod.onattach.push(n=>{const r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;u.minimum>r&&(n._zod.bag.minimum=u.minimum)}),s._zod.check=n=>{const r=n.value;if(r.length>=u.minimum)return;const M=z.getLengthableOrigin(r);n.issues.push({origin:M,code:"too_small",minimum:u.minimum,inclusive:!0,input:r,inst:s,continue:!u.abort})}}),t.$ZodCheckLengthEquals=x.$constructor("$ZodCheckLengthEquals",(s,u)=>{var g;t.$ZodCheck.init(s,u),(g=s._zod.def).when??(g.when=n=>{const r=n.value;return!z.nullish(r)&&r.length!==void 0}),s._zod.onattach.push(n=>{const r=n._zod.bag;r.minimum=u.length,r.maximum=u.length,r.length=u.length}),s._zod.check=n=>{const r=n.value,_=r.length;if(_===u.length)return;const M=z.getLengthableOrigin(r),ee=_>u.length;n.issues.push({origin:M,...ee?{code:"too_big",maximum:u.length}:{code:"too_small",minimum:u.length},inclusive:!0,exact:!0,input:n.value,inst:s,continue:!u.abort})}}),t.$ZodCheckStringFormat=x.$constructor("$ZodCheckStringFormat",(s,u)=>{var g,n;t.$ZodCheck.init(s,u),s._zod.onattach.push(r=>{const _=r._zod.bag;_.format=u.format,u.pattern&&(_.patterns??(_.patterns=new Set),_.patterns.add(u.pattern))}),u.pattern?(g=s._zod).check??(g.check=r=>{u.pattern.lastIndex=0,!u.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:u.format,input:r.value,...u.pattern?{pattern:u.pattern.toString()}:{},inst:s,continue:!u.abort})}):(n=s._zod).check??(n.check=()=>{})}),t.$ZodCheckRegex=x.$constructor("$ZodCheckRegex",(s,u)=>{t.$ZodCheckStringFormat.init(s,u),s._zod.check=g=>{u.pattern.lastIndex=0,!u.pattern.test(g.value)&&g.issues.push({origin:"string",code:"invalid_format",format:"regex",input:g.value,pattern:u.pattern.toString(),inst:s,continue:!u.abort})}}),t.$ZodCheckLowerCase=x.$constructor("$ZodCheckLowerCase",(s,u)=>{u.pattern??(u.pattern=S.lowercase),t.$ZodCheckStringFormat.init(s,u)}),t.$ZodCheckUpperCase=x.$constructor("$ZodCheckUpperCase",(s,u)=>{u.pattern??(u.pattern=S.uppercase),t.$ZodCheckStringFormat.init(s,u)}),t.$ZodCheckIncludes=x.$constructor("$ZodCheckIncludes",(s,u)=>{t.$ZodCheck.init(s,u);const g=z.escapeRegex(u.includes),n=new RegExp(typeof u.position=="number"?`^.{${u.position}}${g}`:g);u.pattern=n,s._zod.onattach.push(r=>{const _=r._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(n)}),s._zod.check=r=>{r.value.includes(u.includes,u.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:u.includes,input:r.value,inst:s,continue:!u.abort})}}),t.$ZodCheckStartsWith=x.$constructor("$ZodCheckStartsWith",(s,u)=>{t.$ZodCheck.init(s,u);const g=new RegExp(`^${z.escapeRegex(u.prefix)}.*`);u.pattern??(u.pattern=g),s._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(g)}),s._zod.check=n=>{n.value.startsWith(u.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:u.prefix,input:n.value,inst:s,continue:!u.abort})}}),t.$ZodCheckEndsWith=x.$constructor("$ZodCheckEndsWith",(s,u)=>{t.$ZodCheck.init(s,u);const g=new RegExp(`.*${z.escapeRegex(u.suffix)}$`);u.pattern??(u.pattern=g),s._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(g)}),s._zod.check=n=>{n.value.endsWith(u.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:u.suffix,input:n.value,inst:s,continue:!u.abort})}});function c(s,u,g){s.issues.length&&u.issues.push(...z.prefixIssues(g,s.issues))}t.$ZodCheckProperty=x.$constructor("$ZodCheckProperty",(s,u)=>{t.$ZodCheck.init(s,u),s._zod.check=g=>{const n=u.schema._zod.run({value:g.value[u.property],issues:[]},{});if(n instanceof Promise)return n.then(r=>c(r,g,u.property));c(n,g,u.property)}}),t.$ZodCheckMimeType=x.$constructor("$ZodCheckMimeType",(s,u)=>{t.$ZodCheck.init(s,u);const g=new Set(u.mime);s._zod.onattach.push(n=>{n._zod.bag.mime=u.mime}),s._zod.check=n=>{g.has(n.value.type)||n.issues.push({code:"invalid_value",values:u.mime,input:n.value.type,inst:s,continue:!u.abort})}}),t.$ZodCheckOverwrite=x.$constructor("$ZodCheckOverwrite",(s,u)=>{t.$ZodCheck.init(s,u),s._zod.check=g=>{g.value=u.tx(g.value)}})})(vr);var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.Doc=void 0;class QC{constructor(f=[]){this.content=[],this.indent=0,this&&(this.args=f)}indented(f){this.indent+=1,f(this),this.indent-=1}write(f){if(typeof f=="function"){f(this,{execution:"sync"}),f(this,{execution:"async"});return}const C=f.split(`
32
- `).filter(z=>z),x=Math.min(...C.map(z=>z.length-z.trimStart().length)),S=C.map(z=>z.slice(x)).map(z=>" ".repeat(this.indent*2)+z);for(const z of S)this.content.push(z)}compile(){const f=Function,k=this?.args,x=[...(this?.content??[""]).map(S=>` ${S}`)];return new f(...k,x.join(`
33
- `))}}Xi.Doc=QC;var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.version=void 0;Yi.version={major:4,minor:4,patch:3};(function(t){var f=Pr&&Pr.__createBinding||(Object.create?(function($,P,I,L){L===void 0&&(L=I);var F=Object.getOwnPropertyDescriptor(P,I);(!F||("get"in F?!P.__esModule:F.writable||F.configurable))&&(F={enumerable:!0,get:function(){return P[I]}}),Object.defineProperty($,L,F)}):(function($,P,I,L){L===void 0&&(L=I),$[L]=P[I]})),k=Pr&&Pr.__setModuleDefault||(Object.create?(function($,P){Object.defineProperty($,"default",{enumerable:!0,value:P})}):function($,P){$.default=P}),C=Pr&&Pr.__importStar||function($){if($&&$.__esModule)return $;var P={};if($!=null)for(var I in $)I!=="default"&&Object.prototype.hasOwnProperty.call($,I)&&f(P,$,I);return k(P,$),P};Object.defineProperty(t,"__esModule",{value:!0}),t.$ZodTuple=t.$ZodIntersection=t.$ZodDiscriminatedUnion=t.$ZodXor=t.$ZodUnion=t.$ZodObjectJIT=t.$ZodObject=t.$ZodArray=t.$ZodDate=t.$ZodVoid=t.$ZodNever=t.$ZodUnknown=t.$ZodAny=t.$ZodNull=t.$ZodUndefined=t.$ZodSymbol=t.$ZodBigIntFormat=t.$ZodBigInt=t.$ZodBoolean=t.$ZodNumberFormat=t.$ZodNumber=t.$ZodCustomStringFormat=t.$ZodJWT=t.$ZodE164=t.$ZodBase64URL=t.$ZodBase64=t.$ZodCIDRv6=t.$ZodCIDRv4=t.$ZodMAC=t.$ZodIPv6=t.$ZodIPv4=t.$ZodISODuration=t.$ZodISOTime=t.$ZodISODate=t.$ZodISODateTime=t.$ZodKSUID=t.$ZodXID=t.$ZodULID=t.$ZodCUID2=t.$ZodCUID=t.$ZodNanoID=t.$ZodEmoji=t.$ZodURL=t.$ZodEmail=t.$ZodUUID=t.$ZodGUID=t.$ZodStringFormat=t.$ZodString=t.clone=t.$ZodType=void 0,t.$ZodCustom=t.$ZodLazy=t.$ZodPromise=t.$ZodFunction=t.$ZodTemplateLiteral=t.$ZodReadonly=t.$ZodPreprocess=t.$ZodCodec=t.$ZodPipe=t.$ZodNaN=t.$ZodCatch=t.$ZodSuccess=t.$ZodNonOptional=t.$ZodPrefault=t.$ZodDefault=t.$ZodNullable=t.$ZodExactOptional=t.$ZodOptional=t.$ZodTransform=t.$ZodFile=t.$ZodLiteral=t.$ZodEnum=t.$ZodSet=t.$ZodMap=t.$ZodRecord=void 0,t.isValidBase64=n,t.isValidBase64URL=r,t.isValidJWT=_;const x=C(vr),S=C(Yr),z=Xi,U=kr,c=C(hr),s=C(ae),u=Yi;t.$ZodType=S.$constructor("$ZodType",($,P)=>{var I;$??($={}),$._zod.def=P,$._zod.bag=$._zod.bag||{},$._zod.version=u.version;const L=[...$._zod.def.checks??[]];$._zod.traits.has("$ZodCheck")&&L.unshift($);for(const F of L)for(const W of F._zod.onattach)W($);if(L.length===0)(I=$._zod).deferred??(I.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{const F=(ne,me,H)=>{let q=s.aborted(ne),oe;for(const fe of me){if(fe._zod.def.when){if(s.explicitlyAborted(ne)||!fe._zod.def.when(ne))continue}else if(q)continue;const J=ne.issues.length,le=fe._zod.check(ne);if(le instanceof Promise&&H?.async===!1)throw new S.$ZodAsyncError;if(oe||le instanceof Promise)oe=(oe??Promise.resolve()).then(async()=>{await le,ne.issues.length!==J&&(q||(q=s.aborted(ne,J)))});else{if(ne.issues.length===J)continue;q||(q=s.aborted(ne,J))}}return oe?oe.then(()=>ne):ne},W=(ne,me,H)=>{if(s.aborted(ne))return ne.aborted=!0,ne;const q=F(me,L,H);if(q instanceof Promise){if(H.async===!1)throw new S.$ZodAsyncError;return q.then(oe=>$._zod.parse(oe,H))}return $._zod.parse(q,H)};$._zod.run=(ne,me)=>{if(me.skipChecks)return $._zod.parse(ne,me);if(me.direction==="backward"){const q=$._zod.parse({value:ne.value,issues:[]},{...me,skipChecks:!0});return q instanceof Promise?q.then(oe=>W(oe,ne,me)):W(q,ne,me)}const H=$._zod.parse(ne,me);if(H instanceof Promise){if(me.async===!1)throw new S.$ZodAsyncError;return H.then(q=>F(q,L,me))}return F(H,L,me)}}s.defineLazy($,"~standard",()=>({validate:F=>{try{const W=(0,U.safeParse)($,F);return W.success?{value:W.data}:{issues:W.error?.issues}}catch{return(0,U.safeParseAsync)($,F).then(ne=>ne.success?{value:ne.data}:{issues:ne.error?.issues})}},vendor:"zod",version:1}))});var g=ae;Object.defineProperty(t,"clone",{enumerable:!0,get:function(){return g.clone}}),t.$ZodString=S.$constructor("$ZodString",($,P)=>{t.$ZodType.init($,P),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??c.string($._zod.bag),$._zod.parse=(I,L)=>{if(P.coerce)try{I.value=String(I.value)}catch{}return typeof I.value=="string"||I.issues.push({expected:"string",code:"invalid_type",input:I.value,inst:$}),I}}),t.$ZodStringFormat=S.$constructor("$ZodStringFormat",($,P)=>{x.$ZodCheckStringFormat.init($,P),t.$ZodString.init($,P)}),t.$ZodGUID=S.$constructor("$ZodGUID",($,P)=>{P.pattern??(P.pattern=c.guid),t.$ZodStringFormat.init($,P)}),t.$ZodUUID=S.$constructor("$ZodUUID",($,P)=>{if(P.version){const L={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[P.version];if(L===void 0)throw new Error(`Invalid UUID version: "${P.version}"`);P.pattern??(P.pattern=c.uuid(L))}else P.pattern??(P.pattern=c.uuid());t.$ZodStringFormat.init($,P)}),t.$ZodEmail=S.$constructor("$ZodEmail",($,P)=>{P.pattern??(P.pattern=c.email),t.$ZodStringFormat.init($,P)}),t.$ZodURL=S.$constructor("$ZodURL",($,P)=>{t.$ZodStringFormat.init($,P),$._zod.check=I=>{try{const L=I.value.trim();if(!P.normalize&&P.protocol?.source===c.httpProtocol.source&&!/^https?:\/\//i.test(L)){I.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:I.value,inst:$,continue:!P.abort});return}const F=new URL(L);P.hostname&&(P.hostname.lastIndex=0,P.hostname.test(F.hostname)||I.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:P.hostname.source,input:I.value,inst:$,continue:!P.abort})),P.protocol&&(P.protocol.lastIndex=0,P.protocol.test(F.protocol.endsWith(":")?F.protocol.slice(0,-1):F.protocol)||I.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:P.protocol.source,input:I.value,inst:$,continue:!P.abort})),P.normalize?I.value=F.href:I.value=L;return}catch{I.issues.push({code:"invalid_format",format:"url",input:I.value,inst:$,continue:!P.abort})}}}),t.$ZodEmoji=S.$constructor("$ZodEmoji",($,P)=>{P.pattern??(P.pattern=c.emoji()),t.$ZodStringFormat.init($,P)}),t.$ZodNanoID=S.$constructor("$ZodNanoID",($,P)=>{P.pattern??(P.pattern=c.nanoid),t.$ZodStringFormat.init($,P)}),t.$ZodCUID=S.$constructor("$ZodCUID",($,P)=>{P.pattern??(P.pattern=c.cuid),t.$ZodStringFormat.init($,P)}),t.$ZodCUID2=S.$constructor("$ZodCUID2",($,P)=>{P.pattern??(P.pattern=c.cuid2),t.$ZodStringFormat.init($,P)}),t.$ZodULID=S.$constructor("$ZodULID",($,P)=>{P.pattern??(P.pattern=c.ulid),t.$ZodStringFormat.init($,P)}),t.$ZodXID=S.$constructor("$ZodXID",($,P)=>{P.pattern??(P.pattern=c.xid),t.$ZodStringFormat.init($,P)}),t.$ZodKSUID=S.$constructor("$ZodKSUID",($,P)=>{P.pattern??(P.pattern=c.ksuid),t.$ZodStringFormat.init($,P)}),t.$ZodISODateTime=S.$constructor("$ZodISODateTime",($,P)=>{P.pattern??(P.pattern=c.datetime(P)),t.$ZodStringFormat.init($,P)}),t.$ZodISODate=S.$constructor("$ZodISODate",($,P)=>{P.pattern??(P.pattern=c.date),t.$ZodStringFormat.init($,P)}),t.$ZodISOTime=S.$constructor("$ZodISOTime",($,P)=>{P.pattern??(P.pattern=c.time(P)),t.$ZodStringFormat.init($,P)}),t.$ZodISODuration=S.$constructor("$ZodISODuration",($,P)=>{P.pattern??(P.pattern=c.duration),t.$ZodStringFormat.init($,P)}),t.$ZodIPv4=S.$constructor("$ZodIPv4",($,P)=>{P.pattern??(P.pattern=c.ipv4),t.$ZodStringFormat.init($,P),$._zod.bag.format="ipv4"}),t.$ZodIPv6=S.$constructor("$ZodIPv6",($,P)=>{P.pattern??(P.pattern=c.ipv6),t.$ZodStringFormat.init($,P),$._zod.bag.format="ipv6",$._zod.check=I=>{try{new URL(`http://[${I.value}]`)}catch{I.issues.push({code:"invalid_format",format:"ipv6",input:I.value,inst:$,continue:!P.abort})}}}),t.$ZodMAC=S.$constructor("$ZodMAC",($,P)=>{P.pattern??(P.pattern=c.mac(P.delimiter)),t.$ZodStringFormat.init($,P),$._zod.bag.format="mac"}),t.$ZodCIDRv4=S.$constructor("$ZodCIDRv4",($,P)=>{P.pattern??(P.pattern=c.cidrv4),t.$ZodStringFormat.init($,P)}),t.$ZodCIDRv6=S.$constructor("$ZodCIDRv6",($,P)=>{P.pattern??(P.pattern=c.cidrv6),t.$ZodStringFormat.init($,P),$._zod.check=I=>{const L=I.value.split("/");try{if(L.length!==2)throw new Error;const[F,W]=L;if(!W)throw new Error;const ne=Number(W);if(`${ne}`!==W)throw new Error;if(ne<0||ne>128)throw new Error;new URL(`http://[${F}]`)}catch{I.issues.push({code:"invalid_format",format:"cidrv6",input:I.value,inst:$,continue:!P.abort})}}});function n($){if($==="")return!0;if(/\s/.test($)||$.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}t.$ZodBase64=S.$constructor("$ZodBase64",($,P)=>{P.pattern??(P.pattern=c.base64),t.$ZodStringFormat.init($,P),$._zod.bag.contentEncoding="base64",$._zod.check=I=>{n(I.value)||I.issues.push({code:"invalid_format",format:"base64",input:I.value,inst:$,continue:!P.abort})}});function r($){if(!c.base64url.test($))return!1;const P=$.replace(/[-_]/g,L=>L==="-"?"+":"/"),I=P.padEnd(Math.ceil(P.length/4)*4,"=");return n(I)}t.$ZodBase64URL=S.$constructor("$ZodBase64URL",($,P)=>{P.pattern??(P.pattern=c.base64url),t.$ZodStringFormat.init($,P),$._zod.bag.contentEncoding="base64url",$._zod.check=I=>{r(I.value)||I.issues.push({code:"invalid_format",format:"base64url",input:I.value,inst:$,continue:!P.abort})}}),t.$ZodE164=S.$constructor("$ZodE164",($,P)=>{P.pattern??(P.pattern=c.e164),t.$ZodStringFormat.init($,P)});function _($,P=null){try{const I=$.split(".");if(I.length!==3)return!1;const[L]=I;if(!L)return!1;const F=JSON.parse(atob(L));return!("typ"in F&&F?.typ!=="JWT"||!F.alg||P&&(!("alg"in F)||F.alg!==P))}catch{return!1}}t.$ZodJWT=S.$constructor("$ZodJWT",($,P)=>{t.$ZodStringFormat.init($,P),$._zod.check=I=>{_(I.value,P.alg)||I.issues.push({code:"invalid_format",format:"jwt",input:I.value,inst:$,continue:!P.abort})}}),t.$ZodCustomStringFormat=S.$constructor("$ZodCustomStringFormat",($,P)=>{t.$ZodStringFormat.init($,P),$._zod.check=I=>{P.fn(I.value)||I.issues.push({code:"invalid_format",format:P.format,input:I.value,inst:$,continue:!P.abort})}}),t.$ZodNumber=S.$constructor("$ZodNumber",($,P)=>{t.$ZodType.init($,P),$._zod.pattern=$._zod.bag.pattern??c.number,$._zod.parse=(I,L)=>{if(P.coerce)try{I.value=Number(I.value)}catch{}const F=I.value;if(typeof F=="number"&&!Number.isNaN(F)&&Number.isFinite(F))return I;const W=typeof F=="number"?Number.isNaN(F)?"NaN":Number.isFinite(F)?void 0:"Infinity":void 0;return I.issues.push({expected:"number",code:"invalid_type",input:F,inst:$,...W?{received:W}:{}}),I}}),t.$ZodNumberFormat=S.$constructor("$ZodNumberFormat",($,P)=>{x.$ZodCheckNumberFormat.init($,P),t.$ZodNumber.init($,P)}),t.$ZodBoolean=S.$constructor("$ZodBoolean",($,P)=>{t.$ZodType.init($,P),$._zod.pattern=c.boolean,$._zod.parse=(I,L)=>{if(P.coerce)try{I.value=!!I.value}catch{}const F=I.value;return typeof F=="boolean"||I.issues.push({expected:"boolean",code:"invalid_type",input:F,inst:$}),I}}),t.$ZodBigInt=S.$constructor("$ZodBigInt",($,P)=>{t.$ZodType.init($,P),$._zod.pattern=c.bigint,$._zod.parse=(I,L)=>{if(P.coerce)try{I.value=BigInt(I.value)}catch{}return typeof I.value=="bigint"||I.issues.push({expected:"bigint",code:"invalid_type",input:I.value,inst:$}),I}}),t.$ZodBigIntFormat=S.$constructor("$ZodBigIntFormat",($,P)=>{x.$ZodCheckBigIntFormat.init($,P),t.$ZodBigInt.init($,P)}),t.$ZodSymbol=S.$constructor("$ZodSymbol",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>{const F=I.value;return typeof F=="symbol"||I.issues.push({expected:"symbol",code:"invalid_type",input:F,inst:$}),I}}),t.$ZodUndefined=S.$constructor("$ZodUndefined",($,P)=>{t.$ZodType.init($,P),$._zod.pattern=c.undefined,$._zod.values=new Set([void 0]),$._zod.parse=(I,L)=>{const F=I.value;return typeof F>"u"||I.issues.push({expected:"undefined",code:"invalid_type",input:F,inst:$}),I}}),t.$ZodNull=S.$constructor("$ZodNull",($,P)=>{t.$ZodType.init($,P),$._zod.pattern=c.null,$._zod.values=new Set([null]),$._zod.parse=(I,L)=>{const F=I.value;return F===null||I.issues.push({expected:"null",code:"invalid_type",input:F,inst:$}),I}}),t.$ZodAny=S.$constructor("$ZodAny",($,P)=>{t.$ZodType.init($,P),$._zod.parse=I=>I}),t.$ZodUnknown=S.$constructor("$ZodUnknown",($,P)=>{t.$ZodType.init($,P),$._zod.parse=I=>I}),t.$ZodNever=S.$constructor("$ZodNever",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>(I.issues.push({expected:"never",code:"invalid_type",input:I.value,inst:$}),I)}),t.$ZodVoid=S.$constructor("$ZodVoid",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>{const F=I.value;return typeof F>"u"||I.issues.push({expected:"void",code:"invalid_type",input:F,inst:$}),I}}),t.$ZodDate=S.$constructor("$ZodDate",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>{if(P.coerce)try{I.value=new Date(I.value)}catch{}const F=I.value,W=F instanceof Date;return W&&!Number.isNaN(F.getTime())||I.issues.push({expected:"date",code:"invalid_type",input:F,...W?{received:"Invalid Date"}:{},inst:$}),I}});function M($,P,I){$.issues.length&&P.issues.push(...s.prefixIssues(I,$.issues)),P.value[I]=$.value}t.$ZodArray=S.$constructor("$ZodArray",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>{const F=I.value;if(!Array.isArray(F))return I.issues.push({expected:"array",code:"invalid_type",input:F,inst:$}),I;I.value=Array(F.length);const W=[];for(let ne=0;ne<F.length;ne++){const me=F[ne],H=P.element._zod.run({value:me,issues:[]},L);H instanceof Promise?W.push(H.then(q=>M(q,I,ne))):M(H,I,ne)}return W.length?Promise.all(W).then(()=>I):I}});function ee($,P,I,L,F,W){const ne=I in L;if($.issues.length){if(F&&W&&!ne)return;P.issues.push(...s.prefixIssues(I,$.issues))}if(!ne&&!F){$.issues.length||P.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[I]});return}$.value===void 0?ne&&(P.value[I]=void 0):P.value[I]=$.value}function X($){const P=Object.keys($.shape);for(const L of P)if(!$.shape?.[L]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${L}": expected a Zod schema`);const I=s.optionalKeys($.shape);return{...$,keys:P,keySet:new Set(P),numKeys:P.length,optionalKeys:new Set(I)}}function ie($,P,I,L,F,W){const ne=[],me=F.keySet,H=F.catchall._zod,q=H.def.type,oe=H.optin==="optional",fe=H.optout==="optional";for(const J in P){if(J==="__proto__"||me.has(J))continue;if(q==="never"){ne.push(J);continue}const le=H.run({value:P[J],issues:[]},L);le instanceof Promise?$.push(le.then(_e=>ee(_e,I,J,P,oe,fe))):ee(le,I,J,P,oe,fe)}return ne.length&&I.issues.push({code:"unrecognized_keys",keys:ne,input:P,inst:W}),$.length?Promise.all($).then(()=>I):I}t.$ZodObject=S.$constructor("$ZodObject",($,P)=>{if(t.$ZodType.init($,P),!Object.getOwnPropertyDescriptor(P,"shape")?.get){const me=P.shape;Object.defineProperty(P,"shape",{get:()=>{const H={...me};return Object.defineProperty(P,"shape",{value:H}),H}})}const L=s.cached(()=>X(P));s.defineLazy($._zod,"propValues",()=>{const me=P.shape,H={};for(const q in me){const oe=me[q]._zod;if(oe.values){H[q]??(H[q]=new Set);for(const fe of oe.values)H[q].add(fe)}}return H});const F=s.isObject,W=P.catchall;let ne;$._zod.parse=(me,H)=>{ne??(ne=L.value);const q=me.value;if(!F(q))return me.issues.push({expected:"object",code:"invalid_type",input:q,inst:$}),me;me.value={};const oe=[],fe=ne.shape;for(const J of ne.keys){const le=fe[J],_e=le._zod.optin==="optional",it=le._zod.optout==="optional",We=le._zod.run({value:q[J],issues:[]},H);We instanceof Promise?oe.push(We.then(Ye=>ee(Ye,me,J,q,_e,it))):ee(We,me,J,q,_e,it)}return W?ie(oe,q,me,H,L.value,$):oe.length?Promise.all(oe).then(()=>me):me}}),t.$ZodObjectJIT=S.$constructor("$ZodObjectJIT",($,P)=>{t.$ZodObject.init($,P);const I=$._zod.parse,L=s.cached(()=>X(P)),F=J=>{const le=new z.Doc(["shape","payload","ctx"]),_e=L.value,it=yt=>{const Ze=s.esc(yt);return`shape[${Ze}]._zod.run({ value: input[${Ze}], issues: [] }, ctx)`};le.write("const input = payload.value;");const We=Object.create(null);let Ye=0;for(const yt of _e.keys)We[yt]=`key_${Ye++}`;le.write("const newResult = {};");for(const yt of _e.keys){const Ze=We[yt],gt=s.esc(yt),Lr=J[yt],en=Lr?._zod?.optin==="optional",Cr=Lr?._zod?.optout==="optional";le.write(`const ${Ze} = ${it(yt)};`),en&&Cr?le.write(`
34
- if (${Ze}.issues.length) {
35
- if (${gt} in input) {
36
- payload.issues = payload.issues.concat(${Ze}.issues.map(iss => ({
37
- ...iss,
38
- path: iss.path ? [${gt}, ...iss.path] : [${gt}]
39
- })));
40
- }
41
- }
42
-
43
- if (${Ze}.value === undefined) {
44
- if (${gt} in input) {
45
- newResult[${gt}] = undefined;
46
- }
47
- } else {
48
- newResult[${gt}] = ${Ze}.value;
49
- }
50
-
51
- `):en?le.write(`
52
- if (${Ze}.issues.length) {
53
- payload.issues = payload.issues.concat(${Ze}.issues.map(iss => ({
54
- ...iss,
55
- path: iss.path ? [${gt}, ...iss.path] : [${gt}]
56
- })));
57
- }
58
-
59
- if (${Ze}.value === undefined) {
60
- if (${gt} in input) {
61
- newResult[${gt}] = undefined;
62
- }
63
- } else {
64
- newResult[${gt}] = ${Ze}.value;
65
- }
66
-
67
- `):le.write(`
68
- const ${Ze}_present = ${gt} in input;
69
- if (${Ze}.issues.length) {
70
- payload.issues = payload.issues.concat(${Ze}.issues.map(iss => ({
71
- ...iss,
72
- path: iss.path ? [${gt}, ...iss.path] : [${gt}]
73
- })));
74
- }
75
- if (!${Ze}_present && !${Ze}.issues.length) {
76
- payload.issues.push({
77
- code: "invalid_type",
78
- expected: "nonoptional",
79
- input: undefined,
80
- path: [${gt}]
81
- });
82
- }
83
-
84
- if (${Ze}_present) {
85
- if (${Ze}.value === undefined) {
86
- newResult[${gt}] = undefined;
87
- } else {
88
- newResult[${gt}] = ${Ze}.value;
89
- }
90
- }
91
-
92
- `)}le.write("payload.value = newResult;"),le.write("return payload;");const at=le.compile();return(yt,Ze)=>at(J,yt,Ze)};let W;const ne=s.isObject,me=!S.globalConfig.jitless,H=s.allowsEval,q=me&&H.value,oe=P.catchall;let fe;$._zod.parse=(J,le)=>{fe??(fe=L.value);const _e=J.value;return ne(_e)?me&&q&&le?.async===!1&&le.jitless!==!0?(W||(W=F(P.shape)),J=W(J,le),oe?ie([],_e,J,le,fe,$):J):I(J,le):(J.issues.push({expected:"object",code:"invalid_type",input:_e,inst:$}),J)}});function Q($,P,I,L){for(const W of $)if(W.issues.length===0)return P.value=W.value,P;const F=$.filter(W=>!s.aborted(W));return F.length===1?(P.value=F[0].value,F[0]):(P.issues.push({code:"invalid_union",input:P.value,inst:I,errors:$.map(W=>W.issues.map(ne=>s.finalizeIssue(ne,L,S.config())))}),P)}t.$ZodUnion=S.$constructor("$ZodUnion",($,P)=>{t.$ZodType.init($,P),s.defineLazy($._zod,"optin",()=>P.options.some(L=>L._zod.optin==="optional")?"optional":void 0),s.defineLazy($._zod,"optout",()=>P.options.some(L=>L._zod.optout==="optional")?"optional":void 0),s.defineLazy($._zod,"values",()=>{if(P.options.every(L=>L._zod.values))return new Set(P.options.flatMap(L=>Array.from(L._zod.values)))}),s.defineLazy($._zod,"pattern",()=>{if(P.options.every(L=>L._zod.pattern)){const L=P.options.map(F=>F._zod.pattern);return new RegExp(`^(${L.map(F=>s.cleanRegex(F.source)).join("|")})$`)}});const I=P.options.length===1?P.options[0]._zod.run:null;$._zod.parse=(L,F)=>{if(I)return I(L,F);let W=!1;const ne=[];for(const me of P.options){const H=me._zod.run({value:L.value,issues:[]},F);if(H instanceof Promise)ne.push(H),W=!0;else{if(H.issues.length===0)return H;ne.push(H)}}return W?Promise.all(ne).then(me=>Q(me,L,$,F)):Q(ne,L,$,F)}});function ge($,P,I,L){const F=$.filter(W=>W.issues.length===0);return F.length===1?(P.value=F[0].value,P):(F.length===0?P.issues.push({code:"invalid_union",input:P.value,inst:I,errors:$.map(W=>W.issues.map(ne=>s.finalizeIssue(ne,L,S.config())))}):P.issues.push({code:"invalid_union",input:P.value,inst:I,errors:[],inclusive:!1}),P)}t.$ZodXor=S.$constructor("$ZodXor",($,P)=>{t.$ZodUnion.init($,P),P.inclusive=!1;const I=P.options.length===1?P.options[0]._zod.run:null;$._zod.parse=(L,F)=>{if(I)return I(L,F);let W=!1;const ne=[];for(const me of P.options){const H=me._zod.run({value:L.value,issues:[]},F);H instanceof Promise?(ne.push(H),W=!0):ne.push(H)}return W?Promise.all(ne).then(me=>ge(me,L,$,F)):ge(ne,L,$,F)}}),t.$ZodDiscriminatedUnion=S.$constructor("$ZodDiscriminatedUnion",($,P)=>{P.inclusive=!1,t.$ZodUnion.init($,P);const I=$._zod.parse;s.defineLazy($._zod,"propValues",()=>{const F={};for(const W of P.options){const ne=W._zod.propValues;if(!ne||Object.keys(ne).length===0)throw new Error(`Invalid discriminated union option at index "${P.options.indexOf(W)}"`);for(const[me,H]of Object.entries(ne)){F[me]||(F[me]=new Set);for(const q of H)F[me].add(q)}}return F});const L=s.cached(()=>{const F=P.options,W=new Map;for(const ne of F){const me=ne._zod.propValues?.[P.discriminator];if(!me||me.size===0)throw new Error(`Invalid discriminated union option at index "${P.options.indexOf(ne)}"`);for(const H of me){if(W.has(H))throw new Error(`Duplicate discriminator value "${String(H)}"`);W.set(H,ne)}}return W});$._zod.parse=(F,W)=>{const ne=F.value;if(!s.isObject(ne))return F.issues.push({code:"invalid_type",expected:"object",input:ne,inst:$}),F;const me=L.value.get(ne?.[P.discriminator]);return me?me._zod.run(F,W):P.unionFallback||W.direction==="backward"?I(F,W):(F.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:P.discriminator,options:Array.from(L.value.keys()),input:ne,path:[P.discriminator],inst:$}),F)}}),t.$ZodIntersection=S.$constructor("$ZodIntersection",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>{const F=I.value,W=P.left._zod.run({value:F,issues:[]},L),ne=P.right._zod.run({value:F,issues:[]},L);return W instanceof Promise||ne instanceof Promise?Promise.all([W,ne]).then(([H,q])=>he(I,H,q)):he(I,W,ne)}});function xe($,P){if($===P)return{valid:!0,data:$};if($ instanceof Date&&P instanceof Date&&+$==+P)return{valid:!0,data:$};if(s.isPlainObject($)&&s.isPlainObject(P)){const I=Object.keys(P),L=Object.keys($).filter(W=>I.indexOf(W)!==-1),F={...$,...P};for(const W of L){const ne=xe($[W],P[W]);if(!ne.valid)return{valid:!1,mergeErrorPath:[W,...ne.mergeErrorPath]};F[W]=ne.data}return{valid:!0,data:F}}if(Array.isArray($)&&Array.isArray(P)){if($.length!==P.length)return{valid:!1,mergeErrorPath:[]};const I=[];for(let L=0;L<$.length;L++){const F=$[L],W=P[L],ne=xe(F,W);if(!ne.valid)return{valid:!1,mergeErrorPath:[L,...ne.mergeErrorPath]};I.push(ne.data)}return{valid:!0,data:I}}return{valid:!1,mergeErrorPath:[]}}function he($,P,I){const L=new Map;let F;for(const me of P.issues)if(me.code==="unrecognized_keys"){F??(F=me);for(const H of me.keys)L.has(H)||L.set(H,{}),L.get(H).l=!0}else $.issues.push(me);for(const me of I.issues)if(me.code==="unrecognized_keys")for(const H of me.keys)L.has(H)||L.set(H,{}),L.get(H).r=!0;else $.issues.push(me);const W=[...L].filter(([,me])=>me.l&&me.r).map(([me])=>me);if(W.length&&F&&$.issues.push({...F,keys:W}),s.aborted($))return $;const ne=xe(P.value,I.value);if(!ne.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(ne.mergeErrorPath)}`);return $.value=ne.data,$}t.$ZodTuple=S.$constructor("$ZodTuple",($,P)=>{t.$ZodType.init($,P);const I=P.items;$._zod.parse=(L,F)=>{const W=L.value;if(!Array.isArray(W))return L.issues.push({input:W,inst:$,expected:"tuple",code:"invalid_type"}),L;L.value=[];const ne=[],me=be(I,"optin"),H=be(I,"optout");if(!P.rest){if(W.length<me)return L.issues.push({code:"too_small",minimum:me,inclusive:!0,input:W,inst:$,origin:"array"}),L;W.length>I.length&&L.issues.push({code:"too_big",maximum:I.length,inclusive:!0,input:W,inst:$,origin:"array"})}const q=new Array(I.length);for(let oe=0;oe<I.length;oe++){const fe=I[oe]._zod.run({value:W[oe],issues:[]},F);fe instanceof Promise?ne.push(fe.then(J=>{q[oe]=J})):q[oe]=fe}if(P.rest){let oe=I.length-1;const fe=W.slice(I.length);for(const J of fe){oe++;const le=P.rest._zod.run({value:J,issues:[]},F);le instanceof Promise?ne.push(le.then(_e=>Te(_e,L,oe))):Te(le,L,oe)}}return ne.length?Promise.all(ne).then(()=>Me(q,L,I,W,H)):Me(q,L,I,W,H)}});function be($,P){for(let I=$.length-1;I>=0;I--)if($[I]._zod[P]!=="optional")return I+1;return 0}function Te($,P,I){$.issues.length&&P.issues.push(...s.prefixIssues(I,$.issues)),P.value[I]=$.value}function Me($,P,I,L,F){for(let W=0;W<I.length;W++){const ne=$[W],me=W<L.length;if(ne.issues.length){if(!me&&W>=F){P.value.length=W;break}P.issues.push(...s.prefixIssues(W,ne.issues))}P.value[W]=ne.value}for(let W=P.value.length-1;W>=L.length&&(I[W]._zod.optout==="optional"&&P.value[W]===void 0);W--)P.value.length=W;return P}t.$ZodRecord=S.$constructor("$ZodRecord",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>{const F=I.value;if(!s.isPlainObject(F))return I.issues.push({expected:"record",code:"invalid_type",input:F,inst:$}),I;const W=[],ne=P.keyType._zod.values;if(ne){I.value={};const me=new Set;for(const q of ne)if(typeof q=="string"||typeof q=="number"||typeof q=="symbol"){me.add(typeof q=="number"?q.toString():q);const oe=P.keyType._zod.run({value:q,issues:[]},L);if(oe instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(oe.issues.length){I.issues.push({code:"invalid_key",origin:"record",issues:oe.issues.map(le=>s.finalizeIssue(le,L,S.config())),input:q,path:[q],inst:$});continue}const fe=oe.value,J=P.valueType._zod.run({value:F[q],issues:[]},L);J instanceof Promise?W.push(J.then(le=>{le.issues.length&&I.issues.push(...s.prefixIssues(q,le.issues)),I.value[fe]=le.value})):(J.issues.length&&I.issues.push(...s.prefixIssues(q,J.issues)),I.value[fe]=J.value)}let H;for(const q in F)me.has(q)||(H=H??[],H.push(q));H&&H.length>0&&I.issues.push({code:"unrecognized_keys",input:F,inst:$,keys:H})}else{I.value={};for(const me of Reflect.ownKeys(F)){if(me==="__proto__"||!Object.prototype.propertyIsEnumerable.call(F,me))continue;let H=P.keyType._zod.run({value:me,issues:[]},L);if(H instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof me=="string"&&c.number.test(me)&&H.issues.length){const fe=P.keyType._zod.run({value:Number(me),issues:[]},L);if(fe instanceof Promise)throw new Error("Async schemas not supported in object keys currently");fe.issues.length===0&&(H=fe)}if(H.issues.length){P.mode==="loose"?I.value[me]=F[me]:I.issues.push({code:"invalid_key",origin:"record",issues:H.issues.map(fe=>s.finalizeIssue(fe,L,S.config())),input:me,path:[me],inst:$});continue}const oe=P.valueType._zod.run({value:F[me],issues:[]},L);oe instanceof Promise?W.push(oe.then(fe=>{fe.issues.length&&I.issues.push(...s.prefixIssues(me,fe.issues)),I.value[H.value]=fe.value})):(oe.issues.length&&I.issues.push(...s.prefixIssues(me,oe.issues)),I.value[H.value]=oe.value)}}return W.length?Promise.all(W).then(()=>I):I}}),t.$ZodMap=S.$constructor("$ZodMap",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>{const F=I.value;if(!(F instanceof Map))return I.issues.push({expected:"map",code:"invalid_type",input:F,inst:$}),I;const W=[];I.value=new Map;for(const[ne,me]of F){const H=P.keyType._zod.run({value:ne,issues:[]},L),q=P.valueType._zod.run({value:me,issues:[]},L);H instanceof Promise||q instanceof Promise?W.push(Promise.all([H,q]).then(([oe,fe])=>{nt(oe,fe,I,ne,F,$,L)})):nt(H,q,I,ne,F,$,L)}return W.length?Promise.all(W).then(()=>I):I}});function nt($,P,I,L,F,W,ne){$.issues.length&&(s.propertyKeyTypes.has(typeof L)?I.issues.push(...s.prefixIssues(L,$.issues)):I.issues.push({code:"invalid_key",origin:"map",input:F,inst:W,issues:$.issues.map(me=>s.finalizeIssue(me,ne,S.config()))})),P.issues.length&&(s.propertyKeyTypes.has(typeof L)?I.issues.push(...s.prefixIssues(L,P.issues)):I.issues.push({origin:"map",code:"invalid_element",input:F,inst:W,key:L,issues:P.issues.map(me=>s.finalizeIssue(me,ne,S.config()))})),I.value.set($.value,P.value)}t.$ZodSet=S.$constructor("$ZodSet",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>{const F=I.value;if(!(F instanceof Set))return I.issues.push({input:F,inst:$,expected:"set",code:"invalid_type"}),I;const W=[];I.value=new Set;for(const ne of F){const me=P.valueType._zod.run({value:ne,issues:[]},L);me instanceof Promise?W.push(me.then(H=>ht(H,I))):ht(me,I)}return W.length?Promise.all(W).then(()=>I):I}});function ht($,P){$.issues.length&&P.issues.push(...$.issues),P.value.add($.value)}t.$ZodEnum=S.$constructor("$ZodEnum",($,P)=>{t.$ZodType.init($,P);const I=s.getEnumValues(P.entries),L=new Set(I);$._zod.values=L,$._zod.pattern=new RegExp(`^(${I.filter(F=>s.propertyKeyTypes.has(typeof F)).map(F=>typeof F=="string"?s.escapeRegex(F):F.toString()).join("|")})$`),$._zod.parse=(F,W)=>{const ne=F.value;return L.has(ne)||F.issues.push({code:"invalid_value",values:I,input:ne,inst:$}),F}}),t.$ZodLiteral=S.$constructor("$ZodLiteral",($,P)=>{if(t.$ZodType.init($,P),P.values.length===0)throw new Error("Cannot create literal schema with no valid values");const I=new Set(P.values);$._zod.values=I,$._zod.pattern=new RegExp(`^(${P.values.map(L=>typeof L=="string"?s.escapeRegex(L):L?s.escapeRegex(L.toString()):String(L)).join("|")})$`),$._zod.parse=(L,F)=>{const W=L.value;return I.has(W)||L.issues.push({code:"invalid_value",values:P.values,input:W,inst:$}),L}}),t.$ZodFile=S.$constructor("$ZodFile",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>{const F=I.value;return F instanceof File||I.issues.push({expected:"file",code:"invalid_type",input:F,inst:$}),I}}),t.$ZodTransform=S.$constructor("$ZodTransform",($,P)=>{t.$ZodType.init($,P),$._zod.optin="optional",$._zod.parse=(I,L)=>{if(L.direction==="backward")throw new S.$ZodEncodeError($.constructor.name);const F=P.transform(I.value,I);if(L.async)return(F instanceof Promise?F:Promise.resolve(F)).then(ne=>(I.value=ne,I.fallback=!0,I));if(F instanceof Promise)throw new S.$ZodAsyncError;return I.value=F,I.fallback=!0,I}});function Ct($,P){return P===void 0&&($.issues.length||$.fallback)?{issues:[],value:void 0}:$}t.$ZodOptional=S.$constructor("$ZodOptional",($,P)=>{t.$ZodType.init($,P),$._zod.optin="optional",$._zod.optout="optional",s.defineLazy($._zod,"values",()=>P.innerType._zod.values?new Set([...P.innerType._zod.values,void 0]):void 0),s.defineLazy($._zod,"pattern",()=>{const I=P.innerType._zod.pattern;return I?new RegExp(`^(${s.cleanRegex(I.source)})?$`):void 0}),$._zod.parse=(I,L)=>{if(P.innerType._zod.optin==="optional"){const F=I.value,W=P.innerType._zod.run(I,L);return W instanceof Promise?W.then(ne=>Ct(ne,F)):Ct(W,F)}return I.value===void 0?I:P.innerType._zod.run(I,L)}}),t.$ZodExactOptional=S.$constructor("$ZodExactOptional",($,P)=>{t.$ZodOptional.init($,P),s.defineLazy($._zod,"values",()=>P.innerType._zod.values),s.defineLazy($._zod,"pattern",()=>P.innerType._zod.pattern),$._zod.parse=(I,L)=>P.innerType._zod.run(I,L)}),t.$ZodNullable=S.$constructor("$ZodNullable",($,P)=>{t.$ZodType.init($,P),s.defineLazy($._zod,"optin",()=>P.innerType._zod.optin),s.defineLazy($._zod,"optout",()=>P.innerType._zod.optout),s.defineLazy($._zod,"pattern",()=>{const I=P.innerType._zod.pattern;return I?new RegExp(`^(${s.cleanRegex(I.source)}|null)$`):void 0}),s.defineLazy($._zod,"values",()=>P.innerType._zod.values?new Set([...P.innerType._zod.values,null]):void 0),$._zod.parse=(I,L)=>I.value===null?I:P.innerType._zod.run(I,L)}),t.$ZodDefault=S.$constructor("$ZodDefault",($,P)=>{t.$ZodType.init($,P),$._zod.optin="optional",s.defineLazy($._zod,"values",()=>P.innerType._zod.values),$._zod.parse=(I,L)=>{if(L.direction==="backward")return P.innerType._zod.run(I,L);if(I.value===void 0)return I.value=P.defaultValue,I;const F=P.innerType._zod.run(I,L);return F instanceof Promise?F.then(W=>Bt(W,P)):Bt(F,P)}});function Bt($,P){return $.value===void 0&&($.value=P.defaultValue),$}t.$ZodPrefault=S.$constructor("$ZodPrefault",($,P)=>{t.$ZodType.init($,P),$._zod.optin="optional",s.defineLazy($._zod,"values",()=>P.innerType._zod.values),$._zod.parse=(I,L)=>(L.direction==="backward"||I.value===void 0&&(I.value=P.defaultValue),P.innerType._zod.run(I,L))}),t.$ZodNonOptional=S.$constructor("$ZodNonOptional",($,P)=>{t.$ZodType.init($,P),s.defineLazy($._zod,"values",()=>{const I=P.innerType._zod.values;return I?new Set([...I].filter(L=>L!==void 0)):void 0}),$._zod.parse=(I,L)=>{const F=P.innerType._zod.run(I,L);return F instanceof Promise?F.then(W=>zt(W,$)):zt(F,$)}});function zt($,P){return!$.issues.length&&$.value===void 0&&$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:P}),$}t.$ZodSuccess=S.$constructor("$ZodSuccess",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>{if(L.direction==="backward")throw new S.$ZodEncodeError("ZodSuccess");const F=P.innerType._zod.run(I,L);return F instanceof Promise?F.then(W=>(I.value=W.issues.length===0,I)):(I.value=F.issues.length===0,I)}}),t.$ZodCatch=S.$constructor("$ZodCatch",($,P)=>{t.$ZodType.init($,P),$._zod.optin="optional",s.defineLazy($._zod,"optout",()=>P.innerType._zod.optout),s.defineLazy($._zod,"values",()=>P.innerType._zod.values),$._zod.parse=(I,L)=>{if(L.direction==="backward")return P.innerType._zod.run(I,L);const F=P.innerType._zod.run(I,L);return F instanceof Promise?F.then(W=>(I.value=W.value,W.issues.length&&(I.value=P.catchValue({...I,error:{issues:W.issues.map(ne=>s.finalizeIssue(ne,L,S.config()))},input:I.value}),I.issues=[],I.fallback=!0),I)):(I.value=F.value,F.issues.length&&(I.value=P.catchValue({...I,error:{issues:F.issues.map(W=>s.finalizeIssue(W,L,S.config()))},input:I.value}),I.issues=[],I.fallback=!0),I)}}),t.$ZodNaN=S.$constructor("$ZodNaN",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>((typeof I.value!="number"||!Number.isNaN(I.value))&&I.issues.push({input:I.value,inst:$,expected:"nan",code:"invalid_type"}),I)}),t.$ZodPipe=S.$constructor("$ZodPipe",($,P)=>{t.$ZodType.init($,P),s.defineLazy($._zod,"values",()=>P.in._zod.values),s.defineLazy($._zod,"optin",()=>P.in._zod.optin),s.defineLazy($._zod,"optout",()=>P.out._zod.optout),s.defineLazy($._zod,"propValues",()=>P.in._zod.propValues),$._zod.parse=(I,L)=>{if(L.direction==="backward"){const W=P.out._zod.run(I,L);return W instanceof Promise?W.then(ne=>Dt(ne,P.in,L)):Dt(W,P.in,L)}const F=P.in._zod.run(I,L);return F instanceof Promise?F.then(W=>Dt(W,P.out,L)):Dt(F,P.out,L)}});function Dt($,P,I){return $.issues.length?($.aborted=!0,$):P._zod.run({value:$.value,issues:$.issues,fallback:$.fallback},I)}t.$ZodCodec=S.$constructor("$ZodCodec",($,P)=>{t.$ZodType.init($,P),s.defineLazy($._zod,"values",()=>P.in._zod.values),s.defineLazy($._zod,"optin",()=>P.in._zod.optin),s.defineLazy($._zod,"optout",()=>P.out._zod.optout),s.defineLazy($._zod,"propValues",()=>P.in._zod.propValues),$._zod.parse=(I,L)=>{if((L.direction||"forward")==="forward"){const W=P.in._zod.run(I,L);return W instanceof Promise?W.then(ne=>Lt(ne,P,L)):Lt(W,P,L)}else{const W=P.out._zod.run(I,L);return W instanceof Promise?W.then(ne=>Lt(ne,P,L)):Lt(W,P,L)}}});function Lt($,P,I){if($.issues.length)return $.aborted=!0,$;if((I.direction||"forward")==="forward"){const F=P.transform($.value,$);return F instanceof Promise?F.then(W=>jt($,W,P.out,I)):jt($,F,P.out,I)}else{const F=P.reverseTransform($.value,$);return F instanceof Promise?F.then(W=>jt($,W,P.in,I)):jt($,F,P.in,I)}}function jt($,P,I,L){return $.issues.length?($.aborted=!0,$):I._zod.run({value:P,issues:$.issues},L)}t.$ZodPreprocess=S.$constructor("$ZodPreprocess",($,P)=>{t.$ZodPipe.init($,P)}),t.$ZodReadonly=S.$constructor("$ZodReadonly",($,P)=>{t.$ZodType.init($,P),s.defineLazy($._zod,"propValues",()=>P.innerType._zod.propValues),s.defineLazy($._zod,"values",()=>P.innerType._zod.values),s.defineLazy($._zod,"optin",()=>P.innerType?._zod?.optin),s.defineLazy($._zod,"optout",()=>P.innerType?._zod?.optout),$._zod.parse=(I,L)=>{if(L.direction==="backward")return P.innerType._zod.run(I,L);const F=P.innerType._zod.run(I,L);return F instanceof Promise?F.then(Ft):Ft(F)}});function Ft($){return $.value=Object.freeze($.value),$}t.$ZodTemplateLiteral=S.$constructor("$ZodTemplateLiteral",($,P)=>{t.$ZodType.init($,P);const I=[];for(const L of P.parts)if(typeof L=="object"&&L!==null){if(!L._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...L._zod.traits].shift()}`);const F=L._zod.pattern instanceof RegExp?L._zod.pattern.source:L._zod.pattern;if(!F)throw new Error(`Invalid template literal part: ${L._zod.traits}`);const W=F.startsWith("^")?1:0,ne=F.endsWith("$")?F.length-1:F.length;I.push(F.slice(W,ne))}else if(L===null||s.primitiveTypes.has(typeof L))I.push(s.escapeRegex(`${L}`));else throw new Error(`Invalid template literal part: ${L}`);$._zod.pattern=new RegExp(`^${I.join("")}$`),$._zod.parse=(L,F)=>typeof L.value!="string"?(L.issues.push({input:L.value,inst:$,expected:"string",code:"invalid_type"}),L):($._zod.pattern.lastIndex=0,$._zod.pattern.test(L.value)||L.issues.push({input:L.value,inst:$,code:"invalid_format",format:P.format??"template_literal",pattern:$._zod.pattern.source}),L)}),t.$ZodFunction=S.$constructor("$ZodFunction",($,P)=>(t.$ZodType.init($,P),$._def=P,$._zod.def=P,$.implement=I=>{if(typeof I!="function")throw new Error("implement() must be called with a function");return function(...L){const F=$._def.input?(0,U.parse)($._def.input,L):L,W=Reflect.apply(I,this,F);return $._def.output?(0,U.parse)($._def.output,W):W}},$.implementAsync=I=>{if(typeof I!="function")throw new Error("implementAsync() must be called with a function");return async function(...L){const F=$._def.input?await(0,U.parseAsync)($._def.input,L):L,W=await Reflect.apply(I,this,F);return $._def.output?await(0,U.parseAsync)($._def.output,W):W}},$._zod.parse=(I,L)=>typeof I.value!="function"?(I.issues.push({code:"invalid_type",expected:"function",input:I.value,inst:$}),I):($._def.output&&$._def.output._zod.def.type==="promise"?I.value=$.implementAsync(I.value):I.value=$.implement(I.value),I),$.input=(...I)=>{const L=$.constructor;return Array.isArray(I[0])?new L({type:"function",input:new t.$ZodTuple({type:"tuple",items:I[0],rest:I[1]}),output:$._def.output}):new L({type:"function",input:I[0],output:$._def.output})},$.output=I=>{const L=$.constructor;return new L({type:"function",input:$._def.input,output:I})},$)),t.$ZodPromise=S.$constructor("$ZodPromise",($,P)=>{t.$ZodType.init($,P),$._zod.parse=(I,L)=>Promise.resolve(I.value).then(F=>P.innerType._zod.run({value:F,issues:[]},L))}),t.$ZodLazy=S.$constructor("$ZodLazy",($,P)=>{t.$ZodType.init($,P),s.defineLazy($._zod,"innerType",()=>{const I=P;return I._cachedInner||(I._cachedInner=P.getter()),I._cachedInner}),s.defineLazy($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),s.defineLazy($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),s.defineLazy($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),s.defineLazy($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(I,L)=>$._zod.innerType._zod.run(I,L)}),t.$ZodCustom=S.$constructor("$ZodCustom",($,P)=>{x.$ZodCheck.init($,P),t.$ZodType.init($,P),$._zod.parse=(I,L)=>I,$._zod.check=I=>{const L=I.value,F=P.fn(L);if(F instanceof Promise)return F.then(W=>Kt(W,I,L,$));Kt(F,I,L,$)}});function Kt($,P,I,L){if(!$){const F={code:"custom",input:I,inst:L,path:[...L._zod.def.path??[]],continue:!L._zod.def.abort};L._zod.def.params&&(F.params=L._zod.def.params),P.issues.push(s.issue(F))}}})(Pr);var Ki={},Qa={exports:{}},kn=Qa.exports;(function(t,f){var k=kn&&kn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=kn&&kn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=kn&&kn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function s(n){return c[n]??null}const u={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},g={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${n.expected}، ولكن تم إدخال ${M}`:`مدخلات غير مقبولة: يفترض إدخال ${r}، ولكن تم إدخال ${M}`}case"invalid_value":return n.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${S.stringifyPrimitive(n.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${r} ${n.maximum.toString()} ${_.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${r} ${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${r} ${n.minimum.toString()} ${_.unit}`:`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${r} ${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`:r.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${r.suffix}"`:r.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${r.includes}"`:r.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${r.pattern}`:`${u[r.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${S.joinValues(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function U(){return{localeError:z()}}t.exports=f.default})(Qa,Qa.exports);var WC=Qa.exports,Wa={exports:{}},Pn=Wa.exports;(function(t,f){var k=Pn&&Pn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Pn&&Pn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Pn&&Pn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function s(n){return c[n]??null}const u={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},g={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Yanlış dəyər: gözlənilən instanceof ${n.expected}, daxil olan ${M}`:`Yanlış dəyər: gözlənilən ${r}, daxil olan ${M}`}case"invalid_value":return n.values.length===1?`Yanlış dəyər: gözlənilən ${S.stringifyPrimitive(n.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${r}${n.maximum.toString()} ${_.unit??"element"}`:`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Çox kiçik: gözlənilən ${n.origin} ${r}${n.minimum.toString()} ${_.unit}`:`Çox kiçik: gözlənilən ${n.origin} ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Yanlış mətn: "${r.prefix}" ilə başlamalıdır`:r.format==="ends_with"?`Yanlış mətn: "${r.suffix}" ilə bitməlidir`:r.format==="includes"?`Yanlış mətn: "${r.includes}" daxil olmalıdır`:r.format==="regex"?`Yanlış mətn: ${r.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${u[r.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function U(){return{localeError:z()}}t.exports=f.default})(Wa,Wa.exports);var qC=Wa.exports,qa={exports:{}},Nn=qa.exports;(function(t,f){var k=Nn&&Nn.__createBinding||(Object.create?(function(s,u,g,n){n===void 0&&(n=g);var r=Object.getOwnPropertyDescriptor(u,g);(!r||("get"in r?!u.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return u[g]}}),Object.defineProperty(s,n,r)}):(function(s,u,g,n){n===void 0&&(n=g),s[n]=u[g]})),C=Nn&&Nn.__setModuleDefault||(Object.create?(function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}):function(s,u){s.default=u}),x=Nn&&Nn.__importStar||function(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var g in s)g!=="default"&&Object.prototype.hasOwnProperty.call(s,g)&&k(u,s,g);return C(u,s),u};Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;const S=x(ae);function z(s,u,g,n){const r=Math.abs(s),_=r%10,M=r%100;return M>=11&&M<=19?n:_===1?u:_>=2&&_<=4?g:n}const U=()=>{const s={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function u(r){return s[r]??null}const g={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},n={nan:"NaN",number:"лік",array:"масіў"};return r=>{switch(r.code){case"invalid_type":{const _=n[r.expected]??r.expected,M=S.parsedType(r.input),ee=n[M]??M;return/^[A-Z]/.test(r.expected)?`Няправільны ўвод: чакаўся instanceof ${r.expected}, атрымана ${ee}`:`Няправільны ўвод: чакаўся ${_}, атрымана ${ee}`}case"invalid_value":return r.values.length===1?`Няправільны ўвод: чакалася ${S.stringifyPrimitive(r.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${S.joinValues(r.values,"|")}`;case"too_big":{const _=r.inclusive?"<=":"<",M=u(r.origin);if(M){const ee=Number(r.maximum),X=z(ee,M.unit.one,M.unit.few,M.unit.many);return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна ${M.verb} ${_}${r.maximum.toString()} ${X}`}return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна быць ${_}${r.maximum.toString()}`}case"too_small":{const _=r.inclusive?">=":">",M=u(r.origin);if(M){const ee=Number(r.minimum),X=z(ee,M.unit.one,M.unit.few,M.unit.many);return`Занадта малы: чакалася, што ${r.origin} павінна ${M.verb} ${_}${r.minimum.toString()} ${X}`}return`Занадта малы: чакалася, што ${r.origin} павінна быць ${_}${r.minimum.toString()}`}case"invalid_format":{const _=r;return _.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${_.prefix}"`:_.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${_.suffix}"`:_.format==="includes"?`Няправільны радок: павінен змяшчаць "${_.includes}"`:_.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${_.pattern}`:`Няправільны ${g[_.format]??r.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${r.keys.length>1?"ключы":"ключ"}: ${S.joinValues(r.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${r.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${r.origin}`;default:return"Няправільны ўвод"}}};function c(){return{localeError:U()}}t.exports=f.default})(qa,qa.exports);var HC=qa.exports,Ha={exports:{}},On=Ha.exports;(function(t,f){var k=On&&On.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=On&&On.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=On&&On.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function s(n){return c[n]??null}const u={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},g={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Невалиден вход: очакван instanceof ${n.expected}, получен ${M}`:`Невалиден вход: очакван ${r}, получен ${M}`}case"invalid_value":return n.values.length===1?`Невалиден вход: очакван ${S.stringifyPrimitive(n.values[0])}`:`Невалидна опция: очаквано едно от ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Твърде голямо: очаква се ${n.origin??"стойност"} да съдържа ${r}${n.maximum.toString()} ${_.unit??"елемента"}`:`Твърде голямо: очаква се ${n.origin??"стойност"} да бъде ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Твърде малко: очаква се ${n.origin} да съдържа ${r}${n.minimum.toString()} ${_.unit}`:`Твърде малко: очаква се ${n.origin} да бъде ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;if(r.format==="starts_with")return`Невалиден низ: трябва да започва с "${r.prefix}"`;if(r.format==="ends_with")return`Невалиден низ: трябва да завършва с "${r.suffix}"`;if(r.format==="includes")return`Невалиден низ: трябва да включва "${r.includes}"`;if(r.format==="regex")return`Невалиден низ: трябва да съвпада с ${r.pattern}`;let _="Невалиден";return r.format==="emoji"&&(_="Невалидно"),r.format==="datetime"&&(_="Невалидно"),r.format==="date"&&(_="Невалидна"),r.format==="time"&&(_="Невалидно"),r.format==="duration"&&(_="Невалидна"),`${_} ${u[r.format]??n.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${n.divisor}`;case"unrecognized_keys":return`Неразпознат${n.keys.length>1?"и":""} ключ${n.keys.length>1?"ове":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${n.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${n.origin}`;default:return"Невалиден вход"}}};function U(){return{localeError:z()}}t.exports=f.default})(Ha,Ha.exports);var JC=Ha.exports,Ja={exports:{}},Cn=Ja.exports;(function(t,f){var k=Cn&&Cn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Cn&&Cn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Cn&&Cn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function s(n){return c[n]??null}const u={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},g={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Tipus invàlid: s'esperava instanceof ${n.expected}, s'ha rebut ${M}`:`Tipus invàlid: s'esperava ${r}, s'ha rebut ${M}`}case"invalid_value":return n.values.length===1?`Valor invàlid: s'esperava ${S.stringifyPrimitive(n.values[0])}`:`Opció invàlida: s'esperava una de ${S.joinValues(n.values," o ")}`;case"too_big":{const r=n.inclusive?"com a màxim":"menys de",_=s(n.origin);return _?`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${r} ${n.maximum.toString()} ${_.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${r} ${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?"com a mínim":"més de",_=s(n.origin);return _?`Massa petit: s'esperava que ${n.origin} contingués ${r} ${n.minimum.toString()} ${_.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${r} ${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Format invàlid: ha de començar amb "${r.prefix}"`:r.format==="ends_with"?`Format invàlid: ha d'acabar amb "${r.suffix}"`:r.format==="includes"?`Format invàlid: ha d'incloure "${r.includes}"`:r.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${r.pattern}`:`Format invàlid per a ${u[r.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function U(){return{localeError:z()}}t.exports=f.default})(Ja,Ja.exports);var KC=Ja.exports,Ka={exports:{}},In=Ka.exports;(function(t,f){var k=In&&In.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=In&&In.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=In&&In.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function s(n){return c[n]??null}const u={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},g={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Neplatný vstup: očekáváno instanceof ${n.expected}, obdrženo ${M}`:`Neplatný vstup: očekáváno ${r}, obdrženo ${M}`}case"invalid_value":return n.values.length===1?`Neplatný vstup: očekáváno ${S.stringifyPrimitive(n.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${r}${n.maximum.toString()} ${_.unit??"prvků"}`:`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${r}${n.minimum.toString()} ${_.unit??"prvků"}`:`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Neplatný řetězec: musí začínat na "${r.prefix}"`:r.format==="ends_with"?`Neplatný řetězec: musí končit na "${r.suffix}"`:r.format==="includes"?`Neplatný řetězec: musí obsahovat "${r.includes}"`:r.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${r.pattern}`:`Neplatný formát ${u[r.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function U(){return{localeError:z()}}t.exports=f.default})(Ka,Ka.exports);var XC=Ka.exports,Xa={exports:{}},En=Xa.exports;(function(t,f){var k=En&&En.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=En&&En.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=En&&En.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function s(n){return c[n]??null}const u={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},g={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${M}`:`Ugyldigt input: forventede ${r}, fik ${M}`}case"invalid_value":return n.values.length===1?`Ugyldig værdi: forventede ${S.stringifyPrimitive(n.values[0])}`:`Ugyldigt valg: forventede en af følgende ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin),M=g[n.origin]??n.origin;return _?`For stor: forventede ${M??"value"} ${_.verb} ${r} ${n.maximum.toString()} ${_.unit??"elementer"}`:`For stor: forventede ${M??"value"} havde ${r} ${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin),M=g[n.origin]??n.origin;return _?`For lille: forventede ${M} ${_.verb} ${r} ${n.minimum.toString()} ${_.unit}`:`For lille: forventede ${M} havde ${r} ${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ugyldig streng: skal starte med "${r.prefix}"`:r.format==="ends_with"?`Ugyldig streng: skal ende med "${r.suffix}"`:r.format==="includes"?`Ugyldig streng: skal indeholde "${r.includes}"`:r.format==="regex"?`Ugyldig streng: skal matche mønsteret ${r.pattern}`:`Ugyldig ${u[r.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${n.origin}`;default:return"Ugyldigt input"}}};function U(){return{localeError:z()}}t.exports=f.default})(Xa,Xa.exports);var YC=Xa.exports,Ya={exports:{}},Mn=Ya.exports;(function(t,f){var k=Mn&&Mn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Mn&&Mn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Mn&&Mn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function s(n){return c[n]??null}const u={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},g={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Ungültige Eingabe: erwartet instanceof ${n.expected}, erhalten ${M}`:`Ungültige Eingabe: erwartet ${r}, erhalten ${M}`}case"invalid_value":return n.values.length===1?`Ungültige Eingabe: erwartet ${S.stringifyPrimitive(n.values[0])}`:`Ungültige Option: erwartet eine von ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Zu groß: erwartet, dass ${n.origin??"Wert"} ${r}${n.maximum.toString()} ${_.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${n.origin??"Wert"} ${r}${n.maximum.toString()} ist`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Zu klein: erwartet, dass ${n.origin} ${r}${n.minimum.toString()} ${_.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${r}${n.minimum.toString()} ist`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ungültiger String: muss mit "${r.prefix}" beginnen`:r.format==="ends_with"?`Ungültiger String: muss mit "${r.suffix}" enden`:r.format==="includes"?`Ungültiger String: muss "${r.includes}" enthalten`:r.format==="regex"?`Ungültiger String: muss dem Muster ${r.pattern} entsprechen`:`Ungültig: ${u[r.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function U(){return{localeError:z()}}t.exports=f.default})(Ya,Ya.exports);var eI=Ya.exports,eo={exports:{}},Dn=eo.exports;(function(t,f){var k=Dn&&Dn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Dn&&Dn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Dn&&Dn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function s(n){return c[n]??null}const u={regex:"είσοδος",email:"διεύθυνση email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ημερομηνία και ώρα",date:"ISO ημερομηνία",time:"ISO ώρα",duration:"ISO διάρκεια",ipv4:"διεύθυνση IPv4",ipv6:"διεύθυνση IPv6",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",jwt:"JWT",template_literal:"είσοδος"},g={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`Μη έγκυρη είσοδος: αναμενόταν instanceof ${n.expected}, λήφθηκε ${M}`:`Μη έγκυρη είσοδος: αναμενόταν ${r}, λήφθηκε ${M}`}case"invalid_value":return n.values.length===1?`Μη έγκυρη είσοδος: αναμενόταν ${S.stringifyPrimitive(n.values[0])}`:`Μη έγκυρη επιλογή: αναμενόταν ένα από ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Πολύ μεγάλο: αναμενόταν ${n.origin??"τιμή"} να έχει ${r}${n.maximum.toString()} ${_.unit??"στοιχεία"}`:`Πολύ μεγάλο: αναμενόταν ${n.origin??"τιμή"} να είναι ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Πολύ μικρό: αναμενόταν ${n.origin} να έχει ${r}${n.minimum.toString()} ${_.unit}`:`Πολύ μικρό: αναμενόταν ${n.origin} να είναι ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${r.prefix}"`:r.format==="ends_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${r.suffix}"`:r.format==="includes"?`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${r.includes}"`:r.format==="regex"?`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${r.pattern}`:`Μη έγκυρο: ${u[r.format]??n.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${n.divisor}`;case"unrecognized_keys":return`Άγνωστ${n.keys.length>1?"α":"ο"} κλειδ${n.keys.length>1?"ιά":"ί"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${n.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${n.origin}`;default:return"Μη έγκυρη είσοδος"}}};function U(){return{localeError:z()}}t.exports=f.default})(eo,eo.exports);var tI=eo.exports,to={exports:{}},An=to.exports;(function(t,f){var k=An&&An.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=An&&An.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=An&&An.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function s(n){return c[n]??null}const u={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},g={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return`Invalid input: expected ${r}, received ${M}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${S.stringifyPrimitive(n.values[0])}`:`Invalid option: expected one of ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Too big: expected ${n.origin??"value"} to have ${r}${n.maximum.toString()} ${_.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Too small: expected ${n.origin} to have ${r}${n.minimum.toString()} ${_.unit}`:`Too small: expected ${n.origin} to be ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Invalid string: must start with "${r.prefix}"`:r.format==="ends_with"?`Invalid string: must end with "${r.suffix}"`:r.format==="includes"?`Invalid string: must include "${r.includes}"`:r.format==="regex"?`Invalid string: must match pattern ${r.pattern}`:`Invalid ${u[r.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(_=>`'${_}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function U(){return{localeError:z()}}t.exports=f.default})(to,to.exports);var dm=to.exports,ro={exports:{}},zn=ro.exports;(function(t,f){var k=zn&&zn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=zn&&zn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=zn&&zn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function s(n){return c[n]??null}const u={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},g={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendiĝis instanceof ${n.expected}, riceviĝis ${M}`:`Nevalida enigo: atendiĝis ${r}, riceviĝis ${M}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendiĝis ${S.stringifyPrimitive(n.values[0])}`:`Nevalida opcio: atendiĝis unu el ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${r}${n.maximum.toString()} ${_.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Tro malgranda: atendiĝis ke ${n.origin} havu ${r}${n.minimum.toString()} ${_.unit}`:`Tro malgranda: atendiĝis ke ${n.origin} estu ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${r.prefix}"`:r.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${r.suffix}"`:r.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${r.includes}"`:r.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`:`Nevalida ${u[r.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} ŝlosilo${n.keys.length>1?"j":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function U(){return{localeError:z()}}t.exports=f.default})(ro,ro.exports);var rI=ro.exports,no={exports:{}},Tn=no.exports;(function(t,f){var k=Tn&&Tn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Tn&&Tn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Tn&&Tn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function s(n){return c[n]??null}const u={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},g={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Entrada inválida: se esperaba instanceof ${n.expected}, recibido ${M}`:`Entrada inválida: se esperaba ${r}, recibido ${M}`}case"invalid_value":return n.values.length===1?`Entrada inválida: se esperaba ${S.stringifyPrimitive(n.values[0])}`:`Opción inválida: se esperaba una de ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin),M=g[n.origin]??n.origin;return _?`Demasiado grande: se esperaba que ${M??"valor"} tuviera ${r}${n.maximum.toString()} ${_.unit??"elementos"}`:`Demasiado grande: se esperaba que ${M??"valor"} fuera ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin),M=g[n.origin]??n.origin;return _?`Demasiado pequeño: se esperaba que ${M} tuviera ${r}${n.minimum.toString()} ${_.unit}`:`Demasiado pequeño: se esperaba que ${M} fuera ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Cadena inválida: debe comenzar con "${r.prefix}"`:r.format==="ends_with"?`Cadena inválida: debe terminar en "${r.suffix}"`:r.format==="includes"?`Cadena inválida: debe incluir "${r.includes}"`:r.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${r.pattern}`:`Inválido ${u[r.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${g[n.origin]??n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${g[n.origin]??n.origin}`;default:return"Entrada inválida"}}};function U(){return{localeError:z()}}t.exports=f.default})(no,no.exports);var nI=no.exports,io={exports:{}},Rn=io.exports;(function(t,f){var k=Rn&&Rn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Rn&&Rn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Rn&&Rn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function s(n){return c[n]??null}const u={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},g={nan:"NaN",number:"عدد",array:"آرایه"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`ورودی نامعتبر: می‌بایست instanceof ${n.expected} می‌بود، ${M} دریافت شد`:`ورودی نامعتبر: می‌بایست ${r} می‌بود، ${M} دریافت شد`}case"invalid_value":return n.values.length===1?`ورودی نامعتبر: می‌بایست ${S.stringifyPrimitive(n.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${S.joinValues(n.values,"|")} می‌بود`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`خیلی بزرگ: ${n.origin??"مقدار"} باید ${r}${n.maximum.toString()} ${_.unit??"عنصر"} باشد`:`خیلی بزرگ: ${n.origin??"مقدار"} باید ${r}${n.maximum.toString()} باشد`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`خیلی کوچک: ${n.origin} باید ${r}${n.minimum.toString()} ${_.unit} باشد`:`خیلی کوچک: ${n.origin} باید ${r}${n.minimum.toString()} باشد`}case"invalid_format":{const r=n;return r.format==="starts_with"?`رشته نامعتبر: باید با "${r.prefix}" شروع شود`:r.format==="ends_with"?`رشته نامعتبر: باید با "${r.suffix}" تمام شود`:r.format==="includes"?`رشته نامعتبر: باید شامل "${r.includes}" باشد`:r.format==="regex"?`رشته نامعتبر: باید با الگوی ${r.pattern} مطابقت داشته باشد`:`${u[r.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function U(){return{localeError:z()}}t.exports=f.default})(io,io.exports);var iI=io.exports,ao={exports:{}},Zn=ao.exports;(function(t,f){var k=Zn&&Zn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Zn&&Zn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Zn&&Zn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function s(n){return c[n]??null}const u={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},g={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${M}`:`Virheellinen tyyppi: odotettiin ${r}, oli ${M}`}case"invalid_value":return n.values.length===1?`Virheellinen syöte: täytyy olla ${S.stringifyPrimitive(n.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Liian suuri: ${_.subject} täytyy olla ${r}${n.maximum.toString()} ${_.unit}`.trim():`Liian suuri: arvon täytyy olla ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Liian pieni: ${_.subject} täytyy olla ${r}${n.minimum.toString()} ${_.unit}`.trim():`Liian pieni: arvon täytyy olla ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${r.prefix}"`:r.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${r.suffix}"`:r.format==="includes"?`Virheellinen syöte: täytyy sisältää "${r.includes}"`:r.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${r.pattern}`:`Virheellinen ${u[r.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function U(){return{localeError:z()}}t.exports=f.default})(ao,ao.exports);var aI=ao.exports,oo={exports:{}},Ln=oo.exports;(function(t,f){var k=Ln&&Ln.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Ln&&Ln.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Ln&&Ln.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function s(n){return c[n]??null}const u={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},g={string:"chaîne",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Entrée invalide : instanceof ${n.expected} attendu, ${M} reçu`:`Entrée invalide : ${r} attendu, ${M} reçu`}case"invalid_value":return n.values.length===1?`Entrée invalide : ${S.stringifyPrimitive(n.values[0])} attendu`:`Option invalide : une valeur parmi ${S.joinValues(n.values,"|")} attendue`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Trop grand : ${g[n.origin]??"valeur"} doit ${_.verb} ${r}${n.maximum.toString()} ${_.unit??"élément(s)"}`:`Trop grand : ${g[n.origin]??"valeur"} doit être ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Trop petit : ${g[n.origin]??"valeur"} doit ${_.verb} ${r}${n.minimum.toString()} ${_.unit}`:`Trop petit : ${g[n.origin]??"valeur"} doit être ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Chaîne invalide : doit commencer par "${r.prefix}"`:r.format==="ends_with"?`Chaîne invalide : doit se terminer par "${r.suffix}"`:r.format==="includes"?`Chaîne invalide : doit inclure "${r.includes}"`:r.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${r.pattern}`:`${u[r.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function U(){return{localeError:z()}}t.exports=f.default})(oo,oo.exports);var oI=oo.exports,so={exports:{}},Un=so.exports;(function(t,f){var k=Un&&Un.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Un&&Un.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Un&&Un.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function s(n){return c[n]??null}const u={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},g={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Entrée invalide : attendu instanceof ${n.expected}, reçu ${M}`:`Entrée invalide : attendu ${r}, reçu ${M}`}case"invalid_value":return n.values.length===1?`Entrée invalide : attendu ${S.stringifyPrimitive(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"≤":"<",_=s(n.origin);return _?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${r}${n.maximum.toString()} ${_.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?"≥":">",_=s(n.origin);return _?`Trop petit : attendu que ${n.origin} ait ${r}${n.minimum.toString()} ${_.unit}`:`Trop petit : attendu que ${n.origin} soit ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Chaîne invalide : doit commencer par "${r.prefix}"`:r.format==="ends_with"?`Chaîne invalide : doit se terminer par "${r.suffix}"`:r.format==="includes"?`Chaîne invalide : doit inclure "${r.includes}"`:r.format==="regex"?`Chaîne invalide : doit correspondre au motif ${r.pattern}`:`${u[r.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function U(){return{localeError:z()}}t.exports=f.default})(so,so.exports);var sI=so.exports,co={exports:{}},Bn=co.exports;(function(t,f){var k=Bn&&Bn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Bn&&Bn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Bn&&Bn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},s={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},u=X=>X?c[X]:void 0,g=X=>{const ie=u(X);return ie?ie.label:X??c.unknown.label},n=X=>`ה${g(X)}`,r=X=>(u(X)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",_=X=>X?s[X]??null:null,M={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},ee={nan:"NaN"};return X=>{switch(X.code){case"invalid_type":{const ie=X.expected,Q=ee[ie??""]??g(ie),ge=S.parsedType(X.input),xe=ee[ge]??c[ge]?.label??ge;return/^[A-Z]/.test(X.expected)?`קלט לא תקין: צריך להיות instanceof ${X.expected}, התקבל ${xe}`:`קלט לא תקין: צריך להיות ${Q}, התקבל ${xe}`}case"invalid_value":{if(X.values.length===1)return`ערך לא תקין: הערך חייב להיות ${S.stringifyPrimitive(X.values[0])}`;const ie=X.values.map(xe=>S.stringifyPrimitive(xe));if(X.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${ie[0]} או ${ie[1]}`;const Q=ie[ie.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${ie.slice(0,-1).join(", ")} או ${Q}`}case"too_big":{const ie=_(X.origin),Q=n(X.origin??"value");if(X.origin==="string")return`${ie?.longLabel??"ארוך"} מדי: ${Q} צריכה להכיל ${X.maximum.toString()} ${ie?.unit??""} ${X.inclusive?"או פחות":"לכל היותר"}`.trim();if(X.origin==="number"){const he=X.inclusive?`קטן או שווה ל-${X.maximum}`:`קטן מ-${X.maximum}`;return`גדול מדי: ${Q} צריך להיות ${he}`}if(X.origin==="array"||X.origin==="set"){const he=X.origin==="set"?"צריכה":"צריך",be=X.inclusive?`${X.maximum} ${ie?.unit??""} או פחות`:`פחות מ-${X.maximum} ${ie?.unit??""}`;return`גדול מדי: ${Q} ${he} להכיל ${be}`.trim()}const ge=X.inclusive?"<=":"<",xe=r(X.origin??"value");return ie?.unit?`${ie.longLabel} מדי: ${Q} ${xe} ${ge}${X.maximum.toString()} ${ie.unit}`:`${ie?.longLabel??"גדול"} מדי: ${Q} ${xe} ${ge}${X.maximum.toString()}`}case"too_small":{const ie=_(X.origin),Q=n(X.origin??"value");if(X.origin==="string")return`${ie?.shortLabel??"קצר"} מדי: ${Q} צריכה להכיל ${X.minimum.toString()} ${ie?.unit??""} ${X.inclusive?"או יותר":"לפחות"}`.trim();if(X.origin==="number"){const he=X.inclusive?`גדול או שווה ל-${X.minimum}`:`גדול מ-${X.minimum}`;return`קטן מדי: ${Q} צריך להיות ${he}`}if(X.origin==="array"||X.origin==="set"){const he=X.origin==="set"?"צריכה":"צריך";if(X.minimum===1&&X.inclusive){const Te=(X.origin==="set","לפחות פריט אחד");return`קטן מדי: ${Q} ${he} להכיל ${Te}`}const be=X.inclusive?`${X.minimum} ${ie?.unit??""} או יותר`:`יותר מ-${X.minimum} ${ie?.unit??""}`;return`קטן מדי: ${Q} ${he} להכיל ${be}`.trim()}const ge=X.inclusive?">=":">",xe=r(X.origin??"value");return ie?.unit?`${ie.shortLabel} מדי: ${Q} ${xe} ${ge}${X.minimum.toString()} ${ie.unit}`:`${ie?.shortLabel??"קטן"} מדי: ${Q} ${xe} ${ge}${X.minimum.toString()}`}case"invalid_format":{const ie=X;if(ie.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${ie.prefix}"`;if(ie.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${ie.suffix}"`;if(ie.format==="includes")return`המחרוזת חייבת לכלול "${ie.includes}"`;if(ie.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${ie.pattern}`;const Q=M[ie.format],ge=Q?.label??ie.format,he=(Q?.gender??"m")==="f"?"תקינה":"תקין";return`${ge} לא ${he}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${X.divisor}`;case"unrecognized_keys":return`מפתח${X.keys.length>1?"ות":""} לא מזוה${X.keys.length>1?"ים":"ה"}: ${S.joinValues(X.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n(X.origin??"array")}`;default:return"קלט לא תקין"}}};function U(){return{localeError:z()}}t.exports=f.default})(co,co.exports);var cI=co.exports,lo={exports:{}},Fn=lo.exports;(function(t,f){var k=Fn&&Fn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Fn&&Fn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Fn&&Fn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function s(n){return c[n]??null}const u={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},g={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Neispravan unos: očekuje se instanceof ${n.expected}, a primljeno je ${M}`:`Neispravan unos: očekuje se ${r}, a primljeno je ${M}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: očekivano ${S.stringifyPrimitive(n.values[0])}`:`Neispravna opcija: očekivano jedno od ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin),M=g[n.origin]??n.origin;return _?`Preveliko: očekivano da ${M??"vrijednost"} ima ${r}${n.maximum.toString()} ${_.unit??"elemenata"}`:`Preveliko: očekivano da ${M??"vrijednost"} bude ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin),M=g[n.origin]??n.origin;return _?`Premalo: očekivano da ${M} ima ${r}${n.minimum.toString()} ${_.unit}`:`Premalo: očekivano da ${M} bude ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Neispravan tekst: mora započinjati s "${r.prefix}"`:r.format==="ends_with"?`Neispravan tekst: mora završavati s "${r.suffix}"`:r.format==="includes"?`Neispravan tekst: mora sadržavati "${r.includes}"`:r.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${r.pattern}`:`Neispravna ${u[r.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i ključevi":" ključ"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${g[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${g[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function U(){return{localeError:z()}}t.exports=f.default})(lo,lo.exports);var lI=lo.exports,uo={exports:{}},Gn=uo.exports;(function(t,f){var k=Gn&&Gn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Gn&&Gn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Gn&&Gn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function s(n){return c[n]??null}const u={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},g={nan:"NaN",number:"szám",array:"tömb"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Érvénytelen bemenet: a várt érték instanceof ${n.expected}, a kapott érték ${M}`:`Érvénytelen bemenet: a várt érték ${r}, a kapott érték ${M}`}case"invalid_value":return n.values.length===1?`Érvénytelen bemenet: a várt érték ${S.stringifyPrimitive(n.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${r}${n.maximum.toString()} ${_.unit??"elem"}`:`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${r}${n.minimum.toString()} ${_.unit}`:`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Érvénytelen string: "${r.prefix}" értékkel kell kezdődnie`:r.format==="ends_with"?`Érvénytelen string: "${r.suffix}" értékkel kell végződnie`:r.format==="includes"?`Érvénytelen string: "${r.includes}" értéket kell tartalmaznia`:r.format==="regex"?`Érvénytelen string: ${r.pattern} mintának kell megfelelnie`:`Érvénytelen ${u[r.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function U(){return{localeError:z()}}t.exports=f.default})(uo,uo.exports);var uI=uo.exports,fo={exports:{}},Vn=fo.exports;(function(t,f){var k=Vn&&Vn.__createBinding||(Object.create?(function(u,g,n,r){r===void 0&&(r=n);var _=Object.getOwnPropertyDescriptor(g,n);(!_||("get"in _?!g.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return g[n]}}),Object.defineProperty(u,r,_)}):(function(u,g,n,r){r===void 0&&(r=n),u[r]=g[n]})),C=Vn&&Vn.__setModuleDefault||(Object.create?(function(u,g){Object.defineProperty(u,"default",{enumerable:!0,value:g})}):function(u,g){u.default=g}),x=Vn&&Vn.__importStar||function(u){if(u&&u.__esModule)return u;var g={};if(u!=null)for(var n in u)n!=="default"&&Object.prototype.hasOwnProperty.call(u,n)&&k(g,u,n);return C(g,u),g};Object.defineProperty(f,"__esModule",{value:!0}),f.default=s;const S=x(ae);function z(u,g,n){return Math.abs(u)===1?g:n}function U(u){if(!u)return"";const g=["ա","ե","ը","ի","ո","ու","օ"],n=u[u.length-1];return u+(g.includes(n)?"ն":"ը")}const c=()=>{const u={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function g(_){return u[_]??null}const n={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},r={nan:"NaN",number:"թիվ",array:"զանգված"};return _=>{switch(_.code){case"invalid_type":{const M=r[_.expected]??_.expected,ee=S.parsedType(_.input),X=r[ee]??ee;return/^[A-Z]/.test(_.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${_.expected}, ստացվել է ${X}`:`Սխալ մուտքագրում․ սպասվում էր ${M}, ստացվել է ${X}`}case"invalid_value":return _.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${S.stringifyPrimitive(_.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${S.joinValues(_.values,"|")}`;case"too_big":{const M=_.inclusive?"<=":"<",ee=g(_.origin);if(ee){const X=Number(_.maximum),ie=z(X,ee.unit.one,ee.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${U(_.origin??"արժեք")} կունենա ${M}${_.maximum.toString()} ${ie}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${U(_.origin??"արժեք")} լինի ${M}${_.maximum.toString()}`}case"too_small":{const M=_.inclusive?">=":">",ee=g(_.origin);if(ee){const X=Number(_.minimum),ie=z(X,ee.unit.one,ee.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${U(_.origin)} կունենա ${M}${_.minimum.toString()} ${ie}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${U(_.origin)} լինի ${M}${_.minimum.toString()}`}case"invalid_format":{const M=_;return M.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${M.prefix}"-ով`:M.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${M.suffix}"-ով`:M.format==="includes"?`Սխալ տող․ պետք է պարունակի "${M.includes}"`:M.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${M.pattern} ձևաչափին`:`Սխալ ${n[M.format]??_.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${_.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${_.keys.length>1?"ներ":""}. ${S.joinValues(_.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${U(_.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${U(_.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function s(){return{localeError:c()}}t.exports=f.default})(fo,fo.exports);var dI=fo.exports,mo={exports:{}},Qn=mo.exports;(function(t,f){var k=Qn&&Qn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Qn&&Qn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Qn&&Qn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function s(n){return c[n]??null}const u={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},g={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${M}`:`Input tidak valid: diharapkan ${r}, diterima ${M}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${S.stringifyPrimitive(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${r}${n.maximum.toString()} ${_.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Terlalu kecil: diharapkan ${n.origin} memiliki ${r}${n.minimum.toString()} ${_.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`String tidak valid: harus dimulai dengan "${r.prefix}"`:r.format==="ends_with"?`String tidak valid: harus berakhir dengan "${r.suffix}"`:r.format==="includes"?`String tidak valid: harus menyertakan "${r.includes}"`:r.format==="regex"?`String tidak valid: harus sesuai pola ${r.pattern}`:`${u[r.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function U(){return{localeError:z()}}t.exports=f.default})(mo,mo.exports);var fI=mo.exports,go={exports:{}},Wn=go.exports;(function(t,f){var k=Wn&&Wn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Wn&&Wn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Wn&&Wn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function s(n){return c[n]??null}const u={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},g={nan:"NaN",number:"númer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Rangt gildi: Þú slóst inn ${M} þar sem á að vera instanceof ${n.expected}`:`Rangt gildi: Þú slóst inn ${M} þar sem á að vera ${r}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert ráð fyrir ${S.stringifyPrimitive(n.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} hafi ${r}${n.maximum.toString()} ${_.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} sé ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Of lítið: gert er ráð fyrir að ${n.origin} hafi ${r}${n.minimum.toString()} ${_.unit}`:`Of lítið: gert er ráð fyrir að ${n.origin} sé ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ógildur strengur: verður að byrja á "${r.prefix}"`:r.format==="ends_with"?`Ógildur strengur: verður að enda á "${r.suffix}"`:r.format==="includes"?`Ógildur strengur: verður að innihalda "${r.includes}"`:r.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${r.pattern}`:`Rangt ${u[r.format]??n.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`Óþekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${n.origin}`;default:return"Rangt gildi"}}};function U(){return{localeError:z()}}t.exports=f.default})(go,go.exports);var mI=go.exports,po={exports:{}},qn=po.exports;(function(t,f){var k=qn&&qn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=qn&&qn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=qn&&qn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function s(n){return c[n]??null}const u={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${M}`:`Input non valido: atteso ${r}, ricevuto ${M}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${S.stringifyPrimitive(n.values[0])}`:`Opzione non valida: atteso uno tra ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Troppo grande: ${n.origin??"valore"} deve avere ${r}${n.maximum.toString()} ${_.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Troppo piccolo: ${n.origin} deve avere ${r}${n.minimum.toString()} ${_.unit}`:`Troppo piccolo: ${n.origin} deve essere ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Stringa non valida: deve iniziare con "${r.prefix}"`:r.format==="ends_with"?`Stringa non valida: deve terminare con "${r.suffix}"`:r.format==="includes"?`Stringa non valida: deve includere "${r.includes}"`:r.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${r.pattern}`:`Input non valido: ${u[r.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function U(){return{localeError:z()}}t.exports=f.default})(po,po.exports);var gI=po.exports,vo={exports:{}},Hn=vo.exports;(function(t,f){var k=Hn&&Hn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Hn&&Hn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Hn&&Hn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function s(n){return c[n]??null}const u={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},g={nan:"NaN",number:"数値",array:"配列"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`無効な入力: instanceof ${n.expected}が期待されましたが、${M}が入力されました`:`無効な入力: ${r}が期待されましたが、${M}が入力されました`}case"invalid_value":return n.values.length===1?`無効な入力: ${S.stringifyPrimitive(n.values[0])}が期待されました`:`無効な選択: ${S.joinValues(n.values,"、")}のいずれかである必要があります`;case"too_big":{const r=n.inclusive?"以下である":"より小さい",_=s(n.origin);return _?`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${_.unit??"要素"}${r}必要があります`:`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${r}必要があります`}case"too_small":{const r=n.inclusive?"以上である":"より大きい",_=s(n.origin);return _?`小さすぎる値: ${n.origin}は${n.minimum.toString()}${_.unit}${r}必要があります`:`小さすぎる値: ${n.origin}は${n.minimum.toString()}${r}必要があります`}case"invalid_format":{const r=n;return r.format==="starts_with"?`無効な文字列: "${r.prefix}"で始まる必要があります`:r.format==="ends_with"?`無効な文字列: "${r.suffix}"で終わる必要があります`:r.format==="includes"?`無効な文字列: "${r.includes}"を含む必要があります`:r.format==="regex"?`無効な文字列: パターン${r.pattern}に一致する必要があります`:`無効な${u[r.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${S.joinValues(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function U(){return{localeError:z()}}t.exports=f.default})(vo,vo.exports);var pI=vo.exports,ho={exports:{}},Jn=ho.exports;(function(t,f){var k=Jn&&Jn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Jn&&Jn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Jn&&Jn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function s(n){return c[n]??null}const u={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული ველი",base64url:"base64url-კოდირებული ველი",json_string:"JSON ველი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},g={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${n.expected}, მიღებული ${M}`:`არასწორი შეყვანა: მოსალოდნელი ${r}, მიღებული ${M}`}case"invalid_value":return n.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${S.stringifyPrimitive(n.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${S.joinValues(n.values,"|")}-დან`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} ${_.verb} ${r}${n.maximum.toString()} ${_.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} იყოს ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`ზედმეტად პატარა: მოსალოდნელი ${n.origin} ${_.verb} ${r}${n.minimum.toString()} ${_.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${n.origin} იყოს ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`არასწორი ველი: უნდა იწყებოდეს "${r.prefix}"-ით`:r.format==="ends_with"?`არასწორი ველი: უნდა მთავრდებოდეს "${r.suffix}"-ით`:r.format==="includes"?`არასწორი ველი: უნდა შეიცავდეს "${r.includes}"-ს`:r.format==="regex"?`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${r.pattern}`:`არასწორი ${u[r.format]??n.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${n.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${n.keys.length>1?"ები":"ი"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${n.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${n.origin}-ში`;default:return"არასწორი შეყვანა"}}};function U(){return{localeError:z()}}t.exports=f.default})(ho,ho.exports);var vI=ho.exports,bo={exports:{}},yo={exports:{}},Kn=yo.exports;(function(t,f){var k=Kn&&Kn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Kn&&Kn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Kn&&Kn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function s(n){return c[n]??null}const u={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},g={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${n.expected} ប៉ុន្តែទទួលបាន ${M}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${r} ប៉ុន្តែទទួលបាន ${M}`}case"invalid_value":return n.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${S.stringifyPrimitive(n.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${r} ${n.maximum.toString()} ${_.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${r} ${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`តូចពេក៖ ត្រូវការ ${n.origin} ${r} ${n.minimum.toString()} ${_.unit}`:`តូចពេក៖ ត្រូវការ ${n.origin} ${r} ${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${r.prefix}"`:r.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${r.suffix}"`:r.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${r.includes}"`:r.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${r.pattern}`:`មិនត្រឹមត្រូវ៖ ${u[r.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function U(){return{localeError:z()}}t.exports=f.default})(yo,yo.exports);var fm=yo.exports,Hf=bo.exports;(function(t,f){var k=Hf&&Hf.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(f,"__esModule",{value:!0}),f.default=x;const C=k(fm);function x(){return(0,C.default)()}t.exports=f.default})(bo,bo.exports);var hI=bo.exports,_o={exports:{}},Xn=_o.exports;(function(t,f){var k=Xn&&Xn.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=Xn&&Xn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=Xn&&Xn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function s(n){return c[n]??null}const u={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},g={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`잘못된 입력: 예상 타입은 instanceof ${n.expected}, 받은 타입은 ${M}입니다`:`잘못된 입력: 예상 타입은 ${r}, 받은 타입은 ${M}입니다`}case"invalid_value":return n.values.length===1?`잘못된 입력: 값은 ${S.stringifyPrimitive(n.values[0])} 이어야 합니다`:`잘못된 옵션: ${S.joinValues(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const r=n.inclusive?"이하":"미만",_=r==="미만"?"이어야 합니다":"여야 합니다",M=s(n.origin),ee=M?.unit??"요소";return M?`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${ee} ${r}${_}`:`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${r}${_}`}case"too_small":{const r=n.inclusive?"이상":"초과",_=r==="이상"?"이어야 합니다":"여야 합니다",M=s(n.origin),ee=M?.unit??"요소";return M?`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${ee} ${r}${_}`:`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${r}${_}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`잘못된 문자열: "${r.prefix}"(으)로 시작해야 합니다`:r.format==="ends_with"?`잘못된 문자열: "${r.suffix}"(으)로 끝나야 합니다`:r.format==="includes"?`잘못된 문자열: "${r.includes}"을(를) 포함해야 합니다`:r.format==="regex"?`잘못된 문자열: 정규식 ${r.pattern} 패턴과 일치해야 합니다`:`잘못된 ${u[r.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function U(){return{localeError:z()}}t.exports=f.default})(_o,_o.exports);var bI=_o.exports,xo={exports:{}},Yn=xo.exports;(function(t,f){var k=Yn&&Yn.__createBinding||(Object.create?(function(u,g,n,r){r===void 0&&(r=n);var _=Object.getOwnPropertyDescriptor(g,n);(!_||("get"in _?!g.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return g[n]}}),Object.defineProperty(u,r,_)}):(function(u,g,n,r){r===void 0&&(r=n),u[r]=g[n]})),C=Yn&&Yn.__setModuleDefault||(Object.create?(function(u,g){Object.defineProperty(u,"default",{enumerable:!0,value:g})}):function(u,g){u.default=g}),x=Yn&&Yn.__importStar||function(u){if(u&&u.__esModule)return u;var g={};if(u!=null)for(var n in u)n!=="default"&&Object.prototype.hasOwnProperty.call(u,n)&&k(g,u,n);return C(g,u),g};Object.defineProperty(f,"__esModule",{value:!0}),f.default=s;const S=x(ae),z=u=>u.charAt(0).toUpperCase()+u.slice(1);function U(u){const g=Math.abs(u),n=g%10,r=g%100;return r>=11&&r<=19||n===0?"many":n===1?"one":"few"}const c=()=>{const u={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function g(_,M,ee,X){const ie=u[_]??null;return ie===null?ie:{unit:ie.unit[M],verb:ie.verb[X][ee?"inclusive":"notInclusive"]}}const n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},r={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return _=>{switch(_.code){case"invalid_type":{const M=r[_.expected]??_.expected,ee=S.parsedType(_.input),X=r[ee]??ee;return/^[A-Z]/.test(_.expected)?`Gautas tipas ${X}, o tikėtasi - instanceof ${_.expected}`:`Gautas tipas ${X}, o tikėtasi - ${M}`}case"invalid_value":return _.values.length===1?`Privalo būti ${S.stringifyPrimitive(_.values[0])}`:`Privalo būti vienas iš ${S.joinValues(_.values,"|")} pasirinkimų`;case"too_big":{const M=r[_.origin]??_.origin,ee=g(_.origin,U(Number(_.maximum)),_.inclusive??!1,"smaller");if(ee?.verb)return`${z(M??_.origin??"reikšmė")} ${ee.verb} ${_.maximum.toString()} ${ee.unit??"elementų"}`;const X=_.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${z(M??_.origin??"reikšmė")} turi būti ${X} ${_.maximum.toString()} ${ee?.unit}`}case"too_small":{const M=r[_.origin]??_.origin,ee=g(_.origin,U(Number(_.minimum)),_.inclusive??!1,"bigger");if(ee?.verb)return`${z(M??_.origin??"reikšmė")} ${ee.verb} ${_.minimum.toString()} ${ee.unit??"elementų"}`;const X=_.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${z(M??_.origin??"reikšmė")} turi būti ${X} ${_.minimum.toString()} ${ee?.unit}`}case"invalid_format":{const M=_;return M.format==="starts_with"?`Eilutė privalo prasidėti "${M.prefix}"`:M.format==="ends_with"?`Eilutė privalo pasibaigti "${M.suffix}"`:M.format==="includes"?`Eilutė privalo įtraukti "${M.includes}"`:M.format==="regex"?`Eilutė privalo atitikti ${M.pattern}`:`Neteisingas ${n[M.format]??_.format}`}case"not_multiple_of":return`Skaičius privalo būti ${_.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${_.keys.length>1?"i":"as"} rakt${_.keys.length>1?"ai":"as"}: ${S.joinValues(_.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const M=r[_.origin]??_.origin;return`${z(M??_.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function s(){return{localeError:c()}}t.exports=f.default})(xo,xo.exports);var yI=xo.exports,wo={exports:{}},ei=wo.exports;(function(t,f){var k=ei&&ei.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=ei&&ei.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=ei&&ei.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function s(n){return c[n]??null}const u={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},g={nan:"NaN",number:"број",array:"низа"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Грешен внес: се очекува instanceof ${n.expected}, примено ${M}`:`Грешен внес: се очекува ${r}, примено ${M}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${S.stringifyPrimitive(n.values[0])}`:`Грешана опција: се очекува една ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${r}${n.maximum.toString()} ${_.unit??"елементи"}`:`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Премногу мал: се очекува ${n.origin} да има ${r}${n.minimum.toString()} ${_.unit}`:`Премногу мал: се очекува ${n.origin} да биде ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Неважечка низа: мора да започнува со "${r.prefix}"`:r.format==="ends_with"?`Неважечка низа: мора да завршува со "${r.suffix}"`:r.format==="includes"?`Неважечка низа: мора да вклучува "${r.includes}"`:r.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${r.pattern}`:`Invalid ${u[r.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function U(){return{localeError:z()}}t.exports=f.default})(wo,wo.exports);var _I=wo.exports,So={exports:{}},ti=So.exports;(function(t,f){var k=ti&&ti.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=ti&&ti.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=ti&&ti.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function s(n){return c[n]??null}const u={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${M}`:`Input tidak sah: dijangka ${r}, diterima ${M}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${S.stringifyPrimitive(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Terlalu besar: dijangka ${n.origin??"nilai"} ${_.verb} ${r}${n.maximum.toString()} ${_.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Terlalu kecil: dijangka ${n.origin} ${_.verb} ${r}${n.minimum.toString()} ${_.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`String tidak sah: mesti bermula dengan "${r.prefix}"`:r.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${r.suffix}"`:r.format==="includes"?`String tidak sah: mesti mengandungi "${r.includes}"`:r.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${r.pattern}`:`${u[r.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function U(){return{localeError:z()}}t.exports=f.default})(So,So.exports);var xI=So.exports,jo={exports:{}},ri=jo.exports;(function(t,f){var k=ri&&ri.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=ri&&ri.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=ri&&ri.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function s(n){return c[n]??null}const u={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},g={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${M}`:`Ongeldige invoer: verwacht ${r}, ontving ${M}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${S.stringifyPrimitive(n.values[0])}`:`Ongeldige optie: verwacht één van ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin),M=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return _?`Te ${M}: verwacht dat ${n.origin??"waarde"} ${r}${n.maximum.toString()} ${_.unit??"elementen"} ${_.verb}`:`Te ${M}: verwacht dat ${n.origin??"waarde"} ${r}${n.maximum.toString()} is`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin),M=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return _?`Te ${M}: verwacht dat ${n.origin} ${r}${n.minimum.toString()} ${_.unit} ${_.verb}`:`Te ${M}: verwacht dat ${n.origin} ${r}${n.minimum.toString()} is`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ongeldige tekst: moet met "${r.prefix}" beginnen`:r.format==="ends_with"?`Ongeldige tekst: moet op "${r.suffix}" eindigen`:r.format==="includes"?`Ongeldige tekst: moet "${r.includes}" bevatten`:r.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${r.pattern}`:`Ongeldig: ${u[r.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function U(){return{localeError:z()}}t.exports=f.default})(jo,jo.exports);var wI=jo.exports,$o={exports:{}},ni=$o.exports;(function(t,f){var k=ni&&ni.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=ni&&ni.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=ni&&ni.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function s(n){return c[n]??null}const u={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${M}`:`Ugyldig input: forventet ${r}, fikk ${M}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${S.stringifyPrimitive(n.values[0])}`:`Ugyldig valg: forventet en av ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`For stor(t): forventet ${n.origin??"value"} til å ha ${r}${n.maximum.toString()} ${_.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til å ha ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`For lite(n): forventet ${n.origin} til å ha ${r}${n.minimum.toString()} ${_.unit}`:`For lite(n): forventet ${n.origin} til å ha ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ugyldig streng: må starte med "${r.prefix}"`:r.format==="ends_with"?`Ugyldig streng: må ende med "${r.suffix}"`:r.format==="includes"?`Ugyldig streng: må inneholde "${r.includes}"`:r.format==="regex"?`Ugyldig streng: må matche mønsteret ${r.pattern}`:`Ugyldig ${u[r.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function U(){return{localeError:z()}}t.exports=f.default})($o,$o.exports);var SI=$o.exports,ko={exports:{}},ii=ko.exports;(function(t,f){var k=ii&&ii.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=ii&&ii.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=ii&&ii.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function s(n){return c[n]??null}const u={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},g={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Fâsit giren: umulan instanceof ${n.expected}, alınan ${M}`:`Fâsit giren: umulan ${r}, alınan ${M}`}case"invalid_value":return n.values.length===1?`Fâsit giren: umulan ${S.stringifyPrimitive(n.values[0])}`:`Fâsit tercih: mûteberler ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Fazla büyük: ${n.origin??"value"}, ${r}${n.maximum.toString()} ${_.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${n.origin??"value"}, ${r}${n.maximum.toString()} olmalıydı.`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Fazla küçük: ${n.origin}, ${r}${n.minimum.toString()} ${_.unit} sahip olmalıydı.`:`Fazla küçük: ${n.origin}, ${r}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Fâsit metin: "${r.prefix}" ile başlamalı.`:r.format==="ends_with"?`Fâsit metin: "${r.suffix}" ile bitmeli.`:r.format==="includes"?`Fâsit metin: "${r.includes}" ihtivâ etmeli.`:r.format==="regex"?`Fâsit metin: ${r.pattern} nakşına uymalı.`:`Fâsit ${u[r.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function U(){return{localeError:z()}}t.exports=f.default})(ko,ko.exports);var jI=ko.exports,Po={exports:{}},ai=Po.exports;(function(t,f){var k=ai&&ai.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=ai&&ai.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=ai&&ai.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function s(n){return c[n]??null}const u={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},g={nan:"NaN",number:"عدد",array:"ارې"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`ناسم ورودي: باید instanceof ${n.expected} وای, مګر ${M} ترلاسه شو`:`ناسم ورودي: باید ${r} وای, مګر ${M} ترلاسه شو`}case"invalid_value":return n.values.length===1?`ناسم ورودي: باید ${S.stringifyPrimitive(n.values[0])} وای`:`ناسم انتخاب: باید یو له ${S.joinValues(n.values,"|")} څخه وای`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`ډیر لوی: ${n.origin??"ارزښت"} باید ${r}${n.maximum.toString()} ${_.unit??"عنصرونه"} ولري`:`ډیر لوی: ${n.origin??"ارزښت"} باید ${r}${n.maximum.toString()} وي`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`ډیر کوچنی: ${n.origin} باید ${r}${n.minimum.toString()} ${_.unit} ولري`:`ډیر کوچنی: ${n.origin} باید ${r}${n.minimum.toString()} وي`}case"invalid_format":{const r=n;return r.format==="starts_with"?`ناسم متن: باید د "${r.prefix}" سره پیل شي`:r.format==="ends_with"?`ناسم متن: باید د "${r.suffix}" سره پای ته ورسيږي`:r.format==="includes"?`ناسم متن: باید "${r.includes}" ولري`:r.format==="regex"?`ناسم متن: باید د ${r.pattern} سره مطابقت ولري`:`${u[r.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function U(){return{localeError:z()}}t.exports=f.default})(Po,Po.exports);var $I=Po.exports,No={exports:{}},oi=No.exports;(function(t,f){var k=oi&&oi.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=oi&&oi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=oi&&oi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function s(n){return c[n]??null}const u={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},g={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${n.expected}, otrzymano ${M}`:`Nieprawidłowe dane wejściowe: oczekiwano ${r}, otrzymano ${M}`}case"invalid_value":return n.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${S.stringifyPrimitive(n.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${r}${n.maximum.toString()} ${_.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${r}${n.minimum.toString()} ${_.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${r.prefix}"`:r.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${r.suffix}"`:r.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${r.includes}"`:r.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${r.pattern}`:`Nieprawidłow(y/a/e) ${u[r.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function U(){return{localeError:z()}}t.exports=f.default})(No,No.exports);var kI=No.exports,Oo={exports:{}},si=Oo.exports;(function(t,f){var k=si&&si.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=si&&si.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=si&&si.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function s(n){return c[n]??null}const u={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},g={nan:"NaN",number:"número",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Tipo inválido: esperado instanceof ${n.expected}, recebido ${M}`:`Tipo inválido: esperado ${r}, recebido ${M}`}case"invalid_value":return n.values.length===1?`Entrada inválida: esperado ${S.stringifyPrimitive(n.values[0])}`:`Opção inválida: esperada uma das ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${r}${n.maximum.toString()} ${_.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Muito pequeno: esperado que ${n.origin} tivesse ${r}${n.minimum.toString()} ${_.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Texto inválido: deve começar com "${r.prefix}"`:r.format==="ends_with"?`Texto inválido: deve terminar com "${r.suffix}"`:r.format==="includes"?`Texto inválido: deve incluir "${r.includes}"`:r.format==="regex"?`Texto inválido: deve corresponder ao padrão ${r.pattern}`:`${u[r.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function U(){return{localeError:z()}}t.exports=f.default})(Oo,Oo.exports);var PI=Oo.exports,Co={exports:{}},ci=Co.exports;(function(t,f){var k=ci&&ci.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=ci&&ci.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=ci&&ci.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function s(n){return c[n]??null}const u={regex:"intrare",email:"adresă de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",jwt:"JWT",template_literal:"intrare"},g={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return`Intrare invalidă: așteptat ${r}, primit ${M}`}case"invalid_value":return n.values.length===1?`Intrare invalidă: așteptat ${S.stringifyPrimitive(n.values[0])}`:`Opțiune invalidă: așteptat una dintre ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Prea mare: așteptat ca ${n.origin??"valoarea"} ${_.verb} ${r}${n.maximum.toString()} ${_.unit??"elemente"}`:`Prea mare: așteptat ca ${n.origin??"valoarea"} să fie ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Prea mic: așteptat ca ${n.origin} ${_.verb} ${r}${n.minimum.toString()} ${_.unit}`:`Prea mic: așteptat ca ${n.origin} să fie ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Șir invalid: trebuie să înceapă cu "${r.prefix}"`:r.format==="ends_with"?`Șir invalid: trebuie să se termine cu "${r.suffix}"`:r.format==="includes"?`Șir invalid: trebuie să includă "${r.includes}"`:r.format==="regex"?`Șir invalid: trebuie să se potrivească cu modelul ${r.pattern}`:`Format invalid: ${u[r.format]??n.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${n.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${n.origin}`;default:return"Intrare invalidă"}}};function U(){return{localeError:z()}}t.exports=f.default})(Co,Co.exports);var NI=Co.exports,Io={exports:{}},li=Io.exports;(function(t,f){var k=li&&li.__createBinding||(Object.create?(function(s,u,g,n){n===void 0&&(n=g);var r=Object.getOwnPropertyDescriptor(u,g);(!r||("get"in r?!u.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return u[g]}}),Object.defineProperty(s,n,r)}):(function(s,u,g,n){n===void 0&&(n=g),s[n]=u[g]})),C=li&&li.__setModuleDefault||(Object.create?(function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}):function(s,u){s.default=u}),x=li&&li.__importStar||function(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var g in s)g!=="default"&&Object.prototype.hasOwnProperty.call(s,g)&&k(u,s,g);return C(u,s),u};Object.defineProperty(f,"__esModule",{value:!0}),f.default=c;const S=x(ae);function z(s,u,g,n){const r=Math.abs(s),_=r%10,M=r%100;return M>=11&&M<=19?n:_===1?u:_>=2&&_<=4?g:n}const U=()=>{const s={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function u(r){return s[r]??null}const g={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},n={nan:"NaN",number:"число",array:"массив"};return r=>{switch(r.code){case"invalid_type":{const _=n[r.expected]??r.expected,M=S.parsedType(r.input),ee=n[M]??M;return/^[A-Z]/.test(r.expected)?`Неверный ввод: ожидалось instanceof ${r.expected}, получено ${ee}`:`Неверный ввод: ожидалось ${_}, получено ${ee}`}case"invalid_value":return r.values.length===1?`Неверный ввод: ожидалось ${S.stringifyPrimitive(r.values[0])}`:`Неверный вариант: ожидалось одно из ${S.joinValues(r.values,"|")}`;case"too_big":{const _=r.inclusive?"<=":"<",M=u(r.origin);if(M){const ee=Number(r.maximum),X=z(ee,M.unit.one,M.unit.few,M.unit.many);return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет иметь ${_}${r.maximum.toString()} ${X}`}return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет ${_}${r.maximum.toString()}`}case"too_small":{const _=r.inclusive?">=":">",M=u(r.origin);if(M){const ee=Number(r.minimum),X=z(ee,M.unit.one,M.unit.few,M.unit.many);return`Слишком маленькое значение: ожидалось, что ${r.origin} будет иметь ${_}${r.minimum.toString()} ${X}`}return`Слишком маленькое значение: ожидалось, что ${r.origin} будет ${_}${r.minimum.toString()}`}case"invalid_format":{const _=r;return _.format==="starts_with"?`Неверная строка: должна начинаться с "${_.prefix}"`:_.format==="ends_with"?`Неверная строка: должна заканчиваться на "${_.suffix}"`:_.format==="includes"?`Неверная строка: должна содержать "${_.includes}"`:_.format==="regex"?`Неверная строка: должна соответствовать шаблону ${_.pattern}`:`Неверный ${g[_.format]??r.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспознанн${r.keys.length>1?"ые":"ый"} ключ${r.keys.length>1?"и":""}: ${S.joinValues(r.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${r.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${r.origin}`;default:return"Неверные входные данные"}}};function c(){return{localeError:U()}}t.exports=f.default})(Io,Io.exports);var OI=Io.exports,Eo={exports:{}},ui=Eo.exports;(function(t,f){var k=ui&&ui.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=ui&&ui.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=ui&&ui.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function s(n){return c[n]??null}const u={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},g={nan:"NaN",number:"število",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pričakovano instanceof ${n.expected}, prejeto ${M}`:`Neveljaven vnos: pričakovano ${r}, prejeto ${M}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pričakovano ${S.stringifyPrimitive(n.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${r}${n.maximum.toString()} ${_.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Premajhno: pričakovano, da bo ${n.origin} imelo ${r}${n.minimum.toString()} ${_.unit}`:`Premajhno: pričakovano, da bo ${n.origin} ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Neveljaven niz: mora se začeti z "${r.prefix}"`:r.format==="ends_with"?`Neveljaven niz: mora se končati z "${r.suffix}"`:r.format==="includes"?`Neveljaven niz: mora vsebovati "${r.includes}"`:r.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${r.pattern}`:`Neveljaven ${u[r.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function U(){return{localeError:z()}}t.exports=f.default})(Eo,Eo.exports);var CI=Eo.exports,Mo={exports:{}},di=Mo.exports;(function(t,f){var k=di&&di.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=di&&di.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=di&&di.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function s(n){return c[n]??null}const u={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},g={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: förväntat instanceof ${n.expected}, fick ${M}`:`Ogiltig inmatning: förväntat ${r}, fick ${M}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: förväntat ${S.stringifyPrimitive(n.values[0])}`:`Ogiltigt val: förväntade en av ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`För stor(t): förväntade ${n.origin??"värdet"} att ha ${r}${n.maximum.toString()} ${_.unit??"element"}`:`För stor(t): förväntat ${n.origin??"värdet"} att ha ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`För lite(t): förväntade ${n.origin??"värdet"} att ha ${r}${n.minimum.toString()} ${_.unit}`:`För lite(t): förväntade ${n.origin??"värdet"} att ha ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ogiltig sträng: måste börja med "${r.prefix}"`:r.format==="ends_with"?`Ogiltig sträng: måste sluta med "${r.suffix}"`:r.format==="includes"?`Ogiltig sträng: måste innehålla "${r.includes}"`:r.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${r.pattern}"`:`Ogiltig(t) ${u[r.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function U(){return{localeError:z()}}t.exports=f.default})(Mo,Mo.exports);var II=Mo.exports,Do={exports:{}},fi=Do.exports;(function(t,f){var k=fi&&fi.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=fi&&fi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=fi&&fi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function s(n){return c[n]??null}const u={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${n.expected}, பெறப்பட்டது ${M}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${r}, பெறப்பட்டது ${M}`}case"invalid_value":return n.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${S.stringifyPrimitive(n.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${S.joinValues(n.values,"|")} இல் ஒன்று`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${r}${n.maximum.toString()} ${_.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${r}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${r}${n.minimum.toString()} ${_.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${r}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const r=n;return r.format==="starts_with"?`தவறான சரம்: "${r.prefix}" இல் தொடங்க வேண்டும்`:r.format==="ends_with"?`தவறான சரம்: "${r.suffix}" இல் முடிவடைய வேண்டும்`:r.format==="includes"?`தவறான சரம்: "${r.includes}" ஐ உள்ளடக்க வேண்டும்`:r.format==="regex"?`தவறான சரம்: ${r.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${u[r.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function U(){return{localeError:z()}}t.exports=f.default})(Do,Do.exports);var EI=Do.exports,Ao={exports:{}},mi=Ao.exports;(function(t,f){var k=mi&&mi.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=mi&&mi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=mi&&mi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function s(n){return c[n]??null}const u={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},g={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${n.expected} แต่ได้รับ ${M}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${r} แต่ได้รับ ${M}`}case"invalid_value":return n.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${S.stringifyPrimitive(n.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"ไม่เกิน":"น้อยกว่า",_=s(n.origin);return _?`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${r} ${n.maximum.toString()} ${_.unit??"รายการ"}`:`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${r} ${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?"อย่างน้อย":"มากกว่า",_=s(n.origin);return _?`น้อยกว่ากำหนด: ${n.origin} ควรมี${r} ${n.minimum.toString()} ${_.unit}`:`น้อยกว่ากำหนด: ${n.origin} ควรมี${r} ${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${r.prefix}"`:r.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${r.suffix}"`:r.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${r.includes}" อยู่ในข้อความ`:r.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${r.pattern}`:`รูปแบบไม่ถูกต้อง: ${u[r.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function U(){return{localeError:z()}}t.exports=f.default})(Ao,Ao.exports);var MI=Ao.exports,zo={exports:{}},gi=zo.exports;(function(t,f){var k=gi&&gi.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=gi&&gi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=gi&&gi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function s(n){return c[n]??null}const u={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},g={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Geçersiz değer: beklenen instanceof ${n.expected}, alınan ${M}`:`Geçersiz değer: beklenen ${r}, alınan ${M}`}case"invalid_value":return n.values.length===1?`Geçersiz değer: beklenen ${S.stringifyPrimitive(n.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Çok büyük: beklenen ${n.origin??"değer"} ${r}${n.maximum.toString()} ${_.unit??"öğe"}`:`Çok büyük: beklenen ${n.origin??"değer"} ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Çok küçük: beklenen ${n.origin} ${r}${n.minimum.toString()} ${_.unit}`:`Çok küçük: beklenen ${n.origin} ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Geçersiz metin: "${r.prefix}" ile başlamalı`:r.format==="ends_with"?`Geçersiz metin: "${r.suffix}" ile bitmeli`:r.format==="includes"?`Geçersiz metin: "${r.includes}" içermeli`:r.format==="regex"?`Geçersiz metin: ${r.pattern} desenine uymalı`:`Geçersiz ${u[r.format]??n.format}`}case"not_multiple_of":return`Geçersiz sayı: ${n.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${n.keys.length>1?"lar":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${n.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function U(){return{localeError:z()}}t.exports=f.default})(zo,zo.exports);var DI=zo.exports,To={exports:{}},Ro={exports:{}},pi=Ro.exports;(function(t,f){var k=pi&&pi.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=pi&&pi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=pi&&pi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function s(n){return c[n]??null}const u={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},g={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Неправильні вхідні дані: очікується instanceof ${n.expected}, отримано ${M}`:`Неправильні вхідні дані: очікується ${r}, отримано ${M}`}case"invalid_value":return n.values.length===1?`Неправильні вхідні дані: очікується ${S.stringifyPrimitive(n.values[0])}`:`Неправильна опція: очікується одне з ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Занадто велике: очікується, що ${n.origin??"значення"} ${_.verb} ${r}${n.maximum.toString()} ${_.unit??"елементів"}`:`Занадто велике: очікується, що ${n.origin??"значення"} буде ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Занадто мале: очікується, що ${n.origin} ${_.verb} ${r}${n.minimum.toString()} ${_.unit}`:`Занадто мале: очікується, що ${n.origin} буде ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Неправильний рядок: повинен починатися з "${r.prefix}"`:r.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${r.suffix}"`:r.format==="includes"?`Неправильний рядок: повинен містити "${r.includes}"`:r.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${r.pattern}`:`Неправильний ${u[r.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function U(){return{localeError:z()}}t.exports=f.default})(Ro,Ro.exports);var mm=Ro.exports,Jf=To.exports;(function(t,f){var k=Jf&&Jf.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(f,"__esModule",{value:!0}),f.default=x;const C=k(mm);function x(){return(0,C.default)()}t.exports=f.default})(To,To.exports);var AI=To.exports,Zo={exports:{}},vi=Zo.exports;(function(t,f){var k=vi&&vi.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=vi&&vi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=vi&&vi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function s(n){return c[n]??null}const u={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},g={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`غلط ان پٹ: instanceof ${n.expected} متوقع تھا، ${M} موصول ہوا`:`غلط ان پٹ: ${r} متوقع تھا، ${M} موصول ہوا`}case"invalid_value":return n.values.length===1?`غلط ان پٹ: ${S.stringifyPrimitive(n.values[0])} متوقع تھا`:`غلط آپشن: ${S.joinValues(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`بہت بڑا: ${n.origin??"ویلیو"} کے ${r}${n.maximum.toString()} ${_.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${n.origin??"ویلیو"} کا ${r}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`بہت چھوٹا: ${n.origin} کے ${r}${n.minimum.toString()} ${_.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${n.origin} کا ${r}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const r=n;return r.format==="starts_with"?`غلط سٹرنگ: "${r.prefix}" سے شروع ہونا چاہیے`:r.format==="ends_with"?`غلط سٹرنگ: "${r.suffix}" پر ختم ہونا چاہیے`:r.format==="includes"?`غلط سٹرنگ: "${r.includes}" شامل ہونا چاہیے`:r.format==="regex"?`غلط سٹرنگ: پیٹرن ${r.pattern} سے میچ ہونا چاہیے`:`غلط ${u[r.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${S.joinValues(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function U(){return{localeError:z()}}t.exports=f.default})(Zo,Zo.exports);var zI=Zo.exports,Lo={exports:{}},hi=Lo.exports;(function(t,f){var k=hi&&hi.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=hi&&hi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=hi&&hi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function s(n){return c[n]??null}const u={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},g={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${M}`:`Noto‘g‘ri kirish: kutilgan ${r}, qabul qilingan ${M}`}case"invalid_value":return n.values.length===1?`Noto‘g‘ri kirish: kutilgan ${S.stringifyPrimitive(n.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Juda katta: kutilgan ${n.origin??"qiymat"} ${r}${n.maximum.toString()} ${_.unit} ${_.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Juda kichik: kutilgan ${n.origin} ${r}${n.minimum.toString()} ${_.unit} ${_.verb}`:`Juda kichik: kutilgan ${n.origin} ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Noto‘g‘ri satr: "${r.prefix}" bilan boshlanishi kerak`:r.format==="ends_with"?`Noto‘g‘ri satr: "${r.suffix}" bilan tugashi kerak`:r.format==="includes"?`Noto‘g‘ri satr: "${r.includes}" ni o‘z ichiga olishi kerak`:r.format==="regex"?`Noto‘g‘ri satr: ${r.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${u[r.format]??n.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${n.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${n.keys.length>1?"lar":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${n.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function U(){return{localeError:z()}}t.exports=f.default})(Lo,Lo.exports);var TI=Lo.exports,Uo={exports:{}},bi=Uo.exports;(function(t,f){var k=bi&&bi.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=bi&&bi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=bi&&bi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function s(n){return c[n]??null}const u={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},g={nan:"NaN",number:"số",array:"mảng"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${n.expected}, nhận được ${M}`:`Đầu vào không hợp lệ: mong đợi ${r}, nhận được ${M}`}case"invalid_value":return n.values.length===1?`Đầu vào không hợp lệ: mong đợi ${S.stringifyPrimitive(n.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Quá lớn: mong đợi ${n.origin??"giá trị"} ${_.verb} ${r}${n.maximum.toString()} ${_.unit??"phần tử"}`:`Quá lớn: mong đợi ${n.origin??"giá trị"} ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Quá nhỏ: mong đợi ${n.origin} ${_.verb} ${r}${n.minimum.toString()} ${_.unit}`:`Quá nhỏ: mong đợi ${n.origin} ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${r.prefix}"`:r.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${r.suffix}"`:r.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${r.includes}"`:r.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${r.pattern}`:`${u[r.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function U(){return{localeError:z()}}t.exports=f.default})(Uo,Uo.exports);var RI=Uo.exports,Bo={exports:{}},yi=Bo.exports;(function(t,f){var k=yi&&yi.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=yi&&yi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=yi&&yi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function s(n){return c[n]??null}const u={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},g={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`无效输入:期望 instanceof ${n.expected},实际接收 ${M}`:`无效输入:期望 ${r},实际接收 ${M}`}case"invalid_value":return n.values.length===1?`无效输入:期望 ${S.stringifyPrimitive(n.values[0])}`:`无效选项:期望以下之一 ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`数值过大:期望 ${n.origin??"值"} ${r}${n.maximum.toString()} ${_.unit??"个元素"}`:`数值过大:期望 ${n.origin??"值"} ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`数值过小:期望 ${n.origin} ${r}${n.minimum.toString()} ${_.unit}`:`数值过小:期望 ${n.origin} ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`无效字符串:必须以 "${r.prefix}" 开头`:r.format==="ends_with"?`无效字符串:必须以 "${r.suffix}" 结尾`:r.format==="includes"?`无效字符串:必须包含 "${r.includes}"`:r.format==="regex"?`无效字符串:必须满足正则表达式 ${r.pattern}`:`无效${u[r.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function U(){return{localeError:z()}}t.exports=f.default})(Bo,Bo.exports);var ZI=Bo.exports,Fo={exports:{}},_i=Fo.exports;(function(t,f){var k=_i&&_i.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=_i&&_i.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=_i&&_i.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function s(n){return c[n]??null}const u={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},g={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`無效的輸入值:預期為 instanceof ${n.expected},但收到 ${M}`:`無效的輸入值:預期為 ${r},但收到 ${M}`}case"invalid_value":return n.values.length===1?`無效的輸入值:預期為 ${S.stringifyPrimitive(n.values[0])}`:`無效的選項:預期為以下其中之一 ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`數值過大:預期 ${n.origin??"值"} 應為 ${r}${n.maximum.toString()} ${_.unit??"個元素"}`:`數值過大:預期 ${n.origin??"值"} 應為 ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`數值過小:預期 ${n.origin} 應為 ${r}${n.minimum.toString()} ${_.unit}`:`數值過小:預期 ${n.origin} 應為 ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`無效的字串:必須以 "${r.prefix}" 開頭`:r.format==="ends_with"?`無效的字串:必須以 "${r.suffix}" 結尾`:r.format==="includes"?`無效的字串:必須包含 "${r.includes}"`:r.format==="regex"?`無效的字串:必須符合格式 ${r.pattern}`:`無效的 ${u[r.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${S.joinValues(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function U(){return{localeError:z()}}t.exports=f.default})(Fo,Fo.exports);var LI=Fo.exports,Go={exports:{}},xi=Go.exports;(function(t,f){var k=xi&&xi.__createBinding||(Object.create?(function(c,s,u,g){g===void 0&&(g=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,g,n)}):(function(c,s,u,g){g===void 0&&(g=u),c[g]=s[u]})),C=xi&&xi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),x=xi&&xi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&k(s,c,u);return C(s,c),s};Object.defineProperty(f,"__esModule",{value:!0}),f.default=U;const S=x(ae),z=()=>{const c={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function s(n){return c[n]??null}const u={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},g={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return n=>{switch(n.code){case"invalid_type":{const r=g[n.expected]??n.expected,_=S.parsedType(n.input),M=g[_]??_;return/^[A-Z]/.test(n.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${n.expected}, àmọ̀ a rí ${M}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${r}, àmọ̀ a rí ${M}`}case"invalid_value":return n.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${S.stringifyPrimitive(n.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",_=s(n.origin);return _?`Tó pọ̀ jù: a ní láti jẹ́ pé ${n.origin??"iye"} ${_.verb} ${r}${n.maximum} ${_.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${r}${n.maximum}`}case"too_small":{const r=n.inclusive?">=":">",_=s(n.origin);return _?`Kéré ju: a ní láti jẹ́ pé ${n.origin} ${_.verb} ${r}${n.minimum} ${_.unit}`:`Kéré ju: a ní láti jẹ́ ${r}${n.minimum}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${r.prefix}"`:r.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${r.suffix}"`:r.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${r.includes}"`:r.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${r.pattern}`:`Aṣìṣe: ${u[r.format]??n.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${n.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${n.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${n.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function U(){return{localeError:z()}}t.exports=f.default})(Go,Go.exports);var UI=Go.exports;(function(t){var f=Ki&&Ki.__importDefault||function(at){return at&&at.__esModule?at:{default:at}};Object.defineProperty(t,"__esModule",{value:!0}),t.zhCN=t.vi=t.uz=t.ur=t.uk=t.ua=t.tr=t.th=t.ta=t.sv=t.sl=t.ru=t.ro=t.pt=t.pl=t.ps=t.ota=t.no=t.nl=t.ms=t.mk=t.lt=t.ko=t.km=t.kh=t.ka=t.ja=t.it=t.is=t.id=t.hy=t.hu=t.hr=t.he=t.frCA=t.fr=t.fi=t.fa=t.es=t.eo=t.en=t.el=t.de=t.da=t.cs=t.ca=t.bg=t.be=t.az=t.ar=void 0,t.yo=t.zhTW=void 0;var k=WC;Object.defineProperty(t,"ar",{enumerable:!0,get:function(){return f(k).default}});var C=qC;Object.defineProperty(t,"az",{enumerable:!0,get:function(){return f(C).default}});var x=HC;Object.defineProperty(t,"be",{enumerable:!0,get:function(){return f(x).default}});var S=JC;Object.defineProperty(t,"bg",{enumerable:!0,get:function(){return f(S).default}});var z=KC;Object.defineProperty(t,"ca",{enumerable:!0,get:function(){return f(z).default}});var U=XC;Object.defineProperty(t,"cs",{enumerable:!0,get:function(){return f(U).default}});var c=YC;Object.defineProperty(t,"da",{enumerable:!0,get:function(){return f(c).default}});var s=eI;Object.defineProperty(t,"de",{enumerable:!0,get:function(){return f(s).default}});var u=tI;Object.defineProperty(t,"el",{enumerable:!0,get:function(){return f(u).default}});var g=dm;Object.defineProperty(t,"en",{enumerable:!0,get:function(){return f(g).default}});var n=rI;Object.defineProperty(t,"eo",{enumerable:!0,get:function(){return f(n).default}});var r=nI;Object.defineProperty(t,"es",{enumerable:!0,get:function(){return f(r).default}});var _=iI;Object.defineProperty(t,"fa",{enumerable:!0,get:function(){return f(_).default}});var M=aI;Object.defineProperty(t,"fi",{enumerable:!0,get:function(){return f(M).default}});var ee=oI;Object.defineProperty(t,"fr",{enumerable:!0,get:function(){return f(ee).default}});var X=sI;Object.defineProperty(t,"frCA",{enumerable:!0,get:function(){return f(X).default}});var ie=cI;Object.defineProperty(t,"he",{enumerable:!0,get:function(){return f(ie).default}});var Q=lI;Object.defineProperty(t,"hr",{enumerable:!0,get:function(){return f(Q).default}});var ge=uI;Object.defineProperty(t,"hu",{enumerable:!0,get:function(){return f(ge).default}});var xe=dI;Object.defineProperty(t,"hy",{enumerable:!0,get:function(){return f(xe).default}});var he=fI;Object.defineProperty(t,"id",{enumerable:!0,get:function(){return f(he).default}});var be=mI;Object.defineProperty(t,"is",{enumerable:!0,get:function(){return f(be).default}});var Te=gI;Object.defineProperty(t,"it",{enumerable:!0,get:function(){return f(Te).default}});var Me=pI;Object.defineProperty(t,"ja",{enumerable:!0,get:function(){return f(Me).default}});var nt=vI;Object.defineProperty(t,"ka",{enumerable:!0,get:function(){return f(nt).default}});var ht=hI;Object.defineProperty(t,"kh",{enumerable:!0,get:function(){return f(ht).default}});var Ct=fm;Object.defineProperty(t,"km",{enumerable:!0,get:function(){return f(Ct).default}});var Bt=bI;Object.defineProperty(t,"ko",{enumerable:!0,get:function(){return f(Bt).default}});var zt=yI;Object.defineProperty(t,"lt",{enumerable:!0,get:function(){return f(zt).default}});var Dt=_I;Object.defineProperty(t,"mk",{enumerable:!0,get:function(){return f(Dt).default}});var Lt=xI;Object.defineProperty(t,"ms",{enumerable:!0,get:function(){return f(Lt).default}});var jt=wI;Object.defineProperty(t,"nl",{enumerable:!0,get:function(){return f(jt).default}});var Ft=SI;Object.defineProperty(t,"no",{enumerable:!0,get:function(){return f(Ft).default}});var Kt=jI;Object.defineProperty(t,"ota",{enumerable:!0,get:function(){return f(Kt).default}});var $=$I;Object.defineProperty(t,"ps",{enumerable:!0,get:function(){return f($).default}});var P=kI;Object.defineProperty(t,"pl",{enumerable:!0,get:function(){return f(P).default}});var I=PI;Object.defineProperty(t,"pt",{enumerable:!0,get:function(){return f(I).default}});var L=NI;Object.defineProperty(t,"ro",{enumerable:!0,get:function(){return f(L).default}});var F=OI;Object.defineProperty(t,"ru",{enumerable:!0,get:function(){return f(F).default}});var W=CI;Object.defineProperty(t,"sl",{enumerable:!0,get:function(){return f(W).default}});var ne=II;Object.defineProperty(t,"sv",{enumerable:!0,get:function(){return f(ne).default}});var me=EI;Object.defineProperty(t,"ta",{enumerable:!0,get:function(){return f(me).default}});var H=MI;Object.defineProperty(t,"th",{enumerable:!0,get:function(){return f(H).default}});var q=DI;Object.defineProperty(t,"tr",{enumerable:!0,get:function(){return f(q).default}});var oe=AI;Object.defineProperty(t,"ua",{enumerable:!0,get:function(){return f(oe).default}});var fe=mm;Object.defineProperty(t,"uk",{enumerable:!0,get:function(){return f(fe).default}});var J=zI;Object.defineProperty(t,"ur",{enumerable:!0,get:function(){return f(J).default}});var le=TI;Object.defineProperty(t,"uz",{enumerable:!0,get:function(){return f(le).default}});var _e=RI;Object.defineProperty(t,"vi",{enumerable:!0,get:function(){return f(_e).default}});var it=ZI;Object.defineProperty(t,"zhCN",{enumerable:!0,get:function(){return f(it).default}});var We=LI;Object.defineProperty(t,"zhTW",{enumerable:!0,get:function(){return f(We).default}});var Ye=UI;Object.defineProperty(t,"yo",{enumerable:!0,get:function(){return f(Ye).default}})})(Ki);var Ut={},Kf;Object.defineProperty(Ut,"__esModule",{value:!0});Ut.globalRegistry=Ut.$ZodRegistry=Ut.$input=Ut.$output=void 0;Ut.registry=pm;Ut.$output=Symbol("ZodOutput");Ut.$input=Symbol("ZodInput");class gm{constructor(){this._map=new WeakMap,this._idmap=new Map}add(f,...k){const C=k[0];return this._map.set(f,C),C&&typeof C=="object"&&"id"in C&&this._idmap.set(C.id,f),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(f){const k=this._map.get(f);return k&&typeof k=="object"&&"id"in k&&this._idmap.delete(k.id),this._map.delete(f),this}get(f){const k=f._zod.parent;if(k){const C={...this.get(k)??{}};delete C.id;const x={...C,...this._map.get(f)};return Object.keys(x).length?x:void 0}return this._map.get(f)}has(f){return this._map.has(f)}}Ut.$ZodRegistry=gm;function pm(){return new gm}(Kf=globalThis).__zod_globalRegistry??(Kf.__zod_globalRegistry=pm());Ut.globalRegistry=globalThis.__zod_globalRegistry;var se={},BI=se&&se.__createBinding||(Object.create?(function(t,f,k,C){C===void 0&&(C=k);var x=Object.getOwnPropertyDescriptor(f,k);(!x||("get"in x?!f.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return f[k]}}),Object.defineProperty(t,C,x)}):(function(t,f,k,C){C===void 0&&(C=k),t[C]=f[k]})),FI=se&&se.__setModuleDefault||(Object.create?(function(t,f){Object.defineProperty(t,"default",{enumerable:!0,value:f})}):function(t,f){t.default=f}),Ho=se&&se.__importStar||function(t){if(t&&t.__esModule)return t;var f={};if(t!=null)for(var k in t)k!=="default"&&Object.prototype.hasOwnProperty.call(t,k)&&BI(f,t,k);return FI(f,t),f};Object.defineProperty(se,"__esModule",{value:!0});se.TimePrecision=void 0;se._string=GI;se._coercedString=VI;se._email=QI;se._guid=WI;se._uuid=qI;se._uuidv4=HI;se._uuidv6=JI;se._uuidv7=KI;se._url=XI;se._emoji=YI;se._nanoid=eE;se._cuid=tE;se._cuid2=rE;se._ulid=nE;se._xid=iE;se._ksuid=aE;se._ipv4=oE;se._ipv6=sE;se._mac=cE;se._cidrv4=lE;se._cidrv6=uE;se._base64=dE;se._base64url=fE;se._e164=mE;se._jwt=gE;se._isoDateTime=pE;se._isoDate=vE;se._isoTime=hE;se._isoDuration=bE;se._number=yE;se._coercedNumber=_E;se._int=xE;se._float32=wE;se._float64=SE;se._int32=jE;se._uint32=$E;se._boolean=kE;se._coercedBoolean=PE;se._bigint=NE;se._coercedBigint=OE;se._int64=CE;se._uint64=IE;se._symbol=EE;se._undefined=ME;se._null=DE;se._any=AE;se._unknown=zE;se._never=TE;se._void=RE;se._date=ZE;se._coercedDate=LE;se._nan=UE;se._lt=vm;se._lte=ea;se._max=ea;se._lte=ea;se._max=ea;se._gt=hm;se._gte=ta;se._min=ta;se._gte=ta;se._min=ta;se._positive=BE;se._negative=FE;se._nonpositive=GE;se._nonnegative=VE;se._multipleOf=QE;se._maxSize=WE;se._minSize=qE;se._size=HE;se._maxLength=JE;se._minLength=KE;se._length=XE;se._regex=YE;se._lowercase=e2;se._uppercase=t2;se._includes=r2;se._startsWith=n2;se._endsWith=i2;se._property=a2;se._mime=o2;se._overwrite=wi;se._normalize=s2;se._trim=c2;se._toLowerCase=l2;se._toUpperCase=u2;se._slugify=d2;se._array=f2;se._union=m2;se._xor=g2;se._discriminatedUnion=p2;se._intersection=v2;se._tuple=h2;se._record=b2;se._map=y2;se._set=_2;se._enum=x2;se._nativeEnum=w2;se._literal=S2;se._file=j2;se._transform=$2;se._optional=k2;se._nullable=P2;se._default=N2;se._nonoptional=O2;se._success=C2;se._catch=I2;se._pipe=E2;se._readonly=M2;se._templateLiteral=D2;se._lazy=A2;se._promise=z2;se._custom=T2;se._refine=R2;se._superRefine=Z2;se._check=bm;se.describe=L2;se.meta=U2;se._stringbool=B2;se._stringFormat=F2;const St=Ho(vr),Vo=Ho(Ut),Va=Ho(Pr),ve=Ho(ae);function GI(t,f){return new t({type:"string",...ve.normalizeParams(f)})}function VI(t,f){return new t({type:"string",coerce:!0,...ve.normalizeParams(f)})}function QI(t,f){return new t({type:"string",format:"email",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function WI(t,f){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function qI(t,f){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function HI(t,f){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ve.normalizeParams(f)})}function JI(t,f){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ve.normalizeParams(f)})}function KI(t,f){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ve.normalizeParams(f)})}function XI(t,f){return new t({type:"string",format:"url",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function YI(t,f){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function eE(t,f){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function tE(t,f){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function rE(t,f){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function nE(t,f){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function iE(t,f){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function aE(t,f){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function oE(t,f){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function sE(t,f){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function cE(t,f){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function lE(t,f){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function uE(t,f){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function dE(t,f){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function fE(t,f){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function mE(t,f){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...ve.normalizeParams(f)})}function gE(t,f){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...ve.normalizeParams(f)})}se.TimePrecision={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function pE(t,f){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ve.normalizeParams(f)})}function vE(t,f){return new t({type:"string",format:"date",check:"string_format",...ve.normalizeParams(f)})}function hE(t,f){return new t({type:"string",format:"time",check:"string_format",precision:null,...ve.normalizeParams(f)})}function bE(t,f){return new t({type:"string",format:"duration",check:"string_format",...ve.normalizeParams(f)})}function yE(t,f){return new t({type:"number",checks:[],...ve.normalizeParams(f)})}function _E(t,f){return new t({type:"number",coerce:!0,checks:[],...ve.normalizeParams(f)})}function xE(t,f){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...ve.normalizeParams(f)})}function wE(t,f){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...ve.normalizeParams(f)})}function SE(t,f){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...ve.normalizeParams(f)})}function jE(t,f){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...ve.normalizeParams(f)})}function $E(t,f){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...ve.normalizeParams(f)})}function kE(t,f){return new t({type:"boolean",...ve.normalizeParams(f)})}function PE(t,f){return new t({type:"boolean",coerce:!0,...ve.normalizeParams(f)})}function NE(t,f){return new t({type:"bigint",...ve.normalizeParams(f)})}function OE(t,f){return new t({type:"bigint",coerce:!0,...ve.normalizeParams(f)})}function CE(t,f){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ve.normalizeParams(f)})}function IE(t,f){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ve.normalizeParams(f)})}function EE(t,f){return new t({type:"symbol",...ve.normalizeParams(f)})}function ME(t,f){return new t({type:"undefined",...ve.normalizeParams(f)})}function DE(t,f){return new t({type:"null",...ve.normalizeParams(f)})}function AE(t){return new t({type:"any"})}function zE(t){return new t({type:"unknown"})}function TE(t,f){return new t({type:"never",...ve.normalizeParams(f)})}function RE(t,f){return new t({type:"void",...ve.normalizeParams(f)})}function ZE(t,f){return new t({type:"date",...ve.normalizeParams(f)})}function LE(t,f){return new t({type:"date",coerce:!0,...ve.normalizeParams(f)})}function UE(t,f){return new t({type:"nan",...ve.normalizeParams(f)})}function vm(t,f){return new St.$ZodCheckLessThan({check:"less_than",...ve.normalizeParams(f),value:t,inclusive:!1})}function ea(t,f){return new St.$ZodCheckLessThan({check:"less_than",...ve.normalizeParams(f),value:t,inclusive:!0})}function hm(t,f){return new St.$ZodCheckGreaterThan({check:"greater_than",...ve.normalizeParams(f),value:t,inclusive:!1})}function ta(t,f){return new St.$ZodCheckGreaterThan({check:"greater_than",...ve.normalizeParams(f),value:t,inclusive:!0})}function BE(t){return hm(0,t)}function FE(t){return vm(0,t)}function GE(t){return ea(0,t)}function VE(t){return ta(0,t)}function QE(t,f){return new St.$ZodCheckMultipleOf({check:"multiple_of",...ve.normalizeParams(f),value:t})}function WE(t,f){return new St.$ZodCheckMaxSize({check:"max_size",...ve.normalizeParams(f),maximum:t})}function qE(t,f){return new St.$ZodCheckMinSize({check:"min_size",...ve.normalizeParams(f),minimum:t})}function HE(t,f){return new St.$ZodCheckSizeEquals({check:"size_equals",...ve.normalizeParams(f),size:t})}function JE(t,f){return new St.$ZodCheckMaxLength({check:"max_length",...ve.normalizeParams(f),maximum:t})}function KE(t,f){return new St.$ZodCheckMinLength({check:"min_length",...ve.normalizeParams(f),minimum:t})}function XE(t,f){return new St.$ZodCheckLengthEquals({check:"length_equals",...ve.normalizeParams(f),length:t})}function YE(t,f){return new St.$ZodCheckRegex({check:"string_format",format:"regex",...ve.normalizeParams(f),pattern:t})}function e2(t){return new St.$ZodCheckLowerCase({check:"string_format",format:"lowercase",...ve.normalizeParams(t)})}function t2(t){return new St.$ZodCheckUpperCase({check:"string_format",format:"uppercase",...ve.normalizeParams(t)})}function r2(t,f){return new St.$ZodCheckIncludes({check:"string_format",format:"includes",...ve.normalizeParams(f),includes:t})}function n2(t,f){return new St.$ZodCheckStartsWith({check:"string_format",format:"starts_with",...ve.normalizeParams(f),prefix:t})}function i2(t,f){return new St.$ZodCheckEndsWith({check:"string_format",format:"ends_with",...ve.normalizeParams(f),suffix:t})}function a2(t,f,k){return new St.$ZodCheckProperty({check:"property",property:t,schema:f,...ve.normalizeParams(k)})}function o2(t,f){return new St.$ZodCheckMimeType({check:"mime_type",mime:t,...ve.normalizeParams(f)})}function wi(t){return new St.$ZodCheckOverwrite({check:"overwrite",tx:t})}function s2(t){return wi(f=>f.normalize(t))}function c2(){return wi(t=>t.trim())}function l2(){return wi(t=>t.toLowerCase())}function u2(){return wi(t=>t.toUpperCase())}function d2(){return wi(t=>ve.slugify(t))}function f2(t,f,k){return new t({type:"array",element:f,...ve.normalizeParams(k)})}function m2(t,f,k){return new t({type:"union",options:f,...ve.normalizeParams(k)})}function g2(t,f,k){return new t({type:"union",options:f,inclusive:!1,...ve.normalizeParams(k)})}function p2(t,f,k,C){return new t({type:"union",options:k,discriminator:f,...ve.normalizeParams(C)})}function v2(t,f,k){return new t({type:"intersection",left:f,right:k})}function h2(t,f,k,C){const x=k instanceof Va.$ZodType,S=x?C:k,z=x?k:null;return new t({type:"tuple",items:f,rest:z,...ve.normalizeParams(S)})}function b2(t,f,k,C){return new t({type:"record",keyType:f,valueType:k,...ve.normalizeParams(C)})}function y2(t,f,k,C){return new t({type:"map",keyType:f,valueType:k,...ve.normalizeParams(C)})}function _2(t,f,k){return new t({type:"set",valueType:f,...ve.normalizeParams(k)})}function x2(t,f,k){const C=Array.isArray(f)?Object.fromEntries(f.map(x=>[x,x])):f;return new t({type:"enum",entries:C,...ve.normalizeParams(k)})}function w2(t,f,k){return new t({type:"enum",entries:f,...ve.normalizeParams(k)})}function S2(t,f,k){return new t({type:"literal",values:Array.isArray(f)?f:[f],...ve.normalizeParams(k)})}function j2(t,f){return new t({type:"file",...ve.normalizeParams(f)})}function $2(t,f){return new t({type:"transform",transform:f})}function k2(t,f){return new t({type:"optional",innerType:f})}function P2(t,f){return new t({type:"nullable",innerType:f})}function N2(t,f,k){return new t({type:"default",innerType:f,get defaultValue(){return typeof k=="function"?k():ve.shallowClone(k)}})}function O2(t,f,k){return new t({type:"nonoptional",innerType:f,...ve.normalizeParams(k)})}function C2(t,f){return new t({type:"success",innerType:f})}function I2(t,f,k){return new t({type:"catch",innerType:f,catchValue:typeof k=="function"?k:()=>k})}function E2(t,f,k){return new t({type:"pipe",in:f,out:k})}function M2(t,f){return new t({type:"readonly",innerType:f})}function D2(t,f,k){return new t({type:"template_literal",parts:f,...ve.normalizeParams(k)})}function A2(t,f){return new t({type:"lazy",getter:f})}function z2(t,f){return new t({type:"promise",innerType:f})}function T2(t,f,k){const C=ve.normalizeParams(k);return C.abort??(C.abort=!0),new t({type:"custom",check:"custom",fn:f,...C})}function R2(t,f,k){return new t({type:"custom",check:"custom",fn:f,...ve.normalizeParams(k)})}function Z2(t,f){const k=bm(C=>(C.addIssue=x=>{if(typeof x=="string")C.issues.push(ve.issue(x,C.value,k._zod.def));else{const S=x;S.fatal&&(S.continue=!1),S.code??(S.code="custom"),S.input??(S.input=C.value),S.inst??(S.inst=k),S.continue??(S.continue=!k._zod.def.abort),C.issues.push(ve.issue(S))}},t(C.value,C)),f);return k}function bm(t,f){const k=new St.$ZodCheck({check:"custom",...ve.normalizeParams(f)});return k._zod.check=t,k}function L2(t){const f=new St.$ZodCheck({check:"describe"});return f._zod.onattach=[k=>{const C=Vo.globalRegistry.get(k)??{};Vo.globalRegistry.add(k,{...C,description:t})}],f._zod.check=()=>{},f}function U2(t){const f=new St.$ZodCheck({check:"meta"});return f._zod.onattach=[k=>{const C=Vo.globalRegistry.get(k)??{};Vo.globalRegistry.add(k,{...C,...t})}],f._zod.check=()=>{},f}function B2(t,f){const k=ve.normalizeParams(f);let C=k.truthy??["true","1","yes","on","y","enabled"],x=k.falsy??["false","0","no","off","n","disabled"];k.case!=="sensitive"&&(C=C.map(r=>typeof r=="string"?r.toLowerCase():r),x=x.map(r=>typeof r=="string"?r.toLowerCase():r));const S=new Set(C),z=new Set(x),U=t.Codec??Va.$ZodCodec,c=t.Boolean??Va.$ZodBoolean,s=t.String??Va.$ZodString,u=new s({type:"string",error:k.error}),g=new c({type:"boolean",error:k.error}),n=new U({type:"pipe",in:u,out:g,transform:((r,_)=>{let M=r;return k.case!=="sensitive"&&(M=M.toLowerCase()),S.has(M)?!0:z.has(M)?!1:(_.issues.push({code:"invalid_value",expected:"stringbool",values:[...S,...z],input:_.value,inst:n,continue:!1}),{})}),reverseTransform:((r,_)=>r===!0?C[0]||"true":x[0]||"false"),error:k.error});return n}function F2(t,f,k,C={}){const x=ve.normalizeParams(C),S={...ve.normalizeParams(C),check:"string_format",type:"string",format:f,fn:typeof k=="function"?k:U=>k.test(U),...x};return k instanceof RegExp&&(S.pattern=k),new t(S)}var ra={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createStandardJSONSchemaMethod=t.createToJSONSchemaMethod=void 0,t.initializeContext=k,t.process=C,t.extractDefs=x,t.finalize=S;const f=Ut;function k(s){let u=s?.target??"draft-2020-12";return u==="draft-4"&&(u="draft-04"),u==="draft-7"&&(u="draft-07"),{processors:s.processors??{},metadataRegistry:s?.metadata??f.globalRegistry,target:u,unrepresentable:s?.unrepresentable??"throw",override:s?.override??(()=>{}),io:s?.io??"output",counter:0,seen:new Map,cycles:s?.cycles??"ref",reused:s?.reused??"inline",external:s?.external??void 0}}function C(s,u,g={path:[],schemaPath:[]}){var n;const r=s._zod.def,_=u.seen.get(s);if(_)return _.count++,g.schemaPath.includes(s)&&(_.cycle=g.path),_.schema;const M={schema:{},count:1,cycle:void 0,path:g.path};u.seen.set(s,M);const ee=s._zod.toJSONSchema?.();if(ee)M.schema=ee;else{const Q={...g,schemaPath:[...g.schemaPath,s],path:g.path};if(s._zod.processJSONSchema)s._zod.processJSONSchema(u,M.schema,Q);else{const xe=M.schema,he=u.processors[r.type];if(!he)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);he(s,u,xe,Q)}const ge=s._zod.parent;ge&&(M.ref||(M.ref=ge),C(ge,u,Q),u.seen.get(ge).isParent=!0)}const X=u.metadataRegistry.get(s);return X&&Object.assign(M.schema,X),u.io==="input"&&z(s)&&(delete M.schema.examples,delete M.schema.default),u.io==="input"&&"_prefault"in M.schema&&((n=M.schema).default??(n.default=M.schema._prefault)),delete M.schema._prefault,u.seen.get(s).schema}function x(s,u){const g=s.seen.get(u);if(!g)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const M of s.seen.entries()){const ee=s.metadataRegistry.get(M[0])?.id;if(ee){const X=n.get(ee);if(X&&X!==M[0])throw new Error(`Duplicate schema id "${ee}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(ee,M[0])}}const r=M=>{const ee=s.target==="draft-2020-12"?"$defs":"definitions";if(s.external){const ge=s.external.registry.get(M[0])?.id,xe=s.external.uri??(be=>be);if(ge)return{ref:xe(ge)};const he=M[1].defId??M[1].schema.id??`schema${s.counter++}`;return M[1].defId=he,{defId:he,ref:`${xe("__shared")}#/${ee}/${he}`}}if(M[1]===g)return{ref:"#"};const ie=`#/${ee}/`,Q=M[1].schema.id??`__schema${s.counter++}`;return{defId:Q,ref:ie+Q}},_=M=>{if(M[1].schema.$ref)return;const ee=M[1],{ref:X,defId:ie}=r(M);ee.def={...ee.schema},ie&&(ee.defId=ie);const Q=ee.schema;for(const ge in Q)delete Q[ge];Q.$ref=X};if(s.cycles==="throw")for(const M of s.seen.entries()){const ee=M[1];if(ee.cycle)throw new Error(`Cycle detected: #/${ee.cycle?.join("/")}/<root>
93
-
94
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const M of s.seen.entries()){const ee=M[1];if(u===M[0]){_(M);continue}if(s.external){const ie=s.external.registry.get(M[0])?.id;if(u!==M[0]&&ie){_(M);continue}}if(s.metadataRegistry.get(M[0])?.id){_(M);continue}if(ee.cycle){_(M);continue}if(ee.count>1&&s.reused==="ref"){_(M);continue}}}function S(s,u){const g=s.seen.get(u);if(!g)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=ee=>{const X=s.seen.get(ee);if(X.ref===null)return;const ie=X.def??X.schema,Q={...ie},ge=X.ref;if(X.ref=null,ge){n(ge);const he=s.seen.get(ge),be=he.schema;if(be.$ref&&(s.target==="draft-07"||s.target==="draft-04"||s.target==="openapi-3.0")?(ie.allOf=ie.allOf??[],ie.allOf.push(be)):Object.assign(ie,be),Object.assign(ie,Q),ee._zod.parent===ge)for(const Me in ie)Me==="$ref"||Me==="allOf"||Me in Q||delete ie[Me];if(be.$ref&&he.def)for(const Me in ie)Me==="$ref"||Me==="allOf"||Me in he.def&&JSON.stringify(ie[Me])===JSON.stringify(he.def[Me])&&delete ie[Me]}const xe=ee._zod.parent;if(xe&&xe!==ge){n(xe);const he=s.seen.get(xe);if(he?.schema.$ref&&(ie.$ref=he.schema.$ref,he.def))for(const be in ie)be==="$ref"||be==="allOf"||be in he.def&&JSON.stringify(ie[be])===JSON.stringify(he.def[be])&&delete ie[be]}s.override({zodSchema:ee,jsonSchema:ie,path:X.path??[]})};for(const ee of[...s.seen.entries()].reverse())n(ee[0]);const r={};if(s.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":s.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":s.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":s.target,s.external?.uri){const ee=s.external.registry.get(u)?.id;if(!ee)throw new Error("Schema is missing an `id` property");r.$id=s.external.uri(ee)}Object.assign(r,g.def??g.schema);const _=s.metadataRegistry.get(u)?.id;_!==void 0&&r.id===_&&delete r.id;const M=s.external?.defs??{};for(const ee of s.seen.entries()){const X=ee[1];X.def&&X.defId&&(X.def.id===X.defId&&delete X.def.id,M[X.defId]=X.def)}s.external||Object.keys(M).length>0&&(s.target==="draft-2020-12"?r.$defs=M:r.definitions=M);try{const ee=JSON.parse(JSON.stringify(r));return Object.defineProperty(ee,"~standard",{value:{...u["~standard"],jsonSchema:{input:(0,t.createStandardJSONSchemaMethod)(u,"input",s.processors),output:(0,t.createStandardJSONSchemaMethod)(u,"output",s.processors)}},enumerable:!1,writable:!1}),ee}catch{throw new Error("Error converting schema to JSON.")}}function z(s,u){const g=u??{seen:new Set};if(g.seen.has(s))return!1;g.seen.add(s);const n=s._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return z(n.element,g);if(n.type==="set")return z(n.valueType,g);if(n.type==="lazy")return z(n.getter(),g);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return z(n.innerType,g);if(n.type==="intersection")return z(n.left,g)||z(n.right,g);if(n.type==="record"||n.type==="map")return z(n.keyType,g)||z(n.valueType,g);if(n.type==="pipe")return s._zod.traits.has("$ZodCodec")?!0:z(n.in,g)||z(n.out,g);if(n.type==="object"){for(const r in n.shape)if(z(n.shape[r],g))return!0;return!1}if(n.type==="union"){for(const r of n.options)if(z(r,g))return!0;return!1}if(n.type==="tuple"){for(const r of n.items)if(z(r,g))return!0;return!!(n.rest&&z(n.rest,g))}return!1}const U=(s,u={})=>g=>{const n=k({...g,processors:u});return C(s,n),x(n,s),S(n,s)};t.createToJSONSchemaMethod=U;const c=(s,u,g={})=>n=>{const{libraryOptions:r,target:_}=n??{},M=k({...r??{},target:_,io:u,processors:g});return C(s,M),x(M,s),S(M,s)};t.createStandardJSONSchemaMethod=c})(ra);var na={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.allProcessors=t.lazyProcessor=t.optionalProcessor=t.promiseProcessor=t.readonlyProcessor=t.pipeProcessor=t.catchProcessor=t.prefaultProcessor=t.defaultProcessor=t.nonoptionalProcessor=t.nullableProcessor=t.recordProcessor=t.tupleProcessor=t.intersectionProcessor=t.unionProcessor=t.objectProcessor=t.arrayProcessor=t.setProcessor=t.mapProcessor=t.transformProcessor=t.functionProcessor=t.customProcessor=t.successProcessor=t.fileProcessor=t.templateLiteralProcessor=t.nanProcessor=t.literalProcessor=t.enumProcessor=t.dateProcessor=t.unknownProcessor=t.anyProcessor=t.neverProcessor=t.voidProcessor=t.undefinedProcessor=t.nullProcessor=t.symbolProcessor=t.bigintProcessor=t.booleanProcessor=t.numberProcessor=t.stringProcessor=void 0,t.toJSONSchema=me;const f=ra,k=ae,C={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},x=(H,q,oe,fe)=>{const J=oe;J.type="string";const{minimum:le,maximum:_e,format:it,patterns:We,contentEncoding:Ye}=H._zod.bag;if(typeof le=="number"&&(J.minLength=le),typeof _e=="number"&&(J.maxLength=_e),it&&(J.format=C[it]??it,J.format===""&&delete J.format,it==="time"&&delete J.format),Ye&&(J.contentEncoding=Ye),We&&We.size>0){const at=[...We];at.length===1?J.pattern=at[0].source:at.length>1&&(J.allOf=[...at.map(yt=>({...q.target==="draft-07"||q.target==="draft-04"||q.target==="openapi-3.0"?{type:"string"}:{},pattern:yt.source}))])}};t.stringProcessor=x;const S=(H,q,oe,fe)=>{const J=oe,{minimum:le,maximum:_e,format:it,multipleOf:We,exclusiveMaximum:Ye,exclusiveMinimum:at}=H._zod.bag;typeof it=="string"&&it.includes("int")?J.type="integer":J.type="number";const yt=typeof at=="number"&&at>=(le??Number.NEGATIVE_INFINITY),Ze=typeof Ye=="number"&&Ye<=(_e??Number.POSITIVE_INFINITY),gt=q.target==="draft-04"||q.target==="openapi-3.0";yt?gt?(J.minimum=at,J.exclusiveMinimum=!0):J.exclusiveMinimum=at:typeof le=="number"&&(J.minimum=le),Ze?gt?(J.maximum=Ye,J.exclusiveMaximum=!0):J.exclusiveMaximum=Ye:typeof _e=="number"&&(J.maximum=_e),typeof We=="number"&&(J.multipleOf=We)};t.numberProcessor=S;const z=(H,q,oe,fe)=>{oe.type="boolean"};t.booleanProcessor=z;const U=(H,q,oe,fe)=>{if(q.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")};t.bigintProcessor=U;const c=(H,q,oe,fe)=>{if(q.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")};t.symbolProcessor=c;const s=(H,q,oe,fe)=>{q.target==="openapi-3.0"?(oe.type="string",oe.nullable=!0,oe.enum=[null]):oe.type="null"};t.nullProcessor=s;const u=(H,q,oe,fe)=>{if(q.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")};t.undefinedProcessor=u;const g=(H,q,oe,fe)=>{if(q.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")};t.voidProcessor=g;const n=(H,q,oe,fe)=>{oe.not={}};t.neverProcessor=n;const r=(H,q,oe,fe)=>{};t.anyProcessor=r;const _=(H,q,oe,fe)=>{};t.unknownProcessor=_;const M=(H,q,oe,fe)=>{if(q.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")};t.dateProcessor=M;const ee=(H,q,oe,fe)=>{const J=H._zod.def,le=(0,k.getEnumValues)(J.entries);le.every(_e=>typeof _e=="number")&&(oe.type="number"),le.every(_e=>typeof _e=="string")&&(oe.type="string"),oe.enum=le};t.enumProcessor=ee;const X=(H,q,oe,fe)=>{const J=H._zod.def,le=[];for(const _e of J.values)if(_e===void 0){if(q.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof _e=="bigint"){if(q.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");le.push(Number(_e))}else le.push(_e);if(le.length!==0)if(le.length===1){const _e=le[0];oe.type=_e===null?"null":typeof _e,q.target==="draft-04"||q.target==="openapi-3.0"?oe.enum=[_e]:oe.const=_e}else le.every(_e=>typeof _e=="number")&&(oe.type="number"),le.every(_e=>typeof _e=="string")&&(oe.type="string"),le.every(_e=>typeof _e=="boolean")&&(oe.type="boolean"),le.every(_e=>_e===null)&&(oe.type="null"),oe.enum=le};t.literalProcessor=X;const ie=(H,q,oe,fe)=>{if(q.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")};t.nanProcessor=ie;const Q=(H,q,oe,fe)=>{const J=oe,le=H._zod.pattern;if(!le)throw new Error("Pattern not found in template literal");J.type="string",J.pattern=le.source};t.templateLiteralProcessor=Q;const ge=(H,q,oe,fe)=>{const J=oe,le={type:"string",format:"binary",contentEncoding:"binary"},{minimum:_e,maximum:it,mime:We}=H._zod.bag;_e!==void 0&&(le.minLength=_e),it!==void 0&&(le.maxLength=it),We?We.length===1?(le.contentMediaType=We[0],Object.assign(J,le)):(Object.assign(J,le),J.anyOf=We.map(Ye=>({contentMediaType:Ye}))):Object.assign(J,le)};t.fileProcessor=ge;const xe=(H,q,oe,fe)=>{oe.type="boolean"};t.successProcessor=xe;const he=(H,q,oe,fe)=>{if(q.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};t.customProcessor=he;const be=(H,q,oe,fe)=>{if(q.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")};t.functionProcessor=be;const Te=(H,q,oe,fe)=>{if(q.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};t.transformProcessor=Te;const Me=(H,q,oe,fe)=>{if(q.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")};t.mapProcessor=Me;const nt=(H,q,oe,fe)=>{if(q.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")};t.setProcessor=nt;const ht=(H,q,oe,fe)=>{const J=oe,le=H._zod.def,{minimum:_e,maximum:it}=H._zod.bag;typeof _e=="number"&&(J.minItems=_e),typeof it=="number"&&(J.maxItems=it),J.type="array",J.items=(0,f.process)(le.element,q,{...fe,path:[...fe.path,"items"]})};t.arrayProcessor=ht;const Ct=(H,q,oe,fe)=>{const J=oe,le=H._zod.def;J.type="object",J.properties={};const _e=le.shape;for(const Ye in _e)J.properties[Ye]=(0,f.process)(_e[Ye],q,{...fe,path:[...fe.path,"properties",Ye]});const it=new Set(Object.keys(_e)),We=new Set([...it].filter(Ye=>{const at=le.shape[Ye]._zod;return q.io==="input"?at.optin===void 0:at.optout===void 0}));We.size>0&&(J.required=Array.from(We)),le.catchall?._zod.def.type==="never"?J.additionalProperties=!1:le.catchall?le.catchall&&(J.additionalProperties=(0,f.process)(le.catchall,q,{...fe,path:[...fe.path,"additionalProperties"]})):q.io==="output"&&(J.additionalProperties=!1)};t.objectProcessor=Ct;const Bt=(H,q,oe,fe)=>{const J=H._zod.def,le=J.inclusive===!1,_e=J.options.map((it,We)=>(0,f.process)(it,q,{...fe,path:[...fe.path,le?"oneOf":"anyOf",We]}));le?oe.oneOf=_e:oe.anyOf=_e};t.unionProcessor=Bt;const zt=(H,q,oe,fe)=>{const J=H._zod.def,le=(0,f.process)(J.left,q,{...fe,path:[...fe.path,"allOf",0]}),_e=(0,f.process)(J.right,q,{...fe,path:[...fe.path,"allOf",1]}),it=Ye=>"allOf"in Ye&&Object.keys(Ye).length===1,We=[...it(le)?le.allOf:[le],...it(_e)?_e.allOf:[_e]];oe.allOf=We};t.intersectionProcessor=zt;const Dt=(H,q,oe,fe)=>{const J=oe,le=H._zod.def;J.type="array";const _e=q.target==="draft-2020-12"?"prefixItems":"items",it=q.target==="draft-2020-12"||q.target==="openapi-3.0"?"items":"additionalItems",We=le.items.map((Ze,gt)=>(0,f.process)(Ze,q,{...fe,path:[...fe.path,_e,gt]})),Ye=le.rest?(0,f.process)(le.rest,q,{...fe,path:[...fe.path,it,...q.target==="openapi-3.0"?[le.items.length]:[]]}):null;q.target==="draft-2020-12"?(J.prefixItems=We,Ye&&(J.items=Ye)):q.target==="openapi-3.0"?(J.items={anyOf:We},Ye&&J.items.anyOf.push(Ye),J.minItems=We.length,Ye||(J.maxItems=We.length)):(J.items=We,Ye&&(J.additionalItems=Ye));const{minimum:at,maximum:yt}=H._zod.bag;typeof at=="number"&&(J.minItems=at),typeof yt=="number"&&(J.maxItems=yt)};t.tupleProcessor=Dt;const Lt=(H,q,oe,fe)=>{const J=oe,le=H._zod.def;J.type="object";const _e=le.keyType,We=_e._zod.bag?.patterns;if(le.mode==="loose"&&We&&We.size>0){const at=(0,f.process)(le.valueType,q,{...fe,path:[...fe.path,"patternProperties","*"]});J.patternProperties={};for(const yt of We)J.patternProperties[yt.source]=at}else(q.target==="draft-07"||q.target==="draft-2020-12")&&(J.propertyNames=(0,f.process)(le.keyType,q,{...fe,path:[...fe.path,"propertyNames"]})),J.additionalProperties=(0,f.process)(le.valueType,q,{...fe,path:[...fe.path,"additionalProperties"]});const Ye=_e._zod.values;if(Ye){const at=[...Ye].filter(yt=>typeof yt=="string"||typeof yt=="number");at.length>0&&(J.required=at)}};t.recordProcessor=Lt;const jt=(H,q,oe,fe)=>{const J=H._zod.def,le=(0,f.process)(J.innerType,q,fe),_e=q.seen.get(H);q.target==="openapi-3.0"?(_e.ref=J.innerType,oe.nullable=!0):oe.anyOf=[le,{type:"null"}]};t.nullableProcessor=jt;const Ft=(H,q,oe,fe)=>{const J=H._zod.def;(0,f.process)(J.innerType,q,fe);const le=q.seen.get(H);le.ref=J.innerType};t.nonoptionalProcessor=Ft;const Kt=(H,q,oe,fe)=>{const J=H._zod.def;(0,f.process)(J.innerType,q,fe);const le=q.seen.get(H);le.ref=J.innerType,oe.default=JSON.parse(JSON.stringify(J.defaultValue))};t.defaultProcessor=Kt;const $=(H,q,oe,fe)=>{const J=H._zod.def;(0,f.process)(J.innerType,q,fe);const le=q.seen.get(H);le.ref=J.innerType,q.io==="input"&&(oe._prefault=JSON.parse(JSON.stringify(J.defaultValue)))};t.prefaultProcessor=$;const P=(H,q,oe,fe)=>{const J=H._zod.def;(0,f.process)(J.innerType,q,fe);const le=q.seen.get(H);le.ref=J.innerType;let _e;try{_e=J.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}oe.default=_e};t.catchProcessor=P;const I=(H,q,oe,fe)=>{const J=H._zod.def,le=J.in._zod.traits.has("$ZodTransform"),_e=q.io==="input"?le?J.out:J.in:J.out;(0,f.process)(_e,q,fe);const it=q.seen.get(H);it.ref=_e};t.pipeProcessor=I;const L=(H,q,oe,fe)=>{const J=H._zod.def;(0,f.process)(J.innerType,q,fe);const le=q.seen.get(H);le.ref=J.innerType,oe.readOnly=!0};t.readonlyProcessor=L;const F=(H,q,oe,fe)=>{const J=H._zod.def;(0,f.process)(J.innerType,q,fe);const le=q.seen.get(H);le.ref=J.innerType};t.promiseProcessor=F;const W=(H,q,oe,fe)=>{const J=H._zod.def;(0,f.process)(J.innerType,q,fe);const le=q.seen.get(H);le.ref=J.innerType};t.optionalProcessor=W;const ne=(H,q,oe,fe)=>{const J=H._zod.innerType;(0,f.process)(J,q,fe);const le=q.seen.get(H);le.ref=J};t.lazyProcessor=ne,t.allProcessors={string:t.stringProcessor,number:t.numberProcessor,boolean:t.booleanProcessor,bigint:t.bigintProcessor,symbol:t.symbolProcessor,null:t.nullProcessor,undefined:t.undefinedProcessor,void:t.voidProcessor,never:t.neverProcessor,any:t.anyProcessor,unknown:t.unknownProcessor,date:t.dateProcessor,enum:t.enumProcessor,literal:t.literalProcessor,nan:t.nanProcessor,template_literal:t.templateLiteralProcessor,file:t.fileProcessor,success:t.successProcessor,custom:t.customProcessor,function:t.functionProcessor,transform:t.transformProcessor,map:t.mapProcessor,set:t.setProcessor,array:t.arrayProcessor,object:t.objectProcessor,union:t.unionProcessor,intersection:t.intersectionProcessor,tuple:t.tupleProcessor,record:t.recordProcessor,nullable:t.nullableProcessor,nonoptional:t.nonoptionalProcessor,default:t.defaultProcessor,prefault:t.prefaultProcessor,catch:t.catchProcessor,pipe:t.pipeProcessor,readonly:t.readonlyProcessor,promise:t.promiseProcessor,optional:t.optionalProcessor,lazy:t.lazyProcessor};function me(H,q){if("_idmap"in H){const fe=H,J=(0,f.initializeContext)({...q,processors:t.allProcessors}),le={};for(const We of fe._idmap.entries()){const[Ye,at]=We;(0,f.process)(at,J)}const _e={},it={registry:fe,uri:q?.uri,defs:le};J.external=it;for(const We of fe._idmap.entries()){const[Ye,at]=We;(0,f.extractDefs)(J,at),_e[Ye]=(0,f.finalize)(J,at)}if(Object.keys(le).length>0){const We=J.target==="draft-2020-12"?"$defs":"definitions";_e.__shared={[We]:le}}return{schemas:_e}}const oe=(0,f.initializeContext)({...q,processors:t.allProcessors});return(0,f.process)(H,oe),(0,f.extractDefs)(oe,H),(0,f.finalize)(oe,H)}})(na);var Jo={};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.JSONSchemaGenerator=void 0;const G2=na,Ga=ra;class V2{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(f){this.ctx.counter=f}get seen(){return this.ctx.seen}constructor(f){let k=f?.target??"draft-2020-12";k==="draft-4"&&(k="draft-04"),k==="draft-7"&&(k="draft-07"),this.ctx=(0,Ga.initializeContext)({processors:G2.allProcessors,target:k,...f?.metadata&&{metadata:f.metadata},...f?.unrepresentable&&{unrepresentable:f.unrepresentable},...f?.override&&{override:f.override},...f?.io&&{io:f.io}})}process(f,k={path:[],schemaPath:[]}){return(0,Ga.process)(f,this.ctx,k)}emit(f,k){k&&(k.cycles&&(this.ctx.cycles=k.cycles),k.reused&&(this.ctx.reused=k.reused),k.external&&(this.ctx.external=k.external)),(0,Ga.extractDefs)(this.ctx,f);const C=(0,Ga.finalize)(this.ctx,f),{"~standard":x,...S}=C;return S}}Jo.JSONSchemaGenerator=V2;var ym={};Object.defineProperty(ym,"__esModule",{value:!0});(function(t){var f=Nt&&Nt.__createBinding||(Object.create?(function(U,c,s,u){u===void 0&&(u=s);var g=Object.getOwnPropertyDescriptor(c,s);(!g||("get"in g?!c.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return c[s]}}),Object.defineProperty(U,u,g)}):(function(U,c,s,u){u===void 0&&(u=s),U[u]=c[s]})),k=Nt&&Nt.__setModuleDefault||(Object.create?(function(U,c){Object.defineProperty(U,"default",{enumerable:!0,value:c})}):function(U,c){U.default=c}),C=Nt&&Nt.__exportStar||function(U,c){for(var s in U)s!=="default"&&!Object.prototype.hasOwnProperty.call(c,s)&&f(c,U,s)},x=Nt&&Nt.__importStar||function(U){if(U&&U.__esModule)return U;var c={};if(U!=null)for(var s in U)s!=="default"&&Object.prototype.hasOwnProperty.call(U,s)&&f(c,U,s);return k(c,U),c};Object.defineProperty(t,"__esModule",{value:!0}),t.JSONSchema=t.JSONSchemaGenerator=t.toJSONSchema=t.locales=t.regexes=t.util=void 0,C(Yr,t),C(kr,t),C(Et,t),C(Pr,t),C(vr,t),C(Yi,t),t.util=x(ae),t.regexes=x(hr),t.locales=x(Ki),C(Ut,t),C(Xi,t),C(se,t),C(ra,t);var S=na;Object.defineProperty(t,"toJSONSchema",{enumerable:!0,get:function(){return S.toJSONSchema}});var z=Jo;Object.defineProperty(t,"JSONSchemaGenerator",{enumerable:!0,get:function(){return z.JSONSchemaGenerator}}),t.JSONSchema=x(ym)})(Nt);var jr={},Ko={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.slugify=t.toUpperCase=t.toLowerCase=t.trim=t.normalize=t.overwrite=t.mime=t.property=t.endsWith=t.startsWith=t.includes=t.uppercase=t.lowercase=t.regex=t.length=t.minLength=t.maxLength=t.size=t.minSize=t.maxSize=t.multipleOf=t.nonnegative=t.nonpositive=t.negative=t.positive=t.gte=t.gt=t.lte=t.lt=void 0;var f=Nt;Object.defineProperty(t,"lt",{enumerable:!0,get:function(){return f._lt}}),Object.defineProperty(t,"lte",{enumerable:!0,get:function(){return f._lte}}),Object.defineProperty(t,"gt",{enumerable:!0,get:function(){return f._gt}}),Object.defineProperty(t,"gte",{enumerable:!0,get:function(){return f._gte}}),Object.defineProperty(t,"positive",{enumerable:!0,get:function(){return f._positive}}),Object.defineProperty(t,"negative",{enumerable:!0,get:function(){return f._negative}}),Object.defineProperty(t,"nonpositive",{enumerable:!0,get:function(){return f._nonpositive}}),Object.defineProperty(t,"nonnegative",{enumerable:!0,get:function(){return f._nonnegative}}),Object.defineProperty(t,"multipleOf",{enumerable:!0,get:function(){return f._multipleOf}}),Object.defineProperty(t,"maxSize",{enumerable:!0,get:function(){return f._maxSize}}),Object.defineProperty(t,"minSize",{enumerable:!0,get:function(){return f._minSize}}),Object.defineProperty(t,"size",{enumerable:!0,get:function(){return f._size}}),Object.defineProperty(t,"maxLength",{enumerable:!0,get:function(){return f._maxLength}}),Object.defineProperty(t,"minLength",{enumerable:!0,get:function(){return f._minLength}}),Object.defineProperty(t,"length",{enumerable:!0,get:function(){return f._length}}),Object.defineProperty(t,"regex",{enumerable:!0,get:function(){return f._regex}}),Object.defineProperty(t,"lowercase",{enumerable:!0,get:function(){return f._lowercase}}),Object.defineProperty(t,"uppercase",{enumerable:!0,get:function(){return f._uppercase}}),Object.defineProperty(t,"includes",{enumerable:!0,get:function(){return f._includes}}),Object.defineProperty(t,"startsWith",{enumerable:!0,get:function(){return f._startsWith}}),Object.defineProperty(t,"endsWith",{enumerable:!0,get:function(){return f._endsWith}}),Object.defineProperty(t,"property",{enumerable:!0,get:function(){return f._property}}),Object.defineProperty(t,"mime",{enumerable:!0,get:function(){return f._mime}}),Object.defineProperty(t,"overwrite",{enumerable:!0,get:function(){return f._overwrite}}),Object.defineProperty(t,"normalize",{enumerable:!0,get:function(){return f._normalize}}),Object.defineProperty(t,"trim",{enumerable:!0,get:function(){return f._trim}}),Object.defineProperty(t,"toLowerCase",{enumerable:!0,get:function(){return f._toLowerCase}}),Object.defineProperty(t,"toUpperCase",{enumerable:!0,get:function(){return f._toUpperCase}}),Object.defineProperty(t,"slugify",{enumerable:!0,get:function(){return f._slugify}})})(Ko);var $r={},Xf;function Qo(){return Xf||(Xf=1,(function(t){var f=$r&&$r.__createBinding||(Object.create?(function(u,g,n,r){r===void 0&&(r=n);var _=Object.getOwnPropertyDescriptor(g,n);(!_||("get"in _?!g.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return g[n]}}),Object.defineProperty(u,r,_)}):(function(u,g,n,r){r===void 0&&(r=n),u[r]=g[n]})),k=$r&&$r.__setModuleDefault||(Object.create?(function(u,g){Object.defineProperty(u,"default",{enumerable:!0,value:g})}):function(u,g){u.default=g}),C=$r&&$r.__importStar||function(u){if(u&&u.__esModule)return u;var g={};if(u!=null)for(var n in u)n!=="default"&&Object.prototype.hasOwnProperty.call(u,n)&&f(g,u,n);return k(g,u),g};Object.defineProperty(t,"__esModule",{value:!0}),t.ZodISODuration=t.ZodISOTime=t.ZodISODate=t.ZodISODateTime=void 0,t.datetime=z,t.date=U,t.time=c,t.duration=s;const x=C(Nt),S=C(Xo());t.ZodISODateTime=x.$constructor("ZodISODateTime",(u,g)=>{x.$ZodISODateTime.init(u,g),S.ZodStringFormat.init(u,g)});function z(u){return x._isoDateTime(t.ZodISODateTime,u)}t.ZodISODate=x.$constructor("ZodISODate",(u,g)=>{x.$ZodISODate.init(u,g),S.ZodStringFormat.init(u,g)});function U(u){return x._isoDate(t.ZodISODate,u)}t.ZodISOTime=x.$constructor("ZodISOTime",(u,g)=>{x.$ZodISOTime.init(u,g),S.ZodStringFormat.init(u,g)});function c(u){return x._isoTime(t.ZodISOTime,u)}t.ZodISODuration=x.$constructor("ZodISODuration",(u,g)=>{x.$ZodISODuration.init(u,g),S.ZodStringFormat.init(u,g)});function s(u){return x._isoDuration(t.ZodISODuration,u)}})($r)),$r}var ut={},Ht={},Q2=Ht&&Ht.__createBinding||(Object.create?(function(t,f,k,C){C===void 0&&(C=k);var x=Object.getOwnPropertyDescriptor(f,k);(!x||("get"in x?!f.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return f[k]}}),Object.defineProperty(t,C,x)}):(function(t,f,k,C){C===void 0&&(C=k),t[C]=f[k]})),W2=Ht&&Ht.__setModuleDefault||(Object.create?(function(t,f){Object.defineProperty(t,"default",{enumerable:!0,value:f})}):function(t,f){t.default=f}),_m=Ht&&Ht.__importStar||function(t){if(t&&t.__esModule)return t;var f={};if(t!=null)for(var k in t)k!=="default"&&Object.prototype.hasOwnProperty.call(t,k)&&Q2(f,t,k);return W2(f,t),f};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.ZodRealError=Ht.ZodError=void 0;const Wo=_m(Nt),q2=Nt,Yf=_m(ae),xm=(t,f)=>{q2.$ZodError.init(t,f),t.name="ZodError",Object.defineProperties(t,{format:{value:k=>Wo.formatError(t,k)},flatten:{value:k=>Wo.flattenError(t,k)},addIssue:{value:k=>{t.issues.push(k),t.message=JSON.stringify(t.issues,Yf.jsonStringifyReplacer,2)}},addIssues:{value:k=>{t.issues.push(...k),t.message=JSON.stringify(t.issues,Yf.jsonStringifyReplacer,2)}},isEmpty:{get(){return t.issues.length===0}}})};Ht.ZodError=Wo.$constructor("ZodError",xm);Ht.ZodRealError=Wo.$constructor("ZodError",xm,{Parent:Error});var H2=ut&&ut.__createBinding||(Object.create?(function(t,f,k,C){C===void 0&&(C=k);var x=Object.getOwnPropertyDescriptor(f,k);(!x||("get"in x?!f.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return f[k]}}),Object.defineProperty(t,C,x)}):(function(t,f,k,C){C===void 0&&(C=k),t[C]=f[k]})),J2=ut&&ut.__setModuleDefault||(Object.create?(function(t,f){Object.defineProperty(t,"default",{enumerable:!0,value:f})}):function(t,f){t.default=f}),K2=ut&&ut.__importStar||function(t){if(t&&t.__esModule)return t;var f={};if(t!=null)for(var k in t)k!=="default"&&Object.prototype.hasOwnProperty.call(t,k)&&H2(f,t,k);return J2(f,t),f};Object.defineProperty(ut,"__esModule",{value:!0});ut.safeDecodeAsync=ut.safeEncodeAsync=ut.safeDecode=ut.safeEncode=ut.decodeAsync=ut.encodeAsync=ut.decode=ut.encode=ut.safeParseAsync=ut.safeParse=ut.parseAsync=ut.parse=void 0;const rr=K2(Nt),nr=Ht;ut.parse=rr._parse(nr.ZodRealError);ut.parseAsync=rr._parseAsync(nr.ZodRealError);ut.safeParse=rr._safeParse(nr.ZodRealError);ut.safeParseAsync=rr._safeParseAsync(nr.ZodRealError);ut.encode=rr._encode(nr.ZodRealError);ut.decode=rr._decode(nr.ZodRealError);ut.encodeAsync=rr._encodeAsync(nr.ZodRealError);ut.decodeAsync=rr._decodeAsync(nr.ZodRealError);ut.safeEncode=rr._safeEncode(nr.ZodRealError);ut.safeDecode=rr._safeDecode(nr.ZodRealError);ut.safeEncodeAsync=rr._safeEncodeAsync(nr.ZodRealError);ut.safeDecodeAsync=rr._safeDecodeAsync(nr.ZodRealError);var em;function Xo(){return em||(em=1,(function(t){var f=jr&&jr.__createBinding||(Object.create?(function(b,D,T,B){B===void 0&&(B=T);var Y=Object.getOwnPropertyDescriptor(D,T);(!Y||("get"in Y?!D.__esModule:Y.writable||Y.configurable))&&(Y={enumerable:!0,get:function(){return D[T]}}),Object.defineProperty(b,B,Y)}):(function(b,D,T,B){B===void 0&&(B=T),b[B]=D[T]})),k=jr&&jr.__setModuleDefault||(Object.create?(function(b,D){Object.defineProperty(b,"default",{enumerable:!0,value:D})}):function(b,D){b.default=D}),C=jr&&jr.__importStar||function(b){if(b&&b.__esModule)return b;var D={};if(b!=null)for(var T in b)T!=="default"&&Object.prototype.hasOwnProperty.call(b,T)&&f(D,b,T);return k(D,b),D};Object.defineProperty(t,"__esModule",{value:!0}),t.ZodLiteral=t.ZodEnum=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodXor=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodDate=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodBigIntFormat=t.ZodBigInt=t.ZodBoolean=t.ZodNumberFormat=t.ZodNumber=t.ZodCustomStringFormat=t.ZodJWT=t.ZodE164=t.ZodBase64URL=t.ZodBase64=t.ZodCIDRv6=t.ZodCIDRv4=t.ZodIPv6=t.ZodMAC=t.ZodIPv4=t.ZodKSUID=t.ZodXID=t.ZodULID=t.ZodCUID2=t.ZodCUID=t.ZodNanoID=t.ZodEmoji=t.ZodURL=t.ZodUUID=t.ZodGUID=t.ZodEmail=t.ZodStringFormat=t.ZodString=t._ZodString=t.ZodType=void 0,t.stringbool=t.meta=t.describe=t.ZodCustom=t.ZodFunction=t.ZodPromise=t.ZodLazy=t.ZodTemplateLiteral=t.ZodReadonly=t.ZodPreprocess=t.ZodCodec=t.ZodPipe=t.ZodNaN=t.ZodCatch=t.ZodSuccess=t.ZodNonOptional=t.ZodPrefault=t.ZodDefault=t.ZodNullable=t.ZodExactOptional=t.ZodOptional=t.ZodTransform=t.ZodFile=void 0,t.string=r,t.email=_,t.guid=M,t.uuid=ee,t.uuidv4=X,t.uuidv6=ie,t.uuidv7=Q,t.url=ge,t.httpUrl=xe,t.emoji=he,t.nanoid=be,t.cuid=Te,t.cuid2=Me,t.ulid=nt,t.xid=ht,t.ksuid=Ct,t.ipv4=Bt,t.mac=zt,t.ipv6=Dt,t.cidrv4=Lt,t.cidrv6=jt,t.base64=Ft,t.base64url=Kt,t.e164=$,t.jwt=P,t.stringFormat=I,t.hostname=L,t.hex=F,t.hash=W,t.number=ne,t.int=me,t.float32=H,t.float64=q,t.int32=oe,t.uint32=fe,t.boolean=J,t.bigint=le,t.int64=_e,t.uint64=it,t.symbol=We,t.undefined=Ye,t.null=at,t.any=yt,t.unknown=Ze,t.never=gt,t.void=Lr,t.date=en,t.array=Cr,t.keyof=Yo,t.object=es,t.strictObject=ts,t.looseObject=rs,t.union=Xt,t.xor=rt,t.discriminatedUnion=lr,t.intersection=tn,t.tuple=Yt,t.record=Si,t.partialRecord=ns,t.looseRecord=ji,t.map=is,t.set=as,t.enum=$i,t.nativeEnum=os,t.literal=Ce,t.file=br,t.transform=rn,t.optional=nn,t.exactOptional=oa,t.nullable=Ur,t.nullish=ss,t._default=Br,t.prefault=Ie,t.nonoptional=Ir,t.success=cs,t.catch=ki,t.nan=ls,t.pipe=Pi,t.codec=an,t.invertCodec=us,t.readonly=ir,t.templateLiteral=yr,t.lazy=Ni,t.promise=sa,t._function=Fr,t.function=Fr,t._function=Fr,t.function=Fr,t.check=ca,t.custom=ds,t.refine=Oi,t.superRefine=Ci,t.instanceof=la,t.json=ms,t.preprocess=K;const x=C(Nt),S=Nt,z=C(na),U=ra,c=C(Ko),s=C(Qo()),u=C(ut),g=new WeakMap;function n(b,D,T){const B=Object.getPrototypeOf(b);let Y=g.get(B);if(Y||(Y=new Set,g.set(B,Y)),!Y.has(D)){Y.add(D);for(const mt in T){const $t=T[mt];Object.defineProperty(B,mt,{configurable:!0,enumerable:!1,get(){const on=$t.bind(this);return Object.defineProperty(this,mt,{configurable:!0,writable:!0,enumerable:!0,value:on}),on},set(on){Object.defineProperty(this,mt,{configurable:!0,writable:!0,enumerable:!0,value:on})}})}}}t.ZodType=x.$constructor("ZodType",(b,D)=>(x.$ZodType.init(b,D),Object.assign(b["~standard"],{jsonSchema:{input:(0,U.createStandardJSONSchemaMethod)(b,"input"),output:(0,U.createStandardJSONSchemaMethod)(b,"output")}}),b.toJSONSchema=(0,U.createToJSONSchemaMethod)(b,{}),b.def=D,b.type=D.type,Object.defineProperty(b,"_def",{value:D}),b.parse=(T,B)=>u.parse(b,T,B,{callee:b.parse}),b.safeParse=(T,B)=>u.safeParse(b,T,B),b.parseAsync=async(T,B)=>u.parseAsync(b,T,B,{callee:b.parseAsync}),b.safeParseAsync=async(T,B)=>u.safeParseAsync(b,T,B),b.spa=b.safeParseAsync,b.encode=(T,B)=>u.encode(b,T,B),b.decode=(T,B)=>u.decode(b,T,B),b.encodeAsync=async(T,B)=>u.encodeAsync(b,T,B),b.decodeAsync=async(T,B)=>u.decodeAsync(b,T,B),b.safeEncode=(T,B)=>u.safeEncode(b,T,B),b.safeDecode=(T,B)=>u.safeDecode(b,T,B),b.safeEncodeAsync=async(T,B)=>u.safeEncodeAsync(b,T,B),b.safeDecodeAsync=async(T,B)=>u.safeDecodeAsync(b,T,B),n(b,"ZodType",{check(...T){const B=this.def;return this.clone(S.util.mergeDefs(B,{checks:[...B.checks??[],...T.map(Y=>typeof Y=="function"?{_zod:{check:Y,def:{check:"custom"},onattach:[]}}:Y)]}),{parent:!0})},with(...T){return this.check(...T)},clone(T,B){return x.clone(this,T,B)},brand(){return this},register(T,B){return T.add(this,B),this},refine(T,B){return this.check(Oi(T,B))},superRefine(T,B){return this.check(Ci(T,B))},overwrite(T){return this.check(c.overwrite(T))},optional(){return nn(this)},exactOptional(){return oa(this)},nullable(){return Ur(this)},nullish(){return nn(Ur(this))},nonoptional(T){return Ir(this,T)},array(){return Cr(this)},or(T){return Xt([this,T])},and(T){return tn(this,T)},transform(T){return Pi(this,rn(T))},default(T){return Br(this,T)},prefault(T){return Ie(this,T)},catch(T){return ki(this,T)},pipe(T){return Pi(this,T)},readonly(){return ir(this)},describe(T){const B=this.clone();return x.globalRegistry.add(B,{description:T}),B},meta(...T){if(T.length===0)return x.globalRegistry.get(this);const B=this.clone();return x.globalRegistry.add(B,T[0]),B},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(T){return T(this)}}),Object.defineProperty(b,"description",{get(){return x.globalRegistry.get(b)?.description},configurable:!0}),b)),t._ZodString=x.$constructor("_ZodString",(b,D)=>{x.$ZodString.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(B,Y,mt)=>z.stringProcessor(b,B,Y,mt);const T=b._zod.bag;b.format=T.format??null,b.minLength=T.minimum??null,b.maxLength=T.maximum??null,n(b,"_ZodString",{regex(...B){return this.check(c.regex(...B))},includes(...B){return this.check(c.includes(...B))},startsWith(...B){return this.check(c.startsWith(...B))},endsWith(...B){return this.check(c.endsWith(...B))},min(...B){return this.check(c.minLength(...B))},max(...B){return this.check(c.maxLength(...B))},length(...B){return this.check(c.length(...B))},nonempty(...B){return this.check(c.minLength(1,...B))},lowercase(B){return this.check(c.lowercase(B))},uppercase(B){return this.check(c.uppercase(B))},trim(){return this.check(c.trim())},normalize(...B){return this.check(c.normalize(...B))},toLowerCase(){return this.check(c.toLowerCase())},toUpperCase(){return this.check(c.toUpperCase())},slugify(){return this.check(c.slugify())}})}),t.ZodString=x.$constructor("ZodString",(b,D)=>{x.$ZodString.init(b,D),t._ZodString.init(b,D),b.email=T=>b.check(x._email(t.ZodEmail,T)),b.url=T=>b.check(x._url(t.ZodURL,T)),b.jwt=T=>b.check(x._jwt(t.ZodJWT,T)),b.emoji=T=>b.check(x._emoji(t.ZodEmoji,T)),b.guid=T=>b.check(x._guid(t.ZodGUID,T)),b.uuid=T=>b.check(x._uuid(t.ZodUUID,T)),b.uuidv4=T=>b.check(x._uuidv4(t.ZodUUID,T)),b.uuidv6=T=>b.check(x._uuidv6(t.ZodUUID,T)),b.uuidv7=T=>b.check(x._uuidv7(t.ZodUUID,T)),b.nanoid=T=>b.check(x._nanoid(t.ZodNanoID,T)),b.guid=T=>b.check(x._guid(t.ZodGUID,T)),b.cuid=T=>b.check(x._cuid(t.ZodCUID,T)),b.cuid2=T=>b.check(x._cuid2(t.ZodCUID2,T)),b.ulid=T=>b.check(x._ulid(t.ZodULID,T)),b.base64=T=>b.check(x._base64(t.ZodBase64,T)),b.base64url=T=>b.check(x._base64url(t.ZodBase64URL,T)),b.xid=T=>b.check(x._xid(t.ZodXID,T)),b.ksuid=T=>b.check(x._ksuid(t.ZodKSUID,T)),b.ipv4=T=>b.check(x._ipv4(t.ZodIPv4,T)),b.ipv6=T=>b.check(x._ipv6(t.ZodIPv6,T)),b.cidrv4=T=>b.check(x._cidrv4(t.ZodCIDRv4,T)),b.cidrv6=T=>b.check(x._cidrv6(t.ZodCIDRv6,T)),b.e164=T=>b.check(x._e164(t.ZodE164,T)),b.datetime=T=>b.check(s.datetime(T)),b.date=T=>b.check(s.date(T)),b.time=T=>b.check(s.time(T)),b.duration=T=>b.check(s.duration(T))});function r(b){return x._string(t.ZodString,b)}t.ZodStringFormat=x.$constructor("ZodStringFormat",(b,D)=>{x.$ZodStringFormat.init(b,D),t._ZodString.init(b,D)}),t.ZodEmail=x.$constructor("ZodEmail",(b,D)=>{x.$ZodEmail.init(b,D),t.ZodStringFormat.init(b,D)});function _(b){return x._email(t.ZodEmail,b)}t.ZodGUID=x.$constructor("ZodGUID",(b,D)=>{x.$ZodGUID.init(b,D),t.ZodStringFormat.init(b,D)});function M(b){return x._guid(t.ZodGUID,b)}t.ZodUUID=x.$constructor("ZodUUID",(b,D)=>{x.$ZodUUID.init(b,D),t.ZodStringFormat.init(b,D)});function ee(b){return x._uuid(t.ZodUUID,b)}function X(b){return x._uuidv4(t.ZodUUID,b)}function ie(b){return x._uuidv6(t.ZodUUID,b)}function Q(b){return x._uuidv7(t.ZodUUID,b)}t.ZodURL=x.$constructor("ZodURL",(b,D)=>{x.$ZodURL.init(b,D),t.ZodStringFormat.init(b,D)});function ge(b){return x._url(t.ZodURL,b)}function xe(b){return x._url(t.ZodURL,{protocol:x.regexes.httpProtocol,hostname:x.regexes.domain,...S.util.normalizeParams(b)})}t.ZodEmoji=x.$constructor("ZodEmoji",(b,D)=>{x.$ZodEmoji.init(b,D),t.ZodStringFormat.init(b,D)});function he(b){return x._emoji(t.ZodEmoji,b)}t.ZodNanoID=x.$constructor("ZodNanoID",(b,D)=>{x.$ZodNanoID.init(b,D),t.ZodStringFormat.init(b,D)});function be(b){return x._nanoid(t.ZodNanoID,b)}t.ZodCUID=x.$constructor("ZodCUID",(b,D)=>{x.$ZodCUID.init(b,D),t.ZodStringFormat.init(b,D)});function Te(b){return x._cuid(t.ZodCUID,b)}t.ZodCUID2=x.$constructor("ZodCUID2",(b,D)=>{x.$ZodCUID2.init(b,D),t.ZodStringFormat.init(b,D)});function Me(b){return x._cuid2(t.ZodCUID2,b)}t.ZodULID=x.$constructor("ZodULID",(b,D)=>{x.$ZodULID.init(b,D),t.ZodStringFormat.init(b,D)});function nt(b){return x._ulid(t.ZodULID,b)}t.ZodXID=x.$constructor("ZodXID",(b,D)=>{x.$ZodXID.init(b,D),t.ZodStringFormat.init(b,D)});function ht(b){return x._xid(t.ZodXID,b)}t.ZodKSUID=x.$constructor("ZodKSUID",(b,D)=>{x.$ZodKSUID.init(b,D),t.ZodStringFormat.init(b,D)});function Ct(b){return x._ksuid(t.ZodKSUID,b)}t.ZodIPv4=x.$constructor("ZodIPv4",(b,D)=>{x.$ZodIPv4.init(b,D),t.ZodStringFormat.init(b,D)});function Bt(b){return x._ipv4(t.ZodIPv4,b)}t.ZodMAC=x.$constructor("ZodMAC",(b,D)=>{x.$ZodMAC.init(b,D),t.ZodStringFormat.init(b,D)});function zt(b){return x._mac(t.ZodMAC,b)}t.ZodIPv6=x.$constructor("ZodIPv6",(b,D)=>{x.$ZodIPv6.init(b,D),t.ZodStringFormat.init(b,D)});function Dt(b){return x._ipv6(t.ZodIPv6,b)}t.ZodCIDRv4=x.$constructor("ZodCIDRv4",(b,D)=>{x.$ZodCIDRv4.init(b,D),t.ZodStringFormat.init(b,D)});function Lt(b){return x._cidrv4(t.ZodCIDRv4,b)}t.ZodCIDRv6=x.$constructor("ZodCIDRv6",(b,D)=>{x.$ZodCIDRv6.init(b,D),t.ZodStringFormat.init(b,D)});function jt(b){return x._cidrv6(t.ZodCIDRv6,b)}t.ZodBase64=x.$constructor("ZodBase64",(b,D)=>{x.$ZodBase64.init(b,D),t.ZodStringFormat.init(b,D)});function Ft(b){return x._base64(t.ZodBase64,b)}t.ZodBase64URL=x.$constructor("ZodBase64URL",(b,D)=>{x.$ZodBase64URL.init(b,D),t.ZodStringFormat.init(b,D)});function Kt(b){return x._base64url(t.ZodBase64URL,b)}t.ZodE164=x.$constructor("ZodE164",(b,D)=>{x.$ZodE164.init(b,D),t.ZodStringFormat.init(b,D)});function $(b){return x._e164(t.ZodE164,b)}t.ZodJWT=x.$constructor("ZodJWT",(b,D)=>{x.$ZodJWT.init(b,D),t.ZodStringFormat.init(b,D)});function P(b){return x._jwt(t.ZodJWT,b)}t.ZodCustomStringFormat=x.$constructor("ZodCustomStringFormat",(b,D)=>{x.$ZodCustomStringFormat.init(b,D),t.ZodStringFormat.init(b,D)});function I(b,D,T={}){return x._stringFormat(t.ZodCustomStringFormat,b,D,T)}function L(b){return x._stringFormat(t.ZodCustomStringFormat,"hostname",x.regexes.hostname,b)}function F(b){return x._stringFormat(t.ZodCustomStringFormat,"hex",x.regexes.hex,b)}function W(b,D){const T=D?.enc??"hex",B=`${b}_${T}`,Y=x.regexes[B];if(!Y)throw new Error(`Unrecognized hash format: ${B}`);return x._stringFormat(t.ZodCustomStringFormat,B,Y,D)}t.ZodNumber=x.$constructor("ZodNumber",(b,D)=>{x.$ZodNumber.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(B,Y,mt)=>z.numberProcessor(b,B,Y,mt),n(b,"ZodNumber",{gt(B,Y){return this.check(c.gt(B,Y))},gte(B,Y){return this.check(c.gte(B,Y))},min(B,Y){return this.check(c.gte(B,Y))},lt(B,Y){return this.check(c.lt(B,Y))},lte(B,Y){return this.check(c.lte(B,Y))},max(B,Y){return this.check(c.lte(B,Y))},int(B){return this.check(me(B))},safe(B){return this.check(me(B))},positive(B){return this.check(c.gt(0,B))},nonnegative(B){return this.check(c.gte(0,B))},negative(B){return this.check(c.lt(0,B))},nonpositive(B){return this.check(c.lte(0,B))},multipleOf(B,Y){return this.check(c.multipleOf(B,Y))},step(B,Y){return this.check(c.multipleOf(B,Y))},finite(){return this}});const T=b._zod.bag;b.minValue=Math.max(T.minimum??Number.NEGATIVE_INFINITY,T.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,b.maxValue=Math.min(T.maximum??Number.POSITIVE_INFINITY,T.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,b.isInt=(T.format??"").includes("int")||Number.isSafeInteger(T.multipleOf??.5),b.isFinite=!0,b.format=T.format??null});function ne(b){return x._number(t.ZodNumber,b)}t.ZodNumberFormat=x.$constructor("ZodNumberFormat",(b,D)=>{x.$ZodNumberFormat.init(b,D),t.ZodNumber.init(b,D)});function me(b){return x._int(t.ZodNumberFormat,b)}function H(b){return x._float32(t.ZodNumberFormat,b)}function q(b){return x._float64(t.ZodNumberFormat,b)}function oe(b){return x._int32(t.ZodNumberFormat,b)}function fe(b){return x._uint32(t.ZodNumberFormat,b)}t.ZodBoolean=x.$constructor("ZodBoolean",(b,D)=>{x.$ZodBoolean.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.booleanProcessor(b,T,B,Y)});function J(b){return x._boolean(t.ZodBoolean,b)}t.ZodBigInt=x.$constructor("ZodBigInt",(b,D)=>{x.$ZodBigInt.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(B,Y,mt)=>z.bigintProcessor(b,B,Y,mt),b.gte=(B,Y)=>b.check(c.gte(B,Y)),b.min=(B,Y)=>b.check(c.gte(B,Y)),b.gt=(B,Y)=>b.check(c.gt(B,Y)),b.gte=(B,Y)=>b.check(c.gte(B,Y)),b.min=(B,Y)=>b.check(c.gte(B,Y)),b.lt=(B,Y)=>b.check(c.lt(B,Y)),b.lte=(B,Y)=>b.check(c.lte(B,Y)),b.max=(B,Y)=>b.check(c.lte(B,Y)),b.positive=B=>b.check(c.gt(BigInt(0),B)),b.negative=B=>b.check(c.lt(BigInt(0),B)),b.nonpositive=B=>b.check(c.lte(BigInt(0),B)),b.nonnegative=B=>b.check(c.gte(BigInt(0),B)),b.multipleOf=(B,Y)=>b.check(c.multipleOf(B,Y));const T=b._zod.bag;b.minValue=T.minimum??null,b.maxValue=T.maximum??null,b.format=T.format??null});function le(b){return x._bigint(t.ZodBigInt,b)}t.ZodBigIntFormat=x.$constructor("ZodBigIntFormat",(b,D)=>{x.$ZodBigIntFormat.init(b,D),t.ZodBigInt.init(b,D)});function _e(b){return x._int64(t.ZodBigIntFormat,b)}function it(b){return x._uint64(t.ZodBigIntFormat,b)}t.ZodSymbol=x.$constructor("ZodSymbol",(b,D)=>{x.$ZodSymbol.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.symbolProcessor(b,T,B,Y)});function We(b){return x._symbol(t.ZodSymbol,b)}t.ZodUndefined=x.$constructor("ZodUndefined",(b,D)=>{x.$ZodUndefined.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.undefinedProcessor(b,T,B,Y)});function Ye(b){return x._undefined(t.ZodUndefined,b)}t.ZodNull=x.$constructor("ZodNull",(b,D)=>{x.$ZodNull.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.nullProcessor(b,T,B,Y)});function at(b){return x._null(t.ZodNull,b)}t.ZodAny=x.$constructor("ZodAny",(b,D)=>{x.$ZodAny.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.anyProcessor(b,T,B,Y)});function yt(){return x._any(t.ZodAny)}t.ZodUnknown=x.$constructor("ZodUnknown",(b,D)=>{x.$ZodUnknown.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.unknownProcessor(b,T,B,Y)});function Ze(){return x._unknown(t.ZodUnknown)}t.ZodNever=x.$constructor("ZodNever",(b,D)=>{x.$ZodNever.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.neverProcessor(b,T,B,Y)});function gt(b){return x._never(t.ZodNever,b)}t.ZodVoid=x.$constructor("ZodVoid",(b,D)=>{x.$ZodVoid.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.voidProcessor(b,T,B,Y)});function Lr(b){return x._void(t.ZodVoid,b)}t.ZodDate=x.$constructor("ZodDate",(b,D)=>{x.$ZodDate.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(B,Y,mt)=>z.dateProcessor(b,B,Y,mt),b.min=(B,Y)=>b.check(c.gte(B,Y)),b.max=(B,Y)=>b.check(c.lte(B,Y));const T=b._zod.bag;b.minDate=T.minimum?new Date(T.minimum):null,b.maxDate=T.maximum?new Date(T.maximum):null});function en(b){return x._date(t.ZodDate,b)}t.ZodArray=x.$constructor("ZodArray",(b,D)=>{x.$ZodArray.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.arrayProcessor(b,T,B,Y),b.element=D.element,n(b,"ZodArray",{min(T,B){return this.check(c.minLength(T,B))},nonempty(T){return this.check(c.minLength(1,T))},max(T,B){return this.check(c.maxLength(T,B))},length(T,B){return this.check(c.length(T,B))},unwrap(){return this.element}})});function Cr(b,D){return x._array(t.ZodArray,b,D)}function Yo(b){const D=b._zod.def.shape;return $i(Object.keys(D))}t.ZodObject=x.$constructor("ZodObject",(b,D)=>{x.$ZodObjectJIT.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.objectProcessor(b,T,B,Y),S.util.defineLazy(b,"shape",()=>D.shape),n(b,"ZodObject",{keyof(){return $i(Object.keys(this._zod.def.shape))},catchall(T){return this.clone({...this._zod.def,catchall:T})},passthrough(){return this.clone({...this._zod.def,catchall:Ze()})},loose(){return this.clone({...this._zod.def,catchall:Ze()})},strict(){return this.clone({...this._zod.def,catchall:gt()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(T){return S.util.extend(this,T)},safeExtend(T){return S.util.safeExtend(this,T)},merge(T){return S.util.merge(this,T)},pick(T){return S.util.pick(this,T)},omit(T){return S.util.omit(this,T)},partial(...T){return S.util.partial(t.ZodOptional,this,T[0])},required(...T){return S.util.required(t.ZodNonOptional,this,T[0])}})});function es(b,D){const T={type:"object",shape:b??{},...S.util.normalizeParams(D)};return new t.ZodObject(T)}function ts(b,D){return new t.ZodObject({type:"object",shape:b,catchall:gt(),...S.util.normalizeParams(D)})}function rs(b,D){return new t.ZodObject({type:"object",shape:b,catchall:Ze(),...S.util.normalizeParams(D)})}t.ZodUnion=x.$constructor("ZodUnion",(b,D)=>{x.$ZodUnion.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.unionProcessor(b,T,B,Y),b.options=D.options});function Xt(b,D){return new t.ZodUnion({type:"union",options:b,...S.util.normalizeParams(D)})}t.ZodXor=x.$constructor("ZodXor",(b,D)=>{t.ZodUnion.init(b,D),x.$ZodXor.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.unionProcessor(b,T,B,Y),b.options=D.options});function rt(b,D){return new t.ZodXor({type:"union",options:b,inclusive:!1,...S.util.normalizeParams(D)})}t.ZodDiscriminatedUnion=x.$constructor("ZodDiscriminatedUnion",(b,D)=>{t.ZodUnion.init(b,D),x.$ZodDiscriminatedUnion.init(b,D)});function lr(b,D,T){return new t.ZodDiscriminatedUnion({type:"union",options:D,discriminator:b,...S.util.normalizeParams(T)})}t.ZodIntersection=x.$constructor("ZodIntersection",(b,D)=>{x.$ZodIntersection.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.intersectionProcessor(b,T,B,Y)});function tn(b,D){return new t.ZodIntersection({type:"intersection",left:b,right:D})}t.ZodTuple=x.$constructor("ZodTuple",(b,D)=>{x.$ZodTuple.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.tupleProcessor(b,T,B,Y),b.rest=T=>b.clone({...b._zod.def,rest:T})});function Yt(b,D,T){const B=D instanceof x.$ZodType,Y=B?T:D,mt=B?D:null;return new t.ZodTuple({type:"tuple",items:b,rest:mt,...S.util.normalizeParams(Y)})}t.ZodRecord=x.$constructor("ZodRecord",(b,D)=>{x.$ZodRecord.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.recordProcessor(b,T,B,Y),b.keyType=D.keyType,b.valueType=D.valueType});function Si(b,D,T){return!D||!D._zod?new t.ZodRecord({type:"record",keyType:r(),valueType:b,...S.util.normalizeParams(D)}):new t.ZodRecord({type:"record",keyType:b,valueType:D,...S.util.normalizeParams(T)})}function ns(b,D,T){const B=x.clone(b);return B._zod.values=void 0,new t.ZodRecord({type:"record",keyType:B,valueType:D,...S.util.normalizeParams(T)})}function ji(b,D,T){return new t.ZodRecord({type:"record",keyType:b,valueType:D,mode:"loose",...S.util.normalizeParams(T)})}t.ZodMap=x.$constructor("ZodMap",(b,D)=>{x.$ZodMap.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.mapProcessor(b,T,B,Y),b.keyType=D.keyType,b.valueType=D.valueType,b.min=(...T)=>b.check(x._minSize(...T)),b.nonempty=T=>b.check(x._minSize(1,T)),b.max=(...T)=>b.check(x._maxSize(...T)),b.size=(...T)=>b.check(x._size(...T))});function is(b,D,T){return new t.ZodMap({type:"map",keyType:b,valueType:D,...S.util.normalizeParams(T)})}t.ZodSet=x.$constructor("ZodSet",(b,D)=>{x.$ZodSet.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.setProcessor(b,T,B,Y),b.min=(...T)=>b.check(x._minSize(...T)),b.nonempty=T=>b.check(x._minSize(1,T)),b.max=(...T)=>b.check(x._maxSize(...T)),b.size=(...T)=>b.check(x._size(...T))});function as(b,D){return new t.ZodSet({type:"set",valueType:b,...S.util.normalizeParams(D)})}t.ZodEnum=x.$constructor("ZodEnum",(b,D)=>{x.$ZodEnum.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(B,Y,mt)=>z.enumProcessor(b,B,Y,mt),b.enum=D.entries,b.options=Object.values(D.entries);const T=new Set(Object.keys(D.entries));b.extract=(B,Y)=>{const mt={};for(const $t of B)if(T.has($t))mt[$t]=D.entries[$t];else throw new Error(`Key ${$t} not found in enum`);return new t.ZodEnum({...D,checks:[],...S.util.normalizeParams(Y),entries:mt})},b.exclude=(B,Y)=>{const mt={...D.entries};for(const $t of B)if(T.has($t))delete mt[$t];else throw new Error(`Key ${$t} not found in enum`);return new t.ZodEnum({...D,checks:[],...S.util.normalizeParams(Y),entries:mt})}});function $i(b,D){const T=Array.isArray(b)?Object.fromEntries(b.map(B=>[B,B])):b;return new t.ZodEnum({type:"enum",entries:T,...S.util.normalizeParams(D)})}function os(b,D){return new t.ZodEnum({type:"enum",entries:b,...S.util.normalizeParams(D)})}t.ZodLiteral=x.$constructor("ZodLiteral",(b,D)=>{x.$ZodLiteral.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.literalProcessor(b,T,B,Y),b.values=new Set(D.values),Object.defineProperty(b,"value",{get(){if(D.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return D.values[0]}})});function Ce(b,D){return new t.ZodLiteral({type:"literal",values:Array.isArray(b)?b:[b],...S.util.normalizeParams(D)})}t.ZodFile=x.$constructor("ZodFile",(b,D)=>{x.$ZodFile.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.fileProcessor(b,T,B,Y),b.min=(T,B)=>b.check(x._minSize(T,B)),b.max=(T,B)=>b.check(x._maxSize(T,B)),b.mime=(T,B)=>b.check(x._mime(Array.isArray(T)?T:[T],B))});function br(b){return x._file(t.ZodFile,b)}t.ZodTransform=x.$constructor("ZodTransform",(b,D)=>{x.$ZodTransform.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.transformProcessor(b,T,B,Y),b._zod.parse=(T,B)=>{if(B.direction==="backward")throw new x.$ZodEncodeError(b.constructor.name);T.addIssue=mt=>{if(typeof mt=="string")T.issues.push(S.util.issue(mt,T.value,D));else{const $t=mt;$t.fatal&&($t.continue=!1),$t.code??($t.code="custom"),$t.input??($t.input=T.value),$t.inst??($t.inst=b),T.issues.push(S.util.issue($t))}};const Y=D.transform(T.value,T);return Y instanceof Promise?Y.then(mt=>(T.value=mt,T.fallback=!0,T)):(T.value=Y,T.fallback=!0,T)}});function rn(b){return new t.ZodTransform({type:"transform",transform:b})}t.ZodOptional=x.$constructor("ZodOptional",(b,D)=>{x.$ZodOptional.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.optionalProcessor(b,T,B,Y),b.unwrap=()=>b._zod.def.innerType});function nn(b){return new t.ZodOptional({type:"optional",innerType:b})}t.ZodExactOptional=x.$constructor("ZodExactOptional",(b,D)=>{x.$ZodExactOptional.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.optionalProcessor(b,T,B,Y),b.unwrap=()=>b._zod.def.innerType});function oa(b){return new t.ZodExactOptional({type:"optional",innerType:b})}t.ZodNullable=x.$constructor("ZodNullable",(b,D)=>{x.$ZodNullable.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.nullableProcessor(b,T,B,Y),b.unwrap=()=>b._zod.def.innerType});function Ur(b){return new t.ZodNullable({type:"nullable",innerType:b})}function ss(b){return nn(Ur(b))}t.ZodDefault=x.$constructor("ZodDefault",(b,D)=>{x.$ZodDefault.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.defaultProcessor(b,T,B,Y),b.unwrap=()=>b._zod.def.innerType,b.removeDefault=b.unwrap});function Br(b,D){return new t.ZodDefault({type:"default",innerType:b,get defaultValue(){return typeof D=="function"?D():S.util.shallowClone(D)}})}t.ZodPrefault=x.$constructor("ZodPrefault",(b,D)=>{x.$ZodPrefault.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.prefaultProcessor(b,T,B,Y),b.unwrap=()=>b._zod.def.innerType});function Ie(b,D){return new t.ZodPrefault({type:"prefault",innerType:b,get defaultValue(){return typeof D=="function"?D():S.util.shallowClone(D)}})}t.ZodNonOptional=x.$constructor("ZodNonOptional",(b,D)=>{x.$ZodNonOptional.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.nonoptionalProcessor(b,T,B,Y),b.unwrap=()=>b._zod.def.innerType});function Ir(b,D){return new t.ZodNonOptional({type:"nonoptional",innerType:b,...S.util.normalizeParams(D)})}t.ZodSuccess=x.$constructor("ZodSuccess",(b,D)=>{x.$ZodSuccess.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.successProcessor(b,T,B,Y),b.unwrap=()=>b._zod.def.innerType});function cs(b){return new t.ZodSuccess({type:"success",innerType:b})}t.ZodCatch=x.$constructor("ZodCatch",(b,D)=>{x.$ZodCatch.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.catchProcessor(b,T,B,Y),b.unwrap=()=>b._zod.def.innerType,b.removeCatch=b.unwrap});function ki(b,D){return new t.ZodCatch({type:"catch",innerType:b,catchValue:typeof D=="function"?D:()=>D})}t.ZodNaN=x.$constructor("ZodNaN",(b,D)=>{x.$ZodNaN.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.nanProcessor(b,T,B,Y)});function ls(b){return x._nan(t.ZodNaN,b)}t.ZodPipe=x.$constructor("ZodPipe",(b,D)=>{x.$ZodPipe.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.pipeProcessor(b,T,B,Y),b.in=D.in,b.out=D.out});function Pi(b,D){return new t.ZodPipe({type:"pipe",in:b,out:D})}t.ZodCodec=x.$constructor("ZodCodec",(b,D)=>{t.ZodPipe.init(b,D),x.$ZodCodec.init(b,D)});function an(b,D,T){return new t.ZodCodec({type:"pipe",in:b,out:D,transform:T.decode,reverseTransform:T.encode})}function us(b){const D=b._zod.def;return new t.ZodCodec({type:"pipe",in:D.out,out:D.in,transform:D.reverseTransform,reverseTransform:D.transform})}t.ZodPreprocess=x.$constructor("ZodPreprocess",(b,D)=>{t.ZodPipe.init(b,D),x.$ZodPreprocess.init(b,D)}),t.ZodReadonly=x.$constructor("ZodReadonly",(b,D)=>{x.$ZodReadonly.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.readonlyProcessor(b,T,B,Y),b.unwrap=()=>b._zod.def.innerType});function ir(b){return new t.ZodReadonly({type:"readonly",innerType:b})}t.ZodTemplateLiteral=x.$constructor("ZodTemplateLiteral",(b,D)=>{x.$ZodTemplateLiteral.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.templateLiteralProcessor(b,T,B,Y)});function yr(b,D){return new t.ZodTemplateLiteral({type:"template_literal",parts:b,...S.util.normalizeParams(D)})}t.ZodLazy=x.$constructor("ZodLazy",(b,D)=>{x.$ZodLazy.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.lazyProcessor(b,T,B,Y),b.unwrap=()=>b._zod.def.getter()});function Ni(b){return new t.ZodLazy({type:"lazy",getter:b})}t.ZodPromise=x.$constructor("ZodPromise",(b,D)=>{x.$ZodPromise.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.promiseProcessor(b,T,B,Y),b.unwrap=()=>b._zod.def.innerType});function sa(b){return new t.ZodPromise({type:"promise",innerType:b})}t.ZodFunction=x.$constructor("ZodFunction",(b,D)=>{x.$ZodFunction.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.functionProcessor(b,T,B,Y)});function Fr(b){return new t.ZodFunction({type:"function",input:Array.isArray(b?.input)?Yt(b?.input):b?.input??Cr(Ze()),output:b?.output??Ze()})}t.ZodCustom=x.$constructor("ZodCustom",(b,D)=>{x.$ZodCustom.init(b,D),t.ZodType.init(b,D),b._zod.processJSONSchema=(T,B,Y)=>z.customProcessor(b,T,B,Y)});function ca(b){const D=new x.$ZodCheck({check:"custom"});return D._zod.check=b,D}function ds(b,D){return x._custom(t.ZodCustom,b??(()=>!0),D)}function Oi(b,D={}){return x._refine(t.ZodCustom,b,D)}function Ci(b,D){return x._superRefine(b,D)}t.describe=x.describe,t.meta=x.meta;function la(b,D={}){const T=new t.ZodCustom({type:"custom",check:"custom",fn:B=>B instanceof b,abort:!0,...S.util.normalizeParams(D)});return T._zod.bag.Class=b,T._zod.check=B=>{B.value instanceof b||B.issues.push({code:"invalid_type",expected:b.name,input:B.value,inst:T,path:[...T._zod.def.path??[]]})},T}const fs=(...b)=>x._stringbool({Codec:t.ZodCodec,Boolean:t.ZodBoolean,String:t.ZodString},...b);t.stringbool=fs;function ms(b){const D=Ni(()=>Xt([r(b),ne(),J(),at(),Cr(D),Si(r(),D)]));return D}function K(b,D){return new t.ZodPreprocess({type:"pipe",in:rn(b),out:D})}})(jr)),jr}var Tr={};(function(t){var f=Tr&&Tr.__createBinding||(Object.create?(function(s,u,g,n){n===void 0&&(n=g);var r=Object.getOwnPropertyDescriptor(u,g);(!r||("get"in r?!u.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return u[g]}}),Object.defineProperty(s,n,r)}):(function(s,u,g,n){n===void 0&&(n=g),s[n]=u[g]})),k=Tr&&Tr.__setModuleDefault||(Object.create?(function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}):function(s,u){s.default=u}),C=Tr&&Tr.__importStar||function(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var g in s)g!=="default"&&Object.prototype.hasOwnProperty.call(s,g)&&f(u,s,g);return k(u,s),u};Object.defineProperty(t,"__esModule",{value:!0}),t.ZodFirstPartyTypeKind=t.config=t.$brand=t.ZodIssueCode=void 0,t.setErrorMap=z,t.getErrorMap=U;const x=C(Nt);t.ZodIssueCode={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var S=Nt;Object.defineProperty(t,"$brand",{enumerable:!0,get:function(){return S.$brand}}),Object.defineProperty(t,"config",{enumerable:!0,get:function(){return S.config}});function z(s){x.config({customError:s})}function U(){return x.config().customError}var c;c||(t.ZodFirstPartyTypeKind=c={})})(Tr);var Nr={},X2=Nr&&Nr.__createBinding||(Object.create?(function(t,f,k,C){C===void 0&&(C=k);var x=Object.getOwnPropertyDescriptor(f,k);(!x||("get"in x?!f.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return f[k]}}),Object.defineProperty(t,C,x)}):(function(t,f,k,C){C===void 0&&(C=k),t[C]=f[k]})),Y2=Nr&&Nr.__setModuleDefault||(Object.create?(function(t,f){Object.defineProperty(t,"default",{enumerable:!0,value:f})}):function(t,f){t.default=f}),Rc=Nr&&Nr.__importStar||function(t){if(t&&t.__esModule)return t;var f={};if(t!=null)for(var k in t)k!=="default"&&Object.prototype.hasOwnProperty.call(t,k)&&X2(f,t,k);return Y2(f,t),f};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.fromJSONSchema=sM;const eM=Ut,tM=Rc(Ko),rM=Rc(Qo()),nM=Rc(Xo()),$e={...nM,...tM,iso:rM},iM=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function aM(t,f){const k=t.$schema;return k==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":k==="http://json-schema.org/draft-07/schema#"?"draft-7":k==="http://json-schema.org/draft-04/schema#"?"draft-4":f??"draft-2020-12"}function oM(t,f){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const k=t.slice(1).split("/").filter(Boolean);if(k.length===0)return f.rootSchema;const C=f.version==="draft-2020-12"?"$defs":"definitions";if(k[0]===C){const x=k[1];if(!x||!f.defs[x])throw new Error(`Reference not found: ${t}`);return f.defs[x]}throw new Error(`Reference not found: ${t}`)}function wm(t,f){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return $e.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){const x=t.$ref;if(f.refs.has(x))return f.refs.get(x);if(f.processing.has(x))return $e.lazy(()=>{if(!f.refs.has(x))throw new Error(`Circular reference not resolved: ${x}`);return f.refs.get(x)});f.processing.add(x);const S=oM(x,f),z=At(S,f);return f.refs.set(x,z),f.processing.delete(x),z}if(t.enum!==void 0){const x=t.enum;if(f.version==="openapi-3.0"&&t.nullable===!0&&x.length===1&&x[0]===null)return $e.null();if(x.length===0)return $e.never();if(x.length===1)return $e.literal(x[0]);if(x.every(z=>typeof z=="string"))return $e.enum(x);const S=x.map(z=>$e.literal(z));return S.length<2?S[0]:$e.union([S[0],S[1],...S.slice(2)])}if(t.const!==void 0)return $e.literal(t.const);const k=t.type;if(Array.isArray(k)){const x=k.map(S=>{const z={...t,type:S};return wm(z,f)});return x.length===0?$e.never():x.length===1?x[0]:$e.union(x)}if(!k)return $e.any();let C;switch(k){case"string":{let x=$e.string();if(t.format){const S=t.format;S==="email"?x=x.check($e.email()):S==="uri"||S==="uri-reference"?x=x.check($e.url()):S==="uuid"||S==="guid"?x=x.check($e.uuid()):S==="date-time"?x=x.check($e.iso.datetime()):S==="date"?x=x.check($e.iso.date()):S==="time"?x=x.check($e.iso.time()):S==="duration"?x=x.check($e.iso.duration()):S==="ipv4"?x=x.check($e.ipv4()):S==="ipv6"?x=x.check($e.ipv6()):S==="mac"?x=x.check($e.mac()):S==="cidr"?x=x.check($e.cidrv4()):S==="cidr-v6"?x=x.check($e.cidrv6()):S==="base64"?x=x.check($e.base64()):S==="base64url"?x=x.check($e.base64url()):S==="e164"?x=x.check($e.e164()):S==="jwt"?x=x.check($e.jwt()):S==="emoji"?x=x.check($e.emoji()):S==="nanoid"?x=x.check($e.nanoid()):S==="cuid"?x=x.check($e.cuid()):S==="cuid2"?x=x.check($e.cuid2()):S==="ulid"?x=x.check($e.ulid()):S==="xid"?x=x.check($e.xid()):S==="ksuid"&&(x=x.check($e.ksuid()))}typeof t.minLength=="number"&&(x=x.min(t.minLength)),typeof t.maxLength=="number"&&(x=x.max(t.maxLength)),t.pattern&&(x=x.regex(new RegExp(t.pattern))),C=x;break}case"number":case"integer":{let x=k==="integer"?$e.number().int():$e.number();typeof t.minimum=="number"&&(x=x.min(t.minimum)),typeof t.maximum=="number"&&(x=x.max(t.maximum)),typeof t.exclusiveMinimum=="number"?x=x.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(x=x.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?x=x.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(x=x.lt(t.maximum)),typeof t.multipleOf=="number"&&(x=x.multipleOf(t.multipleOf)),C=x;break}case"boolean":{C=$e.boolean();break}case"null":{C=$e.null();break}case"object":{const x={},S=t.properties||{},z=new Set(t.required||[]);for(const[c,s]of Object.entries(S)){const u=At(s,f);x[c]=z.has(c)?u:u.optional()}if(t.propertyNames){const c=At(t.propertyNames,f),s=t.additionalProperties&&typeof t.additionalProperties=="object"?At(t.additionalProperties,f):$e.any();if(Object.keys(x).length===0){C=$e.record(c,s);break}const u=$e.object(x).passthrough(),g=$e.looseRecord(c,s);C=$e.intersection(u,g);break}if(t.patternProperties){const c=t.patternProperties,s=Object.keys(c),u=[];for(const n of s){const r=At(c[n],f),_=$e.string().regex(new RegExp(n));u.push($e.looseRecord(_,r))}const g=[];if(Object.keys(x).length>0&&g.push($e.object(x).passthrough()),g.push(...u),g.length===0)C=$e.object({}).passthrough();else if(g.length===1)C=g[0];else{let n=$e.intersection(g[0],g[1]);for(let r=2;r<g.length;r++)n=$e.intersection(n,g[r]);C=n}break}const U=$e.object(x);t.additionalProperties===!1?C=U.strict():typeof t.additionalProperties=="object"?C=U.catchall(At(t.additionalProperties,f)):C=U.passthrough();break}case"array":{const x=t.prefixItems,S=t.items;if(x&&Array.isArray(x)){const z=x.map(c=>At(c,f)),U=S&&typeof S=="object"&&!Array.isArray(S)?At(S,f):void 0;U?C=$e.tuple(z).rest(U):C=$e.tuple(z),typeof t.minItems=="number"&&(C=C.check($e.minLength(t.minItems))),typeof t.maxItems=="number"&&(C=C.check($e.maxLength(t.maxItems)))}else if(Array.isArray(S)){const z=S.map(c=>At(c,f)),U=t.additionalItems&&typeof t.additionalItems=="object"?At(t.additionalItems,f):void 0;U?C=$e.tuple(z).rest(U):C=$e.tuple(z),typeof t.minItems=="number"&&(C=C.check($e.minLength(t.minItems))),typeof t.maxItems=="number"&&(C=C.check($e.maxLength(t.maxItems)))}else if(S!==void 0){const z=At(S,f);let U=$e.array(z);typeof t.minItems=="number"&&(U=U.min(t.minItems)),typeof t.maxItems=="number"&&(U=U.max(t.maxItems)),C=U}else C=$e.array($e.any());break}default:throw new Error(`Unsupported type: ${k}`)}return C}function At(t,f){if(typeof t=="boolean")return t?$e.any():$e.never();let k=wm(t,f);const C=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){const U=t.anyOf.map(s=>At(s,f)),c=$e.union(U);k=C?$e.intersection(k,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){const U=t.oneOf.map(s=>At(s,f)),c=$e.xor(U);k=C?$e.intersection(k,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)k=C?k:$e.any();else{let U=C?k:At(t.allOf[0],f);const c=C?0:1;for(let s=c;s<t.allOf.length;s++)U=$e.intersection(U,At(t.allOf[s],f));k=U}t.nullable===!0&&f.version==="openapi-3.0"&&(k=$e.nullable(k)),t.readOnly===!0&&(k=$e.readonly(k)),t.default!==void 0&&(k=k.default(t.default));const x={},S=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(const U of S)U in t&&(x[U]=t[U]);const z=["contentEncoding","contentMediaType","contentSchema"];for(const U of z)U in t&&(x[U]=t[U]);for(const U of Object.keys(t))iM.has(U)||(x[U]=t[U]);return Object.keys(x).length>0&&f.registry.add(k,x),t.description&&(k=k.describe(t.description)),k}function sM(t,f){if(typeof t=="boolean")return t?$e.any():$e.never();let k;try{k=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}const C=aM(k,f?.defaultTarget),x=k.$defs||k.definitions||{},S={version:C,defs:x,refs:new Map,processing:new Set,rootSchema:k,registry:f?.registry??eM.globalRegistry};return At(k,S)}var Jt={},cM=Jt&&Jt.__createBinding||(Object.create?(function(t,f,k,C){C===void 0&&(C=k);var x=Object.getOwnPropertyDescriptor(f,k);(!x||("get"in x?!f.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return f[k]}}),Object.defineProperty(t,C,x)}):(function(t,f,k,C){C===void 0&&(C=k),t[C]=f[k]})),lM=Jt&&Jt.__setModuleDefault||(Object.create?(function(t,f){Object.defineProperty(t,"default",{enumerable:!0,value:f})}):function(t,f){t.default=f}),Sm=Jt&&Jt.__importStar||function(t){if(t&&t.__esModule)return t;var f={};if(t!=null)for(var k in t)k!=="default"&&Object.prototype.hasOwnProperty.call(t,k)&&cM(f,t,k);return lM(f,t),f};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.string=uM;Jt.number=dM;Jt.boolean=fM;Jt.bigint=mM;Jt.date=gM;const ia=Sm(Nt),aa=Sm(Xo());function uM(t){return ia._coercedString(aa.ZodString,t)}function dM(t){return ia._coercedNumber(aa.ZodNumber,t)}function fM(t){return ia._coercedBoolean(aa.ZodBoolean,t)}function mM(t){return ia._coercedBigint(aa.ZodBigInt,t)}function gM(t){return ia._coercedDate(aa.ZodDate,t)}(function(t){var f=qt&&qt.__createBinding||(Object.create?(function(n,r,_,M){M===void 0&&(M=_);var ee=Object.getOwnPropertyDescriptor(r,_);(!ee||("get"in ee?!r.__esModule:ee.writable||ee.configurable))&&(ee={enumerable:!0,get:function(){return r[_]}}),Object.defineProperty(n,M,ee)}):(function(n,r,_,M){M===void 0&&(M=_),n[M]=r[_]})),k=qt&&qt.__setModuleDefault||(Object.create?(function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}):function(n,r){n.default=r}),C=qt&&qt.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(n!=null)for(var _ in n)_!=="default"&&Object.prototype.hasOwnProperty.call(n,_)&&f(r,n,_);return k(r,n),r},x=qt&&qt.__exportStar||function(n,r){for(var _ in n)_!=="default"&&!Object.prototype.hasOwnProperty.call(r,_)&&f(r,n,_)},S=qt&&qt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.coerce=t.iso=t.ZodISODuration=t.ZodISOTime=t.ZodISODate=t.ZodISODateTime=t.locales=t.fromJSONSchema=t.toJSONSchema=t.NEVER=t.util=t.TimePrecision=t.flattenError=t.formatError=t.prettifyError=t.treeifyError=t.regexes=t.clone=t.$brand=t.$input=t.$output=t.config=t.registry=t.globalRegistry=t.core=void 0,t.core=C(Nt),x(Xo(),t),x(Ko,t),x(Ht,t),x(ut,t),x(Tr,t);const z=Nt,U=S(dm);(0,z.config)((0,U.default)());var c=Nt;Object.defineProperty(t,"globalRegistry",{enumerable:!0,get:function(){return c.globalRegistry}}),Object.defineProperty(t,"registry",{enumerable:!0,get:function(){return c.registry}}),Object.defineProperty(t,"config",{enumerable:!0,get:function(){return c.config}}),Object.defineProperty(t,"$output",{enumerable:!0,get:function(){return c.$output}}),Object.defineProperty(t,"$input",{enumerable:!0,get:function(){return c.$input}}),Object.defineProperty(t,"$brand",{enumerable:!0,get:function(){return c.$brand}}),Object.defineProperty(t,"clone",{enumerable:!0,get:function(){return c.clone}}),Object.defineProperty(t,"regexes",{enumerable:!0,get:function(){return c.regexes}}),Object.defineProperty(t,"treeifyError",{enumerable:!0,get:function(){return c.treeifyError}}),Object.defineProperty(t,"prettifyError",{enumerable:!0,get:function(){return c.prettifyError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return c.formatError}}),Object.defineProperty(t,"flattenError",{enumerable:!0,get:function(){return c.flattenError}}),Object.defineProperty(t,"TimePrecision",{enumerable:!0,get:function(){return c.TimePrecision}}),Object.defineProperty(t,"util",{enumerable:!0,get:function(){return c.util}}),Object.defineProperty(t,"NEVER",{enumerable:!0,get:function(){return c.NEVER}});var s=na;Object.defineProperty(t,"toJSONSchema",{enumerable:!0,get:function(){return s.toJSONSchema}});var u=Nr;Object.defineProperty(t,"fromJSONSchema",{enumerable:!0,get:function(){return u.fromJSONSchema}}),t.locales=C(Ki);var g=Qo();Object.defineProperty(t,"ZodISODateTime",{enumerable:!0,get:function(){return g.ZodISODateTime}}),Object.defineProperty(t,"ZodISODate",{enumerable:!0,get:function(){return g.ZodISODate}}),Object.defineProperty(t,"ZodISOTime",{enumerable:!0,get:function(){return g.ZodISOTime}}),Object.defineProperty(t,"ZodISODuration",{enumerable:!0,get:function(){return g.ZodISODuration}}),t.iso=C(Qo()),t.coerce=C(Jt)})(qt);(function(t){var f=pr&&pr.__createBinding||(Object.create?(function(z,U,c,s){s===void 0&&(s=c);var u=Object.getOwnPropertyDescriptor(U,c);(!u||("get"in u?!U.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return U[c]}}),Object.defineProperty(z,s,u)}):(function(z,U,c,s){s===void 0&&(s=c),z[s]=U[c]})),k=pr&&pr.__setModuleDefault||(Object.create?(function(z,U){Object.defineProperty(z,"default",{enumerable:!0,value:U})}):function(z,U){z.default=U}),C=pr&&pr.__importStar||function(z){if(z&&z.__esModule)return z;var U={};if(z!=null)for(var c in z)c!=="default"&&Object.prototype.hasOwnProperty.call(z,c)&&f(U,z,c);return k(U,z),U},x=pr&&pr.__exportStar||function(z,U){for(var c in z)c!=="default"&&!Object.prototype.hasOwnProperty.call(U,c)&&f(U,z,c)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const S=C(qt);t.z=S,x(qt,t),t.default=S})(pr);var tm;function jm(){return tm||(tm=1,(function(t){var f={};Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});var k=Object.create,C=Object.defineProperty,x=Object.getOwnPropertyDescriptor,S=Object.getOwnPropertyNames,z=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty,c=(e,i,a,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(var l=S(i),d=0,m=l.length,h;d<m;d++)h=l[d],!U.call(e,h)&&h!==a&&C(e,h,{get:(p=>i[p]).bind(null,h),enumerable:!(o=x(i,h))||o.enumerable});return e},s=(e,i,a)=>(a=e!=null?k(z(e)):{},c(i||!e||!e.__esModule?C(a,"default",{value:e,enumerable:!0}):a,e));const u=BO();let g=rm,n=s(g,1);g=s(g);let r=nm;r=s(r,1);let _=DO;_=s(_,1);let M=AO;M=s(M,1);let ee=zO;ee=s(ee,1);let X=TO;X=s(X,1);let ie=RO;ie=s(ie,1);let Q=ZO,ge=FO,xe=pr;function he(e){var i,a,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(i=0;i<l;i++)e[i]&&(a=he(e[i]))&&(o&&(o+=" "),o+=a)}else for(a in e)e[a]&&(o&&(o+=" "),o+=a);return o}function be(){for(var e,i,a=0,o="",l=arguments.length;a<l;a++)(e=arguments[a])&&(i=he(e))&&(o&&(o+=" "),o+=i);return o}var Te=(e,i)=>{const a=new Array(e.length+i.length);for(let o=0;o<e.length;o++)a[o]=e[o];for(let o=0;o<i.length;o++)a[e.length+o]=i[o];return a},Me=(e,i)=>({classGroupId:e,validator:i}),nt=(e=new Map,i=null,a)=>({nextPart:e,validators:i,classGroupId:a}),ht="-",Ct=[],Bt="arbitrary..",zt=e=>{const i=jt(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return Lt(m);const h=m.split(ht);return Dt(h,h[0]===""&&h.length>1?1:0,i)},getConflictingClassGroupIds:(m,h)=>{if(h){const p=o[m],v=a[m];return p?v?Te(v,p):p:v||Ct}return a[m]||Ct}}},Dt=(e,i,a)=>{if(e.length-i===0)return a.classGroupId;const o=e[i],l=a.nextPart.get(o);if(l){const p=Dt(e,i+1,l);if(p)return p}const d=a.validators;if(d===null)return;const m=i===0?e.join(ht):e.slice(i).join(ht),h=d.length;for(let p=0;p<h;p++){const v=d[p];if(v.validator(m))return v.classGroupId}},Lt=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const i=e.slice(1,-1),a=i.indexOf(":"),o=i.slice(0,a);return o?Bt+o:void 0})(),jt=e=>{const{theme:i,classGroups:a}=e;return Ft(a,i)},Ft=(e,i)=>{const a=nt();for(const o in e){const l=e[o];Kt(l,a,o,i)}return a},Kt=(e,i,a,o)=>{const l=e.length;for(let d=0;d<l;d++){const m=e[d];$(m,i,a,o)}},$=(e,i,a,o)=>{if(typeof e=="string"){P(e,i,a);return}if(typeof e=="function"){I(e,i,a,o);return}L(e,i,a,o)},P=(e,i,a)=>{const o=e===""?i:F(i,e);o.classGroupId=a},I=(e,i,a,o)=>{if(W(e)){Kt(e(o),i,a,o);return}i.validators===null&&(i.validators=[]),i.validators.push(Me(a,e))},L=(e,i,a,o)=>{const l=Object.entries(e),d=l.length;for(let m=0;m<d;m++){const[h,p]=l[m];Kt(p,F(i,h),a,o)}},F=(e,i)=>{let a=e;const o=i.split(ht),l=o.length;for(let d=0;d<l;d++){const m=o[d];let h=a.nextPart.get(m);h||(h=nt(),a.nextPart.set(m,h)),a=h}return a},W=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ne=e=>{if(e<1)return{get:()=>{},set:()=>{}};let i=0,a=Object.create(null),o=Object.create(null);const l=(d,m)=>{a[d]=m,i++,i>e&&(i=0,o=a,a=Object.create(null))};return{get(d){let m=a[d];if(m!==void 0)return m;if((m=o[d])!==void 0)return l(d,m),m},set(d,m){d in a?a[d]=m:l(d,m)}}},me="!",H=":",q=[],oe=(e,i,a,o,l)=>({modifiers:e,hasImportantModifier:i,baseClassName:a,maybePostfixModifierPosition:o,isExternal:l}),fe=e=>{const{prefix:i,experimentalParseClassName:a}=e;let o=l=>{const d=[];let m=0,h=0,p=0,v;const y=l.length;for(let A=0;A<y;A++){const R=l[A];if(m===0&&h===0){if(R===H){d.push(l.slice(p,A)),p=A+1;continue}if(R==="/"){v=A;continue}}R==="["?m++:R==="]"?m--:R==="("?h++:R===")"&&h--}const w=d.length===0?l:l.slice(p);let N=w,O=!1;w.endsWith(me)?(N=w.slice(0,-1),O=!0):w.startsWith(me)&&(N=w.slice(1),O=!0);const E=v&&v>p?v-p:void 0;return oe(d,O,N,E)};if(i){const l=i+H,d=o;o=m=>m.startsWith(l)?d(m.slice(l.length)):oe(q,!1,m,void 0,!0)}if(a){const l=o;o=d=>a({className:d,parseClassName:l})}return o},J=e=>{const i=new Map;return e.orderSensitiveModifiers.forEach((a,o)=>{i.set(a,1e6+o)}),a=>{const o=[];let l=[];for(let d=0;d<a.length;d++){const m=a[d],h=m[0]==="[",p=i.has(m);h||p?(l.length>0&&(l.sort(),o.push(...l),l=[]),o.push(m)):l.push(m)}return l.length>0&&(l.sort(),o.push(...l)),o}},le=e=>({cache:ne(e.cacheSize),parseClassName:fe(e),sortModifiers:J(e),...zt(e)}),_e=/\s+/,it=(e,i)=>{const{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:l,sortModifiers:d}=i,m=[],h=e.trim().split(_e);let p="";for(let v=h.length-1;v>=0;v-=1){const y=h[v],{isExternal:w,modifiers:N,hasImportantModifier:O,baseClassName:E,maybePostfixModifierPosition:A}=a(y);if(w){p=y+(p.length>0?" "+p:p);continue}let R=!!A,Z=o(R?E.substring(0,A):E);if(!Z){if(!R){p=y+(p.length>0?" "+p:p);continue}if(Z=o(E),!Z){p=y+(p.length>0?" "+p:p);continue}R=!1}const G=N.length===0?"":N.length===1?N[0]:d(N).join(":"),V=O?G+me:G,re=V+Z;if(m.indexOf(re)>-1)continue;m.push(re);const te=l(Z,R);for(let ce=0;ce<te.length;++ce){const ye=te[ce];m.push(V+ye)}p=y+(p.length>0?" "+p:p)}return p},We=(...e)=>{let i=0,a,o,l="";for(;i<e.length;)(a=e[i++])&&(o=Ye(a))&&(l&&(l+=" "),l+=o);return l},Ye=e=>{if(typeof e=="string")return e;let i,a="";for(let o=0;o<e.length;o++)e[o]&&(i=Ye(e[o]))&&(a&&(a+=" "),a+=i);return a},at=(e,...i)=>{let a,o,l,d;const m=p=>(a=le(i.reduce((v,y)=>y(v),e())),o=a.cache.get,l=a.cache.set,d=h,h(p)),h=p=>{const v=o(p);if(v)return v;const y=it(p,a);return l(p,y),y};return d=m,(...p)=>d(We(...p))},yt=[],Ze=e=>{const i=a=>a[e]||yt;return i.isThemeGetter=!0,i},gt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Lr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,en=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Yo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,es=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ts=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rs=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xt=e=>en.test(e),rt=e=>!!e&&!Number.isNaN(Number(e)),lr=e=>!!e&&Number.isInteger(Number(e)),tn=e=>e.endsWith("%")&&rt(e.slice(0,-1)),Yt=e=>Cr.test(e),Si=()=>!0,ns=e=>Yo.test(e)&&!es.test(e),ji=()=>!1,is=e=>ts.test(e),as=e=>rs.test(e),$i=e=>!Ce(e)&&!Ie(e),os=e=>ir(e,Fr,ji),Ce=e=>gt.test(e),br=e=>ir(e,ca,ns),rn=e=>ir(e,ds,rt),nn=e=>ir(e,Ci,Si),oa=e=>ir(e,Oi,ji),Ur=e=>ir(e,Ni,ji),ss=e=>ir(e,sa,as),Br=e=>ir(e,la,is),Ie=e=>Lr.test(e),Ir=e=>yr(e,ca),cs=e=>yr(e,Oi),ki=e=>yr(e,Ni),ls=e=>yr(e,Fr),Pi=e=>yr(e,sa),an=e=>yr(e,la,!0),us=e=>yr(e,Ci,!0),ir=(e,i,a)=>{const o=gt.exec(e);return o?o[1]?i(o[1]):a(o[2]):!1},yr=(e,i,a=!1)=>{const o=Lr.exec(e);return o?o[1]?i(o[1]):a:!1},Ni=e=>e==="position"||e==="percentage",sa=e=>e==="image"||e==="url",Fr=e=>e==="length"||e==="size"||e==="bg-size",ca=e=>e==="length",ds=e=>e==="number",Oi=e=>e==="family-name",Ci=e=>e==="number"||e==="weight",la=e=>e==="shadow",fs=()=>{const e=Ze("color"),i=Ze("font"),a=Ze("text"),o=Ze("font-weight"),l=Ze("tracking"),d=Ze("leading"),m=Ze("breakpoint"),h=Ze("container"),p=Ze("spacing"),v=Ze("radius"),y=Ze("shadow"),w=Ze("inset-shadow"),N=Ze("text-shadow"),O=Ze("drop-shadow"),E=Ze("blur"),A=Ze("perspective"),R=Ze("aspect"),Z=Ze("ease"),G=Ze("animate"),V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],re=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],te=()=>[...re(),Ie,Ce],ce=()=>["auto","hidden","clip","visible","scroll"],ye=()=>["auto","contain","none"],ue=()=>[Ie,Ce,p],Ee=()=>[Xt,"full","auto",...ue()],Re=()=>[lr,"none","subgrid",Ie,Ce],et=()=>["auto",{span:["full",lr,Ie,Ce]},lr,Ie,Ce],dt=()=>[lr,"auto",Ie,Ce],He=()=>["auto","min","max","fr",Ie,Ce],Je=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Xe=()=>["start","end","center","stretch","center-safe","end-safe"],Ge=()=>["auto",...ue()],Ae=()=>[Xt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...ue()],pt=()=>[Xt,"screen","full","dvw","lvw","svw","min","max","fit",...ue()],ct=()=>[Xt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...ue()],we=()=>[e,Ie,Ce],Oe=()=>[...re(),ki,Ur,{position:[Ie,Ce]}],Pe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Ke=()=>["auto","cover","contain",ls,os,{size:[Ie,Ce]}],ze=()=>[tn,Ir,br],Le=()=>["","none","full",v,Ie,Ce],Ue=()=>["",rt,Ir,br],De=()=>["solid","dashed","dotted","double"],qe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Be=()=>[rt,tn,ki,Ur],Rt=()=>["","none",E,Ie,Ce],Zt=()=>["none",rt,Ie,Ce],Fe=()=>["none",rt,Ie,Ce],lt=()=>[rt,Ie,Ce],_t=()=>[Xt,"full",...ue()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Yt],breakpoint:[Yt],color:[Si],container:[Yt],"drop-shadow":[Yt],ease:["in","out","in-out"],font:[$i],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Yt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Yt],shadow:[Yt],spacing:["px",rt],text:[Yt],"text-shadow":[Yt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xt,Ce,Ie,R]}],container:["container"],columns:[{columns:[rt,Ce,Ie,h]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:te()}],overflow:[{overflow:ce()}],"overflow-x":[{"overflow-x":ce()}],"overflow-y":[{"overflow-y":ce()}],overscroll:[{overscroll:ye()}],"overscroll-x":[{"overscroll-x":ye()}],"overscroll-y":[{"overscroll-y":ye()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Ee()}],"inset-x":[{"inset-x":Ee()}],"inset-y":[{"inset-y":Ee()}],start:[{"inset-s":Ee(),start:Ee()}],end:[{"inset-e":Ee(),end:Ee()}],"inset-bs":[{"inset-bs":Ee()}],"inset-be":[{"inset-be":Ee()}],top:[{top:Ee()}],right:[{right:Ee()}],bottom:[{bottom:Ee()}],left:[{left:Ee()}],visibility:["visible","invisible","collapse"],z:[{z:[lr,"auto",Ie,Ce]}],basis:[{basis:[Xt,"full","auto",h,...ue()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[rt,Xt,"auto","initial","none",Ce]}],grow:[{grow:["",rt,Ie,Ce]}],shrink:[{shrink:["",rt,Ie,Ce]}],order:[{order:[lr,"first","last","none",Ie,Ce]}],"grid-cols":[{"grid-cols":Re()}],"col-start-end":[{col:et()}],"col-start":[{"col-start":dt()}],"col-end":[{"col-end":dt()}],"grid-rows":[{"grid-rows":Re()}],"row-start-end":[{row:et()}],"row-start":[{"row-start":dt()}],"row-end":[{"row-end":dt()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":He()}],"auto-rows":[{"auto-rows":He()}],gap:[{gap:ue()}],"gap-x":[{"gap-x":ue()}],"gap-y":[{"gap-y":ue()}],"justify-content":[{justify:[...Je(),"normal"]}],"justify-items":[{"justify-items":[...Xe(),"normal"]}],"justify-self":[{"justify-self":["auto",...Xe()]}],"align-content":[{content:["normal",...Je()]}],"align-items":[{items:[...Xe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Xe(),{baseline:["","last"]}]}],"place-content":[{"place-content":Je()}],"place-items":[{"place-items":[...Xe(),"baseline"]}],"place-self":[{"place-self":["auto",...Xe()]}],p:[{p:ue()}],px:[{px:ue()}],py:[{py:ue()}],ps:[{ps:ue()}],pe:[{pe:ue()}],pbs:[{pbs:ue()}],pbe:[{pbe:ue()}],pt:[{pt:ue()}],pr:[{pr:ue()}],pb:[{pb:ue()}],pl:[{pl:ue()}],m:[{m:Ge()}],mx:[{mx:Ge()}],my:[{my:Ge()}],ms:[{ms:Ge()}],me:[{me:Ge()}],mbs:[{mbs:Ge()}],mbe:[{mbe:Ge()}],mt:[{mt:Ge()}],mr:[{mr:Ge()}],mb:[{mb:Ge()}],ml:[{ml:Ge()}],"space-x":[{"space-x":ue()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":ue()}],"space-y-reverse":["space-y-reverse"],size:[{size:Ae()}],"inline-size":[{inline:["auto",...pt()]}],"min-inline-size":[{"min-inline":["auto",...pt()]}],"max-inline-size":[{"max-inline":["none",...pt()]}],"block-size":[{block:["auto",...ct()]}],"min-block-size":[{"min-block":["auto",...ct()]}],"max-block-size":[{"max-block":["none",...ct()]}],w:[{w:[h,"screen",...Ae()]}],"min-w":[{"min-w":[h,"screen","none",...Ae()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[m]},...Ae()]}],h:[{h:["screen","lh",...Ae()]}],"min-h":[{"min-h":["screen","lh","none",...Ae()]}],"max-h":[{"max-h":["screen","lh",...Ae()]}],"font-size":[{text:["base",a,Ir,br]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,us,nn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tn,Ce]}],"font-family":[{font:[cs,oa,i]}],"font-features":[{"font-features":[Ce]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Ie,Ce]}],"line-clamp":[{"line-clamp":[rt,"none",Ie,rn]}],leading:[{leading:[d,...ue()]}],"list-image":[{"list-image":["none",Ie,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ie,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:we()}],"text-color":[{text:we()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...De(),"wavy"]}],"text-decoration-thickness":[{decoration:[rt,"from-font","auto",Ie,br]}],"text-decoration-color":[{decoration:we()}],"underline-offset":[{"underline-offset":[rt,"auto",Ie,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ue()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie,Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ie,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Oe()}],"bg-repeat":[{bg:Pe()}],"bg-size":[{bg:Ke()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},lr,Ie,Ce],radial:["",Ie,Ce],conic:[lr,Ie,Ce]},Pi,ss]}],"bg-color":[{bg:we()}],"gradient-from-pos":[{from:ze()}],"gradient-via-pos":[{via:ze()}],"gradient-to-pos":[{to:ze()}],"gradient-from":[{from:we()}],"gradient-via":[{via:we()}],"gradient-to":[{to:we()}],rounded:[{rounded:Le()}],"rounded-s":[{"rounded-s":Le()}],"rounded-e":[{"rounded-e":Le()}],"rounded-t":[{"rounded-t":Le()}],"rounded-r":[{"rounded-r":Le()}],"rounded-b":[{"rounded-b":Le()}],"rounded-l":[{"rounded-l":Le()}],"rounded-ss":[{"rounded-ss":Le()}],"rounded-se":[{"rounded-se":Le()}],"rounded-ee":[{"rounded-ee":Le()}],"rounded-es":[{"rounded-es":Le()}],"rounded-tl":[{"rounded-tl":Le()}],"rounded-tr":[{"rounded-tr":Le()}],"rounded-br":[{"rounded-br":Le()}],"rounded-bl":[{"rounded-bl":Le()}],"border-w":[{border:Ue()}],"border-w-x":[{"border-x":Ue()}],"border-w-y":[{"border-y":Ue()}],"border-w-s":[{"border-s":Ue()}],"border-w-e":[{"border-e":Ue()}],"border-w-bs":[{"border-bs":Ue()}],"border-w-be":[{"border-be":Ue()}],"border-w-t":[{"border-t":Ue()}],"border-w-r":[{"border-r":Ue()}],"border-w-b":[{"border-b":Ue()}],"border-w-l":[{"border-l":Ue()}],"divide-x":[{"divide-x":Ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...De(),"hidden","none"]}],"divide-style":[{divide:[...De(),"hidden","none"]}],"border-color":[{border:we()}],"border-color-x":[{"border-x":we()}],"border-color-y":[{"border-y":we()}],"border-color-s":[{"border-s":we()}],"border-color-e":[{"border-e":we()}],"border-color-bs":[{"border-bs":we()}],"border-color-be":[{"border-be":we()}],"border-color-t":[{"border-t":we()}],"border-color-r":[{"border-r":we()}],"border-color-b":[{"border-b":we()}],"border-color-l":[{"border-l":we()}],"divide-color":[{divide:we()}],"outline-style":[{outline:[...De(),"none","hidden"]}],"outline-offset":[{"outline-offset":[rt,Ie,Ce]}],"outline-w":[{outline:["",rt,Ir,br]}],"outline-color":[{outline:we()}],shadow:[{shadow:["","none",y,an,Br]}],"shadow-color":[{shadow:we()}],"inset-shadow":[{"inset-shadow":["none",w,an,Br]}],"inset-shadow-color":[{"inset-shadow":we()}],"ring-w":[{ring:Ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:we()}],"ring-offset-w":[{"ring-offset":[rt,br]}],"ring-offset-color":[{"ring-offset":we()}],"inset-ring-w":[{"inset-ring":Ue()}],"inset-ring-color":[{"inset-ring":we()}],"text-shadow":[{"text-shadow":["none",N,an,Br]}],"text-shadow-color":[{"text-shadow":we()}],opacity:[{opacity:[rt,Ie,Ce]}],"mix-blend":[{"mix-blend":[...qe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":qe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[rt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Be()}],"mask-image-linear-to-pos":[{"mask-linear-to":Be()}],"mask-image-linear-from-color":[{"mask-linear-from":we()}],"mask-image-linear-to-color":[{"mask-linear-to":we()}],"mask-image-t-from-pos":[{"mask-t-from":Be()}],"mask-image-t-to-pos":[{"mask-t-to":Be()}],"mask-image-t-from-color":[{"mask-t-from":we()}],"mask-image-t-to-color":[{"mask-t-to":we()}],"mask-image-r-from-pos":[{"mask-r-from":Be()}],"mask-image-r-to-pos":[{"mask-r-to":Be()}],"mask-image-r-from-color":[{"mask-r-from":we()}],"mask-image-r-to-color":[{"mask-r-to":we()}],"mask-image-b-from-pos":[{"mask-b-from":Be()}],"mask-image-b-to-pos":[{"mask-b-to":Be()}],"mask-image-b-from-color":[{"mask-b-from":we()}],"mask-image-b-to-color":[{"mask-b-to":we()}],"mask-image-l-from-pos":[{"mask-l-from":Be()}],"mask-image-l-to-pos":[{"mask-l-to":Be()}],"mask-image-l-from-color":[{"mask-l-from":we()}],"mask-image-l-to-color":[{"mask-l-to":we()}],"mask-image-x-from-pos":[{"mask-x-from":Be()}],"mask-image-x-to-pos":[{"mask-x-to":Be()}],"mask-image-x-from-color":[{"mask-x-from":we()}],"mask-image-x-to-color":[{"mask-x-to":we()}],"mask-image-y-from-pos":[{"mask-y-from":Be()}],"mask-image-y-to-pos":[{"mask-y-to":Be()}],"mask-image-y-from-color":[{"mask-y-from":we()}],"mask-image-y-to-color":[{"mask-y-to":we()}],"mask-image-radial":[{"mask-radial":[Ie,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":Be()}],"mask-image-radial-to-pos":[{"mask-radial-to":Be()}],"mask-image-radial-from-color":[{"mask-radial-from":we()}],"mask-image-radial-to-color":[{"mask-radial-to":we()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":re()}],"mask-image-conic-pos":[{"mask-conic":[rt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Be()}],"mask-image-conic-to-pos":[{"mask-conic-to":Be()}],"mask-image-conic-from-color":[{"mask-conic-from":we()}],"mask-image-conic-to-color":[{"mask-conic-to":we()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Oe()}],"mask-repeat":[{mask:Pe()}],"mask-size":[{mask:Ke()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ie,Ce]}],filter:[{filter:["","none",Ie,Ce]}],blur:[{blur:Rt()}],brightness:[{brightness:[rt,Ie,Ce]}],contrast:[{contrast:[rt,Ie,Ce]}],"drop-shadow":[{"drop-shadow":["","none",O,an,Br]}],"drop-shadow-color":[{"drop-shadow":we()}],grayscale:[{grayscale:["",rt,Ie,Ce]}],"hue-rotate":[{"hue-rotate":[rt,Ie,Ce]}],invert:[{invert:["",rt,Ie,Ce]}],saturate:[{saturate:[rt,Ie,Ce]}],sepia:[{sepia:["",rt,Ie,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ie,Ce]}],"backdrop-blur":[{"backdrop-blur":Rt()}],"backdrop-brightness":[{"backdrop-brightness":[rt,Ie,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[rt,Ie,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",rt,Ie,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[rt,Ie,Ce]}],"backdrop-invert":[{"backdrop-invert":["",rt,Ie,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[rt,Ie,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[rt,Ie,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",rt,Ie,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":ue()}],"border-spacing-x":[{"border-spacing-x":ue()}],"border-spacing-y":[{"border-spacing-y":ue()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ie,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[rt,"initial",Ie,Ce]}],ease:[{ease:["linear","initial",Z,Ie,Ce]}],delay:[{delay:[rt,Ie,Ce]}],animate:[{animate:["none",G,Ie,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[A,Ie,Ce]}],"perspective-origin":[{"perspective-origin":te()}],rotate:[{rotate:Zt()}],"rotate-x":[{"rotate-x":Zt()}],"rotate-y":[{"rotate-y":Zt()}],"rotate-z":[{"rotate-z":Zt()}],scale:[{scale:Fe()}],"scale-x":[{"scale-x":Fe()}],"scale-y":[{"scale-y":Fe()}],"scale-z":[{"scale-z":Fe()}],"scale-3d":["scale-3d"],skew:[{skew:lt()}],"skew-x":[{"skew-x":lt()}],"skew-y":[{"skew-y":lt()}],transform:[{transform:[Ie,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:te()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_t()}],"translate-x":[{"translate-x":_t()}],"translate-y":[{"translate-y":_t()}],"translate-z":[{"translate-z":_t()}],"translate-none":["translate-none"],accent:[{accent:we()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:we()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ie,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ue()}],"scroll-mx":[{"scroll-mx":ue()}],"scroll-my":[{"scroll-my":ue()}],"scroll-ms":[{"scroll-ms":ue()}],"scroll-me":[{"scroll-me":ue()}],"scroll-mbs":[{"scroll-mbs":ue()}],"scroll-mbe":[{"scroll-mbe":ue()}],"scroll-mt":[{"scroll-mt":ue()}],"scroll-mr":[{"scroll-mr":ue()}],"scroll-mb":[{"scroll-mb":ue()}],"scroll-ml":[{"scroll-ml":ue()}],"scroll-p":[{"scroll-p":ue()}],"scroll-px":[{"scroll-px":ue()}],"scroll-py":[{"scroll-py":ue()}],"scroll-ps":[{"scroll-ps":ue()}],"scroll-pe":[{"scroll-pe":ue()}],"scroll-pbs":[{"scroll-pbs":ue()}],"scroll-pbe":[{"scroll-pbe":ue()}],"scroll-pt":[{"scroll-pt":ue()}],"scroll-pr":[{"scroll-pr":ue()}],"scroll-pb":[{"scroll-pb":ue()}],"scroll-pl":[{"scroll-pl":ue()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ie,Ce]}],fill:[{fill:["none",...we()]}],"stroke-w":[{stroke:[rt,Ir,br,rn]}],stroke:[{stroke:["none",...we()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ms=at(fs);function K(...e){return ms(be(e))}var b="rounded-lg border border-border bg-surface overflow-hidden",D="border-b border-border px-3 sm:px-4 py-1.5 sm:py-2",T="p-2 sm:p-3 lg:p-4",B="space-y-3 sm:space-y-4",Y="gap-2 sm:gap-3",mt="px-3 sm:px-4 py-1.5 sm:py-2",$t="grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4",on="grid grid-cols-1 lg:grid-cols-2",km="flex flex-col-reverse md:flex-row",Pm="w-full md:w-44 lg:w-52 md:flex-shrink-0 border-b md:border-b-0 md:border-l border-border",Nm="text-[10px] sm:text-[11px] font-semibold text-foreground uppercase tracking-wider",Om="text-[11px] sm:text-xs text-foreground",Cm="text-[10px] text-foreground-subtle",Im="text-[11px] sm:text-xs font-medium text-foreground",Em="text-base sm:text-lg font-semibold leading-tight text-foreground",Mm="inline-flex items-center justify-center gap-1 rounded border border-border bg-surface px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-foreground hover:bg-surface-hover transition-colors disabled:opacity-40",Dm="inline-flex items-center justify-center gap-1 rounded border border-primary/40 bg-primary/15 px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-primary hover:bg-primary/25 transition-colors disabled:opacity-40",Am="inline-flex items-center justify-center gap-1 rounded border border-danger/40 bg-danger/10 px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-danger hover:bg-danger/20 transition-colors disabled:opacity-40",zm="inline-flex items-center justify-center gap-1 rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-warning hover:bg-warning/20 transition-colors disabled:opacity-40",Tm="w-full rounded border border-border bg-background px-1.5 py-0.5 sm:px-2 sm:py-1 text-[11px] sm:text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none",Rm="inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium transition-colors",Zm="border-primary/50 bg-primary/15 text-primary",Lm="border-border bg-surface text-foreground-subtle hover:bg-surface-hover";function Um(e,i){for(const a of e.slots)for(const o of a.addons)if(o.id===i)return o;return null}function Bm(e,i){return e.models.find(a=>a.id===i)??null}function Fm(e,i){return e.models.find(a=>!!a.formats[i])??null}function Gm(e,i){const a=new Set((i.configSchema??[]).map(l=>l.key)),o={};for(const[l,d]of Object.entries(e))a.has(l)&&(o[l]=d);return o}function Vm(e){const{source:i,target:a,catalog:o,addonIds:l}=e,d=[];for(const m of l){const h=i.defaults[m];if(!h){d.push({addonId:m,outcome:"skip",modelId:null,reason:"no source entry",patch:null});continue}const p=Um(o,m);if(!p){d.push({addonId:m,outcome:"skip",modelId:null,reason:"addon not in target catalog",patch:null});continue}const v=Bm(p,h.modelId),y=v!==null&&!!v.formats[a.engine.format];let w,N;if(y)w=h.modelId,N="exact";else{const E=Fm(p,a.engine.format);if(!E){d.push({addonId:m,outcome:"skip",modelId:null,reason:"no compatible model for target format",patch:null});continue}w=E.id,N="mapped"}const O={enabled:h.enabled,modelId:w,settings:Gm(h.settings,p)};d.push({addonId:m,outcome:N,modelId:w,patch:O})}return d}var gs={idle:{label:"Idle",textColor:"text-foreground-subtle",badgeClass:"border-border bg-surface-hover text-foreground-subtle",dotClass:"bg-gray-400",icon:"PowerOff"},active:{label:"Active",textColor:"text-success",badgeClass:"border-success/40 bg-success/10 text-success",dotClass:"bg-red-500 animate-pulse",icon:"Activity"},watching:{label:"Watching",textColor:"text-foreground-subtle",badgeClass:"border-border bg-surface-hover text-foreground-subtle",dotClass:"bg-emerald-500",icon:"Eye"},"load-shed":{label:"Load-Shed",textColor:"text-amber-500",badgeClass:"border-amber-500/40 bg-amber-500/10 text-amber-500",dotClass:"bg-amber-500",icon:"AlertTriangle"},paused:{label:"Paused",textColor:"text-gray-400",badgeClass:"border-gray-500/40 bg-gray-500/10 text-gray-400",dotClass:"bg-gray-400",icon:"PauseCircle"}};function ps(e){return gs[e]??gs.watching}function _r(e,i){if(typeof globalThis>"u")return(0,n.createContext)(i);const a=globalThis.__camstackSharedContexts,o=a??new Map;a||(globalThis.__camstackSharedContexts=o);const l=o.get(e);if(l)return l;const d=(0,n.createContext)(i);return o.set(e,d),d}var Qm="FEDERATION_DEBUG",vs=(function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e})({}),Zc=!0;function Wm(){return Zc}function qm(){try{if(Wm()&&window.localStorage)return!!localStorage.getItem(Qm)}catch{return!1}return!1}function hs(){return typeof process<"u"&&f&&f.FEDERATION_DEBUG?!!f.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:qm()}var Hm="[ Federation Runtime ]",Lc=function(...e){return e.length?e.reduce((i,a)=>a?i?`${i}:${a}`:a:i,""):""},bs=(e,i)=>{if("getPublicPath"in e){let a;return e.getPublicPath.startsWith("function")?a=new Function("return "+e.getPublicPath)()():a=new Function(e.getPublicPath)(),`${a}${i}`}else return"publicPath"in e?`${e.publicPath}${i}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,i),"")},Uc=e=>{console.warn(`${Hm}: ${e}`)};function Bc(e){try{return JSON.stringify(e,null,2)}catch{return""}}var ys=(e,i)=>{if(!e)return i;const o=(l=>{if(l===".")return"";if(l.startsWith("./"))return l.replace("./","");if(l.startsWith("/")){const d=l.slice(1);return d.endsWith("/")?d.slice(0,-1):d}return l})(e);return o?o.endsWith("/")?`${o}${i}`:`${o}/${i}`:i};function Jm(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function Km(e,i={}){const{remotes:a={},overrides:o={},version:l}=i;let d;const m=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&l?Jm(l):e.metaData.publicPath:e.metaData.getPublicPath,h=Object.keys(o);let p={};Object.keys(a).length||(p=e.remotes?.reduce((G,V)=>{let re;const te=V.federationContainerName;return h.includes(te)?re=o[te]:"version"in V?re=V.version:re=V.entry,G[te]={matchedVersion:re},G},{})||{}),Object.keys(a).forEach(G=>p[G]={matchedVersion:h.includes(G)?o[G]:a[G]});const{remoteEntry:{path:v,name:y,type:w},types:N={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:O},globalName:E,ssrRemoteEntry:A}=e.metaData,{exposes:R}=e;let Z={version:l||"",buildVersion:O,globalName:E,remoteEntry:ys(v,y),remoteEntryType:w,remoteTypes:ys(N.path,N.name),remoteTypesZip:N.zip||"",remoteTypesAPI:N.api||"",remotesInfo:p,shared:e?.shared.map(G=>({assets:G.assets,sharedName:G.name,version:G.version,usedExports:G.referenceExports||[]})),modules:R?.map(G=>({moduleName:G.name,modulePath:G.path,assets:G.assets}))};if("publicPath"in e.metaData?(d={...Z,publicPath:m()},typeof e.metaData.ssrPublicPath=="string"&&(d.ssrPublicPath=e.metaData.ssrPublicPath)):d={...Z,getPublicPath:m()},A){const G=ys(A.path,A.name);d.ssrRemoteEntry=G,d.ssrRemoteEntryType=A.type||"commonjs-module"}return d}function Fc(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(".json"))}var Xm="[ Module Federation ]",Ii=console,Ym=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function eg(){try{const e=new Error().stack;if(!e)return;const[,...i]=e.split(`
95
- `),a=i.filter(o=>!Ym.some(l=>o.includes(l)));return a.length?`Stack trace:
96
- ${a.slice(0,5).join(`
97
- `)}`:void 0}catch{return}}var Gc=class{constructor(e,i=Ii){this.prefix=e,this.delegate=i??Ii}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??Ii}emit(e,i){const a=this.delegate,o=hs()?eg():void 0,l=o?[...i,o]:i,d=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];default:return["debug","log"]}})();for(const m of d){const h=a[m];if(typeof h=="function"){h.call(a,this.prefix,...l);return}}for(const m of d){const h=Ii[m];if(typeof h=="function"){h.call(Ii,this.prefix,...l);return}}}log(...e){this.emit("log",e)}warn(...e){this.emit("warn",e)}error(...e){this.emit("error",e)}success(...e){this.emit("info",e)}info(...e){this.emit("info",e)}ready(...e){this.emit("info",e)}debug(...e){hs()&&this.emit("debug",e)}};function tg(e){return new Gc(e)}function rg(e){const i=new Gc(e);return Object.defineProperty(i,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),i}rg(Xm);async function Vc(e,i){try{return await e()}catch(a){Uc(a);return}}function _s(e,i){const a=/^(https?:)?\/\//i;return e.replace(a,"").replace(/\/$/,"")===i.replace(a,"").replace(/\/$/,"")}function Qc(e){let i=null,a=!0,o=2e4,l;const d=document.getElementsByTagName("script");for(let v=0;v<d.length;v++){const y=d[v],w=y.getAttribute("src");if(w&&_s(w,e.url)){i=y,a=!1;break}}if(!i){const v=e.attrs;i=document.createElement("script"),i.type=v?.type==="module"?"module":"text/javascript";let y;e.createScriptHook&&(y=e.createScriptHook(e.url,e.attrs),y instanceof HTMLScriptElement?i=y:typeof y=="object"&&("script"in y&&y.script&&(i=y.script),"timeout"in y&&y.timeout&&(o=y.timeout))),i.src||(i.src=e.url),v&&!y&&Object.keys(v).forEach(w=>{i&&(w==="async"||w==="defer"?i[w]=v[w]:i.getAttribute(w)||i.setAttribute(w,v[w]))})}let m=null;const h=typeof window<"u"?v=>{if(v.filename&&_s(v.filename,e.url)){const y=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${v.message} (${v.filename}:${v.lineno}:${v.colno})`);y.name="ScriptExecutionError",m=y}}:null;h&&window.addEventListener("error",h);const p=async(v,y)=>{clearTimeout(l),h&&window.removeEventListener("error",h);const w=()=>{if(y?.type==="error"){const N=new Error(y?.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);N.name="ScriptNetworkError",e?.onErrorCallback&&e?.onErrorCallback(N)}else m?e?.onErrorCallback&&e?.onErrorCallback(m):e?.cb&&e?.cb()};if(i&&(i.onerror=null,i.onload=null,Vc(()=>{const{needDeleteScript:N=!0}=e;N&&i?.parentNode&&i.parentNode.removeChild(i)}),v&&typeof v=="function")){const N=v(y);if(N instanceof Promise){const O=await N;return w(),O}return w(),N}w()};return i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),l=setTimeout(()=>{p(null,{type:"error",isTimeout:!0})},o),{script:i,needAttach:a}}function xs(e){let i=null,a=!0;const o=document.getElementsByTagName("link");for(let d=0;d<o.length;d++){const m=o[d],h=m.getAttribute("href"),p=m.getAttribute("rel");if(h&&_s(h,e.url)&&p===e.attrs.rel){i=m,a=!1;break}}if(!i){i=document.createElement("link"),i.setAttribute("href",e.url);let d;const m=e.attrs;e.createLinkHook&&(d=e.createLinkHook(e.url,m),d instanceof HTMLLinkElement&&(i=d)),m&&!d&&Object.keys(m).forEach(h=>{i&&!i.getAttribute(h)&&i.setAttribute(h,m[h])})}const l=(d,m)=>{const h=()=>{m?.type==="error"?e?.onErrorCallback&&e?.onErrorCallback(m):e?.cb&&e?.cb()};if(i&&(i.onerror=null,i.onload=null,Vc(()=>{const{needDeleteLink:p=!0}=e;p&&i?.parentNode&&i.parentNode.removeChild(i)}),d)){const p=d(m);return h(),p}h()};return i.onerror=l.bind(null,i.onerror),i.onload=l.bind(null,i.onload),{link:i,needAttach:a}}function ng(e,i){const{attrs:a={},createScriptHook:o}=i;return new Promise((l,d)=>{const{script:m,needAttach:h}=Qc({url:e,cb:l,onErrorCallback:d,attrs:{fetchpriority:"high",...a},createScriptHook:o,needDeleteScript:!0});h&&document.head.appendChild(m)})}var ig=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,Wc=(e,i,a,o)=>{const l=[`${[i[e]]} #${e}`];return a&&l.push(`args: ${JSON.stringify(a)}`),l.push(ig(e)),o&&l.push(`Original Error Message:
98
- ${o}`),l.join(`
99
- `)};function ag(e,i,a,o,l,d){return o(Wc(e,i,a,l))}var Gr="[ Federation Runtime ]",ws=tg(Gr);function Gt(e,i,a,o,l){e||(a!==void 0?kt(i,a,o,void 0):kt(i))}function kt(e,i,a,o,l){if(i!==void 0)return ag(e,i,a??{},m=>{throw new Error(`${Gr}: ${m}`)},o);const d=e;throw d instanceof Error?(d.message.startsWith(Gr)||(d.message=`${Gr}: ${d.message}`),d):new Error(`${Gr}: ${d}`)}function Ss(e){e instanceof Error&&(e.message.startsWith(Gr)||(e.message=`${Gr}: ${e.message}`)),ws.warn(e)}function og(e,i){return e.findIndex(a=>a===i)===-1&&e.push(i),e}function Ei(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function js(e){return typeof e.entry<"u"}function qc(e){return!e.entry.includes(".json")}function $s(e){return e&&typeof e=="object"}var sg=Object.prototype.toString;function cg(e){return sg.call(e)==="[object Object]"}function Hc(e){return Array.isArray(e)?e:[e]}function Jc(e){const i={url:"",type:"global",globalName:""};return"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:i}var lg=(e,i)=>{let a;return e.endsWith("/")?a=e.slice(0,-1):a=e,i.startsWith(".")&&(i=i.slice(1)),a=a+i,a},It=typeof globalThis=="object"?globalThis:window,ar=(()=>{try{return document.defaultView}catch{return It}})(),Mi=ar;function ua(e,i,a){Object.defineProperty(e,i,{value:a,configurable:!1,writable:!0})}function da(e,i){return Object.hasOwnProperty.call(e,i)}da(It,"__GLOBAL_LOADING_REMOTE_ENTRY__")||ua(It,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});var sn=It.__GLOBAL_LOADING_REMOTE_ENTRY__;function Kc(e){da(e,"__VMOK__")&&!da(e,"__FEDERATION__")&&ua(e,"__FEDERATION__",e.__VMOK__),da(e,"__FEDERATION__")||(ua(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),ua(e,"__VMOK__",e.__FEDERATION__)),e.__FEDERATION__.__GLOBAL_PLUGIN__??=[],e.__FEDERATION__.__INSTANCES__??=[],e.__FEDERATION__.moduleInfo??={},e.__FEDERATION__.__SHARE__??={},e.__FEDERATION__.__MANIFEST_LOADING__??={},e.__FEDERATION__.__PRELOADED_MAP__??=new Map}Kc(It),Kc(ar);function ug(e){It.__FEDERATION__.__INSTANCES__.push(e)}function dg(){return It.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function fg(e,i=hs()){i&&(It.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,It.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.4.0")}function cn(e,i){if(typeof i=="string"){if(e[i])return{value:e[i],key:i};{const a=Object.keys(e);for(const o of a){const[l,d]=o.split(":"),m=`${l}:${i}`,h=e[m];if(h)return{value:h,key:m}}return{value:void 0,key:i}}}else kt(`getInfoWithoutType: "key" must be a string, got ${typeof i} (${JSON.stringify(i)}).`)}var Xc=()=>ar.__FEDERATION__.moduleInfo,mg=(e,i)=>{const a=cn(i,Ei(e)).value;if(a&&!a.version&&"version"in e&&e.version&&(a.version=e.version),a)return a;if("version"in e&&e.version){const{version:o,...l}=e,d=Ei(l),m=cn(ar.__FEDERATION__.moduleInfo,d).value;if(m?.version===o)return m}},fa=e=>mg(e,ar.__FEDERATION__.moduleInfo),Yc=(e,i)=>{const a=Ei(e);return ar.__FEDERATION__.moduleInfo[a]=i,ar.__FEDERATION__.moduleInfo},gg=e=>(ar.__FEDERATION__.moduleInfo={...ar.__FEDERATION__.moduleInfo,...e},()=>{const i=Object.keys(e);for(const a of i)delete ar.__FEDERATION__.moduleInfo[a]}),el=(e,i)=>{const a=i||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:a,entryExports:It[a]}},pg=()=>ar.__FEDERATION__.__GLOBAL_PLUGIN__,vg=e=>It.__FEDERATION__.__PRELOADED_MAP__.get(e),hg=e=>It.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),tl="[0-9A-Za-z-]+",ks=`(?:\\+(${tl}(?:\\.${tl})*))`,Di="0|[1-9]\\d*",ma="[0-9]+",rl="\\d*[a-zA-Z-][a-zA-Z0-9-]*",nl=`(?:${ma}|${rl})`,bg=`(?:-?(${nl}(?:\\.${nl})*))`,il=`(?:${Di}|${rl})`,al=`(?:-(${il}(?:\\.${il})*))`,Ps=`${Di}|x|X|\\*`,ln=`[v=\\s]*(${Ps})(?:\\.(${Ps})(?:\\.(${Ps})(?:${al})?${ks}?)?)?`,yg=`^\\s*(${ln})\\s+-\\s+(${ln})\\s*$`,_g=`[v=\\s]*${`(${ma})\\.(${ma})\\.(${ma})`}${bg}?${ks}?`,Ns="((?:<|>)?=?)",xg=`(\\s*)${Ns}\\s*(${_g}|${ln})`,ol="(?:~>?)",wg=`(\\s*)${ol}\\s+`,sl="(?:\\^)",Sg=`(\\s*)${sl}\\s+`,jg="(<|>)?=?\\s*\\*",$g=`^${sl}${ln}$`,kg=`v?${`(${Di})\\.(${Di})\\.(${Di})`}${al}?${ks}?`,Pg=`^${ol}${ln}$`,Ng=`^${Ns}\\s*${ln}$`,Og=`^${Ns}\\s*(${kg})$|^$`,Cg="^\\s*>=\\s*0.0.0\\s*$";function ur(e){return new RegExp(e)}function Tt(e){return!e||e.toLowerCase()==="x"||e==="*"}function cl(...e){return i=>e.reduce((a,o)=>o(a),i)}function ll(e){return e.match(ur(Og))}function ul(e,i,a,o){const l=`${e}.${i}.${a}`;return o?`${l}-${o}`:l}function Ig(e){return e.replace(ur(yg),(i,a,o,l,d,m,h,p,v,y,w,N)=>(Tt(o)?a="":Tt(l)?a=`>=${o}.0.0`:Tt(d)?a=`>=${o}.${l}.0`:a=`>=${a}`,Tt(v)?p="":Tt(y)?p=`<${Number(v)+1}.0.0-0`:Tt(w)?p=`<${v}.${Number(y)+1}.0-0`:N?p=`<=${v}.${y}.${w}-${N}`:p=`<=${p}`,`${a} ${p}`.trim()))}function Eg(e){return e.replace(ur(xg),"$1$2$3")}function Mg(e){return e.replace(ur(wg),"$1~")}function Dg(e){return e.replace(ur(Sg),"$1^")}function Ag(e){return e.trim().split(/\s+/).map(i=>i.replace(ur($g),(a,o,l,d,m)=>Tt(o)?"":Tt(l)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:Tt(d)?o==="0"?`>=${o}.${l}.0 <${o}.${Number(l)+1}.0-0`:`>=${o}.${l}.0 <${Number(o)+1}.0.0-0`:m?o==="0"?l==="0"?`>=${o}.${l}.${d}-${m} <${o}.${l}.${Number(d)+1}-0`:`>=${o}.${l}.${d}-${m} <${o}.${Number(l)+1}.0-0`:`>=${o}.${l}.${d}-${m} <${Number(o)+1}.0.0-0`:o==="0"?l==="0"?`>=${o}.${l}.${d} <${o}.${l}.${Number(d)+1}-0`:`>=${o}.${l}.${d} <${o}.${Number(l)+1}.0-0`:`>=${o}.${l}.${d} <${Number(o)+1}.0.0-0`)).join(" ")}function zg(e){return e.trim().split(/\s+/).map(i=>i.replace(ur(Pg),(a,o,l,d,m)=>Tt(o)?"":Tt(l)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:Tt(d)?`>=${o}.${l}.0 <${o}.${Number(l)+1}.0-0`:m?`>=${o}.${l}.${d}-${m} <${o}.${Number(l)+1}.0-0`:`>=${o}.${l}.${d} <${o}.${Number(l)+1}.0-0`)).join(" ")}function Tg(e){return e.split(/\s+/).map(i=>i.trim().replace(ur(Ng),(a,o,l,d,m,h)=>{const p=Tt(l),v=p||Tt(d),y=v||Tt(m);return o==="="&&y&&(o=""),h="",p?o===">"||o==="<"?"<0.0.0-0":"*":o&&y?(v&&(d=0),m=0,o===">"?(o=">=",v?(l=Number(l)+1,d=0,m=0):(d=Number(d)+1,m=0)):o==="<="&&(o="<",v?l=Number(l)+1:d=Number(d)+1),o==="<"&&(h="-0"),`${o+l}.${d}.${m}${h}`):v?`>=${l}.0.0${h} <${Number(l)+1}.0.0-0`:y?`>=${l}.${d}.0${h} <${l}.${Number(d)+1}.0-0`:a})).join(" ")}function Rg(e){return e.trim().replace(ur(jg),"")}function Zg(e){return e.trim().replace(ur(Cg),"")}function ga(e,i){return e=Number(e)||e,i=Number(i)||i,e>i?1:e===i?0:-1}function Lg(e,i){const{preRelease:a}=e,{preRelease:o}=i;if(a===void 0&&o)return 1;if(a&&o===void 0)return-1;if(a===void 0&&o===void 0)return 0;for(let l=0,d=a.length;l<=d;l++){const m=a[l],h=o[l];if(m!==h)return m===void 0&&h===void 0?0:m?h?ga(m,h):-1:1}return 0}function pa(e,i){return ga(e.major,i.major)||ga(e.minor,i.minor)||ga(e.patch,i.patch)||Lg(e,i)}function Os(e,i){return e.version===i.version}function Ug(e,i){switch(e.operator){case"":case"=":return Os(e,i);case">":return pa(e,i)<0;case">=":return Os(e,i)||pa(e,i)<0;case"<":return pa(e,i)>0;case"<=":return Os(e,i)||pa(e,i)>0;case void 0:return!0;default:return!1}}function Bg(e){return cl(Ag,zg,Tg,Rg)(e)}function Fg(e){return cl(Ig,Eg,Mg,Dg)(e.trim()).split(/\s+/).join(" ")}function Ai(e,i){if(!e)return!1;const a=ll(e);if(!a)return!1;const[,o,,l,d,m,h]=a,p={operator:o,version:ul(l,d,m,h),major:l,minor:d,patch:m,preRelease:h?.split(".")},v=i.split("||");for(const y of v){const w=y.trim();if(!w||w==="*"||w==="x")return!0;try{const N=Fg(w);if(!N.trim())return!0;const O=N.split(" ").map(R=>Bg(R)).join(" ");if(!O.trim())return!0;const E=O.split(/\s+/).map(R=>Zg(R)).filter(Boolean);if(E.length===0)continue;let A=!0;for(const R of E){const Z=ll(R);if(!Z){A=!1;break}const[,G,,V,re,te,ce]=Z;if(!Ug({operator:G,version:ul(V,re,te,ce),major:V,minor:re,patch:te,preRelease:ce?.split(".")},p)){A=!1;break}}if(A)return!0}catch(N){console.error(`[semver] Error processing range part "${w}":`,N);continue}}return!1}var va="default",Gg="global";function Vg(e,i,a,o){let l;return"get"in e?l=e.get:"lib"in e?l=()=>Promise.resolve(e.lib):l=()=>Promise.resolve(()=>{kt(`Cannot get shared "${a}" from "${i}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&kt(`Invalid shared config for "${a}" from "${i}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:i,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:l,loaded:e?.loaded||"lib"in e?!0:void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??o)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??vs.UNKNOWN,useIn:[]}:void 0}}function dl(e,i){const a=i.shared||{},o=i.name,l=Object.keys(a).reduce((m,h)=>{const p=Hc(a[h]);return m[h]=m[h]||[],p.forEach(v=>{m[h].push(Vg(v,o,h,i.shareStrategy))}),m},{}),d={...e.shared};return Object.keys(l).forEach(m=>{d[m]?l[m].forEach(h=>{d[m].find(p=>p.version===h.version)||d[m].push(h)}):d[m]=l[m]}),{allShareInfos:d,newShareInfos:l}}function zi(e,i){if(!e)return!1;const{status:a,mode:o}=e;return a===vs.NO_USE?!1:a===vs.CALCULATED?!0:o==="runtime-infer"?i?Wg(e,i):!0:!1}function Vr(e,i){const a=o=>{if(!Number.isNaN(Number(o))){const l=o.split(".");let d=o;for(let m=0;m<3-l.length;m++)d+=".0";return d}return o};return!!Ai(a(e),`<=${a(i)}`)}var Ti=(e,i)=>{const a=i||function(o,l){return Vr(o,l)};return Object.keys(e).reduce((o,l)=>!o||a(o,l)||o==="0"?l:o,0)},ha=e=>!!e.loaded||typeof e.lib=="function",Qg=e=>!!e.loading,Wg=(e,i)=>{if(!e||!i)return!1;const{usedExports:a}=e;return a?!!i.every(o=>a.includes(o)):!1};function qg(e,i,a,o){const l=e[i][a];let d="",m=zi(o);const h=function(p,v){return m?l[p].treeShaking?l[v].treeShaking?!ha(l[p].treeShaking)&&Vr(p,v):!1:!0:!ha(l[p])&&Vr(p,v)};if(m){if(d=Ti(e[i][a],h),d)return{version:d,useTreesShaking:m};m=!1}return{version:Ti(e[i][a],h),useTreesShaking:m}}var un=e=>ha(e)||Qg(e);function Hg(e,i,a,o){const l=e[i][a];let d="",m=zi(o);const h=function(p,v){if(m){if(!l[p].treeShaking)return!0;if(!l[v].treeShaking)return!1;if(un(l[v].treeShaking))return un(l[p].treeShaking)?!!Vr(p,v):!0;if(un(l[p].treeShaking))return!1}return un(l[v])?un(l[p])?!!Vr(p,v):!0:un(l[p])?!1:Vr(p,v)};if(m){if(d=Ti(e[i][a],h),d)return{version:d,useTreesShaking:m};m=!1}return{version:Ti(e[i][a],h),useTreesShaking:m}}function Jg(e){return e==="loaded-first"?Hg:qg}function ba(e,i,a,o){if(!e)return;const{shareConfig:l,scope:d=va,strategy:m,treeShaking:h}=a,p=Array.isArray(d)?d:[d];for(const v of p)if(l&&e[v]&&e[v][i]){const{requiredVersion:y}=l,{version:w,useTreesShaking:N}=Jg(m)(e,v,i,h),O=()=>{const A=e[v][i][w];if(l.singleton){if(typeof y=="string"&&!Ai(w,y)){const R=`Version ${w} from ${w&&A.from} of shared singleton module ${i} does not satisfy the requirement of ${a.from} which needs ${y})`;l.strictVersion?kt(R):Ss(R)}return{shared:A,useTreesShaking:N}}else{if(y===!1||y==="*")return{shared:A,useTreesShaking:N};if(Ai(w,y))return{shared:A,useTreesShaking:N};const R=zi(h);if(R){for(const[Z,G]of Object.entries(e[v][i]))if(zi(G.treeShaking,h?.usedExports)&&Ai(Z,y))return{shared:G,useTreesShaking:R}}for(const[Z,G]of Object.entries(e[v][i]))if(Ai(Z,y))return{shared:G,useTreesShaking:!1}}},E={shareScopeMap:e,scope:v,pkgName:i,version:w,GlobalFederation:Mi.__FEDERATION__,shareInfo:a,resolver:O};return(o.emit(E)||E).resolver()}}function fl(){return Mi.__FEDERATION__.__SHARE__}function ml(e){const{pkgName:i,extraOptions:a,shareInfos:o}=e,l=p=>{if(!p)return;const v={};return p.forEach(w=>{v[w.version]=w}),v[Ti(v,function(w,N){return!ha(v[w])&&Vr(w,N)})]},d=a?.resolver??l,m=p=>p!==null&&typeof p=="object"&&!Array.isArray(p),h=(...p)=>{const v={};for(const y of p)if(y)for(const[w,N]of Object.entries(y)){const O=v[w];m(O)&&m(N)?v[w]=h(O,N):N!==void 0&&(v[w]=N)}return v};return h(d(o[i]),a?.customShareInfo)}var dn=(e,i)=>{e.useIn||(e.useIn=[]),og(e.useIn,i)};function ya(e,i){return i&&e.treeShaking?e.treeShaking:e}function Kg(e,i){for(const a of e){const o=i.startsWith(a.name);let l=i.replace(a.name,"");if(o){if(l.startsWith("/")){const h=a.name;return l=`.${l}`,{pkgNameOrAlias:h,expose:l,remote:a}}else if(l==="")return{pkgNameOrAlias:a.name,expose:".",remote:a}}const d=a.alias&&i.startsWith(a.alias);let m=a.alias&&i.replace(a.alias,"");if(a.alias&&d){if(m&&m.startsWith("/")){const h=a.alias;return m=`.${m}`,{pkgNameOrAlias:h,expose:m,remote:a}}else if(m==="")return{pkgNameOrAlias:a.alias,expose:".",remote:a}}}}function Xg(e,i){for(const a of e)if(i===a.name||a.alias&&i===a.alias)return a}var gl="RUNTIME-001",pl="RUNTIME-002",vl="RUNTIME-003",hl="RUNTIME-004",bl="RUNTIME-005",Cs="RUNTIME-006",yl="RUNTIME-007",_l="RUNTIME-008",Is="RUNTIME-009",xl="RUNTIME-010",wl="RUNTIME-011",Yg="RUNTIME-012",Vt={[gl]:"Failed to get remoteEntry exports.",[pl]:'The remote entry interface does not contain "init"',[vl]:"Failed to get manifest.",[hl]:"Failed to locate remote.",[bl]:"Invalid loadShareSync function call from bundler runtime",[Cs]:"Invalid loadShareSync function call from runtime",[yl]:"Failed to get remote snapshot.",[_l]:"Failed to load script resources.",[Is]:"Please call createInstance first.",[xl]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[wl]:"The remoteEntry URL is missing from the remote snapshot.",[Yg]:'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.'};({...Vt});var Sl=".then(callbacks[0]).catch(callbacks[1])";async function ep({entry:e,remoteEntryExports:i}){return new Promise((a,o)=>{try{i?a(i):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${Sl}`)([a,o]):import(e).then(a).catch(o)}catch(l){kt(`Failed to load ESM entry from "${e}". ${l instanceof Error?l.message:String(l)}`)}})}async function tp({entry:e,remoteEntryExports:i}){return new Promise((a,o)=>{try{i?a(i):typeof __system_context__>"u"?System.import(e).then(a).catch(o):new Function("callbacks",`System.import("${e}")${Sl}`)([a,o])}catch(l){kt(`Failed to load SystemJS entry from "${e}". ${l instanceof Error?l.message:String(l)}`)}})}function rp(e,i,a){const{remoteEntryKey:o,entryExports:l}=el(e,i);return l||kt(gl,Vt,{remoteName:e,remoteEntryUrl:a,remoteEntryKey:o}),l}async function np({name:e,globalName:i,entry:a,remoteInfo:o,loaderHook:l,getEntryUrl:d}){const{entryExports:m}=el(e,i);if(m)return m;const h=d?d(a):a;return ng(h,{attrs:{},createScriptHook:(p,v)=>{const y=l.lifecycle.createScript.emit({url:p,attrs:v,remoteInfo:o});if(y&&(y instanceof HTMLScriptElement||"script"in y||"timeout"in y))return y}}).then(()=>rp(e,i,a),p=>{const v=p instanceof Error?p.message:String(p);kt(_l,Vt,{remoteName:e,resourceUrl:h},v)})}async function ip({remoteInfo:e,remoteEntryExports:i,loaderHook:a,getEntryUrl:o}){const{entry:l,entryGlobalName:d,name:m,type:h}=e;switch(h){case"esm":case"module":return ep({entry:l,remoteEntryExports:i});case"system":return tp({entry:l,remoteEntryExports:i});default:return np({entry:l,globalName:d,name:m,remoteInfo:e,loaderHook:a,getEntryUrl:o})}}function Es(e){const{entry:i,name:a}=e;return Lc(a,i)}async function _a(e){const{origin:i,remoteEntryExports:a,remoteInfo:o,getEntryUrl:l,_inErrorHandling:d=!1}=e,m=Es(o);if(a)return a;if(!sn[m]){const h=i.remoteHandler.hooks.lifecycle.loadEntry,p=i.loaderHook;sn[m]=h.emit({loaderHook:p,remoteInfo:o,remoteEntryExports:a}).then(v=>v||ip({remoteInfo:o,remoteEntryExports:a,loaderHook:p,getEntryUrl:l})).catch(async v=>{const y=Es(o),w=v instanceof Error&&v.message.includes("ScriptExecutionError");if(v instanceof Error&&v.message.includes("RUNTIME-008")&&!w&&!d){const N=E=>_a({...E,_inErrorHandling:!0}),O=await i.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:N,origin:i,remoteInfo:o,remoteEntryExports:a,globalLoading:sn,uniqueKey:y});if(O)return O}throw v})}return sn[m]}function xa(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||"global",entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||"default"}}function ap(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function op(e,i){const a=pg(),o=[i.hooks,i.remoteHandler.hooks,i.sharedHandler.hooks,i.snapshotHandler.hooks,i.loaderHook,i.bridgeHook];return a.length>0&&a.forEach(l=>{e?.find(d=>d.name!==l.name)&&e.push(l)}),e&&e.length>0&&e.forEach(l=>{o.forEach(d=>{d.applyPlugin(l,i)})}),e}function sp(e){return{name:e.name,alias:e.alias,entry:"entry"in e?e.entry:void 0,version:"version"in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function fn(e){const i={};for(const[a,o]of Object.entries(e.shared)){const l=o[0];l&&(i[a]={version:l.version,singleton:l.shareConfig?.singleton,requiredVersion:l.shareConfig?.requiredVersion===!1?!1:l.shareConfig?.requiredVersion,eager:l.eager,strictVersion:l.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?"host":"unknown"},mfConfig:{name:e.name,remotes:e.remotes?.map(sp)??[],shared:i}}}function jl(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function cp(e,i){return i.map(a=>{const o=Xg(e,a.nameOrAlias);return Gt(o,`Unable to preload ${a.nameOrAlias} as it is not included in ${!o&&Bc({remoteInfo:o,remotes:e})}`),{remote:o,preloadConfig:jl(a)}})}function lp(e){return e?e.map(i=>i==="."?i:i.startsWith("./")?i.replace("./",""):i):[]}function $l(e,i,a,o=!0){const{cssAssets:l,jsAssetsWithoutEntry:d,entryAssets:m}=a;if(i.options.inBrowser){if(m.forEach(h=>{const{moduleInfo:p}=h,v=i.moduleCache.get(e.name);_a(v?{origin:i,remoteInfo:p,remoteEntryExports:v.remoteEntryExports}:{origin:i,remoteInfo:p,remoteEntryExports:void 0})}),o){const h={rel:"preload",as:"style"};l.forEach(p=>{const{link:v,needAttach:y}=xs({url:p,cb:()=>{},attrs:h,createLinkHook:(w,N)=>{const O=i.loaderHook.lifecycle.createLink.emit({url:w,attrs:N,remoteInfo:e});if(O instanceof HTMLLinkElement)return O}});y&&document.head.appendChild(v)})}else{const h={rel:"stylesheet",type:"text/css"};l.forEach(p=>{const{link:v,needAttach:y}=xs({url:p,cb:()=>{},attrs:h,createLinkHook:(w,N)=>{const O=i.loaderHook.lifecycle.createLink.emit({url:w,attrs:N,remoteInfo:e});if(O instanceof HTMLLinkElement)return O},needDeleteLink:!1});y&&document.head.appendChild(v)})}if(o){const h={rel:"preload",as:"script"};d.forEach(p=>{const{link:v,needAttach:y}=xs({url:p,cb:()=>{},attrs:h,createLinkHook:(w,N)=>{const O=i.loaderHook.lifecycle.createLink.emit({url:w,attrs:N,remoteInfo:e});if(O instanceof HTMLLinkElement)return O}});y&&document.head.appendChild(v)})}else{const h={fetchpriority:"high",type:e?.type==="module"?"module":"text/javascript"};d.forEach(p=>{const{script:v,needAttach:y}=Qc({url:p,cb:()=>{},attrs:h,createScriptHook:(w,N)=>{const O=i.loaderHook.lifecycle.createScript.emit({url:w,attrs:N,remoteInfo:e});if(O instanceof HTMLScriptElement)return O},needDeleteScript:!0});y&&document.head.appendChild(v)})}}}function up(e,i,a){const o=i,l=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];l.length||l.push("default"),l.forEach(m=>{o[m]||(o[m]={})});const d={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?l:e.shareScope||"default"};return Object.defineProperty(d,"shareScopeMap",{value:o,enumerable:!1}),{remoteEntryInitOptions:d,shareScope:o[l[0]],initScope:a??[]}}var kl=class{constructor({remoteInfo:e,host:i}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=i}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;const e=await _a({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports});return Gt(e,`remoteEntryExports is undefined
100
- ${Bc(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async init(e,i,a){const o=await this.getEntry();if(this.inited)return o;if(this.initPromise)return await this.initPromise,o;this.initing=!0,this.initPromise=(async()=>{const{remoteEntryInitOptions:l,shareScope:d,initScope:m}=up(this.remoteInfo,this.host.shareScopeMap,a),h=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:d,remoteEntryInitOptions:l,initScope:m,remoteInfo:this.remoteInfo,origin:this.host});typeof o?.init>"u"&&kt(pl,Vt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,fn(this.host.options)),await o.init(h.shareScope,h.initScope,h.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...h,id:e,remoteSnapshot:i,remoteEntryExports:o}),this.inited=!0})();try{await this.initPromise}finally{this.initing=!1,this.initPromise=void 0}return o}async get(e,i,a,o){const{loadFactory:l=!0}=a||{loadFactory:!0},d=await this.init(e,o);this.lib=d;let m;m=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:d,expose:i,moduleInfo:this.remoteInfo}),m||(m=await d.get(i)),Gt(m,`${Ei(this.remoteInfo)} remote don't export ${i}.`);const h=lg(this.remoteInfo.name,i),p=this.wraperFactory(m,h);return l?await p():p}wraperFactory(e,i){function a(o,l){o&&typeof o=="object"&&Object.isExtensible(o)&&!Object.getOwnPropertyDescriptor(o,Symbol.for("mf_module_id"))&&Object.defineProperty(o,Symbol.for("mf_module_id"),{value:l,enumerable:!1})}return e instanceof Promise?async()=>{const o=await e();return a(o,i),o}:()=>{const o=e();return a(o,i),o}}},er=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const i=this;this.on(function a(...o){return i.remove(a),e.apply(null,o)})}emit(...e){let i;return this.listeners.size>0&&this.listeners.forEach(a=>{i=a(...e)}),i}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},or=class extends er{emit(...e){let i;const a=Array.from(this.listeners);if(a.length>0){let o=0;const l=d=>d===!1?!1:o<a.length?Promise.resolve(a[o++].apply(null,e)).then(l):d;i=l()}return Promise.resolve(i)}};function Pl(e,i){if(!$s(i))return!1;if(e!==i){for(const a in e)if(!(a in i))return!1}return!0}var mn=class extends er{constructor(e){super(),this.onerror=kt,this.type=e}emit(e){$s(e)||kt(`The data for the "${this.type}" hook should be an object.`);for(const i of this.listeners)try{const a=i(e);if(Pl(e,a))e=a;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(a){Ss(a),this.onerror(a)}return e}},Er=class extends er{constructor(e){super(),this.onerror=kt,this.type=e}emit(e){$s(e)||kt(`The response data for the "${this.type}" hook must be an object.`);const i=Array.from(this.listeners);if(i.length>0){let a=0;const o=d=>(Ss(d),this.onerror(d),e),l=d=>{if(Pl(e,d)){if(e=d,a<i.length)try{return Promise.resolve(i[a++](e)).then(l,o)}catch(m){return o(m)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(l(e))}return Promise.resolve(e)}},gn=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,i){Gt(cg(e),"Plugin configuration is invalid.");const a=e.name;Gt(a,"A name must be provided by the plugin."),this.registerPlugins[a]||(this.registerPlugins[a]=e,e.apply?.(i),Object.keys(this.lifecycle).forEach(o=>{const l=e[o];l&&this.lifecycle[o].on(l)}))}removePlugin(e){Gt(e,"A name is required.");const i=this.registerPlugins[e];Gt(i,`The plugin "${e}" is not registered.`),Object.keys(i).forEach(a=>{a!=="name"&&this.lifecycle[a].remove(i[a])})}};function Nl(e,i){const a=Jc(i);a.url||kt(wl,Vt,{remoteName:e.name});let o=bs(i,a.url);e.type=a.type,e.entryGlobalName=a.globalName,e.entry=o,e.version=i.version,e.buildVersion=i.buildVersion}function dp(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:i,pkgNameOrAlias:a,expose:o,origin:l,remoteInfo:d,id:m}=e;if(!js(i)||!qc(i)){const{remoteSnapshot:h,globalSnapshot:p}=await l.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:i,id:m});Nl(d,h);const v={remote:i,preloadConfig:{nameOrAlias:a,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1}},y=await l.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:l,preloadOptions:v,remoteInfo:d,remote:i,remoteSnapshot:h,globalSnapshot:p});return y&&$l(d,l,y,!1),{...e,remoteSnapshot:h}}return e}}}function fp(e){const i=e.split(":");return i.length===1?{name:i[0],version:void 0}:i.length===2?{name:i[0],version:i[1]}:{name:i[1],version:i[2]}}function Ol(e,i,a,o,l={},d){const{value:m}=cn(e,Ei(i)),h=d||m;if(h&&!Fc(h)&&(a(h,i,o),h.remotesInfo)){const p=Object.keys(h.remotesInfo);for(const v of p){if(l[v])continue;l[v]=!0;const y=fp(v),w=h.remotesInfo[v];Ol(e,{name:y.name,version:w.matchedVersion},a,!1,l,void 0)}}}var Ms=(e,i)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${i}"]`);function mp(e,i,a,o,l){const d=[],m=[],h=[],p=new Set,v=new Set,{options:y}=e,{preloadConfig:w}=i,{depsRemote:N}=w;if(Ol(o,a,(E,A,R)=>{let Z;if(R)Z=w;else if(Array.isArray(N)){const ce=N.find(ye=>ye.nameOrAlias===A.name||ye.nameOrAlias===A.alias);if(!ce)return;Z=jl(ce)}else if(N===!0)Z=w;else return;const G=bs(E,Jc(E).url);G&&h.push({name:A.name,moduleInfo:{name:A.name,entry:G,type:"remoteEntryType"in E?E.remoteEntryType:"global",entryGlobalName:"globalName"in E?E.globalName:A.name,shareScope:"",version:"version"in E?E.version:void 0},url:G});let V="modules"in E?E.modules:[];const re=lp(Z.exposes);re.length&&"modules"in E&&(V=E?.modules?.reduce((ce,ye)=>(re?.indexOf(ye.moduleName)!==-1&&ce.push(ye),ce),[]));function te(ce){const ye=ce.map(ue=>bs(E,ue));return Z.filter?ye.filter(Z.filter):ye}if(V){const ce=V.length;for(let ye=0;ye<ce;ye++){const ue=V[ye],Ee=`${A.name}/${ue.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:ue.moduleName==="."?A.name:Ee,name:A.name,remoteSnapshot:E,preloadConfig:Z,remote:A,origin:e}),!vg(Ee)&&(Z.resourceCategory==="all"?(d.push(...te(ue.assets.css.async)),d.push(...te(ue.assets.css.sync)),m.push(...te(ue.assets.js.async)),m.push(...te(ue.assets.js.sync))):Z.resourceCategory==="sync"&&(d.push(...te(ue.assets.css.sync)),m.push(...te(ue.assets.js.sync))),hg(Ee))}}},!0,{},l),l.shared&&l.shared.length>0){const E=(A,R)=>{const{shared:Z}=ba(e.shareScopeMap,R.sharedName,A,e.sharedHandler.hooks.lifecycle.resolveShare)||{};Z&&typeof Z.lib=="function"&&(R.assets.js.sync.forEach(G=>{p.add(G)}),R.assets.css.sync.forEach(G=>{v.add(G)}))};l.shared.forEach(A=>{const R=y.shared?.[A.sharedName];if(!R)return;const Z=A.version?R.find(G=>G.version===A.version):R;Z&&Hc(Z).forEach(G=>{E(G,A)})})}const O=m.filter(E=>!p.has(E)&&!Ms("script",E));return{cssAssets:d.filter(E=>!v.has(E)&&!Ms("link",E)),jsAssetsWithoutEntry:O,entryAssets:h.filter(E=>!Ms("script",E.url))}}var gp=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:i,preloadOptions:a,remoteInfo:o,remote:l,globalSnapshot:d,remoteSnapshot:m}=e;return js(l)&&qc(l)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:l.name,url:l.entry,moduleInfo:{name:o.name,entry:l.entry,type:o.type||"global",entryGlobalName:"",shareScope:""}}]}:(Nl(o,m),mp(i,a,o,d,m))}}};function Cl(e,i){const a=fa({name:i.name,version:i.options.version}),o=a&&"remotesInfo"in a&&a.remotesInfo&&cn(a.remotesInfo,e.name).value;return o&&o.matchedVersion?{hostGlobalSnapshot:a,globalSnapshot:Xc(),remoteSnapshot:fa({name:e.name,version:o.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:Xc(),remoteSnapshot:fa({name:e.name,version:"version"in e?e.version:void 0})}}var pp=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new gn({beforeLoadRemoteSnapshot:new or("beforeLoadRemoteSnapshot"),loadSnapshot:new Er("loadGlobalSnapshot"),loadRemoteSnapshot:new Er("loadRemoteSnapshot"),afterLoadSnapshot:new Er("afterLoadSnapshot")}),this.manifestLoading=Mi.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:i,expose:a}){const{options:o}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:o,moduleInfo:e});let l=fa({name:this.HostInstance.options.name,version:this.HostInstance.options.version});l||(l={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},gg({[this.HostInstance.options.name]:l})),l&&"remotesInfo"in l&&!cn(l.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(l.remotesInfo={...l?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:d,remoteSnapshot:m,globalSnapshot:h}=this.getGlobalRemoteInfo(e),{remoteSnapshot:p,globalSnapshot:v}=await this.hooks.lifecycle.loadSnapshot.emit({options:o,moduleInfo:e,hostGlobalSnapshot:d,remoteSnapshot:m,globalSnapshot:h});let y,w;if(p)if(Fc(p)){const N=p.remoteEntry,O=await this.getManifestJson(N,e,{}),E=Yc({...e,entry:N},O);y=O,w=E}else{const{remoteSnapshot:N}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:p,from:"global"});y=N,w=v}else if(js(e)){const N=await this.getManifestJson(e.entry,e,{}),O=Yc(e,N),{remoteSnapshot:E}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:N,from:"global"});y=E,w=O}else kt(yl,Vt,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(v)},void 0,fn(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:i,host:this.HostInstance,options:o,moduleInfo:e,remoteSnapshot:y}),{remoteSnapshot:y,globalSnapshot:w}}getGlobalRemoteInfo(e){return Cl(e,this.HostInstance)}async getManifestJson(e,i,a){const o=async()=>{let d=this.manifestCache.get(e);if(d)return d;try{let m=await this.loaderHook.lifecycle.fetch.emit(e,{},xa(i));(!m||!(m instanceof Response))&&(m=await fetch(e,{})),d=await m.json()}catch(m){d=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:m,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),d||(delete this.manifestLoading[e],kt(vl,Vt,{manifestUrl:e,moduleName:i.name,hostName:this.HostInstance.options.name},`${m}`,fn(this.HostInstance.options)))}return Gt(d.metaData&&d.exposes&&d.shared,`"${e}" is not a valid federation manifest for remote "${i.name}". Missing required fields: ${[!d.metaData&&"metaData",!d.exposes&&"exposes",!d.shared&&"shared"].filter(Boolean).join(", ")}.`),this.manifestCache.set(e,d),d},l=async()=>{const d=await o(),m=Km(d,{version:e}),{remoteSnapshot:h}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:i,manifestJson:d,remoteSnapshot:m,manifestUrl:e,from:"manifest"});return h};return this.manifestLoading[e]||(this.manifestLoading[e]=l().then(d=>d)),this.manifestLoading[e]}},vp=class{constructor(e){this.hooks=new gn({beforeRegisterShare:new mn("beforeRegisterShare"),afterResolve:new Er("afterResolve"),beforeLoadShare:new Er("beforeLoadShare"),loadShare:new or,resolveShare:new mn("resolveShare"),initContainerShareScopeMap:new mn("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,i){const{newShareInfos:a,allShareInfos:o}=dl(e,i);return Object.keys(a).forEach(l=>{a[l].forEach(d=>{d.scope.forEach(m=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:l,shared:d}),this.shareScopeMap[m]?.[l]||this.setShared({pkgName:l,lib:d.lib,get:d.get,loaded:d.loaded||!!d.lib,shared:d,from:i.name})})})}),{newShareInfos:a,allShareInfos:o}}async loadShare(e,i){const{host:a}=this,o=ml({pkgName:e,extraOptions:i,shareInfos:a.options.shared});o?.scope&&await Promise.all(o.scope.map(async h=>{await Promise.all(this.initializeSharing(h,{strategy:o.strategy}))}));const{shareInfo:l}=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:o,shared:a.options.shared,origin:a});Gt(l,`Cannot find shared "${e}" in host "${a.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const{shared:d,useTreesShaking:m}=ba(this.shareScopeMap,e,l,this.hooks.lifecycle.resolveShare)||{};if(d){const h=ya(d,m);if(h.lib)return dn(h,a.options.name),h.lib;if(h.loading&&!h.loaded){const p=await h.loading;return h.loaded=!0,h.lib||(h.lib=p),dn(h,a.options.name),p}else{const v=(async()=>{const y=await h.get();return dn(h,a.options.name),h.loaded=!0,h.lib=y,y})();return this.setShared({pkgName:e,loaded:!1,shared:d,from:a.options.name,lib:null,loading:v,treeShaking:m?h:void 0}),v}}else{if(i?.customShareInfo)return!1;const h=zi(l.treeShaking),p=ya(l,h),y=(async()=>{const w=await p.get();p.lib=w,p.loaded=!0,dn(p,a.options.name);const{shared:N,useTreesShaking:O}=ba(this.shareScopeMap,e,l,this.hooks.lifecycle.resolveShare)||{};if(N){const E=ya(N,O);E.lib=w,E.loaded=!0,N.from=l.from}return w})();return this.setShared({pkgName:e,loaded:!1,shared:l,from:a.options.name,lib:null,loading:y,treeShaking:h?p:void 0}),y}}initializeSharing(e=va,i){const{host:a}=this,o=i?.from,l=i?.strategy;let d=i?.initScope;const m=[];if(o!=="build"){const{initTokens:N}=this;d||(d=[]);let O=N[e];if(O||(O=N[e]={from:this.host.name}),d.indexOf(O)>=0)return m;d.push(O)}const h=this.shareScopeMap,p=a.options.name;h[e]||(h[e]={});const v=h[e],y=(N,O)=>{const{version:E,eager:A}=O;v[N]=v[N]||{};const R=v[N],Z=R[E]&&ya(R[E]),G=!!(Z&&("eager"in Z&&Z.eager||"shareConfig"in Z&&Z.shareConfig?.eager));(!Z||Z.strategy!=="loaded-first"&&!Z.loaded&&(!A!=!G?A:p>R[E].from))&&(R[E]=O)},w=async N=>{const{module:O}=await a.remoteHandler.getRemoteModuleAndOptions({id:N});let E;try{E=await O.getEntry()}catch(A){if(E=await a.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:N,error:A,from:"runtime",lifecycle:"beforeLoadShare",origin:a}),!E)return}finally{E?.init&&!O.initing&&(O.remoteEntryExports=E,await O.init(void 0,void 0,d))}};return Object.keys(a.options.shared).forEach(N=>{a.options.shared[N].forEach(O=>{O.scope.includes(e)&&y(N,O)})}),(a.options.shareStrategy==="version-first"||l==="version-first")&&a.options.remotes.forEach(N=>{N.shareScope===e&&m.push(w(N.name))}),m}loadShareSync(e,i){const{host:a}=this,o=ml({pkgName:e,extraOptions:i,shareInfos:a.options.shared});o?.scope&&o.scope.forEach(m=>{this.initializeSharing(m,{strategy:o.strategy})});const{shared:l,useTreesShaking:d}=ba(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(l){if(typeof l.lib=="function")return dn(l,a.options.name),l.loaded||(l.loaded=!0,l.from===a.options.name&&(o.loaded=!0)),l.lib;if(typeof l.get=="function"){const m=l.get();if(!(m instanceof Promise))return dn(l,a.options.name),this.setShared({pkgName:e,loaded:!0,from:a.options.name,lib:m,shared:l}),m}}if(o.lib)return o.loaded||(o.loaded=!0),o.lib;if(o.get){const m=o.get();return m instanceof Promise&&kt(i?.from==="build"?bl:Cs,Vt,{hostName:a.options.name,sharedPkgName:e},void 0,fn(a.options)),o.lib=m,this.setShared({pkgName:e,loaded:!0,from:a.options.name,lib:o.lib,shared:o}),o.lib}kt(Cs,Vt,{hostName:a.options.name,sharedPkgName:e},void 0,fn(a.options))}initShareScopeMap(e,i,a={}){const{host:o}=this;this.shareScopeMap[e]=i,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:i,options:o.options,origin:o,scopeName:e,hostShareScopeMap:a.hostShareScopeMap})}setShared({pkgName:e,shared:i,from:a,lib:o,loading:l,loaded:d,get:m,treeShaking:h}){const{version:p,scope:v="default",...y}=i,w=Array.isArray(v)?v:[v],N=O=>{const E=(R,Z,G)=>{G&&!R[Z]&&(R[Z]=G)},A=h?O.treeShaking:O;E(A,"loaded",d),E(A,"loading",l),E(A,"get",m)};w.forEach(O=>{this.shareScopeMap[O]||(this.shareScopeMap[O]={}),this.shareScopeMap[O][e]||(this.shareScopeMap[O][e]={}),this.shareScopeMap[O][e][p]||(this.shareScopeMap[O][e][p]={version:p,scope:[O],...y,lib:o});const E=this.shareScopeMap[O][e][p];N(E),a&&E.from!==a&&(E.from=a)})}_setGlobalShareScopeMap(e){const i=fl(),a=e.id||e.name;a&&!i[a]&&(i[a]=this.shareScopeMap)}},hp=class{constructor(e){this.hooks=new gn({beforeRegisterRemote:new mn("beforeRegisterRemote"),registerRemote:new mn("registerRemote"),beforeRequest:new Er("beforeRequest"),onLoad:new or("onLoad"),handlePreloadModule:new er("handlePreloadModule"),errorLoadRemote:new or("errorLoadRemote"),beforePreloadRemote:new or("beforePreloadRemote"),generatePreloadAssets:new or("generatePreloadAssets"),afterPreloadRemote:new or,loadEntry:new or}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,i){return(i.remotes||[]).reduce((a,o)=>(this.registerRemote(o,a,{force:!1}),a),e.remotes)}setIdToRemoteMap(e,i){const{remote:a,expose:o}=i,{name:l,alias:d}=a;if(this.idToRemoteMap[e]={name:a.name,expose:o},d&&e.startsWith(l)){const m=e.replace(l,d);this.idToRemoteMap[m]={name:a.name,expose:o};return}if(d&&e.startsWith(d)){const m=e.replace(d,l);this.idToRemoteMap[m]={name:a.name,expose:o}}}async loadRemote(e,i){const{host:a}=this;try{const{loadFactory:o=!0}=i||{loadFactory:!0},{module:l,moduleOptions:d,remoteMatchInfo:m}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:h,remote:p,expose:v,id:y,remoteSnapshot:w}=m,N=await l.get(y,v,i,w),O=await this.hooks.lifecycle.onLoad.emit({id:y,pkgNameOrAlias:h,expose:v,exposeModule:o?N:void 0,exposeModuleFactory:o?void 0:N,remote:p,options:d,moduleInstance:l,origin:a});return this.setIdToRemoteMap(e,m),typeof O=="function"?O:N}catch(o){const{from:l="runtime"}=i||{from:"runtime"},d=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:o,from:l,lifecycle:"onLoad",origin:a});if(!d)throw o;return d}}async preloadRemote(e){const{host:i}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:i.options,origin:i});const a=cp(i.options.remotes,e);await Promise.all(a.map(async o=>{const{remote:l}=o,d=xa(l),{globalSnapshot:m,remoteSnapshot:h}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:l}),p=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:i,preloadOptions:o,remote:l,remoteInfo:d,globalSnapshot:m,remoteSnapshot:h});p&&$l(d,i,p)}))}registerRemotes(e,i){const{host:a}=this;e.forEach(o=>{this.registerRemote(o,a.options.remotes,{force:i?.force})})}async getRemoteModuleAndOptions(e){const{host:i}=this,{id:a}=e;let o;try{o=await this.hooks.lifecycle.beforeRequest.emit({id:a,options:i.options,origin:i})}catch(O){if(o=await this.hooks.lifecycle.errorLoadRemote.emit({id:a,options:i.options,origin:i,from:"runtime",error:O,lifecycle:"beforeRequest"}),!o)throw O}const{id:l}=o,d=Kg(i.options.remotes,l);d||kt(hl,Vt,{hostName:i.options.name,requestId:l},void 0,fn(i.options));const{remote:m}=d,h=xa(m),p=await i.sharedHandler.hooks.lifecycle.afterResolve.emit({id:l,...d,options:i.options,origin:i,remoteInfo:h}),{remote:v,expose:y}=p;Gt(v&&y,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${l}.`);let w=i.moduleCache.get(v.name);const N={host:i,remoteInfo:h};return w||(w=new kl(N),i.moduleCache.set(v.name,w)),{module:w,moduleOptions:N,remoteMatchInfo:p}}registerRemote(e,i,a){const{host:o}=this,l=()=>{if(e.alias){const m=i.find(h=>e.alias&&(h.name.startsWith(e.alias)||h.alias?.startsWith(e.alias)));Gt(!m,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${m&&m.name} name or alias`)}"entry"in e&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=va),e.type||(e.type=Gg)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:o});const d=i.find(m=>m.name===e.name);if(!d)l(),i.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o});else{const m=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];a?.force&&(this.removeRemote(d),l(),i.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o}),Uc(m.join(" ")))}}removeRemote(e){try{const{host:i}=this,{name:a}=e,o=i.options.remotes.findIndex(d=>d.name===a);o!==-1&&i.options.remotes.splice(o,1);const l=i.moduleCache.get(e.name);if(l){const d=l.remoteInfo,m=d.entryGlobalName;It[m]&&(Object.getOwnPropertyDescriptor(It,m)?.configurable?delete It[m]:It[m]=void 0);const h=Es(l.remoteInfo);sn[h]&&delete sn[h],i.snapshotHandler.manifestCache.delete(d.entry);let p=d.buildVersion?Lc(d.name,d.buildVersion):d.name;const v=It.__FEDERATION__.__INSTANCES__.findIndex(w=>d.buildVersion?w.options.id===p:w.name===p);if(v!==-1){const w=It.__FEDERATION__.__INSTANCES__[v];p=w.options.id||p;const N=fl();let O=!0;const E=[];Object.keys(N).forEach(A=>{const R=N[A];R&&Object.keys(R).forEach(Z=>{const G=R[Z];G&&Object.keys(G).forEach(V=>{const re=G[V];re&&Object.keys(re).forEach(te=>{const ce=re[te];ce&&typeof ce=="object"&&ce.from===d.name&&(ce.loaded||ce.loading?(ce.useIn=ce.useIn.filter(ye=>ye!==d.name),ce.useIn.length?O=!1:E.push([A,Z,V,te])):E.push([A,Z,V,te]))})})})}),O&&(w.shareScopeMap={},delete N[p]),E.forEach(([A,R,Z,G])=>{delete N[A]?.[R]?.[Z]?.[G]}),It.__FEDERATION__.__INSTANCES__.splice(v,1)}const{hostGlobalSnapshot:y}=Cl(e,i);if(y){const w=y&&"remotesInfo"in y&&y.remotesInfo&&cn(y.remotesInfo,e.name).key;w&&(delete y.remotesInfo[w],Mi.__FEDERATION__.__MANIFEST_LOADING__[w]&&delete Mi.__FEDERATION__.__MANIFEST_LOADING__[w])}i.moduleCache.delete(e.name)}}catch(i){ws.error(`removeRemote failed: ${i instanceof Error?i.message:String(i)}`)}}},bp=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,Il=class{constructor(e){this.hooks=new gn({beforeInit:new mn("beforeInit"),init:new er,beforeInitContainer:new Er("beforeInitContainer"),initContainer:new Er("initContainer")}),this.version="2.4.0",this.moduleCache=new Map,this.loaderHook=new gn({getModuleInfo:new er,createScript:new er,createLink:new er,fetch:new or,loadEntryError:new or,getModuleFactory:new or}),this.bridgeHook=new gn({beforeBridgeRender:new er,afterBridgeRender:new er,beforeBridgeDestroy:new er,afterBridgeDestroy:new er});const i=bp?[dp(),gp()]:[],a={id:ap(),name:e.name,plugins:i,remotes:[],shared:{},inBrowser:Zc};this.name=e.name,this.options=a,this.snapshotHandler=new pp(this),this.sharedHandler=new vp(this),this.remoteHandler=new hp(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...a.plugins,...e.plugins||[]]),this.options=this.formatOptions(a,e)}initOptions(e){e.name&&e.name!==this.options.name&&kt(Wc(xl,Vt)),this.registerPlugins(e.plugins);const i=this.formatOptions(this.options,e);return this.options=i,i}async loadShare(e,i){return this.sharedHandler.loadShare(e,i)}loadShareSync(e,i){return this.sharedHandler.loadShareSync(e,i)}initializeSharing(e=va,i){return this.sharedHandler.initializeSharing(e,i)}initRawContainer(e,i,a){const o=xa({name:e,entry:i}),l=new kl({host:this,remoteInfo:o});return l.remoteEntryExports=a,this.moduleCache.set(e,l),l}async loadRemote(e,i){return this.remoteHandler.loadRemote(e,i)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,i,a={}){this.sharedHandler.initShareScopeMap(e,i,a)}formatOptions(e,i){const{allShareInfos:a}=dl(e,i),{userOptions:o,options:l}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:i,options:e,shareInfo:a}),d=this.remoteHandler.formatAndRegisterRemote(l,o),{allShareInfos:m}=this.sharedHandler.registerShared(l,o),h=[...l.plugins];o.plugins&&o.plugins.forEach(v=>{h.includes(v)||h.push(v)});const p={...e,...i,plugins:h,remotes:d,shared:m,id:o.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:p}),p}registerPlugins(e){const i=op(e,this);this.options.plugins=this.options.plugins.reduce((a,o)=>(o&&a&&!a.find(l=>l.name===o.name)&&a.push(o),a),i||[])}registerRemotes(e,i){return this.remoteHandler.registerRemotes(e,i)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};function yp(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function _p(e,i){const a=yp();return It.__FEDERATION__.__INSTANCES__.find(o=>!!(a&&o.options.id===a||o.options.name===e&&!o.options.version&&!i||o.options.name===e&&i&&o.options.version===i))}function xp(e){const i=new(dg()||Il)({id:`${e.name}@${e.version||Date.now()}`,...e});return ug(i),i}var sr=null;function wp(e){const i=_p(e.name,e.version),a={...e,id:e.id||""};return i?(i.initOptions(a),sr||(sr=i),i):(sr=xp(a),sr)}function Sp(...e){return Gt(sr,Is,Vt),sr.loadRemote.apply(sr,e)}function jp(...e){return Gt(sr,Is,Vt),sr.registerRemotes.apply(sr,e)}function $p(){return sr}fg(Il);function pn(e){const i=(typeof globalThis<"u"?globalThis:void 0)?.[e];return i&&typeof i=="object"?i:{}}var kp={singleton:!0,requiredVersion:!1,eager:!0},dr=e=>({version:"0.0.0",scope:"default",lib:e,shareConfig:kp}),El="__mf_module_cache__";function Pp(){const e=globalThis,i=e[El];if(i&&typeof i=="object"){const o=i;return o.share??={},o.remote??={},o}const a={share:{},remote:{}};return e[El]=a,a}function Np(){const e=Pp();e.share.react??=n,e.share["react-dom"]??=_,e.share["react-dom/client"]??=M,e.share["react/jsx-runtime"]??=r,e.share["@tanstack/react-query"]??=ee,e.share["@trpc/client"]??=X,e.share["@trpc/react-query"]??=ie,e.share["@camstack/ui-library"]??=pn("__camstackUiLibrary"),e.share["@camstack/sdk"]??=pn("__camstackSdk"),e.share["@camstack/types"]??=pn("__camstackTypes")}function Ml(){Np(),$p()===null&&wp({name:"admin_ui_host",remotes:[],shared:{react:dr(()=>n),"react-dom":dr(()=>_),"react-dom/client":dr(()=>M),"react/jsx-runtime":dr(()=>r),"@tanstack/react-query":dr(()=>ee),"@trpc/client":dr(()=>X),"@trpc/react-query":dr(()=>ie),"@camstack/ui-library":dr(()=>pn("__camstackUiLibrary")),"@camstack/sdk":dr(()=>pn("__camstackSdk")),"@camstack/types":dr(()=>pn("__camstackTypes"))}})}/**
101
- * @license lucide-react v0.576.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */var Dl=(...e)=>e.filter((i,a,o)=>!!i&&i.trim()!==""&&o.indexOf(i)===a).join(" ").trim();/**
106
- * @license lucide-react v0.576.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */var Op=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
111
- * @license lucide-react v0.576.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */var Cp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,a,o)=>o?o.toUpperCase():a.toLowerCase());/**
116
- * @license lucide-react v0.576.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */var Al=e=>{const i=Cp(e);return i.charAt(0).toUpperCase()+i.slice(1)};/**
121
- * @license lucide-react v0.576.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */var Ip={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
126
- * @license lucide-react v0.576.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */var Ep=e=>{for(const i in e)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1};/**
131
- * @license lucide-react v0.576.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */var Mp=(0,g.forwardRef)(({color:e="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:l="",children:d,iconNode:m,...h},p)=>(0,g.createElement)("svg",{ref:p,...Ip,width:i,height:i,stroke:e,strokeWidth:o?Number(a)*24/Number(i):a,className:Dl("lucide",l),...!d&&!Ep(h)&&{"aria-hidden":"true"},...h},[...m.map(([v,y])=>(0,g.createElement)(v,y)),...Array.isArray(d)?d:[d]]));/**
136
- * @license lucide-react v0.576.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */var pe=(e,i)=>{const a=(0,g.forwardRef)(({className:o,...l},d)=>(0,g.createElement)(Mp,{ref:d,iconNode:i,className:Dl(`lucide-${Op(Al(e))}`,`lucide-${e}`,o),...l}));return a.displayName=Al(e),a},Mr=pe("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),Dp=pe("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),Ap=pe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),zp=pe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Ds=pe("arrow-up-to-line",[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]]),Tp=pe("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),Rp=pe("battery-full",[["path",{d:"M10 10v4",key:"1mb2ec"}],["path",{d:"M14 10v4",key:"1nt88p"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 10v4",key:"1n77qd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]),Zp=pe("battery-low",[["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 14v-4",key:"14a6bd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]),Lp=pe("battery-warning",[["path",{d:"M10 17h.01",key:"nbq80n"}],["path",{d:"M10 7v6",key:"nne03l"}],["path",{d:"M14 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2",key:"1m83kb"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"h8lgfh"}]]),zl=pe("battery",[["path",{d:"M 22 14 L 22 10",key:"nqc4tb"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]),Up=pe("bell-ring",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]]),wa=pe("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),Bp=pe("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]),As=pe("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]),Fp=pe("cast",[["path",{d:"M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6",key:"3zrzxg"}],["path",{d:"M2 12a9 9 0 0 1 8 8",key:"g6cvee"}],["path",{d:"M2 16a5 5 0 0 1 4 4",key:"1y1dii"}],["line",{x1:"2",x2:"2.01",y1:"20",y2:"20",key:"xu2jvo"}]]),vn=pe("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Qr=pe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Gp=pe("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),Dr=pe("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Ri=pe("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Vp=pe("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Qp=pe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),Wp=pe("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),qp=pe("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]),Hp=pe("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Tl=pe("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Jp=pe("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),Kp=pe("copy-plus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),xr=pe("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),Xp=pe("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),Rl=pe("crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]),Yp=pe("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),Zl=pe("door-open",[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]]),zs=pe("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),Ll=pe("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),Ts=pe("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),Rs=pe("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),hn=pe("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),Ul=pe("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]),ev=pe("grip-horizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]),Bl=pe("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]),tv=pe("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),rv=pe("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]),nv=pe("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),iv=pe("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),Fl=pe("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),tr=pe("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),av=pe("locate-fixed",[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),Gl=pe("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]),ov=pe("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]),Vl=pe("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]),Ql=pe("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]),Wl=pe("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Zs=pe("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),sv=pe("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]),Ls=pe("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),cv=pe("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),Us=pe("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),Zi=pe("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),lv=pe("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]),uv=pe("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),dv=pe("qr-code",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]),ql=pe("radar",[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]),fv=pe("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),Sa=pe("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Hl=pe("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),Jl=pe("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),mv=pe("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),gv=pe("scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]),pv=pe("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),Li=pe("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),vv=pe("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),Kl=pe("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),hv=pe("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),bv=pe("ship",[["path",{d:"M12 10.189V14",key:"1p8cqu"}],["path",{d:"M12 2v3",key:"qbqxhf"}],["path",{d:"M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6",key:"qpkstq"}],["path",{d:"M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76",key:"7tigtc"}],["path",{d:"M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"1924j5"}]]),yv=pe("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]),Xl=pe("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),_v=pe("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),Yl=pe("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),xv=pe("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),eu=pe("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),wv=pe("thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]),Sv=pe("toggle-left",[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),fr=pe("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),jv=pe("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]),$v=pe("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]),bn=pe("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),kv=pe("unlink-2",[["path",{d:"M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2",key:"1re2ne"}]]),tu=pe("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),Pv=pe("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),ru=pe("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]),Bs=pe("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),Mt=pe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),nu=pe("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Nv=pe("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Ov=pe("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Cv={frigate:bv,scrypted:hv,reolink:fv,homeAssistant:Bl,rtsp:Fp},Iv={online:Qp,offline:Jp,degraded:Ri,unknown:Tl},iu=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,au=be,Wr=(e,i)=>a=>{var o;if(i?.variants==null)return au(e,a?.class,a?.className);const{variants:l,defaultVariants:d}=i,m=Object.keys(l).map(p=>{const v=a?.[p],y=d?.[p];if(v===null)return null;const w=iu(v)||iu(y);return l[p][w]}),h=a&&Object.entries(a).reduce((p,v)=>{let[y,w]=v;return w===void 0||(p[y]=w),p},{});return au(e,m,i==null||(o=i.compoundVariants)===null||o===void 0?void 0:o.reduce((p,v)=>{let{class:y,className:w,...N}=v;return Object.entries(N).every(O=>{let[E,A]=O;return Array.isArray(A)?A.includes({...d,...h}[E]):{...d,...h}[E]===A})?[...p,y,w]:p},[]),a?.class,a?.className)},Ev=Wr("inline-flex items-center justify-center rounded-md font-medium transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 px-2.5 text-xs gap-1.5",md:"h-8 px-3 text-sm gap-2",lg:"h-9 px-4 text-sm gap-2"}},defaultVariants:{variant:"primary",size:"sm"}}),wr=(0,n.forwardRef)(({className:e,variant:i,size:a,...o},l)=>(0,r.jsx)("button",{ref:l,className:K(Ev({variant:i,size:a}),e),...o}));wr.displayName="Button";var Mv=Wr("inline-flex items-center justify-center rounded-md font-medium transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 w-7",md:"h-8 w-8",lg:"h-9 w-9"}},defaultVariants:{variant:"primary",size:"sm"}}),Fs=(0,n.forwardRef)(({className:e,variant:i,size:a,icon:o,...l},d)=>(0,r.jsx)("button",{ref:d,className:K(Mv({variant:i,size:a}),e),...l,children:(0,r.jsx)(o,{className:"h-4 w-4"})}));Fs.displayName="IconButton";var Dv=Wr("inline-flex items-center rounded-full text-xs font-medium px-2 py-0.5",{variants:{variant:{default:"bg-surface-hover text-foreground",success:"bg-success/15 text-success",warning:"bg-warning/15 text-warning",danger:"bg-danger/15 text-danger",info:"bg-info/15 text-info"},styleVariant:{solid:"",outline:"border bg-transparent"}},defaultVariants:{variant:"default",styleVariant:"solid"}}),Ar=(0,n.forwardRef)(({className:e,variant:i,style:a,...o},l)=>(0,r.jsx)("span",{ref:l,className:K(Dv({variant:i,styleVariant:a}),e),...o}));Ar.displayName="Badge";var Av=Wr("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),Gs=(0,n.forwardRef)(({className:e,variant:i,...a},o)=>(0,r.jsx)("div",{ref:o,className:K(Av({variant:i}),e),...a}));Gs.displayName="Card";function ou({expanded:e,onExpandedChange:i,header:a,children:o,dimmed:l=!1,hideChevron:d=!1,className:m}){return(0,r.jsxs)("div",{className:K("rounded-lg border border-border bg-surface overflow-hidden",l&&"opacity-[0.45]",m),children:[(0,r.jsxs)("div",{role:"button",tabIndex:0,className:"flex items-center gap-2.5 px-3 py-2.5 cursor-pointer select-none",onClick:()=>i(!e),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),i(!e))},children:[!d&&(0,r.jsx)("span",{className:"text-foreground-subtle shrink-0",children:e?(0,r.jsx)(Qr,{className:"h-4 w-4"}):(0,r.jsx)(Dr,{className:"h-4 w-4"})}),a]}),e&&o&&(0,r.jsx)("div",{className:"border-t border-border px-3 py-3",children:o})]})}var Vs=(0,n.forwardRef)(({className:e,...i},a)=>(0,r.jsx)("label",{ref:a,className:K("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",e),...i}));Vs.displayName="Label";var zv=Wr("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),Qs=(0,n.forwardRef)(({className:e,orientation:i,...a},o)=>(0,r.jsx)("div",{ref:o,role:"separator",className:K(zv({orientation:i}),e),...a}));Qs.displayName="Separator";var su=(0,n.forwardRef)(({className:e,...i},a)=>(0,r.jsx)("div",{ref:a,className:K("animate-pulse bg-surface-hover rounded-md h-4 w-full",e),...i}));su.displayName="Skeleton";var cu=Wr("h-7 w-full px-2.5 text-xs bg-surface border rounded-md text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary transition-colors",{variants:{state:{default:"border-border",error:"border-danger"}},defaultVariants:{state:"default"}}),ja=(0,n.forwardRef)(({className:e,state:i,leftSlot:a,rightSlot:o,...l},d)=>a||o?(0,r.jsxs)("div",{className:"relative flex items-center w-full",children:[a&&(0,r.jsx)("div",{className:"absolute left-2.5 flex items-center pointer-events-none",children:a}),(0,r.jsx)("input",{ref:d,className:K(cu({state:i}),a?"pl-7":"",o?"pr-7":"",e),...l}),o&&(0,r.jsx)("div",{className:"absolute right-2.5 flex items-center pointer-events-none",children:o})]}):(0,r.jsx)("input",{ref:d,className:K(cu({state:i}),e),...l}));ja.displayName="Input";var Ui=(0,n.forwardRef)(({className:e,options:i,...a},o)=>(0,r.jsxs)("div",{className:"relative w-full",children:[(0,r.jsx)("select",{ref:o,className:K("h-7 w-full px-2.5 text-xs bg-surface border border-border rounded-md text-foreground appearance-none pr-7 focus:outline-none focus:ring-1 focus:ring-primary",e),...a,children:i.map(l=>(0,r.jsx)("option",{value:l.value,children:l.label},l.value))}),(0,r.jsx)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted",children:(0,r.jsx)(Qr,{className:"h-3.5 w-3.5"})})]}));Ui.displayName="Select";var lu=(0,n.forwardRef)(({className:e,...i},a)=>(0,r.jsx)("input",{ref:a,type:"checkbox",className:K("w-3.5 h-3.5 rounded-sm border border-border accent-primary",e),...i}));lu.displayName="Checkbox";var uu=(0,n.forwardRef)(({className:e,checked:i,onCheckedChange:a,label:o,...l},d)=>(0,r.jsxs)("button",{ref:d,role:"switch","aria-checked":i,type:"button",onClick:()=>a(!i),className:K("inline-flex items-center gap-2",e),...l,children:[(0,r.jsx)("span",{className:K("w-8 h-4 rounded-full transition-colors",i?"bg-primary":"bg-surface-hover"),children:(0,r.jsx)("span",{className:K("block w-3.5 h-3.5 rounded-full bg-white transition-transform",i?"translate-x-4":"translate-x-0.5")})}),o&&(0,r.jsx)("span",{className:"text-xs text-foreground",children:o})]}));uu.displayName="Switch";var du=(0,n.createContext)(null);function fu(){const e=(0,n.useContext)(du);if(!e)throw new Error("Dialog compound components must be used within <Dialog>");return e}function mu({children:e,open:i,onOpenChange:a}){const[o,l]=(0,n.useState)(!1),d=i??o,m=(0,n.useId)(),h=(0,n.useCallback)(p=>{a?.(p),i===void 0&&l(p)},[i,a]);return(0,r.jsx)(du.Provider,{value:{open:d,setOpen:h,contentId:m},children:e})}function Tv({children:e,...i}){const{setOpen:a}=fu();return(0,r.jsx)("button",{type:"button",onClick:()=>a(!0),...i,children:e})}var Rv=Wr("bg-background-elevated border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm max-w-[calc(100vw-2rem)] max-h-[calc(100dvh-2rem)] overflow-y-auto",{variants:{width:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}},defaultVariants:{width:"md"}}),Ws=(0,n.forwardRef)(({className:e,width:i,children:a,...o},l)=>{const{open:d,setOpen:m,contentId:h}=fu(),p=(0,n.useRef)(null),v=l??p;(0,n.useEffect)(()=>{const w=v.current;w&&(d&&!w.open&&w.showModal(),!d&&w.open&&w.close())},[d,v]);const y=w=>{w.target===w.currentTarget&&m(!1)};return(0,r.jsx)("dialog",{ref:v,id:h,className:K(Rv({width:i}),"w-full",e),onClick:y,onClose:()=>m(!1),...o,children:a})});Ws.displayName="DialogContent";function gu({className:e,...i}){return(0,r.jsx)("div",{className:K("flex flex-col gap-1 mb-3",e),...i})}function pu({className:e,...i}){return(0,r.jsx)("div",{className:K("flex justify-end gap-2 mt-4",e),...i})}function vu({className:e,...i}){return(0,r.jsx)("h2",{className:K("text-sm font-semibold text-foreground",e),...i})}function hu({className:e,...i}){return(0,r.jsx)("p",{className:K("text-xs text-foreground-muted",e),...i})}var bu=(0,n.createContext)(null);function qs(){const e=(0,n.useContext)(bu);if(!e)throw new Error("Dropdown compound components must be used within <Dropdown>");return e}function Zv({children:e}){const[i,a]=(0,n.useState)(!1),o=(0,n.useId)(),l=(0,n.useId)(),d=(0,n.useRef)(null);return(0,r.jsx)(bu.Provider,{value:{open:i,setOpen:a,triggerId:o,contentId:l,triggerRef:d},children:(0,r.jsx)("div",{className:"relative inline-block",children:e})})}function Lv({children:e,...i}){const{open:a,setOpen:o,triggerId:l,contentId:d,triggerRef:m}=qs();return(0,r.jsx)("button",{type:"button",ref:m,id:l,"aria-haspopup":"menu","aria-expanded":a,"aria-controls":a?d:void 0,onClick:()=>o(!a),...i,children:e})}function Uv({className:e,children:i,align:a="start",offset:o=4,...l}){const{open:d,setOpen:m,contentId:h,triggerId:p,triggerRef:v}=qs(),y=(0,n.useRef)(null),[w,N]=(0,n.useState)(null);return(0,n.useLayoutEffect)(()=>{if(!d){N(null);return}const O=()=>{const E=v.current;if(!E)return;const A=E.getBoundingClientRect(),R=a==="end"?A.right:A.left;N({top:A.bottom+o,left:R,minWidth:A.width})};return O(),window.addEventListener("resize",O),window.addEventListener("scroll",O,!0),()=>{window.removeEventListener("resize",O),window.removeEventListener("scroll",O,!0)}},[d,a,o,v]),(0,n.useEffect)(()=>{if(!d)return;const O=A=>{const R=y.current,Z=v.current;R&&!R.contains(A.target)&&!Z?.contains(A.target)&&m(!1)},E=A=>{A.key==="Escape"&&m(!1)};return document.addEventListener("mousedown",O),document.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",O),document.removeEventListener("keydown",E)}},[d,m,v]),!d||!w||typeof document>"u"?null:(0,_.createPortal)((0,r.jsx)("div",{ref:y,id:h,role:"menu","aria-labelledby":p,style:{position:"fixed",top:w.top,...a==="end"?{right:window.innerWidth-w.left}:{left:w.left},minWidth:w.minWidth},className:K("z-50 bg-background-elevated border border-border rounded-md shadow-lg py-1 min-w-[160px]",e),...l,children:i}),document.body)}function Bv({className:e,icon:i,variant:a="default",children:o,onClick:l,...d}){const{setOpen:m}=qs(),h=(0,n.useCallback)(p=>{l?.(p),m(!1)},[l,m]);return(0,r.jsxs)("button",{type:"button",role:"menuitem",className:K("h-7 text-xs px-2 w-full text-left flex items-center gap-2",a==="danger"?"text-danger hover:bg-danger/10":"text-foreground hover:bg-surface-hover",e),onClick:h,...d,children:[i&&(0,r.jsx)(i,{size:14}),o]})}var yu=(0,n.createContext)(null);function _u(){const e=(0,n.useContext)(yu);if(!e)throw new Error("Tooltip compound components must be used within <Tooltip>");return e}function Fv({children:e}){const[i,a]=(0,n.useState)(!1),o=(0,n.useRef)(null),l=(0,n.useId)(),d=()=>{o.current=setTimeout(()=>a(!0),300)},m=()=>{o.current&&clearTimeout(o.current),a(!1)};return(0,r.jsx)(yu.Provider,{value:{open:i,show:d,hide:m,tooltipId:l},children:(0,r.jsx)("div",{className:"relative inline-block",children:e})})}function Gv({children:e,...i}){const{show:a,hide:o,tooltipId:l,open:d}=_u();return(0,r.jsx)("div",{onMouseEnter:a,onMouseLeave:o,onFocus:a,onBlur:o,"aria-describedby":d?l:void 0,...i,children:e})}function Vv({className:e,children:i,...a}){const{open:o,tooltipId:l}=_u();return(0,r.jsx)("div",{id:l,role:"tooltip",className:K("absolute bottom-full left-1/2 -translate-x-1/2 mb-2 bg-foreground text-background text-xs px-2 py-1 rounded-md shadow-md whitespace-nowrap pointer-events-none transition-opacity duration-150",o?"opacity-100":"opacity-0",e),...a,children:i})}var xu="(max-width: 767px)",wu="(min-width: 768px) and (max-width: 1023px)";function Su(e){return i=>{const a=window.matchMedia(e);return a.addEventListener("change",i),()=>a.removeEventListener("change",i)}}function ju(e){return()=>window.matchMedia(e).matches}function $u(){return!1}function Bi(){return(0,n.useSyncExternalStore)(Su(xu),ju(xu),$u)}function Qv(){return(0,n.useSyncExternalStore)(Su(wu),ju(wu),$u)}function Hs({open:e,onClose:i,title:a,children:o,className:l}){return(0,n.useEffect)(()=>{if(!e)return;const d=m=>{m.key==="Escape"&&i()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[e,i]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:K("fixed inset-0 z-40 bg-black/50 transition-opacity duration-200",e?"opacity-100":"pointer-events-none opacity-0"),onClick:i,"aria-hidden":"true"}),(0,r.jsxs)("div",{role:"dialog","aria-modal":"true",className:K("fixed inset-x-0 bottom-0 z-50 flex flex-col bg-background-elevated border-t border-border rounded-t-xl shadow-2xl transition-transform duration-200 ease-out","max-h-[80dvh]",e?"translate-y-0":"translate-y-full",l),children:[(0,r.jsx)("div",{className:"flex justify-center pt-2 pb-1",children:(0,r.jsx)("div",{className:"h-1 w-8 rounded-full bg-foreground-subtle/30"})}),a&&(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 pb-2",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:a}),(0,r.jsx)("button",{onClick:i,className:"p-1 rounded-md hover:bg-surface-hover text-foreground-muted transition-colors",children:(0,r.jsx)(Mt,{className:"h-4 w-4"})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:o})]})]})}var ku=(0,n.createContext)(null);function Pu(){const e=(0,n.useContext)(ku);if(!e)throw new Error("Popover compound components must be used within <Popover>");return e}function Nu({children:e,open:i,onOpenChange:a}){const[o,l]=(0,n.useState)(!1),d=i??o,m=(0,n.useId)(),h=(0,n.useId)(),p=(0,n.useCallback)(v=>{a?.(v),i===void 0&&l(v)},[i,a]);return(0,r.jsx)(ku.Provider,{value:{open:d,setOpen:p,triggerId:m,contentId:h},children:(0,r.jsx)("div",{className:"relative inline-block",children:e})})}function Ou({children:e,...i}){const{open:a,setOpen:o,triggerId:l,contentId:d}=Pu();return(0,r.jsx)("button",{type:"button",id:l,"aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?d:void 0,onClick:()=>o(!a),...i,children:e})}function Cu({className:e,children:i,...a}){const{open:o,setOpen:l,contentId:d,triggerId:m}=Pu(),h=Bi(),p=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!o||h)return;const v=w=>{const N=p.current,O=document.getElementById(m);N&&!N.contains(w.target)&&!O?.contains(w.target)&&l(!1)},y=w=>{w.key==="Escape"&&l(!1)};return document.addEventListener("mousedown",v),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",y)}},[o,l,m,h]),o?h?(0,r.jsx)(Hs,{open:o,onClose:()=>l(!1),children:i}):(0,r.jsx)("div",{ref:p,id:d,role:"dialog","aria-labelledby":m,className:K("absolute left-0 top-full z-50 mt-1 bg-background-elevated border border-border rounded-lg shadow-lg p-3",e),...a,children:i}):null}var Iu=(0,n.createContext)(null);function Eu(){const e=(0,n.useContext)(Iu);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}function Wv({value:e,onValueChange:i,defaultValue:a="",className:o,...l}){const[d,m]=(0,n.useState)(a),h=e??d,p=(0,n.useCallback)(v=>{i?.(v),e===void 0&&m(v)},[e,i]);return(0,r.jsx)(Iu.Provider,{value:{value:h,setValue:p},children:(0,r.jsx)("div",{className:o,...l})})}function qv({className:e,...i}){return(0,r.jsx)("div",{role:"tablist",className:K("flex flex-row border-b border-border-subtle",e),...i})}function Hv({value:e,className:i,...a}){const{value:o,setValue:l}=Eu(),d=e===o;return(0,r.jsx)("button",{type:"button",role:"tab","aria-selected":d,"aria-controls":`tabpanel-${e}`,tabIndex:d?0:-1,className:K("h-7 text-xs px-3 transition-colors",d?"border-b-2 border-primary text-foreground font-medium":"text-foreground-muted hover:text-foreground",i),onClick:()=>l(e),...a})}function Jv({value:e,className:i,...a}){const{value:o}=Eu();return e!==o?null:(0,r.jsx)("div",{role:"tabpanel",id:`tabpanel-${e}`,className:K("pt-3",i),...a})}var Js=(0,n.forwardRef)(({className:e,...i},a)=>(0,r.jsx)("div",{ref:a,className:K("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",e),...i}));Js.displayName="ScrollArea";function Kv({title:e,onClose:i,children:a,defaultWidth:o=360,defaultHeight:l=280,minWidth:d=280,minHeight:m=160,offsetIndex:h=0,className:p}){const[v,y]=(0,n.useState)({x:80+h*30,y:80+h*30}),[w,N]=(0,n.useState)({w:o,h:l}),[O,E]=(0,n.useState)(!1),A=(0,n.useRef)(!1),R=(0,n.useRef)(!1),Z=(0,n.useRef)({x:0,y:0}),G=Bi(),V=(0,n.useCallback)(te=>{te.preventDefault(),A.current=!0,Z.current={x:te.clientX-v.x,y:te.clientY-v.y}},[v]),re=(0,n.useCallback)(te=>{te.preventDefault(),te.stopPropagation(),R.current=!0,Z.current={x:te.clientX,y:te.clientY}},[]);return(0,n.useEffect)(()=>{const te=ye=>{if(A.current&&y({x:ye.clientX-Z.current.x,y:ye.clientY-Z.current.y}),R.current){const ue=ye.clientX-Z.current.x,Ee=ye.clientY-Z.current.y;Z.current={x:ye.clientX,y:ye.clientY},N(Re=>({w:Math.max(d,Re.w+ue),h:Math.max(m,Re.h+Ee)}))}},ce=()=>{A.current=!1,R.current=!1};return window.addEventListener("mousemove",te),window.addEventListener("mouseup",ce),()=>{window.removeEventListener("mousemove",te),window.removeEventListener("mouseup",ce)}},[d,m]),G?(0,r.jsxs)("div",{className:K("fixed inset-x-0 bottom-0 z-50 rounded-t-xl border-t border-border bg-background-elevated shadow-2xl flex flex-col overflow-hidden",p),style:{maxHeight:"60dvh"},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border shrink-0 bg-surface",children:[(0,r.jsx)("span",{className:"text-[11px] font-medium truncate",children:e}),(0,r.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,r.jsx)("button",{onClick:()=>E(!O),className:"p-0.5 rounded hover:bg-surface-hover text-foreground-muted transition-colors",children:O?(0,r.jsx)(Gl,{size:12}):(0,r.jsx)(Ql,{size:12})}),(0,r.jsx)("button",{onClick:i,className:"p-0.5 rounded hover:bg-danger/20 text-foreground-muted hover:text-danger transition-colors",children:(0,r.jsx)(Mt,{size:12})})]})]}),!O&&(0,r.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:a})]}):(0,r.jsxs)("div",{className:K("fixed z-50 rounded-lg border border-border bg-background-elevated shadow-2xl flex flex-col overflow-hidden",p),style:{left:v.x,top:v.y,width:O?280:w.w,height:O?"auto":w.h},children:[(0,r.jsxs)("div",{onMouseDown:V,className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border cursor-move select-none shrink-0 bg-surface",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(ev,{size:12,className:"text-foreground-subtle shrink-0"}),(0,r.jsx)("span",{className:"text-[11px] font-medium truncate",children:e})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,r.jsx)("button",{onClick:()=>E(!O),className:"p-0.5 rounded hover:bg-surface-hover text-foreground-muted transition-colors",title:O?"Restore":"Minimize",children:O?(0,r.jsx)(Gl,{size:12}):(0,r.jsx)(Ql,{size:12})}),(0,r.jsx)("button",{onClick:i,className:"p-0.5 rounded hover:bg-danger/20 text-foreground-muted hover:text-danger transition-colors",title:"Close",children:(0,r.jsx)(Mt,{size:12})})]})]}),!O&&(0,r.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto relative",children:[a,(0,r.jsx)("div",{onMouseDown:re,className:"absolute bottom-0 right-0 w-4 h-4 cursor-nwse-resize",style:{background:"linear-gradient(135deg, transparent 50%, var(--color-foreground-subtle) 50%)",opacity:.4}})]})]})}function Mu({open:e,onClose:i,children:a,className:o,width:l="w-64"}){const d=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!e)return;const m=h=>{h.key==="Escape"&&i()};return document.addEventListener("keydown",m),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",m),document.body.style.overflow=""}},[e,i]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:K("fixed inset-0 z-40 bg-black/50 backdrop-blur-sm transition-opacity duration-200",e?"opacity-100":"pointer-events-none opacity-0"),onClick:i,"aria-hidden":"true"}),(0,r.jsx)("div",{ref:d,role:"dialog","aria-modal":"true",className:K("fixed inset-y-0 left-0 z-50 flex flex-col bg-surface border-r border-border shadow-2xl transition-transform duration-200 ease-out",l,e?"translate-x-0":"-translate-x-full",o),children:a})]})}function Xv({items:e,className:i}){return(0,r.jsx)("nav",{className:`flex items-center gap-1 text-[11px] text-foreground-subtle ${i??""}`,children:e.map((a,o)=>{const l=o===e.length-1,d=!l&&(a.onClick||a.href);return(0,r.jsxs)(n.default.Fragment,{children:[o>0&&(0,r.jsx)(Dr,{className:"h-3 w-3 flex-shrink-0"}),d?a.onClick?(0,r.jsx)("button",{type:"button",onClick:a.onClick,className:"hover:text-foreground transition-colors",children:a.label}):(0,r.jsx)("a",{href:a.href,className:"hover:text-foreground transition-colors",children:a.label}):(0,r.jsx)("span",{className:l?"text-foreground font-medium":"",children:a.label})]},o)})})}var Du={left:"text-left",right:"text-right",center:"text-center"};function Au({columns:e,rows:i,rowKey:a,onRowClick:o,minWidthPx:l=480,emptyMessage:d,className:m,bordered:h=!0,rowClassName:p}){return i.length===0&&d?(0,r.jsx)("div",{className:`rounded-lg ${h?"border border-border":""} bg-surface px-3 py-4 text-xs text-foreground-subtle text-center ${m??""}`,children:d}):i.length===0?null:(0,r.jsx)("div",{className:`rounded-lg ${h?"border border-border":""} bg-surface overflow-x-auto ${m??""}`,children:(0,r.jsxs)("table",{className:"w-full text-xs",style:{minWidth:`${l}px`},children:[(0,r.jsx)("thead",{className:"bg-surface",children:(0,r.jsx)("tr",{children:e.map(v=>{const y=v.align??"left",w=v.nowrap??!0;return(0,r.jsx)("th",{className:["px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",Du[y],w?"whitespace-nowrap":"",v.width??""].filter(Boolean).join(" "),children:v.headerRender?v.headerRender():v.header},v.key)})})}),(0,r.jsx)("tbody",{children:i.map((v,y)=>{const w=a?a(v,y):y,N=p?.(v,y)??"",O=o!==void 0;return(0,r.jsx)("tr",{onClick:O?()=>o(v,y):void 0,className:[O?"cursor-pointer hover:bg-primary/5":"hover:bg-primary/5",N].filter(Boolean).join(" "),children:e.map(E=>{const A=E.align??"left",R=E.nowrap??!1;return(0,r.jsx)("td",{className:["px-3 py-2 text-foreground border-b border-border",Du[A],R?"whitespace-nowrap":""].filter(Boolean).join(" "),children:E.render(v,y)},E.key)})},w)})})]})})}function Yv({open:e,onClose:i,title:a,subtitle:o,footer:l,children:d,widthClass:m="w-[360px]"}){return(0,n.useEffect)(()=>{if(!e)return;const h=p=>{p.key==="Escape"&&i()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[e,i]),e?(0,r.jsxs)("aside",{className:K("absolute top-0 right-0 bottom-0 z-20 flex flex-col","bg-surface border-l border-border shadow-xl",m),role:"dialog","aria-modal":"false",children:[(0,r.jsxs)("header",{className:"flex items-start justify-between gap-2 px-4 py-3 border-b border-border",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"text-sm font-semibold text-foreground truncate",children:a}),o!==void 0&&(0,r.jsx)("div",{className:"text-[11px] text-foreground-subtle mt-0.5 truncate",children:o})]}),(0,r.jsx)("button",{type:"button",onClick:i,className:"p-1 rounded hover:bg-muted text-foreground-subtle hover:text-foreground","aria-label":"Close panel",children:(0,r.jsx)(Mt,{className:"w-4 h-4"})})]}),(0,r.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto px-4 py-3",children:d}),l!==void 0&&(0,r.jsx)("footer",{className:"flex items-center gap-2 justify-end px-4 py-3 border-t border-border",children:l})]}):null}var eh={inherit:"bg-muted",on:"bg-emerald-500",off:"bg-orange-500",na:"bg-gray-300 opacity-50"};function zu({node:e,depth:i,selectedAddonId:a,onSelect:o,agentDots:l}){const d=e.addonId===a,m=l?.[e.addonId]??[];return(0,r.jsxs)("div",{children:[(0,r.jsxs)("button",{type:"button",onClick:()=>o(e.addonId),className:K("w-full flex items-center justify-between gap-2 text-left px-3 py-1.5 text-xs","border-l-2",d?"bg-accent border-primary text-foreground font-medium":"border-transparent hover:bg-muted/40 text-foreground"),style:{paddingLeft:`${12+i*14}px`},children:[(0,r.jsx)("span",{className:"truncate",children:e.addonName}),m.length>0&&(0,r.jsx)("span",{className:"flex items-center gap-1 shrink-0",children:m.map(h=>(0,r.jsx)("span",{title:`${h.agentNodeId}: ${h.state}`,className:K("w-2 h-2 rounded-full",eh[h.state])},h.agentNodeId))})]}),e.children.map(h=>(0,r.jsx)(zu,{node:h,depth:i+1,selectedAddonId:a,onSelect:o,agentDots:l},h.addonId))]})}function th({tree:e,selectedAddonId:i,onSelect:a,agentDots:o,className:l}){return(0,r.jsx)("div",{className:K("flex flex-col py-2",l),children:e.map(d=>(0,r.jsx)(zu,{node:d,depth:0,selectedAddonId:i,onSelect:a,agentDots:o},d.addonId))})}function rh(e){const i=[],a=[],o=new Map;for(const d of e.slots)for(const m of d.addons){const h={addonId:m.id,addonName:m.name,slot:m.slot,inputClasses:m.inputClasses,outputClasses:m.outputClasses,children:[]};m.slot==="audio-classifier"?i.push(h):(a.push(h),o.set(m.id,h))}const l=[];for(const d of a){if(d.inputClasses.length===0){l.push(d);continue}const m=a.find(h=>h.addonId!==d.addonId&&h.outputClasses.some(p=>d.inputClasses.includes(p)));m&&m.children.push(d)}return[...l,...i]}function nh(e){return e?e.models.map(i=>({id:i.id,name:i.name})):[]}function $a({step:e,schema:i,allSchemas:a,depth:o=0,onChange:l,onDelete:d,readOnly:m=!1,toggleMode:h="simple",overrideState:p=null,onOverrideChange:v,inheritedEnabled:y,hideModelAndSettings:w=!1}){const[N,O]=(0,n.useState)(!1),E=nh(i);if(E.length>0&&!E.some(R=>R.id===e.modelId)&&!m){const R=(i?.defaultModelId?E.find(Z=>Z.id===i.defaultModelId):null)??E[0];R&&R.id!==e.modelId&&queueMicrotask(()=>l({...e,modelId:R.id}))}const A=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-[10px] uppercase tracking-wider font-medium text-foreground-subtle/60 block leading-none",children:e.slot}),(0,r.jsx)("span",{className:"text-sm font-semibold text-foreground truncate block leading-tight",children:e.addonName}),(0,r.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[e.inputClasses.map(R=>(0,r.jsx)("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-blue-500/12 text-blue-400",children:R},R)),e.inputClasses.length>0&&e.outputClasses.length>0&&(0,r.jsx)("span",{className:"text-foreground-subtle/40 text-[10px]",children:"→"}),e.outputClasses.map(R=>(0,r.jsx)("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-green-500/12 text-green-400",children:R},R))]})]}),!m&&h==="simple"&&(0,r.jsx)("button",{onClick:R=>{R.stopPropagation(),l({...e,enabled:!e.enabled})},className:K("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors",e.enabled?"bg-success":"bg-foreground-subtle/30"),children:(0,r.jsx)("span",{className:K("inline-block h-4 w-4 rounded-full bg-white shadow transition-transform",e.enabled?"translate-x-6":"translate-x-1")})}),!m&&h==="threeState"&&v&&(0,r.jsxs)("div",{className:"flex items-center gap-0.5 rounded-md border border-border p-0.5",onClick:R=>R.stopPropagation(),children:[(0,r.jsx)(Xs,{label:"Inherit",active:p===null,variant:"inherit",subtext:y===void 0?void 0:y?"on":"off",onClick:()=>v(null)}),(0,r.jsx)(Xs,{label:"On",active:p===!0,variant:"on",onClick:()=>v(!0)}),(0,r.jsx)(Xs,{label:"Off",active:p===!1,variant:"off",onClick:()=>v(!1)})]})]});return(0,r.jsx)(ou,{expanded:N,onExpandedChange:O,dimmed:!e.enabled,header:A,children:w?(0,r.jsx)("p",{className:"text-[11px] text-foreground-subtle",children:"Model and detection settings are managed per agent — open the Pipeline page for this camera's agent to edit them."}):(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(Ks,{label:"Model",value:e.modelId,disabled:m,options:E.map(R=>({value:R.id,label:R.name})),onChange:R=>l({...e,modelId:R})}),e.slot==="audio-classifier"&&e.engine&&(0,r.jsx)(Ks,{label:"Runtime",value:`${e.engine.runtime}/${e.engine.backend}`,disabled:m,options:[{value:"node/cpu",label:"Node.js — ONNX CPU"},{value:"node/coreml",label:"Node.js — Apple SoundAnalysis (macOS)"},{value:"python/cpu",label:"Python — ONNX CPU"}],onChange:R=>{const[Z,G]=R.split("/");l({...e,engine:{runtime:Z,backend:G,format:G==="coreml"?"coreml":"onnx"}})}}),i?.configSchema?.map(R=>(0,r.jsx)(ka,{field:R,allFields:i.configSchema??[],step:e,disabled:m,onChange:l},R.key))]})})}function Ks({label:e,value:i,options:a,disabled:o,onChange:l}){return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:e}),(0,r.jsxs)("select",{value:i,onChange:d=>l(d.target.value),disabled:o,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground focus:outline-none focus:border-primary/50",children:[a.length===0&&(0,r.jsx)("option",{value:i,children:i||"default"}),a.map(d=>(0,r.jsx)("option",{value:d.value,disabled:d.disabled,children:d.label},d.value))]})]})}function ih({label:e,description:i,value:a,options:o,disabled:l,onChange:d}){function m(h){l||d(a.includes(h)?a.filter(p=>p!==h):[...a,h])}return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1",children:e}),i&&(0,r.jsx)("p",{className:"text-[10px] text-foreground-subtle/60 mb-1.5",children:i}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:o.map(h=>(0,r.jsx)("button",{type:"button",disabled:l,onClick:()=>m(h.value),className:K("text-[10px] font-medium px-2 py-1 rounded-md border transition-colors",a.includes(h.value)?"bg-primary/20 text-primary border-primary/40":"bg-surface text-foreground-subtle border-border hover:border-primary/30",l&&"opacity-50 cursor-not-allowed"),children:h.label},h.value))})]})}function ah(e,i,a){const o=i.settings?.[e];if(o!==void 0)return o;const l=a.find(d=>"key"in d&&d.key===e);return l&&"default"in l?l.default:void 0}function ka({field:e,allFields:i,step:a,disabled:o,onChange:l}){const d=e.type!=="separator"&&e.type!=="info"?e.showWhen:void 0;if(d){const{field:h,equals:p,notEquals:v,in:y,notIn:w}=d,N=ah(h,a,i);if(p!==void 0&&N!==p||v!==void 0&&N===v||y!==void 0&&!y.includes(N)||w!==void 0&&w.includes(N))return null}function m(h){l({...a,settings:{...a.settings,[e.key]:h}})}if(e.type==="select"){const h=a.settings?.[e.key],p=typeof h=="string"?h:e.default??"";return(0,r.jsx)(Ks,{label:e.label,value:p,disabled:o||e.disabled,options:e.options,onChange:m})}if(e.type==="multiselect"){const h=a.settings?.[e.key],p=Array.isArray(h)?h:Array.isArray(e.default)?e.default:[];return(0,r.jsx)(ih,{label:e.label,description:e.description,value:p,options:e.options,disabled:o||e.disabled,onChange:m})}if(e.type==="slider"||e.type==="number"){const h=a.settings?.[e.key],p=typeof e.default=="number"?e.default:e.min??0,v=typeof h=="number"?h:p,y=e.min??0,w=e.max??1,N=e.step??.01,O=e.type==="slider"?e.showValue:!0,E="unit"in e?e.unit:void 0,A=e.type==="slider"?e.displayScale:void 0,R=A?v/A:v;return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,r.jsx)("span",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide",children:e.label}),O&&(0,r.jsxs)("span",{className:"text-xs font-medium text-foreground tabular-nums",children:[typeof R=="number"?R.toFixed(2).replace(/\.?0+$/,""):R,E?` ${E}`:""]})]}),e.description&&(0,r.jsx)("p",{className:"text-[10px] text-foreground-subtle/60 mb-1.5",children:e.description}),(0,r.jsx)("input",{type:"range",min:y,max:w,step:N,value:v,disabled:o||e.disabled,onChange:Z=>m(Number(Z.target.value)),className:"w-full accent-primary h-1.5"})]})}if(e.type==="boolean"){const h=a.settings?.[e.key];return(0,r.jsxs)("label",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"checkbox",checked:typeof h=="boolean"?h:e.default===!0,disabled:o||e.disabled,onChange:p=>m(p.target.checked),className:"h-3.5 w-3.5 accent-primary"}),(0,r.jsx)("span",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide",children:e.label})]})}if(e.type==="text"||e.type==="password"||e.type==="textarea"){const h=a.settings?.[e.key],p=typeof h=="string"?h:e.default??"",v=e.type==="password"?"password":"text";return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:e.label}),e.type==="textarea"?(0,r.jsx)("textarea",{value:p,disabled:o||e.disabled,placeholder:e.placeholder,onChange:y=>m(y.target.value),rows:3,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground focus:outline-none focus:border-primary/50 resize-y"}):(0,r.jsx)("input",{type:v,value:p,disabled:o||e.disabled,placeholder:e.placeholder,onChange:y=>m(y.target.value),className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground focus:outline-none focus:border-primary/50"})]})}return e.type==="separator"?(0,r.jsx)("div",{className:"border-t border-border my-2"}):e.type==="info"?(0,r.jsx)("div",{className:"rounded-md border border-border bg-surface px-2 py-1.5 text-[10px] text-foreground-subtle",children:e.content}):null}function Xs({label:e,active:i,variant:a,subtext:o,onClick:l}){return(0,r.jsxs)("button",{type:"button",onClick:l,className:K("px-2 py-1 text-[10px] font-medium rounded transition-colors",i?a==="on"?"bg-green-500/20 text-green-400":a==="off"?"bg-red-500/20 text-red-400":"bg-primary/20 text-primary":"text-foreground-subtle hover:bg-surface-hover"),children:[e,o&&i&&(0,r.jsxs)("span",{className:"ml-1 opacity-60",children:["(",o,")"]})]})}function Tu(e,i){return{addonId:e.id,addonName:e.name,slot:e.slot,inputClasses:[...e.inputClasses],outputClasses:[...e.outputClasses],enabled:i.enabled,modelId:i.modelId,children:[],settings:{...i.settings}}}function oh(e,i,a){return a?{enabled:a.enabled??i.enabled,modelId:a.modelId??i.modelId,settings:a.settings??i.settings}:i}function sh({addon:e,agentDefault:i,modelsForFormat:a,onChangeAgentConfig:o}){const l=d=>{o?.({...i,...d})};return(0,r.jsxs)("div",{className:"space-y-4 text-xs",children:[(0,r.jsxs)("label",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"checkbox",checked:i.enabled,onChange:d=>l({enabled:d.target.checked})}),(0,r.jsxs)("span",{children:["Enabled on this agent (",e.name,")"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-foreground-subtle mb-1",children:"Model"}),(0,r.jsx)("select",{className:"w-full bg-surface border border-border rounded px-2 py-1 text-xs",value:i.modelId,onChange:d=>l({modelId:d.target.value}),children:a.map(d=>(0,r.jsx)("option",{value:d.id,children:d.name},d.id))})]}),(e.configSchema?.length??0)>0&&(0,r.jsxs)("div",{className:"pt-2 border-t border-border/50 space-y-3",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-foreground-subtle",children:"Settings"}),e.configSchema?.map(d=>(0,r.jsx)(ka,{field:d,allFields:e.configSchema??[],step:Tu(e,i),disabled:!1,onChange:m=>l({settings:{...m.settings}})},d.key))]})]})}function ch({addon:e,agentDefault:i,agentNodeId:a,currentPatch:o,modelsForFormat:l,onChangePatch:d}){const m=oh("device",i,o),h=O=>{const E=O.enabled!==void 0||O.modelId!==void 0||O.settings!==void 0;d?.(E?O:null)},p=O=>{const{enabled:E,...A}=o??{};h(O==="inherit"?A:{...A,enabled:O==="on"})},v=O=>{const{modelId:E,...A}=o??{};h(O===void 0?A:{...A,modelId:O})},y=O=>{const{settings:E,...A}=o??{};h(O===void 0?A:{...A,settings:O})},w=o?.enabled===void 0?"inherit":o.enabled?"on":"off",N=o?.modelId!==void 0;return(0,r.jsxs)("div",{className:"space-y-4 text-xs",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[["inherit","on","off"].map(O=>(0,r.jsx)("button",{type:"button",onClick:()=>p(O),className:K("px-3 py-1 border border-border rounded text-xs capitalize",w===O?"bg-primary text-primary-foreground border-primary":"bg-surface text-foreground hover:bg-muted"),children:O},O)),(0,r.jsxs)("span",{className:"ml-2 text-[10px] text-foreground-subtle",children:["agent default: ",(0,r.jsx)("span",{className:"font-semibold",children:i.enabled?"on":"off"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-foreground-subtle",children:"Model"}),N?(0,r.jsx)("button",{type:"button",className:"text-[10px] text-foreground-subtle hover:text-foreground",onClick:()=>v(void 0),children:"Clear"}):(0,r.jsx)("button",{type:"button",className:"text-[10px] text-primary hover:underline",onClick:()=>v(i.modelId),children:"Override"})]}),(0,r.jsx)("select",{disabled:!N,className:"w-full bg-surface border border-border rounded px-2 py-1 text-xs disabled:opacity-50",value:N?o?.modelId??i.modelId:i.modelId,onChange:O=>v(O.target.value),children:l.map(O=>(0,r.jsx)("option",{value:O.id,children:O.name},O.id))}),!N&&(0,r.jsxs)("div",{className:"text-[10px] text-foreground-subtle mt-1",children:["inherits from ",a]})]}),(e.configSchema?.length??0)>0&&(()=>{const O=o?.settings!==void 0;return(0,r.jsxs)("div",{className:"pt-2 border-t border-border/50 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-foreground-subtle",children:"Settings"}),O?(0,r.jsx)("button",{type:"button",className:"text-[10px] text-foreground-subtle hover:text-foreground",onClick:()=>y(void 0),children:"Clear"}):(0,r.jsx)("button",{type:"button",className:"text-[10px] text-primary hover:underline",onClick:()=>y({...i.settings}),children:"Override"})]}),e.configSchema?.map(E=>(0,r.jsx)(ka,{field:E,allFields:e.configSchema??[],step:Tu(e,m),disabled:!O,onChange:A=>y({...A.settings})},E.key)),!O&&(0,r.jsxs)("div",{className:"text-[10px] text-foreground-subtle",children:["inherits from ",a]})]})})(),(0,r.jsxs)("div",{className:"rounded bg-muted/40 px-3 py-2 text-[11px] text-foreground-subtle",children:[(0,r.jsx)("div",{className:"font-semibold text-foreground mb-0.5",children:"Effective config preview"}),(0,r.jsxs)("div",{className:"font-mono truncate",children:[e.id," · model: ",m.modelId," · ",m.enabled?"on":"off"]})]})]})}function lh(e){const{mode:i,addon:a,agentDefault:o,agentNodeId:l,currentPatch:d,onChangeAgentConfig:m,onChangePatch:h,engineFormat:p}=e,v=(0,n.useMemo)(()=>a.models.filter(y=>!!y.formats[p]),[a.models,p]);return i==="agent"?(0,r.jsx)(sh,{addon:a,agentDefault:o,modelsForFormat:v,onChangeAgentConfig:m}):(0,r.jsx)(ch,{addon:a,agentDefault:o,agentNodeId:l,currentPatch:d,modelsForFormat:v,onChangePatch:h})}function uh(e){const i=[],a=(o,l)=>{for(const d of o)i.push({node:d,depth:l}),a(d.children,l+1)};return a(e,0),i}var Ru={detector:{label:"detector",className:"text-emerald-500"},cropper:{label:"cropper",className:"text-blue-500"},classifier:{label:"classifier",className:"text-violet-500"},refiner:{label:"refiner",className:"text-amber-500"},"audio-classifier":{label:"audio classifier",className:"text-pink-500"}};function dh({slot:e}){const i=Ru[e]??Ru.classifier;return(0,r.jsx)("span",{className:K("text-[9px] font-semibold uppercase tracking-widest leading-none",i.className),children:i.label})}var Zu="inline-flex items-center rounded bg-muted px-1.5 py-px text-[9px] font-medium text-foreground-subtle";function fh({inputs:e,outputs:i}){return e.length===0&&i.length===0?null:(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 flex-wrap",children:[e.map(a=>(0,r.jsx)("span",{className:K(Zu,"bg-blue-500/10 text-blue-500"),children:a},`in-${a}`)),e.length>0&&i.length>0&&(0,r.jsx)("span",{className:"text-foreground-subtle/60 text-[9px]",children:"→"}),i.map(a=>(0,r.jsx)("span",{className:K(Zu,"bg-emerald-500/10 text-emerald-500"),children:a},`out-${a}`))]})}function mh({enabled:e,onChange:i,disabled:a}){return(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:a,onClick:o=>{o.stopPropagation(),i(!e)},className:K("relative inline-flex h-3.5 w-7 shrink-0 items-center rounded-full transition-colors",e?"bg-emerald-500":"bg-foreground-subtle/30",a?"opacity-50 cursor-not-allowed":"cursor-pointer"),title:e?"Click to disable":"Click to enable",children:(0,r.jsx)("span",{className:K("inline-block h-3 w-3 rounded-full bg-white shadow transition-transform",e?"translate-x-3.5":"translate-x-0.5")})})}function gh(e){return e.kind==="enabled"?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 shrink-0"}),(0,r.jsx)("span",{className:"font-mono text-foreground",children:e.modelId})]}):e.kind==="disabled"?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground-subtle",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full border border-foreground-subtle/60 shrink-0"}),"off"]}):(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground-subtle/70",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-muted shrink-0"}),"n/a"]})}function ph({node:e,depth:i,agents:a,getCellState:o,onCellClick:l,selectedCell:d,toggleProps:m}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sticky left-0 z-10 bg-surface px-3 py-2 border-b border-border text-xs flex items-start gap-2",style:{paddingLeft:`${12+i*14}px`},children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[(0,r.jsx)(dh,{slot:e.slot}),(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("span",{className:"font-semibold truncate",children:e.addonName}),(0,r.jsx)(fh,{inputs:e.inputClasses,outputs:e.outputClasses})]})]}),m&&(0,r.jsx)("span",{className:"pl-2 pt-0.5 shrink-0",children:(0,r.jsx)(mh,{enabled:m.enabled,onChange:m.onChange,disabled:m.disabled})})]}),a.map(h=>{const p=o(e.addonId,h.agentNodeId),v=d?.addonId===e.addonId&&d.agentNodeId===h.agentNodeId;return(0,r.jsx)("button",{type:"button",onClick:()=>l(e.addonId,h.agentNodeId),className:K("text-left px-3 py-1.5 border-b border-l border-border text-xs hover:bg-muted/40",p.kind==="enabled"&&"bg-emerald-500/5",p.kind==="na"&&"bg-muted/30",v&&"ring-2 ring-primary ring-inset"),children:gh(p)},h.agentNodeId)})]})}function vh({tree:e,agents:i,getCellState:a,onCellClick:o,selectedCell:l,onToggleEnabled:d}){const m=(0,n.useMemo)(()=>uh(e),[e]),h=`minmax(320px, 1fr) repeat(${i.length}, minmax(160px, 220px))`,p=d!==void 0&&i.length===1,v=i[0]?.agentNodeId;return(0,r.jsx)("div",{className:"overflow-auto border border-border rounded",children:(0,r.jsxs)("div",{className:"grid",style:{gridTemplateColumns:h},children:[(0,r.jsx)("div",{className:"sticky top-0 left-0 z-20 bg-muted/60 px-3 py-2 text-[10px] uppercase tracking-widest text-foreground-subtle border-b border-border",children:"Step"}),i.map(y=>(0,r.jsxs)("div",{className:"sticky top-0 z-10 bg-muted/60 px-3 py-2 border-b border-l border-border",children:[(0,r.jsx)("div",{className:"text-xs font-semibold text-foreground",children:y.agentNodeId}),(0,r.jsx)("div",{className:"text-[10px] text-foreground-subtle truncate",children:y.engineLabel})]},y.agentNodeId)),m.map(({node:y,depth:w})=>{const N=p&&v!==void 0?a(y.addonId,v):null;return(0,r.jsx)(ph,{node:y,depth:w,agents:i,getCellState:a,onCellClick:o,selectedCell:l,toggleProps:p&&N!==null?{enabled:N.kind==="enabled",onChange:O=>d?.(y.addonId,O),disabled:N.kind==="na"}:void 0},y.addonId)})]})})}var Lu=typeof globalThis<"u"?globalThis.__camstackTrpcReact:void 0,j=Lu??(0,ie.createTRPCReact)();typeof globalThis<"u"&&!Lu&&(globalThis.__camstackTrpcReact=j);var Ys=_r("camstack:system",null);function Uu({system:e,children:i}){return(0,r.jsx)(Ys.Provider,{value:e,children:i})}function qr(){const e=(0,n.useContext)(Ys);if(!e)throw new Error("useSystem(): no <SystemProvider> in tree");return e}function hh(){return(0,n.useContext)(Ys)}function Fi(e,i){const a=qr(),o=(0,n.useRef)(i);o.current=i;const[l,d]=(0,n.useState)(a.connectionVersion);(0,n.useEffect)(()=>a.subscribeConnectionEvents((m,h)=>{m==="connected"&&d(h)}),[a]),(0,n.useEffect)(()=>a.subscribeEvent(e,m=>{o.current(m)}),[a,e,l])}function ec(e){const i=(0,n.useRef)(e);return i.current=e,i}function tc(e,i){const[a,o]=(0,n.useState)(null),l=ec(i);return Fi(e,d=>{const m=d.data,h=l.current;h&&!h(m)||o(m)}),a}function bh(e,i,a){const[o,l]=(0,n.useState)(()=>new Map),d=ec(i),m=ec(a);return Fi(e,h=>{const p=h.data,v=m.current;if(v&&!v(p))return;const y=d.current(p);l(w=>{const N=new Map(w);return N.set(y,p),N})}),{map:o,values:(0,n.useMemo)(()=>Array.from(o.values()),[o])}}function Pa(){const{data:e,isLoading:i}=j.nodes.topology.useQuery(void 0,{staleTime:6e4}),a=tc("cluster.topology-snapshot")?.nodes??e;return{nodes:(0,n.useMemo)(()=>{const o=[];for(const l of a??[])o.push({id:String(l.id??""),name:String(l.name??l.id??""),shortName:l.isHub?"HUB":String(l.name??l.id??""),isHub:!!l.isHub,isOnline:!!l.isOnline,localIps:l.localIps??[],addons:(l.addons??[]).map(d=>({addonId:d.id,capabilities:d.capabilities}))});return o.sort((l,d)=>l.isHub!==d.isHub?l.isHub?-1:1:l.name.localeCompare(d.name)),o},[a]),isLoading:i}}function yh({selectedNodeId:e,onSelect:i,label:a="Node",hideIcon:o=!1,alwaysShow:l=!1}){const{nodes:d}=Pa();return!l&&d.length<=1?null:(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[!o&&(0,r.jsx)(vv,{className:"h-3.5 w-3.5 text-foreground-subtle"}),a&&(0,r.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-foreground-subtle",children:a}),(0,r.jsx)("div",{className:"flex rounded-md border border-border overflow-hidden text-[11px] font-medium",children:d.map((m,h)=>{const p=e===m.id;return(0,r.jsx)("button",{type:"button",onClick:()=>i(m.id),disabled:!m.isOnline,title:m.isOnline?m.name:`${m.name} (offline)`,className:K("px-2.5 py-1 transition-colors",p?"bg-primary/15 text-primary":"bg-transparent text-foreground-subtle hover:bg-surface-hover hover:text-foreground",h>0&&"border-l border-border",!m.isOnline&&"opacity-50 cursor-not-allowed"),children:m.shortName},m.id)})})]})}var _h={online:{colorClass:"bg-success",label:"Online"},offline:{colorClass:"bg-danger",label:"Offline"},degraded:{colorClass:"bg-warning",label:"Degraded"},unknown:{colorClass:"bg-foreground-subtle",label:"Unknown"}};function xh({status:e,showDot:i=!0,showLabel:a=!0,size:o="sm",className:l}){const d=_h[e];return(0,r.jsxs)("span",{className:K("inline-flex items-center gap-1.5",o==="sm"?"text-xs":"text-sm",l),children:[i&&(0,r.jsx)("span",{className:K("h-1.5 w-1.5 shrink-0 rounded-full",d.colorClass),"aria-hidden":"true"}),a&&(0,r.jsx)("span",{className:"text-foreground",children:d.label})]})}var wh={frigate:{colorClass:"bg-provider-frigate",label:"Frigate"},scrypted:{colorClass:"bg-provider-scrypted",label:"Scrypted"},reolink:{colorClass:"bg-provider-reolink",label:"Reolink"},homeAssistant:{colorClass:"bg-provider-homeAssistant",label:"Home Assistant"},rtsp:{colorClass:"bg-provider-rtsp",label:"RTSP"}};function Sh({provider:e,showLabel:i=!0,className:a}){const o=wh[e];return(0,r.jsxs)("span",{className:K("inline-flex items-center gap-1.5 text-xs",a),children:[(0,r.jsx)("span",{className:K("h-1.5 w-1.5 shrink-0 rounded-sm",o.colorClass),"aria-hidden":"true"}),i&&(0,r.jsx)("span",{className:"text-foreground",children:o.label})]})}var jh={success:"bg-emerald-400 text-emerald-950",warning:"bg-amber-400 text-amber-950",danger:"bg-red-400 text-red-950",info:"bg-blue-400 text-blue-950",neutral:"bg-foreground-subtle/20 text-foreground"};function Bu({children:e,variant:i="neutral",mono:a,className:o}){return(0,r.jsx)("span",{className:K("inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-bold leading-tight",a&&"font-mono",jh[i],o),children:e})}function $h({version:e,preRelease:i,className:a}){return(0,r.jsx)(Bu,{variant:i??/-(alpha|beta|rc|dev|canary|next)/i.test(e)?"warning":"success",mono:!0,className:a,children:e})}function kh({label:e,description:i,error:a,required:o,children:l,orientation:d="vertical",className:m}){const h=d==="horizontal";return(0,r.jsxs)("div",{className:K("flex gap-2",h?"flex-row items-center justify-between":"flex-col",m),children:[(0,r.jsxs)("div",{className:K(h?"flex-1":""),children:[(0,r.jsxs)(Vs,{children:[e,o&&(0,r.jsx)("span",{className:"text-danger ml-0.5",children:"*"})]}),i&&(0,r.jsx)("p",{className:"text-foreground-subtle text-xs mt-0.5",children:i})]}),(0,r.jsx)("div",{className:K(h?"shrink-0":""),children:l}),a&&(0,r.jsx)("p",{className:"text-danger text-xs",children:a})]})}function Ph({title:e,subtitle:i,actions:a,className:o}){return(0,r.jsxs)("div",{className:K("flex flex-col gap-2 mb-3 sm:flex-row sm:items-center sm:justify-between",o),children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-sm font-semibold text-foreground",children:e}),i&&(0,r.jsx)("p",{className:"text-foreground-subtle text-xs",children:i})]}),a&&(0,r.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:a})]})}function Fu({icon:e,title:i,description:a,action:o,className:l}){return(0,r.jsxs)("div",{className:K("flex flex-col items-center justify-center gap-3 py-12",l),children:[e&&(0,r.jsx)(e,{className:"h-12 w-12 text-foreground-subtle","aria-hidden":"true"}),(0,r.jsxs)("div",{className:"flex flex-col items-center gap-1 text-center",children:[(0,r.jsx)("p",{className:"text-foreground-muted text-sm font-medium",children:i}),a&&(0,r.jsx)("p",{className:"text-foreground-subtle text-xs max-w-xs",children:a})]}),o&&(0,r.jsx)("div",{className:"mt-1",children:o})]})}var Nh={danger:{box:"border-danger/40 bg-danger/10",icon:"text-danger",title:"text-danger",message:"text-danger"},warning:{box:"border-amber-500/40 bg-amber-500/10",icon:"text-amber-600 dark:text-amber-400",title:"text-amber-700 dark:text-amber-300",message:"text-amber-700 dark:text-amber-300"}};function Gu({message:e,title:i,onRetry:a,action:o,variant:l="danger",className:d}){const m=Nh[l],h=l==="warning"?bn:Ri;return(0,r.jsxs)("div",{role:"alert",className:K("flex items-start gap-2.5 rounded border px-3 py-2.5",m.box,d),children:[(0,r.jsx)(h,{className:K("h-4 w-4 mt-0.5 shrink-0",m.icon),"aria-hidden":"true"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[i&&(0,r.jsx)("p",{className:K("text-xs font-semibold",m.title),children:i}),(0,r.jsx)("div",{className:K("text-xs break-words",m.message,i?"mt-0.5":""),children:e})]}),o??(a&&(0,r.jsxs)("button",{type:"button",onClick:a,className:K("shrink-0 inline-flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium","border border-current/30 hover:bg-current/10 transition-colors",m.message),children:[(0,r.jsx)(Sa,{className:"h-3 w-3","aria-hidden":"true"}),"Retry"]}))]})}var Vu=_r("camstack:confirm-dialog",null);function Na(){const e=(0,n.useContext)(Vu);if(!e)throw new Error("useConfirm must be used within ConfirmDialogProvider");return e.confirm}function Oh({children:e}){const[i,a]=(0,n.useState)(null),o=(0,n.useCallback)(p=>new Promise(v=>{a({...p,resolve:v})}),[]),l=()=>{i?.resolve(!0),a(null)},d=()=>{i?.resolve(!1),a(null)},m={danger:{icon:"text-red-400",button:"bg-red-500 hover:bg-red-600 text-white"},warning:{icon:"text-orange-400",button:"bg-orange-500 hover:bg-orange-600 text-white"},default:{icon:"text-primary",button:"bg-primary hover:bg-primary/90 text-white"}},h=i?m[i.variant??"default"]:m.default;return(0,r.jsxs)(Vu.Provider,{value:{confirm:o},children:[e,i&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:d}),(0,r.jsxs)("div",{className:"relative z-10 w-full max-w-sm mx-4 rounded-xl border border-border bg-surface shadow-2xl overflow-hidden animate-in fade-in zoom-in-95 duration-150",onClick:p=>p.stopPropagation(),children:[(0,r.jsxs)("div",{className:"px-5 pt-5 pb-4",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:i.title}),(0,r.jsx)("p",{className:"mt-2 text-xs text-foreground-subtle leading-relaxed",children:i.message})]}),(0,r.jsxs)("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border bg-surface-hover/30",children:[(0,r.jsx)("button",{type:"button",onClick:d,className:"px-3 py-1.5 text-xs font-medium rounded-md border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:i.cancelLabel??"Cancel"}),(0,r.jsx)("button",{type:"button",onClick:l,className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${h.button}`,children:i.confirmLabel??"Confirm"})]})]})]})]})}function Ch({value:e,label:i,trend:a,className:o}){return(0,r.jsxs)(Gs,{className:K("flex flex-col gap-1",o),children:[(0,r.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,r.jsx)("span",{className:"text-2xl font-semibold text-foreground",children:e}),a&&(0,r.jsxs)("span",{className:K("inline-flex items-center gap-0.5 text-xs font-medium",a.direction==="up"?"text-success":"text-danger"),children:[a.direction==="up"?(0,r.jsx)(jv,{className:"h-3 w-3"}):(0,r.jsx)($v,{className:"h-3 w-3"}),a.value,"%"]})]}),(0,r.jsx)("span",{className:"text-xs text-foreground-muted",children:i})]})}function Ih({items:e,className:i}){return(0,r.jsx)("dl",{className:K("flex flex-col",i),children:e.map(a=>(0,r.jsxs)("div",{className:"flex items-center h-7",children:[(0,r.jsx)("dt",{className:"text-foreground-subtle text-xs w-1/3 shrink-0",children:a.key}),(0,r.jsx)("dd",{className:"text-foreground text-xs",children:a.value})]},a.key))})}function Eh({children:e,maxHeight:i=300,className:a}){const[o,l]=(0,n.useState)(!1),d=(0,n.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)})},[e]);return(0,r.jsxs)("div",{className:K("relative group",a),children:[(0,r.jsx)(Js,{style:{maxHeight:i},children:(0,r.jsx)("pre",{className:"font-mono text-xs bg-surface p-3 rounded-md border border-border-subtle",children:(0,r.jsx)("code",{children:e})})}),(0,r.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,r.jsx)(Fs,{icon:o?vn:xr,"aria-label":"Copy code",variant:"ghost",size:"sm",onClick:d})})]})}function Mh({filters:e,values:i,onChange:a,className:o}){const l=Bi(),[d,m]=(0,n.useState)(!1),h=(v,y)=>{a({...i,[v]:y})},p=Object.values(i).filter(v=>v!==void 0&&v!=="").length;if(l){const v=e.find(w=>w.type==="search"),y=e.some(w=>w.type!=="search");return(0,r.jsxs)("div",{className:K("flex items-center gap-2",o),children:[v&&(0,r.jsx)(ja,{placeholder:v.placeholder??"Search...",value:i[v.key]??"",onChange:w=>h(v.key,w.target.value),leftSlot:(0,r.jsx)(Li,{className:"h-3 w-3 text-foreground-subtle"}),className:"flex-1"}),y&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{onClick:()=>m(!0),className:"flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5 text-xs text-foreground-muted hover:bg-surface-hover transition-colors shrink-0",children:[(0,r.jsx)(yv,{className:"h-3.5 w-3.5"}),"Filters",p>0&&(0,r.jsx)(Ar,{variant:"info",className:"ml-1 text-[10px] px-1 py-0",children:p})]}),(0,r.jsx)(Hs,{open:d,onClose:()=>m(!1),title:"Filters",children:(0,r.jsx)("div",{className:"flex flex-col gap-3",children:e.filter(w=>w.type!=="search").map(w=>{switch(w.type){case"select":return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs text-foreground-muted mb-1 block",children:w.label}),(0,r.jsx)(Ui,{options:w.options,value:i[w.key]??"",onChange:N=>h(w.key,N.target.value),className:"w-full"})]},w.key);case"badge-toggle":return(0,r.jsx)("div",{className:"flex items-center gap-1 flex-wrap",children:w.options.map(N=>{const O=i[w.key]===N.value;return(0,r.jsx)("button",{type:"button",onClick:()=>h(w.key,O?void 0:N.value),children:(0,r.jsx)(Ar,{variant:O?"info":"default",className:"cursor-pointer",children:N.label})},N.value)})},w.key);default:return null}})})})]})]})}return(0,r.jsx)("div",{className:K("flex items-center gap-2 flex-wrap",o),children:e.map(v=>{switch(v.type){case"search":return(0,r.jsx)(ja,{placeholder:v.placeholder??"Search...",value:i[v.key]??"",onChange:y=>h(v.key,y.target.value),leftSlot:(0,r.jsx)(Li,{className:"h-3 w-3 text-foreground-subtle"}),className:"w-48"},v.key);case"select":return(0,r.jsx)(Ui,{options:v.options,value:i[v.key]??"",onChange:y=>h(v.key,y.target.value),className:"w-36"},v.key);case"badge-toggle":return(0,r.jsx)("div",{className:"flex items-center gap-1",children:v.options.map(y=>{const w=i[v.key]===y.value;return(0,r.jsx)("button",{type:"button",onClick:()=>h(v.key,w?void 0:y.value),children:(0,r.jsx)(Ar,{variant:w?"info":"default",className:"cursor-pointer",children:y.label})},y.value)})},v.key);default:return null}})})}function rc({label:e,icon:i,href:a,badge:o,active:l=!1,className:d}){return(0,r.jsxs)("a",{href:a,className:K("flex items-center gap-2 h-7 px-2 text-[11px] transition-colors",l?"border-l-2 border-primary bg-primary/[0.08] text-foreground rounded-r-md":"text-foreground-subtle hover:bg-surface-hover rounded-md",d),children:[(0,r.jsx)(i,{className:"h-3.5 w-3.5 shrink-0"}),(0,r.jsx)("span",{className:"truncate flex-1",children:e}),o!==void 0&&(0,r.jsx)(Ar,{className:"ml-auto text-[10px] px-1.5 py-0",children:o})]})}function nc({logo:e,sections:i,footer:a,onNavigate:o,className:l}){return(0,r.jsxs)("nav",{className:K("bg-surface border-r border-border h-full flex flex-col",l),children:[e&&(0,r.jsx)("div",{className:"px-3 py-2 shrink-0",children:e}),(0,r.jsx)("div",{className:"flex-1 overflow-auto px-1 py-1",children:i.map((d,m)=>(0,r.jsxs)("div",{className:K(m>0?"mt-3":""),children:[d.label&&(0,r.jsx)("span",{className:"text-[10px] text-foreground-disabled uppercase tracking-wider px-2 mb-1 block",children:d.label}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",onClick:o,children:d.items.map(h=>(0,r.jsx)(rc,{...h},h.href))})]},m))}),a&&a.length>0&&(0,r.jsxs)("div",{className:"shrink-0 px-1 pb-1",children:[(0,r.jsx)(Qs,{className:"mb-1"}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",onClick:o,children:a.map(d=>(0,r.jsx)(rc,{...d},d.href))})]})]})}function Dh({sidebar:e,header:i,mobileLogo:a,mobileActions:o,children:l,className:d}){const m=Bi(),[h,p]=(0,n.useState)(!1);return(0,r.jsxs)("div",{className:K("flex h-screen",d),children:[!m&&(0,r.jsx)(nc,{...e,className:K("w-44",e.className)}),m&&(0,r.jsx)(Mu,{open:h,onClose:()=>p(!1),width:"w-64",children:(0,r.jsx)(nc,{...e,onNavigate:()=>p(!1),className:"w-full border-r-0"})}),(0,r.jsxs)("div",{className:"flex flex-1 flex-col min-w-0",children:[m&&(0,r.jsxs)("header",{className:"flex items-center h-12 border-b border-border px-3 shrink-0 bg-surface/80 backdrop-blur-sm",children:[(0,r.jsx)("button",{onClick:()=>p(!0),className:"p-1.5 -ml-1.5 rounded-md hover:bg-surface-hover text-foreground-muted transition-colors","aria-label":"Open menu",children:(0,r.jsx)(ov,{className:"h-5 w-5"})}),a&&(0,r.jsx)("div",{className:"flex-1 flex justify-center",children:a}),o&&(0,r.jsx)("div",{className:"shrink-0",children:o})]}),!m&&i&&(0,r.jsxs)("header",{className:"flex items-center h-10 border-b border-border px-4 shrink-0",children:[i.breadcrumbs&&i.breadcrumbs.length>0&&(0,r.jsx)("nav",{className:"flex items-center gap-1 text-xs flex-1 min-w-0",children:i.breadcrumbs.map((v,y)=>{const w=y===i.breadcrumbs.length-1;return(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[y>0&&(0,r.jsx)(Dr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}),v.href&&!w?(0,r.jsx)("a",{href:v.href,className:"text-foreground-subtle hover:text-foreground transition-colors truncate",children:v.label}):(0,r.jsx)("span",{className:"text-foreground truncate",children:v.label})]},y)})}),i.actions&&(0,r.jsx)("div",{className:"flex items-center gap-2 ml-auto shrink-0",children:i.actions})]}),(0,r.jsx)("main",{className:"flex-1 overflow-auto p-4",children:l})]})]})}var Ah={online:"bg-success",offline:"bg-danger",warning:"bg-warning",unknown:"bg-foreground-subtle"};function zh({title:e,subtitle:i,status:a,selected:o,onClick:l,badges:d,actions:m,offlineAction:h,className:p}){const v=a==="offline";return(0,r.jsxs)("div",{onClick:l,className:K("w-full rounded-lg border p-3 text-left transition-colors",l&&"cursor-pointer",o?"border-primary bg-primary/10":"border-border bg-surface hover:bg-surface-hover",v&&!o&&"opacity-50",p),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("span",{className:"text-sm font-medium truncate",children:e}),a&&(0,r.jsx)("span",{className:K("h-2 w-2 rounded-full shrink-0",Ah[a])})]}),i&&(0,r.jsx)("div",{className:"text-[11px] text-foreground-muted",children:i}),d&&d.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:d.map((y,w)=>{const N=K("rounded px-1.5 py-0.5 text-[10px] flex items-center gap-0.5",o?"bg-primary/20":"bg-surface-hover",y.onClick&&"hover:opacity-80 transition-opacity cursor-pointer");return y.onClick?(0,r.jsxs)("button",{onClick:O=>{O.stopPropagation(),y.onClick()},className:N,children:[y.icon,y.label]},w):(0,r.jsxs)("span",{className:N,children:[y.icon,y.label]},w)})}),!v&&m&&m.length>0&&(0,r.jsx)("div",{className:"flex items-center gap-0.5 mt-2 -mb-1",children:m.map((y,w)=>(0,r.jsx)("button",{onClick:N=>{N.stopPropagation(),y.onClick()},className:"p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",title:y.label,"aria-label":y.label,children:y.icon},w))}),v&&h&&(0,r.jsx)("div",{className:"mt-2",onClick:y=>y.stopPropagation(),children:h})]})}function Th({children:e,minCardWidth:i=220,gap:a=3,className:o}){return(0,r.jsx)("div",{className:K("p-4 overflow-y-auto flex-1 content-start",o),style:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${i}px, 1fr))`,gap:`${a*4}px`},children:e})}var Rh="capability.binding-changed";function Gi(e,i){const[a,o]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(i===null){o(null);return}let l=!1;const d=async()=>{try{const h=await e.deviceManager.getBindings.query({deviceId:i});l||o(h)}catch{l||o(h=>h)}};d();const m=e.live?.onEvent.subscribe({category:Rh},{onData:h=>{const p=h.data?.source;if(!p){d();return}p.type==="device"&&p.id===i&&d()}});return()=>{l=!0,m?.unsubscribe()}},[e,i]),(0,n.useMemo)(()=>a?(0,Q.createDeviceProxy)(e,a):null,[e,a])}function ic(e){const i=(0,n.useCallback)(o=>e?e.subscribe(()=>o()):()=>{},[e]),a=(0,n.useCallback)(()=>e?.value,[e]);return(0,n.useSyncExternalStore)(i,a,a)}function Qu(e,i,a){const o=Gi(e,i);return ic(o?a(o.state):void 0)}function yn(e){const i=Gi(e.trpc,e.deviceId),a=ic(i!==null?e.slice(i):void 0),o=i!==null?e.cap(i):void 0;return{dev:i,cap:o,slice:a,available:(e.requireFeature===void 0||(e.deviceFeatures??[]).includes(e.requireFeature))&&o!==void 0&&a!==void 0}}function Zh(e){return e.parentDeviceId===null?"top-level":e.role?"accessory":"adopted"}var Lh={minimal:{showIntegrationIcon:!1,showParentBadge:!1,showSnapshot:!1,showBattery:!1,showStableId:!1,showId:!1,showSwitchToggle:!0,showChildrenAccordion:!1},compact:{showIntegrationIcon:!0,showParentBadge:!0,showSnapshot:!0,showBattery:!0,showStableId:!1,showId:!1,showSwitchToggle:!0,showChildrenAccordion:!0},expanded:{showIntegrationIcon:!1,showParentBadge:!0,showSnapshot:!0,showBattery:!0,showStableId:!0,showId:!0,showSwitchToggle:!0,showChildrenAccordion:!0}};function Uh(e){const i=Lh[e.variant??"compact"];return{showIntegrationIcon:e.showIntegrationIcon??i.showIntegrationIcon,showParentBadge:e.showParentBadge??i.showParentBadge,showSnapshot:e.showSnapshot??i.showSnapshot,showBattery:e.showBattery??i.showBattery,showStableId:e.showStableId??i.showStableId,showId:e.showId??i.showId,showSwitchToggle:e.showSwitchToggle??i.showSwitchToggle,showChildrenAccordion:e.showChildrenAccordion??i.showChildrenAccordion}}var Bh={siren:wa,floodlight:Fl,spotlight:Yl,"pir-sensor":ql,chime:sv,autotrack:Rl,nightvision:Zs,"privacy-mask":Rs,doorbell:Zl},Fh={camera:As,hub:Ls,nvr:Ls,light:Fl,siren:wa,switch:Sv,sensor:ql,thermostat:wv,button:Wp,generic:Bs};function Wu(e){return e.role?Bh[e.role]??Bs:Fh[e.type.toLowerCase()]??As}var qu={"native-snapshot":tv,"two-way-audio":Vl,"pan-tilt-zoom":Rl,"ptz-autotrack":av,"doorbell-button":Zl,"motion-trigger":Mr,"battery-operated":zl,rebootable:Jl},Hu={"native-snapshot":"Native snapshot","two-way-audio":"Two-way audio","pan-tilt-zoom":"Pan-Tilt-Zoom","ptz-autotrack":"PTZ autotrack","doorbell-button":"Doorbell button","motion-trigger":"Motion trigger","battery-operated":"Battery operated",rebootable:"Rebootable"},Gh={"native-snapshot":"snapshot",rebootable:"reboot","pan-tilt-zoom":"ptz","ptz-autotrack":"ptz-autotrack","two-way-audio":"intercom","motion-trigger":"motion-trigger"},Ju=new Set(["camera","hub","nvr"]);function Ku(e){return!Ju.has(e.type.toLowerCase())}function Xu(e){return e.role?!0:!Ju.has(e.type.toLowerCase())}function Yu(e){return(e.features??[]).includes("motion-trigger")}function Vh(e){if(e.length<=24)return e;const i=e.lastIndexOf(":");if(i>=0&&i<e.length-4)return e.slice(i+1);const a=e.split("-");if(a.length>2){const o=a.slice(-2).join("-");if(o.length>=6)return o}return`…${e.slice(-18)}`}function Qh({trpc:e,accessoryChildren:i,adoptedChildren:a,onNavigate:o}){return(0,r.jsxs)("div",{className:"border-t border-border-subtle/50",children:[a.length>0&&(0,r.jsx)(ed,{trpc:e,label:"Adopted devices",rows:a,onNavigate:o}),i.length>0&&(0,r.jsx)(ed,{trpc:e,label:"Accessories",rows:i,onNavigate:o})]})}function ed({trpc:e,label:i,rows:a,onNavigate:o}){return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"px-3 pt-1.5 pb-1 text-[9px] font-semibold uppercase tracking-wide text-foreground-subtle",children:i}),(0,r.jsx)("ul",{children:a.map(l=>(0,r.jsx)(Wh,{trpc:e,child:l,onNavigate:o},l.id))})]})}function Wh({trpc:e,child:i,onNavigate:a}){const o=!i.disabled,l=o&&Ku(i),d=o&&Yu(i);return(0,r.jsx)("li",{children:(0,r.jsxs)("div",{onClick:m=>{m.stopPropagation(),a(i.id)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-left hover:bg-surface-hover transition-colors cursor-pointer",children:[(0,r.jsx)(Wu(i),{className:"h-3 w-3 text-foreground-subtle flex-shrink-0"}),(0,r.jsx)("span",{className:"text-[10.5px] text-foreground flex-1 truncate",children:i.name}),d&&(0,r.jsx)(Hh,{trpc:e,deviceId:i.id,features:i.features}),l&&(0,r.jsx)(qh,{trpc:e,deviceId:i.id}),(0,r.jsx)("span",{className:K("h-1.5 w-1.5 rounded-full flex-shrink-0",i.online?"bg-success":"bg-foreground-subtle/40"),title:i.online?"Online":"Offline"})]})})}function qh({trpc:e,deviceId:i}){const{dev:a,cap:o,slice:l,available:d}=yn({trpc:e,deviceId:i,cap:w=>w.switch,slice:w=>w.state.switch}),[m,h]=(0,n.useState)(!1);if(a!==null&&!o)return null;const p=l?.on===!0,v={transform:p?"translateX(14px)":"translateX(2px)"},y=async w=>{if(w.stopPropagation(),!(m||!d||!o)){h(!0);try{await o.setState({on:!p})}finally{h(!1)}}};return(0,r.jsx)("button",{type:"button",onClick:w=>{y(w)},disabled:m||!d,className:K("relative inline-flex h-4 w-7 items-center rounded-full border transition-colors flex-shrink-0",p?"bg-success/30 border-success/50":"bg-surface-hover border-border",m&&"opacity-60",!d&&"opacity-40 cursor-not-allowed"),title:d?p?"Turn off":"Turn on":"Awaiting state…","aria-pressed":p,children:(0,r.jsx)("span",{className:K("absolute h-3 w-3 rounded-full transition-all",p?"bg-success":"bg-foreground-subtle"),style:v})})}function Hh({trpc:e,deviceId:i,features:a}){const{dev:o,cap:l,slice:d,available:m}=yn({trpc:e,deviceId:i,cap:w=>w.motionTrigger,slice:w=>w.state.motionTrigger,requireFeature:"motion-trigger",deviceFeatures:a}),[h,p]=(0,n.useState)(!1);if(o!==null&&!l)return null;const v=d?.enabled===!0,y=async w=>{if(w.stopPropagation(),!(h||!m||!l)){p(!0);try{await l.setMotionTrigger({enabled:!v})}finally{p(!1)}}};return(0,r.jsx)("button",{type:"button",onClick:w=>{y(w)},disabled:h||!m,className:K("inline-flex h-4 w-4 items-center justify-center rounded transition-colors flex-shrink-0",v?"text-primary bg-primary/10":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",(h||!m)&&"opacity-50"),title:m?v?"Motion-trigger: on (click to disable)":"Motion-trigger: off (click to enable)":"Awaiting state…","aria-pressed":v,children:(0,r.jsx)(Mr,{className:"h-2.5 w-2.5"})})}function td({trpc:e,device:i,flags:a}){if(i.disabled)return null;const o=i.type.toLowerCase(),l=a.showSwitchToggle&&Ku(i),d=Yu(i),m=o==="hub"||o==="nvr",h=(i.features??[]).includes("rebootable"),p=m&&h;return(0,r.jsxs)(r.Fragment,{children:[d&&(0,r.jsx)(Kh,{trpc:e,deviceId:i.id,features:i.features}),l&&(0,r.jsx)(Jh,{trpc:e,deviceId:i.id}),p&&(0,r.jsx)(Yh,{trpc:e,deviceId:i.id})]})}function Jh({trpc:e,deviceId:i}){const{dev:a,cap:o,slice:l,available:d}=yn({trpc:e,deviceId:i,cap:w=>w.switch,slice:w=>w.state.switch}),[m,h]=(0,n.useState)(!1);if(a!==null&&!o)return null;const p=l?.on===!0,v={transform:p?"translateX(14px)":"translateX(2px)"},y=async w=>{if(w.stopPropagation(),!(m||!d||!o)){h(!0);try{await o.setState({on:!p})}finally{h(!1)}}};return(0,r.jsx)("button",{type:"button",onClick:w=>{y(w)},disabled:m||!d,className:K("relative inline-flex h-4 w-7 items-center rounded-full border transition-colors flex-shrink-0",p?"bg-success/30 border-success/50":"bg-surface-hover border-border",m&&"opacity-60",!d&&"opacity-40 cursor-not-allowed"),title:d?p?"Turn off":"Turn on":"Awaiting state…","aria-pressed":p,children:(0,r.jsx)("span",{className:K("absolute h-3 w-3 rounded-full transition-all",p?"bg-success":"bg-foreground-subtle"),style:v})})}function Kh({trpc:e,deviceId:i,features:a}){const{dev:o,cap:l,slice:d,available:m}=yn({trpc:e,deviceId:i,cap:w=>w.motionTrigger,slice:w=>w.state.motionTrigger,requireFeature:"motion-trigger",deviceFeatures:a}),[h,p]=(0,n.useState)(!1);if(o!==null&&!l)return null;const v=d?.enabled===!0,y=async w=>{if(w.stopPropagation(),!(h||!m||!l)){p(!0);try{await l.setMotionTrigger({enabled:!v})}finally{p(!1)}}};return(0,r.jsx)("button",{type:"button",onClick:w=>{y(w)},disabled:h||!m,className:K("inline-flex h-4 w-4 items-center justify-center rounded transition-colors flex-shrink-0",v?"text-primary bg-primary/10":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",(h||!m)&&"opacity-50"),title:m?v?"Motion-trigger: on (click to disable)":"Motion-trigger: off (click to enable)":"Awaiting state…","aria-pressed":v,children:(0,r.jsx)(Mr,{className:"h-2.5 w-2.5"})})}var ac=168,Xh=4;function Yh({trpc:e,deviceId:i}){const{dev:a,cap:o}=yn({trpc:e,deviceId:i,cap:R=>R.reboot,slice:()=>{}}),l=(0,n.useRef)(null),d=(0,n.useRef)(null),[m,h]=(0,n.useState)(null),[p,v]=(0,n.useState)(!1),y=a!==null&&o!==void 0&&o!==null,w=m!==null,N=()=>h(null),O=()=>{const R=l.current;if(!R)return;const Z=R.getBoundingClientRect(),G=Z.right-ac,V=Math.max(8,Math.min(G,window.innerWidth-ac-8));h({top:Z.bottom+Xh,left:V})};if((0,n.useEffect)(()=>{if(!w)return;const R=G=>{const V=l.current,re=d.current,te=G.target;te!==null&&(V&&V.contains(te)||re&&re.contains(te)||N())},Z=G=>{G.key==="Escape"&&(G.stopPropagation(),N())};return document.addEventListener("mousedown",R),document.addEventListener("keydown",Z),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",Z)}},[w]),a!==null&&!o)return null;const E=R=>{R.stopPropagation(),w?N():O()},A=async()=>{if(!(p||!y||!o)){v(!0),N();try{await o.reboot({})}finally{v(!1)}}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{ref:l,type:"button",onClick:E,disabled:p||!y,className:K("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors flex-shrink-0",(p||!y)&&"opacity-50",w&&"bg-surface-hover text-foreground"),title:"More actions","aria-label":"More actions","aria-haspopup":"menu","aria-expanded":w,children:(0,r.jsx)(Ll,{className:"h-3 w-3"})}),m&&(0,_.createPortal)((0,r.jsx)("div",{ref:d,role:"menu",style:{position:"fixed",top:m.top,left:m.left,width:ac},className:"z-[9999] rounded-md border border-border bg-surface shadow-lg shadow-black/30 p-1",onClick:R=>R.stopPropagation(),children:(0,r.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>{A()},disabled:p||!y,className:K("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[11px] text-foreground","hover:bg-surface-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed"),children:[(0,r.jsx)(Jl,{className:"h-3 w-3 shrink-0 text-foreground-subtle"}),(0,r.jsx)("span",{children:"Reboot device"})]})}),document.body)]})}var eb=Object.freeze([]);function tb(e){return e==="native"?"native":"enhanced"}function rb(e){return e.map(i=>({kind:"marker",feature:i}))}function nb(e,i){const a=new Map,o=i.entries??[];for(const d of o)a.set(d.capName,d);const l=[];for(const d of e){const m=Gh[d];if(m===void 0){l.push({kind:"marker",feature:d});continue}const h=a.get(m);h&&l.push({kind:tb(h.kind),feature:d,capName:m})}return l}function ib(e,i,a){const[o,l]=(0,n.useState)(null),[d,m]=(0,n.useState)(!1),[h,p]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{if(i===null){l(null),m(!1),p(!1);return}let v=!1;p(!0),m(!1);const y=async()=>{try{const N=await e.deviceManager.getBindings.query({deviceId:i});if(v)return;l(N),p(!1)}catch{if(v)return;m(!0),p(!1)}};y();const w=e.live?.onEvent.subscribe({category:"capability.binding-changed"},{onData:N=>{const O=N.data?.source;if(!O){y();return}O.type==="device"&&O.id===i&&y()}});return()=>{v=!0,w?.unsubscribe()}},[e,i]),a.length===0?{loading:h,resolved:eb}:h||d||!o?{loading:h,resolved:rb(a)}:{loading:!1,resolved:nb(a,o)}}var ab=[];function rd({trpc:e,device:i,flags:a,accessoryCount:o,adoptedCount:l,showFeatureRow:d=!1}){const m=o+l,h=a.showChildrenAccordion&&m>0,p=i.features??ab,v=d&&p.length>0,{resolved:y}=ib(e,v?i.id:null,p),w=v&&y.length>0;return!h&&!w?null:(0,r.jsxs)("div",{className:"flex items-center gap-1.5 flex-nowrap whitespace-nowrap min-w-0",children:[h&&(0,r.jsx)(ob,{accessoryCount:o,adoptedCount:l}),w&&(0,r.jsx)(sb,{resolved:y})]})}function ob({accessoryCount:e,adoptedCount:i}){const a=e+i;return a===0?null:(0,r.jsxs)("span",{className:"text-[9px] font-medium text-foreground-subtle bg-surface-elevated/60 rounded px-1.5 py-0.5 flex-shrink-0",title:i>0&&e>0?`${String(i)} adopted · ${String(e)} accessor${e===1?"y":"ies"}`:i>0?`${String(i)} adopted`:`${String(e)} accessor${e===1?"y":"ies"}`,children:["+",a]})}var nd=240,id=200;function sb({resolved:e}){const i=(0,n.useRef)(null),[a,o]=(0,n.useState)(null),l=()=>{const m=i.current;if(!m)return;const h=m.getBoundingClientRect();o({top:window.innerHeight-h.bottom>=id?h.bottom+4:h.top-id-4,left:Math.max(8,Math.min(h.left,window.innerWidth-nd-8))})},d=()=>o(null);return(0,r.jsxs)("span",{ref:i,className:"relative inline-flex items-center gap-1 cursor-help",onMouseEnter:l,onMouseLeave:d,children:[e.map(m=>{const h=qu[m.feature];return h?(0,r.jsx)("span",{className:"inline-flex items-center justify-center h-4 w-4 rounded bg-surface-elevated/60 text-foreground-subtle",title:Hu[m.feature]??m.feature,children:(0,r.jsx)(h,{className:"h-2.5 w-2.5"})},m.feature):null}),a&&(0,_.createPortal)((0,r.jsx)(cb,{resolved:e,position:a}),document.body)]})}function cb({resolved:e,position:i}){return(0,r.jsxs)("div",{style:{position:"fixed",top:i.top,left:i.left,width:nd,pointerEvents:"none"},className:"z-[9999] rounded-md border border-border bg-surface shadow-lg shadow-black/30 p-2",children:[(0,r.jsx)("h5",{className:"text-[9px] font-semibold uppercase tracking-wider text-foreground-subtle mb-1.5",children:"Features"}),(0,r.jsx)("ul",{className:"space-y-0.5",children:e.map(a=>(0,r.jsx)(lb,{entry:a},a.feature))})]})}function lb({entry:e}){const i=qu[e.feature],a=Hu[e.feature]??e.feature;return(0,r.jsxs)("li",{className:"flex items-center justify-between gap-2 text-[10px]",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1.5 text-foreground",children:[i&&(0,r.jsx)(i,{className:"h-3 w-3 text-foreground-subtle"}),(0,r.jsx)("span",{children:a})]}),(0,r.jsx)(ub,{kind:e.kind})]})}function ub({kind:e}){return e==="marker"?(0,r.jsx)("span",{className:"text-[8.5px] px-1 rounded text-foreground-subtle",title:"Informational marker (no cap registered)",children:"marker"}):(0,r.jsx)("span",{className:K("text-[8.5px] px-1 rounded",e==="native"?"bg-success/15 text-success":"bg-primary/15 text-primary"),children:e})}function ad({device:e,variant:i,flags:a,parent:o,integrationIcon:l,hasChildren:d,expanded:m,onToggleExpand:h,onNavigateToParent:p}){const v=Wu(e);return(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[a.showChildrenAccordion&&d?(0,r.jsx)("button",{type:"button",onClick:y=>{y.stopPropagation(),h()},className:"flex h-3.5 w-3.5 items-center justify-center text-foreground-subtle hover:text-foreground transition-colors flex-shrink-0","aria-label":m?"Collapse children":"Expand children","aria-expanded":m,children:m?(0,r.jsx)(Qr,{className:"h-3 w-3"}):(0,r.jsx)(Dr,{className:"h-3 w-3"})}):a.showChildrenAccordion?(0,r.jsx)("span",{className:"h-3.5 w-3.5 flex-shrink-0"}):null,(0,r.jsx)(v,{className:K("text-foreground-subtle flex-shrink-0",i==="minimal"?"h-3 w-3":"h-3.5 w-3.5")}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.showIntegrationIcon&&l&&(0,r.jsx)("span",{className:"flex-shrink-0",children:l}),(0,r.jsx)("span",{className:K("font-semibold text-foreground truncate",i==="minimal"?"text-[10.5px]":"text-[11px]"),title:e.name,children:e.name})]}),(a.showId||a.showStableId)&&(0,r.jsxs)("div",{className:"mt-0.5 flex items-center gap-1 text-[9px] text-foreground-subtle font-mono truncate",title:a.showStableId?`stableId: ${e.stableId}`:void 0,children:[a.showId&&(0,r.jsxs)("span",{className:"flex-shrink-0 tabular-nums",children:["#",String(e.id)]}),a.showId&&a.showStableId&&(0,r.jsx)("span",{className:"flex-shrink-0 opacity-50",children:"·"}),a.showStableId&&(0,r.jsx)("span",{className:"truncate",children:Vh(e.stableId)})]}),a.showParentBadge&&o&&(0,r.jsxs)("button",{type:"button",onClick:y=>{y.stopPropagation(),p(o.id)},className:"mt-0.5 inline-flex max-w-full items-center gap-1 text-[9px] text-foreground-subtle hover:text-primary transition-colors",title:`Open parent: ${o.name} (#${String(o.id)})`,children:[(0,r.jsx)(Ls,{className:"h-2.5 w-2.5 shrink-0"}),(0,r.jsxs)("span",{className:"truncate",children:["Under: ",o.name]})]})]})]})}function od(e,i){return Qu(e,i,a=>a.battery)??null}function sd(e,i){const a=Gi(e,i),o=(0,n.useRef)(!1),{data:l,isLoading:d,isFetching:m,refetch:h}=(0,ee.useQuery)({queryKey:["device",i,"snapshot"],queryFn:()=>{if(!a)throw new Error("useDeviceSnapshotImage: device proxy not ready");const y=o.current;return o.current=!1,a.snapshot?.getSnapshot({force:y})??null},enabled:a!==null&&i!==null,staleTime:1e4,gcTime:1440*60*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1}),p=l?`data:${l.contentType};base64,${l.base64}`:null;function v(){o.current=!0,h()}return{src:p,loading:d||m,refresh:v}}function db(e){return e<=10?Lp:e<=30?Zp:e>=95?Rp:zl}function fb(e,i){return i!=="none"?"text-emerald-400":e<=10?"text-rose-400":e<=30?"text-amber-400":"text-foreground-subtle"}function cd({status:e,variant:i="compact",className:a}){if(!e)return null;const o=db(e.percentage),l=fb(e.percentage,e.charging),d=e.charging==="solar"?Yl:e.charging==="dc"?lv:null,m=e.sleeping;return(0,r.jsxs)("span",{className:K("inline-flex items-center gap-1 text-[10px] font-medium",l,a),title:`Battery: ${Math.round(e.percentage)}%`+(e.charging!=="none"?` · charging (${e.charging})`:"")+(e.sleeping?" · sleeping":""),children:[(0,r.jsx)(o,{className:"h-3.5 w-3.5"}),(0,r.jsxs)("span",{children:[Math.round(e.percentage),"%"]}),d&&(0,r.jsx)(d,{className:"h-3 w-3"}),m&&(0,r.jsx)(Zs,{className:"h-3 w-3 text-blue-300"}),i==="full"&&e.charging!=="none"&&(0,r.jsx)("span",{className:"text-foreground-subtle",children:e.charging})]})}function ld({trpc:e,device:i,status:a,enabled:o,showStatusPills:l=!1}){const d=sd(e,o&&i.online?i.id:null),m=(i.features??[]).includes("battery-operated"),h=l&&m&&!i.disabled,p=od(e,h?i.id:null);return!o&&!h?null:(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 flex-nowrap whitespace-nowrap",children:[h&&p&&(0,r.jsx)(cd,{status:p}),o&&(0,r.jsx)(mb,{deviceName:i.name,snapshotUrl:d.src,status:a})]})}var oc=288,ud=196,sc=8;function mb({deviceName:e,snapshotUrl:i,status:a}){const o=(0,n.useRef)(null),[l,d]=(0,n.useState)(null),m=a==="offline"||a==="disabled",h=()=>{const v=o.current;if(!v)return;const y=v.getBoundingClientRect(),w=y.top,N=window.innerHeight-y.bottom,O=w<ud+sc&&N>w,E=O?y.bottom+sc:y.top-ud-sc,A=y.right-oc;d({top:E,left:Math.max(8,Math.min(A,window.innerWidth-oc-8)),placeBelow:O})},p=()=>d(null);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{ref:o,type:"button",onClick:v=>v.stopPropagation(),onMouseEnter:h,onMouseLeave:p,onFocus:h,onBlur:p,className:"flex h-6 w-6 items-center justify-center rounded text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors flex-shrink-0",title:"Preview","aria-label":"Preview snapshot",children:(0,r.jsx)(hn,{className:"h-3.5 w-3.5"})}),l&&(0,_.createPortal)((0,r.jsxs)("div",{style:{position:"fixed",top:l.top,left:l.left,width:oc,pointerEvents:"none"},className:"rounded-lg border border-border bg-surface shadow-lg shadow-black/30 z-[9999] overflow-hidden",children:[(0,r.jsx)("div",{className:"h-40 bg-background flex items-center justify-center",children:i&&!m?(0,r.jsx)("img",{src:i,alt:e,className:"h-full w-full object-cover"}):(0,r.jsx)("span",{className:"text-xs text-foreground-subtle",children:a==="offline"?"Offline — no snapshot":a==="disabled"?"Disabled":"No snapshot yet"})}),(0,r.jsx)("div",{className:"px-3 py-2",children:(0,r.jsx)("p",{className:"text-xs font-semibold text-foreground truncate",children:e})})]}),document.body)]})}function dd({status:e}){const i=e==="disabled"?"bg-warning":e==="online"?"bg-success":"bg-danger",a=e==="disabled"?"Disabled":e==="online"?"Online":"Offline";return(0,r.jsx)("span",{className:K("h-1.5 w-1.5 rounded-full flex-shrink-0",i),title:a})}function Oa(e){const{trpc:i,device:a,parent:o,integrationIcon:l,onNavigate:d,className:m}=e,h=Uh(e),p=e.variant??"compact",v=e.view??"card",y=!a.disabled,w=a.isCamera??a.type.toLowerCase()==="camera",N=e.children??[],O=N.filter(Xu),E=N.filter(ye=>!Xu(ye)),A=N.length>0,[R,Z]=(0,n.useState)(!1),G=e.expanded??R,V=e.onToggleExpand??(()=>Z(ye=>!ye)),re=ye=>{d?.(ye)},te=e.indentLevel??(e.isAccessoryRow?2:0),ce=y?a.online?"online":"offline":"disabled";return v==="table"?(0,r.jsx)(pb,{trpc:i,device:a,variant:p,flags:h,parent:o??null,integrationIcon:l??null,accessoryCount:O.length,adoptedCount:E.length,hasChildren:A,expanded:G,onToggleExpand:V,onNavigate:re,displayStatus:ce,isCamera:w,showSnapshot:h.showSnapshot&&w,isAccessoryRow:e.isAccessoryRow??!1,indentLevel:te,className:m}):(0,r.jsxs)("div",{className:K("rounded-lg border border-border bg-surface transition-colors",!y&&"opacity-60",m),children:[(0,r.jsxs)("div",{onClick:()=>re(a.id),className:K("flex items-center gap-2 cursor-pointer hover:border-foreground-subtle/30 w-full",p==="minimal"?"px-2.5 py-1.5":"px-3 py-2.5"),children:[(0,r.jsx)(ad,{device:a,variant:p,flags:h,parent:o??null,integrationIcon:l??null,hasChildren:A,expanded:G,onToggleExpand:V,onNavigateToParent:re}),(0,r.jsx)(rd,{trpc:i,device:a,flags:h,accessoryCount:O.length,adoptedCount:E.length,showFeatureRow:!1}),(0,r.jsx)(ld,{trpc:i,device:a,status:ce,enabled:h.showSnapshot&&w,showStatusPills:!0}),(0,r.jsx)(td,{trpc:i,device:a,flags:h}),(0,r.jsx)(dd,{status:ce})]}),G&&A&&(0,r.jsx)(Qh,{trpc:i,accessoryChildren:O,adoptedChildren:E,onNavigate:re})]})}var gb={0:"pl-2",1:"pl-6",2:"pl-8"};function pb(e){const{trpc:i,device:a,variant:o,flags:l,parent:d,integrationIcon:m,accessoryCount:h,adoptedCount:p,hasChildren:v,expanded:y,onToggleExpand:w,onNavigate:N,displayStatus:O,isCamera:E,showSnapshot:A,isAccessoryRow:R,indentLevel:Z,className:G}=e;return(0,r.jsxs)("tr",{onClick:()=>N(a.id),className:K("cursor-pointer hover:bg-surface-hover transition-colors",!l.showChildrenAccordion&&"border-b border-border-subtle/40",R&&"bg-foreground-subtle/[0.03]",G),children:[(0,r.jsx)("td",{className:K("py-2 align-middle pr-2",gb[Z]),children:(0,r.jsx)(ad,{device:a,variant:o,flags:l,parent:d,integrationIcon:m,hasChildren:v,expanded:y,onToggleExpand:w,onNavigateToParent:N})}),(0,r.jsx)("td",{className:"px-2 py-2 align-middle text-[10px] text-foreground-subtle whitespace-nowrap",children:a.type}),(0,r.jsx)("td",{className:"px-2 py-2 align-middle",children:(0,r.jsx)(rd,{trpc:i,device:a,flags:l,accessoryCount:h,adoptedCount:p,showFeatureRow:!0})}),(0,r.jsx)("td",{className:"px-2 py-2 align-middle",children:(0,r.jsx)(ld,{trpc:i,device:a,status:O,enabled:A&&E,showStatusPills:!0})}),(0,r.jsx)("td",{className:"px-2 py-2 align-middle text-right whitespace-nowrap",children:(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)(td,{trpc:i,device:a,flags:l}),(0,r.jsx)(dd,{status:O})]})})]})}function fd(e,i){const[a,o]=(0,n.useState)(e);return(0,n.useEffect)(()=>{const l=setTimeout(()=>o(e),i);return()=>clearTimeout(l)},[e,i]),a}var vb=new Set(["hub","nvr"]);function hb(e){const i=new Map;for(const l of e)i.set(l.id,l);const a=[],o=new Map;for(const l of e){const d=l.parentDeviceId;if(d==null){a.push(l);continue}const m=i.get(d);if(!m){a.push(l);continue}const h=l.role!==null&&l.role!==void 0;if(vb.has(m.type)&&!h){a.push(l);continue}const p=o.get(d);p?p.push(l):o.set(d,[l])}return{topLevel:a,accessoriesByParent:o}}var md=2;function bb(e,i){if(i<=1)return[{kind:"page",n:1}];if(i<=7){const d=[];for(let m=1;m<=i;m++)d.push({kind:"page",n:m});return d}const a=[],o=Math.max(2,e-md),l=Math.min(i-1,e+md);a.push({kind:"page",n:1}),o>2&&a.push({kind:"ellipsis",side:"left"});for(let d=o;d<=l;d++)a.push({kind:"page",n:d});return l<i-1&&a.push({kind:"ellipsis",side:"right"}),a.push({kind:"page",n:i}),a}function yb({currentPage:e,totalItems:i,pageSize:a,onPageChange:o,itemNoun:l="devices"}){if(i<=a)return null;const d=Math.ceil(i/a),m=(e-1)*a+1,h=Math.min(e*a,i),p=bb(e,d);return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4 flex-wrap pt-2 text-[11px] text-foreground-subtle",children:[(0,r.jsxs)("span",{children:["Showing ",m,"–",h," of ",i," ",l]}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,r.jsx)("button",{type:"button","aria-label":"Previous page",disabled:e===1,onClick:()=>o(e-1),className:K("inline-flex items-center justify-center h-7 w-7 rounded border border-border bg-surface text-foreground-subtle","hover:text-foreground hover:bg-surface-hover transition-colors","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-surface"),children:(0,r.jsx)(Gp,{className:"h-3 w-3"})}),p.map((v,y)=>v.kind==="ellipsis"?(0,r.jsx)("span",{className:"px-1 text-foreground-subtle/60 select-none",children:"…"},`e-${y}`):(0,r.jsx)("button",{type:"button",onClick:()=>o(v.n),className:K("inline-flex items-center justify-center h-7 min-w-7 px-1.5 rounded border text-[10.5px] font-medium transition-colors",v.n===e?"border-primary/40 bg-primary/10 text-primary":"border-border bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover"),children:v.n},`p-${v.n}`)),(0,r.jsx)("button",{type:"button","aria-label":"Next page",disabled:e===d,onClick:()=>o(e+1),className:K("inline-flex items-center justify-center h-7 w-7 rounded border border-border bg-surface text-foreground-subtle","hover:text-foreground hover:bg-surface-hover transition-colors","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-surface"),children:(0,r.jsx)(Dr,{className:"h-3 w-3"})})]})]})}function _b({view:e,onViewChange:i,types:a,currentType:o,onTypeChange:l,addons:d,currentAddon:m,onAddonChange:h,hideAddons:p=!1}){return(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsxs)("span",{className:"inline-flex border border-border rounded-md overflow-hidden",children:[(0,r.jsx)("button",{type:"button",onClick:()=>i("cards"),className:K("inline-flex items-center justify-center h-7 w-8 transition-colors",e==="cards"?"bg-primary/10 text-primary":"bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover"),"aria-label":"Cards view",children:(0,r.jsx)(iv,{className:"h-3.5 w-3.5"})}),(0,r.jsx)("button",{type:"button",onClick:()=>i("table"),className:K("inline-flex items-center justify-center h-7 w-8 border-l border-border transition-colors",e==="table"?"bg-primary/10 text-primary":"bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover"),"aria-label":"Table view",children:(0,r.jsx)(xv,{className:"h-3.5 w-3.5"})})]}),a&&a.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(gd,{children:"Type"}),(0,r.jsx)(cc,{active:o===null,onClick:()=>l(null),children:"All"}),a.map(v=>(0,r.jsx)(cc,{active:o===v,onClick:()=>l(o===v?null:v),children:xb(v)},v))]}),!p&&d&&d.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(gd,{children:"Integration"}),d.map(v=>(0,r.jsx)(cc,{active:m===v.id,icon:v.icon,onClick:()=>h(m===v.id?null:v.id),showClearIcon:m===v.id,children:v.name},v.id))]})]})}function gd({children:e}){return(0,r.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wider text-foreground-subtle ml-1",children:e})}function cc({active:e,icon:i,onClick:a,showClearIcon:o,children:l}){return(0,r.jsxs)("button",{type:"button",onClick:a,className:K("inline-flex items-center gap-1.5 h-7 px-2.5 rounded-full border text-[10.5px] font-medium transition-colors",e?"border-primary/40 bg-primary/15 text-primary":"border-border bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover"),children:[i&&(0,r.jsx)("span",{className:"inline-flex items-center",children:i}),(0,r.jsx)("span",{children:l}),e&&o&&(0,r.jsx)(Mt,{className:"h-2.5 w-2.5 opacity-70"})]})}function xb(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function wb({variant:e,onClearFilters:i}){return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)(rv,{className:"h-8 w-8 text-foreground-subtle/40 mb-3"}),(0,r.jsx)("p",{className:"text-sm font-medium text-foreground-subtle",children:e==="filtered"?"No devices match the current filters":"No devices yet"}),e==="filtered"&&i&&(0,r.jsx)("button",{type:"button",onClick:i,className:"mt-2 text-[11px] text-primary hover:underline",children:"Clear filters"})]})}function mr(e,i){if(e==="root")return i;switch(i){case"view":return"deviceView";case"page":return"devicePage";case"type":return"deviceType";case"q":return"deviceQ";case"addon":return"deviceAddon"}}function pd(e){try{const i=localStorage.getItem(`camstack:${e}:lastFilters`);if(!i)return{};const a=JSON.parse(i);return typeof a!="object"||a===null?{}:a}catch{return{}}}function Sb(e,i){try{localStorage.setItem(`camstack:${e}:lastFilters`,JSON.stringify(i))}catch{}}function vd(e,i,a){const o=new URLSearchParams(window.location.search),l=o.get(mr(e,"view")),d=l==="cards"||l==="table"?l:a.view??i,m=o.get(mr(e,"page")),h=m?parseInt(m,10):1;return{view:d,page:Number.isFinite(h)&&h>=1?h:1,addon:o.get(mr(e,"addon"))??a.addon??null,type:o.get(mr(e,"type"))??a.type??null,q:o.get(mr(e,"q"))??a.q??""}}function jb(e,i,a){const o=new URLSearchParams(window.location.search),l=(h,p)=>{p===null||p===""?o.delete(h):o.set(h,p)};l(mr(e,"view"),i.view===a?null:i.view),l(mr(e,"page"),i.page===1?null:String(i.page)),l(mr(e,"addon"),i.addon),l(mr(e,"type"),i.type),l(mr(e,"q"),i.q||null);const d=o.toString(),m=d?`${window.location.pathname}?${d}`:window.location.pathname;window.history.replaceState(null,"",m)}function $b(e){const{scope:i,defaultView:a,lsKey:o}=e,[l,d]=(0,n.useState)(()=>vd(i,a,pd(o))),m=(0,n.useRef)(l);m.current=l,(0,n.useEffect)(()=>{const p=()=>{const v=vd(i,a,pd(o));m.current=v,d(v)};return window.addEventListener("popstate",p),()=>window.removeEventListener("popstate",p)},[i,a,o]);const h=(0,n.useCallback)(p=>{const v=p(m.current);m.current=v,d(v),jb(i,v,a),Sb(o,{view:v.view,addon:v.addon,type:v.type,q:v.q})},[i,a,o]);return{state:l,setView:(0,n.useCallback)(p=>h(v=>({...v,view:p})),[h]),setPage:(0,n.useCallback)(p=>h(v=>({...v,page:p})),[h]),setAddon:(0,n.useCallback)(p=>h(v=>({...v,addon:p,page:1})),[h]),setType:(0,n.useCallback)(p=>h(v=>({...v,type:p,page:1})),[h]),setQ:(0,n.useCallback)(p=>h(v=>({...v,q:p,page:1})),[h]),clearFilters:(0,n.useCallback)(()=>h(p=>({...p,addon:null,type:null,q:"",page:1})),[h])}}var kb={cards:24,table:50};function Pb(e){const{devices:i,trpc:a,defaultView:o="table",filters:l,forceAddon:d,resolveIntegrationIcon:m,resolveParent:h,onNavigate:p,pageSize:v=kb,urlScope:y="root",lsKey:w=y==="root"?"devices":"integrations:nested"}=e,N=$b({scope:y,defaultView:o,lsKey:w}),O=N.state.view,E=O==="cards"?v.cards:v.table,[A,R]=(0,n.useState)(N.state.q),Z=fd(A,300);(0,n.useEffect)(()=>{Z!==N.state.q&&N.setQ(Z)},[Z]);const G=d??N.state.addon,V=(0,n.useMemo)(()=>{const He=N.state.q.toLowerCase().trim();return i.filter(Je=>!(G&&Je.addonId!==G||N.state.type&&Je.type!==N.state.type||He&&!Je.name.toLowerCase().includes(He)&&!Je.stableId.toLowerCase().includes(He)))},[i,G,N.state.type,N.state.q]),re=(0,n.useMemo)(()=>hb(V),[V]),te=(0,n.useMemo)(()=>{if(N.state.q.trim()==="")return new Set;const He=N.state.q.toLowerCase().trim(),Je=new Set;for(const[Xe,Ge]of re.accessoriesByParent.entries())Ge.some(Ae=>Ae.name.toLowerCase().includes(He)||Ae.stableId.toLowerCase().includes(He))&&Je.add(Xe);return Je},[re.accessoriesByParent,N.state.q]),ce=re.topLevel.length,ye=Math.max(1,Math.ceil(ce/E)),ue=Math.min(N.state.page,ye),Ee=(ue-1)*E,Re=re.topLevel.slice(Ee,Ee+E);(0,n.useEffect)(()=>{ue!==N.state.page&&N.setPage(ue)},[ue]),Mb();const et=G!=null||N.state.type!==null||N.state.q!=="",dt=ce===0;return(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[(0,r.jsx)(_b,{view:O,onViewChange:N.setView,types:l?.types,currentType:N.state.type,onTypeChange:N.setType,addons:l?.addons,currentAddon:N.state.addon,onAddonChange:N.setAddon,hideAddons:d!==void 0}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(Li,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-foreground-subtle pointer-events-none"}),(0,r.jsx)("input",{type:"text",value:A,onChange:He=>R(He.target.value),placeholder:"Search by name or stableId","aria-label":"Search devices by name or stableId",className:"h-7 pl-7 pr-2.5 rounded-md border border-border bg-surface text-[11px] text-foreground placeholder:text-foreground-subtle/60 focus:outline-none focus:ring-1 focus:ring-primary/40 w-56"})]})]}),dt?(0,r.jsx)(wb,{variant:et?"filtered":"nofilter",onClearFilters:et?N.clearFilters:void 0}):O==="cards"?(0,r.jsx)(Nb,{rows:Re,accessoriesByParent:re.accessoriesByParent,trpc:a,resolveIntegrationIcon:m??null,resolveParent:h??null,onNavigate:p??null}):(0,r.jsx)(Ib,{rows:Re,accessoriesByParent:re.accessoriesByParent,autoExpandedParents:te,devices:V,trpc:a,resolveIntegrationIcon:m??null,resolveParent:h??null,onNavigate:p??null}),(0,r.jsx)(yb,{currentPage:ue,totalItems:ce,pageSize:E,onPageChange:N.setPage}),d===void 0&&et&&ce>0&&(0,r.jsxs)("p",{className:"text-[11px] text-foreground-subtle",children:["Showing ",ce," of ",i.length," devices",G&&(0,r.jsxs)(r.Fragment,{children:[" ","· filtered by"," ",(0,r.jsx)("strong",{className:"text-primary",children:l?.addons?.find(He=>He.id===G)?.name??G})]})]})]})}function Nb({rows:e,accessoriesByParent:i,trpc:a,resolveIntegrationIcon:o,resolveParent:l,onNavigate:d}){return(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.map(m=>{const h=i.get(m.id)??[];return(0,r.jsx)(Oa,{trpc:a,device:m,view:"card",integrationIcon:o?.(m.addonId)??null,parent:m.parentDeviceId!==null?l?.(m.parentDeviceId)??null:null,children:h,onNavigate:d??void 0},m.id)})})}var Ob=new Set(["hub","nvr"]);function Cb(e,i){return e.parentDeviceId===null||i===null?0:Ob.has(i.toLowerCase())?1:0}function Ib({rows:e,accessoriesByParent:i,autoExpandedParents:a,devices:o,trpc:l,resolveIntegrationIcon:d,resolveParent:m,onNavigate:h}){const p=(0,n.useMemo)(()=>{const v=new Map;for(const y of o)v.set(y.id,y.type);return v},[o]);return(0,r.jsx)("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:(0,r.jsxs)("table",{className:"w-full border-collapse",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"border-b border-border",children:[(0,r.jsx)("th",{className:"text-left px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle",children:"Name"}),(0,r.jsx)("th",{className:"text-left px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle w-24",children:"Type"}),(0,r.jsx)("th",{className:"text-left px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle w-32",children:"Features"}),(0,r.jsx)("th",{className:"text-left px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle w-20",children:"Preview"}),(0,r.jsx)("th",{className:"text-right px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle w-32",children:"Actions"})]})}),(0,r.jsx)("tbody",{children:e.map(v=>{const y=i.get(v.id)??[],w=y.length>0,N=a.has(v.id),O=v.parentDeviceId!==null?m?.(v.parentDeviceId)??null:null,E=v.parentDeviceId!==null?p.get(v.parentDeviceId)??null:null;return(0,r.jsx)(Eb,{parent:v,accessories:y,hasAccessories:w,forceExpanded:N,trpc:l,integrationIcon:d?.(v.addonId)??null,parentRowParent:O,indentLevel:Cb(v,E),onNavigate:h??null},v.id)})})]})})}function Eb({parent:e,accessories:i,hasAccessories:a,forceExpanded:o,trpc:l,integrationIcon:d,parentRowParent:m,indentLevel:h,onNavigate:p}){const[v,y]=(0,n.useState)(o),w=(0,n.useRef)(o);(0,n.useEffect)(()=>{w.current!==o&&(y(o),w.current=o)},[o]);const N=()=>y(O=>!O);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Oa,{trpc:l,device:e,view:"table",integrationIcon:d,parent:m,children:i,onNavigate:p??void 0,showChildrenAccordion:a,expanded:v,onToggleExpand:N,indentLevel:h}),a&&v&&i.map(O=>(0,r.jsx)(Oa,{trpc:l,device:O,view:"table",integrationIcon:null,parent:null,isAccessoryRow:!0,showChildrenAccordion:!1,onNavigate:p??void 0},O.id))]})}function Mb(){(0,ee.useQueryClient)()}function Db({options:e,value:i,onChange:a}){return(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(o=>{const l=o.id===i;return(0,r.jsxs)("button",{onClick:()=>o.available&&a(o.id),disabled:!o.available,className:`flex items-center gap-2 rounded-lg border px-3 py-2 text-xs font-medium transition-all ${l?"border-primary/40 bg-primary/10 text-primary":o.available?"border-border bg-surface text-foreground-subtle hover:bg-surface-hover hover:text-foreground":"border-border/40 bg-surface/40 text-foreground-subtle/40 cursor-not-allowed"}`,children:[(0,r.jsx)(Xp,{className:"h-3.5 w-3.5 shrink-0"}),o.label,o.isBest&&(0,r.jsxs)("span",{className:"inline-flex items-center gap-0.5 rounded-full bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-amber-400",children:[(0,r.jsx)(_v,{className:"h-2.5 w-2.5"}),"Best"]}),o.platformScore!=null&&(0,r.jsxs)("span",{className:"text-[10px] text-foreground-subtle/60",children:["(",o.platformScore,")"]}),(0,r.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${o.available?"bg-success":"bg-danger"}`})]},o.id)})})}function Ab(e,i){const a=new Set(i.slots.flatMap(m=>m.addons.map(h=>h.id))),o=[];function l(m){if(!a.has(m.addonId))return o.push(`Addon "${m.addonId}" is no longer available — step removed`),null;const h=i.slots.flatMap(y=>y.addons).find(y=>y.id===m.addonId);let p=m.modelId;if(h&&!h.models.some(y=>y.id===p)){const y=h.defaultModelId;o.push(`Model "${p}" not available for ${m.addonId} — using "${y}"`),p=y}const v=m.children.map(y=>l(y)).filter(y=>y!==null);return{...m,modelId:p,children:v}}const d=e.map(m=>l(m)).filter(m=>m!==null);return{valid:o.length===0,steps:d,warnings:o}}function zb(e){const i=new Map;for(const a of e.slots)for(const o of a.addons)i.set(o.id,o);return i}function lc(e){return{addonId:e.id,addonName:e.name,slot:e.slot,inputClasses:[...e.inputClasses],outputClasses:[...e.outputClasses],enabled:!0,modelId:e.defaultModelId,children:[]}}function uc({addon:e,onClick:i}){return(0,r.jsx)("button",{type:"button",onClick:i,className:"w-full rounded-lg border border-dashed border-border/60 px-3 py-2.5 text-left transition-all hover:border-primary/30 hover:bg-surface/60 group",children:(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(Hp,{className:"h-[18px] w-[18px] text-foreground-subtle/30 group-hover:text-primary/60 shrink-0"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-[13px] font-medium text-foreground-subtle/50 group-hover:text-foreground-subtle block truncate",children:e.name}),(0,r.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[e.inputClasses.map(a=>(0,r.jsx)("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-blue-500/8 text-blue-400/50",children:a},a)),e.inputClasses.length>0&&e.outputClasses.length>0&&(0,r.jsx)("span",{className:"text-foreground-subtle/25 text-[10px]",children:"→"}),e.outputClasses.map(a=>(0,r.jsx)("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-green-500/8 text-green-400/50",children:a},a))]})]})]})})}function Tb({schema:e,steps:i,onChange:a,templates:o,selectedTemplateId:l,onSelectTemplate:d,onSaveTemplate:m,onUpdateTemplate:h,onDeleteTemplate:p,readOnly:v=!1,excludeAddons:y=[],hideTemplates:w=!1,showOnlyEnabled:N=!1,showSlotLabels:O=!1,toggleMode:E="simple",overrides:A={},onOverrideChange:R,inheritedEnabledByAddon:Z={},hideModelAndSettings:G=!1}){const V=Oe=>({toggleMode:E,hideModelAndSettings:G,...E==="threeState"?{overrideState:A[Oe]!==void 0?A[Oe]:null,onOverrideChange:R?Pe=>R(Oe,Pe):void 0,inheritedEnabled:Z[Oe]}:{}}),re=(0,n.useMemo)(()=>new Set(y),[y]),te=(0,n.useMemo)(()=>zb(e),[e]),[ce,ye]=(0,n.useState)([]),ue=l?JSON.stringify(i)!==JSON.stringify(o.find(Oe=>Oe.id===l)?.steps):!1;function Ee(Oe){const Pe=Oe.target.value||null;if(Pe){const Ke=o.find(ze=>ze.id===Pe);Ke&&ye([...Ab(Ke.steps,e).warnings])}else ye([]);d(Pe)}function Re(){l&&h(l,i)}function et(){const Oe=window.prompt("Template name:");Oe?.trim()&&m(Oe.trim(),i)}function dt(){if(!l)return;const Oe=o.find(Pe=>Pe.id===l);Oe&&window.confirm(`Delete template "${Oe.name}"?`)&&p(l)}function He(Oe){a(i.map(Pe=>Pe.addonId!==Oe.addonId?Pe:Je(Oe)))}function Je(Oe){const Pe=Oe.children.some(Ke=>Ke.enabled||Ke.children.some(ze=>ze.enabled));return{...Oe,enabled:Oe.enabled||Pe,children:Oe.children.map(Ke=>{const ze=Ke.children.some(Le=>Le.enabled);return{...Ke,enabled:Ke.enabled||ze}})}}function Xe(Oe,Pe){const Ke=lc(Pe);a(i.map(ze=>ze.addonId!==Oe?ze:{...ze,children:[...ze.children,Ke]}))}function Ge(Oe){const Pe=new Set;for(const Ke of Oe){Pe.add(Ke.addonId);for(const Le of Ke.children)Pe.add(Le.addonId);const ze=Ge(Ke.children);for(const Le of ze)Pe.add(Le)}return Pe}const Ae=Ge(i);function pt(Oe){const Pe=te.get(Oe.addonId);if(!Pe)return[];const Ke=e.slots.find(De=>De.id===Pe.slot)?.parentSlot==null,ze=Pe.childSlots,Le=new Set(Oe.children.map(De=>De.addonId)),Ue=[];for(const De of e.slots)if(ze.includes(De.id))for(const qe of De.addons){if(Le.has(qe.id)||re.has(qe.id))continue;const Be=qe.inputClasses.length===0;Be&&!Ke||(Be||qe.inputClasses.some(Rt=>Oe.outputClasses.includes(Rt)))&&Ue.push(qe)}return Ue}function ct(Oe){const Pe=N?{...Oe,children:Oe.children.filter(ze=>ze.enabled).map(ze=>({...ze,children:ze.children.filter(Le=>Le.enabled)}))}:Oe,Ke=N?[]:pt(Pe);return(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)($a,{step:Pe,schema:te.get(Pe.addonId)??null,allSchemas:te,onChange:He,onDelete:v?void 0:ze=>a(i.filter(Le=>Le.addonId!==ze)),readOnly:v,...V(Pe.addonId)}),(Pe.children.length>0||Ke.length>0)&&(0,r.jsxs)("div",{className:"ml-4 pl-3 border-l border-border/60 space-y-1.5",children:[O&&(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/40",children:"Slot: Cropper / Classifier"}),Pe.children.map(ze=>{const Le=pt(ze);return(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)($a,{step:ze,schema:te.get(ze.addonId)??null,allSchemas:te,depth:1,onChange:Ue=>{He({...Pe,children:Pe.children.map(De=>De.addonId===Ue.addonId?Ue:De)})},onDelete:v?void 0:Ue=>{He({...Pe,children:Pe.children.filter(De=>De.addonId!==Ue)})},readOnly:v,...V(ze.addonId)}),(ze.children.length>0||Le.length>0)&&(0,r.jsxs)("div",{className:"ml-4 pl-3 border-l border-border/40 space-y-1.5",children:[O&&(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/30",children:"Slot: Recognizer"}),ze.children.map(Ue=>(0,r.jsx)($a,{step:Ue,schema:te.get(Ue.addonId)??null,allSchemas:te,depth:2,onChange:De=>{He({...Pe,children:Pe.children.map(qe=>qe.addonId===ze.addonId?{...qe,children:qe.children.map(Be=>Be.addonId===De.addonId?De:Be)}:qe)})},onDelete:v?void 0:De=>{He({...Pe,children:Pe.children.map(qe=>qe.addonId===ze.addonId?{...qe,children:qe.children.filter(Be=>Be.addonId!==De)}:qe)})},readOnly:v,...V(Ue.addonId)},Ue.addonId)),!v&&Le.map(Ue=>(0,r.jsx)(uc,{addon:Ue,onClick:()=>{const De=lc(Ue);He({...Pe,children:Pe.children.map(qe=>qe.addonId===ze.addonId?{...qe,children:[...qe.children,De]}:qe)})}},Ue.id))]})]},ze.addonId)}),!v&&Ke.map(ze=>(0,r.jsx)(uc,{addon:ze,onClick:()=>Xe(Pe.addonId,ze)},ze.id))]})]},Pe.addonId)}const we=e.slots.filter(Oe=>Oe.parentSlot===null).sort((Oe,Pe)=>Oe.priority-Pe.priority);return(0,r.jsxs)("div",{className:"space-y-4",children:[!w&&(0,r.jsx)("div",{className:"rounded-lg border border-border bg-surface p-3",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"relative flex-1 min-w-0",children:(0,r.jsxs)("select",{value:l??"",onChange:Ee,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:border-primary/50",children:[(0,r.jsx)("option",{value:"",children:"No template"}),o.map(Oe=>(0,r.jsx)("option",{value:Oe.id,children:Oe.name},Oe.id))]})}),ue&&(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500 shrink-0"}),(0,r.jsx)("button",{onClick:Re,disabled:!l||v,title:"Save",className:K("p-2 rounded-lg border border-border transition-colors",l&&!v?"text-foreground-subtle hover:bg-surface-hover":"text-foreground-subtle/30 cursor-not-allowed"),children:(0,r.jsx)(mv,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:et,disabled:v,title:"Save As",className:K("p-2 rounded-lg border border-border transition-colors",v?"text-foreground-subtle/30 cursor-not-allowed":"text-foreground-subtle hover:bg-surface-hover"),children:(0,r.jsx)(Kp,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:dt,disabled:!l||v,title:"Delete",className:K("p-2 rounded-lg border border-border transition-colors",l&&!v?"text-foreground-subtle hover:text-danger":"text-foreground-subtle/30 cursor-not-allowed"),children:(0,r.jsx)(fr,{className:"h-4 w-4"})})]})}),ce.length>0&&(0,r.jsxs)("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-3 text-xs text-amber-400 space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"font-medium",children:"Template loaded with warnings:"}),(0,r.jsx)("button",{onClick:()=>ye([]),className:"text-amber-400/60 hover:text-amber-400",children:(0,r.jsx)(Mt,{className:"h-3.5 w-3.5"})})]}),ce.map((Oe,Pe)=>(0,r.jsxs)("div",{children:["• ",Oe]},Pe))]}),we.map(Oe=>{const Pe=i.filter(De=>De.slot===Oe.id&&!re.has(De.addonId)),Ke=N?Pe.filter(De=>De.enabled):Pe,ze=N?[]:Oe.addons.filter(De=>!Ae.has(De.id)&&!re.has(De.id)),Le=new Map,Ue=[];for(const De of Ke)De.group?(Le.has(De.group)||Le.set(De.group,[]),Le.get(De.group).push(De)):Ue.push(De);return(0,r.jsxs)("div",{className:"space-y-2",children:[O&&(0,r.jsxs)("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/50",children:["Slot: ",Oe.label]}),Ue.map(De=>ct(De)),[...Le.entries()].map(([De,qe])=>(0,r.jsxs)("div",{className:"space-y-2 rounded-lg border border-border/40 p-2",children:[(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/50 px-1",children:De}),qe.map(Be=>ct(Be))]},De)),!v&&ze.map(De=>(0,r.jsx)(uc,{addon:De,onClick:()=>{a([...i,lc(De)])}},De.id))]},Oe.id)})]})}var Vi={person:"#3b82f6",vehicle:"#f59e0b",animal:"#22c55e",face:"#a855f7",plate:"#ec4899",bird:"#14b8a6",dog:"#84cc16",cat:"#f97316",car:"#f59e0b",truck:"#d97706",bus:"#b45309",motorcycle:"#eab308",bicycle:"#ca8a04",motion:"#facc15"},hd=["#ef4444","#8b5cf6","#06b6d4","#f97316","#10b981","#6366f1","#e11d48","#0891b2","#7c3aed","#059669"],Rb="#f59e42";function Qt(e,i){if(i?.[e])return i[e];if(i?.[e.toLowerCase()])return i[e.toLowerCase()];if(Vi[e])return Vi[e];if(Vi[e.toLowerCase()])return Vi[e.toLowerCase()];let a=0;for(let o=0;o<e.length;o++)a=a*31+(e.codePointAt(o)??0)>>>0;return hd[a%hd.length]??"#f59e42"}function Zb({src:e,imageWidth:i,imageHeight:a,detections:o=[],classColors:l,aspectRatio:d,className:m,placeholder:h,showConfidence:p=!0,minConfidence:v=0,borderWidth:y=2}){function w(Z){return Qt(Z,l)}const N=d??(i&&a?`${i}/${a}`:"16/9"),O=o.filter(Z=>Z.score>=v),E=O.filter(Z=>Z.kind==="first-level"),A=O.filter(Z=>Z.kind==="detail"),R=Bb(A,Z=>Z.parentId??"");return(0,r.jsx)("div",{className:K("rounded-lg border border-border bg-surface overflow-hidden relative",m),style:{aspectRatio:N},children:e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:e,className:"absolute inset-0 w-full h-full object-fill",alt:""}),O.map((Z,G)=>Z.debug?.mask&&Z.debug.maskWidth&&Z.debug.maskHeight?(0,r.jsx)(Lb,{mask:Z.debug.mask,maskWidth:Z.debug.maskWidth,maskHeight:Z.debug.maskHeight,bbox:Z.bbox,imageWidth:i,imageHeight:a,color:w(Z.macroClass)},`mask-${G}`):null),E.map(Z=>{const G=R.get(Z.id)??[];return(0,r.jsx)(bd,{detection:Z,imageWidth:i,imageHeight:a,color:w(Z.macroClass),showConfidence:p,borderWidth:Z.debug?.mask?1:y,children:G.map(V=>(0,r.jsx)(Ub,{child:V,parentBbox:Z.bbox,color:w(V.macroClass),showConfidence:p},`child-${V.id}`))},`det-${Z.id}`)}),A.filter(Z=>!Z.parentId||!E.some(G=>G.id===Z.parentId)).map(Z=>(0,r.jsx)(bd,{detection:Z,imageWidth:i,imageHeight:a,color:w(Z.macroClass),showConfidence:p,borderWidth:y},`orphan-${Z.id}`))]}):(0,r.jsx)("div",{className:"w-full h-full flex items-center justify-center text-foreground-subtle text-sm",children:h??"No image loaded"})})}function bd({detection:e,imageWidth:i,imageHeight:a,color:o,showConfidence:l,borderWidth:d,children:m}){const{x:h,y:p,width:v,height:y}=e.bbox,w=(0,r.jsxs)("div",{className:"absolute left-0 flex flex-col items-start gap-px",style:{bottom:"100%",marginBottom:"2px"},children:[(0,r.jsxs)("span",{className:"text-[10px] px-1 rounded-sm whitespace-nowrap text-white",style:{backgroundColor:o},children:[e.macroClass,l&&` ${(e.score*100).toFixed(0)}%`]}),e.labels.map((N,O)=>(0,r.jsxs)("span",{className:"text-[9px] font-semibold px-1 rounded-sm whitespace-nowrap text-white",style:{backgroundColor:Qt(N.label)},children:[N.label," ",(N.score*100).toFixed(0),"%"]},`${e.id}-lbl-${O}`))]});return(0,r.jsxs)("div",{className:"absolute rounded-sm",style:{left:`${h/i*100}%`,top:`${p/a*100}%`,width:`${v/i*100}%`,height:`${y/a*100}%`,borderWidth:`${d}px`,borderStyle:"solid",borderColor:o},children:[w,m]})}function Lb({mask:e,maskWidth:i,maskHeight:a,bbox:o,imageWidth:l,imageHeight:d,color:m}){const h=(0,n.useRef)(null);return(0,n.useEffect)(()=>{const p=h.current;if(!p)return;const v=p.getContext("2d");if(!v)return;const y=atob(e),w=new Uint8Array(y.length);for(let Z=0;Z<y.length;Z++)w[Z]=y.charCodeAt(Z);const N=parseInt(m.slice(1,3),16),O=parseInt(m.slice(3,5),16),E=parseInt(m.slice(5,7),16);p.width=i,p.height=a;const A=v.createImageData(i,a),R=i*a;for(let Z=0;Z<R;Z++){const G=Z<w.length?w[Z]:0,V=Z*4;G>0&&(A.data[V]=N,A.data[V+1]=O,A.data[V+2]=E,A.data[V+3]=120)}v.putImageData(A,0,0)},[e,i,a,m]),(0,r.jsx)("canvas",{ref:h,className:"absolute pointer-events-none",style:{left:`${o.x/l*100}%`,top:`${o.y/d*100}%`,width:`${o.width/l*100}%`,height:`${o.height/d*100}%`,imageRendering:"pixelated"}})}function Ub({child:e,parentBbox:i,color:a,showConfidence:o}){if(i.width<=0||i.height<=0)return null;const l=(e.bbox.x-i.x)/i.width*100,d=(e.bbox.y-i.y)/i.height*100,m=e.bbox.width/i.width*100,h=e.bbox.height/i.height*100;return(0,r.jsx)("div",{className:"absolute rounded-sm",style:{left:`${Math.max(0,l)}%`,top:`${Math.max(0,d)}%`,width:`${Math.min(100,m)}%`,height:`${Math.min(100,h)}%`,borderWidth:"1px",borderStyle:"solid",borderColor:a},children:(0,r.jsxs)("div",{className:"absolute left-0 flex flex-col items-start gap-px",style:{bottom:"100%",marginBottom:"1px"},children:[(0,r.jsxs)("span",{className:"text-[9px] px-0.5 rounded-sm whitespace-nowrap text-white",style:{backgroundColor:a},children:[e.macroClass,o&&` ${(e.score*100).toFixed(0)}%`]}),e.labels.map((p,v)=>(0,r.jsxs)("span",{className:"text-[8px] font-semibold px-0.5 rounded-sm whitespace-nowrap text-white",style:{backgroundColor:Qt(p.label)},children:[p.label," ",(p.score*100).toFixed(0),"%"]},`${e.id}-lbl-${v}`))]})})}function Bb(e,i){const a=new Map;for(const o of e){const l=i(o),d=a.get(l)??[];d.push(o),a.set(l,d)}return a}function Fb({detections:e,classColors:i,className:a,hiddenKeys:o,onToggleVisibility:l}){const d=i;if(e.length===0)return(0,r.jsx)("div",{className:"text-sm text-foreground-subtle italic text-center py-4",children:"No detections"});const m=e.filter(y=>y.kind==="first-level"),h=e.filter(y=>y.kind==="detail"),p=new Map;for(const y of h){if(!y.parentId)continue;const w=p.get(y.parentId)??[];w.push(y),p.set(y.parentId,w)}const v=h.filter(y=>!y.parentId||!m.some(w=>w.id===y.parentId));return(0,r.jsxs)("div",{className:a,children:[(0,r.jsxs)("div",{className:"text-xs font-medium text-foreground-subtle uppercase tracking-wide mb-2",children:["Detections (",e.length,")"]}),(0,r.jsxs)("div",{className:"space-y-2",children:[m.map(y=>(0,r.jsx)(yd,{detection:y,children_:p.get(y.id)??[],colors:d,hiddenKeys:o,onToggleVisibility:l},y.id)),v.map(y=>(0,r.jsx)(yd,{detection:y,children_:[],colors:d,hiddenKeys:o,onToggleVisibility:l},y.id))]})]})}function yd({detection:e,children_:i,colors:a,hiddenKeys:o,onToggleVisibility:l}){const d=Qt(e.macroClass,a),m=!o?.has(e.id),h=e.debug?.mask,p=e.debug?.maskWidth,v=e.debug?.maskHeight,y=e.debug?.alternateLabels;return(0,r.jsxs)("div",{className:`rounded-md border border-border bg-surface p-3 space-y-1 ${m?"":"opacity-40"}`,children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[l&&(0,r.jsx)("input",{type:"checkbox",checked:m,onChange:()=>l(e.id,!m),className:"h-3.5 w-3.5 rounded border-border accent-primary cursor-pointer shrink-0"}),(0,r.jsx)("span",{className:"h-2.5 w-2.5 rounded-full shrink-0",style:{backgroundColor:d}}),(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.macroClass}),e.kind==="detail"&&(0,r.jsx)("span",{className:"text-[9px] font-mono px-1 py-0.5 rounded bg-primary/10 text-primary",children:"detail"}),h&&p&&v&&(0,r.jsxs)("span",{className:"text-[9px] font-mono px-1 py-0.5 rounded bg-primary/10 text-primary",children:["mask ",p,"x",v]})]}),(0,r.jsx)(Qb,{confidence:e.score})]}),(0,r.jsxs)("div",{className:"text-[10px] text-foreground-subtle font-mono",children:["bbox: [",Math.round(e.bbox.x),", ",Math.round(e.bbox.y),","," ",Math.round(e.bbox.x+e.bbox.width),","," ",Math.round(e.bbox.y+e.bbox.height),"]"]}),e.labels.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.labels.map((w,N)=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded-full",style:{backgroundColor:Qt(w.label,a)+"20",color:Qt(w.label,a)},children:[w.label,(0,r.jsxs)("span",{className:"opacity-60",children:[(w.score*100).toFixed(0),"%"]}),w.detectionId&&(0,r.jsxs)("span",{className:"opacity-40 text-[8px]",children:["→ ",w.detectionId]})]},N))}),y&&Object.keys(y).length>0&&(0,r.jsx)(Vb,{alternateLabels:y,colors:a}),i.length>0&&(0,r.jsx)(Gb,{items:i,colors:a,hiddenKeys:o,onToggleVisibility:l})]})}function Gb({items:e,colors:i,hiddenKeys:a,onToggleVisibility:o}){return(0,r.jsx)("div",{className:"ml-4 mt-1.5 space-y-1.5 border-l-2 border-border pl-3",children:e.map(l=>{const d=Qt(l.macroClass,i),m=!a?.has(l.id),h=l.debug?.mask,p=l.debug?.maskWidth,v=l.debug?.maskHeight;return(0,r.jsxs)("div",{className:`text-xs space-y-0.5 ${m?"":"opacity-40"}`,children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[o&&(0,r.jsx)("input",{type:"checkbox",checked:m,onChange:()=>o(l.id,!m),className:"h-3 w-3 rounded border-border accent-primary cursor-pointer shrink-0"}),(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full shrink-0",style:{backgroundColor:d}}),(0,r.jsx)("span",{className:"font-medium",style:{color:d},children:l.macroClass}),(0,r.jsxs)("span",{className:"text-foreground-subtle",children:[(l.score*100).toFixed(0),"%"]}),h&&p&&v&&(0,r.jsxs)("span",{className:"text-[9px] font-mono px-1 py-0.5 rounded bg-primary/10 text-primary",children:["mask ",p,"x",v]})]}),l.labels.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1 ml-5 mt-0.5",children:l.labels.map((y,w)=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-[9px] font-medium px-1 py-0.5 rounded-full",style:{backgroundColor:Qt(y.label,i)+"20",color:Qt(y.label,i)},children:[y.label," ",(0,r.jsxs)("span",{className:"opacity-60",children:[(y.score*100).toFixed(0),"%"]})]},w))})]},l.id)})})}function Vb({alternateLabels:e,colors:i}){const[a,o]=(0,n.useState)(!1),l=Object.keys(e);return(0,r.jsxs)("div",{className:"mt-1",children:[(0,r.jsxs)("button",{onClick:()=>o(d=>!d),className:"text-[9px] text-foreground-subtle hover:text-foreground transition-colors flex items-center gap-1",children:[(0,r.jsx)("span",{className:`transition-transform ${a?"rotate-90":""}`,children:"▶"}),"Alternates (",l.length," source",l.length!==1?"s":"",")"]}),a&&(0,r.jsx)("div",{className:"mt-1 ml-3 space-y-1.5",children:l.map(d=>{const m=e[d];return!m||m.length===0?null:(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[9px] font-medium text-foreground-subtle mb-0.5",children:d}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:m.map((h,p)=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-[9px] px-1 py-0.5 rounded-full",style:{backgroundColor:Qt(d,i)+"10",color:Qt(d,i),opacity:Math.max(.4,h.score)},children:[h.label,(0,r.jsxs)("span",{className:"opacity-60",children:[(h.score*100).toFixed(1),"%"]})]},p))})]},d)})})]})}function Qb({confidence:e}){return(0,r.jsxs)("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${e>=.8?"bg-success/10 text-success":e>=.5?"bg-warning/10 text-warning":"bg-danger/10 text-danger"}`,children:[(e*100).toFixed(1),"%"]})}function Wb({timings:e,totalMs:i,className:a}){const o=Object.entries(e);return o.length===0&&i===void 0?null:(0,r.jsxs)("div",{className:`rounded-lg border border-border bg-surface p-3 space-y-2 ${a??""}`,children:[(0,r.jsx)("div",{className:"text-xs font-medium text-foreground-subtle uppercase tracking-wide",children:"Timings"}),(0,r.jsxs)("div",{className:"space-y-1 text-xs",children:[o.map(([l,d])=>(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-foreground-subtle",children:l}),(0,r.jsxs)("span",{className:"font-mono text-foreground",children:[d.toFixed(1),"ms"]})]},l)),i!==void 0&&(0,r.jsxs)("div",{className:"flex justify-between pt-1 border-t border-border font-medium text-foreground",children:[(0,r.jsx)("span",{children:"Total"}),(0,r.jsxs)("span",{className:"font-mono",children:[i.toFixed(1),"ms"]})]})]})]})}function qb({images:e,selectedFilename:i,uploadedName:a,onSelect:o,onUpload:l,className:d,accept:m="image/*",uploadLabel:h="Upload..."}){const p=()=>{const v=document.createElement("input");v.type="file",v.accept=m,v.onchange=()=>{const y=v.files?.[0];if(!y)return;const w=new FileReader;w.onload=()=>{const N=w.result,O=N.split(",")[1];O&&l(O,y.name,N)},w.readAsDataURL(y)},v.click()};return(0,r.jsxs)("div",{className:`flex flex-wrap items-center gap-2 ${d??""}`,children:[e.map(v=>(0,r.jsx)("button",{onClick:()=>o(v.filename),className:`px-3 py-1.5 text-xs rounded-md border transition-colors ${i===v.filename?"bg-primary text-primary-foreground border-primary":"bg-surface border-border text-foreground hover:border-primary/50"}`,children:v.id??v.filename.replace(/\.[^.]+$/,"")},v.filename)),(0,r.jsx)("button",{onClick:p,className:"px-3 py-1.5 text-xs rounded-md border border-border bg-surface text-foreground hover:bg-surface-hover transition-colors",children:h}),a&&(0,r.jsx)("span",{className:"text-xs text-foreground-subtle",children:a})]})}var Ca="w-full px-3 py-2 text-sm rounded-md border border-border bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-primary/50";function Hb({runtime:e,backend:i,modelId:a,agentId:o="hub",runtimes:l,backends:d,models:m,agents:h=[],onRuntimeChange:p,onBackendChange:v,onModelChange:y,onAgentChange:w,layout:N="grid",className:O,showAgent:E=!1}){return(0,r.jsxs)("div",{className:`${N==="grid"?"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4":N==="horizontal"?"flex flex-wrap items-end gap-4":"space-y-3"} ${O??""}`,children:[E&&h.length>0&&(0,r.jsxs)("label",{className:"space-y-1",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-foreground-subtle",children:"Agent"}),(0,r.jsx)("select",{value:o,onChange:A=>w?.(A.target.value),className:Ca,children:h.map(A=>(0,r.jsxs)("option",{value:A.id,children:[A.name," (",A.status,")"]},A.id))})]}),(0,r.jsxs)("label",{className:"space-y-1",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-foreground-subtle",children:"Runtime"}),(0,r.jsx)("select",{value:e,onChange:A=>p(A.target.value),className:Ca,children:l.map(A=>(0,r.jsxs)("option",{value:A.value,disabled:!A.available,children:[A.label,A.available?"":" (unavailable)"]},A.value))})]}),(0,r.jsxs)("label",{className:"space-y-1",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-foreground-subtle",children:"Backend"}),(0,r.jsx)("select",{value:i,onChange:A=>v(A.target.value),className:Ca,children:d.map(A=>(0,r.jsxs)("option",{value:A.id,disabled:!A.available,children:[A.label,A.available?"":" (unavailable)"]},A.id))})]}),(0,r.jsxs)("label",{className:"space-y-1",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-foreground-subtle",children:"Model"}),(0,r.jsx)("select",{value:a,onChange:A=>y(A.target.value),className:Ca,children:m.length===0?(0,r.jsx)("option",{value:"",children:"No compatible models"}):m.map(A=>(0,r.jsxs)("option",{value:A.id,children:[A.name,A.downloaded?" ✓":""]},A.id))})]})]})}var Jb=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,i){this.keyToValue.set(e,i),this.valueToKey.set(i,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},_d=class{constructor(e){this.generateIdentifier=e,this.kv=new Jb}register(e,i){this.kv.getByValue(e)||(i||(i=this.generateIdentifier(e)),this.kv.set(i,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},Kb=class extends _d{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,i){typeof i=="object"?(i.allowProps&&this.classToAllowedProps.set(e,i.allowProps),super.register(e,i.identifier)):super.register(e,i)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function Xb(e){if("values"in Object)return Object.values(e);const i=[];for(const a in e)e.hasOwnProperty(a)&&i.push(e[a]);return i}function Yb(e,i){const a=Xb(e);if("find"in a)return a.find(i);const o=a;for(let l=0;l<o.length;l++){const d=o[l];if(i(d))return d}}function _n(e,i){Object.entries(e).forEach(([a,o])=>i(o,a))}function Ia(e,i){return e.indexOf(i)!==-1}function xd(e,i){for(let a=0;a<e.length;a++){const o=e[a];if(i(o))return o}}var ey=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return Yb(this.transfomers,i=>i.isApplicable(e))}findByName(e){return this.transfomers[e]}},ty=e=>Object.prototype.toString.call(e).slice(8,-1),wd=e=>typeof e>"u",ry=e=>e===null,Qi=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,dc=e=>Qi(e)&&Object.keys(e).length===0,zr=e=>Array.isArray(e),ny=e=>typeof e=="string",iy=e=>typeof e=="number"&&!isNaN(e),ay=e=>typeof e=="boolean",oy=e=>e instanceof RegExp,Wi=e=>e instanceof Map,qi=e=>e instanceof Set,Sd=e=>ty(e)==="Symbol",sy=e=>e instanceof Date&&!isNaN(e.valueOf()),jd=e=>e instanceof Error,$d=e=>typeof e=="number"&&isNaN(e),cy=e=>ay(e)||ry(e)||wd(e)||iy(e)||ny(e)||Sd(e),ly=e=>typeof e=="bigint",uy=e=>e===1/0||e===-1/0,dy=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),fy=e=>e instanceof URL,fc=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),mc=e=>e.map(String).map(fc).join("."),Hi=(e,i)=>{const a=[];let o="";for(let d=0;d<e.length;d++){let m=e.charAt(d);if(!i&&m==="\\"){const h=e.charAt(d+1);if(h==="\\"){o+="\\",d++;continue}else if(h!==".")throw Error("invalid path")}if(m==="\\"&&e.charAt(d+1)==="."){o+=".",d++;continue}if(m==="."){a.push(o),o="";continue}o+=m}const l=o;return a.push(l),a};function gr(e,i,a,o){return{isApplicable:e,annotation:i,transform:a,untransform:o}}var kd=[gr(wd,"undefined",()=>null,()=>{}),gr(ly,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),gr(sy,"Date",e=>e.toISOString(),e=>new Date(e)),gr(jd,"Error",(e,i)=>{const a={name:e.name,message:e.message};return"cause"in e&&(a.cause=e.cause),i.allowedErrorProps.forEach(o=>{a[o]=e[o]}),a},(e,i)=>{const a=new Error(e.message,{cause:e.cause});return a.name=e.name,a.stack=e.stack,i.allowedErrorProps.forEach(o=>{a[o]=e[o]}),a}),gr(oy,"regexp",e=>""+e,e=>{const i=e.slice(1,e.lastIndexOf("/")),a=e.slice(e.lastIndexOf("/")+1);return new RegExp(i,a)}),gr(qi,"set",e=>[...e.values()],e=>new Set(e)),gr(Wi,"map",e=>[...e.entries()],e=>new Map(e)),gr(e=>$d(e)||uy(e),"number",e=>$d(e)?"NaN":e>0?"Infinity":"-Infinity",Number),gr(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),gr(fy,"URL",e=>e.toString(),e=>new URL(e))];function Ea(e,i,a,o){return{isApplicable:e,annotation:i,transform:a,untransform:o}}var Pd=Ea((e,i)=>Sd(e)?!!i.symbolRegistry.getIdentifier(e):!1,(e,i)=>["symbol",i.symbolRegistry.getIdentifier(e)],e=>e.description,(e,i,a)=>{const o=a.symbolRegistry.getValue(i[1]);if(!o)throw new Error("Trying to deserialize unknown symbol");return o}),my=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,i)=>(e[i.name]=i,e),{}),Nd=Ea(dy,e=>["typed-array",e.constructor.name],e=>[...e],(e,i)=>{const a=my[i[1]];if(!a)throw new Error("Trying to deserialize unknown typed array");return new a(e)});function Od(e,i){return e?.constructor?!!i.classRegistry.getIdentifier(e.constructor):!1}var Cd=Ea(Od,(e,i)=>["class",i.classRegistry.getIdentifier(e.constructor)],(e,i)=>{const a=i.classRegistry.getAllowedProps(e.constructor);if(!a)return{...e};const o={};return a.forEach(l=>{o[l]=e[l]}),o},(e,i,a)=>{const o=a.classRegistry.getValue(i[1]);if(!o)throw new Error(`Trying to deserialize unknown class '${i[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(o.prototype),e)}),Id=Ea((e,i)=>!!i.customTransformerRegistry.findApplicable(e),(e,i)=>["custom",i.customTransformerRegistry.findApplicable(e).name],(e,i)=>i.customTransformerRegistry.findApplicable(e).serialize(e),(e,i,a)=>{const o=a.customTransformerRegistry.findByName(i[1]);if(!o)throw new Error("Trying to deserialize unknown custom value");return o.deserialize(e)}),gy=[Cd,Pd,Id,Nd],Ed=(e,i)=>{const a=xd(gy,l=>l.isApplicable(e,i));if(a)return{value:a.transform(e,i),type:a.annotation(e,i)};const o=xd(kd,l=>l.isApplicable(e,i));if(o)return{value:o.transform(e,i),type:o.annotation}},Md={};kd.forEach(e=>{Md[e.annotation]=e});var py=(e,i,a)=>{if(zr(i))switch(i[0]){case"symbol":return Pd.untransform(e,i,a);case"class":return Cd.untransform(e,i,a);case"custom":return Id.untransform(e,i,a);case"typed-array":return Nd.untransform(e,i,a);default:throw new Error("Unknown transformation: "+i)}else{const o=Md[i];if(!o)throw new Error("Unknown transformation: "+i);return o.untransform(e,a)}},xn=(e,i)=>{if(i>e.size)throw new Error("index out of bounds");const a=e.keys();for(;i>0;)a.next(),i--;return a.next().value};function Dd(e){if(Ia(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Ia(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Ia(e,"constructor"))throw new Error("constructor is not allowed as a property")}var vy=(e,i)=>{Dd(i);for(let a=0;a<i.length;a++){const o=i[a];if(qi(e))e=xn(e,+o);else if(Wi(e)){const l=+o,d=+i[++a]==0?"key":"value",m=xn(e,l);switch(d){case"key":e=m;break;case"value":e=e.get(m);break}}else e=e[o]}return e},gc=(e,i,a)=>{if(Dd(i),i.length===0)return a(e);let o=e;for(let d=0;d<i.length-1;d++){const m=i[d];if(zr(o)){const h=+m;o=o[h]}else if(Qi(o))o=o[m];else if(qi(o)){const h=+m;o=xn(o,h)}else if(Wi(o)){if(d===i.length-2)break;const h=+m,p=+i[++d]==0?"key":"value",v=xn(o,h);switch(p){case"key":o=v;break;case"value":o=o.get(v);break}}}const l=i[i.length-1];if(zr(o)?o[+l]=a(o[+l]):Qi(o)&&(o[l]=a(o[l])),qi(o)){const d=xn(o,+l),m=a(d);d!==m&&(o.delete(d),o.add(m))}if(Wi(o)){const d=+i[i.length-2],m=xn(o,d);switch(+l==0?"key":"value"){case"key":{const h=a(m);o.set(h,o.get(m)),h!==m&&o.delete(m);break}case"value":o.set(m,a(o.get(m)));break}}return e},Ad=e=>e<1;function pc(e,i,a,o=[]){if(!e)return;const l=Ad(a);if(!zr(e)){_n(e,(h,p)=>pc(h,i,a,[...o,...Hi(p,l)]));return}const[d,m]=e;m&&_n(m,(h,p)=>{pc(h,i,a,[...o,...Hi(p,l)])}),i(d,o)}function hy(e,i,a,o){return pc(i,(l,d)=>{e=gc(e,d,m=>py(m,l,o))},a),e}function by(e,i,a){const o=Ad(a);function l(d,m){const h=vy(e,Hi(m,o));d.map(p=>Hi(p,o)).forEach(p=>{e=gc(e,p,()=>h)})}if(zr(i)){const[d,m]=i;d.forEach(h=>{e=gc(e,Hi(h,o),()=>e)}),m&&_n(m,l)}else _n(i,l);return e}var yy=(e,i)=>Qi(e)||zr(e)||Wi(e)||qi(e)||jd(e)||Od(e,i);function _y(e,i,a){const o=a.get(e);o?o.push(i):a.set(e,[i])}function xy(e,i){const a={};let o;return e.forEach(l=>{if(l.length<=1)return;i||(l=l.map(h=>h.map(String)).sort((h,p)=>h.length-p.length));const[d,...m]=l;d.length===0?o=m.map(mc):a[mc(d)]=m.map(mc)}),o?dc(a)?[o]:[o,a]:dc(a)?void 0:a}var zd=(e,i,a,o,l=[],d=[],m=new Map)=>{const h=cy(e);if(!h){_y(e,l,i);const O=m.get(e);if(O)return o?{transformedValue:null}:O}if(!yy(e,a)){const O=Ed(e,a),E=O?{transformedValue:O.value,annotations:[O.type]}:{transformedValue:e};return h||m.set(e,E),E}if(Ia(d,e))return{transformedValue:null};const p=Ed(e,a),v=p?.value??e,y=zr(v)?[]:{},w={};_n(v,(O,E)=>{if(E==="__proto__"||E==="constructor"||E==="prototype")throw new Error(`Detected property ${E}. This is a prototype pollution risk, please remove it from your object.`);const A=zd(O,i,a,o,[...l,E],[...d,e],m);y[E]=A.transformedValue,zr(A.annotations)?w[fc(E)]=A.annotations:Qi(A.annotations)&&_n(A.annotations,(R,Z)=>{w[fc(E)+"."+Z]=R})});const N=dc(w)?{transformedValue:y,annotations:p?[p.type]:void 0}:{transformedValue:y,annotations:p?[p.type,w]:w};return h||m.set(e,N),N};function Td(e){return Object.prototype.toString.call(e).slice(8,-1)}function Rd(e){return Td(e)==="Array"}function wy(e){if(Td(e)!=="Object")return!1;const i=Object.getPrototypeOf(e);return!!i&&i.constructor===Object&&i===Object.prototype}function Sy(e,i,a,o,l){const d={}.propertyIsEnumerable.call(o,i)?"enumerable":"nonenumerable";d==="enumerable"&&(e[i]=a),l&&d==="nonenumerable"&&Object.defineProperty(e,i,{value:a,enumerable:!1,writable:!0,configurable:!0})}function vc(e,i={}){if(Rd(e))return e.map(l=>vc(l,i));if(!wy(e))return e;const a=Object.getOwnPropertyNames(e),o=Object.getOwnPropertySymbols(e);return[...a,...o].reduce((l,d)=>{if(d==="__proto__"||Rd(i.props)&&!i.props.includes(d))return l;const m=e[d];return Sy(l,d,vc(m,i),e,i.nonenumerable),l},{})}var ot=class{constructor({dedupe:e=!1}={}){this.classRegistry=new Kb,this.symbolRegistry=new _d(i=>i.description??""),this.customTransformerRegistry=new ey,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const i=new Map,a=zd(e,i,this,this.dedupe),o={json:a.transformedValue};a.annotations&&(o.meta={...o.meta,values:a.annotations});const l=xy(i,this.dedupe);return l&&(o.meta={...o.meta,referentialEqualities:l}),o.meta&&(o.meta.v=1),o}deserialize(e,i){const{json:a,meta:o}=e;let l=i?.inPlace?a:vc(a);return o?.values&&(l=hy(l,o.values,o.v??0,this)),o?.referentialEqualities&&(l=by(l,o.referentialEqualities,o.v??0)),l}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,i){this.classRegistry.register(e,i)}registerSymbol(e,i){this.symbolRegistry.register(e,i)}registerCustom(e,i){this.customTransformerRegistry.register({name:i,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};ot.defaultInstance=new ot,ot.serialize=ot.defaultInstance.serialize.bind(ot.defaultInstance),ot.deserialize=ot.defaultInstance.deserialize.bind(ot.defaultInstance),ot.stringify=ot.defaultInstance.stringify.bind(ot.defaultInstance),ot.parse=ot.defaultInstance.parse.bind(ot.defaultInstance),ot.registerClass=ot.defaultInstance.registerClass.bind(ot.defaultInstance),ot.registerSymbol=ot.defaultInstance.registerSymbol.bind(ot.defaultInstance),ot.registerCustom=ot.defaultInstance.registerCustom.bind(ot.defaultInstance),ot.allowErrorProps=ot.defaultInstance.allowErrorProps.bind(ot.defaultInstance),ot.serialize,ot.deserialize,ot.stringify,ot.parse,ot.registerClass,ot.registerCustom,ot.registerSymbol,ot.allowErrorProps;function jy({className:e}){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[(0,r.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}function $y({className:e}){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[(0,r.jsx)("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),(0,r.jsx)("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),(0,r.jsx)("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),(0,r.jsx)("path",{d:"m2 2 20 20"})]})}function ky({className:e}){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:(0,r.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}function Zd({onLogin:e,serverUrl:i,logoSrc:a,error:o,className:l}){const[d,m]=(0,n.useState)(""),[h,p]=(0,n.useState)(""),[v,y]=(0,n.useState)(!1),[w,N]=(0,n.useState)(!1),[O,E]=(0,n.useState)(null),A=o??O,R=async Z=>{if(Z.preventDefault(),!w){E(null),N(!0);try{await e(d,h)}catch(G){E(G instanceof Error?G.message:"Login failed. Please try again.")}finally{N(!1)}}};return(0,r.jsx)("div",{className:K("flex min-h-screen items-center justify-center bg-background p-4",l),children:(0,r.jsxs)("div",{className:"w-full max-w-sm",children:[a&&(0,r.jsx)("div",{className:"flex justify-center mb-8",children:(0,r.jsx)("img",{src:a,alt:"Logo",className:"h-12"})}),i&&(0,r.jsx)("p",{className:"mb-4 text-center text-xs text-foreground-subtle truncate",children:i}),(0,r.jsxs)("form",{onSubmit:R,className:"space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10",children:[A&&(0,r.jsx)("div",{className:"rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger",children:A}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)("label",{className:"text-xs font-medium text-foreground-subtle",children:"Username"}),(0,r.jsx)("input",{type:"text",value:d,onChange:Z=>m(Z.target.value),autoComplete:"username",required:!0,className:"w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary"})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)("label",{className:"text-xs font-medium text-foreground-subtle",children:"Password"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:v?"text":"password",value:h,onChange:Z=>p(Z.target.value),autoComplete:"current-password",required:!0,className:"w-full rounded-lg border border-border bg-background px-3 py-2.5 pr-10 text-sm text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary"}),(0,r.jsx)("button",{type:"button",onClick:()=>y(Z=>!Z),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",tabIndex:-1,children:v?(0,r.jsx)($y,{className:"h-4 w-4"}):(0,r.jsx)(jy,{className:"h-4 w-4"})})]})]}),(0,r.jsxs)("button",{type:"submit",disabled:w,className:"w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",children:[w&&(0,r.jsx)(ky,{className:"h-4 w-4 animate-spin"}),w?"Logging in...":"Log in"]})]})]})})}var hc="camstack_dev_token",Ld=(0,n.createContext)(null);function Py(){const e=(0,n.useContext)(Ld);if(!e)throw new Error("useDevShell must be used within a DevShell");return e}function Ny(){return typeof window>"u"?null:localStorage.getItem(hc)}function Oy({className:e}){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,r.jsx)("path",{d:"M12 2v2"}),(0,r.jsx)("path",{d:"M12 20v2"}),(0,r.jsx)("path",{d:"m4.93 4.93 1.41 1.41"}),(0,r.jsx)("path",{d:"m17.66 17.66 1.41 1.41"}),(0,r.jsx)("path",{d:"M2 12h2"}),(0,r.jsx)("path",{d:"M20 12h2"}),(0,r.jsx)("path",{d:"m6.34 17.66-1.41 1.41"}),(0,r.jsx)("path",{d:"m19.07 4.93-1.41 1.41"})]})}function Cy({className:e}){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:(0,r.jsx)("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function Iy({children:e,serverUrl:i,title:a,token:o,onLogout:l}){const d=u.useThemeMode$1(),m=(0,n.useMemo)(()=>[(0,X.splitLink)({condition:N=>N.type==="subscription",true:(0,X.wsLink)({client:(0,X.createWSClient)({url:i.replace(/^http/,"ws")+"/trpc",connectionParams:()=>({token:o})}),transformer:ot}),false:(0,X.httpLink)({url:`${i}/trpc`,transformer:ot,headers:()=>({authorization:`Bearer ${o}`})})})],[i,o]),h=(0,n.useMemo)(()=>(0,X.createTRPCClient)({links:m}),[m]),p=(0,n.useMemo)(()=>j.createClient({links:m}),[m]),v=(0,n.useMemo)(()=>(0,ge.createSystem)({serverUrl:i,token:o}),[i,o]);(0,n.useEffect)(()=>(v.init().catch(()=>{}),()=>{v.close()}),[v]);const y=(0,n.useMemo)(()=>new ee.QueryClient,[]),w=(0,n.useMemo)(()=>({trpc:h,token:o,logout:l}),[h,o,l]);return(0,r.jsx)(Uu,{system:v,children:(0,r.jsx)(j.Provider,{client:p,queryClient:y,children:(0,r.jsx)(ee.QueryClientProvider,{client:y,children:(0,r.jsx)(Ld.Provider,{value:w,children:(0,r.jsxs)("div",{className:"min-h-screen bg-background text-foreground",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-surface px-4 py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"rounded bg-warning/20 px-2 py-0.5 text-xs font-bold text-warning",children:"DEV MODE"}),a&&(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:a}),(0,r.jsx)("span",{className:"text-xs text-foreground-subtle",children:i})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:d.toggleMode,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",title:`Theme: ${d.mode}`,children:[d.resolvedMode==="dark"?(0,r.jsx)(Oy,{className:"h-3.5 w-3.5"}):(0,r.jsx)(Cy,{className:"h-3.5 w-3.5"}),d.mode==="dark"?"Dark":d.mode==="light"?"Light":"System"]}),(0,r.jsx)("button",{type:"button",onClick:l,className:"rounded-md px-2.5 py-1 text-xs font-medium text-danger hover:bg-danger/10 transition-colors",children:"Logout"})]})]}),(0,r.jsx)("div",{className:"p-4",children:e({trpc:h,theme:d})})]})})})})})}function Ud({children:e,serverUrl:i="https://localhost:4443",title:a}){const[o,l]=(0,n.useState)(Ny),d=(0,n.useCallback)(async(h,p)=>{const v=await(0,X.createTRPCClient)({links:[(0,X.httpLink)({url:`${i}/trpc`,transformer:ot})]}).auth.login.mutate({username:h,password:p});if(!v.token)throw new Error("No token returned");localStorage.setItem(hc,v.token),l(v.token)},[i]),m=(0,n.useCallback)(()=>{localStorage.removeItem(hc),l(null)},[]);return o?(0,r.jsx)(u.ThemeProvider$1,{children:(0,r.jsx)(Iy,{serverUrl:i,title:a,token:o,onLogout:m,children:e})}):(0,r.jsx)(u.ThemeProvider$1,{children:(0,r.jsx)(Zd,{onLogin:d,serverUrl:i})})}function Ey(e,i={}){const{serverUrl:a="https://localhost:4443",title:o,rootId:l="root"}=i,d=document.getElementById(l);if(!d){console.error(`[mountAddonPage] Element #${l} not found`);return}(0,M.createRoot)(d).render((0,n.createElement)(Ud,{serverUrl:a,title:o,children:({trpc:m,theme:h})=>(0,n.createElement)(e,{trpc:m,theme:{isDark:h.resolvedMode==="dark"},navigate:p=>{console.log("[dev] navigate:",p)}})}))}var Bd=_r("camstack:custom-field-renderers",{});function My({renderers:e,children:i}){return(0,r.jsx)(Bd.Provider,{value:e,children:i})}function Fd(e){return(0,n.useContext)(Bd)[e]??null}var bc=_r("camstack:device-context",null);function Dy({deviceId:e,device:i,children:a}){const o={deviceId:e,device:i??null};return(0,r.jsx)(bc.Provider,{value:o,children:a})}function Gd(){return(0,n.useContext)(bc)?.deviceId??null}function Ay(){return(0,n.useContext)(bc)?.device??null}var zy=j.accessories.getStatus.useQuery,Ty=j.addonPages.listPages.useQuery,Vd=j.addons.list.useQuery,Ry=j.addons.getLogs.useQuery,Zy=j.addons.listPackages.useQuery,Ly=j.addons.installPackage.useMutation,Uy=j.addons.installFromWorkspace.useMutation,By=j.addons.isWorkspaceAvailable.useQuery,Fy=j.addons.listWorkspacePackages.useQuery,Gy=j.addons.uninstallPackage.useMutation,Vy=j.addons.reloadPackages.useMutation,Qy=j.addons.searchAvailable.useQuery,Wy=j.addons.listUpdates.useQuery,qy=j.addons.updatePackage.useMutation,Hy=j.addons.rollbackPackage.useMutation,Jy=j.addons.forceRefresh.useMutation,Ky=j.addons.restartServer.useMutation,Xy=j.addons.getLastRestart.useQuery,Yy=j.addons.listFrameworkPackages.useQuery,e0=j.addons.listCapabilityProviders.useQuery,t0=j.addons.setCapabilityProviderEnabled.useMutation,r0=j.addons.updateFrameworkPackage.useMutation,n0=j.addons.getVersions.useQuery,i0=j.addons.restartAddon.useMutation,a0=j.addons.retryLoad.useMutation,o0=j.addons.getAutoUpdateSettings.useQuery,s0=j.addons.setAutoUpdateSettings.useMutation,c0=j.addons.getAddonAutoUpdate.useQuery,l0=j.addons.setAddonAutoUpdate.useMutation,u0=j.addons.applyAutoUpdateToAll.useMutation,d0=j.addons.custom.useMutation,f0=j.addons.onAddonLogs.useSubscription,m0=j.addonSettings.getGlobalSettings.useQuery,g0=j.addonSettings.updateGlobalSettings.useMutation,p0=j.addonSettings.getDeviceSettings.useQuery,v0=j.addonSettings.updateDeviceSettings.useMutation,Qd=j.addonWidgets.listWidgets.useQuery,h0=j.alerts.emit.useMutation,b0=j.alerts.update.useMutation,y0=j.alerts.list.useQuery,_0=j.alerts.getUnreadCount.useQuery,x0=j.alerts.markRead.useMutation,w0=j.alerts.markAllRead.useMutation,S0=j.alerts.dismiss.useMutation,j0=j.audioAnalysis.resolveDeviceSettings.useQuery,$0=j.audioAnalysis.getDeviceSettingsContribution.useQuery,k0=j.audioAnalysis.getDeviceLiveContribution.useQuery,P0=j.audioAnalysis.applyDeviceSettingsPatch.useMutation,N0=j.audioAnalyzer.analyseChunk.useMutation,O0=j.audioAnalyzer.classify.useQuery,C0=j.audioAnalyzer.isReady.useQuery,I0=j.audioAnalyzer.dispose.useMutation,E0=j.audioAnalyzer.reprobeAudioEngine.useMutation,M0=j.audioCodec.listSupportedCodecs.useQuery,D0=j.audioCodec.canHandle.useQuery,A0=j.audioCodec.createDecodeSession.useMutation,z0=j.audioCodec.createEncodeSession.useMutation,T0=j.audioCodec.closeSession.useMutation,R0=j.audioCodec.pushEncodedFrame.useMutation,Z0=j.audioCodec.pullPcm.useQuery,L0=j.audioCodec.pushPcm.useMutation,U0=j.audioCodec.pullEncoded.useQuery,B0=j.audioCodec.flushEncode.useMutation,F0=j.audioCodec.listActiveSessions.useQuery,G0=j.audioMetrics.getCurrentSnapshot.useQuery,V0=j.audioMetrics.getHistory.useQuery,Q0=j.backup.listDestinations.useQuery,W0=j.backup.trigger.useMutation,q0=j.backup.list.useQuery,H0=j.backup.listLocations.useQuery,J0=j.backup.getEntries.useQuery,K0=j.backup.restore.useMutation,X0=j.backup.delete.useMutation,Y0=j.backup.listArchives.useQuery,e_=j.backup.upsertDestinationPolicy.useMutation,t_=j.backup.previewSchedule.useQuery,r_=j.battery.getStatus.useQuery,n_=j.brightness.setBrightness.useMutation,i_=j.brightness.getStatus.useQuery,a_=j.cameraCredentials.getCredentials.useQuery,o_=j.cameraCredentials.getStatus.useQuery,s_=j.cameraStreams.getCameraStreams.useQuery,c_=j.cameraStreams.getBrokerStreams.useQuery,Wd=j.cameraStreams.getRtspEntries.useQuery,l_=j.decoder.supportsCodec.useQuery,u_=j.decoder.getInfo.useQuery,d_=j.decoder.createSession.useQuery,f_=j.decoder.destroySession.useQuery,m_=j.decoder.pushPacket.useQuery,g_=j.decoder.openStream.useQuery,p_=j.decoder.pullFrames.useQuery,v_=j.decoder.updateConfig.useQuery,h_=j.decoder.getStats.useQuery,b_=j.decoder.listActiveSessions.useQuery,y_=j.decoder.reprobeHwaccel.useMutation,__=j.detectionPipeline.getDeviceSettingsContribution.useQuery,x_=j.detectionPipeline.getDeviceLiveContribution.useQuery,w_=j.detectionPipeline.applyDeviceSettingsPatch.useMutation,S_=j.deviceDiscovery.listDiscovered.useQuery,j_=j.deviceDiscovery.refreshDiscovery.useMutation,$_=j.deviceDiscovery.adoptDevice.useMutation,k_=j.deviceDiscovery.releaseDevice.useMutation,P_=j.deviceDiscovery.getStatus.useQuery,qd=j.deviceExport.getStatus.useQuery,N_=j.deviceExport.listSupportedDeviceKinds.useQuery,Hd=j.deviceExport.listExposedDevices.useQuery,O_=j.deviceExport.exposeDevice.useMutation,Jd=j.deviceExport.unexposeDevice.useMutation,C_=j.deviceExport.getDeviceSettingsContribution.useQuery,I_=j.deviceExport.getDeviceLiveContribution.useQuery,E_=j.deviceExport.applyDeviceSettingsPatch.useMutation,M_=j.deviceManager.allocateDeviceId.useMutation,D_=j.deviceManager.registerDevice.useMutation,A_=j.deviceManager.removeDevice.useMutation,z_=j.deviceManager.persistConfig.useMutation,T_=j.deviceManager.loadConfig.useQuery,R_=j.deviceManager.loadRuntimeState.useQuery,Z_=j.deviceManager.loadMeta.useQuery,L_=j.deviceManager.setName.useMutation,U_=j.deviceManager.setLocation.useMutation,B_=j.deviceManager.setMetadata.useMutation,F_=j.deviceManager.listLocations.useQuery,G_=j.deviceManager.addLocation.useMutation,V_=j.deviceManager.removeLocation.useMutation,Q_=j.deviceManager.setDisabled.useMutation,W_=j.deviceManager.listPersistedByAddon.useQuery,Kd=j.deviceManager.listAll.useQuery,q_=j.deviceManager.getDevice.useQuery,H_=j.deviceManager.getChildren.useQuery,J_=j.deviceManager.getStreamSources.useQuery,K_=j.deviceManager.getConfigSchema.useQuery,X_=j.deviceManager.getSettingsSchema.useQuery,Y_=j.deviceManager.updateConfig.useMutation,ex=j.deviceManager.enable.useMutation,tx=j.deviceManager.disable.useMutation,rx=j.deviceManager.remove.useMutation,nx=j.deviceManager.getStreamProfileMap.useQuery,ix=j.deviceManager.setStreamProfileMap.useMutation,ax=j.deviceManager.probeStreams.useMutation,ox=j.deviceManager.getBindings.useQuery,sx=j.deviceManager.getAllBindings.useQuery,cx=j.deviceManager.setWrapperActive.useMutation,lx=j.deviceManager.listWrappersForCap.useQuery,ux=j.deviceManager.listBindableCapsForDeviceType.useQuery,dx=j.deviceManager.getDeviceSettingsAggregate.useQuery,fx=j.deviceManager.getDeviceLiveInfoAggregate.useQuery,mx=j.deviceManager.getDeviceAggregate.useQuery,gx=j.deviceManager.updateDeviceField.useMutation,px=j.deviceManager.updateDeviceFieldsBatch.useMutation,vx=j.deviceManager.discoverDevices.useMutation,hx=j.deviceManager.adoptDevice.useMutation,bx=j.deviceManager.getCreationSchema.useQuery,yx=j.deviceManager.createDevice.useMutation,_x=j.deviceManager.testCreationField.useMutation,xx=j.deviceManager.testField.useMutation,wx=j.deviceManager.getDeviceStatusAggregate.useQuery,Sx=j.deviceOps.getStreamSources.useQuery,jx=j.deviceOps.getConfigEntries.useQuery,$x=j.deviceOps.setConfig.useMutation,kx=j.deviceOps.removeDevice.useMutation,Px=j.deviceOps.getSettingsSchema.useQuery,Nx=j.deviceProvider.start.useMutation,Ox=j.deviceProvider.stop.useMutation,Cx=j.deviceProvider.getStatus.useQuery,Ix=j.deviceProvider.getDevices.useQuery,Ex=j.deviceProvider.supportsDiscovery.useQuery,Mx=j.deviceProvider.discoverDevices.useMutation,Dx=j.deviceProvider.adoptDiscoveredDevice.useMutation,Ax=j.deviceProvider.supportsManualCreation.useQuery,zx=j.deviceProvider.getChildCreationSchema.useQuery,Tx=j.deviceProvider.createDevice.useMutation,Rx=j.deviceProvider.testCreationField.useMutation,Zx=j.deviceState.getSnapshot.useQuery,Lx=j.deviceState.getCapSlice.useQuery,Ux=j.deviceState.getAllSnapshots.useQuery,Bx=j.deviceState.setCapSlice.useMutation,Fx=j.deviceStatus.getStatus.useQuery,Gx=j.doorbell.getStatus.useQuery,Vx=j.events.getEvents.useQuery,Qx=j.events.getEventThumbnail.useQuery,Wx=j.events.getEventClipUrl.useQuery,qx=j.featureProbe.getStatus.useQuery,Hx=j.integrations.list.useQuery,Jx=j.integrations.get.useQuery,Kx=j.integrations.getByAddonId.useQuery,Xx=j.integrations.create.useMutation,Yx=j.integrations.update.useMutation,e1=j.integrations.delete.useMutation,t1=j.integrations.getSettings.useQuery,r1=j.integrations.setSettings.useMutation,n1=j.integrations.getAvailableTypes.useQuery,i1=j.integrations.testConnection.useMutation,a1=j.intercom.startSession.useMutation,o1=j.intercom.handleAnswer.useMutation,s1=j.intercom.stopSession.useMutation,c1=j.intercom.startTalkSession.useMutation,l1=j.intercom.pushTalkPcm.useMutation,u1=j.intercom.endTalkSession.useMutation,d1=j.intercom.getStatus.useQuery,f1=j.localNetwork.list.useQuery,m1=j.localNetwork.getPreferred.useQuery,g1=j.localNetwork.getConnectionEndpoints.useQuery,p1=j.localNetwork.getAllowedAddresses.useQuery,v1=j.localNetwork.setAllowedAddresses.useMutation,h1=j.localNetwork.resetAllowlistToBestMatch.useMutation,b1=j.meshNetwork.getStatus.useQuery,y1=j.meshNetwork.join.useMutation,_1=j.meshNetwork.startLogin.useMutation,x1=j.meshNetwork.leave.useMutation,w1=j.meshNetwork.logout.useMutation,S1=j.meshNetwork.listPeers.useQuery,j1=j.meshNetwork.testConnection.useMutation,$1=j.metricsProvider.collectSnapshot.useQuery,k1=j.metricsProvider.getCached.useQuery,P1=j.metricsProvider.getCurrent.useQuery,N1=j.metricsProvider.getDiskSpace.useQuery,O1=j.metricsProvider.getGpuInfo.useQuery,C1=j.metricsProvider.getCpuTemperature.useQuery,I1=j.metricsProvider.getProcessStats.useQuery,E1=j.metricsProvider.listAddonInstances.useQuery,M1=j.metricsProvider.getAddonStats.useQuery,D1=j.metricsProvider.listNodeProcesses.useQuery,A1=j.metricsProvider.killProcess.useMutation,z1=j.motion.isDetected.useQuery,T1=j.motion.getStatus.useQuery,R1=j.motionDetection.analyze.useMutation,Z1=j.motionDetection.removeCamera.useMutation,L1=j.motionDetection.reset.useMutation,U1=j.motionDetection.getDeviceSettingsContribution.useQuery,B1=j.motionDetection.getDeviceLiveContribution.useQuery,F1=j.motionDetection.applyDeviceSettingsPatch.useMutation,G1=j.motionTrigger.setMotionTrigger.useMutation,V1=j.motionTrigger.getStatus.useQuery,Q1=j.mqttBroker.listBrokers.useQuery,W1=j.mqttBroker.getBrokerConfig.useQuery,q1=j.mqttBroker.addBroker.useMutation,H1=j.mqttBroker.removeBroker.useMutation,J1=j.mqttBroker.testConnection.useMutation,K1=j.mqttBroker.startEmbeddedBroker.useMutation,X1=j.mqttBroker.stopEmbeddedBroker.useMutation,Y1=j.mqttBroker.getStatus.useQuery,ew=j.nativeObjectDetection.getStatus.useQuery,tw=j.networkAccess.start.useMutation,rw=j.networkAccess.stop.useMutation,nw=j.networkAccess.getEndpoint.useQuery,iw=j.networkAccess.getStatus.useQuery,aw=j.networkAccess.listEndpoints.useQuery,ow=j.networkQuality.getDeviceStats.useQuery,sw=j.networkQuality.getAllStats.useQuery,cw=j.networkQuality.reportClientStats.useMutation,lw=j.nodes.topology.useQuery,uw=j.nodes.deployAddon.useMutation,dw=j.nodes.undeployAddon.useMutation,fw=j.nodes.restartAddon.useMutation,mw=j.nodes.restartProcess.useMutation,gw=j.nodes.restartNode.useMutation,pw=j.nodes.shutdownNode.useMutation,vw=j.nodes.renameNode.useMutation,hw=j.nodes.clusterAddonStatus.useQuery,bw=j.nodes.getNodeAddons.useQuery,yw=j.nodes.setProcessLogLevel.useMutation,_w=j.nodes.executeQuery.useMutation,xw=j.notificationOutput.send.useMutation,ww=j.notificationOutput.sendTest.useMutation,Sw=j.osd.setOverlay.useMutation,jw=j.osd.getStatus.useQuery,$w=j.pipelineAnalytics.getActiveTracks.useQuery,kw=j.pipelineAnalytics.getTrack.useQuery,Pw=j.pipelineAnalytics.listTracks.useQuery,Nw=j.pipelineAnalytics.clearTracks.useMutation,Ow=j.pipelineAnalytics.getMotionEvents.useQuery,Cw=j.pipelineAnalytics.getObjectEvents.useQuery,Iw=j.pipelineAnalytics.getAudioEvents.useQuery,Ew=j.pipelineAnalytics.getEventMedia.useQuery,Mw=j.pipelineAnalytics.getTrackMedia.useQuery,Dw=j.pipelineAnalytics.getDeviceSettingsContribution.useQuery,Aw=j.pipelineAnalytics.getDeviceLiveContribution.useQuery,zw=j.pipelineAnalytics.applyDeviceSettingsPatch.useMutation,Tw=j.pipelineExecutor.getAvailableEngines.useQuery,Rw=j.pipelineExecutor.getSelectedEngine.useQuery,Zw=j.pipelineExecutor.getDefaultSteps.useQuery,Lw=j.pipelineExecutor.reprobeEngine.useMutation,Uw=j.pipelineExecutor.getVideoPipelineSteps.useQuery,Bw=j.pipelineExecutor.setVideoPipelineSteps.useMutation,Fw=j.pipelineExecutor.getSchema.useQuery,Gw=j.pipelineExecutor.getGlobalSteps.useQuery,Vw=j.pipelineExecutor.getGlobalPipelineConfig.useQuery,Qw=j.pipelineExecutor.getOrchestratorConfigSchema.useQuery,Ww=j.pipelineExecutor.listTemplates.useQuery,qw=j.pipelineExecutor.saveTemplate.useMutation,Hw=j.pipelineExecutor.updateTemplate.useMutation,Jw=j.pipelineExecutor.deleteTemplate.useMutation,Kw=j.pipelineExecutor.getCapabilities.useQuery,Xw=j.pipelineExecutor.getAddonModels.useQuery,Yw=j.pipelineExecutor.downloadModel.useMutation,eS=j.pipelineExecutor.deleteModel.useMutation,tS=j.pipelineExecutor.detect.useQuery,rS=j.pipelineExecutor.runPipeline.useMutation,nS=j.pipelineExecutor.runPipelineBatch.useMutation,iS=j.pipelineExecutor.cacheFrameInPool.useMutation,aS=j.pipelineExecutor.inferCached.useMutation,oS=j.pipelineExecutor.uncacheFrame.useMutation,sS=j.pipelineExecutor.getEffectiveTuning.useQuery,cS=j.pipelineExecutor.listLoadedEngines.useQuery,lS=j.pipelineExecutor.spinEngine.useMutation,uS=j.pipelineExecutor.killEngine.useMutation,dS=j.pipelineExecutor.listReferenceImages.useQuery,fS=j.pipelineExecutor.getReferenceImage.useQuery,mS=j.pipelineExecutor.getReferenceAudioFiles.useQuery,gS=j.pipelineExecutor.getReferenceAudio.useQuery,pS=j.pipelineExecutor.getAudioCapabilities.useQuery,vS=j.pipelineExecutor.runAudioTest.useMutation,hS=j.pipelineExecutor.getDetectionConfigSchema.useQuery,bS=j.pipelineOrchestrator.assignPipeline.useMutation,yS=j.pipelineOrchestrator.unassignPipeline.useMutation,_S=j.pipelineOrchestrator.rebalance.useMutation,xS=j.pipelineOrchestrator.getPipelineAssignments.useQuery,wS=j.pipelineOrchestrator.getPipelineAssignment.useQuery,SS=j.pipelineOrchestrator.getAgentLoad.useQuery,jS=j.pipelineOrchestrator.getGlobalMetrics.useQuery,$S=j.pipelineOrchestrator.getCameraMetrics.useQuery,kS=j.pipelineOrchestrator.getCapabilityBindings.useQuery,PS=j.pipelineOrchestrator.setCapabilityBinding.useMutation,NS=j.pipelineOrchestrator.assignDecoder.useMutation,OS=j.pipelineOrchestrator.unassignDecoder.useMutation,CS=j.pipelineOrchestrator.getDecoderAssignments.useQuery,IS=j.pipelineOrchestrator.assignAudio.useMutation,ES=j.pipelineOrchestrator.unassignAudio.useMutation,MS=j.pipelineOrchestrator.getAudioAssignment.useQuery,DS=j.pipelineOrchestrator.getAudioNodeLoad.useQuery,AS=j.pipelineOrchestrator.getAudioAssignments.useQuery,zS=j.pipelineOrchestrator.getDecoderAssignment.useQuery,TS=j.pipelineOrchestrator.getAgentSettings.useQuery,RS=j.pipelineOrchestrator.listAgentSettings.useQuery,ZS=j.pipelineOrchestrator.setAgentAddonDefaults.useMutation,LS=j.pipelineOrchestrator.removeAgentSettings.useMutation,US=j.pipelineOrchestrator.getCameraSettings.useQuery,BS=j.pipelineOrchestrator.setCameraStepToggle.useMutation,FS=j.pipelineOrchestrator.getCameraStepOverrides.useQuery,GS=j.pipelineOrchestrator.setCameraStepOverride.useMutation,VS=j.pipelineOrchestrator.setCameraPipelineForAgent.useMutation,QS=j.pipelineOrchestrator.resolvePipeline.useQuery,WS=j.pipelineOrchestrator.listTemplates.useQuery,qS=j.pipelineOrchestrator.saveTemplate.useMutation,HS=j.pipelineOrchestrator.updateTemplate.useMutation,JS=j.pipelineOrchestrator.deleteTemplate.useMutation,KS=j.pipelineOrchestrator.getDeviceSettingsContribution.useQuery,XS=j.pipelineOrchestrator.getDeviceLiveContribution.useQuery,YS=j.pipelineOrchestrator.applyDeviceSettingsPatch.useMutation,ej=j.pipelineRunner.attachCamera.useMutation,tj=j.pipelineRunner.detachCamera.useMutation,rj=j.pipelineRunner.reportMotion.useMutation,nj=j.pipelineRunner.getLocalLoad.useQuery,ij=j.pipelineRunner.getLocalMetrics.useQuery,aj=j.pipelineRunner.getCameraMetrics.useQuery,oj=j.pipelineRunner.getAllCameraMetrics.useQuery,sj=j.pipelineRunner.getLocalCameras.useQuery,cj=j.platformProbe.getCapabilities.useQuery,lj=j.platformProbe.getHardware.useQuery,uj=j.platformProbe.resolveInferenceConfig.useQuery,dj=j.platformProbe.resolveHwAccel.useQuery,fj=j.platformProbe.getHardwareEncoders.useQuery,mj=j.platformProbe.refreshHardwareEncoders.useMutation,gj=j.ptz.move.useMutation,pj=j.ptz.continuousMove.useMutation,vj=j.ptz.stop.useMutation,hj=j.ptz.getPresets.useQuery,bj=j.ptz.goToPreset.useMutation,yj=j.ptz.goHome.useMutation,_j=j.ptz.getPosition.useQuery,xj=j.ptz.getStatus.useQuery,wj=j.ptzAutotrack.getStatus.useQuery,Sj=j.ptzAutotrack.setEnabled.useMutation,jj=j.ptzAutotrack.getSettings.useQuery,$j=j.ptzAutotrack.setSettings.useMutation,kj=j.reboot.reboot.useMutation,Pj=j.recording.getSegments.useQuery,Nj=j.recording.getPlaybackUrl.useQuery,Oj=j.recording.getThumbnailAt.useQuery,Cj=j.recordingEngine.getStatus.useQuery,Ij=j.recordingEngine.enable.useMutation,Ej=j.recordingEngine.disable.useMutation,Mj=j.recordingEngine.getConfig.useQuery,Dj=j.recordingEngine.updateConfig.useMutation,Aj=j.recordingEngine.getPlaylist.useQuery,zj=j.recordingEngine.getThumbnail.useQuery,Tj=j.recordingEngine.getSegments.useQuery,Rj=j.recordingEngine.getAvailability.useQuery,Zj=j.recordingEngine.estimateStorage.useQuery,Lj=j.recordingEngine.estimateGlobalStorage.useQuery,Uj=j.recordingEngine.getStorageUsage.useQuery,Bj=j.recordingEngine.setPolicy.useMutation,Fj=j.recordingEngine.getPolicy.useQuery,Gj=j.recordingEngine.getPolicyStatus.useQuery,Vj=j.recordingEngine.getRetentionConfig.useQuery,Qj=j.recordingEngine.updateRetentionConfig.useMutation,Wj=j.recordingEngine.getMotionStats.useQuery,qj=j.settingsStore.get.useQuery,Hj=j.settingsStore.set.useMutation,Jj=j.settingsStore.query.useQuery,Kj=j.settingsStore.insert.useMutation,Xj=j.settingsStore.update.useMutation,Yj=j.settingsStore.delete.useMutation,e$=j.settingsStore.count.useQuery,t$=j.settingsStore.isEmpty.useQuery,r$=j.settingsStore.declareCollection.useMutation,n$=j.snapshot.getSnapshot.useQuery,i$=j.snapshot.invalidateCache.useMutation,a$=j.snapshot.getStatus.useQuery,o$=j.snapshot.getDeviceSettingsContribution.useQuery,s$=j.snapshot.getDeviceLiveContribution.useQuery,c$=j.snapshot.applyDeviceSettingsPatch.useMutation,l$=j.snapshotProvider.supportsDevice.useQuery,u$=j.snapshotProvider.getSnapshot.useQuery,d$=j.storage.resolve.useQuery,f$=j.storage.write.useMutation,m$=j.storage.read.useQuery,g$=j.storage.exists.useQuery,p$=j.storage.list.useQuery,v$=j.storage.delete.useMutation,h$=j.storage.getAvailableSpace.useQuery,b$=j.storage.beginUpload.useMutation,y$=j.storage.writeChunk.useMutation,_$=j.storage.finalizeUpload.useMutation,x$=j.storage.abortUpload.useMutation,w$=j.storage.beginDownload.useMutation,S$=j.storage.readChunk.useQuery,j$=j.storage.endDownload.useMutation,$$=j.storage.listLocations.useQuery,k$=j.storage.getDefaultLocation.useQuery,P$=j.storage.upsertLocation.useMutation,N$=j.storage.deleteLocation.useMutation,O$=j.storage.testLocation.useQuery,C$=j.storage.listProviders.useQuery,I$=j.storage.testConfig.useQuery,E$=j.streamBroker.publishCameraStream.useMutation,M$=j.streamBroker.retractCameraStream.useMutation,D$=j.streamBroker.assignProfile.useMutation,A$=j.streamBroker.unassignProfile.useMutation,z$=j.streamBroker.listAllCameraStreams.useQuery,T$=j.streamBroker.listAllProfileSlots.useQuery,R$=j.streamBroker.getBrokerStats.useQuery,Z$=j.streamBroker.listClients.useQuery,L$=j.streamBroker.killClient.useMutation,U$=j.streamBroker.restartProfile.useMutation,B$=j.streamBroker.getStreamUrl.useQuery,F$=j.streamBroker.getStreamWithCodec.useMutation,G$=j.streamBroker.releaseStreamWithCodec.useMutation,V$=j.streamBroker.getBroker.useQuery,Q$=j.streamBroker.setPreBufferDuration.useMutation,W$=j.streamBroker.getPreBufferInfo.useQuery,q$=j.streamBroker.getRtspPort.useQuery,H$=j.streamBroker.getAllRtspEntries.useQuery,J$=j.streamBroker.getRtspEntry.useQuery,K$=j.streamBroker.regenerateRtspToken.useMutation,X$=j.streamBroker.setRtspEnabled.useMutation,Y$=j.streamBroker.isRtspEnabled.useQuery,ek=j.streamBroker.getDeviceSettingsContribution.useQuery,tk=j.streamBroker.getDeviceLiveContribution.useQuery,rk=j.streamBroker.applyDeviceSettingsPatch.useMutation,nk=j.switch.setState.useMutation,ik=j.switch.getStatus.useQuery,ak=j.system.info.useQuery,ok=j.system.health.useQuery,sk=j.system.featureFlags.useQuery,ck=j.system.networkAddresses.useQuery,lk=j.system.getRetentionConfig.useQuery,uk=j.system.setRetentionConfig.useMutation,dk=j.system.forceRetentionCleanup.useMutation,fk=j.toast.onToast.useSubscription,mk=j.turnProvider.getTurnServers.useQuery,gk=j.userManagement.listUsers.useQuery,pk=j.userManagement.createUser.useMutation,vk=j.userManagement.updateUser.useMutation,hk=j.userManagement.deleteUser.useMutation,bk=j.userManagement.resetPassword.useMutation,yk=j.userManagement.setUserScopes.useMutation,_k=j.userManagement.validateCredentials.useMutation,xk=j.userManagement.listApiKeys.useQuery,wk=j.userManagement.createApiKey.useMutation,Sk=j.userManagement.revokeApiKey.useMutation,jk=j.userManagement.validateApiKey.useMutation,$k=j.userManagement.createScopedToken.useMutation,kk=j.userManagement.revokeScopedToken.useMutation,Pk=j.userManagement.validateScopedToken.useQuery,Nk=j.userManagement.listScopedTokens.useQuery,Ok=j.userManagement.setupTotp.useMutation,Ck=j.userManagement.confirmTotp.useMutation,Ik=j.userManagement.disableTotp.useMutation,Ek=j.userManagement.getTotpStatus.useQuery,Mk=j.userManagement.verifyTotp.useMutation,Dk=j.webrtcSession.listStreams.useQuery,Ak=j.webrtcSession.createSession.useMutation,zk=j.webrtcSession.handleOffer.useMutation,Tk=j.webrtcSession.handleAnswer.useMutation,Rk=j.webrtcSession.closeSession.useMutation,Zk=j.webrtcSession.hasAdaptiveBitrate.useQuery,Lk=j.zoneAnalytics.getCurrentSnapshot.useQuery,Uk=j.zoneAnalytics.getZoneHistory.useQuery,Bk=j.zoneAnalytics.getCameraHistory.useQuery,Fk=j.zoneAnalytics.getUnzonedHistory.useQuery,Gk=j.zoneRules.listRules.useQuery,Vk=j.zoneRules.setRules.useMutation,Qk=j.zones.listZones.useQuery,Wk=j.zones.addZone.useMutation,qk=j.zones.removeZone.useMutation,Hk=j.zones.updateZone.useMutation,Xd=_r("camstack:widget-registry",null),Ma=new Map,Da=new Map,Yd=new Set;function Jk(e){if(!e||typeof e!="object")return!1;const i=e.default;return i!==null&&typeof i=="object"}function Kk(e){if(!e||typeof e!="object")return typeof e;const i=e,a=Object.getPrototypeOf(i),o=a&&typeof a=="object"?a.constructor?.name:void 0;return{ownKeys:Object.keys(i),allKeys:Object.getOwnPropertyNames(i),proto:typeof o=="string"?o:void 0}}async function Xk(e,i){const a=Ma.get(e);if(a)return a;const o=Da.get(e);if(o)return o;Yd.has(e)||(Ml(),jp([{name:e,entry:i,type:"module"}],{force:!1}),Yd.add(e));const l=Sp(`${e}/widgets`).then(d=>{if(!Jk(d)){const h=Kk(d);throw new Error(`Widget remote ${e} (${i}) does not expose a default record on './widgets'. Got: ${JSON.stringify(h)}`)}const m=d.default;return Ma.set(e,m),Da.delete(e),m}).catch(d=>{throw Da.delete(e),d});return Da.set(e,l),l}var Yk=3e4,eP=2e3;function tP({children:e}){const i=(0,ee.useQueryClient)(),a=(0,n.useRef)(Date.now()),{data:o}=Qd(void 0,{staleTime:0,refetchOnMount:"always",refetchInterval:h=>{const p=h.state.data;return p&&p.length>0||Date.now()-a.current>=Yk?!1:eP}});Fi("addon.widget-ready",()=>{i.invalidateQueries({queryKey:[["addonWidgets","listWidgets"]]})});const[l,d]=(0,n.useState)(0);(0,n.useEffect)(()=>{if(!o)return;let h=!1;const p=new Set;for(const v of o){if(p.has(v.remoteName)||(p.add(v.remoteName),Ma.has(v.remoteName)))continue;const y=v.bundleUrl;Xk(v.remoteName,y).then(()=>{h||d(w=>w+1)}).catch(w=>{const N=w instanceof Error?w.message:String(w);(typeof globalThis<"u"?globalThis.console:void 0)?.error?.("[WidgetRegistry] Failed to load widget remote",{remoteName:v.remoteName,entryUrl:y,reason:N})})}return()=>{h=!0}},[o]);const m=(0,n.useMemo)(()=>{const h=o??[],p=new Map;for(const y of h)p.set(`${y.addonId}/${y.stableId}`,y);const v=(y,w)=>({widgetId:y,addonId:w.addonId,stableId:w.stableId,label:w.label,description:w.description,icon:w.icon,remoteName:w.remoteName,bundleUrl:w.bundleUrl,hosts:w.hosts,requires:w.requires,defaultSize:w.defaultSize,allowedSizes:w.allowedSizes,defaultColumns:w.defaultColumns,defaultRows:w.defaultRows});return{resolve:y=>{const w=p.get(y);if(!w)return;const N=Ma.get(w.remoteName);if(!N)return null;const O=N[w.stableId];if(O)return O},metadata:y=>{const w=p.get(y);if(w)return v(y,w)},listAll:()=>{const y=[];for(const[w,N]of p)y.push(v(w,N));return y}}},[o,l]);return(0,r.jsx)(Xd.Provider,{value:m,children:e})}function ef(e){return Aa().resolve(e)}function tf(e){return Aa().metadata(e)}function rP(){return Aa().listAll()}function Aa(){const e=rf();if(!e)throw new Error("useWidgetRegistry(): no <WidgetRegistryProvider> in tree");return e}function rf(){return nP(Xd)}function nP(e){return(0,n.useContext)(e)}function nf(e){const{widgetId:i,host:a="device-tab",config:o,deviceId:l,integrationId:d,instanceId:m,size:h,columns:p,rows:v}=e,y=ef(i),w=tf(i),N=(0,n.useMemo)(()=>m??i,[m,i]);if(y===void 0&&w===void 0)return(0,r.jsx)(za,{widgetId:i,reason:"unknown"});if(y===void 0)return(0,r.jsx)(za,{widgetId:i,reason:"missing-export"});if(y===null)return(0,r.jsx)(iP,{});if(w){if(w.requires.deviceContext&&l===void 0)return(0,r.jsx)(za,{widgetId:i,reason:"missing-device-context"});if(w.requires.integrationContext&&d===void 0)return(0,r.jsx)(za,{widgetId:i,reason:"missing-integration-context"})}return(0,r.jsx)(y,{instanceId:N,host:a,config:o,deviceId:l,integrationId:d,size:h,columns:p,rows:v})}function iP(){return(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-surface/40 p-4 animate-pulse",children:[(0,r.jsx)("div",{className:"h-3 w-24 bg-foreground-subtle/20 rounded mb-2"}),(0,r.jsx)("div",{className:"h-2 w-full bg-foreground-subtle/10 rounded mb-1"}),(0,r.jsx)("div",{className:"h-2 w-3/4 bg-foreground-subtle/10 rounded"})]})}function za({widgetId:e,reason:i}){return(0,r.jsx)("div",{className:"rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning",children:i==="unknown"?`Widget "${e}" not registered`:i==="missing-export"?`Widget "${e}" bundle does not export this stableId`:i==="missing-device-context"?`Widget "${e}" requires a deviceId`:`Widget "${e}" requires an integrationId`})}var Hr="w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none disabled:opacity-50 disabled:cursor-not-allowed",Ta="block text-[11px] font-medium text-foreground mb-1",aP="text-[10px] text-foreground-subtle mt-0.5";function Ot({label:e,description:i,required:a,span:o,children:l,translationFn:d}){const m=o===2?"col-span-2":o===3?"col-span-3":o===4?"col-span-4":"col-span-1",h=cr(e,d),p=cr(i,d);return(0,r.jsxs)("div",{className:m,children:[h!==void 0&&h!==""&&(0,r.jsxs)("label",{className:Ta,children:[h,a&&(0,r.jsx)("span",{className:"text-danger ml-0.5",children:"*"})]}),l,p&&(0,r.jsx)("p",{className:aP,children:p})]})}function oP({field:e,value:i,onChange:a,disabled:o,translationFn:l}){return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsx)("input",{type:e.inputType??"text",className:Hr,value:i==null?"":String(i),placeholder:e.placeholder,maxLength:e.maxLength,pattern:e.pattern,disabled:o||e.disabled,onChange:d=>a(d.target.value)})})}function sP({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const[d,m]=(0,n.useState)(i==null?"":String(i)),h=(0,n.useRef)(!1);(0,n.useEffect)(()=>{h.current||m(i==null?"":String(i))},[i]);const p=v=>{if(m(v),v===""||v==="-"){a(void 0);return}const y=Number(v);Number.isNaN(y)||a(y)};return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("input",{type:"number",className:Hr,value:d,placeholder:e.placeholder,min:e.min,max:e.max,step:e.step,disabled:o||e.disabled,onFocus:()=>{h.current=!0},onBlur:()=>{h.current=!1},onChange:v=>p(v.target.value)}),e.unit&&(0,r.jsx)("span",{className:"text-xs text-foreground-subtle whitespace-nowrap",children:e.unit})]})})}function cP({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=!!i,m=o||e.disabled;return e.style==="checkbox"?(0,r.jsx)(Ot,{label:void 0,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,r.jsx)("input",{type:"checkbox",className:"h-3.5 w-3.5 rounded border-border accent-primary",checked:d,disabled:m,onChange:h=>a(h.target.checked)}),(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:cr(e.label,l)}),e.required&&(0,r.jsx)("span",{className:"text-danger",children:"*"})]})}):(0,r.jsx)(Ot,{label:void 0,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{className:Ta+" mb-0",children:[cr(e.label,l),e.required&&(0,r.jsx)("span",{className:"text-danger ml-0.5",children:"*"})]}),(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":d,disabled:m,onClick:()=>!m&&a(!d),className:["relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150",d?"bg-primary":"bg-foreground-subtle/30",m?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),children:(0,r.jsx)("span",{className:["inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150",d?"translate-x-4":"translate-x-0.5"].join(" ")})})]})})}function lP({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=e.options.some(m=>m.value==="");return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("select",{className:Hr,value:i==null?"":String(i),disabled:o||e.disabled,onChange:m=>a(m.target.value),children:[!e.required&&!d&&(0,r.jsx)("option",{value:"",children:"— Select —"}),e.options.map(m=>(0,r.jsx)("option",{value:m.value,children:m.label},m.value))]})})}function uP({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=Array.isArray(i)?i:[],m=h=>{if(d.includes(h))a(d.filter(p=>p!==h));else{if(e.maxItems!==void 0&&d.length>=e.maxItems)return;a([...d,h])}};return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:e.options.map(h=>{const p=d.includes(h.value);return(0,r.jsxs)("label",{className:["flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs cursor-pointer select-none transition-colors",p?"border-primary bg-primary/10 text-primary":"border-border bg-background text-foreground hover:bg-surface",o||e.disabled?"opacity-50 cursor-not-allowed":""].join(" "),children:[(0,r.jsx)("input",{type:"checkbox",className:"sr-only",checked:p,disabled:o||e.disabled,onChange:()=>m(h.value)}),h.label]},h.value)})})})}function dP({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const[d,m]=(0,n.useState)(!1),h=e.showToggle!==!1;return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:d?"text":"password",className:Hr+(h?" pr-9":""),value:i==null?"":String(i),placeholder:e.placeholder,disabled:o||e.disabled,onChange:p=>a(p.target.value)}),h&&(0,r.jsx)("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",tabIndex:-1,onClick:()=>m(p=>!p),children:d?(0,r.jsx)(Rs,{className:"h-3.5 w-3.5"}):(0,r.jsx)(hn,{className:"h-3.5 w-3.5"})})]})})}function fP({field:e,value:i,onChange:a,disabled:o,translationFn:l}){return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsx)("textarea",{className:Hr+" resize-y min-h-[60px]",value:i==null?"":String(i),placeholder:e.placeholder,rows:e.rows??3,maxLength:e.maxLength,disabled:o||e.disabled,onChange:d=>a(d.target.value)})})}function mP({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=i==null,m=e.nullable===!0,h=d?e.default??e.min:Number(i),p=e.showValue!==!1,v=e.nullLabel??"Auto",y=o||e.disabled,w=e.displayScale??1,N=e.min/w,O=e.max/w,E=h/w,A=(e.step??1)/w;if(m&&d)return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("button",{className:"w-full rounded-lg border border-dashed border-border px-3 py-2 text-xs text-foreground-subtle hover:border-primary/40 hover:text-primary transition-colors text-left",disabled:y,onClick:()=>a(e.default??e.min),children:[v," — click to set manually"]})});const R=e.showStepper===!0&&p,Z=V=>{const re=h+V*(e.step??1),te=Math.min(e.max,Math.max(e.min,re));te!==h&&a(te)},G="flex h-6 w-6 shrink-0 items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:cursor-not-allowed disabled:opacity-40";return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 basis-[160px] items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle tabular-nums shrink-0",children:N}),(0,r.jsx)("input",{type:"range",className:"min-w-0 flex-1 h-1 accent-primary cursor-pointer disabled:opacity-50",min:N,max:O,step:A,value:E,disabled:y,onChange:V=>a(Number(V.target.value)*w)}),(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle tabular-nums shrink-0",children:O})]}),(p||m||e.unit)&&(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[R&&(0,r.jsx)("button",{type:"button",className:G,disabled:y||h<=e.min,onClick:()=>Z(-1),title:`Decrease by ${e.step??1}`,"aria-label":"Decrement",children:(0,r.jsx)(Wl,{className:"h-3 w-3"})}),p&&(0,r.jsx)("input",{type:"number",className:"w-16 rounded border border-border bg-surface px-1.5 py-0.5 text-xs text-center text-foreground tabular-nums focus:outline-none focus:ring-1 focus:ring-primary",min:N,max:O,step:A,value:E,disabled:y,onChange:V=>{if(V.target.value===""){a(m?null:e.min);return}const re=Number(V.target.value)*w,te=e.step??1,ce=re-e.min,ye=e.min+Math.round(ce/te)*te;a(Math.min(e.max,Math.max(e.min,ye)))}}),R&&(0,r.jsx)("button",{type:"button",className:G,disabled:y||h>=e.max,onClick:()=>Z(1),title:`Increase by ${e.step??1}`,"aria-label":"Increment",children:(0,r.jsx)(Zi,{className:"h-3 w-3"})}),e.unit&&(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle",children:e.unit}),m&&(0,r.jsx)("button",{className:"text-[10px] text-foreground-subtle hover:text-primary transition-colors",title:`Reset to ${v}`,disabled:y,onClick:()=>a(null),children:v})]})]})})}function gP({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=Array.isArray(i)?i:[],[m,h]=(0,n.useState)(""),p=(0,n.useRef)(null),v=(0,n.useCallback)(O=>{const E=O.trim();!E||d.includes(E)||e.maxTags!==void 0&&d.length>=e.maxTags||(a([...d,E]),h(""))},[d,e.maxTags,a]),y=O=>a(d.filter(E=>E!==O)),w=O=>{O.key==="Enter"||O.key===","?(O.preventDefault(),v(m)):O.key==="Backspace"&&m===""&&d.length>0&&y(d[d.length-1])},N=o||e.disabled;return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("div",{className:["flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px] cursor-text","focus-within:border-primary focus-within:ring-1 focus-within:ring-primary/30",N?"opacity-50 cursor-not-allowed":""].join(" "),onClick:()=>!N&&p.current?.focus(),children:[d.map(O=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:[O,!N&&(0,r.jsx)("button",{type:"button",onClick:()=>y(O),className:"hover:text-danger",children:(0,r.jsx)(Mt,{className:"h-2.5 w-2.5"})})]},O)),(0,r.jsx)("input",{ref:p,type:"text",className:"flex-1 min-w-[80px] bg-transparent text-sm text-foreground outline-none placeholder:text-foreground-disabled",value:m,placeholder:d.length===0?e.placeholder??"Add tags…":"",disabled:N,list:`tags-suggestions-${e.key}`,onChange:O=>h(O.target.value),onKeyDown:w,onBlur:()=>{m.trim()&&v(m)}}),e.suggestions&&(0,r.jsx)("datalist",{id:`tags-suggestions-${e.key}`,children:e.suggestions.map(O=>(0,r.jsx)("option",{value:O},O))})]})})}function af({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const{nodes:d}=Pa(),m=typeof i=="string"?i:"",h=e.showOffline?d:d.filter(p=>p.isOnline);return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("select",{className:"w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground focus:outline-none focus:border-primary/50 disabled:opacity-50",value:m,onChange:p=>a(p.target.value),disabled:o,children:[(0,r.jsx)("option",{value:"",children:"Select node…"}),h.map(p=>(0,r.jsxs)("option",{value:p.id,disabled:!p.isOnline,children:[p.shortName,p.isOnline?"":" (offline)"]},p.id))]})})}function of({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const{nodes:d}=Pa(),m=new Set(Array.isArray(i)?i.map(String):[]),h=e.showOffline?d:d.filter(v=>v.isOnline),p=v=>{const y=new Set(m);y.has(v)?y.delete(v):y.add(v),a([...y])};return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:h.map(v=>{const y=m.has(v.id);return(0,r.jsx)("button",{type:"button",onClick:()=>p(v.id),disabled:o||!v.isOnline,className:`px-2.5 py-1 text-xs font-medium rounded-md border transition-colors ${y?"border-primary bg-primary/10 text-primary":"border-border bg-surface text-foreground-subtle hover:bg-surface-hover"} ${v.isOnline?"":"opacity-50 cursor-not-allowed"}`,children:v.shortName},v.id)})})})}function pP({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=i==null?"#000000":String(i);return(0,r.jsxs)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"color",className:"h-9 w-9 rounded-md border border-border bg-background cursor-pointer p-0.5 disabled:opacity-50",value:d,disabled:o||e.disabled,onChange:m=>a(m.target.value)}),(0,r.jsx)("input",{type:"text",className:Hr+" flex-1 font-mono",value:d,placeholder:"#000000",disabled:o||e.disabled,onChange:m=>a(m.target.value)})]}),e.presets&&e.presets.length>0&&(0,r.jsx)("div",{className:"flex gap-1.5 mt-1.5",children:e.presets.map(m=>(0,r.jsx)("button",{type:"button",className:"h-5 w-5 rounded-md border border-border hover:scale-110 transition-transform disabled:opacity-50",style:{backgroundColor:m},disabled:o||e.disabled,title:m,onClick:()=>a(m)},m))})]})}function vP({field:e,value:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:m,externalProbe:h}){const[p,v]=(0,n.useState)("idle"),[y,w]=(0,n.useState)(null),N=h?.status??p,O=h?.result??y,E=!!d||!!m,A=(0,n.useCallback)(async()=>{if(E){v("probing"),w(null);try{const G=d?await d(e.key,i):await m("test-probe",e.key,i),V=G&&typeof G=="object"?G:{status:"error",error:"Probe handler returned no result"};w(V),v(V.status==="ok"?"ok":"error")}catch(G){w({status:"error",error:G instanceof Error?G.message:String(G)}),v("error")}}},[d,m,e.key,i,E]),R=N==="probing"?"border-primary/40 bg-primary/10 text-primary":N==="ok"?"border-success/40 bg-success/10 text-success hover:bg-success/15":N==="error"?"border-danger/40 bg-danger/10 text-danger hover:bg-danger/15":"border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover",Z=N==="probing"?(0,r.jsx)(tr,{className:"h-3 w-3 animate-spin"}):N==="ok"?(0,r.jsx)(Vp,{className:"h-3 w-3"}):N==="error"?(0,r.jsx)(Ri,{className:"h-3 w-3"}):(0,r.jsx)(ru,{className:"h-3 w-3"});return(0,r.jsxs)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:[(0,r.jsxs)("div",{className:"@container flex items-center gap-2",style:{containerType:"inline-size"},children:[(0,r.jsxs)("button",{type:"button",onClick:A,title:"Test",disabled:e.disabled||N==="probing"||!E||!i,className:`flex-shrink-0 inline-flex items-center gap-1.5 rounded-md border px-2 py-2 text-xs font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed @[280px]:px-3 ${R}`,children:[Z,(0,r.jsx)("span",{className:"hidden @[280px]:inline",children:"Test"})]}),(0,r.jsx)("input",{type:e.inputType??"url",className:Hr+" flex-1 min-w-0",value:i==null?"":String(i),placeholder:e.placeholder,disabled:o||e.disabled,onChange:G=>{a(G.target.value),p!=="idle"&&(v("idle"),w(null))}})]}),N==="ok"&&O?.labels&&O.labels.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1 mt-1.5",children:O.labels.map((G,V)=>(0,r.jsx)("span",{className:"text-xs bg-success/10 text-success rounded px-2 py-0.5 font-mono",children:G},V))}),N==="error"&&O?.error&&(0,r.jsx)("p",{className:"text-xs text-danger mt-1 truncate",title:O.error,children:O.error})]})}function hP({field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d}){const[m,h]=(0,n.useState)(e.defaultCollapsed??!1),p=e.style==="accordion";return(0,r.jsx)("div",{className:e.span===2?"col-span-2":e.span===3?"col-span-3":e.span===4?"col-span-4":"col-span-1",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-surface/50 overflow-hidden",children:[(0,r.jsxs)("div",{className:["px-3 py-2 flex items-center justify-between",p?"cursor-pointer hover:bg-surface":""].join(" "),onClick:p?()=>h(v=>!v):void 0,children:[(0,r.jsx)("span",{className:"text-xs font-semibold text-foreground",children:cr(e.label,l)}),p&&(0,r.jsx)("span",{className:"text-foreground-subtle text-xs",children:m?"▸":"▾"})]}),!m&&(0,r.jsx)("div",{className:"px-3 pb-3 grid grid-cols-2 gap-x-4 gap-y-3",children:e.fields.map(v=>(0,r.jsx)(wn,{field:v,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d},v.key))})]})})}function bP({field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:m}){const[h,p]=(0,n.useState)(e.tabs[0]?.id??""),v=e.span===2?"col-span-2":e.span===3?"col-span-3":e.span===4?"col-span-4":"col-span-1";return e.tabs.length===0?null:(0,r.jsxs)("div",{className:v,children:[e.label&&(0,r.jsx)("div",{className:Ta,children:cr(e.label,l)}),(0,r.jsxs)("div",{className:"rounded-lg border border-border-subtle bg-surface-hover/40 overflow-hidden",children:[(0,r.jsx)("div",{className:"flex flex-wrap gap-1 p-1.5 border-b border-border-subtle bg-surface/40",role:"tablist",children:e.tabs.map(y=>{const w=y.id===h;return(0,r.jsxs)("button",{type:"button",role:"tab","aria-selected":w,onClick:()=>p(y.id),className:`inline-flex items-center gap-1.5 whitespace-nowrap rounded-md px-2.5 py-1 text-[11px] transition-colors ${w?"bg-primary text-primary-foreground font-medium shadow-sm":"bg-transparent text-foreground-subtle hover:bg-surface hover:text-foreground"}`,children:[(0,r.jsx)("span",{children:cr(y.label,l)}),y.badge&&(0,r.jsx)("span",{className:`text-[9px] px-1 py-0.5 rounded-full font-medium ${w?"bg-primary-foreground/20 text-primary-foreground":"bg-primary/10 text-primary"}`,children:y.badge})]},y.id)})}),e.tabs.map(y=>y.id!==h?null:(0,r.jsx)("div",{role:"tabpanel",className:"px-3 pb-3 pt-2 grid grid-cols-2 gap-x-4 gap-y-3",children:y.fields.map((w,N)=>{const O="key"in w&&typeof w.key=="string"?w.key:`__${y.id}__${N}`;return(0,r.jsx)(wn,{field:w,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:m},O)})},y.id))]})]})}function yP({span:e}){return(0,r.jsx)("div",{className:e===2?"col-span-2":e===3?"col-span-3":e===4?"col-span-4":"col-span-full",children:(0,r.jsx)("hr",{className:"border-border"})})}var sf={info:{border:"border-info",bg:"bg-info/5",text:"text-info"},warning:{border:"border-warning",bg:"bg-warning/5",text:"text-warning"},success:{border:"border-success",bg:"bg-success/5",text:"text-success"},danger:{border:"border-danger",bg:"bg-danger/5",text:"text-danger"}};function _P(e){if(typeof window>"u"||typeof DOMParser>"u")return"";const i=new Set(["A","UL","OL","LI","STRONG","EM","CODE","BR","P","SPAN"]),a=new DOMParser().parseFromString(`<div>${e}</div>`,"text/html"),o=a.body.firstElementChild;if(!o)return"";const l=d=>{const m=Array.from(d.children);for(const h of m){if(!i.has(h.tagName)){const v=a.createTextNode(h.textContent??"");h.replaceWith(v);continue}const p=h.tagName==="A"?new Set(["href"]):new Set;for(const v of Array.from(h.attributes))p.has(v.name)||h.removeAttribute(v.name);if(h.tagName==="A"){const v=h.getAttribute("href")??"";!/^https?:\/\//i.test(v)&&!v.startsWith("mailto:")?h.removeAttribute("href"):(h.setAttribute("target","_blank"),h.setAttribute("rel","noopener noreferrer"))}l(h)}};return l(o),o.innerHTML}function xP({field:e}){const i=sf[e.variant??"info"]??sf.info,a=e.format==="html";return(0,r.jsx)("div",{className:"col-span-full",children:(0,r.jsxs)("div",{className:`rounded-md border-l-4 px-3 py-2.5 ${i.border} ${i.bg}`,children:[e.label&&(0,r.jsx)("p",{className:`text-xs font-semibold mb-0.5 ${i.text}`,children:e.label}),a?(0,r.jsx)("div",{className:"text-xs text-foreground-subtle leading-relaxed info-html-content",dangerouslySetInnerHTML:{__html:_P(e.content)}}):(0,r.jsx)("p",{className:"text-xs text-foreground-subtle leading-relaxed whitespace-pre-line",children:e.content})]})})}var cf={ok:"bg-success",warn:"bg-amber-500",danger:"bg-danger",idle:"bg-foreground-subtle/40",unknown:"bg-foreground-subtle/40"};function wP(e){if(!Number.isFinite(e)||e<0)return"—";if(e<1e3)return`${e}ms`;const i=Math.round(e/1e3);if(i<60)return`${i}s`;const a=Math.floor(i/60),o=i%60;return o===0?`${a}m`:`${a}m ${o}s`}function SP(e){return!Number.isFinite(e)||e<=0?"—":new Date(e).toLocaleTimeString()}function jP({kind:e,value:i}){return i==null||i===""?(0,r.jsx)("span",{className:"text-foreground-subtle/60",children:"—"}):e==="monospace"?(0,r.jsx)("span",{className:"font-mono text-[11px]",children:String(i)}):e==="status"?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${cf[String(i).toLowerCase()]??cf.unknown}`}),(0,r.jsx)("span",{children:String(i)})]}):e==="duration"&&typeof i=="number"?(0,r.jsx)("span",{className:"font-mono text-[11px]",children:wP(i)}):e==="timestamp"&&typeof i=="number"?(0,r.jsx)("span",{className:"font-mono text-[11px]",children:SP(i)}):(0,r.jsx)("span",{children:String(i)})}function $P({field:e}){const i=e.value??[],a=e.description;return(0,r.jsxs)("div",{className:"col-span-full",children:[e.label&&(0,r.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-foreground-subtle mb-1",children:e.label}),a&&(0,r.jsx)("p",{className:"text-xs text-foreground-subtle mb-2",children:a}),i.length===0?(0,r.jsx)("div",{className:"rounded-md border border-border bg-surface-subtle px-3 py-2 text-xs text-foreground-subtle",children:e.emptyMessage??"No entries"}):(0,r.jsx)("div",{className:"rounded-md border border-border overflow-hidden",children:(0,r.jsxs)("table",{className:"w-full text-xs",children:[(0,r.jsx)("thead",{className:"bg-surface-subtle border-b border-border",children:(0,r.jsx)("tr",{children:e.columns.map(o=>(0,r.jsx)("th",{className:"px-3 py-1.5 text-left font-medium text-foreground-subtle",style:o.width?{width:o.width}:void 0,children:o.label},o.key))})}),(0,r.jsx)("tbody",{className:"divide-y divide-border",children:i.map((o,l)=>(0,r.jsx)("tr",{className:"hover:bg-surface-hover/40",children:e.columns.map(d=>(0,r.jsx)("td",{className:"px-3 py-1.5 align-top text-foreground",children:(0,r.jsx)(jP,{kind:d.kind,value:o[d.key]})},d.key))},l))})]})})]})}function kP({field:e,value:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:m}){const h=Array.isArray(i)?i:[],p=e.minRows??0,v=e.maxRows??Number.POSITIVE_INFINITY,y=(R,Z,G)=>{const V=h.slice();V[R]={...V[R]??{},[Z]:G},a(V)},w=R=>{h.length<=p||a(h.filter((Z,G)=>G!==R))},N=()=>{if(h.length>=v)return;const R=e.defaultItem??{};a([...h,{...R}])},O=(R,Z)=>e.rowTitleTemplate?e.rowTitleTemplate.replace(/\{(\w+)\}/g,(G,V)=>{const re=R[V];return re==null||re===""?"—":String(re)}):`Row ${Z+1}`,E=h.length>p,A=h.length<v;return(0,r.jsxs)("div",{className:"col-span-full space-y-2",children:[(0,r.jsxs)("div",{className:"space-y-0.5",children:[e.label&&(0,r.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-foreground-subtle",children:cr(e.label,l)}),e.description&&(0,r.jsx)("p",{className:"text-[11px] text-foreground-subtle",children:cr(e.description,l)})]}),h.length===0?(0,r.jsx)("div",{className:"rounded-md border border-dashed border-border bg-background px-3 py-3 text-center text-[11px] text-foreground-subtle",children:e.emptyMessage??"No entries"}):(0,r.jsx)("div",{className:"space-y-2",children:h.map((R,Z)=>(0,r.jsxs)("div",{className:"rounded-md border border-border bg-background",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:O(R,Z)}),(0,r.jsxs)("button",{type:"button",onClick:()=>w(Z),disabled:o||!E,className:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] text-danger hover:bg-danger/10 disabled:opacity-30 disabled:cursor-not-allowed",title:E?"Remove this row":`At least ${p} row(s) required`,children:[(0,r.jsx)(Wl,{className:"h-3 w-3"}),"Remove"]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 @[420px]:grid-cols-2 gap-x-3 gap-y-2 p-3",children:e.itemFields.map(G=>(0,r.jsx)(wn,{field:G,values:R,onChange:(V,re)=>y(Z,V,re),disabled:o,translationFn:l,onTestField:d,allFields:e.itemFields,onAction:m},G.key))})]},Z))}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("button",{type:"button",onClick:N,disabled:o||!A,className:"inline-flex items-center gap-1 rounded border border-border bg-surface px-3 py-1 text-[11px] font-medium text-foreground hover:border-primary/40 hover:bg-primary/5 disabled:opacity-30 disabled:cursor-not-allowed",children:[(0,r.jsx)(Zi,{className:"h-3 w-3"}),e.addLabel??"Add"]}),!A&&Number.isFinite(v)&&(0,r.jsxs)("span",{className:"ml-2 text-[10px] text-foreground-subtle",children:["(limit: ",v,")"]})]})]})}function PP({field:e,disabled:i,onAction:a}){const[o,l]=(0,n.useState)(!1),d=Na(),m=async()=>{if(!(e.confirmMessage&&!await d({title:e.label,message:e.confirmMessage,confirmLabel:e.buttonLabel,variant:e.variant==="danger"?"danger":"default"}))&&a){l(!0);try{await a(e.action,e.key)}finally{l(!1)}}},h={default:"border border-border text-foreground hover:bg-surface-hover",primary:"bg-primary text-primary-foreground hover:bg-primary/90",danger:"bg-danger text-white hover:bg-danger/90"};return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,children:(0,r.jsx)("button",{onClick:m,disabled:i||o,className:`inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors disabled:opacity-50 ${h[e.variant??"default"]??h.default}`,children:o?"Processing...":e.buttonLabel})})}function lf(e,i){const a={...e.paramsStatic??{}};if(e.paramsFromForm)for(const[o,l]of Object.entries(e.paramsFromForm)){const d=i[l];d!=null&&d!==""&&(a[o]=d)}return a}function NP({field:e,value:i,values:a,onChange:o,disabled:l,onAction:d}){const[m,h]=(0,n.useState)(!1),[p,v]=(0,n.useState)(null),[y,w]=(0,n.useState)(null),N=lf(e,a),O=Object.keys(e.paramsFromForm??{}).some(Z=>N[Z]===void 0);(0,n.useEffect)(()=>{if(!d||O){w(null),v(null);return}let Z=!1;return h(!0),v(null),d(e.action,e.key,N).then(G=>{if(Z)return;const V=G;let re=[];if(Array.isArray(V))re=V;else if(V&&typeof V=="object")for(const te of Object.keys(V)){const ce=V[te];if(Array.isArray(ce)){re=ce;break}}w(re)}).catch(G=>{Z||(v(G instanceof Error?G.message:String(G)),w([]))}).finally(()=>{Z||h(!1)}),()=>{Z=!0}},[(e.refreshOn??Object.values(e.paramsFromForm??{})).map(Z=>`${Z}=${JSON.stringify(a[Z])}`).join("|"),d,e.action,e.key]);const E=e.mapOption.value,A=e.mapOption.label,R=e.mapOption.description;return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,children:O?(0,r.jsx)("div",{className:"text-[11px] text-foreground-subtle italic",children:e.emptyParamsMessage??"Fill the prerequisite fields above first."}):m?(0,r.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-foreground-subtle",children:[(0,r.jsx)(tr,{className:"h-3 w-3 animate-spin"})," Loading options…"]}):p?(0,r.jsx)("div",{className:"text-[11px] text-danger",children:p}):y&&y.length===0?(0,r.jsx)("div",{className:"text-[11px] text-foreground-subtle italic",children:e.emptyResultsMessage??"No options returned."}):(()=>{const Z=(y??[]).some(G=>{const V=G[E];return V===""||V===void 0});return(0,r.jsxs)("select",{className:"w-full rounded-md border border-border bg-surface px-2 py-1.5 text-xs text-foreground",value:typeof i=="string"?i:"",disabled:l,onChange:G=>o(G.target.value),children:[!Z&&(0,r.jsx)("option",{value:"",children:"— Select —"}),(y??[]).map((G,V)=>{const re=G[E],te=G[A],ce=R?G[R]:void 0,ye=typeof re=="string"&&re!==""?re:`row-${V}`;return(0,r.jsxs)("option",{value:typeof re=="string"?re:String(re??""),children:[typeof te=="string"?te:String(te??ye),ce!==void 0?` (${String(ce)})`:""]},ye)})]})})()})}function OP({field:e,values:i,disabled:a,onAction:o}){const[l,d]=(0,n.useState)(!1),[m,h]=(0,n.useState)(null),p=Na(),v=async()=>{if(e.confirmMessage&&!await p({title:e.label,message:e.confirmMessage,confirmLabel:e.buttonLabel,variant:e.variant==="danger"?"danger":"default"})||!o)return;const w=lf(e,i);d(!0),h(null);try{const N=await o(e.action,e.key,w),O=typeof N=="object"&&N!==null?N:null;h({kind:"ok",text:e.successMessage?e.successMessage.replace(/\{(\w+)\}/g,(E,A)=>{const R=O?.[A];return R===void 0?"":String(R)}):"Done."})}catch(N){h({kind:"error",text:N instanceof Error?N.message:String(N)})}finally{d(!1)}},y={default:"border border-border text-foreground hover:bg-surface-hover",primary:"bg-primary text-primary-foreground hover:bg-primary/90",danger:"bg-danger text-white hover:bg-danger/90"};return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,children:(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("button",{onClick:v,disabled:a||l,className:`inline-flex w-fit items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors disabled:opacity-50 ${y[e.variant??"default"]??y.default}`,children:l?"Working…":e.buttonLabel}),m&&(0,r.jsx)("div",{className:`text-[11px] ${m.kind==="ok"?"text-emerald-700 dark:text-emerald-300":"text-danger"}`,children:m.text})]})})}function CP({field:e}){const i=Gd();return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,children:(0,r.jsx)(nf,{widgetId:e.widgetId,host:"device-tab",config:e.widgetConfig,deviceId:i??void 0,instanceId:e.key})})}function IP(e,i){if(e==null)return"—";if(typeof e=="boolean")return e?"yes":"no";if(typeof e=="number"){const a=Number.isInteger(e)?String(e):e.toFixed(2);return i?`${a} ${i}`:a}return typeof e=="string"?e:JSON.stringify(e)}function EP({field:e,values:i,onAction:a,translationFn:o}){const l="key"in e?e.key:void 0;if(!l)return null;const d=i[l],m=d!==void 0?d:"default"in e?e.default:void 0,h=IP(m,"unit"in e?e.unit:void 0),p="label"in e?e.label:void 0,v="description"in e?e.description:void 0,y="span"in e?e.span:void 0,w="actions"in e?e.actions??[]:[];return(0,r.jsx)(Ot,{label:p,description:v,span:y,translationFn:o,children:(0,r.jsxs)("div",{className:"flex items-stretch gap-1",children:[(0,r.jsx)("div",{className:"flex-1 rounded-md border border-border bg-surface-alt px-2.5 py-1.5 text-xs text-foreground font-mono break-all",children:h}),w.length>0&&(0,r.jsx)("div",{className:"flex items-center gap-1",children:w.map(N=>(0,r.jsx)(DP,{action:N,fieldKey:l,value:m,onAction:a},N.action))})]})})}function MP({name:e}){const i="h-3.5 w-3.5";switch(e){case"copy":return(0,r.jsx)(xr,{className:i});case"refresh-cw":return(0,r.jsx)(Sa,{className:i});case"external-link":return(0,r.jsx)(Ts,{className:i});case"trash-2":return(0,r.jsx)(fr,{className:i});case"download":return(0,r.jsx)(zs,{className:i});case"upload":return(0,r.jsx)(tu,{className:i});default:return(0,r.jsx)(Bs,{className:i})}}function DP({action:e,fieldKey:i,value:a,onAction:o}){const l=Na(),[d,m]=(0,n.useState)(!1),h=e.variant==="danger"?"text-danger hover:bg-danger/10 border-danger/30":e.variant==="primary"?"text-primary hover:bg-primary/10 border-primary/30":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover border-border",p=async()=>{if(!(e.confirmMessage&&!await l({title:e.tooltip,message:e.confirmMessage,variant:e.variant==="danger"?"danger":"default"}))){if(e.action==="copy-value"){try{await navigator.clipboard.writeText(typeof a=="string"?a:String(a))}catch{}return}if(o){m(!0);try{await o(e.action,i)}finally{m(!1)}}}};return(0,r.jsx)("button",{type:"button",onClick:p,disabled:d,title:e.tooltip,className:`inline-flex items-center justify-center rounded-md border px-2 py-1.5 transition-colors disabled:opacity-50 ${h}`,children:(0,r.jsx)(MP,{name:e.icon})})}function AP(e){return"multiple"in e&&e.multiple!=null}function zP({field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,externalProbe:m,allFields:h,onAction:p}){const v=e.multiple,y=v.min,w=v.max,N=i[e.key],O=[...Array.isArray(N)?N:N!=null?[N]:[]],E=v.itemDefault!==void 0?v.itemDefault:"default"in e&&e.default!==void 0?e.default:"";for(;O.length<y;)O.push(E);const A=re=>a(e.key,[...re]),R=(re,te)=>{const ce=[...O];ce[re]=te,A(ce)},Z=()=>{O.length>=w||A([...O,E])},G=re=>{O.length<=y||A(O.filter((te,ce)=>ce!==re))},V=()=>{const{multiple:re,...te}=e;return{...te,...{label:void 0,description:void 0,required:!1}}};return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:y>0?e.required:!1,span:e.span,translationFn:l,children:(0,r.jsxs)("div",{className:"space-y-2",children:[O.map((re,te)=>{const ce=v.itemLabel?.replace("${n}",String(te+1));return(0,r.jsxs)("div",{className:"space-y-1",children:[ce&&(0,r.jsx)("div",{className:Ta,children:ce}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"flex-1 min-w-0",children:(0,r.jsx)(wn,{field:V(),values:{...i,[e.key]:re},onChange:(ye,ue)=>R(te,ue),disabled:o,translationFn:l,onTestField:d,onAction:p,allFields:h})}),O.length>y&&(0,r.jsx)("button",{type:"button",onClick:()=>G(te),disabled:o,title:"Remove",className:"flex-shrink-0 inline-flex items-center justify-center rounded-md border border-border p-1.5 text-foreground-subtle hover:text-danger hover:border-danger/50 transition-colors disabled:opacity-40",children:(0,r.jsx)(fr,{className:"h-3.5 w-3.5"})})]})]},te)}),(0,r.jsxs)("div",{className:"flex items-center justify-between pt-1",children:[O.length<w?(0,r.jsxs)("button",{type:"button",onClick:Z,disabled:o,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-40",children:[(0,r.jsx)(Zi,{className:"h-3 w-3"}),v.addLabel??"Add"]}):(0,r.jsx)("span",{}),(0,r.jsxs)("span",{className:"text-[10px] text-foreground-subtle tabular-nums",children:[O.length,"/",w]})]})]})})}function uf(e,i,a){if(!("showWhen"in e)||!e.showWhen)return!0;const o=e.showWhen,l=i[o.field],d=a?.find(p=>"key"in p&&p.key===o.field),m=d&&"default"in d?d.default:void 0,h=l!==void 0?l:m;return o.equals!==void 0?h===o.equals:o.notEquals!==void 0?h!==o.notEquals:o.in!==void 0?o.in.includes(h):o.notIn!==void 0?!o.notIn.includes(h):o.includes!==void 0?Array.isArray(h)&&h.includes(o.includes):o.notIncludes!==void 0?!Array.isArray(h)||!h.includes(o.notIncludes):!0}function wn({field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,externalProbe:m,allFields:h,onAction:p}){if(AP(e))return(0,r.jsx)(zP,{field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,externalProbe:m,allFields:h,onAction:p});if("readonlyField"in e&&e.readonlyField===!0)return(0,r.jsx)(EP,{field:e,values:i,onAction:p,translationFn:l});if(!uf(e,i,h))return null;const v=i[e.key],y=v!==void 0?v:"default"in e?e.default:void 0,w=O=>a(e.key,O),N=Fd(e.type);switch(e.type){case"text":return(0,r.jsx)(oP,{field:e,value:y,onChange:w,disabled:o,translationFn:l});case"number":return(0,r.jsx)(sP,{field:e,value:y,onChange:w,disabled:o,translationFn:l});case"boolean":return(0,r.jsx)(cP,{field:e,value:y,onChange:w,disabled:o,translationFn:l});case"select":return(0,r.jsx)(lP,{field:e,value:y,onChange:w,disabled:o,translationFn:l});case"multiselect":return(0,r.jsx)(uP,{field:e,value:y,onChange:w,disabled:o,translationFn:l});case"password":return(0,r.jsx)(dP,{field:e,value:y,onChange:w,disabled:o,translationFn:l});case"textarea":return(0,r.jsx)(fP,{field:e,value:y,onChange:w,disabled:o,translationFn:l});case"slider":return(0,r.jsx)(mP,{field:e,value:y,onChange:w,disabled:o,translationFn:l});case"tags":return(0,r.jsx)(gP,{field:e,value:y,onChange:w,disabled:o,translationFn:l});case"color":return(0,r.jsx)(pP,{field:e,value:y,onChange:w,disabled:o,translationFn:l});case"node-select":return(0,r.jsx)(af,{field:e,value:y,onChange:w,disabled:o,translationFn:l});case"node-multiselect":return(0,r.jsx)(of,{field:e,value:y,onChange:w,disabled:o,translationFn:l});case"probe":return(0,r.jsx)(vP,{field:e,value:y,onChange:w,disabled:o,translationFn:l,onTestField:d,onAction:p,externalProbe:m});case"group":return(0,r.jsx)(hP,{field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d});case"sub-tabs":return(0,r.jsx)(bP,{field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:p});case"separator":return(0,r.jsx)(yP,{});case"info":return(0,r.jsx)(xP,{field:e});case"object-array":return(0,r.jsx)($P,{field:e});case"editable-array":return(0,r.jsx)(kP,{field:e,value:y,onChange:w,disabled:o,translationFn:l,onTestField:d,onAction:p});case"button":return(0,r.jsx)(PP,{field:e,disabled:o,onAction:p});case"addon-action-select":return(0,r.jsx)(NP,{field:e,value:y,values:i,onChange:w,disabled:o,onAction:p});case"addon-action-button":return(0,r.jsx)(OP,{field:e,values:i,disabled:o,onAction:p});case"widget":return(0,r.jsx)(CP,{field:e});default:return N?(0,r.jsx)(N,{field:e,value:y,onChange:w,disabled:o}):null}}function TP(e){return/^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)+$/.test(e)}function cr(e,i){if(e!==void 0)return i&&TP(e)?i(e):e}function RP({section:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,probeResults:m}){const[h,p]=(0,n.useState)(e.defaultCollapsed??!1),v=e.style==="accordion",y=e.columns??2,w=y===1?"grid-cols-1":y===3?"grid-cols-1 @[480px]:grid-cols-2 @[880px]:grid-cols-3":y===4?"grid-cols-1 @[480px]:grid-cols-2 @[1140px]:grid-cols-4":"grid-cols-1 @[640px]:grid-cols-2";return(0,r.jsxs)("div",{className:"@container rounded-lg border border-border bg-surface p-3",style:{containerType:"inline-size"},children:[(0,r.jsxs)("div",{className:["flex items-center justify-between mb-2",v?"cursor-pointer":""].join(" "),onClick:v?()=>p(N=>!N):void 0,children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wider",children:cr(e.title,l)}),e.description&&(0,r.jsx)("p",{className:"text-[10px] text-foreground-subtle mt-0.5",children:cr(e.description,l)})]}),v&&(0,r.jsx)("span",{className:"text-foreground-subtle text-xs ml-2",children:h?"▸":"▾"})]}),!h&&(0,r.jsx)("div",{className:`grid ${w} gap-x-3 gap-y-2.5`,children:e.fields.map(N=>(0,r.jsx)(wn,{field:N,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,externalProbe:m?.[N.key]},N.key))})]})}function df({schema:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,probeResults:m,onClearProbe:h}){const p=(v,y)=>{a({...i,[v]:y}),h?.(v)};return(0,r.jsx)("div",{className:"space-y-4",children:e.sections.map(v=>(0,r.jsx)(RP,{section:v,values:i,onChange:p,disabled:o,translationFn:l,onTestField:d,probeResults:m},v.id))})}var ZP=({open:e})=>(0,r.jsx)("svg",{className:`h-3 w-3 transition-transform ${e?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,r.jsx)("polyline",{points:"9 18 15 12 9 6"})});function ff(e){const i={};if(!e)return i;for(const a of e.sections)for(const o of a.fields){if(o.type==="separator"||o.type==="info"||o.type==="button"||o.type==="group")continue;const l=o.key;i[l]=o.value}return i}function LP(e){return{...e,sections:e.sections.map(i=>({...i,fields:i.fields.map(a=>{if(a.type==="separator"||a.type==="info"||a.type==="button"||a.type==="group")return a;const{value:o,...l}=a;return l})}))}}function UP({trpc:e,addonId:i,nodeId:a,title:o,disabled:l,onAfterChange:d,refreshToken:m,collapsible:h,defaultOpen:p,mode:v,onOverrideChange:y}){const w=v??"persist",[N,O]=(0,n.useState)(null),[E,A]=(0,n.useState)(!0),[R,Z]=(0,n.useState)(null),[G,V]=(0,n.useState)(!1),[re,te]=(0,n.useState)(p??!1),[ce,ye]=(0,n.useState)({}),[ue,Ee]=(0,n.useState)(null);(0,n.useEffect)(()=>{Ee(null),ye({})},[e,i,a,m,w]),(0,n.useEffect)(()=>{let Xe=!1;A(!0),Z(null);const Ge=w==="override"&&Object.keys(ce).length>0?ce:void 0;return e.addonSettings.getGlobalSettings.query({addonId:i,nodeId:a,...Ge?{overlay:Ge}:{}}).then(Ae=>{Xe||(O(Ae),Ge||Ee(ff(Ae)),A(!1))}).catch(Ae=>{Xe||(Z(Ae instanceof Error?Ae.message:String(Ae)),A(!1))}),()=>{Xe=!0}},[e,i,a,m,w,JSON.stringify(ce)]);const Re=(0,n.useMemo)(()=>ff(N),[N]),et=(0,n.useMemo)(()=>N?LP(N):null,[N]),dt=async Xe=>{if(w==="override"){const Ae=ue??Re,pt={};for(const we of Object.keys(Xe))Xe[we]!==Ae[we]&&(pt[we]=Xe[we]);const ct={...Ae,...pt};ye(pt),y?.(pt,ct);return}const Ge={};for(const Ae of Object.keys(Xe))Xe[Ae]!==Re[Ae]&&(Ge[Ae]=Xe[Ae]);if(Object.keys(Ge).length!==0){V(!0);try{await e.addonSettings.updateGlobalSettings.mutate({addonId:i,nodeId:a,patch:Ge}),O(await e.addonSettings.getGlobalSettings.query({addonId:i,nodeId:a})),d?.()}catch(Ae){Z(Ae instanceof Error?Ae.message:String(Ae))}finally{V(!1)}}};if(E)return(0,r.jsxs)("div",{className:"text-xs text-foreground-subtle animate-pulse",children:["Loading ",o??i,"…"]});if(R)return(0,r.jsxs)("div",{className:"text-xs text-red-400",children:[o??i,": ",R]});if(!N||!et)return(0,r.jsxs)("div",{className:"text-xs text-foreground-subtle",children:[o??i," not available on ",a,"."]});const He=w==="override"?{...Re,...ce}:Re,Je=(0,r.jsxs)(r.Fragment,{children:[w==="override"?(0,r.jsx)("div",{className:"mb-2 text-[11px] text-foreground-subtle",children:"Benchmark override — applies to this run only. The addon's saved settings are not changed."}):null,(0,r.jsx)(df,{schema:et,values:He,onChange:dt,disabled:l===!0||G})]});return h===!0?(0,r.jsxs)("section",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>te(Xe=>!Xe),className:"w-full px-4 py-2 flex items-center gap-2 hover:bg-surface-hover text-left","aria-expanded":re,children:[(0,r.jsx)(ZP,{open:re}),(0,r.jsx)("h3",{className:"text-xs font-semibold text-foreground uppercase tracking-wide flex-1",children:o??i}),(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle",children:re?"hide":"edit"})]}),re?(0,r.jsx)("div",{className:"border-t border-border px-4 py-3",children:Je}):null]}):o?(0,r.jsxs)("section",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[(0,r.jsx)("div",{className:"border-b border-border px-4 py-2",children:(0,r.jsx)("h3",{className:"text-xs font-semibold text-foreground uppercase tracking-wide",children:o})}),(0,r.jsx)("div",{className:"px-4 py-3",children:Je})]}):(0,r.jsx)("div",{children:Je})}function mf({detections:{motion:e,motionRaw:i,detection:a,phase:o},showMotionZones:l=!0,showMotionRaw:d=!0,showDetections:m=!0,showPhaseIndicator:h=!0}){const p=l&&e&&e.zones.length>0,v=d&&i&&i.boxes.length>0,y=m&&a&&a.detections.length>0;return!p&&!v&&!y&&!h?null:(0,r.jsxs)("div",{className:"absolute inset-0 pointer-events-none z-10",children:[h&&(0,r.jsx)(BP,{phase:o}),v&&(0,r.jsx)(FP,{raw:i}),p&&(0,r.jsx)(GP,{motion:e}),y&&(0,r.jsx)(VP,{detections:a.detections,frameWidth:a.frameWidth,frameHeight:a.frameHeight})]})}function BP({phase:e}){const i=ps(e);return(0,r.jsxs)("div",{className:"absolute top-2 left-2 flex items-center gap-1.5 px-2 py-1 rounded-md bg-black/60 backdrop-blur-sm",children:[(0,r.jsx)("span",{className:`w-2 h-2 rounded-full ${i.dotClass}`}),(0,r.jsx)("span",{className:"text-[10px] font-semibold text-white uppercase tracking-wider",children:i.label})]})}function FP({raw:e}){return e.frameWidth===0||e.frameHeight===0?null:(0,r.jsx)(r.Fragment,{children:e.boxes.map((i,a)=>{const[o,l,d,m]=i.bbox,h=o/e.frameWidth*100,p=l/e.frameHeight*100,v=(d-o)/e.frameWidth*100,y=(m-l)/e.frameHeight*100,w=Math.max(.05,Math.min(.25,i.changeScore*.3));return(0,r.jsx)("div",{className:"absolute rounded-sm",style:{left:`${h}%`,top:`${p}%`,width:`${v}%`,height:`${y}%`,backgroundColor:`rgba(239, 68, 68, ${w})`}},`mr-${a}`)})})}function GP({motion:e}){return e.frameWidth===0||e.frameHeight===0?null:(0,r.jsx)(r.Fragment,{children:e.zones.filter(i=>i.w*i.h/(e.frameWidth*e.frameHeight)<.9).map((i,a)=>{const o=Math.max(.15,Math.min(.5,i.intensity/255));return(0,r.jsx)("div",{className:"absolute rounded-sm",style:{left:`${i.x/e.frameWidth*100}%`,top:`${i.y/e.frameHeight*100}%`,width:`${i.w/e.frameWidth*100}%`,height:`${i.h/e.frameHeight*100}%`,border:`1px solid rgba(250, 204, 21, ${o})`,backgroundColor:`rgba(250, 204, 21, ${o*.15})`}},`mz-${a}`)})})}function VP({detections:e,frameWidth:i,frameHeight:a}){return i===0||a===0?null:(0,r.jsx)(r.Fragment,{children:e.map(o=>{const{x:l,y:d,width:m,height:h}=o.bbox,p=l/i*100,v=d/a*100,y=m/i*100,w=h/a*100,N=Qt(o.macroClass),O=[`${o.macroClass} ${(o.score*100).toFixed(0)}%`];for(const E of o.labels)O.push(E.label);return(0,r.jsx)("div",{className:"absolute border-2 rounded-sm",style:{left:`${p}%`,top:`${v}%`,width:`${y}%`,height:`${w}%`,borderColor:N},children:(0,r.jsx)("div",{className:"absolute -top-4 left-0 px-1 py-0.5 text-[9px] font-bold text-white rounded-sm whitespace-nowrap",style:{backgroundColor:N},children:O.join(" | ")})},`det-${o.id}`)})})}function QP(e){const i={};if(typeof window<"u"){if(e){const o=e.getBoundingClientRect();o.width>0&&o.height>0&&(i.viewportWidth=Math.round(o.width),i.viewportHeight=Math.round(o.height))}i.viewportWidth===void 0&&(i.viewportWidth=window.innerWidth,i.viewportHeight=window.innerHeight),i.devicePixelRatio=window.devicePixelRatio||1;const a=navigator.connection;a?.downlink&&a.downlink>0&&(i.downlinkMbps=a.downlink)}return i}var WP=3e3,qP=5;function gf({serverUrl:e,streamKey:i,label:a,autoPlay:o=!0,muted:l=!0,showControls:d=!0,className:m="",onStateChange:h,onError:p,overlay:v,createSession:y,sendAnswer:w,closeSession:N,hintsOverride:O}){const E=(0,n.useRef)(null),A=(0,n.useRef)(null),R=(0,n.useRef)(null),Z=(0,n.useRef)(new Set),G=(0,n.useRef)(null),V=(0,n.useRef)(null),re=(0,n.useRef)(0),te=(0,n.useRef)(!0),[ce,ye]=(0,n.useState)("idle"),[ue,Ee]=(0,n.useState)(""),[Re,et]=(0,n.useState)(l),[dt,He]=(0,n.useState)(!1),[Je,Xe]=(0,n.useState)(!1),Ge=(0,n.useRef)(null),Ae=(0,n.useRef)(!1);(w||y)&&(Ae.current=!0);const pt=Ae.current,ct=(0,n.useCallback)(Fe=>{ye(Fe),h?.(Fe)},[h]),we=(0,n.useCallback)(()=>{if(G.current?.abort(),G.current=null,V.current&&(clearTimeout(V.current),V.current=null),R.current&&(R.current.close(),R.current=null),N&&Z.current.size>0){for(const Fe of Z.current)N(Fe).catch(()=>{});Z.current.clear()}E.current&&(E.current.srcObject=null)},[N]),Oe=(0,n.useCallback)(async()=>{if(!te.current||!y||!w)return;we(),ct("connecting");const Fe=new AbortController;G.current=Fe;try{const{sessionId:lt,sdpOffer:_t}=await y({...QP(A.current),...O});if(Z.current.add(lt),!te.current||Fe.signal.aborted){N?.(lt).catch(()=>{}),Z.current.delete(lt);return}const xt=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});R.current=xt;const ke=new MediaStream;xt.ontrack=je=>{console.debug("[WebRTC] ontrack",je.track.kind,je.track.readyState),ke.addTrack(je.track),E.current&&(E.current.srcObject=ke,E.current.play().catch(()=>{}))},xt.oniceconnectionstatechange=()=>{if(!te.current)return;const je=xt.iceConnectionState;console.debug("[WebRTC] ICE state:",je),je==="connected"||je==="completed"?(re.current=0,ct("playing"),E.current?.paused&&(console.debug("[WebRTC] video was paused at ICE connected — calling play()"),E.current.play().catch(()=>{}))):(je==="failed"||je==="disconnected"||je==="closed")&&(ct("disconnected"),Le())},xt.onicecandidateerror=je=>{console.debug("[WebRTC] ICE candidate error:",je)},console.debug("[WebRTC] Setting remote description (server offer)..."),await xt.setRemoteDescription({type:"offer",sdp:_t});const de=await xt.createAnswer();if(await xt.setLocalDescription(de),console.debug("[WebRTC] Local description set, waiting for ICE gathering..."),await pf(xt),!te.current)return;const Se=(xt.localDescription?.sdp??"").split(`
141
- `).filter(je=>je.startsWith("a=candidate:")).length;console.debug("[WebRTC] Sending answer to server",{localCandidates:Se,sessionId:lt.slice(0,8)}),await w(lt,xt.localDescription?.sdp??""),console.debug("[WebRTC] Answer sent successfully");const Ve=xt,tt=()=>{const je=Ve.connectionState;if(je==="closed"||je==="failed")return;const Qe=E.current;Qe&&Qe.readyState===0&&console.log(`[WebRTC] no video data yet (ice=${Ve.iceConnectionState})`)};setTimeout(tt,3e3),setTimeout(tt,8e3)}catch(lt){if(!te.current)return;const _t=lt instanceof Error?lt.message:String(lt);Ee(_t),ct("error"),p?.(_t),Le()}},[e,i,y,w,we,ct,p,O]),Pe=(0,n.useCallback)(async()=>{if(te.current){we(),ct("connecting");try{const Fe=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});R.current=Fe,Fe.addTransceiver("video",{direction:"recvonly"}),Fe.addTransceiver("audio",{direction:"recvonly"});const lt=new MediaStream;Fe.ontrack=Se=>{lt.addTrack(Se.track),E.current&&(E.current.srcObject=lt,E.current.play().catch(()=>{}))},Fe.oniceconnectionstatechange=()=>{if(!te.current)return;const Se=Fe.iceConnectionState;Se==="connected"||Se==="completed"?(re.current=0,ct("playing"),E.current?.paused&&E.current.play().catch(()=>{})):(Se==="failed"||Se==="disconnected"||Se==="closed")&&(ct("disconnected"),Le())};const _t=await Fe.createOffer();if(await Fe.setLocalDescription(_t),await pf(Fe),!te.current)return;const xt=`${e}/api/webrtc?src=${encodeURIComponent(i)}`,ke=await fetch(xt,{method:"POST",headers:{"Content-Type":"application/sdp"},body:Fe.localDescription?.sdp??""});if(!ke.ok)throw new Error(`WHEP ${ke.status}: ${ke.statusText}`);const de=await ke.text();await Fe.setRemoteDescription({type:"answer",sdp:de})}catch(Fe){if(!te.current)return;const lt=Fe instanceof Error?Fe.message:String(Fe);Ee(lt),ct("error"),p?.(lt),Le()}}},[e,i,we,ct,p]),Ke=pt?Oe:Pe,ze=(0,n.useRef)(()=>{});ze.current=Ke;const Le=(0,n.useCallback)(()=>{te.current&&(re.current>=qP||(re.current+=1,V.current=setTimeout(()=>{te.current&&ze.current()},WP)))},[]);(0,n.useEffect)(()=>(te.current=!0,re.current=0,o&&Ke(),()=>{te.current=!1,we()}),[e,i]);const Ue=(0,n.useRef)(!1);(0,n.useEffect)(()=>{!o||!pt||!y||!w||Ue.current||R.current||(Ue.current=!0,Ke())},[o,pt,y,w,Ke]);const De=()=>{re.current=0,Ke()},qe=()=>{E.current&&(E.current.muted=!E.current.muted,et(E.current.muted))},Be=async()=>{if(A.current)try{document.fullscreenElement?await document.exitFullscreen():await A.current.requestFullscreen()}catch(Fe){console.warn(`Fullscreen toggle failed: ${Fe instanceof Error?Fe.message:Fe}`)}},Rt=()=>{if(!E.current)return;const Fe=document.createElement("canvas");Fe.width=E.current.videoWidth||1280,Fe.height=E.current.videoHeight||720;const lt=Fe.getContext("2d");if(!lt)return;lt.drawImage(E.current,0,0);const _t=document.createElement("a");_t.download=`${i.replace(/[/:]/g,"-")}-${Date.now()}.jpg`,_t.href=Fe.toDataURL("image/jpeg",.92),_t.click()};(0,n.useEffect)(()=>{const Fe=()=>He(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",Fe),()=>document.removeEventListener("fullscreenchange",Fe)},[]);const Zt=()=>{Xe(!0),Ge.current&&clearTimeout(Ge.current),Ge.current=setTimeout(()=>Xe(!1),3e3)};return(0,r.jsxs)("div",{ref:A,className:`relative bg-black overflow-hidden group ${m}`,onMouseMove:Zt,onMouseEnter:Zt,children:[(0,r.jsx)("video",{ref:E,autoPlay:o,muted:Re,playsInline:!0,className:"w-full h-full object-contain"}),a&&ce==="playing"&&(0,r.jsx)("div",{className:"absolute top-2 left-2 px-2 py-0.5 rounded bg-black/60 text-[10px] text-white font-medium",children:a}),v,ce==="connecting"&&(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-black/70 gap-2",children:[(0,r.jsx)("svg",{className:"h-6 w-6 text-white/60 animate-spin",viewBox:"0 0 24 24",fill:"none",children:(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",className:"animate-[dash_1.5s_ease-in-out_infinite]"})}),(0,r.jsx)("span",{className:"text-xs text-white/60",children:"Connecting…"})]}),(ce==="error"||ce==="disconnected")&&(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-black/70 gap-2",children:[(0,r.jsx)("svg",{className:"h-6 w-6 text-red-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,r.jsx)("path",{d:"M1 1l5.5 5.5M23 23l-5.5-5.5M8.11 15.89a8 8 0 0110.78-10.78M3.64 3.64A12 12 0 0020.36 20.36",strokeLinecap:"round"})}),(0,r.jsx)("span",{className:"text-xs text-red-400 text-center px-4",children:ce==="error"?ue||"Connection failed":"Disconnected"}),(0,r.jsx)("button",{onClick:De,className:"mt-1 inline-flex items-center gap-1.5 rounded px-3 py-1 text-xs bg-white/10 text-white hover:bg-white/20 transition-colors",children:"Reconnect"})]}),d&&ce==="playing"&&(0,r.jsxs)("div",{className:`absolute bottom-0 inset-x-0 flex items-center justify-between px-3 py-1.5 bg-gradient-to-t from-black/80 to-transparent transition-opacity duration-200 ${Je?"opacity-100":"opacity-0"}`,children:[(0,r.jsx)("div",{className:"flex items-center gap-1",children:(0,r.jsx)(yc,{onClick:qe,title:Re?"Unmute":"Mute",children:Re?(0,r.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[(0,r.jsx)("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),(0,r.jsx)("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),(0,r.jsx)("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):(0,r.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[(0,r.jsx)("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),(0,r.jsx)("path",{d:"M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"})]})})}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(yc,{onClick:Rt,title:"Take snapshot",children:(0,r.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[(0,r.jsx)("path",{d:"M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z"}),(0,r.jsx)("circle",{cx:"12",cy:"13",r:"4"})]})}),(0,r.jsx)(yc,{onClick:Be,title:dt?"Exit fullscreen":"Fullscreen",children:dt?(0,r.jsx)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,r.jsx)("path",{d:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3"})}):(0,r.jsx)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,r.jsx)("path",{d:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3"})})})]})]})]})}function yc({onClick:e,title:i,children:a}){return(0,r.jsx)("button",{onClick:e,title:i,className:"rounded-full p-1.5 text-white/80 hover:text-white hover:bg-white/20 transition-colors",children:a})}async function pf(e){if(e.iceGatheringState!=="complete")return new Promise(i=>{const a=()=>{e.iceGatheringState==="complete"&&(e.removeEventListener("icegatheringstatechange",a),i())};e.addEventListener("icegatheringstatechange",a),setTimeout(i,5e3)})}var _c=_r("camstack:player-overlays-state",null),xc=_r("camstack:player-overlays-actions",null);function HP({children:e}){const[i,a]=(0,n.useState)(()=>new Map),[o,l]=(0,n.useState)(()=>new Map),d=(0,n.useCallback)(w=>{a(N=>{const O=new Map(N);return O.set(w.id,w),O})},[]),m=(0,n.useCallback)(w=>{a(N=>{if(!N.has(w))return N;const O=new Map(N);return O.delete(w),O})},[]),h=(0,n.useCallback)(w=>{l(N=>{const O=new Map(N);return O.set(w.id,w),O})},[]),p=(0,n.useCallback)(w=>{l(N=>{if(!N.has(w))return N;const O=new Map(N);return O.delete(w),O})},[]),v=(0,n.useMemo)(()=>({layers:i,buttons:o}),[i,o]),y=(0,n.useMemo)(()=>({setLayer:d,removeLayer:m,setButton:h,removeButton:p}),[d,m,h,p]);return(0,r.jsx)(_c.Provider,{value:v,children:(0,r.jsx)(xc.Provider,{value:y,children:e})})}function JP(){const e=(0,n.useContext)(_c);return(0,n.useMemo)(()=>e?[...e.layers.values()].sort((i,a)=>i.order-a.order):[],[e])}function vf(){const e=(0,n.useContext)(_c);return(0,n.useMemo)(()=>e?[...e.buttons.values()].sort((i,a)=>i.order-a.order):[],[e])}function KP(e){const i=(0,n.useContext)(xc);(0,n.useEffect)(()=>{if(!(!i||!e))return i.setLayer(e),()=>i.removeLayer(e.id)},[i,e])}function XP(e){const i=(0,n.useContext)(xc);(0,n.useEffect)(()=>{if(!(!i||!e))return i.setButton(e),()=>i.removeButton(e.id)},[i,e])}function YP(e){return e==="streaming"?"bg-emerald-500":e==="connecting"?"bg-amber-500":e==="error"?"bg-rose-500":"bg-zinc-500"}function eN(e){const i=Math.floor(e/1e3);return i<60?`${i}s`:i<3600?`${Math.floor(i/60)}m`:`${Math.floor(i/3600)}h${Math.floor(i%3600/60)}m`}function wc({className:e}){return(0,r.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polygon",{points:"5 3 19 12 5 21 5 3"})})}function tN({className:e}){return(0,r.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})})}function rN({className:e}){return(0,r.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z"}),(0,r.jsx)("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),(0,r.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),(0,r.jsx)("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]})}function nN({className:e}){return(0,r.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:[(0,r.jsx)("circle",{cx:"5",cy:"12",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"2"}),(0,r.jsx)("circle",{cx:"19",cy:"12",r:"2"})]})}function Sc({label:e,active:i,onClick:a}){return(0,r.jsxs)("button",{type:"button",onClick:a,className:"w-full flex items-center justify-between gap-3 px-3 py-1.5 text-[11px] text-foreground hover:bg-surface-hover transition-colors",children:[(0,r.jsx)("span",{children:e}),(0,r.jsx)("span",{className:`inline-block h-3 w-5 rounded-full transition-colors ${i?"bg-primary":"bg-foreground-subtle/30"} relative`,children:(0,r.jsx)("span",{className:`absolute top-0.5 h-2 w-2 rounded-full bg-white transition-all ${i?"left-2.5":"left-0.5"}`})})]})}function hf({className:e}){return(0,r.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,r.jsx)("polyline",{points:"1 20 1 14 7 14"}),(0,r.jsx)("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]})}function iN({className:e}){return(0,r.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"2",y1:"2",x2:"22",y2:"22"}),(0,r.jsx)("path",{d:"M10.41 10.41a2 2 0 11-2.83-2.83"}),(0,r.jsx)("line",{x1:"13.5",y1:"13.5",x2:"6",y2:"21"}),(0,r.jsx)("path",{d:"M18 12l-1.5-1.5"}),(0,r.jsx)("path",{d:"M21 15V5a2 2 0 00-2-2H5"}),(0,r.jsx)("path",{d:"M21 21H5a2 2 0 01-2-2V11"})]})}function aN({serverUrl:e,createSession:i,sendAnswer:a,closeSession:o,streams:l,activeStreamId:d,onStreamChange:m,deviceName:h,phase:p,pipelineMetrics:v,detections:y,defaultShowDetections:w=!0,defaultShowMotion:N=!1,streamStats:O,autoPlay:E=!1,showPlayStop:A=!1,snapshotSrc:R,snapshotLoading:Z=!1,onRefreshSnapshot:G,showStreamStats:V=!1,children:re,extraOverlay:te,ptzAvailable:ce=!1,ptzShown:ye=!1,ptzOverlay:ue,onPtzToggle:Ee,intercomAvailable:Re=!1,intercomShown:et=!1,onIntercomToggle:dt,chromeless:He=!1,className:Je}){const Xe=vf(),[Ge,Ae]=(0,n.useState)(E),[pt,ct]=(0,n.useState)(w),[we,Oe]=(0,n.useState)(N),[Pe,Ke]=(0,n.useState)(null),[ze,Le]=(0,n.useState)(!1),Ue=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!ze)return;function je(Qe){Ue.current&&!Ue.current.contains(Qe.target)&&Le(!1)}return document.addEventListener("mousedown",je),()=>document.removeEventListener("mousedown",je)},[ze]);const De=d??Pe??l?.[0]?.id??"",qe=l?.find(je=>je.id===De)??l?.[0],Be=qe?.inputFps!=null?{status:qe.status??"unknown",inputFps:qe.inputFps,bitrateKbps:qe.bitrateKbps??0}:null,Rt=je=>{Ke(je),m?.(je),Ge&&A&&(Ae(!1),setTimeout(()=>Ae(!0),50))},Zt=(0,n.useMemo)(()=>{const je=qe?.target;if(je)return Qe=>i(je,Qe)},[i,qe]),Fe=l,lt=()=>Ae(!0),_t=()=>Ae(!1),xt=v?.phase??p,ke=xt==="active",de=!!y,Se=de&&(pt||we),Ve=ce&&ye&&!!ue,tt=A?Ge:!0;return(0,r.jsxs)("div",{className:`overflow-hidden ${He?"":"rounded-xl border border-border bg-surface"} ${Je??""}`,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(O??Be)&&(0,r.jsx)("span",{className:`w-2 h-2 rounded-full ${YP((O??Be).status)}`}),h&&(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:h}),Fe&&Fe.length>1&&(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("select",{"data-testid":"stream-profile-select",value:De,onChange:je=>Rt(je.target.value),className:"appearance-none cursor-pointer rounded-md border border-border bg-surface-hover hover:bg-surface text-foreground text-[11px] font-medium pl-2 pr-6 py-1 focus:outline-none focus:ring-1 focus:ring-primary transition-colors",children:Fe.map(je=>(0,r.jsx)("option",{value:je.id,children:je.label},je.id))}),(0,r.jsx)("span",{className:"pointer-events-none absolute right-1.5 top-1/2 -translate-y-1/2 text-foreground-subtle",children:(0,r.jsx)("svg",{className:"h-2.5 w-2.5",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polyline",{points:"3 4.5 6 7.5 9 4.5"})})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[Re&&(0,r.jsxs)("button",{"data-testid":"stream-intercom-toggle","data-intercom-shown":et?"true":"false",onClick:dt,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors ${et?"bg-primary/15 text-primary":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover"}`,title:et?"Close intercom":"Open intercom",children:[(0,r.jsx)(rN,{className:"h-3 w-3"}),(0,r.jsx)("span",{className:"hidden xl:inline",children:"Intercom"})]}),Xe.map(je=>{const Qe=je.tone==="primary"?"bg-primary text-primary-foreground":"bg-primary/15 text-primary";return(0,r.jsxs)("button",{type:"button","data-toolbar-button-id":je.id,"data-toolbar-button-active":je.active?"true":"false",onClick:je.onClick,disabled:je.disabled,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors disabled:opacity-50 ${je.active?Qe:"text-foreground-subtle hover:text-foreground hover:bg-surface-hover"}`,title:je.title??je.label,children:[je.icon,(0,r.jsx)("span",{className:"hidden xl:inline",children:je.label})]},je.id)}),A&&(0,r.jsxs)("button",{"data-testid":"stream-play-toggle","data-stream-playing":tt?"true":"false",onClick:tt?_t:lt,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors ${tt?"bg-danger/10 text-danger hover:bg-danger/20":"bg-primary/10 text-primary hover:bg-primary/20"}`,title:tt?"Stop stream":"Start stream",children:[tt?(0,r.jsx)(tN,{className:"h-3 w-3"}):(0,r.jsx)(wc,{className:"h-3 w-3"}),(0,r.jsx)("span",{className:"hidden xl:inline",children:tt?"Stop":"Play"})]}),G&&(0,r.jsxs)("button",{"data-testid":"stream-snapshot-refresh",onClick:G,disabled:Z,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50",title:"Force snapshot refresh",children:[(0,r.jsx)(hf,{className:`h-3 w-3 ${Z?"animate-spin":""}`}),(0,r.jsx)("span",{className:"hidden xl:inline",children:"Snapshot"})]}),(de||ce||v||xt||O||Be&&Be.inputFps>0)&&(0,r.jsxs)("div",{ref:Ue,className:"relative",children:[(0,r.jsx)("button",{onClick:()=>Le(je=>!je),title:"More controls",className:"inline-flex items-center justify-center rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:(0,r.jsx)(nN,{className:"h-3.5 w-3.5"})}),ze&&(0,r.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-30 min-w-[200px] rounded-lg border border-border bg-surface shadow-xl py-1.5",children:[V&&O&&(0,r.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Input"}),(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:[O.inputFps.toFixed(1)," fps"]})]}),(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Decode"}),(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:[O.decodeFps.toFixed(1)," fps"]})]}),(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Uptime"}),(0,r.jsx)("span",{className:"tabular-nums text-foreground",children:eN(O.uptimeMs)})]})]}),!V&&Be&&Be.inputFps>0&&(0,r.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Input"}),(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:[Be.inputFps.toFixed(1)," fps"]})]}),Be.bitrateKbps>0&&(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Bitrate"}),(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:[Be.bitrateKbps," kbps"]})]})]}),(v||de&&xt)&&(0,r.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex justify-between gap-3 items-center",children:[(0,r.jsx)("span",{children:"Phase"}),(0,r.jsxs)("span",{className:`flex items-center gap-1 font-semibold uppercase tracking-wider ${ke?"text-red-400":"text-emerald-400"}`,children:[(0,r.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${ke?"bg-red-500 animate-pulse":"bg-emerald-500"}`}),ke?"Active":"Watching"]})]}),v&&v.detectionFps>0&&(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Detection"}),(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:[v.detectionFps.toFixed(1)," det/s"]})]}),v&&v.avgInferenceMs>0&&(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Inference"}),(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:[v.avgInferenceMs.toFixed(0)," ms"]})]})]}),de&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Sc,{label:"Show detections",active:pt,onClick:()=>ct(je=>!je)}),(0,r.jsx)(Sc,{label:"Show motion",active:we,onClick:()=>Oe(je=>!je)})]}),ce&&(0,r.jsx)(Sc,{label:"PTZ controls",active:ye,onClick:()=>{Ee?.(),Le(!1)}})]})]})]})]}),tt?(0,r.jsx)("div",{className:"aspect-video relative",children:(0,r.jsx)(gf,{serverUrl:e,streamKey:De,autoPlay:!0,className:"w-full h-full",createSession:Zt,sendAnswer:a,closeSession:o,overlay:Se||te||Ve?(0,r.jsxs)(r.Fragment,{children:[Se&&(0,r.jsx)(mf,{detections:y,showPhaseIndicator:!1,showMotionZones:we,showMotionRaw:we,showDetections:pt}),te,Ve&&ue]}):void 0},De)}):(0,r.jsx)(oN,{src:R??null,isLoading:Z,onPlay:lt,onRetry:G,extraOverlay:te||Ve?(0,r.jsxs)(r.Fragment,{children:[te,Ve&&ue]}):null,suppressPlayHover:!!te||Ve}),re]})}function oN({src:e,isLoading:i,onPlay:a,onRetry:o,extraOverlay:l,suppressPlayHover:d=!1}){return e?(0,r.jsxs)("div",{className:"relative w-full aspect-video bg-black/90 flex items-center justify-center",children:[(0,r.jsx)("img",{src:e,alt:"Camera snapshot",className:"w-full h-full object-contain"}),!d&&(0,r.jsx)("button",{onClick:a,className:"absolute inset-0 flex items-center justify-center bg-black/30 opacity-0 hover:opacity-100 transition-opacity cursor-pointer",children:(0,r.jsx)("div",{className:"h-14 w-14 rounded-full bg-white/20 backdrop-blur-sm flex items-center justify-center",children:(0,r.jsx)(wc,{className:"h-7 w-7 text-white ml-0.5"})})}),l]}):i?(0,r.jsx)("div",{className:"relative w-full aspect-video bg-black/90 flex items-center justify-center",children:(0,r.jsx)("div",{className:"h-8 w-8 border-2 border-white/20 border-t-white/60 rounded-full animate-spin"})}):(0,r.jsx)("div",{className:"relative w-full aspect-video bg-black/90 flex items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 text-white/40",children:[(0,r.jsx)(iN,{className:"h-8 w-8"}),(0,r.jsx)("span",{className:"text-xs",children:"No snapshot available"}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[o&&(0,r.jsxs)("button",{onClick:o,className:"inline-flex items-center gap-1.5 rounded-md border border-white/20 px-3 py-1.5 text-xs font-medium text-white/60 hover:text-white hover:border-white/40 transition-colors",children:[(0,r.jsx)(hf,{className:"h-3 w-3"}),"Retry"]}),(0,r.jsxs)("button",{onClick:a,className:"inline-flex items-center gap-1.5 rounded-md bg-primary/80 px-3 py-1.5 text-xs font-medium text-white hover:bg-primary transition-colors",children:[(0,r.jsx)(wc,{className:"h-3 w-3"}),"Play Live"]})]})]})})}var bf={value:"auto",label:"Auto (best available)"};function sN(e){return e.charAt(0).toUpperCase()+e.slice(1)}function cN({deviceId:e,value:i,onChange:a,disabled:o,label:l,className:d}){const m=(0,n.useId)(),h=Wd({deviceId:e},{refetchOnWindowFocus:!1}),[p,v]=(0,n.useState)([bf]);(0,n.useEffect)(()=>{if(!h.data)return;const N=`${e}/`,O=[bf];for(const E of h.data){if(!E.enabled)continue;const A=E.brokerId.startsWith(N)?E.brokerId.slice(N.length):E.brokerId;O.push({value:A,label:sN(A)})}v(O)},[h.data,e]);const y=l??"Preferred stream",w=h.isLoading?"Loading available streams…":h.isError?"Could not load streams — only Auto available.":p.length===1?"No enabled streams found — only Auto available.":null;return(0,r.jsxs)("div",{className:d,children:[(0,r.jsx)("label",{id:m,className:"text-xs font-medium text-foreground-muted block mb-1",children:y}),(0,r.jsx)(Ui,{"aria-labelledby":m,options:p,value:i,disabled:o,onChange:N=>a(N.target.value)}),w!==null&&(0,r.jsx)("p",{className:"text-foreground-subtle text-[10px] mt-1",children:w})]})}var lN=Object.defineProperty,Ra=Object.getOwnPropertySymbols,yf=Object.prototype.hasOwnProperty,_f=Object.prototype.propertyIsEnumerable,xf=(e,i,a)=>i in e?lN(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a,jc=(e,i)=>{for(var a in i||(i={}))yf.call(i,a)&&xf(e,a,i[a]);if(Ra)for(var a of Ra(i))_f.call(i,a)&&xf(e,a,i[a]);return e},$c=(e,i)=>{var a={};for(var o in e)yf.call(e,o)&&i.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&Ra)for(var o of Ra(e))i.indexOf(o)<0&&_f.call(e,o)&&(a[o]=e[o]);return a};/**
142
- * @license QR Code generator library (TypeScript)
143
- * Copyright (c) Project Nayuki.
144
- * SPDX-License-Identifier: MIT
145
- */var Jr;(e=>{const i=class st{constructor(p,v,y,w){if(this.version=p,this.errorCorrectionLevel=v,this.modules=[],this.isFunction=[],p<st.MIN_VERSION||p>st.MAX_VERSION)throw new RangeError("Version value out of range");if(w<-1||w>7)throw new RangeError("Mask value out of range");this.size=p*4+17;let N=[];for(let E=0;E<this.size;E++)N.push(!1);for(let E=0;E<this.size;E++)this.modules.push(N.slice()),this.isFunction.push(N.slice());this.drawFunctionPatterns();const O=this.addEccAndInterleave(y);if(this.drawCodewords(O),w==-1){let E=1e9;for(let A=0;A<8;A++){this.applyMask(A),this.drawFormatBits(A);const R=this.getPenaltyScore();R<E&&(w=A,E=R),this.applyMask(A)}}l(0<=w&&w<=7),this.mask=w,this.applyMask(w),this.drawFormatBits(w),this.isFunction=[]}static encodeText(p,v){const y=e.QrSegment.makeSegments(p);return st.encodeSegments(y,v)}static encodeBinary(p,v){const y=e.QrSegment.makeBytes(p);return st.encodeSegments([y],v)}static encodeSegments(p,v,y=1,w=40,N=-1,O=!0){if(!(st.MIN_VERSION<=y&&y<=w&&w<=st.MAX_VERSION)||N<-1||N>7)throw new RangeError("Invalid value");let E,A;for(E=y;;E++){const V=st.getNumDataCodewords(E,v)*8,re=m.getTotalBits(p,E);if(re<=V){A=re;break}if(E>=w)throw new RangeError("Data too long")}for(const V of[st.Ecc.MEDIUM,st.Ecc.QUARTILE,st.Ecc.HIGH])O&&A<=st.getNumDataCodewords(E,V)*8&&(v=V);let R=[];for(const V of p){a(V.mode.modeBits,4,R),a(V.numChars,V.mode.numCharCountBits(E),R);for(const re of V.getData())R.push(re)}l(R.length==A);const Z=st.getNumDataCodewords(E,v)*8;l(R.length<=Z),a(0,Math.min(4,Z-R.length),R),a(0,(8-R.length%8)%8,R),l(R.length%8==0);for(let V=236;R.length<Z;V^=253)a(V,8,R);let G=[];for(;G.length*8<R.length;)G.push(0);return R.forEach((V,re)=>G[re>>>3]|=V<<7-(re&7)),new st(E,v,G,N)}getModule(p,v){return 0<=p&&p<this.size&&0<=v&&v<this.size&&this.modules[v][p]}getModules(){return this.modules}drawFunctionPatterns(){for(let y=0;y<this.size;y++)this.setFunctionModule(6,y,y%2==0),this.setFunctionModule(y,6,y%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const p=this.getAlignmentPatternPositions(),v=p.length;for(let y=0;y<v;y++)for(let w=0;w<v;w++)y==0&&w==0||y==0&&w==v-1||y==v-1&&w==0||this.drawAlignmentPattern(p[y],p[w]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(p){const v=this.errorCorrectionLevel.formatBits<<3|p;let y=v;for(let N=0;N<10;N++)y=y<<1^(y>>>9)*1335;const w=(v<<10|y)^21522;l(w>>>15==0);for(let N=0;N<=5;N++)this.setFunctionModule(8,N,o(w,N));this.setFunctionModule(8,7,o(w,6)),this.setFunctionModule(8,8,o(w,7)),this.setFunctionModule(7,8,o(w,8));for(let N=9;N<15;N++)this.setFunctionModule(14-N,8,o(w,N));for(let N=0;N<8;N++)this.setFunctionModule(this.size-1-N,8,o(w,N));for(let N=8;N<15;N++)this.setFunctionModule(8,this.size-15+N,o(w,N));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let p=this.version;for(let y=0;y<12;y++)p=p<<1^(p>>>11)*7973;const v=this.version<<12|p;l(v>>>18==0);for(let y=0;y<18;y++){const w=o(v,y),N=this.size-11+y%3,O=Math.floor(y/3);this.setFunctionModule(N,O,w),this.setFunctionModule(O,N,w)}}drawFinderPattern(p,v){for(let y=-4;y<=4;y++)for(let w=-4;w<=4;w++){const N=Math.max(Math.abs(w),Math.abs(y)),O=p+w,E=v+y;0<=O&&O<this.size&&0<=E&&E<this.size&&this.setFunctionModule(O,E,N!=2&&N!=4)}}drawAlignmentPattern(p,v){for(let y=-2;y<=2;y++)for(let w=-2;w<=2;w++)this.setFunctionModule(p+w,v+y,Math.max(Math.abs(w),Math.abs(y))!=1)}setFunctionModule(p,v,y){this.modules[v][p]=y,this.isFunction[v][p]=!0}addEccAndInterleave(p){const v=this.version,y=this.errorCorrectionLevel;if(p.length!=st.getNumDataCodewords(v,y))throw new RangeError("Invalid argument");const w=st.NUM_ERROR_CORRECTION_BLOCKS[y.ordinal][v],N=st.ECC_CODEWORDS_PER_BLOCK[y.ordinal][v],O=Math.floor(st.getNumRawDataModules(v)/8),E=w-O%w,A=Math.floor(O/w);let R=[];const Z=st.reedSolomonComputeDivisor(N);for(let V=0,re=0;V<w;V++){let te=p.slice(re,re+A-N+(V<E?0:1));re+=te.length;const ce=st.reedSolomonComputeRemainder(te,Z);V<E&&te.push(0),R.push(te.concat(ce))}let G=[];for(let V=0;V<R[0].length;V++)R.forEach((re,te)=>{(V!=A-N||te>=E)&&G.push(re[V])});return l(G.length==O),G}drawCodewords(p){if(p.length!=Math.floor(st.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let v=0;for(let y=this.size-1;y>=1;y-=2){y==6&&(y=5);for(let w=0;w<this.size;w++)for(let N=0;N<2;N++){const O=y-N,E=(y+1&2)==0?this.size-1-w:w;!this.isFunction[E][O]&&v<p.length*8&&(this.modules[E][O]=o(p[v>>>3],7-(v&7)),v++)}}l(v==p.length*8)}applyMask(p){if(p<0||p>7)throw new RangeError("Mask value out of range");for(let v=0;v<this.size;v++)for(let y=0;y<this.size;y++){let w;switch(p){case 0:w=(y+v)%2==0;break;case 1:w=v%2==0;break;case 2:w=y%3==0;break;case 3:w=(y+v)%3==0;break;case 4:w=(Math.floor(y/3)+Math.floor(v/2))%2==0;break;case 5:w=y*v%2+y*v%3==0;break;case 6:w=(y*v%2+y*v%3)%2==0;break;case 7:w=((y+v)%2+y*v%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[v][y]&&w&&(this.modules[v][y]=!this.modules[v][y])}}getPenaltyScore(){let p=0;for(let N=0;N<this.size;N++){let O=!1,E=0,A=[0,0,0,0,0,0,0];for(let R=0;R<this.size;R++)this.modules[N][R]==O?(E++,E==5?p+=st.PENALTY_N1:E>5&&p++):(this.finderPenaltyAddHistory(E,A),O||(p+=this.finderPenaltyCountPatterns(A)*st.PENALTY_N3),O=this.modules[N][R],E=1);p+=this.finderPenaltyTerminateAndCount(O,E,A)*st.PENALTY_N3}for(let N=0;N<this.size;N++){let O=!1,E=0,A=[0,0,0,0,0,0,0];for(let R=0;R<this.size;R++)this.modules[R][N]==O?(E++,E==5?p+=st.PENALTY_N1:E>5&&p++):(this.finderPenaltyAddHistory(E,A),O||(p+=this.finderPenaltyCountPatterns(A)*st.PENALTY_N3),O=this.modules[R][N],E=1);p+=this.finderPenaltyTerminateAndCount(O,E,A)*st.PENALTY_N3}for(let N=0;N<this.size-1;N++)for(let O=0;O<this.size-1;O++){const E=this.modules[N][O];E==this.modules[N][O+1]&&E==this.modules[N+1][O]&&E==this.modules[N+1][O+1]&&(p+=st.PENALTY_N2)}let v=0;for(const N of this.modules)v=N.reduce((O,E)=>O+(E?1:0),v);const y=this.size*this.size,w=Math.ceil(Math.abs(v*20-y*10)/y)-1;return l(0<=w&&w<=9),p+=w*st.PENALTY_N4,l(0<=p&&p<=2568888),p}getAlignmentPatternPositions(){if(this.version==1)return[];{const p=Math.floor(this.version/7)+2,v=this.version==32?26:Math.ceil((this.version*4+4)/(p*2-2))*2;let y=[6];for(let w=this.size-7;y.length<p;w-=v)y.splice(1,0,w);return y}}static getNumRawDataModules(p){if(p<st.MIN_VERSION||p>st.MAX_VERSION)throw new RangeError("Version number out of range");let v=(16*p+128)*p+64;if(p>=2){const y=Math.floor(p/7)+2;v-=(25*y-10)*y-55,p>=7&&(v-=36)}return l(208<=v&&v<=29648),v}static getNumDataCodewords(p,v){return Math.floor(st.getNumRawDataModules(p)/8)-st.ECC_CODEWORDS_PER_BLOCK[v.ordinal][p]*st.NUM_ERROR_CORRECTION_BLOCKS[v.ordinal][p]}static reedSolomonComputeDivisor(p){if(p<1||p>255)throw new RangeError("Degree out of range");let v=[];for(let w=0;w<p-1;w++)v.push(0);v.push(1);let y=1;for(let w=0;w<p;w++){for(let N=0;N<v.length;N++)v[N]=st.reedSolomonMultiply(v[N],y),N+1<v.length&&(v[N]^=v[N+1]);y=st.reedSolomonMultiply(y,2)}return v}static reedSolomonComputeRemainder(p,v){let y=v.map(w=>0);for(const w of p){const N=w^y.shift();y.push(0),v.forEach((O,E)=>y[E]^=st.reedSolomonMultiply(O,N))}return y}static reedSolomonMultiply(p,v){if(p>>>8||v>>>8)throw new RangeError("Byte out of range");let y=0;for(let w=7;w>=0;w--)y=y<<1^(y>>>7)*285,y^=(v>>>w&1)*p;return l(y>>>8==0),y}finderPenaltyCountPatterns(p){const v=p[1];l(v<=this.size*3);const y=v>0&&p[2]==v&&p[3]==v*3&&p[4]==v&&p[5]==v;return(y&&p[0]>=v*4&&p[6]>=v?1:0)+(y&&p[6]>=v*4&&p[0]>=v?1:0)}finderPenaltyTerminateAndCount(p,v,y){return p&&(this.finderPenaltyAddHistory(v,y),v=0),v+=this.size,this.finderPenaltyAddHistory(v,y),this.finderPenaltyCountPatterns(y)}finderPenaltyAddHistory(p,v){v[0]==0&&(p+=this.size),v.pop(),v.unshift(p)}};i.MIN_VERSION=1,i.MAX_VERSION=40,i.PENALTY_N1=3,i.PENALTY_N2=3,i.PENALTY_N3=40,i.PENALTY_N4=10,i.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],i.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=i;function a(h,p,v){if(p<0||p>31||h>>>p)throw new RangeError("Value out of range");for(let y=p-1;y>=0;y--)v.push(h>>>y&1)}function o(h,p){return(h>>>p&1)!=0}function l(h){if(!h)throw new Error("Assertion error")}const d=class Pt{constructor(p,v,y){if(this.mode=p,this.numChars=v,this.bitData=y,v<0)throw new RangeError("Invalid argument");this.bitData=y.slice()}static makeBytes(p){let v=[];for(const y of p)a(y,8,v);return new Pt(Pt.Mode.BYTE,p.length,v)}static makeNumeric(p){if(!Pt.isNumeric(p))throw new RangeError("String contains non-numeric characters");let v=[];for(let y=0;y<p.length;){const w=Math.min(p.length-y,3);a(parseInt(p.substring(y,y+w),10),w*3+1,v),y+=w}return new Pt(Pt.Mode.NUMERIC,p.length,v)}static makeAlphanumeric(p){if(!Pt.isAlphanumeric(p))throw new RangeError("String contains unencodable characters in alphanumeric mode");let v=[],y;for(y=0;y+2<=p.length;y+=2){let w=Pt.ALPHANUMERIC_CHARSET.indexOf(p.charAt(y))*45;w+=Pt.ALPHANUMERIC_CHARSET.indexOf(p.charAt(y+1)),a(w,11,v)}return y<p.length&&a(Pt.ALPHANUMERIC_CHARSET.indexOf(p.charAt(y)),6,v),new Pt(Pt.Mode.ALPHANUMERIC,p.length,v)}static makeSegments(p){return p==""?[]:Pt.isNumeric(p)?[Pt.makeNumeric(p)]:Pt.isAlphanumeric(p)?[Pt.makeAlphanumeric(p)]:[Pt.makeBytes(Pt.toUtf8ByteArray(p))]}static makeEci(p){let v=[];if(p<0)throw new RangeError("ECI assignment value out of range");if(p<128)a(p,8,v);else if(p<16384)a(2,2,v),a(p,14,v);else if(p<1e6)a(6,3,v),a(p,21,v);else throw new RangeError("ECI assignment value out of range");return new Pt(Pt.Mode.ECI,0,v)}static isNumeric(p){return Pt.NUMERIC_REGEX.test(p)}static isAlphanumeric(p){return Pt.ALPHANUMERIC_REGEX.test(p)}getData(){return this.bitData.slice()}static getTotalBits(p,v){let y=0;for(const w of p){const N=w.mode.numCharCountBits(v);if(w.numChars>=1<<N)return 1/0;y+=4+N+w.bitData.length}return y}static toUtf8ByteArray(p){p=encodeURI(p);let v=[];for(let y=0;y<p.length;y++)p.charAt(y)!="%"?v.push(p.charCodeAt(y)):(v.push(parseInt(p.substring(y+1,y+3),16)),y+=2);return v}};d.NUMERIC_REGEX=/^[0-9]*$/,d.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,d.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let m=d;e.QrSegment=d})(Jr||(Jr={})),(e=>{(i=>{const a=class{constructor(l,d){this.ordinal=l,this.formatBits=d}};a.LOW=new a(0,1),a.MEDIUM=new a(1,0),a.QUARTILE=new a(2,3),a.HIGH=new a(3,2),i.Ecc=a})(e.QrCode||(e.QrCode={}))})(Jr||(Jr={})),(e=>{(i=>{const a=class{constructor(l,d){this.modeBits=l,this.numBitsCharCount=d}numCharCountBits(l){return this.numBitsCharCount[Math.floor((l+7)/17)]}};a.NUMERIC=new a(1,[10,12,14]),a.ALPHANUMERIC=new a(2,[9,11,13]),a.BYTE=new a(4,[8,16,16]),a.KANJI=new a(8,[8,10,12]),a.ECI=new a(7,[0,0,0]),i.Mode=a})(e.QrSegment||(e.QrSegment={}))})(Jr||(Jr={}));var Sn=Jr;/**
146
- * @license qrcode.react
147
- * Copyright (c) Paul O'Shannessy
148
- * SPDX-License-Identifier: ISC
149
- */var uN={L:Sn.QrCode.Ecc.LOW,M:Sn.QrCode.Ecc.MEDIUM,Q:Sn.QrCode.Ecc.QUARTILE,H:Sn.QrCode.Ecc.HIGH},wf=128,Sf="L",jf="#FFFFFF",$f="#000000",kf=!1,Pf=1,dN=4,fN=0,mN=.1;function Nf(e,i=0){const a=[];return e.forEach(function(o,l){let d=null;o.forEach(function(m,h){if(!m&&d!==null){a.push(`M${d+i} ${l+i}h${h-d}v1H${d+i}z`),d=null;return}if(h===o.length-1){if(!m)return;d===null?a.push(`M${h+i},${l+i} h1v1H${h+i}z`):a.push(`M${d+i},${l+i} h${h+1-d}v1H${d+i}z`);return}m&&d===null&&(d=h)})}),a.join("")}function Of(e,i){return e.slice().map((a,o)=>o<i.y||o>=i.y+i.h?a:a.map((l,d)=>d<i.x||d>=i.x+i.w?l:!1))}function gN(e,i,a,o){if(o==null)return null;const l=e.length+a*2,d=Math.floor(i*mN),m=l/i,h=(o.width||d)*m,p=(o.height||d)*m,v=o.x==null?e.length/2-h/2:o.x*m,y=o.y==null?e.length/2-p/2:o.y*m,w=o.opacity==null?1:o.opacity;let N=null;if(o.excavate){let E=Math.floor(v),A=Math.floor(y);N={x:E,y:A,w:Math.ceil(h+v-E),h:Math.ceil(p+y-A)}}const O=o.crossOrigin;return{x:v,y,h:p,w:h,excavation:N,opacity:w,crossOrigin:O}}function pN(e,i){return i!=null?Math.max(Math.floor(i),0):e?dN:fN}function Cf({value:e,level:i,minVersion:a,includeMargin:o,marginSize:l,imageSettings:d,size:m,boostLevel:h}){let p=g.default.useMemo(()=>{const O=(Array.isArray(e)?e:[e]).reduce((E,A)=>(E.push(...Sn.QrSegment.makeSegments(A)),E),[]);return Sn.QrCode.encodeSegments(O,uN[i],a,void 0,void 0,h)},[e,i,a,h]);const{cells:v,margin:y,numCells:w,calculatedImageSettings:N}=g.default.useMemo(()=>{let O=p.getModules();const E=pN(o,l);return{cells:O,margin:E,numCells:O.length+E*2,calculatedImageSettings:gN(O,m,E,d)}},[p,m,d,o,l]);return{qrcode:p,margin:y,cells:v,numCells:w,calculatedImageSettings:N}}var vN=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),hN=g.default.forwardRef(function(i,a){const o=i,{value:l,size:d=wf,level:m=Sf,bgColor:h=jf,fgColor:p=$f,includeMargin:v=kf,minVersion:y=Pf,boostLevel:w,marginSize:N,imageSettings:O}=o,E=$c(o,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:A}=E,R=$c(E,["style"]),Z=O?.src,G=g.default.useRef(null),V=g.default.useRef(null),re=g.default.useCallback(He=>{G.current=He,typeof a=="function"?a(He):a&&(a.current=He)},[a]),[te,ce]=g.default.useState(!1),{margin:ye,cells:ue,numCells:Ee,calculatedImageSettings:Re}=Cf({value:l,level:m,minVersion:y,boostLevel:w,includeMargin:v,marginSize:N,imageSettings:O,size:d});g.default.useEffect(()=>{if(G.current!=null){const He=G.current,Je=He.getContext("2d");if(!Je)return;let Xe=ue;const Ge=V.current,Ae=Re!=null&&Ge!==null&&Ge.complete&&Ge.naturalHeight!==0&&Ge.naturalWidth!==0;Ae&&Re.excavation!=null&&(Xe=Of(ue,Re.excavation));const pt=window.devicePixelRatio||1;He.height=He.width=d*pt;const ct=d/Ee*pt;Je.scale(ct,ct),Je.fillStyle=h,Je.fillRect(0,0,Ee,Ee),Je.fillStyle=p,vN?Je.fill(new Path2D(Nf(Xe,ye))):ue.forEach(function(we,Oe){we.forEach(function(Pe,Ke){Pe&&Je.fillRect(Ke+ye,Oe+ye,1,1)})}),Re&&(Je.globalAlpha=Re.opacity),Ae&&Je.drawImage(Ge,Re.x+ye,Re.y+ye,Re.w,Re.h)}}),g.default.useEffect(()=>{ce(!1)},[Z]);const et=jc({height:d,width:d},A);let dt=null;return Z!=null&&(dt=g.default.createElement("img",{src:Z,key:Z,style:{display:"none"},onLoad:()=>{ce(!0)},ref:V,crossOrigin:Re?.crossOrigin})),g.default.createElement(g.default.Fragment,null,g.default.createElement("canvas",jc({style:et,height:d,width:d,ref:re,role:"img"},R)),dt)});hN.displayName="QRCodeCanvas";var If=g.default.forwardRef(function(i,a){const o=i,{value:l,size:d=wf,level:m=Sf,bgColor:h=jf,fgColor:p=$f,includeMargin:v=kf,minVersion:y=Pf,boostLevel:w,title:N,marginSize:O,imageSettings:E}=o,A=$c(o,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:R,cells:Z,numCells:G,calculatedImageSettings:V}=Cf({value:l,level:m,minVersion:y,boostLevel:w,includeMargin:v,marginSize:O,imageSettings:E,size:d});let re=Z,te=null;E!=null&&V!=null&&(V.excavation!=null&&(re=Of(Z,V.excavation)),te=g.default.createElement("image",{href:E.src,height:V.h,width:V.w,x:V.x+R,y:V.y+R,preserveAspectRatio:"none",opacity:V.opacity,crossOrigin:V.crossOrigin}));const ce=Nf(re,R);return g.default.createElement("svg",jc({height:d,width:d,viewBox:`0 0 ${G} ${G}`,ref:a,role:"img"},A),!!N&&g.default.createElement("title",null,N),g.default.createElement("path",{fill:h,d:`M0,0 h${G}v${G}H0z`,shapeRendering:"crispEdges"}),g.default.createElement("path",{fill:p,d:ce,shapeRendering:"crispEdges"}),te)});If.displayName="QRCodeSVG";var bN=192;function Ef({value:e,size:i=bN,className:a,alt:o}){const l=e.trim();return l.length===0?null:(0,r.jsx)("div",{className:K("inline-flex rounded-md bg-white p-2",a),children:(0,r.jsx)(If,{value:l,size:i,marginSize:1,title:o??"QR code"})})}var yN=2e3;function Mf({value:e,label:i,className:a,disabled:o}){const[l,d]=(0,n.useState)(!1),m=(0,n.useCallback)(()=>{e&&navigator.clipboard.writeText(e).then(()=>{d(!0),setTimeout(()=>d(!1),yN)})},[e]);return(0,r.jsxs)(wr,{size:"sm",variant:"ghost",type:"button",disabled:o||e.length===0,onClick:m,className:K(a),"aria-label":l?"Copied":`Copy ${i??"value"}`,children:[l?(0,r.jsx)(vn,{className:"h-3.5 w-3.5 text-success"}):(0,r.jsx)(xr,{className:"h-3.5 w-3.5"}),i?(0,r.jsx)("span",{className:"ml-1",children:l?"Copied":i}):null]})}var _N=xe.z.array(Q.ExposedDeviceSchema),Df=1e4;function Af(e){return e==="linked"?"success":e==="error"?"danger":"warning"}function zf(e){return e==="linked"?"Linked":e==="unlinked"?"Unlinked":e==="error"?"Error":e}function xN({field:e}){const[i,a]=(0,n.useState)(!1),o=e.secret===!0,l=o&&!i?"•".repeat(Math.min(e.value.length,24)):e.value;return(0,r.jsxs)("div",{className:"flex items-center gap-2 py-1.5",children:[(0,r.jsx)("span",{className:"text-[11px] text-foreground-subtle w-32 shrink-0",children:e.label}),(0,r.jsx)("span",{className:"flex-1 min-w-0 truncate font-mono text-xs text-foreground",children:l||"—"}),o&&(0,r.jsx)(wr,{size:"sm",variant:"ghost",type:"button","aria-label":i?"Hide value":"Reveal value",onClick:()=>a(d=>!d),children:i?(0,r.jsx)(Rs,{className:"h-3.5 w-3.5"}):(0,r.jsx)(hn,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(Mf,{value:e.value,label:e.label})]})}function wN({setup:e}){const i=e.fields??[];return(0,r.jsxs)("div",{className:"border-b border-border bg-surface-hover/10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border",children:[(0,r.jsx)(dv,{className:"h-3.5 w-3.5 text-foreground-subtle shrink-0"}),(0,r.jsx)("span",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wide",children:"Setup"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 p-4 sm:flex-row sm:items-start",children:[e.qr&&(0,r.jsx)("div",{className:"shrink-0",children:(0,r.jsx)(Ef,{value:e.qr,alt:"Pairing QR code"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[e.note&&(0,r.jsx)("p",{className:"text-xs text-foreground-muted whitespace-pre-line mb-2",children:e.note}),i.length>0&&(0,r.jsx)("div",{className:"divide-y divide-border-subtle",children:i.map(a=>(0,r.jsx)(xN,{field:a},a.label))})]})]})]})}function SN({addonId:e,onOpenDevice:i}){const a=(0,ee.useQueryClient)(),o=qd({nodeId:"hub",addonId:e},{refetchInterval:Df,retry:!1}),l=Hd({nodeId:"hub",addonId:e},{refetchInterval:Df,retry:!1}),d=Jd({onSuccess:()=>{a.invalidateQueries({queryKey:[["deviceExport"]]})}}),m=(0,n.useMemo)(()=>{const O=Q.DeviceExportStatusSchema.safeParse(o.data);return O.success?O.data:null},[o.data]),h=(0,n.useMemo)(()=>{const O=_N.safeParse(l.data);return O.success?O.data:[]},[l.data]),p=m?.linkState??"unlinked",v=(0,n.useMemo)(()=>h.map(O=>({deviceId:O.deviceId,displayName:O.exposedAs??`Device ${O.deviceId}`,streamPreference:"auto",linkState:p})),[h,p]),y=o.isLoading||l.isLoading,w=m?.exposedDeviceCount??v.length,N=(0,n.useMemo)(()=>[{key:"device",header:"Device",render:O=>(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("span",{className:"text-foreground font-medium",children:O.displayName}),(0,r.jsxs)("span",{className:"text-foreground-subtle text-xs font-mono",children:["#",O.deviceId]})]})},{key:"status",header:"Status",render:O=>(0,r.jsx)(Ar,{variant:Af(O.linkState),children:zf(O.linkState)})},{key:"stream",header:"Stream",render:O=>(0,r.jsx)("span",{className:"text-xs text-foreground-subtle font-mono",children:O.streamPreference==="auto"?"Auto":O.streamPreference})},{key:"actions",header:"",align:"right",render:O=>(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[i&&(0,r.jsxs)(wr,{size:"sm",variant:"ghost",onClick:()=>i(O.deviceId),children:[(0,r.jsx)(Ts,{className:"h-3.5 w-3.5 mr-1"}),"Open"]}),(0,r.jsxs)(wr,{size:"sm",variant:"ghost",disabled:d.isPending,onClick:()=>d.mutate({deviceId:O.deviceId,nodeId:"hub",addonId:e}),children:[(0,r.jsx)(kv,{className:"h-3.5 w-3.5 mr-1"}),"Unexpose"]})]})}],[i,d,e]);return(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5 border-b border-border bg-surface-hover/20",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(Kl,{className:"h-3.5 w-3.5 text-foreground-subtle shrink-0"}),(0,r.jsx)("span",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wide",children:"Exported devices"}),(0,r.jsx)(Ar,{variant:Af(p),children:zf(p)}),(0,r.jsxs)("span",{className:"text-[11px] text-foreground-subtle",children:[w," exposed"]})]}),y&&(0,r.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin text-foreground-subtle"})]}),m?.error&&(0,r.jsx)("div",{className:"px-4 py-3 border-b border-border",children:(0,r.jsx)(Gu,{message:m.error})}),m?.setup&&(0,r.jsx)(wN,{setup:m.setup}),v.length===0?(0,r.jsx)(Fu,{icon:Kl,title:"No devices exposed",description:`Expose a camera to "${e}" from its device-details page to surface it in the connected ecosystem.`}):(0,r.jsx)("div",{className:"p-3",children:(0,r.jsx)(Au,{columns:N,rows:v,rowKey:O=>O.deviceId})})]})}function jN({samples:e,sampleRate:i=16e3,height:a=96,className:o="",color:l="#3b82f6",bgColor:d="transparent"}){const m=(0,n.useRef)(null),h=(0,n.useRef)(null),p=(0,n.useCallback)(()=>{const y=m.current,w=h.current;if(!y||!w||!e||e.length===0)return;const N=w.clientWidth;if(N===0)return;const O=window.devicePixelRatio||1;y.width=N*O,y.height=a*O,y.style.width=`${N}px`,y.style.height=`${a}px`;const E=y.getContext("2d");if(!E)return;E.scale(O,O),d!=="transparent"?(E.fillStyle=d,E.fillRect(0,0,N,a)):E.clearRect(0,0,N,a);const A=e.length/N,R=a/2;E.fillStyle=l,E.globalAlpha=.7;for(let Z=0;Z<N;Z++){const G=Math.floor(Z*A),V=Math.min(Math.floor((Z+1)*A),e.length);let re=0,te=0;for(let Ee=G;Ee<V;Ee++){const Re=e[Ee];Re<re&&(re=Re),Re>te&&(te=Re)}const ce=R-te*R,ye=R-re*R,ue=Math.max(1,ye-ce);E.fillRect(Z,ce,1,ue)}E.globalAlpha=1,E.strokeStyle=l,E.globalAlpha=.2,E.lineWidth=1,E.beginPath(),E.moveTo(0,R),E.lineTo(N,R),E.stroke(),E.globalAlpha=1},[e,a,l,d]);(0,n.useEffect)(()=>{p()},[p]),(0,n.useEffect)(()=>{const y=new ResizeObserver(()=>p()),w=h.current;return w&&y.observe(w),()=>y.disconnect()},[p]);const v=((e&&i?Math.round(e.length/i*1e3):0)/1e3).toFixed(1);return(0,r.jsxs)("div",{ref:h,className:`relative ${o}`,children:[(0,r.jsx)("canvas",{ref:m,className:"w-full rounded-md"}),e&&e.length>0&&(0,r.jsxs)("div",{className:"absolute bottom-1 right-2 text-[10px] text-foreground-subtle/60 font-mono",children:[v,"s · ",i/1e3,"kHz · ",e.length.toLocaleString()," samples"]})]})}function $N({currentDbfs:e,durationSec:i=30,maxSamples:a=120,height:o=64,className:l="",color:d="#10b981",clipColor:m="#ef4444",clipThreshold:h=-6,minDbfs:p=-96}){const v=(0,n.useRef)(null),y=(0,n.useRef)(null),[w,N]=(0,n.useState)([]);(0,n.useEffect)(()=>{e!==null&&N(A=>{const R=[...A,{dbfs:e,timestamp:Date.now()}];return R.length>a?R.slice(-a):R})},[e,a]);const O=(0,n.useCallback)(()=>{const A=v.current,R=y.current;if(!A||!R)return;const Z=R.clientWidth;if(Z===0)return;const G=window.devicePixelRatio||1;A.width=Z*G,A.height=o*G,A.style.width=`${Z}px`,A.style.height=`${o}px`;const V=A.getContext("2d");if(!V||(V.scale(G,G),V.clearRect(0,0,Z,o),w.length===0))return;const re=w[w.length-1].timestamp,te=i*1e3,ce=re-te,ye=w.filter(et=>et.timestamp>=ce);if(ye.length===0)return;const ue=Math.max(1,Math.floor(Z/(i*2))),Ee=Math.abs(p);for(const et of ye){const dt=et.timestamp-ce,He=Math.floor(dt/te*Z),Je=(Math.max(p,Math.min(0,et.dbfs))-p)/Ee,Xe=Math.max(1,Je*o);V.fillStyle=et.dbfs>=h?m:d,V.globalAlpha=.8,V.fillRect(He,o-Xe,ue,Xe)}V.globalAlpha=1;const Re=o-(h-p)/Ee*o;V.strokeStyle=m,V.globalAlpha=.25,V.lineWidth=1,V.setLineDash([4,4]),V.beginPath(),V.moveTo(0,Re),V.lineTo(Z,Re),V.stroke(),V.setLineDash([]),V.globalAlpha=1},[w,i,o,d,m,h,p]);(0,n.useEffect)(()=>{O()},[O]),(0,n.useEffect)(()=>{const A=new ResizeObserver(()=>O()),R=y.current;return R&&A.observe(R),()=>A.disconnect()},[O]);const E=w.length>0?w[w.length-1].dbfs:null;return(0,r.jsxs)("div",{ref:y,className:`relative ${l}`,children:[(0,r.jsx)("canvas",{ref:v,className:"w-full rounded-md"}),(0,r.jsxs)("div",{className:"absolute top-1 left-2 text-[9px] text-foreground-subtle/50 font-mono",children:[i,"s"]}),E!==null&&(0,r.jsxs)("div",{className:"absolute bottom-1 right-2 text-[9px] text-foreground-subtle/50 font-mono",children:[E.toFixed(1)," dBFS · ",w.length," samples"]})]})}function kN(e){return e>=.8?"bg-emerald-500":e>=.5?"bg-amber-500":e>=.3?"bg-orange-500":"bg-zinc-500"}function PN(e){return e>=.8?"text-emerald-400":e>=.5?"text-amber-400":e>=.3?"text-orange-400":"text-zinc-400"}function NN({classifications:e,processing:i=!1,inferenceMs:a,maxItems:o=10,className:l=""}){const d=e.slice(0,o),m=d.length>0?d[0].score:1;return i?(0,r.jsx)("div",{className:`rounded-xl border border-border bg-surface p-4 text-center ${l}`,children:(0,r.jsx)("div",{className:"text-sm text-foreground-subtle animate-pulse",children:"Classifying audio..."})}):d.length===0?(0,r.jsx)("div",{className:`rounded-xl border border-border bg-surface p-4 text-center ${l}`,children:(0,r.jsx)("div",{className:"text-xs text-foreground-subtle",children:"No classifications yet"})}):(0,r.jsxs)("div",{className:`rounded-xl border border-border bg-surface overflow-hidden ${l}`,children:[(0,r.jsxs)("div",{className:"px-3 py-2 border-b border-border flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"text-xs font-medium text-foreground",children:"Audio Classifications"}),(0,r.jsxs)("div",{className:"flex items-center gap-3 text-[10px] text-foreground-subtle",children:[d.length<e.length&&(0,r.jsxs)("span",{children:["showing ",d.length," of ",e.length]}),a!==void 0&&(0,r.jsxs)("span",{className:"font-mono",children:[a.toFixed(1),"ms"]})]})]}),(0,r.jsx)("div",{className:"divide-y divide-border/50",children:d.map((h,p)=>{const v=m>0?h.score/m*100:0;return(0,r.jsxs)("div",{className:"px-3 py-1.5 flex items-center gap-3 hover:bg-surface-hover/30",children:[(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle w-5 text-right font-mono",children:p+1}),(0,r.jsx)("span",{className:"text-xs font-medium text-foreground min-w-[120px]",children:h.className}),(0,r.jsx)("div",{className:"flex-1 h-2 rounded-full bg-zinc-800 overflow-hidden",children:(0,r.jsx)("div",{className:`h-full rounded-full transition-all duration-300 ${kN(h.score)}`,style:{width:`${v}%`}})}),(0,r.jsxs)("span",{className:`text-xs font-mono font-semibold w-14 text-right ${PN(h.score)}`,children:[(h.score*100).toFixed(1),"%"]})]},`${h.className}-${p}`)})})]})}function ON({data:e,label:i="Response",className:a=""}){const[o,l]=(0,n.useState)(!1);if(!e)return null;const d=JSON.stringify(e,null,2);return(0,r.jsxs)("div",{className:`rounded-xl border border-border bg-surface overflow-hidden ${a}`,children:[(0,r.jsxs)("div",{className:"px-3 py-2 border-b border-border flex items-center justify-between cursor-pointer select-none hover:bg-surface-hover/30",onClick:()=>l(m=>!m),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle",children:o?"▼":"▶"}),(0,r.jsx)("h3",{className:"text-xs font-medium text-foreground",children:i})]}),(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle font-mono",children:d.length>1e3?`${(d.length/1024).toFixed(1)} KB`:`${d.length} bytes`})]}),o&&(0,r.jsx)("div",{className:"max-h-80 overflow-y-auto overflow-x-auto",children:(0,r.jsx)("pre",{className:"p-3 text-[10px] leading-4 font-mono text-foreground-subtle whitespace-pre",children:d})})]})}var CN={Activity:Mr,Eye:hn,AlertTriangle:bn,PauseCircle:qp,PowerOff:uv};function IN({phase:e,...i}){const a=CN[ps(e).icon];return(0,r.jsx)(a,{...i})}function Kr(e){const[i,a]=(0,n.useState)([]),o=(0,n.useCallback)(d=>{a(m=>{const h=[...m,d];return h.length>e?h.slice(-e):h})},[e]),l=(0,n.useCallback)(()=>{a([])},[]);return(0,n.useMemo)(()=>({entries:i,append:o,reset:l}),[i,o,l])}function Tf(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}var Rf={error:{icon:Ri,color:"text-red-400"},warn:{icon:bn,color:"text-amber-400"},info:{icon:nv,color:"text-blue-400"},debug:{icon:Bp,color:"text-gray-500"}},Zf={debug:0,info:1,warn:2,error:3},EN=["all","debug","info","warn","error"],MN=500;function DN(e,i){return i?(Zf[e]??0)>=(Zf[i]??0):!0}function kc({agentId:e,addonId:i,deviceId:a,integrationId:o,requestId:l,level:d,maxHeight:m="max-h-96",showScope:h=!1,showFilters:p=!0,limit:v=100,liveBuffer:y,onClose:w,className:N}){const[O,E]=(0,n.useState)(""),[A,R]=(0,n.useState)(""),[Z,G]=(0,n.useState)(d),V=e,re=i??(O||void 0),te=a??(A?Number(A):void 0),ce=o,ye=l,ue=(0,n.useMemo)(()=>{const de={};return V&&(de.agentId=V),re&&(de.addonId=re),te!==void 0&&Number.isFinite(te)&&(de.deviceId=te),ce&&(de.integrationId=ce),ye&&(de.requestId=ye),Object.keys(de).length>0?de:void 0},[V,re,te,ce,ye]),Ee=Kr(MN),Re=y??Ee,et=Re.entries,[dt,He]=(0,n.useState)(0),[Je,Xe]=(0,n.useState)(!1),[Ge,Ae]=(0,n.useState)(!1),[pt,ct]=(0,n.useState)(new Set),[we,Oe]=(0,n.useState)(""),Pe=(0,n.useRef)(null),Ke=`${V??""}:${re??""}:${String(te??"")}:${ce??""}:${ye??""}`,ze=(0,n.useRef)(Ke);(0,n.useEffect)(()=>{ze.current!==Ke&&(ze.current=Ke,Re.reset(),He(0),ct(new Set))},[Ke,Re]);const{data:Le,isLoading:Ue}=j.logs.query.useQuery({...ue?{tags:ue}:{},limit:v},{staleTime:3e4});j.logs.subscribe.useSubscription({...ue?{tags:ue}:{}},{onData:de=>{Re.append(de)}});const De=(0,n.useRef)(et.length);(0,n.useEffect)(()=>{const de=Pe.current;if(!de){De.current=et.length;return}const Se=De.current;if(De.current=et.length,!(et.length<=Se)){if(Je&&de.scrollTop<=8)de.scrollTo({top:0});else if(!Je&&de.scrollTop>0){const Ve=de.querySelector("tbody tr"),tt=Ve instanceof HTMLElement?Ve.offsetHeight:24;de.scrollTop+=tt*(et.length-Se)}}},[et.length,Je]);const qe=(0,n.useMemo)(()=>{const de=(Le??[]).map(Qe=>({timestamp:Qe.timestamp,level:Qe.level,message:Qe.message,scope:Qe.scope,tags:Qe.tags,meta:Qe.meta})),Se=new Set,Ve=[];for(const Qe of[...et].reverse()){const wt=`${Qe.timestamp}|${Qe.level}|${Qe.scope??""}|${Qe.message}`;Se.has(wt)||(Se.add(wt),Ve.push(Qe))}for(const Qe of de){const wt=`${Qe.timestamp}|${Qe.level}|${Qe.scope??""}|${Qe.message}`;Se.has(wt)||(Se.add(wt),Ve.push(Qe))}const tt=(dt>0?Ve.filter(Qe=>new Date(Qe.timestamp).getTime()>dt):Ve).filter(Qe=>DN(Qe.level,Z)),je=we.trim().toLowerCase();return je?tt.filter(Qe=>{if(Qe.message.toLowerCase().includes(je)||Qe.scope&&Qe.scope.toLowerCase().includes(je))return!0;if(Qe.tags){for(const wt of Object.values(Qe.tags))if(wt!==void 0&&String(wt).toLowerCase().includes(je))return!0}if(Qe.meta){for(const wt of Object.values(Qe.meta))if(wt!=null&&Tf(wt).toLowerCase().includes(je))return!0}return!1}):tt},[Le,et,Z,dt,we]),Be=(0,n.useCallback)(()=>{const de=qe.map(Se=>{const Ve=new Date(Se.timestamp).toLocaleTimeString(),tt=Se.tags?" "+Object.entries(Se.tags).filter(([,je])=>je).map(([je,Qe])=>`${je}=${Qe}`).join(" "):"";return`${Ve} [${Se.level.toUpperCase()}]${Se.scope?` [${Se.scope}]`:""}${tt} ${Se.message}`});navigator.clipboard.writeText(de.join(`
150
- `)).then(()=>{Ae(!0),setTimeout(()=>Ae(!1),1500)})},[qe]),Rt=j.logs.clear.useMutation(),Zt=(0,n.useCallback)(()=>{He(Date.now()),Re.reset(),Rt.mutate({...ue?{tags:ue}:{}})},[Re,Rt,ue]),Fe=(0,n.useCallback)(de=>{ct(Se=>{const Ve=new Set(Se);return Ve.has(de)?Ve.delete(de):Ve.add(de),Ve})},[]),[lt,_t]=(0,n.useState)(null),xt=(0,n.useCallback)((de,Se)=>{const Ve=new Date(de.timestamp).toISOString(),tt=de.tags?" "+Object.entries(de.tags).filter(([,wt])=>wt).map(([wt,Sr])=>`${wt}=${Sr}`).join(" "):"",je=de.meta&&Object.keys(de.meta).length>0?` meta=${JSON.stringify(de.meta)}`:"",Qe=`${Ve} [${de.level.toUpperCase()}]${de.scope?` [${de.scope}]`:""}${tt} ${de.message}${je}`;navigator.clipboard.writeText(Qe).then(()=>{_t(Se),setTimeout(()=>_t(wt=>wt===Se?null:wt),1200)})},[]),ke=(0,n.useCallback)(de=>`${de.timestamp}|${de.level}|${de.scope??""}|${de.message}`,[]);return(0,r.jsxs)("div",{className:K("h-full min-h-0 flex flex-col",N),onClick:de=>de.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-hover/30 gap-2 shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"Logs"}),V&&(0,r.jsx)(Pc,{label:"agent",value:V}),re&&(0,r.jsx)(Pc,{label:"addon",value:re}),te!==void 0&&(0,r.jsx)(Pc,{label:"device",value:`#${te}`}),(0,r.jsx)("div",{className:"flex rounded border border-border overflow-hidden text-[9px]",children:EN.map(de=>(0,r.jsxs)("button",{type:"button",onClick:()=>G(de==="all"?void 0:de),className:K("px-1.5 py-0.5 capitalize transition-colors",de==="all"&&!Z||Z===de?"bg-primary/10 text-primary":"text-foreground-subtle hover:bg-surface-hover",de!=="all"&&"border-l border-border"),children:[de,de!=="all"?"+":""]},de))}),(0,r.jsx)(Nc,{icon:Ds,label:Je?"Auto":"Paused",active:!Je,onClick:()=>{Xe(de=>!de),!Je&&Pe.current&&Pe.current.scrollTo({top:0,behavior:"smooth"})}}),(0,r.jsx)(Nc,{icon:xr,label:Ge?"Copied!":"Copy",onClick:Be,disabled:qe.length===0}),(0,r.jsx)(Nc,{icon:fr,label:"Clear",onClick:Zt}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:"text",value:we,onChange:de=>Oe(de.target.value),placeholder:"Search…",className:"w-32 pl-1.5 pr-5 py-0.5 rounded border border-border bg-background text-foreground text-[10px] focus:outline-none focus:border-primary/50"}),we&&(0,r.jsx)("button",{type:"button",onClick:()=>Oe(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",title:"Clear search",children:(0,r.jsx)(Mt,{className:"h-2.5 w-2.5"})})]}),et.length>0&&(0,r.jsxs)("span",{className:"text-[9px] text-emerald-400 font-medium",children:["+",et.length," live"]})]}),w&&(0,r.jsx)("button",{type:"button",onClick:w,className:"text-foreground-subtle hover:text-foreground",children:(0,r.jsx)(Mt,{className:"h-3.5 w-3.5"})})]}),p&&(!i||!a)&&(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1 border-b border-border/50 bg-surface/50 text-[10px]",children:[!i&&(0,r.jsxs)("label",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"text-foreground-subtle",children:"Addon:"}),(0,r.jsx)("input",{type:"text",value:O,onChange:de=>E(de.target.value),placeholder:"all",className:"w-28 px-1.5 py-0.5 rounded border border-border bg-background text-foreground text-[10px] focus:outline-none focus:border-primary/50"})]}),!a&&(0,r.jsxs)("label",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"text-foreground-subtle",children:"Device:"}),(0,r.jsx)("input",{type:"text",inputMode:"numeric",value:A,onChange:de=>R(de.target.value),placeholder:"all",className:"w-16 px-1.5 py-0.5 rounded border border-border bg-background text-foreground text-[10px] focus:outline-none focus:border-primary/50"})]})]}),(0,r.jsxs)("div",{ref:Pe,className:K("flex-1 min-h-0 overflow-auto font-mono text-[10px]",m),children:[Ue&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle",children:[(0,r.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin"}),"Loading logs..."]}),!Ue&&qe.length===0&&(0,r.jsx)("div",{className:"py-4 text-center text-foreground-subtle",children:"No logs found"}),qe.length>0&&(0,r.jsx)("table",{className:"w-full",children:(0,r.jsx)("tbody",{children:qe.map(de=>{const Se=Rf[de.level]??Rf.info,Ve=Se.icon,tt=ke(de),je=pt.has(tt),Qe=de.tags&&Object.keys(de.tags).length>0,wt=de.meta&&Object.keys(de.meta).length>0,Sr=Qe||wt;return(0,r.jsxs)("tr",{className:K("hover:bg-surface-hover/30 border-b border-border/30",Sr&&"cursor-pointer"),onClick:Sr?()=>Fe(tt):void 0,children:[(0,r.jsx)("td",{className:"px-2 py-1 text-foreground-subtle whitespace-nowrap align-top w-[70px]",children:new Date(de.timestamp).toLocaleTimeString()}),(0,r.jsx)("td",{className:K("px-1 py-1 align-top w-5",Se.color),children:(0,r.jsx)(Ve,{className:"h-3 w-3"})}),h&&(0,r.jsx)("td",{className:"px-2 py-1 text-foreground-subtle align-top truncate max-w-[120px]",title:de.scope,children:de.scope?.replace(/^addon:/,"")??""}),(0,r.jsx)("td",{className:"px-2 py-1 text-foreground break-all",children:(0,r.jsxs)("div",{className:"flex items-start gap-1",children:[Sr&&(je?(0,r.jsx)(Qr,{className:"h-3 w-3 text-foreground-subtle shrink-0 mt-0.5"}):(0,r.jsx)(Dr,{className:"h-3 w-3 text-foreground-subtle shrink-0 mt-0.5"})),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[de.message,je&&Sr&&(0,r.jsxs)("div",{className:"mt-1 text-[9px] text-foreground-subtle bg-surface rounded px-2 py-1 space-y-0.5",children:[wt&&Object.entries(de.meta).filter(([,Wt])=>Wt!==void 0&&Wt!=="").map(([Wt,$n])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-amber-400/80 font-medium",children:Wt}),(0,r.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,r.jsx)("span",{className:"text-foreground break-all",children:Tf($n)})]},`m-${Wt}`)),Qe&&Object.entries(de.tags).filter(([,Wt])=>Wt!==void 0).map(([Wt,$n])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-primary/70 font-medium",children:Wt}),(0,r.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,r.jsx)("span",{className:"text-foreground",children:$n})]},`t-${Wt}`))]})]})]})}),(0,r.jsx)("td",{className:"px-1 py-1 align-top w-5",children:(0,r.jsx)(zN,{copied:lt===tt,onCopy:()=>xt(de,tt)})})]},tt)})})})]})]})}function AN({position:e="bottom",className:i,...a}){return(0,r.jsx)("div",{className:K(e==="bottom"?"absolute bottom-0 left-0 right-0 z-10 border-t border-border bg-surface/95 backdrop-blur-sm":"absolute inset-x-2 bottom-2 z-10 rounded-lg border border-border bg-surface/95 backdrop-blur-sm shadow-xl",i),children:(0,r.jsx)(kc,{maxHeight:"max-h-48",...a})})}function Pc({label:e,value:i}){return(0,r.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:[e,": ",i]})}function zN({copied:e,onCopy:i}){return(0,r.jsx)("button",{type:"button",title:"Copy this row",onClick:a=>{a.stopPropagation(),i()},className:K("rounded p-0.5 transition-colors",e?"text-emerald-400":"text-foreground-subtle/60 hover:text-foreground hover:bg-surface-hover"),children:e?(0,r.jsx)(vn,{className:"h-3 w-3"}):(0,r.jsx)(xr,{className:"h-3 w-3"})})}function Nc({icon:e,label:i,onClick:a,disabled:o,active:l}){return(0,r.jsxs)("button",{type:"button",onClick:a,disabled:o,className:K("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",l?"border-amber-500/30 bg-amber-500/10 text-amber-400":"border-border text-foreground-subtle hover:text-foreground",o&&"opacity-40 cursor-not-allowed"),children:[(0,r.jsx)(e,{className:"h-2.5 w-2.5"}),i]})}function TN(e,i,a,o){if(o!==void 0&&(e.source.deviceId??(e.source.type==="device"&&typeof e.source.id=="number"?e.source.id:void 0))!==o||a!==void 0&&(e.source.addonId??(e.source.type==="addon"&&typeof e.source.id=="string"?e.source.id:void 0))!==a)return!1;if(i!==void 0){const l=e.source.nodeId;if(!l||l!==i&&!l.startsWith(`${i}/`))return!1}return!0}var RN={[Q.EventCategory.AddonStarted]:{icon:Us,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Started"},[Q.EventCategory.AddonInstalled]:{icon:zs,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Installed"},[Q.EventCategory.AddonRestarted]:{icon:Sa,color:"bg-blue-500/15 text-blue-400 border-blue-500/30",label:"Restarted"},[Q.EventCategory.AddonUpdated]:{icon:tu,color:"bg-blue-500/15 text-blue-400 border-blue-500/30",label:"Updated"},[Q.EventCategory.AddonStopped]:{icon:Xl,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:"Stopped"},[Q.EventCategory.AddonUninstalled]:{icon:fr,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:"Uninstalled"},[Q.EventCategory.AddonCrashed]:{icon:Ri,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Crashed"},[Q.EventCategory.AddonError]:{icon:bn,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Error"},[Q.EventCategory.DetectionPhaseTransition]:{icon:Mr,color:"bg-violet-500/15 text-violet-400 border-violet-500/30",label:"Phase"},[Q.EventCategory.DetectionResult]:{icon:gv,color:"bg-purple-500/15 text-purple-400 border-purple-500/30",label:"Detection"},[Q.EventCategory.DetectionEvent]:{icon:hn,color:"bg-blue-500/15 text-blue-400 border-blue-500/30",label:"Event"},[Q.EventCategory.DetectionCameraNative]:{icon:eu,color:"bg-cyan-500/15 text-cyan-400 border-cyan-500/30",label:"Camera AI"},[Q.EventCategory.ProviderMotion]:{icon:nu,color:"bg-orange-500/15 text-orange-400 border-orange-500/30",label:"Motion"},[Q.EventCategory.MotionOnMotionChanged]:{icon:nu,color:"bg-orange-500/15 text-orange-400 border-orange-500/30",label:"Motion"},[Q.EventCategory.MotionAnalysis]:{icon:Mr,color:"bg-orange-500/10 text-orange-300 border-orange-500/20",label:"Motion analysis"},[Q.EventCategory.MotionZonesRaw]:{icon:Mr,color:"bg-orange-500/10 text-orange-300 border-orange-500/20",label:"Motion zones"},[Q.EventCategory.ProviderDetection]:{icon:eu,color:"bg-cyan-500/15 text-cyan-400 border-cyan-500/30",label:"Provider Det"},[Q.EventCategory.PipelineAudioInferenceResult]:{icon:Vl,color:"bg-pink-500/15 text-pink-400 border-pink-500/30",label:"Audio"},[Q.EventCategory.AgentOnline]:{icon:Us,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Agent Online"},[Q.EventCategory.AgentOffline]:{icon:Xl,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Agent Offline"},[Q.EventCategory.DeviceRegistered]:{icon:zs,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Registered"},[Q.EventCategory.DeviceUnregistered]:{icon:fr,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Unregistered"},[Q.EventCategory.DeviceStateChanged]:{icon:Mr,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:"State"}};function Oc(e,i){const a=RN[e]??{icon:Us,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:e.split(".").pop()??e};if(e===Q.EventCategory.DeviceStateChanged&&i&&typeof i.capName=="string"){const o=i.capName;return{...a,label:o}}return a}var jn=Object.freeze([...new Set(Object.values(Q.EventCategory))].sort()),ZN=Object.freeze([Q.EventCategory.PipelineCameraMetricsSnapshot,Q.EventCategory.PipelineRunnerLoadSnapshot,Q.EventCategory.PipelineEngineMetricsSnapshot,Q.EventCategory.PipelineInferenceResult,Q.EventCategory.PipelineTrace,Q.EventCategory.PipelineProgress,Q.EventCategory.StreamBrokerMetricsSnapshot,Q.EventCategory.MetricsNodeResourcesSnapshot,Q.EventCategory.MetricsNodeProcessesSnapshot,Q.EventCategory.ClusterTopologySnapshot,Q.EventCategory.MotionAnalysis,Q.EventCategory.MotionZonesRaw,Q.EventCategory.DetectionResult,Q.EventCategory.PipelineAudioInferenceResult,Q.EventCategory.PlatformProbePhase,Q.EventCategory.BenchmarkProgress,Q.EventCategory.ModelDownloadProgress]),LN=new Set(ZN),UN=Object.freeze(jn.filter(e=>!LN.has(e)));function Za(e,i){if(e===Q.EventCategory.DetectionPhaseTransition){const l=i.to,d=i.from,m=typeof i.source=="string"?i.source:null,h=typeof i.cooldownMs=="number"?i.cooldownMs:null,p=m?` (${m}${h?`, ${Math.round(h/1e3)}s cooldown`:""})`:"";return l==="active"?`Motion detected — phase active${p}`:l==="watching"?`Cooldown expired — phase watching${p}`:`Phase: ${String(d)} → ${String(l)}${p}`}if(e===Q.EventCategory.DetectionResult){const l=i.frame?.detections??[];if(l.length===0)return null;const d=new Map;for(const m of l){const h=m,p=h.class??h.macroClass,v=typeof p=="string"?p:"";v&&d.set(v,(d.get(v)??0)+1)}return[...d.entries()].map(([m,h])=>h>1?`${m} ×${h}`:m).join(", ")}if(e===Q.EventCategory.PipelineAudioInferenceResult){const l=i.frame?.detections??[];return l.length===0?null:l.map(d=>{const m=d,h=m.macroClass??m.class??m.label,p=typeof h=="string"?h:"",v=m.score;return v?`${p} (${Math.round(v*100)}%)`:p}).filter(Boolean).join(", ")}if(e===Q.EventCategory.DetectionEvent){const l=i.label??i.class,d=i.score??i.confidence,m=[];return typeof l=="string"&&m.push(l),typeof d=="number"&&m.push(`${Math.round(d*100)}%`),m.length>0?m.join(" — "):null}if(e===Q.EventCategory.ProviderMotion)return i.active===!0?"motion start":"motion stop";if(e===Q.EventCategory.DeviceStateChanged){const l=i.slice;if(l&&typeof l=="object"){const d=Object.keys(l).filter(m=>m!=="lastFetchedAt"&&m!=="ts");if(d.length>0)return d.slice(0,4).join(", ")+(d.length>4?"…":"")}return null}if(e===Q.EventCategory.MotionOnMotionChanged){const l=i.detected,d=typeof i.source=="string"?i.source:null,m=l===!0?"motion start":l===!1?"motion stop":"motion";return d?`${m} (${d})`:m}if(e===Q.EventCategory.ProviderDetection||e===Q.EventCategory.DetectionCameraNative){const l=i.detections??[];if(!Array.isArray(l)||l.length===0)return(typeof i.class=="string"?i.class:null)??null;const d=new Map;for(const m of l){const h=m,p=h.class??h.macroClass,v=typeof p=="string"?p:"";v&&d.set(v,(d.get(v)??0)+1)}return[...d.entries()].map(([m,h])=>h>1?`${m} ×${h}`:m).join(", ")}const a=i.addonId,o=i.error;return o||(a?`addon: ${a}`:null)}function BN(e){const i=e.category;return i===Q.EventCategory.DetectionResult||i===Q.EventCategory.PipelineAudioInferenceResult?Za(i,e.data)!==null:!0}var FN=300;function Cc({agentId:e,addonId:i,deviceId:a,defaultCategories:o,categories:l,category:d,maxHeight:m="max-h-96",limit:h=50,showCategoryFilter:p=!0,showFilters:v=!1,liveBuffer:y,onClose:w,className:N}){const O=(0,n.useMemo)(()=>o??l??UN,[o,l]),E=(0,n.useMemo)(()=>[...O].sort().join(","),[O]),[A,R]=(0,n.useState)(()=>new Set(O)),Z=(0,n.useRef)(E);(0,n.useEffect)(()=>{Z.current!==E&&(Z.current=E,R(new Set(O)))},[E,O]);const G=Kr(FN),V=y??G,re=V.entries,[te,ce]=(0,n.useState)(!0),[ye,ue]=(0,n.useState)(new Set),[Ee,Re]=(0,n.useState)(""),[et,dt]=(0,n.useState)(!1),[He,Je]=(0,n.useState)(""),[Xe,Ge]=(0,n.useState)(0),Ae=(0,n.useRef)(null),pt=(0,n.useRef)(null),ct=`${e??""}:${i??""}:${String(a??"")}:${d??""}`,we=(0,n.useRef)(ct);(0,n.useEffect)(()=>{we.current!==ct&&(we.current=ct,V.reset(),ue(new Set),Ge(0))},[ct,V]),(0,n.useEffect)(()=>{if(!et)return;const Ne=ft=>{const vt=pt.current;vt&&ft.target instanceof Node&&!vt.contains(ft.target)&&dt(!1)};return document.addEventListener("mousedown",Ne),()=>{document.removeEventListener("mousedown",Ne)}},[et]);const Oe=(0,n.useMemo)(()=>{const Ne={};return e&&(Ne.agentId=e),i&&(Ne.addonId=i),a!==void 0&&(Ne.deviceId=a),d&&(Ne.category=d),Ne},[e,i,a,d]),Pe=(0,n.useMemo)(()=>[...A].sort(),[A]),Ke=(0,n.useMemo)(()=>{const Ne={...Oe,limit:h};return Pe.length>0&&Pe.length<jn.length&&(Ne.category=Pe),Ne},[Oe,h,(0,n.useMemo)(()=>Pe.join(","),[Pe]),Pe]),{data:ze,isLoading:Le}=j.systemEvents.getRecent.useQuery(Ke,{staleTime:3e4}),Ue=(0,n.useRef)(A);(0,n.useEffect)(()=>{Ue.current=A},[A]);const De=Oe;j.systemEvents.subscribe.useSubscription(De,{onData:Ne=>{const ft=Ne;ft?.id&&TN(ft,e,i,a)&&Ue.current.has(ft.category)&&V.append(ft)}});const qe=(0,n.useRef)(re.length);(0,n.useEffect)(()=>{const Ne=Ae.current;if(!Ne){qe.current=re.length;return}const ft=qe.current;if(qe.current=re.length,!(re.length<=ft)){if(te&&Ne.scrollTop<=8)Ne.scrollTo({top:0});else if(!te&&Ne.scrollTop>0){const vt=Ne.firstElementChild?.firstElementChild,bt=vt instanceof HTMLElement?vt.offsetHeight:28;Ne.scrollTop+=bt*(re.length-ft)}}},[re.length,te]);const Be=(0,n.useMemo)(()=>{const Ne=new Map;for(const bt of ze??[])Ne.set(bt.id,bt);for(const bt of re)Ne.set(bt.id,bt);let ft=[...Ne.values()].filter(bt=>A.has(bt.category)).filter(BN);Xe>0&&(ft=ft.filter(bt=>new Date(bt.timestamp).getTime()>Xe));const vt=Ee.trim().toLowerCase();return vt&&(ft=ft.filter(bt=>{if(bt.category.toLowerCase().includes(vt)||Oc(bt.category,bt.data).label.toLowerCase().includes(vt))return!0;const Xr=Za(bt.category,bt.data);if(Xr&&Xr.toLowerCase().includes(vt))return!0;try{if(new Date(bt.timestamp).toLocaleTimeString().toLowerCase().includes(vt))return!0}catch{}try{if(JSON.stringify(bt.data).toLowerCase().includes(vt)||JSON.stringify(bt.source).toLowerCase().includes(vt))return!0}catch{}return!1})),ft.sort((bt,Xr)=>new Date(Xr.timestamp).getTime()-new Date(bt.timestamp).getTime())},[ze,re,A,Ee,Xe]),Rt=(0,n.useCallback)(Ne=>{ue(ft=>{const vt=new Set(ft);return vt.has(Ne)?vt.delete(Ne):vt.add(Ne),vt})},[]),Zt=(0,n.useCallback)(Ne=>{R(ft=>{const vt=new Set(ft);return vt.has(Ne)?vt.delete(Ne):vt.add(Ne),vt})},[]),Fe=(0,n.useCallback)(()=>{R(new Set(O)),Re(""),Ge(0)},[O]),lt=(0,n.useCallback)(()=>{Ge(Date.now()),V.reset()},[V]),[_t,xt]=(0,n.useState)(!1),[ke,de]=(0,n.useState)(null),Se=(0,n.useCallback)(Ne=>{const ft=new Date(Ne.timestamp).toISOString(),vt=Za(Ne.category,Ne.data)??"",bt=vt?` ${vt}`:"";return`${ft} [${Ne.category}]${bt} data=${JSON.stringify(Ne.data)}`},[]),Ve=(0,n.useCallback)(()=>{const Ne=Be.map(Se);navigator.clipboard.writeText(Ne.join(`
151
- `)).then(()=>{xt(!0),setTimeout(()=>xt(!1),1500)})},[Be,Se]),tt=(0,n.useCallback)(Ne=>{navigator.clipboard.writeText(Se(Ne)).then(()=>{de(Ne.id),setTimeout(()=>de(ft=>ft===Ne.id?null:ft),1200)})},[Se]),je=(0,n.useCallback)(()=>{R(new Set(jn))},[]),Qe=(0,n.useCallback)(()=>{R(new Set)},[]),wt=(0,n.useMemo)(()=>{const Ne=He.trim().toLowerCase();return Ne?jn.filter(ft=>ft.toLowerCase().includes(Ne)):jn},[He]),Sr=jn.length,Wt=A.size,$n=Wt===Sr,IO=$n?"All":`${Wt}/${Sr}`;return(0,r.jsxs)("div",{className:K("h-full min-h-0 flex flex-col",N),onClick:Ne=>Ne.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-hover/30 gap-2 shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"Events"}),e&&(0,r.jsx)(La,{label:"agent",value:e}),i&&(0,r.jsx)(La,{label:"addon",value:i}),a!==void 0&&(0,r.jsx)(La,{label:"device",value:`#${a}`}),d&&(0,r.jsx)(La,{label:"category",value:d}),(0,r.jsxs)("button",{type:"button",onClick:()=>{ce(Ne=>!Ne),!te&&Ae.current&&Ae.current.scrollTo({top:0,behavior:"smooth"})},className:K("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",te?"border-border text-foreground-subtle hover:text-foreground":"border-amber-500/30 bg-amber-500/10 text-amber-400"),children:[(0,r.jsx)(Ds,{className:"h-2.5 w-2.5"}),te?"Auto":"Paused"]}),p&&(0,r.jsxs)("div",{className:"relative",ref:pt,children:[(0,r.jsxs)("button",{type:"button",onClick:()=>dt(Ne=>!Ne),className:K("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",$n?"border-border text-foreground-subtle hover:text-foreground":"border-violet-500/30 bg-violet-500/10 text-violet-400"),title:"Pick events to track",children:[(0,r.jsx)(Ul,{className:"h-2.5 w-2.5"}),"Filter (",IO,")"]}),et&&(0,r.jsx)(GN,{search:He,onSearchChange:Je,categories:wt,active:A,onToggle:Zt,onSelectAll:je,onSelectNone:Qe,onResetDefaults:Fe})]}),(0,r.jsxs)("button",{type:"button",onClick:Fe,className:"inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground transition-colors",title:"Reset filters to defaults",children:[(0,r.jsx)(Hl,{className:"h-2.5 w-2.5"}),"Reset"]}),(0,r.jsxs)("button",{type:"button",onClick:lt,className:"inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground transition-colors",title:"Clear visible entries",children:[(0,r.jsx)(fr,{className:"h-2.5 w-2.5"}),"Clear"]}),(0,r.jsxs)("button",{type:"button",onClick:Ve,disabled:Be.length===0,className:K("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",_t?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":"border-border text-foreground-subtle hover:text-foreground",Be.length===0&&"opacity-40 cursor-not-allowed"),title:"Copy all visible events",children:[(0,r.jsx)(xr,{className:"h-2.5 w-2.5"}),_t?"Copied!":"Copy"]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:"text",value:Ee,onChange:Ne=>Re(Ne.target.value),placeholder:"Search…",className:"w-32 pl-1.5 pr-5 py-0.5 rounded border border-border bg-background text-foreground text-[10px] focus:outline-none focus:border-primary/50"}),Ee&&(0,r.jsx)("button",{type:"button",onClick:()=>Re(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",title:"Clear search",children:(0,r.jsx)(Mt,{className:"h-2.5 w-2.5"})})]}),re.length>0&&(0,r.jsxs)("span",{className:"text-[9px] text-emerald-400 font-medium",children:["+",re.length," live"]})]}),w&&(0,r.jsx)("button",{type:"button",onClick:w,className:"text-foreground-subtle hover:text-foreground",children:(0,r.jsx)(Mt,{className:"h-3.5 w-3.5"})})]}),(0,r.jsxs)("div",{ref:Ae,className:K("flex-1 min-h-0 overflow-auto text-[10px]",m),children:[Le&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle",children:[(0,r.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin"}),"Loading events..."]}),!Le&&Be.length===0&&(0,r.jsx)("div",{className:"py-4 text-center text-foreground-subtle",children:"No events found"}),Be.length>0&&(0,r.jsx)("div",{className:"divide-y divide-border/30",children:Be.map(Ne=>{const ft=Oc(Ne.category,Ne.data),vt=ft.icon,bt=Za(Ne.category,Ne.data),Xr=ye.has(Ne.id);return(0,r.jsxs)("div",{className:"flex items-start gap-2 px-3 py-1.5 hover:bg-surface-hover/30 cursor-pointer",onClick:()=>Rt(Ne.id),children:[(0,r.jsx)("span",{className:"text-foreground-subtle whitespace-nowrap w-[70px] shrink-0 pt-0.5",children:new Date(Ne.timestamp).toLocaleTimeString()}),(0,r.jsx)(QN,{copied:ke===Ne.id,onCopy:()=>tt(Ne)}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[Xr?(0,r.jsx)(Qr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}):(0,r.jsx)(Dr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}),(0,r.jsxs)("span",{className:K("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[9px] font-medium",ft.color),children:[(0,r.jsx)(vt,{className:"h-2.5 w-2.5"}),ft.label]}),Ne.source.nodeId&&Ne.source.nodeId!=="hub"&&(0,r.jsx)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-foreground-subtle/10 text-foreground-subtle font-mono",children:Ne.source.nodeId})]}),bt&&(0,r.jsx)("p",{className:"text-foreground-subtle text-[10px] mt-0.5 ml-5",children:bt}),Xr&&(0,r.jsxs)("div",{className:"mt-1 ml-5 text-[9px] bg-surface rounded px-2 py-1.5 space-y-0.5 font-mono overflow-x-auto",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-primary/70",children:"source"}),(0,r.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,r.jsx)("span",{className:"text-foreground",children:JSON.stringify(Ne.source)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-primary/70",children:"category"}),(0,r.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,r.jsx)("span",{className:"text-foreground",children:Ne.category})]}),Object.entries(Ne.data).map(([Qf,Dc])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-primary/70",children:Qf}),(0,r.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,r.jsx)("span",{className:"text-foreground break-all",children:typeof Dc=="object"?JSON.stringify(Dc):String(Dc)})]},Qf))]})]})]},Ne.id)})})]})]})}function GN({search:e,onSearchChange:i,categories:a,active:o,onToggle:l,onSelectAll:d,onSelectNone:m,onResetDefaults:h}){return(0,r.jsxs)("div",{className:"absolute z-20 top-full mt-1 left-0 w-72 max-h-80 rounded-md border border-border bg-surface shadow-lg flex flex-col",onClick:p=>p.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border/50",children:[(0,r.jsx)(Li,{className:"h-3 w-3 text-foreground-subtle"}),(0,r.jsx)("input",{type:"text",value:e,onChange:p=>i(p.target.value),placeholder:"Filter categories…",className:"flex-1 bg-transparent text-[10px] focus:outline-none text-foreground placeholder:text-foreground-subtle",autoFocus:!0}),e&&(0,r.jsx)("button",{type:"button",onClick:()=>i(""),className:"text-foreground-subtle hover:text-foreground",children:(0,r.jsx)(Mt,{className:"h-2.5 w-2.5"})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 border-b border-border/50 text-[9px]",children:[(0,r.jsx)("button",{type:"button",onClick:d,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"All"}),(0,r.jsx)("button",{type:"button",onClick:m,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"None"}),(0,r.jsx)("button",{type:"button",onClick:h,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"Defaults"})]}),(0,r.jsxs)("div",{className:"overflow-y-auto flex-1",children:[a.length===0&&(0,r.jsx)("div",{className:"text-[10px] text-foreground-subtle italic px-2 py-3 text-center",children:"No matches"}),a.map(p=>{const v=o.has(p),y=Oc(p),w=y.icon;return(0,r.jsxs)("button",{type:"button",onClick:()=>l(p),className:"w-full flex items-center gap-2 px-2 py-1 text-left hover:bg-surface-hover/40 text-[10px]",children:[(0,r.jsx)("input",{type:"checkbox",readOnly:!0,checked:v,className:"accent-violet-500"}),(0,r.jsxs)("span",{className:K("inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[9px] font-medium shrink-0",y.color),children:[(0,r.jsx)(w,{className:"h-2.5 w-2.5"}),y.label]}),(0,r.jsx)("span",{className:"text-foreground-subtle font-mono truncate",children:p})]},p)})]})]})}function VN({position:e="bottom",className:i,...a}){return(0,r.jsx)("div",{className:K(e==="bottom"?"absolute bottom-0 left-0 right-0 z-10 border-t border-border bg-surface/95 backdrop-blur-sm":"absolute inset-x-2 bottom-2 z-10 rounded-lg border border-border bg-surface/95 backdrop-blur-sm shadow-xl",i),children:(0,r.jsx)(Cc,{maxHeight:"max-h-48",...a})})}function La({label:e,value:i}){return(0,r.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:[e,": ",i]})}function QN({copied:e,onCopy:i}){return(0,r.jsx)("button",{type:"button",title:"Copy this event",onClick:a=>{a.stopPropagation(),i()},className:K("rounded p-0.5 transition-colors mt-0.5",e?"text-emerald-400":"text-foreground-subtle/60 hover:text-foreground hover:bg-surface-hover"),children:e?(0,r.jsx)(vn,{className:"h-3 w-3"}):(0,r.jsx)(xr,{className:"h-3 w-3"})})}function WN({deviceId:e,className:i="",onOpenChild:a}){const o=j.useUtils(),l=j.deviceDiscovery.listDiscovered.useQuery({deviceId:e},{refetchInterval:1e4,retry:!1}),d=j.deviceDiscovery.getStatus.useQuery({deviceId:e},{refetchInterval:1e4,retry:!1}),m=j.deviceDiscovery.refreshDiscovery.useMutation({onSuccess:()=>{o.deviceDiscovery.listDiscovered.invalidate({deviceId:e}),o.deviceDiscovery.getStatus.invalidate({deviceId:e})}}),h=j.deviceDiscovery.adoptDevice.useMutation({onSuccess:()=>{o.deviceDiscovery.listDiscovered.invalidate({deviceId:e})}}),p=j.deviceDiscovery.releaseDevice.useMutation({onSuccess:()=>{o.deviceDiscovery.listDiscovered.invalidate({deviceId:e})}}),[v,y]=(0,n.useState)(null),{available:w,adopted:N}=(0,n.useMemo)(()=>{const V=l.data??[],re=ce=>typeof ce.metadata.rtspChannel=="number"?ce.metadata.rtspChannel:Number.POSITIVE_INFINITY,te=(ce,ye)=>{const ue=re(ce),Ee=re(ye);return ue!==Ee?ue-Ee:ce.name.localeCompare(ye.name)};return{available:V.filter(ce=>!ce.alreadyAdopted).sort(te),adopted:V.filter(ce=>ce.alreadyAdopted).sort(te)}},[l.data]),O=d.data,E=O?.lastError??null,A=O?.lastDiscoveryAt??null;async function R(){await m.mutateAsync({deviceId:e}).catch(()=>{})}async function Z(V){y(V.childNativeId);try{await h.mutateAsync({deviceId:e,childNativeId:V.childNativeId})}finally{y(null)}}async function G(V){if(V.adoptedDeviceId!=null){y(V.childNativeId);try{await p.mutateAsync({deviceId:e,childDeviceId:V.adoptedDeviceId})}finally{y(null)}}}return(0,r.jsxs)("div",{className:`rounded-xl border border-border bg-surface ${i}`,children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2 border-b border-border px-3 py-2 sm:px-5 sm:py-3",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Discovered devices"}),(0,r.jsxs)("p",{className:"text-[11px] text-foreground-subtle",children:["Channels behind this hub. Click ",(0,r.jsx)("span",{className:"font-medium",children:"Add"})," to promote a channel to a managed device, or ",(0,r.jsx)("span",{className:"font-medium",children:"Remove"})," to detach."]})]}),(0,r.jsxs)("button",{type:"button",onClick:R,disabled:m.isPending,className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-2 py-1.5 sm:px-3 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50 shrink-0",children:[m.isPending?(0,r.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(Sa,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Refresh"})]})]}),E?(0,r.jsxs)("div",{className:"flex items-start gap-2 border-b border-border bg-destructive/10 px-5 py-2 text-[11px] text-destructive",children:[(0,r.jsx)(bn,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),(0,r.jsxs)("span",{children:["Last refresh failed: ",E]})]}):null,l.isLoading?(0,r.jsx)("div",{className:"flex items-center justify-center py-8 text-foreground-subtle",children:(0,r.jsx)(tr,{className:"h-5 w-5 animate-spin"})}):w.length===0&&N.length===0?(0,r.jsx)("div",{className:"px-5 py-8 text-center text-xs text-foreground-subtle",children:"No channels reported by the hub yet. Click Refresh to enumerate."}):(0,r.jsxs)(r.Fragment,{children:[w.length>0?(0,r.jsx)(Lf,{title:"Available to add",count:w.length,tone:"primary",children:w.map(V=>(0,r.jsx)(Uf,{child:V,busy:v===V.childNativeId,onAdopt:Z,onRelease:G,onOpenChild:a},V.childNativeId))}):null,N.length>0?(0,r.jsx)(Lf,{title:"Already adopted",count:N.length,tone:"muted",children:N.map(V=>(0,r.jsx)(Uf,{child:V,busy:v===V.childNativeId,onAdopt:Z,onRelease:G,onOpenChild:a},V.childNativeId))}):null]}),A!=null?(0,r.jsxs)("div",{className:"border-t border-border px-5 py-2 text-[10px] text-foreground-subtle",children:["Last refreshed ",new Date(A).toLocaleString()]}):null]})}function Lf({title:e,count:i,tone:a,children:o}){return(0,r.jsxs)("div",{className:"border-t border-border",children:[(0,r.jsxs)("div",{className:`flex items-center justify-between border-b px-3 sm:px-5 py-1.5 text-[10px] uppercase tracking-wider ${a==="primary"?"bg-primary/5 text-primary border-primary/30":"bg-surface text-foreground-subtle border-border"}`,children:[(0,r.jsx)("span",{className:"font-semibold",children:e}),(0,r.jsx)("span",{className:"font-mono",children:i})]}),(0,r.jsx)("div",{className:"divide-y divide-border",children:o})]})}function Uf({child:e,busy:i,onAdopt:a,onRelease:o,onOpenChild:l}){return(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2 sm:px-5 sm:py-3 sm:flex-nowrap sm:gap-3",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[(0,r.jsx)(qN,{status:e.status}),(0,r.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:e.name}),e.metadata.isDoorbell?(0,r.jsx)("span",{className:"rounded bg-surface-hover px-1.5 py-0.5 text-[9px] uppercase tracking-wide text-foreground-subtle",children:"Doorbell"}):null,e.metadata.isBattery?(0,r.jsx)("span",{className:"rounded bg-surface-hover px-1.5 py-0.5 text-[9px] uppercase tracking-wide text-foreground-subtle",children:"Battery"}):null,e.metadata.isMultifocal?(0,r.jsx)("span",{className:"rounded bg-surface-hover px-1.5 py-0.5 text-[9px] uppercase tracking-wide text-foreground-subtle",children:"Multifocal"}):null]}),(0,r.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[11px] text-foreground-subtle",children:[typeof e.metadata.rtspChannel=="number"?(0,r.jsxs)("span",{children:["ch ",(0,r.jsx)("span",{className:"font-mono",children:e.metadata.rtspChannel})]}):null,e.metadata.model?(0,r.jsx)("span",{className:"truncate max-w-[160px]",children:e.metadata.model}):null,e.metadata.uid?(0,r.jsxs)("span",{className:"font-mono truncate max-w-[140px]",children:[e.metadata.uid.slice(0,12),"…"]}):null]})]}),e.alreadyAdopted?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[l&&e.adoptedDeviceId!==null?(0,r.jsxs)("button",{type:"button",onClick:()=>l(e.adoptedDeviceId),className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",title:"Open device detail",children:[(0,r.jsx)(Ts,{className:"h-3.5 w-3.5"}),"Open"]}):null,(0,r.jsxs)("button",{type:"button",onClick:()=>{o(e)},disabled:i,className:"inline-flex items-center gap-1.5 rounded-lg border border-destructive/30 px-3 py-1.5 text-xs text-destructive hover:bg-destructive/10 transition-colors disabled:opacity-50",children:[i?(0,r.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(fr,{className:"h-3.5 w-3.5"}),"Remove"]})]}):(0,r.jsxs)("button",{type:"button",onClick:()=>{a(e)},disabled:i,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50",children:[i?(0,r.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(Zi,{className:"h-3.5 w-3.5"}),"Add"]})]})}function qN({status:e}){switch(e){case"online":return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-emerald-500/40 bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-500",children:[(0,r.jsx)(ru,{className:"h-2.5 w-2.5"})," online"]});case"sleeping":return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-500",children:[(0,r.jsx)(Zs,{className:"h-2.5 w-2.5"})," sleeping"]});case"offline":return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-destructive/40 bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,r.jsx)(Pv,{className:"h-2.5 w-2.5"})," offline"]});default:return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-border bg-surface px-2 py-0.5 text-[10px] font-medium text-foreground-subtle",children:[(0,r.jsx)(Tl,{className:"h-2.5 w-2.5"})," unknown"]})}}function HN(e,i){if(!e||typeof e!="object")return!1;const a=e;if(a.category!==Q.EventCategory.DeviceStateChanged)return!1;const o=a.data;return!(!o||typeof o!="object"||o.deviceId!==i||typeof o.capName!="string"||!o.slice||typeof o.slice!="object")}function Ic(e){if(!e||typeof e!="object")return null;const i=e,a=typeof i.id=="string"?i.id:null,o=typeof i.timestamp=="string"?i.timestamp:null,l=i.data;return!a||!o||!l||typeof l!="object"||typeof l.capName!="string"||!l.slice||typeof l.slice!="object"?null:{id:a,timestamp:o,capName:l.capName,slice:l.slice}}var JN=300,KN=Object.freeze([...new Set(Q.ALL_CAPABILITY_DEFINITIONS.filter(e=>e.scope==="device").map(e=>e.name))].sort());function Bf({deviceId:e,defaultCaps:i,maxHeight:a="max-h-96",limit:o=50,liveBuffer:l,onClose:d,className:m}){const[h,p]=(0,n.useState)((0,n.useMemo)(()=>new Set(i??[]),[i])),[v,y]=(0,n.useState)(""),[w,N]=(0,n.useState)(!0),[O,E]=(0,n.useState)(new Set),[A,R]=(0,n.useState)(0),[Z,G]=(0,n.useState)(!1),[V,re]=(0,n.useState)(""),te=(0,n.useRef)(null),ce=Kr(JN),ye=l??ce,ue=ye.entries,Ee=(0,n.useRef)(null),Re=(0,n.useRef)(e);(0,n.useEffect)(()=>{Re.current!==e&&(Re.current=e,ye.reset(),E(new Set),R(0))},[e,ye]);const et=(0,n.useMemo)(()=>({deviceId:e,category:Q.EventCategory.DeviceStateChanged,limit:o}),[e,o]),{data:dt,isLoading:He}=j.systemEvents.getRecent.useQuery(et,{staleTime:3e4}),Je=(0,n.useRef)(h);(0,n.useEffect)(()=>{Je.current=h},[h]),j.systemEvents.subscribe.useSubscription({deviceId:e,category:Q.EventCategory.DeviceStateChanged},{onData:ke=>{if(!HN(ke,e))return;const de=Ic(ke);if(!de)return;const Se=Je.current;Se.size>0&&!Se.has(de.capName)||ye.append(de)}});const Xe=(0,n.useRef)(ue.length);(0,n.useEffect)(()=>{const ke=Ee.current;if(!ke){Xe.current=ue.length;return}const de=Xe.current;if(Xe.current=ue.length,!(ue.length<=de)){if(w&&ke.scrollTop<=8)ke.scrollTo({top:0});else if(!w&&ke.scrollTop>0){const Se=ke.firstElementChild?.firstElementChild,Ve=Se instanceof HTMLElement?Se.offsetHeight:28,tt=ue.length-de;ke.scrollTop+=Ve*tt}}},[ue.length,w]);const Ge=(0,n.useMemo)(()=>{const ke=new Map;for(const Ve of dt??[]){const tt=Ic(Ve);tt&&ke.set(tt.id,tt)}for(const Ve of ue)ke.set(Ve.id,Ve);let de=[...ke.values()];A>0&&(de=de.filter(Ve=>new Date(Ve.timestamp).getTime()>A)),h.size>0&&(de=de.filter(Ve=>h.has(Ve.capName)));const Se=v.trim().toLowerCase();return Se&&(de=de.filter(Ve=>{if(Ve.capName.toLowerCase().includes(Se))return!0;try{if(new Date(Ve.timestamp).toLocaleTimeString().toLowerCase().includes(Se))return!0}catch{}try{if(Object.entries(Ve.slice).map(([tt,je])=>`${tt}=${Ec(je)}`).join(" · ").toLowerCase().includes(Se))return!0}catch{}try{if(JSON.stringify(Ve.slice).toLowerCase().includes(Se))return!0}catch{}return!1})),de.sort((Ve,tt)=>new Date(tt.timestamp).getTime()-new Date(Ve.timestamp).getTime())},[dt,ue,h,v,A]),Ae=(0,n.useMemo)(()=>{const ke=new Set(KN);for(const de of dt??[]){const Se=Ic(de);Se&&ke.add(Se.capName)}for(const de of ue)ke.add(de.capName);return[...ke].sort()},[dt,ue]),pt=(0,n.useCallback)(ke=>{E(de=>{const Se=new Set(de);return Se.has(ke)?Se.delete(ke):Se.add(ke),Se})},[]),ct=(0,n.useCallback)(ke=>{p(de=>{const Se=new Set(de);return Se.has(ke)?Se.delete(ke):Se.add(ke),Se})},[]),we=(0,n.useCallback)(()=>{p(new Set(i??[])),y("")},[i]),Oe=(0,n.useCallback)(()=>{R(Date.now()),ye.reset()},[ye]),[Pe,Ke]=(0,n.useState)(!1),[ze,Le]=(0,n.useState)(null),Ue=(0,n.useCallback)(ke=>`${new Date(ke.timestamp).toISOString()} [${ke.capName}] slice=${JSON.stringify(ke.slice)}`,[]),De=(0,n.useCallback)(()=>{const ke=Ge.map(Ue);navigator.clipboard.writeText(ke.join(`
152
- `)).then(()=>{Ke(!0),setTimeout(()=>Ke(!1),1500)})},[Ge,Ue]),qe=(0,n.useCallback)(ke=>{navigator.clipboard.writeText(Ue(ke)).then(()=>{Le(ke.id),setTimeout(()=>Le(de=>de===ke.id?null:de),1200)})},[Ue]),Be=(0,n.useCallback)(()=>{p(new Set(Ae))},[Ae]),Rt=(0,n.useCallback)(()=>{p(new Set)},[]),Zt=(0,n.useMemo)(()=>{const ke=V.trim().toLowerCase();return ke?Ae.filter(de=>de.toLowerCase().includes(ke)):Ae},[V,Ae]),Fe=Ae.length,lt=h.size,_t=lt===0||lt===Fe,xt=_t?"All":`${lt}/${Fe}`;return(0,n.useEffect)(()=>{if(!Z)return;const ke=de=>{const Se=te.current;Se&&!Se.contains(de.target)&&G(!1)};return document.addEventListener("mousedown",ke),()=>document.removeEventListener("mousedown",ke)},[Z]),(0,r.jsxs)("div",{className:K("h-full min-h-0 flex flex-col",m),onClick:ke=>ke.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-hover/30 gap-2 shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"State"}),(0,r.jsx)(XN,{label:"device",value:`#${e}`}),(0,r.jsxs)("button",{type:"button",onClick:()=>{N(ke=>!ke),!w&&Ee.current&&Ee.current.scrollTo({top:0,behavior:"smooth"})},className:K("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",w?"border-border text-foreground-subtle hover:text-foreground":"border-amber-500/30 bg-amber-500/10 text-amber-400"),children:[(0,r.jsx)(Ds,{className:"h-2.5 w-2.5"}),w?"Auto":"Paused"]}),(0,r.jsxs)("div",{className:"relative",ref:te,children:[(0,r.jsxs)("button",{type:"button",onClick:()=>G(ke=>!ke),className:K("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",_t?"border-border text-foreground-subtle hover:text-foreground":"border-violet-500/30 bg-violet-500/10 text-violet-400"),title:"Pick caps to track",children:[(0,r.jsx)(Ul,{className:"h-2.5 w-2.5"}),"Filter (",xt,")"]}),Z&&(0,r.jsx)(YN,{search:V,onSearchChange:re,caps:Zt,active:h,onToggle:ct,onSelectAll:Be,onSelectNone:Rt,onResetDefaults:we})]}),(0,r.jsxs)("button",{type:"button",onClick:we,className:"inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground transition-colors",title:"Reset filters",children:[(0,r.jsx)(Hl,{className:"h-2.5 w-2.5"}),"Reset"]}),(0,r.jsxs)("button",{type:"button",onClick:Oe,className:"inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground transition-colors",title:"Clear visible entries",children:[(0,r.jsx)(fr,{className:"h-2.5 w-2.5"}),"Clear"]}),(0,r.jsxs)("button",{type:"button",onClick:De,disabled:Ge.length===0,className:K("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",Pe?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":"border-border text-foreground-subtle hover:text-foreground",Ge.length===0&&"opacity-40 cursor-not-allowed"),title:"Copy all visible state changes",children:[(0,r.jsx)(xr,{className:"h-2.5 w-2.5"}),Pe?"Copied!":"Copy"]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:"text",value:v,onChange:ke=>y(ke.target.value),placeholder:"Search…",className:"w-32 pl-1.5 pr-5 py-0.5 rounded border border-border bg-background text-foreground text-[10px] focus:outline-none focus:border-primary/50"}),v&&(0,r.jsx)("button",{type:"button",onClick:()=>y(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",title:"Clear search",children:(0,r.jsx)(Mt,{className:"h-2.5 w-2.5"})})]}),ue.length>0&&(0,r.jsxs)("span",{className:"text-[9px] text-emerald-400 font-medium",children:["+",ue.length," live"]})]}),d&&(0,r.jsx)("button",{type:"button",onClick:d,className:"text-foreground-subtle hover:text-foreground",children:(0,r.jsx)(Mt,{className:"h-3.5 w-3.5"})})]}),(0,r.jsxs)("div",{ref:Ee,className:K("flex-1 min-h-0 overflow-auto text-[10px]",a),children:[He&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle",children:[(0,r.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin"}),"Loading state changes..."]}),!He&&Ge.length===0&&(0,r.jsx)("div",{className:"py-4 text-center text-foreground-subtle",children:"No state changes"}),Ge.length>0&&(0,r.jsx)("div",{className:"divide-y divide-border/30",children:Ge.map(ke=>{const de=O.has(ke.id),Se=Object.entries(ke.slice),Ve=Se.slice(0,3).map(([tt,je])=>`${tt}=${Ec(je)}`).join(" · ");return(0,r.jsxs)("div",{className:"flex items-start gap-2 px-3 py-1.5 hover:bg-surface-hover/30 cursor-pointer",onClick:()=>pt(ke.id),children:[(0,r.jsx)("span",{className:"text-foreground-subtle whitespace-nowrap w-[70px] shrink-0 pt-0.5",children:new Date(ke.timestamp).toLocaleTimeString()}),(0,r.jsx)(eO,{copied:ze===ke.id,onCopy:()=>qe(ke)}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[de?(0,r.jsx)(Qr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}):(0,r.jsx)(Dr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}),(0,r.jsx)("span",{className:"inline-flex items-center gap-1 rounded-full border border-violet-500/30 bg-violet-500/15 text-violet-400 px-2 py-0.5 text-[9px] font-medium",children:ke.capName}),Se.length>3&&(0,r.jsxs)("span",{className:"text-[9px] text-foreground-subtle",children:["+",Se.length-3," more"]})]}),Ve&&(0,r.jsx)("p",{className:"text-foreground-subtle text-[10px] mt-0.5 ml-5 truncate",children:Ve}),de&&(0,r.jsx)("div",{className:"mt-1 ml-5 text-[9px] bg-surface rounded px-2 py-1.5 space-y-0.5 font-mono overflow-x-auto",children:Se.length===0?(0,r.jsx)("div",{className:"text-foreground-subtle italic",children:"empty slice"}):Se.map(([tt,je])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-primary/70",children:tt}),(0,r.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,r.jsx)("span",{className:"text-foreground break-all",children:Ec(je)})]},tt))})]})]},ke.id)})})]})]})}function Ec(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function XN({label:e,value:i}){return(0,r.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:[e,": ",i]})}function YN({search:e,onSearchChange:i,caps:a,active:o,onToggle:l,onSelectAll:d,onSelectNone:m,onResetDefaults:h}){return(0,r.jsxs)("div",{className:"absolute z-20 top-full mt-1 left-0 w-72 max-h-80 rounded-md border border-border bg-surface shadow-lg flex flex-col",onClick:p=>p.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border/50",children:[(0,r.jsx)(Li,{className:"h-3 w-3 text-foreground-subtle"}),(0,r.jsx)("input",{type:"text",value:e,onChange:p=>i(p.target.value),placeholder:"Filter caps…",className:"flex-1 bg-transparent text-[10px] focus:outline-none text-foreground placeholder:text-foreground-subtle",autoFocus:!0}),e&&(0,r.jsx)("button",{type:"button",onClick:()=>i(""),className:"text-foreground-subtle hover:text-foreground",children:(0,r.jsx)(Mt,{className:"h-2.5 w-2.5"})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 border-b border-border/50 text-[9px]",children:[(0,r.jsx)("button",{type:"button",onClick:d,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"All"}),(0,r.jsx)("button",{type:"button",onClick:m,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"None"}),(0,r.jsx)("button",{type:"button",onClick:h,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"Defaults"})]}),(0,r.jsxs)("div",{className:"overflow-y-auto flex-1",children:[a.length===0&&(0,r.jsx)("div",{className:"text-[10px] text-foreground-subtle italic px-2 py-3 text-center",children:"No matches"}),a.map(p=>(0,r.jsxs)("button",{type:"button",onClick:()=>l(p),className:"w-full flex items-center gap-2 px-2 py-1 text-left hover:bg-surface-hover/40 text-[10px]",children:[(0,r.jsx)("input",{type:"checkbox",readOnly:!0,checked:o.has(p),className:"accent-violet-500"}),(0,r.jsx)("span",{className:"inline-flex items-center gap-1 rounded-full border border-violet-500/30 bg-violet-500/15 text-violet-400 px-1.5 py-0.5 text-[9px] font-medium shrink-0",children:p})]},p))]})]})}function eO({copied:e,onCopy:i}){return(0,r.jsx)("button",{type:"button",title:"Copy this state change",onClick:a=>{a.stopPropagation(),i()},className:K("rounded p-0.5 transition-colors mt-0.5",e?"text-emerald-400":"text-foreground-subtle/60 hover:text-foreground hover:bg-surface-hover"),children:e?(0,r.jsx)(vn,{className:"h-3 w-3"}):(0,r.jsx)(xr,{className:"h-3 w-3"})})}var Mc=500,tO=[{id:"logs",label:"Logs",icon:pv},{id:"events",label:"Events",icon:wa},{id:"state",label:"State",icon:Yp}];function rO({deviceId:e,defaultEventCategories:i,defaultStateCaps:a,initialTab:o="events",className:l,maxHeight:d="max-h-96"}){const[m,h]=(0,n.useState)(o),p=Kr(Mc),v=Kr(Mc),y=Kr(Mc),w=p.reset,N=v.reset,O=y.reset;return(0,n.useEffect)(()=>{w(),N(),O()},[e,w,N,O]),(0,r.jsxs)("div",{className:K("flex flex-col h-full min-h-0",l),children:[(0,r.jsx)("div",{className:"flex items-center gap-1 mb-2 shrink-0",children:tO.map(({id:E,label:A,icon:R})=>(0,r.jsxs)("button",{type:"button",onClick:()=>h(E),className:K("inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[11px] font-medium transition-colors",m===E?"bg-primary/15 text-primary border border-primary/30":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover border border-transparent"),children:[(0,r.jsx)(R,{className:"h-3.5 w-3.5"}),A]},E))}),(0,r.jsxs)("div",{className:"flex-1 min-h-0 overflow-hidden",children:[m==="logs"&&(0,r.jsx)(kc,{deviceId:e,maxHeight:d,showFilters:!1,liveBuffer:p}),m==="events"&&(0,r.jsx)(Cc,{deviceId:e,defaultCategories:i,maxHeight:d,showCategoryFilter:!0,liveBuffer:v}),m==="state"&&(0,r.jsx)(Bf,{deviceId:e,defaultCaps:a,maxHeight:d,liveBuffer:y})]})]})}function nO({label:e,icon:i,title:a="Confirm action",description:o,confirmLabel:l,triggerVariant:d="outline",confirmVariant:m="danger",size:h="sm",disabled:p,className:v,action:y,onSuccess:w}){const[N,O]=(0,n.useState)(!1),[E,A]=(0,n.useState)(!1),[R,Z]=(0,n.useState)(null),G=async()=>{Z(null),A(!0);try{const V=await y();w?.(V),O(!1)}catch(V){Z(V instanceof Error?V.message:String(V))}finally{A(!1)}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(wr,{type:"button",variant:d,size:h,disabled:p,onClick:()=>{Z(null),O(!0)},className:v,children:[i&&(0,r.jsx)(i,{className:"h-3.5 w-3.5"}),e]}),(0,r.jsx)(mu,{open:N,onOpenChange:V=>!E&&O(V),children:(0,r.jsxs)(Ws,{children:[(0,r.jsxs)(gu,{children:[(0,r.jsxs)(vu,{className:"flex items-center gap-2",children:[(0,r.jsx)(bn,{className:"h-4 w-4 text-amber-400"}),a]}),typeof o=="string"?(0,r.jsx)(hu,{children:o}):o]}),R&&(0,r.jsx)("div",{className:K("mt-2 px-3 py-2 rounded border border-danger/40 bg-danger/10","text-xs text-danger"),children:R}),(0,r.jsxs)(pu,{children:[(0,r.jsx)(wr,{type:"button",variant:"ghost",size:h,disabled:E,onClick:()=>O(!1),children:"Cancel"}),(0,r.jsxs)(wr,{type:"button",variant:m,size:h,disabled:E,onClick:()=>{G()},children:[E&&(0,r.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin"}),l??e]})]})]})})]})}function Ua({direction:e,icon:i,disabled:a,className:o,variant:l,onMove:d,onStart:m,onStop:h}){const[p,v]=(0,n.useState)(null),[y,w]=(0,n.useState)(!1),N=(0,n.useCallback)(Z=>{if(a)return;Z.currentTarget.setPointerCapture(Z.pointerId),v(Date.now()),w(!1);const G=setTimeout(()=>{w(!0),m(e)},250);Z.currentTarget.dataset.timer=String(G)},[e,a,m]),O=(0,n.useCallback)(Z=>{const G=Number(Z.currentTarget.dataset.timer);G&&clearTimeout(G),Z.currentTarget.dataset.timer="",y?h():p!==null&&d(e),v(null),w(!1)},[y,e,d,h,p]),E=(0,n.useCallback)(Z=>{const G=Number(Z.currentTarget.dataset.timer);G&&clearTimeout(G),Z.currentTarget.dataset.timer="",y&&h(),v(null),w(!1)},[y,h]),A=l==="panel"?"h-9 w-9":"h-7 w-7",R=l==="panel"?"h-4 w-4":"h-3.5 w-3.5";return(0,r.jsx)("button",{type:"button",disabled:a,onPointerDown:N,onPointerUp:O,onPointerCancel:E,className:K("flex items-center justify-center rounded transition-colors disabled:opacity-40",l==="panel"?"text-foreground hover:bg-surface-hover active:bg-surface-hover/80":"text-white hover:bg-white/15 active:bg-white/25",A,o),title:e,children:(0,r.jsx)(i,{className:R})})}function iO({controls:e,mode:i="overlay",showPresets:a,showZoom:o=!0,showHome:l=!0,className:d}){const{move:m,startContinuous:h,stopContinuous:p,zoom:v,goHome:y,goToPreset:w,presets:N,busy:O,error:E}=e,[A,R]=(0,n.useState)(!1),Z=(a??N.length>0)&&N.length>0,G=i==="panel",V=G?"flex flex-col items-stretch gap-2 w-full h-full p-3":"pointer-events-auto absolute top-3 right-3 z-10 flex flex-col items-end gap-2",re=K(G?"flex items-center gap-3 rounded-lg p-2":"flex items-center gap-2 rounded-lg border border-white/30 bg-zinc-900/90 backdrop-blur-md p-2 shadow-lg shadow-black/40",O&&"ring-1 ring-primary/40"),te=G?"h-9 w-9":"h-7 w-7",ce=G?"h-4 w-4":"h-3.5 w-3.5",ye=G?"text-foreground hover:bg-surface-hover":"text-white hover:bg-white/15",ue=G?"h-12 w-px bg-border mx-1":"h-12 w-px bg-white/15 mx-1";return(0,r.jsxs)("div",{className:K(V,d),children:[E&&(0,r.jsxs)("div",{className:"rounded bg-danger/90 px-2 py-1 text-[10px] font-medium text-white shadow-lg max-w-[200px] self-center",children:["PTZ: ",E]}),(0,r.jsxs)("div",{className:K(re,G&&"justify-center"),children:[(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-0.5",children:[(0,r.jsx)("span",{"aria-hidden":!0,className:G?"h-9 w-9":"h-7 w-7"}),(0,r.jsx)(Ua,{direction:"up",icon:Tp,variant:i,onMove:m,onStart:h,onStop:p}),(0,r.jsx)("span",{"aria-hidden":!0,className:G?"h-9 w-9":"h-7 w-7"}),(0,r.jsx)(Ua,{direction:"left",icon:Ap,variant:i,onMove:m,onStart:h,onStop:p}),(0,r.jsx)("span",{"aria-hidden":!0,className:G?"h-9 w-9":"h-7 w-7"}),(0,r.jsx)(Ua,{direction:"right",icon:zp,variant:i,onMove:m,onStart:h,onStop:p}),(0,r.jsx)("span",{"aria-hidden":!0,className:G?"h-9 w-9":"h-7 w-7"}),(0,r.jsx)(Ua,{direction:"down",icon:Dp,variant:i,onMove:m,onStart:h,onStop:p}),(0,r.jsx)("span",{"aria-hidden":!0,className:G?"h-9 w-9":"h-7 w-7"})]}),(o||l)&&(0,r.jsx)("div",{className:ue}),(0,r.jsxs)("div",{className:"flex flex-col gap-0.5",children:[o&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",onClick:()=>v("in"),disabled:O,title:"Zoom in",className:K("flex items-center justify-center rounded disabled:opacity-40",te,ye),children:(0,r.jsx)(Nv,{className:ce})}),(0,r.jsx)("button",{type:"button",onClick:()=>v("out"),disabled:O,title:"Zoom out",className:K("flex items-center justify-center rounded disabled:opacity-40",te,ye),children:(0,r.jsx)(Ov,{className:ce})})]}),l&&(0,r.jsx)("button",{type:"button",onClick:()=>y(),disabled:O,title:"Go home",className:K("flex items-center justify-center rounded disabled:opacity-40",te,ye),children:(0,r.jsx)(Bl,{className:ce})})]}),Z&&(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>R(Ee=>!Ee),disabled:O,className:K("flex items-center gap-1 rounded px-2 text-[10px] disabled:opacity-40",G?"h-9 text-foreground hover:bg-surface-hover":"h-7 text-white hover:bg-white/15"),title:"Presets",children:["Presets",(0,r.jsx)(Qr,{className:K("h-3 w-3 transition-transform",A&&"rotate-180")})]}),A&&(0,r.jsx)("div",{className:K("absolute right-0 min-w-[140px] rounded-lg shadow-xl py-1 z-20",G?"bottom-full mb-1 bg-surface border border-border":"top-full mt-1 border border-white/30 bg-zinc-900/95 backdrop-blur-md"),children:N.map(Ee=>(0,r.jsx)("button",{type:"button",onClick:()=>{w(Ee.id),R(!1)},disabled:O,className:K("block w-full px-3 py-1.5 text-left text-[10px] disabled:opacity-40",G?"text-foreground hover:bg-surface-hover":"text-white hover:bg-white/15"),children:Ee.name||Ee.id},Ee.id))})]})]})]})}function aO(e,i){const a=document.createElement("a");a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a)}function oO({trpc:e,deviceId:i,deviceName:a,size:o="sm",className:l}){const[d,m]=(0,n.useState)(!1),[h,p]=(0,n.useState)(!1),[v,y]=(0,n.useState)(null),w=a.replace(/[^a-zA-Z0-9_.-]+/g,"_"),N=(0,n.useCallback)(async te=>{m(!0),y(null),p(!1);try{const ce=await e.snapshot.getSnapshot.query({deviceId:i,force:!0});if(!ce)throw new Error("No snapshot available");const ye=`data:${ce.contentType};base64,${ce.base64}`;if(te==="copy")try{await navigator.clipboard.writeText(ye)}catch{throw new Error("Clipboard unavailable")}else{const ue=ce.contentType.includes("png")?"png":"jpg";aO(`${w}-${new Date().toISOString().replace(/[:.]/g,"-")}.${ue}`,ye)}p(!0),setTimeout(()=>p(!1),1500)}catch(ce){y(ce instanceof Error?ce.message:String(ce))}finally{m(!1)}},[e,i,w]),O=o==="md"?"h-9 px-3 text-sm gap-2":"h-7 px-2.5 text-[11px] gap-1.5",[E,A]=(0,n.useState)(null),[R,Z]=(0,n.useState)(!1),G=()=>{Z(!1),A(setTimeout(()=>{Z(!0),N("copy")},600))},V=()=>{E&&(clearTimeout(E),A(null)),R||N("download")},re=()=>{E&&(clearTimeout(E),A(null))};return(0,r.jsxs)("button",{type:"button",title:"Click to download · long-press to copy",disabled:d,onPointerDown:G,onPointerUp:V,onPointerLeave:re,onPointerCancel:re,className:K("inline-flex items-center justify-center rounded-lg font-medium border border-border","text-foreground-subtle hover:text-foreground hover:bg-surface-hover","disabled:opacity-50 transition-colors",O,v&&"border-danger/40 text-danger",l),children:[d?(0,r.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin"}):h?(0,r.jsx)(vn,{className:"h-3.5 w-3.5 text-success"}):(0,r.jsx)(As,{className:"h-3.5 w-3.5"}),"Snapshot"]})}function sO(e){const i=Date.now()-e;return i<6e4?"just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:`${Math.floor(i/864e5)}d ago`}function cO({history:e,limit:i=5,latestIsFresh:a,className:o}){if(e.length===0)return null;const l=a?Up:wa,d=e.slice(0,i);return(0,r.jsxs)("div",{className:K("rounded-lg border border-border bg-surface px-3 py-2",o),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)(l,{className:K("h-4 w-4 text-amber-400",a&&"animate-pulse")}),(0,r.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-foreground-subtle",children:"Recent presses"}),(0,r.jsx)("span",{className:"ml-auto rounded-full bg-foreground-subtle/10 px-1.5 py-0.5 text-[10px] font-medium text-foreground-subtle border border-border",children:e.length})]}),(0,r.jsx)("ul",{className:"space-y-1",children:d.map(m=>(0,r.jsxs)("li",{className:"flex items-center justify-between text-[11px]",title:new Date(m.timestamp).toLocaleString(),children:[(0,r.jsx)("span",{className:"text-foreground",children:sO(m.timestamp)}),(0,r.jsx)("span",{className:"text-foreground-subtle font-mono text-[10px]",children:new Date(m.timestamp).toLocaleTimeString()})]},`${m.deviceId}-${m.timestamp}`))})]})}function lO({items:e,header:i,triggerClassName:a,title:o="More actions"}){const[l,d]=(0,n.useState)(!1),m=e.filter(h=>!h.hidden);return m.length===0?null:(0,r.jsxs)(Nu,{open:l,onOpenChange:d,children:[(0,r.jsx)(Ou,{title:o,className:K("inline-flex items-center justify-center rounded-lg p-2","text-foreground-subtle hover:text-foreground hover:bg-surface-hover","border border-transparent transition-colors",a),children:(0,r.jsx)(Ll,{className:"h-4 w-4"})}),(0,r.jsxs)(Cu,{className:"left-auto right-0 mt-1 min-w-[200px] p-1",children:[i&&(0,r.jsx)("div",{className:"px-2 py-1 text-[10px] uppercase tracking-wider text-foreground-subtle",children:i}),(0,r.jsx)("ul",{className:"space-y-0.5",children:m.map((h,p)=>(0,r.jsxs)("li",{children:[h.separatorBefore&&p>0&&(0,r.jsx)("div",{className:"my-1 h-px bg-border"}),(0,r.jsxs)("button",{type:"button",disabled:h.disabled,onClick:()=>{h.disabled||(h.onClick(),d(!1))},className:K("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-[12px]","transition-colors disabled:opacity-40 disabled:cursor-not-allowed",h.danger?"text-foreground hover:bg-danger/10 hover:text-danger":"text-foreground hover:bg-surface-hover"),children:[h.icon&&(0,r.jsx)(h.icon,{className:K("h-3.5 w-3.5 shrink-0 mt-0.5",h.danger&&"text-danger/80")}),(0,r.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"block leading-tight",children:h.label}),h.description&&(0,r.jsx)("span",{className:"block mt-0.5 text-[10px] text-foreground-subtle leading-tight",children:h.description})]})]})]},h.id))})]})]})}var uO=[{value:"view",label:"View",icon:hn,hint:"Read-only — queries + subscriptions"},{value:"create",label:"Create",icon:cv,hint:"Mutations that create or update"},{value:"delete",label:"Delete",icon:fr,hint:"Destructive ops (delete/revoke/reset/…)"}],dO=["device","system"];function fO(){return{type:"capability",target:"",access:["view"]}}function mO(e){if(e==null)return[];const i=new Set;for(const a of e)if(a.type==="device")for(const o of a.targets)i.add(o);return[...i]}function gO(e,i,a,o){let l;switch(e){case"addon":l=a;break;case"capability":l=o;break;case"category":l=dO.map(m=>({value:m,label:m}));break}if(i==null)return l;const d=new Set(i.filter(m=>m.type!=="device"&&m.type===e).map(m=>m.target));return l.filter(m=>d.has(m.value))}function pO(e,i){if(i==null)return["view","create","delete"];const a=i.filter(l=>l.type!==e.type?!1:l.type==="device"&&e.type==="device"?l.targets.some(d=>e.targets.includes(d)):l.type!=="device"&&e.type!=="device"?l.target===e.target:!1);if(a.length===0)return[];const o=new Set;for(const l of a)for(const d of l.access)o.add(d);return[...o]}function vO({value:e,onChange:i,clampToParent:a,emptyHint:o}){const{data:l}=Vd(),{data:d}=Kd({}),m=(0,n.useMemo)(()=>(l??[]).map(E=>({value:E.manifest.id,label:E.manifest.id})).sort((E,A)=>E.label.localeCompare(A.label)),[l]),h=(0,n.useMemo)(()=>[...Q.KNOWN_CAP_NAMES].sort().map(E=>({value:E,label:E})),[]),p=(0,n.useMemo)(()=>(d??[]).map(E=>({value:String(E.id),label:`${E.name} (#${E.id} · ${E.addonId})`})).sort((E,A)=>E.label.localeCompare(A.label)),[d]),v=(0,n.useMemo)(()=>a==null?null:mO(a),[a]),y=(E,A)=>{const R=[...A];switch(E){case"category":return{type:"category",target:"device",access:R};case"capability":return{type:"capability",target:"",access:R};case"addon":return{type:"addon",target:"",access:R};case"device":return{type:"device",targets:[],access:R}}},w=(E,A)=>{i(e.map((R,Z)=>{if(Z!==E)return R;if(A.type!==void 0&&A.type!==R.type)return y(A.type,A.access??R.access);const G=[...A.access??R.access];return R.type==="device"?{type:"device",targets:[...A.targets??R.targets],access:G}:R.type==="category"?{type:"category",target:A.target??R.target,access:G}:R.type==="capability"?{type:"capability",target:A.target??R.target,access:G}:{type:"addon",target:A.target??R.target,access:G}}))},N=E=>{i(e.filter((A,R)=>R!==E))},O=()=>{i([...e,fO()])};return(0,r.jsxs)("div",{className:"space-y-2",children:[e.length===0&&o&&(0,r.jsx)("div",{className:"text-[10px] text-foreground-subtle italic px-2 py-2",children:o}),e.map((E,A)=>{const R=pO(E,a);return(0,r.jsxs)("div",{className:"flex flex-wrap items-start gap-1.5 rounded border border-border bg-surface px-2 py-1.5",children:[(0,r.jsxs)("select",{value:E.type,onChange:Z=>w(A,{type:Z.target.value}),className:"rounded border border-border bg-background px-2 py-1 text-[11px] focus:outline-none focus:ring-1 focus:ring-primary",children:[(0,r.jsx)("option",{value:"category",children:"category"}),(0,r.jsx)("option",{value:"capability",children:"capability"}),(0,r.jsx)("option",{value:"addon",children:"addon"}),(0,r.jsx)("option",{value:"device",children:"device"})]}),E.type==="device"?(0,r.jsx)(hO,{value:E.targets,choices:p,clampToParent:v,onChange:Z=>w(A,{targets:Z})}):(0,r.jsxs)("select",{value:E.target,onChange:Z=>w(A,{target:Z.target.value}),className:"flex-1 min-w-[160px] rounded border border-border bg-background px-2 py-1 text-[11px] font-mono focus:outline-none focus:ring-1 focus:ring-primary",children:[(0,r.jsxs)("option",{value:"",children:["— pick ",E.type," —"]}),gO(E.type,a,m,h).map(Z=>(0,r.jsx)("option",{value:Z.value,children:Z.label},Z.value))]}),(0,r.jsx)("div",{className:"flex items-center gap-1",children:uO.map(({value:Z,label:G,icon:V,hint:re})=>{const te=E.access.includes(Z),ce=a!=null&&!R.includes(Z)&&!te;return(0,r.jsxs)("label",{title:ce?`${re} — not granted by your scope`:re,className:`inline-flex items-center gap-1 rounded px-1.5 py-1 text-[10px] cursor-pointer transition-colors ${te?"bg-primary/15 text-primary font-medium":"text-foreground-subtle hover:bg-foreground-subtle/10"} ${ce?"opacity-40 cursor-not-allowed":""}`,children:[(0,r.jsx)("input",{type:"checkbox",checked:te,disabled:ce,onChange:ye=>{const ue=new Set(E.access);ye.target.checked?ue.add(Z):ue.delete(Z),w(A,{access:[...ue]})},className:"sr-only"}),(0,r.jsx)(V,{className:"h-3 w-3"}),G]},Z)})}),(0,r.jsx)("button",{type:"button",onClick:()=>N(A),className:"rounded p-1 text-foreground-subtle hover:bg-danger/10 hover:text-danger transition-colors",title:"Remove scope",children:(0,r.jsx)(Mt,{className:"h-3 w-3"})})]},A)}),(0,r.jsxs)("button",{type:"button",onClick:O,className:"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] text-foreground-subtle hover:text-foreground hover:bg-foreground-subtle/10 transition-colors",children:[(0,r.jsx)(Zi,{className:"h-3 w-3"}),"Add scope"]})]})}function hO({value:e,choices:i,clampToParent:a,onChange:o}){const[l,d]=(0,n.useState)(""),m=(0,n.useMemo)(()=>{const y=a==null?i:i.filter(N=>a.includes(N.value)),w=new Set(e);return y.filter(N=>!w.has(N.value))},[i,a,e]),h=y=>i.find(w=>w.value===y)?.label??`#${y}`,p=y=>{y&&(o([...e,y]),d(""))},v=y=>{o(e.filter(w=>w!==y))};return(0,r.jsxs)("div",{className:"flex-1 min-w-[160px] flex flex-wrap items-center gap-1",children:[e.length===0&&(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle italic px-1",children:"no devices selected"}),e.map(y=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-mono text-primary",children:[h(y),(0,r.jsx)("button",{type:"button",onClick:()=>v(y),className:"hover:text-danger transition-colors",title:"Remove device",children:(0,r.jsx)(Mt,{className:"h-2.5 w-2.5"})})]},y)),m.length>0&&(0,r.jsxs)("select",{value:l,onChange:y=>p(y.target.value),className:"rounded border border-border bg-background px-1.5 py-0.5 text-[10px] focus:outline-none focus:ring-1 focus:ring-primary",children:[(0,r.jsx)("option",{value:"",children:"+ add device…"}),m.map(y=>(0,r.jsx)("option",{value:y.value,children:y.label},y.value))]})]})}function bO(e){for(const i of e){if(i.type==="device"){if(i.targets.length===0)return"Scope device: pick at least one device"}else if(i.target.trim().length===0)return`Scope ${i.type}: pick a target`;if(i.access.length===0){const a=i.type==="device"?`[${i.targets.join(",")}]`:i.target;return`Scope ${i.type}:${a}: pick at least one access`}}return null}var Ff=_r("camstack:zone-editing",null);function yO({children:e}){const[i,a]=(0,n.useState)(!1),[o,l]=(0,n.useState)(null),[d,m]=(0,n.useState)(null),[h,p]=(0,n.useState)(null),v=(0,n.useCallback)(G=>{a(G),G||(l(null),m(null),p(null))},[]),y=(0,n.useCallback)(G=>{l(G)},[]),w=(0,n.useCallback)(G=>{m(G)},[]),N=(0,n.useCallback)(G=>{a(!0),m(null),l(G),p(null)},[]),O=(0,n.useCallback)(()=>{a(!1),l(null),m(null),p(null)},[]),E=(0,n.useCallback)(G=>{m(G.id),p(G)},[]),A=(0,n.useCallback)(G=>{p(V=>V===null?V:{...V,...G})},[]),R=(0,n.useCallback)(()=>{p(null)},[]),Z=(0,n.useMemo)(()=>({editing:i,drawingKind:o,selectedZoneId:d,editingDraft:h,setEditing:v,setDrawingKind:y,setSelectedZoneId:w,startDrawing:N,exitEditing:O,enterDraft:E,updateDraft:A,discardDraft:R}),[i,o,d,h,v,y,w,N,O,E,A,R]);return(0,r.jsx)(Ff.Provider,{value:Z,children:e})}function _O(){return(0,n.useContext)(Ff)}var Gf=500,xO=800;function Ba(e,i,a){try{const o=e.live;if(!o)return null;const l=o.onEvent;return!l||typeof l.subscribe!="function"?null:l.subscribe({category:i},{onData:a})}catch{return null}}function Fa(e,i){return e?.id===i}function wO(e,i){const[a,o]=(0,n.useState)(null),[l,d]=(0,n.useState)(null),[m,h]=(0,n.useState)(null),[p,v]=(0,n.useState)("watching"),y=(0,n.useRef)(void 0),w=(0,n.useRef)(void 0),N=(0,n.useRef)(void 0);return(0,n.useEffect)(()=>{if(i===null)return;const O=Ba(e,"detection.motion-analysis",E=>{const A=E;if(!Fa(A?.source,i))return;const R=A.data;!R?.regions||R.regions.length===0||(o({zones:R.regions.map(Z=>({...Z.bbox,intensity:Z.intensity})),frameWidth:R.frameWidth,frameHeight:R.frameHeight}),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>o(null),Gf))});return()=>{O?.unsubscribe(),y.current&&clearTimeout(y.current)}},[e,i]),(0,n.useEffect)(()=>{if(i===null)return;const O=Ba(e,"detection.motion-zones-raw",E=>{const A=E;if(!Fa(A?.source,i))return;const R=A.data;R?.zones&&(d({boxes:R.zones.map(Z=>({bbox:Z.bbox,changeScore:Z.changeScore})),frameWidth:R.frameSize?.width??0,frameHeight:R.frameSize?.height??0,motionScore:R.zones.length>0?R.zones.reduce((Z,G)=>Z+G.changeScore,0)/R.zones.length:0}),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>d(null),Gf))});return()=>{O?.unsubscribe(),w.current&&clearTimeout(w.current)}},[e,i]),(0,n.useEffect)(()=>{if(i===null)return;const O=Ba(e,"detection.result",E=>{const A=E;if(!Fa(A?.source,i))return;const R=A.data?.frame;R?.detections?.length&&(h({detections:R.detections,frameWidth:R.width,frameHeight:R.height}),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>h(null),xO))});return()=>{O?.unsubscribe(),N.current&&clearTimeout(N.current)}},[e,i]),(0,n.useEffect)(()=>{if(i===null)return;const O=Ba(e,"detection.phase-transition",E=>{const A=E;Fa(A?.source,i)&&A.data?.to&&v(A.data.to)});return()=>{O?.unsubscribe()}},[e,i]),{motion:a,motionRaw:l,detection:m,phase:p}}function SO(e,i,a=5e3){const[o,l]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(i===null)return;let v=!1;const y=()=>{e.webrtcSession.listStreams.query({deviceId:i}).then(N=>{v||l(N)}).catch(()=>{})};y();const w=setInterval(y,a);return()=>{v=!0,clearInterval(w)}},[e,i,a]);const[d,m]=(0,n.useState)(null);(0,n.useEffect)(()=>{if(i===null)return;let v=!1;return e.pipelineOrchestrator&&e.pipelineOrchestrator.getCameraMetrics.query({deviceId:i}).then(y=>{v||!y||m({phase:y.phase,detectionFps:y.actualFps,avgInferenceMs:y.avgInferenceTimeMs,droppedFrames:y.droppedFrames})}).catch(()=>{}),()=>{v=!0}},[e,i]),Fi("pipeline.camera-metrics-snapshot",v=>{if(i===null)return;const y=v.data;y.deviceId!==i||!y.metrics||m({phase:y.metrics.phase,detectionFps:y.metrics.actualFps,avgInferenceMs:y.metrics.avgInferenceTimeMs,droppedFrames:y.metrics.droppedFrames})});const{streams:h,hasWebrtc:p}=(0,n.useMemo)(()=>i===null||o.length===0?{streams:[],hasWebrtc:!1}:{streams:o.map(v=>({id:v.id,label:v.label,target:v.target,status:v.status,inputFps:v.inputFps,decodeFps:v.decodeFps,bitrateKbps:v.bitrateKbps})),hasWebrtc:!0},[i,o]);return{streams:h,hasWebrtc:p,pipelineMetrics:d,createSession:(0,n.useCallback)(async(v,y)=>{if(i===null)throw new Error("No device selected");const w=await e.webrtcSession.createSession.mutate({deviceId:i,target:v,hints:y});return{sessionId:w.sessionId,sdpOffer:w.sdpOffer}},[e,i]),sendAnswer:(0,n.useCallback)(async(v,y)=>{if(i===null)throw new Error("No device selected");await e.webrtcSession.handleAnswer.mutate({deviceId:i,sessionId:v,sdpAnswer:y})},[e,i]),closeSession:(0,n.useCallback)(async v=>{i!==null&&await e.webrtcSession.closeSession.mutate({deviceId:i,sessionId:v}).catch(()=>{})},[e,i])}}var Vf={up:{pan:0,tilt:1},down:{pan:0,tilt:-1},left:{pan:-1,tilt:0},right:{pan:1,tilt:0},"up-left":{pan:-1,tilt:1},"up-right":{pan:1,tilt:1},"down-left":{pan:-1,tilt:-1},"down-right":{pan:1,tilt:-1}};function jO(e,i,a){const o=a?.defaultSpeed??.5,l=a?.pulseMs??250,d=a?.enabled??!0,m=Gi(e,d?i:null)?.ptz,[h,p]=(0,n.useState)([]),[v,y]=(0,n.useState)(!1),[w,N]=(0,n.useState)(null),O=(0,n.useCallback)(async()=>{if(!(!d||!m))try{p(await m.getPresets({}))}catch(A){const R=A instanceof Error?A.message:String(A);if(R.includes("provider not available")||R.includes("no 'ptz' binding"))return;N(R)}},[m,d]);(0,n.useEffect)(()=>{O()},[O]);const E=(0,n.useCallback)(async A=>{if(!(!d||!m)){N(null),y(!0);try{return await A()}catch(R){N(R instanceof Error?R.message:String(R));return}finally{y(!1)}}},[d,m]);return{move:(0,n.useCallback)(async(A,R)=>{if(!m)return;const Z=Vf[A],G=R??o;await E(async()=>{await m.move({pan:Z.pan,tilt:Z.tilt,speed:G}),await new Promise(V=>setTimeout(V,l)),await m.stop({})})},[m,o,l,E]),startContinuous:(0,n.useCallback)(async(A,R)=>{if(!m)return;const Z=Vf[A],G=R??o;await E(()=>m.continuousMove({pan:Z.pan,tilt:Z.tilt,speed:G}))},[m,o,E]),stopContinuous:(0,n.useCallback)(async()=>{m&&await E(()=>m.stop({}))},[m,E]),zoom:(0,n.useCallback)(async(A,R)=>{if(!m)return;const Z=A==="in"?1:-1,G=R??o;await E(async()=>{await m.move({zoom:Z,speed:G}),await new Promise(V=>setTimeout(V,l)),await m.stop({})})},[m,o,l,E]),goHome:(0,n.useCallback)(async()=>{m&&await E(()=>m.goHome({}))},[m,E]),goToPreset:(0,n.useCallback)(async A=>{m&&await E(()=>m.goToPreset({presetId:A}))},[m,E]),presets:h,refreshPresets:O,busy:v,error:w}}function $O(e){const i=e?.deviceId??null,a=e?.historyLimit??20,o=tc("doorbell.onPressed",i!==null?m=>m.deviceId===i:void 0),[l,d]=(0,n.useState)([]);return(0,n.useEffect)(()=>{o&&d(m=>{if(m.length>0&&m[0].deviceId===o.deviceId&&m[0].timestamp===o.timestamp)return m;const h=[o,...m];return h.length>a?h.slice(0,a):h})},[o,a]),{latest:o??null,history:l}}function kO(e){const i=qr(),a=(0,n.useMemo)(()=>e?JSON.stringify(e):"",[e]),[o,l]=(0,n.useState)(()=>i.listDevices(e));return(0,n.useEffect)(()=>{const d=()=>{l(i.listDevices(e))};d();let m=null,h=null;try{m=i.onDeviceAdded(d),h=i.onDeviceRemoved(d)}catch{}const p=i.subscribeConnectionEvents(v=>{v==="connected"&&d()});return()=>{m?.(),h?.(),p()}},[i,e,a]),o}function PO(e){const i=qr(),[a,o]=(0,n.useState)(()=>e===null?null:i.getDevice(e));return(0,n.useEffect)(()=>{if(e===null){o(null);return}const l=()=>{o(i.getDevice(e))};l();let d=null,m=null;try{d=i.onDeviceAdded(l),m=i.onDeviceRemoved(l)}catch{}const h=i.subscribeConnectionEvents(p=>{p==="connected"&&l()});return()=>{d?.(),m?.(),h()}},[i,e]),a}function NO(e,i,a){const o=qr();return(0,ee.useQuery)({queryKey:e,queryFn:()=>i(o)(),...a})}function OO(e,i){const a=qr();return(0,ee.useMutation)({mutationFn:o=>e(a)(o),...i})}function CO(e,i){const a=qr(),o=(0,ee.useQueryClient)(),[l,d]=(0,n.useState)(a.connectionVersion);(0,n.useEffect)(()=>a.subscribeConnectionEvents((p,v)=>{p==="connected"&&d(v)}),[a]);const m=i.join("|"),h=JSON.stringify(e);(0,n.useEffect)(()=>{const p=[],v=()=>{const y=JSON.parse(h),w=y.length===1&&Array.isArray(y[0])?y:[y];o.invalidateQueries({queryKey:w})};v();for(const y of m.split("|"))if(y)try{p.push(a.subscribeEvent(y,v))}catch{}return()=>{for(const y of p)y()}},[a,o,m,h,l])}t.AddonGlobalSettingsForm=UP,t.AgentStepEditor=lh,t.AppShell=Dh,t.AudioClassificationList=NN,t.AudioLevelWaveform=$N,t.AudioWaveform=jN,t.BTN_COMPACT=Mm,t.BTN_COMPACT_DANGER=Am,t.BTN_COMPACT_PRIMARY=Dm,t.BTN_COMPACT_WARNING=zm,t.Badge=Ar,t.BatteryBadge=cd,t.BottomSheet=Hs,t.Breadcrumb=Xv,t.Button=wr,t.CHIP_ACTIVE=Zm,t.CHIP_BASE=Rm,t.CHIP_INACTIVE=Lm,t.CLASS_COLORS=Vi,t.CameraStreamPlayer=gf,t.Card=Gs,t.Checkbox=lu,t.CodeBlock=Eh,t.CollapsibleCard=ou,t.ConfigFormBuilder=df,t.ConfigFormField=wn,t.ConfigSchemaField=ka,t.ConfirmActionButton=nO,t.ConfirmDialogProvider=Oh,t.CopyButton=Mf,t.CustomFieldRenderersProvider=My,t.DEFAULT_COLOR=Rb,t.DataTable=Au,t.DetectionCanvas=Zb,t.DetectionOverlay=mf,t.DetectionResultTree=Fb,t.DevShell=Ud,t.DeviceActivityPanel=rO,t.DeviceCard=zh,t.DeviceContextProvider=Dy,t.DeviceExportPanel=SN,t.DeviceGrid=Th,t.DeviceItem=Oa,t.DeviceList=Pb,t.Dialog=mu,t.DialogContent=Ws,t.DialogDescription=hu,t.DialogFooter=pu,t.DialogHeader=gu,t.DialogTitle=vu,t.DialogTrigger=Tv,t.DiscoveryPanel=WN,t.DoorbellRecentPanel=cO,t.Dropdown=Zv,t.DropdownContent=Uv,t.DropdownItem=Bv,t.DropdownTrigger=Lv,t.EmptyState=Fu,t.ErrorBox=Gu,t.EventStream=Cc,t.FilterBar=Mh,t.FloatingEventStream=VN,t.FloatingLogStream=AN,t.FloatingPanel=Kv,t.FormField=kh,t.GRID_GAP=Y,t.GRID_PAIRED=on,t.GRID_QUICK_STATS=$t,t.INPUT_COMPACT=Tm,t.IconButton=Fs,t.ImageSelector=qb,t.InferenceConfigSelector=Hb,t.Input=ja,t.KebabMenu=lO,t.KeyValueList=Ih,t.LIST_ROW=mt,t.Label=Vs,t.LogStream=kc,t.LoginForm=Zd,t.MobileDrawer=Mu,t.NodeMultiSelectField=of,t.NodePicker=yh,t.NodeSelectField=af,t.PHASE_CONFIG=gs,t.PTZOverlay=iO,t.PageHeader=Ph,t.PhaseIcon=IN,t.PipelineBuilder=Tb,t.PipelineRuntimeSelector=Db,t.PipelineStep=$a,t.PipelineTreeMatrix=vh,t.PlayerOverlaysProvider=HP,t.Popover=Nu,t.PopoverContent=Cu,t.PopoverTrigger=Ou,t.ProviderBadge=Sh,t.QrCode=Ef,t.ResponseLog=ON,t.SECTION_BODY=T,t.SECTION_CARD=b,t.SECTION_HEADER=D,t.SPLIT_PANEL_OUTER=km,t.SPLIT_PANEL_SIDE=Pm,t.STACK_GAP=B,t.ScopePicker=vO,t.ScrollArea=Js,t.Select=Ui,t.SemanticBadge=Bu,t.Separator=Qs,t.Sidebar=nc,t.SidebarItem=rc,t.Skeleton=su,t.SlideOverPanel=Yv,t.SnapshotButton=oO,t.StatCard=Ch,t.StateValuesStream=Bf,t.StatusBadge=xh,t.StepTimings=Wb,t.StepTreeMaster=th,t.StreamBrokerSelector=cN,t.StreamPanel=aN,t.Switch=uu,t.SystemProvider=Uu,t.TEXT_FIELD_LABEL=Om,t.TEXT_HINT=Cm,t.TEXT_METRIC=Em,t.TEXT_SECTION_LABEL=Nm,t.TEXT_VALUE=Im,t.Tabs=Wv,t.TabsContent=Jv,t.TabsList=qv,t.TabsTrigger=Hv,t.ThemeProvider=u.ThemeProvider$1,t.Tooltip=Fv,t.TooltipContent=Vv,t.TooltipTrigger=Gv,t.VersionBadge=$h,t.WidgetRegistryProvider=tP,t.WidgetSlot=nf,t.ZoneEditingProvider=yO,t.__toESM=s,t.buildStepTreeFromSchema=rh,t.cn=K,t.createSharedContext=_r,t.createTheme=u.createTheme$1,t.darkColors=u.darkColors$1,t.defaultTheme=u.defaultTheme$1,t.deriveDeviceKind=Zh,t.ensureMfHostInit=Ml,t.getClassColor=Qt,t.getPhaseVisual=ps,t.isFieldVisible=uf,t.lightColors=u.lightColors$1,t.mirror=Vm,t.mountAddonPage=Ey,t.providerIcons=Cv,t.statusIcons=Iv,t.themeToCss=u.themeToCss$1,t.trpc=j,t.useAccessoriesGetStatus=zy,t.useAddonPagesListPages=Ty,t.useAddonSettingsGetDeviceSettings=p0,t.useAddonSettingsGetGlobalSettings=m0,t.useAddonSettingsUpdateDeviceSettings=v0,t.useAddonSettingsUpdateGlobalSettings=g0,t.useAddonWidgetsListWidgets=Qd,t.useAddonsApplyAutoUpdateToAll=u0,t.useAddonsCustom=d0,t.useAddonsForceRefresh=Jy,t.useAddonsGetAddonAutoUpdate=c0,t.useAddonsGetAutoUpdateSettings=o0,t.useAddonsGetLastRestart=Xy,t.useAddonsGetLogs=Ry,t.useAddonsGetVersions=n0,t.useAddonsInstallFromWorkspace=Uy,t.useAddonsInstallPackage=Ly,t.useAddonsIsWorkspaceAvailable=By,t.useAddonsList=Vd,t.useAddonsListCapabilityProviders=e0,t.useAddonsListFrameworkPackages=Yy,t.useAddonsListPackages=Zy,t.useAddonsListUpdates=Wy,t.useAddonsListWorkspacePackages=Fy,t.useAddonsOnAddonLogs=f0,t.useAddonsReloadPackages=Vy,t.useAddonsRestartAddon=i0,t.useAddonsRestartServer=Ky,t.useAddonsRetryLoad=a0,t.useAddonsRollbackPackage=Hy,t.useAddonsSearchAvailable=Qy,t.useAddonsSetAddonAutoUpdate=l0,t.useAddonsSetAutoUpdateSettings=s0,t.useAddonsSetCapabilityProviderEnabled=t0,t.useAddonsUninstallPackage=Gy,t.useAddonsUpdateFrameworkPackage=r0,t.useAddonsUpdatePackage=qy,t.useAlertsDismiss=S0,t.useAlertsEmit=h0,t.useAlertsGetUnreadCount=_0,t.useAlertsList=y0,t.useAlertsMarkAllRead=w0,t.useAlertsMarkRead=x0,t.useAlertsUpdate=b0,t.useAllWidgets=rP,t.useAudioAnalysisApplyDeviceSettingsPatch=P0,t.useAudioAnalysisGetDeviceLiveContribution=k0,t.useAudioAnalysisGetDeviceSettingsContribution=$0,t.useAudioAnalysisResolveDeviceSettings=j0,t.useAudioAnalyzerAnalyseChunk=N0,t.useAudioAnalyzerClassify=O0,t.useAudioAnalyzerDispose=I0,t.useAudioAnalyzerIsReady=C0,t.useAudioAnalyzerReprobeAudioEngine=E0,t.useAudioCodecCanHandle=D0,t.useAudioCodecCloseSession=T0,t.useAudioCodecCreateDecodeSession=A0,t.useAudioCodecCreateEncodeSession=z0,t.useAudioCodecFlushEncode=B0,t.useAudioCodecListActiveSessions=F0,t.useAudioCodecListSupportedCodecs=M0,t.useAudioCodecPullEncoded=U0,t.useAudioCodecPullPcm=Z0,t.useAudioCodecPushEncodedFrame=R0,t.useAudioCodecPushPcm=L0,t.useAudioMetricsGetCurrentSnapshot=G0,t.useAudioMetricsGetHistory=V0,t.useBackupDelete=X0,t.useBackupGetEntries=J0,t.useBackupList=q0,t.useBackupListArchives=Y0,t.useBackupListDestinations=Q0,t.useBackupListLocations=H0,t.useBackupPreviewSchedule=t_,t.useBackupRestore=K0,t.useBackupTrigger=W0,t.useBackupUpsertDestinationPolicy=e_,t.useBatteryGetStatus=r_,t.useBrightnessGetStatus=i_,t.useBrightnessSetBrightness=n_,t.useCameraCredentialsGetCredentials=a_,t.useCameraCredentialsGetStatus=o_,t.useCameraStreamsGetBrokerStreams=c_,t.useCameraStreamsGetCameraStreams=s_,t.useCameraStreamsGetRtspEntries=Wd,t.useClusterNodes=Pa,t.useConfirm=Na,t.useCustomFieldRenderer=Fd,t.useDebouncedString=fd,t.useDecoderCreateSession=d_,t.useDecoderDestroySession=f_,t.useDecoderGetInfo=u_,t.useDecoderGetStats=h_,t.useDecoderListActiveSessions=b_,t.useDecoderOpenStream=g_,t.useDecoderPullFrames=p_,t.useDecoderPushPacket=m_,t.useDecoderReprobeHwaccel=y_,t.useDecoderSupportsCodec=l_,t.useDecoderUpdateConfig=v_,t.useDetectionPipelineApplyDeviceSettingsPatch=w_,t.useDetectionPipelineGetDeviceLiveContribution=x_,t.useDetectionPipelineGetDeviceSettingsContribution=__,t.useDevShell=Py,t.useDevice=PO,t.useDeviceBattery=od,t.useDeviceCapability=yn,t.useDeviceDetections=wO,t.useDeviceDiscoveryAdoptDevice=$_,t.useDeviceDiscoveryGetStatus=P_,t.useDeviceDiscoveryListDiscovered=S_,t.useDeviceDiscoveryRefreshDiscovery=j_,t.useDeviceDiscoveryReleaseDevice=k_,t.useDeviceExportApplyDeviceSettingsPatch=E_,t.useDeviceExportExposeDevice=O_,t.useDeviceExportGetDeviceLiveContribution=I_,t.useDeviceExportGetDeviceSettingsContribution=C_,t.useDeviceExportGetStatus=qd,t.useDeviceExportListExposedDevices=Hd,t.useDeviceExportListSupportedDeviceKinds=N_,t.useDeviceExportUnexposeDevice=Jd,t.useDeviceId=Gd,t.useDeviceManagerAddLocation=G_,t.useDeviceManagerAdoptDevice=hx,t.useDeviceManagerAllocateDeviceId=M_,t.useDeviceManagerCreateDevice=yx,t.useDeviceManagerDisable=tx,t.useDeviceManagerDiscoverDevices=vx,t.useDeviceManagerEnable=ex,t.useDeviceManagerGetAllBindings=sx,t.useDeviceManagerGetBindings=ox,t.useDeviceManagerGetChildren=H_,t.useDeviceManagerGetConfigSchema=K_,t.useDeviceManagerGetCreationSchema=bx,t.useDeviceManagerGetDevice=q_,t.useDeviceManagerGetDeviceAggregate=mx,t.useDeviceManagerGetDeviceLiveInfoAggregate=fx,t.useDeviceManagerGetDeviceSettingsAggregate=dx,t.useDeviceManagerGetDeviceStatusAggregate=wx,t.useDeviceManagerGetSettingsSchema=X_,t.useDeviceManagerGetStreamProfileMap=nx,t.useDeviceManagerGetStreamSources=J_,t.useDeviceManagerListAll=Kd,t.useDeviceManagerListBindableCapsForDeviceType=ux,t.useDeviceManagerListLocations=F_,t.useDeviceManagerListPersistedByAddon=W_,t.useDeviceManagerListWrappersForCap=lx,t.useDeviceManagerLoadConfig=T_,t.useDeviceManagerLoadMeta=Z_,t.useDeviceManagerLoadRuntimeState=R_,t.useDeviceManagerPersistConfig=z_,t.useDeviceManagerProbeStreams=ax,t.useDeviceManagerRegisterDevice=D_,t.useDeviceManagerRemove=rx,t.useDeviceManagerRemoveDevice=A_,t.useDeviceManagerRemoveLocation=V_,t.useDeviceManagerSetDisabled=Q_,t.useDeviceManagerSetLocation=U_,t.useDeviceManagerSetMetadata=B_,t.useDeviceManagerSetName=L_,t.useDeviceManagerSetStreamProfileMap=ix,t.useDeviceManagerSetWrapperActive=cx,t.useDeviceManagerTestCreationField=_x,t.useDeviceManagerTestField=xx,t.useDeviceManagerUpdateConfig=Y_,t.useDeviceManagerUpdateDeviceField=gx,t.useDeviceManagerUpdateDeviceFieldsBatch=px,t.useDeviceOpsGetConfigEntries=jx,t.useDeviceOpsGetSettingsSchema=Px,t.useDeviceOpsGetStreamSources=Sx,t.useDeviceOpsRemoveDevice=kx,t.useDeviceOpsSetConfig=$x,t.useDeviceProviderAdoptDiscoveredDevice=Dx,t.useDeviceProviderCreateDevice=Tx,t.useDeviceProviderDiscoverDevices=Mx,t.useDeviceProviderGetChildCreationSchema=zx,t.useDeviceProviderGetDevices=Ix,t.useDeviceProviderGetStatus=Cx,t.useDeviceProviderStart=Nx,t.useDeviceProviderStop=Ox,t.useDeviceProviderSupportsDiscovery=Ex,t.useDeviceProviderSupportsManualCreation=Ax,t.useDeviceProviderTestCreationField=Rx,t.useDeviceProxy=Gi,t.useDeviceSnapshot=Ay,t.useDeviceSnapshotImage=sd,t.useDeviceState=Qu,t.useDeviceStateGetAllSnapshots=Ux,t.useDeviceStateGetCapSlice=Lx,t.useDeviceStateGetSnapshot=Zx,t.useDeviceStateSetCapSlice=Bx,t.useDeviceStateSlice=ic,t.useDeviceStatusGetStatus=Fx,t.useDeviceWebrtc=SO,t.useDevices=kO,t.useDoorbellEvents=$O,t.useDoorbellGetStatus=Gx,t.useEventInvalidation=CO,t.useEventStreamLatest=tc,t.useEventStreamMap=bh,t.useEventsGetEventClipUrl=Wx,t.useEventsGetEventThumbnail=Qx,t.useEventsGetEvents=Vx,t.useFeatureProbeGetStatus=qx,t.useIntegrationsCreate=Xx,t.useIntegrationsDelete=e1,t.useIntegrationsGet=Jx,t.useIntegrationsGetAvailableTypes=n1,t.useIntegrationsGetByAddonId=Kx,t.useIntegrationsGetSettings=t1,t.useIntegrationsList=Hx,t.useIntegrationsSetSettings=r1,t.useIntegrationsTestConnection=i1,t.useIntegrationsUpdate=Yx,t.useIntercomEndTalkSession=u1,t.useIntercomGetStatus=d1,t.useIntercomHandleAnswer=o1,t.useIntercomPushTalkPcm=l1,t.useIntercomStartSession=a1,t.useIntercomStartTalkSession=c1,t.useIntercomStopSession=s1,t.useIsMidWidth=Qv,t.useIsMobile=Bi,t.useLiveBuffer=Kr,t.useLiveEvent=Fi,t.useLocalNetworkGetAllowedAddresses=p1,t.useLocalNetworkGetConnectionEndpoints=g1,t.useLocalNetworkGetPreferred=m1,t.useLocalNetworkList=f1,t.useLocalNetworkResetAllowlistToBestMatch=h1,t.useLocalNetworkSetAllowedAddresses=v1,t.useMeshNetworkGetStatus=b1,t.useMeshNetworkJoin=y1,t.useMeshNetworkLeave=x1,t.useMeshNetworkListPeers=S1,t.useMeshNetworkLogout=w1,t.useMeshNetworkStartLogin=_1,t.useMeshNetworkTestConnection=j1,t.useMetricsProviderCollectSnapshot=$1,t.useMetricsProviderGetAddonStats=M1,t.useMetricsProviderGetCached=k1,t.useMetricsProviderGetCpuTemperature=C1,t.useMetricsProviderGetCurrent=P1,t.useMetricsProviderGetDiskSpace=N1,t.useMetricsProviderGetGpuInfo=O1,t.useMetricsProviderGetProcessStats=I1,t.useMetricsProviderKillProcess=A1,t.useMetricsProviderListAddonInstances=E1,t.useMetricsProviderListNodeProcesses=D1,t.useMotionDetectionAnalyze=R1,t.useMotionDetectionApplyDeviceSettingsPatch=F1,t.useMotionDetectionGetDeviceLiveContribution=B1,t.useMotionDetectionGetDeviceSettingsContribution=U1,t.useMotionDetectionRemoveCamera=Z1,t.useMotionDetectionReset=L1,t.useMotionGetStatus=T1,t.useMotionIsDetected=z1,t.useMotionTriggerGetStatus=V1,t.useMotionTriggerSetMotionTrigger=G1,t.useMqttBrokerAddBroker=q1,t.useMqttBrokerGetBrokerConfig=W1,t.useMqttBrokerGetStatus=Y1,t.useMqttBrokerListBrokers=Q1,t.useMqttBrokerRemoveBroker=H1,t.useMqttBrokerStartEmbeddedBroker=K1,t.useMqttBrokerStopEmbeddedBroker=X1,t.useMqttBrokerTestConnection=J1,t.useNativeObjectDetectionGetStatus=ew,t.useNetworkAccessGetEndpoint=nw,t.useNetworkAccessGetStatus=iw,t.useNetworkAccessListEndpoints=aw,t.useNetworkAccessStart=tw,t.useNetworkAccessStop=rw,t.useNetworkQualityGetAllStats=sw,t.useNetworkQualityGetDeviceStats=ow,t.useNetworkQualityReportClientStats=cw,t.useNodesClusterAddonStatus=hw,t.useNodesDeployAddon=uw,t.useNodesExecuteQuery=_w,t.useNodesGetNodeAddons=bw,t.useNodesRenameNode=vw,t.useNodesRestartAddon=fw,t.useNodesRestartNode=gw,t.useNodesRestartProcess=mw,t.useNodesSetProcessLogLevel=yw,t.useNodesShutdownNode=pw,t.useNodesTopology=lw,t.useNodesUndeployAddon=dw,t.useNotificationOutputSend=xw,t.useNotificationOutputSendTest=ww,t.useOptionalSystem=hh,t.useOptionalWidgetRegistry=rf,t.useOsdGetStatus=jw,t.useOsdSetOverlay=Sw,t.usePTZ=jO,t.usePipelineAnalyticsApplyDeviceSettingsPatch=zw,t.usePipelineAnalyticsClearTracks=Nw,t.usePipelineAnalyticsGetActiveTracks=$w,t.usePipelineAnalyticsGetAudioEvents=Iw,t.usePipelineAnalyticsGetDeviceLiveContribution=Aw,t.usePipelineAnalyticsGetDeviceSettingsContribution=Dw,t.usePipelineAnalyticsGetEventMedia=Ew,t.usePipelineAnalyticsGetMotionEvents=Ow,t.usePipelineAnalyticsGetObjectEvents=Cw,t.usePipelineAnalyticsGetTrack=kw,t.usePipelineAnalyticsGetTrackMedia=Mw,t.usePipelineAnalyticsListTracks=Pw,t.usePipelineExecutorCacheFrameInPool=iS,t.usePipelineExecutorDeleteModel=eS,t.usePipelineExecutorDeleteTemplate=Jw,t.usePipelineExecutorDetect=tS,t.usePipelineExecutorDownloadModel=Yw,t.usePipelineExecutorGetAddonModels=Xw,t.usePipelineExecutorGetAudioCapabilities=pS,t.usePipelineExecutorGetAvailableEngines=Tw,t.usePipelineExecutorGetCapabilities=Kw,t.usePipelineExecutorGetDefaultSteps=Zw,t.usePipelineExecutorGetDetectionConfigSchema=hS,t.usePipelineExecutorGetEffectiveTuning=sS,t.usePipelineExecutorGetGlobalPipelineConfig=Vw,t.usePipelineExecutorGetGlobalSteps=Gw,t.usePipelineExecutorGetOrchestratorConfigSchema=Qw,t.usePipelineExecutorGetReferenceAudio=gS,t.usePipelineExecutorGetReferenceAudioFiles=mS,t.usePipelineExecutorGetReferenceImage=fS,t.usePipelineExecutorGetSchema=Fw,t.usePipelineExecutorGetSelectedEngine=Rw,t.usePipelineExecutorGetVideoPipelineSteps=Uw,t.usePipelineExecutorInferCached=aS,t.usePipelineExecutorKillEngine=uS,t.usePipelineExecutorListLoadedEngines=cS,t.usePipelineExecutorListReferenceImages=dS,t.usePipelineExecutorListTemplates=Ww,t.usePipelineExecutorReprobeEngine=Lw,t.usePipelineExecutorRunAudioTest=vS,t.usePipelineExecutorRunPipeline=rS,t.usePipelineExecutorRunPipelineBatch=nS,t.usePipelineExecutorSaveTemplate=qw,t.usePipelineExecutorSetVideoPipelineSteps=Bw,t.usePipelineExecutorSpinEngine=lS,t.usePipelineExecutorUncacheFrame=oS,t.usePipelineExecutorUpdateTemplate=Hw,t.usePipelineOrchestratorApplyDeviceSettingsPatch=YS,t.usePipelineOrchestratorAssignAudio=IS,t.usePipelineOrchestratorAssignDecoder=NS,t.usePipelineOrchestratorAssignPipeline=bS,t.usePipelineOrchestratorDeleteTemplate=JS,t.usePipelineOrchestratorGetAgentLoad=SS,t.usePipelineOrchestratorGetAgentSettings=TS,t.usePipelineOrchestratorGetAudioAssignment=MS,t.usePipelineOrchestratorGetAudioAssignments=AS,t.usePipelineOrchestratorGetAudioNodeLoad=DS,t.usePipelineOrchestratorGetCameraMetrics=$S,t.usePipelineOrchestratorGetCameraSettings=US,t.usePipelineOrchestratorGetCameraStepOverrides=FS,t.usePipelineOrchestratorGetCapabilityBindings=kS,t.usePipelineOrchestratorGetDecoderAssignment=zS,t.usePipelineOrchestratorGetDecoderAssignments=CS,t.usePipelineOrchestratorGetDeviceLiveContribution=XS,t.usePipelineOrchestratorGetDeviceSettingsContribution=KS,t.usePipelineOrchestratorGetGlobalMetrics=jS,t.usePipelineOrchestratorGetPipelineAssignment=wS,t.usePipelineOrchestratorGetPipelineAssignments=xS,t.usePipelineOrchestratorListAgentSettings=RS,t.usePipelineOrchestratorListTemplates=WS,t.usePipelineOrchestratorRebalance=_S,t.usePipelineOrchestratorRemoveAgentSettings=LS,t.usePipelineOrchestratorResolvePipeline=QS,t.usePipelineOrchestratorSaveTemplate=qS,t.usePipelineOrchestratorSetAgentAddonDefaults=ZS,t.usePipelineOrchestratorSetCameraPipelineForAgent=VS,t.usePipelineOrchestratorSetCameraStepOverride=GS,t.usePipelineOrchestratorSetCameraStepToggle=BS,t.usePipelineOrchestratorSetCapabilityBinding=PS,t.usePipelineOrchestratorUnassignAudio=ES,t.usePipelineOrchestratorUnassignDecoder=OS,t.usePipelineOrchestratorUnassignPipeline=yS,t.usePipelineOrchestratorUpdateTemplate=HS,t.usePipelineRunnerAttachCamera=ej,t.usePipelineRunnerDetachCamera=tj,t.usePipelineRunnerGetAllCameraMetrics=oj,t.usePipelineRunnerGetCameraMetrics=aj,t.usePipelineRunnerGetLocalCameras=sj,t.usePipelineRunnerGetLocalLoad=nj,t.usePipelineRunnerGetLocalMetrics=ij,t.usePipelineRunnerReportMotion=rj,t.usePlatformProbeGetCapabilities=cj,t.usePlatformProbeGetHardware=lj,t.usePlatformProbeGetHardwareEncoders=fj,t.usePlatformProbeRefreshHardwareEncoders=mj,t.usePlatformProbeResolveHwAccel=dj,t.usePlatformProbeResolveInferenceConfig=uj,t.usePlayerOverlayLayer=KP,t.usePlayerOverlayLayers=JP,t.usePlayerToolbarButton=XP,t.usePlayerToolbarButtons=vf,t.usePtzAutotrackGetSettings=jj,t.usePtzAutotrackGetStatus=wj,t.usePtzAutotrackSetEnabled=Sj,t.usePtzAutotrackSetSettings=$j,t.usePtzContinuousMove=pj,t.usePtzGetPosition=_j,t.usePtzGetPresets=hj,t.usePtzGetStatus=xj,t.usePtzGoHome=yj,t.usePtzGoToPreset=bj,t.usePtzMove=gj,t.usePtzStop=vj,t.useRebootReboot=kj,t.useRecordingEngineDisable=Ej,t.useRecordingEngineEnable=Ij,t.useRecordingEngineEstimateGlobalStorage=Lj,t.useRecordingEngineEstimateStorage=Zj,t.useRecordingEngineGetAvailability=Rj,t.useRecordingEngineGetConfig=Mj,t.useRecordingEngineGetMotionStats=Wj,t.useRecordingEngineGetPlaylist=Aj,t.useRecordingEngineGetPolicy=Fj,t.useRecordingEngineGetPolicyStatus=Gj,t.useRecordingEngineGetRetentionConfig=Vj,t.useRecordingEngineGetSegments=Tj,t.useRecordingEngineGetStatus=Cj,t.useRecordingEngineGetStorageUsage=Uj,t.useRecordingEngineGetThumbnail=zj,t.useRecordingEngineSetPolicy=Bj,t.useRecordingEngineUpdateConfig=Dj,t.useRecordingEngineUpdateRetentionConfig=Qj,t.useRecordingGetPlaybackUrl=Nj,t.useRecordingGetSegments=Pj,t.useRecordingGetThumbnailAt=Oj,t.useSettingsStoreCount=e$,t.useSettingsStoreDeclareCollection=r$,t.useSettingsStoreDelete=Yj,t.useSettingsStoreGet=qj,t.useSettingsStoreInsert=Kj,t.useSettingsStoreIsEmpty=t$,t.useSettingsStoreQuery=Jj,t.useSettingsStoreSet=Hj,t.useSettingsStoreUpdate=Xj,t.useSnapshotApplyDeviceSettingsPatch=c$,t.useSnapshotGetDeviceLiveContribution=s$,t.useSnapshotGetDeviceSettingsContribution=o$,t.useSnapshotGetSnapshot=n$,t.useSnapshotGetStatus=a$,t.useSnapshotInvalidateCache=i$,t.useSnapshotProviderGetSnapshot=u$,t.useSnapshotProviderSupportsDevice=l$,t.useStorageAbortUpload=x$,t.useStorageBeginDownload=w$,t.useStorageBeginUpload=b$,t.useStorageDelete=v$,t.useStorageDeleteLocation=N$,t.useStorageEndDownload=j$,t.useStorageExists=g$,t.useStorageFinalizeUpload=_$,t.useStorageGetAvailableSpace=h$,t.useStorageGetDefaultLocation=k$,t.useStorageList=p$,t.useStorageListLocations=$$,t.useStorageListProviders=C$,t.useStorageRead=m$,t.useStorageReadChunk=S$,t.useStorageResolve=d$,t.useStorageTestConfig=I$,t.useStorageTestLocation=O$,t.useStorageUpsertLocation=P$,t.useStorageWrite=f$,t.useStorageWriteChunk=y$,t.useStreamBrokerApplyDeviceSettingsPatch=rk,t.useStreamBrokerAssignProfile=D$,t.useStreamBrokerGetAllRtspEntries=H$,t.useStreamBrokerGetBroker=V$,t.useStreamBrokerGetBrokerStats=R$,t.useStreamBrokerGetDeviceLiveContribution=tk,t.useStreamBrokerGetDeviceSettingsContribution=ek,t.useStreamBrokerGetPreBufferInfo=W$,t.useStreamBrokerGetRtspEntry=J$,t.useStreamBrokerGetRtspPort=q$,t.useStreamBrokerGetStreamUrl=B$,t.useStreamBrokerGetStreamWithCodec=F$,t.useStreamBrokerIsRtspEnabled=Y$,t.useStreamBrokerKillClient=L$,t.useStreamBrokerListAllCameraStreams=z$,t.useStreamBrokerListAllProfileSlots=T$,t.useStreamBrokerListClients=Z$,t.useStreamBrokerPublishCameraStream=E$,t.useStreamBrokerRegenerateRtspToken=K$,t.useStreamBrokerReleaseStreamWithCodec=G$,t.useStreamBrokerRestartProfile=U$,t.useStreamBrokerRetractCameraStream=M$,t.useStreamBrokerSetPreBufferDuration=Q$,t.useStreamBrokerSetRtspEnabled=X$,t.useStreamBrokerUnassignProfile=A$,t.useSwitchGetStatus=ik,t.useSwitchSetState=nk,t.useSystem=qr,t.useSystemFeatureFlags=sk,t.useSystemForceRetentionCleanup=dk,t.useSystemGetRetentionConfig=lk,t.useSystemHealth=ok,t.useSystemInfo=ak,t.useSystemMutation=OO,t.useSystemNetworkAddresses=ck,t.useSystemQuery=NO,t.useSystemSetRetentionConfig=uk,t.useThemeMode=u.useThemeMode$1,t.useToastOnToast=fk,t.useTurnProviderGetTurnServers=mk,t.useUserManagementConfirmTotp=Ck,t.useUserManagementCreateApiKey=wk,t.useUserManagementCreateScopedToken=$k,t.useUserManagementCreateUser=pk,t.useUserManagementDeleteUser=hk,t.useUserManagementDisableTotp=Ik,t.useUserManagementGetTotpStatus=Ek,t.useUserManagementListApiKeys=xk,t.useUserManagementListScopedTokens=Nk,t.useUserManagementListUsers=gk,t.useUserManagementResetPassword=bk,t.useUserManagementRevokeApiKey=Sk,t.useUserManagementRevokeScopedToken=kk,t.useUserManagementSetUserScopes=yk,t.useUserManagementSetupTotp=Ok,t.useUserManagementUpdateUser=vk,t.useUserManagementValidateApiKey=jk,t.useUserManagementValidateCredentials=_k,t.useUserManagementValidateScopedToken=Pk,t.useUserManagementVerifyTotp=Mk,t.useWebrtcSessionCloseSession=Rk,t.useWebrtcSessionCreateSession=Ak,t.useWebrtcSessionHandleAnswer=Tk,t.useWebrtcSessionHandleOffer=zk,t.useWebrtcSessionHasAdaptiveBitrate=Zk,t.useWebrtcSessionListStreams=Dk,t.useWidget=ef,t.useWidgetMetadata=tf,t.useWidgetRegistry=Aa,t.useZoneAnalyticsGetCameraHistory=Bk,t.useZoneAnalyticsGetCurrentSnapshot=Lk,t.useZoneAnalyticsGetUnzonedHistory=Fk,t.useZoneAnalyticsGetZoneHistory=Uk,t.useZoneEditing=_O,t.useZoneRulesListRules=Gk,t.useZoneRulesSetRules=Vk,t.useZonesAddZone=Wk,t.useZonesListZones=Qk,t.useZonesRemoveZone=qk,t.useZonesUpdateZone=Hk,t.validateScopes=bO})(Ac)),Ac}var $m=jm();const pM=MO($m),NM=UO({__proto__:null,default:pM},[$m]);export{NM as i};