@camstack/addon-admin-ui 0.1.40 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-Cv6qLu_-.js → __mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-CRKSbdgN.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-CChEG9e0.js → __mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-BGPfTw3V.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-C1BmHlGM.js → __mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-jPpiOa0I.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-Bxv_3KWz.js → __mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-DYNYuSL7.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-DC63qZbr.js → __mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-ij0ODm-n.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-D2C49VyZ.js → __mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-C4Ko8zXp.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-D3WbXy3O.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-Cf5gSqc_.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-Csg6EbPB.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-CYaX3FDr.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-CUc0oFNo.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-rHwdrynu.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-vh0hhA5d.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-DRDS6j-Y.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs-CpGtTxci.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs-cUuqcEcL.js} +2 -2
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs_commonjs-proxy-RUDPE9aM.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs_commonjs-proxy-CzMP41OH.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-yD7UmaAo.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DNAkeUTZ.js} +1 -1
- package/dist/assets/{devices-a77yscD5.js → devices-DaqavVOg.js} +1 -1
- package/dist/assets/{hostInit-DaDF_bfJ.js → hostInit-ByQycOVJ.js} +1 -1
- package/dist/assets/index-B6kubsZI.js +151 -0
- package/dist/assets/index-BI1a6Whs.js +1 -0
- package/dist/assets/index-BVNg3Krt.js +1185 -0
- package/dist/assets/{index-DsOnjZM4.js → index-BbwPCEeT.js} +1 -1
- package/dist/assets/{index-CehI0ALS.js → index-BpC2rqYA.js} +1 -1
- package/dist/assets/index-CukoHCyD.js +1 -0
- package/dist/assets/{index-DVUREV1A.js → index-Cyva9RmE.js} +1 -1
- package/dist/assets/index-DLnW8nGB.css +1 -0
- package/dist/assets/index-DNydUTOB.js +1 -0
- package/dist/assets/{index-IsVfuhTX.js → index-DVLRgczW.js} +1 -1
- package/dist/assets/index-PXbclFuZ.js +87 -0
- package/dist/assets/index-QqQmcu5i.js +1 -0
- package/dist/assets/method-access-map-DjDdPRYC.js +1 -0
- package/dist/assets/{remoteEntry-VsZWB5do.js → remoteEntry-iRKuVHUX.js} +1 -1
- package/dist/assets/{schemas-BEt-CulV.js → schemas-BdJePqbR.js} +5 -5
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-VQvlRqZ-.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-QVZxTxLo.js} +2 -2
- package/dist/index.html +152 -9
- package/dist/mf-entry-bootstrap-0.js +2 -2
- package/dist/server/addon.js +413 -44
- package/dist/server/addon.js.map +1 -1
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/dist/assets/index-C8NE-4Ma.js +0 -1
- package/dist/assets/index-COoei6lw.css +0 -1
- package/dist/assets/index-D4yaxCPF.js +0 -87
- package/dist/assets/index-DAMgd5aW.js +0 -1
- package/dist/assets/index-DAenO2kJ.js +0 -151
- package/dist/assets/index-DWdPkQ_j.js +0 -1
- package/dist/assets/index-Dj1ZxUR8.js +0 -1150
- package/dist/assets/index-EjW6hqu2.js +0 -1
- package/dist/assets/method-access-map-BgqTQNPE.js +0 -1
- package/dist/registerSW.js +0 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import{b as XM,g as YM}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-C_6K4VBY.js";import{r as Km}from"./__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-C4Ko8zXp.js";import{r as Xm}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs_commonjs-proxy-DrLZNXOX.js";import{r as eE}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-CYaX3FDr.js";import{r as tE}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-DRDS6j-Y.js";import{r as rE}from"./__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-BGPfTw3V.js";import{r as nE}from"./__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs_commonjs-proxy-WD2WouMQ.js";import{r as iE}from"./__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-DYNYuSL7.js";import{r as aE}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs_commonjs-proxy-CzMP41OH.js";import{r as oE}from"./__mfe_internal__admin_ui_host__loadShare__konva__loadShare__.mjs_commonjs-proxy-Bqeq2Zwj.js";import{r as sE}from"./index-BpC2rqYA.js";import{s as lE}from"./index-Cyva9RmE.js";function cE(r,m){for(var C=0;C<m.length;C++){const E=m[C];if(typeof E!="string"&&!Array.isArray(E)){for(const _ in E)if(_!=="default"&&!(_ in r)){const j=Object.getOwnPropertyDescriptor(E,_);j&&Object.defineProperty(r,_,j.get?j:{enumerable:!0,get:()=>E[_]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var pc={},hc={},Bm;function uE(){return Bm||(Bm=1,(function(r){Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),yg();let m=Km,C=Xm;var E={frigate:"#3b82f6",scrypted:"#a855f7",reolink:"#06b6d4",homeAssistant:"#22d3ee",rtsp:"#78716c"},_={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:E},j={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:E},T={colors:{dark:_,light:j},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 F(Se,He){const Ge={...Se};for(const it in He){const ht=He[it],kt=Se[it];ht!==void 0&&typeof ht=="object"&&ht!==null&&!Array.isArray(ht)&&typeof kt=="object"&&kt!==null?Ge[it]=F(kt,ht):ht!==void 0&&(Ge[it]=ht)}return Ge}function c(Se){return Se?F(structuredClone(T),Se):structuredClone(T)}function s(Se){return Se.replace(/[A-Z]/g,He=>`-${He.toLowerCase()}`)}function u(Se){return`--color-${s(Se)}`}function v(Se){const He=[];for(const[Ge,it]of Object.entries(Se))Ge!=="provider"&&He.push(` ${u(Ge)}: ${it};`);return He.join(`
|
|
2
|
+
`)}function n(Se){const He=[];for(const[Ge,it]of Object.entries(Se))He.push(` --color-provider-${s(Ge)}: ${it};`);return He.join(`
|
|
3
|
+
`)}function t(Se){const He=[];for(const[Ge,it]of Object.entries(Se))He.push(` --spacing-${Ge}: ${it}px;`);return He.join(`
|
|
4
|
+
`)}function x(Se){const He=[];for(const[Ge,it]of Object.entries(Se))He.push(` --radius-${Ge}: ${it}px;`);return He.join(`
|
|
5
|
+
`)}function A(Se){const He=v(Se.colors.dark),Ge=v(Se.colors.light);return`@theme {
|
|
6
|
+
${n(Se.colors.dark.provider)}
|
|
7
|
+
${t(Se.spacing)}
|
|
8
|
+
${x(Se.radius)}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dark {
|
|
12
|
+
${He}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.light {
|
|
16
|
+
${Ge}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (prefers-color-scheme: dark) {
|
|
20
|
+
:root {
|
|
21
|
+
${He.replace(/^ {2}/gm," ")}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@media (prefers-color-scheme: light) {
|
|
26
|
+
:root {
|
|
27
|
+
${Ge.replace(/^ {2}/gm," ")}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`}var te=(0,m.createContext)(null),ee=["dark","light","system"];function oe(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ie(Se,He){if(typeof window>"u")return He;const Ge=localStorage.getItem(Se);return Ge==="dark"||Ge==="light"||Ge==="system"?Ge:He}function ke(Se){return Se==="system"?oe():Se}function se({children:Se,defaultMode:He="system",storageKey:Ge="camstack-theme-mode"}){const[it,ht]=(0,m.useState)(()=>ie(Ge,He)),[kt,Et]=(0,m.useState)(()=>ke(it)),It=(0,m.useCallback)(yt=>{ht(yt),Et(ke(yt)),typeof window<"u"&&localStorage.setItem(Ge,yt)},[Ge]),At=(0,m.useCallback)(()=>{It(ee[(ee.indexOf(it)+1)%ee.length]??"dark")},[it,It]);(0,m.useEffect)(()=>{if(typeof document>"u")return;const yt=document.documentElement;yt.classList.remove("dark","light"),yt.classList.add(kt)},[it,kt]),(0,m.useEffect)(()=>{if(typeof window>"u"||it!=="system")return;const yt=window.matchMedia("(prefers-color-scheme: dark)"),Ft=()=>{Et(oe())};return yt.addEventListener("change",Ft),()=>yt.removeEventListener("change",Ft)},[it]);const Lt=(0,m.useMemo)(()=>({mode:it,resolvedMode:kt,setMode:It,toggleMode:At}),[it,kt,It,At]);return(0,C.jsx)(te.Provider,{value:Lt,children:Se})}function Oe(){const Se=(0,m.useContext)(te);if(!Se)throw new Error("useThemeMode must be used within a ThemeProvider");return Se}r.ThemeProvider=se,r.ThemeProvider$1=se,r.createTheme=c,r.createTheme$1=c,r.darkColors=_,r.darkColors$1=_,r.defaultTheme=T,r.defaultTheme$1=T,r.lightColors=j,r.lightColors$1=j,r.themeToCss=A,r.themeToCss$1=A,r.useThemeMode=Oe,r.useThemeMode$1=Oe})(hc)),hc}const dE=XM(lE);var xr={},Ht={},$t={},on={};(function(r){var m;Object.defineProperty(r,"__esModule",{value:!0}),r.globalConfig=r.$ZodEncodeError=r.$ZodAsyncError=r.$brand=r.NEVER=void 0,r.$constructor=C,r.config=j,r.NEVER=Object.freeze({status:"aborted"});function C(T,F,c){function s(t,x){if(t._zod||Object.defineProperty(t,"_zod",{value:{def:x,constr:n,traits:new Set},enumerable:!1}),t._zod.traits.has(T))return;t._zod.traits.add(T),F(t,x);const A=n.prototype,te=Object.keys(A);for(let ee=0;ee<te.length;ee++){const oe=te[ee];oe in t||(t[oe]=A[oe].bind(t))}}const u=c?.Parent??Object;class v extends u{}Object.defineProperty(v,"name",{value:T});function n(t){var x;const A=c?.Parent?new v:this;s(A,t),(x=A._zod).deferred??(x.deferred=[]);for(const te of A._zod.deferred)te();return A}return Object.defineProperty(n,"init",{value:s}),Object.defineProperty(n,Symbol.hasInstance,{value:t=>c?.Parent&&t instanceof c.Parent?!0:t?._zod?.traits?.has(T)}),Object.defineProperty(n,"name",{value:T}),n}r.$brand=Symbol("zod_brand");class E extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}r.$ZodAsyncError=E;class _ extends Error{constructor(F){super(`Encountered unidirectional transform during encode: ${F}`),this.name="ZodEncodeError"}}r.$ZodEncodeError=_,(m=globalThis).__zod_globalConfig??(m.__zod_globalConfig={}),r.globalConfig=globalThis.__zod_globalConfig;function j(T){return T&&Object.assign(r.globalConfig,T),r.globalConfig}})(on);var Or={},Ot={},le={};Object.defineProperty(le,"__esModule",{value:!0});le.Class=le.BIGINT_FORMAT_RANGES=le.NUMBER_FORMAT_RANGES=le.primitiveTypes=le.propertyKeyTypes=le.getParsedType=le.allowsEval=le.captureStackTrace=void 0;le.assertEqual=mE;le.assertNotEqual=gE;le.assertIs=pE;le.assertNever=hE;le.assert=vE;le.getEnumValues=bE;le.joinValues=yE;le.jsonStringifyReplacer=xE;le.cached=Ym;le.nullish=_E;le.cleanRegex=wE;le.floatSafeRemainder=SE;le.defineLazy=jE;le.objectClone=$E;le.assignProp=Qr;le.mergeDefs=Ir;le.cloneDef=kE;le.getElementAtPath=PE;le.promiseAllObject=NE;le.randomString=CE;le.esc=OE;le.slugify=ME;le.isObject=vc;le.isPlainObject=fs;le.shallowClone=EE;le.numKeys=IE;le.escapeRegex=AE;le.clone=Hr;le.normalizeParams=zE;le.createTransparentProxy=TE;le.stringifyPrimitive=eg;le.optionalKeys=RE;le.pick=LE;le.omit=ZE;le.extend=UE;le.safeExtend=BE;le.merge=FE;le.partial=GE;le.required=VE;le.aborted=WE;le.explicitlyAborted=QE;le.prefixIssues=HE;le.unwrapMessage=aa;le.finalizeIssue=qE;le.getSizableOrigin=JE;le.getLengthableOrigin=KE;le.parsedType=XE;le.issue=YE;le.cleanEnum=eI;le.base64ToUint8Array=tg;le.uint8ArrayToBase64=rg;le.base64urlToUint8Array=tI;le.uint8ArrayToBase64url=rI;le.hexToUint8Array=nI;le.uint8ArrayToHex=iI;const fE=on;function mE(r){return r}function gE(r){return r}function pE(r){}function hE(r){throw new Error("Unexpected value in exhaustive check")}function vE(r){}function bE(r){const m=Object.values(r).filter(E=>typeof E=="number");return Object.entries(r).filter(([E,_])=>m.indexOf(+E)===-1).map(([E,_])=>_)}function yE(r,m="|"){return r.map(C=>eg(C)).join(m)}function xE(r,m){return typeof m=="bigint"?m.toString():m}function Ym(r){return{get value(){{const m=r();return Object.defineProperty(this,"value",{value:m}),m}}}}function _E(r){return r==null}function wE(r){const m=r.startsWith("^")?1:0,C=r.endsWith("$")?r.length-1:r.length;return r.slice(m,C)}function SE(r,m){const C=r/m,E=Math.round(C),_=Number.EPSILON*Math.max(Math.abs(C),1);return Math.abs(C-E)<_?0:C-E}const Fm=Symbol("evaluating");function jE(r,m,C){let E;Object.defineProperty(r,m,{get(){if(E!==Fm)return E===void 0&&(E=Fm,E=C()),E},set(_){Object.defineProperty(r,m,{value:_})},configurable:!0})}function $E(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function Qr(r,m,C){Object.defineProperty(r,m,{value:C,writable:!0,enumerable:!0,configurable:!0})}function Ir(...r){const m={};for(const C of r){const E=Object.getOwnPropertyDescriptors(C);Object.assign(m,E)}return Object.defineProperties({},m)}function kE(r){return Ir(r._zod.def)}function PE(r,m){return m?m.reduce((C,E)=>C?.[E],r):r}function NE(r){const m=Object.keys(r),C=m.map(E=>r[E]);return Promise.all(C).then(E=>{const _={};for(let j=0;j<m.length;j++)_[m[j]]=E[j];return _})}function CE(r=10){const m="abcdefghijklmnopqrstuvwxyz";let C="";for(let E=0;E<r;E++)C+=m[Math.floor(Math.random()*m.length)];return C}function OE(r){return JSON.stringify(r)}function ME(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}le.captureStackTrace="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function vc(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}le.allowsEval=Ym(()=>{if(fE.globalConfig.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const r=Function;return new r(""),!0}catch{return!1}});function fs(r){if(vc(r)===!1)return!1;const m=r.constructor;if(m===void 0||typeof m!="function")return!0;const C=m.prototype;return!(vc(C)===!1||Object.prototype.hasOwnProperty.call(C,"isPrototypeOf")===!1)}function EE(r){return fs(r)?{...r}:Array.isArray(r)?[...r]:r instanceof Map?new Map(r):r instanceof Set?new Set(r):r}function IE(r){let m=0;for(const C in r)Object.prototype.hasOwnProperty.call(r,C)&&m++;return m}const DE=r=>{const m=typeof r;switch(m){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(r)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(r)?"array":r===null?"null":r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?"promise":typeof Map<"u"&&r instanceof Map?"map":typeof Set<"u"&&r instanceof Set?"set":typeof Date<"u"&&r instanceof Date?"date":typeof File<"u"&&r instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${m}`)}};le.getParsedType=DE;le.propertyKeyTypes=new Set(["string","number","symbol"]);le.primitiveTypes=new Set(["string","number","bigint","boolean","symbol","undefined"]);function AE(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hr(r,m,C){const E=new r._zod.constr(m??r._zod.def);return(!m||C?.parent)&&(E._zod.parent=r),E}function zE(r){const m=r;if(!m)return{};if(typeof m=="string")return{error:()=>m};if(m?.message!==void 0){if(m?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");m.error=m.message}return delete m.message,typeof m.error=="string"?{...m,error:()=>m.error}:m}function TE(r){let m;return new Proxy({},{get(C,E,_){return m??(m=r()),Reflect.get(m,E,_)},set(C,E,_,j){return m??(m=r()),Reflect.set(m,E,_,j)},has(C,E){return m??(m=r()),Reflect.has(m,E)},deleteProperty(C,E){return m??(m=r()),Reflect.deleteProperty(m,E)},ownKeys(C){return m??(m=r()),Reflect.ownKeys(m)},getOwnPropertyDescriptor(C,E){return m??(m=r()),Reflect.getOwnPropertyDescriptor(m,E)},defineProperty(C,E,_){return m??(m=r()),Reflect.defineProperty(m,E,_)}})}function eg(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function RE(r){return Object.keys(r).filter(m=>r[m]._zod.optin==="optional"&&r[m]._zod.optout==="optional")}le.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]};le.BIGINT_FORMAT_RANGES={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function LE(r,m){const C=r._zod.def,E=C.checks;if(E&&E.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const j=Ir(r._zod.def,{get shape(){const T={};for(const F in m){if(!(F in C.shape))throw new Error(`Unrecognized key: "${F}"`);m[F]&&(T[F]=C.shape[F])}return Qr(this,"shape",T),T},checks:[]});return Hr(r,j)}function ZE(r,m){const C=r._zod.def,E=C.checks;if(E&&E.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const j=Ir(r._zod.def,{get shape(){const T={...r._zod.def.shape};for(const F in m){if(!(F in C.shape))throw new Error(`Unrecognized key: "${F}"`);m[F]&&delete T[F]}return Qr(this,"shape",T),T},checks:[]});return Hr(r,j)}function UE(r,m){if(!fs(m))throw new Error("Invalid input to extend: expected a plain object");const C=r._zod.def.checks;if(C&&C.length>0){const j=r._zod.def.shape;for(const T in m)if(Object.getOwnPropertyDescriptor(j,T)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const _=Ir(r._zod.def,{get shape(){const j={...r._zod.def.shape,...m};return Qr(this,"shape",j),j}});return Hr(r,_)}function BE(r,m){if(!fs(m))throw new Error("Invalid input to safeExtend: expected a plain object");const C=Ir(r._zod.def,{get shape(){const E={...r._zod.def.shape,...m};return Qr(this,"shape",E),E}});return Hr(r,C)}function FE(r,m){if(r._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const C=Ir(r._zod.def,{get shape(){const E={...r._zod.def.shape,...m._zod.def.shape};return Qr(this,"shape",E),E},get catchall(){return m._zod.def.catchall},checks:m._zod.def.checks??[]});return Hr(r,C)}function GE(r,m,C){const _=m._zod.def.checks;if(_&&_.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const T=Ir(m._zod.def,{get shape(){const F=m._zod.def.shape,c={...F};if(C)for(const s in C){if(!(s in F))throw new Error(`Unrecognized key: "${s}"`);C[s]&&(c[s]=r?new r({type:"optional",innerType:F[s]}):F[s])}else for(const s in F)c[s]=r?new r({type:"optional",innerType:F[s]}):F[s];return Qr(this,"shape",c),c},checks:[]});return Hr(m,T)}function VE(r,m,C){const E=Ir(m._zod.def,{get shape(){const _=m._zod.def.shape,j={..._};if(C)for(const T in C){if(!(T in j))throw new Error(`Unrecognized key: "${T}"`);C[T]&&(j[T]=new r({type:"nonoptional",innerType:_[T]}))}else for(const T in _)j[T]=new r({type:"nonoptional",innerType:_[T]});return Qr(this,"shape",j),j}});return Hr(m,E)}function WE(r,m=0){if(r.aborted===!0)return!0;for(let C=m;C<r.issues.length;C++)if(r.issues[C]?.continue!==!0)return!0;return!1}function QE(r,m=0){if(r.aborted===!0)return!0;for(let C=m;C<r.issues.length;C++)if(r.issues[C]?.continue===!1)return!0;return!1}function HE(r,m){return m.map(C=>{var E;return(E=C).path??(E.path=[]),C.path.unshift(r),C})}function aa(r){return typeof r=="string"?r:r?.message}function qE(r,m,C){const E=r.message?r.message:aa(r.inst?._zod.def?.error?.(r))??aa(m?.error?.(r))??aa(C.customError?.(r))??aa(C.localeError?.(r))??"Invalid input",{inst:_,continue:j,input:T,...F}=r;return F.path??(F.path=[]),F.message=E,m?.reportInput&&(F.input=T),F}function JE(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function KE(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function XE(r){const m=typeof r;switch(m){case"number":return Number.isNaN(r)?"nan":"number";case"object":{if(r===null)return"null";if(Array.isArray(r))return"array";const C=r;if(C&&Object.getPrototypeOf(C)!==Object.prototype&&"constructor"in C&&C.constructor)return C.constructor.name}}return m}function YE(...r){const[m,C,E]=r;return typeof m=="string"?{message:m,code:"custom",input:C,inst:E}:{...m}}function eI(r){return Object.entries(r).filter(([m,C])=>Number.isNaN(Number.parseInt(m,10))).map(m=>m[1])}function tg(r){const m=atob(r),C=new Uint8Array(m.length);for(let E=0;E<m.length;E++)C[E]=m.charCodeAt(E);return C}function rg(r){let m="";for(let C=0;C<r.length;C++)m+=String.fromCharCode(r[C]);return btoa(m)}function tI(r){const m=r.replace(/-/g,"+").replace(/_/g,"/"),C="=".repeat((4-m.length%4)%4);return tg(m+C)}function rI(r){return rg(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function nI(r){const m=r.replace(/^0x/,"");if(m.length%2!==0)throw new Error("Invalid hex string length");const C=new Uint8Array(m.length/2);for(let E=0;E<m.length;E+=2)C[E/2]=Number.parseInt(m.slice(E,E+2),16);return C}function iI(r){return Array.from(r).map(m=>m.toString(16).padStart(2,"0")).join("")}class aI{constructor(...m){}}le.Class=aI;var oI=Ot&&Ot.__createBinding||(Object.create?(function(r,m,C,E){E===void 0&&(E=C);var _=Object.getOwnPropertyDescriptor(m,C);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[C]}}),Object.defineProperty(r,E,_)}):(function(r,m,C,E){E===void 0&&(E=C),r[E]=m[C]})),sI=Ot&&Ot.__setModuleDefault||(Object.create?(function(r,m){Object.defineProperty(r,"default",{enumerable:!0,value:m})}):function(r,m){r.default=m}),lI=Ot&&Ot.__importStar||function(r){if(r&&r.__esModule)return r;var m={};if(r!=null)for(var C in r)C!=="default"&&Object.prototype.hasOwnProperty.call(r,C)&&oI(m,r,C);return sI(m,r),m};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.$ZodRealError=Ot.$ZodError=void 0;Ot.flattenError=uI;Ot.formatError=dI;Ot.treeifyError=fI;Ot.toDotPath=ag;Ot.prettifyError=mI;const ng=on,cI=lI(le),ig=(r,m)=>{r.name="$ZodError",Object.defineProperty(r,"_zod",{value:r._zod,enumerable:!1}),Object.defineProperty(r,"issues",{value:m,enumerable:!1}),r.message=JSON.stringify(m,cI.jsonStringifyReplacer,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})};Ot.$ZodError=(0,ng.$constructor)("$ZodError",ig);Ot.$ZodRealError=(0,ng.$constructor)("$ZodError",ig,{Parent:Error});function uI(r,m=C=>C.message){const C={},E=[];for(const _ of r.issues)_.path.length>0?(C[_.path[0]]=C[_.path[0]]||[],C[_.path[0]].push(m(_))):E.push(m(_));return{formErrors:E,fieldErrors:C}}function dI(r,m=C=>C.message){const C={_errors:[]},E=(_,j=[])=>{for(const T of _.issues)if(T.code==="invalid_union"&&T.errors.length)T.errors.map(F=>E({issues:F},[...j,...T.path]));else if(T.code==="invalid_key")E({issues:T.issues},[...j,...T.path]);else if(T.code==="invalid_element")E({issues:T.issues},[...j,...T.path]);else{const F=[...j,...T.path];if(F.length===0)C._errors.push(m(T));else{let c=C,s=0;for(;s<F.length;){const u=F[s];s===F.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(m(T))):c[u]=c[u]||{_errors:[]},c=c[u],s++}}}};return E(r),C}function fI(r,m=C=>C.message){const C={errors:[]},E=(_,j=[])=>{var T,F;for(const c of _.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(s=>E({issues:s},[...j,...c.path]));else if(c.code==="invalid_key")E({issues:c.issues},[...j,...c.path]);else if(c.code==="invalid_element")E({issues:c.issues},[...j,...c.path]);else{const s=[...j,...c.path];if(s.length===0){C.errors.push(m(c));continue}let u=C,v=0;for(;v<s.length;){const n=s[v],t=v===s.length-1;typeof n=="string"?(u.properties??(u.properties={}),(T=u.properties)[n]??(T[n]={errors:[]}),u=u.properties[n]):(u.items??(u.items=[]),(F=u.items)[n]??(F[n]={errors:[]}),u=u.items[n]),t&&u.errors.push(m(c)),v++}}};return E(r),C}function ag(r){const m=[],C=r.map(E=>typeof E=="object"?E.key:E);for(const E of C)typeof E=="number"?m.push(`[${E}]`):typeof E=="symbol"?m.push(`[${JSON.stringify(String(E))}]`):/[^\w$]/.test(E)?m.push(`[${JSON.stringify(E)}]`):(m.length&&m.push("."),m.push(E));return m.join("")}function mI(r){const m=[],C=[...r.issues].sort((E,_)=>(E.path??[]).length-(_.path??[]).length);for(const E of C)m.push(`✖ ${E.message}`),E.path?.length&&m.push(` → at ${ag(E.path)}`);return m.join(`
|
|
31
|
+
`)}(function(r){var m=Or&&Or.__createBinding||(Object.create?(function(ie,ke,se,Oe){Oe===void 0&&(Oe=se);var Se=Object.getOwnPropertyDescriptor(ke,se);(!Se||("get"in Se?!ke.__esModule:Se.writable||Se.configurable))&&(Se={enumerable:!0,get:function(){return ke[se]}}),Object.defineProperty(ie,Oe,Se)}):(function(ie,ke,se,Oe){Oe===void 0&&(Oe=se),ie[Oe]=ke[se]})),C=Or&&Or.__setModuleDefault||(Object.create?(function(ie,ke){Object.defineProperty(ie,"default",{enumerable:!0,value:ke})}):function(ie,ke){ie.default=ke}),E=Or&&Or.__importStar||function(ie){if(ie&&ie.__esModule)return ie;var ke={};if(ie!=null)for(var se in ie)se!=="default"&&Object.prototype.hasOwnProperty.call(ie,se)&&m(ke,ie,se);return C(ke,ie),ke};Object.defineProperty(r,"__esModule",{value:!0}),r.safeDecodeAsync=r._safeDecodeAsync=r.safeEncodeAsync=r._safeEncodeAsync=r.safeDecode=r._safeDecode=r.safeEncode=r._safeEncode=r.decodeAsync=r._decodeAsync=r.encodeAsync=r._encodeAsync=r.decode=r._decode=r.encode=r._encode=r.safeParseAsync=r._safeParseAsync=r.safeParse=r._safeParse=r.parseAsync=r._parseAsync=r.parse=r._parse=void 0;const _=E(on),j=E(Ot),T=E(le),F=ie=>(ke,se,Oe,Se)=>{const He=Oe?{...Oe,async:!1}:{async:!1},Ge=ke._zod.run({value:se,issues:[]},He);if(Ge instanceof Promise)throw new _.$ZodAsyncError;if(Ge.issues.length){const it=new(Se?.Err??ie)(Ge.issues.map(ht=>T.finalizeIssue(ht,He,_.config())));throw T.captureStackTrace(it,Se?.callee),it}return Ge.value};r._parse=F,r.parse=(0,r._parse)(j.$ZodRealError);const c=ie=>async(ke,se,Oe,Se)=>{const He=Oe?{...Oe,async:!0}:{async:!0};let Ge=ke._zod.run({value:se,issues:[]},He);if(Ge instanceof Promise&&(Ge=await Ge),Ge.issues.length){const it=new(Se?.Err??ie)(Ge.issues.map(ht=>T.finalizeIssue(ht,He,_.config())));throw T.captureStackTrace(it,Se?.callee),it}return Ge.value};r._parseAsync=c,r.parseAsync=(0,r._parseAsync)(j.$ZodRealError);const s=ie=>(ke,se,Oe)=>{const Se=Oe?{...Oe,async:!1}:{async:!1},He=ke._zod.run({value:se,issues:[]},Se);if(He instanceof Promise)throw new _.$ZodAsyncError;return He.issues.length?{success:!1,error:new(ie??j.$ZodError)(He.issues.map(Ge=>T.finalizeIssue(Ge,Se,_.config())))}:{success:!0,data:He.value}};r._safeParse=s,r.safeParse=(0,r._safeParse)(j.$ZodRealError);const u=ie=>async(ke,se,Oe)=>{const Se=Oe?{...Oe,async:!0}:{async:!0};let He=ke._zod.run({value:se,issues:[]},Se);return He instanceof Promise&&(He=await He),He.issues.length?{success:!1,error:new ie(He.issues.map(Ge=>T.finalizeIssue(Ge,Se,_.config())))}:{success:!0,data:He.value}};r._safeParseAsync=u,r.safeParseAsync=(0,r._safeParseAsync)(j.$ZodRealError);const v=ie=>(ke,se,Oe)=>{const Se=Oe?{...Oe,direction:"backward"}:{direction:"backward"};return(0,r._parse)(ie)(ke,se,Se)};r._encode=v,r.encode=(0,r._encode)(j.$ZodRealError);const n=ie=>(ke,se,Oe)=>(0,r._parse)(ie)(ke,se,Oe);r._decode=n,r.decode=(0,r._decode)(j.$ZodRealError);const t=ie=>async(ke,se,Oe)=>{const Se=Oe?{...Oe,direction:"backward"}:{direction:"backward"};return(0,r._parseAsync)(ie)(ke,se,Se)};r._encodeAsync=t,r.encodeAsync=(0,r._encodeAsync)(j.$ZodRealError);const x=ie=>async(ke,se,Oe)=>(0,r._parseAsync)(ie)(ke,se,Oe);r._decodeAsync=x,r.decodeAsync=(0,r._decodeAsync)(j.$ZodRealError);const A=ie=>(ke,se,Oe)=>{const Se=Oe?{...Oe,direction:"backward"}:{direction:"backward"};return(0,r._safeParse)(ie)(ke,se,Se)};r._safeEncode=A,r.safeEncode=(0,r._safeEncode)(j.$ZodRealError);const te=ie=>(ke,se,Oe)=>(0,r._safeParse)(ie)(ke,se,Oe);r._safeDecode=te,r.safeDecode=(0,r._safeDecode)(j.$ZodRealError);const ee=ie=>async(ke,se,Oe)=>{const Se=Oe?{...Oe,direction:"backward"}:{direction:"backward"};return(0,r._safeParseAsync)(ie)(ke,se,Se)};r._safeEncodeAsync=ee,r.safeEncodeAsync=(0,r._safeEncodeAsync)(j.$ZodRealError);const oe=ie=>async(ke,se,Oe)=>(0,r._safeParseAsync)(ie)(ke,se,Oe);r._safeDecodeAsync=oe,r.safeDecodeAsync=(0,r._safeDecodeAsync)(j.$ZodRealError)})(Or);var Mr={},_r={},wr={};(function(r){var m=wr&&wr.__createBinding||(Object.create?(function(oe,ie,ke,se){se===void 0&&(se=ke);var Oe=Object.getOwnPropertyDescriptor(ie,ke);(!Oe||("get"in Oe?!ie.__esModule:Oe.writable||Oe.configurable))&&(Oe={enumerable:!0,get:function(){return ie[ke]}}),Object.defineProperty(oe,se,Oe)}):(function(oe,ie,ke,se){se===void 0&&(se=ke),oe[se]=ie[ke]})),C=wr&&wr.__setModuleDefault||(Object.create?(function(oe,ie){Object.defineProperty(oe,"default",{enumerable:!0,value:ie})}):function(oe,ie){oe.default=ie}),E=wr&&wr.__importStar||function(oe){if(oe&&oe.__esModule)return oe;var ie={};if(oe!=null)for(var ke in oe)ke!=="default"&&Object.prototype.hasOwnProperty.call(oe,ke)&&m(ie,oe,ke);return C(ie,oe),ie};Object.defineProperty(r,"__esModule",{value:!0}),r.sha256_base64url=r.sha256_base64=r.sha256_hex=r.sha1_base64url=r.sha1_base64=r.sha1_hex=r.md5_base64url=r.md5_base64=r.md5_hex=r.hex=r.uppercase=r.lowercase=r.undefined=r.null=r.boolean=r.number=r.integer=r.bigint=r.string=r.date=r.e164=r.httpProtocol=r.domain=r.hostname=r.base64url=r.base64=r.cidrv6=r.cidrv4=r.mac=r.ipv6=r.ipv4=r.browserEmail=r.idnEmail=r.unicodeEmail=r.rfc5322Email=r.html5Email=r.email=r.uuid7=r.uuid6=r.uuid4=r.uuid=r.guid=r.extendedDuration=r.duration=r.nanoid=r.ksuid=r.xid=r.ulid=r.cuid2=r.cuid=void 0,r.sha512_base64url=r.sha512_base64=r.sha512_hex=r.sha384_base64url=r.sha384_base64=r.sha384_hex=void 0,r.emoji=F,r.time=v,r.datetime=n;const _=E(le);r.cuid=/^[cC][0-9a-z]{6,}$/,r.cuid2=/^[0-9a-z]+$/,r.ulid=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,r.xid=/^[0-9a-vA-V]{20}$/,r.ksuid=/^[A-Za-z0-9]{27}$/,r.nanoid=/^[a-zA-Z0-9_-]{21}$/,r.duration=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,r.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)?)??$/,r.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 j=oe=>oe?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${oe}[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)$/;r.uuid=j,r.uuid4=(0,r.uuid)(4),r.uuid6=(0,r.uuid)(6),r.uuid7=(0,r.uuid)(7),r.email=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,r.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])?)*$/,r.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,}))$/,r.unicodeEmail=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,r.idnEmail=r.unicodeEmail,r.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 T="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function F(){return new RegExp(T,"u")}r.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])$/,r.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=oe=>{const ie=_.escapeRegex(oe??":");return new RegExp(`^(?:[0-9A-F]{2}${ie}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${ie}){5}[0-9a-f]{2}$`)};r.mac=c,r.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])$/,r.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])$/,r.base64=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,r.base64url=/^[A-Za-z0-9_-]*$/,r.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])?)*\.?$/,r.domain=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,r.httpProtocol=/^https?$/,r.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])))";r.date=new RegExp(`^${s}$`);function u(oe){const ie="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof oe.precision=="number"?oe.precision===-1?`${ie}`:oe.precision===0?`${ie}:[0-5]\\d`:`${ie}:[0-5]\\d\\.\\d{${oe.precision}}`:`${ie}(?::[0-5]\\d(?:\\.\\d+)?)?`}function v(oe){return new RegExp(`^${u(oe)}$`)}function n(oe){const ie=u({precision:oe.precision}),ke=["Z"];oe.local&&ke.push(""),oe.offset&&ke.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const se=`${ie}(?:${ke.join("|")})`;return new RegExp(`^${s}T(?:${se})$`)}const t=oe=>{const ie=oe?`[\\s\\S]{${oe?.minimum??0},${oe?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${ie}$`)};r.string=t,r.bigint=/^-?\d+n?$/,r.integer=/^-?\d+$/,r.number=/^-?\d+(?:\.\d+)?$/,r.boolean=/^(?:true|false)$/i;const x=/^null$/i;r.null=x;const A=/^undefined$/i;r.undefined=A,r.lowercase=/^[^A-Z]*$/,r.uppercase=/^[^a-z]*$/,r.hex=/^[0-9a-fA-F]*$/;function te(oe,ie){return new RegExp(`^[A-Za-z0-9+/]{${oe}}${ie}$`)}function ee(oe){return new RegExp(`^[A-Za-z0-9_-]{${oe}}$`)}r.md5_hex=/^[0-9a-fA-F]{32}$/,r.md5_base64=te(22,"=="),r.md5_base64url=ee(22),r.sha1_hex=/^[0-9a-fA-F]{40}$/,r.sha1_base64=te(27,"="),r.sha1_base64url=ee(27),r.sha256_hex=/^[0-9a-fA-F]{64}$/,r.sha256_base64=te(43,"="),r.sha256_base64url=ee(43),r.sha384_hex=/^[0-9a-fA-F]{96}$/,r.sha384_base64=te(64,""),r.sha384_base64url=ee(64),r.sha512_hex=/^[0-9a-fA-F]{128}$/,r.sha512_base64=te(86,"=="),r.sha512_base64url=ee(86)})(wr);(function(r){var m=_r&&_r.__createBinding||(Object.create?(function(s,u,v,n){n===void 0&&(n=v);var t=Object.getOwnPropertyDescriptor(u,v);(!t||("get"in t?!u.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return u[v]}}),Object.defineProperty(s,n,t)}):(function(s,u,v,n){n===void 0&&(n=v),s[n]=u[v]})),C=_r&&_r.__setModuleDefault||(Object.create?(function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}):function(s,u){s.default=u}),E=_r&&_r.__importStar||function(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var v in s)v!=="default"&&Object.prototype.hasOwnProperty.call(s,v)&&m(u,s,v);return C(u,s),u};Object.defineProperty(r,"__esModule",{value:!0}),r.$ZodCheckOverwrite=r.$ZodCheckMimeType=r.$ZodCheckProperty=r.$ZodCheckEndsWith=r.$ZodCheckStartsWith=r.$ZodCheckIncludes=r.$ZodCheckUpperCase=r.$ZodCheckLowerCase=r.$ZodCheckRegex=r.$ZodCheckStringFormat=r.$ZodCheckLengthEquals=r.$ZodCheckMinLength=r.$ZodCheckMaxLength=r.$ZodCheckSizeEquals=r.$ZodCheckMinSize=r.$ZodCheckMaxSize=r.$ZodCheckBigIntFormat=r.$ZodCheckNumberFormat=r.$ZodCheckMultipleOf=r.$ZodCheckGreaterThan=r.$ZodCheckLessThan=r.$ZodCheck=void 0;const _=E(on),j=E(wr),T=E(le);r.$ZodCheck=_.$constructor("$ZodCheck",(s,u)=>{var v;s._zod??(s._zod={}),s._zod.def=u,(v=s._zod).onattach??(v.onattach=[])});const F={number:"number",bigint:"bigint",object:"date"};r.$ZodCheckLessThan=_.$constructor("$ZodCheckLessThan",(s,u)=>{r.$ZodCheck.init(s,u);const v=F[typeof u.value];s._zod.onattach.push(n=>{const t=n._zod.bag,x=(u.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;u.value<x&&(u.inclusive?t.maximum=u.value:t.exclusiveMaximum=u.value)}),s._zod.check=n=>{(u.inclusive?n.value<=u.value:n.value<u.value)||n.issues.push({origin:v,code:"too_big",maximum:typeof u.value=="object"?u.value.getTime():u.value,input:n.value,inclusive:u.inclusive,inst:s,continue:!u.abort})}}),r.$ZodCheckGreaterThan=_.$constructor("$ZodCheckGreaterThan",(s,u)=>{r.$ZodCheck.init(s,u);const v=F[typeof u.value];s._zod.onattach.push(n=>{const t=n._zod.bag,x=(u.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;u.value>x&&(u.inclusive?t.minimum=u.value:t.exclusiveMinimum=u.value)}),s._zod.check=n=>{(u.inclusive?n.value>=u.value:n.value>u.value)||n.issues.push({origin:v,code:"too_small",minimum:typeof u.value=="object"?u.value.getTime():u.value,input:n.value,inclusive:u.inclusive,inst:s,continue:!u.abort})}}),r.$ZodCheckMultipleOf=_.$constructor("$ZodCheckMultipleOf",(s,u)=>{r.$ZodCheck.init(s,u),s._zod.onattach.push(v=>{var n;(n=v._zod.bag).multipleOf??(n.multipleOf=u.value)}),s._zod.check=v=>{if(typeof v.value!=typeof u.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof v.value=="bigint"?v.value%u.value===BigInt(0):T.floatSafeRemainder(v.value,u.value)===0)||v.issues.push({origin:typeof v.value,code:"not_multiple_of",divisor:u.value,input:v.value,inst:s,continue:!u.abort})}}),r.$ZodCheckNumberFormat=_.$constructor("$ZodCheckNumberFormat",(s,u)=>{r.$ZodCheck.init(s,u),u.format=u.format||"float64";const v=u.format?.includes("int"),n=v?"int":"number",[t,x]=T.NUMBER_FORMAT_RANGES[u.format];s._zod.onattach.push(A=>{const te=A._zod.bag;te.format=u.format,te.minimum=t,te.maximum=x,v&&(te.pattern=j.integer)}),s._zod.check=A=>{const te=A.value;if(v){if(!Number.isInteger(te)){A.issues.push({expected:n,format:u.format,code:"invalid_type",continue:!1,input:te,inst:s});return}if(!Number.isSafeInteger(te)){te>0?A.issues.push({input:te,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}):A.issues.push({input:te,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}}te<t&&A.issues.push({origin:"number",input:te,code:"too_small",minimum:t,inclusive:!0,inst:s,continue:!u.abort}),te>x&&A.issues.push({origin:"number",input:te,code:"too_big",maximum:x,inclusive:!0,inst:s,continue:!u.abort})}}),r.$ZodCheckBigIntFormat=_.$constructor("$ZodCheckBigIntFormat",(s,u)=>{r.$ZodCheck.init(s,u);const[v,n]=T.BIGINT_FORMAT_RANGES[u.format];s._zod.onattach.push(t=>{const x=t._zod.bag;x.format=u.format,x.minimum=v,x.maximum=n}),s._zod.check=t=>{const x=t.value;x<v&&t.issues.push({origin:"bigint",input:x,code:"too_small",minimum:v,inclusive:!0,inst:s,continue:!u.abort}),x>n&&t.issues.push({origin:"bigint",input:x,code:"too_big",maximum:n,inclusive:!0,inst:s,continue:!u.abort})}}),r.$ZodCheckMaxSize=_.$constructor("$ZodCheckMaxSize",(s,u)=>{var v;r.$ZodCheck.init(s,u),(v=s._zod.def).when??(v.when=n=>{const t=n.value;return!T.nullish(t)&&t.size!==void 0}),s._zod.onattach.push(n=>{const t=n._zod.bag.maximum??Number.POSITIVE_INFINITY;u.maximum<t&&(n._zod.bag.maximum=u.maximum)}),s._zod.check=n=>{const t=n.value;t.size<=u.maximum||n.issues.push({origin:T.getSizableOrigin(t),code:"too_big",maximum:u.maximum,inclusive:!0,input:t,inst:s,continue:!u.abort})}}),r.$ZodCheckMinSize=_.$constructor("$ZodCheckMinSize",(s,u)=>{var v;r.$ZodCheck.init(s,u),(v=s._zod.def).when??(v.when=n=>{const t=n.value;return!T.nullish(t)&&t.size!==void 0}),s._zod.onattach.push(n=>{const t=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;u.minimum>t&&(n._zod.bag.minimum=u.minimum)}),s._zod.check=n=>{const t=n.value;t.size>=u.minimum||n.issues.push({origin:T.getSizableOrigin(t),code:"too_small",minimum:u.minimum,inclusive:!0,input:t,inst:s,continue:!u.abort})}}),r.$ZodCheckSizeEquals=_.$constructor("$ZodCheckSizeEquals",(s,u)=>{var v;r.$ZodCheck.init(s,u),(v=s._zod.def).when??(v.when=n=>{const t=n.value;return!T.nullish(t)&&t.size!==void 0}),s._zod.onattach.push(n=>{const t=n._zod.bag;t.minimum=u.size,t.maximum=u.size,t.size=u.size}),s._zod.check=n=>{const t=n.value,x=t.size;if(x===u.size)return;const A=x>u.size;n.issues.push({origin:T.getSizableOrigin(t),...A?{code:"too_big",maximum:u.size}:{code:"too_small",minimum:u.size},inclusive:!0,exact:!0,input:n.value,inst:s,continue:!u.abort})}}),r.$ZodCheckMaxLength=_.$constructor("$ZodCheckMaxLength",(s,u)=>{var v;r.$ZodCheck.init(s,u),(v=s._zod.def).when??(v.when=n=>{const t=n.value;return!T.nullish(t)&&t.length!==void 0}),s._zod.onattach.push(n=>{const t=n._zod.bag.maximum??Number.POSITIVE_INFINITY;u.maximum<t&&(n._zod.bag.maximum=u.maximum)}),s._zod.check=n=>{const t=n.value;if(t.length<=u.maximum)return;const A=T.getLengthableOrigin(t);n.issues.push({origin:A,code:"too_big",maximum:u.maximum,inclusive:!0,input:t,inst:s,continue:!u.abort})}}),r.$ZodCheckMinLength=_.$constructor("$ZodCheckMinLength",(s,u)=>{var v;r.$ZodCheck.init(s,u),(v=s._zod.def).when??(v.when=n=>{const t=n.value;return!T.nullish(t)&&t.length!==void 0}),s._zod.onattach.push(n=>{const t=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;u.minimum>t&&(n._zod.bag.minimum=u.minimum)}),s._zod.check=n=>{const t=n.value;if(t.length>=u.minimum)return;const A=T.getLengthableOrigin(t);n.issues.push({origin:A,code:"too_small",minimum:u.minimum,inclusive:!0,input:t,inst:s,continue:!u.abort})}}),r.$ZodCheckLengthEquals=_.$constructor("$ZodCheckLengthEquals",(s,u)=>{var v;r.$ZodCheck.init(s,u),(v=s._zod.def).when??(v.when=n=>{const t=n.value;return!T.nullish(t)&&t.length!==void 0}),s._zod.onattach.push(n=>{const t=n._zod.bag;t.minimum=u.length,t.maximum=u.length,t.length=u.length}),s._zod.check=n=>{const t=n.value,x=t.length;if(x===u.length)return;const A=T.getLengthableOrigin(t),te=x>u.length;n.issues.push({origin:A,...te?{code:"too_big",maximum:u.length}:{code:"too_small",minimum:u.length},inclusive:!0,exact:!0,input:n.value,inst:s,continue:!u.abort})}}),r.$ZodCheckStringFormat=_.$constructor("$ZodCheckStringFormat",(s,u)=>{var v,n;r.$ZodCheck.init(s,u),s._zod.onattach.push(t=>{const x=t._zod.bag;x.format=u.format,u.pattern&&(x.patterns??(x.patterns=new Set),x.patterns.add(u.pattern))}),u.pattern?(v=s._zod).check??(v.check=t=>{u.pattern.lastIndex=0,!u.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:u.format,input:t.value,...u.pattern?{pattern:u.pattern.toString()}:{},inst:s,continue:!u.abort})}):(n=s._zod).check??(n.check=()=>{})}),r.$ZodCheckRegex=_.$constructor("$ZodCheckRegex",(s,u)=>{r.$ZodCheckStringFormat.init(s,u),s._zod.check=v=>{u.pattern.lastIndex=0,!u.pattern.test(v.value)&&v.issues.push({origin:"string",code:"invalid_format",format:"regex",input:v.value,pattern:u.pattern.toString(),inst:s,continue:!u.abort})}}),r.$ZodCheckLowerCase=_.$constructor("$ZodCheckLowerCase",(s,u)=>{u.pattern??(u.pattern=j.lowercase),r.$ZodCheckStringFormat.init(s,u)}),r.$ZodCheckUpperCase=_.$constructor("$ZodCheckUpperCase",(s,u)=>{u.pattern??(u.pattern=j.uppercase),r.$ZodCheckStringFormat.init(s,u)}),r.$ZodCheckIncludes=_.$constructor("$ZodCheckIncludes",(s,u)=>{r.$ZodCheck.init(s,u);const v=T.escapeRegex(u.includes),n=new RegExp(typeof u.position=="number"?`^.{${u.position}}${v}`:v);u.pattern=n,s._zod.onattach.push(t=>{const x=t._zod.bag;x.patterns??(x.patterns=new Set),x.patterns.add(n)}),s._zod.check=t=>{t.value.includes(u.includes,u.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:u.includes,input:t.value,inst:s,continue:!u.abort})}}),r.$ZodCheckStartsWith=_.$constructor("$ZodCheckStartsWith",(s,u)=>{r.$ZodCheck.init(s,u);const v=new RegExp(`^${T.escapeRegex(u.prefix)}.*`);u.pattern??(u.pattern=v),s._zod.onattach.push(n=>{const t=n._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(v)}),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})}}),r.$ZodCheckEndsWith=_.$constructor("$ZodCheckEndsWith",(s,u)=>{r.$ZodCheck.init(s,u);const v=new RegExp(`.*${T.escapeRegex(u.suffix)}$`);u.pattern??(u.pattern=v),s._zod.onattach.push(n=>{const t=n._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(v)}),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,v){s.issues.length&&u.issues.push(...T.prefixIssues(v,s.issues))}r.$ZodCheckProperty=_.$constructor("$ZodCheckProperty",(s,u)=>{r.$ZodCheck.init(s,u),s._zod.check=v=>{const n=u.schema._zod.run({value:v.value[u.property],issues:[]},{});if(n instanceof Promise)return n.then(t=>c(t,v,u.property));c(n,v,u.property)}}),r.$ZodCheckMimeType=_.$constructor("$ZodCheckMimeType",(s,u)=>{r.$ZodCheck.init(s,u);const v=new Set(u.mime);s._zod.onattach.push(n=>{n._zod.bag.mime=u.mime}),s._zod.check=n=>{v.has(n.value.type)||n.issues.push({code:"invalid_value",values:u.mime,input:n.value.type,inst:s,continue:!u.abort})}}),r.$ZodCheckOverwrite=_.$constructor("$ZodCheckOverwrite",(s,u)=>{r.$ZodCheck.init(s,u),s._zod.check=v=>{v.value=u.tx(v.value)}})})(_r);var sa={};Object.defineProperty(sa,"__esModule",{value:!0});sa.Doc=void 0;class gI{constructor(m=[]){this.content=[],this.indent=0,this&&(this.args=m)}indented(m){this.indent+=1,m(this),this.indent-=1}write(m){if(typeof m=="function"){m(this,{execution:"sync"}),m(this,{execution:"async"});return}const E=m.split(`
|
|
32
|
+
`).filter(T=>T),_=Math.min(...E.map(T=>T.length-T.trimStart().length)),j=E.map(T=>T.slice(_)).map(T=>" ".repeat(this.indent*2)+T);for(const T of j)this.content.push(T)}compile(){const m=Function,C=this?.args,_=[...(this?.content??[""]).map(j=>` ${j}`)];return new m(...C,_.join(`
|
|
33
|
+
`))}}sa.Doc=gI;var la={};Object.defineProperty(la,"__esModule",{value:!0});la.version=void 0;la.version={major:4,minor:4,patch:3};(function(r){var m=Mr&&Mr.__createBinding||(Object.create?(function(k,O,I,U){U===void 0&&(U=I);var V=Object.getOwnPropertyDescriptor(O,I);(!V||("get"in V?!O.__esModule:V.writable||V.configurable))&&(V={enumerable:!0,get:function(){return O[I]}}),Object.defineProperty(k,U,V)}):(function(k,O,I,U){U===void 0&&(U=I),k[U]=O[I]})),C=Mr&&Mr.__setModuleDefault||(Object.create?(function(k,O){Object.defineProperty(k,"default",{enumerable:!0,value:O})}):function(k,O){k.default=O}),E=Mr&&Mr.__importStar||function(k){if(k&&k.__esModule)return k;var O={};if(k!=null)for(var I in k)I!=="default"&&Object.prototype.hasOwnProperty.call(k,I)&&m(O,k,I);return C(O,k),O};Object.defineProperty(r,"__esModule",{value:!0}),r.$ZodTuple=r.$ZodIntersection=r.$ZodDiscriminatedUnion=r.$ZodXor=r.$ZodUnion=r.$ZodObjectJIT=r.$ZodObject=r.$ZodArray=r.$ZodDate=r.$ZodVoid=r.$ZodNever=r.$ZodUnknown=r.$ZodAny=r.$ZodNull=r.$ZodUndefined=r.$ZodSymbol=r.$ZodBigIntFormat=r.$ZodBigInt=r.$ZodBoolean=r.$ZodNumberFormat=r.$ZodNumber=r.$ZodCustomStringFormat=r.$ZodJWT=r.$ZodE164=r.$ZodBase64URL=r.$ZodBase64=r.$ZodCIDRv6=r.$ZodCIDRv4=r.$ZodMAC=r.$ZodIPv6=r.$ZodIPv4=r.$ZodISODuration=r.$ZodISOTime=r.$ZodISODate=r.$ZodISODateTime=r.$ZodKSUID=r.$ZodXID=r.$ZodULID=r.$ZodCUID2=r.$ZodCUID=r.$ZodNanoID=r.$ZodEmoji=r.$ZodURL=r.$ZodEmail=r.$ZodUUID=r.$ZodGUID=r.$ZodStringFormat=r.$ZodString=r.clone=r.$ZodType=void 0,r.$ZodCustom=r.$ZodLazy=r.$ZodPromise=r.$ZodFunction=r.$ZodTemplateLiteral=r.$ZodReadonly=r.$ZodPreprocess=r.$ZodCodec=r.$ZodPipe=r.$ZodNaN=r.$ZodCatch=r.$ZodSuccess=r.$ZodNonOptional=r.$ZodPrefault=r.$ZodDefault=r.$ZodNullable=r.$ZodExactOptional=r.$ZodOptional=r.$ZodTransform=r.$ZodFile=r.$ZodLiteral=r.$ZodEnum=r.$ZodSet=r.$ZodMap=r.$ZodRecord=void 0,r.isValidBase64=n,r.isValidBase64URL=t,r.isValidJWT=x;const _=E(_r),j=E(on),T=sa,F=Or,c=E(wr),s=E(le),u=la;r.$ZodType=j.$constructor("$ZodType",(k,O)=>{var I;k??(k={}),k._zod.def=O,k._zod.bag=k._zod.bag||{},k._zod.version=u.version;const U=[...k._zod.def.checks??[]];k._zod.traits.has("$ZodCheck")&&U.unshift(k);for(const V of U)for(const J of V._zod.onattach)J(k);if(U.length===0)(I=k._zod).deferred??(I.deferred=[]),k._zod.deferred?.push(()=>{k._zod.run=k._zod.parse});else{const V=(ae,be,K)=>{let q=s.aborted(ae),ce;for(const pe of be){if(pe._zod.def.when){if(s.explicitlyAborted(ae)||!pe._zod.def.when(ae))continue}else if(q)continue;const Y=ae.issues.length,fe=pe._zod.check(ae);if(fe instanceof Promise&&K?.async===!1)throw new j.$ZodAsyncError;if(ce||fe instanceof Promise)ce=(ce??Promise.resolve()).then(async()=>{await fe,ae.issues.length!==Y&&(q||(q=s.aborted(ae,Y)))});else{if(ae.issues.length===Y)continue;q||(q=s.aborted(ae,Y))}}return ce?ce.then(()=>ae):ae},J=(ae,be,K)=>{if(s.aborted(ae))return ae.aborted=!0,ae;const q=V(be,U,K);if(q instanceof Promise){if(K.async===!1)throw new j.$ZodAsyncError;return q.then(ce=>k._zod.parse(ce,K))}return k._zod.parse(q,K)};k._zod.run=(ae,be)=>{if(be.skipChecks)return k._zod.parse(ae,be);if(be.direction==="backward"){const q=k._zod.parse({value:ae.value,issues:[]},{...be,skipChecks:!0});return q instanceof Promise?q.then(ce=>J(ce,ae,be)):J(q,ae,be)}const K=k._zod.parse(ae,be);if(K instanceof Promise){if(be.async===!1)throw new j.$ZodAsyncError;return K.then(q=>V(q,U,be))}return V(K,U,be)}}s.defineLazy(k,"~standard",()=>({validate:V=>{try{const J=(0,F.safeParse)(k,V);return J.success?{value:J.data}:{issues:J.error?.issues}}catch{return(0,F.safeParseAsync)(k,V).then(ae=>ae.success?{value:ae.data}:{issues:ae.error?.issues})}},vendor:"zod",version:1}))});var v=le;Object.defineProperty(r,"clone",{enumerable:!0,get:function(){return v.clone}}),r.$ZodString=j.$constructor("$ZodString",(k,O)=>{r.$ZodType.init(k,O),k._zod.pattern=[...k?._zod.bag?.patterns??[]].pop()??c.string(k._zod.bag),k._zod.parse=(I,U)=>{if(O.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:k}),I}}),r.$ZodStringFormat=j.$constructor("$ZodStringFormat",(k,O)=>{_.$ZodCheckStringFormat.init(k,O),r.$ZodString.init(k,O)}),r.$ZodGUID=j.$constructor("$ZodGUID",(k,O)=>{O.pattern??(O.pattern=c.guid),r.$ZodStringFormat.init(k,O)}),r.$ZodUUID=j.$constructor("$ZodUUID",(k,O)=>{if(O.version){const U={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[O.version];if(U===void 0)throw new Error(`Invalid UUID version: "${O.version}"`);O.pattern??(O.pattern=c.uuid(U))}else O.pattern??(O.pattern=c.uuid());r.$ZodStringFormat.init(k,O)}),r.$ZodEmail=j.$constructor("$ZodEmail",(k,O)=>{O.pattern??(O.pattern=c.email),r.$ZodStringFormat.init(k,O)}),r.$ZodURL=j.$constructor("$ZodURL",(k,O)=>{r.$ZodStringFormat.init(k,O),k._zod.check=I=>{try{const U=I.value.trim();if(!O.normalize&&O.protocol?.source===c.httpProtocol.source&&!/^https?:\/\//i.test(U)){I.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:I.value,inst:k,continue:!O.abort});return}const V=new URL(U);O.hostname&&(O.hostname.lastIndex=0,O.hostname.test(V.hostname)||I.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:O.hostname.source,input:I.value,inst:k,continue:!O.abort})),O.protocol&&(O.protocol.lastIndex=0,O.protocol.test(V.protocol.endsWith(":")?V.protocol.slice(0,-1):V.protocol)||I.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:O.protocol.source,input:I.value,inst:k,continue:!O.abort})),O.normalize?I.value=V.href:I.value=U;return}catch{I.issues.push({code:"invalid_format",format:"url",input:I.value,inst:k,continue:!O.abort})}}}),r.$ZodEmoji=j.$constructor("$ZodEmoji",(k,O)=>{O.pattern??(O.pattern=c.emoji()),r.$ZodStringFormat.init(k,O)}),r.$ZodNanoID=j.$constructor("$ZodNanoID",(k,O)=>{O.pattern??(O.pattern=c.nanoid),r.$ZodStringFormat.init(k,O)}),r.$ZodCUID=j.$constructor("$ZodCUID",(k,O)=>{O.pattern??(O.pattern=c.cuid),r.$ZodStringFormat.init(k,O)}),r.$ZodCUID2=j.$constructor("$ZodCUID2",(k,O)=>{O.pattern??(O.pattern=c.cuid2),r.$ZodStringFormat.init(k,O)}),r.$ZodULID=j.$constructor("$ZodULID",(k,O)=>{O.pattern??(O.pattern=c.ulid),r.$ZodStringFormat.init(k,O)}),r.$ZodXID=j.$constructor("$ZodXID",(k,O)=>{O.pattern??(O.pattern=c.xid),r.$ZodStringFormat.init(k,O)}),r.$ZodKSUID=j.$constructor("$ZodKSUID",(k,O)=>{O.pattern??(O.pattern=c.ksuid),r.$ZodStringFormat.init(k,O)}),r.$ZodISODateTime=j.$constructor("$ZodISODateTime",(k,O)=>{O.pattern??(O.pattern=c.datetime(O)),r.$ZodStringFormat.init(k,O)}),r.$ZodISODate=j.$constructor("$ZodISODate",(k,O)=>{O.pattern??(O.pattern=c.date),r.$ZodStringFormat.init(k,O)}),r.$ZodISOTime=j.$constructor("$ZodISOTime",(k,O)=>{O.pattern??(O.pattern=c.time(O)),r.$ZodStringFormat.init(k,O)}),r.$ZodISODuration=j.$constructor("$ZodISODuration",(k,O)=>{O.pattern??(O.pattern=c.duration),r.$ZodStringFormat.init(k,O)}),r.$ZodIPv4=j.$constructor("$ZodIPv4",(k,O)=>{O.pattern??(O.pattern=c.ipv4),r.$ZodStringFormat.init(k,O),k._zod.bag.format="ipv4"}),r.$ZodIPv6=j.$constructor("$ZodIPv6",(k,O)=>{O.pattern??(O.pattern=c.ipv6),r.$ZodStringFormat.init(k,O),k._zod.bag.format="ipv6",k._zod.check=I=>{try{new URL(`http://[${I.value}]`)}catch{I.issues.push({code:"invalid_format",format:"ipv6",input:I.value,inst:k,continue:!O.abort})}}}),r.$ZodMAC=j.$constructor("$ZodMAC",(k,O)=>{O.pattern??(O.pattern=c.mac(O.delimiter)),r.$ZodStringFormat.init(k,O),k._zod.bag.format="mac"}),r.$ZodCIDRv4=j.$constructor("$ZodCIDRv4",(k,O)=>{O.pattern??(O.pattern=c.cidrv4),r.$ZodStringFormat.init(k,O)}),r.$ZodCIDRv6=j.$constructor("$ZodCIDRv6",(k,O)=>{O.pattern??(O.pattern=c.cidrv6),r.$ZodStringFormat.init(k,O),k._zod.check=I=>{const U=I.value.split("/");try{if(U.length!==2)throw new Error;const[V,J]=U;if(!J)throw new Error;const ae=Number(J);if(`${ae}`!==J)throw new Error;if(ae<0||ae>128)throw new Error;new URL(`http://[${V}]`)}catch{I.issues.push({code:"invalid_format",format:"cidrv6",input:I.value,inst:k,continue:!O.abort})}}});function n(k){if(k==="")return!0;if(/\s/.test(k)||k.length%4!==0)return!1;try{return atob(k),!0}catch{return!1}}r.$ZodBase64=j.$constructor("$ZodBase64",(k,O)=>{O.pattern??(O.pattern=c.base64),r.$ZodStringFormat.init(k,O),k._zod.bag.contentEncoding="base64",k._zod.check=I=>{n(I.value)||I.issues.push({code:"invalid_format",format:"base64",input:I.value,inst:k,continue:!O.abort})}});function t(k){if(!c.base64url.test(k))return!1;const O=k.replace(/[-_]/g,U=>U==="-"?"+":"/"),I=O.padEnd(Math.ceil(O.length/4)*4,"=");return n(I)}r.$ZodBase64URL=j.$constructor("$ZodBase64URL",(k,O)=>{O.pattern??(O.pattern=c.base64url),r.$ZodStringFormat.init(k,O),k._zod.bag.contentEncoding="base64url",k._zod.check=I=>{t(I.value)||I.issues.push({code:"invalid_format",format:"base64url",input:I.value,inst:k,continue:!O.abort})}}),r.$ZodE164=j.$constructor("$ZodE164",(k,O)=>{O.pattern??(O.pattern=c.e164),r.$ZodStringFormat.init(k,O)});function x(k,O=null){try{const I=k.split(".");if(I.length!==3)return!1;const[U]=I;if(!U)return!1;const V=JSON.parse(atob(U));return!("typ"in V&&V?.typ!=="JWT"||!V.alg||O&&(!("alg"in V)||V.alg!==O))}catch{return!1}}r.$ZodJWT=j.$constructor("$ZodJWT",(k,O)=>{r.$ZodStringFormat.init(k,O),k._zod.check=I=>{x(I.value,O.alg)||I.issues.push({code:"invalid_format",format:"jwt",input:I.value,inst:k,continue:!O.abort})}}),r.$ZodCustomStringFormat=j.$constructor("$ZodCustomStringFormat",(k,O)=>{r.$ZodStringFormat.init(k,O),k._zod.check=I=>{O.fn(I.value)||I.issues.push({code:"invalid_format",format:O.format,input:I.value,inst:k,continue:!O.abort})}}),r.$ZodNumber=j.$constructor("$ZodNumber",(k,O)=>{r.$ZodType.init(k,O),k._zod.pattern=k._zod.bag.pattern??c.number,k._zod.parse=(I,U)=>{if(O.coerce)try{I.value=Number(I.value)}catch{}const V=I.value;if(typeof V=="number"&&!Number.isNaN(V)&&Number.isFinite(V))return I;const J=typeof V=="number"?Number.isNaN(V)?"NaN":Number.isFinite(V)?void 0:"Infinity":void 0;return I.issues.push({expected:"number",code:"invalid_type",input:V,inst:k,...J?{received:J}:{}}),I}}),r.$ZodNumberFormat=j.$constructor("$ZodNumberFormat",(k,O)=>{_.$ZodCheckNumberFormat.init(k,O),r.$ZodNumber.init(k,O)}),r.$ZodBoolean=j.$constructor("$ZodBoolean",(k,O)=>{r.$ZodType.init(k,O),k._zod.pattern=c.boolean,k._zod.parse=(I,U)=>{if(O.coerce)try{I.value=!!I.value}catch{}const V=I.value;return typeof V=="boolean"||I.issues.push({expected:"boolean",code:"invalid_type",input:V,inst:k}),I}}),r.$ZodBigInt=j.$constructor("$ZodBigInt",(k,O)=>{r.$ZodType.init(k,O),k._zod.pattern=c.bigint,k._zod.parse=(I,U)=>{if(O.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:k}),I}}),r.$ZodBigIntFormat=j.$constructor("$ZodBigIntFormat",(k,O)=>{_.$ZodCheckBigIntFormat.init(k,O),r.$ZodBigInt.init(k,O)}),r.$ZodSymbol=j.$constructor("$ZodSymbol",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>{const V=I.value;return typeof V=="symbol"||I.issues.push({expected:"symbol",code:"invalid_type",input:V,inst:k}),I}}),r.$ZodUndefined=j.$constructor("$ZodUndefined",(k,O)=>{r.$ZodType.init(k,O),k._zod.pattern=c.undefined,k._zod.values=new Set([void 0]),k._zod.parse=(I,U)=>{const V=I.value;return typeof V>"u"||I.issues.push({expected:"undefined",code:"invalid_type",input:V,inst:k}),I}}),r.$ZodNull=j.$constructor("$ZodNull",(k,O)=>{r.$ZodType.init(k,O),k._zod.pattern=c.null,k._zod.values=new Set([null]),k._zod.parse=(I,U)=>{const V=I.value;return V===null||I.issues.push({expected:"null",code:"invalid_type",input:V,inst:k}),I}}),r.$ZodAny=j.$constructor("$ZodAny",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=I=>I}),r.$ZodUnknown=j.$constructor("$ZodUnknown",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=I=>I}),r.$ZodNever=j.$constructor("$ZodNever",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>(I.issues.push({expected:"never",code:"invalid_type",input:I.value,inst:k}),I)}),r.$ZodVoid=j.$constructor("$ZodVoid",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>{const V=I.value;return typeof V>"u"||I.issues.push({expected:"void",code:"invalid_type",input:V,inst:k}),I}}),r.$ZodDate=j.$constructor("$ZodDate",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>{if(O.coerce)try{I.value=new Date(I.value)}catch{}const V=I.value,J=V instanceof Date;return J&&!Number.isNaN(V.getTime())||I.issues.push({expected:"date",code:"invalid_type",input:V,...J?{received:"Invalid Date"}:{},inst:k}),I}});function A(k,O,I){k.issues.length&&O.issues.push(...s.prefixIssues(I,k.issues)),O.value[I]=k.value}r.$ZodArray=j.$constructor("$ZodArray",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>{const V=I.value;if(!Array.isArray(V))return I.issues.push({expected:"array",code:"invalid_type",input:V,inst:k}),I;I.value=Array(V.length);const J=[];for(let ae=0;ae<V.length;ae++){const be=V[ae],K=O.element._zod.run({value:be,issues:[]},U);K instanceof Promise?J.push(K.then(q=>A(q,I,ae))):A(K,I,ae)}return J.length?Promise.all(J).then(()=>I):I}});function te(k,O,I,U,V,J){const ae=I in U;if(k.issues.length){if(V&&J&&!ae)return;O.issues.push(...s.prefixIssues(I,k.issues))}if(!ae&&!V){k.issues.length||O.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[I]});return}k.value===void 0?ae&&(O.value[I]=void 0):O.value[I]=k.value}function ee(k){const O=Object.keys(k.shape);for(const U of O)if(!k.shape?.[U]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${U}": expected a Zod schema`);const I=s.optionalKeys(k.shape);return{...k,keys:O,keySet:new Set(O),numKeys:O.length,optionalKeys:new Set(I)}}function oe(k,O,I,U,V,J){const ae=[],be=V.keySet,K=V.catchall._zod,q=K.def.type,ce=K.optin==="optional",pe=K.optout==="optional";for(const Y in O){if(Y==="__proto__"||be.has(Y))continue;if(q==="never"){ae.push(Y);continue}const fe=K.run({value:O[Y],issues:[]},U);fe instanceof Promise?k.push(fe.then(Ie=>te(Ie,I,Y,O,ce,pe))):te(fe,I,Y,O,ce,pe)}return ae.length&&I.issues.push({code:"unrecognized_keys",keys:ae,input:O,inst:J}),k.length?Promise.all(k).then(()=>I):I}r.$ZodObject=j.$constructor("$ZodObject",(k,O)=>{if(r.$ZodType.init(k,O),!Object.getOwnPropertyDescriptor(O,"shape")?.get){const be=O.shape;Object.defineProperty(O,"shape",{get:()=>{const K={...be};return Object.defineProperty(O,"shape",{value:K}),K}})}const U=s.cached(()=>ee(O));s.defineLazy(k._zod,"propValues",()=>{const be=O.shape,K={};for(const q in be){const ce=be[q]._zod;if(ce.values){K[q]??(K[q]=new Set);for(const pe of ce.values)K[q].add(pe)}}return K});const V=s.isObject,J=O.catchall;let ae;k._zod.parse=(be,K)=>{ae??(ae=U.value);const q=be.value;if(!V(q))return be.issues.push({expected:"object",code:"invalid_type",input:q,inst:k}),be;be.value={};const ce=[],pe=ae.shape;for(const Y of ae.keys){const fe=pe[Y],Ie=fe._zod.optin==="optional",at=fe._zod.optout==="optional",Xe=fe._zod.run({value:q[Y],issues:[]},K);Xe instanceof Promise?ce.push(Xe.then(tt=>te(tt,be,Y,q,Ie,at))):te(Xe,be,Y,q,Ie,at)}return J?oe(ce,q,be,K,U.value,k):ce.length?Promise.all(ce).then(()=>be):be}}),r.$ZodObjectJIT=j.$constructor("$ZodObjectJIT",(k,O)=>{r.$ZodObject.init(k,O);const I=k._zod.parse,U=s.cached(()=>ee(O)),V=Y=>{const fe=new T.Doc(["shape","payload","ctx"]),Ie=U.value,at=gt=>{const ct=s.esc(gt);return`shape[${ct}]._zod.run({ value: input[${ct}], issues: [] }, ctx)`};fe.write("const input = payload.value;");const Xe=Object.create(null);let tt=0;for(const gt of Ie.keys)Xe[gt]=`key_${tt++}`;fe.write("const newResult = {};");for(const gt of Ie.keys){const ct=Xe[gt],mt=s.esc(gt),vt=Y[gt],qr=vt?._zod?.optin==="optional",Sr=vt?._zod?.optout==="optional";fe.write(`const ${ct} = ${at(gt)};`),qr&&Sr?fe.write(`
|
|
34
|
+
if (${ct}.issues.length) {
|
|
35
|
+
if (${mt} in input) {
|
|
36
|
+
payload.issues = payload.issues.concat(${ct}.issues.map(iss => ({
|
|
37
|
+
...iss,
|
|
38
|
+
path: iss.path ? [${mt}, ...iss.path] : [${mt}]
|
|
39
|
+
})));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (${ct}.value === undefined) {
|
|
44
|
+
if (${mt} in input) {
|
|
45
|
+
newResult[${mt}] = undefined;
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
newResult[${mt}] = ${ct}.value;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
`):qr?fe.write(`
|
|
52
|
+
if (${ct}.issues.length) {
|
|
53
|
+
payload.issues = payload.issues.concat(${ct}.issues.map(iss => ({
|
|
54
|
+
...iss,
|
|
55
|
+
path: iss.path ? [${mt}, ...iss.path] : [${mt}]
|
|
56
|
+
})));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (${ct}.value === undefined) {
|
|
60
|
+
if (${mt} in input) {
|
|
61
|
+
newResult[${mt}] = undefined;
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
newResult[${mt}] = ${ct}.value;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
`):fe.write(`
|
|
68
|
+
const ${ct}_present = ${mt} in input;
|
|
69
|
+
if (${ct}.issues.length) {
|
|
70
|
+
payload.issues = payload.issues.concat(${ct}.issues.map(iss => ({
|
|
71
|
+
...iss,
|
|
72
|
+
path: iss.path ? [${mt}, ...iss.path] : [${mt}]
|
|
73
|
+
})));
|
|
74
|
+
}
|
|
75
|
+
if (!${ct}_present && !${ct}.issues.length) {
|
|
76
|
+
payload.issues.push({
|
|
77
|
+
code: "invalid_type",
|
|
78
|
+
expected: "nonoptional",
|
|
79
|
+
input: undefined,
|
|
80
|
+
path: [${mt}]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (${ct}_present) {
|
|
85
|
+
if (${ct}.value === undefined) {
|
|
86
|
+
newResult[${mt}] = undefined;
|
|
87
|
+
} else {
|
|
88
|
+
newResult[${mt}] = ${ct}.value;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
`)}fe.write("payload.value = newResult;"),fe.write("return payload;");const ot=fe.compile();return(gt,ct)=>ot(Y,gt,ct)};let J;const ae=s.isObject,be=!j.globalConfig.jitless,K=s.allowsEval,q=be&&K.value,ce=O.catchall;let pe;k._zod.parse=(Y,fe)=>{pe??(pe=U.value);const Ie=Y.value;return ae(Ie)?be&&q&&fe?.async===!1&&fe.jitless!==!0?(J||(J=V(O.shape)),Y=J(Y,fe),ce?oe([],Ie,Y,fe,pe,k):Y):I(Y,fe):(Y.issues.push({expected:"object",code:"invalid_type",input:Ie,inst:k}),Y)}});function ie(k,O,I,U){for(const J of k)if(J.issues.length===0)return O.value=J.value,O;const V=k.filter(J=>!s.aborted(J));return V.length===1?(O.value=V[0].value,V[0]):(O.issues.push({code:"invalid_union",input:O.value,inst:I,errors:k.map(J=>J.issues.map(ae=>s.finalizeIssue(ae,U,j.config())))}),O)}r.$ZodUnion=j.$constructor("$ZodUnion",(k,O)=>{r.$ZodType.init(k,O),s.defineLazy(k._zod,"optin",()=>O.options.some(U=>U._zod.optin==="optional")?"optional":void 0),s.defineLazy(k._zod,"optout",()=>O.options.some(U=>U._zod.optout==="optional")?"optional":void 0),s.defineLazy(k._zod,"values",()=>{if(O.options.every(U=>U._zod.values))return new Set(O.options.flatMap(U=>Array.from(U._zod.values)))}),s.defineLazy(k._zod,"pattern",()=>{if(O.options.every(U=>U._zod.pattern)){const U=O.options.map(V=>V._zod.pattern);return new RegExp(`^(${U.map(V=>s.cleanRegex(V.source)).join("|")})$`)}});const I=O.options.length===1?O.options[0]._zod.run:null;k._zod.parse=(U,V)=>{if(I)return I(U,V);let J=!1;const ae=[];for(const be of O.options){const K=be._zod.run({value:U.value,issues:[]},V);if(K instanceof Promise)ae.push(K),J=!0;else{if(K.issues.length===0)return K;ae.push(K)}}return J?Promise.all(ae).then(be=>ie(be,U,k,V)):ie(ae,U,k,V)}});function ke(k,O,I,U){const V=k.filter(J=>J.issues.length===0);return V.length===1?(O.value=V[0].value,O):(V.length===0?O.issues.push({code:"invalid_union",input:O.value,inst:I,errors:k.map(J=>J.issues.map(ae=>s.finalizeIssue(ae,U,j.config())))}):O.issues.push({code:"invalid_union",input:O.value,inst:I,errors:[],inclusive:!1}),O)}r.$ZodXor=j.$constructor("$ZodXor",(k,O)=>{r.$ZodUnion.init(k,O),O.inclusive=!1;const I=O.options.length===1?O.options[0]._zod.run:null;k._zod.parse=(U,V)=>{if(I)return I(U,V);let J=!1;const ae=[];for(const be of O.options){const K=be._zod.run({value:U.value,issues:[]},V);K instanceof Promise?(ae.push(K),J=!0):ae.push(K)}return J?Promise.all(ae).then(be=>ke(be,U,k,V)):ke(ae,U,k,V)}}),r.$ZodDiscriminatedUnion=j.$constructor("$ZodDiscriminatedUnion",(k,O)=>{O.inclusive=!1,r.$ZodUnion.init(k,O);const I=k._zod.parse;s.defineLazy(k._zod,"propValues",()=>{const V={};for(const J of O.options){const ae=J._zod.propValues;if(!ae||Object.keys(ae).length===0)throw new Error(`Invalid discriminated union option at index "${O.options.indexOf(J)}"`);for(const[be,K]of Object.entries(ae)){V[be]||(V[be]=new Set);for(const q of K)V[be].add(q)}}return V});const U=s.cached(()=>{const V=O.options,J=new Map;for(const ae of V){const be=ae._zod.propValues?.[O.discriminator];if(!be||be.size===0)throw new Error(`Invalid discriminated union option at index "${O.options.indexOf(ae)}"`);for(const K of be){if(J.has(K))throw new Error(`Duplicate discriminator value "${String(K)}"`);J.set(K,ae)}}return J});k._zod.parse=(V,J)=>{const ae=V.value;if(!s.isObject(ae))return V.issues.push({code:"invalid_type",expected:"object",input:ae,inst:k}),V;const be=U.value.get(ae?.[O.discriminator]);return be?be._zod.run(V,J):O.unionFallback||J.direction==="backward"?I(V,J):(V.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:O.discriminator,options:Array.from(U.value.keys()),input:ae,path:[O.discriminator],inst:k}),V)}}),r.$ZodIntersection=j.$constructor("$ZodIntersection",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>{const V=I.value,J=O.left._zod.run({value:V,issues:[]},U),ae=O.right._zod.run({value:V,issues:[]},U);return J instanceof Promise||ae instanceof Promise?Promise.all([J,ae]).then(([K,q])=>Oe(I,K,q)):Oe(I,J,ae)}});function se(k,O){if(k===O)return{valid:!0,data:k};if(k instanceof Date&&O instanceof Date&&+k==+O)return{valid:!0,data:k};if(s.isPlainObject(k)&&s.isPlainObject(O)){const I=Object.keys(O),U=Object.keys(k).filter(J=>I.indexOf(J)!==-1),V={...k,...O};for(const J of U){const ae=se(k[J],O[J]);if(!ae.valid)return{valid:!1,mergeErrorPath:[J,...ae.mergeErrorPath]};V[J]=ae.data}return{valid:!0,data:V}}if(Array.isArray(k)&&Array.isArray(O)){if(k.length!==O.length)return{valid:!1,mergeErrorPath:[]};const I=[];for(let U=0;U<k.length;U++){const V=k[U],J=O[U],ae=se(V,J);if(!ae.valid)return{valid:!1,mergeErrorPath:[U,...ae.mergeErrorPath]};I.push(ae.data)}return{valid:!0,data:I}}return{valid:!1,mergeErrorPath:[]}}function Oe(k,O,I){const U=new Map;let V;for(const be of O.issues)if(be.code==="unrecognized_keys"){V??(V=be);for(const K of be.keys)U.has(K)||U.set(K,{}),U.get(K).l=!0}else k.issues.push(be);for(const be of I.issues)if(be.code==="unrecognized_keys")for(const K of be.keys)U.has(K)||U.set(K,{}),U.get(K).r=!0;else k.issues.push(be);const J=[...U].filter(([,be])=>be.l&&be.r).map(([be])=>be);if(J.length&&V&&k.issues.push({...V,keys:J}),s.aborted(k))return k;const ae=se(O.value,I.value);if(!ae.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(ae.mergeErrorPath)}`);return k.value=ae.data,k}r.$ZodTuple=j.$constructor("$ZodTuple",(k,O)=>{r.$ZodType.init(k,O);const I=O.items;k._zod.parse=(U,V)=>{const J=U.value;if(!Array.isArray(J))return U.issues.push({input:J,inst:k,expected:"tuple",code:"invalid_type"}),U;U.value=[];const ae=[],be=Se(I,"optin"),K=Se(I,"optout");if(!O.rest){if(J.length<be)return U.issues.push({code:"too_small",minimum:be,inclusive:!0,input:J,inst:k,origin:"array"}),U;J.length>I.length&&U.issues.push({code:"too_big",maximum:I.length,inclusive:!0,input:J,inst:k,origin:"array"})}const q=new Array(I.length);for(let ce=0;ce<I.length;ce++){const pe=I[ce]._zod.run({value:J[ce],issues:[]},V);pe instanceof Promise?ae.push(pe.then(Y=>{q[ce]=Y})):q[ce]=pe}if(O.rest){let ce=I.length-1;const pe=J.slice(I.length);for(const Y of pe){ce++;const fe=O.rest._zod.run({value:Y,issues:[]},V);fe instanceof Promise?ae.push(fe.then(Ie=>He(Ie,U,ce))):He(fe,U,ce)}}return ae.length?Promise.all(ae).then(()=>Ge(q,U,I,J,K)):Ge(q,U,I,J,K)}});function Se(k,O){for(let I=k.length-1;I>=0;I--)if(k[I]._zod[O]!=="optional")return I+1;return 0}function He(k,O,I){k.issues.length&&O.issues.push(...s.prefixIssues(I,k.issues)),O.value[I]=k.value}function Ge(k,O,I,U,V){for(let J=0;J<I.length;J++){const ae=k[J],be=J<U.length;if(ae.issues.length){if(!be&&J>=V){O.value.length=J;break}O.issues.push(...s.prefixIssues(J,ae.issues))}O.value[J]=ae.value}for(let J=O.value.length-1;J>=U.length&&(I[J]._zod.optout==="optional"&&O.value[J]===void 0);J--)O.value.length=J;return O}r.$ZodRecord=j.$constructor("$ZodRecord",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>{const V=I.value;if(!s.isPlainObject(V))return I.issues.push({expected:"record",code:"invalid_type",input:V,inst:k}),I;const J=[],ae=O.keyType._zod.values;if(ae){I.value={};const be=new Set;for(const q of ae)if(typeof q=="string"||typeof q=="number"||typeof q=="symbol"){be.add(typeof q=="number"?q.toString():q);const ce=O.keyType._zod.run({value:q,issues:[]},U);if(ce instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(ce.issues.length){I.issues.push({code:"invalid_key",origin:"record",issues:ce.issues.map(fe=>s.finalizeIssue(fe,U,j.config())),input:q,path:[q],inst:k});continue}const pe=ce.value,Y=O.valueType._zod.run({value:V[q],issues:[]},U);Y instanceof Promise?J.push(Y.then(fe=>{fe.issues.length&&I.issues.push(...s.prefixIssues(q,fe.issues)),I.value[pe]=fe.value})):(Y.issues.length&&I.issues.push(...s.prefixIssues(q,Y.issues)),I.value[pe]=Y.value)}let K;for(const q in V)be.has(q)||(K=K??[],K.push(q));K&&K.length>0&&I.issues.push({code:"unrecognized_keys",input:V,inst:k,keys:K})}else{I.value={};for(const be of Reflect.ownKeys(V)){if(be==="__proto__"||!Object.prototype.propertyIsEnumerable.call(V,be))continue;let K=O.keyType._zod.run({value:be,issues:[]},U);if(K instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof be=="string"&&c.number.test(be)&&K.issues.length){const pe=O.keyType._zod.run({value:Number(be),issues:[]},U);if(pe instanceof Promise)throw new Error("Async schemas not supported in object keys currently");pe.issues.length===0&&(K=pe)}if(K.issues.length){O.mode==="loose"?I.value[be]=V[be]:I.issues.push({code:"invalid_key",origin:"record",issues:K.issues.map(pe=>s.finalizeIssue(pe,U,j.config())),input:be,path:[be],inst:k});continue}const ce=O.valueType._zod.run({value:V[be],issues:[]},U);ce instanceof Promise?J.push(ce.then(pe=>{pe.issues.length&&I.issues.push(...s.prefixIssues(be,pe.issues)),I.value[K.value]=pe.value})):(ce.issues.length&&I.issues.push(...s.prefixIssues(be,ce.issues)),I.value[K.value]=ce.value)}}return J.length?Promise.all(J).then(()=>I):I}}),r.$ZodMap=j.$constructor("$ZodMap",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>{const V=I.value;if(!(V instanceof Map))return I.issues.push({expected:"map",code:"invalid_type",input:V,inst:k}),I;const J=[];I.value=new Map;for(const[ae,be]of V){const K=O.keyType._zod.run({value:ae,issues:[]},U),q=O.valueType._zod.run({value:be,issues:[]},U);K instanceof Promise||q instanceof Promise?J.push(Promise.all([K,q]).then(([ce,pe])=>{it(ce,pe,I,ae,V,k,U)})):it(K,q,I,ae,V,k,U)}return J.length?Promise.all(J).then(()=>I):I}});function it(k,O,I,U,V,J,ae){k.issues.length&&(s.propertyKeyTypes.has(typeof U)?I.issues.push(...s.prefixIssues(U,k.issues)):I.issues.push({code:"invalid_key",origin:"map",input:V,inst:J,issues:k.issues.map(be=>s.finalizeIssue(be,ae,j.config()))})),O.issues.length&&(s.propertyKeyTypes.has(typeof U)?I.issues.push(...s.prefixIssues(U,O.issues)):I.issues.push({origin:"map",code:"invalid_element",input:V,inst:J,key:U,issues:O.issues.map(be=>s.finalizeIssue(be,ae,j.config()))})),I.value.set(k.value,O.value)}r.$ZodSet=j.$constructor("$ZodSet",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>{const V=I.value;if(!(V instanceof Set))return I.issues.push({input:V,inst:k,expected:"set",code:"invalid_type"}),I;const J=[];I.value=new Set;for(const ae of V){const be=O.valueType._zod.run({value:ae,issues:[]},U);be instanceof Promise?J.push(be.then(K=>ht(K,I))):ht(be,I)}return J.length?Promise.all(J).then(()=>I):I}});function ht(k,O){k.issues.length&&O.issues.push(...k.issues),O.value.add(k.value)}r.$ZodEnum=j.$constructor("$ZodEnum",(k,O)=>{r.$ZodType.init(k,O);const I=s.getEnumValues(O.entries),U=new Set(I);k._zod.values=U,k._zod.pattern=new RegExp(`^(${I.filter(V=>s.propertyKeyTypes.has(typeof V)).map(V=>typeof V=="string"?s.escapeRegex(V):V.toString()).join("|")})$`),k._zod.parse=(V,J)=>{const ae=V.value;return U.has(ae)||V.issues.push({code:"invalid_value",values:I,input:ae,inst:k}),V}}),r.$ZodLiteral=j.$constructor("$ZodLiteral",(k,O)=>{if(r.$ZodType.init(k,O),O.values.length===0)throw new Error("Cannot create literal schema with no valid values");const I=new Set(O.values);k._zod.values=I,k._zod.pattern=new RegExp(`^(${O.values.map(U=>typeof U=="string"?s.escapeRegex(U):U?s.escapeRegex(U.toString()):String(U)).join("|")})$`),k._zod.parse=(U,V)=>{const J=U.value;return I.has(J)||U.issues.push({code:"invalid_value",values:O.values,input:J,inst:k}),U}}),r.$ZodFile=j.$constructor("$ZodFile",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>{const V=I.value;return V instanceof File||I.issues.push({expected:"file",code:"invalid_type",input:V,inst:k}),I}}),r.$ZodTransform=j.$constructor("$ZodTransform",(k,O)=>{r.$ZodType.init(k,O),k._zod.optin="optional",k._zod.parse=(I,U)=>{if(U.direction==="backward")throw new j.$ZodEncodeError(k.constructor.name);const V=O.transform(I.value,I);if(U.async)return(V instanceof Promise?V:Promise.resolve(V)).then(ae=>(I.value=ae,I.fallback=!0,I));if(V instanceof Promise)throw new j.$ZodAsyncError;return I.value=V,I.fallback=!0,I}});function kt(k,O){return O===void 0&&(k.issues.length||k.fallback)?{issues:[],value:void 0}:k}r.$ZodOptional=j.$constructor("$ZodOptional",(k,O)=>{r.$ZodType.init(k,O),k._zod.optin="optional",k._zod.optout="optional",s.defineLazy(k._zod,"values",()=>O.innerType._zod.values?new Set([...O.innerType._zod.values,void 0]):void 0),s.defineLazy(k._zod,"pattern",()=>{const I=O.innerType._zod.pattern;return I?new RegExp(`^(${s.cleanRegex(I.source)})?$`):void 0}),k._zod.parse=(I,U)=>{if(O.innerType._zod.optin==="optional"){const V=I.value,J=O.innerType._zod.run(I,U);return J instanceof Promise?J.then(ae=>kt(ae,V)):kt(J,V)}return I.value===void 0?I:O.innerType._zod.run(I,U)}}),r.$ZodExactOptional=j.$constructor("$ZodExactOptional",(k,O)=>{r.$ZodOptional.init(k,O),s.defineLazy(k._zod,"values",()=>O.innerType._zod.values),s.defineLazy(k._zod,"pattern",()=>O.innerType._zod.pattern),k._zod.parse=(I,U)=>O.innerType._zod.run(I,U)}),r.$ZodNullable=j.$constructor("$ZodNullable",(k,O)=>{r.$ZodType.init(k,O),s.defineLazy(k._zod,"optin",()=>O.innerType._zod.optin),s.defineLazy(k._zod,"optout",()=>O.innerType._zod.optout),s.defineLazy(k._zod,"pattern",()=>{const I=O.innerType._zod.pattern;return I?new RegExp(`^(${s.cleanRegex(I.source)}|null)$`):void 0}),s.defineLazy(k._zod,"values",()=>O.innerType._zod.values?new Set([...O.innerType._zod.values,null]):void 0),k._zod.parse=(I,U)=>I.value===null?I:O.innerType._zod.run(I,U)}),r.$ZodDefault=j.$constructor("$ZodDefault",(k,O)=>{r.$ZodType.init(k,O),k._zod.optin="optional",s.defineLazy(k._zod,"values",()=>O.innerType._zod.values),k._zod.parse=(I,U)=>{if(U.direction==="backward")return O.innerType._zod.run(I,U);if(I.value===void 0)return I.value=O.defaultValue,I;const V=O.innerType._zod.run(I,U);return V instanceof Promise?V.then(J=>Et(J,O)):Et(V,O)}});function Et(k,O){return k.value===void 0&&(k.value=O.defaultValue),k}r.$ZodPrefault=j.$constructor("$ZodPrefault",(k,O)=>{r.$ZodType.init(k,O),k._zod.optin="optional",s.defineLazy(k._zod,"values",()=>O.innerType._zod.values),k._zod.parse=(I,U)=>(U.direction==="backward"||I.value===void 0&&(I.value=O.defaultValue),O.innerType._zod.run(I,U))}),r.$ZodNonOptional=j.$constructor("$ZodNonOptional",(k,O)=>{r.$ZodType.init(k,O),s.defineLazy(k._zod,"values",()=>{const I=O.innerType._zod.values;return I?new Set([...I].filter(U=>U!==void 0)):void 0}),k._zod.parse=(I,U)=>{const V=O.innerType._zod.run(I,U);return V instanceof Promise?V.then(J=>It(J,k)):It(V,k)}});function It(k,O){return!k.issues.length&&k.value===void 0&&k.issues.push({code:"invalid_type",expected:"nonoptional",input:k.value,inst:O}),k}r.$ZodSuccess=j.$constructor("$ZodSuccess",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>{if(U.direction==="backward")throw new j.$ZodEncodeError("ZodSuccess");const V=O.innerType._zod.run(I,U);return V instanceof Promise?V.then(J=>(I.value=J.issues.length===0,I)):(I.value=V.issues.length===0,I)}}),r.$ZodCatch=j.$constructor("$ZodCatch",(k,O)=>{r.$ZodType.init(k,O),k._zod.optin="optional",s.defineLazy(k._zod,"optout",()=>O.innerType._zod.optout),s.defineLazy(k._zod,"values",()=>O.innerType._zod.values),k._zod.parse=(I,U)=>{if(U.direction==="backward")return O.innerType._zod.run(I,U);const V=O.innerType._zod.run(I,U);return V instanceof Promise?V.then(J=>(I.value=J.value,J.issues.length&&(I.value=O.catchValue({...I,error:{issues:J.issues.map(ae=>s.finalizeIssue(ae,U,j.config()))},input:I.value}),I.issues=[],I.fallback=!0),I)):(I.value=V.value,V.issues.length&&(I.value=O.catchValue({...I,error:{issues:V.issues.map(J=>s.finalizeIssue(J,U,j.config()))},input:I.value}),I.issues=[],I.fallback=!0),I)}}),r.$ZodNaN=j.$constructor("$ZodNaN",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>((typeof I.value!="number"||!Number.isNaN(I.value))&&I.issues.push({input:I.value,inst:k,expected:"nan",code:"invalid_type"}),I)}),r.$ZodPipe=j.$constructor("$ZodPipe",(k,O)=>{r.$ZodType.init(k,O),s.defineLazy(k._zod,"values",()=>O.in._zod.values),s.defineLazy(k._zod,"optin",()=>O.in._zod.optin),s.defineLazy(k._zod,"optout",()=>O.out._zod.optout),s.defineLazy(k._zod,"propValues",()=>O.in._zod.propValues),k._zod.parse=(I,U)=>{if(U.direction==="backward"){const J=O.out._zod.run(I,U);return J instanceof Promise?J.then(ae=>At(ae,O.in,U)):At(J,O.in,U)}const V=O.in._zod.run(I,U);return V instanceof Promise?V.then(J=>At(J,O.out,U)):At(V,O.out,U)}});function At(k,O,I){return k.issues.length?(k.aborted=!0,k):O._zod.run({value:k.value,issues:k.issues,fallback:k.fallback},I)}r.$ZodCodec=j.$constructor("$ZodCodec",(k,O)=>{r.$ZodType.init(k,O),s.defineLazy(k._zod,"values",()=>O.in._zod.values),s.defineLazy(k._zod,"optin",()=>O.in._zod.optin),s.defineLazy(k._zod,"optout",()=>O.out._zod.optout),s.defineLazy(k._zod,"propValues",()=>O.in._zod.propValues),k._zod.parse=(I,U)=>{if((U.direction||"forward")==="forward"){const J=O.in._zod.run(I,U);return J instanceof Promise?J.then(ae=>Lt(ae,O,U)):Lt(J,O,U)}else{const J=O.out._zod.run(I,U);return J instanceof Promise?J.then(ae=>Lt(ae,O,U)):Lt(J,O,U)}}});function Lt(k,O,I){if(k.issues.length)return k.aborted=!0,k;if((I.direction||"forward")==="forward"){const V=O.transform(k.value,k);return V instanceof Promise?V.then(J=>yt(k,J,O.out,I)):yt(k,V,O.out,I)}else{const V=O.reverseTransform(k.value,k);return V instanceof Promise?V.then(J=>yt(k,J,O.in,I)):yt(k,V,O.in,I)}}function yt(k,O,I,U){return k.issues.length?(k.aborted=!0,k):I._zod.run({value:O,issues:k.issues},U)}r.$ZodPreprocess=j.$constructor("$ZodPreprocess",(k,O)=>{r.$ZodPipe.init(k,O)}),r.$ZodReadonly=j.$constructor("$ZodReadonly",(k,O)=>{r.$ZodType.init(k,O),s.defineLazy(k._zod,"propValues",()=>O.innerType._zod.propValues),s.defineLazy(k._zod,"values",()=>O.innerType._zod.values),s.defineLazy(k._zod,"optin",()=>O.innerType?._zod?.optin),s.defineLazy(k._zod,"optout",()=>O.innerType?._zod?.optout),k._zod.parse=(I,U)=>{if(U.direction==="backward")return O.innerType._zod.run(I,U);const V=O.innerType._zod.run(I,U);return V instanceof Promise?V.then(Ft):Ft(V)}});function Ft(k){return k.value=Object.freeze(k.value),k}r.$ZodTemplateLiteral=j.$constructor("$ZodTemplateLiteral",(k,O)=>{r.$ZodType.init(k,O);const I=[];for(const U of O.parts)if(typeof U=="object"&&U!==null){if(!U._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...U._zod.traits].shift()}`);const V=U._zod.pattern instanceof RegExp?U._zod.pattern.source:U._zod.pattern;if(!V)throw new Error(`Invalid template literal part: ${U._zod.traits}`);const J=V.startsWith("^")?1:0,ae=V.endsWith("$")?V.length-1:V.length;I.push(V.slice(J,ae))}else if(U===null||s.primitiveTypes.has(typeof U))I.push(s.escapeRegex(`${U}`));else throw new Error(`Invalid template literal part: ${U}`);k._zod.pattern=new RegExp(`^${I.join("")}$`),k._zod.parse=(U,V)=>typeof U.value!="string"?(U.issues.push({input:U.value,inst:k,expected:"string",code:"invalid_type"}),U):(k._zod.pattern.lastIndex=0,k._zod.pattern.test(U.value)||U.issues.push({input:U.value,inst:k,code:"invalid_format",format:O.format??"template_literal",pattern:k._zod.pattern.source}),U)}),r.$ZodFunction=j.$constructor("$ZodFunction",(k,O)=>(r.$ZodType.init(k,O),k._def=O,k._zod.def=O,k.implement=I=>{if(typeof I!="function")throw new Error("implement() must be called with a function");return function(...U){const V=k._def.input?(0,F.parse)(k._def.input,U):U,J=Reflect.apply(I,this,V);return k._def.output?(0,F.parse)(k._def.output,J):J}},k.implementAsync=I=>{if(typeof I!="function")throw new Error("implementAsync() must be called with a function");return async function(...U){const V=k._def.input?await(0,F.parseAsync)(k._def.input,U):U,J=await Reflect.apply(I,this,V);return k._def.output?await(0,F.parseAsync)(k._def.output,J):J}},k._zod.parse=(I,U)=>typeof I.value!="function"?(I.issues.push({code:"invalid_type",expected:"function",input:I.value,inst:k}),I):(k._def.output&&k._def.output._zod.def.type==="promise"?I.value=k.implementAsync(I.value):I.value=k.implement(I.value),I),k.input=(...I)=>{const U=k.constructor;return Array.isArray(I[0])?new U({type:"function",input:new r.$ZodTuple({type:"tuple",items:I[0],rest:I[1]}),output:k._def.output}):new U({type:"function",input:I[0],output:k._def.output})},k.output=I=>{const U=k.constructor;return new U({type:"function",input:k._def.input,output:I})},k)),r.$ZodPromise=j.$constructor("$ZodPromise",(k,O)=>{r.$ZodType.init(k,O),k._zod.parse=(I,U)=>Promise.resolve(I.value).then(V=>O.innerType._zod.run({value:V,issues:[]},U))}),r.$ZodLazy=j.$constructor("$ZodLazy",(k,O)=>{r.$ZodType.init(k,O),s.defineLazy(k._zod,"innerType",()=>{const I=O;return I._cachedInner||(I._cachedInner=O.getter()),I._cachedInner}),s.defineLazy(k._zod,"pattern",()=>k._zod.innerType?._zod?.pattern),s.defineLazy(k._zod,"propValues",()=>k._zod.innerType?._zod?.propValues),s.defineLazy(k._zod,"optin",()=>k._zod.innerType?._zod?.optin??void 0),s.defineLazy(k._zod,"optout",()=>k._zod.innerType?._zod?.optout??void 0),k._zod.parse=(I,U)=>k._zod.innerType._zod.run(I,U)}),r.$ZodCustom=j.$constructor("$ZodCustom",(k,O)=>{_.$ZodCheck.init(k,O),r.$ZodType.init(k,O),k._zod.parse=(I,U)=>I,k._zod.check=I=>{const U=I.value,V=O.fn(U);if(V instanceof Promise)return V.then(J=>fr(J,I,U,k));fr(V,I,U,k)}});function fr(k,O,I,U){if(!k){const V={code:"custom",input:I,inst:U,path:[...U._zod.def.path??[]],continue:!U._zod.def.abort};U._zod.def.params&&(V.params=U._zod.def.params),O.issues.push(s.issue(V))}}})(Mr);var oa={},uo={exports:{}},Dn=uo.exports;(function(r,m){var C=Dn&&Dn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Dn&&Dn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"مدخل"},v={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${n.expected}، ولكن تم إدخال ${A}`:`مدخلات غير مقبولة: يفترض إدخال ${t}، ولكن تم إدخال ${A}`}case"invalid_value":return n.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${j.stringifyPrimitive(n.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${t} ${n.maximum.toString()} ${x.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${t} ${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${t} ${n.minimum.toString()} ${x.unit}`:`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${t} ${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`:t.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${u[t.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${j.joinValues(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function F(){return{localeError:T()}}r.exports=m.default})(uo,uo.exports);var pI=uo.exports,fo={exports:{}},An=fo.exports;(function(r,m){var C=An&&An.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=An&&An.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Yanlış dəyər: gözlənilən instanceof ${n.expected}, daxil olan ${A}`:`Yanlış dəyər: gözlənilən ${t}, daxil olan ${A}`}case"invalid_value":return n.values.length===1?`Yanlış dəyər: gözlənilən ${j.stringifyPrimitive(n.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${t}${n.maximum.toString()} ${x.unit??"element"}`:`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Çox kiçik: gözlənilən ${n.origin} ${t}${n.minimum.toString()} ${x.unit}`:`Çox kiçik: gözlənilən ${n.origin} ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format==="ends_with"?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format==="includes"?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format==="regex"?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${u[t.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":""}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(fo,fo.exports);var hI=fo.exports,mo={exports:{}},zn=mo.exports;(function(r,m){var C=zn&&zn.__createBinding||(Object.create?(function(s,u,v,n){n===void 0&&(n=v);var t=Object.getOwnPropertyDescriptor(u,v);(!t||("get"in t?!u.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return u[v]}}),Object.defineProperty(s,n,t)}):(function(s,u,v,n){n===void 0&&(n=v),s[n]=u[v]})),E=zn&&zn.__setModuleDefault||(Object.create?(function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}):function(s,u){s.default=u}),_=zn&&zn.__importStar||function(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var v in s)v!=="default"&&Object.prototype.hasOwnProperty.call(s,v)&&C(u,s,v);return E(u,s),u};Object.defineProperty(m,"__esModule",{value:!0}),m.default=c;const j=_(le);function T(s,u,v,n){const t=Math.abs(s),x=t%10,A=t%100;return A>=11&&A<=19?n:x===1?u:x>=2&&x<=4?v:n}const F=()=>{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(t){return s[t]??null}const v={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 t=>{switch(t.code){case"invalid_type":{const x=n[t.expected]??t.expected,A=j.parsedType(t.input),te=n[A]??A;return/^[A-Z]/.test(t.expected)?`Няправільны ўвод: чакаўся instanceof ${t.expected}, атрымана ${te}`:`Няправільны ўвод: чакаўся ${x}, атрымана ${te}`}case"invalid_value":return t.values.length===1?`Няправільны ўвод: чакалася ${j.stringifyPrimitive(t.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${j.joinValues(t.values,"|")}`;case"too_big":{const x=t.inclusive?"<=":"<",A=u(t.origin);if(A){const te=Number(t.maximum),ee=T(te,A.unit.one,A.unit.few,A.unit.many);return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна ${A.verb} ${x}${t.maximum.toString()} ${ee}`}return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна быць ${x}${t.maximum.toString()}`}case"too_small":{const x=t.inclusive?">=":">",A=u(t.origin);if(A){const te=Number(t.minimum),ee=T(te,A.unit.one,A.unit.few,A.unit.many);return`Занадта малы: чакалася, што ${t.origin} павінна ${A.verb} ${x}${t.minimum.toString()} ${ee}`}return`Занадта малы: чакалася, што ${t.origin} павінна быць ${x}${t.minimum.toString()}`}case"invalid_format":{const x=t;return x.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${x.prefix}"`:x.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${x.suffix}"`:x.format==="includes"?`Няправільны радок: павінен змяшчаць "${x.includes}"`:x.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${x.pattern}`:`Няправільны ${v[x.format]??t.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${t.keys.length>1?"ключы":"ключ"}: ${j.joinValues(t.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${t.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${t.origin}`;default:return"Няправільны ўвод"}}};function c(){return{localeError:F()}}r.exports=m.default})(mo,mo.exports);var vI=mo.exports,go={exports:{}},Tn=go.exports;(function(r,m){var C=Tn&&Tn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Tn&&Tn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"вход"},v={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Невалиден вход: очакван instanceof ${n.expected}, получен ${A}`:`Невалиден вход: очакван ${t}, получен ${A}`}case"invalid_value":return n.values.length===1?`Невалиден вход: очакван ${j.stringifyPrimitive(n.values[0])}`:`Невалидна опция: очаквано едно от ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Твърде голямо: очаква се ${n.origin??"стойност"} да съдържа ${t}${n.maximum.toString()} ${x.unit??"елемента"}`:`Твърде голямо: очаква се ${n.origin??"стойност"} да бъде ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Твърде малко: очаква се ${n.origin} да съдържа ${t}${n.minimum.toString()} ${x.unit}`:`Твърде малко: очаква се ${n.origin} да бъде ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;if(t.format==="starts_with")return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format==="ends_with")return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format==="includes")return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format==="regex")return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let x="Невалиден";return t.format==="emoji"&&(x="Невалидно"),t.format==="datetime"&&(x="Невалидно"),t.format==="date"&&(x="Невалидна"),t.format==="time"&&(x="Невалидно"),t.format==="duration"&&(x="Невалидна"),`${x} ${u[t.format]??n.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${n.divisor}`;case"unrecognized_keys":return`Неразпознат${n.keys.length>1?"и":""} ключ${n.keys.length>1?"ове":""}: ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${n.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${n.origin}`;default:return"Невалиден вход"}}};function F(){return{localeError:T()}}r.exports=m.default})(go,go.exports);var bI=go.exports,po={exports:{}},Rn=po.exports;(function(r,m){var C=Rn&&Rn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Rn&&Rn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Tipus invàlid: s'esperava instanceof ${n.expected}, s'ha rebut ${A}`:`Tipus invàlid: s'esperava ${t}, s'ha rebut ${A}`}case"invalid_value":return n.values.length===1?`Valor invàlid: s'esperava ${j.stringifyPrimitive(n.values[0])}`:`Opció invàlida: s'esperava una de ${j.joinValues(n.values," o ")}`;case"too_big":{const t=n.inclusive?"com a màxim":"menys de",x=s(n.origin);return x?`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${t} ${n.maximum.toString()} ${x.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${t} ${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?"com a mínim":"més de",x=s(n.origin);return x?`Massa petit: s'esperava que ${n.origin} contingués ${t} ${n.minimum.toString()} ${x.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${t} ${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format==="ends_with"?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format==="includes"?`Format invàlid: ha d'incloure "${t.includes}"`:t.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${u[t.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":""}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(po,po.exports);var yI=po.exports,ho={exports:{}},Ln=ho.exports;(function(r,m){var C=Ln&&Ln.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Ln&&Ln.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Neplatný vstup: očekáváno instanceof ${n.expected}, obdrženo ${A}`:`Neplatný vstup: očekáváno ${t}, obdrženo ${A}`}case"invalid_value":return n.values.length===1?`Neplatný vstup: očekáváno ${j.stringifyPrimitive(n.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${t}${n.maximum.toString()} ${x.unit??"prvků"}`:`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${t}${n.minimum.toString()} ${x.unit??"prvků"}`:`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format==="ends_with"?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format==="includes"?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${u[t.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: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(ho,ho.exports);var xI=ho.exports,vo={exports:{}},Zn=vo.exports;(function(r,m){var C=Zn&&Zn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Zn&&Zn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={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 t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${A}`:`Ugyldigt input: forventede ${t}, fik ${A}`}case"invalid_value":return n.values.length===1?`Ugyldig værdi: forventede ${j.stringifyPrimitive(n.values[0])}`:`Ugyldigt valg: forventede en af følgende ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin),A=v[n.origin]??n.origin;return x?`For stor: forventede ${A??"value"} ${x.verb} ${t} ${n.maximum.toString()} ${x.unit??"elementer"}`:`For stor: forventede ${A??"value"} havde ${t} ${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin),A=v[n.origin]??n.origin;return x?`For lille: forventede ${A} ${x.verb} ${t} ${n.minimum.toString()} ${x.unit}`:`For lille: forventede ${A} havde ${t} ${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format==="ends_with"?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format==="includes"?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format==="regex"?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${u[t.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"}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(vo,vo.exports);var _I=vo.exports,bo={exports:{}},Un=bo.exports;(function(r,m){var C=Un&&Un.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Un&&Un.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Ungültige Eingabe: erwartet instanceof ${n.expected}, erhalten ${A}`:`Ungültige Eingabe: erwartet ${t}, erhalten ${A}`}case"invalid_value":return n.values.length===1?`Ungültige Eingabe: erwartet ${j.stringifyPrimitive(n.values[0])}`:`Ungültige Option: erwartet eine von ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Zu groß: erwartet, dass ${n.origin??"Wert"} ${t}${n.maximum.toString()} ${x.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${n.origin??"Wert"} ${t}${n.maximum.toString()} ist`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Zu klein: erwartet, dass ${n.origin} ${t}${n.minimum.toString()} ${x.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${t}${n.minimum.toString()} ist`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format==="ends_with"?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format==="includes"?`Ungültiger String: muss "${t.includes}" enthalten`:t.format==="regex"?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${u[t.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"}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(bo,bo.exports);var wI=bo.exports,yo={exports:{}},Bn=yo.exports;(function(r,m){var C=Bn&&Bn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Bn&&Bn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"είσοδος"},v={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`Μη έγκυρη είσοδος: αναμενόταν instanceof ${n.expected}, λήφθηκε ${A}`:`Μη έγκυρη είσοδος: αναμενόταν ${t}, λήφθηκε ${A}`}case"invalid_value":return n.values.length===1?`Μη έγκυρη είσοδος: αναμενόταν ${j.stringifyPrimitive(n.values[0])}`:`Μη έγκυρη επιλογή: αναμενόταν ένα από ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Πολύ μεγάλο: αναμενόταν ${n.origin??"τιμή"} να έχει ${t}${n.maximum.toString()} ${x.unit??"στοιχεία"}`:`Πολύ μεγάλο: αναμενόταν ${n.origin??"τιμή"} να είναι ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Πολύ μικρό: αναμενόταν ${n.origin} να έχει ${t}${n.minimum.toString()} ${x.unit}`:`Πολύ μικρό: αναμενόταν ${n.origin} να είναι ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${t.prefix}"`:t.format==="ends_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${t.suffix}"`:t.format==="includes"?`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${t.includes}"`:t.format==="regex"?`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${t.pattern}`:`Μη έγκυρο: ${u[t.format]??n.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${n.divisor}`;case"unrecognized_keys":return`Άγνωστ${n.keys.length>1?"α":"ο"} κλειδ${n.keys.length>1?"ιά":"ί"}: ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${n.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${n.origin}`;default:return"Μη έγκυρη είσοδος"}}};function F(){return{localeError:T()}}r.exports=m.default})(yo,yo.exports);var SI=yo.exports,xo={exports:{}},Fn=xo.exports;(function(r,m){var C=Fn&&Fn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Fn&&Fn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return`Invalid input: expected ${t}, received ${A}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${j.stringifyPrimitive(n.values[0])}`:`Invalid option: expected one of ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Too big: expected ${n.origin??"value"} to have ${t}${n.maximum.toString()} ${x.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Too small: expected ${n.origin} to have ${t}${n.minimum.toString()} ${x.unit}`:`Too small: expected ${n.origin} to be ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Invalid string: must start with "${t.prefix}"`:t.format==="ends_with"?`Invalid string: must end with "${t.suffix}"`:t.format==="includes"?`Invalid string: must include "${t.includes}"`:t.format==="regex"?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${u[t.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":""}: ${j.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(x=>`'${x}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function F(){return{localeError:T()}}r.exports=m.default})(xo,xo.exports);var og=xo.exports,_o={exports:{}},Gn=_o.exports;(function(r,m){var C=Gn&&Gn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Gn&&Gn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendiĝis instanceof ${n.expected}, riceviĝis ${A}`:`Nevalida enigo: atendiĝis ${t}, riceviĝis ${A}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendiĝis ${j.stringifyPrimitive(n.values[0])}`:`Nevalida opcio: atendiĝis unu el ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${t}${n.maximum.toString()} ${x.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Tro malgranda: atendiĝis ke ${n.origin} havu ${t}${n.minimum.toString()} ${x.unit}`:`Tro malgranda: atendiĝis ke ${n.origin} estu ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${u[t.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":""}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(_o,_o.exports);var jI=_o.exports,wo={exports:{}},Vn=wo.exports;(function(r,m){var C=Vn&&Vn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Vn&&Vn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Vn&&Vn.__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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={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 t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Entrada inválida: se esperaba instanceof ${n.expected}, recibido ${A}`:`Entrada inválida: se esperaba ${t}, recibido ${A}`}case"invalid_value":return n.values.length===1?`Entrada inválida: se esperaba ${j.stringifyPrimitive(n.values[0])}`:`Opción inválida: se esperaba una de ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin),A=v[n.origin]??n.origin;return x?`Demasiado grande: se esperaba que ${A??"valor"} tuviera ${t}${n.maximum.toString()} ${x.unit??"elementos"}`:`Demasiado grande: se esperaba que ${A??"valor"} fuera ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin),A=v[n.origin]??n.origin;return x?`Demasiado pequeño: se esperaba que ${A} tuviera ${t}${n.minimum.toString()} ${x.unit}`:`Demasiado pequeño: se esperaba que ${A} fuera ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format==="ends_with"?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format==="includes"?`Cadena inválida: debe incluir "${t.includes}"`:t.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${u[t.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":""}: ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${v[n.origin]??n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${v[n.origin]??n.origin}`;default:return"Entrada inválida"}}};function F(){return{localeError:T()}}r.exports=m.default})(wo,wo.exports);var $I=wo.exports,So={exports:{}},Wn=So.exports;(function(r,m){var C=Wn&&Wn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Wn&&Wn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"ورودی"},v={nan:"NaN",number:"عدد",array:"آرایه"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`ورودی نامعتبر: میبایست instanceof ${n.expected} میبود، ${A} دریافت شد`:`ورودی نامعتبر: میبایست ${t} میبود، ${A} دریافت شد`}case"invalid_value":return n.values.length===1?`ورودی نامعتبر: میبایست ${j.stringifyPrimitive(n.values[0])} میبود`:`گزینه نامعتبر: میبایست یکی از ${j.joinValues(n.values,"|")} میبود`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`خیلی بزرگ: ${n.origin??"مقدار"} باید ${t}${n.maximum.toString()} ${x.unit??"عنصر"} باشد`:`خیلی بزرگ: ${n.origin??"مقدار"} باید ${t}${n.maximum.toString()} باشد`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`خیلی کوچک: ${n.origin} باید ${t}${n.minimum.toString()} ${x.unit} باشد`:`خیلی کوچک: ${n.origin} باید ${t}${n.minimum.toString()} باشد`}case"invalid_format":{const t=n;return t.format==="starts_with"?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format==="ends_with"?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format==="includes"?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format==="regex"?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${u[t.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function F(){return{localeError:T()}}r.exports=m.default})(So,So.exports);var kI=So.exports,jo={exports:{}},Qn=jo.exports;(function(r,m){var C=Qn&&Qn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Qn&&Qn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${A}`:`Virheellinen tyyppi: odotettiin ${t}, oli ${A}`}case"invalid_value":return n.values.length===1?`Virheellinen syöte: täytyy olla ${j.stringifyPrimitive(n.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Liian suuri: ${x.subject} täytyy olla ${t}${n.maximum.toString()} ${x.unit}`.trim():`Liian suuri: arvon täytyy olla ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Liian pieni: ${x.subject} täytyy olla ${t}${n.minimum.toString()} ${x.unit}`.trim():`Liian pieni: arvon täytyy olla ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format==="includes"?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${u[t.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"}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(jo,jo.exports);var PI=jo.exports,$o={exports:{}},Hn=$o.exports;(function(r,m){var C=Hn&&Hn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Hn&&Hn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={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 t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Entrée invalide : instanceof ${n.expected} attendu, ${A} reçu`:`Entrée invalide : ${t} attendu, ${A} reçu`}case"invalid_value":return n.values.length===1?`Entrée invalide : ${j.stringifyPrimitive(n.values[0])} attendu`:`Option invalide : une valeur parmi ${j.joinValues(n.values,"|")} attendue`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Trop grand : ${v[n.origin]??"valeur"} doit ${x.verb} ${t}${n.maximum.toString()} ${x.unit??"élément(s)"}`:`Trop grand : ${v[n.origin]??"valeur"} doit être ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Trop petit : ${v[n.origin]??"valeur"} doit ${x.verb} ${t}${n.minimum.toString()} ${x.unit}`:`Trop petit : ${v[n.origin]??"valeur"} doit être ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format==="ends_with"?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format==="includes"?`Chaîne invalide : doit inclure "${t.includes}"`:t.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${u[t.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":""} : ${j.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 F(){return{localeError:T()}}r.exports=m.default})($o,$o.exports);var NI=$o.exports,ko={exports:{}},qn=ko.exports;(function(r,m){var C=qn&&qn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=qn&&qn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Entrée invalide : attendu instanceof ${n.expected}, reçu ${A}`:`Entrée invalide : attendu ${t}, reçu ${A}`}case"invalid_value":return n.values.length===1?`Entrée invalide : attendu ${j.stringifyPrimitive(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"≤":"<",x=s(n.origin);return x?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${t}${n.maximum.toString()} ${x.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?"≥":">",x=s(n.origin);return x?`Trop petit : attendu que ${n.origin} ait ${t}${n.minimum.toString()} ${x.unit}`:`Trop petit : attendu que ${n.origin} soit ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format==="ends_with"?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format==="includes"?`Chaîne invalide : doit inclure "${t.includes}"`:t.format==="regex"?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${u[t.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":""} : ${j.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 F(){return{localeError:T()}}r.exports=m.default})(ko,ko.exports);var CI=ko.exports,Po={exports:{}},Jn=Po.exports;(function(r,m){var C=Jn&&Jn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Jn&&Jn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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=ee=>ee?c[ee]:void 0,v=ee=>{const oe=u(ee);return oe?oe.label:ee??c.unknown.label},n=ee=>`ה${v(ee)}`,t=ee=>(u(ee)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",x=ee=>ee?s[ee]??null:null,A={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"}},te={nan:"NaN"};return ee=>{switch(ee.code){case"invalid_type":{const oe=ee.expected,ie=te[oe??""]??v(oe),ke=j.parsedType(ee.input),se=te[ke]??c[ke]?.label??ke;return/^[A-Z]/.test(ee.expected)?`קלט לא תקין: צריך להיות instanceof ${ee.expected}, התקבל ${se}`:`קלט לא תקין: צריך להיות ${ie}, התקבל ${se}`}case"invalid_value":{if(ee.values.length===1)return`ערך לא תקין: הערך חייב להיות ${j.stringifyPrimitive(ee.values[0])}`;const oe=ee.values.map(se=>j.stringifyPrimitive(se));if(ee.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${oe[0]} או ${oe[1]}`;const ie=oe[oe.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${oe.slice(0,-1).join(", ")} או ${ie}`}case"too_big":{const oe=x(ee.origin),ie=n(ee.origin??"value");if(ee.origin==="string")return`${oe?.longLabel??"ארוך"} מדי: ${ie} צריכה להכיל ${ee.maximum.toString()} ${oe?.unit??""} ${ee.inclusive?"או פחות":"לכל היותר"}`.trim();if(ee.origin==="number"){const Oe=ee.inclusive?`קטן או שווה ל-${ee.maximum}`:`קטן מ-${ee.maximum}`;return`גדול מדי: ${ie} צריך להיות ${Oe}`}if(ee.origin==="array"||ee.origin==="set"){const Oe=ee.origin==="set"?"צריכה":"צריך",Se=ee.inclusive?`${ee.maximum} ${oe?.unit??""} או פחות`:`פחות מ-${ee.maximum} ${oe?.unit??""}`;return`גדול מדי: ${ie} ${Oe} להכיל ${Se}`.trim()}const ke=ee.inclusive?"<=":"<",se=t(ee.origin??"value");return oe?.unit?`${oe.longLabel} מדי: ${ie} ${se} ${ke}${ee.maximum.toString()} ${oe.unit}`:`${oe?.longLabel??"גדול"} מדי: ${ie} ${se} ${ke}${ee.maximum.toString()}`}case"too_small":{const oe=x(ee.origin),ie=n(ee.origin??"value");if(ee.origin==="string")return`${oe?.shortLabel??"קצר"} מדי: ${ie} צריכה להכיל ${ee.minimum.toString()} ${oe?.unit??""} ${ee.inclusive?"או יותר":"לפחות"}`.trim();if(ee.origin==="number"){const Oe=ee.inclusive?`גדול או שווה ל-${ee.minimum}`:`גדול מ-${ee.minimum}`;return`קטן מדי: ${ie} צריך להיות ${Oe}`}if(ee.origin==="array"||ee.origin==="set"){const Oe=ee.origin==="set"?"צריכה":"צריך";if(ee.minimum===1&&ee.inclusive){const He=(ee.origin==="set","לפחות פריט אחד");return`קטן מדי: ${ie} ${Oe} להכיל ${He}`}const Se=ee.inclusive?`${ee.minimum} ${oe?.unit??""} או יותר`:`יותר מ-${ee.minimum} ${oe?.unit??""}`;return`קטן מדי: ${ie} ${Oe} להכיל ${Se}`.trim()}const ke=ee.inclusive?">=":">",se=t(ee.origin??"value");return oe?.unit?`${oe.shortLabel} מדי: ${ie} ${se} ${ke}${ee.minimum.toString()} ${oe.unit}`:`${oe?.shortLabel??"קטן"} מדי: ${ie} ${se} ${ke}${ee.minimum.toString()}`}case"invalid_format":{const oe=ee;if(oe.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${oe.prefix}"`;if(oe.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${oe.suffix}"`;if(oe.format==="includes")return`המחרוזת חייבת לכלול "${oe.includes}"`;if(oe.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${oe.pattern}`;const ie=A[oe.format],ke=ie?.label??oe.format,Oe=(ie?.gender??"m")==="f"?"תקינה":"תקין";return`${ke} לא ${Oe}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${ee.divisor}`;case"unrecognized_keys":return`מפתח${ee.keys.length>1?"ות":""} לא מזוה${ee.keys.length>1?"ים":"ה"}: ${j.joinValues(ee.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n(ee.origin??"array")}`;default:return"קלט לא תקין"}}};function F(){return{localeError:T()}}r.exports=m.default})(Po,Po.exports);var OI=Po.exports,No={exports:{}},Kn=No.exports;(function(r,m){var C=Kn&&Kn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Kn&&Kn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={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 t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Neispravan unos: očekuje se instanceof ${n.expected}, a primljeno je ${A}`:`Neispravan unos: očekuje se ${t}, a primljeno je ${A}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: očekivano ${j.stringifyPrimitive(n.values[0])}`:`Neispravna opcija: očekivano jedno od ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin),A=v[n.origin]??n.origin;return x?`Preveliko: očekivano da ${A??"vrijednost"} ima ${t}${n.maximum.toString()} ${x.unit??"elemenata"}`:`Preveliko: očekivano da ${A??"vrijednost"} bude ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin),A=v[n.origin]??n.origin;return x?`Premalo: očekivano da ${A} ima ${t}${n.minimum.toString()} ${x.unit}`:`Premalo: očekivano da ${A} bude ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Neispravan tekst: mora započinjati s "${t.prefix}"`:t.format==="ends_with"?`Neispravan tekst: mora završavati s "${t.suffix}"`:t.format==="includes"?`Neispravan tekst: mora sadržavati "${t.includes}"`:t.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${t.pattern}`:`Neispravna ${u[t.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č"}: ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${v[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${v[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function F(){return{localeError:T()}}r.exports=m.default})(No,No.exports);var MI=No.exports,Co={exports:{}},Xn=Co.exports;(function(r,m){var C=Xn&&Xn.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Xn&&Xn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"szám",array:"tömb"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Érvénytelen bemenet: a várt érték instanceof ${n.expected}, a kapott érték ${A}`:`Érvénytelen bemenet: a várt érték ${t}, a kapott érték ${A}`}case"invalid_value":return n.values.length===1?`Érvénytelen bemenet: a várt érték ${j.stringifyPrimitive(n.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${t}${n.maximum.toString()} ${x.unit??"elem"}`:`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${t}${n.minimum.toString()} ${x.unit}`:`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format==="ends_with"?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format==="includes"?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format==="regex"?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${u[t.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":""}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Co,Co.exports);var EI=Co.exports,Oo={exports:{}},Yn=Oo.exports;(function(r,m){var C=Yn&&Yn.__createBinding||(Object.create?(function(u,v,n,t){t===void 0&&(t=n);var x=Object.getOwnPropertyDescriptor(v,n);(!x||("get"in x?!v.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return v[n]}}),Object.defineProperty(u,t,x)}):(function(u,v,n,t){t===void 0&&(t=n),u[t]=v[n]})),E=Yn&&Yn.__setModuleDefault||(Object.create?(function(u,v){Object.defineProperty(u,"default",{enumerable:!0,value:v})}):function(u,v){u.default=v}),_=Yn&&Yn.__importStar||function(u){if(u&&u.__esModule)return u;var v={};if(u!=null)for(var n in u)n!=="default"&&Object.prototype.hasOwnProperty.call(u,n)&&C(v,u,n);return E(v,u),v};Object.defineProperty(m,"__esModule",{value:!0}),m.default=s;const j=_(le);function T(u,v,n){return Math.abs(u)===1?v:n}function F(u){if(!u)return"";const v=["ա","ե","ը","ի","ո","ու","օ"],n=u[u.length-1];return u+(v.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 v(x){return u[x]??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:"մուտք"},t={nan:"NaN",number:"թիվ",array:"զանգված"};return x=>{switch(x.code){case"invalid_type":{const A=t[x.expected]??x.expected,te=j.parsedType(x.input),ee=t[te]??te;return/^[A-Z]/.test(x.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${x.expected}, ստացվել է ${ee}`:`Սխալ մուտքագրում․ սպասվում էր ${A}, ստացվել է ${ee}`}case"invalid_value":return x.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${j.stringifyPrimitive(x.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${j.joinValues(x.values,"|")}`;case"too_big":{const A=x.inclusive?"<=":"<",te=v(x.origin);if(te){const ee=Number(x.maximum),oe=T(ee,te.unit.one,te.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${F(x.origin??"արժեք")} կունենա ${A}${x.maximum.toString()} ${oe}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${F(x.origin??"արժեք")} լինի ${A}${x.maximum.toString()}`}case"too_small":{const A=x.inclusive?">=":">",te=v(x.origin);if(te){const ee=Number(x.minimum),oe=T(ee,te.unit.one,te.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${F(x.origin)} կունենա ${A}${x.minimum.toString()} ${oe}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${F(x.origin)} լինի ${A}${x.minimum.toString()}`}case"invalid_format":{const A=x;return A.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${A.prefix}"-ով`:A.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${A.suffix}"-ով`:A.format==="includes"?`Սխալ տող․ պետք է պարունակի "${A.includes}"`:A.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${A.pattern} ձևաչափին`:`Սխալ ${n[A.format]??x.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${x.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${x.keys.length>1?"ներ":""}. ${j.joinValues(x.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${F(x.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${F(x.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function s(){return{localeError:c()}}r.exports=m.default})(Oo,Oo.exports);var II=Oo.exports,Mo={exports:{}},ei=Mo.exports;(function(r,m){var C=ei&&ei.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=ei&&ei.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${A}`:`Input tidak valid: diharapkan ${t}, diterima ${A}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${j.stringifyPrimitive(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${t}${n.maximum.toString()} ${x.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Terlalu kecil: diharapkan ${n.origin} memiliki ${t}${n.minimum.toString()} ${x.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format==="ends_with"?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format==="includes"?`String tidak valid: harus menyertakan "${t.includes}"`:t.format==="regex"?`String tidak valid: harus sesuai pola ${t.pattern}`:`${u[t.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":""}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Mo,Mo.exports);var DI=Mo.exports,Eo={exports:{}},ti=Eo.exports;(function(r,m){var C=ti&&ti.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=ti&&ti.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"númer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Rangt gildi: Þú slóst inn ${A} þar sem á að vera instanceof ${n.expected}`:`Rangt gildi: Þú slóst inn ${A} þar sem á að vera ${t}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert ráð fyrir ${j.stringifyPrimitive(n.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} hafi ${t}${n.maximum.toString()} ${x.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} sé ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Of lítið: gert er ráð fyrir að ${n.origin} hafi ${t}${n.minimum.toString()} ${x.unit}`:`Of lítið: gert er ráð fyrir að ${n.origin} sé ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format==="ends_with"?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format==="includes"?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${u[t.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"}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Eo,Eo.exports);var AI=Eo.exports,Io={exports:{}},ri=Io.exports;(function(r,m){var C=ri&&ri.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=ri&&ri.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${A}`:`Input non valido: atteso ${t}, ricevuto ${A}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${j.stringifyPrimitive(n.values[0])}`:`Opzione non valida: atteso uno tra ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Troppo grande: ${n.origin??"valore"} deve avere ${t}${n.maximum.toString()} ${x.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Troppo piccolo: ${n.origin} deve avere ${t}${n.minimum.toString()} ${x.unit}`:`Troppo piccolo: ${n.origin} deve essere ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format==="ends_with"?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format==="includes"?`Stringa non valida: deve includere "${t.includes}"`:t.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Input non valido: ${u[t.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"}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Io,Io.exports);var zI=Io.exports,Do={exports:{}},ni=Do.exports;(function(r,m){var C=ni&&ni.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=ni&&ni.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"入力値"},v={nan:"NaN",number:"数値",array:"配列"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`無効な入力: instanceof ${n.expected}が期待されましたが、${A}が入力されました`:`無効な入力: ${t}が期待されましたが、${A}が入力されました`}case"invalid_value":return n.values.length===1?`無効な入力: ${j.stringifyPrimitive(n.values[0])}が期待されました`:`無効な選択: ${j.joinValues(n.values,"、")}のいずれかである必要があります`;case"too_big":{const t=n.inclusive?"以下である":"より小さい",x=s(n.origin);return x?`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${x.unit??"要素"}${t}必要があります`:`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${t}必要があります`}case"too_small":{const t=n.inclusive?"以上である":"より大きい",x=s(n.origin);return x?`小さすぎる値: ${n.origin}は${n.minimum.toString()}${x.unit}${t}必要があります`:`小さすぎる値: ${n.origin}は${n.minimum.toString()}${t}必要があります`}case"invalid_format":{const t=n;return t.format==="starts_with"?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format==="ends_with"?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format==="includes"?`無効な文字列: "${t.includes}"を含む必要があります`:t.format==="regex"?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${u[t.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${j.joinValues(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function F(){return{localeError:T()}}r.exports=m.default})(Do,Do.exports);var TI=Do.exports,Ao={exports:{}},ii=Ao.exports;(function(r,m){var C=ii&&ii.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=ii&&ii.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"შეყვანა"},v={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${n.expected}, მიღებული ${A}`:`არასწორი შეყვანა: მოსალოდნელი ${t}, მიღებული ${A}`}case"invalid_value":return n.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${j.stringifyPrimitive(n.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${j.joinValues(n.values,"|")}-დან`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} ${x.verb} ${t}${n.maximum.toString()} ${x.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} იყოს ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`ზედმეტად პატარა: მოსალოდნელი ${n.origin} ${x.verb} ${t}${n.minimum.toString()} ${x.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${n.origin} იყოს ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`არასწორი ველი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format==="ends_with"?`არასწორი ველი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format==="includes"?`არასწორი ველი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format==="regex"?`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${u[t.format]??n.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${n.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${n.keys.length>1?"ები":"ი"}: ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${n.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${n.origin}-ში`;default:return"არასწორი შეყვანა"}}};function F(){return{localeError:T()}}r.exports=m.default})(Ao,Ao.exports);var RI=Ao.exports,zo={exports:{}},To={exports:{}},ai=To.exports;(function(r,m){var C=ai&&ai.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=ai&&ai.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"ទិន្នន័យបញ្ចូល"},v={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${n.expected} ប៉ុន្តែទទួលបាន ${A}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t} ប៉ុន្តែទទួលបាន ${A}`}case"invalid_value":return n.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${j.stringifyPrimitive(n.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${t} ${n.maximum.toString()} ${x.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${t} ${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`តូចពេក៖ ត្រូវការ ${n.origin} ${t} ${n.minimum.toString()} ${x.unit}`:`តូចពេក៖ ត្រូវការ ${n.origin} ${t} ${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${u[t.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function F(){return{localeError:T()}}r.exports=m.default})(To,To.exports);var sg=To.exports,Gm=zo.exports;(function(r,m){var C=Gm&&Gm.__importDefault||function(j){return j&&j.__esModule?j:{default:j}};Object.defineProperty(m,"__esModule",{value:!0}),m.default=_;const E=C(sg);function _(){return(0,E.default)()}r.exports=m.default})(zo,zo.exports);var LI=zo.exports,Ro={exports:{}},oi=Ro.exports;(function(r,m){var C=oi&&oi.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=oi&&oi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"입력"},v={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`잘못된 입력: 예상 타입은 instanceof ${n.expected}, 받은 타입은 ${A}입니다`:`잘못된 입력: 예상 타입은 ${t}, 받은 타입은 ${A}입니다`}case"invalid_value":return n.values.length===1?`잘못된 입력: 값은 ${j.stringifyPrimitive(n.values[0])} 이어야 합니다`:`잘못된 옵션: ${j.joinValues(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const t=n.inclusive?"이하":"미만",x=t==="미만"?"이어야 합니다":"여야 합니다",A=s(n.origin),te=A?.unit??"요소";return A?`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${te} ${t}${x}`:`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${t}${x}`}case"too_small":{const t=n.inclusive?"이상":"초과",x=t==="이상"?"이어야 합니다":"여야 합니다",A=s(n.origin),te=A?.unit??"요소";return A?`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${te} ${t}${x}`:`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${t}${x}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format==="ends_with"?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format==="includes"?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format==="regex"?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${u[t.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function F(){return{localeError:T()}}r.exports=m.default})(Ro,Ro.exports);var ZI=Ro.exports,Lo={exports:{}},si=Lo.exports;(function(r,m){var C=si&&si.__createBinding||(Object.create?(function(u,v,n,t){t===void 0&&(t=n);var x=Object.getOwnPropertyDescriptor(v,n);(!x||("get"in x?!v.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return v[n]}}),Object.defineProperty(u,t,x)}):(function(u,v,n,t){t===void 0&&(t=n),u[t]=v[n]})),E=si&&si.__setModuleDefault||(Object.create?(function(u,v){Object.defineProperty(u,"default",{enumerable:!0,value:v})}):function(u,v){u.default=v}),_=si&&si.__importStar||function(u){if(u&&u.__esModule)return u;var v={};if(u!=null)for(var n in u)n!=="default"&&Object.prototype.hasOwnProperty.call(u,n)&&C(v,u,n);return E(v,u),v};Object.defineProperty(m,"__esModule",{value:!0}),m.default=s;const j=_(le),T=u=>u.charAt(0).toUpperCase()+u.slice(1);function F(u){const v=Math.abs(u),n=v%10,t=v%100;return t>=11&&t<=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 v(x,A,te,ee){const oe=u[x]??null;return oe===null?oe:{unit:oe.unit[A],verb:oe.verb[ee][te?"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"},t={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 x=>{switch(x.code){case"invalid_type":{const A=t[x.expected]??x.expected,te=j.parsedType(x.input),ee=t[te]??te;return/^[A-Z]/.test(x.expected)?`Gautas tipas ${ee}, o tikėtasi - instanceof ${x.expected}`:`Gautas tipas ${ee}, o tikėtasi - ${A}`}case"invalid_value":return x.values.length===1?`Privalo būti ${j.stringifyPrimitive(x.values[0])}`:`Privalo būti vienas iš ${j.joinValues(x.values,"|")} pasirinkimų`;case"too_big":{const A=t[x.origin]??x.origin,te=v(x.origin,F(Number(x.maximum)),x.inclusive??!1,"smaller");if(te?.verb)return`${T(A??x.origin??"reikšmė")} ${te.verb} ${x.maximum.toString()} ${te.unit??"elementų"}`;const ee=x.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${T(A??x.origin??"reikšmė")} turi būti ${ee} ${x.maximum.toString()} ${te?.unit}`}case"too_small":{const A=t[x.origin]??x.origin,te=v(x.origin,F(Number(x.minimum)),x.inclusive??!1,"bigger");if(te?.verb)return`${T(A??x.origin??"reikšmė")} ${te.verb} ${x.minimum.toString()} ${te.unit??"elementų"}`;const ee=x.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${T(A??x.origin??"reikšmė")} turi būti ${ee} ${x.minimum.toString()} ${te?.unit}`}case"invalid_format":{const A=x;return A.format==="starts_with"?`Eilutė privalo prasidėti "${A.prefix}"`:A.format==="ends_with"?`Eilutė privalo pasibaigti "${A.suffix}"`:A.format==="includes"?`Eilutė privalo įtraukti "${A.includes}"`:A.format==="regex"?`Eilutė privalo atitikti ${A.pattern}`:`Neteisingas ${n[A.format]??x.format}`}case"not_multiple_of":return`Skaičius privalo būti ${x.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${x.keys.length>1?"i":"as"} rakt${x.keys.length>1?"ai":"as"}: ${j.joinValues(x.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const A=t[x.origin]??x.origin;return`${T(A??x.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function s(){return{localeError:c()}}r.exports=m.default})(Lo,Lo.exports);var UI=Lo.exports,Zo={exports:{}},li=Zo.exports;(function(r,m){var C=li&&li.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=li&&li.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=li&&li.__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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"внес"},v={nan:"NaN",number:"број",array:"низа"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Грешен внес: се очекува instanceof ${n.expected}, примено ${A}`:`Грешен внес: се очекува ${t}, примено ${A}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${j.stringifyPrimitive(n.values[0])}`:`Грешана опција: се очекува една ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${t}${n.maximum.toString()} ${x.unit??"елементи"}`:`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Премногу мал: се очекува ${n.origin} да има ${t}${n.minimum.toString()} ${x.unit}`:`Премногу мал: се очекува ${n.origin} да биде ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format==="ends_with"?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format==="includes"?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${u[t.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function F(){return{localeError:T()}}r.exports=m.default})(Zo,Zo.exports);var BI=Zo.exports,Uo={exports:{}},ci=Uo.exports;(function(r,m){var C=ci&&ci.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=ci&&ci.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${A}`:`Input tidak sah: dijangka ${t}, diterima ${A}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${j.stringifyPrimitive(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Terlalu besar: dijangka ${n.origin??"nilai"} ${x.verb} ${t}${n.maximum.toString()} ${x.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Terlalu kecil: dijangka ${n.origin} ${x.verb} ${t}${n.minimum.toString()} ${x.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format==="includes"?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${u[t.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Uo,Uo.exports);var FI=Uo.exports,Bo={exports:{}},ui=Bo.exports;(function(r,m){var C=ui&&ui.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=ui&&ui.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${A}`:`Ongeldige invoer: verwacht ${t}, ontving ${A}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${j.stringifyPrimitive(n.values[0])}`:`Ongeldige optie: verwacht één van ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin),A=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return x?`Te ${A}: verwacht dat ${n.origin??"waarde"} ${t}${n.maximum.toString()} ${x.unit??"elementen"} ${x.verb}`:`Te ${A}: verwacht dat ${n.origin??"waarde"} ${t}${n.maximum.toString()} is`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin),A=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return x?`Te ${A}: verwacht dat ${n.origin} ${t}${n.minimum.toString()} ${x.unit} ${x.verb}`:`Te ${A}: verwacht dat ${n.origin} ${t}${n.minimum.toString()} is`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format==="ends_with"?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format==="includes"?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${u[t.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":""}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Bo,Bo.exports);var GI=Bo.exports,Fo={exports:{}},di=Fo.exports;(function(r,m){var C=di&&di.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=di&&di.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${A}`:`Ugyldig input: forventet ${t}, fikk ${A}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${j.stringifyPrimitive(n.values[0])}`:`Ugyldig valg: forventet en av ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`For stor(t): forventet ${n.origin??"value"} til å ha ${t}${n.maximum.toString()} ${x.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til å ha ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`For lite(n): forventet ${n.origin} til å ha ${t}${n.minimum.toString()} ${x.unit}`:`For lite(n): forventet ${n.origin} til å ha ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Ugyldig streng: må starte med "${t.prefix}"`:t.format==="ends_with"?`Ugyldig streng: må ende med "${t.suffix}"`:t.format==="includes"?`Ugyldig streng: må inneholde "${t.includes}"`:t.format==="regex"?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${u[t.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"}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Fo,Fo.exports);var VI=Fo.exports,Go={exports:{}},fi=Go.exports;(function(r,m){var C=fi&&fi.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=fi&&fi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Fâsit giren: umulan instanceof ${n.expected}, alınan ${A}`:`Fâsit giren: umulan ${t}, alınan ${A}`}case"invalid_value":return n.values.length===1?`Fâsit giren: umulan ${j.stringifyPrimitive(n.values[0])}`:`Fâsit tercih: mûteberler ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Fazla büyük: ${n.origin??"value"}, ${t}${n.maximum.toString()} ${x.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${n.origin??"value"}, ${t}${n.maximum.toString()} olmalıydı.`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Fazla küçük: ${n.origin}, ${t}${n.minimum.toString()} ${x.unit} sahip olmalıydı.`:`Fazla küçük: ${n.origin}, ${t}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format==="ends_with"?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format==="includes"?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format==="regex"?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${u[t.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":""}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Go,Go.exports);var WI=Go.exports,Vo={exports:{}},mi=Vo.exports;(function(r,m){var C=mi&&mi.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=mi&&mi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"ورودي"},v={nan:"NaN",number:"عدد",array:"ارې"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`ناسم ورودي: باید instanceof ${n.expected} وای, مګر ${A} ترلاسه شو`:`ناسم ورودي: باید ${t} وای, مګر ${A} ترلاسه شو`}case"invalid_value":return n.values.length===1?`ناسم ورودي: باید ${j.stringifyPrimitive(n.values[0])} وای`:`ناسم انتخاب: باید یو له ${j.joinValues(n.values,"|")} څخه وای`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`ډیر لوی: ${n.origin??"ارزښت"} باید ${t}${n.maximum.toString()} ${x.unit??"عنصرونه"} ولري`:`ډیر لوی: ${n.origin??"ارزښت"} باید ${t}${n.maximum.toString()} وي`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`ډیر کوچنی: ${n.origin} باید ${t}${n.minimum.toString()} ${x.unit} ولري`:`ډیر کوچنی: ${n.origin} باید ${t}${n.minimum.toString()} وي`}case"invalid_format":{const t=n;return t.format==="starts_with"?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format==="ends_with"?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format==="includes"?`ناسم متن: باید "${t.includes}" ولري`:t.format==="regex"?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${u[t.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function F(){return{localeError:T()}}r.exports=m.default})(Vo,Vo.exports);var QI=Vo.exports,Wo={exports:{}},gi=Wo.exports;(function(r,m){var C=gi&&gi.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=gi&&gi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${n.expected}, otrzymano ${A}`:`Nieprawidłowe dane wejściowe: oczekiwano ${t}, otrzymano ${A}`}case"invalid_value":return n.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${j.stringifyPrimitive(n.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${t}${n.maximum.toString()} ${x.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${t}${n.minimum.toString()} ${x.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${u[t.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":""}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Wo,Wo.exports);var HI=Wo.exports,Qo={exports:{}},pi=Qo.exports;(function(r,m){var C=pi&&pi.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=pi&&pi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"número",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Tipo inválido: esperado instanceof ${n.expected}, recebido ${A}`:`Tipo inválido: esperado ${t}, recebido ${A}`}case"invalid_value":return n.values.length===1?`Entrada inválida: esperado ${j.stringifyPrimitive(n.values[0])}`:`Opção inválida: esperada uma das ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${t}${n.maximum.toString()} ${x.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Muito pequeno: esperado que ${n.origin} tivesse ${t}${n.minimum.toString()} ${x.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Texto inválido: deve começar com "${t.prefix}"`:t.format==="ends_with"?`Texto inválido: deve terminar com "${t.suffix}"`:t.format==="includes"?`Texto inválido: deve incluir "${t.includes}"`:t.format==="regex"?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${u[t.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":""}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Qo,Qo.exports);var qI=Qo.exports,Ho={exports:{}},hi=Ho.exports;(function(r,m){var C=hi&&hi.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=hi&&hi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={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 t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return`Intrare invalidă: așteptat ${t}, primit ${A}`}case"invalid_value":return n.values.length===1?`Intrare invalidă: așteptat ${j.stringifyPrimitive(n.values[0])}`:`Opțiune invalidă: așteptat una dintre ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Prea mare: așteptat ca ${n.origin??"valoarea"} ${x.verb} ${t}${n.maximum.toString()} ${x.unit??"elemente"}`:`Prea mare: așteptat ca ${n.origin??"valoarea"} să fie ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Prea mic: așteptat ca ${n.origin} ${x.verb} ${t}${n.minimum.toString()} ${x.unit}`:`Prea mic: așteptat ca ${n.origin} să fie ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Șir invalid: trebuie să înceapă cu "${t.prefix}"`:t.format==="ends_with"?`Șir invalid: trebuie să se termine cu "${t.suffix}"`:t.format==="includes"?`Șir invalid: trebuie să includă "${t.includes}"`:t.format==="regex"?`Șir invalid: trebuie să se potrivească cu modelul ${t.pattern}`:`Format invalid: ${u[t.format]??n.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Ho,Ho.exports);var JI=Ho.exports,qo={exports:{}},vi=qo.exports;(function(r,m){var C=vi&&vi.__createBinding||(Object.create?(function(s,u,v,n){n===void 0&&(n=v);var t=Object.getOwnPropertyDescriptor(u,v);(!t||("get"in t?!u.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return u[v]}}),Object.defineProperty(s,n,t)}):(function(s,u,v,n){n===void 0&&(n=v),s[n]=u[v]})),E=vi&&vi.__setModuleDefault||(Object.create?(function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}):function(s,u){s.default=u}),_=vi&&vi.__importStar||function(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var v in s)v!=="default"&&Object.prototype.hasOwnProperty.call(s,v)&&C(u,s,v);return E(u,s),u};Object.defineProperty(m,"__esModule",{value:!0}),m.default=c;const j=_(le);function T(s,u,v,n){const t=Math.abs(s),x=t%10,A=t%100;return A>=11&&A<=19?n:x===1?u:x>=2&&x<=4?v:n}const F=()=>{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(t){return s[t]??null}const v={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 t=>{switch(t.code){case"invalid_type":{const x=n[t.expected]??t.expected,A=j.parsedType(t.input),te=n[A]??A;return/^[A-Z]/.test(t.expected)?`Неверный ввод: ожидалось instanceof ${t.expected}, получено ${te}`:`Неверный ввод: ожидалось ${x}, получено ${te}`}case"invalid_value":return t.values.length===1?`Неверный ввод: ожидалось ${j.stringifyPrimitive(t.values[0])}`:`Неверный вариант: ожидалось одно из ${j.joinValues(t.values,"|")}`;case"too_big":{const x=t.inclusive?"<=":"<",A=u(t.origin);if(A){const te=Number(t.maximum),ee=T(te,A.unit.one,A.unit.few,A.unit.many);return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет иметь ${x}${t.maximum.toString()} ${ee}`}return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет ${x}${t.maximum.toString()}`}case"too_small":{const x=t.inclusive?">=":">",A=u(t.origin);if(A){const te=Number(t.minimum),ee=T(te,A.unit.one,A.unit.few,A.unit.many);return`Слишком маленькое значение: ожидалось, что ${t.origin} будет иметь ${x}${t.minimum.toString()} ${ee}`}return`Слишком маленькое значение: ожидалось, что ${t.origin} будет ${x}${t.minimum.toString()}`}case"invalid_format":{const x=t;return x.format==="starts_with"?`Неверная строка: должна начинаться с "${x.prefix}"`:x.format==="ends_with"?`Неверная строка: должна заканчиваться на "${x.suffix}"`:x.format==="includes"?`Неверная строка: должна содержать "${x.includes}"`:x.format==="regex"?`Неверная строка: должна соответствовать шаблону ${x.pattern}`:`Неверный ${v[x.format]??t.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспознанн${t.keys.length>1?"ые":"ый"} ключ${t.keys.length>1?"и":""}: ${j.joinValues(t.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${t.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${t.origin}`;default:return"Неверные входные данные"}}};function c(){return{localeError:F()}}r.exports=m.default})(qo,qo.exports);var KI=qo.exports,Jo={exports:{}},bi=Jo.exports;(function(r,m){var C=bi&&bi.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=bi&&bi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"število",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pričakovano instanceof ${n.expected}, prejeto ${A}`:`Neveljaven vnos: pričakovano ${t}, prejeto ${A}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pričakovano ${j.stringifyPrimitive(n.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${t}${n.maximum.toString()} ${x.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Premajhno: pričakovano, da bo ${n.origin} imelo ${t}${n.minimum.toString()} ${x.unit}`:`Premajhno: pričakovano, da bo ${n.origin} ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format==="ends_with"?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format==="includes"?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${u[t.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č"}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Jo,Jo.exports);var XI=Jo.exports,Ko={exports:{}},yi=Ko.exports;(function(r,m){var C=yi&&yi.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=yi&&yi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: förväntat instanceof ${n.expected}, fick ${A}`:`Ogiltig inmatning: förväntat ${t}, fick ${A}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: förväntat ${j.stringifyPrimitive(n.values[0])}`:`Ogiltigt val: förväntade en av ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`För stor(t): förväntade ${n.origin??"värdet"} att ha ${t}${n.maximum.toString()} ${x.unit??"element"}`:`För stor(t): förväntat ${n.origin??"värdet"} att ha ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`För lite(t): förväntade ${n.origin??"värdet"} att ha ${t}${n.minimum.toString()} ${x.unit}`:`För lite(t): förväntade ${n.origin??"värdet"} att ha ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format==="ends_with"?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format==="includes"?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${u[t.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"}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(Ko,Ko.exports);var YI=Ko.exports,Xo={exports:{}},xi=Xo.exports;(function(r,m){var C=xi&&xi.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=xi&&xi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${n.expected}, பெறப்பட்டது ${A}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t}, பெறப்பட்டது ${A}`}case"invalid_value":return n.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${j.stringifyPrimitive(n.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${j.joinValues(n.values,"|")} இல் ஒன்று`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${t}${n.maximum.toString()} ${x.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${t}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${t}${n.minimum.toString()} ${x.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${t}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const t=n;return t.format==="starts_with"?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format==="ends_with"?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format==="includes"?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format==="regex"?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${u[t.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function F(){return{localeError:T()}}r.exports=m.default})(Xo,Xo.exports);var e2=Xo.exports,Yo={exports:{}},_i=Yo.exports;(function(r,m){var C=_i&&_i.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=_i&&_i.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=_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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"ข้อมูลที่ป้อน"},v={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${n.expected} แต่ได้รับ ${A}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t} แต่ได้รับ ${A}`}case"invalid_value":return n.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${j.stringifyPrimitive(n.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"ไม่เกิน":"น้อยกว่า",x=s(n.origin);return x?`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${t} ${n.maximum.toString()} ${x.unit??"รายการ"}`:`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${t} ${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?"อย่างน้อย":"มากกว่า",x=s(n.origin);return x?`น้อยกว่ากำหนด: ${n.origin} ควรมี${t} ${n.minimum.toString()} ${x.unit}`:`น้อยกว่ากำหนด: ${n.origin} ควรมี${t} ${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${u[t.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function F(){return{localeError:T()}}r.exports=m.default})(Yo,Yo.exports);var t2=Yo.exports,es={exports:{}},wi=es.exports;(function(r,m){var C=wi&&wi.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=wi&&wi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=wi&&wi.__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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Geçersiz değer: beklenen instanceof ${n.expected}, alınan ${A}`:`Geçersiz değer: beklenen ${t}, alınan ${A}`}case"invalid_value":return n.values.length===1?`Geçersiz değer: beklenen ${j.stringifyPrimitive(n.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Çok büyük: beklenen ${n.origin??"değer"} ${t}${n.maximum.toString()} ${x.unit??"öğe"}`:`Çok büyük: beklenen ${n.origin??"değer"} ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Çok küçük: beklenen ${n.origin} ${t}${n.minimum.toString()} ${x.unit}`:`Çok küçük: beklenen ${n.origin} ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format==="ends_with"?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format==="includes"?`Geçersiz metin: "${t.includes}" içermeli`:t.format==="regex"?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${u[t.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":""}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(es,es.exports);var r2=es.exports,ts={exports:{}},rs={exports:{}},Si=rs.exports;(function(r,m){var C=Si&&Si.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Si&&Si.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"вхідні дані"},v={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Неправильні вхідні дані: очікується instanceof ${n.expected}, отримано ${A}`:`Неправильні вхідні дані: очікується ${t}, отримано ${A}`}case"invalid_value":return n.values.length===1?`Неправильні вхідні дані: очікується ${j.stringifyPrimitive(n.values[0])}`:`Неправильна опція: очікується одне з ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Занадто велике: очікується, що ${n.origin??"значення"} ${x.verb} ${t}${n.maximum.toString()} ${x.unit??"елементів"}`:`Занадто велике: очікується, що ${n.origin??"значення"} буде ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Занадто мале: очікується, що ${n.origin} ${x.verb} ${t}${n.minimum.toString()} ${x.unit}`:`Занадто мале: очікується, що ${n.origin} буде ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format==="includes"?`Неправильний рядок: повинен містити "${t.includes}"`:t.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${u[t.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function F(){return{localeError:T()}}r.exports=m.default})(rs,rs.exports);var lg=rs.exports,Vm=ts.exports;(function(r,m){var C=Vm&&Vm.__importDefault||function(j){return j&&j.__esModule?j:{default:j}};Object.defineProperty(m,"__esModule",{value:!0}),m.default=_;const E=C(lg);function _(){return(0,E.default)()}r.exports=m.default})(ts,ts.exports);var n2=ts.exports,ns={exports:{}},ji=ns.exports;(function(r,m){var C=ji&&ji.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=ji&&ji.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=ji&&ji.__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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"ان پٹ"},v={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`غلط ان پٹ: instanceof ${n.expected} متوقع تھا، ${A} موصول ہوا`:`غلط ان پٹ: ${t} متوقع تھا، ${A} موصول ہوا`}case"invalid_value":return n.values.length===1?`غلط ان پٹ: ${j.stringifyPrimitive(n.values[0])} متوقع تھا`:`غلط آپشن: ${j.joinValues(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`بہت بڑا: ${n.origin??"ویلیو"} کے ${t}${n.maximum.toString()} ${x.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${n.origin??"ویلیو"} کا ${t}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`بہت چھوٹا: ${n.origin} کے ${t}${n.minimum.toString()} ${x.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${n.origin} کا ${t}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const t=n;return t.format==="starts_with"?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format==="ends_with"?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format==="includes"?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format==="regex"?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${u[t.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${j.joinValues(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function F(){return{localeError:T()}}r.exports=m.default})(ns,ns.exports);var i2=ns.exports,is={exports:{}},$i=is.exports;(function(r,m){var C=$i&&$i.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=$i&&$i.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=$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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${A}`:`Noto‘g‘ri kirish: kutilgan ${t}, qabul qilingan ${A}`}case"invalid_value":return n.values.length===1?`Noto‘g‘ri kirish: kutilgan ${j.stringifyPrimitive(n.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Juda katta: kutilgan ${n.origin??"qiymat"} ${t}${n.maximum.toString()} ${x.unit} ${x.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Juda kichik: kutilgan ${n.origin} ${t}${n.minimum.toString()} ${x.unit} ${x.verb}`:`Juda kichik: kutilgan ${n.origin} ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Noto‘g‘ri satr: "${t.prefix}" bilan boshlanishi kerak`:t.format==="ends_with"?`Noto‘g‘ri satr: "${t.suffix}" bilan tugashi kerak`:t.format==="includes"?`Noto‘g‘ri satr: "${t.includes}" ni o‘z ichiga olishi kerak`:t.format==="regex"?`Noto‘g‘ri satr: ${t.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${u[t.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":""}: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(is,is.exports);var a2=is.exports,as={exports:{}},ki=as.exports;(function(r,m){var C=ki&&ki.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=ki&&ki.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=ki&&ki.__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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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"},v={nan:"NaN",number:"số",array:"mảng"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${n.expected}, nhận được ${A}`:`Đầu vào không hợp lệ: mong đợi ${t}, nhận được ${A}`}case"invalid_value":return n.values.length===1?`Đầu vào không hợp lệ: mong đợi ${j.stringifyPrimitive(n.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Quá lớn: mong đợi ${n.origin??"giá trị"} ${x.verb} ${t}${n.maximum.toString()} ${x.unit??"phần tử"}`:`Quá lớn: mong đợi ${n.origin??"giá trị"} ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Quá nhỏ: mong đợi ${n.origin} ${x.verb} ${t}${n.minimum.toString()} ${x.unit}`:`Quá nhỏ: mong đợi ${n.origin} ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${u[t.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: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(as,as.exports);var o2=as.exports,os={exports:{}},Pi=os.exports;(function(r,m){var C=Pi&&Pi.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Pi&&Pi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"输入"},v={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`无效输入:期望 instanceof ${n.expected},实际接收 ${A}`:`无效输入:期望 ${t},实际接收 ${A}`}case"invalid_value":return n.values.length===1?`无效输入:期望 ${j.stringifyPrimitive(n.values[0])}`:`无效选项:期望以下之一 ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`数值过大:期望 ${n.origin??"值"} ${t}${n.maximum.toString()} ${x.unit??"个元素"}`:`数值过大:期望 ${n.origin??"值"} ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`数值过小:期望 ${n.origin} ${t}${n.minimum.toString()} ${x.unit}`:`数值过小:期望 ${n.origin} ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`无效字符串:必须以 "${t.prefix}" 开头`:t.format==="ends_with"?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format==="includes"?`无效字符串:必须包含 "${t.includes}"`:t.format==="regex"?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${u[t.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${j.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function F(){return{localeError:T()}}r.exports=m.default})(os,os.exports);var s2=os.exports,ss={exports:{}},Ni=ss.exports;(function(r,m){var C=Ni&&Ni.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Ni&&Ni.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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:"輸入"},v={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`無效的輸入值:預期為 instanceof ${n.expected},但收到 ${A}`:`無效的輸入值:預期為 ${t},但收到 ${A}`}case"invalid_value":return n.values.length===1?`無效的輸入值:預期為 ${j.stringifyPrimitive(n.values[0])}`:`無效的選項:預期為以下其中之一 ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`數值過大:預期 ${n.origin??"值"} 應為 ${t}${n.maximum.toString()} ${x.unit??"個元素"}`:`數值過大:預期 ${n.origin??"值"} 應為 ${t}${n.maximum.toString()}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`數值過小:預期 ${n.origin} 應為 ${t}${n.minimum.toString()} ${x.unit}`:`數值過小:預期 ${n.origin} 應為 ${t}${n.minimum.toString()}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format==="ends_with"?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format==="includes"?`無效的字串:必須包含 "${t.includes}"`:t.format==="regex"?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${u[t.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${j.joinValues(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function F(){return{localeError:T()}}r.exports=m.default})(ss,ss.exports);var l2=ss.exports,ls={exports:{}},Ci=ls.exports;(function(r,m){var C=Ci&&Ci.__createBinding||(Object.create?(function(c,s,u,v){v===void 0&&(v=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,v,n)}):(function(c,s,u,v){v===void 0&&(v=u),c[v]=s[u]})),E=Ci&&Ci.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=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)&&C(s,c,u);return E(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=F;const j=_(le),T=()=>{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é"},v={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return n=>{switch(n.code){case"invalid_type":{const t=v[n.expected]??n.expected,x=j.parsedType(n.input),A=v[x]??x;return/^[A-Z]/.test(n.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${n.expected}, àmọ̀ a rí ${A}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${t}, àmọ̀ a rí ${A}`}case"invalid_value":return n.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${j.stringifyPrimitive(n.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${j.joinValues(n.values,"|")}`;case"too_big":{const t=n.inclusive?"<=":"<",x=s(n.origin);return x?`Tó pọ̀ jù: a ní láti jẹ́ pé ${n.origin??"iye"} ${x.verb} ${t}${n.maximum} ${x.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${t}${n.maximum}`}case"too_small":{const t=n.inclusive?">=":">",x=s(n.origin);return x?`Kéré ju: a ní láti jẹ́ pé ${n.origin} ${x.verb} ${t}${n.minimum} ${x.unit}`:`Kéré ju: a ní láti jẹ́ ${t}${n.minimum}`}case"invalid_format":{const t=n;return t.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${u[t.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ọ̀: ${j.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 F(){return{localeError:T()}}r.exports=m.default})(ls,ls.exports);var c2=ls.exports;(function(r){var m=oa&&oa.__importDefault||function(ot){return ot&&ot.__esModule?ot:{default:ot}};Object.defineProperty(r,"__esModule",{value:!0}),r.zhCN=r.vi=r.uz=r.ur=r.uk=r.ua=r.tr=r.th=r.ta=r.sv=r.sl=r.ru=r.ro=r.pt=r.pl=r.ps=r.ota=r.no=r.nl=r.ms=r.mk=r.lt=r.ko=r.km=r.kh=r.ka=r.ja=r.it=r.is=r.id=r.hy=r.hu=r.hr=r.he=r.frCA=r.fr=r.fi=r.fa=r.es=r.eo=r.en=r.el=r.de=r.da=r.cs=r.ca=r.bg=r.be=r.az=r.ar=void 0,r.yo=r.zhTW=void 0;var C=pI;Object.defineProperty(r,"ar",{enumerable:!0,get:function(){return m(C).default}});var E=hI;Object.defineProperty(r,"az",{enumerable:!0,get:function(){return m(E).default}});var _=vI;Object.defineProperty(r,"be",{enumerable:!0,get:function(){return m(_).default}});var j=bI;Object.defineProperty(r,"bg",{enumerable:!0,get:function(){return m(j).default}});var T=yI;Object.defineProperty(r,"ca",{enumerable:!0,get:function(){return m(T).default}});var F=xI;Object.defineProperty(r,"cs",{enumerable:!0,get:function(){return m(F).default}});var c=_I;Object.defineProperty(r,"da",{enumerable:!0,get:function(){return m(c).default}});var s=wI;Object.defineProperty(r,"de",{enumerable:!0,get:function(){return m(s).default}});var u=SI;Object.defineProperty(r,"el",{enumerable:!0,get:function(){return m(u).default}});var v=og;Object.defineProperty(r,"en",{enumerable:!0,get:function(){return m(v).default}});var n=jI;Object.defineProperty(r,"eo",{enumerable:!0,get:function(){return m(n).default}});var t=$I;Object.defineProperty(r,"es",{enumerable:!0,get:function(){return m(t).default}});var x=kI;Object.defineProperty(r,"fa",{enumerable:!0,get:function(){return m(x).default}});var A=PI;Object.defineProperty(r,"fi",{enumerable:!0,get:function(){return m(A).default}});var te=NI;Object.defineProperty(r,"fr",{enumerable:!0,get:function(){return m(te).default}});var ee=CI;Object.defineProperty(r,"frCA",{enumerable:!0,get:function(){return m(ee).default}});var oe=OI;Object.defineProperty(r,"he",{enumerable:!0,get:function(){return m(oe).default}});var ie=MI;Object.defineProperty(r,"hr",{enumerable:!0,get:function(){return m(ie).default}});var ke=EI;Object.defineProperty(r,"hu",{enumerable:!0,get:function(){return m(ke).default}});var se=II;Object.defineProperty(r,"hy",{enumerable:!0,get:function(){return m(se).default}});var Oe=DI;Object.defineProperty(r,"id",{enumerable:!0,get:function(){return m(Oe).default}});var Se=AI;Object.defineProperty(r,"is",{enumerable:!0,get:function(){return m(Se).default}});var He=zI;Object.defineProperty(r,"it",{enumerable:!0,get:function(){return m(He).default}});var Ge=TI;Object.defineProperty(r,"ja",{enumerable:!0,get:function(){return m(Ge).default}});var it=RI;Object.defineProperty(r,"ka",{enumerable:!0,get:function(){return m(it).default}});var ht=LI;Object.defineProperty(r,"kh",{enumerable:!0,get:function(){return m(ht).default}});var kt=sg;Object.defineProperty(r,"km",{enumerable:!0,get:function(){return m(kt).default}});var Et=ZI;Object.defineProperty(r,"ko",{enumerable:!0,get:function(){return m(Et).default}});var It=UI;Object.defineProperty(r,"lt",{enumerable:!0,get:function(){return m(It).default}});var At=BI;Object.defineProperty(r,"mk",{enumerable:!0,get:function(){return m(At).default}});var Lt=FI;Object.defineProperty(r,"ms",{enumerable:!0,get:function(){return m(Lt).default}});var yt=GI;Object.defineProperty(r,"nl",{enumerable:!0,get:function(){return m(yt).default}});var Ft=VI;Object.defineProperty(r,"no",{enumerable:!0,get:function(){return m(Ft).default}});var fr=WI;Object.defineProperty(r,"ota",{enumerable:!0,get:function(){return m(fr).default}});var k=QI;Object.defineProperty(r,"ps",{enumerable:!0,get:function(){return m(k).default}});var O=HI;Object.defineProperty(r,"pl",{enumerable:!0,get:function(){return m(O).default}});var I=qI;Object.defineProperty(r,"pt",{enumerable:!0,get:function(){return m(I).default}});var U=JI;Object.defineProperty(r,"ro",{enumerable:!0,get:function(){return m(U).default}});var V=KI;Object.defineProperty(r,"ru",{enumerable:!0,get:function(){return m(V).default}});var J=XI;Object.defineProperty(r,"sl",{enumerable:!0,get:function(){return m(J).default}});var ae=YI;Object.defineProperty(r,"sv",{enumerable:!0,get:function(){return m(ae).default}});var be=e2;Object.defineProperty(r,"ta",{enumerable:!0,get:function(){return m(be).default}});var K=t2;Object.defineProperty(r,"th",{enumerable:!0,get:function(){return m(K).default}});var q=r2;Object.defineProperty(r,"tr",{enumerable:!0,get:function(){return m(q).default}});var ce=n2;Object.defineProperty(r,"ua",{enumerable:!0,get:function(){return m(ce).default}});var pe=lg;Object.defineProperty(r,"uk",{enumerable:!0,get:function(){return m(pe).default}});var Y=i2;Object.defineProperty(r,"ur",{enumerable:!0,get:function(){return m(Y).default}});var fe=a2;Object.defineProperty(r,"uz",{enumerable:!0,get:function(){return m(fe).default}});var Ie=o2;Object.defineProperty(r,"vi",{enumerable:!0,get:function(){return m(Ie).default}});var at=s2;Object.defineProperty(r,"zhCN",{enumerable:!0,get:function(){return m(at).default}});var Xe=l2;Object.defineProperty(r,"zhTW",{enumerable:!0,get:function(){return m(Xe).default}});var tt=c2;Object.defineProperty(r,"yo",{enumerable:!0,get:function(){return m(tt).default}})})(oa);var Bt={},Wm;Object.defineProperty(Bt,"__esModule",{value:!0});Bt.globalRegistry=Bt.$ZodRegistry=Bt.$input=Bt.$output=void 0;Bt.registry=ug;Bt.$output=Symbol("ZodOutput");Bt.$input=Symbol("ZodInput");class cg{constructor(){this._map=new WeakMap,this._idmap=new Map}add(m,...C){const E=C[0];return this._map.set(m,E),E&&typeof E=="object"&&"id"in E&&this._idmap.set(E.id,m),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(m){const C=this._map.get(m);return C&&typeof C=="object"&&"id"in C&&this._idmap.delete(C.id),this._map.delete(m),this}get(m){const C=m._zod.parent;if(C){const E={...this.get(C)??{}};delete E.id;const _={...E,...this._map.get(m)};return Object.keys(_).length?_:void 0}return this._map.get(m)}has(m){return this._map.has(m)}}Bt.$ZodRegistry=cg;function ug(){return new cg}(Wm=globalThis).__zod_globalRegistry??(Wm.__zod_globalRegistry=ug());Bt.globalRegistry=globalThis.__zod_globalRegistry;var de={},u2=de&&de.__createBinding||(Object.create?(function(r,m,C,E){E===void 0&&(E=C);var _=Object.getOwnPropertyDescriptor(m,C);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[C]}}),Object.defineProperty(r,E,_)}):(function(r,m,C,E){E===void 0&&(E=C),r[E]=m[C]})),d2=de&&de.__setModuleDefault||(Object.create?(function(r,m){Object.defineProperty(r,"default",{enumerable:!0,value:m})}):function(r,m){r.default=m}),ms=de&&de.__importStar||function(r){if(r&&r.__esModule)return r;var m={};if(r!=null)for(var C in r)C!=="default"&&Object.prototype.hasOwnProperty.call(r,C)&&u2(m,r,C);return d2(m,r),m};Object.defineProperty(de,"__esModule",{value:!0});de.TimePrecision=void 0;de._string=f2;de._coercedString=m2;de._email=g2;de._guid=p2;de._uuid=h2;de._uuidv4=v2;de._uuidv6=b2;de._uuidv7=y2;de._url=x2;de._emoji=_2;de._nanoid=w2;de._cuid=S2;de._cuid2=j2;de._ulid=$2;de._xid=k2;de._ksuid=P2;de._ipv4=N2;de._ipv6=C2;de._mac=O2;de._cidrv4=M2;de._cidrv6=E2;de._base64=I2;de._base64url=D2;de._e164=A2;de._jwt=z2;de._isoDateTime=T2;de._isoDate=R2;de._isoTime=L2;de._isoDuration=Z2;de._number=U2;de._coercedNumber=B2;de._int=F2;de._float32=G2;de._float64=V2;de._int32=W2;de._uint32=Q2;de._boolean=H2;de._coercedBoolean=q2;de._bigint=J2;de._coercedBigint=K2;de._int64=X2;de._uint64=Y2;de._symbol=eD;de._undefined=tD;de._null=rD;de._any=nD;de._unknown=iD;de._never=aD;de._void=oD;de._date=sD;de._coercedDate=lD;de._nan=cD;de._lt=dg;de._lte=ca;de._max=ca;de._lte=ca;de._max=ca;de._gt=fg;de._gte=ua;de._min=ua;de._gte=ua;de._min=ua;de._positive=uD;de._negative=dD;de._nonpositive=fD;de._nonnegative=mD;de._multipleOf=gD;de._maxSize=pD;de._minSize=hD;de._size=vD;de._maxLength=bD;de._minLength=yD;de._length=xD;de._regex=_D;de._lowercase=wD;de._uppercase=SD;de._includes=jD;de._startsWith=$D;de._endsWith=kD;de._property=PD;de._mime=ND;de._overwrite=Oi;de._normalize=CD;de._trim=OD;de._toLowerCase=MD;de._toUpperCase=ED;de._slugify=ID;de._array=DD;de._union=AD;de._xor=zD;de._discriminatedUnion=TD;de._intersection=RD;de._tuple=LD;de._record=ZD;de._map=UD;de._set=BD;de._enum=FD;de._nativeEnum=GD;de._literal=VD;de._file=WD;de._transform=QD;de._optional=HD;de._nullable=qD;de._default=JD;de._nonoptional=KD;de._success=XD;de._catch=YD;de._pipe=e4;de._readonly=t4;de._templateLiteral=r4;de._lazy=n4;de._promise=i4;de._custom=a4;de._refine=o4;de._superRefine=s4;de._check=mg;de.describe=l4;de.meta=c4;de._stringbool=u4;de._stringFormat=d4;const _t=ms(_r),cs=ms(Bt),co=ms(Mr),Ne=ms(le);function f2(r,m){return new r({type:"string",...Ne.normalizeParams(m)})}function m2(r,m){return new r({type:"string",coerce:!0,...Ne.normalizeParams(m)})}function g2(r,m){return new r({type:"string",format:"email",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function p2(r,m){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function h2(r,m){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function v2(r,m){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ne.normalizeParams(m)})}function b2(r,m){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ne.normalizeParams(m)})}function y2(r,m){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ne.normalizeParams(m)})}function x2(r,m){return new r({type:"string",format:"url",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function _2(r,m){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function w2(r,m){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function S2(r,m){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function j2(r,m){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function $2(r,m){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function k2(r,m){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function P2(r,m){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function N2(r,m){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function C2(r,m){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function O2(r,m){return new r({type:"string",format:"mac",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function M2(r,m){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function E2(r,m){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function I2(r,m){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function D2(r,m){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function A2(r,m){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}function z2(r,m){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...Ne.normalizeParams(m)})}de.TimePrecision={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function T2(r,m){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ne.normalizeParams(m)})}function R2(r,m){return new r({type:"string",format:"date",check:"string_format",...Ne.normalizeParams(m)})}function L2(r,m){return new r({type:"string",format:"time",check:"string_format",precision:null,...Ne.normalizeParams(m)})}function Z2(r,m){return new r({type:"string",format:"duration",check:"string_format",...Ne.normalizeParams(m)})}function U2(r,m){return new r({type:"number",checks:[],...Ne.normalizeParams(m)})}function B2(r,m){return new r({type:"number",coerce:!0,checks:[],...Ne.normalizeParams(m)})}function F2(r,m){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...Ne.normalizeParams(m)})}function G2(r,m){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...Ne.normalizeParams(m)})}function V2(r,m){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...Ne.normalizeParams(m)})}function W2(r,m){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...Ne.normalizeParams(m)})}function Q2(r,m){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...Ne.normalizeParams(m)})}function H2(r,m){return new r({type:"boolean",...Ne.normalizeParams(m)})}function q2(r,m){return new r({type:"boolean",coerce:!0,...Ne.normalizeParams(m)})}function J2(r,m){return new r({type:"bigint",...Ne.normalizeParams(m)})}function K2(r,m){return new r({type:"bigint",coerce:!0,...Ne.normalizeParams(m)})}function X2(r,m){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Ne.normalizeParams(m)})}function Y2(r,m){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Ne.normalizeParams(m)})}function eD(r,m){return new r({type:"symbol",...Ne.normalizeParams(m)})}function tD(r,m){return new r({type:"undefined",...Ne.normalizeParams(m)})}function rD(r,m){return new r({type:"null",...Ne.normalizeParams(m)})}function nD(r){return new r({type:"any"})}function iD(r){return new r({type:"unknown"})}function aD(r,m){return new r({type:"never",...Ne.normalizeParams(m)})}function oD(r,m){return new r({type:"void",...Ne.normalizeParams(m)})}function sD(r,m){return new r({type:"date",...Ne.normalizeParams(m)})}function lD(r,m){return new r({type:"date",coerce:!0,...Ne.normalizeParams(m)})}function cD(r,m){return new r({type:"nan",...Ne.normalizeParams(m)})}function dg(r,m){return new _t.$ZodCheckLessThan({check:"less_than",...Ne.normalizeParams(m),value:r,inclusive:!1})}function ca(r,m){return new _t.$ZodCheckLessThan({check:"less_than",...Ne.normalizeParams(m),value:r,inclusive:!0})}function fg(r,m){return new _t.$ZodCheckGreaterThan({check:"greater_than",...Ne.normalizeParams(m),value:r,inclusive:!1})}function ua(r,m){return new _t.$ZodCheckGreaterThan({check:"greater_than",...Ne.normalizeParams(m),value:r,inclusive:!0})}function uD(r){return fg(0,r)}function dD(r){return dg(0,r)}function fD(r){return ca(0,r)}function mD(r){return ua(0,r)}function gD(r,m){return new _t.$ZodCheckMultipleOf({check:"multiple_of",...Ne.normalizeParams(m),value:r})}function pD(r,m){return new _t.$ZodCheckMaxSize({check:"max_size",...Ne.normalizeParams(m),maximum:r})}function hD(r,m){return new _t.$ZodCheckMinSize({check:"min_size",...Ne.normalizeParams(m),minimum:r})}function vD(r,m){return new _t.$ZodCheckSizeEquals({check:"size_equals",...Ne.normalizeParams(m),size:r})}function bD(r,m){return new _t.$ZodCheckMaxLength({check:"max_length",...Ne.normalizeParams(m),maximum:r})}function yD(r,m){return new _t.$ZodCheckMinLength({check:"min_length",...Ne.normalizeParams(m),minimum:r})}function xD(r,m){return new _t.$ZodCheckLengthEquals({check:"length_equals",...Ne.normalizeParams(m),length:r})}function _D(r,m){return new _t.$ZodCheckRegex({check:"string_format",format:"regex",...Ne.normalizeParams(m),pattern:r})}function wD(r){return new _t.$ZodCheckLowerCase({check:"string_format",format:"lowercase",...Ne.normalizeParams(r)})}function SD(r){return new _t.$ZodCheckUpperCase({check:"string_format",format:"uppercase",...Ne.normalizeParams(r)})}function jD(r,m){return new _t.$ZodCheckIncludes({check:"string_format",format:"includes",...Ne.normalizeParams(m),includes:r})}function $D(r,m){return new _t.$ZodCheckStartsWith({check:"string_format",format:"starts_with",...Ne.normalizeParams(m),prefix:r})}function kD(r,m){return new _t.$ZodCheckEndsWith({check:"string_format",format:"ends_with",...Ne.normalizeParams(m),suffix:r})}function PD(r,m,C){return new _t.$ZodCheckProperty({check:"property",property:r,schema:m,...Ne.normalizeParams(C)})}function ND(r,m){return new _t.$ZodCheckMimeType({check:"mime_type",mime:r,...Ne.normalizeParams(m)})}function Oi(r){return new _t.$ZodCheckOverwrite({check:"overwrite",tx:r})}function CD(r){return Oi(m=>m.normalize(r))}function OD(){return Oi(r=>r.trim())}function MD(){return Oi(r=>r.toLowerCase())}function ED(){return Oi(r=>r.toUpperCase())}function ID(){return Oi(r=>Ne.slugify(r))}function DD(r,m,C){return new r({type:"array",element:m,...Ne.normalizeParams(C)})}function AD(r,m,C){return new r({type:"union",options:m,...Ne.normalizeParams(C)})}function zD(r,m,C){return new r({type:"union",options:m,inclusive:!1,...Ne.normalizeParams(C)})}function TD(r,m,C,E){return new r({type:"union",options:C,discriminator:m,...Ne.normalizeParams(E)})}function RD(r,m,C){return new r({type:"intersection",left:m,right:C})}function LD(r,m,C,E){const _=C instanceof co.$ZodType,j=_?E:C,T=_?C:null;return new r({type:"tuple",items:m,rest:T,...Ne.normalizeParams(j)})}function ZD(r,m,C,E){return new r({type:"record",keyType:m,valueType:C,...Ne.normalizeParams(E)})}function UD(r,m,C,E){return new r({type:"map",keyType:m,valueType:C,...Ne.normalizeParams(E)})}function BD(r,m,C){return new r({type:"set",valueType:m,...Ne.normalizeParams(C)})}function FD(r,m,C){const E=Array.isArray(m)?Object.fromEntries(m.map(_=>[_,_])):m;return new r({type:"enum",entries:E,...Ne.normalizeParams(C)})}function GD(r,m,C){return new r({type:"enum",entries:m,...Ne.normalizeParams(C)})}function VD(r,m,C){return new r({type:"literal",values:Array.isArray(m)?m:[m],...Ne.normalizeParams(C)})}function WD(r,m){return new r({type:"file",...Ne.normalizeParams(m)})}function QD(r,m){return new r({type:"transform",transform:m})}function HD(r,m){return new r({type:"optional",innerType:m})}function qD(r,m){return new r({type:"nullable",innerType:m})}function JD(r,m,C){return new r({type:"default",innerType:m,get defaultValue(){return typeof C=="function"?C():Ne.shallowClone(C)}})}function KD(r,m,C){return new r({type:"nonoptional",innerType:m,...Ne.normalizeParams(C)})}function XD(r,m){return new r({type:"success",innerType:m})}function YD(r,m,C){return new r({type:"catch",innerType:m,catchValue:typeof C=="function"?C:()=>C})}function e4(r,m,C){return new r({type:"pipe",in:m,out:C})}function t4(r,m){return new r({type:"readonly",innerType:m})}function r4(r,m,C){return new r({type:"template_literal",parts:m,...Ne.normalizeParams(C)})}function n4(r,m){return new r({type:"lazy",getter:m})}function i4(r,m){return new r({type:"promise",innerType:m})}function a4(r,m,C){const E=Ne.normalizeParams(C);return E.abort??(E.abort=!0),new r({type:"custom",check:"custom",fn:m,...E})}function o4(r,m,C){return new r({type:"custom",check:"custom",fn:m,...Ne.normalizeParams(C)})}function s4(r,m){const C=mg(E=>(E.addIssue=_=>{if(typeof _=="string")E.issues.push(Ne.issue(_,E.value,C._zod.def));else{const j=_;j.fatal&&(j.continue=!1),j.code??(j.code="custom"),j.input??(j.input=E.value),j.inst??(j.inst=C),j.continue??(j.continue=!C._zod.def.abort),E.issues.push(Ne.issue(j))}},r(E.value,E)),m);return C}function mg(r,m){const C=new _t.$ZodCheck({check:"custom",...Ne.normalizeParams(m)});return C._zod.check=r,C}function l4(r){const m=new _t.$ZodCheck({check:"describe"});return m._zod.onattach=[C=>{const E=cs.globalRegistry.get(C)??{};cs.globalRegistry.add(C,{...E,description:r})}],m._zod.check=()=>{},m}function c4(r){const m=new _t.$ZodCheck({check:"meta"});return m._zod.onattach=[C=>{const E=cs.globalRegistry.get(C)??{};cs.globalRegistry.add(C,{...E,...r})}],m._zod.check=()=>{},m}function u4(r,m){const C=Ne.normalizeParams(m);let E=C.truthy??["true","1","yes","on","y","enabled"],_=C.falsy??["false","0","no","off","n","disabled"];C.case!=="sensitive"&&(E=E.map(t=>typeof t=="string"?t.toLowerCase():t),_=_.map(t=>typeof t=="string"?t.toLowerCase():t));const j=new Set(E),T=new Set(_),F=r.Codec??co.$ZodCodec,c=r.Boolean??co.$ZodBoolean,s=r.String??co.$ZodString,u=new s({type:"string",error:C.error}),v=new c({type:"boolean",error:C.error}),n=new F({type:"pipe",in:u,out:v,transform:((t,x)=>{let A=t;return C.case!=="sensitive"&&(A=A.toLowerCase()),j.has(A)?!0:T.has(A)?!1:(x.issues.push({code:"invalid_value",expected:"stringbool",values:[...j,...T],input:x.value,inst:n,continue:!1}),{})}),reverseTransform:((t,x)=>t===!0?E[0]||"true":_[0]||"false"),error:C.error});return n}function d4(r,m,C,E={}){const _=Ne.normalizeParams(E),j={...Ne.normalizeParams(E),check:"string_format",type:"string",format:m,fn:typeof C=="function"?C:F=>C.test(F),..._};return C instanceof RegExp&&(j.pattern=C),new r(j)}var da={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.createStandardJSONSchemaMethod=r.createToJSONSchemaMethod=void 0,r.initializeContext=C,r.process=E,r.extractDefs=_,r.finalize=j;const m=Bt;function C(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??m.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 E(s,u,v={path:[],schemaPath:[]}){var n;const t=s._zod.def,x=u.seen.get(s);if(x)return x.count++,v.schemaPath.includes(s)&&(x.cycle=v.path),x.schema;const A={schema:{},count:1,cycle:void 0,path:v.path};u.seen.set(s,A);const te=s._zod.toJSONSchema?.();if(te)A.schema=te;else{const ie={...v,schemaPath:[...v.schemaPath,s],path:v.path};if(s._zod.processJSONSchema)s._zod.processJSONSchema(u,A.schema,ie);else{const se=A.schema,Oe=u.processors[t.type];if(!Oe)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);Oe(s,u,se,ie)}const ke=s._zod.parent;ke&&(A.ref||(A.ref=ke),E(ke,u,ie),u.seen.get(ke).isParent=!0)}const ee=u.metadataRegistry.get(s);return ee&&Object.assign(A.schema,ee),u.io==="input"&&T(s)&&(delete A.schema.examples,delete A.schema.default),u.io==="input"&&"_prefault"in A.schema&&((n=A.schema).default??(n.default=A.schema._prefault)),delete A.schema._prefault,u.seen.get(s).schema}function _(s,u){const v=s.seen.get(u);if(!v)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const A of s.seen.entries()){const te=s.metadataRegistry.get(A[0])?.id;if(te){const ee=n.get(te);if(ee&&ee!==A[0])throw new Error(`Duplicate schema id "${te}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(te,A[0])}}const t=A=>{const te=s.target==="draft-2020-12"?"$defs":"definitions";if(s.external){const ke=s.external.registry.get(A[0])?.id,se=s.external.uri??(Se=>Se);if(ke)return{ref:se(ke)};const Oe=A[1].defId??A[1].schema.id??`schema${s.counter++}`;return A[1].defId=Oe,{defId:Oe,ref:`${se("__shared")}#/${te}/${Oe}`}}if(A[1]===v)return{ref:"#"};const oe=`#/${te}/`,ie=A[1].schema.id??`__schema${s.counter++}`;return{defId:ie,ref:oe+ie}},x=A=>{if(A[1].schema.$ref)return;const te=A[1],{ref:ee,defId:oe}=t(A);te.def={...te.schema},oe&&(te.defId=oe);const ie=te.schema;for(const ke in ie)delete ie[ke];ie.$ref=ee};if(s.cycles==="throw")for(const A of s.seen.entries()){const te=A[1];if(te.cycle)throw new Error(`Cycle detected: #/${te.cycle?.join("/")}/<root>
|
|
93
|
+
|
|
94
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const A of s.seen.entries()){const te=A[1];if(u===A[0]){x(A);continue}if(s.external){const oe=s.external.registry.get(A[0])?.id;if(u!==A[0]&&oe){x(A);continue}}if(s.metadataRegistry.get(A[0])?.id){x(A);continue}if(te.cycle){x(A);continue}if(te.count>1&&s.reused==="ref"){x(A);continue}}}function j(s,u){const v=s.seen.get(u);if(!v)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=te=>{const ee=s.seen.get(te);if(ee.ref===null)return;const oe=ee.def??ee.schema,ie={...oe},ke=ee.ref;if(ee.ref=null,ke){n(ke);const Oe=s.seen.get(ke),Se=Oe.schema;if(Se.$ref&&(s.target==="draft-07"||s.target==="draft-04"||s.target==="openapi-3.0")?(oe.allOf=oe.allOf??[],oe.allOf.push(Se)):Object.assign(oe,Se),Object.assign(oe,ie),te._zod.parent===ke)for(const Ge in oe)Ge==="$ref"||Ge==="allOf"||Ge in ie||delete oe[Ge];if(Se.$ref&&Oe.def)for(const Ge in oe)Ge==="$ref"||Ge==="allOf"||Ge in Oe.def&&JSON.stringify(oe[Ge])===JSON.stringify(Oe.def[Ge])&&delete oe[Ge]}const se=te._zod.parent;if(se&&se!==ke){n(se);const Oe=s.seen.get(se);if(Oe?.schema.$ref&&(oe.$ref=Oe.schema.$ref,Oe.def))for(const Se in oe)Se==="$ref"||Se==="allOf"||Se in Oe.def&&JSON.stringify(oe[Se])===JSON.stringify(Oe.def[Se])&&delete oe[Se]}s.override({zodSchema:te,jsonSchema:oe,path:ee.path??[]})};for(const te of[...s.seen.entries()].reverse())n(te[0]);const t={};if(s.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":s.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":s.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":s.target,s.external?.uri){const te=s.external.registry.get(u)?.id;if(!te)throw new Error("Schema is missing an `id` property");t.$id=s.external.uri(te)}Object.assign(t,v.def??v.schema);const x=s.metadataRegistry.get(u)?.id;x!==void 0&&t.id===x&&delete t.id;const A=s.external?.defs??{};for(const te of s.seen.entries()){const ee=te[1];ee.def&&ee.defId&&(ee.def.id===ee.defId&&delete ee.def.id,A[ee.defId]=ee.def)}s.external||Object.keys(A).length>0&&(s.target==="draft-2020-12"?t.$defs=A:t.definitions=A);try{const te=JSON.parse(JSON.stringify(t));return Object.defineProperty(te,"~standard",{value:{...u["~standard"],jsonSchema:{input:(0,r.createStandardJSONSchemaMethod)(u,"input",s.processors),output:(0,r.createStandardJSONSchemaMethod)(u,"output",s.processors)}},enumerable:!1,writable:!1}),te}catch{throw new Error("Error converting schema to JSON.")}}function T(s,u){const v=u??{seen:new Set};if(v.seen.has(s))return!1;v.seen.add(s);const n=s._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return T(n.element,v);if(n.type==="set")return T(n.valueType,v);if(n.type==="lazy")return T(n.getter(),v);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return T(n.innerType,v);if(n.type==="intersection")return T(n.left,v)||T(n.right,v);if(n.type==="record"||n.type==="map")return T(n.keyType,v)||T(n.valueType,v);if(n.type==="pipe")return s._zod.traits.has("$ZodCodec")?!0:T(n.in,v)||T(n.out,v);if(n.type==="object"){for(const t in n.shape)if(T(n.shape[t],v))return!0;return!1}if(n.type==="union"){for(const t of n.options)if(T(t,v))return!0;return!1}if(n.type==="tuple"){for(const t of n.items)if(T(t,v))return!0;return!!(n.rest&&T(n.rest,v))}return!1}const F=(s,u={})=>v=>{const n=C({...v,processors:u});return E(s,n),_(n,s),j(n,s)};r.createToJSONSchemaMethod=F;const c=(s,u,v={})=>n=>{const{libraryOptions:t,target:x}=n??{},A=C({...t??{},target:x,io:u,processors:v});return E(s,A),_(A,s),j(A,s)};r.createStandardJSONSchemaMethod=c})(da);var fa={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.allProcessors=r.lazyProcessor=r.optionalProcessor=r.promiseProcessor=r.readonlyProcessor=r.pipeProcessor=r.catchProcessor=r.prefaultProcessor=r.defaultProcessor=r.nonoptionalProcessor=r.nullableProcessor=r.recordProcessor=r.tupleProcessor=r.intersectionProcessor=r.unionProcessor=r.objectProcessor=r.arrayProcessor=r.setProcessor=r.mapProcessor=r.transformProcessor=r.functionProcessor=r.customProcessor=r.successProcessor=r.fileProcessor=r.templateLiteralProcessor=r.nanProcessor=r.literalProcessor=r.enumProcessor=r.dateProcessor=r.unknownProcessor=r.anyProcessor=r.neverProcessor=r.voidProcessor=r.undefinedProcessor=r.nullProcessor=r.symbolProcessor=r.bigintProcessor=r.booleanProcessor=r.numberProcessor=r.stringProcessor=void 0,r.toJSONSchema=be;const m=da,C=le,E={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_=(K,q,ce,pe)=>{const Y=ce;Y.type="string";const{minimum:fe,maximum:Ie,format:at,patterns:Xe,contentEncoding:tt}=K._zod.bag;if(typeof fe=="number"&&(Y.minLength=fe),typeof Ie=="number"&&(Y.maxLength=Ie),at&&(Y.format=E[at]??at,Y.format===""&&delete Y.format,at==="time"&&delete Y.format),tt&&(Y.contentEncoding=tt),Xe&&Xe.size>0){const ot=[...Xe];ot.length===1?Y.pattern=ot[0].source:ot.length>1&&(Y.allOf=[...ot.map(gt=>({...q.target==="draft-07"||q.target==="draft-04"||q.target==="openapi-3.0"?{type:"string"}:{},pattern:gt.source}))])}};r.stringProcessor=_;const j=(K,q,ce,pe)=>{const Y=ce,{minimum:fe,maximum:Ie,format:at,multipleOf:Xe,exclusiveMaximum:tt,exclusiveMinimum:ot}=K._zod.bag;typeof at=="string"&&at.includes("int")?Y.type="integer":Y.type="number";const gt=typeof ot=="number"&&ot>=(fe??Number.NEGATIVE_INFINITY),ct=typeof tt=="number"&&tt<=(Ie??Number.POSITIVE_INFINITY),mt=q.target==="draft-04"||q.target==="openapi-3.0";gt?mt?(Y.minimum=ot,Y.exclusiveMinimum=!0):Y.exclusiveMinimum=ot:typeof fe=="number"&&(Y.minimum=fe),ct?mt?(Y.maximum=tt,Y.exclusiveMaximum=!0):Y.exclusiveMaximum=tt:typeof Ie=="number"&&(Y.maximum=Ie),typeof Xe=="number"&&(Y.multipleOf=Xe)};r.numberProcessor=j;const T=(K,q,ce,pe)=>{ce.type="boolean"};r.booleanProcessor=T;const F=(K,q,ce,pe)=>{if(q.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")};r.bigintProcessor=F;const c=(K,q,ce,pe)=>{if(q.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")};r.symbolProcessor=c;const s=(K,q,ce,pe)=>{q.target==="openapi-3.0"?(ce.type="string",ce.nullable=!0,ce.enum=[null]):ce.type="null"};r.nullProcessor=s;const u=(K,q,ce,pe)=>{if(q.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")};r.undefinedProcessor=u;const v=(K,q,ce,pe)=>{if(q.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")};r.voidProcessor=v;const n=(K,q,ce,pe)=>{ce.not={}};r.neverProcessor=n;const t=(K,q,ce,pe)=>{};r.anyProcessor=t;const x=(K,q,ce,pe)=>{};r.unknownProcessor=x;const A=(K,q,ce,pe)=>{if(q.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")};r.dateProcessor=A;const te=(K,q,ce,pe)=>{const Y=K._zod.def,fe=(0,C.getEnumValues)(Y.entries);fe.every(Ie=>typeof Ie=="number")&&(ce.type="number"),fe.every(Ie=>typeof Ie=="string")&&(ce.type="string"),ce.enum=fe};r.enumProcessor=te;const ee=(K,q,ce,pe)=>{const Y=K._zod.def,fe=[];for(const Ie of Y.values)if(Ie===void 0){if(q.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof Ie=="bigint"){if(q.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");fe.push(Number(Ie))}else fe.push(Ie);if(fe.length!==0)if(fe.length===1){const Ie=fe[0];ce.type=Ie===null?"null":typeof Ie,q.target==="draft-04"||q.target==="openapi-3.0"?ce.enum=[Ie]:ce.const=Ie}else fe.every(Ie=>typeof Ie=="number")&&(ce.type="number"),fe.every(Ie=>typeof Ie=="string")&&(ce.type="string"),fe.every(Ie=>typeof Ie=="boolean")&&(ce.type="boolean"),fe.every(Ie=>Ie===null)&&(ce.type="null"),ce.enum=fe};r.literalProcessor=ee;const oe=(K,q,ce,pe)=>{if(q.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")};r.nanProcessor=oe;const ie=(K,q,ce,pe)=>{const Y=ce,fe=K._zod.pattern;if(!fe)throw new Error("Pattern not found in template literal");Y.type="string",Y.pattern=fe.source};r.templateLiteralProcessor=ie;const ke=(K,q,ce,pe)=>{const Y=ce,fe={type:"string",format:"binary",contentEncoding:"binary"},{minimum:Ie,maximum:at,mime:Xe}=K._zod.bag;Ie!==void 0&&(fe.minLength=Ie),at!==void 0&&(fe.maxLength=at),Xe?Xe.length===1?(fe.contentMediaType=Xe[0],Object.assign(Y,fe)):(Object.assign(Y,fe),Y.anyOf=Xe.map(tt=>({contentMediaType:tt}))):Object.assign(Y,fe)};r.fileProcessor=ke;const se=(K,q,ce,pe)=>{ce.type="boolean"};r.successProcessor=se;const Oe=(K,q,ce,pe)=>{if(q.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};r.customProcessor=Oe;const Se=(K,q,ce,pe)=>{if(q.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")};r.functionProcessor=Se;const He=(K,q,ce,pe)=>{if(q.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};r.transformProcessor=He;const Ge=(K,q,ce,pe)=>{if(q.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")};r.mapProcessor=Ge;const it=(K,q,ce,pe)=>{if(q.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")};r.setProcessor=it;const ht=(K,q,ce,pe)=>{const Y=ce,fe=K._zod.def,{minimum:Ie,maximum:at}=K._zod.bag;typeof Ie=="number"&&(Y.minItems=Ie),typeof at=="number"&&(Y.maxItems=at),Y.type="array",Y.items=(0,m.process)(fe.element,q,{...pe,path:[...pe.path,"items"]})};r.arrayProcessor=ht;const kt=(K,q,ce,pe)=>{const Y=ce,fe=K._zod.def;Y.type="object",Y.properties={};const Ie=fe.shape;for(const tt in Ie)Y.properties[tt]=(0,m.process)(Ie[tt],q,{...pe,path:[...pe.path,"properties",tt]});const at=new Set(Object.keys(Ie)),Xe=new Set([...at].filter(tt=>{const ot=fe.shape[tt]._zod;return q.io==="input"?ot.optin===void 0:ot.optout===void 0}));Xe.size>0&&(Y.required=Array.from(Xe)),fe.catchall?._zod.def.type==="never"?Y.additionalProperties=!1:fe.catchall?fe.catchall&&(Y.additionalProperties=(0,m.process)(fe.catchall,q,{...pe,path:[...pe.path,"additionalProperties"]})):q.io==="output"&&(Y.additionalProperties=!1)};r.objectProcessor=kt;const Et=(K,q,ce,pe)=>{const Y=K._zod.def,fe=Y.inclusive===!1,Ie=Y.options.map((at,Xe)=>(0,m.process)(at,q,{...pe,path:[...pe.path,fe?"oneOf":"anyOf",Xe]}));fe?ce.oneOf=Ie:ce.anyOf=Ie};r.unionProcessor=Et;const It=(K,q,ce,pe)=>{const Y=K._zod.def,fe=(0,m.process)(Y.left,q,{...pe,path:[...pe.path,"allOf",0]}),Ie=(0,m.process)(Y.right,q,{...pe,path:[...pe.path,"allOf",1]}),at=tt=>"allOf"in tt&&Object.keys(tt).length===1,Xe=[...at(fe)?fe.allOf:[fe],...at(Ie)?Ie.allOf:[Ie]];ce.allOf=Xe};r.intersectionProcessor=It;const At=(K,q,ce,pe)=>{const Y=ce,fe=K._zod.def;Y.type="array";const Ie=q.target==="draft-2020-12"?"prefixItems":"items",at=q.target==="draft-2020-12"||q.target==="openapi-3.0"?"items":"additionalItems",Xe=fe.items.map((ct,mt)=>(0,m.process)(ct,q,{...pe,path:[...pe.path,Ie,mt]})),tt=fe.rest?(0,m.process)(fe.rest,q,{...pe,path:[...pe.path,at,...q.target==="openapi-3.0"?[fe.items.length]:[]]}):null;q.target==="draft-2020-12"?(Y.prefixItems=Xe,tt&&(Y.items=tt)):q.target==="openapi-3.0"?(Y.items={anyOf:Xe},tt&&Y.items.anyOf.push(tt),Y.minItems=Xe.length,tt||(Y.maxItems=Xe.length)):(Y.items=Xe,tt&&(Y.additionalItems=tt));const{minimum:ot,maximum:gt}=K._zod.bag;typeof ot=="number"&&(Y.minItems=ot),typeof gt=="number"&&(Y.maxItems=gt)};r.tupleProcessor=At;const Lt=(K,q,ce,pe)=>{const Y=ce,fe=K._zod.def;Y.type="object";const Ie=fe.keyType,Xe=Ie._zod.bag?.patterns;if(fe.mode==="loose"&&Xe&&Xe.size>0){const ot=(0,m.process)(fe.valueType,q,{...pe,path:[...pe.path,"patternProperties","*"]});Y.patternProperties={};for(const gt of Xe)Y.patternProperties[gt.source]=ot}else(q.target==="draft-07"||q.target==="draft-2020-12")&&(Y.propertyNames=(0,m.process)(fe.keyType,q,{...pe,path:[...pe.path,"propertyNames"]})),Y.additionalProperties=(0,m.process)(fe.valueType,q,{...pe,path:[...pe.path,"additionalProperties"]});const tt=Ie._zod.values;if(tt){const ot=[...tt].filter(gt=>typeof gt=="string"||typeof gt=="number");ot.length>0&&(Y.required=ot)}};r.recordProcessor=Lt;const yt=(K,q,ce,pe)=>{const Y=K._zod.def,fe=(0,m.process)(Y.innerType,q,pe),Ie=q.seen.get(K);q.target==="openapi-3.0"?(Ie.ref=Y.innerType,ce.nullable=!0):ce.anyOf=[fe,{type:"null"}]};r.nullableProcessor=yt;const Ft=(K,q,ce,pe)=>{const Y=K._zod.def;(0,m.process)(Y.innerType,q,pe);const fe=q.seen.get(K);fe.ref=Y.innerType};r.nonoptionalProcessor=Ft;const fr=(K,q,ce,pe)=>{const Y=K._zod.def;(0,m.process)(Y.innerType,q,pe);const fe=q.seen.get(K);fe.ref=Y.innerType,ce.default=JSON.parse(JSON.stringify(Y.defaultValue))};r.defaultProcessor=fr;const k=(K,q,ce,pe)=>{const Y=K._zod.def;(0,m.process)(Y.innerType,q,pe);const fe=q.seen.get(K);fe.ref=Y.innerType,q.io==="input"&&(ce._prefault=JSON.parse(JSON.stringify(Y.defaultValue)))};r.prefaultProcessor=k;const O=(K,q,ce,pe)=>{const Y=K._zod.def;(0,m.process)(Y.innerType,q,pe);const fe=q.seen.get(K);fe.ref=Y.innerType;let Ie;try{Ie=Y.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}ce.default=Ie};r.catchProcessor=O;const I=(K,q,ce,pe)=>{const Y=K._zod.def,fe=Y.in._zod.traits.has("$ZodTransform"),Ie=q.io==="input"?fe?Y.out:Y.in:Y.out;(0,m.process)(Ie,q,pe);const at=q.seen.get(K);at.ref=Ie};r.pipeProcessor=I;const U=(K,q,ce,pe)=>{const Y=K._zod.def;(0,m.process)(Y.innerType,q,pe);const fe=q.seen.get(K);fe.ref=Y.innerType,ce.readOnly=!0};r.readonlyProcessor=U;const V=(K,q,ce,pe)=>{const Y=K._zod.def;(0,m.process)(Y.innerType,q,pe);const fe=q.seen.get(K);fe.ref=Y.innerType};r.promiseProcessor=V;const J=(K,q,ce,pe)=>{const Y=K._zod.def;(0,m.process)(Y.innerType,q,pe);const fe=q.seen.get(K);fe.ref=Y.innerType};r.optionalProcessor=J;const ae=(K,q,ce,pe)=>{const Y=K._zod.innerType;(0,m.process)(Y,q,pe);const fe=q.seen.get(K);fe.ref=Y};r.lazyProcessor=ae,r.allProcessors={string:r.stringProcessor,number:r.numberProcessor,boolean:r.booleanProcessor,bigint:r.bigintProcessor,symbol:r.symbolProcessor,null:r.nullProcessor,undefined:r.undefinedProcessor,void:r.voidProcessor,never:r.neverProcessor,any:r.anyProcessor,unknown:r.unknownProcessor,date:r.dateProcessor,enum:r.enumProcessor,literal:r.literalProcessor,nan:r.nanProcessor,template_literal:r.templateLiteralProcessor,file:r.fileProcessor,success:r.successProcessor,custom:r.customProcessor,function:r.functionProcessor,transform:r.transformProcessor,map:r.mapProcessor,set:r.setProcessor,array:r.arrayProcessor,object:r.objectProcessor,union:r.unionProcessor,intersection:r.intersectionProcessor,tuple:r.tupleProcessor,record:r.recordProcessor,nullable:r.nullableProcessor,nonoptional:r.nonoptionalProcessor,default:r.defaultProcessor,prefault:r.prefaultProcessor,catch:r.catchProcessor,pipe:r.pipeProcessor,readonly:r.readonlyProcessor,promise:r.promiseProcessor,optional:r.optionalProcessor,lazy:r.lazyProcessor};function be(K,q){if("_idmap"in K){const pe=K,Y=(0,m.initializeContext)({...q,processors:r.allProcessors}),fe={};for(const Xe of pe._idmap.entries()){const[tt,ot]=Xe;(0,m.process)(ot,Y)}const Ie={},at={registry:pe,uri:q?.uri,defs:fe};Y.external=at;for(const Xe of pe._idmap.entries()){const[tt,ot]=Xe;(0,m.extractDefs)(Y,ot),Ie[tt]=(0,m.finalize)(Y,ot)}if(Object.keys(fe).length>0){const Xe=Y.target==="draft-2020-12"?"$defs":"definitions";Ie.__shared={[Xe]:fe}}return{schemas:Ie}}const ce=(0,m.initializeContext)({...q,processors:r.allProcessors});return(0,m.process)(K,ce),(0,m.extractDefs)(ce,K),(0,m.finalize)(ce,K)}})(fa);var gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.JSONSchemaGenerator=void 0;const f4=fa,lo=da;class m4{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(m){this.ctx.counter=m}get seen(){return this.ctx.seen}constructor(m){let C=m?.target??"draft-2020-12";C==="draft-4"&&(C="draft-04"),C==="draft-7"&&(C="draft-07"),this.ctx=(0,lo.initializeContext)({processors:f4.allProcessors,target:C,...m?.metadata&&{metadata:m.metadata},...m?.unrepresentable&&{unrepresentable:m.unrepresentable},...m?.override&&{override:m.override},...m?.io&&{io:m.io}})}process(m,C={path:[],schemaPath:[]}){return(0,lo.process)(m,this.ctx,C)}emit(m,C){C&&(C.cycles&&(this.ctx.cycles=C.cycles),C.reused&&(this.ctx.reused=C.reused),C.external&&(this.ctx.external=C.external)),(0,lo.extractDefs)(this.ctx,m);const E=(0,lo.finalize)(this.ctx,m),{"~standard":_,...j}=E;return j}}gs.JSONSchemaGenerator=m4;var gg={};Object.defineProperty(gg,"__esModule",{value:!0});(function(r){var m=$t&&$t.__createBinding||(Object.create?(function(F,c,s,u){u===void 0&&(u=s);var v=Object.getOwnPropertyDescriptor(c,s);(!v||("get"in v?!c.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return c[s]}}),Object.defineProperty(F,u,v)}):(function(F,c,s,u){u===void 0&&(u=s),F[u]=c[s]})),C=$t&&$t.__setModuleDefault||(Object.create?(function(F,c){Object.defineProperty(F,"default",{enumerable:!0,value:c})}):function(F,c){F.default=c}),E=$t&&$t.__exportStar||function(F,c){for(var s in F)s!=="default"&&!Object.prototype.hasOwnProperty.call(c,s)&&m(c,F,s)},_=$t&&$t.__importStar||function(F){if(F&&F.__esModule)return F;var c={};if(F!=null)for(var s in F)s!=="default"&&Object.prototype.hasOwnProperty.call(F,s)&&m(c,F,s);return C(c,F),c};Object.defineProperty(r,"__esModule",{value:!0}),r.JSONSchema=r.JSONSchemaGenerator=r.toJSONSchema=r.locales=r.regexes=r.util=void 0,E(on,r),E(Or,r),E(Ot,r),E(Mr,r),E(_r,r),E(la,r),r.util=_(le),r.regexes=_(wr),r.locales=_(oa),E(Bt,r),E(sa,r),E(de,r),E(da,r);var j=fa;Object.defineProperty(r,"toJSONSchema",{enumerable:!0,get:function(){return j.toJSONSchema}});var T=gs;Object.defineProperty(r,"JSONSchemaGenerator",{enumerable:!0,get:function(){return T.JSONSchemaGenerator}}),r.JSONSchema=_(gg)})($t);var Nr={},ps={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.slugify=r.toUpperCase=r.toLowerCase=r.trim=r.normalize=r.overwrite=r.mime=r.property=r.endsWith=r.startsWith=r.includes=r.uppercase=r.lowercase=r.regex=r.length=r.minLength=r.maxLength=r.size=r.minSize=r.maxSize=r.multipleOf=r.nonnegative=r.nonpositive=r.negative=r.positive=r.gte=r.gt=r.lte=r.lt=void 0;var m=$t;Object.defineProperty(r,"lt",{enumerable:!0,get:function(){return m._lt}}),Object.defineProperty(r,"lte",{enumerable:!0,get:function(){return m._lte}}),Object.defineProperty(r,"gt",{enumerable:!0,get:function(){return m._gt}}),Object.defineProperty(r,"gte",{enumerable:!0,get:function(){return m._gte}}),Object.defineProperty(r,"positive",{enumerable:!0,get:function(){return m._positive}}),Object.defineProperty(r,"negative",{enumerable:!0,get:function(){return m._negative}}),Object.defineProperty(r,"nonpositive",{enumerable:!0,get:function(){return m._nonpositive}}),Object.defineProperty(r,"nonnegative",{enumerable:!0,get:function(){return m._nonnegative}}),Object.defineProperty(r,"multipleOf",{enumerable:!0,get:function(){return m._multipleOf}}),Object.defineProperty(r,"maxSize",{enumerable:!0,get:function(){return m._maxSize}}),Object.defineProperty(r,"minSize",{enumerable:!0,get:function(){return m._minSize}}),Object.defineProperty(r,"size",{enumerable:!0,get:function(){return m._size}}),Object.defineProperty(r,"maxLength",{enumerable:!0,get:function(){return m._maxLength}}),Object.defineProperty(r,"minLength",{enumerable:!0,get:function(){return m._minLength}}),Object.defineProperty(r,"length",{enumerable:!0,get:function(){return m._length}}),Object.defineProperty(r,"regex",{enumerable:!0,get:function(){return m._regex}}),Object.defineProperty(r,"lowercase",{enumerable:!0,get:function(){return m._lowercase}}),Object.defineProperty(r,"uppercase",{enumerable:!0,get:function(){return m._uppercase}}),Object.defineProperty(r,"includes",{enumerable:!0,get:function(){return m._includes}}),Object.defineProperty(r,"startsWith",{enumerable:!0,get:function(){return m._startsWith}}),Object.defineProperty(r,"endsWith",{enumerable:!0,get:function(){return m._endsWith}}),Object.defineProperty(r,"property",{enumerable:!0,get:function(){return m._property}}),Object.defineProperty(r,"mime",{enumerable:!0,get:function(){return m._mime}}),Object.defineProperty(r,"overwrite",{enumerable:!0,get:function(){return m._overwrite}}),Object.defineProperty(r,"normalize",{enumerable:!0,get:function(){return m._normalize}}),Object.defineProperty(r,"trim",{enumerable:!0,get:function(){return m._trim}}),Object.defineProperty(r,"toLowerCase",{enumerable:!0,get:function(){return m._toLowerCase}}),Object.defineProperty(r,"toUpperCase",{enumerable:!0,get:function(){return m._toUpperCase}}),Object.defineProperty(r,"slugify",{enumerable:!0,get:function(){return m._slugify}})})(ps);var Cr={},Qm;function us(){return Qm||(Qm=1,(function(r){var m=Cr&&Cr.__createBinding||(Object.create?(function(u,v,n,t){t===void 0&&(t=n);var x=Object.getOwnPropertyDescriptor(v,n);(!x||("get"in x?!v.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return v[n]}}),Object.defineProperty(u,t,x)}):(function(u,v,n,t){t===void 0&&(t=n),u[t]=v[n]})),C=Cr&&Cr.__setModuleDefault||(Object.create?(function(u,v){Object.defineProperty(u,"default",{enumerable:!0,value:v})}):function(u,v){u.default=v}),E=Cr&&Cr.__importStar||function(u){if(u&&u.__esModule)return u;var v={};if(u!=null)for(var n in u)n!=="default"&&Object.prototype.hasOwnProperty.call(u,n)&&m(v,u,n);return C(v,u),v};Object.defineProperty(r,"__esModule",{value:!0}),r.ZodISODuration=r.ZodISOTime=r.ZodISODate=r.ZodISODateTime=void 0,r.datetime=T,r.date=F,r.time=c,r.duration=s;const _=E($t),j=E(hs());r.ZodISODateTime=_.$constructor("ZodISODateTime",(u,v)=>{_.$ZodISODateTime.init(u,v),j.ZodStringFormat.init(u,v)});function T(u){return _._isoDateTime(r.ZodISODateTime,u)}r.ZodISODate=_.$constructor("ZodISODate",(u,v)=>{_.$ZodISODate.init(u,v),j.ZodStringFormat.init(u,v)});function F(u){return _._isoDate(r.ZodISODate,u)}r.ZodISOTime=_.$constructor("ZodISOTime",(u,v)=>{_.$ZodISOTime.init(u,v),j.ZodStringFormat.init(u,v)});function c(u){return _._isoTime(r.ZodISOTime,u)}r.ZodISODuration=_.$constructor("ZodISODuration",(u,v)=>{_.$ZodISODuration.init(u,v),j.ZodStringFormat.init(u,v)});function s(u){return _._isoDuration(r.ZodISODuration,u)}})(Cr)),Cr}var dt={},qt={},g4=qt&&qt.__createBinding||(Object.create?(function(r,m,C,E){E===void 0&&(E=C);var _=Object.getOwnPropertyDescriptor(m,C);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[C]}}),Object.defineProperty(r,E,_)}):(function(r,m,C,E){E===void 0&&(E=C),r[E]=m[C]})),p4=qt&&qt.__setModuleDefault||(Object.create?(function(r,m){Object.defineProperty(r,"default",{enumerable:!0,value:m})}):function(r,m){r.default=m}),pg=qt&&qt.__importStar||function(r){if(r&&r.__esModule)return r;var m={};if(r!=null)for(var C in r)C!=="default"&&Object.prototype.hasOwnProperty.call(r,C)&&g4(m,r,C);return p4(m,r),m};Object.defineProperty(qt,"__esModule",{value:!0});qt.ZodRealError=qt.ZodError=void 0;const ds=pg($t),h4=$t,Hm=pg(le),hg=(r,m)=>{h4.$ZodError.init(r,m),r.name="ZodError",Object.defineProperties(r,{format:{value:C=>ds.formatError(r,C)},flatten:{value:C=>ds.flattenError(r,C)},addIssue:{value:C=>{r.issues.push(C),r.message=JSON.stringify(r.issues,Hm.jsonStringifyReplacer,2)}},addIssues:{value:C=>{r.issues.push(...C),r.message=JSON.stringify(r.issues,Hm.jsonStringifyReplacer,2)}},isEmpty:{get(){return r.issues.length===0}}})};qt.ZodError=ds.$constructor("ZodError",hg);qt.ZodRealError=ds.$constructor("ZodError",hg,{Parent:Error});var v4=dt&&dt.__createBinding||(Object.create?(function(r,m,C,E){E===void 0&&(E=C);var _=Object.getOwnPropertyDescriptor(m,C);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[C]}}),Object.defineProperty(r,E,_)}):(function(r,m,C,E){E===void 0&&(E=C),r[E]=m[C]})),b4=dt&&dt.__setModuleDefault||(Object.create?(function(r,m){Object.defineProperty(r,"default",{enumerable:!0,value:m})}):function(r,m){r.default=m}),y4=dt&&dt.__importStar||function(r){if(r&&r.__esModule)return r;var m={};if(r!=null)for(var C in r)C!=="default"&&Object.prototype.hasOwnProperty.call(r,C)&&v4(m,r,C);return b4(m,r),m};Object.defineProperty(dt,"__esModule",{value:!0});dt.safeDecodeAsync=dt.safeEncodeAsync=dt.safeDecode=dt.safeEncode=dt.decodeAsync=dt.encodeAsync=dt.decode=dt.encode=dt.safeParseAsync=dt.safeParse=dt.parseAsync=dt.parse=void 0;const tr=y4($t),rr=qt;dt.parse=tr._parse(rr.ZodRealError);dt.parseAsync=tr._parseAsync(rr.ZodRealError);dt.safeParse=tr._safeParse(rr.ZodRealError);dt.safeParseAsync=tr._safeParseAsync(rr.ZodRealError);dt.encode=tr._encode(rr.ZodRealError);dt.decode=tr._decode(rr.ZodRealError);dt.encodeAsync=tr._encodeAsync(rr.ZodRealError);dt.decodeAsync=tr._decodeAsync(rr.ZodRealError);dt.safeEncode=tr._safeEncode(rr.ZodRealError);dt.safeDecode=tr._safeDecode(rr.ZodRealError);dt.safeEncodeAsync=tr._safeEncodeAsync(rr.ZodRealError);dt.safeDecodeAsync=tr._safeDecodeAsync(rr.ZodRealError);var qm;function hs(){return qm||(qm=1,(function(r){var m=Nr&&Nr.__createBinding||(Object.create?(function(y,N,L,B){B===void 0&&(B=L);var re=Object.getOwnPropertyDescriptor(N,L);(!re||("get"in re?!N.__esModule:re.writable||re.configurable))&&(re={enumerable:!0,get:function(){return N[L]}}),Object.defineProperty(y,B,re)}):(function(y,N,L,B){B===void 0&&(B=L),y[B]=N[L]})),C=Nr&&Nr.__setModuleDefault||(Object.create?(function(y,N){Object.defineProperty(y,"default",{enumerable:!0,value:N})}):function(y,N){y.default=N}),E=Nr&&Nr.__importStar||function(y){if(y&&y.__esModule)return y;var N={};if(y!=null)for(var L in y)L!=="default"&&Object.prototype.hasOwnProperty.call(y,L)&&m(N,y,L);return C(N,y),N};Object.defineProperty(r,"__esModule",{value:!0}),r.ZodLiteral=r.ZodEnum=r.ZodSet=r.ZodMap=r.ZodRecord=r.ZodTuple=r.ZodIntersection=r.ZodDiscriminatedUnion=r.ZodXor=r.ZodUnion=r.ZodObject=r.ZodArray=r.ZodDate=r.ZodVoid=r.ZodNever=r.ZodUnknown=r.ZodAny=r.ZodNull=r.ZodUndefined=r.ZodSymbol=r.ZodBigIntFormat=r.ZodBigInt=r.ZodBoolean=r.ZodNumberFormat=r.ZodNumber=r.ZodCustomStringFormat=r.ZodJWT=r.ZodE164=r.ZodBase64URL=r.ZodBase64=r.ZodCIDRv6=r.ZodCIDRv4=r.ZodIPv6=r.ZodMAC=r.ZodIPv4=r.ZodKSUID=r.ZodXID=r.ZodULID=r.ZodCUID2=r.ZodCUID=r.ZodNanoID=r.ZodEmoji=r.ZodURL=r.ZodUUID=r.ZodGUID=r.ZodEmail=r.ZodStringFormat=r.ZodString=r._ZodString=r.ZodType=void 0,r.stringbool=r.meta=r.describe=r.ZodCustom=r.ZodFunction=r.ZodPromise=r.ZodLazy=r.ZodTemplateLiteral=r.ZodReadonly=r.ZodPreprocess=r.ZodCodec=r.ZodPipe=r.ZodNaN=r.ZodCatch=r.ZodSuccess=r.ZodNonOptional=r.ZodPrefault=r.ZodDefault=r.ZodNullable=r.ZodExactOptional=r.ZodOptional=r.ZodTransform=r.ZodFile=void 0,r.string=t,r.email=x,r.guid=A,r.uuid=te,r.uuidv4=ee,r.uuidv6=oe,r.uuidv7=ie,r.url=ke,r.httpUrl=se,r.emoji=Oe,r.nanoid=Se,r.cuid=He,r.cuid2=Ge,r.ulid=it,r.xid=ht,r.ksuid=kt,r.ipv4=Et,r.mac=It,r.ipv6=At,r.cidrv4=Lt,r.cidrv6=yt,r.base64=Ft,r.base64url=fr,r.e164=k,r.jwt=O,r.stringFormat=I,r.hostname=U,r.hex=V,r.hash=J,r.number=ae,r.int=be,r.float32=K,r.float64=q,r.int32=ce,r.uint32=pe,r.boolean=Y,r.bigint=fe,r.int64=Ie,r.uint64=at,r.symbol=Xe,r.undefined=tt,r.null=ot,r.any=gt,r.unknown=ct,r.never=mt,r.void=vt,r.date=qr,r.array=Sr,r.keyof=vs,r.object=bs,r.strictObject=ys,r.looseObject=xs,r.union=Mi,r.xor=_s,r.discriminatedUnion=mr,r.intersection=rt,r.tuple=nr,r.record=sn,r.partialRecord=ir,r.looseRecord=pa,r.map=ws,r.set=Ei,r.enum=Ii,r.nativeEnum=Ss,r.literal=js,r.file=$s,r.transform=Ze,r.optional=Kt,r.exactOptional=Di,r.nullable=ln,r.nullish=ks,r._default=Ai,r.prefault=ha,r.nonoptional=Jr,r.success=Be,r.catch=Dr,r.nan=Ps,r.pipe=cn,r.codec=Ns,r.invertCodec=Cs,r.readonly=Kr,r.templateLiteral=Os,r.lazy=ar,r.promise=jr,r._function=Xr,r.function=Xr,r._function=Xr,r.function=Xr,r.check=va,r.custom=ba,r.refine=zi,r.superRefine=ya,r.instanceof=xa,r.json=wa,r.preprocess=Ms;const _=E($t),j=$t,T=E(fa),F=da,c=E(ps),s=E(us()),u=E(dt),v=new WeakMap;function n(y,N,L){const B=Object.getPrototypeOf(y);let re=v.get(B);if(re||(re=new Set,v.set(B,re)),!re.has(N)){re.add(N);for(const ft in L){const wt=L[ft];Object.defineProperty(B,ft,{configurable:!0,enumerable:!1,get(){const un=wt.bind(this);return Object.defineProperty(this,ft,{configurable:!0,writable:!0,enumerable:!0,value:un}),un},set(un){Object.defineProperty(this,ft,{configurable:!0,writable:!0,enumerable:!0,value:un})}})}}}r.ZodType=_.$constructor("ZodType",(y,N)=>(_.$ZodType.init(y,N),Object.assign(y["~standard"],{jsonSchema:{input:(0,F.createStandardJSONSchemaMethod)(y,"input"),output:(0,F.createStandardJSONSchemaMethod)(y,"output")}}),y.toJSONSchema=(0,F.createToJSONSchemaMethod)(y,{}),y.def=N,y.type=N.type,Object.defineProperty(y,"_def",{value:N}),y.parse=(L,B)=>u.parse(y,L,B,{callee:y.parse}),y.safeParse=(L,B)=>u.safeParse(y,L,B),y.parseAsync=async(L,B)=>u.parseAsync(y,L,B,{callee:y.parseAsync}),y.safeParseAsync=async(L,B)=>u.safeParseAsync(y,L,B),y.spa=y.safeParseAsync,y.encode=(L,B)=>u.encode(y,L,B),y.decode=(L,B)=>u.decode(y,L,B),y.encodeAsync=async(L,B)=>u.encodeAsync(y,L,B),y.decodeAsync=async(L,B)=>u.decodeAsync(y,L,B),y.safeEncode=(L,B)=>u.safeEncode(y,L,B),y.safeDecode=(L,B)=>u.safeDecode(y,L,B),y.safeEncodeAsync=async(L,B)=>u.safeEncodeAsync(y,L,B),y.safeDecodeAsync=async(L,B)=>u.safeDecodeAsync(y,L,B),n(y,"ZodType",{check(...L){const B=this.def;return this.clone(j.util.mergeDefs(B,{checks:[...B.checks??[],...L.map(re=>typeof re=="function"?{_zod:{check:re,def:{check:"custom"},onattach:[]}}:re)]}),{parent:!0})},with(...L){return this.check(...L)},clone(L,B){return _.clone(this,L,B)},brand(){return this},register(L,B){return L.add(this,B),this},refine(L,B){return this.check(zi(L,B))},superRefine(L,B){return this.check(ya(L,B))},overwrite(L){return this.check(c.overwrite(L))},optional(){return Kt(this)},exactOptional(){return Di(this)},nullable(){return ln(this)},nullish(){return Kt(ln(this))},nonoptional(L){return Jr(this,L)},array(){return Sr(this)},or(L){return Mi([this,L])},and(L){return rt(this,L)},transform(L){return cn(this,Ze(L))},default(L){return Ai(this,L)},prefault(L){return ha(this,L)},catch(L){return Dr(this,L)},pipe(L){return cn(this,L)},readonly(){return Kr(this)},describe(L){const B=this.clone();return _.globalRegistry.add(B,{description:L}),B},meta(...L){if(L.length===0)return _.globalRegistry.get(this);const B=this.clone();return _.globalRegistry.add(B,L[0]),B},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(L){return L(this)}}),Object.defineProperty(y,"description",{get(){return _.globalRegistry.get(y)?.description},configurable:!0}),y)),r._ZodString=_.$constructor("_ZodString",(y,N)=>{_.$ZodString.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(B,re,ft)=>T.stringProcessor(y,B,re,ft);const L=y._zod.bag;y.format=L.format??null,y.minLength=L.minimum??null,y.maxLength=L.maximum??null,n(y,"_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())}})}),r.ZodString=_.$constructor("ZodString",(y,N)=>{_.$ZodString.init(y,N),r._ZodString.init(y,N),y.email=L=>y.check(_._email(r.ZodEmail,L)),y.url=L=>y.check(_._url(r.ZodURL,L)),y.jwt=L=>y.check(_._jwt(r.ZodJWT,L)),y.emoji=L=>y.check(_._emoji(r.ZodEmoji,L)),y.guid=L=>y.check(_._guid(r.ZodGUID,L)),y.uuid=L=>y.check(_._uuid(r.ZodUUID,L)),y.uuidv4=L=>y.check(_._uuidv4(r.ZodUUID,L)),y.uuidv6=L=>y.check(_._uuidv6(r.ZodUUID,L)),y.uuidv7=L=>y.check(_._uuidv7(r.ZodUUID,L)),y.nanoid=L=>y.check(_._nanoid(r.ZodNanoID,L)),y.guid=L=>y.check(_._guid(r.ZodGUID,L)),y.cuid=L=>y.check(_._cuid(r.ZodCUID,L)),y.cuid2=L=>y.check(_._cuid2(r.ZodCUID2,L)),y.ulid=L=>y.check(_._ulid(r.ZodULID,L)),y.base64=L=>y.check(_._base64(r.ZodBase64,L)),y.base64url=L=>y.check(_._base64url(r.ZodBase64URL,L)),y.xid=L=>y.check(_._xid(r.ZodXID,L)),y.ksuid=L=>y.check(_._ksuid(r.ZodKSUID,L)),y.ipv4=L=>y.check(_._ipv4(r.ZodIPv4,L)),y.ipv6=L=>y.check(_._ipv6(r.ZodIPv6,L)),y.cidrv4=L=>y.check(_._cidrv4(r.ZodCIDRv4,L)),y.cidrv6=L=>y.check(_._cidrv6(r.ZodCIDRv6,L)),y.e164=L=>y.check(_._e164(r.ZodE164,L)),y.datetime=L=>y.check(s.datetime(L)),y.date=L=>y.check(s.date(L)),y.time=L=>y.check(s.time(L)),y.duration=L=>y.check(s.duration(L))});function t(y){return _._string(r.ZodString,y)}r.ZodStringFormat=_.$constructor("ZodStringFormat",(y,N)=>{_.$ZodStringFormat.init(y,N),r._ZodString.init(y,N)}),r.ZodEmail=_.$constructor("ZodEmail",(y,N)=>{_.$ZodEmail.init(y,N),r.ZodStringFormat.init(y,N)});function x(y){return _._email(r.ZodEmail,y)}r.ZodGUID=_.$constructor("ZodGUID",(y,N)=>{_.$ZodGUID.init(y,N),r.ZodStringFormat.init(y,N)});function A(y){return _._guid(r.ZodGUID,y)}r.ZodUUID=_.$constructor("ZodUUID",(y,N)=>{_.$ZodUUID.init(y,N),r.ZodStringFormat.init(y,N)});function te(y){return _._uuid(r.ZodUUID,y)}function ee(y){return _._uuidv4(r.ZodUUID,y)}function oe(y){return _._uuidv6(r.ZodUUID,y)}function ie(y){return _._uuidv7(r.ZodUUID,y)}r.ZodURL=_.$constructor("ZodURL",(y,N)=>{_.$ZodURL.init(y,N),r.ZodStringFormat.init(y,N)});function ke(y){return _._url(r.ZodURL,y)}function se(y){return _._url(r.ZodURL,{protocol:_.regexes.httpProtocol,hostname:_.regexes.domain,...j.util.normalizeParams(y)})}r.ZodEmoji=_.$constructor("ZodEmoji",(y,N)=>{_.$ZodEmoji.init(y,N),r.ZodStringFormat.init(y,N)});function Oe(y){return _._emoji(r.ZodEmoji,y)}r.ZodNanoID=_.$constructor("ZodNanoID",(y,N)=>{_.$ZodNanoID.init(y,N),r.ZodStringFormat.init(y,N)});function Se(y){return _._nanoid(r.ZodNanoID,y)}r.ZodCUID=_.$constructor("ZodCUID",(y,N)=>{_.$ZodCUID.init(y,N),r.ZodStringFormat.init(y,N)});function He(y){return _._cuid(r.ZodCUID,y)}r.ZodCUID2=_.$constructor("ZodCUID2",(y,N)=>{_.$ZodCUID2.init(y,N),r.ZodStringFormat.init(y,N)});function Ge(y){return _._cuid2(r.ZodCUID2,y)}r.ZodULID=_.$constructor("ZodULID",(y,N)=>{_.$ZodULID.init(y,N),r.ZodStringFormat.init(y,N)});function it(y){return _._ulid(r.ZodULID,y)}r.ZodXID=_.$constructor("ZodXID",(y,N)=>{_.$ZodXID.init(y,N),r.ZodStringFormat.init(y,N)});function ht(y){return _._xid(r.ZodXID,y)}r.ZodKSUID=_.$constructor("ZodKSUID",(y,N)=>{_.$ZodKSUID.init(y,N),r.ZodStringFormat.init(y,N)});function kt(y){return _._ksuid(r.ZodKSUID,y)}r.ZodIPv4=_.$constructor("ZodIPv4",(y,N)=>{_.$ZodIPv4.init(y,N),r.ZodStringFormat.init(y,N)});function Et(y){return _._ipv4(r.ZodIPv4,y)}r.ZodMAC=_.$constructor("ZodMAC",(y,N)=>{_.$ZodMAC.init(y,N),r.ZodStringFormat.init(y,N)});function It(y){return _._mac(r.ZodMAC,y)}r.ZodIPv6=_.$constructor("ZodIPv6",(y,N)=>{_.$ZodIPv6.init(y,N),r.ZodStringFormat.init(y,N)});function At(y){return _._ipv6(r.ZodIPv6,y)}r.ZodCIDRv4=_.$constructor("ZodCIDRv4",(y,N)=>{_.$ZodCIDRv4.init(y,N),r.ZodStringFormat.init(y,N)});function Lt(y){return _._cidrv4(r.ZodCIDRv4,y)}r.ZodCIDRv6=_.$constructor("ZodCIDRv6",(y,N)=>{_.$ZodCIDRv6.init(y,N),r.ZodStringFormat.init(y,N)});function yt(y){return _._cidrv6(r.ZodCIDRv6,y)}r.ZodBase64=_.$constructor("ZodBase64",(y,N)=>{_.$ZodBase64.init(y,N),r.ZodStringFormat.init(y,N)});function Ft(y){return _._base64(r.ZodBase64,y)}r.ZodBase64URL=_.$constructor("ZodBase64URL",(y,N)=>{_.$ZodBase64URL.init(y,N),r.ZodStringFormat.init(y,N)});function fr(y){return _._base64url(r.ZodBase64URL,y)}r.ZodE164=_.$constructor("ZodE164",(y,N)=>{_.$ZodE164.init(y,N),r.ZodStringFormat.init(y,N)});function k(y){return _._e164(r.ZodE164,y)}r.ZodJWT=_.$constructor("ZodJWT",(y,N)=>{_.$ZodJWT.init(y,N),r.ZodStringFormat.init(y,N)});function O(y){return _._jwt(r.ZodJWT,y)}r.ZodCustomStringFormat=_.$constructor("ZodCustomStringFormat",(y,N)=>{_.$ZodCustomStringFormat.init(y,N),r.ZodStringFormat.init(y,N)});function I(y,N,L={}){return _._stringFormat(r.ZodCustomStringFormat,y,N,L)}function U(y){return _._stringFormat(r.ZodCustomStringFormat,"hostname",_.regexes.hostname,y)}function V(y){return _._stringFormat(r.ZodCustomStringFormat,"hex",_.regexes.hex,y)}function J(y,N){const L=N?.enc??"hex",B=`${y}_${L}`,re=_.regexes[B];if(!re)throw new Error(`Unrecognized hash format: ${B}`);return _._stringFormat(r.ZodCustomStringFormat,B,re,N)}r.ZodNumber=_.$constructor("ZodNumber",(y,N)=>{_.$ZodNumber.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(B,re,ft)=>T.numberProcessor(y,B,re,ft),n(y,"ZodNumber",{gt(B,re){return this.check(c.gt(B,re))},gte(B,re){return this.check(c.gte(B,re))},min(B,re){return this.check(c.gte(B,re))},lt(B,re){return this.check(c.lt(B,re))},lte(B,re){return this.check(c.lte(B,re))},max(B,re){return this.check(c.lte(B,re))},int(B){return this.check(be(B))},safe(B){return this.check(be(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,re){return this.check(c.multipleOf(B,re))},step(B,re){return this.check(c.multipleOf(B,re))},finite(){return this}});const L=y._zod.bag;y.minValue=Math.max(L.minimum??Number.NEGATIVE_INFINITY,L.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,y.maxValue=Math.min(L.maximum??Number.POSITIVE_INFINITY,L.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,y.isInt=(L.format??"").includes("int")||Number.isSafeInteger(L.multipleOf??.5),y.isFinite=!0,y.format=L.format??null});function ae(y){return _._number(r.ZodNumber,y)}r.ZodNumberFormat=_.$constructor("ZodNumberFormat",(y,N)=>{_.$ZodNumberFormat.init(y,N),r.ZodNumber.init(y,N)});function be(y){return _._int(r.ZodNumberFormat,y)}function K(y){return _._float32(r.ZodNumberFormat,y)}function q(y){return _._float64(r.ZodNumberFormat,y)}function ce(y){return _._int32(r.ZodNumberFormat,y)}function pe(y){return _._uint32(r.ZodNumberFormat,y)}r.ZodBoolean=_.$constructor("ZodBoolean",(y,N)=>{_.$ZodBoolean.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.booleanProcessor(y,L,B,re)});function Y(y){return _._boolean(r.ZodBoolean,y)}r.ZodBigInt=_.$constructor("ZodBigInt",(y,N)=>{_.$ZodBigInt.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(B,re,ft)=>T.bigintProcessor(y,B,re,ft),y.gte=(B,re)=>y.check(c.gte(B,re)),y.min=(B,re)=>y.check(c.gte(B,re)),y.gt=(B,re)=>y.check(c.gt(B,re)),y.gte=(B,re)=>y.check(c.gte(B,re)),y.min=(B,re)=>y.check(c.gte(B,re)),y.lt=(B,re)=>y.check(c.lt(B,re)),y.lte=(B,re)=>y.check(c.lte(B,re)),y.max=(B,re)=>y.check(c.lte(B,re)),y.positive=B=>y.check(c.gt(BigInt(0),B)),y.negative=B=>y.check(c.lt(BigInt(0),B)),y.nonpositive=B=>y.check(c.lte(BigInt(0),B)),y.nonnegative=B=>y.check(c.gte(BigInt(0),B)),y.multipleOf=(B,re)=>y.check(c.multipleOf(B,re));const L=y._zod.bag;y.minValue=L.minimum??null,y.maxValue=L.maximum??null,y.format=L.format??null});function fe(y){return _._bigint(r.ZodBigInt,y)}r.ZodBigIntFormat=_.$constructor("ZodBigIntFormat",(y,N)=>{_.$ZodBigIntFormat.init(y,N),r.ZodBigInt.init(y,N)});function Ie(y){return _._int64(r.ZodBigIntFormat,y)}function at(y){return _._uint64(r.ZodBigIntFormat,y)}r.ZodSymbol=_.$constructor("ZodSymbol",(y,N)=>{_.$ZodSymbol.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.symbolProcessor(y,L,B,re)});function Xe(y){return _._symbol(r.ZodSymbol,y)}r.ZodUndefined=_.$constructor("ZodUndefined",(y,N)=>{_.$ZodUndefined.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.undefinedProcessor(y,L,B,re)});function tt(y){return _._undefined(r.ZodUndefined,y)}r.ZodNull=_.$constructor("ZodNull",(y,N)=>{_.$ZodNull.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.nullProcessor(y,L,B,re)});function ot(y){return _._null(r.ZodNull,y)}r.ZodAny=_.$constructor("ZodAny",(y,N)=>{_.$ZodAny.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.anyProcessor(y,L,B,re)});function gt(){return _._any(r.ZodAny)}r.ZodUnknown=_.$constructor("ZodUnknown",(y,N)=>{_.$ZodUnknown.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.unknownProcessor(y,L,B,re)});function ct(){return _._unknown(r.ZodUnknown)}r.ZodNever=_.$constructor("ZodNever",(y,N)=>{_.$ZodNever.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.neverProcessor(y,L,B,re)});function mt(y){return _._never(r.ZodNever,y)}r.ZodVoid=_.$constructor("ZodVoid",(y,N)=>{_.$ZodVoid.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.voidProcessor(y,L,B,re)});function vt(y){return _._void(r.ZodVoid,y)}r.ZodDate=_.$constructor("ZodDate",(y,N)=>{_.$ZodDate.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(B,re,ft)=>T.dateProcessor(y,B,re,ft),y.min=(B,re)=>y.check(c.gte(B,re)),y.max=(B,re)=>y.check(c.lte(B,re));const L=y._zod.bag;y.minDate=L.minimum?new Date(L.minimum):null,y.maxDate=L.maximum?new Date(L.maximum):null});function qr(y){return _._date(r.ZodDate,y)}r.ZodArray=_.$constructor("ZodArray",(y,N)=>{_.$ZodArray.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.arrayProcessor(y,L,B,re),y.element=N.element,n(y,"ZodArray",{min(L,B){return this.check(c.minLength(L,B))},nonempty(L){return this.check(c.minLength(1,L))},max(L,B){return this.check(c.maxLength(L,B))},length(L,B){return this.check(c.length(L,B))},unwrap(){return this.element}})});function Sr(y,N){return _._array(r.ZodArray,y,N)}function vs(y){const N=y._zod.def.shape;return Ii(Object.keys(N))}r.ZodObject=_.$constructor("ZodObject",(y,N)=>{_.$ZodObjectJIT.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.objectProcessor(y,L,B,re),j.util.defineLazy(y,"shape",()=>N.shape),n(y,"ZodObject",{keyof(){return Ii(Object.keys(this._zod.def.shape))},catchall(L){return this.clone({...this._zod.def,catchall:L})},passthrough(){return this.clone({...this._zod.def,catchall:ct()})},loose(){return this.clone({...this._zod.def,catchall:ct()})},strict(){return this.clone({...this._zod.def,catchall:mt()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(L){return j.util.extend(this,L)},safeExtend(L){return j.util.safeExtend(this,L)},merge(L){return j.util.merge(this,L)},pick(L){return j.util.pick(this,L)},omit(L){return j.util.omit(this,L)},partial(...L){return j.util.partial(r.ZodOptional,this,L[0])},required(...L){return j.util.required(r.ZodNonOptional,this,L[0])}})});function bs(y,N){const L={type:"object",shape:y??{},...j.util.normalizeParams(N)};return new r.ZodObject(L)}function ys(y,N){return new r.ZodObject({type:"object",shape:y,catchall:mt(),...j.util.normalizeParams(N)})}function xs(y,N){return new r.ZodObject({type:"object",shape:y,catchall:ct(),...j.util.normalizeParams(N)})}r.ZodUnion=_.$constructor("ZodUnion",(y,N)=>{_.$ZodUnion.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.unionProcessor(y,L,B,re),y.options=N.options});function Mi(y,N){return new r.ZodUnion({type:"union",options:y,...j.util.normalizeParams(N)})}r.ZodXor=_.$constructor("ZodXor",(y,N)=>{r.ZodUnion.init(y,N),_.$ZodXor.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.unionProcessor(y,L,B,re),y.options=N.options});function _s(y,N){return new r.ZodXor({type:"union",options:y,inclusive:!1,...j.util.normalizeParams(N)})}r.ZodDiscriminatedUnion=_.$constructor("ZodDiscriminatedUnion",(y,N)=>{r.ZodUnion.init(y,N),_.$ZodDiscriminatedUnion.init(y,N)});function mr(y,N,L){return new r.ZodDiscriminatedUnion({type:"union",options:N,discriminator:y,...j.util.normalizeParams(L)})}r.ZodIntersection=_.$constructor("ZodIntersection",(y,N)=>{_.$ZodIntersection.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.intersectionProcessor(y,L,B,re)});function rt(y,N){return new r.ZodIntersection({type:"intersection",left:y,right:N})}r.ZodTuple=_.$constructor("ZodTuple",(y,N)=>{_.$ZodTuple.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.tupleProcessor(y,L,B,re),y.rest=L=>y.clone({...y._zod.def,rest:L})});function nr(y,N,L){const B=N instanceof _.$ZodType,re=B?L:N,ft=B?N:null;return new r.ZodTuple({type:"tuple",items:y,rest:ft,...j.util.normalizeParams(re)})}r.ZodRecord=_.$constructor("ZodRecord",(y,N)=>{_.$ZodRecord.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.recordProcessor(y,L,B,re),y.keyType=N.keyType,y.valueType=N.valueType});function sn(y,N,L){return!N||!N._zod?new r.ZodRecord({type:"record",keyType:t(),valueType:y,...j.util.normalizeParams(N)}):new r.ZodRecord({type:"record",keyType:y,valueType:N,...j.util.normalizeParams(L)})}function ir(y,N,L){const B=_.clone(y);return B._zod.values=void 0,new r.ZodRecord({type:"record",keyType:B,valueType:N,...j.util.normalizeParams(L)})}function pa(y,N,L){return new r.ZodRecord({type:"record",keyType:y,valueType:N,mode:"loose",...j.util.normalizeParams(L)})}r.ZodMap=_.$constructor("ZodMap",(y,N)=>{_.$ZodMap.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.mapProcessor(y,L,B,re),y.keyType=N.keyType,y.valueType=N.valueType,y.min=(...L)=>y.check(_._minSize(...L)),y.nonempty=L=>y.check(_._minSize(1,L)),y.max=(...L)=>y.check(_._maxSize(...L)),y.size=(...L)=>y.check(_._size(...L))});function ws(y,N,L){return new r.ZodMap({type:"map",keyType:y,valueType:N,...j.util.normalizeParams(L)})}r.ZodSet=_.$constructor("ZodSet",(y,N)=>{_.$ZodSet.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.setProcessor(y,L,B,re),y.min=(...L)=>y.check(_._minSize(...L)),y.nonempty=L=>y.check(_._minSize(1,L)),y.max=(...L)=>y.check(_._maxSize(...L)),y.size=(...L)=>y.check(_._size(...L))});function Ei(y,N){return new r.ZodSet({type:"set",valueType:y,...j.util.normalizeParams(N)})}r.ZodEnum=_.$constructor("ZodEnum",(y,N)=>{_.$ZodEnum.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(B,re,ft)=>T.enumProcessor(y,B,re,ft),y.enum=N.entries,y.options=Object.values(N.entries);const L=new Set(Object.keys(N.entries));y.extract=(B,re)=>{const ft={};for(const wt of B)if(L.has(wt))ft[wt]=N.entries[wt];else throw new Error(`Key ${wt} not found in enum`);return new r.ZodEnum({...N,checks:[],...j.util.normalizeParams(re),entries:ft})},y.exclude=(B,re)=>{const ft={...N.entries};for(const wt of B)if(L.has(wt))delete ft[wt];else throw new Error(`Key ${wt} not found in enum`);return new r.ZodEnum({...N,checks:[],...j.util.normalizeParams(re),entries:ft})}});function Ii(y,N){const L=Array.isArray(y)?Object.fromEntries(y.map(B=>[B,B])):y;return new r.ZodEnum({type:"enum",entries:L,...j.util.normalizeParams(N)})}function Ss(y,N){return new r.ZodEnum({type:"enum",entries:y,...j.util.normalizeParams(N)})}r.ZodLiteral=_.$constructor("ZodLiteral",(y,N)=>{_.$ZodLiteral.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.literalProcessor(y,L,B,re),y.values=new Set(N.values),Object.defineProperty(y,"value",{get(){if(N.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return N.values[0]}})});function js(y,N){return new r.ZodLiteral({type:"literal",values:Array.isArray(y)?y:[y],...j.util.normalizeParams(N)})}r.ZodFile=_.$constructor("ZodFile",(y,N)=>{_.$ZodFile.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.fileProcessor(y,L,B,re),y.min=(L,B)=>y.check(_._minSize(L,B)),y.max=(L,B)=>y.check(_._maxSize(L,B)),y.mime=(L,B)=>y.check(_._mime(Array.isArray(L)?L:[L],B))});function $s(y){return _._file(r.ZodFile,y)}r.ZodTransform=_.$constructor("ZodTransform",(y,N)=>{_.$ZodTransform.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.transformProcessor(y,L,B,re),y._zod.parse=(L,B)=>{if(B.direction==="backward")throw new _.$ZodEncodeError(y.constructor.name);L.addIssue=ft=>{if(typeof ft=="string")L.issues.push(j.util.issue(ft,L.value,N));else{const wt=ft;wt.fatal&&(wt.continue=!1),wt.code??(wt.code="custom"),wt.input??(wt.input=L.value),wt.inst??(wt.inst=y),L.issues.push(j.util.issue(wt))}};const re=N.transform(L.value,L);return re instanceof Promise?re.then(ft=>(L.value=ft,L.fallback=!0,L)):(L.value=re,L.fallback=!0,L)}});function Ze(y){return new r.ZodTransform({type:"transform",transform:y})}r.ZodOptional=_.$constructor("ZodOptional",(y,N)=>{_.$ZodOptional.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.optionalProcessor(y,L,B,re),y.unwrap=()=>y._zod.def.innerType});function Kt(y){return new r.ZodOptional({type:"optional",innerType:y})}r.ZodExactOptional=_.$constructor("ZodExactOptional",(y,N)=>{_.$ZodExactOptional.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.optionalProcessor(y,L,B,re),y.unwrap=()=>y._zod.def.innerType});function Di(y){return new r.ZodExactOptional({type:"optional",innerType:y})}r.ZodNullable=_.$constructor("ZodNullable",(y,N)=>{_.$ZodNullable.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.nullableProcessor(y,L,B,re),y.unwrap=()=>y._zod.def.innerType});function ln(y){return new r.ZodNullable({type:"nullable",innerType:y})}function ks(y){return Kt(ln(y))}r.ZodDefault=_.$constructor("ZodDefault",(y,N)=>{_.$ZodDefault.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.defaultProcessor(y,L,B,re),y.unwrap=()=>y._zod.def.innerType,y.removeDefault=y.unwrap});function Ai(y,N){return new r.ZodDefault({type:"default",innerType:y,get defaultValue(){return typeof N=="function"?N():j.util.shallowClone(N)}})}r.ZodPrefault=_.$constructor("ZodPrefault",(y,N)=>{_.$ZodPrefault.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.prefaultProcessor(y,L,B,re),y.unwrap=()=>y._zod.def.innerType});function ha(y,N){return new r.ZodPrefault({type:"prefault",innerType:y,get defaultValue(){return typeof N=="function"?N():j.util.shallowClone(N)}})}r.ZodNonOptional=_.$constructor("ZodNonOptional",(y,N)=>{_.$ZodNonOptional.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.nonoptionalProcessor(y,L,B,re),y.unwrap=()=>y._zod.def.innerType});function Jr(y,N){return new r.ZodNonOptional({type:"nonoptional",innerType:y,...j.util.normalizeParams(N)})}r.ZodSuccess=_.$constructor("ZodSuccess",(y,N)=>{_.$ZodSuccess.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.successProcessor(y,L,B,re),y.unwrap=()=>y._zod.def.innerType});function Be(y){return new r.ZodSuccess({type:"success",innerType:y})}r.ZodCatch=_.$constructor("ZodCatch",(y,N)=>{_.$ZodCatch.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.catchProcessor(y,L,B,re),y.unwrap=()=>y._zod.def.innerType,y.removeCatch=y.unwrap});function Dr(y,N){return new r.ZodCatch({type:"catch",innerType:y,catchValue:typeof N=="function"?N:()=>N})}r.ZodNaN=_.$constructor("ZodNaN",(y,N)=>{_.$ZodNaN.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.nanProcessor(y,L,B,re)});function Ps(y){return _._nan(r.ZodNaN,y)}r.ZodPipe=_.$constructor("ZodPipe",(y,N)=>{_.$ZodPipe.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.pipeProcessor(y,L,B,re),y.in=N.in,y.out=N.out});function cn(y,N){return new r.ZodPipe({type:"pipe",in:y,out:N})}r.ZodCodec=_.$constructor("ZodCodec",(y,N)=>{r.ZodPipe.init(y,N),_.$ZodCodec.init(y,N)});function Ns(y,N,L){return new r.ZodCodec({type:"pipe",in:y,out:N,transform:L.decode,reverseTransform:L.encode})}function Cs(y){const N=y._zod.def;return new r.ZodCodec({type:"pipe",in:N.out,out:N.in,transform:N.reverseTransform,reverseTransform:N.transform})}r.ZodPreprocess=_.$constructor("ZodPreprocess",(y,N)=>{r.ZodPipe.init(y,N),_.$ZodPreprocess.init(y,N)}),r.ZodReadonly=_.$constructor("ZodReadonly",(y,N)=>{_.$ZodReadonly.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.readonlyProcessor(y,L,B,re),y.unwrap=()=>y._zod.def.innerType});function Kr(y){return new r.ZodReadonly({type:"readonly",innerType:y})}r.ZodTemplateLiteral=_.$constructor("ZodTemplateLiteral",(y,N)=>{_.$ZodTemplateLiteral.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.templateLiteralProcessor(y,L,B,re)});function Os(y,N){return new r.ZodTemplateLiteral({type:"template_literal",parts:y,...j.util.normalizeParams(N)})}r.ZodLazy=_.$constructor("ZodLazy",(y,N)=>{_.$ZodLazy.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.lazyProcessor(y,L,B,re),y.unwrap=()=>y._zod.def.getter()});function ar(y){return new r.ZodLazy({type:"lazy",getter:y})}r.ZodPromise=_.$constructor("ZodPromise",(y,N)=>{_.$ZodPromise.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.promiseProcessor(y,L,B,re),y.unwrap=()=>y._zod.def.innerType});function jr(y){return new r.ZodPromise({type:"promise",innerType:y})}r.ZodFunction=_.$constructor("ZodFunction",(y,N)=>{_.$ZodFunction.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.functionProcessor(y,L,B,re)});function Xr(y){return new r.ZodFunction({type:"function",input:Array.isArray(y?.input)?nr(y?.input):y?.input??Sr(ct()),output:y?.output??ct()})}r.ZodCustom=_.$constructor("ZodCustom",(y,N)=>{_.$ZodCustom.init(y,N),r.ZodType.init(y,N),y._zod.processJSONSchema=(L,B,re)=>T.customProcessor(y,L,B,re)});function va(y){const N=new _.$ZodCheck({check:"custom"});return N._zod.check=y,N}function ba(y,N){return _._custom(r.ZodCustom,y??(()=>!0),N)}function zi(y,N={}){return _._refine(r.ZodCustom,y,N)}function ya(y,N){return _._superRefine(y,N)}r.describe=_.describe,r.meta=_.meta;function xa(y,N={}){const L=new r.ZodCustom({type:"custom",check:"custom",fn:B=>B instanceof y,abort:!0,...j.util.normalizeParams(N)});return L._zod.bag.Class=y,L._zod.check=B=>{B.value instanceof y||B.issues.push({code:"invalid_type",expected:y.name,input:B.value,inst:L,path:[...L._zod.def.path??[]]})},L}const _a=(...y)=>_._stringbool({Codec:r.ZodCodec,Boolean:r.ZodBoolean,String:r.ZodString},...y);r.stringbool=_a;function wa(y){const N=ar(()=>Mi([t(y),ae(),Y(),ot(),Sr(N),sn(t(),N)]));return N}function Ms(y,N){return new r.ZodPreprocess({type:"pipe",in:Ze(y),out:N})}})(Nr)),Nr}var Wr={};(function(r){var m=Wr&&Wr.__createBinding||(Object.create?(function(s,u,v,n){n===void 0&&(n=v);var t=Object.getOwnPropertyDescriptor(u,v);(!t||("get"in t?!u.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return u[v]}}),Object.defineProperty(s,n,t)}):(function(s,u,v,n){n===void 0&&(n=v),s[n]=u[v]})),C=Wr&&Wr.__setModuleDefault||(Object.create?(function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}):function(s,u){s.default=u}),E=Wr&&Wr.__importStar||function(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var v in s)v!=="default"&&Object.prototype.hasOwnProperty.call(s,v)&&m(u,s,v);return C(u,s),u};Object.defineProperty(r,"__esModule",{value:!0}),r.ZodFirstPartyTypeKind=r.config=r.$brand=r.ZodIssueCode=void 0,r.setErrorMap=T,r.getErrorMap=F;const _=E($t);r.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 j=$t;Object.defineProperty(r,"$brand",{enumerable:!0,get:function(){return j.$brand}}),Object.defineProperty(r,"config",{enumerable:!0,get:function(){return j.config}});function T(s){_.config({customError:s})}function F(){return _.config().customError}var c;c||(r.ZodFirstPartyTypeKind=c={})})(Wr);var Er={},x4=Er&&Er.__createBinding||(Object.create?(function(r,m,C,E){E===void 0&&(E=C);var _=Object.getOwnPropertyDescriptor(m,C);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[C]}}),Object.defineProperty(r,E,_)}):(function(r,m,C,E){E===void 0&&(E=C),r[E]=m[C]})),_4=Er&&Er.__setModuleDefault||(Object.create?(function(r,m){Object.defineProperty(r,"default",{enumerable:!0,value:m})}):function(r,m){r.default=m}),bc=Er&&Er.__importStar||function(r){if(r&&r.__esModule)return r;var m={};if(r!=null)for(var C in r)C!=="default"&&Object.prototype.hasOwnProperty.call(r,C)&&x4(m,r,C);return _4(m,r),m};Object.defineProperty(Er,"__esModule",{value:!0});Er.fromJSONSchema=C4;const w4=Bt,S4=bc(ps),j4=bc(us()),$4=bc(hs()),Le={...$4,...S4,iso:j4},k4=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 P4(r,m){const C=r.$schema;return C==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":C==="http://json-schema.org/draft-07/schema#"?"draft-7":C==="http://json-schema.org/draft-04/schema#"?"draft-4":m??"draft-2020-12"}function N4(r,m){if(!r.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const C=r.slice(1).split("/").filter(Boolean);if(C.length===0)return m.rootSchema;const E=m.version==="draft-2020-12"?"$defs":"definitions";if(C[0]===E){const _=C[1];if(!_||!m.defs[_])throw new Error(`Reference not found: ${r}`);return m.defs[_]}throw new Error(`Reference not found: ${r}`)}function vg(r,m){if(r.not!==void 0){if(typeof r.not=="object"&&Object.keys(r.not).length===0)return Le.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(r.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(r.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(r.if!==void 0||r.then!==void 0||r.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(r.dependentSchemas!==void 0||r.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(r.$ref){const _=r.$ref;if(m.refs.has(_))return m.refs.get(_);if(m.processing.has(_))return Le.lazy(()=>{if(!m.refs.has(_))throw new Error(`Circular reference not resolved: ${_}`);return m.refs.get(_)});m.processing.add(_);const j=N4(_,m),T=Dt(j,m);return m.refs.set(_,T),m.processing.delete(_),T}if(r.enum!==void 0){const _=r.enum;if(m.version==="openapi-3.0"&&r.nullable===!0&&_.length===1&&_[0]===null)return Le.null();if(_.length===0)return Le.never();if(_.length===1)return Le.literal(_[0]);if(_.every(T=>typeof T=="string"))return Le.enum(_);const j=_.map(T=>Le.literal(T));return j.length<2?j[0]:Le.union([j[0],j[1],...j.slice(2)])}if(r.const!==void 0)return Le.literal(r.const);const C=r.type;if(Array.isArray(C)){const _=C.map(j=>{const T={...r,type:j};return vg(T,m)});return _.length===0?Le.never():_.length===1?_[0]:Le.union(_)}if(!C)return Le.any();let E;switch(C){case"string":{let _=Le.string();if(r.format){const j=r.format;j==="email"?_=_.check(Le.email()):j==="uri"||j==="uri-reference"?_=_.check(Le.url()):j==="uuid"||j==="guid"?_=_.check(Le.uuid()):j==="date-time"?_=_.check(Le.iso.datetime()):j==="date"?_=_.check(Le.iso.date()):j==="time"?_=_.check(Le.iso.time()):j==="duration"?_=_.check(Le.iso.duration()):j==="ipv4"?_=_.check(Le.ipv4()):j==="ipv6"?_=_.check(Le.ipv6()):j==="mac"?_=_.check(Le.mac()):j==="cidr"?_=_.check(Le.cidrv4()):j==="cidr-v6"?_=_.check(Le.cidrv6()):j==="base64"?_=_.check(Le.base64()):j==="base64url"?_=_.check(Le.base64url()):j==="e164"?_=_.check(Le.e164()):j==="jwt"?_=_.check(Le.jwt()):j==="emoji"?_=_.check(Le.emoji()):j==="nanoid"?_=_.check(Le.nanoid()):j==="cuid"?_=_.check(Le.cuid()):j==="cuid2"?_=_.check(Le.cuid2()):j==="ulid"?_=_.check(Le.ulid()):j==="xid"?_=_.check(Le.xid()):j==="ksuid"&&(_=_.check(Le.ksuid()))}typeof r.minLength=="number"&&(_=_.min(r.minLength)),typeof r.maxLength=="number"&&(_=_.max(r.maxLength)),r.pattern&&(_=_.regex(new RegExp(r.pattern))),E=_;break}case"number":case"integer":{let _=C==="integer"?Le.number().int():Le.number();typeof r.minimum=="number"&&(_=_.min(r.minimum)),typeof r.maximum=="number"&&(_=_.max(r.maximum)),typeof r.exclusiveMinimum=="number"?_=_.gt(r.exclusiveMinimum):r.exclusiveMinimum===!0&&typeof r.minimum=="number"&&(_=_.gt(r.minimum)),typeof r.exclusiveMaximum=="number"?_=_.lt(r.exclusiveMaximum):r.exclusiveMaximum===!0&&typeof r.maximum=="number"&&(_=_.lt(r.maximum)),typeof r.multipleOf=="number"&&(_=_.multipleOf(r.multipleOf)),E=_;break}case"boolean":{E=Le.boolean();break}case"null":{E=Le.null();break}case"object":{const _={},j=r.properties||{},T=new Set(r.required||[]);for(const[c,s]of Object.entries(j)){const u=Dt(s,m);_[c]=T.has(c)?u:u.optional()}if(r.propertyNames){const c=Dt(r.propertyNames,m),s=r.additionalProperties&&typeof r.additionalProperties=="object"?Dt(r.additionalProperties,m):Le.any();if(Object.keys(_).length===0){E=Le.record(c,s);break}const u=Le.object(_).passthrough(),v=Le.looseRecord(c,s);E=Le.intersection(u,v);break}if(r.patternProperties){const c=r.patternProperties,s=Object.keys(c),u=[];for(const n of s){const t=Dt(c[n],m),x=Le.string().regex(new RegExp(n));u.push(Le.looseRecord(x,t))}const v=[];if(Object.keys(_).length>0&&v.push(Le.object(_).passthrough()),v.push(...u),v.length===0)E=Le.object({}).passthrough();else if(v.length===1)E=v[0];else{let n=Le.intersection(v[0],v[1]);for(let t=2;t<v.length;t++)n=Le.intersection(n,v[t]);E=n}break}const F=Le.object(_);r.additionalProperties===!1?E=F.strict():typeof r.additionalProperties=="object"?E=F.catchall(Dt(r.additionalProperties,m)):E=F.passthrough();break}case"array":{const _=r.prefixItems,j=r.items;if(_&&Array.isArray(_)){const T=_.map(c=>Dt(c,m)),F=j&&typeof j=="object"&&!Array.isArray(j)?Dt(j,m):void 0;F?E=Le.tuple(T).rest(F):E=Le.tuple(T),typeof r.minItems=="number"&&(E=E.check(Le.minLength(r.minItems))),typeof r.maxItems=="number"&&(E=E.check(Le.maxLength(r.maxItems)))}else if(Array.isArray(j)){const T=j.map(c=>Dt(c,m)),F=r.additionalItems&&typeof r.additionalItems=="object"?Dt(r.additionalItems,m):void 0;F?E=Le.tuple(T).rest(F):E=Le.tuple(T),typeof r.minItems=="number"&&(E=E.check(Le.minLength(r.minItems))),typeof r.maxItems=="number"&&(E=E.check(Le.maxLength(r.maxItems)))}else if(j!==void 0){const T=Dt(j,m);let F=Le.array(T);typeof r.minItems=="number"&&(F=F.min(r.minItems)),typeof r.maxItems=="number"&&(F=F.max(r.maxItems)),E=F}else E=Le.array(Le.any());break}default:throw new Error(`Unsupported type: ${C}`)}return E}function Dt(r,m){if(typeof r=="boolean")return r?Le.any():Le.never();let C=vg(r,m);const E=r.type||r.enum!==void 0||r.const!==void 0;if(r.anyOf&&Array.isArray(r.anyOf)){const F=r.anyOf.map(s=>Dt(s,m)),c=Le.union(F);C=E?Le.intersection(C,c):c}if(r.oneOf&&Array.isArray(r.oneOf)){const F=r.oneOf.map(s=>Dt(s,m)),c=Le.xor(F);C=E?Le.intersection(C,c):c}if(r.allOf&&Array.isArray(r.allOf))if(r.allOf.length===0)C=E?C:Le.any();else{let F=E?C:Dt(r.allOf[0],m);const c=E?0:1;for(let s=c;s<r.allOf.length;s++)F=Le.intersection(F,Dt(r.allOf[s],m));C=F}r.nullable===!0&&m.version==="openapi-3.0"&&(C=Le.nullable(C)),r.readOnly===!0&&(C=Le.readonly(C)),r.default!==void 0&&(C=C.default(r.default));const _={},j=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(const F of j)F in r&&(_[F]=r[F]);const T=["contentEncoding","contentMediaType","contentSchema"];for(const F of T)F in r&&(_[F]=r[F]);for(const F of Object.keys(r))k4.has(F)||(_[F]=r[F]);return Object.keys(_).length>0&&m.registry.add(C,_),r.description&&(C=C.describe(r.description)),C}function C4(r,m){if(typeof r=="boolean")return r?Le.any():Le.never();let C;try{C=JSON.parse(JSON.stringify(r))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}const E=P4(C,m?.defaultTarget),_=C.$defs||C.definitions||{},j={version:E,defs:_,refs:new Map,processing:new Set,rootSchema:C,registry:m?.registry??w4.globalRegistry};return Dt(C,j)}var Jt={},O4=Jt&&Jt.__createBinding||(Object.create?(function(r,m,C,E){E===void 0&&(E=C);var _=Object.getOwnPropertyDescriptor(m,C);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[C]}}),Object.defineProperty(r,E,_)}):(function(r,m,C,E){E===void 0&&(E=C),r[E]=m[C]})),M4=Jt&&Jt.__setModuleDefault||(Object.create?(function(r,m){Object.defineProperty(r,"default",{enumerable:!0,value:m})}):function(r,m){r.default=m}),bg=Jt&&Jt.__importStar||function(r){if(r&&r.__esModule)return r;var m={};if(r!=null)for(var C in r)C!=="default"&&Object.prototype.hasOwnProperty.call(r,C)&&O4(m,r,C);return M4(m,r),m};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.string=E4;Jt.number=I4;Jt.boolean=D4;Jt.bigint=A4;Jt.date=z4;const ma=bg($t),ga=bg(hs());function E4(r){return ma._coercedString(ga.ZodString,r)}function I4(r){return ma._coercedNumber(ga.ZodNumber,r)}function D4(r){return ma._coercedBoolean(ga.ZodBoolean,r)}function A4(r){return ma._coercedBigint(ga.ZodBigInt,r)}function z4(r){return ma._coercedDate(ga.ZodDate,r)}(function(r){var m=Ht&&Ht.__createBinding||(Object.create?(function(n,t,x,A){A===void 0&&(A=x);var te=Object.getOwnPropertyDescriptor(t,x);(!te||("get"in te?!t.__esModule:te.writable||te.configurable))&&(te={enumerable:!0,get:function(){return t[x]}}),Object.defineProperty(n,A,te)}):(function(n,t,x,A){A===void 0&&(A=x),n[A]=t[x]})),C=Ht&&Ht.__setModuleDefault||(Object.create?(function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}):function(n,t){n.default=t}),E=Ht&&Ht.__importStar||function(n){if(n&&n.__esModule)return n;var t={};if(n!=null)for(var x in n)x!=="default"&&Object.prototype.hasOwnProperty.call(n,x)&&m(t,n,x);return C(t,n),t},_=Ht&&Ht.__exportStar||function(n,t){for(var x in n)x!=="default"&&!Object.prototype.hasOwnProperty.call(t,x)&&m(t,n,x)},j=Ht&&Ht.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(r,"__esModule",{value:!0}),r.coerce=r.iso=r.ZodISODuration=r.ZodISOTime=r.ZodISODate=r.ZodISODateTime=r.locales=r.fromJSONSchema=r.toJSONSchema=r.NEVER=r.util=r.TimePrecision=r.flattenError=r.formatError=r.prettifyError=r.treeifyError=r.regexes=r.clone=r.$brand=r.$input=r.$output=r.config=r.registry=r.globalRegistry=r.core=void 0,r.core=E($t),_(hs(),r),_(ps,r),_(qt,r),_(dt,r),_(Wr,r);const T=$t,F=j(og);(0,T.config)((0,F.default)());var c=$t;Object.defineProperty(r,"globalRegistry",{enumerable:!0,get:function(){return c.globalRegistry}}),Object.defineProperty(r,"registry",{enumerable:!0,get:function(){return c.registry}}),Object.defineProperty(r,"config",{enumerable:!0,get:function(){return c.config}}),Object.defineProperty(r,"$output",{enumerable:!0,get:function(){return c.$output}}),Object.defineProperty(r,"$input",{enumerable:!0,get:function(){return c.$input}}),Object.defineProperty(r,"$brand",{enumerable:!0,get:function(){return c.$brand}}),Object.defineProperty(r,"clone",{enumerable:!0,get:function(){return c.clone}}),Object.defineProperty(r,"regexes",{enumerable:!0,get:function(){return c.regexes}}),Object.defineProperty(r,"treeifyError",{enumerable:!0,get:function(){return c.treeifyError}}),Object.defineProperty(r,"prettifyError",{enumerable:!0,get:function(){return c.prettifyError}}),Object.defineProperty(r,"formatError",{enumerable:!0,get:function(){return c.formatError}}),Object.defineProperty(r,"flattenError",{enumerable:!0,get:function(){return c.flattenError}}),Object.defineProperty(r,"TimePrecision",{enumerable:!0,get:function(){return c.TimePrecision}}),Object.defineProperty(r,"util",{enumerable:!0,get:function(){return c.util}}),Object.defineProperty(r,"NEVER",{enumerable:!0,get:function(){return c.NEVER}});var s=fa;Object.defineProperty(r,"toJSONSchema",{enumerable:!0,get:function(){return s.toJSONSchema}});var u=Er;Object.defineProperty(r,"fromJSONSchema",{enumerable:!0,get:function(){return u.fromJSONSchema}}),r.locales=E(oa);var v=us();Object.defineProperty(r,"ZodISODateTime",{enumerable:!0,get:function(){return v.ZodISODateTime}}),Object.defineProperty(r,"ZodISODate",{enumerable:!0,get:function(){return v.ZodISODate}}),Object.defineProperty(r,"ZodISOTime",{enumerable:!0,get:function(){return v.ZodISOTime}}),Object.defineProperty(r,"ZodISODuration",{enumerable:!0,get:function(){return v.ZodISODuration}}),r.iso=E(us()),r.coerce=E(Jt)})(Ht);(function(r){var m=xr&&xr.__createBinding||(Object.create?(function(T,F,c,s){s===void 0&&(s=c);var u=Object.getOwnPropertyDescriptor(F,c);(!u||("get"in u?!F.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return F[c]}}),Object.defineProperty(T,s,u)}):(function(T,F,c,s){s===void 0&&(s=c),T[s]=F[c]})),C=xr&&xr.__setModuleDefault||(Object.create?(function(T,F){Object.defineProperty(T,"default",{enumerable:!0,value:F})}):function(T,F){T.default=F}),E=xr&&xr.__importStar||function(T){if(T&&T.__esModule)return T;var F={};if(T!=null)for(var c in T)c!=="default"&&Object.prototype.hasOwnProperty.call(T,c)&&m(F,T,c);return C(F,T),F},_=xr&&xr.__exportStar||function(T,F){for(var c in T)c!=="default"&&!Object.prototype.hasOwnProperty.call(F,c)&&m(F,T,c)};Object.defineProperty(r,"__esModule",{value:!0}),r.z=void 0;const j=E(Ht);r.z=j,_(Ht,r),r.default=j})(xr);var Jm;function yg(){return Jm||(Jm=1,(function(r){var m={};Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});var C=Object.create,E=Object.defineProperty,_=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,T=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty,c=(e,i,a,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(var l=j(i),d=0,f=l.length,p;d<f;d++)p=l[d],!F.call(e,p)&&p!==a&&E(e,p,{get:(g=>i[g]).bind(null,p),enumerable:!(o=_(i,p))||o.enumerable});return e},s=(e,i,a)=>(a=e!=null?C(T(e)):{},c(i||!e||!e.__esModule?E(a,"default",{value:e,enumerable:!0}):a,e));const u=uE();let v=Km,n=s(v,1);v=s(v);let t=Xm;t=s(t,1);let x=eE;x=s(x,1);let A=tE;A=s(A,1);let te=rE;te=s(te,1);let ee=nE;ee=s(ee,1);let oe=iE;oe=s(oe,1);let ie=aE;ie=s(ie,1);let ke=oE;ke=s(ke,1);let se=sE,Oe=dE,Se=xr;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 Ge(){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 it=(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},ht=(e,i)=>({classGroupId:e,validator:i}),kt=(e=new Map,i=null,a)=>({nextPart:e,validators:i,classGroupId:a}),Et="-",It=[],At="arbitrary..",Lt=e=>{const i=fr(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return Ft(f);const p=f.split(Et);return yt(p,p[0]===""&&p.length>1?1:0,i)},getConflictingClassGroupIds:(f,p)=>{if(p){const g=o[f],h=a[f];return g?h?it(h,g):g:h||It}return a[f]||It}}},yt=(e,i,a)=>{if(e.length-i===0)return a.classGroupId;const o=e[i],l=a.nextPart.get(o);if(l){const g=yt(e,i+1,l);if(g)return g}const d=a.validators;if(d===null)return;const f=i===0?e.join(Et):e.slice(i).join(Et),p=d.length;for(let g=0;g<p;g++){const h=d[g];if(h.validator(f))return h.classGroupId}},Ft=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?At+o:void 0})(),fr=e=>{const{theme:i,classGroups:a}=e;return k(a,i)},k=(e,i)=>{const a=kt();for(const o in e){const l=e[o];O(l,a,o,i)}return a},O=(e,i,a,o)=>{const l=e.length;for(let d=0;d<l;d++){const f=e[d];I(f,i,a,o)}},I=(e,i,a,o)=>{if(typeof e=="string"){U(e,i,a);return}if(typeof e=="function"){V(e,i,a,o);return}J(e,i,a,o)},U=(e,i,a)=>{const o=e===""?i:ae(i,e);o.classGroupId=a},V=(e,i,a,o)=>{if(be(e)){O(e(o),i,a,o);return}i.validators===null&&(i.validators=[]),i.validators.push(ht(a,e))},J=(e,i,a,o)=>{const l=Object.entries(e),d=l.length;for(let f=0;f<d;f++){const[p,g]=l[f];O(g,ae(i,p),a,o)}},ae=(e,i)=>{let a=e;const o=i.split(Et),l=o.length;for(let d=0;d<l;d++){const f=o[d];let p=a.nextPart.get(f);p||(p=kt(),a.nextPart.set(f,p)),a=p}return a},be=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,K=e=>{if(e<1)return{get:()=>{},set:()=>{}};let i=0,a=Object.create(null),o=Object.create(null);const l=(d,f)=>{a[d]=f,i++,i>e&&(i=0,o=a,a=Object.create(null))};return{get(d){let f=a[d];if(f!==void 0)return f;if((f=o[d])!==void 0)return l(d,f),f},set(d,f){d in a?a[d]=f:l(d,f)}}},q="!",ce=":",pe=[],Y=(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 f=0,p=0,g=0,h;const b=l.length;for(let D=0;D<b;D++){const z=l[D];if(f===0&&p===0){if(z===ce){d.push(l.slice(g,D)),g=D+1;continue}if(z==="/"){h=D;continue}}z==="["?f++:z==="]"?f--:z==="("?p++:z===")"&&p--}const w=d.length===0?l:l.slice(g);let $=w,P=!1;w.endsWith(q)?($=w.slice(0,-1),P=!0):w.startsWith(q)&&($=w.slice(1),P=!0);const M=h&&h>g?h-g:void 0;return Y(d,P,$,M)};if(i){const l=i+ce,d=o;o=f=>f.startsWith(l)?d(f.slice(l.length)):Y(pe,!1,f,void 0,!0)}if(a){const l=o;o=d=>a({className:d,parseClassName:l})}return o},Ie=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 f=a[d],p=f[0]==="[",g=i.has(f);p||g?(l.length>0&&(l.sort(),o.push(...l),l=[]),o.push(f)):l.push(f)}return l.length>0&&(l.sort(),o.push(...l)),o}},at=e=>({cache:K(e.cacheSize),parseClassName:fe(e),sortModifiers:Ie(e),...Lt(e)}),Xe=/\s+/,tt=(e,i)=>{const{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:l,sortModifiers:d}=i,f=[],p=e.trim().split(Xe);let g="";for(let h=p.length-1;h>=0;h-=1){const b=p[h],{isExternal:w,modifiers:$,hasImportantModifier:P,baseClassName:M,maybePostfixModifierPosition:D}=a(b);if(w){g=b+(g.length>0?" "+g:g);continue}let z=!!D,R=o(z?M.substring(0,D):M);if(!R){if(!z){g=b+(g.length>0?" "+g:g);continue}if(R=o(M),!R){g=b+(g.length>0?" "+g:g);continue}z=!1}const Z=$.length===0?"":$.length===1?$[0]:d($).join(":"),G=P?Z+q:Z,Q=G+R;if(f.indexOf(Q)>-1)continue;f.push(Q);const W=l(R,z);for(let X=0;X<W.length;++X){const he=W[X];f.push(G+he)}g=b+(g.length>0?" "+g:g)}return g},ot=(...e)=>{let i=0,a,o,l="";for(;i<e.length;)(a=e[i++])&&(o=gt(a))&&(l&&(l+=" "),l+=o);return l},gt=e=>{if(typeof e=="string")return e;let i,a="";for(let o=0;o<e.length;o++)e[o]&&(i=gt(e[o]))&&(a&&(a+=" "),a+=i);return a},ct=(e,...i)=>{let a,o,l,d;const f=g=>(a=at(i.reduce((h,b)=>b(h),e())),o=a.cache.get,l=a.cache.set,d=p,p(g)),p=g=>{const h=o(g);if(h)return h;const b=tt(g,a);return l(g,b),b};return d=f,(...g)=>d(ot(...g))},mt=[],vt=e=>{const i=a=>a[e]||mt;return i.isThemeGetter=!0,i},qr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Sr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,vs=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,bs=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ys=/\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$/,xs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Mi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_s=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mr=e=>vs.test(e),rt=e=>!!e&&!Number.isNaN(Number(e)),nr=e=>!!e&&Number.isInteger(Number(e)),sn=e=>e.endsWith("%")&&rt(e.slice(0,-1)),ir=e=>bs.test(e),pa=()=>!0,ws=e=>ys.test(e)&&!xs.test(e),Ei=()=>!1,Ii=e=>Mi.test(e),Ss=e=>_s.test(e),js=e=>!Ze(e)&&!Be(e),$s=e=>ar(e,ba,Ei),Ze=e=>qr.test(e),Kt=e=>ar(e,zi,ws),Di=e=>ar(e,ya,rt),ln=e=>ar(e,_a,pa),ks=e=>ar(e,xa,Ei),Ai=e=>ar(e,Xr,Ei),ha=e=>ar(e,va,Ss),Jr=e=>ar(e,wa,Ii),Be=e=>Sr.test(e),Dr=e=>jr(e,zi),Ps=e=>jr(e,xa),cn=e=>jr(e,Xr),Ns=e=>jr(e,ba),Cs=e=>jr(e,va),Kr=e=>jr(e,wa,!0),Os=e=>jr(e,_a,!0),ar=(e,i,a)=>{const o=qr.exec(e);return o?o[1]?i(o[1]):a(o[2]):!1},jr=(e,i,a=!1)=>{const o=Sr.exec(e);return o?o[1]?i(o[1]):a:!1},Xr=e=>e==="position"||e==="percentage",va=e=>e==="image"||e==="url",ba=e=>e==="length"||e==="size"||e==="bg-size",zi=e=>e==="length",ya=e=>e==="number",xa=e=>e==="family-name",_a=e=>e==="number"||e==="weight",wa=e=>e==="shadow",Ms=()=>{const e=vt("color"),i=vt("font"),a=vt("text"),o=vt("font-weight"),l=vt("tracking"),d=vt("leading"),f=vt("breakpoint"),p=vt("container"),g=vt("spacing"),h=vt("radius"),b=vt("shadow"),w=vt("inset-shadow"),$=vt("text-shadow"),P=vt("drop-shadow"),M=vt("blur"),D=vt("perspective"),z=vt("aspect"),R=vt("ease"),Z=vt("animate"),G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],W=()=>[...Q(),Be,Ze],X=()=>["auto","hidden","clip","visible","scroll"],he=()=>["auto","contain","none"],H=()=>[Be,Ze,g],me=()=>[mr,"full","auto",...H()],ye=()=>[nr,"none","subgrid",Be,Ze],Qe=()=>["auto",{span:["full",nr,Be,Ze]},nr,Be,Ze],Ye=()=>[nr,"auto",Be,Ze],Je=()=>["auto","min","max","fr",Be,Ze],Ae=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],De=()=>["start","end","center","stretch","center-safe","end-safe"],Re=()=>["auto",...H()],Te=()=>[mr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],ue=()=>[mr,"screen","full","dvw","lvw","svw","min","max","fit",...H()],ge=()=>[mr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...H()],ve=()=>[e,Be,Ze],je=()=>[...Q(),cn,Ai,{position:[Be,Ze]}],_e=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Ue=()=>["auto","cover","contain",Ns,$s,{size:[Be,Ze]}],ne=()=>[sn,Dr,Kt],we=()=>["","none","full",h,Be,Ze],Me=()=>["",rt,Dr,Kt],ze=()=>["solid","dashed","dotted","double"],We=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Fe=()=>[rt,sn,cn,Ai],Tt=()=>["","none",M,Be,Ze],Rt=()=>["none",rt,Be,Ze],Ct=()=>["none",rt,Be,Ze],xt=()=>[rt,Be,Ze],Zt=()=>[mr,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ir],breakpoint:[ir],color:[pa],container:[ir],"drop-shadow":[ir],ease:["in","out","in-out"],font:[js],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ir],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ir],shadow:[ir],spacing:["px",rt],text:[ir],"text-shadow":[ir],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",mr,Ze,Be,z]}],container:["container"],columns:[{columns:[rt,Ze,Be,p]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"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:W()}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:he()}],"overscroll-x":[{"overscroll-x":he()}],"overscroll-y":[{"overscroll-y":he()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:me()}],"inset-x":[{"inset-x":me()}],"inset-y":[{"inset-y":me()}],start:[{"inset-s":me(),start:me()}],end:[{"inset-e":me(),end:me()}],"inset-bs":[{"inset-bs":me()}],"inset-be":[{"inset-be":me()}],top:[{top:me()}],right:[{right:me()}],bottom:[{bottom:me()}],left:[{left:me()}],visibility:["visible","invisible","collapse"],z:[{z:[nr,"auto",Be,Ze]}],basis:[{basis:[mr,"full","auto",p,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[rt,mr,"auto","initial","none",Ze]}],grow:[{grow:["",rt,Be,Ze]}],shrink:[{shrink:["",rt,Be,Ze]}],order:[{order:[nr,"first","last","none",Be,Ze]}],"grid-cols":[{"grid-cols":ye()}],"col-start-end":[{col:Qe()}],"col-start":[{"col-start":Ye()}],"col-end":[{"col-end":Ye()}],"grid-rows":[{"grid-rows":ye()}],"row-start-end":[{row:Qe()}],"row-start":[{"row-start":Ye()}],"row-end":[{"row-end":Ye()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Je()}],"auto-rows":[{"auto-rows":Je()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...Ae(),"normal"]}],"justify-items":[{"justify-items":[...De(),"normal"]}],"justify-self":[{"justify-self":["auto",...De()]}],"align-content":[{content:["normal",...Ae()]}],"align-items":[{items:[...De(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...De(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ae()}],"place-items":[{"place-items":[...De(),"baseline"]}],"place-self":[{"place-self":["auto",...De()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pbs:[{pbs:H()}],pbe:[{pbe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:Re()}],mx:[{mx:Re()}],my:[{my:Re()}],ms:[{ms:Re()}],me:[{me:Re()}],mbs:[{mbs:Re()}],mbe:[{mbe:Re()}],mt:[{mt:Re()}],mr:[{mr:Re()}],mb:[{mb:Re()}],ml:[{ml:Re()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:Te()}],"inline-size":[{inline:["auto",...ue()]}],"min-inline-size":[{"min-inline":["auto",...ue()]}],"max-inline-size":[{"max-inline":["none",...ue()]}],"block-size":[{block:["auto",...ge()]}],"min-block-size":[{"min-block":["auto",...ge()]}],"max-block-size":[{"max-block":["none",...ge()]}],w:[{w:[p,"screen",...Te()]}],"min-w":[{"min-w":[p,"screen","none",...Te()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[f]},...Te()]}],h:[{h:["screen","lh",...Te()]}],"min-h":[{"min-h":["screen","lh","none",...Te()]}],"max-h":[{"max-h":["screen","lh",...Te()]}],"font-size":[{text:["base",a,Dr,Kt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Os,ln]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",sn,Ze]}],"font-family":[{font:[Ps,ks,i]}],"font-features":[{"font-features":[Ze]}],"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,Be,Ze]}],"line-clamp":[{"line-clamp":[rt,"none",Be,Di]}],leading:[{leading:[d,...H()]}],"list-image":[{"list-image":["none",Be,Ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,Ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ve()}],"text-color":[{text:ve()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ze(),"wavy"]}],"text-decoration-thickness":[{decoration:[rt,"from-font","auto",Be,Kt]}],"text-decoration-color":[{decoration:ve()}],"underline-offset":[{"underline-offset":[rt,"auto",Be,Ze]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,Ze]}],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",Be,Ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:je()}],"bg-repeat":[{bg:_e()}],"bg-size":[{bg:Ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},nr,Be,Ze],radial:["",Be,Ze],conic:[nr,Be,Ze]},Cs,ha]}],"bg-color":[{bg:ve()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:ve()}],"gradient-via":[{via:ve()}],"gradient-to":[{to:ve()}],rounded:[{rounded:we()}],"rounded-s":[{"rounded-s":we()}],"rounded-e":[{"rounded-e":we()}],"rounded-t":[{"rounded-t":we()}],"rounded-r":[{"rounded-r":we()}],"rounded-b":[{"rounded-b":we()}],"rounded-l":[{"rounded-l":we()}],"rounded-ss":[{"rounded-ss":we()}],"rounded-se":[{"rounded-se":we()}],"rounded-ee":[{"rounded-ee":we()}],"rounded-es":[{"rounded-es":we()}],"rounded-tl":[{"rounded-tl":we()}],"rounded-tr":[{"rounded-tr":we()}],"rounded-br":[{"rounded-br":we()}],"rounded-bl":[{"rounded-bl":we()}],"border-w":[{border:Me()}],"border-w-x":[{"border-x":Me()}],"border-w-y":[{"border-y":Me()}],"border-w-s":[{"border-s":Me()}],"border-w-e":[{"border-e":Me()}],"border-w-bs":[{"border-bs":Me()}],"border-w-be":[{"border-be":Me()}],"border-w-t":[{"border-t":Me()}],"border-w-r":[{"border-r":Me()}],"border-w-b":[{"border-b":Me()}],"border-w-l":[{"border-l":Me()}],"divide-x":[{"divide-x":Me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ze(),"hidden","none"]}],"divide-style":[{divide:[...ze(),"hidden","none"]}],"border-color":[{border:ve()}],"border-color-x":[{"border-x":ve()}],"border-color-y":[{"border-y":ve()}],"border-color-s":[{"border-s":ve()}],"border-color-e":[{"border-e":ve()}],"border-color-bs":[{"border-bs":ve()}],"border-color-be":[{"border-be":ve()}],"border-color-t":[{"border-t":ve()}],"border-color-r":[{"border-r":ve()}],"border-color-b":[{"border-b":ve()}],"border-color-l":[{"border-l":ve()}],"divide-color":[{divide:ve()}],"outline-style":[{outline:[...ze(),"none","hidden"]}],"outline-offset":[{"outline-offset":[rt,Be,Ze]}],"outline-w":[{outline:["",rt,Dr,Kt]}],"outline-color":[{outline:ve()}],shadow:[{shadow:["","none",b,Kr,Jr]}],"shadow-color":[{shadow:ve()}],"inset-shadow":[{"inset-shadow":["none",w,Kr,Jr]}],"inset-shadow-color":[{"inset-shadow":ve()}],"ring-w":[{ring:Me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ve()}],"ring-offset-w":[{"ring-offset":[rt,Kt]}],"ring-offset-color":[{"ring-offset":ve()}],"inset-ring-w":[{"inset-ring":Me()}],"inset-ring-color":[{"inset-ring":ve()}],"text-shadow":[{"text-shadow":["none",$,Kr,Jr]}],"text-shadow-color":[{"text-shadow":ve()}],opacity:[{opacity:[rt,Be,Ze]}],"mix-blend":[{"mix-blend":[...We(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":We()}],"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":Fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":Fe()}],"mask-image-linear-from-color":[{"mask-linear-from":ve()}],"mask-image-linear-to-color":[{"mask-linear-to":ve()}],"mask-image-t-from-pos":[{"mask-t-from":Fe()}],"mask-image-t-to-pos":[{"mask-t-to":Fe()}],"mask-image-t-from-color":[{"mask-t-from":ve()}],"mask-image-t-to-color":[{"mask-t-to":ve()}],"mask-image-r-from-pos":[{"mask-r-from":Fe()}],"mask-image-r-to-pos":[{"mask-r-to":Fe()}],"mask-image-r-from-color":[{"mask-r-from":ve()}],"mask-image-r-to-color":[{"mask-r-to":ve()}],"mask-image-b-from-pos":[{"mask-b-from":Fe()}],"mask-image-b-to-pos":[{"mask-b-to":Fe()}],"mask-image-b-from-color":[{"mask-b-from":ve()}],"mask-image-b-to-color":[{"mask-b-to":ve()}],"mask-image-l-from-pos":[{"mask-l-from":Fe()}],"mask-image-l-to-pos":[{"mask-l-to":Fe()}],"mask-image-l-from-color":[{"mask-l-from":ve()}],"mask-image-l-to-color":[{"mask-l-to":ve()}],"mask-image-x-from-pos":[{"mask-x-from":Fe()}],"mask-image-x-to-pos":[{"mask-x-to":Fe()}],"mask-image-x-from-color":[{"mask-x-from":ve()}],"mask-image-x-to-color":[{"mask-x-to":ve()}],"mask-image-y-from-pos":[{"mask-y-from":Fe()}],"mask-image-y-to-pos":[{"mask-y-to":Fe()}],"mask-image-y-from-color":[{"mask-y-from":ve()}],"mask-image-y-to-color":[{"mask-y-to":ve()}],"mask-image-radial":[{"mask-radial":[Be,Ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":Fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":Fe()}],"mask-image-radial-from-color":[{"mask-radial-from":ve()}],"mask-image-radial-to-color":[{"mask-radial-to":ve()}],"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":Q()}],"mask-image-conic-pos":[{"mask-conic":[rt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":Fe()}],"mask-image-conic-from-color":[{"mask-conic-from":ve()}],"mask-image-conic-to-color":[{"mask-conic-to":ve()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:je()}],"mask-repeat":[{mask:_e()}],"mask-size":[{mask:Ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Be,Ze]}],filter:[{filter:["","none",Be,Ze]}],blur:[{blur:Tt()}],brightness:[{brightness:[rt,Be,Ze]}],contrast:[{contrast:[rt,Be,Ze]}],"drop-shadow":[{"drop-shadow":["","none",P,Kr,Jr]}],"drop-shadow-color":[{"drop-shadow":ve()}],grayscale:[{grayscale:["",rt,Be,Ze]}],"hue-rotate":[{"hue-rotate":[rt,Be,Ze]}],invert:[{invert:["",rt,Be,Ze]}],saturate:[{saturate:[rt,Be,Ze]}],sepia:[{sepia:["",rt,Be,Ze]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,Ze]}],"backdrop-blur":[{"backdrop-blur":Tt()}],"backdrop-brightness":[{"backdrop-brightness":[rt,Be,Ze]}],"backdrop-contrast":[{"backdrop-contrast":[rt,Be,Ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",rt,Be,Ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[rt,Be,Ze]}],"backdrop-invert":[{"backdrop-invert":["",rt,Be,Ze]}],"backdrop-opacity":[{"backdrop-opacity":[rt,Be,Ze]}],"backdrop-saturate":[{"backdrop-saturate":[rt,Be,Ze]}],"backdrop-sepia":[{"backdrop-sepia":["",rt,Be,Ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,Ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[rt,"initial",Be,Ze]}],ease:[{ease:["linear","initial",R,Be,Ze]}],delay:[{delay:[rt,Be,Ze]}],animate:[{animate:["none",Z,Be,Ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[D,Be,Ze]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:Rt()}],"rotate-x":[{"rotate-x":Rt()}],"rotate-y":[{"rotate-y":Rt()}],"rotate-z":[{"rotate-z":Rt()}],scale:[{scale:Ct()}],"scale-x":[{"scale-x":Ct()}],"scale-y":[{"scale-y":Ct()}],"scale-z":[{"scale-z":Ct()}],"scale-3d":["scale-3d"],skew:[{skew:xt()}],"skew-x":[{"skew-x":xt()}],"skew-y":[{"skew-y":xt()}],transform:[{transform:[Be,Ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Zt()}],"translate-x":[{"translate-x":Zt()}],"translate-y":[{"translate-y":Zt()}],"translate-z":[{"translate-z":Zt()}],"translate-none":["translate-none"],accent:[{accent:ve()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ve()}],"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",Be,Ze]}],"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":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mbs":[{"scroll-mbs":H()}],"scroll-mbe":[{"scroll-mbe":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pbs":[{"scroll-pbs":H()}],"scroll-pbe":[{"scroll-pbe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",Be,Ze]}],fill:[{fill:["none",...ve()]}],"stroke-w":[{stroke:[rt,Dr,Kt,Di]}],stroke:[{stroke:["none",...ve()]}],"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"]}},y=ct(Ms);function N(...e){return y(Ge(e))}function L(e){if(e==null||typeof e!="object")return null;const i=Reflect.get(e,"data");if(i!=null&&typeof i=="object"){const a=Reflect.get(i,"capRouteReason");if(typeof a=="string")return a}return null}function B(e){const i=L(e);return i!==null?i==="no-provider"||i==="node-offline":(e instanceof Error?e.message:String(e)).includes("provider not available")}var re="rounded-lg border border-border bg-surface overflow-hidden",ft="border-b border-border px-3 sm:px-4 py-1.5 sm:py-2",wt="p-2 sm:p-3 lg:p-4",un="space-y-3 sm:space-y-4",_g="gap-2 sm:gap-3",wg="px-3 sm:px-4 py-1.5 sm:py-2",Sg="grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4",jg="grid grid-cols-1 lg:grid-cols-2",$g="flex flex-col-reverse md:flex-row",kg="w-full md:w-44 lg:w-52 md:flex-shrink-0 border-b md:border-b-0 md:border-l border-border",Pg="text-[10px] sm:text-[11px] font-semibold text-foreground uppercase tracking-wider",Ng="text-[11px] sm:text-xs text-foreground",gr="text-[10px] text-foreground-subtle",Cg="text-[11px] sm:text-xs font-medium text-foreground",Og="text-base sm:text-lg font-semibold leading-tight text-foreground",Mg="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",Eg="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",Ig="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",Dg="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",Ag="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",zg="inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium transition-colors",Tg="border-primary/50 bg-primary/15 text-primary",Rg="border-border bg-surface text-foreground-subtle hover:bg-surface-hover";function Lg(e,i){for(const a of e.slots)for(const o of a.addons)if(o.id===i)return o;return null}function Zg(e,i){return e.models.find(a=>a.id===i)??null}function Ug(e,i){return e.models.find(a=>!!a.formats[i])??null}function Bg(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 Fg(e){const{source:i,target:a,catalog:o,addonIds:l}=e,d=[];for(const f of l){const p=i.defaults[f];if(!p){d.push({addonId:f,outcome:"skip",modelId:null,reason:"no source entry",patch:null});continue}const g=Lg(o,f);if(!g){d.push({addonId:f,outcome:"skip",modelId:null,reason:"addon not in target catalog",patch:null});continue}const h=Zg(g,p.modelId),b=h!==null&&!!h.formats[a.engine.format];let w,$;if(b)w=p.modelId,$="exact";else{const M=Ug(g,a.engine.format);if(!M){d.push({addonId:f,outcome:"skip",modelId:null,reason:"no compatible model for target format",patch:null});continue}w=M.id,$="mapped"}const P={enabled:p.enabled,modelId:w,settings:Bg(p.settings,g)};d.push({addonId:f,outcome:$,modelId:w,patch:P})}return d}var Es={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 Is(e){return Es[e]??Es.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 Gg="FEDERATION_DEBUG",Ds=(function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e})({}),yc=!0;function Vg(){return yc}function Wg(){try{if(Vg()&&window.localStorage)return!!localStorage.getItem(Gg)}catch{return!1}return!1}function As(){return typeof process<"u"&&m&&m.FEDERATION_DEBUG?!!m.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:Wg()}var Qg="[ Federation Runtime ]",xc=function(...e){return e.length?e.reduce((i,a)=>a?i?`${i}:${a}`:a:i,""):""},zs=(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),"")},_c=e=>{console.warn(`${Qg}: ${e}`)};function wc(e){try{return JSON.stringify(e,null,2)}catch{return""}}var Ts=(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 Hg(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function qg(e,i={}){const{remotes:a={},overrides:o={},version:l}=i;let d;const f=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&l?Hg(l):e.metaData.publicPath:e.metaData.getPublicPath,p=Object.keys(o);let g={};Object.keys(a).length||(g=e.remotes?.reduce((Z,G)=>{let Q;const W=G.federationContainerName;return p.includes(W)?Q=o[W]:"version"in G?Q=G.version:Q=G.entry,Z[W]={matchedVersion:Q},Z},{})||{}),Object.keys(a).forEach(Z=>g[Z]={matchedVersion:p.includes(Z)?o[Z]:a[Z]});const{remoteEntry:{path:h,name:b,type:w},types:$={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:P},globalName:M,ssrRemoteEntry:D}=e.metaData,{exposes:z}=e;let R={version:l||"",buildVersion:P,globalName:M,remoteEntry:Ts(h,b),remoteEntryType:w,remoteTypes:Ts($.path,$.name),remoteTypesZip:$.zip||"",remoteTypesAPI:$.api||"",remotesInfo:g,shared:e?.shared.map(Z=>({assets:Z.assets,sharedName:Z.name,version:Z.version,usedExports:Z.referenceExports||[]})),modules:z?.map(Z=>({moduleName:Z.name,modulePath:Z.path,assets:Z.assets}))};if("publicPath"in e.metaData?(d={...R,publicPath:f()},typeof e.metaData.ssrPublicPath=="string"&&(d.ssrPublicPath=e.metaData.ssrPublicPath)):d={...R,getPublicPath:f()},D){const Z=Ts(D.path,D.name);d.ssrRemoteEntry=Z,d.ssrRemoteEntryType=D.type||"commonjs-module"}return d}function Sc(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(".json"))}var Jg="[ Module Federation ]",Ti=console,Kg=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function Xg(){try{const e=new Error().stack;if(!e)return;const[,...i]=e.split(`
|
|
95
|
+
`),a=i.filter(o=>!Kg.some(l=>o.includes(l)));return a.length?`Stack trace:
|
|
96
|
+
${a.slice(0,5).join(`
|
|
97
|
+
`)}`:void 0}catch{return}}var jc=class{constructor(e,i=Ti){this.prefix=e,this.delegate=i??Ti}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??Ti}emit(e,i){const a=this.delegate,o=As()?Xg():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 f of d){const p=a[f];if(typeof p=="function"){p.call(a,this.prefix,...l);return}}for(const f of d){const p=Ti[f];if(typeof p=="function"){p.call(Ti,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){As()&&this.emit("debug",e)}};function Yg(e){return new jc(e)}function ep(e){const i=new jc(e);return Object.defineProperty(i,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),i}ep(Jg);async function $c(e,i){try{return await e()}catch(a){_c(a);return}}function Rs(e,i){const a=/^(https?:)?\/\//i;return e.replace(a,"").replace(/\/$/,"")===i.replace(a,"").replace(/\/$/,"")}function kc(e){let i=null,a=!0,o=2e4,l;const d=document.getElementsByTagName("script");for(let h=0;h<d.length;h++){const b=d[h],w=b.getAttribute("src");if(w&&Rs(w,e.url)){i=b,a=!1;break}}if(!i){const h=e.attrs;i=document.createElement("script"),i.type=h?.type==="module"?"module":"text/javascript";let b;e.createScriptHook&&(b=e.createScriptHook(e.url,e.attrs),b instanceof HTMLScriptElement?i=b:typeof b=="object"&&("script"in b&&b.script&&(i=b.script),"timeout"in b&&b.timeout&&(o=b.timeout))),i.src||(i.src=e.url),h&&!b&&Object.keys(h).forEach(w=>{i&&(w==="async"||w==="defer"?i[w]=h[w]:i.getAttribute(w)||i.setAttribute(w,h[w]))})}let f=null;const p=typeof window<"u"?h=>{if(h.filename&&Rs(h.filename,e.url)){const b=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${h.message} (${h.filename}:${h.lineno}:${h.colno})`);b.name="ScriptExecutionError",f=b}}:null;p&&window.addEventListener("error",p);const g=async(h,b)=>{clearTimeout(l),p&&window.removeEventListener("error",p);const w=()=>{if(b?.type==="error"){const $=new Error(b?.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.)`);$.name="ScriptNetworkError",e?.onErrorCallback&&e?.onErrorCallback($)}else f?e?.onErrorCallback&&e?.onErrorCallback(f):e?.cb&&e?.cb()};if(i&&(i.onerror=null,i.onload=null,$c(()=>{const{needDeleteScript:$=!0}=e;$&&i?.parentNode&&i.parentNode.removeChild(i)}),h&&typeof h=="function")){const $=h(b);if($ instanceof Promise){const P=await $;return w(),P}return w(),$}w()};return i.onerror=g.bind(null,i.onerror),i.onload=g.bind(null,i.onload),l=setTimeout(()=>{g(null,{type:"error",isTimeout:!0})},o),{script:i,needAttach:a}}function Ls(e){let i=null,a=!0;const o=document.getElementsByTagName("link");for(let d=0;d<o.length;d++){const f=o[d],p=f.getAttribute("href"),g=f.getAttribute("rel");if(p&&Rs(p,e.url)&&g===e.attrs.rel){i=f,a=!1;break}}if(!i){i=document.createElement("link"),i.setAttribute("href",e.url);let d;const f=e.attrs;e.createLinkHook&&(d=e.createLinkHook(e.url,f),d instanceof HTMLLinkElement&&(i=d)),f&&!d&&Object.keys(f).forEach(p=>{i&&!i.getAttribute(p)&&i.setAttribute(p,f[p])})}const l=(d,f)=>{const p=()=>{f?.type==="error"?e?.onErrorCallback&&e?.onErrorCallback(f):e?.cb&&e?.cb()};if(i&&(i.onerror=null,i.onload=null,$c(()=>{const{needDeleteLink:g=!0}=e;g&&i?.parentNode&&i.parentNode.removeChild(i)}),d)){const g=d(f);return p(),g}p()};return i.onerror=l.bind(null,i.onerror),i.onload=l.bind(null,i.onload),{link:i,needAttach:a}}function tp(e,i){const{attrs:a={},createScriptHook:o}=i;return new Promise((l,d)=>{const{script:f,needAttach:p}=kc({url:e,cb:l,onErrorCallback:d,attrs:{fetchpriority:"high",...a},createScriptHook:o,needDeleteScript:!0});p&&document.head.appendChild(f)})}var rp=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,Pc=(e,i,a,o)=>{const l=[`${[i[e]]} #${e}`];return a&&l.push(`args: ${JSON.stringify(a)}`),l.push(rp(e)),o&&l.push(`Original Error Message:
|
|
98
|
+
${o}`),l.join(`
|
|
99
|
+
`)};function np(e,i,a,o,l,d){return o(Pc(e,i,a,l))}var Yr="[ Federation Runtime ]",Zs=Yg(Yr);function Gt(e,i,a,o,l){e||(a!==void 0?St(i,a,o,void 0):St(i))}function St(e,i,a,o,l){if(i!==void 0)return np(e,i,a??{},f=>{throw new Error(`${Yr}: ${f}`)},o);const d=e;throw d instanceof Error?(d.message.startsWith(Yr)||(d.message=`${Yr}: ${d.message}`),d):new Error(`${Yr}: ${d}`)}function Us(e){e instanceof Error&&(e.message.startsWith(Yr)||(e.message=`${Yr}: ${e.message}`)),Zs.warn(e)}function ip(e,i){return e.findIndex(a=>a===i)===-1&&e.push(i),e}function Ri(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Bs(e){return typeof e.entry<"u"}function Nc(e){return!e.entry.includes(".json")}function Fs(e){return e&&typeof e=="object"}var ap=Object.prototype.toString;function op(e){return ap.call(e)==="[object Object]"}function Cc(e){return Array.isArray(e)?e:[e]}function Oc(e){const i={url:"",type:"global",globalName:""};return"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:i}var sp=(e,i)=>{let a;return e.endsWith("/")?a=e.slice(0,-1):a=e,i.startsWith(".")&&(i=i.slice(1)),a=a+i,a},Pt=typeof globalThis=="object"?globalThis:window,or=(()=>{try{return document.defaultView}catch{return Pt}})(),Li=or;function Sa(e,i,a){Object.defineProperty(e,i,{value:a,configurable:!1,writable:!0})}function ja(e,i){return Object.hasOwnProperty.call(e,i)}ja(Pt,"__GLOBAL_LOADING_REMOTE_ENTRY__")||Sa(Pt,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});var dn=Pt.__GLOBAL_LOADING_REMOTE_ENTRY__;function Mc(e){ja(e,"__VMOK__")&&!ja(e,"__FEDERATION__")&&Sa(e,"__FEDERATION__",e.__VMOK__),ja(e,"__FEDERATION__")||(Sa(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),Sa(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}Mc(Pt),Mc(or);function lp(e){Pt.__FEDERATION__.__INSTANCES__.push(e)}function cp(){return Pt.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function up(e,i=As()){i&&(Pt.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,Pt.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.4.0")}function fn(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(":"),f=`${l}:${i}`,p=e[f];if(p)return{value:p,key:f}}return{value:void 0,key:i}}}else St(`getInfoWithoutType: "key" must be a string, got ${typeof i} (${JSON.stringify(i)}).`)}var Ec=()=>or.__FEDERATION__.moduleInfo,dp=(e,i)=>{const a=fn(i,Ri(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=Ri(l),f=fn(or.__FEDERATION__.moduleInfo,d).value;if(f?.version===o)return f}},$a=e=>dp(e,or.__FEDERATION__.moduleInfo),Ic=(e,i)=>{const a=Ri(e);return or.__FEDERATION__.moduleInfo[a]=i,or.__FEDERATION__.moduleInfo},fp=e=>(or.__FEDERATION__.moduleInfo={...or.__FEDERATION__.moduleInfo,...e},()=>{const i=Object.keys(e);for(const a of i)delete or.__FEDERATION__.moduleInfo[a]}),Dc=(e,i)=>{const a=i||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:a,entryExports:Pt[a]}},mp=()=>or.__FEDERATION__.__GLOBAL_PLUGIN__,gp=e=>Pt.__FEDERATION__.__PRELOADED_MAP__.get(e),pp=e=>Pt.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Ac="[0-9A-Za-z-]+",Gs=`(?:\\+(${Ac}(?:\\.${Ac})*))`,Zi="0|[1-9]\\d*",ka="[0-9]+",zc="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Tc=`(?:${ka}|${zc})`,hp=`(?:-?(${Tc}(?:\\.${Tc})*))`,Rc=`(?:${Zi}|${zc})`,Lc=`(?:-(${Rc}(?:\\.${Rc})*))`,Vs=`${Zi}|x|X|\\*`,mn=`[v=\\s]*(${Vs})(?:\\.(${Vs})(?:\\.(${Vs})(?:${Lc})?${Gs}?)?)?`,vp=`^\\s*(${mn})\\s+-\\s+(${mn})\\s*$`,bp=`[v=\\s]*${`(${ka})\\.(${ka})\\.(${ka})`}${hp}?${Gs}?`,Ws="((?:<|>)?=?)",yp=`(\\s*)${Ws}\\s*(${bp}|${mn})`,Zc="(?:~>?)",xp=`(\\s*)${Zc}\\s+`,Uc="(?:\\^)",_p=`(\\s*)${Uc}\\s+`,wp="(<|>)?=?\\s*\\*",Sp=`^${Uc}${mn}$`,jp=`v?${`(${Zi})\\.(${Zi})\\.(${Zi})`}${Lc}?${Gs}?`,$p=`^${Zc}${mn}$`,kp=`^${Ws}\\s*${mn}$`,Pp=`^${Ws}\\s*(${jp})$|^$`,Np="^\\s*>=\\s*0.0.0\\s*$";function pr(e){return new RegExp(e)}function zt(e){return!e||e.toLowerCase()==="x"||e==="*"}function Bc(...e){return i=>e.reduce((a,o)=>o(a),i)}function Fc(e){return e.match(pr(Pp))}function Gc(e,i,a,o){const l=`${e}.${i}.${a}`;return o?`${l}-${o}`:l}function Cp(e){return e.replace(pr(vp),(i,a,o,l,d,f,p,g,h,b,w,$)=>(zt(o)?a="":zt(l)?a=`>=${o}.0.0`:zt(d)?a=`>=${o}.${l}.0`:a=`>=${a}`,zt(h)?g="":zt(b)?g=`<${Number(h)+1}.0.0-0`:zt(w)?g=`<${h}.${Number(b)+1}.0-0`:$?g=`<=${h}.${b}.${w}-${$}`:g=`<=${g}`,`${a} ${g}`.trim()))}function Op(e){return e.replace(pr(yp),"$1$2$3")}function Mp(e){return e.replace(pr(xp),"$1~")}function Ep(e){return e.replace(pr(_p),"$1^")}function Ip(e){return e.trim().split(/\s+/).map(i=>i.replace(pr(Sp),(a,o,l,d,f)=>zt(o)?"":zt(l)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:zt(d)?o==="0"?`>=${o}.${l}.0 <${o}.${Number(l)+1}.0-0`:`>=${o}.${l}.0 <${Number(o)+1}.0.0-0`:f?o==="0"?l==="0"?`>=${o}.${l}.${d}-${f} <${o}.${l}.${Number(d)+1}-0`:`>=${o}.${l}.${d}-${f} <${o}.${Number(l)+1}.0-0`:`>=${o}.${l}.${d}-${f} <${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 Dp(e){return e.trim().split(/\s+/).map(i=>i.replace(pr($p),(a,o,l,d,f)=>zt(o)?"":zt(l)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:zt(d)?`>=${o}.${l}.0 <${o}.${Number(l)+1}.0-0`:f?`>=${o}.${l}.${d}-${f} <${o}.${Number(l)+1}.0-0`:`>=${o}.${l}.${d} <${o}.${Number(l)+1}.0-0`)).join(" ")}function Ap(e){return e.split(/\s+/).map(i=>i.trim().replace(pr(kp),(a,o,l,d,f,p)=>{const g=zt(l),h=g||zt(d),b=h||zt(f);return o==="="&&b&&(o=""),p="",g?o===">"||o==="<"?"<0.0.0-0":"*":o&&b?(h&&(d=0),f=0,o===">"?(o=">=",h?(l=Number(l)+1,d=0,f=0):(d=Number(d)+1,f=0)):o==="<="&&(o="<",h?l=Number(l)+1:d=Number(d)+1),o==="<"&&(p="-0"),`${o+l}.${d}.${f}${p}`):h?`>=${l}.0.0${p} <${Number(l)+1}.0.0-0`:b?`>=${l}.${d}.0${p} <${l}.${Number(d)+1}.0-0`:a})).join(" ")}function zp(e){return e.trim().replace(pr(wp),"")}function Tp(e){return e.trim().replace(pr(Np),"")}function Pa(e,i){return e=Number(e)||e,i=Number(i)||i,e>i?1:e===i?0:-1}function Rp(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 f=a[l],p=o[l];if(f!==p)return f===void 0&&p===void 0?0:f?p?Pa(f,p):-1:1}return 0}function Na(e,i){return Pa(e.major,i.major)||Pa(e.minor,i.minor)||Pa(e.patch,i.patch)||Rp(e,i)}function Qs(e,i){return e.version===i.version}function Lp(e,i){switch(e.operator){case"":case"=":return Qs(e,i);case">":return Na(e,i)<0;case">=":return Qs(e,i)||Na(e,i)<0;case"<":return Na(e,i)>0;case"<=":return Qs(e,i)||Na(e,i)>0;case void 0:return!0;default:return!1}}function Zp(e){return Bc(Ip,Dp,Ap,zp)(e)}function Up(e){return Bc(Cp,Op,Mp,Ep)(e.trim()).split(/\s+/).join(" ")}function Ui(e,i){if(!e)return!1;const a=Fc(e);if(!a)return!1;const[,o,,l,d,f,p]=a,g={operator:o,version:Gc(l,d,f,p),major:l,minor:d,patch:f,preRelease:p?.split(".")},h=i.split("||");for(const b of h){const w=b.trim();if(!w||w==="*"||w==="x")return!0;try{const $=Up(w);if(!$.trim())return!0;const P=$.split(" ").map(z=>Zp(z)).join(" ");if(!P.trim())return!0;const M=P.split(/\s+/).map(z=>Tp(z)).filter(Boolean);if(M.length===0)continue;let D=!0;for(const z of M){const R=Fc(z);if(!R){D=!1;break}const[,Z,,G,Q,W,X]=R;if(!Lp({operator:Z,version:Gc(G,Q,W,X),major:G,minor:Q,patch:W,preRelease:X?.split(".")},g)){D=!1;break}}if(D)return!0}catch($){console.error(`[semver] Error processing range part "${w}":`,$);continue}}return!1}var Ca="default",Bp="global";function Fp(e,i,a,o){let l;return"get"in e?l=e.get:"lib"in e?l=()=>Promise.resolve(e.lib):l=()=>Promise.resolve(()=>{St(`Cannot get shared "${a}" from "${i}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&St(`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??Ds.UNKNOWN,useIn:[]}:void 0}}function Vc(e,i){const a=i.shared||{},o=i.name,l=Object.keys(a).reduce((f,p)=>{const g=Cc(a[p]);return f[p]=f[p]||[],g.forEach(h=>{f[p].push(Fp(h,o,p,i.shareStrategy))}),f},{}),d={...e.shared};return Object.keys(l).forEach(f=>{d[f]?l[f].forEach(p=>{d[f].find(g=>g.version===p.version)||d[f].push(p)}):d[f]=l[f]}),{allShareInfos:d,newShareInfos:l}}function Bi(e,i){if(!e)return!1;const{status:a,mode:o}=e;return a===Ds.NO_USE?!1:a===Ds.CALCULATED?!0:o==="runtime-infer"?i?Vp(e,i):!0:!1}function en(e,i){const a=o=>{if(!Number.isNaN(Number(o))){const l=o.split(".");let d=o;for(let f=0;f<3-l.length;f++)d+=".0";return d}return o};return!!Ui(a(e),`<=${a(i)}`)}var Fi=(e,i)=>{const a=i||function(o,l){return en(o,l)};return Object.keys(e).reduce((o,l)=>!o||a(o,l)||o==="0"?l:o,0)},Oa=e=>!!e.loaded||typeof e.lib=="function",Gp=e=>!!e.loading,Vp=(e,i)=>{if(!e||!i)return!1;const{usedExports:a}=e;return a?!!i.every(o=>a.includes(o)):!1};function Wp(e,i,a,o){const l=e[i][a];let d="",f=Bi(o);const p=function(g,h){return f?l[g].treeShaking?l[h].treeShaking?!Oa(l[g].treeShaking)&&en(g,h):!1:!0:!Oa(l[g])&&en(g,h)};if(f){if(d=Fi(e[i][a],p),d)return{version:d,useTreesShaking:f};f=!1}return{version:Fi(e[i][a],p),useTreesShaking:f}}var gn=e=>Oa(e)||Gp(e);function Qp(e,i,a,o){const l=e[i][a];let d="",f=Bi(o);const p=function(g,h){if(f){if(!l[g].treeShaking)return!0;if(!l[h].treeShaking)return!1;if(gn(l[h].treeShaking))return gn(l[g].treeShaking)?!!en(g,h):!0;if(gn(l[g].treeShaking))return!1}return gn(l[h])?gn(l[g])?!!en(g,h):!0:gn(l[g])?!1:en(g,h)};if(f){if(d=Fi(e[i][a],p),d)return{version:d,useTreesShaking:f};f=!1}return{version:Fi(e[i][a],p),useTreesShaking:f}}function Hp(e){return e==="loaded-first"?Qp:Wp}function Ma(e,i,a,o){if(!e)return;const{shareConfig:l,scope:d=Ca,strategy:f,treeShaking:p}=a,g=Array.isArray(d)?d:[d];for(const h of g)if(l&&e[h]&&e[h][i]){const{requiredVersion:b}=l,{version:w,useTreesShaking:$}=Hp(f)(e,h,i,p),P=()=>{const D=e[h][i][w];if(l.singleton){if(typeof b=="string"&&!Ui(w,b)){const z=`Version ${w} from ${w&&D.from} of shared singleton module ${i} does not satisfy the requirement of ${a.from} which needs ${b})`;l.strictVersion?St(z):Us(z)}return{shared:D,useTreesShaking:$}}else{if(b===!1||b==="*")return{shared:D,useTreesShaking:$};if(Ui(w,b))return{shared:D,useTreesShaking:$};const z=Bi(p);if(z){for(const[R,Z]of Object.entries(e[h][i]))if(Bi(Z.treeShaking,p?.usedExports)&&Ui(R,b))return{shared:Z,useTreesShaking:z}}for(const[R,Z]of Object.entries(e[h][i]))if(Ui(R,b))return{shared:Z,useTreesShaking:!1}}},M={shareScopeMap:e,scope:h,pkgName:i,version:w,GlobalFederation:Li.__FEDERATION__,shareInfo:a,resolver:P};return(o.emit(M)||M).resolver()}}function Wc(){return Li.__FEDERATION__.__SHARE__}function Qc(e){const{pkgName:i,extraOptions:a,shareInfos:o}=e,l=g=>{if(!g)return;const h={};return g.forEach(w=>{h[w.version]=w}),h[Fi(h,function(w,$){return!Oa(h[w])&&en(w,$)})]},d=a?.resolver??l,f=g=>g!==null&&typeof g=="object"&&!Array.isArray(g),p=(...g)=>{const h={};for(const b of g)if(b)for(const[w,$]of Object.entries(b)){const P=h[w];f(P)&&f($)?h[w]=p(P,$):$!==void 0&&(h[w]=$)}return h};return p(d(o[i]),a?.customShareInfo)}var pn=(e,i)=>{e.useIn||(e.useIn=[]),ip(e.useIn,i)};function Ea(e,i){return i&&e.treeShaking?e.treeShaking:e}function qp(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 p=a.name;return l=`.${l}`,{pkgNameOrAlias:p,expose:l,remote:a}}else if(l==="")return{pkgNameOrAlias:a.name,expose:".",remote:a}}const d=a.alias&&i.startsWith(a.alias);let f=a.alias&&i.replace(a.alias,"");if(a.alias&&d){if(f&&f.startsWith("/")){const p=a.alias;return f=`.${f}`,{pkgNameOrAlias:p,expose:f,remote:a}}else if(f==="")return{pkgNameOrAlias:a.alias,expose:".",remote:a}}}}function Jp(e,i){for(const a of e)if(i===a.name||a.alias&&i===a.alias)return a}var Hc="RUNTIME-001",qc="RUNTIME-002",Jc="RUNTIME-003",Kc="RUNTIME-004",Xc="RUNTIME-005",Hs="RUNTIME-006",Yc="RUNTIME-007",eu="RUNTIME-008",qs="RUNTIME-009",tu="RUNTIME-010",ru="RUNTIME-011",Kp="RUNTIME-012",Vt={[Hc]:"Failed to get remoteEntry exports.",[qc]:'The remote entry interface does not contain "init"',[Jc]:"Failed to get manifest.",[Kc]:"Failed to locate remote.",[Xc]:"Invalid loadShareSync function call from bundler runtime",[Hs]:"Invalid loadShareSync function call from runtime",[Yc]:"Failed to get remote snapshot.",[eu]:"Failed to load script resources.",[qs]:"Please call createInstance first.",[tu]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[ru]:"The remoteEntry URL is missing from the remote snapshot.",[Kp]:'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 nu=".then(callbacks[0]).catch(callbacks[1])";async function Xp({entry:e,remoteEntryExports:i}){return new Promise((a,o)=>{try{i?a(i):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${nu}`)([a,o]):import(e).then(a).catch(o)}catch(l){St(`Failed to load ESM entry from "${e}". ${l instanceof Error?l.message:String(l)}`)}})}async function Yp({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}")${nu}`)([a,o])}catch(l){St(`Failed to load SystemJS entry from "${e}". ${l instanceof Error?l.message:String(l)}`)}})}function eh(e,i,a){const{remoteEntryKey:o,entryExports:l}=Dc(e,i);return l||St(Hc,Vt,{remoteName:e,remoteEntryUrl:a,remoteEntryKey:o}),l}async function th({name:e,globalName:i,entry:a,remoteInfo:o,loaderHook:l,getEntryUrl:d}){const{entryExports:f}=Dc(e,i);if(f)return f;const p=d?d(a):a;return tp(p,{attrs:{},createScriptHook:(g,h)=>{const b=l.lifecycle.createScript.emit({url:g,attrs:h,remoteInfo:o});if(b&&(b instanceof HTMLScriptElement||"script"in b||"timeout"in b))return b}}).then(()=>eh(e,i,a),g=>{const h=g instanceof Error?g.message:String(g);St(eu,Vt,{remoteName:e,resourceUrl:p},h)})}async function rh({remoteInfo:e,remoteEntryExports:i,loaderHook:a,getEntryUrl:o}){const{entry:l,entryGlobalName:d,name:f,type:p}=e;switch(p){case"esm":case"module":return Xp({entry:l,remoteEntryExports:i});case"system":return Yp({entry:l,remoteEntryExports:i});default:return th({entry:l,globalName:d,name:f,remoteInfo:e,loaderHook:a,getEntryUrl:o})}}function Js(e){const{entry:i,name:a}=e;return xc(a,i)}async function Ia(e){const{origin:i,remoteEntryExports:a,remoteInfo:o,getEntryUrl:l,_inErrorHandling:d=!1}=e,f=Js(o);if(a)return a;if(!dn[f]){const p=i.remoteHandler.hooks.lifecycle.loadEntry,g=i.loaderHook;dn[f]=p.emit({loaderHook:g,remoteInfo:o,remoteEntryExports:a}).then(h=>h||rh({remoteInfo:o,remoteEntryExports:a,loaderHook:g,getEntryUrl:l})).catch(async h=>{const b=Js(o),w=h instanceof Error&&h.message.includes("ScriptExecutionError");if(h instanceof Error&&h.message.includes("RUNTIME-008")&&!w&&!d){const $=M=>Ia({...M,_inErrorHandling:!0}),P=await i.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:$,origin:i,remoteInfo:o,remoteEntryExports:a,globalLoading:dn,uniqueKey:b});if(P)return P}throw h})}return dn[f]}function Da(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||"global",entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||"default"}}function nh(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function ih(e,i){const a=mp(),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 ah(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 hn(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(ah)??[],shared:i}}}function iu(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function oh(e,i){return i.map(a=>{const o=Jp(e,a.nameOrAlias);return Gt(o,`Unable to preload ${a.nameOrAlias} as it is not included in ${!o&&wc({remoteInfo:o,remotes:e})}`),{remote:o,preloadConfig:iu(a)}})}function sh(e){return e?e.map(i=>i==="."?i:i.startsWith("./")?i.replace("./",""):i):[]}function au(e,i,a,o=!0){const{cssAssets:l,jsAssetsWithoutEntry:d,entryAssets:f}=a;if(i.options.inBrowser){if(f.forEach(p=>{const{moduleInfo:g}=p,h=i.moduleCache.get(e.name);Ia(h?{origin:i,remoteInfo:g,remoteEntryExports:h.remoteEntryExports}:{origin:i,remoteInfo:g,remoteEntryExports:void 0})}),o){const p={rel:"preload",as:"style"};l.forEach(g=>{const{link:h,needAttach:b}=Ls({url:g,cb:()=>{},attrs:p,createLinkHook:(w,$)=>{const P=i.loaderHook.lifecycle.createLink.emit({url:w,attrs:$,remoteInfo:e});if(P instanceof HTMLLinkElement)return P}});b&&document.head.appendChild(h)})}else{const p={rel:"stylesheet",type:"text/css"};l.forEach(g=>{const{link:h,needAttach:b}=Ls({url:g,cb:()=>{},attrs:p,createLinkHook:(w,$)=>{const P=i.loaderHook.lifecycle.createLink.emit({url:w,attrs:$,remoteInfo:e});if(P instanceof HTMLLinkElement)return P},needDeleteLink:!1});b&&document.head.appendChild(h)})}if(o){const p={rel:"preload",as:"script"};d.forEach(g=>{const{link:h,needAttach:b}=Ls({url:g,cb:()=>{},attrs:p,createLinkHook:(w,$)=>{const P=i.loaderHook.lifecycle.createLink.emit({url:w,attrs:$,remoteInfo:e});if(P instanceof HTMLLinkElement)return P}});b&&document.head.appendChild(h)})}else{const p={fetchpriority:"high",type:e?.type==="module"?"module":"text/javascript"};d.forEach(g=>{const{script:h,needAttach:b}=kc({url:g,cb:()=>{},attrs:p,createScriptHook:(w,$)=>{const P=i.loaderHook.lifecycle.createScript.emit({url:w,attrs:$,remoteInfo:e});if(P instanceof HTMLScriptElement)return P},needDeleteScript:!0});b&&document.head.appendChild(h)})}}}function lh(e,i,a){const o=i,l=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];l.length||l.push("default"),l.forEach(f=>{o[f]||(o[f]={})});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 ou=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 Ia({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports});return Gt(e,`remoteEntryExports is undefined
|
|
100
|
+
${wc(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:f}=lh(this.remoteInfo,this.host.shareScopeMap,a),p=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:d,remoteEntryInitOptions:l,initScope:f,remoteInfo:this.remoteInfo,origin:this.host});typeof o?.init>"u"&&St(qc,Vt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,hn(this.host.options)),await o.init(p.shareScope,p.initScope,p.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...p,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 f;f=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:d,expose:i,moduleInfo:this.remoteInfo}),f||(f=await d.get(i)),Gt(f,`${Ri(this.remoteInfo)} remote don't export ${i}.`);const p=sp(this.remoteInfo.name,i),g=this.wraperFactory(f,p);return l?await g():g}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}}},Xt=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()}},sr=class extends Xt{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 su(e,i){if(!Fs(i))return!1;if(e!==i){for(const a in e)if(!(a in i))return!1}return!0}var vn=class extends Xt{constructor(e){super(),this.onerror=St,this.type=e}emit(e){Fs(e)||St(`The data for the "${this.type}" hook should be an object.`);for(const i of this.listeners)try{const a=i(e);if(su(e,a))e=a;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(a){Us(a),this.onerror(a)}return e}},Ar=class extends Xt{constructor(e){super(),this.onerror=St,this.type=e}emit(e){Fs(e)||St(`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=>(Us(d),this.onerror(d),e),l=d=>{if(su(e,d)){if(e=d,a<i.length)try{return Promise.resolve(i[a++](e)).then(l,o)}catch(f){return o(f)}}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)}},bn=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,i){Gt(op(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 lu(e,i){const a=Oc(i);a.url||St(ru,Vt,{remoteName:e.name});let o=zs(i,a.url);e.type=a.type,e.entryGlobalName=a.globalName,e.entry=o,e.version=i.version,e.buildVersion=i.buildVersion}function ch(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:i,pkgNameOrAlias:a,expose:o,origin:l,remoteInfo:d,id:f}=e;if(!Bs(i)||!Nc(i)){const{remoteSnapshot:p,globalSnapshot:g}=await l.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:i,id:f});lu(d,p);const h={remote:i,preloadConfig:{nameOrAlias:a,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1}},b=await l.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:l,preloadOptions:h,remoteInfo:d,remote:i,remoteSnapshot:p,globalSnapshot:g});return b&&au(d,l,b,!1),{...e,remoteSnapshot:p}}return e}}}function uh(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 cu(e,i,a,o,l={},d){const{value:f}=fn(e,Ri(i)),p=d||f;if(p&&!Sc(p)&&(a(p,i,o),p.remotesInfo)){const g=Object.keys(p.remotesInfo);for(const h of g){if(l[h])continue;l[h]=!0;const b=uh(h),w=p.remotesInfo[h];cu(e,{name:b.name,version:w.matchedVersion},a,!1,l,void 0)}}}var Ks=(e,i)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${i}"]`);function dh(e,i,a,o,l){const d=[],f=[],p=[],g=new Set,h=new Set,{options:b}=e,{preloadConfig:w}=i,{depsRemote:$}=w;if(cu(o,a,(M,D,z)=>{let R;if(z)R=w;else if(Array.isArray($)){const X=$.find(he=>he.nameOrAlias===D.name||he.nameOrAlias===D.alias);if(!X)return;R=iu(X)}else if($===!0)R=w;else return;const Z=zs(M,Oc(M).url);Z&&p.push({name:D.name,moduleInfo:{name:D.name,entry:Z,type:"remoteEntryType"in M?M.remoteEntryType:"global",entryGlobalName:"globalName"in M?M.globalName:D.name,shareScope:"",version:"version"in M?M.version:void 0},url:Z});let G="modules"in M?M.modules:[];const Q=sh(R.exposes);Q.length&&"modules"in M&&(G=M?.modules?.reduce((X,he)=>(Q?.indexOf(he.moduleName)!==-1&&X.push(he),X),[]));function W(X){const he=X.map(H=>zs(M,H));return R.filter?he.filter(R.filter):he}if(G){const X=G.length;for(let he=0;he<X;he++){const H=G[he],me=`${D.name}/${H.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:H.moduleName==="."?D.name:me,name:D.name,remoteSnapshot:M,preloadConfig:R,remote:D,origin:e}),!gp(me)&&(R.resourceCategory==="all"?(d.push(...W(H.assets.css.async)),d.push(...W(H.assets.css.sync)),f.push(...W(H.assets.js.async)),f.push(...W(H.assets.js.sync))):R.resourceCategory==="sync"&&(d.push(...W(H.assets.css.sync)),f.push(...W(H.assets.js.sync))),pp(me))}}},!0,{},l),l.shared&&l.shared.length>0){const M=(D,z)=>{const{shared:R}=Ma(e.shareScopeMap,z.sharedName,D,e.sharedHandler.hooks.lifecycle.resolveShare)||{};R&&typeof R.lib=="function"&&(z.assets.js.sync.forEach(Z=>{g.add(Z)}),z.assets.css.sync.forEach(Z=>{h.add(Z)}))};l.shared.forEach(D=>{const z=b.shared?.[D.sharedName];if(!z)return;const R=D.version?z.find(Z=>Z.version===D.version):z;R&&Cc(R).forEach(Z=>{M(Z,D)})})}const P=f.filter(M=>!g.has(M)&&!Ks("script",M));return{cssAssets:d.filter(M=>!h.has(M)&&!Ks("link",M)),jsAssetsWithoutEntry:P,entryAssets:p.filter(M=>!Ks("script",M.url))}}var fh=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:i,preloadOptions:a,remoteInfo:o,remote:l,globalSnapshot:d,remoteSnapshot:f}=e;return Bs(l)&&Nc(l)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:l.name,url:l.entry,moduleInfo:{name:o.name,entry:l.entry,type:o.type||"global",entryGlobalName:"",shareScope:""}}]}:(lu(o,f),dh(i,a,o,d,f))}}};function uu(e,i){const a=$a({name:i.name,version:i.options.version}),o=a&&"remotesInfo"in a&&a.remotesInfo&&fn(a.remotesInfo,e.name).value;return o&&o.matchedVersion?{hostGlobalSnapshot:a,globalSnapshot:Ec(),remoteSnapshot:$a({name:e.name,version:o.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:Ec(),remoteSnapshot:$a({name:e.name,version:"version"in e?e.version:void 0})}}var mh=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new bn({beforeLoadRemoteSnapshot:new sr("beforeLoadRemoteSnapshot"),loadSnapshot:new Ar("loadGlobalSnapshot"),loadRemoteSnapshot:new Ar("loadRemoteSnapshot"),afterLoadSnapshot:new Ar("afterLoadSnapshot")}),this.manifestLoading=Li.__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=$a({name:this.HostInstance.options.name,version:this.HostInstance.options.version});l||(l={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},fp({[this.HostInstance.options.name]:l})),l&&"remotesInfo"in l&&!fn(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:f,globalSnapshot:p}=this.getGlobalRemoteInfo(e),{remoteSnapshot:g,globalSnapshot:h}=await this.hooks.lifecycle.loadSnapshot.emit({options:o,moduleInfo:e,hostGlobalSnapshot:d,remoteSnapshot:f,globalSnapshot:p});let b,w;if(g)if(Sc(g)){const $=g.remoteEntry,P=await this.getManifestJson($,e,{}),M=Ic({...e,entry:$},P);b=P,w=M}else{const{remoteSnapshot:$}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:g,from:"global"});b=$,w=h}else if(Bs(e)){const $=await this.getManifestJson(e.entry,e,{}),P=Ic(e,$),{remoteSnapshot:M}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:$,from:"global"});b=M,w=P}else St(Yc,Vt,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(h)},void 0,hn(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:i,host:this.HostInstance,options:o,moduleInfo:e,remoteSnapshot:b}),{remoteSnapshot:b,globalSnapshot:w}}getGlobalRemoteInfo(e){return uu(e,this.HostInstance)}async getManifestJson(e,i,a){const o=async()=>{let d=this.manifestCache.get(e);if(d)return d;try{let f=await this.loaderHook.lifecycle.fetch.emit(e,{},Da(i));(!f||!(f instanceof Response))&&(f=await fetch(e,{})),d=await f.json()}catch(f){d=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:f,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),d||(delete this.manifestLoading[e],St(Jc,Vt,{manifestUrl:e,moduleName:i.name,hostName:this.HostInstance.options.name},`${f}`,hn(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(),f=qg(d,{version:e}),{remoteSnapshot:p}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:i,manifestJson:d,remoteSnapshot:f,manifestUrl:e,from:"manifest"});return p};return this.manifestLoading[e]||(this.manifestLoading[e]=l().then(d=>d)),this.manifestLoading[e]}},gh=class{constructor(e){this.hooks=new bn({beforeRegisterShare:new vn("beforeRegisterShare"),afterResolve:new Ar("afterResolve"),beforeLoadShare:new Ar("beforeLoadShare"),loadShare:new sr,resolveShare:new vn("resolveShare"),initContainerShareScopeMap:new vn("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,i){const{newShareInfos:a,allShareInfos:o}=Vc(e,i);return Object.keys(a).forEach(l=>{a[l].forEach(d=>{d.scope.forEach(f=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:l,shared:d}),this.shareScopeMap[f]?.[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=Qc({pkgName:e,extraOptions:i,shareInfos:a.options.shared});o?.scope&&await Promise.all(o.scope.map(async p=>{await Promise.all(this.initializeSharing(p,{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:f}=Ma(this.shareScopeMap,e,l,this.hooks.lifecycle.resolveShare)||{};if(d){const p=Ea(d,f);if(p.lib)return pn(p,a.options.name),p.lib;if(p.loading&&!p.loaded){const g=await p.loading;return p.loaded=!0,p.lib||(p.lib=g),pn(p,a.options.name),g}else{const h=(async()=>{const b=await p.get();return pn(p,a.options.name),p.loaded=!0,p.lib=b,b})();return this.setShared({pkgName:e,loaded:!1,shared:d,from:a.options.name,lib:null,loading:h,treeShaking:f?p:void 0}),h}}else{if(i?.customShareInfo)return!1;const p=Bi(l.treeShaking),g=Ea(l,p),b=(async()=>{const w=await g.get();g.lib=w,g.loaded=!0,pn(g,a.options.name);const{shared:$,useTreesShaking:P}=Ma(this.shareScopeMap,e,l,this.hooks.lifecycle.resolveShare)||{};if($){const M=Ea($,P);M.lib=w,M.loaded=!0,$.from=l.from}return w})();return this.setShared({pkgName:e,loaded:!1,shared:l,from:a.options.name,lib:null,loading:b,treeShaking:p?g:void 0}),b}}initializeSharing(e=Ca,i){const{host:a}=this,o=i?.from,l=i?.strategy;let d=i?.initScope;const f=[];if(o!=="build"){const{initTokens:$}=this;d||(d=[]);let P=$[e];if(P||(P=$[e]={from:this.host.name}),d.indexOf(P)>=0)return f;d.push(P)}const p=this.shareScopeMap,g=a.options.name;p[e]||(p[e]={});const h=p[e],b=($,P)=>{const{version:M,eager:D}=P;h[$]=h[$]||{};const z=h[$],R=z[M]&&Ea(z[M]),Z=!!(R&&("eager"in R&&R.eager||"shareConfig"in R&&R.shareConfig?.eager));(!R||R.strategy!=="loaded-first"&&!R.loaded&&(!D!=!Z?D:g>z[M].from))&&(z[M]=P)},w=async $=>{const{module:P}=await a.remoteHandler.getRemoteModuleAndOptions({id:$});let M;try{M=await P.getEntry()}catch(D){if(M=await a.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:$,error:D,from:"runtime",lifecycle:"beforeLoadShare",origin:a}),!M)return}finally{M?.init&&!P.initing&&(P.remoteEntryExports=M,await P.init(void 0,void 0,d))}};return Object.keys(a.options.shared).forEach($=>{a.options.shared[$].forEach(P=>{P.scope.includes(e)&&b($,P)})}),(a.options.shareStrategy==="version-first"||l==="version-first")&&a.options.remotes.forEach($=>{$.shareScope===e&&f.push(w($.name))}),f}loadShareSync(e,i){const{host:a}=this,o=Qc({pkgName:e,extraOptions:i,shareInfos:a.options.shared});o?.scope&&o.scope.forEach(f=>{this.initializeSharing(f,{strategy:o.strategy})});const{shared:l,useTreesShaking:d}=Ma(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(l){if(typeof l.lib=="function")return pn(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 f=l.get();if(!(f instanceof Promise))return pn(l,a.options.name),this.setShared({pkgName:e,loaded:!0,from:a.options.name,lib:f,shared:l}),f}}if(o.lib)return o.loaded||(o.loaded=!0),o.lib;if(o.get){const f=o.get();return f instanceof Promise&&St(i?.from==="build"?Xc:Hs,Vt,{hostName:a.options.name,sharedPkgName:e},void 0,hn(a.options)),o.lib=f,this.setShared({pkgName:e,loaded:!0,from:a.options.name,lib:o.lib,shared:o}),o.lib}St(Hs,Vt,{hostName:a.options.name,sharedPkgName:e},void 0,hn(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:f,treeShaking:p}){const{version:g,scope:h="default",...b}=i,w=Array.isArray(h)?h:[h],$=P=>{const M=(z,R,Z)=>{Z&&!z[R]&&(z[R]=Z)},D=p?P.treeShaking:P;M(D,"loaded",d),M(D,"loading",l),M(D,"get",f)};w.forEach(P=>{this.shareScopeMap[P]||(this.shareScopeMap[P]={}),this.shareScopeMap[P][e]||(this.shareScopeMap[P][e]={}),this.shareScopeMap[P][e][g]||(this.shareScopeMap[P][e][g]={version:g,scope:[P],...b,lib:o});const M=this.shareScopeMap[P][e][g];$(M),a&&M.from!==a&&(M.from=a)})}_setGlobalShareScopeMap(e){const i=Wc(),a=e.id||e.name;a&&!i[a]&&(i[a]=this.shareScopeMap)}},ph=class{constructor(e){this.hooks=new bn({beforeRegisterRemote:new vn("beforeRegisterRemote"),registerRemote:new vn("registerRemote"),beforeRequest:new Ar("beforeRequest"),onLoad:new sr("onLoad"),handlePreloadModule:new Xt("handlePreloadModule"),errorLoadRemote:new sr("errorLoadRemote"),beforePreloadRemote:new sr("beforePreloadRemote"),generatePreloadAssets:new sr("generatePreloadAssets"),afterPreloadRemote:new sr,loadEntry:new sr}),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 f=e.replace(l,d);this.idToRemoteMap[f]={name:a.name,expose:o};return}if(d&&e.startsWith(d)){const f=e.replace(d,l);this.idToRemoteMap[f]={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:f}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:p,remote:g,expose:h,id:b,remoteSnapshot:w}=f,$=await l.get(b,h,i,w),P=await this.hooks.lifecycle.onLoad.emit({id:b,pkgNameOrAlias:p,expose:h,exposeModule:o?$:void 0,exposeModuleFactory:o?void 0:$,remote:g,options:d,moduleInstance:l,origin:a});return this.setIdToRemoteMap(e,f),typeof P=="function"?P:$}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=oh(i.options.remotes,e);await Promise.all(a.map(async o=>{const{remote:l}=o,d=Da(l),{globalSnapshot:f,remoteSnapshot:p}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:l}),g=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:i,preloadOptions:o,remote:l,remoteInfo:d,globalSnapshot:f,remoteSnapshot:p});g&&au(d,i,g)}))}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(P){if(o=await this.hooks.lifecycle.errorLoadRemote.emit({id:a,options:i.options,origin:i,from:"runtime",error:P,lifecycle:"beforeRequest"}),!o)throw P}const{id:l}=o,d=qp(i.options.remotes,l);d||St(Kc,Vt,{hostName:i.options.name,requestId:l},void 0,hn(i.options));const{remote:f}=d,p=Da(f),g=await i.sharedHandler.hooks.lifecycle.afterResolve.emit({id:l,...d,options:i.options,origin:i,remoteInfo:p}),{remote:h,expose:b}=g;Gt(h&&b,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${l}.`);let w=i.moduleCache.get(h.name);const $={host:i,remoteInfo:p};return w||(w=new ou($),i.moduleCache.set(h.name,w)),{module:w,moduleOptions:$,remoteMatchInfo:g}}registerRemote(e,i,a){const{host:o}=this,l=()=>{if(e.alias){const f=i.find(p=>e.alias&&(p.name.startsWith(e.alias)||p.alias?.startsWith(e.alias)));Gt(!f,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${f&&f.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=Ca),e.type||(e.type=Bp)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:o});const d=i.find(f=>f.name===e.name);if(!d)l(),i.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o});else{const f=[`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}),_c(f.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,f=d.entryGlobalName;Pt[f]&&(Object.getOwnPropertyDescriptor(Pt,f)?.configurable?delete Pt[f]:Pt[f]=void 0);const p=Js(l.remoteInfo);dn[p]&&delete dn[p],i.snapshotHandler.manifestCache.delete(d.entry);let g=d.buildVersion?xc(d.name,d.buildVersion):d.name;const h=Pt.__FEDERATION__.__INSTANCES__.findIndex(w=>d.buildVersion?w.options.id===g:w.name===g);if(h!==-1){const w=Pt.__FEDERATION__.__INSTANCES__[h];g=w.options.id||g;const $=Wc();let P=!0;const M=[];Object.keys($).forEach(D=>{const z=$[D];z&&Object.keys(z).forEach(R=>{const Z=z[R];Z&&Object.keys(Z).forEach(G=>{const Q=Z[G];Q&&Object.keys(Q).forEach(W=>{const X=Q[W];X&&typeof X=="object"&&X.from===d.name&&(X.loaded||X.loading?(X.useIn=X.useIn.filter(he=>he!==d.name),X.useIn.length?P=!1:M.push([D,R,G,W])):M.push([D,R,G,W]))})})})}),P&&(w.shareScopeMap={},delete $[g]),M.forEach(([D,z,R,Z])=>{delete $[D]?.[z]?.[R]?.[Z]}),Pt.__FEDERATION__.__INSTANCES__.splice(h,1)}const{hostGlobalSnapshot:b}=uu(e,i);if(b){const w=b&&"remotesInfo"in b&&b.remotesInfo&&fn(b.remotesInfo,e.name).key;w&&(delete b.remotesInfo[w],Li.__FEDERATION__.__MANIFEST_LOADING__[w]&&delete Li.__FEDERATION__.__MANIFEST_LOADING__[w])}i.moduleCache.delete(e.name)}}catch(i){Zs.error(`removeRemote failed: ${i instanceof Error?i.message:String(i)}`)}}},hh=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,du=class{constructor(e){this.hooks=new bn({beforeInit:new vn("beforeInit"),init:new Xt,beforeInitContainer:new Ar("beforeInitContainer"),initContainer:new Ar("initContainer")}),this.version="2.4.0",this.moduleCache=new Map,this.loaderHook=new bn({getModuleInfo:new Xt,createScript:new Xt,createLink:new Xt,fetch:new sr,loadEntryError:new sr,getModuleFactory:new sr}),this.bridgeHook=new bn({beforeBridgeRender:new Xt,afterBridgeRender:new Xt,beforeBridgeDestroy:new Xt,afterBridgeDestroy:new Xt});const i=hh?[ch(),fh()]:[],a={id:nh(),name:e.name,plugins:i,remotes:[],shared:{},inBrowser:yc};this.name=e.name,this.options=a,this.snapshotHandler=new mh(this),this.sharedHandler=new gh(this),this.remoteHandler=new ph(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&&St(Pc(tu,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=Ca,i){return this.sharedHandler.initializeSharing(e,i)}initRawContainer(e,i,a){const o=Da({name:e,entry:i}),l=new ou({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}=Vc(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:f}=this.sharedHandler.registerShared(l,o),p=[...l.plugins];o.plugins&&o.plugins.forEach(h=>{p.includes(h)||p.push(h)});const g={...e,...i,plugins:p,remotes:d,shared:f,id:o.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:g}),g}registerPlugins(e){const i=ih(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 vh(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function bh(e,i){const a=vh();return Pt.__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 yh(e){const i=new(cp()||du)({id:`${e.name}@${e.version||Date.now()}`,...e});return lp(i),i}var lr=null;function xh(e){const i=bh(e.name,e.version),a={...e,id:e.id||""};return i?(i.initOptions(a),lr||(lr=i),i):(lr=yh(a),lr)}function _h(...e){return Gt(lr,qs,Vt),lr.loadRemote.apply(lr,e)}function wh(...e){return Gt(lr,qs,Vt),lr.registerRemotes.apply(lr,e)}function Sh(){return lr}up(du);function yn(e){const i=(typeof globalThis<"u"?globalThis:void 0)?.[e];return i&&typeof i=="object"?i:{}}var jh={singleton:!0,requiredVersion:!1,eager:!0},Yt=e=>({version:"0.0.0",scope:"default",lib:e,shareConfig:jh}),fu="__mf_module_cache__";function $h(){const e=globalThis,i=e[fu];if(i&&typeof i=="object"){const o=i;return o.share??={},o.remote??={},o}const a={share:{},remote:{}};return e[fu]=a,a}function kh(){const e=$h();e.share.react??=n,e.share["react-dom"]??=x,e.share["react-dom/client"]??=A,e.share["react/jsx-runtime"]??=t,e.share["@tanstack/react-query"]??=te,e.share["@trpc/client"]??=ee,e.share["@trpc/react-query"]??=oe,e.share["react-konva"]??=ie,e.share.konva??=ke,e.share["@camstack/ui-library"]??=yn("__camstackUiLibrary"),e.share["@camstack/sdk"]??=yn("__camstackSdk"),e.share["@camstack/types"]??=yn("__camstackTypes")}function mu(){kh(),Sh()===null&&xh({name:"admin_ui_host",remotes:[],shared:{react:Yt(()=>n),"react-dom":Yt(()=>x),"react-dom/client":Yt(()=>A),"react/jsx-runtime":Yt(()=>t),"@tanstack/react-query":Yt(()=>te),"@trpc/client":Yt(()=>ee),"@trpc/react-query":Yt(()=>oe),"react-konva":Yt(()=>ie),konva:Yt(()=>ke),"@camstack/ui-library":Yt(()=>yn("__camstackUiLibrary")),"@camstack/sdk":Yt(()=>yn("__camstackSdk")),"@camstack/types":Yt(()=>yn("__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 gu=(...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 Ph=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 Nh=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 pu=e=>{const i=Nh(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 Ch={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 Oh=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 Mh=(0,v.forwardRef)(({color:e="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:l="",children:d,iconNode:f,...p},g)=>(0,v.createElement)("svg",{ref:g,...Ch,width:i,height:i,stroke:e,strokeWidth:o?Number(a)*24/Number(i):a,className:gu("lucide",l),...!d&&!Oh(p)&&{"aria-hidden":"true"},...p},[...f.map(([h,b])=>(0,v.createElement)(h,b)),...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 $e=(e,i)=>{const a=(0,v.forwardRef)(({className:o,...l},d)=>(0,v.createElement)(Mh,{ref:d,iconNode:i,className:gu(`lucide-${Ph(pu(e))}`,`lucide-${e}`,o),...l}));return a.displayName=pu(e),a},zr=$e("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"}]]),Eh=$e("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),Ih=$e("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),Dh=$e("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),Ah=$e("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),zh=$e("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"}]]),Th=$e("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),Rh=$e("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"}]]),Lh=$e("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"}]]),Zh=$e("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"}]]),hu=$e("battery",[["path",{d:"M 22 14 L 22 10",key:"nqc4tb"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]),Uh=$e("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"}]]),Aa=$e("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"}]]),Bh=$e("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"}]]),Xs=$e("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"}]]),Fh=$e("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"}]]),xn=$e("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Tr=$e("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Gh=$e("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),Rr=$e("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Vh=$e("chevrons-down-up",[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]),Wh=$e("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),_n=$e("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"}]]),Qh=$e("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"}]]),Hh=$e("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),qh=$e("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),Jh=$e("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"}]]),Kh=$e("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),vu=$e("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"}]]),Xh=$e("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"}]]),Yh=$e("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"}]]),Lr=$e("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"}]]),ev=$e("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"}]]),Ys=$e("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"}]]),tv=$e("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"}]]),bu=$e("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"}]]),el=$e("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"}]]),yu=$e("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"}]]),xu=$e("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"}]]),tl=$e("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"}]]),wn=$e("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"}]]),_u=$e("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"}]]),rv=$e("gamepad-2",[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]]),nv=$e("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"}]]),iv=$e("hexagon",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]]),wu=$e("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"}]]),av=$e("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"}]]),ov=$e("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"}]]),sv=$e("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),lv=$e("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"}]]),Su=$e("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"}]]),Wt=$e("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),cv=$e("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"}]]),ju=$e("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"}]]),uv=$e("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]),$u=$e("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"}]]),ku=$e("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"}]]),Pu=$e("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),rl=$e("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"}]]),dv=$e("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"}]]),nl=$e("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"}]]),fv=$e("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"}]]),il=$e("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"}]]),Sn=$e("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),mv=$e("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"}]]),gv=$e("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"}]]),pv=$e("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"}]]),Nu=$e("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"}]]),hv=$e("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"}]]),za=$e("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"}]]),Cu=$e("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"}]]),Ou=$e("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"}]]),vv=$e("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"}]]),bv=$e("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"}]]),yv=$e("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"}]]),Gi=$e("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),xv=$e("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"}]]),al=$e("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"}]]),_v=$e("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"}]]),wv=$e("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"}]]),Sv=$e("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"}]]),ol=$e("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),jv=$e("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"}]]),Mu=$e("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"}]]),$v=$e("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=$e("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"}]]),kv=$e("thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]),Pv=$e("toggle-left",[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),hr=$e("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"}]]),Nv=$e("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]),Cv=$e("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]),jn=$e("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"}]]),Ov=$e("unlink-2",[["path",{d:"M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2",key:"1re2ne"}]]),Iu=$e("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"}]]),Mv=$e("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"}]]),Du=$e("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"}]]),sl=$e("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=$e("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Au=$e("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"}]]),Ev=$e("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"}]]),Iv=$e("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"}]]),Dv={frigate:wv,scrypted:_v,reolink:hv,homeAssistant:wu,rtsp:Fh},Av={online:Hh,offline:Xh,degraded:_n,unknown:vu},zu=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Tu=Ge,tn=(e,i)=>a=>{var o;if(i?.variants==null)return Tu(e,a?.class,a?.className);const{variants:l,defaultVariants:d}=i,f=Object.keys(l).map(g=>{const h=a?.[g],b=d?.[g];if(h===null)return null;const w=zu(h)||zu(b);return l[g][w]}),p=a&&Object.entries(a).reduce((g,h)=>{let[b,w]=h;return w===void 0||(g[b]=w),g},{});return Tu(e,f,i==null||(o=i.compoundVariants)===null||o===void 0?void 0:o.reduce((g,h)=>{let{class:b,className:w,...$}=h;return Object.entries($).every(P=>{let[M,D]=P;return Array.isArray(D)?D.includes({...d,...p}[M]):{...d,...p}[M]===D})?[...g,b,w]:g},[]),a?.class,a?.className)},zv=tn("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"}}),Zr=(0,n.forwardRef)(({className:e,variant:i,size:a,...o},l)=>(0,t.jsx)("button",{ref:l,className:N(zv({variant:i,size:a}),e),...o}));Zr.displayName="Button";var Tv=tn("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"}}),ll=(0,n.forwardRef)(({className:e,variant:i,size:a,icon:o,...l},d)=>(0,t.jsx)("button",{ref:d,className:N(Tv({variant:i,size:a}),e),...l,children:(0,t.jsx)(o,{className:"h-4 w-4"})}));ll.displayName="IconButton";var Rv=tn("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"}}),rn=(0,n.forwardRef)(({className:e,variant:i,style:a,...o},l)=>(0,t.jsx)("span",{ref:l,className:N(Rv({variant:i,styleVariant:a}),e),...o}));rn.displayName="Badge";var Lv=tn("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),cl=(0,n.forwardRef)(({className:e,variant:i,...a},o)=>(0,t.jsx)("div",{ref:o,className:N(Lv({variant:i}),e),...a}));cl.displayName="Card";function Ru({expanded:e,onExpandedChange:i,header:a,children:o,dimmed:l=!1,hideChevron:d=!1,className:f}){return(0,t.jsxs)("div",{className:N("rounded-lg border border-border bg-surface overflow-hidden",l&&"opacity-[0.45]",f),children:[(0,t.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:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i(!e))},children:[!d&&(0,t.jsx)("span",{className:"text-foreground-subtle shrink-0",children:e?(0,t.jsx)(Tr,{className:"h-4 w-4"}):(0,t.jsx)(Rr,{className:"h-4 w-4"})}),a]}),e&&o&&(0,t.jsx)("div",{className:"border-t border-border px-3 py-3",children:o})]})}var ul=(0,n.forwardRef)(({className:e,...i},a)=>(0,t.jsx)("label",{ref:a,className:N("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",e),...i}));ul.displayName="Label";var Zv=tn("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),dl=(0,n.forwardRef)(({className:e,orientation:i,...a},o)=>(0,t.jsx)("div",{ref:o,role:"separator",className:N(Zv({orientation:i}),e),...a}));dl.displayName="Separator";var Lu=(0,n.forwardRef)(({className:e,...i},a)=>(0,t.jsx)("div",{ref:a,className:N("animate-pulse bg-surface-hover rounded-md h-4 w-full",e),...i}));Lu.displayName="Skeleton";var Zu=tn("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"}}),Ta=(0,n.forwardRef)(({className:e,state:i,leftSlot:a,rightSlot:o,...l},d)=>a||o?(0,t.jsxs)("div",{className:"relative flex items-center w-full",children:[a&&(0,t.jsx)("div",{className:"absolute left-2.5 flex items-center pointer-events-none",children:a}),(0,t.jsx)("input",{ref:d,className:N(Zu({state:i}),a?"pl-7":"",o?"pr-7":"",e),...l}),o&&(0,t.jsx)("div",{className:"absolute right-2.5 flex items-center pointer-events-none",children:o})]}):(0,t.jsx)("input",{ref:d,className:N(Zu({state:i}),e),...l}));Ta.displayName="Input";var Vi=(0,n.forwardRef)(({className:e,options:i,...a},o)=>(0,t.jsxs)("div",{className:"relative w-full",children:[(0,t.jsx)("select",{ref:o,className:N("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,t.jsx)("option",{value:l.value,children:l.label},l.value))}),(0,t.jsx)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted",children:(0,t.jsx)(Tr,{className:"h-3.5 w-3.5"})})]}));Vi.displayName="Select";var Uu=(0,n.forwardRef)(({className:e,...i},a)=>(0,t.jsx)("input",{ref:a,type:"checkbox",className:N("w-3.5 h-3.5 rounded-sm border border-border accent-primary",e),...i}));Uu.displayName="Checkbox";var Bu=(0,n.forwardRef)(({className:e,checked:i,onCheckedChange:a,label:o,...l},d)=>(0,t.jsxs)("button",{ref:d,role:"switch","aria-checked":i,type:"button",onClick:()=>a(!i),className:N("inline-flex items-center gap-2",e),...l,children:[(0,t.jsx)("span",{className:N("w-8 h-4 rounded-full transition-colors",i?"bg-primary":"bg-surface-hover"),children:(0,t.jsx)("span",{className:N("block w-3.5 h-3.5 rounded-full bg-white transition-transform",i?"translate-x-4":"translate-x-0.5")})}),o&&(0,t.jsx)("span",{className:"text-xs text-foreground",children:o})]}));Bu.displayName="Switch";var Fu=(0,n.createContext)(null);function Gu(){const e=(0,n.useContext)(Fu);if(!e)throw new Error("Dialog compound components must be used within <Dialog>");return e}function Vu({children:e,open:i,onOpenChange:a}){const[o,l]=(0,n.useState)(!1),d=i??o,f=(0,n.useId)(),p=(0,n.useCallback)(g=>{a?.(g),i===void 0&&l(g)},[i,a]);return(0,t.jsx)(Fu.Provider,{value:{open:d,setOpen:p,contentId:f},children:e})}function Uv({children:e,...i}){const{setOpen:a}=Gu();return(0,t.jsx)("button",{type:"button",onClick:()=>a(!0),...i,children:e})}var Bv=tn("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"}}),fl=(0,n.forwardRef)(({className:e,width:i,children:a,...o},l)=>{const{open:d,setOpen:f,contentId:p}=Gu(),g=(0,n.useRef)(null),h=l??g;(0,n.useEffect)(()=>{const w=h.current;w&&(d&&!w.open&&w.showModal(),!d&&w.open&&w.close())},[d,h]);const b=w=>{w.target===w.currentTarget&&f(!1)};return(0,t.jsx)("dialog",{ref:h,id:p,className:N(Bv({width:i}),"w-full",e),onClick:b,onClose:()=>f(!1),...o,children:a})});fl.displayName="DialogContent";function Wu({className:e,...i}){return(0,t.jsx)("div",{className:N("flex flex-col gap-1 mb-3",e),...i})}function Qu({className:e,...i}){return(0,t.jsx)("div",{className:N("flex justify-end gap-2 mt-4",e),...i})}function Hu({className:e,...i}){return(0,t.jsx)("h2",{className:N("text-sm font-semibold text-foreground",e),...i})}function qu({className:e,...i}){return(0,t.jsx)("p",{className:N("text-xs text-foreground-muted",e),...i})}var Ju=(0,n.createContext)(null);function ml(){const e=(0,n.useContext)(Ju);if(!e)throw new Error("Dropdown compound components must be used within <Dropdown>");return e}function Fv({children:e}){const[i,a]=(0,n.useState)(!1),o=(0,n.useId)(),l=(0,n.useId)(),d=(0,n.useRef)(null);return(0,t.jsx)(Ju.Provider,{value:{open:i,setOpen:a,triggerId:o,contentId:l,triggerRef:d},children:(0,t.jsx)("div",{className:"relative inline-block",children:e})})}function Gv({children:e,...i}){const{open:a,setOpen:o,triggerId:l,contentId:d,triggerRef:f}=ml();return(0,t.jsx)("button",{type:"button",ref:f,id:l,"aria-haspopup":"menu","aria-expanded":a,"aria-controls":a?d:void 0,onClick:()=>o(!a),...i,children:e})}function Vv({className:e,children:i,align:a="start",offset:o=4,...l}){const{open:d,setOpen:f,contentId:p,triggerId:g,triggerRef:h}=ml(),b=(0,n.useRef)(null),[w,$]=(0,n.useState)(null);return(0,n.useLayoutEffect)(()=>{if(!d){$(null);return}const P=()=>{const M=h.current;if(!M)return;const D=M.getBoundingClientRect(),z=a==="end"?D.right:D.left;$({top:D.bottom+o,left:z,minWidth:D.width})};return P(),window.addEventListener("resize",P),window.addEventListener("scroll",P,!0),()=>{window.removeEventListener("resize",P),window.removeEventListener("scroll",P,!0)}},[d,a,o,h]),(0,n.useEffect)(()=>{if(!d)return;const P=D=>{const z=b.current,R=h.current;z&&!z.contains(D.target)&&!R?.contains(D.target)&&f(!1)},M=D=>{D.key==="Escape"&&f(!1)};return document.addEventListener("mousedown",P),document.addEventListener("keydown",M),()=>{document.removeEventListener("mousedown",P),document.removeEventListener("keydown",M)}},[d,f,h]),!d||!w||typeof document>"u"?null:(0,x.createPortal)((0,t.jsx)("div",{ref:b,id:p,role:"menu","aria-labelledby":g,style:{position:"fixed",top:w.top,...a==="end"?{right:window.innerWidth-w.left}:{left:w.left},minWidth:w.minWidth},className:N("z-50 bg-background-elevated border border-border rounded-md shadow-lg py-1 min-w-[160px]",e),...l,children:i}),document.body)}function Wv({className:e,icon:i,variant:a="default",children:o,onClick:l,...d}){const{setOpen:f}=ml(),p=(0,n.useCallback)(g=>{l?.(g),f(!1)},[l,f]);return(0,t.jsxs)("button",{type:"button",role:"menuitem",className:N("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:p,...d,children:[i&&(0,t.jsx)(i,{size:14}),o]})}var Ku=(0,n.createContext)(null);function Xu(){const e=(0,n.useContext)(Ku);if(!e)throw new Error("Tooltip compound components must be used within <Tooltip>");return e}function Qv({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)},f=()=>{o.current&&clearTimeout(o.current),a(!1)};return(0,t.jsx)(Ku.Provider,{value:{open:i,show:d,hide:f,tooltipId:l},children:(0,t.jsx)("div",{className:"relative inline-block",children:e})})}function Hv({children:e,...i}){const{show:a,hide:o,tooltipId:l,open:d}=Xu();return(0,t.jsx)("div",{onMouseEnter:a,onMouseLeave:o,onFocus:a,onBlur:o,"aria-describedby":d?l:void 0,...i,children:e})}function qv({className:e,children:i,...a}){const{open:o,tooltipId:l}=Xu();return(0,t.jsx)("div",{id:l,role:"tooltip",className:N("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 Yu="(max-width: 767px)",ed="(min-width: 768px) and (max-width: 1023px)";function td(e){return i=>{const a=window.matchMedia(e);return a.addEventListener("change",i),()=>a.removeEventListener("change",i)}}function rd(e){return()=>window.matchMedia(e).matches}function nd(){return!1}function Wi(){return(0,n.useSyncExternalStore)(td(Yu),rd(Yu),nd)}function Jv(){return(0,n.useSyncExternalStore)(td(ed),rd(ed),nd)}function gl({open:e,onClose:i,title:a,children:o,className:l}){return(0,n.useEffect)(()=>{if(!e)return;const d=f=>{f.key==="Escape"&&i()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[e,i]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:N("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,t.jsxs)("div",{role:"dialog","aria-modal":"true",className:N("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,t.jsx)("div",{className:"flex justify-center pt-2 pb-1",children:(0,t.jsx)("div",{className:"h-1 w-8 rounded-full bg-foreground-subtle/30"})}),a&&(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 pb-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:a}),(0,t.jsx)("button",{onClick:i,className:"p-1 rounded-md hover:bg-surface-hover text-foreground-muted transition-colors",children:(0,t.jsx)(Mt,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:o})]})]})}var id=(0,n.createContext)(null);function ad(){const e=(0,n.useContext)(id);if(!e)throw new Error("Popover compound components must be used within <Popover>");return e}function od({children:e,open:i,onOpenChange:a}){const[o,l]=(0,n.useState)(!1),d=i??o,f=(0,n.useId)(),p=(0,n.useId)(),g=(0,n.useCallback)(h=>{a?.(h),i===void 0&&l(h)},[i,a]);return(0,t.jsx)(id.Provider,{value:{open:d,setOpen:g,triggerId:f,contentId:p},children:(0,t.jsx)("div",{className:"relative inline-block",children:e})})}function sd({children:e,...i}){const{open:a,setOpen:o,triggerId:l,contentId:d}=ad();return(0,t.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 ld({className:e,children:i,...a}){const{open:o,setOpen:l,contentId:d,triggerId:f}=ad(),p=Wi(),g=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!o||p)return;const h=w=>{const $=g.current,P=document.getElementById(f);$&&!$.contains(w.target)&&!P?.contains(w.target)&&l(!1)},b=w=>{w.key==="Escape"&&l(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",b)}},[o,l,f,p]),o?p?(0,t.jsx)(gl,{open:o,onClose:()=>l(!1),children:i}):(0,t.jsx)("div",{ref:g,id:d,role:"dialog","aria-labelledby":f,className:N("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 cd=(0,n.createContext)(null);function ud(){const e=(0,n.useContext)(cd);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}function Kv({value:e,onValueChange:i,defaultValue:a="",className:o,...l}){const[d,f]=(0,n.useState)(a),p=e??d,g=(0,n.useCallback)(h=>{i?.(h),e===void 0&&f(h)},[e,i]);return(0,t.jsx)(cd.Provider,{value:{value:p,setValue:g},children:(0,t.jsx)("div",{className:o,...l})})}function Xv({className:e,...i}){return(0,t.jsx)("div",{role:"tablist",className:N("flex flex-row border-b border-border-subtle",e),...i})}function Yv({value:e,className:i,...a}){const{value:o,setValue:l}=ud(),d=e===o;return(0,t.jsx)("button",{type:"button",role:"tab","aria-selected":d,"aria-controls":`tabpanel-${e}`,tabIndex:d?0:-1,className:N("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 eb({value:e,className:i,...a}){const{value:o}=ud();return e!==o?null:(0,t.jsx)("div",{role:"tabpanel",id:`tabpanel-${e}`,className:N("pt-3",i),...a})}var pl=(0,n.forwardRef)(({className:e,...i},a)=>(0,t.jsx)("div",{ref:a,className:N("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",e),...i}));pl.displayName="ScrollArea";function tb({title:e,onClose:i,children:a,defaultWidth:o=360,defaultHeight:l=280,minWidth:d=280,minHeight:f=160,offsetIndex:p=0,className:g}){const[h,b]=(0,n.useState)({x:80+p*30,y:80+p*30}),[w,$]=(0,n.useState)({w:o,h:l}),[P,M]=(0,n.useState)(!1),D=(0,n.useRef)(!1),z=(0,n.useRef)(!1),R=(0,n.useRef)({x:0,y:0}),Z=Wi(),G=(0,n.useCallback)(W=>{W.preventDefault(),D.current=!0,R.current={x:W.clientX-h.x,y:W.clientY-h.y}},[h]),Q=(0,n.useCallback)(W=>{W.preventDefault(),W.stopPropagation(),z.current=!0,R.current={x:W.clientX,y:W.clientY}},[]);return(0,n.useEffect)(()=>{const W=he=>{if(D.current&&b({x:he.clientX-R.current.x,y:he.clientY-R.current.y}),z.current){const H=he.clientX-R.current.x,me=he.clientY-R.current.y;R.current={x:he.clientX,y:he.clientY},$(ye=>({w:Math.max(d,ye.w+H),h:Math.max(f,ye.h+me)}))}},X=()=>{D.current=!1,z.current=!1};return window.addEventListener("mousemove",W),window.addEventListener("mouseup",X),()=>{window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",X)}},[d,f]),Z?(0,t.jsxs)("div",{className:N("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",g),style:{maxHeight:"60dvh"},children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border shrink-0 bg-surface",children:[(0,t.jsx)("span",{className:"text-[11px] font-medium truncate",children:e}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,t.jsx)("button",{onClick:()=>M(!P),className:"p-0.5 rounded hover:bg-surface-hover text-foreground-muted transition-colors",children:P?(0,t.jsx)(ju,{size:12}):(0,t.jsx)(ku,{size:12})}),(0,t.jsx)("button",{onClick:i,className:"p-0.5 rounded hover:bg-danger/20 text-foreground-muted hover:text-danger transition-colors",children:(0,t.jsx)(Mt,{size:12})})]})]}),!P&&(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:a})]}):(0,t.jsxs)("div",{className:N("fixed z-50 rounded-lg border border-border bg-background-elevated shadow-2xl flex flex-col overflow-hidden",g),style:{left:h.x,top:h.y,width:P?280:w.w,height:P?"auto":w.h},children:[(0,t.jsxs)("div",{onMouseDown:G,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,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(nv,{size:12,className:"text-foreground-subtle shrink-0"}),(0,t.jsx)("span",{className:"text-[11px] font-medium truncate",children:e})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,t.jsx)("button",{onClick:()=>M(!P),className:"p-0.5 rounded hover:bg-surface-hover text-foreground-muted transition-colors",title:P?"Restore":"Minimize",children:P?(0,t.jsx)(ju,{size:12}):(0,t.jsx)(ku,{size:12})}),(0,t.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,t.jsx)(Mt,{size:12})})]})]}),!P&&(0,t.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto relative",children:[a,(0,t.jsx)("div",{onMouseDown:Q,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 dd({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 f=p=>{p.key==="Escape"&&i()};return document.addEventListener("keydown",f),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",f),document.body.style.overflow=""}},[e,i]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:N("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,t.jsx)("div",{ref:d,role:"dialog","aria-modal":"true",className:N("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 rb({items:e,className:i}){return(0,t.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,t.jsxs)(n.default.Fragment,{children:[o>0&&(0,t.jsx)(Rr,{className:"h-3 w-3 flex-shrink-0"}),d?a.onClick?(0,t.jsx)("button",{type:"button",onClick:a.onClick,className:"hover:text-foreground transition-colors",children:a.label}):(0,t.jsx)("a",{href:a.href,className:"hover:text-foreground transition-colors",children:a.label}):(0,t.jsx)("span",{className:l?"text-foreground font-medium":"",children:a.label})]},o)})})}var fd={left:"text-left",right:"text-right",center:"text-center"};function nb({columns:e,rows:i,rowKey:a,onRowClick:o,minWidthPx:l=480,emptyMessage:d,className:f,bordered:p=!0,rowClassName:g}){return i.length===0&&d?(0,t.jsx)("div",{className:`rounded-lg ${p?"border border-border":""} bg-surface px-3 py-4 text-xs text-foreground-subtle text-center ${f??""}`,children:d}):i.length===0?null:(0,t.jsx)("div",{className:`rounded-lg ${p?"border border-border":""} bg-surface overflow-x-auto ${f??""}`,children:(0,t.jsxs)("table",{className:"w-full text-xs",style:{minWidth:`${l}px`},children:[(0,t.jsx)("thead",{className:"bg-surface",children:(0,t.jsx)("tr",{children:e.map(h=>{const b=h.align??"left",w=h.nowrap??!0;return(0,t.jsx)("th",{className:["px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",fd[b],w?"whitespace-nowrap":"",h.width??""].filter(Boolean).join(" "),children:h.headerRender?h.headerRender():h.header},h.key)})})}),(0,t.jsx)("tbody",{children:i.map((h,b)=>{const w=a?a(h,b):b,$=g?.(h,b)??"",P=o!==void 0;return(0,t.jsx)("tr",{onClick:P?()=>o(h,b):void 0,className:[P?"cursor-pointer hover:bg-primary/5":"hover:bg-primary/5",$].filter(Boolean).join(" "),children:e.map(M=>{const D=M.align??"left",z=M.nowrap??!1;return(0,t.jsx)("td",{className:["px-3 py-2 text-foreground border-b border-border",fd[D],z?"whitespace-nowrap":""].filter(Boolean).join(" "),children:M.render(h,b)},M.key)})},w)})})]})})}function ib({open:e,onClose:i,title:a,subtitle:o,footer:l,children:d,widthClass:f="w-[360px]"}){return(0,n.useEffect)(()=>{if(!e)return;const p=g=>{g.key==="Escape"&&i()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[e,i]),e?(0,t.jsxs)("aside",{className:N("absolute top-0 right-0 bottom-0 z-20 flex flex-col","bg-surface border-l border-border shadow-xl",f),role:"dialog","aria-modal":"false",children:[(0,t.jsxs)("header",{className:"flex items-start justify-between gap-2 px-4 py-3 border-b border-border",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-foreground truncate",children:a}),o!==void 0&&(0,t.jsx)("div",{className:"text-[11px] text-foreground-subtle mt-0.5 truncate",children:o})]}),(0,t.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,t.jsx)(Mt,{className:"w-4 h-4"})})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto px-4 py-3",children:d}),l!==void 0&&(0,t.jsx)("footer",{className:"flex items-center gap-2 justify-end px-4 py-3 border-t border-border",children:l})]}):null}var ab={inherit:"bg-muted",on:"bg-emerald-500",off:"bg-orange-500",na:"bg-gray-300 opacity-50"};function md({node:e,depth:i,selectedAddonId:a,onSelect:o,agentDots:l}){const d=e.addonId===a,f=l?.[e.addonId]??[];return(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{type:"button",onClick:()=>o(e.addonId),className:N("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,t.jsx)("span",{className:"truncate",children:e.addonName}),f.length>0&&(0,t.jsx)("span",{className:"flex items-center gap-1 shrink-0",children:f.map(p=>(0,t.jsx)("span",{title:`${p.agentNodeId}: ${p.state}`,className:N("w-2 h-2 rounded-full",ab[p.state])},p.agentNodeId))})]}),e.children.map(p=>(0,t.jsx)(md,{node:p,depth:i+1,selectedAddonId:a,onSelect:o,agentDots:l},p.addonId))]})}function ob({tree:e,selectedAddonId:i,onSelect:a,agentDots:o,className:l}){return(0,t.jsx)("div",{className:N("flex flex-col py-2",l),children:e.map(d=>(0,t.jsx)(md,{node:d,depth:0,selectedAddonId:i,onSelect:a,agentDots:o},d.addonId))})}function sb(e){const i=[],a=[],o=new Map;for(const d of e.slots)for(const f of d.addons){const p={addonId:f.id,addonName:f.name,slot:f.slot,inputClasses:f.inputClasses,outputClasses:f.outputClasses,children:[]};f.slot==="audio-classifier"?i.push(p):(a.push(p),o.set(f.id,p))}const l=[];for(const d of a){if(d.inputClasses.length===0){l.push(d);continue}const f=a.find(p=>p.addonId!==d.addonId&&p.outputClasses.some(g=>d.inputClasses.includes(g)));f&&f.children.push(d)}return[...l,...i]}function lb(e){return e?e.models.map(i=>({id:i.id,name:i.name})):[]}function Ra({step:e,schema:i,allSchemas:a,depth:o=0,onChange:l,onDelete:d,readOnly:f=!1,toggleMode:p="simple",overrideState:g=null,onOverrideChange:h,inheritedEnabled:b,hideModelAndSettings:w=!1}){const[$,P]=(0,n.useState)(!1),M=lb(i);if(M.length>0&&!M.some(z=>z.id===e.modelId)&&!f){const z=(i?.defaultModelId?M.find(R=>R.id===i.defaultModelId):null)??M[0];z&&z.id!==e.modelId&&queueMicrotask(()=>l({...e,modelId:z.id}))}const D=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider font-medium text-foreground-subtle/60 block leading-none",children:e.slot}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground truncate block leading-tight",children:e.addonName}),(0,t.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[e.inputClasses.map(z=>(0,t.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:z},z)),e.inputClasses.length>0&&e.outputClasses.length>0&&(0,t.jsx)("span",{className:"text-foreground-subtle/40 text-[10px]",children:"→"}),e.outputClasses.map(z=>(0,t.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:z},z))]})]}),!f&&p==="simple"&&(0,t.jsx)("button",{onClick:z=>{z.stopPropagation(),l({...e,enabled:!e.enabled})},className:N("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,t.jsx)("span",{className:N("inline-block h-4 w-4 rounded-full bg-white shadow transition-transform",e.enabled?"translate-x-6":"translate-x-1")})}),!f&&p==="threeState"&&h&&(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-md border border-border p-0.5",onClick:z=>z.stopPropagation(),children:[(0,t.jsx)(vl,{label:"Inherit",active:g===null,variant:"inherit",subtext:b===void 0?void 0:b?"on":"off",onClick:()=>h(null)}),(0,t.jsx)(vl,{label:"On",active:g===!0,variant:"on",onClick:()=>h(!0)}),(0,t.jsx)(vl,{label:"Off",active:g===!1,variant:"off",onClick:()=>h(!1)})]})]});return(0,t.jsx)(Ru,{expanded:$,onExpandedChange:P,dimmed:!e.enabled,header:D,children:w?(0,t.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,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(hl,{label:"Model",value:e.modelId,disabled:f,options:M.map(z=>({value:z.id,label:z.name})),onChange:z=>l({...e,modelId:z})}),e.slot==="audio-classifier"&&e.engine&&(0,t.jsx)(hl,{label:"Runtime",value:`${e.engine.runtime}/${e.engine.backend}`,disabled:f,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:z=>{const[R,Z]=z.split("/");l({...e,engine:{runtime:R,backend:Z,format:Z==="coreml"?"coreml":"onnx"}})}}),i?.configSchema?.map(z=>(0,t.jsx)(La,{field:z,allFields:i.configSchema??[],step:e,disabled:f,onChange:l},z.key))]})})}function hl({label:e,value:i,options:a,disabled:o,onChange:l}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:e}),(0,t.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,t.jsx)("option",{value:i,children:i||"default"}),a.map(d=>(0,t.jsx)("option",{value:d.value,disabled:d.disabled,children:d.label},d.value))]})]})}function cb({label:e,description:i,value:a,options:o,disabled:l,onChange:d}){function f(p){l||d(a.includes(p)?a.filter(g=>g!==p):[...a,p])}return(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1",children:e}),i&&(0,t.jsx)("p",{className:"text-[10px] text-foreground-subtle/60 mb-1.5",children:i}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:o.map(p=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>f(p.value),className:N("text-[10px] font-medium px-2 py-1 rounded-md border transition-colors",a.includes(p.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:p.label},p.value))})]})}function ub(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 La({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:p,equals:g,notEquals:h,in:b,notIn:w}=d,$=ub(p,a,i);if(g!==void 0&&$!==g||h!==void 0&&$===h||b!==void 0&&!b.includes($)||w!==void 0&&w.includes($))return null}function f(p){l({...a,settings:{...a.settings,[e.key]:p}})}if(e.type==="select"){const p=a.settings?.[e.key],g=typeof p=="string"?p:e.default??"";return(0,t.jsx)(hl,{label:e.label,value:g,disabled:o||e.disabled,options:e.options,onChange:f})}if(e.type==="multiselect"){const p=a.settings?.[e.key],g=Array.isArray(p)?p:Array.isArray(e.default)?e.default:[];return(0,t.jsx)(cb,{label:e.label,description:e.description,value:g,options:e.options,disabled:o||e.disabled,onChange:f})}if(e.type==="slider"||e.type==="number"){const p=a.settings?.[e.key],g=typeof e.default=="number"?e.default:e.min??0,h=typeof p=="number"?p:g,b=e.min??0,w=e.max??1,$=e.step??.01,P=e.type==="slider"?e.showValue:!0,M="unit"in e?e.unit:void 0,D=e.type==="slider"?e.displayScale:void 0,z=D?h/D:h;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide",children:e.label}),P&&(0,t.jsxs)("span",{className:"text-xs font-medium text-foreground tabular-nums",children:[typeof z=="number"?z.toFixed(2).replace(/\.?0+$/,""):z,M?` ${M}`:""]})]}),e.description&&(0,t.jsx)("p",{className:"text-[10px] text-foreground-subtle/60 mb-1.5",children:e.description}),(0,t.jsx)("input",{type:"range",min:b,max:w,step:$,value:h,disabled:o||e.disabled,onChange:R=>f(Number(R.target.value)),className:"w-full accent-primary h-1.5"})]})}if(e.type==="boolean"){const p=a.settings?.[e.key];return(0,t.jsxs)("label",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"checkbox",checked:typeof p=="boolean"?p:e.default===!0,disabled:o||e.disabled,onChange:g=>f(g.target.checked),className:"h-3.5 w-3.5 accent-primary"}),(0,t.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 p=a.settings?.[e.key],g=typeof p=="string"?p:e.default??"",h=e.type==="password"?"password":"text";return(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:e.label}),e.type==="textarea"?(0,t.jsx)("textarea",{value:g,disabled:o||e.disabled,placeholder:e.placeholder,onChange:b=>f(b.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,t.jsx)("input",{type:h,value:g,disabled:o||e.disabled,placeholder:e.placeholder,onChange:b=>f(b.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,t.jsx)("div",{className:"border-t border-border my-2"}):e.type==="info"?(0,t.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 vl({label:e,active:i,variant:a,subtext:o,onClick:l}){return(0,t.jsxs)("button",{type:"button",onClick:l,className:N("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,t.jsxs)("span",{className:"ml-1 opacity-60",children:["(",o,")"]})]})}function gd(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 db(e,i,a){return a?{enabled:a.enabled??i.enabled,modelId:a.modelId??i.modelId,settings:a.settings??i.settings}:i}function fb({addon:e,agentDefault:i,modelsForFormat:a,onChangeAgentConfig:o}){const l=d=>{o?.({...i,...d})};return(0,t.jsxs)("div",{className:"space-y-4 text-xs",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"checkbox",checked:i.enabled,onChange:d=>l({enabled:d.target.checked})}),(0,t.jsxs)("span",{children:["Enabled on this agent (",e.name,")"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-foreground-subtle mb-1",children:"Model"}),(0,t.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,t.jsx)("option",{value:d.id,children:d.name},d.id))})]}),(e.configSchema?.length??0)>0&&(0,t.jsxs)("div",{className:"pt-2 border-t border-border/50 space-y-3",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-foreground-subtle",children:"Settings"}),e.configSchema?.map(d=>(0,t.jsx)(La,{field:d,allFields:e.configSchema??[],step:gd(e,i),disabled:!1,onChange:f=>l({settings:{...f.settings}})},d.key))]})]})}function mb({addon:e,agentDefault:i,agentNodeId:a,currentPatch:o,modelsForFormat:l,onChangePatch:d}){const f=db("device",i,o),p=P=>{const M=P.enabled!==void 0||P.modelId!==void 0||P.settings!==void 0;d?.(M?P:null)},g=P=>{const{enabled:M,...D}=o??{};p(P==="inherit"?D:{...D,enabled:P==="on"})},h=P=>{const{modelId:M,...D}=o??{};p(P===void 0?D:{...D,modelId:P})},b=P=>{const{settings:M,...D}=o??{};p(P===void 0?D:{...D,settings:P})},w=o?.enabled===void 0?"inherit":o.enabled?"on":"off",$=o?.modelId!==void 0;return(0,t.jsxs)("div",{className:"space-y-4 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[["inherit","on","off"].map(P=>(0,t.jsx)("button",{type:"button",onClick:()=>g(P),className:N("px-3 py-1 border border-border rounded text-xs capitalize",w===P?"bg-primary text-primary-foreground border-primary":"bg-surface text-foreground hover:bg-muted"),children:P},P)),(0,t.jsxs)("span",{className:"ml-2 text-[10px] text-foreground-subtle",children:["agent default: ",(0,t.jsx)("span",{className:"font-semibold",children:i.enabled?"on":"off"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-foreground-subtle",children:"Model"}),$?(0,t.jsx)("button",{type:"button",className:"text-[10px] text-foreground-subtle hover:text-foreground",onClick:()=>h(void 0),children:"Clear"}):(0,t.jsx)("button",{type:"button",className:"text-[10px] text-primary hover:underline",onClick:()=>h(i.modelId),children:"Override"})]}),(0,t.jsx)("select",{disabled:!$,className:"w-full bg-surface border border-border rounded px-2 py-1 text-xs disabled:opacity-50",value:$?o?.modelId??i.modelId:i.modelId,onChange:P=>h(P.target.value),children:l.map(P=>(0,t.jsx)("option",{value:P.id,children:P.name},P.id))}),!$&&(0,t.jsxs)("div",{className:"text-[10px] text-foreground-subtle mt-1",children:["inherits from ",a]})]}),(e.configSchema?.length??0)>0&&(()=>{const P=o?.settings!==void 0;return(0,t.jsxs)("div",{className:"pt-2 border-t border-border/50 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-foreground-subtle",children:"Settings"}),P?(0,t.jsx)("button",{type:"button",className:"text-[10px] text-foreground-subtle hover:text-foreground",onClick:()=>b(void 0),children:"Clear"}):(0,t.jsx)("button",{type:"button",className:"text-[10px] text-primary hover:underline",onClick:()=>b({...i.settings}),children:"Override"})]}),e.configSchema?.map(M=>(0,t.jsx)(La,{field:M,allFields:e.configSchema??[],step:gd(e,f),disabled:!P,onChange:D=>b({...D.settings})},M.key)),!P&&(0,t.jsxs)("div",{className:"text-[10px] text-foreground-subtle",children:["inherits from ",a]})]})})(),(0,t.jsxs)("div",{className:"rounded bg-muted/40 px-3 py-2 text-[11px] text-foreground-subtle",children:[(0,t.jsx)("div",{className:"font-semibold text-foreground mb-0.5",children:"Effective config preview"}),(0,t.jsxs)("div",{className:"font-mono truncate",children:[e.id," · model: ",f.modelId," · ",f.enabled?"on":"off"]})]})]})}function gb(e){const{mode:i,addon:a,agentDefault:o,agentNodeId:l,currentPatch:d,onChangeAgentConfig:f,onChangePatch:p,engineFormat:g}=e,h=(0,n.useMemo)(()=>a.models.filter(b=>!!b.formats[g]),[a.models,g]);return i==="agent"?(0,t.jsx)(fb,{addon:a,agentDefault:o,modelsForFormat:h,onChangeAgentConfig:f}):(0,t.jsx)(mb,{addon:a,agentDefault:o,agentNodeId:l,currentPatch:d,modelsForFormat:h,onChangePatch:p})}function pb(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 pd={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 hb({slot:e}){const i=pd[e]??pd.classifier;return(0,t.jsx)("span",{className:N("text-[9px] font-semibold uppercase tracking-widest leading-none",i.className),children:i.label})}var hd="inline-flex items-center rounded bg-muted px-1.5 py-px text-[9px] font-medium text-foreground-subtle";function vb({inputs:e,outputs:i}){return e.length===0&&i.length===0?null:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 flex-wrap",children:[e.map(a=>(0,t.jsx)("span",{className:N(hd,"bg-blue-500/10 text-blue-500"),children:a},`in-${a}`)),e.length>0&&i.length>0&&(0,t.jsx)("span",{className:"text-foreground-subtle/60 text-[9px]",children:"→"}),i.map(a=>(0,t.jsx)("span",{className:N(hd,"bg-emerald-500/10 text-emerald-500"),children:a},`out-${a}`))]})}function bb({enabled:e,onChange:i,disabled:a}){return(0,t.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:a,onClick:o=>{o.stopPropagation(),i(!e)},className:N("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,t.jsx)("span",{className:N("inline-block h-3 w-3 rounded-full bg-white shadow transition-transform",e?"translate-x-3.5":"translate-x-0.5")})})}function yb(e){return e.kind==="enabled"?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 shrink-0"}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.modelId})]}):e.kind==="disabled"?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground-subtle",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full border border-foreground-subtle/60 shrink-0"}),"off"]}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground-subtle/70",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-muted shrink-0"}),"n/a"]})}function xb({node:e,depth:i,agents:a,getCellState:o,onCellClick:l,selectedCell:d,toggleProps:f}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.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,t.jsxs)("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[(0,t.jsx)(hb,{slot:e.slot}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:"font-semibold truncate",children:e.addonName}),(0,t.jsx)(vb,{inputs:e.inputClasses,outputs:e.outputClasses})]})]}),f&&(0,t.jsx)("span",{className:"pl-2 pt-0.5 shrink-0",children:(0,t.jsx)(bb,{enabled:f.enabled,onChange:f.onChange,disabled:f.disabled})})]}),a.map(p=>{const g=o(e.addonId,p.agentNodeId),h=d?.addonId===e.addonId&&d.agentNodeId===p.agentNodeId;return(0,t.jsx)("button",{type:"button",onClick:()=>l(e.addonId,p.agentNodeId),className:N("text-left px-3 py-1.5 border-b border-l border-border text-xs hover:bg-muted/40",g.kind==="enabled"&&"bg-emerald-500/5",g.kind==="na"&&"bg-muted/30",h&&"ring-2 ring-primary ring-inset"),children:yb(g)},p.agentNodeId)})]})}function _b({tree:e,agents:i,getCellState:a,onCellClick:o,selectedCell:l,onToggleEnabled:d}){const f=(0,n.useMemo)(()=>pb(e),[e]),p=`minmax(320px, 1fr) repeat(${i.length}, minmax(160px, 220px))`,g=d!==void 0&&i.length===1,h=i[0]?.agentNodeId;return(0,t.jsx)("div",{className:"overflow-auto border border-border rounded",children:(0,t.jsxs)("div",{className:"grid",style:{gridTemplateColumns:p},children:[(0,t.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(b=>(0,t.jsxs)("div",{className:"sticky top-0 z-10 bg-muted/60 px-3 py-2 border-b border-l border-border",children:[(0,t.jsx)("div",{className:"text-xs font-semibold text-foreground",children:b.agentNodeId}),(0,t.jsx)("div",{className:"text-[10px] text-foreground-subtle truncate",children:b.engineLabel})]},b.agentNodeId)),f.map(({node:b,depth:w})=>{const $=g&&h!==void 0?a(b.addonId,h):null;return(0,t.jsx)(xb,{node:b,depth:w,agents:i,getCellState:a,onCellClick:o,selectedCell:l,toggleProps:g&&$!==null?{enabled:$.kind==="enabled",onChange:P=>d?.(b.addonId,P),disabled:$.kind==="na"}:void 0},b.addonId)})]})})}var vd=typeof globalThis<"u"?globalThis.__camstackTrpcReact:void 0,S=vd??(0,oe.createTRPCReact)();typeof globalThis<"u"&&!vd&&(globalThis.__camstackTrpcReact=S);var bl=$r("camstack:system",null);function bd({system:e,children:i}){return(0,t.jsx)(bl.Provider,{value:e,children:i})}function cr(){const e=(0,n.useContext)(bl);if(!e)throw new Error("useSystem(): no <SystemProvider> in tree");return e}function wb(){return(0,n.useContext)(bl)}function Qi(e,i){const a=cr(),o=(0,n.useRef)(i);o.current=i;const[l,d]=(0,n.useState)(a.connectionVersion);(0,n.useEffect)(()=>a.subscribeConnectionEvents((f,p)=>{f==="connected"&&d(p)}),[a]),(0,n.useEffect)(()=>a.subscribeEvent(e,f=>{o.current(f)}),[a,e,l])}function yl(e){const i=(0,n.useRef)(e);return i.current=e,i}function xl(e,i){const[a,o]=(0,n.useState)(null),l=yl(i);return Qi(e,d=>{const f=d.data,p=l.current;p&&!p(f)||o(f)}),a}function Sb(e,i,a){const[o,l]=(0,n.useState)(()=>new Map),d=yl(i),f=yl(a);return Qi(e,p=>{const g=p.data,h=f.current;if(h&&!h(g))return;const b=d.current(g);l(w=>{const $=new Map(w);return $.set(b,g),$})}),{map:o,values:(0,n.useMemo)(()=>Array.from(o.values()),[o])}}function Za(){const{data:e,isLoading:i}=S.nodes.topology.useQuery(void 0,{staleTime:6e4}),a=xl("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 jb({selectedNodeId:e,onSelect:i,label:a="Node",hideIcon:o=!1,alwaysShow:l=!1}){const{nodes:d}=Za();return!l&&d.length<=1?null:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[!o&&(0,t.jsx)(xv,{className:"h-3.5 w-3.5 text-foreground-subtle"}),a&&(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-foreground-subtle",children:a}),(0,t.jsx)("div",{className:"flex rounded-md border border-border overflow-hidden text-[11px] font-medium",children:d.map((f,p)=>{const g=e===f.id;return(0,t.jsx)("button",{type:"button",onClick:()=>i(f.id),disabled:!f.isOnline,title:f.isOnline?f.name:`${f.name} (offline)`,className:N("px-2.5 py-1 transition-colors",g?"bg-primary/15 text-primary":"bg-transparent text-foreground-subtle hover:bg-surface-hover hover:text-foreground",p>0&&"border-l border-border",!f.isOnline&&"opacity-50 cursor-not-allowed"),children:f.shortName},f.id)})})]})}var $b={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 kb({status:e,showDot:i=!0,showLabel:a=!0,size:o="sm",className:l}){const d=$b[e];return(0,t.jsxs)("span",{className:N("inline-flex items-center gap-1.5",o==="sm"?"text-xs":"text-sm",l),children:[i&&(0,t.jsx)("span",{className:N("h-1.5 w-1.5 shrink-0 rounded-full",d.colorClass),"aria-hidden":"true"}),a&&(0,t.jsx)("span",{className:"text-foreground",children:d.label})]})}var Pb={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 Nb({provider:e,showLabel:i=!0,className:a}){const o=Pb[e];return(0,t.jsxs)("span",{className:N("inline-flex items-center gap-1.5 text-xs",a),children:[(0,t.jsx)("span",{className:N("h-1.5 w-1.5 shrink-0 rounded-sm",o.colorClass),"aria-hidden":"true"}),i&&(0,t.jsx)("span",{className:"text-foreground",children:o.label})]})}var Cb={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 yd({children:e,variant:i="neutral",mono:a,className:o}){return(0,t.jsx)("span",{className:N("inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-bold leading-tight",a&&"font-mono",Cb[i],o),children:e})}function Ob({version:e,preRelease:i,className:a}){return(0,t.jsx)(yd,{variant:i??/-(alpha|beta|rc|dev|canary|next)/i.test(e)?"warning":"success",mono:!0,className:a,children:e})}function Mb({label:e,description:i,error:a,required:o,children:l,orientation:d="vertical",className:f}){const p=d==="horizontal";return(0,t.jsxs)("div",{className:N("flex gap-2",p?"flex-row items-center justify-between":"flex-col",f),children:[(0,t.jsxs)("div",{className:N(p?"flex-1":""),children:[(0,t.jsxs)(ul,{children:[e,o&&(0,t.jsx)("span",{className:"text-danger ml-0.5",children:"*"})]}),i&&(0,t.jsx)("p",{className:"text-foreground-subtle text-xs mt-0.5",children:i})]}),(0,t.jsx)("div",{className:N(p?"shrink-0":""),children:l}),a&&(0,t.jsx)("p",{className:"text-danger text-xs",children:a})]})}function Eb({title:e,subtitle:i,actions:a,className:o}){return(0,t.jsxs)("div",{className:N("flex flex-col gap-2 mb-3 sm:flex-row sm:items-center sm:justify-between",o),children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-sm font-semibold text-foreground",children:e}),i&&(0,t.jsx)("p",{className:"text-foreground-subtle text-xs",children:i})]}),a&&(0,t.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:a})]})}function xd({icon:e,title:i,description:a,action:o,className:l}){return(0,t.jsxs)("div",{className:N("flex flex-col items-center justify-center gap-3 py-12",l),children:[e&&(0,t.jsx)(e,{className:"h-12 w-12 text-foreground-subtle","aria-hidden":"true"}),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1 text-center",children:[(0,t.jsx)("p",{className:"text-foreground-muted text-sm font-medium",children:i}),a&&(0,t.jsx)("p",{className:"text-foreground-subtle text-xs max-w-xs",children:a})]}),o&&(0,t.jsx)("div",{className:"mt-1",children:o})]})}var Ib={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 _d({message:e,title:i,onRetry:a,action:o,variant:l="danger",className:d}){const f=Ib[l],p=l==="warning"?jn:_n;return(0,t.jsxs)("div",{role:"alert",className:N("flex items-start gap-2.5 rounded border px-3 py-2.5",f.box,d),children:[(0,t.jsx)(p,{className:N("h-4 w-4 mt-0.5 shrink-0",f.icon),"aria-hidden":"true"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[i&&(0,t.jsx)("p",{className:N("text-xs font-semibold",f.title),children:i}),(0,t.jsx)("div",{className:N("text-xs break-words",f.message,i?"mt-0.5":""),children:e})]}),o??(a&&(0,t.jsxs)("button",{type:"button",onClick:a,className:N("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",f.message),children:[(0,t.jsx)(za,{className:"h-3 w-3","aria-hidden":"true"}),"Retry"]}))]})}var wd=$r("camstack:confirm-dialog",null);function Hi(){const e=(0,n.useContext)(wd);if(!e)throw new Error("useConfirm must be used within ConfirmDialogProvider");return e.confirm}function Db({children:e}){const[i,a]=(0,n.useState)(null),o=(0,n.useCallback)(g=>new Promise(h=>{a({...g,resolve:h})}),[]),l=()=>{i?.resolve(!0),a(null)},d=()=>{i?.resolve(!1),a(null)},f={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"}},p=i?f[i.variant??"default"]:f.default;return(0,t.jsxs)(wd.Provider,{value:{confirm:o},children:[e,i&&(0,t.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:d}),(0,t.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:g=>g.stopPropagation(),children:[(0,t.jsxs)("div",{className:"px-5 pt-5 pb-4",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:i.title}),(0,t.jsx)("p",{className:"mt-2 text-xs text-foreground-subtle leading-relaxed",children:i.message})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border bg-surface-hover/30",children:[(0,t.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,t.jsx)("button",{type:"button",onClick:l,className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${p.button}`,children:i.confirmLabel??"Confirm"})]})]})]})]})}function Ab({value:e,label:i,trend:a,className:o}){return(0,t.jsxs)(cl,{className:N("flex flex-col gap-1",o),children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"text-2xl font-semibold text-foreground",children:e}),a&&(0,t.jsxs)("span",{className:N("inline-flex items-center gap-0.5 text-xs font-medium",a.direction==="up"?"text-success":"text-danger"),children:[a.direction==="up"?(0,t.jsx)(Nv,{className:"h-3 w-3"}):(0,t.jsx)(Cv,{className:"h-3 w-3"}),a.value,"%"]})]}),(0,t.jsx)("span",{className:"text-xs text-foreground-muted",children:i})]})}function zb({items:e,className:i}){return(0,t.jsx)("dl",{className:N("flex flex-col",i),children:e.map(a=>(0,t.jsxs)("div",{className:"flex items-center h-7",children:[(0,t.jsx)("dt",{className:"text-foreground-subtle text-xs w-1/3 shrink-0",children:a.key}),(0,t.jsx)("dd",{className:"text-foreground text-xs",children:a.value})]},a.key))})}function Tb({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,t.jsxs)("div",{className:N("relative group",a),children:[(0,t.jsx)(pl,{style:{maxHeight:i},children:(0,t.jsx)("pre",{className:"font-mono text-xs bg-surface p-3 rounded-md border border-border-subtle",children:(0,t.jsx)("code",{children:e})})}),(0,t.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(ll,{icon:o?xn:Lr,"aria-label":"Copy code",variant:"ghost",size:"sm",onClick:d})})]})}function Rb({filters:e,values:i,onChange:a,className:o}){const l=Wi(),[d,f]=(0,n.useState)(!1),p=(h,b)=>{a({...i,[h]:b})},g=Object.values(i).filter(h=>h!==void 0&&h!=="").length;if(l){const h=e.find(w=>w.type==="search"),b=e.some(w=>w.type!=="search");return(0,t.jsxs)("div",{className:N("flex items-center gap-2",o),children:[h&&(0,t.jsx)(Ta,{placeholder:h.placeholder??"Search...",value:i[h.key]??"",onChange:w=>p(h.key,w.target.value),leftSlot:(0,t.jsx)(Gi,{className:"h-3 w-3 text-foreground-subtle"}),className:"flex-1"}),b&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>f(!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,t.jsx)(Sv,{className:"h-3.5 w-3.5"}),"Filters",g>0&&(0,t.jsx)(rn,{variant:"info",className:"ml-1 text-[10px] px-1 py-0",children:g})]}),(0,t.jsx)(gl,{open:d,onClose:()=>f(!1),title:"Filters",children:(0,t.jsx)("div",{className:"flex flex-col gap-3",children:e.filter(w=>w.type!=="search").map(w=>{switch(w.type){case"select":return(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs text-foreground-muted mb-1 block",children:w.label}),(0,t.jsx)(Vi,{options:w.options,value:i[w.key]??"",onChange:$=>p(w.key,$.target.value),className:"w-full"})]},w.key);case"badge-toggle":return(0,t.jsx)("div",{className:"flex items-center gap-1 flex-wrap",children:w.options.map($=>{const P=i[w.key]===$.value;return(0,t.jsx)("button",{type:"button",onClick:()=>p(w.key,P?void 0:$.value),children:(0,t.jsx)(rn,{variant:P?"info":"default",className:"cursor-pointer",children:$.label})},$.value)})},w.key);default:return null}})})})]})]})}return(0,t.jsx)("div",{className:N("flex items-center gap-2 flex-wrap",o),children:e.map(h=>{switch(h.type){case"search":return(0,t.jsx)(Ta,{placeholder:h.placeholder??"Search...",value:i[h.key]??"",onChange:b=>p(h.key,b.target.value),leftSlot:(0,t.jsx)(Gi,{className:"h-3 w-3 text-foreground-subtle"}),className:"w-48"},h.key);case"select":return(0,t.jsx)(Vi,{options:h.options,value:i[h.key]??"",onChange:b=>p(h.key,b.target.value),className:"w-36"},h.key);case"badge-toggle":return(0,t.jsx)("div",{className:"flex items-center gap-1",children:h.options.map(b=>{const w=i[h.key]===b.value;return(0,t.jsx)("button",{type:"button",onClick:()=>p(h.key,w?void 0:b.value),children:(0,t.jsx)(rn,{variant:w?"info":"default",className:"cursor-pointer",children:b.label})},b.value)})},h.key);default:return null}})})}function _l({label:e,icon:i,href:a,badge:o,active:l=!1,className:d}){return(0,t.jsxs)("a",{href:a,className:N("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,t.jsx)(i,{className:"h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate flex-1",children:e}),o!==void 0&&(0,t.jsx)(rn,{className:"ml-auto text-[10px] px-1.5 py-0",children:o})]})}function wl({logo:e,sections:i,footer:a,onNavigate:o,className:l}){return(0,t.jsxs)("nav",{className:N("bg-surface border-r border-border h-full flex flex-col",l),children:[e&&(0,t.jsx)("div",{className:"px-3 py-2 shrink-0",children:e}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-1 py-1",children:i.map((d,f)=>(0,t.jsxs)("div",{className:N(f>0?"mt-3":""),children:[d.label&&(0,t.jsx)("span",{className:"text-[10px] text-foreground-disabled uppercase tracking-wider px-2 mb-1 block",children:d.label}),(0,t.jsx)("div",{className:"flex flex-col gap-0.5",onClick:o,children:d.items.map(p=>(0,t.jsx)(_l,{...p},p.href))})]},f))}),a&&a.length>0&&(0,t.jsxs)("div",{className:"shrink-0 px-1 pb-1",children:[(0,t.jsx)(dl,{className:"mb-1"}),(0,t.jsx)("div",{className:"flex flex-col gap-0.5",onClick:o,children:a.map(d=>(0,t.jsx)(_l,{...d},d.href))})]})]})}function Lb({sidebar:e,header:i,mobileLogo:a,mobileActions:o,children:l,className:d}){const f=Wi(),[p,g]=(0,n.useState)(!1);return(0,t.jsxs)("div",{className:N("flex h-screen",d),children:[!f&&(0,t.jsx)(wl,{...e,className:N("w-44",e.className)}),f&&(0,t.jsx)(dd,{open:p,onClose:()=>g(!1),width:"w-64",children:(0,t.jsx)(wl,{...e,onNavigate:()=>g(!1),className:"w-full border-r-0"})}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col min-w-0",children:[f&&(0,t.jsxs)("header",{className:"flex items-center h-12 border-b border-border px-3 shrink-0 bg-surface/80 backdrop-blur-sm",children:[(0,t.jsx)("button",{onClick:()=>g(!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,t.jsx)(uv,{className:"h-5 w-5"})}),a&&(0,t.jsx)("div",{className:"flex-1 flex justify-center",children:a}),o&&(0,t.jsx)("div",{className:"shrink-0",children:o})]}),!f&&i&&(0,t.jsxs)("header",{className:"flex items-center h-10 border-b border-border px-4 shrink-0",children:[i.breadcrumbs&&i.breadcrumbs.length>0&&(0,t.jsx)("nav",{className:"flex items-center gap-1 text-xs flex-1 min-w-0",children:i.breadcrumbs.map((h,b)=>{const w=b===i.breadcrumbs.length-1;return(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[b>0&&(0,t.jsx)(Rr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}),h.href&&!w?(0,t.jsx)("a",{href:h.href,className:"text-foreground-subtle hover:text-foreground transition-colors truncate",children:h.label}):(0,t.jsx)("span",{className:"text-foreground truncate",children:h.label})]},b)})}),i.actions&&(0,t.jsx)("div",{className:"flex items-center gap-2 ml-auto shrink-0",children:i.actions})]}),(0,t.jsx)("main",{className:"flex-1 overflow-auto p-4",children:l})]})]})}var Zb={online:"bg-success",offline:"bg-danger",warning:"bg-warning",unknown:"bg-foreground-subtle"};function Ub({title:e,subtitle:i,status:a,selected:o,onClick:l,badges:d,actions:f,offlineAction:p,className:g}){const h=a==="offline";return(0,t.jsxs)("div",{onClick:l,className:N("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",h&&!o&&"opacity-50",g),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium truncate",children:e}),a&&(0,t.jsx)("span",{className:N("h-2 w-2 rounded-full shrink-0",Zb[a])})]}),i&&(0,t.jsx)("div",{className:"text-[11px] text-foreground-muted",children:i}),d&&d.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:d.map((b,w)=>{const $=N("rounded px-1.5 py-0.5 text-[10px] flex items-center gap-0.5",o?"bg-primary/20":"bg-surface-hover",b.onClick&&"hover:opacity-80 transition-opacity cursor-pointer");return b.onClick?(0,t.jsxs)("button",{onClick:P=>{P.stopPropagation(),b.onClick()},className:$,children:[b.icon,b.label]},w):(0,t.jsxs)("span",{className:$,children:[b.icon,b.label]},w)})}),!h&&f&&f.length>0&&(0,t.jsx)("div",{className:"flex items-center gap-0.5 mt-2 -mb-1",children:f.map((b,w)=>(0,t.jsx)("button",{onClick:$=>{$.stopPropagation(),b.onClick()},className:"p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",title:b.label,"aria-label":b.label,children:b.icon},w))}),h&&p&&(0,t.jsx)("div",{className:"mt-2",onClick:b=>b.stopPropagation(),children:p})]})}function Bb({children:e,minCardWidth:i=220,gap:a=3,className:o}){return(0,t.jsx)("div",{className:N("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 Fb="capability.binding-changed";function Ur(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 p=await e.deviceManager.getBindings.query({deviceId:i});l||o(p)}catch{l||o(p=>p)}};d();const f=e.live?.onEvent.subscribe({category:Fb},{onData:p=>{const g=p.data?.source;if(!g){d();return}g.type==="device"&&g.id===i&&d()}});return()=>{l=!0,f?.unsubscribe()}},[e,i]),(0,n.useMemo)(()=>a?(0,se.createDeviceProxy)(e,a):null,[e,a])}function Sl(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 Sd(e,i,a){const o=Ur(e,i);return Sl(o?a(o.state):void 0)}function $n(e){const i=Ur(e.trpc,e.deviceId),a=Sl(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 Gb(e){return e.parentDeviceId===null?"top-level":e.role?"accessory":"adopted"}var Vb={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 Wb(e){const i=Vb[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 Qb={siren:Aa,floodlight:Su,spotlight:Mu,"pir-sensor":Nu,chime:dv,autotrack:Ys,nightvision:rl,"privacy-mask":tl,doorbell:bu},Hb={camera:Xs,hub:nl,nvr:nl,light:Su,siren:Aa,switch:Pv,sensor:Nu,thermostat:kv,button:qh,generic:sl};function jd(e){return e.role?Qb[e.role]??sl:Hb[e.type.toLowerCase()]??Xs}var $d={"native-snapshot":av,"two-way-audio":$u,"pan-tilt-zoom":Ys,"ptz-autotrack":cv,"doorbell-button":bu,"motion-trigger":zr,"battery-operated":hu,rebootable:Ou},kd={"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"},qb={"native-snapshot":"snapshot",rebootable:"reboot","pan-tilt-zoom":"ptz","ptz-autotrack":"ptz-autotrack","two-way-audio":"intercom","motion-trigger":"motion-trigger"},Pd=new Set(["camera","hub","nvr"]);function Nd(e){return!Pd.has(e.type.toLowerCase())}function Cd(e){return e.role?!0:!Pd.has(e.type.toLowerCase())}function Od(e){return(e.features??[]).includes("motion-trigger")}function Jb(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 Kb({trpc:e,accessoryChildren:i,adoptedChildren:a,onNavigate:o}){return(0,t.jsxs)("div",{className:"border-t border-border-subtle/50",children:[a.length>0&&(0,t.jsx)(Md,{trpc:e,label:"Adopted devices",rows:a,onNavigate:o}),i.length>0&&(0,t.jsx)(Md,{trpc:e,label:"Accessories",rows:i,onNavigate:o})]})}function Md({trpc:e,label:i,rows:a,onNavigate:o}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-3 pt-1.5 pb-1 text-[9px] font-semibold uppercase tracking-wide text-foreground-subtle",children:i}),(0,t.jsx)("ul",{children:a.map(l=>(0,t.jsx)(Xb,{trpc:e,child:l,onNavigate:o},l.id))})]})}function Xb({trpc:e,child:i,onNavigate:a}){const o=!i.disabled,l=o&&Nd(i),d=o&&Od(i);return(0,t.jsx)("li",{children:(0,t.jsxs)("div",{onClick:f=>{f.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,t.jsx)(jd(i),{className:"h-3 w-3 text-foreground-subtle flex-shrink-0"}),(0,t.jsx)("span",{className:"text-[10.5px] text-foreground flex-1 truncate",children:i.name}),d&&(0,t.jsx)(ey,{trpc:e,deviceId:i.id,features:i.features}),l&&(0,t.jsx)(Yb,{trpc:e,deviceId:i.id}),(0,t.jsx)("span",{className:N("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 Yb({trpc:e,deviceId:i}){const{dev:a,cap:o,slice:l,available:d}=$n({trpc:e,deviceId:i,cap:w=>w.switch,slice:w=>w.state.switch}),[f,p]=(0,n.useState)(!1);if(a!==null&&!o)return null;const g=l?.on===!0,h={transform:g?"translateX(14px)":"translateX(2px)"},b=async w=>{if(w.stopPropagation(),!(f||!d||!o)){p(!0);try{await o.setState({on:!g})}finally{p(!1)}}};return(0,t.jsx)("button",{type:"button",onClick:w=>{b(w)},disabled:f||!d,className:N("relative inline-flex h-4 w-7 items-center rounded-full border transition-colors flex-shrink-0",g?"bg-success/30 border-success/50":"bg-surface-hover border-border",f&&"opacity-60",!d&&"opacity-40 cursor-not-allowed"),title:d?g?"Turn off":"Turn on":"Awaiting state…","aria-pressed":g,children:(0,t.jsx)("span",{className:N("absolute h-3 w-3 rounded-full transition-all",g?"bg-success":"bg-foreground-subtle"),style:h})})}function ey({trpc:e,deviceId:i,features:a}){const{dev:o,cap:l,slice:d,available:f}=$n({trpc:e,deviceId:i,cap:w=>w.motionTrigger,slice:w=>w.state.motionTrigger,requireFeature:"motion-trigger",deviceFeatures:a}),[p,g]=(0,n.useState)(!1);if(o!==null&&!l)return null;const h=d?.enabled===!0,b=async w=>{if(w.stopPropagation(),!(p||!f||!l)){g(!0);try{await l.setMotionTrigger({enabled:!h})}finally{g(!1)}}};return(0,t.jsx)("button",{type:"button",onClick:w=>{b(w)},disabled:p||!f,className:N("inline-flex h-4 w-4 items-center justify-center rounded transition-colors flex-shrink-0",h?"text-primary bg-primary/10":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",(p||!f)&&"opacity-50"),title:f?h?"Motion-trigger: on (click to disable)":"Motion-trigger: off (click to enable)":"Awaiting state…","aria-pressed":h,children:(0,t.jsx)(zr,{className:"h-2.5 w-2.5"})})}var Ed={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 jl(e,i,a){const o=a?.defaultSpeed??.5,l=a?.pulseMs??250,d=a?.enabled??!0,f=Ur(e,d?i:null)?.ptz,[p,g]=(0,n.useState)([]),[h,b]=(0,n.useState)(null),[w,$]=(0,n.useState)(!1),[P,M]=(0,n.useState)(null),D=(0,n.useCallback)(async()=>{if(!(!d||!f))try{g(await f.getPresets({}))}catch(Z){if(B(Z))return;M(Z instanceof Error?Z.message:String(Z))}},[f,d]),z=(0,n.useCallback)(async()=>{if(!(!d||!f))try{b(await f.getOptions({}))}catch(Z){if(B(Z))return;M(Z instanceof Error?Z.message:String(Z))}},[f,d]);(0,n.useEffect)(()=>{D(),z()},[D,z]);const R=(0,n.useCallback)(async Z=>{if(!(!d||!f)){M(null),$(!0);try{return await Z()}catch(G){M(G instanceof Error?G.message:String(G));return}finally{$(!1)}}},[d,f]);return{move:(0,n.useCallback)(async(Z,G)=>{if(!f)return;const Q=Ed[Z],W=G??o;await R(async()=>{await f.move({pan:Q.pan,tilt:Q.tilt,speed:W}),await new Promise(X=>setTimeout(X,l)),await f.stop({})})},[f,o,l,R]),startContinuous:(0,n.useCallback)(async(Z,G)=>{if(!f)return;const Q=Ed[Z],W=G??o;await R(()=>f.continuousMove({pan:Q.pan,tilt:Q.tilt,speed:W}))},[f,o,R]),stopContinuous:(0,n.useCallback)(async()=>{f&&await R(()=>f.stop({}))},[f,R]),zoom:(0,n.useCallback)(async(Z,G)=>{if(!f)return;const Q=Z==="in"?1:-1,W=G??o;await R(async()=>{await f.move({zoom:Q,speed:W}),await new Promise(X=>setTimeout(X,l)),await f.stop({})})},[f,o,l,R]),goHome:(0,n.useCallback)(async()=>{f&&await R(()=>f.goHome({}))},[f,R]),goToPreset:(0,n.useCallback)(async Z=>{f&&await R(()=>f.goToPreset({presetId:Z}))},[f,R]),savePreset:(0,n.useCallback)(async Z=>{if(f)return R(async()=>{const G=new Set(p.map(X=>Number(X.id)).filter(X=>Number.isInteger(X)&&X>=0));let Q=0;for(;G.has(Q);)Q+=1;const W=String(Q);return await f.savePreset({presetId:W,name:Z}),await D(),W})},[f,p,D,R]),deletePreset:(0,n.useCallback)(async Z=>{f&&await R(async()=>{await f.deletePreset({presetId:Z}),await D()})},[f,D,R]),presets:p,refreshPresets:D,options:h,busy:w,error:P}}function Ua({direction:e,icon:i,disabled:a,className:o,variant:l,onMove:d,onStart:f,onStop:p}){const[g,h]=(0,n.useState)(null),[b,w]=(0,n.useState)(!1),$=(0,n.useCallback)(R=>{if(a)return;R.currentTarget.setPointerCapture(R.pointerId),h(Date.now()),w(!1);const Z=setTimeout(()=>{w(!0),f(e)},250);R.currentTarget.dataset.timer=String(Z)},[e,a,f]),P=(0,n.useCallback)(R=>{const Z=Number(R.currentTarget.dataset.timer);Z&&clearTimeout(Z),R.currentTarget.dataset.timer="",b?p():g!==null&&d(e),h(null),w(!1)},[b,e,d,p,g]),M=(0,n.useCallback)(R=>{const Z=Number(R.currentTarget.dataset.timer);Z&&clearTimeout(Z),R.currentTarget.dataset.timer="",b&&p(),h(null),w(!1)},[b,p]),D=l==="panel"?"h-9 w-9":"h-7 w-7",z=l==="panel"?"h-4 w-4":"h-3.5 w-3.5";return(0,t.jsx)("button",{type:"button",disabled:a,onPointerDown:$,onPointerUp:P,onPointerCancel:M,className:N("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",D,o),title:e,children:(0,t.jsx)(i,{className:z})})}function $l({controls:e,mode:i="overlay",showPresets:a,showZoom:o=!0,showHome:l=!0,className:d}){const{move:f,startContinuous:p,stopContinuous:g,zoom:h,goHome:b,goToPreset:w,savePreset:$,deletePreset:P,presets:M,options:D,busy:z,error:R}=e,Z=Hi(),[G,Q]=(0,n.useState)(!1),[W,X]=(0,n.useState)(""),he=(a??M.length>0)&&M.length>0,H=i==="panel",me=H&&(D?.supportsPresets??!1),ye=D?.maxPresets!==void 0&&M.length>=D.maxPresets,Qe=(0,n.useCallback)(async()=>{const ge=W.trim();!ge||z||ye||await $(ge)!==void 0&&X("")},[W,z,ye,$]),Ye=(0,n.useCallback)(async(ge,ve)=>{await Z({title:"Delete preset",message:`Delete PTZ preset "${ve}"? This removes it from the camera.`,confirmLabel:"Delete",variant:"danger"})&&await P(ge)},[Z,P]),Je=H?"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",Ae=N(H?"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",z&&"ring-1 ring-primary/40"),De=H?"h-9 w-9":"h-7 w-7",Re=H?"h-4 w-4":"h-3.5 w-3.5",Te=H?"text-foreground hover:bg-surface-hover":"text-white hover:bg-white/15",ue=H?"h-12 w-px bg-border mx-1":"h-12 w-px bg-white/15 mx-1";return(0,t.jsxs)("div",{className:N(Je,d),children:[R&&(0,t.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: ",R]}),(0,t.jsxs)("div",{className:N(Ae,H&&"justify-center"),children:[(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-0.5",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:H?"h-9 w-9":"h-7 w-7"}),(0,t.jsx)(Ua,{direction:"up",icon:Th,variant:i,onMove:f,onStart:p,onStop:g}),(0,t.jsx)("span",{"aria-hidden":!0,className:H?"h-9 w-9":"h-7 w-7"}),(0,t.jsx)(Ua,{direction:"left",icon:Dh,variant:i,onMove:f,onStart:p,onStop:g}),(0,t.jsx)("span",{"aria-hidden":!0,className:H?"h-9 w-9":"h-7 w-7"}),(0,t.jsx)(Ua,{direction:"right",icon:Ah,variant:i,onMove:f,onStart:p,onStop:g}),(0,t.jsx)("span",{"aria-hidden":!0,className:H?"h-9 w-9":"h-7 w-7"}),(0,t.jsx)(Ua,{direction:"down",icon:Ih,variant:i,onMove:f,onStart:p,onStop:g}),(0,t.jsx)("span",{"aria-hidden":!0,className:H?"h-9 w-9":"h-7 w-7"})]}),(o||l)&&(0,t.jsx)("div",{className:ue}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:()=>h("in"),disabled:z,title:"Zoom in",className:N("flex items-center justify-center rounded disabled:opacity-40",De,Te),children:(0,t.jsx)(Ev,{className:Re})}),(0,t.jsx)("button",{type:"button",onClick:()=>h("out"),disabled:z,title:"Zoom out",className:N("flex items-center justify-center rounded disabled:opacity-40",De,Te),children:(0,t.jsx)(Iv,{className:Re})})]}),l&&(0,t.jsx)("button",{type:"button",onClick:()=>b(),disabled:z,title:"Go home",className:N("flex items-center justify-center rounded disabled:opacity-40",De,Te),children:(0,t.jsx)(wu,{className:Re})})]}),he&&(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>Q(ge=>!ge),disabled:z,className:N("flex items-center gap-1 rounded px-2 text-[10px] disabled:opacity-40",H?"h-9 text-foreground hover:bg-surface-hover":"h-7 text-white hover:bg-white/15"),title:"Presets",children:["Presets",(0,t.jsx)(Tr,{className:N("h-3 w-3 transition-transform",G&&"rotate-180")})]}),G&&(0,t.jsx)("div",{className:N("absolute right-0 top-full mt-1 min-w-[140px] rounded-lg shadow-xl py-1 z-20",H?"bg-surface border border-border":"border border-white/30 bg-zinc-900/95 backdrop-blur-md"),children:M.map(ge=>(0,t.jsxs)("div",{className:N("group flex items-center",H?"hover:bg-surface-hover":"hover:bg-white/15"),children:[(0,t.jsx)("button",{type:"button",onClick:()=>{w(ge.id),Q(!1)},disabled:z,className:N("flex-1 px-3 py-1.5 text-left text-[10px] disabled:opacity-40",H?"text-foreground":"text-white"),children:ge.name||ge.id}),me&&(0,t.jsx)("button",{type:"button",onClick:()=>void Ye(ge.id,ge.name||ge.id),disabled:z,title:`Delete preset ${ge.name||ge.id}`,className:N("mr-1 flex h-5 w-5 shrink-0 items-center justify-center rounded","text-foreground-subtle hover:bg-danger/15 hover:text-danger disabled:opacity-40"),children:(0,t.jsx)(Mt,{className:"h-3 w-3"})})]},ge.id))})]})]}),me&&(0,t.jsxs)("div",{className:"flex flex-col gap-1 rounded-lg border border-border p-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"text",value:W,onChange:ge=>X(ge.target.value),onKeyDown:ge=>{ge.key==="Enter"&&Qe()},disabled:z||ye,placeholder:"New preset name",maxLength:64,className:N("min-w-0 flex-1 rounded border border-border bg-surface px-2 py-1 text-[11px] text-foreground","placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary/50","disabled:opacity-40")}),(0,t.jsxs)("button",{type:"button",onClick:()=>void Qe(),disabled:z||ye||W.trim().length===0,title:ye?`Camera preset limit reached (${D?.maxPresets})`:"Save current position as a new preset",className:N("flex h-7 shrink-0 items-center gap-1 rounded px-2 text-[10px] font-medium","bg-primary/15 text-primary hover:bg-primary/25 disabled:opacity-40"),children:[(0,t.jsx)(Sn,{className:"h-3 w-3"}),"Save current position"]})]}),ye&&(0,t.jsxs)("span",{className:"text-[10px] text-foreground-subtle",children:["Camera preset limit reached (",D?.maxPresets,"). Delete a preset to add a new one."]})]})]})}function Id({trpc:e,device:i,flags:a}){if(i.disabled)return null;const o=a.showSwitchToggle&&Nd(i),l=Od(i),d=(i.features??[]).includes("rebootable"),f=(i.features??[]).includes("pan-tilt-zoom");return(0,t.jsxs)(t.Fragment,{children:[l&&(0,t.jsx)(ry,{trpc:e,deviceId:i.id,features:i.features}),o&&(0,t.jsx)(ty,{trpc:e,deviceId:i.id}),f&&(0,t.jsx)(ay,{trpc:e,deviceId:i.id}),d&&(0,t.jsx)(ny,{trpc:e,deviceId:i.id})]})}function ty({trpc:e,deviceId:i}){const{dev:a,cap:o,slice:l,available:d}=$n({trpc:e,deviceId:i,cap:w=>w.switch,slice:w=>w.state.switch}),[f,p]=(0,n.useState)(!1);if(a!==null&&!o)return null;const g=l?.on===!0,h={transform:g?"translateX(14px)":"translateX(2px)"},b=async w=>{if(w.stopPropagation(),!(f||!d||!o)){p(!0);try{await o.setState({on:!g})}finally{p(!1)}}};return(0,t.jsx)("button",{type:"button",onClick:w=>{b(w)},disabled:f||!d,className:N("relative inline-flex h-4 w-7 items-center rounded-full border transition-colors flex-shrink-0",g?"bg-success/30 border-success/50":"bg-surface-hover border-border",f&&"opacity-60",!d&&"opacity-40 cursor-not-allowed"),title:d?g?"Turn off":"Turn on":"Awaiting state…","aria-pressed":g,children:(0,t.jsx)("span",{className:N("absolute h-3 w-3 rounded-full transition-all",g?"bg-success":"bg-foreground-subtle"),style:h})})}function ry({trpc:e,deviceId:i,features:a}){const{dev:o,cap:l,slice:d,available:f}=$n({trpc:e,deviceId:i,cap:w=>w.motionTrigger,slice:w=>w.state.motionTrigger,requireFeature:"motion-trigger",deviceFeatures:a}),[p,g]=(0,n.useState)(!1);if(o!==null&&!l)return null;const h=d?.enabled===!0,b=async w=>{if(w.stopPropagation(),!(p||!f||!l)){g(!0);try{await l.setMotionTrigger({enabled:!h})}finally{g(!1)}}};return(0,t.jsx)("button",{type:"button",onClick:w=>{b(w)},disabled:p||!f,className:N("inline-flex h-4 w-4 items-center justify-center rounded transition-colors flex-shrink-0",h?"text-primary bg-primary/10":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",(p||!f)&&"opacity-50"),title:f?h?"Motion-trigger: on (click to disable)":"Motion-trigger: off (click to enable)":"Awaiting state…","aria-pressed":h,children:(0,t.jsx)(zr,{className:"h-2.5 w-2.5"})})}var kl=168,Dd=4;function ny({trpc:e,deviceId:i}){const{dev:a,cap:o}=$n({trpc:e,deviceId:i,cap:z=>z.reboot,slice:()=>{}}),l=(0,n.useRef)(null),d=(0,n.useRef)(null),[f,p]=(0,n.useState)(null),[g,h]=(0,n.useState)(!1),b=a!==null&&o!==void 0&&o!==null,w=f!==null,$=()=>p(null),P=()=>{const z=l.current;if(!z)return;const R=z.getBoundingClientRect(),Z=R.right-kl,G=Math.max(8,Math.min(Z,window.innerWidth-kl-8));p({top:R.bottom+Dd,left:G})};if((0,n.useEffect)(()=>{if(!w)return;const z=Z=>{const G=l.current,Q=d.current,W=Z.target;W!==null&&(G&&G.contains(W)||Q&&Q.contains(W)||$())},R=Z=>{Z.key==="Escape"&&(Z.stopPropagation(),$())};return document.addEventListener("mousedown",z),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",z),document.removeEventListener("keydown",R)}},[w]),a!==null&&!o)return null;const M=z=>{z.stopPropagation(),w?$():P()},D=async()=>{if(!(g||!b||!o)){h(!0),$();try{await o.reboot({})}finally{h(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{ref:l,type:"button",onClick:M,disabled:g||!b,className:N("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",(g||!b)&&"opacity-50",w&&"bg-surface-hover text-foreground"),title:"More actions","aria-label":"More actions","aria-haspopup":"menu","aria-expanded":w,children:(0,t.jsx)(yu,{className:"h-3 w-3"})}),f&&(0,x.createPortal)((0,t.jsx)("div",{ref:d,role:"menu",style:{position:"fixed",top:f.top,left:f.left,width:kl},className:"z-[9999] rounded-md border border-border bg-surface shadow-lg shadow-black/30 p-1",onClick:z=>z.stopPropagation(),children:(0,t.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>{D()},disabled:g||!b,className:N("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,t.jsx)(Ou,{className:"h-3 w-3 shrink-0 text-foreground-subtle"}),(0,t.jsx)("span",{children:"Reboot device"})]})}),document.body)]})}var iy=300;function ay({trpc:e,deviceId:i}){const a=(0,n.useRef)(null),o=(0,n.useRef)(null),[l,d]=(0,n.useState)(null),f=l!==null,p=jl(e,i,{enabled:f}),g=()=>d(null),h=()=>{const w=a.current;if(!w)return;const $=w.getBoundingClientRect(),P=8,M=Math.min(iy,window.innerWidth-P*2),D=Math.max(P,Math.min($.right-M,window.innerWidth-M-P)),z=$.bottom+Dd;d({top:z,left:D,width:M,maxHeight:Math.max(160,window.innerHeight-z-P)})};(0,n.useEffect)(()=>{if(!f)return;const w=P=>{const M=a.current,D=o.current,z=P.target;z!==null&&(M&&M.contains(z)||D&&D.contains(z)||g())},$=P=>{P.key==="Escape"&&(P.stopPropagation(),g())};return document.addEventListener("mousedown",w),document.addEventListener("touchstart",w),document.addEventListener("keydown",$),()=>{document.removeEventListener("mousedown",w),document.removeEventListener("touchstart",w),document.removeEventListener("keydown",$)}},[f]);const b=w=>{w.stopPropagation(),f?g():h()};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{ref:a,type:"button",onClick:b,className:N("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",f&&"bg-surface-hover text-foreground"),title:"PTZ controls","aria-label":"PTZ controls","aria-haspopup":"dialog","aria-expanded":f,children:(0,t.jsx)(rv,{className:"h-3 w-3"})}),l&&(0,x.createPortal)((0,t.jsx)("div",{ref:o,style:{position:"fixed",top:l.top,left:l.left,width:l.width,maxHeight:l.maxHeight},className:"z-[9999] overflow-y-auto rounded-lg border border-border bg-surface shadow-lg shadow-black/30",onClick:w=>w.stopPropagation(),children:(0,t.jsx)($l,{mode:"panel",controls:p})}),document.body)]})}var oy=Object.freeze([]);function sy(e){return e==="native"?"native":"enhanced"}function ly(e){return e.map(i=>({kind:"marker",feature:i}))}function cy(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 f=qb[d];if(f===void 0){l.push({kind:"marker",feature:d});continue}const p=a.get(f);p&&l.push({kind:sy(p.kind),feature:d,capName:f})}return l}function uy(e,i,a){const[o,l]=(0,n.useState)(null),[d,f]=(0,n.useState)(!1),[p,g]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{if(i===null){l(null),f(!1),g(!1);return}let h=!1;g(!0),f(!1);const b=async()=>{try{const $=await e.deviceManager.getBindings.query({deviceId:i});if(h)return;l($),g(!1)}catch{if(h)return;f(!0),g(!1)}};b();const w=e.live?.onEvent.subscribe({category:"capability.binding-changed"},{onData:$=>{const P=$.data?.source;if(!P){b();return}P.type==="device"&&P.id===i&&b()}});return()=>{h=!0,w?.unsubscribe()}},[e,i]),a.length===0?{loading:p,resolved:oy}:p||d||!o?{loading:p,resolved:ly(a)}:{loading:!1,resolved:cy(a,o)}}var dy=[];function Ad({trpc:e,device:i,flags:a,accessoryCount:o,adoptedCount:l,showFeatureRow:d=!1}){const f=o+l,p=a.showChildrenAccordion&&f>0,g=i.features??dy,h=d&&g.length>0,{resolved:b}=uy(e,h?i.id:null,g),w=h&&b.length>0;return!p&&!w?null:(0,t.jsxs)("div",{className:"flex items-center gap-1.5 flex-nowrap whitespace-nowrap min-w-0",children:[p&&(0,t.jsx)(fy,{accessoryCount:o,adoptedCount:l}),w&&(0,t.jsx)(my,{resolved:b})]})}function fy({accessoryCount:e,adoptedCount:i}){const a=e+i;return a===0?null:(0,t.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 zd=240,Td=200;function my({resolved:e}){const i=(0,n.useRef)(null),[a,o]=(0,n.useState)(null),l=()=>{const f=i.current;if(!f)return;const p=f.getBoundingClientRect();o({top:window.innerHeight-p.bottom>=Td?p.bottom+4:p.top-Td-4,left:Math.max(8,Math.min(p.left,window.innerWidth-zd-8))})},d=()=>o(null);return(0,t.jsxs)("span",{ref:i,className:"relative inline-flex items-center gap-1 cursor-help",onMouseEnter:l,onMouseLeave:d,children:[e.map(f=>{const p=$d[f.feature];return p?(0,t.jsx)("span",{className:"inline-flex items-center justify-center h-4 w-4 rounded bg-surface-elevated/60 text-foreground-subtle",title:kd[f.feature]??f.feature,children:(0,t.jsx)(p,{className:"h-2.5 w-2.5"})},f.feature):null}),a&&(0,x.createPortal)((0,t.jsx)(gy,{resolved:e,position:a}),document.body)]})}function gy({resolved:e,position:i}){return(0,t.jsxs)("div",{style:{position:"fixed",top:i.top,left:i.left,width:zd,pointerEvents:"none"},className:"z-[9999] rounded-md border border-border bg-surface shadow-lg shadow-black/30 p-2",children:[(0,t.jsx)("h5",{className:"text-[9px] font-semibold uppercase tracking-wider text-foreground-subtle mb-1.5",children:"Features"}),(0,t.jsx)("ul",{className:"space-y-0.5",children:e.map(a=>(0,t.jsx)(py,{entry:a},a.feature))})]})}function py({entry:e}){const i=$d[e.feature],a=kd[e.feature]??e.feature;return(0,t.jsxs)("li",{className:"flex items-center justify-between gap-2 text-[10px]",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-foreground",children:[i&&(0,t.jsx)(i,{className:"h-3 w-3 text-foreground-subtle"}),(0,t.jsx)("span",{children:a})]}),(0,t.jsx)(hy,{kind:e.kind})]})}function hy({kind:e}){return e==="marker"?(0,t.jsx)("span",{className:"text-[8.5px] px-1 rounded text-foreground-subtle",title:"Informational marker (no cap registered)",children:"marker"}):(0,t.jsx)("span",{className:N("text-[8.5px] px-1 rounded",e==="native"?"bg-success/15 text-success":"bg-primary/15 text-primary"),children:e})}function Rd({device:e,variant:i,flags:a,parent:o,integrationIcon:l,hasChildren:d,expanded:f,onToggleExpand:p,onNavigateToParent:g}){const h=jd(e);return(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[a.showChildrenAccordion&&d?(0,t.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),p()},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":f?"Collapse children":"Expand children","aria-expanded":f,children:f?(0,t.jsx)(Tr,{className:"h-3 w-3"}):(0,t.jsx)(Rr,{className:"h-3 w-3"})}):a.showChildrenAccordion?(0,t.jsx)("span",{className:"h-3.5 w-3.5 flex-shrink-0"}):null,(0,t.jsx)(h,{className:N("text-foreground-subtle flex-shrink-0",i==="minimal"?"h-3 w-3":"h-3.5 w-3.5")}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.showIntegrationIcon&&l&&(0,t.jsx)("span",{className:"flex-shrink-0",children:l}),(0,t.jsx)("span",{className:N("font-semibold text-foreground truncate",i==="minimal"?"text-[10.5px]":"text-[11px]"),title:e.name,children:e.name})]}),(a.showId||a.showStableId)&&(0,t.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,t.jsxs)("span",{className:"flex-shrink-0 tabular-nums",children:["#",String(e.id)]}),a.showId&&a.showStableId&&(0,t.jsx)("span",{className:"flex-shrink-0 opacity-50",children:"·"}),a.showStableId&&(0,t.jsx)("span",{className:"truncate",children:Jb(e.stableId)})]}),a.showParentBadge&&o&&(0,t.jsxs)("button",{type:"button",onClick:b=>{b.stopPropagation(),g(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,t.jsx)(nl,{className:"h-2.5 w-2.5 shrink-0"}),(0,t.jsxs)("span",{className:"truncate",children:["Under: ",o.name]})]})]})]})}function Ld(e,i){return Sd(e,i,a=>a.battery)??null}function Zd(e,i){const a=Ur(e,i),o=(0,n.useRef)(!1),{data:l,isLoading:d,isFetching:f,refetch:p}=(0,te.useQuery)({queryKey:["device",i,"snapshot"],queryFn:()=>{if(!a)throw new Error("useDeviceSnapshotImage: device proxy not ready");const b=o.current;return o.current=!1,a.snapshot?.getSnapshot({force:b})??null},enabled:a!==null&&i!==null,staleTime:1e4,gcTime:1440*60*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1}),g=l?`data:${l.contentType};base64,${l.base64}`:null;function h(){o.current=!0,p()}return{src:g,loading:d||f,refresh:h}}function vy(e){return e<=10?Zh:e<=30?Lh:e>=95?Rh:hu}function by(e,i){return i!=="none"?"text-emerald-400":e<=10?"text-rose-400":e<=30?"text-amber-400":"text-foreground-subtle"}function Ud({status:e,variant:i="compact",className:a}){if(!e)return null;const o=vy(e.percentage),l=by(e.percentage,e.charging),d=e.charging==="solar"?Mu:e.charging==="dc"?mv:null,f=e.sleeping;return(0,t.jsxs)("span",{className:N("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,t.jsx)(o,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{children:[Math.round(e.percentage),"%"]}),d&&(0,t.jsx)(d,{className:"h-3 w-3"}),f&&(0,t.jsx)(rl,{className:"h-3 w-3 text-blue-300"}),i==="full"&&e.charging!=="none"&&(0,t.jsx)("span",{className:"text-foreground-subtle",children:e.charging})]})}function Bd({trpc:e,device:i,status:a,enabled:o,showStatusPills:l=!1}){const d=Zd(e,o&&i.online?i.id:null),f=(i.features??[]).includes("battery-operated"),p=l&&f&&!i.disabled,g=Ld(e,p?i.id:null);return!o&&!p?null:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 flex-nowrap whitespace-nowrap",children:[p&&g&&(0,t.jsx)(Ud,{status:g}),o&&(0,t.jsx)(yy,{deviceName:i.name,snapshotUrl:d.src,status:a})]})}var Pl=288,Fd=196,Nl=8;function yy({deviceName:e,snapshotUrl:i,status:a}){const o=(0,n.useRef)(null),[l,d]=(0,n.useState)(null),f=a==="offline"||a==="disabled",p=()=>{const h=o.current;if(!h)return;const b=h.getBoundingClientRect(),w=b.top,$=window.innerHeight-b.bottom,P=w<Fd+Nl&&$>w,M=P?b.bottom+Nl:b.top-Fd-Nl,D=b.right-Pl;d({top:M,left:Math.max(8,Math.min(D,window.innerWidth-Pl-8)),placeBelow:P})},g=()=>d(null);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{ref:o,type:"button",onClick:h=>h.stopPropagation(),onMouseEnter:p,onMouseLeave:g,onFocus:p,onBlur:g,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,t.jsx)(wn,{className:"h-3.5 w-3.5"})}),l&&(0,x.createPortal)((0,t.jsxs)("div",{style:{position:"fixed",top:l.top,left:l.left,width:Pl,pointerEvents:"none"},className:"rounded-lg border border-border bg-surface shadow-lg shadow-black/30 z-[9999] overflow-hidden",children:[(0,t.jsx)("div",{className:"h-40 bg-background flex items-center justify-center",children:i&&!f?(0,t.jsx)("img",{src:i,alt:e,className:"h-full w-full object-cover"}):(0,t.jsx)("span",{className:"text-xs text-foreground-subtle",children:a==="offline"?"Offline — no snapshot":a==="disabled"?"Disabled":"No snapshot yet"})}),(0,t.jsx)("div",{className:"px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs font-semibold text-foreground truncate",children:e})})]}),document.body)]})}function Gd({status:e}){const i=e==="disabled"?"bg-warning":e==="online"?"bg-success":"bg-danger",a=e==="disabled"?"Disabled":e==="online"?"Online":"Offline";return(0,t.jsx)("span",{className:N("h-1.5 w-1.5 rounded-full flex-shrink-0",i),title:a})}function Ba(e){const{trpc:i,device:a,parent:o,integrationIcon:l,onNavigate:d,className:f,renderRowAction:p}=e,g=Wb(e),h=e.variant??"compact",b=e.view??"card",w=!a.disabled,$=a.isCamera??a.type.toLowerCase()==="camera",P=e.children??[],M=P.filter(Cd),D=P.filter(H=>!Cd(H)),z=P.length>0,[R,Z]=(0,n.useState)(!1),G=e.expanded??R,Q=e.onToggleExpand??(()=>Z(H=>!H)),W=H=>{d?.(H)},X=e.indentLevel??(e.isAccessoryRow?2:0),he=w?a.online?"online":"offline":"disabled";return b==="table"?(0,t.jsx)(_y,{trpc:i,device:a,variant:h,flags:g,parent:o??null,integrationIcon:l??null,accessoryCount:M.length,adoptedCount:D.length,hasChildren:z,expanded:G,onToggleExpand:Q,onNavigate:W,displayStatus:he,isCamera:$,showSnapshot:g.showSnapshot&&$,isAccessoryRow:e.isAccessoryRow??!1,indentLevel:X,className:f,renderRowAction:p??null}):(0,t.jsxs)("div",{className:N("rounded-lg border border-border bg-surface transition-colors",!w&&"opacity-60",f),children:[(0,t.jsxs)("div",{onClick:()=>W(a.id),className:N("flex items-center gap-2 cursor-pointer hover:border-foreground-subtle/30 w-full",h==="minimal"?"px-2.5 py-1.5":"px-3 py-2.5"),children:[(0,t.jsx)(Rd,{device:a,variant:h,flags:g,parent:o??null,integrationIcon:l??null,hasChildren:z,expanded:G,onToggleExpand:Q,onNavigateToParent:W}),(0,t.jsx)(Ad,{trpc:i,device:a,flags:g,accessoryCount:M.length,adoptedCount:D.length,showFeatureRow:!1}),(0,t.jsx)(Bd,{trpc:i,device:a,status:he,enabled:g.showSnapshot&&$,showStatusPills:!0}),(0,t.jsx)(Id,{trpc:i,device:a,flags:g}),p&&(0,t.jsx)("span",{onClick:H=>H.stopPropagation(),children:p(a)}),(0,t.jsx)(Gd,{status:he})]}),G&&z&&(0,t.jsx)(Kb,{trpc:i,accessoryChildren:M,adoptedChildren:D,onNavigate:W})]})}var xy={0:"pl-2",1:"pl-6",2:"pl-8"};function _y(e){const{trpc:i,device:a,variant:o,flags:l,parent:d,integrationIcon:f,accessoryCount:p,adoptedCount:g,hasChildren:h,expanded:b,onToggleExpand:w,onNavigate:$,displayStatus:P,isCamera:M,showSnapshot:D,isAccessoryRow:z,indentLevel:R,className:Z,renderRowAction:G}=e;return(0,t.jsxs)("tr",{onClick:()=>$(a.id),className:N("cursor-pointer hover:bg-surface-hover transition-colors",!l.showChildrenAccordion&&"border-b border-border-subtle/40",z&&"bg-foreground-subtle/[0.03]",Z),children:[(0,t.jsx)("td",{className:N("py-2 align-middle pr-2",xy[R]),children:(0,t.jsx)(Rd,{device:a,variant:o,flags:l,parent:d,integrationIcon:f,hasChildren:h,expanded:b,onToggleExpand:w,onNavigateToParent:$})}),(0,t.jsx)("td",{className:"hidden md:table-cell px-2 py-2 align-middle text-[10px] text-foreground-subtle whitespace-nowrap",children:a.type}),(0,t.jsx)("td",{className:"hidden lg:table-cell px-2 py-2 align-middle",children:(0,t.jsx)(Ad,{trpc:i,device:a,flags:l,accessoryCount:p,adoptedCount:g,showFeatureRow:!0})}),(0,t.jsx)("td",{className:"hidden sm:table-cell px-2 py-2 align-middle",children:(0,t.jsx)(Bd,{trpc:i,device:a,status:P,enabled:D&&M,showStatusPills:!0})}),(0,t.jsx)("td",{className:"px-2 py-2 align-middle text-right whitespace-nowrap",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(Id,{trpc:i,device:a,flags:l}),G&&(0,t.jsx)("span",{onClick:Q=>Q.stopPropagation(),children:G(a)}),(0,t.jsx)(Gd,{status:P})]})})]})}function Vd(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 wy=new Set(["hub","nvr"]);function Sy(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 f=i.get(d);if(!f){a.push(l);continue}const p=l.role!==null&&l.role!==void 0;if(wy.has(f.type)&&!p){a.push(l);continue}const g=o.get(d);g?g.push(l):o.set(d,[l])}return{topLevel:a,accessoriesByParent:o}}var Wd=2;function jy(e,i){if(i<=1)return[{kind:"page",n:1}];if(i<=7){const d=[];for(let f=1;f<=i;f++)d.push({kind:"page",n:f});return d}const a=[],o=Math.max(2,e-Wd),l=Math.min(i-1,e+Wd);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 $y({currentPage:e,totalItems:i,pageSize:a,onPageChange:o,itemNoun:l="devices"}){if(i<=a)return null;const d=Math.ceil(i/a),f=(e-1)*a+1,p=Math.min(e*a,i),g=jy(e,d);return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 flex-wrap pt-2 text-[11px] text-foreground-subtle",children:[(0,t.jsxs)("span",{children:["Showing ",f,"–",p," of ",i," ",l]}),(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button","aria-label":"Previous page",disabled:e===1,onClick:()=>o(e-1),className:N("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,t.jsx)(Gh,{className:"h-3 w-3"})}),g.map((h,b)=>h.kind==="ellipsis"?(0,t.jsx)("span",{className:"px-1 text-foreground-subtle/60 select-none",children:"…"},`e-${b}`):(0,t.jsx)("button",{type:"button",onClick:()=>o(h.n),className:N("inline-flex items-center justify-center h-7 min-w-7 px-1.5 rounded border text-[10.5px] font-medium transition-colors",h.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:h.n},`p-${h.n}`)),(0,t.jsx)("button",{type:"button","aria-label":"Next page",disabled:e===d,onClick:()=>o(e+1),className:N("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,t.jsx)(Rr,{className:"h-3 w-3"})})]})]})}function ky({view:e,onViewChange:i,types:a,currentType:o,onTypeChange:l,addons:d,selectedAddons:f,onAddonsChange:p,hideAddons:g=!1}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsxs)("span",{className:"inline-flex border border-border rounded-md overflow-hidden",children:[(0,t.jsx)("button",{type:"button",onClick:()=>i("cards"),className:N("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,t.jsx)(lv,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:()=>i("table"),className:N("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,t.jsx)($v,{className:"h-3.5 w-3.5"})})]}),a&&a.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Ny,{children:"Type"}),(0,t.jsx)(Qd,{active:o===null,onClick:()=>l(null),children:"All"}),a.map(h=>(0,t.jsx)(Qd,{active:o===h,onClick:()=>l(o===h?null:h),children:Cy(h)},h))]}),!g&&d&&d.length>0&&(0,t.jsx)(Py,{addons:d,selected:f,onChange:p})]})}function Py({addons:e,selected:i,onChange:a}){const[o,l]=(0,n.useState)(!1),d=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!o)return;const h=w=>{const $=w.target;$&&d.current&&!d.current.contains($)&&l(!1)},b=w=>{w.key==="Escape"&&l(!1)};return document.addEventListener("mousedown",h),document.addEventListener("touchstart",h),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("touchstart",h),document.removeEventListener("keydown",b)}},[o]);const f=new Set(i),p=i.length,g=h=>{const b=new Set(f);b.has(h)?b.delete(h):b.add(h),a(e.filter(w=>b.has(w.id)).map(w=>w.id))};return(0,t.jsxs)("div",{ref:d,className:"relative",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(h=>!h),className:N("inline-flex items-center gap-1.5 h-7 px-2.5 rounded-full border text-[10.5px] font-medium transition-colors",p>0?"border-primary/40 bg-primary/15 text-primary":"border-border bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover"),"aria-haspopup":"listbox","aria-expanded":o,children:[(0,t.jsxs)("span",{children:["Integration",p>0?` · ${String(p)}`:""]}),(0,t.jsx)(Tr,{className:N("h-3 w-3 transition-transform",o&&"rotate-180")})]}),o&&(0,t.jsxs)("div",{role:"listbox",className:"absolute left-0 top-full mt-1 z-30 min-w-[180px] max-h-72 overflow-y-auto rounded-lg border border-border bg-surface shadow-xl py-1",children:[p>0&&(0,t.jsx)("button",{type:"button",onClick:()=>a([]),className:"flex w-full items-center px-3 py-1.5 text-left text-[10.5px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground",children:"Clear selection"}),e.map(h=>{const b=f.has(h.id);return(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":b,onClick:()=>g(h.id),className:N("flex w-full items-center gap-2 px-3 py-1.5 text-left text-[10.5px] transition-colors",b?"text-primary":"text-foreground hover:bg-surface-hover"),children:[(0,t.jsx)("span",{className:N("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border",b?"border-primary bg-primary/20":"border-border"),children:b&&(0,t.jsx)(xn,{className:"h-2.5 w-2.5"})}),h.icon&&(0,t.jsx)("span",{className:"inline-flex items-center",children:h.icon}),(0,t.jsx)("span",{className:"truncate",children:h.name})]},h.id)})]})]})}function Ny({children:e}){return(0,t.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wider text-foreground-subtle ml-1",children:e})}function Qd({active:e,icon:i,onClick:a,children:o}){return(0,t.jsxs)("button",{type:"button",onClick:a,className:N("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,t.jsx)("span",{className:"inline-flex items-center",children:i}),(0,t.jsx)("span",{children:o})]})}function Cy(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function Oy({variant:e,onClearFilters:i}){return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,t.jsx)(ov,{className:"h-8 w-8 text-foreground-subtle/40 mb-3"}),(0,t.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,t.jsx)("button",{type:"button",onClick:i,className:"mt-2 text-[11px] text-primary hover:underline",children:"Clear filters"})]})}function My(e){return e?e.split(",").map(i=>i.trim()).filter(i=>i.length>0):[]}function vr(e,i){if(e==="root")return i==="addons"?"addon":i;switch(i){case"view":return"deviceView";case"page":return"devicePage";case"type":return"deviceType";case"q":return"deviceQ";case"addons":return"deviceAddon"}}function Hd(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 Ey(e,i){try{localStorage.setItem(`camstack:${e}:lastFilters`,JSON.stringify(i))}catch{}}function qd(e,i,a){const o=new URLSearchParams(window.location.search),l=o.get(vr(e,"view")),d=l==="cards"||l==="table"?l:a.view??i,f=o.get(vr(e,"page")),p=f?parseInt(f,10):1;return{view:d,page:Number.isFinite(p)&&p>=1?p:1,addons:My(o.get(vr(e,"addons"))??a.addon??null),type:o.get(vr(e,"type"))??a.type??null,q:o.get(vr(e,"q"))??a.q??""}}function Iy(e,i,a){const o=new URLSearchParams(window.location.search),l=(p,g)=>{g===null||g===""?o.delete(p):o.set(p,g)};l(vr(e,"view"),i.view===a?null:i.view),l(vr(e,"page"),i.page===1?null:String(i.page)),l(vr(e,"addons"),i.addons.length>0?i.addons.join(","):null),l(vr(e,"type"),i.type),l(vr(e,"q"),i.q||null);const d=o.toString(),f=d?`${window.location.pathname}?${d}`:window.location.pathname;window.history.replaceState(null,"",f)}function Dy(e){const{scope:i,defaultView:a,lsKey:o}=e,[l,d]=(0,n.useState)(()=>qd(i,a,Hd(o))),f=(0,n.useRef)(l);f.current=l,(0,n.useEffect)(()=>{const g=()=>{const h=qd(i,a,Hd(o));f.current=h,d(h)};return window.addEventListener("popstate",g),()=>window.removeEventListener("popstate",g)},[i,a,o]);const p=(0,n.useCallback)(g=>{const h=g(f.current);f.current=h,d(h),Iy(i,h,a),Ey(o,{view:h.view,addon:h.addons.length>0?h.addons.join(","):null,type:h.type,q:h.q})},[i,a,o]);return{state:l,setView:(0,n.useCallback)(g=>p(h=>({...h,view:g})),[p]),setPage:(0,n.useCallback)(g=>p(h=>({...h,page:g})),[p]),setAddons:(0,n.useCallback)(g=>p(h=>({...h,addons:g,page:1})),[p]),setType:(0,n.useCallback)(g=>p(h=>({...h,type:g,page:1})),[p]),setQ:(0,n.useCallback)(g=>p(h=>({...h,q:g,page:1})),[p]),clearFilters:(0,n.useCallback)(()=>p(g=>({...g,addons:[],type:null,q:"",page:1})),[p])}}var Ay={cards:24,table:50};function Jd(e){const{devices:i,trpc:a,defaultView:o="table",filters:l,forceAddon:d,resolveIntegrationIcon:f,resolveParent:p,onNavigate:g,pageSize:h=Ay,urlScope:b="root",lsKey:w=b==="root"?"devices":"integrations:nested",renderRowAction:$}=e,P=Dy({scope:b,defaultView:o,lsKey:w}),M=P.state.view,D=M==="cards"?h.cards:h.table,[z,R]=(0,n.useState)(P.state.q),Z=Vd(z,300);(0,n.useEffect)(()=>{Z!==P.state.q&&P.setQ(Z)},[Z]);const G=(0,n.useMemo)(()=>d!==void 0?[d]:P.state.addons,[d,P.state.addons]),Q=(0,n.useMemo)(()=>{const Ae=P.state.q.toLowerCase().trim(),De=G.length>0?new Set(G):null;return i.filter(Re=>!(De&&!De.has(Re.addonId)||P.state.type&&Re.type!==P.state.type||Ae&&!Re.name.toLowerCase().includes(Ae)&&!Re.stableId.toLowerCase().includes(Ae)))},[i,G,P.state.type,P.state.q]),W=(0,n.useMemo)(()=>Sy(Q),[Q]),X=(0,n.useMemo)(()=>{if(P.state.q.trim()==="")return new Set;const Ae=P.state.q.toLowerCase().trim(),De=new Set;for(const[Re,Te]of W.accessoriesByParent.entries())Te.some(ue=>ue.name.toLowerCase().includes(Ae)||ue.stableId.toLowerCase().includes(Ae))&&De.add(Re);return De},[W.accessoriesByParent,P.state.q]),he=W.topLevel.length,H=Math.max(1,Math.ceil(he/D)),me=Math.min(P.state.page,H),ye=(me-1)*D,Qe=W.topLevel.slice(ye,ye+D);(0,n.useEffect)(()=>{me!==P.state.page&&P.setPage(me)},[me]),Uy();const Ye=G.length>0||P.state.type!==null||P.state.q!=="",Je=he===0;return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[(0,t.jsx)(ky,{view:M,onViewChange:P.setView,types:l?.types,currentType:P.state.type,onTypeChange:P.setType,addons:l?.addons,selectedAddons:P.state.addons,onAddonsChange:P.setAddons,hideAddons:d!==void 0}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(Gi,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-foreground-subtle pointer-events-none"}),(0,t.jsx)("input",{type:"text",value:z,onChange:Ae=>R(Ae.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"})]})]}),Je?(0,t.jsx)(Oy,{variant:Ye?"filtered":"nofilter",onClearFilters:Ye?P.clearFilters:void 0}):M==="cards"?(0,t.jsx)(zy,{rows:Qe,accessoriesByParent:W.accessoriesByParent,trpc:a,resolveIntegrationIcon:f??null,resolveParent:p??null,onNavigate:g??null,renderRowAction:$??null}):(0,t.jsx)(Ly,{rows:Qe,accessoriesByParent:W.accessoriesByParent,autoExpandedParents:X,devices:Q,trpc:a,resolveIntegrationIcon:f??null,resolveParent:p??null,onNavigate:g??null,renderRowAction:$??null}),(0,t.jsx)($y,{currentPage:me,totalItems:he,pageSize:D,onPageChange:P.setPage}),d===void 0&&Ye&&he>0&&(0,t.jsxs)("p",{className:"text-[11px] text-foreground-subtle",children:["Showing ",he," of ",i.length," devices",G.length>0&&(0,t.jsxs)(t.Fragment,{children:[" ","· filtered by"," ",(0,t.jsx)("strong",{className:"text-primary",children:G.map(Ae=>l?.addons?.find(De=>De.id===Ae)?.name??Ae).join(", ")})]})]})]})}function zy({rows:e,accessoriesByParent:i,trpc:a,resolveIntegrationIcon:o,resolveParent:l,onNavigate:d,renderRowAction:f}){return(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.map(p=>{const g=i.get(p.id)??[];return(0,t.jsx)(Ba,{trpc:a,device:p,view:"card",integrationIcon:o?.(p.addonId)??null,parent:p.parentDeviceId!==null?l?.(p.parentDeviceId)??null:null,children:g,onNavigate:d??void 0,renderRowAction:f??void 0},p.id)})})}var Ty=new Set(["hub","nvr"]);function Ry(e,i){return e.parentDeviceId===null||i===null?0:Ty.has(i.toLowerCase())?1:0}function Ly({rows:e,accessoriesByParent:i,autoExpandedParents:a,devices:o,trpc:l,resolveIntegrationIcon:d,resolveParent:f,onNavigate:p,renderRowAction:g}){const h=(0,n.useMemo)(()=>{const b=new Map;for(const w of o)b.set(w.id,w.type);return b},[o]);return(0,t.jsx)("div",{className:"rounded-lg border border-border bg-surface overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full border-collapse",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-border",children:[(0,t.jsx)("th",{className:"text-left px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle",children:"Name"}),(0,t.jsx)("th",{className:"hidden md:table-cell text-left px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle w-24",children:"Type"}),(0,t.jsx)("th",{className:"hidden lg:table-cell text-left px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle w-32",children:"Features"}),(0,t.jsx)("th",{className:"hidden sm:table-cell text-left px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle w-20",children:"Preview"}),(0,t.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,t.jsx)("tbody",{children:e.map(b=>{const w=i.get(b.id)??[],$=w.length>0,P=a.has(b.id),M=b.parentDeviceId!==null?f?.(b.parentDeviceId)??null:null,D=b.parentDeviceId!==null?h.get(b.parentDeviceId)??null:null;return(0,t.jsx)(Zy,{parent:b,accessories:w,hasAccessories:$,forceExpanded:P,trpc:l,integrationIcon:d?.(b.addonId)??null,parentRowParent:M,indentLevel:Ry(b,D),onNavigate:p??null,renderRowAction:g??null},b.id)})})]})})}function Zy({parent:e,accessories:i,hasAccessories:a,forceExpanded:o,trpc:l,integrationIcon:d,parentRowParent:f,indentLevel:p,onNavigate:g,renderRowAction:h}){const[b,w]=(0,n.useState)(o),$=(0,n.useRef)(o);(0,n.useEffect)(()=>{$.current!==o&&(w(o),$.current=o)},[o]);const P=()=>w(M=>!M);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Ba,{trpc:l,device:e,view:"table",integrationIcon:d,parent:f,children:i,onNavigate:g??void 0,showChildrenAccordion:a,expanded:b,onToggleExpand:P,indentLevel:p,renderRowAction:h??void 0}),a&&b&&i.map(M=>(0,t.jsx)(Ba,{trpc:l,device:M,view:"table",integrationIcon:null,parent:null,isAccessoryRow:!0,showChildrenAccordion:!1,onNavigate:g??void 0},M.id))]})}function Uy(){(0,te.useQueryClient)()}function By({options:e,value:i,onChange:a}){return(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(o=>{const l=o.id===i;return(0,t.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,t.jsx)(ev,{className:"h-3.5 w-3.5 shrink-0"}),o.label,o.isBest&&(0,t.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,t.jsx)(jv,{className:"h-2.5 w-2.5"}),"Best"]}),o.platformScore!=null&&(0,t.jsxs)("span",{className:"text-[10px] text-foreground-subtle/60",children:["(",o.platformScore,")"]}),(0,t.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${o.available?"bg-success":"bg-danger"}`})]},o.id)})})}function Fy(e,i){const a=new Set(i.slots.flatMap(f=>f.addons.map(p=>p.id))),o=[];function l(f){if(!a.has(f.addonId))return o.push(`Addon "${f.addonId}" is no longer available — step removed`),null;const p=i.slots.flatMap(b=>b.addons).find(b=>b.id===f.addonId);let g=f.modelId;if(p&&!p.models.some(b=>b.id===g)){const b=p.defaultModelId;o.push(`Model "${g}" not available for ${f.addonId} — using "${b}"`),g=b}const h=f.children.map(b=>l(b)).filter(b=>b!==null);return{...f,modelId:g,children:h}}const d=e.map(f=>l(f)).filter(f=>f!==null);return{valid:o.length===0,steps:d,warnings:o}}function Gy(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 Cl(e){return{addonId:e.id,addonName:e.name,slot:e.slot,inputClasses:[...e.inputClasses],outputClasses:[...e.outputClasses],enabled:!0,modelId:e.defaultModelId,children:[]}}function Ol({addon:e,onClick:i}){return(0,t.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,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(Kh,{className:"h-[18px] w-[18px] text-foreground-subtle/30 group-hover:text-primary/60 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"text-[13px] font-medium text-foreground-subtle/50 group-hover:text-foreground-subtle block truncate",children:e.name}),(0,t.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[e.inputClasses.map(a=>(0,t.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,t.jsx)("span",{className:"text-foreground-subtle/25 text-[10px]",children:"→"}),e.outputClasses.map(a=>(0,t.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 Vy({schema:e,steps:i,onChange:a,templates:o,selectedTemplateId:l,onSelectTemplate:d,onSaveTemplate:f,onUpdateTemplate:p,onDeleteTemplate:g,readOnly:h=!1,excludeAddons:b=[],hideTemplates:w=!1,showOnlyEnabled:$=!1,showSlotLabels:P=!1,toggleMode:M="simple",overrides:D={},onOverrideChange:z,inheritedEnabledByAddon:R={},hideModelAndSettings:Z=!1}){const G=je=>({toggleMode:M,hideModelAndSettings:Z,...M==="threeState"?{overrideState:D[je]!==void 0?D[je]:null,onOverrideChange:z?_e=>z(je,_e):void 0,inheritedEnabled:R[je]}:{}}),Q=(0,n.useMemo)(()=>new Set(b),[b]),W=(0,n.useMemo)(()=>Gy(e),[e]),[X,he]=(0,n.useState)([]),H=l?JSON.stringify(i)!==JSON.stringify(o.find(je=>je.id===l)?.steps):!1;function me(je){const _e=je.target.value||null;if(_e){const Ue=o.find(ne=>ne.id===_e);Ue&&he([...Fy(Ue.steps,e).warnings])}else he([]);d(_e)}function ye(){l&&p(l,i)}function Qe(){const je=window.prompt("Template name:");je?.trim()&&f(je.trim(),i)}function Ye(){if(!l)return;const je=o.find(_e=>_e.id===l);je&&window.confirm(`Delete template "${je.name}"?`)&&g(l)}function Je(je){a(i.map(_e=>_e.addonId!==je.addonId?_e:Ae(je)))}function Ae(je){const _e=je.children.some(Ue=>Ue.enabled||Ue.children.some(ne=>ne.enabled));return{...je,enabled:je.enabled||_e,children:je.children.map(Ue=>{const ne=Ue.children.some(we=>we.enabled);return{...Ue,enabled:Ue.enabled||ne}})}}function De(je,_e){const Ue=Cl(_e);a(i.map(ne=>ne.addonId!==je?ne:{...ne,children:[...ne.children,Ue]}))}function Re(je){const _e=new Set;for(const Ue of je){_e.add(Ue.addonId);for(const we of Ue.children)_e.add(we.addonId);const ne=Re(Ue.children);for(const we of ne)_e.add(we)}return _e}const Te=Re(i);function ue(je){const _e=W.get(je.addonId);if(!_e)return[];const Ue=e.slots.find(ze=>ze.id===_e.slot)?.parentSlot==null,ne=_e.childSlots,we=new Set(je.children.map(ze=>ze.addonId)),Me=[];for(const ze of e.slots)if(ne.includes(ze.id))for(const We of ze.addons){if(we.has(We.id)||Q.has(We.id))continue;const Fe=We.inputClasses.length===0;Fe&&!Ue||(Fe||We.inputClasses.some(Tt=>je.outputClasses.includes(Tt)))&&Me.push(We)}return Me}function ge(je){const _e=$?{...je,children:je.children.filter(ne=>ne.enabled).map(ne=>({...ne,children:ne.children.filter(we=>we.enabled)}))}:je,Ue=$?[]:ue(_e);return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(Ra,{step:_e,schema:W.get(_e.addonId)??null,allSchemas:W,onChange:Je,onDelete:h?void 0:ne=>a(i.filter(we=>we.addonId!==ne)),readOnly:h,...G(_e.addonId)}),(_e.children.length>0||Ue.length>0)&&(0,t.jsxs)("div",{className:"ml-4 pl-3 border-l border-border/60 space-y-1.5",children:[P&&(0,t.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/40",children:"Slot: Cropper / Classifier"}),_e.children.map(ne=>{const we=ue(ne);return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(Ra,{step:ne,schema:W.get(ne.addonId)??null,allSchemas:W,depth:1,onChange:Me=>{Je({..._e,children:_e.children.map(ze=>ze.addonId===Me.addonId?Me:ze)})},onDelete:h?void 0:Me=>{Je({..._e,children:_e.children.filter(ze=>ze.addonId!==Me)})},readOnly:h,...G(ne.addonId)}),(ne.children.length>0||we.length>0)&&(0,t.jsxs)("div",{className:"ml-4 pl-3 border-l border-border/40 space-y-1.5",children:[P&&(0,t.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/30",children:"Slot: Recognizer"}),ne.children.map(Me=>(0,t.jsx)(Ra,{step:Me,schema:W.get(Me.addonId)??null,allSchemas:W,depth:2,onChange:ze=>{Je({..._e,children:_e.children.map(We=>We.addonId===ne.addonId?{...We,children:We.children.map(Fe=>Fe.addonId===ze.addonId?ze:Fe)}:We)})},onDelete:h?void 0:ze=>{Je({..._e,children:_e.children.map(We=>We.addonId===ne.addonId?{...We,children:We.children.filter(Fe=>Fe.addonId!==ze)}:We)})},readOnly:h,...G(Me.addonId)},Me.addonId)),!h&&we.map(Me=>(0,t.jsx)(Ol,{addon:Me,onClick:()=>{const ze=Cl(Me);Je({..._e,children:_e.children.map(We=>We.addonId===ne.addonId?{...We,children:[...We.children,ze]}:We)})}},Me.id))]})]},ne.addonId)}),!h&&Ue.map(ne=>(0,t.jsx)(Ol,{addon:ne,onClick:()=>De(_e.addonId,ne)},ne.id))]})]},_e.addonId)}const ve=e.slots.filter(je=>je.parentSlot===null).sort((je,_e)=>je.priority-_e.priority);return(0,t.jsxs)("div",{className:"space-y-4",children:[!w&&(0,t.jsx)("div",{className:"rounded-lg border border-border bg-surface p-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"relative flex-1 min-w-0",children:(0,t.jsxs)("select",{value:l??"",onChange:me,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,t.jsx)("option",{value:"",children:"No template"}),o.map(je=>(0,t.jsx)("option",{value:je.id,children:je.name},je.id))]})}),H&&(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500 shrink-0"}),(0,t.jsx)("button",{onClick:ye,disabled:!l||h,title:"Save",className:N("p-2 rounded-lg border border-border transition-colors",l&&!h?"text-foreground-subtle hover:bg-surface-hover":"text-foreground-subtle/30 cursor-not-allowed"),children:(0,t.jsx)(vv,{className:"h-4 w-4"})}),(0,t.jsx)("button",{onClick:Qe,disabled:h,title:"Save As",className:N("p-2 rounded-lg border border-border transition-colors",h?"text-foreground-subtle/30 cursor-not-allowed":"text-foreground-subtle hover:bg-surface-hover"),children:(0,t.jsx)(Yh,{className:"h-4 w-4"})}),(0,t.jsx)("button",{onClick:Ye,disabled:!l||h,title:"Delete",className:N("p-2 rounded-lg border border-border transition-colors",l&&!h?"text-foreground-subtle hover:text-danger":"text-foreground-subtle/30 cursor-not-allowed"),children:(0,t.jsx)(hr,{className:"h-4 w-4"})})]})}),X.length>0&&(0,t.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,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"font-medium",children:"Template loaded with warnings:"}),(0,t.jsx)("button",{onClick:()=>he([]),className:"text-amber-400/60 hover:text-amber-400",children:(0,t.jsx)(Mt,{className:"h-3.5 w-3.5"})})]}),X.map((je,_e)=>(0,t.jsxs)("div",{children:["• ",je]},_e))]}),ve.map(je=>{const _e=i.filter(ze=>ze.slot===je.id&&!Q.has(ze.addonId)),Ue=$?_e.filter(ze=>ze.enabled):_e,ne=$?[]:je.addons.filter(ze=>!Te.has(ze.id)&&!Q.has(ze.id)),we=new Map,Me=[];for(const ze of Ue)ze.group?(we.has(ze.group)||we.set(ze.group,[]),we.get(ze.group).push(ze)):Me.push(ze);return(0,t.jsxs)("div",{className:"space-y-2",children:[P&&(0,t.jsxs)("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/50",children:["Slot: ",je.label]}),Me.map(ze=>ge(ze)),[...we.entries()].map(([ze,We])=>(0,t.jsxs)("div",{className:"space-y-2 rounded-lg border border-border/40 p-2",children:[(0,t.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/50 px-1",children:ze}),We.map(Fe=>ge(Fe))]},ze)),!h&&ne.map(ze=>(0,t.jsx)(Ol,{addon:ze,onClick:()=>{a([...i,Cl(ze)])}},ze.id))]},je.id)})]})}var qi={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"},Kd=["#ef4444","#8b5cf6","#06b6d4","#f97316","#10b981","#6366f1","#e11d48","#0891b2","#7c3aed","#059669"],Wy="#f59e42";function Qt(e,i){if(i?.[e])return i[e];if(i?.[e.toLowerCase()])return i[e.toLowerCase()];if(qi[e])return qi[e];if(qi[e.toLowerCase()])return qi[e.toLowerCase()];let a=0;for(let o=0;o<e.length;o++)a=a*31+(e.codePointAt(o)??0)>>>0;return Kd[a%Kd.length]??"#f59e42"}function Qy({src:e,imageWidth:i,imageHeight:a,detections:o=[],classColors:l,aspectRatio:d,className:f,placeholder:p,showConfidence:g=!0,minConfidence:h=0,borderWidth:b=2}){function w(R){return Qt(R,l)}const $=d??(i&&a?`${i}/${a}`:"16/9"),P=o.filter(R=>R.score>=h),M=P.filter(R=>R.kind==="first-level"),D=P.filter(R=>R.kind==="detail"),z=Jy(D,R=>R.parentId??"");return(0,t.jsx)("div",{className:N("rounded-lg border border-border bg-surface overflow-hidden relative",f),style:{aspectRatio:$},children:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("img",{src:e,className:"absolute inset-0 w-full h-full object-fill",alt:""}),P.map((R,Z)=>R.debug?.mask&&R.debug.maskWidth&&R.debug.maskHeight?(0,t.jsx)(Hy,{mask:R.debug.mask,maskWidth:R.debug.maskWidth,maskHeight:R.debug.maskHeight,bbox:R.bbox,imageWidth:i,imageHeight:a,color:w(R.macroClass)},`mask-${Z}`):null),M.map(R=>{const Z=z.get(R.id)??[];return(0,t.jsx)(Xd,{detection:R,imageWidth:i,imageHeight:a,color:w(R.macroClass),showConfidence:g,borderWidth:R.debug?.mask?1:b,children:Z.map(G=>(0,t.jsx)(qy,{child:G,parentBbox:R.bbox,color:w(G.macroClass),showConfidence:g},`child-${G.id}`))},`det-${R.id}`)}),D.filter(R=>!R.parentId||!M.some(Z=>Z.id===R.parentId)).map(R=>(0,t.jsx)(Xd,{detection:R,imageWidth:i,imageHeight:a,color:w(R.macroClass),showConfidence:g,borderWidth:b},`orphan-${R.id}`))]}):(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center text-foreground-subtle text-sm",children:p??"No image loaded"})})}function Xd({detection:e,imageWidth:i,imageHeight:a,color:o,showConfidence:l,borderWidth:d,children:f}){const{x:p,y:g,width:h,height:b}=e.bbox,w=(0,t.jsxs)("div",{className:"absolute left-0 flex flex-col items-start gap-px",style:{bottom:"100%",marginBottom:"2px"},children:[(0,t.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(($,P)=>(0,t.jsxs)("span",{className:"text-[9px] font-semibold px-1 rounded-sm whitespace-nowrap text-white",style:{backgroundColor:Qt($.label)},children:[$.label," ",($.score*100).toFixed(0),"%"]},`${e.id}-lbl-${P}`))]});return(0,t.jsxs)("div",{className:"absolute rounded-sm",style:{left:`${p/i*100}%`,top:`${g/a*100}%`,width:`${h/i*100}%`,height:`${b/a*100}%`,borderWidth:`${d}px`,borderStyle:"solid",borderColor:o},children:[w,f]})}function Hy({mask:e,maskWidth:i,maskHeight:a,bbox:o,imageWidth:l,imageHeight:d,color:f}){const p=(0,n.useRef)(null);return(0,n.useEffect)(()=>{const g=p.current;if(!g)return;const h=g.getContext("2d");if(!h)return;const b=atob(e),w=new Uint8Array(b.length);for(let R=0;R<b.length;R++)w[R]=b.charCodeAt(R);const $=parseInt(f.slice(1,3),16),P=parseInt(f.slice(3,5),16),M=parseInt(f.slice(5,7),16);g.width=i,g.height=a;const D=h.createImageData(i,a),z=i*a;for(let R=0;R<z;R++){const Z=R<w.length?w[R]:0,G=R*4;Z>0&&(D.data[G]=$,D.data[G+1]=P,D.data[G+2]=M,D.data[G+3]=120)}h.putImageData(D,0,0)},[e,i,a,f]),(0,t.jsx)("canvas",{ref:p,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 qy({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,f=e.bbox.width/i.width*100,p=e.bbox.height/i.height*100;return(0,t.jsx)("div",{className:"absolute rounded-sm",style:{left:`${Math.max(0,l)}%`,top:`${Math.max(0,d)}%`,width:`${Math.min(100,f)}%`,height:`${Math.min(100,p)}%`,borderWidth:"1px",borderStyle:"solid",borderColor:a},children:(0,t.jsxs)("div",{className:"absolute left-0 flex flex-col items-start gap-px",style:{bottom:"100%",marginBottom:"1px"},children:[(0,t.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((g,h)=>(0,t.jsxs)("span",{className:"text-[8px] font-semibold px-0.5 rounded-sm whitespace-nowrap text-white",style:{backgroundColor:Qt(g.label)},children:[g.label," ",(g.score*100).toFixed(0),"%"]},`${e.id}-lbl-${h}`))]})})}function Jy(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 Ky({detections:e,classColors:i,className:a,hiddenKeys:o,onToggleVisibility:l}){const d=i;if(e.length===0)return(0,t.jsx)("div",{className:"text-sm text-foreground-subtle italic text-center py-4",children:"No detections"});const f=e.filter(b=>b.kind==="first-level"),p=e.filter(b=>b.kind==="detail"),g=new Map;for(const b of p){if(!b.parentId)continue;const w=g.get(b.parentId)??[];w.push(b),g.set(b.parentId,w)}const h=p.filter(b=>!b.parentId||!f.some(w=>w.id===b.parentId));return(0,t.jsxs)("div",{className:a,children:[(0,t.jsxs)("div",{className:"text-xs font-medium text-foreground-subtle uppercase tracking-wide mb-2",children:["Detections (",e.length,")"]}),(0,t.jsxs)("div",{className:"space-y-2",children:[f.map(b=>(0,t.jsx)(Yd,{detection:b,children_:g.get(b.id)??[],colors:d,hiddenKeys:o,onToggleVisibility:l},b.id)),h.map(b=>(0,t.jsx)(Yd,{detection:b,children_:[],colors:d,hiddenKeys:o,onToggleVisibility:l},b.id))]})]})}function Yd({detection:e,children_:i,colors:a,hiddenKeys:o,onToggleVisibility:l}){const d=Qt(e.macroClass,a),f=!o?.has(e.id),p=e.debug?.mask,g=e.debug?.maskWidth,h=e.debug?.maskHeight,b=e.debug?.alternateLabels;return(0,t.jsxs)("div",{className:`rounded-md border border-border bg-surface p-3 space-y-1 ${f?"":"opacity-40"}`,children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[l&&(0,t.jsx)("input",{type:"checkbox",checked:f,onChange:()=>l(e.id,!f),className:"h-3.5 w-3.5 rounded border-border accent-primary cursor-pointer shrink-0"}),(0,t.jsx)("span",{className:"h-2.5 w-2.5 rounded-full shrink-0",style:{backgroundColor:d}}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.macroClass}),e.kind==="detail"&&(0,t.jsx)("span",{className:"text-[9px] font-mono px-1 py-0.5 rounded bg-primary/10 text-primary",children:"detail"}),p&&g&&h&&(0,t.jsxs)("span",{className:"text-[9px] font-mono px-1 py-0.5 rounded bg-primary/10 text-primary",children:["mask ",g,"x",h]})]}),(0,t.jsx)(e0,{confidence:e.score})]}),(0,t.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,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.labels.map((w,$)=>(0,t.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,t.jsxs)("span",{className:"opacity-60",children:[(w.score*100).toFixed(0),"%"]}),w.detectionId&&(0,t.jsxs)("span",{className:"opacity-40 text-[8px]",children:["→ ",w.detectionId]})]},$))}),b&&Object.keys(b).length>0&&(0,t.jsx)(Yy,{alternateLabels:b,colors:a}),i.length>0&&(0,t.jsx)(Xy,{items:i,colors:a,hiddenKeys:o,onToggleVisibility:l})]})}function Xy({items:e,colors:i,hiddenKeys:a,onToggleVisibility:o}){return(0,t.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),f=!a?.has(l.id),p=l.debug?.mask,g=l.debug?.maskWidth,h=l.debug?.maskHeight;return(0,t.jsxs)("div",{className:`text-xs space-y-0.5 ${f?"":"opacity-40"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[o&&(0,t.jsx)("input",{type:"checkbox",checked:f,onChange:()=>o(l.id,!f),className:"h-3 w-3 rounded border-border accent-primary cursor-pointer shrink-0"}),(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full shrink-0",style:{backgroundColor:d}}),(0,t.jsx)("span",{className:"font-medium",style:{color:d},children:l.macroClass}),(0,t.jsxs)("span",{className:"text-foreground-subtle",children:[(l.score*100).toFixed(0),"%"]}),p&&g&&h&&(0,t.jsxs)("span",{className:"text-[9px] font-mono px-1 py-0.5 rounded bg-primary/10 text-primary",children:["mask ",g,"x",h]})]}),l.labels.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 ml-5 mt-0.5",children:l.labels.map((b,w)=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-[9px] font-medium px-1 py-0.5 rounded-full",style:{backgroundColor:Qt(b.label,i)+"20",color:Qt(b.label,i)},children:[b.label," ",(0,t.jsxs)("span",{className:"opacity-60",children:[(b.score*100).toFixed(0),"%"]})]},w))})]},l.id)})})}function Yy({alternateLabels:e,colors:i}){const[a,o]=(0,n.useState)(!1),l=Object.keys(e);return(0,t.jsxs)("div",{className:"mt-1",children:[(0,t.jsxs)("button",{onClick:()=>o(d=>!d),className:"text-[9px] text-foreground-subtle hover:text-foreground transition-colors flex items-center gap-1",children:[(0,t.jsx)("span",{className:`transition-transform ${a?"rotate-90":""}`,children:"▶"}),"Alternates (",l.length," source",l.length!==1?"s":"",")"]}),a&&(0,t.jsx)("div",{className:"mt-1 ml-3 space-y-1.5",children:l.map(d=>{const f=e[d];return!f||f.length===0?null:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] font-medium text-foreground-subtle mb-0.5",children:d}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:f.map((p,g)=>(0,t.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,p.score)},children:[p.label,(0,t.jsxs)("span",{className:"opacity-60",children:[(p.score*100).toFixed(1),"%"]})]},g))})]},d)})})]})}function e0({confidence:e}){return(0,t.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 t0({timings:e,totalMs:i,className:a}){const o=Object.entries(e);return o.length===0&&i===void 0?null:(0,t.jsxs)("div",{className:`rounded-lg border border-border bg-surface p-3 space-y-2 ${a??""}`,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-foreground-subtle uppercase tracking-wide",children:"Timings"}),(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[o.map(([l,d])=>(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{className:"text-foreground-subtle",children:l}),(0,t.jsxs)("span",{className:"font-mono text-foreground",children:[d.toFixed(1),"ms"]})]},l)),i!==void 0&&(0,t.jsxs)("div",{className:"flex justify-between pt-1 border-t border-border font-medium text-foreground",children:[(0,t.jsx)("span",{children:"Total"}),(0,t.jsxs)("span",{className:"font-mono",children:[i.toFixed(1),"ms"]})]})]})]})}function r0({images:e,selectedFilename:i,uploadedName:a,onSelect:o,onUpload:l,className:d,accept:f="image/*",uploadLabel:p="Upload..."}){const g=()=>{const h=document.createElement("input");h.type="file",h.accept=f,h.onchange=()=>{const b=h.files?.[0];if(!b)return;const w=new FileReader;w.onload=()=>{const $=w.result,P=$.split(",")[1];P&&l(P,b.name,$)},w.readAsDataURL(b)},h.click()};return(0,t.jsxs)("div",{className:`flex flex-wrap items-center gap-2 ${d??""}`,children:[e.map(h=>(0,t.jsx)("button",{onClick:()=>o(h.filename),className:`px-3 py-1.5 text-xs rounded-md border transition-colors ${i===h.filename?"bg-primary text-primary-foreground border-primary":"bg-surface border-border text-foreground hover:border-primary/50"}`,children:h.id??h.filename.replace(/\.[^.]+$/,"")},h.filename)),(0,t.jsx)("button",{onClick:g,className:"px-3 py-1.5 text-xs rounded-md border border-border bg-surface text-foreground hover:bg-surface-hover transition-colors",children:p}),a&&(0,t.jsx)("span",{className:"text-xs text-foreground-subtle",children:a})]})}var Fa="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 n0({runtime:e,backend:i,modelId:a,agentId:o="hub",runtimes:l,backends:d,models:f,agents:p=[],onRuntimeChange:g,onBackendChange:h,onModelChange:b,onAgentChange:w,layout:$="grid",className:P,showAgent:M=!1}){return(0,t.jsxs)("div",{className:`${$==="grid"?"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4":$==="horizontal"?"flex flex-wrap items-end gap-4":"space-y-3"} ${P??""}`,children:[M&&p.length>0&&(0,t.jsxs)("label",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground-subtle",children:"Agent"}),(0,t.jsx)("select",{value:o,onChange:D=>w?.(D.target.value),className:Fa,children:p.map(D=>(0,t.jsxs)("option",{value:D.id,children:[D.name," (",D.status,")"]},D.id))})]}),(0,t.jsxs)("label",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground-subtle",children:"Runtime"}),(0,t.jsx)("select",{value:e,onChange:D=>g(D.target.value),className:Fa,children:l.map(D=>(0,t.jsxs)("option",{value:D.value,disabled:!D.available,children:[D.label,D.available?"":" (unavailable)"]},D.value))})]}),(0,t.jsxs)("label",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground-subtle",children:"Backend"}),(0,t.jsx)("select",{value:i,onChange:D=>h(D.target.value),className:Fa,children:d.map(D=>(0,t.jsxs)("option",{value:D.id,disabled:!D.available,children:[D.label,D.available?"":" (unavailable)"]},D.id))})]}),(0,t.jsxs)("label",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground-subtle",children:"Model"}),(0,t.jsx)("select",{value:a,onChange:D=>b(D.target.value),className:Fa,children:f.length===0?(0,t.jsx)("option",{value:"",children:"No compatible models"}):f.map(D=>(0,t.jsxs)("option",{value:D.id,children:[D.name,D.downloaded?" ✓":""]},D.id))})]})]})}var i0=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()}},ef=class{constructor(e){this.generateIdentifier=e,this.kv=new i0}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)}},a0=class extends ef{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 o0(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 s0(e,i){const a=o0(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 kn(e,i){Object.entries(e).forEach(([a,o])=>i(o,a))}function Ga(e,i){return e.indexOf(i)!==-1}function tf(e,i){for(let a=0;a<e.length;a++){const o=e[a];if(i(o))return o}}var l0=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return s0(this.transfomers,i=>i.isApplicable(e))}findByName(e){return this.transfomers[e]}},c0=e=>Object.prototype.toString.call(e).slice(8,-1),rf=e=>typeof e>"u",u0=e=>e===null,Ji=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,Ml=e=>Ji(e)&&Object.keys(e).length===0,Br=e=>Array.isArray(e),d0=e=>typeof e=="string",f0=e=>typeof e=="number"&&!isNaN(e),m0=e=>typeof e=="boolean",g0=e=>e instanceof RegExp,Ki=e=>e instanceof Map,Xi=e=>e instanceof Set,nf=e=>c0(e)==="Symbol",p0=e=>e instanceof Date&&!isNaN(e.valueOf()),af=e=>e instanceof Error,of=e=>typeof e=="number"&&isNaN(e),h0=e=>m0(e)||u0(e)||rf(e)||f0(e)||d0(e)||nf(e),v0=e=>typeof e=="bigint",b0=e=>e===1/0||e===-1/0,y0=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),x0=e=>e instanceof URL,El=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),Il=e=>e.map(String).map(El).join("."),Yi=(e,i)=>{const a=[];let o="";for(let d=0;d<e.length;d++){let f=e.charAt(d);if(!i&&f==="\\"){const p=e.charAt(d+1);if(p==="\\"){o+="\\",d++;continue}else if(p!==".")throw Error("invalid path")}if(f==="\\"&&e.charAt(d+1)==="."){o+=".",d++;continue}if(f==="."){a.push(o),o="";continue}o+=f}const l=o;return a.push(l),a};function br(e,i,a,o){return{isApplicable:e,annotation:i,transform:a,untransform:o}}var sf=[br(rf,"undefined",()=>null,()=>{}),br(v0,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),br(p0,"Date",e=>e.toISOString(),e=>new Date(e)),br(af,"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}),br(g0,"regexp",e=>""+e,e=>{const i=e.slice(1,e.lastIndexOf("/")),a=e.slice(e.lastIndexOf("/")+1);return new RegExp(i,a)}),br(Xi,"set",e=>[...e.values()],e=>new Set(e)),br(Ki,"map",e=>[...e.entries()],e=>new Map(e)),br(e=>of(e)||b0(e),"number",e=>of(e)?"NaN":e>0?"Infinity":"-Infinity",Number),br(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),br(x0,"URL",e=>e.toString(),e=>new URL(e))];function Va(e,i,a,o){return{isApplicable:e,annotation:i,transform:a,untransform:o}}var lf=Va((e,i)=>nf(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}),_0=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,i)=>(e[i.name]=i,e),{}),cf=Va(y0,e=>["typed-array",e.constructor.name],e=>[...e],(e,i)=>{const a=_0[i[1]];if(!a)throw new Error("Trying to deserialize unknown typed array");return new a(e)});function uf(e,i){return e?.constructor?!!i.classRegistry.getIdentifier(e.constructor):!1}var df=Va(uf,(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)}),ff=Va((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)}),w0=[df,lf,ff,cf],mf=(e,i)=>{const a=tf(w0,l=>l.isApplicable(e,i));if(a)return{value:a.transform(e,i),type:a.annotation(e,i)};const o=tf(sf,l=>l.isApplicable(e,i));if(o)return{value:o.transform(e,i),type:o.annotation}},gf={};sf.forEach(e=>{gf[e.annotation]=e});var S0=(e,i,a)=>{if(Br(i))switch(i[0]){case"symbol":return lf.untransform(e,i,a);case"class":return df.untransform(e,i,a);case"custom":return ff.untransform(e,i,a);case"typed-array":return cf.untransform(e,i,a);default:throw new Error("Unknown transformation: "+i)}else{const o=gf[i];if(!o)throw new Error("Unknown transformation: "+i);return o.untransform(e,a)}},Pn=(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 pf(e){if(Ga(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Ga(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Ga(e,"constructor"))throw new Error("constructor is not allowed as a property")}var j0=(e,i)=>{pf(i);for(let a=0;a<i.length;a++){const o=i[a];if(Xi(e))e=Pn(e,+o);else if(Ki(e)){const l=+o,d=+i[++a]==0?"key":"value",f=Pn(e,l);switch(d){case"key":e=f;break;case"value":e=e.get(f);break}}else e=e[o]}return e},Dl=(e,i,a)=>{if(pf(i),i.length===0)return a(e);let o=e;for(let d=0;d<i.length-1;d++){const f=i[d];if(Br(o)){const p=+f;o=o[p]}else if(Ji(o))o=o[f];else if(Xi(o)){const p=+f;o=Pn(o,p)}else if(Ki(o)){if(d===i.length-2)break;const p=+f,g=+i[++d]==0?"key":"value",h=Pn(o,p);switch(g){case"key":o=h;break;case"value":o=o.get(h);break}}}const l=i[i.length-1];if(Br(o)?o[+l]=a(o[+l]):Ji(o)&&(o[l]=a(o[l])),Xi(o)){const d=Pn(o,+l),f=a(d);d!==f&&(o.delete(d),o.add(f))}if(Ki(o)){const d=+i[i.length-2],f=Pn(o,d);switch(+l==0?"key":"value"){case"key":{const p=a(f);o.set(p,o.get(f)),p!==f&&o.delete(f);break}case"value":o.set(f,a(o.get(f)));break}}return e},hf=e=>e<1;function Al(e,i,a,o=[]){if(!e)return;const l=hf(a);if(!Br(e)){kn(e,(p,g)=>Al(p,i,a,[...o,...Yi(g,l)]));return}const[d,f]=e;f&&kn(f,(p,g)=>{Al(p,i,a,[...o,...Yi(g,l)])}),i(d,o)}function $0(e,i,a,o){return Al(i,(l,d)=>{e=Dl(e,d,f=>S0(f,l,o))},a),e}function k0(e,i,a){const o=hf(a);function l(d,f){const p=j0(e,Yi(f,o));d.map(g=>Yi(g,o)).forEach(g=>{e=Dl(e,g,()=>p)})}if(Br(i)){const[d,f]=i;d.forEach(p=>{e=Dl(e,Yi(p,o),()=>e)}),f&&kn(f,l)}else kn(i,l);return e}var P0=(e,i)=>Ji(e)||Br(e)||Ki(e)||Xi(e)||af(e)||uf(e,i);function N0(e,i,a){const o=a.get(e);o?o.push(i):a.set(e,[i])}function C0(e,i){const a={};let o;return e.forEach(l=>{if(l.length<=1)return;i||(l=l.map(p=>p.map(String)).sort((p,g)=>p.length-g.length));const[d,...f]=l;d.length===0?o=f.map(Il):a[Il(d)]=f.map(Il)}),o?Ml(a)?[o]:[o,a]:Ml(a)?void 0:a}var vf=(e,i,a,o,l=[],d=[],f=new Map)=>{const p=h0(e);if(!p){N0(e,l,i);const P=f.get(e);if(P)return o?{transformedValue:null}:P}if(!P0(e,a)){const P=mf(e,a),M=P?{transformedValue:P.value,annotations:[P.type]}:{transformedValue:e};return p||f.set(e,M),M}if(Ga(d,e))return{transformedValue:null};const g=mf(e,a),h=g?.value??e,b=Br(h)?[]:{},w={};kn(h,(P,M)=>{if(M==="__proto__"||M==="constructor"||M==="prototype")throw new Error(`Detected property ${M}. This is a prototype pollution risk, please remove it from your object.`);const D=vf(P,i,a,o,[...l,M],[...d,e],f);b[M]=D.transformedValue,Br(D.annotations)?w[El(M)]=D.annotations:Ji(D.annotations)&&kn(D.annotations,(z,R)=>{w[El(M)+"."+R]=z})});const $=Ml(w)?{transformedValue:b,annotations:g?[g.type]:void 0}:{transformedValue:b,annotations:g?[g.type,w]:w};return p||f.set(e,$),$};function bf(e){return Object.prototype.toString.call(e).slice(8,-1)}function yf(e){return bf(e)==="Array"}function O0(e){if(bf(e)!=="Object")return!1;const i=Object.getPrototypeOf(e);return!!i&&i.constructor===Object&&i===Object.prototype}function M0(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 zl(e,i={}){if(yf(e))return e.map(l=>zl(l,i));if(!O0(e))return e;const a=Object.getOwnPropertyNames(e),o=Object.getOwnPropertySymbols(e);return[...a,...o].reduce((l,d)=>{if(d==="__proto__"||yf(i.props)&&!i.props.includes(d))return l;const f=e[d];return M0(l,d,zl(f,i),e,i.nonenumerable),l},{})}var st=class{constructor({dedupe:e=!1}={}){this.classRegistry=new a0,this.symbolRegistry=new ef(i=>i.description??""),this.customTransformerRegistry=new l0,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const i=new Map,a=vf(e,i,this,this.dedupe),o={json:a.transformedValue};a.annotations&&(o.meta={...o.meta,values:a.annotations});const l=C0(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:zl(a);return o?.values&&(l=$0(l,o.values,o.v??0,this)),o?.referentialEqualities&&(l=k0(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)}};st.defaultInstance=new st,st.serialize=st.defaultInstance.serialize.bind(st.defaultInstance),st.deserialize=st.defaultInstance.deserialize.bind(st.defaultInstance),st.stringify=st.defaultInstance.stringify.bind(st.defaultInstance),st.parse=st.defaultInstance.parse.bind(st.defaultInstance),st.registerClass=st.defaultInstance.registerClass.bind(st.defaultInstance),st.registerSymbol=st.defaultInstance.registerSymbol.bind(st.defaultInstance),st.registerCustom=st.defaultInstance.registerCustom.bind(st.defaultInstance),st.allowErrorProps=st.defaultInstance.allowErrorProps.bind(st.defaultInstance),st.serialize,st.deserialize,st.stringify,st.parse,st.registerClass,st.registerCustom,st.registerSymbol,st.allowErrorProps;function E0({className:e}){return(0,t.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,t.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,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}function I0({className:e}){return(0,t.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,t.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,t.jsx)("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),(0,t.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,t.jsx)("path",{d:"m2 2 20 20"})]})}function D0({className:e}){return(0,t.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,t.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}function xf({onLogin:e,serverUrl:i,logoSrc:a,error:o,className:l}){const[d,f]=(0,n.useState)(""),[p,g]=(0,n.useState)(""),[h,b]=(0,n.useState)(!1),[w,$]=(0,n.useState)(!1),[P,M]=(0,n.useState)(null),D=o??P,z=async R=>{if(R.preventDefault(),!w){M(null),$(!0);try{await e(d,p)}catch(Z){M(Z instanceof Error?Z.message:"Login failed. Please try again.")}finally{$(!1)}}};return(0,t.jsx)("div",{className:N("flex min-h-screen items-center justify-center bg-background p-4",l),children:(0,t.jsxs)("div",{className:"w-full max-w-sm",children:[a&&(0,t.jsx)("div",{className:"flex justify-center mb-8",children:(0,t.jsx)("img",{src:a,alt:"Logo",className:"h-12"})}),i&&(0,t.jsx)("p",{className:"mb-4 text-center text-xs text-foreground-subtle truncate",children:i}),(0,t.jsxs)("form",{onSubmit:z,className:"space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10",children:[D&&(0,t.jsx)("div",{className:"rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger",children:D}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-foreground-subtle",children:"Username"}),(0,t.jsx)("input",{type:"text",value:d,onChange:R=>f(R.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,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-foreground-subtle",children:"Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{type:h?"text":"password",value:p,onChange:R=>g(R.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,t.jsx)("button",{type:"button",onClick:()=>b(R=>!R),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",tabIndex:-1,children:h?(0,t.jsx)(I0,{className:"h-4 w-4"}):(0,t.jsx)(E0,{className:"h-4 w-4"})})]})]}),(0,t.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,t.jsx)(D0,{className:"h-4 w-4 animate-spin"}),w?"Logging in...":"Log in"]})]})]})})}var Tl="camstack_dev_token",_f=(0,n.createContext)(null);function A0(){const e=(0,n.useContext)(_f);if(!e)throw new Error("useDevShell must be used within a DevShell");return e}function z0(){return typeof window>"u"?null:localStorage.getItem(Tl)}function T0({className:e}){return(0,t.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,t.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,t.jsx)("path",{d:"M12 2v2"}),(0,t.jsx)("path",{d:"M12 20v2"}),(0,t.jsx)("path",{d:"m4.93 4.93 1.41 1.41"}),(0,t.jsx)("path",{d:"m17.66 17.66 1.41 1.41"}),(0,t.jsx)("path",{d:"M2 12h2"}),(0,t.jsx)("path",{d:"M20 12h2"}),(0,t.jsx)("path",{d:"m6.34 17.66-1.41 1.41"}),(0,t.jsx)("path",{d:"m19.07 4.93-1.41 1.41"})]})}function R0({className:e}){return(0,t.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,t.jsx)("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function L0({children:e,serverUrl:i,title:a,token:o,onLogout:l}){const d=u.useThemeMode$1(),f=(0,n.useMemo)(()=>[(0,ee.splitLink)({condition:$=>$.type==="subscription",true:(0,ee.wsLink)({client:(0,ee.createWSClient)({url:i.replace(/^http/,"ws")+"/trpc",connectionParams:()=>({token:o})}),transformer:st}),false:(0,ee.httpLink)({url:`${i}/trpc`,transformer:st,headers:()=>({authorization:`Bearer ${o}`})})})],[i,o]),p=(0,n.useMemo)(()=>(0,ee.createTRPCClient)({links:f}),[f]),g=(0,n.useMemo)(()=>S.createClient({links:f}),[f]),h=(0,n.useMemo)(()=>(0,Oe.createSystem)({serverUrl:i,token:o}),[i,o]);(0,n.useEffect)(()=>(h.init().catch(()=>{}),()=>{h.close()}),[h]);const b=(0,n.useMemo)(()=>new te.QueryClient,[]),w=(0,n.useMemo)(()=>({trpc:p,token:o,logout:l}),[p,o,l]);return(0,t.jsx)(bd,{system:h,children:(0,t.jsx)(S.Provider,{client:g,queryClient:b,children:(0,t.jsx)(te.QueryClientProvider,{client:b,children:(0,t.jsx)(_f.Provider,{value:w,children:(0,t.jsxs)("div",{className:"min-h-screen bg-background text-foreground",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-surface px-4 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"rounded bg-warning/20 px-2 py-0.5 text-xs font-bold text-warning",children:"DEV MODE"}),a&&(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:a}),(0,t.jsx)("span",{className:"text-xs text-foreground-subtle",children:i})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.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,t.jsx)(T0,{className:"h-3.5 w-3.5"}):(0,t.jsx)(R0,{className:"h-3.5 w-3.5"}),d.mode==="dark"?"Dark":d.mode==="light"?"Light":"System"]}),(0,t.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,t.jsx)("div",{className:"p-4",children:e({trpc:p,theme:d})})]})})})})})}function wf({children:e,serverUrl:i="https://localhost:4443",title:a}){const[o,l]=(0,n.useState)(z0),d=(0,n.useCallback)(async(p,g)=>{const h=await(0,ee.createTRPCClient)({links:[(0,ee.httpLink)({url:`${i}/trpc`,transformer:st})]}).auth.login.mutate({username:p,password:g});if(!h.token)throw new Error("No token returned");localStorage.setItem(Tl,h.token),l(h.token)},[i]),f=(0,n.useCallback)(()=>{localStorage.removeItem(Tl),l(null)},[]);return o?(0,t.jsx)(u.ThemeProvider$1,{children:(0,t.jsx)(L0,{serverUrl:i,title:a,token:o,onLogout:f,children:e})}):(0,t.jsx)(u.ThemeProvider$1,{children:(0,t.jsx)(xf,{onLogin:d,serverUrl:i})})}function Z0(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,A.createRoot)(d).render((0,n.createElement)(wf,{serverUrl:a,title:o,children:({trpc:f,theme:p})=>(0,n.createElement)(e,{trpc:f,theme:{isDark:p.resolvedMode==="dark"},navigate:g=>{console.log("[dev] navigate:",g)}})}))}var Sf=$r("camstack:custom-field-renderers",{});function U0({renderers:e,children:i}){return(0,t.jsx)(Sf.Provider,{value:e,children:i})}function jf(e){return(0,n.useContext)(Sf)[e]??null}var Rl=$r("camstack:device-context",null);function B0({deviceId:e,device:i,children:a}){const o={deviceId:e,device:i??null};return(0,t.jsx)(Rl.Provider,{value:o,children:a})}function $f(){return(0,n.useContext)(Rl)?.deviceId??null}function F0(){return(0,n.useContext)(Rl)?.device??null}var G0=S.accessories.getStatus.useQuery,V0=S.addonPages.listPages.useQuery,kf=S.addons.list.useQuery,W0=S.addons.getLogs.useQuery,Q0=S.addons.listPackages.useQuery,H0=S.addons.installPackage.useMutation,q0=S.addons.installFromWorkspace.useMutation,J0=S.addons.isWorkspaceAvailable.useQuery,K0=S.addons.listWorkspacePackages.useQuery,X0=S.addons.uninstallPackage.useMutation,Y0=S.addons.reloadPackages.useMutation,ex=S.addons.searchAvailable.useQuery,tx=S.addons.listUpdates.useQuery,rx=S.addons.updatePackage.useMutation,nx=S.addons.rollbackPackage.useMutation,ix=S.addons.forceRefresh.useMutation,ax=S.addons.restartServer.useMutation,ox=S.addons.getLastRestart.useQuery,sx=S.addons.listFrameworkPackages.useQuery,lx=S.addons.listCapabilityProviders.useQuery,cx=S.addons.setCapabilityProviderEnabled.useMutation,ux=S.addons.updateFrameworkPackage.useMutation,dx=S.addons.startBulkUpdate.useMutation,fx=S.addons.getBulkUpdateState.useQuery,mx=S.addons.cancelBulkUpdate.useMutation,gx=S.addons.listActiveBulkUpdates.useQuery,px=S.addons.getVersions.useQuery,hx=S.addons.restartAddon.useMutation,vx=S.addons.retryLoad.useMutation,bx=S.addons.getAutoUpdateSettings.useQuery,yx=S.addons.setAutoUpdateSettings.useMutation,xx=S.addons.getAddonAutoUpdate.useQuery,_x=S.addons.setAddonAutoUpdate.useMutation,wx=S.addons.applyAutoUpdateToAll.useMutation,Sx=S.addons.custom.useMutation,jx=S.addons.onAddonLogs.useSubscription,$x=S.addonSettings.getGlobalSettings.useQuery,kx=S.addonSettings.updateGlobalSettings.useMutation,Px=S.addonSettings.getDeviceSettings.useQuery,Nx=S.addonSettings.updateDeviceSettings.useMutation,Pf=S.addonWidgets.listWidgets.useQuery,Cx=S.alerts.emit.useMutation,Ox=S.alerts.update.useMutation,Mx=S.alerts.list.useQuery,Ex=S.alerts.getUnreadCount.useQuery,Ix=S.alerts.markRead.useMutation,Dx=S.alerts.markAllRead.useMutation,Ax=S.alerts.dismiss.useMutation,zx=S.audioAnalysis.resolveDeviceSettings.useQuery,Tx=S.audioAnalysis.getDeviceSettingsContribution.useQuery,Rx=S.audioAnalysis.getDeviceLiveContribution.useQuery,Lx=S.audioAnalysis.applyDeviceSettingsPatch.useMutation,Zx=S.audioAnalyzer.analyseChunk.useMutation,Ux=S.audioAnalyzer.classify.useQuery,Bx=S.audioAnalyzer.isReady.useQuery,Fx=S.audioAnalyzer.dispose.useMutation,Gx=S.audioAnalyzer.reprobeAudioEngine.useMutation,Vx=S.audioCodec.listSupportedCodecs.useQuery,Wx=S.audioCodec.canHandle.useQuery,Qx=S.audioCodec.createDecodeSession.useMutation,Hx=S.audioCodec.createEncodeSession.useMutation,qx=S.audioCodec.closeSession.useMutation,Jx=S.audioCodec.pushEncodedFrame.useMutation,Kx=S.audioCodec.pullPcm.useQuery,Xx=S.audioCodec.pushPcm.useMutation,Yx=S.audioCodec.pullEncoded.useQuery,e_=S.audioCodec.flushEncode.useMutation,t_=S.audioCodec.listActiveSessions.useQuery,r_=S.audioMetrics.getCurrentSnapshot.useQuery,n_=S.audioMetrics.getHistory.useQuery,i_=S.backup.listDestinations.useQuery,a_=S.backup.trigger.useMutation,o_=S.backup.list.useQuery,s_=S.backup.listLocations.useQuery,l_=S.backup.getEntries.useQuery,c_=S.backup.restore.useMutation,u_=S.backup.delete.useMutation,d_=S.backup.listArchives.useQuery,f_=S.backup.upsertDestinationPolicy.useMutation,m_=S.backup.previewSchedule.useQuery,g_=S.battery.getStatus.useQuery,p_=S.brightness.setBrightness.useMutation,h_=S.brightness.getStatus.useQuery,v_=S.cameraCredentials.getCredentials.useQuery,b_=S.cameraCredentials.getStatus.useQuery,y_=S.cameraPipelineConfig.getDeviceSettingsContribution.useQuery,x_=S.cameraPipelineConfig.getDeviceLiveContribution.useQuery,__=S.cameraPipelineConfig.applyDeviceSettingsPatch.useMutation,w_=S.cameraStreams.getCameraStreams.useQuery,S_=S.cameraStreams.getBrokerStreams.useQuery,Nf=S.cameraStreams.getRtspEntries.useQuery,j_=S.decoder.supportsCodec.useQuery,$_=S.decoder.getInfo.useQuery,k_=S.decoder.createSession.useQuery,P_=S.decoder.destroySession.useQuery,N_=S.decoder.pushPacket.useQuery,C_=S.decoder.openStream.useQuery,O_=S.decoder.pullFrames.useQuery,M_=S.decoder.pullHandles.useQuery,E_=S.decoder.getFrame.useQuery,I_=S.decoder.getShmStats.useQuery,D_=S.decoder.updateConfig.useQuery,A_=S.decoder.getStats.useQuery,z_=S.decoder.listActiveSessions.useQuery,T_=S.decoder.reprobeHwaccel.useMutation,R_=S.detectionPipeline.getDeviceSettingsContribution.useQuery,L_=S.detectionPipeline.getDeviceLiveContribution.useQuery,Z_=S.detectionPipeline.applyDeviceSettingsPatch.useMutation,U_=S.deviceDiscovery.listDiscovered.useQuery,B_=S.deviceDiscovery.refreshDiscovery.useMutation,F_=S.deviceDiscovery.adoptDevice.useMutation,G_=S.deviceDiscovery.releaseDevice.useMutation,V_=S.deviceDiscovery.getStatus.useQuery,Cf=S.deviceExport.getStatus.useQuery,Of=S.deviceExport.listSupportedDeviceKinds.useQuery,Mf=S.deviceExport.listExposedDevices.useQuery,Ef=S.deviceExport.exposeDevice.useMutation,If=S.deviceExport.unexposeDevice.useMutation,W_=S.deviceExport.getDeviceSettingsContribution.useQuery,Q_=S.deviceExport.getDeviceLiveContribution.useQuery,H_=S.deviceExport.applyDeviceSettingsPatch.useMutation,q_=S.deviceManager.allocateDeviceId.useMutation,J_=S.deviceManager.registerDevice.useMutation,K_=S.deviceManager.removeDevice.useMutation,X_=S.deviceManager.persistConfig.useMutation,Y_=S.deviceManager.loadConfig.useQuery,e1=S.deviceManager.loadRuntimeState.useQuery,t1=S.deviceManager.loadMeta.useQuery,r1=S.deviceManager.setName.useMutation,n1=S.deviceManager.setLocation.useMutation,i1=S.deviceManager.setMetadata.useMutation,a1=S.deviceManager.listLocations.useQuery,o1=S.deviceManager.addLocation.useMutation,s1=S.deviceManager.removeLocation.useMutation,l1=S.deviceManager.setDisabled.useMutation,c1=S.deviceManager.listPersistedByAddon.useQuery,Ll=S.deviceManager.listAll.useQuery,u1=S.deviceManager.getDevice.useQuery,d1=S.deviceManager.getChildren.useQuery,f1=S.deviceManager.getStreamSources.useQuery,m1=S.deviceManager.getConfigSchema.useQuery,g1=S.deviceManager.getSettingsSchema.useQuery,p1=S.deviceManager.updateConfig.useMutation,h1=S.deviceManager.enable.useMutation,v1=S.deviceManager.disable.useMutation,b1=S.deviceManager.remove.useMutation,y1=S.deviceManager.getStreamProfileMap.useQuery,x1=S.deviceManager.setStreamProfileMap.useMutation,_1=S.deviceManager.probeStreams.useMutation,w1=S.deviceManager.getBindings.useQuery,S1=S.deviceManager.getAllBindings.useQuery,j1=S.deviceManager.setWrapperActive.useMutation,$1=S.deviceManager.listWrappersForCap.useQuery,k1=S.deviceManager.listBindableCapsForDeviceType.useQuery,P1=S.deviceManager.getDeviceSettingsAggregate.useQuery,N1=S.deviceManager.getDeviceLiveInfoAggregate.useQuery,C1=S.deviceManager.getDeviceAggregate.useQuery,O1=S.deviceManager.updateDeviceField.useMutation,M1=S.deviceManager.updateDeviceFieldsBatch.useMutation,E1=S.deviceManager.discoverDevices.useMutation,I1=S.deviceManager.adoptDevice.useMutation,D1=S.deviceManager.getCreationSchema.useQuery,A1=S.deviceManager.createDevice.useMutation,z1=S.deviceManager.testCreationField.useMutation,T1=S.deviceManager.testField.useMutation,R1=S.deviceManager.getDeviceStatusAggregate.useQuery,L1=S.deviceOps.getStreamSources.useQuery,Z1=S.deviceOps.getConfigEntries.useQuery,U1=S.deviceOps.setConfig.useMutation,B1=S.deviceOps.removeDevice.useMutation,F1=S.deviceOps.getSettingsSchema.useQuery,G1=S.deviceProvider.start.useMutation,V1=S.deviceProvider.stop.useMutation,W1=S.deviceProvider.getStatus.useQuery,Q1=S.deviceProvider.getDevices.useQuery,H1=S.deviceProvider.supportsDiscovery.useQuery,q1=S.deviceProvider.discoverDevices.useMutation,J1=S.deviceProvider.adoptDiscoveredDevice.useMutation,K1=S.deviceProvider.supportsManualCreation.useQuery,X1=S.deviceProvider.getChildCreationSchema.useQuery,Y1=S.deviceProvider.createDevice.useMutation,ew=S.deviceProvider.testCreationField.useMutation,tw=S.deviceState.getSnapshot.useQuery,rw=S.deviceState.getCapSlice.useQuery,nw=S.deviceState.getAllSnapshots.useQuery,iw=S.deviceState.setCapSlice.useMutation,aw=S.deviceStatus.getStatus.useQuery,ow=S.doorbell.getStatus.useQuery,sw=S.events.getEvents.useQuery,lw=S.events.getEventThumbnail.useQuery,cw=S.events.getEventClipUrl.useQuery,uw=S.featureProbe.getStatus.useQuery,dw=S.integrations.list.useQuery,fw=S.integrations.get.useQuery,mw=S.integrations.getByAddonId.useQuery,gw=S.integrations.create.useMutation,pw=S.integrations.update.useMutation,hw=S.integrations.delete.useMutation,vw=S.integrations.getSettings.useQuery,bw=S.integrations.setSettings.useMutation,yw=S.integrations.getAvailableTypes.useQuery,xw=S.integrations.testConnection.useMutation,_w=S.intercom.startSession.useMutation,ww=S.intercom.handleAnswer.useMutation,Sw=S.intercom.stopSession.useMutation,jw=S.intercom.startTalkSession.useMutation,$w=S.intercom.pushTalkPcm.useMutation,kw=S.intercom.endTalkSession.useMutation,Pw=S.intercom.getStatus.useQuery,Nw=S.localNetwork.list.useQuery,Cw=S.localNetwork.getPreferred.useQuery,Ow=S.localNetwork.getConnectionEndpoints.useQuery,Mw=S.localNetwork.getAllowedAddresses.useQuery,Ew=S.localNetwork.setAllowedAddresses.useMutation,Iw=S.localNetwork.resetAllowlistToBestMatch.useMutation,Dw=S.meshNetwork.getStatus.useQuery,Aw=S.meshNetwork.join.useMutation,zw=S.meshNetwork.startLogin.useMutation,Tw=S.meshNetwork.leave.useMutation,Rw=S.meshNetwork.logout.useMutation,Lw=S.meshNetwork.listPeers.useQuery,Zw=S.meshNetwork.testConnection.useMutation,Uw=S.metricsProvider.collectSnapshot.useQuery,Bw=S.metricsProvider.getCached.useQuery,Fw=S.metricsProvider.getCurrent.useQuery,Gw=S.metricsProvider.getDiskSpace.useQuery,Vw=S.metricsProvider.getGpuInfo.useQuery,Ww=S.metricsProvider.getCpuTemperature.useQuery,Qw=S.metricsProvider.getProcessStats.useQuery,Hw=S.metricsProvider.listAddonInstances.useQuery,qw=S.metricsProvider.getAddonStats.useQuery,Jw=S.metricsProvider.listNodeProcesses.useQuery,Kw=S.metricsProvider.killProcess.useMutation,Xw=S.motion.isDetected.useQuery,Yw=S.motion.getStatus.useQuery,eS=S.motionDetection.analyze.useMutation,tS=S.motionDetection.removeCamera.useMutation,rS=S.motionDetection.reset.useMutation,nS=S.motionDetection.getDeviceSettingsContribution.useQuery,iS=S.motionDetection.getDeviceLiveContribution.useQuery,aS=S.motionDetection.applyDeviceSettingsPatch.useMutation,oS=S.motionTrigger.setMotionTrigger.useMutation,sS=S.motionTrigger.getStatus.useQuery,lS=S.motionZones.getOptions.useQuery,cS=S.motionZones.setZone.useMutation,uS=S.motionZones.getStatus.useQuery,dS=S.mqttBroker.listBrokers.useQuery,fS=S.mqttBroker.getBrokerConfig.useQuery,mS=S.mqttBroker.addBroker.useMutation,gS=S.mqttBroker.removeBroker.useMutation,pS=S.mqttBroker.testConnection.useMutation,hS=S.mqttBroker.startEmbeddedBroker.useMutation,vS=S.mqttBroker.stopEmbeddedBroker.useMutation,bS=S.mqttBroker.getStatus.useQuery,yS=S.nativeObjectDetection.setEnabled.useMutation,xS=S.nativeObjectDetection.getStatus.useQuery,_S=S.networkAccess.start.useMutation,wS=S.networkAccess.stop.useMutation,SS=S.networkAccess.getEndpoint.useQuery,jS=S.networkAccess.getStatus.useQuery,$S=S.networkAccess.listEndpoints.useQuery,kS=S.networkQuality.getDeviceStats.useQuery,PS=S.networkQuality.getAllStats.useQuery,NS=S.networkQuality.reportClientStats.useMutation,CS=S.nodes.topology.useQuery,OS=S.nodes.deployAddon.useMutation,MS=S.nodes.undeployAddon.useMutation,ES=S.nodes.restartAddon.useMutation,IS=S.nodes.restartProcess.useMutation,DS=S.nodes.restartNode.useMutation,AS=S.nodes.shutdownNode.useMutation,zS=S.nodes.renameNode.useMutation,TS=S.nodes.clusterAddonStatus.useQuery,RS=S.nodes.getCapUsageGraph.useQuery,LS=S.nodes.getNodeAddons.useQuery,ZS=S.nodes.setProcessLogLevel.useMutation,US=S.nodes.executeQuery.useMutation,BS=S.notificationOutput.send.useMutation,FS=S.notificationOutput.sendTest.useMutation,GS=S.osd.setOverlay.useMutation,VS=S.osd.getStatus.useQuery,WS=S.pipelineAnalytics.getActiveTracks.useQuery,QS=S.pipelineAnalytics.getTrack.useQuery,HS=S.pipelineAnalytics.listTracks.useQuery,qS=S.pipelineAnalytics.clearTracks.useMutation,JS=S.pipelineAnalytics.getMotionEvents.useQuery,KS=S.pipelineAnalytics.getObjectEvents.useQuery,XS=S.pipelineAnalytics.getAudioEvents.useQuery,YS=S.pipelineAnalytics.getEventMedia.useQuery,ej=S.pipelineAnalytics.getTrackMedia.useQuery,tj=S.pipelineAnalytics.getDeviceSettingsContribution.useQuery,rj=S.pipelineAnalytics.getDeviceLiveContribution.useQuery,nj=S.pipelineAnalytics.applyDeviceSettingsPatch.useMutation,ij=S.pipelineExecutor.getAvailableEngines.useQuery,aj=S.pipelineExecutor.getSelectedEngine.useQuery,oj=S.pipelineExecutor.getDefaultSteps.useQuery,sj=S.pipelineExecutor.reprobeEngine.useMutation,lj=S.pipelineExecutor.getVideoPipelineSteps.useQuery,cj=S.pipelineExecutor.setVideoPipelineSteps.useMutation,uj=S.pipelineExecutor.getSchema.useQuery,dj=S.pipelineExecutor.getGlobalSteps.useQuery,fj=S.pipelineExecutor.getGlobalPipelineConfig.useQuery,mj=S.pipelineExecutor.getOrchestratorConfigSchema.useQuery,gj=S.pipelineExecutor.listTemplates.useQuery,pj=S.pipelineExecutor.saveTemplate.useMutation,hj=S.pipelineExecutor.updateTemplate.useMutation,vj=S.pipelineExecutor.deleteTemplate.useMutation,bj=S.pipelineExecutor.getCapabilities.useQuery,yj=S.pipelineExecutor.getAddonModels.useQuery,xj=S.pipelineExecutor.downloadModel.useMutation,_j=S.pipelineExecutor.deleteModel.useMutation,wj=S.pipelineExecutor.detect.useQuery,Sj=S.pipelineExecutor.runPipeline.useMutation,jj=S.pipelineExecutor.runPipelineBatch.useMutation,$j=S.pipelineExecutor.cacheFrameInPool.useMutation,kj=S.pipelineExecutor.inferCached.useMutation,Pj=S.pipelineExecutor.uncacheFrame.useMutation,Nj=S.pipelineExecutor.getEffectiveTuning.useQuery,Cj=S.pipelineExecutor.listLoadedEngines.useQuery,Oj=S.pipelineExecutor.spinEngine.useMutation,Mj=S.pipelineExecutor.killEngine.useMutation,Ej=S.pipelineExecutor.listReferenceImages.useQuery,Ij=S.pipelineExecutor.getReferenceImage.useQuery,Dj=S.pipelineExecutor.getReferenceAudioFiles.useQuery,Aj=S.pipelineExecutor.getReferenceAudio.useQuery,zj=S.pipelineExecutor.getAudioCapabilities.useQuery,Tj=S.pipelineExecutor.runAudioTest.useMutation,Rj=S.pipelineExecutor.getDetectionConfigSchema.useQuery,Lj=S.pipelineOrchestrator.assignPipeline.useMutation,Zj=S.pipelineOrchestrator.unassignPipeline.useMutation,Uj=S.pipelineOrchestrator.rebalance.useMutation,Bj=S.pipelineOrchestrator.getPipelineAssignments.useQuery,Fj=S.pipelineOrchestrator.getPipelineAssignment.useQuery,Gj=S.pipelineOrchestrator.getAgentLoad.useQuery,Vj=S.pipelineOrchestrator.getGlobalMetrics.useQuery,Wj=S.pipelineOrchestrator.getCameraMetrics.useQuery,Qj=S.pipelineOrchestrator.getCapabilityBindings.useQuery,Hj=S.pipelineOrchestrator.setCapabilityBinding.useMutation,qj=S.pipelineOrchestrator.assignDecoder.useMutation,Jj=S.pipelineOrchestrator.unassignDecoder.useMutation,Kj=S.pipelineOrchestrator.getDecoderAssignments.useQuery,Xj=S.pipelineOrchestrator.assignAudio.useMutation,Yj=S.pipelineOrchestrator.unassignAudio.useMutation,e$=S.pipelineOrchestrator.getAudioAssignment.useQuery,t$=S.pipelineOrchestrator.getAudioNodeLoad.useQuery,r$=S.pipelineOrchestrator.getAudioAssignments.useQuery,n$=S.pipelineOrchestrator.getDecoderAssignment.useQuery,i$=S.pipelineOrchestrator.getAgentSettings.useQuery,a$=S.pipelineOrchestrator.listAgentSettings.useQuery,o$=S.pipelineOrchestrator.setAgentAddonDefaults.useMutation,s$=S.pipelineOrchestrator.removeAgentSettings.useMutation,l$=S.pipelineOrchestrator.getCameraSettings.useQuery,c$=S.pipelineOrchestrator.setCameraStepToggle.useMutation,u$=S.pipelineOrchestrator.getCameraStepOverrides.useQuery,d$=S.pipelineOrchestrator.setCameraStepOverride.useMutation,f$=S.pipelineOrchestrator.setCameraPipelineForAgent.useMutation,m$=S.pipelineOrchestrator.resolvePipeline.useQuery,g$=S.pipelineOrchestrator.listTemplates.useQuery,p$=S.pipelineOrchestrator.saveTemplate.useMutation,h$=S.pipelineOrchestrator.updateTemplate.useMutation,v$=S.pipelineOrchestrator.deleteTemplate.useMutation,b$=S.pipelineOrchestrator.getDeviceSettingsContribution.useQuery,y$=S.pipelineOrchestrator.getDeviceLiveContribution.useQuery,x$=S.pipelineOrchestrator.applyDeviceSettingsPatch.useMutation,_$=S.pipelineRunner.attachCamera.useMutation,w$=S.pipelineRunner.detachCamera.useMutation,S$=S.pipelineRunner.reportMotion.useMutation,j$=S.pipelineRunner.getLocalLoad.useQuery,$$=S.pipelineRunner.getLocalMetrics.useQuery,k$=S.pipelineRunner.getCameraMetrics.useQuery,P$=S.pipelineRunner.getAllCameraMetrics.useQuery,N$=S.pipelineRunner.getLocalCameras.useQuery,C$=S.platformProbe.getCapabilities.useQuery,O$=S.platformProbe.getHardware.useQuery,M$=S.platformProbe.resolveInferenceConfig.useQuery,E$=S.platformProbe.resolveHwAccel.useQuery,I$=S.platformProbe.getHardwareEncoders.useQuery,D$=S.platformProbe.refreshHardwareEncoders.useMutation,A$=S.privacyMask.getOptions.useQuery,z$=S.privacyMask.setMask.useMutation,T$=S.privacyMask.getStatus.useQuery,R$=S.ptz.move.useMutation,L$=S.ptz.continuousMove.useMutation,Z$=S.ptz.stop.useMutation,U$=S.ptz.getPresets.useQuery,B$=S.ptz.goToPreset.useMutation,F$=S.ptz.savePreset.useMutation,G$=S.ptz.deletePreset.useMutation,V$=S.ptz.getOptions.useQuery,W$=S.ptz.goHome.useMutation,Q$=S.ptz.getPosition.useQuery,H$=S.ptz.setAutofocus.useMutation,q$=S.ptz.getStatus.useQuery,Df=S.ptzAutotrack.getStatus.useQuery,Af=S.ptzAutotrack.setEnabled.useMutation,J$=S.ptzAutotrack.getSettings.useQuery,zf=S.ptzAutotrack.setSettings.useMutation,K$=S.reboot.reboot.useMutation,X$=S.recording.getSegments.useQuery,Y$=S.recording.getPlaybackUrl.useQuery,ek=S.recording.getThumbnailAt.useQuery,tk=S.recordingEngine.getStatus.useQuery,rk=S.recordingEngine.enable.useMutation,nk=S.recordingEngine.disable.useMutation,ik=S.recordingEngine.getConfig.useQuery,ak=S.recordingEngine.updateConfig.useMutation,ok=S.recordingEngine.getPlaylist.useQuery,sk=S.recordingEngine.getThumbnail.useQuery,lk=S.recordingEngine.getSegments.useQuery,ck=S.recordingEngine.getAvailability.useQuery,uk=S.recordingEngine.estimateStorage.useQuery,dk=S.recordingEngine.estimateGlobalStorage.useQuery,fk=S.recordingEngine.getStorageUsage.useQuery,mk=S.recordingEngine.setPolicy.useMutation,gk=S.recordingEngine.getPolicy.useQuery,pk=S.recordingEngine.getPolicyStatus.useQuery,hk=S.recordingEngine.getRetentionConfig.useQuery,vk=S.recordingEngine.updateRetentionConfig.useMutation,bk=S.recordingEngine.getMotionStats.useQuery,yk=S.settingsStore.get.useQuery,xk=S.settingsStore.set.useMutation,_k=S.settingsStore.query.useQuery,wk=S.settingsStore.insert.useMutation,Sk=S.settingsStore.update.useMutation,jk=S.settingsStore.delete.useMutation,$k=S.settingsStore.count.useQuery,kk=S.settingsStore.isEmpty.useQuery,Pk=S.settingsStore.declareCollection.useMutation,Nk=S.snapshot.getSnapshot.useQuery,Ck=S.snapshot.invalidateCache.useMutation,Ok=S.snapshot.getStatus.useQuery,Mk=S.snapshot.getDeviceSettingsContribution.useQuery,Ek=S.snapshot.getDeviceLiveContribution.useQuery,Ik=S.snapshot.applyDeviceSettingsPatch.useMutation,Dk=S.snapshotProvider.supportsDevice.useQuery,Ak=S.snapshotProvider.getSnapshot.useQuery,zk=S.storage.resolve.useQuery,Tk=S.storage.write.useMutation,Rk=S.storage.read.useQuery,Lk=S.storage.exists.useQuery,Zk=S.storage.list.useQuery,Uk=S.storage.delete.useMutation,Bk=S.storage.getAvailableSpace.useQuery,Fk=S.storage.beginUpload.useMutation,Gk=S.storage.writeChunk.useMutation,Vk=S.storage.finalizeUpload.useMutation,Wk=S.storage.abortUpload.useMutation,Qk=S.storage.beginDownload.useMutation,Hk=S.storage.readChunk.useQuery,qk=S.storage.endDownload.useMutation,Jk=S.storage.listLocations.useQuery,Kk=S.storage.getDefaultLocation.useQuery,Xk=S.storage.upsertLocation.useMutation,Yk=S.storage.deleteLocation.useMutation,eP=S.storage.testLocation.useQuery,tP=S.storage.listProviders.useQuery,rP=S.storage.testConfig.useQuery,nP=S.streamBroker.publishCameraStream.useMutation,iP=S.streamBroker.retractCameraStream.useMutation,aP=S.streamBroker.assignProfile.useMutation,oP=S.streamBroker.unassignProfile.useMutation,sP=S.streamBroker.listAllCameraStreams.useQuery,lP=S.streamBroker.listAllProfileSlots.useQuery,cP=S.streamBroker.getBrokerStats.useQuery,uP=S.streamBroker.listClients.useQuery,dP=S.streamBroker.killClient.useMutation,fP=S.streamBroker.restartProfile.useMutation,mP=S.streamBroker.getStreamUrl.useQuery,gP=S.streamBroker.getStreamWithCodec.useMutation,pP=S.streamBroker.releaseStreamWithCodec.useMutation,hP=S.streamBroker.subscribeAudioChunks.useMutation,vP=S.streamBroker.pullAudioChunks.useQuery,bP=S.streamBroker.unsubscribeAudioChunks.useMutation,yP=S.streamBroker.subscribeFrames.useMutation,xP=S.streamBroker.pullFrameHandles.useQuery,_P=S.streamBroker.unsubscribeFrames.useMutation,wP=S.streamBroker.setPreBufferDuration.useMutation,SP=S.streamBroker.getPreBufferInfo.useQuery,jP=S.streamBroker.getRtspPort.useQuery,$P=S.streamBroker.getAllRtspEntries.useQuery,kP=S.streamBroker.getRtspEntry.useQuery,PP=S.streamBroker.regenerateRtspToken.useMutation,NP=S.streamBroker.setRtspEnabled.useMutation,CP=S.streamBroker.isRtspEnabled.useQuery,OP=S.streamBroker.getDeviceSettingsContribution.useQuery,MP=S.streamBroker.getDeviceLiveContribution.useQuery,EP=S.streamBroker.applyDeviceSettingsPatch.useMutation,IP=S.streamCatalog.getCatalog.useQuery,DP=S.streamParams.getOptions.useQuery,AP=S.streamParams.setProfile.useMutation,zP=S.streamParams.getConfigSchema.useQuery,TP=S.streamParams.getStatus.useQuery,RP=S.switch.setState.useMutation,LP=S.switch.getStatus.useQuery,ZP=S.system.info.useQuery,UP=S.system.health.useQuery,BP=S.system.featureFlags.useQuery,FP=S.system.networkAddresses.useQuery,GP=S.system.getRetentionConfig.useQuery,VP=S.system.setRetentionConfig.useMutation,WP=S.system.forceRetentionCleanup.useMutation,QP=S.toast.onToast.useSubscription,HP=S.turnProvider.getTurnServers.useQuery,qP=S.userManagement.listUsers.useQuery,JP=S.userManagement.createUser.useMutation,KP=S.userManagement.updateUser.useMutation,XP=S.userManagement.deleteUser.useMutation,YP=S.userManagement.resetPassword.useMutation,eN=S.userManagement.setUserScopes.useMutation,tN=S.userManagement.validateCredentials.useMutation,rN=S.userManagement.listApiKeys.useQuery,nN=S.userManagement.createApiKey.useMutation,iN=S.userManagement.revokeApiKey.useMutation,aN=S.userManagement.validateApiKey.useMutation,oN=S.userManagement.createScopedToken.useMutation,sN=S.userManagement.revokeScopedToken.useMutation,lN=S.userManagement.validateScopedToken.useQuery,cN=S.userManagement.listScopedTokens.useQuery,uN=S.userManagement.setupTotp.useMutation,dN=S.userManagement.confirmTotp.useMutation,fN=S.userManagement.disableTotp.useMutation,mN=S.userManagement.getTotpStatus.useQuery,gN=S.userManagement.verifyTotp.useMutation,pN=S.userManagement.oauthIssueCode.useMutation,hN=S.userManagement.oauthExchangeCode.useMutation,vN=S.userManagement.oauthRefresh.useMutation,bN=S.userManagement.oauthVerifyAccessToken.useQuery,yN=S.userManagement.listOauthSessions.useQuery,xN=S.userManagement.revokeOauthSession.useMutation,_N=S.webrtcSession.listStreams.useQuery,wN=S.webrtcSession.createSession.useMutation,SN=S.webrtcSession.handleOffer.useMutation,jN=S.webrtcSession.handleAnswer.useMutation,$N=S.webrtcSession.addIceCandidate.useMutation,kN=S.webrtcSession.getIceCandidates.useQuery,PN=S.webrtcSession.closeSession.useMutation,NN=S.webrtcSession.hasAdaptiveBitrate.useQuery,CN=S.zoneAnalytics.getCurrentSnapshot.useQuery,ON=S.zoneAnalytics.getZoneHistory.useQuery,MN=S.zoneAnalytics.getCameraHistory.useQuery,EN=S.zoneAnalytics.getUnzonedHistory.useQuery,IN=S.zoneRules.listRules.useQuery,DN=S.zoneRules.setRules.useMutation,AN=S.zones.listZones.useQuery,zN=S.zones.addZone.useMutation,TN=S.zones.removeZone.useMutation,RN=S.zones.updateZone.useMutation,Tf=$r("camstack:widget-registry",null),Wa=new Map,Qa=new Map,Rf=new Set;function Zl(e,i){return`${e}::${i}`}function LN(e){if(!e||typeof e!="object")return!1;const i=e.default;return i!==null&&typeof i=="object"}function ZN(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 Ul(e,i,a){const o=Zl(e,i),l=Wa.get(o);if(l)return l;const d=Qa.get(o);if(d)return d;Rf.has(e)||(mu(),wh([{name:e,entry:a,type:"module"}],{force:!1}),Rf.add(e));const f=_h(`${e}/${i.startsWith("./")?i.slice(2):i}`).then(p=>{if(!LN(p)){const h=ZN(p);throw new Error(`Remote ${e} (${a}) does not expose a default record on '${i}'. Got: ${JSON.stringify(h)}`)}const g=p.default;return Wa.set(o,g),Qa.delete(o),g}).catch(p=>{throw Qa.delete(o),p});return Qa.set(o,f),f}function Bl(e,i){return Wa.get(Zl(e,i))}var UN=3e4,BN=2e3;function FN({children:e}){const i=(0,te.useQueryClient)(),a=(0,n.useRef)(Date.now()),{data:o}=Pf(void 0,{staleTime:0,refetchOnMount:"always",refetchInterval:g=>{const h=g.state.data;return h&&h.length>0||Date.now()-a.current>=UN?!1:BN}});Qi("addon.widget-ready",()=>{i.invalidateQueries({queryKey:[["addonWidgets","listWidgets"]]})});const[l,d]=(0,n.useState)(0),f=(0,n.useMemo)(()=>o??[],[o]);(0,n.useEffect)(()=>{if(f.length===0)return;let g=!1;const h=new Set;for(const b of f){const w=Zl(b.remote.remoteName,b.remote.exposedModule);if(h.has(w)||(h.add(w),Wa.has(w)))continue;const $=b.bundleUrl;Ul(b.remote.remoteName,b.remote.exposedModule,$).then(()=>{g||d(P=>P+1)}).catch(P=>{const M=P instanceof Error?P.message:String(P);(typeof globalThis<"u"?globalThis.console:void 0)?.error?.("[WidgetRegistry] Failed to load widget remote",{remoteName:b.remote.remoteName,exposedModule:b.remote.exposedModule,entryUrl:$,reason:M})})}return()=>{g=!0}},[f]);const p=(0,n.useMemo)(()=>{const g=new Map,h=new Map;for(const w of f)g.set(`${w.addonId}/${w.stableId}`,w),h.set(w.remote.remoteName,w.bundleUrl);const b=(w,$)=>({widgetId:w,addonId:$.addonId,stableId:$.stableId,tab:$.tab,subTab:$.subTab,label:$.label,order:$.order,kind:$.kind,remote:$.remote,description:$.description,icon:$.icon,bundleUrl:$.bundleUrl,hosts:$.hosts,requires:$.requires,defaultSize:$.defaultSize,allowedSizes:$.allowedSizes,defaultColumns:$.defaultColumns,defaultRows:$.defaultRows});return{resolve:w=>{const $=g.get(w);if(!$)return;const P=Bl($.remote.remoteName,$.remote.exposedModule);if(!P)return null;const M=P[$.remote.componentKey??$.stableId];if(M)return M},metadata:w=>{const $=g.get(w);if($)return b(w,$)},listAll:()=>{const w=[];for(const[$,P]of g)w.push(b($,P));return w},entryUrlFor:w=>h.get(w)}},[f,l]);return(0,t.jsx)(Tf.Provider,{value:p,children:e})}function GN(e){return Ha().resolve(e)}function Lf(e){return Ha().metadata(e)}function VN(){return Ha().listAll()}function Zf(e,i){const a=Fl(),o=i??a?.entryUrlFor(e.remoteName),[l,d]=(0,n.useState)(0),[f,p]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!o||(p(!1),Bl(e.remoteName,e.exposedModule)))return;let g=!1;return Ul(e.remoteName,e.exposedModule,o).then(()=>{g||d(h=>h+1)}).catch(h=>{const b=h instanceof Error?h.message:String(h);(typeof globalThis<"u"?globalThis.console:void 0)?.error?.("[WidgetRegistry] Failed to load remote component",{remoteName:e.remoteName,exposedModule:e.exposedModule,entryUrl:o,reason:b}),g||p(!0)}),()=>{g=!0}},[e.remoteName,e.exposedModule,o]),(0,n.useMemo)(()=>{if(!o||f)return;const g=Bl(e.remoteName,e.exposedModule);if(!g)return null;const h=e.componentKey;return h===void 0?Object.values(g)[0]??void 0:g[h]??void 0},[e.remoteName,e.exposedModule,e.componentKey,o,l,f])}function Ha(){const e=Fl();if(!e)throw new Error("useWidgetRegistry(): no <WidgetRegistryProvider> in tree");return e}function Fl(){return WN(Tf)}function WN(e){return(0,n.useContext)(e)}function QN({deviceId:e}){const i=Ur(cr().trpcClient,e),[a,o]=(0,n.useState)(null),[l,d]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!i)return;let p=!1;return(async()=>{try{const g=await i.ptz?.getStatus({});if(p||!g)return;o(g.autofocus)}catch{}})(),()=>{p=!0}},[i]);const f=(0,n.useCallback)(async()=>{if(!(!i?.ptz||a===null)){d(!0);try{const p=!a;await i.ptz.setAutofocus({enabled:p}),o(p)}catch(p){console.error("ptz.setAutofocus failed",p)}finally{d(!1)}}},[i,a]);return a===null?null:(0,t.jsxs)("div",{className:"flex items-center justify-between border-t border-border/40 mt-2 pt-2",children:[(0,t.jsx)("span",{className:"text-[10.5px] font-semibold text-foreground",children:"Autofocus"}),(0,t.jsxs)("button",{type:"button",onClick:()=>void f(),disabled:l,"aria-pressed":a,className:`flex items-center gap-1.5 rounded-md px-2 py-1 text-[10px] font-medium transition-colors ${a?"bg-success/15 text-success hover:bg-success/25":"bg-surface-elevated/40 text-foreground-subtle hover:bg-surface-hover hover:text-foreground"} disabled:opacity-50`,children:[(0,t.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${a?"bg-success":"bg-foreground-subtle/40"}`}),a?"On":"Off"]})]})}function Uf({deviceId:e}){const i=cr(),a=Number.isFinite(e),o=jl(i.trpcClient,a?e:0,{enabled:a});if(!a)return(0,t.jsxs)("div",{className:"flex items-center justify-center h-full text-[11px] text-foreground-subtle italic",children:["Device #",e," not loaded."]});const l=o.options?.hasAutofocus===!0;return(0,t.jsxs)("div",{className:"flex flex-col h-full overflow-y-auto",children:[(0,t.jsx)("h3",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wider mb-2",children:"PTZ"}),(0,t.jsx)($l,{controls:o,mode:"panel"}),l&&(0,t.jsx)(QN,{deviceId:e})]})}function Bf(e){const i=(0,te.useQueryClient)(),a=Df({deviceId:e??0},{enabled:e!==null&&Number.isFinite(e),refetchInterval:5e3,retry:1}),o=Af({onSuccess:()=>{i.invalidateQueries({queryKey:[["ptzAutotrack"]]})}}),l=zf({onSuccess:()=>{i.invalidateQueries({queryKey:[["ptzAutotrack"]]})}}),d=(0,n.useCallback)(async g=>{e!==null&&await o.mutateAsync({deviceId:e,enabled:g})},[e,o]),f=(0,n.useCallback)(async g=>{e!==null&&await l.mutateAsync({deviceId:e,settings:g})},[e,l]),p=a.error?a.error.message:o.error?o.error.message:l.error?l.error.message:null;return{status:a.data??null,isLoading:a.isLoading,isPending:o.isPending||l.isPending,error:p,setEnabled:d,setSettings:f}}function Ff({deviceId:e}){const{status:i,isLoading:a,isPending:o,error:l,setEnabled:d,setSettings:f}=Bf(Number.isFinite(e)?e:null),[p,g]=(0,n.useState)({targetType:"",stopDelaySeconds:30,disappearDelaySeconds:15}),[h,b]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(h)return;const w=i?.currentSettings;w&&g({targetType:w.targetType,stopDelaySeconds:w.stopDelaySeconds,disappearDelaySeconds:w.disappearDelaySeconds})},[i,h]),a&&!i?(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 text-[10.5px] text-foreground-subtle",children:[(0,t.jsx)(Wt,{className:"h-3 w-3 animate-spin"}),"Loading autotrack…"]}):(0,t.jsxs)("div",{className:"border-t border-border/40 mt-2 pt-2 px-1 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-2",children:[(0,t.jsxs)("h3",{className:"flex items-center gap-1.5 text-[11px] font-semibold text-foreground-subtle uppercase tracking-wider",children:[(0,t.jsx)(Ys,{className:"h-3 w-3 text-primary"}),"Autotrack"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>{d(!(i?.enabled??!1))},disabled:o,className:`flex items-center gap-1.5 rounded-md px-2 py-1 text-[10px] font-medium transition-colors ${i?.enabled?"bg-success/15 text-success hover:bg-success/25":"bg-surface-elevated/40 text-foreground-subtle hover:bg-surface-hover hover:text-foreground"} disabled:opacity-50`,"aria-pressed":i?.enabled??!1,children:[(0,t.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${i?.enabled?"bg-success":"bg-foreground-subtle/40"}`}),i?.enabled?"Enabled":"Disabled"]})]}),l&&(0,t.jsxs)("div",{className:"flex items-start gap-1.5 rounded-md border border-danger/30 bg-danger/5 px-2 py-1.5 text-[10px] text-danger",children:[(0,t.jsx)(_n,{className:"h-3 w-3 flex-shrink-0 mt-0.5"}),(0,t.jsx)("span",{className:"leading-snug break-words",children:l})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2 px-2",children:[(i?.supportedTargetTypes?.length??0)>0&&(0,t.jsxs)("label",{className:"col-span-2 flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[10px] font-medium text-foreground-subtle",children:"Target type"}),(0,t.jsx)("select",{value:p.targetType,onFocus:()=>b(!0),onChange:w=>g($=>({...$,targetType:w.target.value})),onBlur:()=>{b(!1);const w=i?.currentSettings?.targetType??"";p.targetType!==w&&f({targetType:p.targetType})},disabled:o,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:border-primary focus:outline-none disabled:opacity-50",children:(i?.supportedTargetTypes??[]).map(w=>(0,t.jsx)("option",{value:w.value,children:w.label},w.value))})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[10px] font-medium text-foreground-subtle",children:"Stop delay (s)"}),(0,t.jsx)("input",{type:"number",min:0,max:300,value:p.stopDelaySeconds,onFocus:()=>b(!0),onChange:w=>g($=>({...$,stopDelaySeconds:Number(w.target.value)||0})),onBlur:()=>{b(!1);const w=i?.currentSettings?.stopDelaySeconds??30;p.stopDelaySeconds!==w&&f({stopDelaySeconds:p.stopDelaySeconds})},disabled:o,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:border-primary focus:outline-none disabled:opacity-50"})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[10px] font-medium text-foreground-subtle",children:"Disappear delay (s)"}),(0,t.jsx)("input",{type:"number",min:0,max:300,value:p.disappearDelaySeconds,onFocus:()=>b(!0),onChange:w=>g($=>({...$,disappearDelaySeconds:Number(w.target.value)||0})),onBlur:()=>{b(!1);const w=i?.currentSettings?.disappearDelaySeconds??15;p.disappearDelaySeconds!==w&&f({disappearDelaySeconds:p.disappearDelaySeconds})},disabled:o,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:border-primary focus:outline-none disabled:opacity-50"})]})]}),(0,t.jsx)("p",{className:"px-2 text-[9.5px] text-foreground-subtle leading-snug italic",children:"Settings save on blur. Vendor support varies — Reolink honours all three; Hikvision honours target type + stop delay only (disappear delay is accepted but ignored at firmware push)."})]})}var Gl=$r("camstack:player-overlays-state",null),Vl=$r("camstack:player-overlays-actions",null);function HN({children:e}){const[i,a]=(0,n.useState)(()=>new Map),[o,l]=(0,n.useState)(()=>new Map),d=(0,n.useCallback)(w=>{a($=>{const P=new Map($);return P.set(w.id,w),P})},[]),f=(0,n.useCallback)(w=>{a($=>{if(!$.has(w))return $;const P=new Map($);return P.delete(w),P})},[]),p=(0,n.useCallback)(w=>{l($=>{const P=new Map($);return P.set(w.id,w),P})},[]),g=(0,n.useCallback)(w=>{l($=>{if(!$.has(w))return $;const P=new Map($);return P.delete(w),P})},[]),h=(0,n.useMemo)(()=>({layers:i,buttons:o}),[i,o]),b=(0,n.useMemo)(()=>({setLayer:d,removeLayer:f,setButton:p,removeButton:g}),[d,f,p,g]);return(0,t.jsx)(Gl.Provider,{value:h,children:(0,t.jsx)(Vl.Provider,{value:b,children:e})})}function qN(){const e=(0,n.useContext)(Gl);return(0,n.useMemo)(()=>e?[...e.layers.values()].sort((i,a)=>i.order-a.order):[],[e])}function Gf(){const e=(0,n.useContext)(Gl);return(0,n.useMemo)(()=>e?[...e.buttons.values()].sort((i,a)=>i.order-a.order):[],[e])}function Wl(e){const i=(0,n.useContext)(Vl);(0,n.useEffect)(()=>{if(!(!i||!e))return i.setLayer(e),()=>i.removeLayer(e.id)},[i,e])}function JN(e){const i=(0,n.useContext)(Vl);(0,n.useEffect)(()=>{if(!(!i||!e))return i.setButton(e),()=>i.removeButton(e.id)},[i,e])}var Vf={rect:"#ef4444",polygon:"#3b82f6",grid:"#6366f1",line:"#f59e0b"},Wf="33",Ql="66",qa="#6366f1",Nn=3,Qf=2,KN=12,Hl=16,ql=9;function ea(e,i,a){return{x:e.x*i,y:e.y*a}}function Jl(e,i,a){return{x:e.x/i,y:e.y/a}}function Hf(e,i,a){return e.flatMap(o=>[o.x*i,o.y*a])}function Cn(e){return!Number.isFinite(e)||e<0?0:e>1?1:e}function XN(e){return e.color??Vf[e.shape.kind]}function YN(e,i){const a=e[i],o=e[(i+1)%e.length];if(!a||!o)return[...e];const l={x:(a.x+o.x)/2,y:(a.y+o.y)/2};return[...e.slice(0,i+1),l,...e.slice(i+1)]}function eC(e,i){return e.length!==i.length?!1:e.every((a,o)=>{const l=i[o];return Math.abs(a.x-l.x)<1e-6&&Math.abs(a.y-l.y)<1e-6})}function tC(e){return e.kind==="polygon"||e.kind==="line"}function rC({items:e,selectedId:i,onSelect:a,onShapeChange:o,onDrawComplete:l,drawingKind:d,supportedShapes:f,transparent:p=!1,backdrop:g,polygonVertices:h,grid:b}){const w=(0,n.useRef)(null),[$,P]=(0,n.useState)({w:800,h:450}),[M,D]=(0,n.useState)([]),[z,R]=(0,n.useState)(null),[Z,G]=(0,n.useState)(null),[Q,W]=(0,n.useState)(null),X=d!==null&&f.includes(d);(0,n.useEffect)(()=>{if(!Q)return;const ue=e.find(ge=>ge.id===Q.itemId);if(!ue||!tC(ue.shape)){W(null);return}eC(ue.shape.points,Q.points)&&W(null)},[e,Q]),(0,n.useEffect)(()=>{const ue=w.current;if(!ue)return;const ge=new ResizeObserver(ve=>{const je=ve[0];if(!je)return;const{width:_e,height:Ue}=je.contentRect;P(p?{w:_e,h:Ue}:{w:_e,h:_e*9/16})});return ge.observe(ue),()=>ge.disconnect()},[p]),(0,n.useEffect)(()=>{!X&&z!==null&&R(null)},[X,z]);const he=(0,n.useCallback)(ue=>{l(ue),D([])},[l]),H=(0,n.useCallback)(ue=>{if(!X||d===null){a(null);return}const ge=ue.target.getStage();if(!ge)return;const ve=ge.getPointerPosition();if(!ve)return;const je=Jl(ve,$.w,$.h);if(d==="rect"){const _e=Cn(je.x),Ue=Cn(je.y);he({kind:"rect",x:_e,y:Ue,width:Math.min(.2,1-_e),height:Math.min(.2,1-Ue)});return}if(d==="grid"){const _e=b?.width??Hl,Ue=b?.height??ql;he({kind:"grid",gridWidth:_e,gridHeight:Ue,cells:Array.from({length:_e*Ue},()=>!1)});return}if(d==="line"){if(M.length===0){D([je]);return}he({kind:"line",points:[...M,je]});return}if(d==="polygon"){if(M.length===0){D([je]);return}if(M.length>=Nn){const _e=ea(M[0],$.w,$.h);if(Math.hypot(ve.x-_e.x,ve.y-_e.y)<KN){he({kind:"polygon",points:M});return}}D(_e=>[..._e,je])}},[X,d,M,$,b,he,a]),me=(0,n.useCallback)(ue=>{!X||d!=="polygon"||M.length<Nn||(ue.cancelBubble=!0,he({kind:"polygon",points:M}))},[X,d,M,he]),ye=(0,n.useRef)(null),Qe=(0,n.useRef)(null);(0,n.useEffect)(()=>()=>{ye.current!==null&&cancelAnimationFrame(ye.current)},[]);const Ye=(0,n.useCallback)(ue=>{if(!X)return;const ge=ue.target.getStage();ge&&(Qe.current=ge.getPointerPosition()??null,ye.current===null&&(ye.current=requestAnimationFrame(()=>{ye.current=null,R(Qe.current)})))},[X]),Je=(0,n.useRef)(!1),Ae=(0,n.useRef)(!0),De=(0,n.useRef)(new Set),Re=(0,n.useCallback)((ue,ge,ve,je)=>{const _e=ge.gridWidth*ge.gridHeight;if(ve<0||ve>=_e||ge.cells[ve]===je)return;const Ue=[...ge.cells];for(;Ue.length<_e;)Ue.push(!1);Ue.length=_e,Ue[ve]=je,o(ue,{...ge,cells:Ue})},[o]),Te=[];if(!p){for(let ue=1;ue<Hl;ue++){const ge=$.w/Hl*ue;Te.push((0,t.jsx)(ie.Line,{points:[ge,0,ge,$.h],stroke:"#ffffff",strokeWidth:.5,opacity:.08},`gv-${ue}`))}for(let ue=1;ue<ql;ue++){const ge=$.h/ql*ue;Te.push((0,t.jsx)(ie.Line,{points:[0,ge,$.w,ge],stroke:"#ffffff",strokeWidth:.5,opacity:.08},`gh-${ue}`))}}return(0,t.jsxs)("div",{ref:w,className:p?"absolute inset-0":"relative w-full bg-zinc-900 rounded-lg overflow-hidden",style:{cursor:X?"crosshair":"default"},children:[g&&!p?(0,t.jsx)("div",{className:"absolute inset-0 pointer-events-none [&>*]:w-full [&>*]:h-full [&>img]:object-cover [&>video]:object-cover",style:{width:$.w,height:$.h},children:g}):null,(0,t.jsxs)(ie.Stage,{width:$.w,height:$.h,onClick:H,onDblClick:me,onMouseMove:Ye,children:[(0,t.jsxs)(ie.Layer,{listening:!1,children:[(0,t.jsx)(ie.Line,{points:[0,0,$.w,0,$.w,$.h,0,$.h,0,0],stroke:"transparent",strokeWidth:0}),Te]}),(0,t.jsx)(ie.Layer,{children:e.map(ue=>{const ge=ue.id===i,ve=ue.enabled===!1,je=XN(ue),_e=ge&&!X&&!ve;if(ue.shape.kind==="rect")return(0,t.jsx)(iC,{item:ue,shape:ue.shape,color:je,selected:ge,dimmed:ve,editable:_e,isDrawing:X,size:$,onSelect:a,onShapeChange:o},ue.id);if(ue.shape.kind==="grid")return(0,t.jsx)(aC,{item:ue,shape:ue.shape,color:je,dimmed:ve,editable:_e,size:$,onSelect:a,paintingRef:Je,paintValueRef:Ae,paintedRef:De,paintCell:Re},ue.id);const Ue=ue.shape.kind==="line",ne=Ue?Qf:Math.max(Nn,h?.min??Nn),we=Ue?Qf:h?.max,Me=Q&&Q.itemId===ue.id?Q.points:ue.shape.points;return(0,t.jsx)(oC,{item:ue,shape:ue.shape,color:je,selected:ge,dimmed:ve,editable:_e,isLine:Ue,isDrawing:X,size:$,effectivePoints:Me,minVertices:ne,maxVertices:we,isDragging:Z===ue.id,onSelect:a,onShapeChange:o,setDragOverride:W,setDraggingItemId:G},ue.id)})}),(0,t.jsx)(ie.Layer,{listening:!1,children:X&&M.length>0&&(0,t.jsxs)(ie.Group,{children:[d==="polygon"&&M.length>=2&&(0,t.jsx)(ie.Line,{points:Hf(M,$.w,$.h),stroke:qa,strokeWidth:1.5,dash:[6,3],opacity:.8}),d==="line"&&M.length===1&&z&&(0,t.jsx)(ie.Line,{points:[M[0].x*$.w,M[0].y*$.h,z.x,z.y],stroke:Vf.line,strokeWidth:1.5,dash:[6,3],opacity:.7}),d==="polygon"&&z&&M.length>=1&&(0,t.jsx)(ie.Line,{points:[M[M.length-1].x*$.w,M[M.length-1].y*$.h,z.x,z.y],stroke:qa,strokeWidth:1,dash:[4,4],opacity:.5}),M.map((ue,ge)=>{const ve=ea(ue,$.w,$.h),je=ge===0&&d==="polygon"&&M.length>=Nn;return(0,t.jsx)(ie.Circle,{x:ve.x,y:ve.y,radius:je?7:4,fill:je?qa:"#ffffff",stroke:qa,strokeWidth:1.5,opacity:.9},ge)})]})})]}),X?(0,t.jsx)("div",{className:"px-3 py-1.5 bg-zinc-800/80 text-[11px] text-zinc-400 border-t border-zinc-700",children:d==="line"?"Click to set the start point, click again to complete the line":d==="rect"?"Click to drop a rectangle, then drag the corner to resize":d==="grid"?"Click to add the grid, then paint cells":M.length<Nn?"Click to add points (min 3). Double-click or click the first point to close.":"Continue adding points. Double-click or click the first point to close."}):null]})}var Ja=.02;function nC(e,i){return Math.abs(e.x-i.x)<1e-6&&Math.abs(e.y-i.y)<1e-6&&Math.abs(e.width-i.width)<1e-6&&Math.abs(e.height-i.height)<1e-6}function iC({item:e,shape:i,color:a,selected:o,dimmed:l,editable:d,isDrawing:f,size:p,onSelect:g,onShapeChange:h}){const[b,w]=(0,n.useState)(null),$={x:i.x,y:i.y,width:i.width,height:i.height};(0,n.useEffect)(()=>{b&&nC($,b)&&w(null)},[i.x,i.y,i.width,i.height,b]);const P=b??$,M=P.x*p.w,D=P.y*p.h,z=P.width*p.w,R=P.height*p.h,Z=l?.35:o?1:.85,G=H=>{w(H),h(e.id,{kind:"rect",x:H.x,y:H.y,width:H.width,height:H.height})},Q=H=>({x:Math.max(-M,Math.min(p.w-(M+z),H.x)),y:Math.max(-D,Math.min(p.h-(D+R),H.y))}),W=H=>{const me=H.target,ye=me.x()/p.w,Qe=me.y()/p.h;if(me.position({x:0,y:0}),ye===0&&Qe===0)return;const Ye=Math.min(Math.max(0,P.x+ye),Math.max(0,1-P.width)),Je=Math.min(Math.max(0,P.y+Qe),Math.max(0,1-P.height));G({...P,x:Ye,y:Je})},X=H=>{const me=H.target,ye=Cn(me.x()/p.w-P.x),Qe=Cn(me.y()/p.h-P.y);w({...P,width:Math.max(Ja,Math.min(ye,1-P.x)),height:Math.max(Ja,Math.min(Qe,1-P.y))})},he=H=>{const me=H.target,ye=Cn(me.x()/p.w-P.x),Qe=Cn(me.y()/p.h-P.y);G({...P,width:Math.max(Ja,Math.min(ye,1-P.x)),height:Math.max(Ja,Math.min(Qe,1-P.y))})};return(0,t.jsx)(ie.Group,{onClick:H=>{H.cancelBubble=!0,f||g(e.id)},children:(0,t.jsxs)(ie.Group,{draggable:d,dragBoundFunc:d?Q:void 0,onDragEnd:d?W:void 0,onMouseEnter:H=>{if(!d)return;const me=H.target.getStage();me&&(me.container().style.cursor="move")},onMouseLeave:H=>{if(!d)return;const me=H.target.getStage();me&&(me.container().style.cursor=f?"crosshair":"default")},children:[(0,t.jsx)(ie.Rect,{x:M,y:D,width:z,height:R,fill:a+(o?Ql:Wf),stroke:a,strokeWidth:o?2.5:1.5,opacity:Z}),e.label?(0,t.jsx)(ie.Text,{x:M,y:D-16,text:e.label,fontSize:12,fill:a,stroke:"#000000",strokeWidth:3,fillAfterStrokeEnabled:!0,fontStyle:"bold",listening:!1}):null,d?(0,t.jsx)(ie.Circle,{x:M+z,y:D+R,radius:6,fill:a,stroke:"#ffffff",strokeWidth:1.5,draggable:!0,dragBoundFunc:H=>({x:Math.min(p.w,Math.max(M,H.x)),y:Math.min(p.h,Math.max(D,H.y))}),onDragStart:H=>{H.cancelBubble=!0},onDragMove:X,onDragEnd:he,onMouseEnter:H=>{const me=H.target.getStage();me&&(me.container().style.cursor="nwse-resize")},onMouseLeave:H=>{const me=H.target.getStage();me&&(me.container().style.cursor="default")}}):null]})})}function aC({item:e,shape:i,color:a,dimmed:o,editable:l,size:d,onSelect:f,paintingRef:p,paintValueRef:g,paintedRef:h,paintCell:b}){const{gridWidth:w,gridHeight:$,cells:P}=i,M=d.w/w,D=d.h/$,z=w*$,R=o?.3:1,Z=W=>{if(!l){f(e.id);return}const X=P[W]!==!0;p.current=!0,g.current=X,h.current=new Set([W]),b(e.id,i,W,X)},G=W=>{!p.current||!l||h.current.has(W)||(h.current.add(W),b(e.id,i,W,g.current))},Q=()=>{p.current&&(p.current=!1,h.current=new Set)};return(0,t.jsx)(ie.Group,{opacity:R,onMouseUp:Q,onMouseLeave:Q,children:Array.from({length:z},(W,X)=>{const he=X%w,H=Math.floor(X/w),me=P[X]===!0;return(0,t.jsx)(ie.Rect,{x:he*M,y:H*D,width:M,height:D,fill:me?a+Ql:"#ffffff10",stroke:me?a:"#ffffff40",strokeWidth:.5,onMouseDown:ye=>{ye.cancelBubble=!0,Z(X)},onMouseEnter:()=>G(X)},X)})})}function oC({item:e,shape:i,color:a,selected:o,dimmed:l,editable:d,isLine:f,isDrawing:p,size:g,effectivePoints:h,minVertices:b,maxVertices:w,isDragging:$,onSelect:P,onShapeChange:M,setDragOverride:D,setDraggingItemId:z}){const R=Hf(h,g.w,g.h),Z=l?.35:o?1:f?.8:.85,G=Ae=>f?{kind:"line",points:[...Ae]}:{kind:"polygon",points:[...Ae]},Q=h.map(Ae=>Ae.x*g.w),W=h.map(Ae=>Ae.y*g.h),X=Q.length>0?Math.min(...Q):0,he=Q.length>0?Math.max(...Q):0,H=W.length>0?Math.min(...W):0,me=W.length>0?Math.max(...W):0,ye=Ae=>({x:Math.max(-X,Math.min(g.w-he,Ae.x)),y:Math.max(-H,Math.min(g.h-me,Ae.y))}),Qe=Ae=>{const De=Ae.target,Re=De.x()/g.w,Te=De.y()/g.h;if(De.position({x:0,y:0}),z(null),Re===0&&Te===0)return;const ue=i.points.map(ge=>({x:ge.x+Re,y:ge.y+Te}));D({itemId:e.id,points:ue}),M(e.id,G(ue))},Ye=!f&&h.length>b,Je=!f&&(w===void 0||h.length<w);return(0,t.jsxs)(ie.Group,{onClick:Ae=>{Ae.cancelBubble=!0,p||P(e.id)},children:[(0,t.jsxs)(ie.Group,{draggable:d,dragBoundFunc:d?ye:void 0,onDragStart:d?()=>z(e.id):void 0,onDragEnd:d?Qe:void 0,onMouseEnter:Ae=>{if(!d)return;const De=Ae.target.getStage();De&&(De.container().style.cursor="move")},onMouseLeave:Ae=>{if(!d)return;const De=Ae.target.getStage();De&&(De.container().style.cursor=p?"crosshair":"default")},children:[f?(0,t.jsx)(ie.Arrow,{points:R,stroke:a,strokeWidth:o?3:2,fill:a,pointerLength:10,pointerWidth:8,opacity:Z}):(0,t.jsx)(ie.Line,{points:R,closed:!0,fill:a+(o?Ql:Wf),stroke:a,strokeWidth:o?2.5:1.5,opacity:Z}),e.label&&h.length>0?(()=>{const Ae=ea({x:h.reduce((Re,Te)=>Re+Te.x,0)/h.length,y:h.reduce((Re,Te)=>Re+Te.y,0)/h.length},g.w,g.h),De=Math.max(40,e.label.length*11*.62);return(0,t.jsx)(ie.Text,{x:Ae.x-De/2,y:Ae.y-7,width:De,align:"center",text:e.label,fontSize:12,fill:a,stroke:"#000000",strokeWidth:3,fillAfterStrokeEnabled:!0,fontStyle:"bold",listening:!1})})():null]}),d&&!$&&h.map((Ae,De)=>{const Re=ea(Ae,g.w,g.h);return(0,t.jsx)(ie.Circle,{x:Re.x,y:Re.y,radius:5,fill:a,stroke:"#ffffff",strokeWidth:1.5,draggable:!0,onDragMove:Te=>{const ue=Jl({x:Te.target.x(),y:Te.target.y()},g.w,g.h);D(ge=>{const ve=ge&&ge.itemId===e.id?ge.points:i.points;return{itemId:e.id,points:ve.map((je,_e)=>_e===De?ue:je)}})},onDragEnd:Te=>{const ue=Jl({x:Te.target.x(),y:Te.target.y()},g.w,g.h),ge=i.points.map((ve,je)=>je===De?ue:ve);D({itemId:e.id,points:ge}),M(e.id,G(ge))},onContextMenu:Te=>{Te.evt.preventDefault(),Te.cancelBubble=!0,Ye&&M(e.id,G(i.points.filter((ue,ge)=>ge!==De)))}},`pt-${De}`)}),d&&!$&&Je&&h.length>=2&&h.map((Ae,De)=>{const Re=h[(De+1)%h.length],Te=ea({x:(Ae.x+Re.x)/2,y:(Ae.y+Re.y)/2},g.w,g.h);return(0,t.jsx)(ie.Circle,{x:Te.x,y:Te.y,radius:4,fill:"#ffffff",stroke:a,strokeWidth:1.5,opacity:.6,onMouseEnter:ue=>{const ge=ue.target;ge.to({radius:6,opacity:1,duration:.1});const ve=ge.getStage();ve&&(ve.container().style.cursor="copy")},onMouseLeave:ue=>{const ge=ue.target;ge.to({radius:4,opacity:.6,duration:.1});const ve=ge.getStage();ve&&(ve.container().style.cursor=p?"crosshair":"default")},onClick:ue=>{ue.cancelBubble=!0,M(e.id,G(YN(i.points,De)))}},`mid-${De}`)})]})}var Kl=(0,n.memo)(rC),sC=110,lC="motion-zones",Xl=0,cC=[1,2,3],Yl=1,ta="rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",ec="rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors";function qf(e,i,a){const o=i*a,l=new Array(o);for(let d=0;d<o;d+=1)l[d]=e[d]===!0;return l}function uC(e,i){if(e.length!==i.length)return!1;for(let a=0;a<e.length;a+=1)if(e[a]!==i[a])return!1;return!0}function Fr(e,i){return Math.ceil(e/i)}function Ka(e,i,a){return Math.min(a-1,Math.floor((e+.5)/i*a))}function Xa(e,i,a,o){const l=Fr(i,o),d=Fr(a,o),f=new Array(l*d).fill(!1);for(let p=0;p<a;p+=1){const g=Ka(p,a,d);for(let h=0;h<i;h+=1)e[p*i+h]===!0&&(f[g*l+Ka(h,i,l)]=!0)}return f}function tc(e,i,a,o){const l=Fr(i,o),d=Fr(a,o),f=new Array(i*a).fill(!1);for(let p=0;p<a;p+=1){const g=Ka(p,a,d);for(let h=0;h<i;h+=1)f[p*i+h]=e[g*l+Ka(h,i,l)]===!0}return f}function Jf({deviceId:e}){const i=Ur(cr().trpcClient,e),[a,o]=(0,n.useState)(null),[l,d]=(0,n.useState)(!1),[f,p]=(0,n.useState)(null),[g,h]=(0,n.useState)(null),[b,w]=(0,n.useState)(Yl),[$,P]=(0,n.useState)(!1),[M,D]=(0,n.useState)(!1),z=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!i)return;let ue=!1;return z.current=!1,o(null),d(!1),p(null),h(null),w(Yl),D(!1),(async()=>{try{const ge=await i.motionZones?.getOptions({});if(ue)return;if(!ge)throw new Error("device proxy not ready");if(o(ge),z.current)return;const ve=await i.motionZones?.getStatus({});if(ue)return;if(!ve)throw new Error("device proxy not ready");z.current=!0;const je=ve.regions.find(Ue=>Ue.shape.kind==="grid"),_e=qf(je?je.shape.cells:[],ge.grid.width,ge.grid.height);h(_e),p(Xa(_e,ge.grid.width,ge.grid.height,Yl))}catch(ge){if(ue)return;B(ge)?d(!0):console.error("Motion Zones load failed",ge)}})(),()=>{ue=!0}},[i]);const R=a?a.grid.width:0,Z=a?a.grid.height:0,G=Fr(R,b),Q=Fr(Z,b),W=(0,n.useMemo)(()=>f&&a?tc(f,R,Z,b):null,[f,a,R,Z,b]),X=(0,n.useMemo)(()=>W!==null&&g!==null&&!uC(W,g),[W,g]),he=(0,n.useMemo)(()=>W?W.reduce((ue,ge)=>ge?ue+1:ue,0):0,[W]),H=R*Z,me=G*Q,ye=(0,n.useCallback)(ue=>{me>0&&p(new Array(me).fill(ue))},[me]),Qe=(0,n.useCallback)(()=>{p(ue=>ue&&ue.map(ge=>!ge))},[]),Ye=(0,n.useCallback)(()=>{g&&a&&p(Xa(g,R,Z,b))},[g,a,R,Z,b]),Je=(0,n.useCallback)(ue=>{ue===b||!a||p(ge=>{if(!ge)return w(ue),ge;const ve=Xa(tc(ge,R,Z,b),R,Z,ue);return w(ue),ve})},[b,a,R,Z]),Ae=(0,n.useMemo)(()=>a&&f?[{id:Xl,shape:{kind:"grid",gridWidth:G,gridHeight:Q,cells:[...f]}}]:[],[a,f,G,Q]),De=(0,n.useCallback)((ue,ge)=>{ge.kind==="grid"&&p(ge.cells)},[]),Re=(0,n.useCallback)(async()=>{if(!(!i||!f||!a)){P(!0);try{const ue=tc(f,a.grid.width,a.grid.height,b),ge={kind:"grid",gridWidth:a.grid.width,gridHeight:a.grid.height,cells:ue};await i.motionZones?.setZone({patch:{regions:[{id:Xl,enabled:!0,shape:ge}]}});const ve=await i.motionZones?.getStatus({});if(ve){const je=ve.regions.find(Ue=>Ue.shape.kind==="grid"),_e=qf(je?je.shape.cells:[],a.grid.width,a.grid.height);h(_e),p(Xa(_e,a.grid.width,a.grid.height,b))}}catch(ue){console.error("Motion Zones save failed",ue)}finally{P(!1)}}},[i,f,a,b]);Wl((0,n.useMemo)(()=>M&&!l&&a&&f?{id:lC,order:sC,node:(0,t.jsx)(Kl,{transparent:!0,items:Ae,supportedShapes:["grid"],grid:{width:G,height:Q},selectedId:Xl,onSelect:()=>{},onShapeChange:De,onDrawComplete:()=>{},drawingKind:null})}:null,[M,l,a,f,Ae,De,G,Q]));const Te=!l&&a!==null&&f!==null;return i?(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)("h3",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wider",children:"Motion Zones"}),l?(0,t.jsx)("p",{className:`${gr} leading-relaxed`,children:"This camera doesn't expose an on-board motion zones grid."}):Te?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:`${gr} leading-relaxed`,children:["Toggle ",(0,t.jsx)("strong",{className:"text-foreground",children:"Edit grid"})," to paint the region directly on the live frame, then ",(0,t.jsx)("strong",{className:"text-foreground",children:"Save"})," to push the mask to the camera. Pick a bigger ",(0,t.jsx)("strong",{className:"text-foreground",children:"Cell size"})," ","for quicker, broad-stroke painting — it's resampled to the camera's native"," ",a.grid.width,"×",a.grid.height," grid on save (×1 is the finest)."]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("button",{type:"button",onClick:()=>D(ue=>!ue),disabled:$,"aria-pressed":M,className:M?ec:ta,children:M?"Done editing":"Edit grid"}),(0,t.jsx)("button",{type:"button",onClick:()=>ye(!0),disabled:$,className:ta,children:"All on"}),(0,t.jsx)("button",{type:"button",onClick:()=>ye(!1),disabled:$,className:ta,children:"All off"}),(0,t.jsx)("button",{type:"button",onClick:Qe,disabled:$,className:ta,children:"Invert"}),(0,t.jsxs)("div",{className:"flex items-center gap-1 ml-1",role:"group","aria-label":"Cell size",children:[(0,t.jsx)("span",{className:`${gr} mr-0.5`,children:"Cell size"}),cC.map(ue=>(0,t.jsxs)("button",{type:"button",onClick:()=>Je(ue),disabled:$,"aria-pressed":b===ue,title:ue===1?`Camera grid ${R}×${Z} (finest)`:`${Fr(R,ue)}×${Fr(Z,ue)} painting grid · cells ×${ue} bigger`,className:b===ue?ec:ta,children:["×",ue]},ue))]}),(0,t.jsxs)("span",{className:`${gr} ml-1 tabular-nums`,children:[he," / ",H," cells · ",a.grid.width,"×",a.grid.height,b!==1?` · paint ${G}×${Q}`:""]}),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsx)("button",{type:"button",onClick:Ye,disabled:$||!X,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",children:"Revert"}),(0,t.jsx)("button",{type:"button",onClick:()=>void Re(),disabled:$||!X,className:ec,children:$?"Saving…":"Save"})]})]}):(0,t.jsx)("p",{className:`${gr} leading-relaxed`,children:"Loading the camera's grid…"})]}):null}var dC=120,fC="privacy-mask",Ya="rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",ra="rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors";function Kf(e){return e.kind==="rect"||e.kind==="polygon"?e:null}function mC(e){const i=new Set(e.map(o=>o.id));let a=0;for(;i.has(a);)a+=1;return a}function gC(e,i){if(e.length!==i.length)return!1;for(let a=0;a<e.length;a+=1)if(JSON.stringify(e[a])!==JSON.stringify(i[a]))return!1;return!0}function pC({deviceId:e}){const i=Ur(cr().trpcClient,e),[a,o]=(0,n.useState)(null),[l,d]=(0,n.useState)(!1),[f,p]=(0,n.useState)(null),[g,h]=(0,n.useState)(null),[b,w]=(0,n.useState)(!1),[$,P]=(0,n.useState)(!1),[M,D]=(0,n.useState)(null),[z,R]=(0,n.useState)(null),Z=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!i)return;let ne=!1;return Z.current=!1,o(null),d(!1),p(null),h(null),P(!1),D(null),R(null),(async()=>{try{const we=await i.privacyMask?.getOptions({});if(ne)return;if(!we)throw new Error("device proxy not ready");if(o(we),Z.current)return;const Me=await i.privacyMask?.getStatus({});if(ne)return;if(!Me)throw new Error("device proxy not ready");Z.current=!0;const ze={enabled:Me.enabled,regions:Me.regions};h(ze),p(ze)}catch(we){if(ne)return;B(we)?d(!0):console.error("Privacy Mask load failed",we)}})(),()=>{ne=!0}},[i]);const G=(0,n.useMemo)(()=>f!==null&&g!==null&&(f.enabled!==g.enabled||!gC(f.regions,g.regions)),[f,g]),Q=f?f.regions.length:0,W=a?a.maxRegions:0,X=(0,n.useRef)(0);(0,n.useEffect)(()=>{X.current=W},[W]);const he=W>0&&Q>=W,H=(0,n.useCallback)(()=>{p(ne=>ne&&{...ne,enabled:!ne.enabled})},[]),me=(0,n.useCallback)(ne=>{D(typeof ne=="number"?ne:null)},[]),ye=(0,n.useMemo)(()=>f?f.regions.map(ne=>({id:ne.id,shape:ne.shape,enabled:ne.enabled,label:`Zone ${String(ne.id)}`})):[],[f]),Qe=(0,n.useCallback)((ne,we)=>{const Me=Kf(we);Me&&p(ze=>ze&&{...ze,regions:ze.regions.map(We=>We.id===ne?{...We,shape:Me}:We)})},[]),Ye=(0,n.useCallback)(ne=>{const we=Kf(ne);we&&(R(null),p(Me=>{if(!Me)return Me;const ze=X.current;if(ze>0&&Me.regions.length>=ze)return Me;const We=mC(Me.regions),Fe={id:We,enabled:!0,shape:we};return D(We),{...Me,regions:[...Me.regions,Fe]}}))},[]),Je=(0,n.useCallback)(ne=>{P(!0),D(null),R(ne)},[]),Ae=(0,n.useCallback)(ne=>{P(!0),R(null),D(ne)},[]),De=(0,n.useCallback)(ne=>{D(we=>we===ne?null:we),p(we=>we&&{...we,regions:we.regions.filter(Me=>Me.id!==ne)})},[]),Re=(0,n.useCallback)(()=>{R(null),D(null),g&&p({enabled:g.enabled,regions:g.regions})},[g]),Te=(0,n.useCallback)(async()=>{if(!(!i||!f)){w(!0);try{await i.privacyMask?.setMask({patch:{enabled:f.enabled,regions:[...f.regions]}});const ne=await i.privacyMask?.getStatus({});if(ne){const we={enabled:ne.enabled,regions:ne.regions};h(we),p(we)}}catch(ne){console.error("Privacy Mask save failed",ne)}finally{w(!1)}}},[i,f]),ue=(0,n.useCallback)(()=>{P(ne=>(ne&&(R(null),D(null)),!ne))},[]),ge=a?.supportedShapes??[];Wl((0,n.useMemo)(()=>$&&!l&&a&&f?{id:fC,order:dC,node:(0,t.jsx)(Kl,{transparent:!0,items:ye,supportedShapes:ge,polygonVertices:a.polygonVertices,selectedId:M,onSelect:me,onShapeChange:Qe,onDrawComplete:Ye,drawingKind:z})}:null,[$,l,a,f,ye,ge,M,me,Qe,Ye,z]));const ve=a?.supportedShapes.includes("rect")??!1,je=a?.supportedShapes.includes("polygon")??!1,_e=a!==null&&(a.maxRegions<=0||a.supportedShapes.length===0),Ue=!l&&!_e&&a!==null&&f!==null;return i?(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)("h3",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wider",children:"Privacy Mask"}),l||_e?(0,t.jsx)("p",{className:`${gr} leading-relaxed`,children:"This camera doesn't support an on-board privacy mask."}):Ue?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:`${gr} leading-relaxed`,children:["Toggle ",(0,t.jsx)("strong",{className:"text-foreground",children:"Edit mask"})," to draw blanked-out zones on the live frame, then ",(0,t.jsx)("strong",{className:"text-foreground",children:"Save"})," to push them to the camera. Drag a rectangle to move, its corner to resize; drag polygon vertices, click an edge midpoint to add one, or right-click a vertex to remove it."]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("button",{type:"button",onClick:ue,disabled:b,"aria-pressed":$,className:$?ra:Ya,children:$?"Done editing":"Edit mask"}),(0,t.jsx)("button",{type:"button",onClick:H,disabled:b,"aria-pressed":f.enabled,className:f.enabled?ra:Ya,children:f.enabled?"Mask on":"Mask off"}),ve&&(0,t.jsx)("button",{type:"button",onClick:()=>Je("rect"),disabled:b||he,"aria-pressed":z==="rect",className:z==="rect"?ra:Ya,title:he?"Maximum zones reached":"Add a rectangle zone",children:"+ Rect"}),je&&(0,t.jsx)("button",{type:"button",onClick:()=>Je("polygon"),disabled:b||he,"aria-pressed":z==="polygon",className:z==="polygon"?ra:Ya,title:he?"Maximum zones reached":"Add a polygon zone",children:"+ Polygon"}),(0,t.jsxs)("span",{className:`${gr} ml-1 tabular-nums`,children:[Q," / ",W," zones"]}),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsx)("button",{type:"button",onClick:Re,disabled:b||!G,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",children:"Revert"}),(0,t.jsx)("button",{type:"button",onClick:()=>void Te(),disabled:b||!G,className:ra,children:b?"Saving…":"Save"})]}),Q>0?(0,t.jsx)("div",{className:"flex flex-col gap-1",children:f.regions.map(ne=>{const we=M===ne.id,Me=ne.shape.kind==="polygon"?iv:ol;return(0,t.jsxs)("div",{className:`flex items-center gap-2 rounded-md border px-2 py-1 transition-colors ${we?"border-primary/50 bg-primary/10":"border-border bg-surface"}`,children:[(0,t.jsxs)("button",{type:"button",onClick:()=>Ae(ne.id),disabled:b,className:"flex flex-1 items-center gap-2 text-left text-[11px] font-medium text-foreground-subtle hover:text-foreground disabled:opacity-40 transition-colors",children:[(0,t.jsx)(Me,{className:"h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("span",{children:["Zone ",ne.id]}),(0,t.jsx)("span",{className:"text-foreground-faint capitalize",children:ne.shape.kind})]}),(0,t.jsx)("button",{type:"button",onClick:()=>De(ne.id),disabled:b,"aria-label":`Delete zone ${String(ne.id)}`,title:"Delete zone",className:"inline-flex h-6 w-6 items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:border-red-400/40 hover:bg-red-500/10 hover:text-red-400 disabled:opacity-40 transition-colors",children:(0,t.jsx)(hr,{className:"h-3.5 w-3.5"})})]},ne.id)})}):null]}):(0,t.jsx)("p",{className:`${gr} leading-relaxed`,children:"Loading the camera's privacy mask…"})]}):null}var Xf={"host/motion-zones-grid":Jf,"host/privacy-mask-grid":pC,"host/ptz-panel":Uf,"host/ptz-autotrack":Ff};function Yf(e){const{widgetId:i,deviceId:a}=e,o=Xf[i];return o!==void 0?a===void 0?(0,t.jsx)(na,{widgetId:i,reason:"missing-device-context"}):(0,t.jsx)(o,{deviceId:a}):(0,t.jsx)(hC,{...e})}function hC(e){const{widgetId:i}=e,a=Lf(i);return a===void 0?(0,t.jsx)(na,{widgetId:i,reason:"unknown"}):(0,t.jsx)(vC,{...e,metadata:a})}function vC(e){const{widgetId:i,host:a="device-tab",config:o,deviceId:l,integrationId:d,instanceId:f,size:p,columns:g,rows:h,metadata:b}=e,w=Zf(b.remote,b.bundleUrl),$=(0,n.useMemo)(()=>f??i,[f,i]);return w===null?(0,t.jsx)(bC,{}):w===void 0?(0,t.jsx)(na,{widgetId:i,reason:"missing-export"}):b.requires.deviceContext&&l===void 0?(0,t.jsx)(na,{widgetId:i,reason:"missing-device-context"}):b.requires.integrationContext&&d===void 0?(0,t.jsx)(na,{widgetId:i,reason:"missing-integration-context"}):(0,t.jsx)(w,{instanceId:$,host:a,config:o,deviceId:l,integrationId:d,size:p,columns:g,rows:h})}function bC(){return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-surface/40 p-4 animate-pulse",children:[(0,t.jsx)("div",{className:"h-3 w-24 bg-foreground-subtle/20 rounded mb-2"}),(0,t.jsx)("div",{className:"h-2 w-full bg-foreground-subtle/10 rounded mb-1"}),(0,t.jsx)("div",{className:"h-2 w-3/4 bg-foreground-subtle/10 rounded"})]})}function na({widgetId:e,reason:i}){return(0,t.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 nn="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",eo="block text-[11px] font-medium text-foreground mb-1 break-words",yC="text-[10px] text-foreground-subtle mt-0.5 break-words";function Nt({label:e,description:i,required:a,span:o,children:l,translationFn:d}){const f=o===2?"col-span-1 @[480px]:col-span-2":o===3?"col-span-1 @[480px]:col-span-2 @[880px]:col-span-3":o===4?"col-span-1 @[480px]:col-span-2 @[1140px]:col-span-4":"col-span-1",p=ur(e,d),g=ur(i,d),h=p!==void 0&&p!=="";return(0,t.jsxs)("div",{className:`${f} min-w-0`,children:[h&&(0,t.jsxs)("label",{className:eo,children:[p,a&&(0,t.jsx)("span",{className:"text-danger ml-0.5",children:"*"})]}),l,g&&(0,t.jsx)("p",{className:yC,children:g})]})}function xC({field:e,value:i,onChange:a,disabled:o,translationFn:l}){return(0,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.jsx)("input",{type:e.inputType??"text",className:nn,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 _C({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const[d,f]=(0,n.useState)(i==null?"":String(i)),p=(0,n.useRef)(!1);(0,n.useEffect)(()=>{p.current||f(i==null?"":String(i))},[i]);const g=h=>{if(f(h),h===""||h==="-"){a(void 0);return}const b=Number(h);Number.isNaN(b)||a(b)};return(0,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("input",{type:"number",className:nn,value:d,placeholder:e.placeholder,min:e.min,max:e.max,step:e.step,disabled:o||e.disabled,onFocus:()=>{p.current=!0},onBlur:()=>{p.current=!1},onChange:h=>g(h.target.value)}),e.unit&&(0,t.jsx)("span",{className:"text-xs text-foreground-subtle whitespace-nowrap",children:e.unit})]})})}function wC({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=!!i,f=o||e.disabled;return e.style==="checkbox"?(0,t.jsx)(Nt,{label:void 0,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",className:"h-3.5 w-3.5 rounded border-border accent-primary",checked:d,disabled:f,onChange:p=>a(p.target.checked)}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:ur(e.label,l)}),e.required&&(0,t.jsx)("span",{className:"text-danger",children:"*"})]})}):(0,t.jsx)(Nt,{label:void 0,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:eo+" mb-0",children:[ur(e.label,l),e.required&&(0,t.jsx)("span",{className:"text-danger ml-0.5",children:"*"})]}),(0,t.jsx)("button",{type:"button",role:"switch","aria-checked":d,disabled:f,onClick:()=>!f&&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",f?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),children:(0,t.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 SC({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=e.options.some(f=>f.value==="");return(0,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.jsxs)("select",{className:nn,value:i==null?"":String(i),disabled:o||e.disabled,onChange:f=>a(f.target.value),children:[!e.required&&!d&&(0,t.jsx)("option",{value:"",children:"— Select —"}),e.options.map(f=>(0,t.jsx)("option",{value:f.value,children:f.label},f.value))]})})}function jC({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=Array.isArray(i)?i:[],f=p=>{if(d.includes(p))a(d.filter(g=>g!==p));else{if(e.maxItems!==void 0&&d.length>=e.maxItems)return;a([...d,p])}};return(0,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.options.map(p=>{const g=d.includes(p.value);return(0,t.jsxs)("label",{className:["flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs cursor-pointer select-none transition-colors",g?"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,t.jsx)("input",{type:"checkbox",className:"sr-only",checked:g,disabled:o||e.disabled,onChange:()=>f(p.value)}),p.label]},p.value)})})})}function $C({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const[d,f]=(0,n.useState)(!1),p=e.showToggle!==!1;return(0,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{type:d?"text":"password",className:nn+(p?" pr-9":""),value:i==null?"":String(i),placeholder:e.placeholder,disabled:o||e.disabled,onChange:g=>a(g.target.value)}),p&&(0,t.jsx)("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",tabIndex:-1,onClick:()=>f(g=>!g),children:d?(0,t.jsx)(tl,{className:"h-3.5 w-3.5"}):(0,t.jsx)(wn,{className:"h-3.5 w-3.5"})})]})})}function kC({field:e,value:i,onChange:a,disabled:o,translationFn:l}){return(0,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.jsx)("textarea",{className:nn+" 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 PC({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=i==null,f=e.nullable===!0,p=d?e.default??e.min:Number(i),g=e.showValue!==!1,h=e.nullLabel??"Auto",b=o||e.disabled,w=e.displayScale??1,$=e.min/w,P=e.max/w,M=p/w,D=(e.step??1)/w;if(f&&d)return(0,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.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:b,onClick:()=>a(e.default??e.min),children:[h," — click to set manually"]})});const z=e.showStepper===!0&&g,R=G=>{const Q=p+G*(e.step??1),W=Math.min(e.max,Math.max(e.min,Q));W!==p&&a(W)},Z="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,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 basis-[160px] items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] text-foreground-subtle tabular-nums shrink-0",children:$}),(0,t.jsx)("input",{type:"range",className:"min-w-0 flex-1 h-1 accent-primary cursor-pointer disabled:opacity-50",min:$,max:P,step:D,value:M,disabled:b,onChange:G=>a(Number(G.target.value)*w)}),(0,t.jsx)("span",{className:"text-[10px] text-foreground-subtle tabular-nums shrink-0",children:P})]}),(g||f||e.unit)&&(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[z&&(0,t.jsx)("button",{type:"button",className:Z,disabled:b||p<=e.min,onClick:()=>R(-1),title:`Decrease by ${e.step??1}`,"aria-label":"Decrement",children:(0,t.jsx)(Pu,{className:"h-3 w-3"})}),g&&(0,t.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:$,max:P,step:D,value:M,disabled:b,onChange:G=>{if(G.target.value===""){a(f?null:e.min);return}const Q=Number(G.target.value)*w,W=e.step??1,X=Q-e.min,he=e.min+Math.round(X/W)*W;a(Math.min(e.max,Math.max(e.min,he)))}}),z&&(0,t.jsx)("button",{type:"button",className:Z,disabled:b||p>=e.max,onClick:()=>R(1),title:`Increase by ${e.step??1}`,"aria-label":"Increment",children:(0,t.jsx)(Sn,{className:"h-3 w-3"})}),e.unit&&(0,t.jsx)("span",{className:"text-[10px] text-foreground-subtle",children:e.unit}),f&&(0,t.jsx)("button",{className:"text-[10px] text-foreground-subtle hover:text-primary transition-colors",title:`Reset to ${h}`,disabled:b,onClick:()=>a(null),children:h})]})]})})}function NC({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=Array.isArray(i)?i:[],[f,p]=(0,n.useState)(""),g=(0,n.useRef)(null),h=(0,n.useCallback)(P=>{const M=P.trim();!M||d.includes(M)||e.maxTags!==void 0&&d.length>=e.maxTags||(a([...d,M]),p(""))},[d,e.maxTags,a]),b=P=>a(d.filter(M=>M!==P)),w=P=>{P.key==="Enter"||P.key===","?(P.preventDefault(),h(f)):P.key==="Backspace"&&f===""&&d.length>0&&b(d[d.length-1])},$=o||e.disabled;return(0,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.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",$?"opacity-50 cursor-not-allowed":""].join(" "),onClick:()=>!$&&g.current?.focus(),children:[d.map(P=>(0,t.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:[P,!$&&(0,t.jsx)("button",{type:"button",onClick:()=>b(P),className:"hover:text-danger",children:(0,t.jsx)(Mt,{className:"h-2.5 w-2.5"})})]},P)),(0,t.jsx)("input",{ref:g,type:"text",className:"flex-1 min-w-[80px] bg-transparent text-sm text-foreground outline-none placeholder:text-foreground-disabled",value:f,placeholder:d.length===0?e.placeholder??"Add tags…":"",disabled:$,list:`tags-suggestions-${e.key}`,onChange:P=>p(P.target.value),onKeyDown:w,onBlur:()=>{f.trim()&&h(f)}}),e.suggestions&&(0,t.jsx)("datalist",{id:`tags-suggestions-${e.key}`,children:e.suggestions.map(P=>(0,t.jsx)("option",{value:P},P))})]})})}function em({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const{nodes:d}=Za(),f=typeof i=="string"?i:"",p=e.showOffline?d:d.filter(g=>g.isOnline);return(0,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.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:f,onChange:g=>a(g.target.value),disabled:o,children:[(0,t.jsx)("option",{value:"",children:"Select node…"}),p.map(g=>(0,t.jsxs)("option",{value:g.id,disabled:!g.isOnline,children:[g.shortName,g.isOnline?"":" (offline)"]},g.id))]})})}function tm({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const{nodes:d}=Za(),f=new Set(Array.isArray(i)?i.map(String):[]),p=e.showOffline?d:d.filter(h=>h.isOnline),g=h=>{const b=new Set(f);b.has(h)?b.delete(h):b.add(h),a([...b])};return(0,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:p.map(h=>{const b=f.has(h.id);return(0,t.jsx)("button",{type:"button",onClick:()=>g(h.id),disabled:o||!h.isOnline,className:`px-2.5 py-1 text-xs font-medium rounded-md border transition-colors ${b?"border-primary bg-primary/10 text-primary":"border-border bg-surface text-foreground-subtle hover:bg-surface-hover"} ${h.isOnline?"":"opacity-50 cursor-not-allowed"}`,children:h.shortName},h.id)})})})}function CC({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=i==null?"#000000":String(i);return(0,t.jsxs)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.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:f=>a(f.target.value)}),(0,t.jsx)("input",{type:"text",className:nn+" flex-1 font-mono",value:d,placeholder:"#000000",disabled:o||e.disabled,onChange:f=>a(f.target.value)})]}),e.presets&&e.presets.length>0&&(0,t.jsx)("div",{className:"flex gap-1.5 mt-1.5",children:e.presets.map(f=>(0,t.jsx)("button",{type:"button",className:"h-5 w-5 rounded-md border border-border hover:scale-110 transition-transform disabled:opacity-50",style:{backgroundColor:f},disabled:o||e.disabled,title:f,onClick:()=>a(f)},f))})]})}function OC({field:e,value:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:f,externalProbe:p}){const[g,h]=(0,n.useState)("idle"),[b,w]=(0,n.useState)(null),$=p?.status??g,P=p?.result??b,M=!!d||!!f,D=(0,n.useCallback)(async()=>{if(M){h("probing"),w(null);try{const Z=d?await d(e.key,i):await f("test-probe",e.key,i),G=Z&&typeof Z=="object"?Z:{status:"error",error:"Probe handler returned no result"};w(G),h(G.status==="ok"?"ok":"error")}catch(Z){w({status:"error",error:Z instanceof Error?Z.message:String(Z)}),h("error")}}},[d,f,e.key,i,M]),z=$==="probing"?"border-primary/40 bg-primary/10 text-primary":$==="ok"?"border-success/40 bg-success/10 text-success hover:bg-success/15":$==="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",R=$==="probing"?(0,t.jsx)(Wt,{className:"h-3 w-3 animate-spin"}):$==="ok"?(0,t.jsx)(Qh,{className:"h-3 w-3"}):$==="error"?(0,t.jsx)(_n,{className:"h-3 w-3"}):(0,t.jsx)(Du,{className:"h-3 w-3"});return(0,t.jsxs)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:[(0,t.jsxs)("div",{className:"@container flex items-center gap-2",style:{containerType:"inline-size"},children:[(0,t.jsxs)("button",{type:"button",onClick:D,title:"Test",disabled:e.disabled||$==="probing"||!M||!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 ${z}`,children:[R,(0,t.jsx)("span",{className:"hidden @[280px]:inline",children:"Test"})]}),(0,t.jsx)("input",{type:e.inputType??"url",className:nn+" flex-1 min-w-0",value:i==null?"":String(i),placeholder:e.placeholder,disabled:o||e.disabled,onChange:Z=>{a(Z.target.value),g!=="idle"&&(h("idle"),w(null))}})]}),$==="ok"&&P?.labels&&P.labels.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1.5",children:P.labels.map((Z,G)=>(0,t.jsx)("span",{className:"text-xs bg-success/10 text-success rounded px-2 py-0.5 font-mono",children:Z},G))}),$==="error"&&P?.error&&(0,t.jsx)("p",{className:"text-xs text-danger mt-1 truncate",title:P.error,children:P.error})]})}function MC({field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d}){const[f,p]=(0,n.useState)(e.defaultCollapsed??!1),g=e.style==="accordion";return(0,t.jsx)("div",{className:`${e.span===2?"col-span-2":e.span===3?"col-span-3":e.span===4?"col-span-4":"col-span-1"} min-w-0`,children:(0,t.jsxs)("div",{className:"@container rounded-lg border border-border bg-surface/50 overflow-hidden",style:{containerType:"inline-size"},children:[(0,t.jsxs)("div",{className:["px-3 py-2 flex items-center justify-between min-w-0",g?"cursor-pointer hover:bg-surface":""].join(" "),onClick:g?()=>p(h=>!h):void 0,children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-foreground min-w-0 break-words",children:ur(e.label,l)}),g&&(0,t.jsx)("span",{className:"text-foreground-subtle text-xs shrink-0 ml-2",children:f?"▸":"▾"})]}),!f&&(0,t.jsx)("div",{className:"px-3 pb-3 grid grid-cols-1 @[480px]:grid-cols-2 gap-x-4 gap-y-3",children:e.fields.map(h=>(0,t.jsx)(On,{field:h,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d},h.key))})]})})}function EC({field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:f}){const[p,g]=(0,n.useState)(e.tabs[0]?.id??""),h=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,t.jsxs)("div",{className:`${h} min-w-0`,children:[e.label&&(0,t.jsx)("div",{className:eo,children:ur(e.label,l)}),(0,t.jsxs)("div",{className:"@container rounded-lg border border-border-subtle bg-surface-hover/40 overflow-hidden",style:{containerType:"inline-size"},children:[(0,t.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(b=>{const w=b.id===p;return(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":w,onClick:()=>g(b.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,t.jsx)("span",{children:ur(b.label,l)}),b.badge&&(0,t.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:b.badge})]},b.id)})}),e.tabs.map(b=>b.id!==p?null:(0,t.jsx)("div",{role:"tabpanel",className:"px-3 pb-3 pt-2 grid grid-cols-1 @[480px]:grid-cols-2 gap-x-4 gap-y-3",children:b.fields.map((w,$)=>{const P="key"in w&&typeof w.key=="string"?w.key:`__${b.id}__${$}`;return(0,t.jsx)(On,{field:w,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:f},P)})},b.id))]})]})}function IC({span:e}){return(0,t.jsx)("div",{className:e===2?"col-span-2":e===3?"col-span-3":e===4?"col-span-4":"col-span-full",children:(0,t.jsx)("hr",{className:"border-border"})})}var rm={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 DC(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 f=Array.from(d.children);for(const p of f){if(!i.has(p.tagName)){const h=a.createTextNode(p.textContent??"");p.replaceWith(h);continue}const g=p.tagName==="A"?new Set(["href"]):new Set;for(const h of Array.from(p.attributes))g.has(h.name)||p.removeAttribute(h.name);if(p.tagName==="A"){const h=p.getAttribute("href")??"";!/^https?:\/\//i.test(h)&&!h.startsWith("mailto:")?p.removeAttribute("href"):(p.setAttribute("target","_blank"),p.setAttribute("rel","noopener noreferrer"))}l(p)}};return l(o),o.innerHTML}function AC({field:e}){const i=rm[e.variant??"info"]??rm.info,a=e.format==="html";return(0,t.jsx)("div",{className:"col-span-full",children:(0,t.jsxs)("div",{className:`rounded-md border-l-4 px-3 py-2.5 ${i.border} ${i.bg}`,children:[e.label&&(0,t.jsx)("p",{className:`text-xs font-semibold mb-0.5 ${i.text}`,children:e.label}),a?(0,t.jsx)("div",{className:"text-xs text-foreground-subtle leading-relaxed info-html-content",dangerouslySetInnerHTML:{__html:DC(e.content)}}):(0,t.jsx)("p",{className:"text-xs text-foreground-subtle leading-relaxed whitespace-pre-line",children:e.content})]})})}var nm={ok:"bg-success",warn:"bg-amber-500",danger:"bg-danger",idle:"bg-foreground-subtle/40",unknown:"bg-foreground-subtle/40"};function zC(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 TC(e){return!Number.isFinite(e)||e<=0?"—":new Date(e).toLocaleTimeString()}function RC({kind:e,value:i}){return i==null||i===""?(0,t.jsx)("span",{className:"text-foreground-subtle/60",children:"—"}):e==="monospace"?(0,t.jsx)("span",{className:"font-mono text-[11px]",children:String(i)}):e==="status"?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${nm[String(i).toLowerCase()]??nm.unknown}`}),(0,t.jsx)("span",{children:String(i)})]}):e==="duration"&&typeof i=="number"?(0,t.jsx)("span",{className:"font-mono text-[11px]",children:zC(i)}):e==="timestamp"&&typeof i=="number"?(0,t.jsx)("span",{className:"font-mono text-[11px]",children:TC(i)}):(0,t.jsx)("span",{children:String(i)})}function LC({field:e}){const i=e.value??[],a=e.description;return(0,t.jsxs)("div",{className:"col-span-full",children:[e.label&&(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-foreground-subtle mb-1",children:e.label}),a&&(0,t.jsx)("p",{className:"text-xs text-foreground-subtle mb-2",children:a}),i.length===0?(0,t.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,t.jsx)("div",{className:"rounded-md border border-border overflow-hidden",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{className:"bg-surface-subtle border-b border-border",children:(0,t.jsx)("tr",{children:e.columns.map(o=>(0,t.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,t.jsx)("tbody",{className:"divide-y divide-border",children:i.map((o,l)=>(0,t.jsx)("tr",{className:"hover:bg-surface-hover/40",children:e.columns.map(d=>(0,t.jsx)("td",{className:"px-3 py-1.5 align-top text-foreground",children:(0,t.jsx)(RC,{kind:d.kind,value:o[d.key]})},d.key))},l))})]})})]})}function ZC({field:e,value:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:f}){const p=Array.isArray(i)?i:[],g=e.minRows??0,h=e.maxRows??Number.POSITIVE_INFINITY,b=(z,R,Z)=>{const G=p.slice();G[z]={...G[z]??{},[R]:Z},a(G)},w=z=>{p.length<=g||a(p.filter((R,Z)=>Z!==z))},$=()=>{if(p.length>=h)return;const z=e.defaultItem??{};a([...p,{...z}])},P=(z,R)=>e.rowTitleTemplate?e.rowTitleTemplate.replace(/\{(\w+)\}/g,(Z,G)=>{const Q=z[G];return Q==null||Q===""?"—":String(Q)}):`Row ${R+1}`,M=p.length>g,D=p.length<h;return(0,t.jsxs)("div",{className:"col-span-full space-y-2",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[e.label&&(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-foreground-subtle",children:ur(e.label,l)}),e.description&&(0,t.jsx)("p",{className:"text-[11px] text-foreground-subtle",children:ur(e.description,l)})]}),p.length===0?(0,t.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,t.jsx)("div",{className:"space-y-2",children:p.map((z,R)=>(0,t.jsxs)("div",{className:"rounded-md border border-border bg-background",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:P(z,R)}),(0,t.jsxs)("button",{type:"button",onClick:()=>w(R),disabled:o||!M,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:M?"Remove this row":`At least ${g} row(s) required`,children:[(0,t.jsx)(Pu,{className:"h-3 w-3"}),"Remove"]})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 @[480px]:grid-cols-2 gap-x-3 gap-y-2 p-3",children:e.itemFields.map(Z=>(0,t.jsx)(On,{field:Z,values:z,onChange:(G,Q)=>b(R,G,Q),disabled:o,translationFn:l,onTestField:d,allFields:e.itemFields,onAction:f},Z.key))})]},R))}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{type:"button",onClick:$,disabled:o||!D,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,t.jsx)(Sn,{className:"h-3 w-3"}),e.addLabel??"Add"]}),!D&&Number.isFinite(h)&&(0,t.jsxs)("span",{className:"ml-2 text-[10px] text-foreground-subtle",children:["(limit: ",h,")"]})]})]})}function UC({field:e,disabled:i,onAction:a}){const[o,l]=(0,n.useState)(!1),d=Hi(),f=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)}}},p={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,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,children:(0,t.jsx)("button",{onClick:f,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 ${p[e.variant??"default"]??p.default}`,children:o?"Processing...":e.buttonLabel})})}function im(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 BC({field:e,value:i,values:a,onChange:o,disabled:l,onAction:d}){const[f,p]=(0,n.useState)(!1),[g,h]=(0,n.useState)(null),[b,w]=(0,n.useState)(null),$=im(e,a),P=Object.keys(e.paramsFromForm??{}).some(R=>$[R]===void 0);(0,n.useEffect)(()=>{if(!d||P){w(null),h(null);return}let R=!1;return p(!0),h(null),d(e.action,e.key,$).then(Z=>{if(R)return;const G=Z;let Q=[];if(Array.isArray(G))Q=G;else if(G&&typeof G=="object")for(const W of Object.keys(G)){const X=G[W];if(Array.isArray(X)){Q=X;break}}w(Q)}).catch(Z=>{R||(h(Z instanceof Error?Z.message:String(Z)),w([]))}).finally(()=>{R||p(!1)}),()=>{R=!0}},[(e.refreshOn??Object.values(e.paramsFromForm??{})).map(R=>`${R}=${JSON.stringify(a[R])}`).join("|"),d,e.action,e.key]);const M=e.mapOption.value,D=e.mapOption.label,z=e.mapOption.description;return(0,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,children:P?(0,t.jsx)("div",{className:"text-[11px] text-foreground-subtle italic",children:e.emptyParamsMessage??"Fill the prerequisite fields above first."}):f?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-foreground-subtle",children:[(0,t.jsx)(Wt,{className:"h-3 w-3 animate-spin"})," Loading options…"]}):g?(0,t.jsx)("div",{className:"text-[11px] text-danger",children:g}):b&&b.length===0?(0,t.jsx)("div",{className:"text-[11px] text-foreground-subtle italic",children:e.emptyResultsMessage??"No options returned."}):(()=>{const R=(b??[]).some(Z=>{const G=Z[M];return G===""||G===void 0});return(0,t.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:Z=>o(Z.target.value),children:[!R&&(0,t.jsx)("option",{value:"",children:"— Select —"}),(b??[]).map((Z,G)=>{const Q=Z[M],W=Z[D],X=z?Z[z]:void 0,he=typeof Q=="string"&&Q!==""?Q:`row-${G}`;return(0,t.jsxs)("option",{value:typeof Q=="string"?Q:String(Q??""),children:[typeof W=="string"?W:String(W??he),X!==void 0?` (${String(X)})`:""]},he)})]})})()})}function FC({field:e,values:i,disabled:a,onAction:o}){const[l,d]=(0,n.useState)(!1),[f,p]=(0,n.useState)(null),g=Hi(),h=async()=>{if(e.confirmMessage&&!await g({title:e.label,message:e.confirmMessage,confirmLabel:e.buttonLabel,variant:e.variant==="danger"?"danger":"default"})||!o)return;const w=im(e,i);d(!0),p(null);try{const $=await o(e.action,e.key,w),P=typeof $=="object"&&$!==null?$:null;p({kind:"ok",text:e.successMessage?e.successMessage.replace(/\{(\w+)\}/g,(M,D)=>{const z=P?.[D];return z===void 0?"":String(z)}):"Done."})}catch($){p({kind:"error",text:$ instanceof Error?$.message:String($)})}finally{d(!1)}},b={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,t.jsx)(Nt,{label:e.label,description:e.description,required:e.required,span:e.span,children:(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("button",{onClick:h,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 ${b[e.variant??"default"]??b.default}`,children:l?"Working…":e.buttonLabel}),f&&(0,t.jsx)("div",{className:`text-[11px] ${f.kind==="ok"?"text-emerald-700 dark:text-emerald-300":"text-danger"}`,children:f.text})]})})}function GC({field:e}){const i=$f();return(0,t.jsx)(Yf,{widgetId:e.widgetId,host:"device-tab",config:e.widgetConfig,deviceId:i??void 0,instanceId:e.key})}function VC(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 WC({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],f=d!==void 0?d:"default"in e?e.default:void 0,p=VC(f,"unit"in e?e.unit:void 0),g="label"in e?e.label:void 0,h="description"in e?e.description:void 0,b="span"in e?e.span:void 0,w="actions"in e?e.actions??[]:[];return(0,t.jsx)(Nt,{label:g,description:h,span:b,translationFn:o,children:(0,t.jsxs)("div",{className:"flex items-stretch gap-1",children:[(0,t.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:p}),w.length>0&&(0,t.jsx)("div",{className:"flex items-center gap-1",children:w.map($=>(0,t.jsx)(HC,{action:$,fieldKey:l,value:f,onAction:a},$.action))})]})})}function QC({name:e}){const i="h-3.5 w-3.5";switch(e){case"copy":return(0,t.jsx)(Lr,{className:i});case"refresh-cw":return(0,t.jsx)(za,{className:i});case"external-link":return(0,t.jsx)(xu,{className:i});case"trash-2":return(0,t.jsx)(hr,{className:i});case"download":return(0,t.jsx)(el,{className:i});case"upload":return(0,t.jsx)(Iu,{className:i});default:return(0,t.jsx)(sl,{className:i})}}function HC({action:e,fieldKey:i,value:a,onAction:o}){const l=Hi(),[d,f]=(0,n.useState)(!1),p=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",g=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){f(!0);try{await o(e.action,i)}finally{f(!1)}}}};return(0,t.jsx)("button",{type:"button",onClick:g,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 ${p}`,children:(0,t.jsx)(QC,{name:e.icon})})}function qC(e){return"multiple"in e&&e.multiple!=null}function JC({field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,externalProbe:f,allFields:p,onAction:g}){const h=e.multiple,b=h.min,w=h.max,$=i[e.key],P=[...Array.isArray($)?$:$!=null?[$]:[]],M=h.itemDefault!==void 0?h.itemDefault:"default"in e&&e.default!==void 0?e.default:"";for(;P.length<b;)P.push(M);const D=Q=>a(e.key,[...Q]),z=(Q,W)=>{const X=[...P];X[Q]=W,D(X)},R=()=>{P.length>=w||D([...P,M])},Z=Q=>{P.length<=b||D(P.filter((W,X)=>X!==Q))},G=()=>{const{multiple:Q,...W}=e;return{...W,...{label:void 0,description:void 0,required:!1}}};return(0,t.jsx)(Nt,{label:e.label,description:e.description,required:b>0?e.required:!1,span:e.span,translationFn:l,children:(0,t.jsxs)("div",{className:"space-y-2",children:[P.map((Q,W)=>{const X=h.itemLabel?.replace("${n}",String(W+1));return(0,t.jsxs)("div",{className:"space-y-1",children:[X&&(0,t.jsx)("div",{className:eo,children:X}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1 min-w-0",children:(0,t.jsx)(On,{field:G(),values:{...i,[e.key]:Q},onChange:(he,H)=>z(W,H),disabled:o,translationFn:l,onTestField:d,onAction:g,allFields:p})}),P.length>b&&(0,t.jsx)("button",{type:"button",onClick:()=>Z(W),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,t.jsx)(hr,{className:"h-3.5 w-3.5"})})]})]},W)}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-1",children:[P.length<w?(0,t.jsxs)("button",{type:"button",onClick:R,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,t.jsx)(Sn,{className:"h-3 w-3"}),h.addLabel??"Add"]}):(0,t.jsx)("span",{}),(0,t.jsxs)("span",{className:"text-[10px] text-foreground-subtle tabular-nums",children:[P.length,"/",w]})]})]})})}function am(e,i,a){if(!("showWhen"in e)||!e.showWhen)return!0;const o=e.showWhen,l=i[o.field],d=a?.find(g=>"key"in g&&g.key===o.field),f=d&&"default"in d?d.default:void 0,p=l!==void 0?l:f;return o.equals!==void 0?p===o.equals:o.notEquals!==void 0?p!==o.notEquals:o.in!==void 0?o.in.includes(p):o.notIn!==void 0?!o.notIn.includes(p):o.includes!==void 0?Array.isArray(p)&&p.includes(o.includes):o.notIncludes!==void 0?!Array.isArray(p)||!p.includes(o.notIncludes):!0}function On({field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,externalProbe:f,allFields:p,onAction:g}){if(qC(e))return(0,t.jsx)(JC,{field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,externalProbe:f,allFields:p,onAction:g});if("readonlyField"in e&&e.readonlyField===!0)return(0,t.jsx)(WC,{field:e,values:i,onAction:g,translationFn:l});if(!am(e,i,p))return null;const h=i[e.key],b=h!==void 0?h:"default"in e?e.default:void 0,w=P=>a(e.key,P),$=jf(e.type);switch(e.type){case"text":return(0,t.jsx)(xC,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"number":return(0,t.jsx)(_C,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"boolean":return(0,t.jsx)(wC,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"select":return(0,t.jsx)(SC,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"multiselect":return(0,t.jsx)(jC,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"password":return(0,t.jsx)($C,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"textarea":return(0,t.jsx)(kC,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"slider":return(0,t.jsx)(PC,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"tags":return(0,t.jsx)(NC,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"color":return(0,t.jsx)(CC,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"node-select":return(0,t.jsx)(em,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"node-multiselect":return(0,t.jsx)(tm,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"probe":return(0,t.jsx)(OC,{field:e,value:b,onChange:w,disabled:o,translationFn:l,onTestField:d,onAction:g,externalProbe:f});case"group":return(0,t.jsx)(MC,{field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d});case"sub-tabs":return(0,t.jsx)(EC,{field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:g});case"separator":return(0,t.jsx)(IC,{});case"info":return(0,t.jsx)(AC,{field:e});case"object-array":return(0,t.jsx)(LC,{field:e});case"editable-array":return(0,t.jsx)(ZC,{field:e,value:b,onChange:w,disabled:o,translationFn:l,onTestField:d,onAction:g});case"button":return(0,t.jsx)(UC,{field:e,disabled:o,onAction:g});case"addon-action-select":return(0,t.jsx)(BC,{field:e,value:b,values:i,onChange:w,disabled:o,onAction:g});case"addon-action-button":return(0,t.jsx)(FC,{field:e,values:i,disabled:o,onAction:g});case"widget":return(0,t.jsx)(GC,{field:e});default:return $?(0,t.jsx)($,{field:e,value:b,onChange:w,disabled:o}):null}}function KC(e){return/^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)+$/.test(e)}function ur(e,i){if(e!==void 0)return i&&KC(e)?i(e):e}function XC({section:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,probeResults:f}){const[p,g]=(0,n.useState)(e.defaultCollapsed??!1),h=e.style==="accordion",b=e.columns??2,w=b===1?"grid-cols-1":b===3?"grid-cols-1 @[480px]:grid-cols-2 @[880px]:grid-cols-3":b===4?"grid-cols-1 @[480px]:grid-cols-2 @[1140px]:grid-cols-4":"grid-cols-1 @[480px]:grid-cols-2";return(0,t.jsxs)("div",{className:"@container rounded-lg border border-border bg-surface p-3",style:{containerType:"inline-size"},children:[(0,t.jsxs)("div",{className:["flex items-center justify-between mb-2",h?"cursor-pointer":""].join(" "),onClick:h?()=>g($=>!$):void 0,children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wider",children:ur(e.title,l)}),e.description&&(0,t.jsx)("p",{className:"text-[10px] text-foreground-subtle mt-0.5",children:ur(e.description,l)})]}),h&&(0,t.jsx)("span",{className:"text-foreground-subtle text-xs ml-2",children:p?"▸":"▾"})]}),!p&&(0,t.jsx)("div",{className:`grid ${w} gap-x-3 gap-y-2.5`,children:e.fields.map($=>(0,t.jsx)(On,{field:$,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,externalProbe:f?.[$.key]},$.key))})]})}function om({schema:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,probeResults:f,onClearProbe:p}){const g=(h,b)=>{a({...i,[h]:b}),p?.(h)};return(0,t.jsx)("div",{className:"space-y-4",children:e.sections.map(h=>(0,t.jsx)(XC,{section:h,values:i,onChange:g,disabled:o,translationFn:l,onTestField:d,probeResults:f},h.id))})}var YC=({open:e})=>(0,t.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,t.jsx)("polyline",{points:"9 18 15 12 9 6"})});function sm(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 eO(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 tO({trpc:e,addonId:i,nodeId:a,title:o,disabled:l,onAfterChange:d,refreshToken:f,collapsible:p,defaultOpen:g,mode:h,onOverrideChange:b}){const w=h??"persist",[$,P]=(0,n.useState)(null),[M,D]=(0,n.useState)(!0),[z,R]=(0,n.useState)(null),[Z,G]=(0,n.useState)(!1),[Q,W]=(0,n.useState)(g??!1),[X,he]=(0,n.useState)({}),[H,me]=(0,n.useState)(null);(0,n.useEffect)(()=>{me(null),he({})},[e,i,a,f,w]),(0,n.useEffect)(()=>{let De=!1;D(!0),R(null);const Re=w==="override"&&Object.keys(X).length>0?X:void 0;return e.addonSettings.getGlobalSettings.query({addonId:i,nodeId:a,...Re?{overlay:Re}:{}}).then(Te=>{De||(P(Te),Re||me(sm(Te)),D(!1))}).catch(Te=>{De||(R(Te instanceof Error?Te.message:String(Te)),D(!1))}),()=>{De=!0}},[e,i,a,f,w,JSON.stringify(X)]);const ye=(0,n.useMemo)(()=>sm($),[$]),Qe=(0,n.useMemo)(()=>$?eO($):null,[$]),Ye=async De=>{if(w==="override"){const Te=H??ye,ue={};for(const ve of Object.keys(De))De[ve]!==Te[ve]&&(ue[ve]=De[ve]);const ge={...Te,...ue};he(ue),b?.(ue,ge);return}const Re={};for(const Te of Object.keys(De))De[Te]!==ye[Te]&&(Re[Te]=De[Te]);if(Object.keys(Re).length!==0){G(!0);try{await e.addonSettings.updateGlobalSettings.mutate({addonId:i,nodeId:a,patch:Re}),P(await e.addonSettings.getGlobalSettings.query({addonId:i,nodeId:a})),d?.()}catch(Te){R(Te instanceof Error?Te.message:String(Te))}finally{G(!1)}}};if(M)return(0,t.jsxs)("div",{className:"text-xs text-foreground-subtle animate-pulse",children:["Loading ",o??i,"…"]});if(z)return(0,t.jsxs)("div",{className:"text-xs text-red-400",children:[o??i,": ",z]});if(!$||!Qe)return(0,t.jsxs)("div",{className:"text-xs text-foreground-subtle",children:[o??i," not available on ",a,"."]});const Je=w==="override"?{...ye,...X}:ye,Ae=(0,t.jsxs)(t.Fragment,{children:[w==="override"?(0,t.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,t.jsx)(om,{schema:Qe,values:Je,onChange:Ye,disabled:l===!0||Z})]});return p===!0?(0,t.jsxs)("section",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>W(De=>!De),className:"w-full px-4 py-2 flex items-center gap-2 hover:bg-surface-hover text-left","aria-expanded":Q,children:[(0,t.jsx)(YC,{open:Q}),(0,t.jsx)("h3",{className:"text-xs font-semibold text-foreground uppercase tracking-wide flex-1",children:o??i}),(0,t.jsx)("span",{className:"text-[10px] text-foreground-subtle",children:Q?"hide":"edit"})]}),Q?(0,t.jsx)("div",{className:"border-t border-border px-4 py-3",children:Ae}):null]}):o?(0,t.jsxs)("section",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[(0,t.jsx)("div",{className:"border-b border-border px-4 py-2",children:(0,t.jsx)("h3",{className:"text-xs font-semibold text-foreground uppercase tracking-wide",children:o})}),(0,t.jsx)("div",{className:"px-4 py-3",children:Ae})]}):(0,t.jsx)("div",{children:Ae})}function lm({detections:{motion:e,motionRaw:i,detection:a,phase:o},showMotionZones:l=!0,showMotionRaw:d=!0,showDetections:f=!0,showPhaseIndicator:p=!0}){const g=l&&e&&e.zones.length>0,h=d&&i&&i.boxes.length>0,b=f&&a&&a.detections.length>0;return!g&&!h&&!b&&!p?null:(0,t.jsxs)("div",{className:"absolute inset-0 pointer-events-none z-10",children:[p&&(0,t.jsx)(rO,{phase:o}),h&&(0,t.jsx)(nO,{raw:i}),g&&(0,t.jsx)(iO,{motion:e}),b&&(0,t.jsx)(aO,{detections:a.detections,frameWidth:a.frameWidth,frameHeight:a.frameHeight})]})}function rO({phase:e}){const i=Is(e);return(0,t.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,t.jsx)("span",{className:`w-2 h-2 rounded-full ${i.dotClass}`}),(0,t.jsx)("span",{className:"text-[10px] font-semibold text-white uppercase tracking-wider",children:i.label})]})}function nO({raw:e}){return e.frameWidth===0||e.frameHeight===0?null:(0,t.jsx)(t.Fragment,{children:e.boxes.map((i,a)=>{const[o,l,d,f]=i.bbox,p=o/e.frameWidth*100,g=l/e.frameHeight*100,h=(d-o)/e.frameWidth*100,b=(f-l)/e.frameHeight*100,w=Math.max(.05,Math.min(.25,i.changeScore*.3));return(0,t.jsx)("div",{className:"absolute rounded-sm",style:{left:`${p}%`,top:`${g}%`,width:`${h}%`,height:`${b}%`,backgroundColor:`rgba(239, 68, 68, ${w})`}},`mr-${a}`)})})}function iO({motion:e}){return e.frameWidth===0||e.frameHeight===0?null:(0,t.jsx)(t.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,t.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 aO({detections:e,frameWidth:i,frameHeight:a}){return i===0||a===0?null:(0,t.jsx)(t.Fragment,{children:e.map(o=>{const{x:l,y:d,width:f,height:p}=o.bbox,g=l/i*100,h=d/a*100,b=f/i*100,w=p/a*100,$=Qt(o.macroClass),P=[`${o.macroClass} ${(o.score*100).toFixed(0)}%`];for(const M of o.labels)P.push(M.label);return(0,t.jsx)("div",{className:"absolute border-2 rounded-sm",style:{left:`${g}%`,top:`${h}%`,width:`${b}%`,height:`${w}%`,borderColor:$},children:(0,t.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:$},children:P.join(" | ")})},`det-${o.id}`)})})}function oO(){return typeof window>"u"?!1:window.matchMedia("(hover: none) and (pointer: coarse)").matches||typeof navigator<"u"&&navigator.maxTouchPoints>0||"ontouchstart"in window}function sO(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 lO=1500,cO=15e3,uO=40;function cm({serverUrl:e,streamKey:i,label:a,autoPlay:o=!0,muted:l=!0,showControls:d=!0,className:f="",onStateChange:p,onError:g,overlay:h,createSession:b,sendAnswer:w,handleOffer:$,getIceServers:P,addIceCandidate:M,getIceCandidates:D,closeSession:z,hintsOverride:R}){const Z=(0,n.useRef)(null),G=(0,n.useRef)(null),Q=(0,n.useRef)(null),W=(0,n.useRef)(new Set),X=(0,n.useRef)(null),he=(0,n.useRef)(null),H=(0,n.useRef)(0),me=(0,n.useRef)(!0),[ye,Qe]=(0,n.useState)("idle"),[Ye,Je]=(0,n.useState)(""),[Ae,De]=(0,n.useState)(l),[Re,Te]=(0,n.useState)(!1),[ue,ge]=(0,n.useState)(!1),ve=oO(),[je,_e]=(0,n.useState)(!0),Ue=(0,n.useRef)(null),ne=(0,n.useRef)(!1);(w||b)&&(ne.current=!0);const we=ne.current,Me=(0,n.useRef)(!1);$&&(Me.current=!0);const ze=Me.current,We=(0,n.useCallback)(Ee=>{Qe(Ee),p?.(Ee)},[p]),Fe=(0,n.useCallback)(()=>{if(X.current?.abort(),X.current=null,he.current&&(clearTimeout(he.current),he.current=null),Q.current&&(Q.current.close(),Q.current=null),z&&W.current.size>0){for(const Ee of W.current)z(Ee).catch(()=>{});W.current.clear()}Z.current&&(Z.current.srcObject=null)},[z]),Tt=(0,n.useCallback)(async()=>{if(!me.current||!b||!w)return;Fe(),We("connecting");const Ee=new AbortController;X.current=Ee;try{const{sessionId:Ve,sdpOffer:Ce,iceServers:qe}=await b({...sO(G.current),...R});if(W.current.add(Ve),!me.current||Ee.signal.aborted){z?.(Ve).catch(()=>{}),W.current.delete(Ve);return}const xe=new RTCPeerConnection({iceServers:[...qe??[],{urls:"stun:stun.l.google.com:19302"}]});Q.current=xe;const et=new MediaStream;xe.ontrack=pt=>{console.debug("[WebRTC] ontrack",pt.track.kind,pt.track.readyState),et.addTrack(pt.track),Z.current&&(Z.current.srcObject=et,Z.current.play().catch(()=>{}))},xe.oniceconnectionstatechange=()=>{if(!me.current)return;const pt=xe.iceConnectionState;console.debug("[WebRTC] ICE state:",pt),pt==="connected"||pt==="completed"?(H.current=0,We("playing"),Z.current?.paused&&(console.debug("[WebRTC] video was paused at ICE connected — calling play()"),Z.current.play().catch(()=>{}))):(pt==="failed"||pt==="disconnected"||pt==="closed")&&(We("disconnected"),Ut())},xe.onicecandidateerror=pt=>{console.debug("[WebRTC] ICE candidate error:",pt)},console.debug("[WebRTC] Setting remote description (server offer)..."),await xe.setRemoteDescription({type:"offer",sdp:Ce});const Ke=await xe.createAnswer();if(await xe.setLocalDescription(Ke),console.debug("[WebRTC] Local description set, waiting for ICE gathering..."),await um(xe),!me.current)return;const nt=(xe.localDescription?.sdp??"").split(`
|
|
141
|
+
`).filter(pt=>pt.startsWith("a=candidate:")).length;console.debug("[WebRTC] Sending answer to server",{localCandidates:nt,sessionId:Ve.slice(0,8)}),await w(Ve,xe.localDescription?.sdp??""),console.debug("[WebRTC] Answer sent successfully");const er=xe,bt=()=>{const pt=er.connectionState;if(pt==="closed"||pt==="failed")return;const ia=Z.current;ia&&ia.readyState===0&&console.log(`[WebRTC] no video data yet (ice=${er.iceConnectionState})`)};setTimeout(bt,3e3),setTimeout(bt,8e3)}catch(Ve){if(!me.current)return;const Ce=Ve instanceof Error?Ve.message:String(Ve);Je(Ce),We("error"),g?.(Ce),Ut()}},[e,i,b,w,Fe,We,g,R]),Rt=(0,n.useCallback)(async()=>{if(me.current){Fe(),We("connecting");try{const Ee=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});Q.current=Ee,Ee.addTransceiver("video",{direction:"recvonly"}),Ee.addTransceiver("audio",{direction:"recvonly"});const Ve=new MediaStream;Ee.ontrack=Ke=>{Ve.addTrack(Ke.track),Z.current&&(Z.current.srcObject=Ve,Z.current.play().catch(()=>{}))},Ee.oniceconnectionstatechange=()=>{if(!me.current)return;const Ke=Ee.iceConnectionState;Ke==="connected"||Ke==="completed"?(H.current=0,We("playing"),Z.current?.paused&&Z.current.play().catch(()=>{})):(Ke==="failed"||Ke==="disconnected"||Ke==="closed")&&(We("disconnected"),Ut())};const Ce=await Ee.createOffer();if(await Ee.setLocalDescription(Ce),await um(Ee),!me.current)return;const qe=`${e}/api/webrtc?src=${encodeURIComponent(i)}`,xe=await fetch(qe,{method:"POST",headers:{"Content-Type":"application/sdp"},body:Ee.localDescription?.sdp??""});if(!xe.ok)throw new Error(`WHEP ${xe.status}: ${xe.statusText}`);const et=await xe.text();await Ee.setRemoteDescription({type:"answer",sdp:et})}catch(Ee){if(!me.current)return;const Ve=Ee instanceof Error?Ee.message:String(Ee);Je(Ve),We("error"),g?.(Ve),Ut()}}},[e,i,Fe,We,g]),Ct=(0,n.useCallback)(async()=>{if(!me.current||!$)return;Fe(),We("connecting");const Ee=new AbortController;X.current=Ee;try{const Ve=await P?.();if(!me.current||Ee.signal.aborted)return;const Ce=new RTCPeerConnection({iceServers:[...Ve??[],{urls:"stun:stun.l.google.com:19302"}]});Q.current=Ce;const qe=new MediaStream;Ce.ontrack=bt=>{console.debug("[WebRTC] ontrack (client-offer)",bt.track.kind,bt.track.readyState),qe.addTrack(bt.track),Z.current&&(Z.current.srcObject=qe,Z.current.play().catch(()=>{}))},Ce.oniceconnectionstatechange=()=>{if(!me.current)return;const bt=Ce.iceConnectionState;console.debug("[WebRTC] ICE state (client-offer):",bt),bt==="connected"||bt==="completed"?(H.current=0,We("playing"),Z.current?.paused&&Z.current.play().catch(()=>{})):(bt==="failed"||bt==="disconnected"||bt==="closed")&&(We("disconnected"),Ut())};let xe=null;const et=[];Ce.onicecandidate=bt=>{if(!bt.candidate)return;const pt=bt.candidate.toJSON();xe&&M?M(xe,pt).catch(()=>{}):et.push(pt)},Ce.addTransceiver("video",{direction:"recvonly"}),Ce.addTransceiver("audio",{direction:"recvonly"});const Ke=await Ce.createOffer();if(await Ce.setLocalDescription(Ke),!me.current||Ee.signal.aborted)return;const{sessionId:nt,sdpAnswer:er}=await $(Ce.localDescription?.sdp??Ke.sdp??"");if(xe=nt,W.current.add(nt),!me.current||Ee.signal.aborted){z?.(nt).catch(()=>{}),W.current.delete(nt);return}if(M)for(const bt of et)M(nt,bt).catch(()=>{});if(et.length=0,await Ce.setRemoteDescription({type:"answer",sdp:er}),console.debug("[WebRTC] Client-offer answer set (trickle)",{sessionId:nt.slice(0,8)}),D){const bt=new Set,pt=Date.now(),ia=async()=>{if(!(!me.current||Ee.signal.aborted||Q.current!==Ce)){try{const{candidates:JM,done:KM}=await D(nt);for(const Um of JM){const gc=Um.candidate??"";gc&&!bt.has(gc)&&(bt.add(gc),Ce.addIceCandidate(new RTCIceCandidate(Um)).catch(()=>{}))}const Zm=Ce.iceConnectionState;if(KM||Date.now()-pt>1e4||Zm==="connected"||Zm==="completed")return}catch{}setTimeout(()=>{ia()},200)}};ia()}}catch(Ve){if(!me.current)return;const Ce=Ve instanceof Error?Ve.message:String(Ve);Je(Ce),We("error"),g?.(Ce),Ut()}},[$,P,M,D,z,Fe,We,g]),xt=ze?Ct:we?Tt:Rt,Zt=(0,n.useRef)(()=>{});Zt.current=xt;const Ut=(0,n.useCallback)(()=>{if(!me.current||H.current>=uO)return;const Ee=H.current;H.current+=1;const Ve=Math.min(cO,lO*2**Ee),Ce=Math.round(Ve*(.8+Math.random()*.4));he.current=setTimeout(()=>{me.current&&Zt.current()},Ce)},[]);(0,n.useEffect)(()=>(me.current=!0,H.current=0,o&&xt(),()=>{me.current=!1,Fe()}),[e,i]);const Gr=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(o){if(ze){if(!$)return}else if(we){if(!b||!w)return}else return;Gr.current||Q.current||(Gr.current=!0,xt())}},[o,ze,we,$,b,w,xt]);const yr=()=>{H.current=0,xt()},dr=()=>{Z.current&&(Z.current.muted=!Z.current.muted,De(Z.current.muted))},Vr=async()=>{if(G.current)try{if(document.fullscreenElement){await document.exitFullscreen();return}if(G.current.requestFullscreen){await G.current.requestFullscreen();return}const Ee=Z.current;Ee?.webkitEnterFullscreen&&Ee.webkitEnterFullscreen()}catch(Ee){console.warn(`Fullscreen toggle failed: ${Ee instanceof Error?Ee.message:Ee}`)}},kr=async()=>{const Ee=Z.current;if(Ee)try{const Ve=Reflect.get(Ee,"webkitSetPresentationMode");if(typeof Ve=="function"){const Ce=Reflect.get(Ee,"webkitPresentationMode");Ve.call(Ee,Ce==="picture-in-picture"?"inline":"picture-in-picture");return}document.pictureInPictureElement?await document.exitPictureInPicture():await Ee.requestPictureInPicture()}catch(Ve){console.warn(`PiP toggle failed: ${Ve instanceof Error?Ve.message:String(Ve)}`)}},Pr=()=>{if(!Z.current)return;const Ee=document.createElement("canvas");Ee.width=Z.current.videoWidth||1280,Ee.height=Z.current.videoHeight||720;const Ve=Ee.getContext("2d");if(!Ve)return;Ve.drawImage(Z.current,0,0);const Ce=document.createElement("a");Ce.download=`${i.replace(/[/:]/g,"-")}-${Date.now()}.jpg`,Ce.href=Ee.toDataURL("image/jpeg",.92),Ce.click()};(0,n.useEffect)(()=>{const Ee=()=>Te(!!document.fullscreenElement);document.addEventListener("fullscreenchange",Ee);const Ve=Z.current;return Ve?.addEventListener("webkitbeginfullscreen",Ee),Ve?.addEventListener("webkitendfullscreen",Ee),()=>{document.removeEventListener("fullscreenchange",Ee),Ve?.removeEventListener("webkitbeginfullscreen",Ee),Ve?.removeEventListener("webkitendfullscreen",Ee)}},[]),(0,n.useEffect)(()=>{const Ee=Z.current,Ve=typeof document<"u"&&document.pictureInPictureEnabled===!0,Ce=Ee!==null&&typeof Reflect.get(Ee,"webkitSetPresentationMode")=="function";ge(Ve||Ce)},[]);const Pe=()=>{ve||(_e(!0),Ue.current&&clearTimeout(Ue.current),Ue.current=setTimeout(()=>_e(!1),3e3))},ut=()=>{_e(Ee=>!Ee),Ue.current&&clearTimeout(Ue.current)};return(0,t.jsxs)("div",{ref:G,className:`relative isolate bg-black overflow-hidden group ${f}`,onMouseMove:Pe,onMouseEnter:Pe,onTouchStart:ut,children:[(0,t.jsx)("video",{ref:Z,autoPlay:o,muted:Ae,playsInline:!0,className:"w-full h-full object-contain relative z-0"}),a&&ye==="playing"&&(0,t.jsx)("div",{className:"absolute top-2 left-2 z-10 transform-gpu px-2 py-0.5 rounded bg-black/60 text-[10px] text-white font-medium",children:a}),h,ye==="connecting"&&(0,t.jsxs)("div",{className:"absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2",children:[(0,t.jsx)("svg",{className:"h-6 w-6 text-white/60 animate-spin",viewBox:"0 0 24 24",fill:"none",children:(0,t.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,t.jsx)("span",{className:"text-xs text-white/60",children:"Connecting…"})]}),(ye==="error"||ye==="disconnected")&&(0,t.jsxs)("div",{className:"absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2",children:[(0,t.jsx)("svg",{className:"h-6 w-6 text-red-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.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,t.jsx)("span",{className:"text-xs text-red-400 text-center px-4",children:ye==="error"?Ye||"Connection failed":"Disconnected"}),(0,t.jsx)("button",{onClick:yr,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&&ye!=="idle"&&ye!=="error"&&(0,t.jsxs)("div",{className:`absolute bottom-0 inset-x-0 z-20 transform-gpu flex items-center justify-between px-3 py-1.5 bg-gradient-to-t from-black/80 to-transparent transition-opacity duration-200 ${ve||je?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"}`,children:[(0,t.jsx)("div",{className:"flex items-center gap-1",children:(0,t.jsx)(to,{onClick:dr,title:Ae?"Unmute":"Mute",children:Ae?(0,t.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[(0,t.jsx)("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),(0,t.jsx)("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),(0,t.jsx)("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):(0,t.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[(0,t.jsx)("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),(0,t.jsx)("path",{d:"M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"})]})})}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(to,{onClick:Pr,title:"Take snapshot",children:(0,t.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[(0,t.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,t.jsx)("circle",{cx:"12",cy:"13",r:"4"})]})}),ue&&(0,t.jsx)(to,{onClick:kr,title:"Picture-in-Picture",children:(0,t.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M21 9V6a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h4"}),(0,t.jsx)("rect",{width:"10",height:"7",x:"12",y:"13",rx:"2"})]})}),(0,t.jsx)(to,{onClick:Vr,title:Re?"Exit fullscreen":"Fullscreen",children:Re?(0,t.jsx)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,t.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,t.jsx)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,t.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 to({onClick:e,title:i,children:a}){return(0,t.jsx)("button",{onClick:e,title:i,className:"rounded-full p-1.5 min-w-[44px] min-h-[44px] flex items-center justify-center text-white/80 hover:text-white hover:bg-white/20 active:bg-white/30 transition-colors",children:a})}async function um(e){if(e.iceGatheringState!=="complete")return new Promise(i=>{let a=!1,o;const l=()=>{a||(a=!0,o&&clearInterval(o),e.removeEventListener("icegatheringstatechange",d),i())},d=()=>{e.iceGatheringState==="complete"&&l()};e.addEventListener("icegatheringstatechange",d);const f=Date.now();o=setInterval(()=>{const p=e.localDescription?.sdp??"";/ typ host/.test(p)&&Date.now()-f>=600&&l()},100),setTimeout(l,2500)})}function dO(e){return e==="streaming"?"bg-emerald-500":e==="connecting"?"bg-amber-500":e==="error"?"bg-rose-500":"bg-zinc-500"}function fO(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 rc({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("polygon",{points:"5 3 19 12 5 21 5 3"})})}function mO({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})})}function gO({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z"}),(0,t.jsx)("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),(0,t.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),(0,t.jsx)("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]})}function pO({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:[(0,t.jsx)("circle",{cx:"5",cy:"12",r:"2"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"2"}),(0,t.jsx)("circle",{cx:"19",cy:"12",r:"2"})]})}function nc({label:e,active:i,onClick:a}){return(0,t.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,t.jsx)("span",{children:e}),(0,t.jsx)("span",{className:`inline-block h-3 w-5 rounded-full transition-colors ${i?"bg-primary":"bg-foreground-subtle/30"} relative`,children:(0,t.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 dm({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,t.jsx)("polyline",{points:"1 20 1 14 7 14"}),(0,t.jsx)("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]})}function hO({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("line",{x1:"2",y1:"2",x2:"22",y2:"22"}),(0,t.jsx)("path",{d:"M10.41 10.41a2 2 0 11-2.83-2.83"}),(0,t.jsx)("line",{x1:"13.5",y1:"13.5",x2:"6",y2:"21"}),(0,t.jsx)("path",{d:"M18 12l-1.5-1.5"}),(0,t.jsx)("path",{d:"M21 15V5a2 2 0 00-2-2H5"}),(0,t.jsx)("path",{d:"M21 21H5a2 2 0 01-2-2V11"})]})}function vO({serverUrl:e,createSession:i,sendAnswer:a,handleOffer:o,getIceServers:l,addIceCandidate:d,getIceCandidates:f,closeSession:p,streams:g,activeStreamId:h,onStreamChange:b,deviceName:w,phase:$,pipelineMetrics:P,detections:M,defaultShowDetections:D=!0,defaultShowMotion:z=!1,streamStats:R,autoPlay:Z=!1,showPlayStop:G=!1,snapshotSrc:Q,snapshotLoading:W=!1,onRefreshSnapshot:X,showStreamStats:he=!1,children:H,extraOverlay:me,ptzAvailable:ye=!1,ptzShown:Qe=!1,ptzOverlay:Ye,onPtzToggle:Je,intercomAvailable:Ae=!1,intercomShown:De=!1,onIntercomToggle:Re,chromeless:Te=!1,className:ue}){const ge=Gf(),[ve,je]=(0,n.useState)(Z),[_e,Ue]=(0,n.useState)(D),[ne,we]=(0,n.useState)(z),[Me,ze]=(0,n.useState)(null),[We,Fe]=(0,n.useState)(!1),Tt=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!We)return;function Ce(qe){Tt.current&&!Tt.current.contains(qe.target)&&Fe(!1)}return document.addEventListener("mousedown",Ce),()=>document.removeEventListener("mousedown",Ce)},[We]);const Rt=h??Me??g?.[0]?.id??"",Ct=g?.find(Ce=>Ce.id===Rt)??g?.[0],xt=Ct?.inputFps!=null?{status:Ct.status??"unknown",inputFps:Ct.inputFps,bitrateKbps:Ct.bitrateKbps??0}:null,Zt=Ce=>{ze(Ce),b?.(Ce),ve&&G&&(je(!1),setTimeout(()=>je(!0),50))},Ut=(0,n.useMemo)(()=>{const Ce=Ct?.target;if(Ce)return qe=>i(Ce,qe)},[i,Ct]),Gr=(0,n.useMemo)(()=>{const Ce=Ct?.target;if(!(!Ce||!o))return qe=>o(Ce,qe)},[o,Ct]),yr=g,dr=()=>je(!0),Vr=()=>je(!1),kr=P?.phase??$,Pr=kr==="active",Pe=!!M,ut=Pe&&(_e||ne),Ee=ye&&Qe&&!!Ye,Ve=G?ve:!0;return(0,t.jsxs)("div",{className:`overflow-hidden ${Te?"":"rounded-xl border border-border bg-surface"} ${ue??""}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2 border-b border-border",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(R??xt)&&(0,t.jsx)("span",{className:`shrink-0 w-2 h-2 rounded-full ${dO((R??xt).status)}`}),w&&(0,t.jsx)("span",{className:"text-xs font-medium text-foreground truncate",children:w}),yr&&yr.length>1&&(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("select",{"data-testid":"stream-profile-select",value:Rt,onChange:Ce=>Zt(Ce.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:yr.map(Ce=>(0,t.jsx)("option",{value:Ce.id,children:Ce.label},Ce.id))}),(0,t.jsx)("span",{className:"pointer-events-none absolute right-1.5 top-1/2 -translate-y-1/2 text-foreground-subtle",children:(0,t.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,t.jsx)("polyline",{points:"3 4.5 6 7.5 9 4.5"})})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0 ml-auto",children:[Ae&&(0,t.jsxs)("button",{"data-testid":"stream-intercom-toggle","data-intercom-shown":De?"true":"false",onClick:Re,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors ${De?"bg-primary/15 text-primary":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover"}`,title:De?"Close intercom":"Open intercom",children:[(0,t.jsx)(gO,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden xl:inline",children:"Intercom"})]}),ge.map(Ce=>{const qe=Ce.tone==="primary"?"bg-primary text-primary-foreground":"bg-primary/15 text-primary";return(0,t.jsxs)("button",{type:"button","data-toolbar-button-id":Ce.id,"data-toolbar-button-active":Ce.active?"true":"false",onClick:Ce.onClick,disabled:Ce.disabled,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors disabled:opacity-50 ${Ce.active?qe:"text-foreground-subtle hover:text-foreground hover:bg-surface-hover"}`,title:Ce.title??Ce.label,children:[Ce.icon,(0,t.jsx)("span",{className:"hidden xl:inline",children:Ce.label})]},Ce.id)}),G&&(0,t.jsxs)("button",{"data-testid":"stream-play-toggle","data-stream-playing":Ve?"true":"false",onClick:Ve?Vr:dr,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors ${Ve?"bg-danger/10 text-danger hover:bg-danger/20":"bg-primary/10 text-primary hover:bg-primary/20"}`,title:Ve?"Stop stream":"Start stream",children:[Ve?(0,t.jsx)(mO,{className:"h-3 w-3"}):(0,t.jsx)(rc,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden xl:inline",children:Ve?"Stop":"Play"})]}),X&&(0,t.jsxs)("button",{"data-testid":"stream-snapshot-refresh",onClick:X,disabled:W,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,t.jsx)(dm,{className:`h-3 w-3 ${W?"animate-spin":""}`}),(0,t.jsx)("span",{className:"hidden xl:inline",children:"Snapshot"})]}),(Pe||ye||P||kr||R||xt&&xt.inputFps>0)&&(0,t.jsxs)("div",{ref:Tt,className:"relative",children:[(0,t.jsx)("button",{onClick:()=>Fe(Ce=>!Ce),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,t.jsx)(pO,{className:"h-3.5 w-3.5"})}),We&&(0,t.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:[he&&R&&(0,t.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle border-b border-border-subtle",children:[(0,t.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,t.jsx)("span",{children:"Input"}),(0,t.jsxs)("span",{className:"tabular-nums text-foreground",children:[R.inputFps.toFixed(1)," fps"]})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,t.jsx)("span",{children:"Decode"}),(0,t.jsxs)("span",{className:"tabular-nums text-foreground",children:[R.decodeFps.toFixed(1)," fps"]})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,t.jsx)("span",{children:"Uptime"}),(0,t.jsx)("span",{className:"tabular-nums text-foreground",children:fO(R.uptimeMs)})]})]}),!he&&xt&&xt.inputFps>0&&(0,t.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle border-b border-border-subtle",children:[(0,t.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,t.jsx)("span",{children:"Input"}),(0,t.jsxs)("span",{className:"tabular-nums text-foreground",children:[xt.inputFps.toFixed(1)," fps"]})]}),xt.bitrateKbps>0&&(0,t.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,t.jsx)("span",{children:"Bitrate"}),(0,t.jsxs)("span",{className:"tabular-nums text-foreground",children:[xt.bitrateKbps," kbps"]})]})]}),(P||Pe&&kr)&&(0,t.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle border-b border-border-subtle",children:[(0,t.jsxs)("div",{className:"flex justify-between gap-3 items-center",children:[(0,t.jsx)("span",{children:"Phase"}),(0,t.jsxs)("span",{className:`flex items-center gap-1 font-semibold uppercase tracking-wider ${Pr?"text-red-400":"text-emerald-400"}`,children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${Pr?"bg-red-500 animate-pulse":"bg-emerald-500"}`}),Pr?"Active":"Watching"]})]}),P&&P.detectionFps>0&&(0,t.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,t.jsx)("span",{children:"Detection"}),(0,t.jsxs)("span",{className:"tabular-nums text-foreground",children:[P.detectionFps.toFixed(1)," det/s"]})]}),P&&P.avgInferenceMs>0&&(0,t.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,t.jsx)("span",{children:"Inference"}),(0,t.jsxs)("span",{className:"tabular-nums text-foreground",children:[P.avgInferenceMs.toFixed(0)," ms"]})]})]}),Pe&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(nc,{label:"Show detections",active:_e,onClick:()=>Ue(Ce=>!Ce)}),(0,t.jsx)(nc,{label:"Show motion",active:ne,onClick:()=>we(Ce=>!Ce)})]}),ye&&(0,t.jsx)(nc,{label:"PTZ controls",active:Qe,onClick:()=>{Je?.(),Fe(!1)}})]})]})]})]}),Ve?(0,t.jsx)("div",{className:"aspect-video relative",children:(0,t.jsx)(cm,{serverUrl:e,streamKey:Rt,autoPlay:!0,className:"w-full h-full",createSession:Ut,sendAnswer:a,handleOffer:Gr,getIceServers:l,addIceCandidate:d,getIceCandidates:f,closeSession:p,overlay:ut||me||Ee?(0,t.jsxs)(t.Fragment,{children:[ut&&(0,t.jsx)(lm,{detections:M,showPhaseIndicator:!1,showMotionZones:ne,showMotionRaw:ne,showDetections:_e}),me,Ee&&Ye]}):void 0},Rt)}):(0,t.jsx)(bO,{src:Q??null,isLoading:W,onPlay:dr,onRetry:X,extraOverlay:me||Ee?(0,t.jsxs)(t.Fragment,{children:[me,Ee&&Ye]}):null,suppressPlayHover:!!me||Ee}),H]})}function bO({src:e,isLoading:i,onPlay:a,onRetry:o,extraOverlay:l,suppressPlayHover:d=!1}){return e?(0,t.jsxs)("div",{className:"relative w-full aspect-video bg-black/90 flex items-center justify-center",children:[(0,t.jsx)("img",{src:e,alt:"Camera snapshot",className:"w-full h-full object-contain"}),!d&&(0,t.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,t.jsx)("div",{className:"h-14 w-14 rounded-full bg-white/20 backdrop-blur-sm flex items-center justify-center",children:(0,t.jsx)(rc,{className:"h-7 w-7 text-white ml-0.5"})})}),l]}):i?(0,t.jsx)("div",{className:"relative w-full aspect-video bg-black/90 flex items-center justify-center",children:(0,t.jsx)("div",{className:"h-8 w-8 border-2 border-white/20 border-t-white/60 rounded-full animate-spin"})}):(0,t.jsx)("div",{className:"relative w-full aspect-video bg-black/90 flex items-center justify-center",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 text-white/40",children:[(0,t.jsx)(hO,{className:"h-8 w-8"}),(0,t.jsx)("span",{className:"text-xs",children:"No snapshot available"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[o&&(0,t.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,t.jsx)(dm,{className:"h-3 w-3"}),"Retry"]}),(0,t.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,t.jsx)(rc,{className:"h-3 w-3"}),"Play Live"]})]})]})})}var fm={value:"auto",label:"Auto (best available)"};function yO(e){return e.charAt(0).toUpperCase()+e.slice(1)}function xO({deviceId:e,value:i,onChange:a,disabled:o,label:l,className:d}){const f=(0,n.useId)(),p=Nf({deviceId:e},{refetchOnWindowFocus:!1}),[g,h]=(0,n.useState)([fm]);(0,n.useEffect)(()=>{if(!p.data)return;const $=`${e}/`,P=[fm];for(const M of p.data){if(!M.enabled)continue;const D=M.brokerId.startsWith($)?M.brokerId.slice($.length):M.brokerId;P.push({value:D,label:yO(D)})}h(P)},[p.data,e]);const b=l??"Preferred stream",w=p.isLoading?"Loading available streams…":p.isError?"Could not load streams — only Auto available.":g.length===1?"No enabled streams found — only Auto available.":null;return(0,t.jsxs)("div",{className:d,children:[(0,t.jsx)("label",{id:f,className:"text-xs font-medium text-foreground-muted block mb-1",children:b}),(0,t.jsx)(Vi,{"aria-labelledby":f,options:g,value:i,disabled:o,onChange:$=>a($.target.value)}),w!==null&&(0,t.jsx)("p",{className:"text-foreground-subtle text-[10px] mt-1",children:w})]})}var _O=Object.defineProperty,ro=Object.getOwnPropertySymbols,mm=Object.prototype.hasOwnProperty,gm=Object.prototype.propertyIsEnumerable,pm=(e,i,a)=>i in e?_O(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a,ic=(e,i)=>{for(var a in i||(i={}))mm.call(i,a)&&pm(e,a,i[a]);if(ro)for(var a of ro(i))gm.call(i,a)&&pm(e,a,i[a]);return e},ac=(e,i)=>{var a={};for(var o in e)mm.call(e,o)&&i.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&ro)for(var o of ro(e))i.indexOf(o)<0&&gm.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 an;(e=>{const i=class lt{constructor(g,h,b,w){if(this.version=g,this.errorCorrectionLevel=h,this.modules=[],this.isFunction=[],g<lt.MIN_VERSION||g>lt.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=g*4+17;let $=[];for(let M=0;M<this.size;M++)$.push(!1);for(let M=0;M<this.size;M++)this.modules.push($.slice()),this.isFunction.push($.slice());this.drawFunctionPatterns();const P=this.addEccAndInterleave(b);if(this.drawCodewords(P),w==-1){let M=1e9;for(let D=0;D<8;D++){this.applyMask(D),this.drawFormatBits(D);const z=this.getPenaltyScore();z<M&&(w=D,M=z),this.applyMask(D)}}l(0<=w&&w<=7),this.mask=w,this.applyMask(w),this.drawFormatBits(w),this.isFunction=[]}static encodeText(g,h){const b=e.QrSegment.makeSegments(g);return lt.encodeSegments(b,h)}static encodeBinary(g,h){const b=e.QrSegment.makeBytes(g);return lt.encodeSegments([b],h)}static encodeSegments(g,h,b=1,w=40,$=-1,P=!0){if(!(lt.MIN_VERSION<=b&&b<=w&&w<=lt.MAX_VERSION)||$<-1||$>7)throw new RangeError("Invalid value");let M,D;for(M=b;;M++){const G=lt.getNumDataCodewords(M,h)*8,Q=f.getTotalBits(g,M);if(Q<=G){D=Q;break}if(M>=w)throw new RangeError("Data too long")}for(const G of[lt.Ecc.MEDIUM,lt.Ecc.QUARTILE,lt.Ecc.HIGH])P&&D<=lt.getNumDataCodewords(M,G)*8&&(h=G);let z=[];for(const G of g){a(G.mode.modeBits,4,z),a(G.numChars,G.mode.numCharCountBits(M),z);for(const Q of G.getData())z.push(Q)}l(z.length==D);const R=lt.getNumDataCodewords(M,h)*8;l(z.length<=R),a(0,Math.min(4,R-z.length),z),a(0,(8-z.length%8)%8,z),l(z.length%8==0);for(let G=236;z.length<R;G^=253)a(G,8,z);let Z=[];for(;Z.length*8<z.length;)Z.push(0);return z.forEach((G,Q)=>Z[Q>>>3]|=G<<7-(Q&7)),new lt(M,h,Z,$)}getModule(g,h){return 0<=g&&g<this.size&&0<=h&&h<this.size&&this.modules[h][g]}getModules(){return this.modules}drawFunctionPatterns(){for(let b=0;b<this.size;b++)this.setFunctionModule(6,b,b%2==0),this.setFunctionModule(b,6,b%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const g=this.getAlignmentPatternPositions(),h=g.length;for(let b=0;b<h;b++)for(let w=0;w<h;w++)b==0&&w==0||b==0&&w==h-1||b==h-1&&w==0||this.drawAlignmentPattern(g[b],g[w]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(g){const h=this.errorCorrectionLevel.formatBits<<3|g;let b=h;for(let $=0;$<10;$++)b=b<<1^(b>>>9)*1335;const w=(h<<10|b)^21522;l(w>>>15==0);for(let $=0;$<=5;$++)this.setFunctionModule(8,$,o(w,$));this.setFunctionModule(8,7,o(w,6)),this.setFunctionModule(8,8,o(w,7)),this.setFunctionModule(7,8,o(w,8));for(let $=9;$<15;$++)this.setFunctionModule(14-$,8,o(w,$));for(let $=0;$<8;$++)this.setFunctionModule(this.size-1-$,8,o(w,$));for(let $=8;$<15;$++)this.setFunctionModule(8,this.size-15+$,o(w,$));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let g=this.version;for(let b=0;b<12;b++)g=g<<1^(g>>>11)*7973;const h=this.version<<12|g;l(h>>>18==0);for(let b=0;b<18;b++){const w=o(h,b),$=this.size-11+b%3,P=Math.floor(b/3);this.setFunctionModule($,P,w),this.setFunctionModule(P,$,w)}}drawFinderPattern(g,h){for(let b=-4;b<=4;b++)for(let w=-4;w<=4;w++){const $=Math.max(Math.abs(w),Math.abs(b)),P=g+w,M=h+b;0<=P&&P<this.size&&0<=M&&M<this.size&&this.setFunctionModule(P,M,$!=2&&$!=4)}}drawAlignmentPattern(g,h){for(let b=-2;b<=2;b++)for(let w=-2;w<=2;w++)this.setFunctionModule(g+w,h+b,Math.max(Math.abs(w),Math.abs(b))!=1)}setFunctionModule(g,h,b){this.modules[h][g]=b,this.isFunction[h][g]=!0}addEccAndInterleave(g){const h=this.version,b=this.errorCorrectionLevel;if(g.length!=lt.getNumDataCodewords(h,b))throw new RangeError("Invalid argument");const w=lt.NUM_ERROR_CORRECTION_BLOCKS[b.ordinal][h],$=lt.ECC_CODEWORDS_PER_BLOCK[b.ordinal][h],P=Math.floor(lt.getNumRawDataModules(h)/8),M=w-P%w,D=Math.floor(P/w);let z=[];const R=lt.reedSolomonComputeDivisor($);for(let G=0,Q=0;G<w;G++){let W=g.slice(Q,Q+D-$+(G<M?0:1));Q+=W.length;const X=lt.reedSolomonComputeRemainder(W,R);G<M&&W.push(0),z.push(W.concat(X))}let Z=[];for(let G=0;G<z[0].length;G++)z.forEach((Q,W)=>{(G!=D-$||W>=M)&&Z.push(Q[G])});return l(Z.length==P),Z}drawCodewords(g){if(g.length!=Math.floor(lt.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let h=0;for(let b=this.size-1;b>=1;b-=2){b==6&&(b=5);for(let w=0;w<this.size;w++)for(let $=0;$<2;$++){const P=b-$,M=(b+1&2)==0?this.size-1-w:w;!this.isFunction[M][P]&&h<g.length*8&&(this.modules[M][P]=o(g[h>>>3],7-(h&7)),h++)}}l(h==g.length*8)}applyMask(g){if(g<0||g>7)throw new RangeError("Mask value out of range");for(let h=0;h<this.size;h++)for(let b=0;b<this.size;b++){let w;switch(g){case 0:w=(b+h)%2==0;break;case 1:w=h%2==0;break;case 2:w=b%3==0;break;case 3:w=(b+h)%3==0;break;case 4:w=(Math.floor(b/3)+Math.floor(h/2))%2==0;break;case 5:w=b*h%2+b*h%3==0;break;case 6:w=(b*h%2+b*h%3)%2==0;break;case 7:w=((b+h)%2+b*h%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[h][b]&&w&&(this.modules[h][b]=!this.modules[h][b])}}getPenaltyScore(){let g=0;for(let $=0;$<this.size;$++){let P=!1,M=0,D=[0,0,0,0,0,0,0];for(let z=0;z<this.size;z++)this.modules[$][z]==P?(M++,M==5?g+=lt.PENALTY_N1:M>5&&g++):(this.finderPenaltyAddHistory(M,D),P||(g+=this.finderPenaltyCountPatterns(D)*lt.PENALTY_N3),P=this.modules[$][z],M=1);g+=this.finderPenaltyTerminateAndCount(P,M,D)*lt.PENALTY_N3}for(let $=0;$<this.size;$++){let P=!1,M=0,D=[0,0,0,0,0,0,0];for(let z=0;z<this.size;z++)this.modules[z][$]==P?(M++,M==5?g+=lt.PENALTY_N1:M>5&&g++):(this.finderPenaltyAddHistory(M,D),P||(g+=this.finderPenaltyCountPatterns(D)*lt.PENALTY_N3),P=this.modules[z][$],M=1);g+=this.finderPenaltyTerminateAndCount(P,M,D)*lt.PENALTY_N3}for(let $=0;$<this.size-1;$++)for(let P=0;P<this.size-1;P++){const M=this.modules[$][P];M==this.modules[$][P+1]&&M==this.modules[$+1][P]&&M==this.modules[$+1][P+1]&&(g+=lt.PENALTY_N2)}let h=0;for(const $ of this.modules)h=$.reduce((P,M)=>P+(M?1:0),h);const b=this.size*this.size,w=Math.ceil(Math.abs(h*20-b*10)/b)-1;return l(0<=w&&w<=9),g+=w*lt.PENALTY_N4,l(0<=g&&g<=2568888),g}getAlignmentPatternPositions(){if(this.version==1)return[];{const g=Math.floor(this.version/7)+2,h=this.version==32?26:Math.ceil((this.version*4+4)/(g*2-2))*2;let b=[6];for(let w=this.size-7;b.length<g;w-=h)b.splice(1,0,w);return b}}static getNumRawDataModules(g){if(g<lt.MIN_VERSION||g>lt.MAX_VERSION)throw new RangeError("Version number out of range");let h=(16*g+128)*g+64;if(g>=2){const b=Math.floor(g/7)+2;h-=(25*b-10)*b-55,g>=7&&(h-=36)}return l(208<=h&&h<=29648),h}static getNumDataCodewords(g,h){return Math.floor(lt.getNumRawDataModules(g)/8)-lt.ECC_CODEWORDS_PER_BLOCK[h.ordinal][g]*lt.NUM_ERROR_CORRECTION_BLOCKS[h.ordinal][g]}static reedSolomonComputeDivisor(g){if(g<1||g>255)throw new RangeError("Degree out of range");let h=[];for(let w=0;w<g-1;w++)h.push(0);h.push(1);let b=1;for(let w=0;w<g;w++){for(let $=0;$<h.length;$++)h[$]=lt.reedSolomonMultiply(h[$],b),$+1<h.length&&(h[$]^=h[$+1]);b=lt.reedSolomonMultiply(b,2)}return h}static reedSolomonComputeRemainder(g,h){let b=h.map(w=>0);for(const w of g){const $=w^b.shift();b.push(0),h.forEach((P,M)=>b[M]^=lt.reedSolomonMultiply(P,$))}return b}static reedSolomonMultiply(g,h){if(g>>>8||h>>>8)throw new RangeError("Byte out of range");let b=0;for(let w=7;w>=0;w--)b=b<<1^(b>>>7)*285,b^=(h>>>w&1)*g;return l(b>>>8==0),b}finderPenaltyCountPatterns(g){const h=g[1];l(h<=this.size*3);const b=h>0&&g[2]==h&&g[3]==h*3&&g[4]==h&&g[5]==h;return(b&&g[0]>=h*4&&g[6]>=h?1:0)+(b&&g[6]>=h*4&&g[0]>=h?1:0)}finderPenaltyTerminateAndCount(g,h,b){return g&&(this.finderPenaltyAddHistory(h,b),h=0),h+=this.size,this.finderPenaltyAddHistory(h,b),this.finderPenaltyCountPatterns(b)}finderPenaltyAddHistory(g,h){h[0]==0&&(g+=this.size),h.pop(),h.unshift(g)}};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(p,g,h){if(g<0||g>31||p>>>g)throw new RangeError("Value out of range");for(let b=g-1;b>=0;b--)h.push(p>>>b&1)}function o(p,g){return(p>>>g&1)!=0}function l(p){if(!p)throw new Error("Assertion error")}const d=class jt{constructor(g,h,b){if(this.mode=g,this.numChars=h,this.bitData=b,h<0)throw new RangeError("Invalid argument");this.bitData=b.slice()}static makeBytes(g){let h=[];for(const b of g)a(b,8,h);return new jt(jt.Mode.BYTE,g.length,h)}static makeNumeric(g){if(!jt.isNumeric(g))throw new RangeError("String contains non-numeric characters");let h=[];for(let b=0;b<g.length;){const w=Math.min(g.length-b,3);a(parseInt(g.substring(b,b+w),10),w*3+1,h),b+=w}return new jt(jt.Mode.NUMERIC,g.length,h)}static makeAlphanumeric(g){if(!jt.isAlphanumeric(g))throw new RangeError("String contains unencodable characters in alphanumeric mode");let h=[],b;for(b=0;b+2<=g.length;b+=2){let w=jt.ALPHANUMERIC_CHARSET.indexOf(g.charAt(b))*45;w+=jt.ALPHANUMERIC_CHARSET.indexOf(g.charAt(b+1)),a(w,11,h)}return b<g.length&&a(jt.ALPHANUMERIC_CHARSET.indexOf(g.charAt(b)),6,h),new jt(jt.Mode.ALPHANUMERIC,g.length,h)}static makeSegments(g){return g==""?[]:jt.isNumeric(g)?[jt.makeNumeric(g)]:jt.isAlphanumeric(g)?[jt.makeAlphanumeric(g)]:[jt.makeBytes(jt.toUtf8ByteArray(g))]}static makeEci(g){let h=[];if(g<0)throw new RangeError("ECI assignment value out of range");if(g<128)a(g,8,h);else if(g<16384)a(2,2,h),a(g,14,h);else if(g<1e6)a(6,3,h),a(g,21,h);else throw new RangeError("ECI assignment value out of range");return new jt(jt.Mode.ECI,0,h)}static isNumeric(g){return jt.NUMERIC_REGEX.test(g)}static isAlphanumeric(g){return jt.ALPHANUMERIC_REGEX.test(g)}getData(){return this.bitData.slice()}static getTotalBits(g,h){let b=0;for(const w of g){const $=w.mode.numCharCountBits(h);if(w.numChars>=1<<$)return 1/0;b+=4+$+w.bitData.length}return b}static toUtf8ByteArray(g){g=encodeURI(g);let h=[];for(let b=0;b<g.length;b++)g.charAt(b)!="%"?h.push(g.charCodeAt(b)):(h.push(parseInt(g.substring(b+1,b+3),16)),b+=2);return h}};d.NUMERIC_REGEX=/^[0-9]*$/,d.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,d.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let f=d;e.QrSegment=d})(an||(an={})),(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={}))})(an||(an={})),(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={}))})(an||(an={}));var Mn=an;/**
|
|
146
|
+
* @license qrcode.react
|
|
147
|
+
* Copyright (c) Paul O'Shannessy
|
|
148
|
+
* SPDX-License-Identifier: ISC
|
|
149
|
+
*/var wO={L:Mn.QrCode.Ecc.LOW,M:Mn.QrCode.Ecc.MEDIUM,Q:Mn.QrCode.Ecc.QUARTILE,H:Mn.QrCode.Ecc.HIGH},hm=128,vm="L",bm="#FFFFFF",ym="#000000",xm=!1,_m=1,SO=4,jO=0,$O=.1;function wm(e,i=0){const a=[];return e.forEach(function(o,l){let d=null;o.forEach(function(f,p){if(!f&&d!==null){a.push(`M${d+i} ${l+i}h${p-d}v1H${d+i}z`),d=null;return}if(p===o.length-1){if(!f)return;d===null?a.push(`M${p+i},${l+i} h1v1H${p+i}z`):a.push(`M${d+i},${l+i} h${p+1-d}v1H${d+i}z`);return}f&&d===null&&(d=p)})}),a.join("")}function Sm(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 kO(e,i,a,o){if(o==null)return null;const l=e.length+a*2,d=Math.floor(i*$O),f=l/i,p=(o.width||d)*f,g=(o.height||d)*f,h=o.x==null?e.length/2-p/2:o.x*f,b=o.y==null?e.length/2-g/2:o.y*f,w=o.opacity==null?1:o.opacity;let $=null;if(o.excavate){let M=Math.floor(h),D=Math.floor(b);$={x:M,y:D,w:Math.ceil(p+h-M),h:Math.ceil(g+b-D)}}const P=o.crossOrigin;return{x:h,y:b,h:g,w:p,excavation:$,opacity:w,crossOrigin:P}}function PO(e,i){return i!=null?Math.max(Math.floor(i),0):e?SO:jO}function jm({value:e,level:i,minVersion:a,includeMargin:o,marginSize:l,imageSettings:d,size:f,boostLevel:p}){let g=v.default.useMemo(()=>{const P=(Array.isArray(e)?e:[e]).reduce((M,D)=>(M.push(...Mn.QrSegment.makeSegments(D)),M),[]);return Mn.QrCode.encodeSegments(P,wO[i],a,void 0,void 0,p)},[e,i,a,p]);const{cells:h,margin:b,numCells:w,calculatedImageSettings:$}=v.default.useMemo(()=>{let P=g.getModules();const M=PO(o,l);return{cells:P,margin:M,numCells:P.length+M*2,calculatedImageSettings:kO(P,f,M,d)}},[g,f,d,o,l]);return{qrcode:g,margin:b,cells:h,numCells:w,calculatedImageSettings:$}}var NO=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),CO=v.default.forwardRef(function(i,a){const o=i,{value:l,size:d=hm,level:f=vm,bgColor:p=bm,fgColor:g=ym,includeMargin:h=xm,minVersion:b=_m,boostLevel:w,marginSize:$,imageSettings:P}=o,M=ac(o,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:D}=M,z=ac(M,["style"]),R=P?.src,Z=v.default.useRef(null),G=v.default.useRef(null),Q=v.default.useCallback(Je=>{Z.current=Je,typeof a=="function"?a(Je):a&&(a.current=Je)},[a]),[W,X]=v.default.useState(!1),{margin:he,cells:H,numCells:me,calculatedImageSettings:ye}=jm({value:l,level:f,minVersion:b,boostLevel:w,includeMargin:h,marginSize:$,imageSettings:P,size:d});v.default.useEffect(()=>{if(Z.current!=null){const Je=Z.current,Ae=Je.getContext("2d");if(!Ae)return;let De=H;const Re=G.current,Te=ye!=null&&Re!==null&&Re.complete&&Re.naturalHeight!==0&&Re.naturalWidth!==0;Te&&ye.excavation!=null&&(De=Sm(H,ye.excavation));const ue=window.devicePixelRatio||1;Je.height=Je.width=d*ue;const ge=d/me*ue;Ae.scale(ge,ge),Ae.fillStyle=p,Ae.fillRect(0,0,me,me),Ae.fillStyle=g,NO?Ae.fill(new Path2D(wm(De,he))):H.forEach(function(ve,je){ve.forEach(function(_e,Ue){_e&&Ae.fillRect(Ue+he,je+he,1,1)})}),ye&&(Ae.globalAlpha=ye.opacity),Te&&Ae.drawImage(Re,ye.x+he,ye.y+he,ye.w,ye.h)}}),v.default.useEffect(()=>{X(!1)},[R]);const Qe=ic({height:d,width:d},D);let Ye=null;return R!=null&&(Ye=v.default.createElement("img",{src:R,key:R,style:{display:"none"},onLoad:()=>{X(!0)},ref:G,crossOrigin:ye?.crossOrigin})),v.default.createElement(v.default.Fragment,null,v.default.createElement("canvas",ic({style:Qe,height:d,width:d,ref:Q,role:"img"},z)),Ye)});CO.displayName="QRCodeCanvas";var $m=v.default.forwardRef(function(i,a){const o=i,{value:l,size:d=hm,level:f=vm,bgColor:p=bm,fgColor:g=ym,includeMargin:h=xm,minVersion:b=_m,boostLevel:w,title:$,marginSize:P,imageSettings:M}=o,D=ac(o,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:z,cells:R,numCells:Z,calculatedImageSettings:G}=jm({value:l,level:f,minVersion:b,boostLevel:w,includeMargin:h,marginSize:P,imageSettings:M,size:d});let Q=R,W=null;M!=null&&G!=null&&(G.excavation!=null&&(Q=Sm(R,G.excavation)),W=v.default.createElement("image",{href:M.src,height:G.h,width:G.w,x:G.x+z,y:G.y+z,preserveAspectRatio:"none",opacity:G.opacity,crossOrigin:G.crossOrigin}));const X=wm(Q,z);return v.default.createElement("svg",ic({height:d,width:d,viewBox:`0 0 ${Z} ${Z}`,ref:a,role:"img"},D),!!$&&v.default.createElement("title",null,$),v.default.createElement("path",{fill:p,d:`M0,0 h${Z}v${Z}H0z`,shapeRendering:"crispEdges"}),v.default.createElement("path",{fill:g,d:X,shapeRendering:"crispEdges"}),W)});$m.displayName="QRCodeSVG";var OO=192;function km({value:e,size:i=OO,className:a,alt:o}){const l=e.trim();return l.length===0?null:(0,t.jsx)("div",{className:N("inline-flex rounded-md bg-white p-2",a),children:(0,t.jsx)($m,{value:l,size:i,marginSize:1,title:o??"QR code"})})}var MO=2e3;function Pm({value:e,label:i,className:a,disabled:o}){const[l,d]=(0,n.useState)(!1),f=(0,n.useCallback)(()=>{e&&navigator.clipboard.writeText(e).then(()=>{d(!0),setTimeout(()=>d(!1),MO)})},[e]);return(0,t.jsxs)(Zr,{size:"sm",variant:"ghost",type:"button",disabled:o||e.length===0,onClick:f,className:N(a),"aria-label":l?"Copied":`Copy ${i??"value"}`,children:[l?(0,t.jsx)(xn,{className:"h-3.5 w-3.5 text-success"}):(0,t.jsx)(Lr,{className:"h-3.5 w-3.5"}),i?(0,t.jsx)("span",{className:"ml-1",children:l?"Copied":i}):null]})}var EO=Se.z.array(se.ExposedDeviceSchema),IO=Se.z.object({id:Se.z.number(),stableId:Se.z.string(),addonId:Se.z.string(),type:Se.z.string(),name:Se.z.string(),online:Se.z.boolean(),disabled:Se.z.boolean(),parentDeviceId:Se.z.number().nullable(),role:Se.z.string().nullable().optional(),features:Se.z.array(Se.z.string()).optional(),isCamera:Se.z.boolean().optional()}),DO=Se.z.array(Se.z.string()),Nm=1e4;function AO(e){return e==="linked"?"success":e==="error"?"danger":"warning"}function zO(e){return e==="linked"?"Linked":e==="unlinked"?"Unlinked":e==="error"?"Error":e}function TO({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,t.jsxs)("div",{className:"flex items-center gap-2 py-1.5",children:[(0,t.jsx)("span",{className:"text-[11px] text-foreground-subtle w-32 shrink-0",children:e.label}),(0,t.jsx)("span",{className:"flex-1 min-w-0 truncate font-mono text-xs text-foreground",children:l||"—"}),o&&(0,t.jsx)(Zr,{size:"sm",variant:"ghost",type:"button","aria-label":i?"Hide value":"Reveal value",onClick:()=>a(d=>!d),children:i?(0,t.jsx)(tl,{className:"h-3.5 w-3.5"}):(0,t.jsx)(wn,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(Pm,{value:e.value,label:e.label})]})}function RO({setup:e}){const i=e.fields??[];return(0,t.jsxs)("div",{className:"border-b border-border bg-surface-hover/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border",children:[(0,t.jsx)(pv,{className:"h-3.5 w-3.5 text-foreground-subtle shrink-0"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wide",children:"Setup"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4 sm:flex-row sm:items-start",children:[e.qr&&(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)(km,{value:e.qr,alt:"Pairing QR code"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[e.note&&(0,t.jsx)("p",{className:"text-xs text-foreground-muted whitespace-pre-line mb-2",children:e.note}),i.length>0&&(0,t.jsx)("div",{className:"divide-y divide-border-subtle",children:i.map(a=>(0,t.jsx)(TO,{field:a},a.label))})]})]})]})}function LO({addonId:e,deviceId:i,exposed:a,busy:o,onExpose:l,onUnexpose:d}){const f=p=>{p.stopPropagation(),!o&&(a?d(i):l(i))};return(0,t.jsx)(Zr,{size:"sm",variant:a?"ghost":"primary",disabled:o,onClick:f,title:a?`Stop exposing to "${e}"`:`Expose to "${e}"`,children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Ov,{className:"mr-1 h-3.5 w-3.5"}),"Exposed"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(al,{className:"mr-1 h-3.5 w-3.5"}),"Expose"]})})}function ZO({addonId:e,trpc:i,onOpenDevice:a}){const o=(0,te.useQueryClient)(),l=Cf({nodeId:"hub",addonId:e},{refetchInterval:Nm,retry:!1}),d=Mf({nodeId:"hub",addonId:e},{refetchInterval:Nm,retry:!1}),f=Of({nodeId:"hub",addonId:e},{retry:!1}),p=Ll({},{refetchInterval:5e3}),g=(0,n.useCallback)(()=>{o.invalidateQueries({queryKey:[["deviceExport"]]})},[o]),h=Ef({onSuccess:g}),b=If({onSuccess:g}),w=(0,n.useMemo)(()=>{const ye=se.DeviceExportStatusSchema.safeParse(l.data);return ye.success?ye.data:null},[l.data]),$=(0,n.useMemo)(()=>{const ye=EO.safeParse(d.data);return ye.success?ye.data:[]},[d.data]),P=(0,n.useMemo)(()=>new Set($.map(ye=>ye.deviceId)),[$]),M=(0,n.useMemo)(()=>{const ye=DO.safeParse(f.data);return new Set(ye.success?ye.data:[])},[f.data]),D=(0,n.useMemo)(()=>[...M].sort(),[M]),z=(0,n.useMemo)(()=>{const ye=p.data;if(!Array.isArray(ye))return[];const Qe=[];for(const Ye of ye){const Je=IO.safeParse(Ye);Je.success&&M.has(Je.data.type)&&Qe.push(Je.data)}return Qe},[p.data,M]),R=w?.linkState??"unlinked",Z=l.isLoading||d.isLoading||f.isLoading||p.isLoading,G=w?.exposedDeviceCount??P.size,Q=h.isPending||b.isPending,W=(0,n.useCallback)(ye=>{h.mutate({deviceId:ye,nodeId:"hub",addonId:e})},[h,e]),X=(0,n.useCallback)(ye=>{b.mutate({deviceId:ye,nodeId:"hub",addonId:e})},[b,e]),he=(0,n.useCallback)(ye=>{const Qe=String(ye.id);return(0,t.jsx)(LO,{addonId:e,deviceId:Qe,exposed:P.has(Qe),busy:Q,onExpose:W,onUnexpose:X})},[e,P,Q,W,X]),H=(0,n.useCallback)(ye=>a?.(String(ye)),[a]),me=D.length>0;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[(0,t.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,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(al,{className:"h-3.5 w-3.5 text-foreground-subtle shrink-0"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wide",children:"Exported devices"}),(0,t.jsx)(rn,{variant:AO(R),children:zO(R)}),(0,t.jsxs)("span",{className:"text-[11px] text-foreground-subtle",children:[G," exposed"]})]}),Z&&(0,t.jsx)(Wt,{className:"h-3.5 w-3.5 animate-spin text-foreground-subtle"})]}),w?.error&&(0,t.jsx)("div",{className:"px-4 py-3 border-b border-border",children:(0,t.jsx)(_d,{message:w.error})}),w?.setup&&(0,t.jsx)(RO,{setup:w.setup}),(0,t.jsx)("div",{className:"p-3",children:me&&z.length>0?(0,t.jsx)(Jd,{devices:z,trpc:i,defaultView:"table",filters:{types:D},urlScope:"nested",lsKey:`device-export:${e}`,onNavigate:a?H:void 0,renderRowAction:he}):(0,t.jsx)(xd,{icon:al,title:"No exportable devices",description:me?`No devices of the supported kinds (${D.join(", ")}) are available to expose to "${e}".`:`"${e}" reports no exportable device kinds yet.`})})]})}function UO({samples:e,sampleRate:i=16e3,height:a=96,className:o="",color:l="#3b82f6",bgColor:d="transparent"}){const f=(0,n.useRef)(null),p=(0,n.useRef)(null),g=(0,n.useCallback)(()=>{const b=f.current,w=p.current;if(!b||!w||!e||e.length===0)return;const $=w.clientWidth;if($===0)return;const P=window.devicePixelRatio||1;b.width=$*P,b.height=a*P,b.style.width=`${$}px`,b.style.height=`${a}px`;const M=b.getContext("2d");if(!M)return;M.scale(P,P),d!=="transparent"?(M.fillStyle=d,M.fillRect(0,0,$,a)):M.clearRect(0,0,$,a);const D=e.length/$,z=a/2;M.fillStyle=l,M.globalAlpha=.7;for(let R=0;R<$;R++){const Z=Math.floor(R*D),G=Math.min(Math.floor((R+1)*D),e.length);let Q=0,W=0;for(let me=Z;me<G;me++){const ye=e[me];ye<Q&&(Q=ye),ye>W&&(W=ye)}const X=z-W*z,he=z-Q*z,H=Math.max(1,he-X);M.fillRect(R,X,1,H)}M.globalAlpha=1,M.strokeStyle=l,M.globalAlpha=.2,M.lineWidth=1,M.beginPath(),M.moveTo(0,z),M.lineTo($,z),M.stroke(),M.globalAlpha=1},[e,a,l,d]);(0,n.useEffect)(()=>{g()},[g]),(0,n.useEffect)(()=>{const b=new ResizeObserver(()=>g()),w=p.current;return w&&b.observe(w),()=>b.disconnect()},[g]);const h=((e&&i?Math.round(e.length/i*1e3):0)/1e3).toFixed(1);return(0,t.jsxs)("div",{ref:p,className:`relative ${o}`,children:[(0,t.jsx)("canvas",{ref:f,className:"w-full rounded-md"}),e&&e.length>0&&(0,t.jsxs)("div",{className:"absolute bottom-1 right-2 text-[10px] text-foreground-subtle/60 font-mono",children:[h,"s · ",i/1e3,"kHz · ",e.length.toLocaleString()," samples"]})]})}function BO({currentDbfs:e,durationSec:i=30,maxSamples:a=120,height:o=64,className:l="",color:d="#10b981",clipColor:f="#ef4444",clipThreshold:p=-6,minDbfs:g=-96}){const h=(0,n.useRef)(null),b=(0,n.useRef)(null),[w,$]=(0,n.useState)([]);(0,n.useEffect)(()=>{e!==null&&$(D=>{const z=[...D,{dbfs:e,timestamp:Date.now()}];return z.length>a?z.slice(-a):z})},[e,a]);const P=(0,n.useCallback)(()=>{const D=h.current,z=b.current;if(!D||!z)return;const R=z.clientWidth;if(R===0)return;const Z=window.devicePixelRatio||1;D.width=R*Z,D.height=o*Z,D.style.width=`${R}px`,D.style.height=`${o}px`;const G=D.getContext("2d");if(!G||(G.scale(Z,Z),G.clearRect(0,0,R,o),w.length===0))return;const Q=w[w.length-1].timestamp,W=i*1e3,X=Q-W,he=w.filter(Qe=>Qe.timestamp>=X);if(he.length===0)return;const H=Math.max(1,Math.floor(R/(i*2))),me=Math.abs(g);for(const Qe of he){const Ye=Qe.timestamp-X,Je=Math.floor(Ye/W*R),Ae=(Math.max(g,Math.min(0,Qe.dbfs))-g)/me,De=Math.max(1,Ae*o);G.fillStyle=Qe.dbfs>=p?f:d,G.globalAlpha=.8,G.fillRect(Je,o-De,H,De)}G.globalAlpha=1;const ye=o-(p-g)/me*o;G.strokeStyle=f,G.globalAlpha=.25,G.lineWidth=1,G.setLineDash([4,4]),G.beginPath(),G.moveTo(0,ye),G.lineTo(R,ye),G.stroke(),G.setLineDash([]),G.globalAlpha=1},[w,i,o,d,f,p,g]);(0,n.useEffect)(()=>{P()},[P]),(0,n.useEffect)(()=>{const D=new ResizeObserver(()=>P()),z=b.current;return z&&D.observe(z),()=>D.disconnect()},[P]);const M=w.length>0?w[w.length-1].dbfs:null;return(0,t.jsxs)("div",{ref:b,className:`relative ${l}`,children:[(0,t.jsx)("canvas",{ref:h,className:"w-full rounded-md"}),(0,t.jsxs)("div",{className:"absolute top-1 left-2 text-[9px] text-foreground-subtle/50 font-mono",children:[i,"s"]}),M!==null&&(0,t.jsxs)("div",{className:"absolute bottom-1 right-2 text-[9px] text-foreground-subtle/50 font-mono",children:[M.toFixed(1)," dBFS · ",w.length," samples"]})]})}function FO(e){return e>=.8?"bg-emerald-500":e>=.5?"bg-amber-500":e>=.3?"bg-orange-500":"bg-zinc-500"}function GO(e){return e>=.8?"text-emerald-400":e>=.5?"text-amber-400":e>=.3?"text-orange-400":"text-zinc-400"}function VO({classifications:e,processing:i=!1,inferenceMs:a,maxItems:o=10,className:l=""}){const d=e.slice(0,o),f=d.length>0?d[0].score:1;return i?(0,t.jsx)("div",{className:`rounded-xl border border-border bg-surface p-4 text-center ${l}`,children:(0,t.jsx)("div",{className:"text-sm text-foreground-subtle animate-pulse",children:"Classifying audio..."})}):d.length===0?(0,t.jsx)("div",{className:`rounded-xl border border-border bg-surface p-4 text-center ${l}`,children:(0,t.jsx)("div",{className:"text-xs text-foreground-subtle",children:"No classifications yet"})}):(0,t.jsxs)("div",{className:`rounded-xl border border-border bg-surface overflow-hidden ${l}`,children:[(0,t.jsxs)("div",{className:"px-3 py-2 border-b border-border flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-foreground",children:"Audio Classifications"}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-[10px] text-foreground-subtle",children:[d.length<e.length&&(0,t.jsxs)("span",{children:["showing ",d.length," of ",e.length]}),a!==void 0&&(0,t.jsxs)("span",{className:"font-mono",children:[a.toFixed(1),"ms"]})]})]}),(0,t.jsx)("div",{className:"divide-y divide-border/50",children:d.map((p,g)=>{const h=f>0?p.score/f*100:0;return(0,t.jsxs)("div",{className:"px-3 py-1.5 flex items-center gap-3 hover:bg-surface-hover/30",children:[(0,t.jsx)("span",{className:"text-[10px] text-foreground-subtle w-5 text-right font-mono",children:g+1}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground min-w-[120px]",children:p.className}),(0,t.jsx)("div",{className:"flex-1 h-2 rounded-full bg-zinc-800 overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-300 ${FO(p.score)}`,style:{width:`${h}%`}})}),(0,t.jsxs)("span",{className:`text-xs font-mono font-semibold w-14 text-right ${GO(p.score)}`,children:[(p.score*100).toFixed(1),"%"]})]},`${p.className}-${g}`)})})]})}function WO({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,t.jsxs)("div",{className:`rounded-xl border border-border bg-surface overflow-hidden ${a}`,children:[(0,t.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(f=>!f),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] text-foreground-subtle",children:o?"▼":"▶"}),(0,t.jsx)("h3",{className:"text-xs font-medium text-foreground",children:i})]}),(0,t.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,t.jsx)("div",{className:"max-h-80 overflow-y-auto overflow-x-auto",children:(0,t.jsx)("pre",{className:"p-3 text-[10px] leading-4 font-mono text-foreground-subtle whitespace-pre",children:d})})]})}var QO={Activity:zr,Eye:wn,AlertTriangle:jn,PauseCircle:Jh,PowerOff:gv};function HO({phase:e,...i}){const a=QO[Is(e).icon];return(0,t.jsx)(a,{...i})}function En(e){const[i,a]=(0,n.useState)([]),o=(0,n.useCallback)(d=>{a(f=>{const p=[...f,d];return p.length>e?p.slice(-e):p})},[e]),l=(0,n.useCallback)(()=>{a([])},[]);return(0,n.useMemo)(()=>({entries:i,append:o,reset:l}),[i,o,l])}function Cm(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 Om={error:{icon:_n,color:"text-red-400"},warn:{icon:jn,color:"text-amber-400"},info:{icon:sv,color:"text-blue-400"},debug:{icon:Bh,color:"text-gray-500"}},Mm={debug:0,info:1,warn:2,error:3},qO=["all","debug","info","warn","error"],JO=500;function KO(e,i){return i?(Mm[e]??0)>=(Mm[i]??0):!0}function oc({agentId:e,addonId:i,deviceId:a,integrationId:o,requestId:l,level:d,maxHeight:f="max-h-96",showScope:p=!1,showFilters:g=!0,limit:h=100,liveBuffer:b,onClose:w,className:$}){const[P,M]=(0,n.useState)(""),[D,z]=(0,n.useState)(""),[R,Z]=(0,n.useState)(d),G=e,Q=i??(P||void 0),W=a??(D?Number(D):void 0),X=o,he=l,H=(0,n.useMemo)(()=>{const Pe={};return G&&(Pe.agentId=G),Q&&(Pe.addonId=Q),W!==void 0&&Number.isFinite(W)&&(Pe.deviceId=W),X&&(Pe.integrationId=X),he&&(Pe.requestId=he),Object.keys(Pe).length>0?Pe:void 0},[G,Q,W,X,he]),me=En(JO),ye=b??me,Qe=ye.entries,[Ye,Je]=(0,n.useState)(0),[Ae,De]=(0,n.useState)(!0),[Re,Te]=(0,n.useState)(!1),[ue,ge]=(0,n.useState)(!1),[ve,je]=(0,n.useState)(new Set),[_e,Ue]=(0,n.useState)(""),ne=(0,n.useRef)(null),we=`${G??""}:${Q??""}:${String(W??"")}:${X??""}:${he??""}`,Me=(0,n.useRef)(we);(0,n.useEffect)(()=>{Me.current!==we&&(Me.current=we,ye.reset(),Je(0),je(new Set),Te(!1))},[we,ye]);const{data:ze,isLoading:We}=S.logs.query.useQuery({...H?{tags:H}:{},limit:h},{staleTime:3e4});S.logs.subscribe.useSubscription({...H?{tags:H}:{}},{onData:Pe=>{ye.append(Pe)}});const Fe=(0,n.useMemo)(()=>{const Pe=(ze??[]).map(qe=>({timestamp:qe.timestamp,level:qe.level,message:qe.message,scope:qe.scope,tags:qe.tags,meta:qe.meta})),ut=new Map;for(const qe of Pe)ut.set(`${qe.timestamp}|${qe.level}|${qe.scope??""}|${qe.message}`,qe);for(const qe of Qe)ut.set(`${qe.timestamp}|${qe.level}|${qe.scope??""}|${qe.message}`,qe);const Ee=[...ut.values()].sort((qe,xe)=>new Date(qe.timestamp).getTime()-new Date(xe.timestamp).getTime()),Ve=(Ye>0?Ee.filter(qe=>new Date(qe.timestamp).getTime()>Ye):Ee).filter(qe=>KO(qe.level,R)),Ce=_e.trim().toLowerCase();return Ce?Ve.filter(qe=>{if(qe.message.toLowerCase().includes(Ce)||qe.scope&&qe.scope.toLowerCase().includes(Ce))return!0;if(qe.tags){for(const xe of Object.values(qe.tags))if(xe!==void 0&&String(xe).toLowerCase().includes(Ce))return!0}if(qe.meta){for(const xe of Object.values(qe.meta))if(xe!=null&&Cm(xe).toLowerCase().includes(Ce))return!0}return!1}):Ve},[ze,Qe,R,Ye,_e]),Tt=(0,n.useRef)(Fe.length);(0,n.useEffect)(()=>{const Pe=ne.current,ut=Fe.length>Tt.current;Tt.current=Fe.length,!(!Pe||!ut||!Ae)&&Pe.scrollTo({top:Pe.scrollHeight})},[Fe.length,Ae]);const Rt=(0,n.useCallback)(()=>{const Pe=ne.current;if(!Pe)return;const ut=Pe.scrollHeight-Pe.scrollTop-Pe.clientHeight<32;De(Ee=>Ee===ut?Ee:ut)},[]),Ct=(0,n.useMemo)(()=>Fe.filter(Pe=>Pe.tags&&Object.keys(Pe.tags).length>0||Pe.meta&&Object.keys(Pe.meta).length>0).map(Pe=>`${Pe.timestamp}|${Pe.level}|${Pe.scope??""}|${Pe.message}`),[Fe]),xt=(0,n.useCallback)(()=>{Te(Pe=>(Pe&&je(new Set),!Pe))},[]),Zt=(0,n.useCallback)(()=>{const Pe=Fe.map(ut=>{const Ee=new Date(ut.timestamp).toLocaleTimeString(),Ve=ut.tags?" "+Object.entries(ut.tags).filter(([,Ce])=>Ce).map(([Ce,qe])=>`${Ce}=${qe}`).join(" "):"";return`${Ee} [${ut.level.toUpperCase()}]${ut.scope?` [${ut.scope}]`:""}${Ve} ${ut.message}`});navigator.clipboard.writeText(Pe.join(`
|
|
150
|
+
`)).then(()=>{ge(!0),setTimeout(()=>ge(!1),1500)})},[Fe]),Ut=S.logs.clear.useMutation(),Gr=(0,n.useCallback)(()=>{Je(Date.now()),ye.reset(),Ut.mutate({...H?{tags:H}:{}})},[ye,Ut,H]),yr=(0,n.useCallback)(Pe=>{je(ut=>{const Ee=new Set(ut);return Ee.has(Pe)?Ee.delete(Pe):Ee.add(Pe),Ee})},[]),[dr,Vr]=(0,n.useState)(null),kr=(0,n.useCallback)((Pe,ut)=>{const Ee=new Date(Pe.timestamp).toISOString(),Ve=Pe.tags?" "+Object.entries(Pe.tags).filter(([,xe])=>xe).map(([xe,et])=>`${xe}=${et}`).join(" "):"",Ce=Pe.meta&&Object.keys(Pe.meta).length>0?` meta=${JSON.stringify(Pe.meta)}`:"",qe=`${Ee} [${Pe.level.toUpperCase()}]${Pe.scope?` [${Pe.scope}]`:""}${Ve} ${Pe.message}${Ce}`;navigator.clipboard.writeText(qe).then(()=>{Vr(ut),setTimeout(()=>Vr(xe=>xe===ut?null:xe),1200)})},[]),Pr=(0,n.useCallback)(Pe=>`${Pe.timestamp}|${Pe.level}|${Pe.scope??""}|${Pe.message}`,[]);return(0,t.jsxs)("div",{className:N("h-full min-h-0 flex flex-col",$),onClick:Pe=>Pe.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-hover/30 gap-2 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"Logs"}),G&&(0,t.jsx)(sc,{label:"agent",value:G}),Q&&(0,t.jsx)(sc,{label:"addon",value:Q}),W!==void 0&&(0,t.jsx)(sc,{label:"device",value:`#${W}`}),(0,t.jsx)("div",{className:"flex rounded border border-border overflow-hidden text-[9px]",children:qO.map(Pe=>(0,t.jsxs)("button",{type:"button",onClick:()=>Z(Pe==="all"?void 0:Pe),className:N("px-1.5 py-0.5 capitalize transition-colors",Pe==="all"&&!R||R===Pe?"bg-primary/10 text-primary":"text-foreground-subtle hover:bg-surface-hover",Pe!=="all"&&"border-l border-border"),children:[Pe,Pe!=="all"?"+":""]},Pe))}),(0,t.jsx)(no,{icon:Eh,label:Ae?"Following":"Paused",active:Ae,onClick:()=>{De(Pe=>{const ut=!Pe;return ut&&ne.current&&ne.current.scrollTo({top:ne.current.scrollHeight,behavior:"smooth"}),ut})}}),(0,t.jsx)(no,{icon:Re?Vh:Wh,label:Re?"Collapse":"Expand",active:Re,onClick:xt,disabled:Ct.length===0}),(0,t.jsx)(no,{icon:Lr,label:ue?"Copied!":"Copy",onClick:Zt,disabled:Fe.length===0}),(0,t.jsx)(no,{icon:hr,label:"Clear",onClick:Gr}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{type:"text",value:_e,onChange:Pe=>Ue(Pe.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"}),_e&&(0,t.jsx)("button",{type:"button",onClick:()=>Ue(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",title:"Clear search",children:(0,t.jsx)(Mt,{className:"h-2.5 w-2.5"})})]}),Qe.length>0&&(0,t.jsxs)("span",{className:"text-[9px] text-emerald-400 font-medium",children:["+",Qe.length," live"]})]}),w&&(0,t.jsx)("button",{type:"button",onClick:w,className:"text-foreground-subtle hover:text-foreground",children:(0,t.jsx)(Mt,{className:"h-3.5 w-3.5"})})]}),g&&(!i||!a)&&(0,t.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,t.jsxs)("label",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-foreground-subtle",children:"Addon:"}),(0,t.jsx)("input",{type:"text",value:P,onChange:Pe=>M(Pe.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,t.jsxs)("label",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-foreground-subtle",children:"Device:"}),(0,t.jsx)("input",{type:"text",inputMode:"numeric",value:D,onChange:Pe=>z(Pe.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,t.jsxs)("div",{ref:ne,onScroll:Rt,className:N("flex-1 min-h-0 overflow-auto font-mono text-[10px]",f),children:[We&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle",children:[(0,t.jsx)(Wt,{className:"h-3.5 w-3.5 animate-spin"}),"Loading logs..."]}),!We&&Fe.length===0&&(0,t.jsx)("div",{className:"py-4 text-center text-foreground-subtle",children:"No logs found"}),Fe.length>0&&(0,t.jsx)("table",{className:"w-full",children:(0,t.jsx)("tbody",{children:Fe.map(Pe=>{const ut=Om[Pe.level]??Om.info,Ee=ut.icon,Ve=Pr(Pe),Ce=Re||ve.has(Ve),qe=Pe.tags&&Object.keys(Pe.tags).length>0,xe=Pe.meta&&Object.keys(Pe.meta).length>0,et=qe||xe;return(0,t.jsxs)("tr",{className:N("hover:bg-surface-hover/30 border-b border-border/30",et&&"cursor-pointer"),onClick:et?()=>yr(Ve):void 0,children:[(0,t.jsx)("td",{className:"px-2 py-1 text-foreground-subtle whitespace-nowrap align-top w-[70px]",children:new Date(Pe.timestamp).toLocaleTimeString()}),(0,t.jsx)("td",{className:N("px-1 py-1 align-top w-5",ut.color),children:(0,t.jsx)(Ee,{className:"h-3 w-3"})}),p&&(0,t.jsx)("td",{className:"px-2 py-1 text-foreground-subtle align-top truncate max-w-[120px]",title:Pe.scope,children:Pe.scope?.replace(/^addon:/,"")??""}),(0,t.jsx)("td",{className:"px-2 py-1 text-foreground break-all",children:(0,t.jsxs)("div",{className:"flex items-start gap-1",children:[et&&(Ce?(0,t.jsx)(Tr,{className:"h-3 w-3 text-foreground-subtle shrink-0 mt-0.5"}):(0,t.jsx)(Rr,{className:"h-3 w-3 text-foreground-subtle shrink-0 mt-0.5"})),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[Pe.message,Ce&&et&&(0,t.jsxs)("div",{className:"mt-0.5 pl-3 text-[9px] leading-snug",children:[xe&&Object.entries(Pe.meta).filter(([,Ke])=>Ke!==void 0&&Ke!=="").map(([Ke,nt])=>(0,t.jsxs)("div",{className:"break-all",children:[(0,t.jsx)("span",{className:"text-amber-400/80",children:Ke}),(0,t.jsx)("span",{className:"text-foreground-subtle",children:"="}),(0,t.jsx)("span",{className:"text-foreground",children:Cm(nt)})]},`m-${Ke}`)),qe&&Object.entries(Pe.tags).filter(([,Ke])=>Ke!==void 0).map(([Ke,nt])=>(0,t.jsxs)("div",{className:"break-all",children:[(0,t.jsx)("span",{className:"text-primary/70",children:Ke}),(0,t.jsx)("span",{className:"text-foreground-subtle",children:"="}),(0,t.jsx)("span",{className:"text-foreground",children:nt})]},`t-${Ke}`))]})]})]})}),(0,t.jsx)("td",{className:"px-1 py-1 align-top w-5",children:(0,t.jsx)(YO,{copied:dr===Ve,onCopy:()=>kr(Pe,Ve)})})]},Ve)})})})]})]})}function XO({position:e="bottom",className:i,...a}){return(0,t.jsx)("div",{className:N(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,t.jsx)(oc,{maxHeight:"max-h-48",...a})})}function sc({label:e,value:i}){return(0,t.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:[e,": ",i]})}function YO({copied:e,onCopy:i}){return(0,t.jsx)("button",{type:"button",title:"Copy this row",onClick:a=>{a.stopPropagation(),i()},className:N("rounded p-0.5 transition-colors",e?"text-emerald-400":"text-foreground-subtle/60 hover:text-foreground hover:bg-surface-hover"),children:e?(0,t.jsx)(xn,{className:"h-3 w-3"}):(0,t.jsx)(Lr,{className:"h-3 w-3"})})}function no({icon:e,label:i,onClick:a,disabled:o,active:l}){return(0,t.jsxs)("button",{type:"button",onClick:a,disabled:o,className:N("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,t.jsx)(e,{className:"h-2.5 w-2.5"}),i]})}function eM(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 tM={[se.EventCategory.AddonStarted]:{icon:il,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Started"},[se.EventCategory.AddonInstalled]:{icon:el,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Installed"},[se.EventCategory.AddonRestarted]:{icon:za,color:"bg-blue-500/15 text-blue-400 border-blue-500/30",label:"Restarted"},[se.EventCategory.AddonUpdated]:{icon:Iu,color:"bg-blue-500/15 text-blue-400 border-blue-500/30",label:"Updated"},[se.EventCategory.AddonStopped]:{icon:ol,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:"Stopped"},[se.EventCategory.AddonUninstalled]:{icon:hr,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:"Uninstalled"},[se.EventCategory.AddonCrashed]:{icon:_n,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Crashed"},[se.EventCategory.AddonError]:{icon:jn,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Error"},[se.EventCategory.DetectionPhaseTransition]:{icon:zr,color:"bg-violet-500/15 text-violet-400 border-violet-500/30",label:"Phase"},[se.EventCategory.DetectionResult]:{icon:bv,color:"bg-purple-500/15 text-purple-400 border-purple-500/30",label:"Detection"},[se.EventCategory.DetectionEvent]:{icon:wn,color:"bg-blue-500/15 text-blue-400 border-blue-500/30",label:"Event"},[se.EventCategory.DetectionCameraNative]:{icon:Eu,color:"bg-cyan-500/15 text-cyan-400 border-cyan-500/30",label:"Camera AI"},[se.EventCategory.ProviderMotion]:{icon:Au,color:"bg-orange-500/15 text-orange-400 border-orange-500/30",label:"Motion"},[se.EventCategory.MotionOnMotionChanged]:{icon:Au,color:"bg-orange-500/15 text-orange-400 border-orange-500/30",label:"Motion"},[se.EventCategory.MotionAnalysis]:{icon:zr,color:"bg-orange-500/10 text-orange-300 border-orange-500/20",label:"Motion analysis"},[se.EventCategory.MotionZonesRaw]:{icon:zr,color:"bg-orange-500/10 text-orange-300 border-orange-500/20",label:"Motion zones"},[se.EventCategory.ProviderDetection]:{icon:Eu,color:"bg-cyan-500/15 text-cyan-400 border-cyan-500/30",label:"Provider Det"},[se.EventCategory.PipelineAudioInferenceResult]:{icon:$u,color:"bg-pink-500/15 text-pink-400 border-pink-500/30",label:"Audio"},[se.EventCategory.AgentOnline]:{icon:il,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Agent Online"},[se.EventCategory.AgentOffline]:{icon:ol,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Agent Offline"},[se.EventCategory.DeviceRegistered]:{icon:el,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Registered"},[se.EventCategory.DeviceUnregistered]:{icon:hr,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Unregistered"},[se.EventCategory.DeviceStateChanged]:{icon:zr,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:"State"}};function lc(e,i){const a=tM[e]??{icon:il,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:e.split(".").pop()??e};if(e===se.EventCategory.DeviceStateChanged&&i&&typeof i.capName=="string"){const o=i.capName;return{...a,label:o}}return a}var In=Object.freeze([...new Set(Object.values(se.EventCategory))].sort()),rM=Object.freeze([se.EventCategory.PipelineCameraMetricsSnapshot,se.EventCategory.PipelineRunnerLoadSnapshot,se.EventCategory.PipelineEngineMetricsSnapshot,se.EventCategory.PipelineInferenceResult,se.EventCategory.PipelineTrace,se.EventCategory.PipelineProgress,se.EventCategory.StreamBrokerMetricsSnapshot,se.EventCategory.MetricsNodeResourcesSnapshot,se.EventCategory.MetricsNodeProcessesSnapshot,se.EventCategory.ClusterTopologySnapshot,se.EventCategory.MotionAnalysis,se.EventCategory.MotionZonesRaw,se.EventCategory.DetectionResult,se.EventCategory.PipelineAudioInferenceResult,se.EventCategory.PlatformProbePhase,se.EventCategory.BenchmarkProgress,se.EventCategory.ModelDownloadProgress]),nM=new Set(rM),iM=Object.freeze(In.filter(e=>!nM.has(e)));function io(e,i){if(e===se.EventCategory.DetectionPhaseTransition){const l=i.to,d=i.from,f=typeof i.source=="string"?i.source:null,p=typeof i.cooldownMs=="number"?i.cooldownMs:null,g=f?` (${f}${p?`, ${Math.round(p/1e3)}s cooldown`:""})`:"";return l==="active"?`Motion detected — phase active${g}`:l==="watching"?`Cooldown expired — phase watching${g}`:`Phase: ${String(d)} → ${String(l)}${g}`}if(e===se.EventCategory.DetectionResult){const l=i.frame?.detections??[];if(l.length===0)return null;const d=new Map;for(const f of l){const p=f,g=p.class??p.macroClass,h=typeof g=="string"?g:"";h&&d.set(h,(d.get(h)??0)+1)}return[...d.entries()].map(([f,p])=>p>1?`${f} ×${p}`:f).join(", ")}if(e===se.EventCategory.PipelineAudioInferenceResult){const l=i.frame?.detections??[];return l.length===0?null:l.map(d=>{const f=d,p=f.macroClass??f.class??f.label,g=typeof p=="string"?p:"",h=f.score;return h?`${g} (${Math.round(h*100)}%)`:g}).filter(Boolean).join(", ")}if(e===se.EventCategory.DetectionEvent){const l=i.label??i.class,d=i.score??i.confidence,f=[];return typeof l=="string"&&f.push(l),typeof d=="number"&&f.push(`${Math.round(d*100)}%`),f.length>0?f.join(" — "):null}if(e===se.EventCategory.ProviderMotion)return i.active===!0?"motion start":"motion stop";if(e===se.EventCategory.DeviceStateChanged){const l=i.slice;if(l&&typeof l=="object"){const d=Object.keys(l).filter(f=>f!=="lastFetchedAt"&&f!=="ts");if(d.length>0)return d.slice(0,4).join(", ")+(d.length>4?"…":"")}return null}if(e===se.EventCategory.MotionOnMotionChanged){const l=i.detected,d=typeof i.source=="string"?i.source:null,f=l===!0?"motion start":l===!1?"motion stop":"motion";return d?`${f} (${d})`:f}if(e===se.EventCategory.ProviderDetection||e===se.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 f of l){const p=f,g=p.class??p.macroClass,h=typeof g=="string"?g:"";h&&d.set(h,(d.get(h)??0)+1)}return[...d.entries()].map(([f,p])=>p>1?`${f} ×${p}`:f).join(", ")}const a=i.addonId,o=i.error;return o||(a?`addon: ${a}`:null)}function aM(e){const i=e.category;return i===se.EventCategory.DetectionResult||i===se.EventCategory.PipelineAudioInferenceResult?io(i,e.data)!==null:!0}var oM=300;function cc({agentId:e,addonId:i,deviceId:a,defaultCategories:o,categories:l,category:d,maxHeight:f="max-h-96",limit:p=50,showCategoryFilter:g=!0,showFilters:h=!1,liveBuffer:b,onClose:w,className:$}){const P=(0,n.useMemo)(()=>o??l??iM,[o,l]),M=(0,n.useMemo)(()=>[...P].sort().join(","),[P]),[D,z]=(0,n.useState)(()=>new Set(P)),R=(0,n.useRef)(M);(0,n.useEffect)(()=>{R.current!==M&&(R.current=M,z(new Set(P)))},[M,P]);const Z=En(oM),G=b??Z,Q=G.entries,[W,X]=(0,n.useState)(!0),[he,H]=(0,n.useState)(new Set),[me,ye]=(0,n.useState)(""),[Qe,Ye]=(0,n.useState)(!1),[Je,Ae]=(0,n.useState)(""),[De,Re]=(0,n.useState)(0),Te=(0,n.useRef)(null),ue=(0,n.useRef)(null),ge=`${e??""}:${i??""}:${String(a??"")}:${d??""}`,ve=(0,n.useRef)(ge);(0,n.useEffect)(()=>{ve.current!==ge&&(ve.current=ge,G.reset(),H(new Set),Re(0))},[ge,G]),(0,n.useEffect)(()=>{if(!Qe)return;const xe=et=>{const Ke=ue.current;Ke&&et.target instanceof Node&&!Ke.contains(et.target)&&Ye(!1)};return document.addEventListener("mousedown",xe),()=>{document.removeEventListener("mousedown",xe)}},[Qe]);const je=(0,n.useMemo)(()=>{const xe={};return e&&(xe.agentId=e),i&&(xe.addonId=i),a!==void 0&&(xe.deviceId=a),d&&(xe.category=d),xe},[e,i,a,d]),_e=(0,n.useMemo)(()=>[...D].sort(),[D]),Ue=(0,n.useMemo)(()=>{const xe={...je,limit:p};return _e.length>0&&_e.length<In.length&&(xe.category=_e),xe},[je,p,(0,n.useMemo)(()=>_e.join(","),[_e]),_e]),{data:ne,isLoading:we}=S.systemEvents.getRecent.useQuery(Ue,{staleTime:3e4}),Me=(0,n.useRef)(D);(0,n.useEffect)(()=>{Me.current=D},[D]);const ze=je;S.systemEvents.subscribe.useSubscription(ze,{onData:xe=>{const et=xe;et?.id&&eM(et,e,i,a)&&Me.current.has(et.category)&&G.append(et)}});const We=(0,n.useRef)(Q.length);(0,n.useEffect)(()=>{const xe=Te.current;if(!xe){We.current=Q.length;return}const et=We.current;if(We.current=Q.length,!(Q.length<=et)){if(W&&xe.scrollTop<=8)xe.scrollTo({top:0});else if(!W&&xe.scrollTop>0){const Ke=xe.firstElementChild?.firstElementChild,nt=Ke instanceof HTMLElement?Ke.offsetHeight:28;xe.scrollTop+=nt*(Q.length-et)}}},[Q.length,W]);const Fe=(0,n.useMemo)(()=>{const xe=new Map;for(const nt of ne??[])xe.set(nt.id,nt);for(const nt of Q)xe.set(nt.id,nt);let et=[...xe.values()].filter(nt=>D.has(nt.category)).filter(aM);De>0&&(et=et.filter(nt=>new Date(nt.timestamp).getTime()>De));const Ke=me.trim().toLowerCase();return Ke&&(et=et.filter(nt=>{if(nt.category.toLowerCase().includes(Ke)||lc(nt.category,nt.data).label.toLowerCase().includes(Ke))return!0;const er=io(nt.category,nt.data);if(er&&er.toLowerCase().includes(Ke))return!0;try{if(new Date(nt.timestamp).toLocaleTimeString().toLowerCase().includes(Ke))return!0}catch{}try{if(JSON.stringify(nt.data).toLowerCase().includes(Ke)||JSON.stringify(nt.source).toLowerCase().includes(Ke))return!0}catch{}return!1})),et.sort((nt,er)=>new Date(er.timestamp).getTime()-new Date(nt.timestamp).getTime())},[ne,Q,D,me,De]),Tt=(0,n.useCallback)(xe=>{H(et=>{const Ke=new Set(et);return Ke.has(xe)?Ke.delete(xe):Ke.add(xe),Ke})},[]),Rt=(0,n.useCallback)(xe=>{z(et=>{const Ke=new Set(et);return Ke.has(xe)?Ke.delete(xe):Ke.add(xe),Ke})},[]),Ct=(0,n.useCallback)(()=>{z(new Set(P)),ye(""),Re(0)},[P]),xt=(0,n.useCallback)(()=>{Re(Date.now()),G.reset()},[G]),[Zt,Ut]=(0,n.useState)(!1),[Gr,yr]=(0,n.useState)(null),dr=(0,n.useCallback)(xe=>{const et=new Date(xe.timestamp).toISOString(),Ke=io(xe.category,xe.data)??"",nt=Ke?` ${Ke}`:"";return`${et} [${xe.category}]${nt} data=${JSON.stringify(xe.data)}`},[]),Vr=(0,n.useCallback)(()=>{const xe=Fe.map(dr);navigator.clipboard.writeText(xe.join(`
|
|
151
|
+
`)).then(()=>{Ut(!0),setTimeout(()=>Ut(!1),1500)})},[Fe,dr]),kr=(0,n.useCallback)(xe=>{navigator.clipboard.writeText(dr(xe)).then(()=>{yr(xe.id),setTimeout(()=>yr(et=>et===xe.id?null:et),1200)})},[dr]),Pr=(0,n.useCallback)(()=>{z(new Set(In))},[]),Pe=(0,n.useCallback)(()=>{z(new Set)},[]),ut=(0,n.useMemo)(()=>{const xe=Je.trim().toLowerCase();return xe?In.filter(et=>et.toLowerCase().includes(xe)):In},[Je]),Ee=In.length,Ve=D.size,Ce=Ve===Ee,qe=Ce?"All":`${Ve}/${Ee}`;return(0,t.jsxs)("div",{className:N("h-full min-h-0 flex flex-col",$),onClick:xe=>xe.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-hover/30 gap-2 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"Events"}),e&&(0,t.jsx)(ao,{label:"agent",value:e}),i&&(0,t.jsx)(ao,{label:"addon",value:i}),a!==void 0&&(0,t.jsx)(ao,{label:"device",value:`#${a}`}),d&&(0,t.jsx)(ao,{label:"category",value:d}),(0,t.jsxs)("button",{type:"button",onClick:()=>{X(xe=>!xe),!W&&Te.current&&Te.current.scrollTo({top:0,behavior:"smooth"})},className:N("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,t.jsx)(zh,{className:"h-2.5 w-2.5"}),W?"Auto":"Paused"]}),g&&(0,t.jsxs)("div",{className:"relative",ref:ue,children:[(0,t.jsxs)("button",{type:"button",onClick:()=>Ye(xe=>!xe),className:N("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",Ce?"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,t.jsx)(_u,{className:"h-2.5 w-2.5"}),"Filter (",qe,")"]}),Qe&&(0,t.jsx)(sM,{search:Je,onSearchChange:Ae,categories:ut,active:D,onToggle:Rt,onSelectAll:Pr,onSelectNone:Pe,onResetDefaults:Ct})]}),(0,t.jsxs)("button",{type:"button",onClick:Ct,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,t.jsx)(Cu,{className:"h-2.5 w-2.5"}),"Reset"]}),(0,t.jsxs)("button",{type:"button",onClick:xt,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,t.jsx)(hr,{className:"h-2.5 w-2.5"}),"Clear"]}),(0,t.jsxs)("button",{type:"button",onClick:Vr,disabled:Fe.length===0,className:N("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",Zt?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":"border-border text-foreground-subtle hover:text-foreground",Fe.length===0&&"opacity-40 cursor-not-allowed"),title:"Copy all visible events",children:[(0,t.jsx)(Lr,{className:"h-2.5 w-2.5"}),Zt?"Copied!":"Copy"]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{type:"text",value:me,onChange:xe=>ye(xe.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"}),me&&(0,t.jsx)("button",{type:"button",onClick:()=>ye(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",title:"Clear search",children:(0,t.jsx)(Mt,{className:"h-2.5 w-2.5"})})]}),Q.length>0&&(0,t.jsxs)("span",{className:"text-[9px] text-emerald-400 font-medium",children:["+",Q.length," live"]})]}),w&&(0,t.jsx)("button",{type:"button",onClick:w,className:"text-foreground-subtle hover:text-foreground",children:(0,t.jsx)(Mt,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)("div",{ref:Te,className:N("flex-1 min-h-0 overflow-auto text-[10px]",f),children:[we&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle",children:[(0,t.jsx)(Wt,{className:"h-3.5 w-3.5 animate-spin"}),"Loading events..."]}),!we&&Fe.length===0&&(0,t.jsx)("div",{className:"py-4 text-center text-foreground-subtle",children:"No events found"}),Fe.length>0&&(0,t.jsx)("div",{className:"divide-y divide-border/30",children:Fe.map(xe=>{const et=lc(xe.category,xe.data),Ke=et.icon,nt=io(xe.category,xe.data),er=he.has(xe.id);return(0,t.jsxs)("div",{className:"flex items-start gap-2 px-3 py-1.5 hover:bg-surface-hover/30 cursor-pointer",onClick:()=>Tt(xe.id),children:[(0,t.jsx)("span",{className:"text-foreground-subtle whitespace-nowrap w-[70px] shrink-0 pt-0.5",children:new Date(xe.timestamp).toLocaleTimeString()}),(0,t.jsx)(cM,{copied:Gr===xe.id,onCopy:()=>kr(xe)}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[er?(0,t.jsx)(Tr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}):(0,t.jsx)(Rr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}),(0,t.jsxs)("span",{className:N("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[9px] font-medium",et.color),children:[(0,t.jsx)(Ke,{className:"h-2.5 w-2.5"}),et.label]}),xe.source.nodeId&&xe.source.nodeId!=="hub"&&(0,t.jsx)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-foreground-subtle/10 text-foreground-subtle font-mono",children:xe.source.nodeId})]}),nt&&(0,t.jsx)("p",{className:"text-foreground-subtle text-[10px] mt-0.5 ml-5",children:nt}),er&&(0,t.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,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-primary/70",children:"source"}),(0,t.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,t.jsx)("span",{className:"text-foreground",children:JSON.stringify(xe.source)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-primary/70",children:"category"}),(0,t.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,t.jsx)("span",{className:"text-foreground",children:xe.category})]}),Object.entries(xe.data).map(([bt,pt])=>(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-primary/70",children:bt}),(0,t.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,t.jsx)("span",{className:"text-foreground break-all",children:typeof pt=="object"?JSON.stringify(pt):String(pt)})]},bt))]})]})]},xe.id)})})]})]})}function sM({search:e,onSearchChange:i,categories:a,active:o,onToggle:l,onSelectAll:d,onSelectNone:f,onResetDefaults:p}){return(0,t.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:g=>g.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border/50",children:[(0,t.jsx)(Gi,{className:"h-3 w-3 text-foreground-subtle"}),(0,t.jsx)("input",{type:"text",value:e,onChange:g=>i(g.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,t.jsx)("button",{type:"button",onClick:()=>i(""),className:"text-foreground-subtle hover:text-foreground",children:(0,t.jsx)(Mt,{className:"h-2.5 w-2.5"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 border-b border-border/50 text-[9px]",children:[(0,t.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,t.jsx)("button",{type:"button",onClick:f,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"None"}),(0,t.jsx)("button",{type:"button",onClick:p,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"Defaults"})]}),(0,t.jsxs)("div",{className:"overflow-y-auto flex-1",children:[a.length===0&&(0,t.jsx)("div",{className:"text-[10px] text-foreground-subtle italic px-2 py-3 text-center",children:"No matches"}),a.map(g=>{const h=o.has(g),b=lc(g),w=b.icon;return(0,t.jsxs)("button",{type:"button",onClick:()=>l(g),className:"w-full flex items-center gap-2 px-2 py-1 text-left hover:bg-surface-hover/40 text-[10px]",children:[(0,t.jsx)("input",{type:"checkbox",readOnly:!0,checked:h,className:"accent-violet-500"}),(0,t.jsxs)("span",{className:N("inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[9px] font-medium shrink-0",b.color),children:[(0,t.jsx)(w,{className:"h-2.5 w-2.5"}),b.label]}),(0,t.jsx)("span",{className:"text-foreground-subtle font-mono truncate",children:g})]},g)})]})]})}function lM({position:e="bottom",className:i,...a}){return(0,t.jsx)("div",{className:N(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,t.jsx)(cc,{maxHeight:"max-h-48",...a})})}function ao({label:e,value:i}){return(0,t.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:[e,": ",i]})}function cM({copied:e,onCopy:i}){return(0,t.jsx)("button",{type:"button",title:"Copy this event",onClick:a=>{a.stopPropagation(),i()},className:N("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,t.jsx)(xn,{className:"h-3 w-3"}):(0,t.jsx)(Lr,{className:"h-3 w-3"})})}function uM({deviceId:e,className:i="",onOpenChild:a}){const o=S.useUtils(),l=S.deviceDiscovery.listDiscovered.useQuery({deviceId:e},{refetchInterval:1e4,retry:!1}),d=S.deviceDiscovery.getStatus.useQuery({deviceId:e},{refetchInterval:1e4,retry:!1}),f=S.deviceDiscovery.refreshDiscovery.useMutation({onSuccess:()=>{o.deviceDiscovery.listDiscovered.invalidate({deviceId:e}),o.deviceDiscovery.getStatus.invalidate({deviceId:e})}}),p=S.deviceDiscovery.adoptDevice.useMutation({onSuccess:()=>{o.deviceDiscovery.listDiscovered.invalidate({deviceId:e})}}),g=S.deviceDiscovery.releaseDevice.useMutation({onSuccess:()=>{o.deviceDiscovery.listDiscovered.invalidate({deviceId:e})}}),[h,b]=(0,n.useState)(null),{available:w,adopted:$}=(0,n.useMemo)(()=>{const G=l.data??[],Q=X=>typeof X.metadata.rtspChannel=="number"?X.metadata.rtspChannel:Number.POSITIVE_INFINITY,W=(X,he)=>{const H=Q(X),me=Q(he);return H!==me?H-me:X.name.localeCompare(he.name)};return{available:G.filter(X=>!X.alreadyAdopted).sort(W),adopted:G.filter(X=>X.alreadyAdopted).sort(W)}},[l.data]),P=d.data,M=P?.lastError??null,D=P?.lastDiscoveryAt??null;async function z(){await f.mutateAsync({deviceId:e}).catch(()=>{})}async function R(G){b(G.childNativeId);try{await p.mutateAsync({deviceId:e,childNativeId:G.childNativeId})}finally{b(null)}}async function Z(G){if(G.adoptedDeviceId!=null){b(G.childNativeId);try{await g.mutateAsync({deviceId:e,childDeviceId:G.adoptedDeviceId})}finally{b(null)}}}return(0,t.jsxs)("div",{className:`rounded-xl border border-border bg-surface ${i}`,children:[(0,t.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,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Discovered devices"}),(0,t.jsxs)("p",{className:"text-[11px] text-foreground-subtle",children:["Channels behind this hub. Click ",(0,t.jsx)("span",{className:"font-medium",children:"Add"})," to promote a channel to a managed device, or ",(0,t.jsx)("span",{className:"font-medium",children:"Remove"})," to detach."]})]}),(0,t.jsxs)("button",{type:"button",onClick:z,disabled:f.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:[f.isPending?(0,t.jsx)(Wt,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(za,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Refresh"})]})]}),M?(0,t.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,t.jsx)(jn,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),(0,t.jsxs)("span",{children:["Last refresh failed: ",M]})]}):null,l.isLoading?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-foreground-subtle",children:(0,t.jsx)(Wt,{className:"h-5 w-5 animate-spin"})}):w.length===0&&$.length===0?(0,t.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,t.jsxs)(t.Fragment,{children:[w.length>0?(0,t.jsx)(Em,{title:"Available to add",count:w.length,tone:"primary",children:w.map(G=>(0,t.jsx)(Im,{child:G,busy:h===G.childNativeId,onAdopt:R,onRelease:Z,onOpenChild:a},G.childNativeId))}):null,$.length>0?(0,t.jsx)(Em,{title:"Already adopted",count:$.length,tone:"muted",children:$.map(G=>(0,t.jsx)(Im,{child:G,busy:h===G.childNativeId,onAdopt:R,onRelease:Z,onOpenChild:a},G.childNativeId))}):null]}),D!=null?(0,t.jsxs)("div",{className:"border-t border-border px-5 py-2 text-[10px] text-foreground-subtle",children:["Last refreshed ",new Date(D).toLocaleString()]}):null]})}function Em({title:e,count:i,tone:a,children:o}){return(0,t.jsxs)("div",{className:"border-t border-border",children:[(0,t.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,t.jsx)("span",{className:"font-semibold",children:e}),(0,t.jsx)("span",{className:"font-mono",children:i})]}),(0,t.jsx)("div",{className:"divide-y divide-border",children:o})]})}function Im({child:e,busy:i,onAdopt:a,onRelease:o,onOpenChild:l}){return(0,t.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,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsx)(dM,{status:e.status}),(0,t.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:e.name}),e.metadata.isDoorbell?(0,t.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,t.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,t.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,t.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,t.jsxs)("span",{children:["ch ",(0,t.jsx)("span",{className:"font-mono",children:e.metadata.rtspChannel})]}):null,e.metadata.model?(0,t.jsx)("span",{className:"truncate max-w-[160px]",children:e.metadata.model}):null,e.metadata.uid?(0,t.jsxs)("span",{className:"font-mono truncate max-w-[140px]",children:[e.metadata.uid.slice(0,12),"…"]}):null]})]}),e.alreadyAdopted?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[l&&e.adoptedDeviceId!==null?(0,t.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,t.jsx)(xu,{className:"h-3.5 w-3.5"}),"Open"]}):null,(0,t.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,t.jsx)(Wt,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(hr,{className:"h-3.5 w-3.5"}),"Remove"]})]}):(0,t.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,t.jsx)(Wt,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(Sn,{className:"h-3.5 w-3.5"}),"Add"]})]})}function dM({status:e}){switch(e){case"online":return(0,t.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,t.jsx)(Du,{className:"h-2.5 w-2.5"})," online"]});case"sleeping":return(0,t.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,t.jsx)(rl,{className:"h-2.5 w-2.5"})," sleeping"]});case"offline":return(0,t.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,t.jsx)(Mv,{className:"h-2.5 w-2.5"})," offline"]});default:return(0,t.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,t.jsx)(vu,{className:"h-2.5 w-2.5"})," unknown"]})}}function fM(e,i){if(!e||typeof e!="object")return null;const a=e;if(a.category!==se.EventCategory.DeviceStateChanged)return null;const o=a.data;return!o||typeof o!="object"||o.deviceId!==i||typeof o.capName!="string"||!o.slice||typeof o.slice!="object"?null:{capName:o.capName,slice:o.slice}}function mM(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}var gM=Object.freeze([...new Set(se.ALL_CAPABILITY_DEFINITIONS.filter(e=>e.scope==="device").map(e=>e.name))].sort()),pM=1;function Dm({deviceId:e,defaultCaps:i,maxHeight:a="max-h-96",onClose:o,className:l}){const[d,f]=(0,n.useState)((0,n.useMemo)(()=>new Set(i??[]),[i])),[p,g]=(0,n.useState)(""),[h,b]=(0,n.useState)(!1),[w,$]=(0,n.useState)(""),P=(0,n.useRef)(null),[M,D]=(0,n.useState)(new Map),[z,R]=(0,n.useState)(new Map),[,Z]=(0,n.useState)(0),G=(0,n.useRef)(e);(0,n.useEffect)(()=>{G.current!==e&&(G.current=e,D(new Map),R(new Map))},[e]);const{data:Q,isLoading:W}=S.deviceState.getAllSnapshots.useQuery({},{staleTime:3e4}),X=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(X.current||!mM(Q))return;const ne=Q[String(e)];if(X.current=!0,!ne)return;const we=Date.now();D(Me=>{const ze=new Map(Me);for(const[We,Fe]of Object.entries(ne))ze.has(We)||ze.set(We,{slice:Fe,updatedAt:we});return ze})},[Q,e]),(0,n.useEffect)(()=>{X.current=!1},[e]),S.systemEvents.subscribe.useSubscription({deviceId:e,category:se.EventCategory.DeviceStateChanged},{onData:ne=>{const we=fM(ne,e);we&&D(Me=>{const ze=new Map(Me);return ze.set(we.capName,{slice:we.slice,updatedAt:Date.now()}),ze})}}),(0,n.useEffect)(()=>{const ne=setInterval(()=>Z(we=>we+1),5e3);return()=>clearInterval(ne)},[]);const he=(0,n.useMemo)(()=>{const ne=new Set(gM);for(const we of M.keys())ne.add(we);return[...ne].sort()},[M]),H=(0,n.useMemo)(()=>{const ne=p.trim().toLowerCase();return[...M.keys()].sort().filter(we=>d.size>0&&!d.has(we)?!1:!ne||we.toLowerCase().includes(ne)?!0:fc(M.get(we)?.slice??{},ne))},[M,d,p]),me=(0,n.useCallback)(ne=>{f(we=>{const Me=new Set(we);return Me.has(ne)?Me.delete(ne):Me.add(ne),Me})},[]),ye=(0,n.useCallback)(()=>{f(new Set(i??[])),g("")},[i]),Qe=(0,n.useCallback)(()=>{f(new Set(he))},[he]),Ye=(0,n.useCallback)(()=>{f(new Set)},[]),Je=(0,n.useCallback)((ne,we)=>{R(Me=>{const ze=new Map(Me);return ze.set(ne,!we),ze})},[]),Ae=(0,n.useCallback)((ne,we)=>{const Me=z.get(ne);return Me!==void 0?Me:we<pM},[z]),[De,Re]=(0,n.useState)(!1),Te=(0,n.useCallback)(()=>{const ne={};for(const we of H){const Me=M.get(we);Me&&(ne[we]=Me.slice)}navigator.clipboard.writeText(JSON.stringify(ne,null,2)).then(()=>{Re(!0),setTimeout(()=>Re(!1),1500)})},[H,M]),ue=(0,n.useMemo)(()=>{const ne=w.trim().toLowerCase();return ne?he.filter(we=>we.toLowerCase().includes(ne)):he},[w,he]),ge=he.length,ve=d.size,je=ve===0||ve===ge,_e=je?"All":`${ve}/${ge}`;(0,n.useEffect)(()=>{if(!h)return;const ne=we=>{const Me=P.current;Me&&!Me.contains(we.target)&&b(!1)};return document.addEventListener("mousedown",ne),()=>document.removeEventListener("mousedown",ne)},[h]);const Ue=p.trim().toLowerCase();return(0,t.jsxs)("div",{className:N("h-full min-h-0 flex flex-col",l),onClick:ne=>ne.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-hover/30 gap-2 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"State"}),(0,t.jsx)(xM,{label:"device",value:`#${e}`}),(0,t.jsxs)("div",{className:"relative",ref:P,children:[(0,t.jsxs)("button",{type:"button",onClick:()=>b(ne=>!ne),className:N("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",je?"border-border text-foreground-subtle hover:text-foreground":"border-violet-500/30 bg-violet-500/10 text-violet-400"),title:"Pick caps to show",children:[(0,t.jsx)(_u,{className:"h-2.5 w-2.5"}),"Filter (",_e,")"]}),h&&(0,t.jsx)(_M,{search:w,onSearchChange:$,caps:ue,active:d,onToggle:me,onSelectAll:Qe,onSelectNone:Ye,onResetDefaults:ye})]}),(0,t.jsxs)("button",{type:"button",onClick:ye,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,t.jsx)(Cu,{className:"h-2.5 w-2.5"}),"Reset"]}),(0,t.jsxs)("button",{type:"button",onClick:Te,disabled:H.length===0,className:N("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",De?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":"border-border text-foreground-subtle hover:text-foreground",H.length===0&&"opacity-40 cursor-not-allowed"),title:"Copy visible state as JSON",children:[(0,t.jsx)(Lr,{className:"h-2.5 w-2.5"}),De?"Copied!":"Copy"]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{type:"text",value:p,onChange:ne=>g(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"}),p&&(0,t.jsx)("button",{type:"button",onClick:()=>g(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",title:"Clear search",children:(0,t.jsx)(Mt,{className:"h-2.5 w-2.5"})})]}),(0,t.jsxs)("span",{className:"text-[9px] text-emerald-400 font-medium inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),"live"]})]}),o&&(0,t.jsx)("button",{type:"button",onClick:o,className:"text-foreground-subtle hover:text-foreground",children:(0,t.jsx)(Mt,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)("div",{className:N("flex-1 min-h-0 overflow-auto text-[10px] font-mono",a),children:[W&&M.size===0&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle font-sans",children:[(0,t.jsx)(Wt,{className:"h-3.5 w-3.5 animate-spin"}),"Loading device state..."]}),!W&&M.size===0&&(0,t.jsx)("div",{className:"py-4 text-center text-foreground-subtle font-sans",children:"No runtime state"}),!W&&M.size>0&&H.length===0&&(0,t.jsx)("div",{className:"py-4 text-center text-foreground-subtle font-sans",children:"No caps match the filter"}),H.length>0&&(0,t.jsx)("div",{className:"py-1",children:H.map(ne=>{const we=M.get(ne);return we?(0,t.jsx)(hM,{capName:ne,slice:we.slice,updatedAt:we.updatedAt,searchNeedle:Ue,isPathOpen:Ae,onToggle:Je},ne):null})})]})]})}function hM({capName:e,slice:i,updatedAt:a,searchNeedle:o,isPathOpen:l,onToggle:d}){const f=e,p=l(f,0),g=Object.entries(i);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1 hover:bg-surface-hover/30 cursor-pointer select-none",onClick:()=>d(f,p),children:[(0,t.jsx)(Tm,{open:p,hasChildren:g.length>0}),(0,t.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 font-sans",children:e}),(0,t.jsxs)("span",{className:"text-[9px] text-foreground-subtle font-sans",children:[g.length," ",g.length===1?"key":"keys"]}),(0,t.jsxs)("span",{className:"ml-auto text-[9px] text-foreground-subtle/70 font-sans tabular-nums",children:["updated ",yM(a)]})]}),p&&(0,t.jsx)("div",{children:g.length===0?(0,t.jsx)(zm,{depth:1,label:"empty slice"}):g.map(([h,b])=>(0,t.jsx)(Am,{path:`${f}.${h}`,nodeKey:h,value:b,depth:1,searchNeedle:o,isPathOpen:l,onToggle:d},h))})]})}function Am({path:e,nodeKey:i,value:a,depth:o,searchNeedle:l,isPathOpen:d,onToggle:f}){const p=vM(a),g={paddingLeft:`${12+o*14}px`};if(!p)return(0,t.jsxs)("div",{className:"flex items-start gap-1 px-3 py-0.5",style:g,children:[(0,t.jsx)("span",{className:N("shrink-0",dc(i,l,"text-primary/70")),children:i}),(0,t.jsx)("span",{className:"text-foreground-subtle",children:":"}),(0,t.jsx)("span",{className:N("break-all",dc(uc(a),l,bM(a))),children:uc(a)})]});const h=d(e,o);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 px-3 py-0.5 hover:bg-surface-hover/30 cursor-pointer select-none",style:g,onClick:()=>f(e,h),children:[(0,t.jsx)(Tm,{open:h,hasChildren:p.entries.length>0}),(0,t.jsx)("span",{className:dc(i,l,"text-primary/70"),children:i}),(0,t.jsx)("span",{className:"text-foreground-subtle/70 text-[9px]",children:p.summary})]}),h&&(p.entries.length===0?(0,t.jsx)(zm,{depth:o+1,label:p.kind==="array"?"empty array":"empty object"}):p.entries.map(([b,w])=>(0,t.jsx)(Am,{path:`${e}.${b}`,nodeKey:b,value:w,depth:o+1,searchNeedle:l,isPathOpen:d,onToggle:f},b)))]})}function zm({depth:e,label:i}){return(0,t.jsx)("div",{className:"px-3 py-0.5 text-foreground-subtle/60 italic",style:{paddingLeft:`${12+e*14}px`},children:i})}function Tm({open:e,hasChildren:i}){return i?e?(0,t.jsx)(Tr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}):(0,t.jsx)(Rr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}):(0,t.jsx)("span",{className:"inline-block w-3 shrink-0"})}function vM(e){if(Array.isArray(e))return{kind:"array",entries:e.map((i,a)=>[String(a),i]),summary:`[${e.length}]`};if(e&&typeof e=="object"){const i=Object.entries(e);return{kind:"object",entries:i,summary:`{${i.length}}`}}return null}function uc(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 bM(e){return e==null?"text-foreground-subtle/60":typeof e=="number"?"text-amber-400":typeof e=="boolean"?e?"text-emerald-400":"text-rose-400":"text-foreground"}function dc(e,i,a){return i&&e.toLowerCase().includes(i)?N(a,"bg-violet-500/20 rounded px-0.5"):a}function fc(e,i){if(Array.isArray(e))return e.some(a=>fc(a,i));if(e&&typeof e=="object"){for(const[a,o]of Object.entries(e))if(a.toLowerCase().includes(i)||fc(o,i))return!0;return!1}return uc(e).toLowerCase().includes(i)}function yM(e){const i=Date.now()-e;if(i<5e3)return"just now";const a=Math.floor(i/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);return o<60?`${o}m ago`:`${Math.floor(o/60)}h ago`}function xM({label:e,value:i}){return(0,t.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium font-sans",children:[e,": ",i]})}function _M({search:e,onSearchChange:i,caps:a,active:o,onToggle:l,onSelectAll:d,onSelectNone:f,onResetDefaults:p}){return(0,t.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 font-sans",onClick:g=>g.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border/50",children:[(0,t.jsx)(Gi,{className:"h-3 w-3 text-foreground-subtle"}),(0,t.jsx)("input",{type:"text",value:e,onChange:g=>i(g.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,t.jsx)("button",{type:"button",onClick:()=>i(""),className:"text-foreground-subtle hover:text-foreground",children:(0,t.jsx)(Mt,{className:"h-2.5 w-2.5"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 border-b border-border/50 text-[9px]",children:[(0,t.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,t.jsx)("button",{type:"button",onClick:f,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"None"}),(0,t.jsx)("button",{type:"button",onClick:p,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"Defaults"})]}),(0,t.jsxs)("div",{className:"overflow-y-auto flex-1",children:[a.length===0&&(0,t.jsx)("div",{className:"text-[10px] text-foreground-subtle italic px-2 py-3 text-center",children:"No matches"}),a.map(g=>(0,t.jsxs)("button",{type:"button",onClick:()=>l(g),className:"w-full flex items-center gap-2 px-2 py-1 text-left hover:bg-surface-hover/40 text-[10px]",children:[(0,t.jsx)("input",{type:"checkbox",readOnly:!0,checked:o.has(g),className:"accent-violet-500"}),(0,t.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:g})]},g))]})]})}var mc=500,wM=[{id:"logs",label:"Logs",icon:yv},{id:"events",label:"Events",icon:Aa},{id:"state",label:"State",icon:tv}];function SM({deviceId:e,defaultEventCategories:i,defaultStateCaps:a,initialTab:o="events",className:l,maxHeight:d="max-h-96"}){const[f,p]=(0,n.useState)(o),g=En(mc),h=En(mc),b=En(mc),w=g.reset,$=h.reset,P=b.reset;return(0,n.useEffect)(()=>{w(),$(),P()},[e,w,$,P]),(0,t.jsxs)("div",{className:N("flex flex-col h-full min-h-0",l),children:[(0,t.jsx)("div",{className:"flex items-center gap-1 mb-2 shrink-0",children:wM.map(({id:M,label:D,icon:z})=>(0,t.jsxs)("button",{type:"button",onClick:()=>p(M),className:N("inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[11px] font-medium transition-colors",f===M?"bg-primary/15 text-primary border border-primary/30":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover border border-transparent"),children:[(0,t.jsx)(z,{className:"h-3.5 w-3.5"}),D]},M))}),(0,t.jsxs)("div",{className:"flex-1 min-h-0 overflow-hidden",children:[f==="logs"&&(0,t.jsx)(oc,{deviceId:e,maxHeight:d,showFilters:!1,liveBuffer:g}),f==="events"&&(0,t.jsx)(cc,{deviceId:e,defaultCategories:i,maxHeight:d,showCategoryFilter:!0,liveBuffer:h}),f==="state"&&(0,t.jsx)(Dm,{deviceId:e,defaultCaps:a,maxHeight:d,liveBuffer:b})]})]})}function jM({label:e,icon:i,title:a="Confirm action",description:o,confirmLabel:l,triggerVariant:d="outline",confirmVariant:f="danger",size:p="sm",disabled:g,className:h,action:b,onSuccess:w}){const[$,P]=(0,n.useState)(!1),[M,D]=(0,n.useState)(!1),[z,R]=(0,n.useState)(null),Z=async()=>{R(null),D(!0);try{const G=await b();w?.(G),P(!1)}catch(G){R(G instanceof Error?G.message:String(G))}finally{D(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(Zr,{type:"button",variant:d,size:p,disabled:g,onClick:()=>{R(null),P(!0)},className:h,children:[i&&(0,t.jsx)(i,{className:"h-3.5 w-3.5"}),e]}),(0,t.jsx)(Vu,{open:$,onOpenChange:G=>!M&&P(G),children:(0,t.jsxs)(fl,{children:[(0,t.jsxs)(Wu,{children:[(0,t.jsxs)(Hu,{className:"flex items-center gap-2",children:[(0,t.jsx)(jn,{className:"h-4 w-4 text-amber-400"}),a]}),typeof o=="string"?(0,t.jsx)(qu,{children:o}):o]}),z&&(0,t.jsx)("div",{className:N("mt-2 px-3 py-2 rounded border border-danger/40 bg-danger/10","text-xs text-danger"),children:z}),(0,t.jsxs)(Qu,{children:[(0,t.jsx)(Zr,{type:"button",variant:"ghost",size:p,disabled:M,onClick:()=>P(!1),children:"Cancel"}),(0,t.jsxs)(Zr,{type:"button",variant:f,size:p,disabled:M,onClick:()=>{Z()},children:[M&&(0,t.jsx)(Wt,{className:"h-3.5 w-3.5 animate-spin"}),l??e]})]})]})})]})}function $M(e,i){const a=document.createElement("a");a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a)}function kM({trpc:e,deviceId:i,deviceName:a,size:o="sm",className:l}){const[d,f]=(0,n.useState)(!1),[p,g]=(0,n.useState)(!1),[h,b]=(0,n.useState)(null),w=a.replace(/[^a-zA-Z0-9_.-]+/g,"_"),$=(0,n.useCallback)(async W=>{f(!0),b(null),g(!1);try{const X=await e.snapshot.getSnapshot.query({deviceId:i,force:!0});if(!X)throw new Error("No snapshot available");const he=`data:${X.contentType};base64,${X.base64}`;if(W==="copy")try{await navigator.clipboard.writeText(he)}catch{throw new Error("Clipboard unavailable")}else{const H=X.contentType.includes("png")?"png":"jpg";$M(`${w}-${new Date().toISOString().replace(/[:.]/g,"-")}.${H}`,he)}g(!0),setTimeout(()=>g(!1),1500)}catch(X){b(X instanceof Error?X.message:String(X))}finally{f(!1)}},[e,i,w]),P=o==="md"?"h-9 px-3 text-sm gap-2":"h-7 px-2.5 text-[11px] gap-1.5",[M,D]=(0,n.useState)(null),[z,R]=(0,n.useState)(!1),Z=()=>{R(!1),D(setTimeout(()=>{R(!0),$("copy")},600))},G=()=>{M&&(clearTimeout(M),D(null)),z||$("download")},Q=()=>{M&&(clearTimeout(M),D(null))};return(0,t.jsxs)("button",{type:"button",title:"Click to download · long-press to copy",disabled:d,onPointerDown:Z,onPointerUp:G,onPointerLeave:Q,onPointerCancel:Q,className:N("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",P,h&&"border-danger/40 text-danger",l),children:[d?(0,t.jsx)(Wt,{className:"h-3.5 w-3.5 animate-spin"}):p?(0,t.jsx)(xn,{className:"h-3.5 w-3.5 text-success"}):(0,t.jsx)(Xs,{className:"h-3.5 w-3.5"}),"Snapshot"]})}function PM(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 NM({history:e,limit:i=5,latestIsFresh:a,className:o}){if(e.length===0)return null;const l=a?Uh:Aa,d=e.slice(0,i);return(0,t.jsxs)("div",{className:N("rounded-lg border border-border bg-surface px-3 py-2",o),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(l,{className:N("h-4 w-4 text-amber-400",a&&"animate-pulse")}),(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-foreground-subtle",children:"Recent presses"}),(0,t.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,t.jsx)("ul",{className:"space-y-1",children:d.map(f=>(0,t.jsxs)("li",{className:"flex items-center justify-between text-[11px]",title:new Date(f.timestamp).toLocaleString(),children:[(0,t.jsx)("span",{className:"text-foreground",children:PM(f.timestamp)}),(0,t.jsx)("span",{className:"text-foreground-subtle font-mono text-[10px]",children:new Date(f.timestamp).toLocaleTimeString()})]},`${f.deviceId}-${f.timestamp}`))})]})}function CM({items:e,header:i,triggerClassName:a,title:o="More actions"}){const[l,d]=(0,n.useState)(!1),f=e.filter(p=>!p.hidden);return f.length===0?null:(0,t.jsxs)(od,{open:l,onOpenChange:d,children:[(0,t.jsx)(sd,{title:o,className:N("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,t.jsx)(yu,{className:"h-4 w-4"})}),(0,t.jsxs)(ld,{className:"left-auto right-0 mt-1 min-w-[200px] p-1",children:[i&&(0,t.jsx)("div",{className:"px-2 py-1 text-[10px] uppercase tracking-wider text-foreground-subtle",children:i}),(0,t.jsx)("ul",{className:"space-y-0.5",children:f.map((p,g)=>(0,t.jsxs)("li",{children:[p.separatorBefore&&g>0&&(0,t.jsx)("div",{className:"my-1 h-px bg-border"}),(0,t.jsxs)("button",{type:"button",disabled:p.disabled,onClick:()=>{p.disabled||(p.onClick(),d(!1))},className:N("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",p.danger?"text-foreground hover:bg-danger/10 hover:text-danger":"text-foreground hover:bg-surface-hover"),children:[p.icon&&(0,t.jsx)(p.icon,{className:N("h-3.5 w-3.5 shrink-0 mt-0.5",p.danger&&"text-danger/80")}),(0,t.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"block leading-tight",children:p.label}),p.description&&(0,t.jsx)("span",{className:"block mt-0.5 text-[10px] text-foreground-subtle leading-tight",children:p.description})]})]})]},p.id))})]})]})}var OM=[{value:"view",label:"View",icon:wn,hint:"Read-only — queries + subscriptions"},{value:"create",label:"Create",icon:fv,hint:"Mutations that create or update"},{value:"delete",label:"Delete",icon:hr,hint:"Destructive ops (delete/revoke/reset/…)"}],MM=["device","system"];function EM(){return{type:"capability",target:"",access:["view"]}}function IM(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 DM(e,i,a,o){let l;switch(e){case"addon":l=a;break;case"capability":l=o;break;case"category":l=MM.map(f=>({value:f,label:f}));break}if(i==null)return l;const d=new Set(i.filter(f=>f.type!=="device"&&f.type===e).map(f=>f.target));return l.filter(f=>d.has(f.value))}function AM(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 zM({value:e,onChange:i,clampToParent:a,emptyHint:o}){const{data:l}=kf(),{data:d}=Ll({}),f=(0,n.useMemo)(()=>(l??[]).map(M=>({value:M.manifest.id,label:M.manifest.id})).sort((M,D)=>M.label.localeCompare(D.label)),[l]),p=(0,n.useMemo)(()=>[...se.KNOWN_CAP_NAMES].sort().map(M=>({value:M,label:M})),[]),g=(0,n.useMemo)(()=>(d??[]).map(M=>({value:String(M.id),label:`${M.name} (#${M.id} · ${M.addonId})`})).sort((M,D)=>M.label.localeCompare(D.label)),[d]),h=(0,n.useMemo)(()=>a==null?null:IM(a),[a]),b=(M,D)=>{const z=[...D];switch(M){case"category":return{type:"category",target:"device",access:z};case"capability":return{type:"capability",target:"",access:z};case"addon":return{type:"addon",target:"",access:z};case"device":return{type:"device",targets:[],access:z}}},w=(M,D)=>{i(e.map((z,R)=>{if(R!==M)return z;if(D.type!==void 0&&D.type!==z.type)return b(D.type,D.access??z.access);const Z=[...D.access??z.access];return z.type==="device"?{type:"device",targets:[...D.targets??z.targets],access:Z}:z.type==="category"?{type:"category",target:D.target??z.target,access:Z}:z.type==="capability"?{type:"capability",target:D.target??z.target,access:Z}:{type:"addon",target:D.target??z.target,access:Z}}))},$=M=>{i(e.filter((D,z)=>z!==M))},P=()=>{i([...e,EM()])};return(0,t.jsxs)("div",{className:"space-y-2",children:[e.length===0&&o&&(0,t.jsx)("div",{className:"text-[10px] text-foreground-subtle italic px-2 py-2",children:o}),e.map((M,D)=>{const z=AM(M,a);return(0,t.jsxs)("div",{className:"flex flex-wrap items-start gap-1.5 rounded border border-border bg-surface px-2 py-1.5",children:[(0,t.jsxs)("select",{value:M.type,onChange:R=>w(D,{type:R.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,t.jsx)("option",{value:"category",children:"category"}),(0,t.jsx)("option",{value:"capability",children:"capability"}),(0,t.jsx)("option",{value:"addon",children:"addon"}),(0,t.jsx)("option",{value:"device",children:"device"})]}),M.type==="device"?(0,t.jsx)(TM,{value:M.targets,choices:g,clampToParent:h,onChange:R=>w(D,{targets:R})}):(0,t.jsxs)("select",{value:M.target,onChange:R=>w(D,{target:R.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,t.jsxs)("option",{value:"",children:["— pick ",M.type," —"]}),DM(M.type,a,f,p).map(R=>(0,t.jsx)("option",{value:R.value,children:R.label},R.value))]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:OM.map(({value:R,label:Z,icon:G,hint:Q})=>{const W=M.access.includes(R),X=a!=null&&!z.includes(R)&&!W;return(0,t.jsxs)("label",{title:X?`${Q} — not granted by your scope`:Q,className:`inline-flex items-center gap-1 rounded px-1.5 py-1 text-[10px] cursor-pointer transition-colors ${W?"bg-primary/15 text-primary font-medium":"text-foreground-subtle hover:bg-foreground-subtle/10"} ${X?"opacity-40 cursor-not-allowed":""}`,children:[(0,t.jsx)("input",{type:"checkbox",checked:W,disabled:X,onChange:he=>{const H=new Set(M.access);he.target.checked?H.add(R):H.delete(R),w(D,{access:[...H]})},className:"sr-only"}),(0,t.jsx)(G,{className:"h-3 w-3"}),Z]},R)})}),(0,t.jsx)("button",{type:"button",onClick:()=>$(D),className:"rounded p-1 text-foreground-subtle hover:bg-danger/10 hover:text-danger transition-colors",title:"Remove scope",children:(0,t.jsx)(Mt,{className:"h-3 w-3"})})]},D)}),(0,t.jsxs)("button",{type:"button",onClick:P,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,t.jsx)(Sn,{className:"h-3 w-3"}),"Add scope"]})]})}function TM({value:e,choices:i,clampToParent:a,onChange:o}){const[l,d]=(0,n.useState)(""),f=(0,n.useMemo)(()=>{const b=a==null?i:i.filter($=>a.includes($.value)),w=new Set(e);return b.filter($=>!w.has($.value))},[i,a,e]),p=b=>i.find(w=>w.value===b)?.label??`#${b}`,g=b=>{b&&(o([...e,b]),d(""))},h=b=>{o(e.filter(w=>w!==b))};return(0,t.jsxs)("div",{className:"flex-1 min-w-[160px] flex flex-wrap items-center gap-1",children:[e.length===0&&(0,t.jsx)("span",{className:"text-[10px] text-foreground-subtle italic px-1",children:"no devices selected"}),e.map(b=>(0,t.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:[p(b),(0,t.jsx)("button",{type:"button",onClick:()=>h(b),className:"hover:text-danger transition-colors",title:"Remove device",children:(0,t.jsx)(Mt,{className:"h-2.5 w-2.5"})})]},b)),f.length>0&&(0,t.jsxs)("select",{value:l,onChange:b=>g(b.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,t.jsx)("option",{value:"",children:"+ add device…"}),f.map(b=>(0,t.jsx)("option",{value:b.value,children:b.label},b.value))]})]})}function RM(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 Rm=$r("camstack:zone-editing",null);function LM({children:e}){const[i,a]=(0,n.useState)(!1),[o,l]=(0,n.useState)(null),[d,f]=(0,n.useState)(null),[p,g]=(0,n.useState)(null),h=(0,n.useCallback)(Z=>{a(Z),Z||(l(null),f(null),g(null))},[]),b=(0,n.useCallback)(Z=>{l(Z)},[]),w=(0,n.useCallback)(Z=>{f(Z)},[]),$=(0,n.useCallback)(Z=>{a(!0),f(null),l(Z),g(null)},[]),P=(0,n.useCallback)(()=>{a(!1),l(null),f(null),g(null)},[]),M=(0,n.useCallback)(Z=>{f(Z.id),g(Z)},[]),D=(0,n.useCallback)(Z=>{g(G=>G===null?G:{...G,...Z})},[]),z=(0,n.useCallback)(()=>{g(null)},[]),R=(0,n.useMemo)(()=>({editing:i,drawingKind:o,selectedZoneId:d,editingDraft:p,setEditing:h,setDrawingKind:b,setSelectedZoneId:w,startDrawing:$,exitEditing:P,enterDraft:M,updateDraft:D,discardDraft:z}),[i,o,d,p,h,b,w,$,P,M,D,z]);return(0,t.jsx)(Rm.Provider,{value:R,children:e})}function ZM(){return(0,n.useContext)(Rm)}var Lm=500,UM=800;function oo(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 so(e,i){return e?.id===i}function BM(e,i){const[a,o]=(0,n.useState)(null),[l,d]=(0,n.useState)(null),[f,p]=(0,n.useState)(null),[g,h]=(0,n.useState)("watching"),b=(0,n.useRef)(void 0),w=(0,n.useRef)(void 0),$=(0,n.useRef)(void 0);return(0,n.useEffect)(()=>{if(i===null)return;const P=oo(e,"detection.motion-analysis",M=>{const D=M;if(!so(D?.source,i))return;const z=D.data;!z?.regions||z.regions.length===0||(o({zones:z.regions.map(R=>({...R.bbox,intensity:R.intensity})),frameWidth:z.frameWidth,frameHeight:z.frameHeight}),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>o(null),Lm))});return()=>{P?.unsubscribe(),b.current&&clearTimeout(b.current)}},[e,i]),(0,n.useEffect)(()=>{if(i===null)return;const P=oo(e,"detection.motion-zones-raw",M=>{const D=M;if(!so(D?.source,i))return;const z=D.data;z?.zones&&(d({boxes:z.zones.map(R=>({bbox:R.bbox,changeScore:R.changeScore})),frameWidth:z.frameSize?.width??0,frameHeight:z.frameSize?.height??0,motionScore:z.zones.length>0?z.zones.reduce((R,Z)=>R+Z.changeScore,0)/z.zones.length:0}),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>d(null),Lm))});return()=>{P?.unsubscribe(),w.current&&clearTimeout(w.current)}},[e,i]),(0,n.useEffect)(()=>{if(i===null)return;const P=oo(e,"detection.result",M=>{const D=M;if(!so(D?.source,i))return;const z=D.data?.frame;z?.detections?.length&&(p({detections:z.detections,frameWidth:z.width,frameHeight:z.height}),$.current&&clearTimeout($.current),$.current=setTimeout(()=>p(null),UM))});return()=>{P?.unsubscribe(),$.current&&clearTimeout($.current)}},[e,i]),(0,n.useEffect)(()=>{if(i===null)return;const P=oo(e,"detection.phase-transition",M=>{const D=M;so(D?.source,i)&&D.data?.to&&h(D.data.to)});return()=>{P?.unsubscribe()}},[e,i]),{motion:a,motionRaw:l,detection:f,phase:g}}function FM(e,i,a=5e3){const[o,l]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(i===null)return;let P=!1;const M=()=>{e.webrtcSession.listStreams.query({deviceId:i}).then(z=>{P||l(z)}).catch(()=>{})};M();const D=setInterval(M,a);return()=>{P=!0,clearInterval(D)}},[e,i,a]);const[d,f]=(0,n.useState)(null);(0,n.useEffect)(()=>{if(i===null)return;let P=!1;return e.pipelineOrchestrator&&e.pipelineOrchestrator.getCameraMetrics.query({deviceId:i}).then(M=>{P||!M||f({phase:M.phase,detectionFps:M.actualFps,avgInferenceMs:M.avgInferenceTimeMs,droppedFrames:M.droppedFrames})}).catch(()=>{}),()=>{P=!0}},[e,i]),Qi("pipeline.camera-metrics-snapshot",P=>{if(i===null)return;const M=P.data;M.deviceId!==i||!M.metrics||f({phase:M.metrics.phase,detectionFps:M.metrics.actualFps,avgInferenceMs:M.metrics.avgInferenceTimeMs,droppedFrames:M.metrics.droppedFrames})});const{streams:p,hasWebrtc:g}=(0,n.useMemo)(()=>i===null||o.length===0?{streams:[],hasWebrtc:!1}:{streams:o.map(P=>({id:P.id,label:P.label,target:P.target,status:P.status,inputFps:P.inputFps,decodeFps:P.decodeFps,bitrateKbps:P.bitrateKbps})),hasWebrtc:!0},[i,o]),h=(0,n.useCallback)(async()=>{if(e.turnProvider)try{return(await e.turnProvider.getTurnServers.query()).map(P=>({urls:typeof P.urls=="string"?P.urls:[...P.urls],...P.username!==void 0?{username:P.username}:{},...P.credential!==void 0?{credential:P.credential}:{}}))}catch{return}},[e]),b=(0,n.useCallback)(async(P,M)=>{if(i===null)throw new Error("No device selected");const D=await e.webrtcSession.createSession.mutate({deviceId:i,target:P,hints:M}),z=await h();return{sessionId:D.sessionId,sdpOffer:D.sdpOffer,...z?{iceServers:z}:{}}},[e,i,h]),w=(0,n.useCallback)(async(P,M)=>{if(i===null)throw new Error("No device selected");return e.webrtcSession.handleOffer.mutate({deviceId:i,target:P,sdpOffer:M})},[e,i]),$=(0,n.useCallback)(async(P,M)=>{if(i===null)throw new Error("No device selected");await e.webrtcSession.handleAnswer.mutate({deviceId:i,sessionId:P,sdpAnswer:M})},[e,i]);return{streams:p,hasWebrtc:g,pipelineMetrics:d,createSession:b,handleOffer:w,getIceServers:h,addIceCandidate:(0,n.useCallback)(async(P,M)=>{i!==null&&await e.webrtcSession.addIceCandidate.mutate({deviceId:i,sessionId:P,candidate:M.candidate??"",sdpMid:M.sdpMid??null,sdpMLineIndex:M.sdpMLineIndex??null}).catch(()=>{})},[e,i]),getIceCandidates:(0,n.useCallback)(async P=>i===null?{candidates:[],done:!0}:e.webrtcSession.getIceCandidates.query({deviceId:i,sessionId:P}),[e,i]),sendAnswer:$,closeSession:(0,n.useCallback)(async P=>{i!==null&&await e.webrtcSession.closeSession.mutate({deviceId:i,sessionId:P}).catch(()=>{})},[e,i])}}function GM(e){const i=e?.deviceId??null,a=e?.historyLimit??20,o=xl("doorbell.onPressed",i!==null?f=>f.deviceId===i:void 0),[l,d]=(0,n.useState)([]);return(0,n.useEffect)(()=>{o&&d(f=>{if(f.length>0&&f[0].deviceId===o.deviceId&&f[0].timestamp===o.timestamp)return f;const p=[o,...f];return p.length>a?p.slice(0,a):p})},[o,a]),{latest:o??null,history:l}}function VM(e){const i=cr(),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 f=null,p=null;try{f=i.onDeviceAdded(d),p=i.onDeviceRemoved(d)}catch{}const g=i.subscribeConnectionEvents(h=>{h==="connected"&&d()});return()=>{f?.(),p?.(),g()}},[i,e,a]),o}function WM(e){const i=cr(),[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,f=null;try{d=i.onDeviceAdded(l),f=i.onDeviceRemoved(l)}catch{}const p=i.subscribeConnectionEvents(g=>{g==="connected"&&l()});return()=>{d?.(),f?.(),p()}},[i,e]),a}function QM(e,i,a){const o=cr();return(0,te.useQuery)({queryKey:e,queryFn:()=>i(o)(),...a})}function HM(e,i){const a=cr();return(0,te.useMutation)({mutationFn:o=>e(a)(o),...i})}function qM(e,i){const a=cr(),o=(0,te.useQueryClient)(),[l,d]=(0,n.useState)(a.connectionVersion);(0,n.useEffect)(()=>a.subscribeConnectionEvents((g,h)=>{g==="connected"&&d(h)}),[a]);const f=i.join("|"),p=JSON.stringify(e);(0,n.useEffect)(()=>{const g=[],h=()=>{const b=JSON.parse(p),w=b.length===1&&Array.isArray(b[0])?b:[b];o.invalidateQueries({queryKey:w})};h();for(const b of f.split("|"))if(b)try{g.push(a.subscribeEvent(b,h))}catch{}return()=>{for(const b of g)b()}},[a,o,f,p,l])}r.AddonGlobalSettingsForm=tO,r.AgentStepEditor=gb,r.AppShell=Lb,r.AudioClassificationList=VO,r.AudioLevelWaveform=BO,r.AudioWaveform=UO,r.AutotrackSection=Ff,r.BTN_COMPACT=Mg,r.BTN_COMPACT_DANGER=Ig,r.BTN_COMPACT_PRIMARY=Eg,r.BTN_COMPACT_WARNING=Dg,r.Badge=rn,r.BatteryBadge=Ud,r.BottomSheet=gl,r.Breadcrumb=rb,r.Button=Zr,r.CHIP_ACTIVE=Tg,r.CHIP_BASE=zg,r.CHIP_INACTIVE=Rg,r.CLASS_COLORS=qi,r.CameraStreamPlayer=cm,r.Card=cl,r.Checkbox=Uu,r.CodeBlock=Tb,r.CollapsibleCard=Ru,r.ConfigFormBuilder=om,r.ConfigFormField=On,r.ConfigSchemaField=La,r.ConfirmActionButton=jM,r.ConfirmDialogProvider=Db,r.CopyButton=Pm,r.CustomFieldRenderersProvider=U0,r.DEFAULT_COLOR=Wy,r.DataTable=nb,r.DetectionCanvas=Qy,r.DetectionOverlay=lm,r.DetectionResultTree=Ky,r.DevShell=wf,r.DeviceActivityPanel=SM,r.DeviceCard=Ub,r.DeviceContextProvider=B0,r.DeviceExportPanel=ZO,r.DeviceGrid=Bb,r.DeviceItem=Ba,r.DeviceList=Jd,r.Dialog=Vu,r.DialogContent=fl,r.DialogDescription=qu,r.DialogFooter=Qu,r.DialogHeader=Wu,r.DialogTitle=Hu,r.DialogTrigger=Uv,r.DiscoveryPanel=uM,r.DoorbellRecentPanel=NM,r.Dropdown=Fv,r.DropdownContent=Vv,r.DropdownItem=Wv,r.DropdownTrigger=Gv,r.EmptyState=xd,r.ErrorBox=_d,r.EventStream=cc,r.FilterBar=Rb,r.FloatingEventStream=lM,r.FloatingLogStream=XO,r.FloatingPanel=tb,r.FormField=Mb,r.GRID_GAP=_g,r.GRID_PAIRED=jg,r.GRID_QUICK_STATS=Sg,r.HOST_WIDGETS=Xf,r.INPUT_COMPACT=Ag,r.IconButton=ll,r.ImageSelector=r0,r.InferenceConfigSelector=n0,r.Input=Ta,r.KebabMenu=CM,r.KeyValueList=zb,r.LIST_ROW=wg,r.Label=ul,r.LogStream=oc,r.LoginForm=xf,r.MaskShapeCanvas=Kl,r.MobileDrawer=dd,r.MotionZonesSettings=Jf,r.NodeMultiSelectField=tm,r.NodePicker=jb,r.NodeSelectField=em,r.PHASE_CONFIG=Es,r.PTZOverlay=$l,r.PageHeader=Eb,r.PhaseIcon=HO,r.PipelineBuilder=Vy,r.PipelineRuntimeSelector=By,r.PipelineStep=Ra,r.PipelineTreeMatrix=_b,r.PlayerOverlaysProvider=HN,r.Popover=od,r.PopoverContent=ld,r.PopoverTrigger=sd,r.ProviderBadge=Nb,r.PtzPanel=Uf,r.QrCode=km,r.ResponseLog=WO,r.SECTION_BODY=wt,r.SECTION_CARD=re,r.SECTION_HEADER=ft,r.SPLIT_PANEL_OUTER=$g,r.SPLIT_PANEL_SIDE=kg,r.STACK_GAP=un,r.ScopePicker=zM,r.ScrollArea=pl,r.Select=Vi,r.SemanticBadge=yd,r.Separator=dl,r.Sidebar=wl,r.SidebarItem=_l,r.Skeleton=Lu,r.SlideOverPanel=ib,r.SnapshotButton=kM,r.StatCard=Ab,r.StateValuesStream=Dm,r.StatusBadge=kb,r.StepTimings=t0,r.StepTreeMaster=ob,r.StreamBrokerSelector=xO,r.StreamPanel=vO,r.Switch=Bu,r.SystemProvider=bd,r.TEXT_FIELD_LABEL=Ng,r.TEXT_HINT=gr,r.TEXT_METRIC=Og,r.TEXT_SECTION_LABEL=Pg,r.TEXT_VALUE=Cg,r.Tabs=Kv,r.TabsContent=eb,r.TabsList=Xv,r.TabsTrigger=Yv,r.ThemeProvider=u.ThemeProvider$1,r.Tooltip=Qv,r.TooltipContent=qv,r.TooltipTrigger=Hv,r.VersionBadge=Ob,r.WidgetRegistryProvider=FN,r.WidgetSlot=Yf,r.ZoneEditingProvider=LM,r.__toESM=s,r.buildStepTreeFromSchema=sb,r.cn=N,r.createSharedContext=$r,r.createTheme=u.createTheme$1,r.darkColors=u.darkColors$1,r.defaultTheme=u.defaultTheme$1,r.deriveDeviceKind=Gb,r.ensureMfHostInit=mu,r.getClassColor=Qt,r.getPhaseVisual=Is,r.isAbsentProvider=B,r.isFieldVisible=am,r.lightColors=u.lightColors$1,r.loadRemoteBundle=Ul,r.mirror=Fg,r.mountAddonPage=Z0,r.providerIcons=Dv,r.statusIcons=Av,r.themeToCss=u.themeToCss$1,r.trpc=S,r.useAccessoriesGetStatus=G0,r.useAddonPagesListPages=V0,r.useAddonSettingsGetDeviceSettings=Px,r.useAddonSettingsGetGlobalSettings=$x,r.useAddonSettingsUpdateDeviceSettings=Nx,r.useAddonSettingsUpdateGlobalSettings=kx,r.useAddonWidgetsListWidgets=Pf,r.useAddonsApplyAutoUpdateToAll=wx,r.useAddonsCancelBulkUpdate=mx,r.useAddonsCustom=Sx,r.useAddonsForceRefresh=ix,r.useAddonsGetAddonAutoUpdate=xx,r.useAddonsGetAutoUpdateSettings=bx,r.useAddonsGetBulkUpdateState=fx,r.useAddonsGetLastRestart=ox,r.useAddonsGetLogs=W0,r.useAddonsGetVersions=px,r.useAddonsInstallFromWorkspace=q0,r.useAddonsInstallPackage=H0,r.useAddonsIsWorkspaceAvailable=J0,r.useAddonsList=kf,r.useAddonsListActiveBulkUpdates=gx,r.useAddonsListCapabilityProviders=lx,r.useAddonsListFrameworkPackages=sx,r.useAddonsListPackages=Q0,r.useAddonsListUpdates=tx,r.useAddonsListWorkspacePackages=K0,r.useAddonsOnAddonLogs=jx,r.useAddonsReloadPackages=Y0,r.useAddonsRestartAddon=hx,r.useAddonsRestartServer=ax,r.useAddonsRetryLoad=vx,r.useAddonsRollbackPackage=nx,r.useAddonsSearchAvailable=ex,r.useAddonsSetAddonAutoUpdate=_x,r.useAddonsSetAutoUpdateSettings=yx,r.useAddonsSetCapabilityProviderEnabled=cx,r.useAddonsStartBulkUpdate=dx,r.useAddonsUninstallPackage=X0,r.useAddonsUpdateFrameworkPackage=ux,r.useAddonsUpdatePackage=rx,r.useAlertsDismiss=Ax,r.useAlertsEmit=Cx,r.useAlertsGetUnreadCount=Ex,r.useAlertsList=Mx,r.useAlertsMarkAllRead=Dx,r.useAlertsMarkRead=Ix,r.useAlertsUpdate=Ox,r.useAllWidgets=VN,r.useAudioAnalysisApplyDeviceSettingsPatch=Lx,r.useAudioAnalysisGetDeviceLiveContribution=Rx,r.useAudioAnalysisGetDeviceSettingsContribution=Tx,r.useAudioAnalysisResolveDeviceSettings=zx,r.useAudioAnalyzerAnalyseChunk=Zx,r.useAudioAnalyzerClassify=Ux,r.useAudioAnalyzerDispose=Fx,r.useAudioAnalyzerIsReady=Bx,r.useAudioAnalyzerReprobeAudioEngine=Gx,r.useAudioCodecCanHandle=Wx,r.useAudioCodecCloseSession=qx,r.useAudioCodecCreateDecodeSession=Qx,r.useAudioCodecCreateEncodeSession=Hx,r.useAudioCodecFlushEncode=e_,r.useAudioCodecListActiveSessions=t_,r.useAudioCodecListSupportedCodecs=Vx,r.useAudioCodecPullEncoded=Yx,r.useAudioCodecPullPcm=Kx,r.useAudioCodecPushEncodedFrame=Jx,r.useAudioCodecPushPcm=Xx,r.useAudioMetricsGetCurrentSnapshot=r_,r.useAudioMetricsGetHistory=n_,r.useBackupDelete=u_,r.useBackupGetEntries=l_,r.useBackupList=o_,r.useBackupListArchives=d_,r.useBackupListDestinations=i_,r.useBackupListLocations=s_,r.useBackupPreviewSchedule=m_,r.useBackupRestore=c_,r.useBackupTrigger=a_,r.useBackupUpsertDestinationPolicy=f_,r.useBatteryGetStatus=g_,r.useBrightnessGetStatus=h_,r.useBrightnessSetBrightness=p_,r.useCameraCredentialsGetCredentials=v_,r.useCameraCredentialsGetStatus=b_,r.useCameraPipelineConfigApplyDeviceSettingsPatch=__,r.useCameraPipelineConfigGetDeviceLiveContribution=x_,r.useCameraPipelineConfigGetDeviceSettingsContribution=y_,r.useCameraStreamsGetBrokerStreams=S_,r.useCameraStreamsGetCameraStreams=w_,r.useCameraStreamsGetRtspEntries=Nf,r.useClusterNodes=Za,r.useConfirm=Hi,r.useCustomFieldRenderer=jf,r.useDebouncedString=Vd,r.useDecoderCreateSession=k_,r.useDecoderDestroySession=P_,r.useDecoderGetFrame=E_,r.useDecoderGetInfo=$_,r.useDecoderGetShmStats=I_,r.useDecoderGetStats=A_,r.useDecoderListActiveSessions=z_,r.useDecoderOpenStream=C_,r.useDecoderPullFrames=O_,r.useDecoderPullHandles=M_,r.useDecoderPushPacket=N_,r.useDecoderReprobeHwaccel=T_,r.useDecoderSupportsCodec=j_,r.useDecoderUpdateConfig=D_,r.useDetectionPipelineApplyDeviceSettingsPatch=Z_,r.useDetectionPipelineGetDeviceLiveContribution=L_,r.useDetectionPipelineGetDeviceSettingsContribution=R_,r.useDevShell=A0,r.useDevice=WM,r.useDeviceAutotrack=Bf,r.useDeviceBattery=Ld,r.useDeviceCapability=$n,r.useDeviceDetections=BM,r.useDeviceDiscoveryAdoptDevice=F_,r.useDeviceDiscoveryGetStatus=V_,r.useDeviceDiscoveryListDiscovered=U_,r.useDeviceDiscoveryRefreshDiscovery=B_,r.useDeviceDiscoveryReleaseDevice=G_,r.useDeviceExportApplyDeviceSettingsPatch=H_,r.useDeviceExportExposeDevice=Ef,r.useDeviceExportGetDeviceLiveContribution=Q_,r.useDeviceExportGetDeviceSettingsContribution=W_,r.useDeviceExportGetStatus=Cf,r.useDeviceExportListExposedDevices=Mf,r.useDeviceExportListSupportedDeviceKinds=Of,r.useDeviceExportUnexposeDevice=If,r.useDeviceId=$f,r.useDeviceManagerAddLocation=o1,r.useDeviceManagerAdoptDevice=I1,r.useDeviceManagerAllocateDeviceId=q_,r.useDeviceManagerCreateDevice=A1,r.useDeviceManagerDisable=v1,r.useDeviceManagerDiscoverDevices=E1,r.useDeviceManagerEnable=h1,r.useDeviceManagerGetAllBindings=S1,r.useDeviceManagerGetBindings=w1,r.useDeviceManagerGetChildren=d1,r.useDeviceManagerGetConfigSchema=m1,r.useDeviceManagerGetCreationSchema=D1,r.useDeviceManagerGetDevice=u1,r.useDeviceManagerGetDeviceAggregate=C1,r.useDeviceManagerGetDeviceLiveInfoAggregate=N1,r.useDeviceManagerGetDeviceSettingsAggregate=P1,r.useDeviceManagerGetDeviceStatusAggregate=R1,r.useDeviceManagerGetSettingsSchema=g1,r.useDeviceManagerGetStreamProfileMap=y1,r.useDeviceManagerGetStreamSources=f1,r.useDeviceManagerListAll=Ll,r.useDeviceManagerListBindableCapsForDeviceType=k1,r.useDeviceManagerListLocations=a1,r.useDeviceManagerListPersistedByAddon=c1,r.useDeviceManagerListWrappersForCap=$1,r.useDeviceManagerLoadConfig=Y_,r.useDeviceManagerLoadMeta=t1,r.useDeviceManagerLoadRuntimeState=e1,r.useDeviceManagerPersistConfig=X_,r.useDeviceManagerProbeStreams=_1,r.useDeviceManagerRegisterDevice=J_,r.useDeviceManagerRemove=b1,r.useDeviceManagerRemoveDevice=K_,r.useDeviceManagerRemoveLocation=s1,r.useDeviceManagerSetDisabled=l1,r.useDeviceManagerSetLocation=n1,r.useDeviceManagerSetMetadata=i1,r.useDeviceManagerSetName=r1,r.useDeviceManagerSetStreamProfileMap=x1,r.useDeviceManagerSetWrapperActive=j1,r.useDeviceManagerTestCreationField=z1,r.useDeviceManagerTestField=T1,r.useDeviceManagerUpdateConfig=p1,r.useDeviceManagerUpdateDeviceField=O1,r.useDeviceManagerUpdateDeviceFieldsBatch=M1,r.useDeviceOpsGetConfigEntries=Z1,r.useDeviceOpsGetSettingsSchema=F1,r.useDeviceOpsGetStreamSources=L1,r.useDeviceOpsRemoveDevice=B1,r.useDeviceOpsSetConfig=U1,r.useDeviceProviderAdoptDiscoveredDevice=J1,r.useDeviceProviderCreateDevice=Y1,r.useDeviceProviderDiscoverDevices=q1,r.useDeviceProviderGetChildCreationSchema=X1,r.useDeviceProviderGetDevices=Q1,r.useDeviceProviderGetStatus=W1,r.useDeviceProviderStart=G1,r.useDeviceProviderStop=V1,r.useDeviceProviderSupportsDiscovery=H1,r.useDeviceProviderSupportsManualCreation=K1,r.useDeviceProviderTestCreationField=ew,r.useDeviceProxy=Ur,r.useDeviceSnapshot=F0,r.useDeviceSnapshotImage=Zd,r.useDeviceState=Sd,r.useDeviceStateGetAllSnapshots=nw,r.useDeviceStateGetCapSlice=rw,r.useDeviceStateGetSnapshot=tw,r.useDeviceStateSetCapSlice=iw,r.useDeviceStateSlice=Sl,r.useDeviceStatusGetStatus=aw,r.useDeviceWebrtc=FM,r.useDevices=VM,r.useDoorbellEvents=GM,r.useDoorbellGetStatus=ow,r.useEventInvalidation=qM,r.useEventStreamLatest=xl,r.useEventStreamMap=Sb,r.useEventsGetEventClipUrl=cw,r.useEventsGetEventThumbnail=lw,r.useEventsGetEvents=sw,r.useFeatureProbeGetStatus=uw,r.useIntegrationsCreate=gw,r.useIntegrationsDelete=hw,r.useIntegrationsGet=fw,r.useIntegrationsGetAvailableTypes=yw,r.useIntegrationsGetByAddonId=mw,r.useIntegrationsGetSettings=vw,r.useIntegrationsList=dw,r.useIntegrationsSetSettings=bw,r.useIntegrationsTestConnection=xw,r.useIntegrationsUpdate=pw,r.useIntercomEndTalkSession=kw,r.useIntercomGetStatus=Pw,r.useIntercomHandleAnswer=ww,r.useIntercomPushTalkPcm=$w,r.useIntercomStartSession=_w,r.useIntercomStartTalkSession=jw,r.useIntercomStopSession=Sw,r.useIsMidWidth=Jv,r.useIsMobile=Wi,r.useLiveBuffer=En,r.useLiveEvent=Qi,r.useLocalNetworkGetAllowedAddresses=Mw,r.useLocalNetworkGetConnectionEndpoints=Ow,r.useLocalNetworkGetPreferred=Cw,r.useLocalNetworkList=Nw,r.useLocalNetworkResetAllowlistToBestMatch=Iw,r.useLocalNetworkSetAllowedAddresses=Ew,r.useMeshNetworkGetStatus=Dw,r.useMeshNetworkJoin=Aw,r.useMeshNetworkLeave=Tw,r.useMeshNetworkListPeers=Lw,r.useMeshNetworkLogout=Rw,r.useMeshNetworkStartLogin=zw,r.useMeshNetworkTestConnection=Zw,r.useMetricsProviderCollectSnapshot=Uw,r.useMetricsProviderGetAddonStats=qw,r.useMetricsProviderGetCached=Bw,r.useMetricsProviderGetCpuTemperature=Ww,r.useMetricsProviderGetCurrent=Fw,r.useMetricsProviderGetDiskSpace=Gw,r.useMetricsProviderGetGpuInfo=Vw,r.useMetricsProviderGetProcessStats=Qw,r.useMetricsProviderKillProcess=Kw,r.useMetricsProviderListAddonInstances=Hw,r.useMetricsProviderListNodeProcesses=Jw,r.useMotionDetectionAnalyze=eS,r.useMotionDetectionApplyDeviceSettingsPatch=aS,r.useMotionDetectionGetDeviceLiveContribution=iS,r.useMotionDetectionGetDeviceSettingsContribution=nS,r.useMotionDetectionRemoveCamera=tS,r.useMotionDetectionReset=rS,r.useMotionGetStatus=Yw,r.useMotionIsDetected=Xw,r.useMotionTriggerGetStatus=sS,r.useMotionTriggerSetMotionTrigger=oS,r.useMotionZonesGetOptions=lS,r.useMotionZonesGetStatus=uS,r.useMotionZonesSetZone=cS,r.useMqttBrokerAddBroker=mS,r.useMqttBrokerGetBrokerConfig=fS,r.useMqttBrokerGetStatus=bS,r.useMqttBrokerListBrokers=dS,r.useMqttBrokerRemoveBroker=gS,r.useMqttBrokerStartEmbeddedBroker=hS,r.useMqttBrokerStopEmbeddedBroker=vS,r.useMqttBrokerTestConnection=pS,r.useNativeObjectDetectionGetStatus=xS,r.useNativeObjectDetectionSetEnabled=yS,r.useNetworkAccessGetEndpoint=SS,r.useNetworkAccessGetStatus=jS,r.useNetworkAccessListEndpoints=$S,r.useNetworkAccessStart=_S,r.useNetworkAccessStop=wS,r.useNetworkQualityGetAllStats=PS,r.useNetworkQualityGetDeviceStats=kS,r.useNetworkQualityReportClientStats=NS,r.useNodesClusterAddonStatus=TS,r.useNodesDeployAddon=OS,r.useNodesExecuteQuery=US,r.useNodesGetCapUsageGraph=RS,r.useNodesGetNodeAddons=LS,r.useNodesRenameNode=zS,r.useNodesRestartAddon=ES,r.useNodesRestartNode=DS,r.useNodesRestartProcess=IS,r.useNodesSetProcessLogLevel=ZS,r.useNodesShutdownNode=AS,r.useNodesTopology=CS,r.useNodesUndeployAddon=MS,r.useNotificationOutputSend=BS,r.useNotificationOutputSendTest=FS,r.useOptionalSystem=wb,r.useOptionalWidgetRegistry=Fl,r.useOsdGetStatus=VS,r.useOsdSetOverlay=GS,r.usePTZ=jl,r.usePipelineAnalyticsApplyDeviceSettingsPatch=nj,r.usePipelineAnalyticsClearTracks=qS,r.usePipelineAnalyticsGetActiveTracks=WS,r.usePipelineAnalyticsGetAudioEvents=XS,r.usePipelineAnalyticsGetDeviceLiveContribution=rj,r.usePipelineAnalyticsGetDeviceSettingsContribution=tj,r.usePipelineAnalyticsGetEventMedia=YS,r.usePipelineAnalyticsGetMotionEvents=JS,r.usePipelineAnalyticsGetObjectEvents=KS,r.usePipelineAnalyticsGetTrack=QS,r.usePipelineAnalyticsGetTrackMedia=ej,r.usePipelineAnalyticsListTracks=HS,r.usePipelineExecutorCacheFrameInPool=$j,r.usePipelineExecutorDeleteModel=_j,r.usePipelineExecutorDeleteTemplate=vj,r.usePipelineExecutorDetect=wj,r.usePipelineExecutorDownloadModel=xj,r.usePipelineExecutorGetAddonModels=yj,r.usePipelineExecutorGetAudioCapabilities=zj,r.usePipelineExecutorGetAvailableEngines=ij,r.usePipelineExecutorGetCapabilities=bj,r.usePipelineExecutorGetDefaultSteps=oj,r.usePipelineExecutorGetDetectionConfigSchema=Rj,r.usePipelineExecutorGetEffectiveTuning=Nj,r.usePipelineExecutorGetGlobalPipelineConfig=fj,r.usePipelineExecutorGetGlobalSteps=dj,r.usePipelineExecutorGetOrchestratorConfigSchema=mj,r.usePipelineExecutorGetReferenceAudio=Aj,r.usePipelineExecutorGetReferenceAudioFiles=Dj,r.usePipelineExecutorGetReferenceImage=Ij,r.usePipelineExecutorGetSchema=uj,r.usePipelineExecutorGetSelectedEngine=aj,r.usePipelineExecutorGetVideoPipelineSteps=lj,r.usePipelineExecutorInferCached=kj,r.usePipelineExecutorKillEngine=Mj,r.usePipelineExecutorListLoadedEngines=Cj,r.usePipelineExecutorListReferenceImages=Ej,r.usePipelineExecutorListTemplates=gj,r.usePipelineExecutorReprobeEngine=sj,r.usePipelineExecutorRunAudioTest=Tj,r.usePipelineExecutorRunPipeline=Sj,r.usePipelineExecutorRunPipelineBatch=jj,r.usePipelineExecutorSaveTemplate=pj,r.usePipelineExecutorSetVideoPipelineSteps=cj,r.usePipelineExecutorSpinEngine=Oj,r.usePipelineExecutorUncacheFrame=Pj,r.usePipelineExecutorUpdateTemplate=hj,r.usePipelineOrchestratorApplyDeviceSettingsPatch=x$,r.usePipelineOrchestratorAssignAudio=Xj,r.usePipelineOrchestratorAssignDecoder=qj,r.usePipelineOrchestratorAssignPipeline=Lj,r.usePipelineOrchestratorDeleteTemplate=v$,r.usePipelineOrchestratorGetAgentLoad=Gj,r.usePipelineOrchestratorGetAgentSettings=i$,r.usePipelineOrchestratorGetAudioAssignment=e$,r.usePipelineOrchestratorGetAudioAssignments=r$,r.usePipelineOrchestratorGetAudioNodeLoad=t$,r.usePipelineOrchestratorGetCameraMetrics=Wj,r.usePipelineOrchestratorGetCameraSettings=l$,r.usePipelineOrchestratorGetCameraStepOverrides=u$,r.usePipelineOrchestratorGetCapabilityBindings=Qj,r.usePipelineOrchestratorGetDecoderAssignment=n$,r.usePipelineOrchestratorGetDecoderAssignments=Kj,r.usePipelineOrchestratorGetDeviceLiveContribution=y$,r.usePipelineOrchestratorGetDeviceSettingsContribution=b$,r.usePipelineOrchestratorGetGlobalMetrics=Vj,r.usePipelineOrchestratorGetPipelineAssignment=Fj,r.usePipelineOrchestratorGetPipelineAssignments=Bj,r.usePipelineOrchestratorListAgentSettings=a$,r.usePipelineOrchestratorListTemplates=g$,r.usePipelineOrchestratorRebalance=Uj,r.usePipelineOrchestratorRemoveAgentSettings=s$,r.usePipelineOrchestratorResolvePipeline=m$,r.usePipelineOrchestratorSaveTemplate=p$,r.usePipelineOrchestratorSetAgentAddonDefaults=o$,r.usePipelineOrchestratorSetCameraPipelineForAgent=f$,r.usePipelineOrchestratorSetCameraStepOverride=d$,r.usePipelineOrchestratorSetCameraStepToggle=c$,r.usePipelineOrchestratorSetCapabilityBinding=Hj,r.usePipelineOrchestratorUnassignAudio=Yj,r.usePipelineOrchestratorUnassignDecoder=Jj,r.usePipelineOrchestratorUnassignPipeline=Zj,r.usePipelineOrchestratorUpdateTemplate=h$,r.usePipelineRunnerAttachCamera=_$,r.usePipelineRunnerDetachCamera=w$,r.usePipelineRunnerGetAllCameraMetrics=P$,r.usePipelineRunnerGetCameraMetrics=k$,r.usePipelineRunnerGetLocalCameras=N$,r.usePipelineRunnerGetLocalLoad=j$,r.usePipelineRunnerGetLocalMetrics=$$,r.usePipelineRunnerReportMotion=S$,r.usePlatformProbeGetCapabilities=C$,r.usePlatformProbeGetHardware=O$,r.usePlatformProbeGetHardwareEncoders=I$,r.usePlatformProbeRefreshHardwareEncoders=D$,r.usePlatformProbeResolveHwAccel=E$,r.usePlatformProbeResolveInferenceConfig=M$,r.usePlayerOverlayLayer=Wl,r.usePlayerOverlayLayers=qN,r.usePlayerToolbarButton=JN,r.usePlayerToolbarButtons=Gf,r.usePrivacyMaskGetOptions=A$,r.usePrivacyMaskGetStatus=T$,r.usePrivacyMaskSetMask=z$,r.usePtzAutotrackGetSettings=J$,r.usePtzAutotrackGetStatus=Df,r.usePtzAutotrackSetEnabled=Af,r.usePtzAutotrackSetSettings=zf,r.usePtzContinuousMove=L$,r.usePtzDeletePreset=G$,r.usePtzGetOptions=V$,r.usePtzGetPosition=Q$,r.usePtzGetPresets=U$,r.usePtzGetStatus=q$,r.usePtzGoHome=W$,r.usePtzGoToPreset=B$,r.usePtzMove=R$,r.usePtzSavePreset=F$,r.usePtzSetAutofocus=H$,r.usePtzStop=Z$,r.useRebootReboot=K$,r.useRecordingEngineDisable=nk,r.useRecordingEngineEnable=rk,r.useRecordingEngineEstimateGlobalStorage=dk,r.useRecordingEngineEstimateStorage=uk,r.useRecordingEngineGetAvailability=ck,r.useRecordingEngineGetConfig=ik,r.useRecordingEngineGetMotionStats=bk,r.useRecordingEngineGetPlaylist=ok,r.useRecordingEngineGetPolicy=gk,r.useRecordingEngineGetPolicyStatus=pk,r.useRecordingEngineGetRetentionConfig=hk,r.useRecordingEngineGetSegments=lk,r.useRecordingEngineGetStatus=tk,r.useRecordingEngineGetStorageUsage=fk,r.useRecordingEngineGetThumbnail=sk,r.useRecordingEngineSetPolicy=mk,r.useRecordingEngineUpdateConfig=ak,r.useRecordingEngineUpdateRetentionConfig=vk,r.useRecordingGetPlaybackUrl=Y$,r.useRecordingGetSegments=X$,r.useRecordingGetThumbnailAt=ek,r.useRemoteComponent=Zf,r.useSettingsStoreCount=$k,r.useSettingsStoreDeclareCollection=Pk,r.useSettingsStoreDelete=jk,r.useSettingsStoreGet=yk,r.useSettingsStoreInsert=wk,r.useSettingsStoreIsEmpty=kk,r.useSettingsStoreQuery=_k,r.useSettingsStoreSet=xk,r.useSettingsStoreUpdate=Sk,r.useSnapshotApplyDeviceSettingsPatch=Ik,r.useSnapshotGetDeviceLiveContribution=Ek,r.useSnapshotGetDeviceSettingsContribution=Mk,r.useSnapshotGetSnapshot=Nk,r.useSnapshotGetStatus=Ok,r.useSnapshotInvalidateCache=Ck,r.useSnapshotProviderGetSnapshot=Ak,r.useSnapshotProviderSupportsDevice=Dk,r.useStorageAbortUpload=Wk,r.useStorageBeginDownload=Qk,r.useStorageBeginUpload=Fk,r.useStorageDelete=Uk,r.useStorageDeleteLocation=Yk,r.useStorageEndDownload=qk,r.useStorageExists=Lk,r.useStorageFinalizeUpload=Vk,r.useStorageGetAvailableSpace=Bk,r.useStorageGetDefaultLocation=Kk,r.useStorageList=Zk,r.useStorageListLocations=Jk,r.useStorageListProviders=tP,r.useStorageRead=Rk,r.useStorageReadChunk=Hk,r.useStorageResolve=zk,r.useStorageTestConfig=rP,r.useStorageTestLocation=eP,r.useStorageUpsertLocation=Xk,r.useStorageWrite=Tk,r.useStorageWriteChunk=Gk,r.useStreamBrokerApplyDeviceSettingsPatch=EP,r.useStreamBrokerAssignProfile=aP,r.useStreamBrokerGetAllRtspEntries=$P,r.useStreamBrokerGetBrokerStats=cP,r.useStreamBrokerGetDeviceLiveContribution=MP,r.useStreamBrokerGetDeviceSettingsContribution=OP,r.useStreamBrokerGetPreBufferInfo=SP,r.useStreamBrokerGetRtspEntry=kP,r.useStreamBrokerGetRtspPort=jP,r.useStreamBrokerGetStreamUrl=mP,r.useStreamBrokerGetStreamWithCodec=gP,r.useStreamBrokerIsRtspEnabled=CP,r.useStreamBrokerKillClient=dP,r.useStreamBrokerListAllCameraStreams=sP,r.useStreamBrokerListAllProfileSlots=lP,r.useStreamBrokerListClients=uP,r.useStreamBrokerPublishCameraStream=nP,r.useStreamBrokerPullAudioChunks=vP,r.useStreamBrokerPullFrameHandles=xP,r.useStreamBrokerRegenerateRtspToken=PP,r.useStreamBrokerReleaseStreamWithCodec=pP,r.useStreamBrokerRestartProfile=fP,r.useStreamBrokerRetractCameraStream=iP,r.useStreamBrokerSetPreBufferDuration=wP,r.useStreamBrokerSetRtspEnabled=NP,r.useStreamBrokerSubscribeAudioChunks=hP,r.useStreamBrokerSubscribeFrames=yP,r.useStreamBrokerUnassignProfile=oP,r.useStreamBrokerUnsubscribeAudioChunks=bP,r.useStreamBrokerUnsubscribeFrames=_P,r.useStreamCatalogGetCatalog=IP,r.useStreamParamsGetConfigSchema=zP,r.useStreamParamsGetOptions=DP,r.useStreamParamsGetStatus=TP,r.useStreamParamsSetProfile=AP,r.useSwitchGetStatus=LP,r.useSwitchSetState=RP,r.useSystem=cr,r.useSystemFeatureFlags=BP,r.useSystemForceRetentionCleanup=WP,r.useSystemGetRetentionConfig=GP,r.useSystemHealth=UP,r.useSystemInfo=ZP,r.useSystemMutation=HM,r.useSystemNetworkAddresses=FP,r.useSystemQuery=QM,r.useSystemSetRetentionConfig=VP,r.useThemeMode=u.useThemeMode$1,r.useToastOnToast=QP,r.useTurnProviderGetTurnServers=HP,r.useUserManagementConfirmTotp=dN,r.useUserManagementCreateApiKey=nN,r.useUserManagementCreateScopedToken=oN,r.useUserManagementCreateUser=JP,r.useUserManagementDeleteUser=XP,r.useUserManagementDisableTotp=fN,r.useUserManagementGetTotpStatus=mN,r.useUserManagementListApiKeys=rN,r.useUserManagementListOauthSessions=yN,r.useUserManagementListScopedTokens=cN,r.useUserManagementListUsers=qP,r.useUserManagementOauthExchangeCode=hN,r.useUserManagementOauthIssueCode=pN,r.useUserManagementOauthRefresh=vN,r.useUserManagementOauthVerifyAccessToken=bN,r.useUserManagementResetPassword=YP,r.useUserManagementRevokeApiKey=iN,r.useUserManagementRevokeOauthSession=xN,r.useUserManagementRevokeScopedToken=sN,r.useUserManagementSetUserScopes=eN,r.useUserManagementSetupTotp=uN,r.useUserManagementUpdateUser=KP,r.useUserManagementValidateApiKey=aN,r.useUserManagementValidateCredentials=tN,r.useUserManagementValidateScopedToken=lN,r.useUserManagementVerifyTotp=gN,r.useWebrtcSessionAddIceCandidate=$N,r.useWebrtcSessionCloseSession=PN,r.useWebrtcSessionCreateSession=wN,r.useWebrtcSessionGetIceCandidates=kN,r.useWebrtcSessionHandleAnswer=jN,r.useWebrtcSessionHandleOffer=SN,r.useWebrtcSessionHasAdaptiveBitrate=NN,r.useWebrtcSessionListStreams=_N,r.useWidget=GN,r.useWidgetMetadata=Lf,r.useWidgetRegistry=Ha,r.useZoneAnalyticsGetCameraHistory=MN,r.useZoneAnalyticsGetCurrentSnapshot=CN,r.useZoneAnalyticsGetUnzonedHistory=EN,r.useZoneAnalyticsGetZoneHistory=ON,r.useZoneEditing=ZM,r.useZoneRulesListRules=IN,r.useZoneRulesSetRules=DN,r.useZonesAddZone=zN,r.useZonesListZones=AN,r.useZonesRemoveZone=TN,r.useZonesUpdateZone=RN,r.validateScopes=RM})(pc)),pc}var xg=yg();const T4=YM(xg),X4=cE({__proto__:null,default:T4},[xg]);export{X4 as i};
|