@syntrologie/runtime-sdk 2.8.0-canary.151 → 2.8.0-canary.153
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/actions/schema.js +3 -3
- package/dist/adaptives/adaptive-viz/index.js +2 -2
- package/dist/adaptives/adaptive-viz/index.js.map +3 -3
- package/dist/{chunk-QA3K45LV.js → chunk-IZZQFSJ5.js} +2 -2
- package/dist/{chunk-WU267INS.js → chunk-OGJKQFQZ.js} +13 -1
- package/dist/chunk-OGJKQFQZ.js.map +7 -0
- package/dist/{chunk-BIEVC32B.js → chunk-RD3TLE4K.js} +3 -3
- package/dist/config/schema.js +2 -2
- package/dist/decisions/schema.js +1 -1
- package/dist/index.js +17 -6
- package/dist/index.js.map +2 -2
- package/dist/smart-canvas.esm.js +57 -57
- package/dist/smart-canvas.esm.js.map +3 -3
- package/dist/smart-canvas.js +27 -4
- package/dist/smart-canvas.js.map +2 -2
- package/dist/smart-canvas.min.js +57 -57
- package/dist/smart-canvas.min.js.map +3 -3
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-WU267INS.js.map +0 -7
- /package/dist/{chunk-QA3K45LV.js.map → chunk-IZZQFSJ5.js.map} +0 -0
- /package/dist/{chunk-BIEVC32B.js.map → chunk-RD3TLE4K.js.map} +0 -0
package/dist/actions/schema.js
CHANGED
|
@@ -31,9 +31,9 @@ import {
|
|
|
31
31
|
WaitZ,
|
|
32
32
|
WidgetConfigZ,
|
|
33
33
|
coreActionStepSchemas
|
|
34
|
-
} from "../chunk-
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-
|
|
34
|
+
} from "../chunk-RD3TLE4K.js";
|
|
35
|
+
import "../chunk-IZZQFSJ5.js";
|
|
36
|
+
import "../chunk-OGJKQFQZ.js";
|
|
37
37
|
import "../chunk-5Z66FT5C.js";
|
|
38
38
|
export {
|
|
39
39
|
AddClassZ,
|
|
@@ -192,9 +192,9 @@
|
|
|
192
192
|
<circle r="2" cy="8" cx="2"></circle>
|
|
193
193
|
<circle r="2" cy="8" cx="8"></circle>
|
|
194
194
|
<circle r="2" cy="8" cx="14"></circle>
|
|
195
|
-
</svg>`,GTe="chart-wrapper"});var bte='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"',b$={"\u{1F4B5}":['<rect width="20" height="12" x="2" y="6" rx="2"/>','<circle cx="12" cy="12" r="2"/>','<path d="M6 12h.01M18 12h.01"/>'],"\u{1F3DB}\uFE0F":['<line x1="3" x2="21" y1="22" y2="22"/>','<line x1="6" x2="6" y1="18" y2="11"/>','<line x1="10" x2="10" y1="18" y2="11"/>','<line x1="14" x2="14" y1="18" y2="11"/>','<line x1="18" x2="18" y1="18" y2="11"/>','<polygon points="12 2 20 7 4 7"/>'],"\u23ED\uFE0F":['<polygon points="5 4 15 12 5 20 5 4"/>','<line x1="19" x2="19" y1="5" y2="19"/>'],"\u27A1\uFE0F":['<path d="M5 12h14"/>','<path d="m12 5 7 7-7 7"/>'],"\u{1F4A1}":['<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"/>','<path d="M9 18h6"/>','<path d="M10 22h4"/>'],"\u{1F4B0}":['<rect width="20" height="12" x="2" y="6" rx="2"/>','<circle cx="12" cy="12" r="2"/>','<path d="M6 12h.01M18 12h.01"/>'],"\u{1F4CB}":['<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/>','<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>','<path d="M12 11h4"/>','<path d="M12 16h4"/>','<path d="M8 11h.01"/>','<path d="M8 16h.01"/>'],"\u2705":['<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/>','<path d="m9 11 3 3L22 4"/>'],"\u26A0\uFE0F":['<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"/>','<path d="M12 9v4"/>','<path d="M12 17h.01"/>'],"\u{1F6E1}\uFE0F":['<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"/>'],"\u{1F4C8}":['<polyline points="22 7 13.5 15.5 8.5 10.5 2 17"/>','<polyline points="16 7 22 7 22 13"/>'],"\u{1F52C}":['<path d="M6 18h8"/>','<path d="M3 22h18"/>','<path d="M14 22a7 7 0 1 0 0-14h-1"/>','<path d="M9 14h2"/>','<path d="M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z"/>','<path d="M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3"/>'],"\u{1F48A}":['<path d="m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z"/>','<path d="m8.5 8.5 7 7"/>'],"\u{1F4C4}":['<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/>','<path d="M14 2v4a2 2 0 0 0 2 2h4"/>','<path d="M10 9H8"/>','<path d="M16 13H8"/>','<path d="M16 17H8"/>'],"\u{1F9EA}":['<path d="M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2"/>','<path d="M6.453 15h11.094"/>','<path d="M8.5 2h7"/>'],"\u{1F501}":['<path d="m17 2 4 4-4 4"/>','<path d="M3 11v-1a4 4 0 0 1 4-4h14"/>','<path d="m7 22-4-4 4-4"/>','<path d="M21 13v1a4 4 0 0 1-4 4H3"/>'],"\u{1F9E0}":['<path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"/>','<path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"/>','<path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"/>','<path d="M17.599 6.5a3 3 0 0 0 .399-1.375"/>','<path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"/>','<path d="M3.477 10.896a4 4 0 0 1 .585-.396"/>','<path d="M19.938 10.5a4 4 0 0 1 .585.396"/>','<path d="M6 18a4 4 0 0 1-1.967-.516"/>','<path d="M19.967 17.484A4 4 0 0 1 18 18"/>'],"\u{1F319}":['<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>'],"\u{1F4E6}":['<path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 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.73z"/>','<path d="M12 22V12"/>','<path d="m3.3 7 8.7 5 8.7-5"/>','<path d="m7.5 4.27 9 5.15"/>'],"\u{1F331}":['<path d="M7 20h10"/>','<path d="M10 20c5.5-2.5.8-6.4 3-10"/>','<path d="M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z"/>','<path d="M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z"/>'],"\u26A1":['<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"/>'],"\u{1F333}":['<path d="M12 22V8"/>','<path d="m17 8-5-6-5 6"/>','<path d="M12 12c-2-2-4-2-4-2 0 0 0 4 2 6 1.5 1.5 3 1 4 0"/>','<path d="M12 12c2-2 4-2 4-2 0 0 0 4-2 6-1.5 1.5-3 1-4 0"/>'],"\u{1F33F}":['<path d="M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19.2 2.96a1 1 0 0 1 1.8.5c0 6-2 11-9 16.5"/>','<path d="M2 21c0-3 1.85-5.36 5.08-6"/>'],"\u2753":['<circle cx="12" cy="12" r="10"/>','<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/>','<path d="M12 17h.01"/>'],"\u{1F9ED}":['<circle cx="12" cy="12" r="10"/>','<polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"/>'],"\u{1F4DD}":['<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/>','<polyline points="14 2 14 8 20 8"/>','<line x1="16" y1="13" x2="8" y2="13"/>','<line x1="16" y1="17" x2="8" y2="17"/>','<line x1="10" y1="9" x2="8" y2="9"/>'],"\u{1F3AF}":['<polygon points="12 2 2 7 12 12 22 7 12 2"/>','<polyline points="2 17 12 22 22 17"/>','<polyline points="2 12 12 17 22 12"/>'],"\u{1F3C6}":['<path d="M6 9H4.5a2.5 2.5 0 0 1 0-5H6"/>','<path d="M18 9h1.5a2.5 2.5 0 0 0 0-5H18"/>','<path d="M4 22h16"/>','<path d="M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22"/>','<path d="M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22"/>','<path d="M18 2H6v7a6 6 0 0 0 12 0V2Z"/>'],"\u2728":['<path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/>','<path d="M5 3v4"/>','<path d="M19 17v4"/>','<path d="M3 5h4"/>','<path d="M17 19h4"/>'],"\u{1F4AC}":['<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>'],"\u{1F3AE}":['<line x1="6" y1="11" x2="10" y2="11"/>','<line x1="8" y1="9" x2="8" y2="13"/>','<line x1="15" y1="12" x2="15.01" y2="12"/>','<line x1="18" y1="10" x2="18.01" y2="10"/>','<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"/>'],"\u23F1\uFE0F":['<line x1="10" y1="2" x2="14" y2="2"/>','<line x1="12" y1="14" x2="12" y2="8"/>','<circle cx="12" cy="14" r="8"/>'],"\u{1F4D6}":['<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/>','<path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/>'],"\u{1F514}":['<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/>','<path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/>'],"\u{1F393}":['<path d="M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z"/>','<path d="M22 10v6"/>','<path d="M6 12.5V16a6 3 0 0 0 12 0v-3.5"/>'],"\u23F0":['<circle cx="12" cy="13" r="8"/>','<path d="M12 9v4l2 2"/>','<path d="M5 3 2 6"/>','<path d="m22 6-3-3"/>','<path d="M6.38 18.7 4 21"/>','<path d="M17.64 18.67 20 21"/>'],"\u{1F504}":['<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/>','<path d="M21 3v5h-5"/>','<path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/>','<path d="M8 16H3v5"/>'],"\u{1F464}":['<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>','<circle cx="12" cy="7" r="4"/>'],"\u{1F3E0}":['<path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"/>','<path d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'],"\u{1F6D2}":['<circle cx="8" cy="21" r="1"/>','<circle cx="19" cy="21" r="1"/>','<path d="M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12"/>'],"\u{1F4CA}":['<path d="M3 3v18h18"/>','<path d="M18 17V9"/>','<path d="M13 17V5"/>','<path d="M8 17v-3"/>'],"\u{1F4C9}":['<polyline points="22 17 13.5 8.5 8.5 13.5 2 7"/>','<polyline points="16 17 22 17 22 11"/>'],"\u{1F967}":['<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z"/>','<path d="M21.21 15.89A10 10 0 1 1 8 2.83"/>'],"\u{1F4B9}":['<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.5.5 0 0 1-.96 0L9.24 2.18a.5.5 0 0 0-.96 0l-2.35 8.36A2 2 0 0 1 4.02 12H2"/>'],"\u{1F321}\uFE0F":['<path d="M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z"/>']};function OS(e,t={}){let n=b$[e];if(!n)return"";let r=t.size??14,i=t.color??"currentColor";return`${bte} width="${r}" height="${r}" stroke="${i}">${n.join("")}</svg>`}var Z={};yn(Z,{BRAND:()=>Vte,DIRTY:()=>Oc,EMPTY_PATH:()=>Cte,INVALID:()=>ke,NEVER:()=>Tne,OK:()=>Ar,ParseStatus:()=>nr,Schema:()=>qe,ZodAny:()=>al,ZodArray:()=>Xs,ZodBigInt:()=>Pc,ZodBoolean:()=>Lc,ZodBranded:()=>Fg,ZodCatch:()=>Yc,ZodDate:()=>Ic,ZodDefault:()=>Gc,ZodDiscriminatedUnion:()=>Iv,ZodEffects:()=>mo,ZodEnum:()=>Wc,ZodError:()=>xi,ZodFirstPartyTypeKind:()=>Re,ZodFunction:()=>zv,ZodIntersection:()=>jc,ZodIssueCode:()=>ie,ZodLazy:()=>qc,ZodLiteral:()=>Hc,ZodMap:()=>lp,ZodNaN:()=>fp,ZodNativeEnum:()=>Vc,ZodNever:()=>Xo,ZodNull:()=>zc,ZodNullable:()=>Ya,ZodNumber:()=>$c,ZodObject:()=>vi,ZodOptional:()=>po,ZodParsedType:()=>de,ZodPipeline:()=>Dg,ZodPromise:()=>sl,ZodReadonly:()=>Xc,ZodRecord:()=>Bv,ZodSchema:()=>qe,ZodSet:()=>cp,ZodString:()=>ol,ZodSymbol:()=>sp,ZodTransformer:()=>mo,ZodTuple:()=>Ga,ZodType:()=>qe,ZodUndefined:()=>Bc,ZodUnion:()=>Uc,ZodUnknown:()=>Ys,ZodVoid:()=>up,addIssueToContext:()=>ue,any:()=>tne,array:()=>one,bigint:()=>Zte,boolean:()=>R$,coerce:()=>kne,custom:()=>D$,date:()=>Kte,datetimeRegex:()=>S$,defaultErrorMap:()=>Vs,discriminatedUnion:()=>lne,effect:()=>Ene,enum:()=>xne,function:()=>mne,getErrorMap:()=>ip,getParsedType:()=>Va,instanceof:()=>Yte,intersection:()=>cne,isAborted:()=>Pv,isAsync:()=>op,isDirty:()=>Lv,isValid:()=>il,late:()=>Gte,lazy:()=>gne,literal:()=>yne,makeIssue:()=>Sg,map:()=>pne,nan:()=>Xte,nativeEnum:()=>vne,never:()=>rne,null:()=>ene,nullable:()=>wne,number:()=>T$,object:()=>ane,objectUtil:()=>$S,oboolean:()=>Dne,onumber:()=>Fne,optional:()=>Ane,ostring:()=>Sne,pipeline:()=>_ne,preprocess:()=>Cne,promise:()=>bne,quotelessJson:()=>Ete,record:()=>dne,set:()=>hne,setErrorMap:()=>wte,strictObject:()=>sne,string:()=>k$,symbol:()=>Qte,transformer:()=>Ene,tuple:()=>fne,undefined:()=>Jte,union:()=>une,unknown:()=>nne,util:()=>Ke,void:()=>ine});var Ke;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{let o={};for(let a of i)o[a]=a;return o},e.getValidEnumValues=i=>{let o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(let s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(let a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ke||(Ke={}));var $S;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})($S||($S={}));var de=Ke.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Va=e=>{switch(typeof e){case"undefined":return de.undefined;case"string":return de.string;case"number":return Number.isNaN(e)?de.nan:de.number;case"boolean":return de.boolean;case"function":return de.function;case"bigint":return de.bigint;case"symbol":return de.symbol;case"object":return Array.isArray(e)?de.array:e===null?de.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?de.promise:typeof Map<"u"&&e instanceof Map?de.map:typeof Set<"u"&&e instanceof Set?de.set:typeof Date<"u"&&e instanceof Date?de.date:de.object;default:return de.unknown}};var ie=Ke.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ete=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),xi=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,u=0;for(;u<a.path.length;){let l=a.path[u];u===a.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(n(a))):s[l]=s[l]||{_errors:[]},s=s[l],u++}}};return i(this),r}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ke.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n={},r=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];n[o]=n[o]||[],n[o].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};xi.create=e=>new xi(e);var Ate=(e,t)=>{let n;switch(e.code){case ie.invalid_type:e.received===de.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ie.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ke.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ke.joinValues(e.keys,", ")}`;break;case ie.invalid_union:n="Invalid input";break;case ie.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ke.joinValues(e.options)}`;break;case ie.invalid_enum_value:n=`Invalid enum value. Expected ${Ke.joinValues(e.options)}, received '${e.received}'`;break;case ie.invalid_arguments:n="Invalid function arguments";break;case ie.invalid_return_type:n="Invalid function return type";break;case ie.invalid_date:n="Invalid date";break;case ie.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ke.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ie.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ie.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ie.custom:n="Invalid input";break;case ie.invalid_intersection_types:n="Intersection results could not be merged";break;case ie.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ie.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ke.assertNever(e)}return{message:n}},Vs=Ate;var E$=Vs;function wte(e){E$=e}function ip(){return E$}var Sg=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="",u=r.filter(l=>!!l).slice().reverse();for(let l of u)s=l(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},Cte=[];function ue(e,t){let n=ip(),r=Sg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Vs?void 0:Vs].filter(i=>!!i)});e.common.issues.push(r)}var nr=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let i of n){if(i.status==="aborted")return ke;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let i of n){let o=await i.key,a=await i.value;r.push({key:o,value:a})}return e.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let i of n){let{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return ke;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}},ke=Object.freeze({status:"aborted"}),Oc=e=>({status:"dirty",value:e}),Ar=e=>({status:"valid",value:e}),Pv=e=>e.status==="aborted",Lv=e=>e.status==="dirty",il=e=>e.status==="valid",op=e=>typeof Promise<"u"&&e instanceof Promise;var xe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(xe||(xe={}));var ho=class{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},A$=(e,t)=>{if(il(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new xi(e.common.issues);return this._error=n,this._error}}};function ze(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{let{message:u}=e;return a.code==="invalid_enum_value"?{message:u??s.defaultError}:typeof s.data>"u"?{message:u??r??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:u??n??s.defaultError}},description:i}}var qe=class{get description(){return this._def.description}_getType(t){return Va(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Va(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new nr,ctx:{common:t.parent.common,data:t.data,parsedType:Va(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(op(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Va(t)},i=this._parseSync({data:t,path:r.path,parent:r});return A$(r,i)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Va(t)};if(!this["~standard"].async)try{let r=this._parseSync({data:t,path:[],parent:n});return il(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>il(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Va(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(op(i)?i:Promise.resolve(i));return A$(r,o)}refine(t,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{let a=t(i),s=()=>o.addIssue({code:ie.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new mo({schema:this,typeName:Re.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return po.create(this,this._def)}nullable(){return Ya.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xs.create(this)}promise(){return sl.create(this,this._def)}or(t){return Uc.create([this,t],this._def)}and(t){return jc.create(this,t,this._def)}transform(t){return new mo({...ze(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new Gc({...ze(this._def),innerType:this,defaultValue:n,typeName:Re.ZodDefault})}brand(){return new Fg({typeName:Re.ZodBranded,type:this,...ze(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Yc({...ze(this._def),innerType:this,catchValue:n,typeName:Re.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Dg.create(this,t)}readonly(){return Xc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},_te=/^c[^\s-]{8,}$/i,Ste=/^[0-9a-z]+$/,Fte=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Dte=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,kte=/^[a-z0-9_-]{21}$/i,Tte=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Rte=/^[-+]?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)?)??$/,Mte=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Nte="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",PS,Ote=/^(?:(?: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])$/,$te=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Pte=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Lte=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ite=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Bte=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,C$="((\\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])))",zte=new RegExp(`^${C$}$`);function _$(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Ute(e){return new RegExp(`^${_$(e)}$`)}function S$(e){let t=`${C$}T${_$(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function jte(e,t){return!!((t==="v4"||!t)&&Ote.test(e)||(t==="v6"||!t)&&Pte.test(e))}function qte(e,t){if(!Tte.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function Hte(e,t){return!!((t==="v4"||!t)&&$te.test(e)||(t==="v6"||!t)&&Lte.test(e))}var ol=class e extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==de.string){let o=this._getOrReturnCtx(t);return ue(o,{code:ie.invalid_type,expected:de.string,received:o.parsedType}),ke}let r=new nr,i;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?ue(i,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&ue(i,{code:ie.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Mte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"email",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")PS||(PS=new RegExp(Nte,"u")),PS.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"emoji",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Dte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"uuid",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")kte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"nanoid",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")_te.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"cuid",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Ste.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"cuid2",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Fte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"ulid",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ue(i,{validation:"url",code:ie.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"regex",code:ie.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?S$(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?zte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Ute(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Rte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"duration",code:ie.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?jte(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"ip",code:ie.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?qte(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"jwt",code:ie.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?Hte(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"cidr",code:ie.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?Ite.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"base64",code:ie.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?Bte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"base64url",code:ie.invalid_string,message:o.message}),r.dirty()):Ke.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:ie.invalid_string,...xe.errToObj(r)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...xe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...xe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...xe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...xe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...xe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...xe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...xe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...xe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...xe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...xe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...xe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...xe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...xe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...xe.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...xe.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...xe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...xe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...xe.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...xe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...xe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...xe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...xe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...xe.errToObj(n)})}nonempty(t){return this.min(1,xe.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};ol.create=e=>new ol({checks:[],typeName:Re.ZodString,coerce:e?.coerce??!1,...ze(e)});function Wte(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return o%a/10**i}var $c=class e extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==de.number){let o=this._getOrReturnCtx(t);return ue(o,{code:ie.invalid_type,expected:de.number,received:o.parsedType}),ke}let r,i=new nr;for(let o of this._def.checks)o.kind==="int"?Ke.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Wte(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.not_finite,message:o.message}),i.dirty()):Ke.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,xe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,xe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,xe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,xe.toString(n))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:xe.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:xe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:xe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:xe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:xe.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ke.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};$c.create=e=>new $c({checks:[],typeName:Re.ZodNumber,coerce:e?.coerce||!1,...ze(e)});var Pc=class e extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==de.bigint)return this._getInvalidInput(t);let r,i=new nr;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ke.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return ue(n,{code:ie.invalid_type,expected:de.bigint,received:n.parsedType}),ke}gte(t,n){return this.setLimit("min",t,!0,xe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,xe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,xe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,xe.toString(n))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:xe.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Pc.create=e=>new Pc({checks:[],typeName:Re.ZodBigInt,coerce:e?.coerce??!1,...ze(e)});var Lc=class extends qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==de.boolean){let r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:de.boolean,received:r.parsedType}),ke}return Ar(t.data)}};Lc.create=e=>new Lc({typeName:Re.ZodBoolean,coerce:e?.coerce||!1,...ze(e)});var Ic=class e extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==de.date){let o=this._getOrReturnCtx(t);return ue(o,{code:ie.invalid_type,expected:de.date,received:o.parsedType}),ke}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return ue(o,{code:ie.invalid_date}),ke}let r=new nr,i;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ke.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:xe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:xe.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};Ic.create=e=>new Ic({checks:[],coerce:e?.coerce||!1,typeName:Re.ZodDate,...ze(e)});var sp=class extends qe{_parse(t){if(this._getType(t)!==de.symbol){let r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:de.symbol,received:r.parsedType}),ke}return Ar(t.data)}};sp.create=e=>new sp({typeName:Re.ZodSymbol,...ze(e)});var Bc=class extends qe{_parse(t){if(this._getType(t)!==de.undefined){let r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:de.undefined,received:r.parsedType}),ke}return Ar(t.data)}};Bc.create=e=>new Bc({typeName:Re.ZodUndefined,...ze(e)});var zc=class extends qe{_parse(t){if(this._getType(t)!==de.null){let r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:de.null,received:r.parsedType}),ke}return Ar(t.data)}};zc.create=e=>new zc({typeName:Re.ZodNull,...ze(e)});var al=class extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return Ar(t.data)}};al.create=e=>new al({typeName:Re.ZodAny,...ze(e)});var Ys=class extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ar(t.data)}};Ys.create=e=>new Ys({typeName:Re.ZodUnknown,...ze(e)});var Xo=class extends qe{_parse(t){let n=this._getOrReturnCtx(t);return ue(n,{code:ie.invalid_type,expected:de.never,received:n.parsedType}),ke}};Xo.create=e=>new Xo({typeName:Re.ZodNever,...ze(e)});var up=class extends qe{_parse(t){if(this._getType(t)!==de.undefined){let r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:de.void,received:r.parsedType}),ke}return Ar(t.data)}};up.create=e=>new up({typeName:Re.ZodVoid,...ze(e)});var Xs=class e extends qe{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==de.array)return ue(n,{code:ie.invalid_type,expected:de.array,received:n.parsedType}),ke;if(i.exactLength!==null){let a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&(ue(n,{code:a?ie.too_big:ie.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ue(n,{code:ie.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ue(n,{code:ie.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new ho(n,a,n.path,s)))).then(a=>nr.mergeArray(r,a));let o=[...n.data].map((a,s)=>i.type._parseSync(new ho(n,a,n.path,s)));return nr.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:xe.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:xe.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:xe.toString(n)}})}nonempty(t){return this.min(1,t)}};Xs.create=(e,t)=>new Xs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,...ze(t)});function ap(e){if(e instanceof vi){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=po.create(ap(r))}return new vi({...e._def,shape:()=>t})}else return e instanceof Xs?new Xs({...e._def,type:ap(e.element)}):e instanceof po?po.create(ap(e.unwrap())):e instanceof Ya?Ya.create(ap(e.unwrap())):e instanceof Ga?Ga.create(e.items.map(t=>ap(t))):e}var vi=class e extends qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=Ke.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==de.object){let l=this._getOrReturnCtx(t);return ue(l,{code:ie.invalid_type,expected:de.object,received:l.parsedType}),ke}let{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Xo&&this._def.unknownKeys==="strip"))for(let l in i.data)a.includes(l)||s.push(l);let u=[];for(let l of a){let c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new ho(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Xo){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of s)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")s.length>0&&(ue(i,{code:ie.unrecognized_keys,keys:s}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of s){let f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new ho(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let f=await c.key,d=await c.value;l.push({key:f,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>nr.mergeObjectSync(r,l)):nr.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return xe.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{let i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:xe.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Re.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let r of Ke.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let r of Ke.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new e({...this._def,shape:()=>n})}deepPartial(){return ap(this)}partial(t){let n={};for(let r of Ke.objectKeys(this.shape)){let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let r of Ke.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof po;)o=o._def.innerType;n[r]=o}return new e({...this._def,shape:()=>n})}keyof(){return F$(Ke.objectKeys(this.shape))}};vi.create=(e,t)=>new vi({shape:()=>e,unknownKeys:"strip",catchall:Xo.create(),typeName:Re.ZodObject,...ze(t)});vi.strictCreate=(e,t)=>new vi({shape:()=>e,unknownKeys:"strict",catchall:Xo.create(),typeName:Re.ZodObject,...ze(t)});vi.lazycreate=(e,t)=>new vi({shape:e,unknownKeys:"strip",catchall:Xo.create(),typeName:Re.ZodObject,...ze(t)});var Uc=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new xi(s.ctx.common.issues));return ue(n,{code:ie.invalid_union,unionErrors:a}),ke}if(n.common.async)return Promise.all(r.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o,a=[];for(let u of r){let l={...n,common:{...n.common,issues:[]},parent:null},c=u._parseSync({data:n.data,path:n.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(u=>new xi(u));return ue(n,{code:ie.invalid_union,unionErrors:s}),ke}}get options(){return this._def.options}};Uc.create=(e,t)=>new Uc({options:e,typeName:Re.ZodUnion,...ze(t)});var Gs=e=>e instanceof qc?Gs(e.schema):e instanceof mo?Gs(e.innerType()):e instanceof Hc?[e.value]:e instanceof Wc?e.options:e instanceof Vc?Ke.objectValues(e.enum):e instanceof Gc?Gs(e._def.innerType):e instanceof Bc?[void 0]:e instanceof zc?[null]:e instanceof po?[void 0,...Gs(e.unwrap())]:e instanceof Ya?[null,...Gs(e.unwrap())]:e instanceof Fg||e instanceof Xc?Gs(e.unwrap()):e instanceof Yc?Gs(e._def.innerType):[],Iv=class e extends qe{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==de.object)return ue(n,{code:ie.invalid_type,expected:de.object,received:n.parsedType}),ke;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ue(n,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ke)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let o of n){let a=Gs(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new e({typeName:Re.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...ze(r)})}};function LS(e,t){let n=Va(e),r=Va(t);if(e===t)return{valid:!0,data:e};if(n===de.object&&r===de.object){let i=Ke.objectKeys(t),o=Ke.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(let s of o){let u=LS(e[s],t[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(n===de.array&&r===de.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let o=0;o<e.length;o++){let a=e[o],s=t[o],u=LS(a,s);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return n===de.date&&r===de.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var jc=class extends qe{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(Pv(o)||Pv(a))return ke;let s=LS(o.value,a.value);return s.valid?((Lv(o)||Lv(a))&&n.dirty(),{status:n.value,value:s.data}):(ue(r,{code:ie.invalid_intersection_types}),ke)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};jc.create=(e,t,n)=>new jc({left:e,right:t,typeName:Re.ZodIntersection,...ze(n)});var Ga=class e extends qe{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==de.array)return ue(r,{code:ie.invalid_type,expected:de.array,received:r.parsedType}),ke;if(r.data.length<this._def.items.length)return ue(r,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ke;!this._def.rest&&r.data.length>this._def.items.length&&(ue(r,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...r.data].map((a,s)=>{let u=this._def.items[s]||this._def.rest;return u?u._parse(new ho(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>nr.mergeArray(n,a)):nr.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ga.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ga({items:e,typeName:Re.ZodTuple,rest:null,...ze(t)})};var Bv=class e extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==de.object)return ue(r,{code:ie.invalid_type,expected:de.object,received:r.parsedType}),ke;let i=[],o=this._def.keyType,a=this._def.valueType;for(let s in r.data)i.push({key:o._parse(new ho(r,s,r.path,s)),value:a._parse(new ho(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?nr.mergeObjectAsync(n,i):nr.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof qe?new e({keyType:t,valueType:n,typeName:Re.ZodRecord,...ze(r)}):new e({keyType:ol.create(),valueType:t,typeName:Re.ZodRecord,...ze(n)})}},lp=class extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==de.map)return ue(r,{code:ie.invalid_type,expected:de.map,received:r.parsedType}),ke;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,u],l)=>({key:i._parse(new ho(r,s,r.path,[l,"key"])),value:o._parse(new ho(r,u,r.path,[l,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let u of a){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return ke;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let u of a){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return ke;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}}}};lp.create=(e,t,n)=>new lp({valueType:t,keyType:e,typeName:Re.ZodMap,...ze(n)});var cp=class e extends qe{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==de.set)return ue(r,{code:ie.invalid_type,expected:de.set,received:r.parsedType}),ke;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ue(r,{code:ie.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ue(r,{code:ie.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function a(u){let l=new Set;for(let c of u){if(c.status==="aborted")return ke;c.status==="dirty"&&n.dirty(),l.add(c.value)}return{status:n.value,value:l}}let s=[...r.data.values()].map((u,l)=>o._parse(new ho(r,u,r.path,l)));return r.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(t,n){return new e({...this._def,minSize:{value:t,message:xe.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:xe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};cp.create=(e,t)=>new cp({valueType:e,minSize:null,maxSize:null,typeName:Re.ZodSet,...ze(t)});var zv=class e extends qe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==de.function)return ue(n,{code:ie.invalid_type,expected:de.function,received:n.parsedType}),ke;function r(s,u){return Sg({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ip(),Vs].filter(l=>!!l),issueData:{code:ie.invalid_arguments,argumentsError:u}})}function i(s,u){return Sg({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ip(),Vs].filter(l=>!!l),issueData:{code:ie.invalid_return_type,returnTypeError:u}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof sl){let s=this;return Ar(async function(...u){let l=new xi([]),c=await s._def.args.parseAsync(u,o).catch(p=>{throw l.addIssue(r(u,p)),l}),f=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(f,o).catch(p=>{throw l.addIssue(i(f,p)),l})})}else{let s=this;return Ar(function(...u){let l=s._def.args.safeParse(u,o);if(!l.success)throw new xi([r(u,l.error)]);let c=Reflect.apply(a,this,l.data),f=s._def.returns.safeParse(c,o);if(!f.success)throw new xi([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ga.create(t).rest(Ys.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new e({args:t||Ga.create([]).rest(Ys.create()),returns:n||Ys.create(),typeName:Re.ZodFunction,...ze(r)})}},qc=class extends qe{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};qc.create=(e,t)=>new qc({getter:e,typeName:Re.ZodLazy,...ze(t)});var Hc=class extends qe{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return ue(n,{received:n.data,code:ie.invalid_literal,expected:this._def.value}),ke}return{status:"valid",value:t.data}}get value(){return this._def.value}};Hc.create=(e,t)=>new Hc({value:e,typeName:Re.ZodLiteral,...ze(t)});function F$(e,t){return new Wc({values:e,typeName:Re.ZodEnum,...ze(t)})}var Wc=class e extends qe{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return ue(n,{expected:Ke.joinValues(r),received:n.parsedType,code:ie.invalid_type}),ke}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),r=this._def.values;return ue(n,{received:n.data,code:ie.invalid_enum_value,options:r}),ke}return Ar(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}};Wc.create=F$;var Vc=class extends qe{_parse(t){let n=Ke.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==de.string&&r.parsedType!==de.number){let i=Ke.objectValues(n);return ue(r,{expected:Ke.joinValues(i),received:r.parsedType,code:ie.invalid_type}),ke}if(this._cache||(this._cache=new Set(Ke.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=Ke.objectValues(n);return ue(r,{received:r.data,code:ie.invalid_enum_value,options:i}),ke}return Ar(t.data)}get enum(){return this._def.values}};Vc.create=(e,t)=>new Vc({values:e,typeName:Re.ZodNativeEnum,...ze(t)});var sl=class extends qe{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==de.promise&&n.common.async===!1)return ue(n,{code:ie.invalid_type,expected:de.promise,received:n.parsedType}),ke;let r=n.parsedType===de.promise?n.data:Promise.resolve(n.data);return Ar(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};sl.create=(e,t)=>new sl({type:e,typeName:Re.ZodPromise,...ze(t)});var mo=class extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{ue(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let a=i.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return ke;let u=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return u.status==="aborted"?ke:u.status==="dirty"?Oc(u.value):n.value==="dirty"?Oc(u.value):u});{if(n.value==="aborted")return ke;let s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?ke:s.status==="dirty"?Oc(s.value):n.value==="dirty"?Oc(s.value):s}}if(i.type==="refinement"){let a=s=>{let u=i.refinement(s,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ke:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?ke:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!il(a))return ke;let s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>il(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):ke);Ke.assertNever(i)}};mo.create=(e,t,n)=>new mo({schema:e,typeName:Re.ZodEffects,effect:t,...ze(n)});mo.createWithPreprocess=(e,t,n)=>new mo({schema:t,effect:{type:"preprocess",transform:e},typeName:Re.ZodEffects,...ze(n)});var po=class extends qe{_parse(t){return this._getType(t)===de.undefined?Ar(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};po.create=(e,t)=>new po({innerType:e,typeName:Re.ZodOptional,...ze(t)});var Ya=class extends qe{_parse(t){return this._getType(t)===de.null?Ar(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ya.create=(e,t)=>new Ya({innerType:e,typeName:Re.ZodNullable,...ze(t)});var Gc=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===de.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Gc.create=(e,t)=>new Gc({innerType:e,typeName:Re.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ze(t)});var Yc=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return op(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new xi(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new xi(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Yc.create=(e,t)=>new Yc({innerType:e,typeName:Re.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ze(t)});var fp=class extends qe{_parse(t){if(this._getType(t)!==de.nan){let r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:de.nan,received:r.parsedType}),ke}return{status:"valid",value:t.data}}};fp.create=e=>new fp({typeName:Re.ZodNaN,...ze(e)});var Vte=Symbol("zod_brand"),Fg=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Dg=class e extends qe{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ke:o.status==="dirty"?(n.dirty(),Oc(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ke:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new e({in:t,out:n,typeName:Re.ZodPipeline})}},Xc=class extends qe{_parse(t){let n=this._def.innerType._parse(t),r=i=>(il(i)&&(i.value=Object.freeze(i.value)),i);return op(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};Xc.create=(e,t)=>new Xc({innerType:e,typeName:Re.ZodReadonly,...ze(t)});function w$(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function D$(e,t={},n){return e?al.create().superRefine((r,i)=>{let o=e(r);if(o instanceof Promise)return o.then(a=>{if(!a){let s=w$(t,r),u=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:u})}});if(!o){let a=w$(t,r),s=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:s})}}):al.create()}var Gte={object:vi.lazycreate},Re;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Re||(Re={}));var Yte=(e,t={message:`Input not instance of ${e.name}`})=>D$(n=>n instanceof e,t),k$=ol.create,T$=$c.create,Xte=fp.create,Zte=Pc.create,R$=Lc.create,Kte=Ic.create,Qte=sp.create,Jte=Bc.create,ene=zc.create,tne=al.create,nne=Ys.create,rne=Xo.create,ine=up.create,one=Xs.create,ane=vi.create,sne=vi.strictCreate,une=Uc.create,lne=Iv.create,cne=jc.create,fne=Ga.create,dne=Bv.create,pne=lp.create,hne=cp.create,mne=zv.create,gne=qc.create,yne=Hc.create,xne=Wc.create,vne=Vc.create,bne=sl.create,Ene=mo.create,Ane=po.create,wne=Ya.create,Cne=mo.createWithPreprocess,_ne=Dg.create,Sne=()=>k$().optional(),Fne=()=>T$().optional(),Dne=()=>R$().optional(),kne={string:(e=>ol.create({...e,coerce:!0})),number:(e=>$c.create({...e,coerce:!0})),boolean:(e=>Lc.create({...e,coerce:!0})),bigint:(e=>Pc.create({...e,coerce:!0})),date:(e=>Ic.create({...e,coerce:!0}))};var Tne=ke;var Rne=Z.object({selector:Z.string(),route:Z.union([Z.string(),Z.array(Z.string())])}).strict(),M$=["ui.click","ui.scroll","ui.input","ui.change","ui.submit","ui.hover","ui.idle","ui.scroll_thrash","ui.focus_bounce","nav.page_view","nav.page_leave","behavior.rage_click","behavior.hesitation","behavior.confusion"],N$=Z.enum(M$).describe("Event name to count. ui.* = user interactions and behavioral detectors, nav.* = page navigation, behavior.* = derived behavioral signals."),O$=["time_on_page","page_views","scroll_depth"],$$=Z.enum(O$).describe("Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.");var P$=Z.object({type:Z.literal("page_url"),url:Z.string().describe('URL path to match (e.g. "/pricing", "/dashboard")')}).describe('Fires when the current page URL matches. Use for page-specific actions. Example: {"type": "page_url", "url": "/pricing"}'),L$=Z.object({type:Z.literal("route"),routeId:Z.string().describe("Named route ID from the route filter")}).describe("Fires when the current route matches a named route ID."),I$=Z.object({type:Z.literal("anchor_visible"),anchorId:Z.string().describe("CSS selector of the anchor element"),state:Z.enum(["visible","present","absent"]).describe('"visible" = in viewport, "present" = in DOM, "absent" = not in DOM')}).describe(`Fires based on a DOM element's visibility state. Example: {"type": "anchor_visible", "anchorId": "#cta-button", "state": "visible"}`),B$=Z.object({type:Z.literal("event_occurred"),eventName:Z.string().describe('Event name (e.g. "ui.click", "$pageview")'),withinMs:Z.number().optional().describe("Time window in ms. Omit = any time this session.")}).describe('Fires when a specific event has occurred during this session. Example: {"type": "event_occurred", "eventName": "ui.click", "withinMs": 5000}'),z$=Z.object({type:Z.literal("state_equals"),key:Z.string().describe("Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set()."),value:Z.unknown().describe("Expected value to match against")}).describe("Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type."),U$=Z.object({type:Z.literal("viewport"),minWidth:Z.number().optional().describe("Minimum viewport width in pixels"),maxWidth:Z.number().optional().describe("Maximum viewport width in pixels"),minHeight:Z.number().optional().describe("Minimum viewport height in pixels"),maxHeight:Z.number().optional().describe("Maximum viewport height in pixels")}).describe('Fires based on viewport (screen) size. Use for responsive behavior. Example: {"type": "viewport", "minWidth": 768} \u2014 fires on tablet and larger.'),j$=Z.object({type:Z.literal("session_metric"),key:$$,operator:Z.enum(["gte","lte","eq","gt","lt"]),threshold:Z.number().describe("Numeric threshold to compare against")}).describe('Fires when a session metric crosses a threshold. Valid keys: "time_on_page" (seconds), "page_views" (count), "scroll_depth" (0-100). Example: {"type": "session_metric", "key": "time_on_page", "operator": "gte", "threshold": 30}'),q$=Z.object({type:Z.literal("dismissed"),key:Z.string().describe("Dismissal key (usually a tile or action ID)"),inverted:Z.boolean().optional().describe("When true, fires if NOT dismissed (default behavior)")}).describe("Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed."),H$=Z.object({type:Z.literal("cooldown_active"),key:Z.string().describe("Cooldown key"),inverted:Z.boolean().optional().describe("When true, fires if cooldown is NOT active")}).describe("Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently."),W$=Z.object({type:Z.literal("frequency_limit"),key:Z.string().describe("Frequency counter key"),limit:Z.number().describe("Maximum allowed count"),inverted:Z.boolean().optional().describe("When true, fires if limit NOT reached")}).describe("Checks if a frequency limit has been reached. Use to cap how many times an action fires per session."),V$=Z.object({equals:Z.union([Z.string(),Z.number(),Z.boolean()]).optional(),contains:Z.string().optional()}).describe("Match operator for counter filters. Exactly one of equals or contains must be specified."),G$=Z.object({events:Z.array(N$).min(1).describe("Event names to count. Use values from the countable events enum."),match:Z.record(Z.string(),V$).optional().describe("Property filters. Keys are event prop names or element-chain fields (tag_name, $el_text, attr__*). All entries AND together.")}).describe("Defines what events to count. Registered as an accumulator predicate at config-load time."),Y$=Z.object({type:Z.literal("event_count"),key:Z.string().describe("Unique key for this counter (used for accumulator registration)"),operator:Z.enum(["gte","lte","eq","gt","lt"]),count:Z.number().int().min(0).describe("Target count threshold"),withinMs:Z.number().positive().optional().describe("Time window in ms. Omit = count across entire session."),counter:G$.optional().describe("Inline counter definition. Defines what events to count.")}).describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. Example: {"type": "event_count", "key": "pricing-clicks", "operator": "gte", "count": 3, "counter": {"events": ["ui.click"], "match": {"attr__data-cta": {"contains": "pricing"}}}}'),X$=Z.discriminatedUnion("type",[P$,L$,I$,B$,z$,U$,j$,q$,H$,W$,Y$]),Z$=Z.object({conditions:Z.array(X$).describe("Array of conditions \u2014 ALL must match (AND logic) for this rule to fire."),value:Z.unknown().describe("Value returned when all conditions match. For triggerWhen: true = fire the action.")}).describe("A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated top-to-bottom \u2014 first rule where all conditions match wins and returns its value."),K$=Z.object({type:Z.literal("rules"),rules:Z.array(Z$).describe("Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins."),default:Z.unknown().describe("Fallback value when no rule matches. For triggerWhen: false = do not fire by default.")}).describe("Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match returns its value. If no rule matches, returns default. For triggerWhen: set value=true on matching rules, default=false."),Q$=Z.object({type:Z.literal("score"),field:Z.string(),threshold:Z.number(),above:Z.unknown(),below:Z.unknown()}).describe("Score-based strategy. Compares a field value against a threshold."),J$=Z.object({type:Z.literal("model"),modelId:Z.string(),inputs:Z.array(Z.string()),outputMapping:Z.record(Z.string(),Z.unknown()),default:Z.unknown()}).describe("ML model strategy. Sends inputs to a model and maps outputs."),eP=Z.object({type:Z.literal("external"),endpoint:Z.string(),method:Z.enum(["GET","POST"]).optional(),default:Z.unknown(),timeoutMs:Z.number().optional()}).describe("External API strategy. Calls an endpoint to determine the value."),tP=Z.discriminatedUnion("type",[K$,Q$,J$,eP]),Mne=tP.nullable().optional();var Nne=Z.object({events:Z.array(Z.string()),urlContains:Z.string().optional(),props:Z.record(Z.union([Z.string(),Z.number(),Z.boolean()])).optional()}),One=Z.object({title:Z.string().optional(),body:Z.string().optional(),icon:Z.string().optional()}).nullable().optional();var Uv=globalThis,qv=Uv.ShadowRoot&&(Uv.ShadyCSS===void 0||Uv.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rP=Symbol(),nP=new WeakMap,jv=class{constructor(t,n,r){if(this._$cssResult$=!0,r!==rP)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}get styleSheet(){let t=this.o,n=this.t;if(qv&&t===void 0){let r=n!==void 0&&n.length===1;r&&(t=nP.get(n)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&nP.set(n,t))}return t}toString(){return this.cssText}},iP=e=>new jv(typeof e=="string"?e:e+"",void 0,rP);var oP=(e,t)=>{if(qv)e.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(let n of t){let r=document.createElement("style"),i=Uv.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=n.cssText,e.appendChild(r)}},IS=qv?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let n="";for(let r of t.cssRules)n+=r.cssText;return iP(n)})(e):e;var{is:$ne,defineProperty:Pne,getOwnPropertyDescriptor:Lne,getOwnPropertyNames:Ine,getOwnPropertySymbols:Bne,getPrototypeOf:zne}=Object,ul=globalThis,aP=ul.trustedTypes,Une=aP?aP.emptyScript:"",jne=ul.reactiveElementPolyfillSupport,kg=(e,t)=>e,BS={toAttribute(e,t){switch(t){case Boolean:e=e?Une:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},uP=(e,t)=>!$ne(e,t),sP={attribute:!0,type:String,converter:BS,reflect:!1,useDefault:!1,hasChanged:uP};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ul.litPropertyMetadata??(ul.litPropertyMetadata=new WeakMap);var Zs=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,n=sP){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(t,n),!n.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(t,r,n);i!==void 0&&Pne(this.prototype,t,i)}}static getPropertyDescriptor(t,n,r){let{get:i,set:o}=Lne(this.prototype,t)??{get(){return this[n]},set(a){this[n]=a}};return{get:i,set(a){let s=i?.call(this);o?.call(this,a),this.requestUpdate(t,s,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??sP}static _$Ei(){if(this.hasOwnProperty(kg("elementProperties")))return;let t=zne(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(kg("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(kg("properties"))){let n=this.properties,r=[...Ine(n),...Bne(n)];for(let i of r)this.createProperty(i,n[i])}let t=this[Symbol.metadata];if(t!==null){let n=litPropertyMetadata.get(t);if(n!==void 0)for(let[r,i]of n)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[n,r]of this.elementProperties){let i=this._$Eu(n,r);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let n=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let i of r)n.unshift(IS(i))}else t!==void 0&&n.push(IS(t));return n}static _$Eu(t,n){let r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,n=this.constructor.elementProperties;for(let r of n.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return oP(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,n,r){this._$AK(t,r)}_$ET(t,n){let r=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,r);if(i!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:BS).toAttribute(n,r.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,n){let r=this.constructor,i=r._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=r.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:BS;this._$Em=i;let s=a.fromAttribute(n,o.type);this[i]=s??this._$Ej?.get(i)??s,this._$Em=null}}requestUpdate(t,n,r,i=!1,o){if(t!==void 0){let a=this.constructor;if(i===!1&&(o=this[t]),r??(r=a.getPropertyOptions(t)),!((r.hasChanged??uP)(o,n)||r.useDefault&&r.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(a._$Eu(t,r))))return;this.C(t,n,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,n,{useDefault:r,reflect:i,wrapped:o},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,a??n??this[t]),o!==!0||a!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(n=void 0),this._$AL.set(t,n)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[i,o]of r){let{wrapped:a}=o,s=this[i];a!==!0||this._$AL.has(i)||s===void 0||this.C(i,void 0,o,s)}}let t=!1,n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(n)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(n)}willUpdate(t){}_$AE(t){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(n=>this._$ET(n,this[n]))),this._$EM()}updated(t){}firstUpdated(t){}};Zs.elementStyles=[],Zs.shadowRootOptions={mode:"open"},Zs[kg("elementProperties")]=new Map,Zs[kg("finalized")]=new Map,jne?.({ReactiveElement:Zs}),(ul.reactiveElementVersions??(ul.reactiveElementVersions=[])).push("2.1.2");var Rg=globalThis,lP=e=>e,Hv=Rg.trustedTypes,cP=Hv?Hv.createPolicy("lit-html",{createHTML:e=>e}):void 0,gP="$lit$",ll=`lit$${Math.random().toFixed(9).slice(2)}$`,yP="?"+ll,qne=`<${yP}>`,Qc=document,Mg=()=>Qc.createComment(""),Ng=e=>e===null||typeof e!="object"&&typeof e!="function",VS=Array.isArray,Hne=e=>VS(e)||typeof e?.[Symbol.iterator]=="function",zS=`[
|
|
195
|
+
</svg>`,GTe="chart-wrapper"});var bte='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"',b$={"\u{1F4B5}":['<rect width="20" height="12" x="2" y="6" rx="2"/>','<circle cx="12" cy="12" r="2"/>','<path d="M6 12h.01M18 12h.01"/>'],"\u{1F3DB}\uFE0F":['<line x1="3" x2="21" y1="22" y2="22"/>','<line x1="6" x2="6" y1="18" y2="11"/>','<line x1="10" x2="10" y1="18" y2="11"/>','<line x1="14" x2="14" y1="18" y2="11"/>','<line x1="18" x2="18" y1="18" y2="11"/>','<polygon points="12 2 20 7 4 7"/>'],"\u23ED\uFE0F":['<polygon points="5 4 15 12 5 20 5 4"/>','<line x1="19" x2="19" y1="5" y2="19"/>'],"\u27A1\uFE0F":['<path d="M5 12h14"/>','<path d="m12 5 7 7-7 7"/>'],"\u{1F4A1}":['<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"/>','<path d="M9 18h6"/>','<path d="M10 22h4"/>'],"\u{1F4B0}":['<rect width="20" height="12" x="2" y="6" rx="2"/>','<circle cx="12" cy="12" r="2"/>','<path d="M6 12h.01M18 12h.01"/>'],"\u{1F4CB}":['<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/>','<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>','<path d="M12 11h4"/>','<path d="M12 16h4"/>','<path d="M8 11h.01"/>','<path d="M8 16h.01"/>'],"\u2705":['<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/>','<path d="m9 11 3 3L22 4"/>'],"\u26A0\uFE0F":['<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"/>','<path d="M12 9v4"/>','<path d="M12 17h.01"/>'],"\u{1F6E1}\uFE0F":['<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"/>'],"\u{1F4C8}":['<polyline points="22 7 13.5 15.5 8.5 10.5 2 17"/>','<polyline points="16 7 22 7 22 13"/>'],"\u{1F52C}":['<path d="M6 18h8"/>','<path d="M3 22h18"/>','<path d="M14 22a7 7 0 1 0 0-14h-1"/>','<path d="M9 14h2"/>','<path d="M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z"/>','<path d="M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3"/>'],"\u{1F48A}":['<path d="m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z"/>','<path d="m8.5 8.5 7 7"/>'],"\u{1F4C4}":['<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/>','<path d="M14 2v4a2 2 0 0 0 2 2h4"/>','<path d="M10 9H8"/>','<path d="M16 13H8"/>','<path d="M16 17H8"/>'],"\u{1F9EA}":['<path d="M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2"/>','<path d="M6.453 15h11.094"/>','<path d="M8.5 2h7"/>'],"\u{1F501}":['<path d="m17 2 4 4-4 4"/>','<path d="M3 11v-1a4 4 0 0 1 4-4h14"/>','<path d="m7 22-4-4 4-4"/>','<path d="M21 13v1a4 4 0 0 1-4 4H3"/>'],"\u{1F9E0}":['<path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"/>','<path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"/>','<path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"/>','<path d="M17.599 6.5a3 3 0 0 0 .399-1.375"/>','<path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"/>','<path d="M3.477 10.896a4 4 0 0 1 .585-.396"/>','<path d="M19.938 10.5a4 4 0 0 1 .585.396"/>','<path d="M6 18a4 4 0 0 1-1.967-.516"/>','<path d="M19.967 17.484A4 4 0 0 1 18 18"/>'],"\u{1F319}":['<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>'],"\u{1F4E6}":['<path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 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.73z"/>','<path d="M12 22V12"/>','<path d="m3.3 7 8.7 5 8.7-5"/>','<path d="m7.5 4.27 9 5.15"/>'],"\u{1F69A}":['<path d="M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2"/>','<path d="M15 18H9"/>','<path d="M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14"/>','<circle cx="17" cy="18" r="2"/>','<circle cx="7" cy="18" r="2"/>'],"\u{1F331}":['<path d="M7 20h10"/>','<path d="M10 20c5.5-2.5.8-6.4 3-10"/>','<path d="M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z"/>','<path d="M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z"/>'],"\u26A1":['<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"/>'],"\u{1F525}":['<path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"/>'],"\u{1F333}":['<path d="M12 22V8"/>','<path d="m17 8-5-6-5 6"/>','<path d="M12 12c-2-2-4-2-4-2 0 0 0 4 2 6 1.5 1.5 3 1 4 0"/>','<path d="M12 12c2-2 4-2 4-2 0 0 0 4-2 6-1.5 1.5-3 1-4 0"/>'],"\u{1F33F}":['<path d="M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19.2 2.96a1 1 0 0 1 1.8.5c0 6-2 11-9 16.5"/>','<path d="M2 21c0-3 1.85-5.36 5.08-6"/>'],"\u2753":['<circle cx="12" cy="12" r="10"/>','<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/>','<path d="M12 17h.01"/>'],"\u{1F9ED}":['<circle cx="12" cy="12" r="10"/>','<polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"/>'],"\u{1F4DD}":['<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/>','<polyline points="14 2 14 8 20 8"/>','<line x1="16" y1="13" x2="8" y2="13"/>','<line x1="16" y1="17" x2="8" y2="17"/>','<line x1="10" y1="9" x2="8" y2="9"/>'],"\u{1F3AF}":['<polygon points="12 2 2 7 12 12 22 7 12 2"/>','<polyline points="2 17 12 22 22 17"/>','<polyline points="2 12 12 17 22 12"/>'],"\u{1F3C6}":['<path d="M6 9H4.5a2.5 2.5 0 0 1 0-5H6"/>','<path d="M18 9h1.5a2.5 2.5 0 0 0 0-5H18"/>','<path d="M4 22h16"/>','<path d="M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22"/>','<path d="M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22"/>','<path d="M18 2H6v7a6 6 0 0 0 12 0V2Z"/>'],"\u2728":['<path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/>','<path d="M5 3v4"/>','<path d="M19 17v4"/>','<path d="M3 5h4"/>','<path d="M17 19h4"/>'],"\u{1F4AC}":['<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>'],"\u{1F3AE}":['<line x1="6" y1="11" x2="10" y2="11"/>','<line x1="8" y1="9" x2="8" y2="13"/>','<line x1="15" y1="12" x2="15.01" y2="12"/>','<line x1="18" y1="10" x2="18.01" y2="10"/>','<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"/>'],"\u23F1\uFE0F":['<line x1="10" y1="2" x2="14" y2="2"/>','<line x1="12" y1="14" x2="12" y2="8"/>','<circle cx="12" cy="14" r="8"/>'],"\u{1F4D6}":['<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/>','<path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/>'],"\u{1F514}":['<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/>','<path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/>'],"\u{1F393}":['<path d="M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z"/>','<path d="M22 10v6"/>','<path d="M6 12.5V16a6 3 0 0 0 12 0v-3.5"/>'],"\u23F0":['<circle cx="12" cy="13" r="8"/>','<path d="M12 9v4l2 2"/>','<path d="M5 3 2 6"/>','<path d="m22 6-3-3"/>','<path d="M6.38 18.7 4 21"/>','<path d="M17.64 18.67 20 21"/>'],"\u{1F504}":['<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/>','<path d="M21 3v5h-5"/>','<path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/>','<path d="M8 16H3v5"/>'],"\u{1F464}":['<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>','<circle cx="12" cy="7" r="4"/>'],"\u{1F3E0}":['<path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"/>','<path d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'],"\u{1F6D2}":['<circle cx="8" cy="21" r="1"/>','<circle cx="19" cy="21" r="1"/>','<path d="M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12"/>'],"\u{1F4CA}":['<path d="M3 3v18h18"/>','<path d="M18 17V9"/>','<path d="M13 17V5"/>','<path d="M8 17v-3"/>'],"\u{1F4C9}":['<polyline points="22 17 13.5 8.5 8.5 13.5 2 7"/>','<polyline points="16 17 22 17 22 11"/>'],"\u{1F967}":['<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z"/>','<path d="M21.21 15.89A10 10 0 1 1 8 2.83"/>'],"\u{1F4B9}":['<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.5.5 0 0 1-.96 0L9.24 2.18a.5.5 0 0 0-.96 0l-2.35 8.36A2 2 0 0 1 4.02 12H2"/>'],"\u{1F321}\uFE0F":['<path d="M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z"/>']};function OS(e,t={}){let n=b$[e];if(!n)return"";let r=t.size??14,i=t.color??"currentColor";return`${bte} width="${r}" height="${r}" stroke="${i}">${n.join("")}</svg>`}var Z={};yn(Z,{BRAND:()=>Vte,DIRTY:()=>Oc,EMPTY_PATH:()=>Cte,INVALID:()=>ke,NEVER:()=>Tne,OK:()=>Ar,ParseStatus:()=>nr,Schema:()=>qe,ZodAny:()=>al,ZodArray:()=>Xs,ZodBigInt:()=>Pc,ZodBoolean:()=>Lc,ZodBranded:()=>Fg,ZodCatch:()=>Yc,ZodDate:()=>Ic,ZodDefault:()=>Gc,ZodDiscriminatedUnion:()=>Iv,ZodEffects:()=>mo,ZodEnum:()=>Wc,ZodError:()=>xi,ZodFirstPartyTypeKind:()=>Re,ZodFunction:()=>zv,ZodIntersection:()=>jc,ZodIssueCode:()=>ie,ZodLazy:()=>qc,ZodLiteral:()=>Hc,ZodMap:()=>lp,ZodNaN:()=>fp,ZodNativeEnum:()=>Vc,ZodNever:()=>Xo,ZodNull:()=>zc,ZodNullable:()=>Ya,ZodNumber:()=>$c,ZodObject:()=>vi,ZodOptional:()=>po,ZodParsedType:()=>de,ZodPipeline:()=>Dg,ZodPromise:()=>sl,ZodReadonly:()=>Xc,ZodRecord:()=>Bv,ZodSchema:()=>qe,ZodSet:()=>cp,ZodString:()=>ol,ZodSymbol:()=>sp,ZodTransformer:()=>mo,ZodTuple:()=>Ga,ZodType:()=>qe,ZodUndefined:()=>Bc,ZodUnion:()=>Uc,ZodUnknown:()=>Ys,ZodVoid:()=>up,addIssueToContext:()=>ue,any:()=>tne,array:()=>one,bigint:()=>Zte,boolean:()=>R$,coerce:()=>kne,custom:()=>D$,date:()=>Kte,datetimeRegex:()=>S$,defaultErrorMap:()=>Vs,discriminatedUnion:()=>lne,effect:()=>Ene,enum:()=>xne,function:()=>mne,getErrorMap:()=>ip,getParsedType:()=>Va,instanceof:()=>Yte,intersection:()=>cne,isAborted:()=>Pv,isAsync:()=>op,isDirty:()=>Lv,isValid:()=>il,late:()=>Gte,lazy:()=>gne,literal:()=>yne,makeIssue:()=>Sg,map:()=>pne,nan:()=>Xte,nativeEnum:()=>vne,never:()=>rne,null:()=>ene,nullable:()=>wne,number:()=>T$,object:()=>ane,objectUtil:()=>$S,oboolean:()=>Dne,onumber:()=>Fne,optional:()=>Ane,ostring:()=>Sne,pipeline:()=>_ne,preprocess:()=>Cne,promise:()=>bne,quotelessJson:()=>Ete,record:()=>dne,set:()=>hne,setErrorMap:()=>wte,strictObject:()=>sne,string:()=>k$,symbol:()=>Qte,transformer:()=>Ene,tuple:()=>fne,undefined:()=>Jte,union:()=>une,unknown:()=>nne,util:()=>Ke,void:()=>ine});var Ke;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{let o={};for(let a of i)o[a]=a;return o},e.getValidEnumValues=i=>{let o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(let s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(let a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ke||(Ke={}));var $S;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})($S||($S={}));var de=Ke.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Va=e=>{switch(typeof e){case"undefined":return de.undefined;case"string":return de.string;case"number":return Number.isNaN(e)?de.nan:de.number;case"boolean":return de.boolean;case"function":return de.function;case"bigint":return de.bigint;case"symbol":return de.symbol;case"object":return Array.isArray(e)?de.array:e===null?de.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?de.promise:typeof Map<"u"&&e instanceof Map?de.map:typeof Set<"u"&&e instanceof Set?de.set:typeof Date<"u"&&e instanceof Date?de.date:de.object;default:return de.unknown}};var ie=Ke.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ete=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),xi=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,u=0;for(;u<a.path.length;){let l=a.path[u];u===a.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(n(a))):s[l]=s[l]||{_errors:[]},s=s[l],u++}}};return i(this),r}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ke.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n={},r=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];n[o]=n[o]||[],n[o].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};xi.create=e=>new xi(e);var Ate=(e,t)=>{let n;switch(e.code){case ie.invalid_type:e.received===de.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ie.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ke.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ke.joinValues(e.keys,", ")}`;break;case ie.invalid_union:n="Invalid input";break;case ie.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ke.joinValues(e.options)}`;break;case ie.invalid_enum_value:n=`Invalid enum value. Expected ${Ke.joinValues(e.options)}, received '${e.received}'`;break;case ie.invalid_arguments:n="Invalid function arguments";break;case ie.invalid_return_type:n="Invalid function return type";break;case ie.invalid_date:n="Invalid date";break;case ie.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ke.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ie.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ie.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ie.custom:n="Invalid input";break;case ie.invalid_intersection_types:n="Intersection results could not be merged";break;case ie.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ie.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ke.assertNever(e)}return{message:n}},Vs=Ate;var E$=Vs;function wte(e){E$=e}function ip(){return E$}var Sg=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="",u=r.filter(l=>!!l).slice().reverse();for(let l of u)s=l(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},Cte=[];function ue(e,t){let n=ip(),r=Sg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Vs?void 0:Vs].filter(i=>!!i)});e.common.issues.push(r)}var nr=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let i of n){if(i.status==="aborted")return ke;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let i of n){let o=await i.key,a=await i.value;r.push({key:o,value:a})}return e.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let i of n){let{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return ke;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}},ke=Object.freeze({status:"aborted"}),Oc=e=>({status:"dirty",value:e}),Ar=e=>({status:"valid",value:e}),Pv=e=>e.status==="aborted",Lv=e=>e.status==="dirty",il=e=>e.status==="valid",op=e=>typeof Promise<"u"&&e instanceof Promise;var xe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(xe||(xe={}));var ho=class{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},A$=(e,t)=>{if(il(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new xi(e.common.issues);return this._error=n,this._error}}};function ze(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{let{message:u}=e;return a.code==="invalid_enum_value"?{message:u??s.defaultError}:typeof s.data>"u"?{message:u??r??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:u??n??s.defaultError}},description:i}}var qe=class{get description(){return this._def.description}_getType(t){return Va(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Va(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new nr,ctx:{common:t.parent.common,data:t.data,parsedType:Va(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(op(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Va(t)},i=this._parseSync({data:t,path:r.path,parent:r});return A$(r,i)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Va(t)};if(!this["~standard"].async)try{let r=this._parseSync({data:t,path:[],parent:n});return il(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>il(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Va(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(op(i)?i:Promise.resolve(i));return A$(r,o)}refine(t,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{let a=t(i),s=()=>o.addIssue({code:ie.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new mo({schema:this,typeName:Re.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return po.create(this,this._def)}nullable(){return Ya.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xs.create(this)}promise(){return sl.create(this,this._def)}or(t){return Uc.create([this,t],this._def)}and(t){return jc.create(this,t,this._def)}transform(t){return new mo({...ze(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new Gc({...ze(this._def),innerType:this,defaultValue:n,typeName:Re.ZodDefault})}brand(){return new Fg({typeName:Re.ZodBranded,type:this,...ze(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Yc({...ze(this._def),innerType:this,catchValue:n,typeName:Re.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Dg.create(this,t)}readonly(){return Xc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},_te=/^c[^\s-]{8,}$/i,Ste=/^[0-9a-z]+$/,Fte=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Dte=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,kte=/^[a-z0-9_-]{21}$/i,Tte=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Rte=/^[-+]?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)?)??$/,Mte=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Nte="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",PS,Ote=/^(?:(?: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])$/,$te=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Pte=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Lte=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ite=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Bte=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,C$="((\\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])))",zte=new RegExp(`^${C$}$`);function _$(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Ute(e){return new RegExp(`^${_$(e)}$`)}function S$(e){let t=`${C$}T${_$(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function jte(e,t){return!!((t==="v4"||!t)&&Ote.test(e)||(t==="v6"||!t)&&Pte.test(e))}function qte(e,t){if(!Tte.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function Hte(e,t){return!!((t==="v4"||!t)&&$te.test(e)||(t==="v6"||!t)&&Lte.test(e))}var ol=class e extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==de.string){let o=this._getOrReturnCtx(t);return ue(o,{code:ie.invalid_type,expected:de.string,received:o.parsedType}),ke}let r=new nr,i;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?ue(i,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&ue(i,{code:ie.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Mte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"email",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")PS||(PS=new RegExp(Nte,"u")),PS.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"emoji",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Dte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"uuid",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")kte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"nanoid",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")_te.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"cuid",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Ste.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"cuid2",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Fte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"ulid",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ue(i,{validation:"url",code:ie.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"regex",code:ie.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?S$(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?zte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Ute(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Rte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"duration",code:ie.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?jte(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"ip",code:ie.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?qte(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"jwt",code:ie.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?Hte(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"cidr",code:ie.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?Ite.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"base64",code:ie.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?Bte.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"base64url",code:ie.invalid_string,message:o.message}),r.dirty()):Ke.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:ie.invalid_string,...xe.errToObj(r)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...xe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...xe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...xe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...xe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...xe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...xe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...xe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...xe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...xe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...xe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...xe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...xe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...xe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...xe.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...xe.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...xe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...xe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...xe.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...xe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...xe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...xe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...xe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...xe.errToObj(n)})}nonempty(t){return this.min(1,xe.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};ol.create=e=>new ol({checks:[],typeName:Re.ZodString,coerce:e?.coerce??!1,...ze(e)});function Wte(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return o%a/10**i}var $c=class e extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==de.number){let o=this._getOrReturnCtx(t);return ue(o,{code:ie.invalid_type,expected:de.number,received:o.parsedType}),ke}let r,i=new nr;for(let o of this._def.checks)o.kind==="int"?Ke.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Wte(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.not_finite,message:o.message}),i.dirty()):Ke.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,xe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,xe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,xe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,xe.toString(n))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:xe.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:xe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:xe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:xe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:xe.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ke.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};$c.create=e=>new $c({checks:[],typeName:Re.ZodNumber,coerce:e?.coerce||!1,...ze(e)});var Pc=class e extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==de.bigint)return this._getInvalidInput(t);let r,i=new nr;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ke.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return ue(n,{code:ie.invalid_type,expected:de.bigint,received:n.parsedType}),ke}gte(t,n){return this.setLimit("min",t,!0,xe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,xe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,xe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,xe.toString(n))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:xe.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Pc.create=e=>new Pc({checks:[],typeName:Re.ZodBigInt,coerce:e?.coerce??!1,...ze(e)});var Lc=class extends qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==de.boolean){let r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:de.boolean,received:r.parsedType}),ke}return Ar(t.data)}};Lc.create=e=>new Lc({typeName:Re.ZodBoolean,coerce:e?.coerce||!1,...ze(e)});var Ic=class e extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==de.date){let o=this._getOrReturnCtx(t);return ue(o,{code:ie.invalid_type,expected:de.date,received:o.parsedType}),ke}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return ue(o,{code:ie.invalid_date}),ke}let r=new nr,i;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:ie.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ke.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:xe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:xe.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};Ic.create=e=>new Ic({checks:[],coerce:e?.coerce||!1,typeName:Re.ZodDate,...ze(e)});var sp=class extends qe{_parse(t){if(this._getType(t)!==de.symbol){let r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:de.symbol,received:r.parsedType}),ke}return Ar(t.data)}};sp.create=e=>new sp({typeName:Re.ZodSymbol,...ze(e)});var Bc=class extends qe{_parse(t){if(this._getType(t)!==de.undefined){let r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:de.undefined,received:r.parsedType}),ke}return Ar(t.data)}};Bc.create=e=>new Bc({typeName:Re.ZodUndefined,...ze(e)});var zc=class extends qe{_parse(t){if(this._getType(t)!==de.null){let r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:de.null,received:r.parsedType}),ke}return Ar(t.data)}};zc.create=e=>new zc({typeName:Re.ZodNull,...ze(e)});var al=class extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return Ar(t.data)}};al.create=e=>new al({typeName:Re.ZodAny,...ze(e)});var Ys=class extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ar(t.data)}};Ys.create=e=>new Ys({typeName:Re.ZodUnknown,...ze(e)});var Xo=class extends qe{_parse(t){let n=this._getOrReturnCtx(t);return ue(n,{code:ie.invalid_type,expected:de.never,received:n.parsedType}),ke}};Xo.create=e=>new Xo({typeName:Re.ZodNever,...ze(e)});var up=class extends qe{_parse(t){if(this._getType(t)!==de.undefined){let r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:de.void,received:r.parsedType}),ke}return Ar(t.data)}};up.create=e=>new up({typeName:Re.ZodVoid,...ze(e)});var Xs=class e extends qe{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==de.array)return ue(n,{code:ie.invalid_type,expected:de.array,received:n.parsedType}),ke;if(i.exactLength!==null){let a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&(ue(n,{code:a?ie.too_big:ie.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ue(n,{code:ie.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ue(n,{code:ie.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new ho(n,a,n.path,s)))).then(a=>nr.mergeArray(r,a));let o=[...n.data].map((a,s)=>i.type._parseSync(new ho(n,a,n.path,s)));return nr.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:xe.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:xe.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:xe.toString(n)}})}nonempty(t){return this.min(1,t)}};Xs.create=(e,t)=>new Xs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,...ze(t)});function ap(e){if(e instanceof vi){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=po.create(ap(r))}return new vi({...e._def,shape:()=>t})}else return e instanceof Xs?new Xs({...e._def,type:ap(e.element)}):e instanceof po?po.create(ap(e.unwrap())):e instanceof Ya?Ya.create(ap(e.unwrap())):e instanceof Ga?Ga.create(e.items.map(t=>ap(t))):e}var vi=class e extends qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=Ke.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==de.object){let l=this._getOrReturnCtx(t);return ue(l,{code:ie.invalid_type,expected:de.object,received:l.parsedType}),ke}let{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Xo&&this._def.unknownKeys==="strip"))for(let l in i.data)a.includes(l)||s.push(l);let u=[];for(let l of a){let c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new ho(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Xo){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of s)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")s.length>0&&(ue(i,{code:ie.unrecognized_keys,keys:s}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of s){let f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new ho(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let f=await c.key,d=await c.value;l.push({key:f,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>nr.mergeObjectSync(r,l)):nr.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return xe.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{let i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:xe.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Re.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let r of Ke.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let r of Ke.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new e({...this._def,shape:()=>n})}deepPartial(){return ap(this)}partial(t){let n={};for(let r of Ke.objectKeys(this.shape)){let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let r of Ke.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof po;)o=o._def.innerType;n[r]=o}return new e({...this._def,shape:()=>n})}keyof(){return F$(Ke.objectKeys(this.shape))}};vi.create=(e,t)=>new vi({shape:()=>e,unknownKeys:"strip",catchall:Xo.create(),typeName:Re.ZodObject,...ze(t)});vi.strictCreate=(e,t)=>new vi({shape:()=>e,unknownKeys:"strict",catchall:Xo.create(),typeName:Re.ZodObject,...ze(t)});vi.lazycreate=(e,t)=>new vi({shape:e,unknownKeys:"strip",catchall:Xo.create(),typeName:Re.ZodObject,...ze(t)});var Uc=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new xi(s.ctx.common.issues));return ue(n,{code:ie.invalid_union,unionErrors:a}),ke}if(n.common.async)return Promise.all(r.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o,a=[];for(let u of r){let l={...n,common:{...n.common,issues:[]},parent:null},c=u._parseSync({data:n.data,path:n.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(u=>new xi(u));return ue(n,{code:ie.invalid_union,unionErrors:s}),ke}}get options(){return this._def.options}};Uc.create=(e,t)=>new Uc({options:e,typeName:Re.ZodUnion,...ze(t)});var Gs=e=>e instanceof qc?Gs(e.schema):e instanceof mo?Gs(e.innerType()):e instanceof Hc?[e.value]:e instanceof Wc?e.options:e instanceof Vc?Ke.objectValues(e.enum):e instanceof Gc?Gs(e._def.innerType):e instanceof Bc?[void 0]:e instanceof zc?[null]:e instanceof po?[void 0,...Gs(e.unwrap())]:e instanceof Ya?[null,...Gs(e.unwrap())]:e instanceof Fg||e instanceof Xc?Gs(e.unwrap()):e instanceof Yc?Gs(e._def.innerType):[],Iv=class e extends qe{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==de.object)return ue(n,{code:ie.invalid_type,expected:de.object,received:n.parsedType}),ke;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ue(n,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ke)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let o of n){let a=Gs(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new e({typeName:Re.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...ze(r)})}};function LS(e,t){let n=Va(e),r=Va(t);if(e===t)return{valid:!0,data:e};if(n===de.object&&r===de.object){let i=Ke.objectKeys(t),o=Ke.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(let s of o){let u=LS(e[s],t[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(n===de.array&&r===de.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let o=0;o<e.length;o++){let a=e[o],s=t[o],u=LS(a,s);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return n===de.date&&r===de.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var jc=class extends qe{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(Pv(o)||Pv(a))return ke;let s=LS(o.value,a.value);return s.valid?((Lv(o)||Lv(a))&&n.dirty(),{status:n.value,value:s.data}):(ue(r,{code:ie.invalid_intersection_types}),ke)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};jc.create=(e,t,n)=>new jc({left:e,right:t,typeName:Re.ZodIntersection,...ze(n)});var Ga=class e extends qe{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==de.array)return ue(r,{code:ie.invalid_type,expected:de.array,received:r.parsedType}),ke;if(r.data.length<this._def.items.length)return ue(r,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ke;!this._def.rest&&r.data.length>this._def.items.length&&(ue(r,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...r.data].map((a,s)=>{let u=this._def.items[s]||this._def.rest;return u?u._parse(new ho(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>nr.mergeArray(n,a)):nr.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ga.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ga({items:e,typeName:Re.ZodTuple,rest:null,...ze(t)})};var Bv=class e extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==de.object)return ue(r,{code:ie.invalid_type,expected:de.object,received:r.parsedType}),ke;let i=[],o=this._def.keyType,a=this._def.valueType;for(let s in r.data)i.push({key:o._parse(new ho(r,s,r.path,s)),value:a._parse(new ho(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?nr.mergeObjectAsync(n,i):nr.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof qe?new e({keyType:t,valueType:n,typeName:Re.ZodRecord,...ze(r)}):new e({keyType:ol.create(),valueType:t,typeName:Re.ZodRecord,...ze(n)})}},lp=class extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==de.map)return ue(r,{code:ie.invalid_type,expected:de.map,received:r.parsedType}),ke;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,u],l)=>({key:i._parse(new ho(r,s,r.path,[l,"key"])),value:o._parse(new ho(r,u,r.path,[l,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let u of a){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return ke;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let u of a){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return ke;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}}}};lp.create=(e,t,n)=>new lp({valueType:t,keyType:e,typeName:Re.ZodMap,...ze(n)});var cp=class e extends qe{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==de.set)return ue(r,{code:ie.invalid_type,expected:de.set,received:r.parsedType}),ke;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ue(r,{code:ie.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ue(r,{code:ie.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function a(u){let l=new Set;for(let c of u){if(c.status==="aborted")return ke;c.status==="dirty"&&n.dirty(),l.add(c.value)}return{status:n.value,value:l}}let s=[...r.data.values()].map((u,l)=>o._parse(new ho(r,u,r.path,l)));return r.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(t,n){return new e({...this._def,minSize:{value:t,message:xe.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:xe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};cp.create=(e,t)=>new cp({valueType:e,minSize:null,maxSize:null,typeName:Re.ZodSet,...ze(t)});var zv=class e extends qe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==de.function)return ue(n,{code:ie.invalid_type,expected:de.function,received:n.parsedType}),ke;function r(s,u){return Sg({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ip(),Vs].filter(l=>!!l),issueData:{code:ie.invalid_arguments,argumentsError:u}})}function i(s,u){return Sg({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ip(),Vs].filter(l=>!!l),issueData:{code:ie.invalid_return_type,returnTypeError:u}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof sl){let s=this;return Ar(async function(...u){let l=new xi([]),c=await s._def.args.parseAsync(u,o).catch(p=>{throw l.addIssue(r(u,p)),l}),f=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(f,o).catch(p=>{throw l.addIssue(i(f,p)),l})})}else{let s=this;return Ar(function(...u){let l=s._def.args.safeParse(u,o);if(!l.success)throw new xi([r(u,l.error)]);let c=Reflect.apply(a,this,l.data),f=s._def.returns.safeParse(c,o);if(!f.success)throw new xi([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ga.create(t).rest(Ys.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new e({args:t||Ga.create([]).rest(Ys.create()),returns:n||Ys.create(),typeName:Re.ZodFunction,...ze(r)})}},qc=class extends qe{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};qc.create=(e,t)=>new qc({getter:e,typeName:Re.ZodLazy,...ze(t)});var Hc=class extends qe{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return ue(n,{received:n.data,code:ie.invalid_literal,expected:this._def.value}),ke}return{status:"valid",value:t.data}}get value(){return this._def.value}};Hc.create=(e,t)=>new Hc({value:e,typeName:Re.ZodLiteral,...ze(t)});function F$(e,t){return new Wc({values:e,typeName:Re.ZodEnum,...ze(t)})}var Wc=class e extends qe{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return ue(n,{expected:Ke.joinValues(r),received:n.parsedType,code:ie.invalid_type}),ke}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),r=this._def.values;return ue(n,{received:n.data,code:ie.invalid_enum_value,options:r}),ke}return Ar(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}};Wc.create=F$;var Vc=class extends qe{_parse(t){let n=Ke.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==de.string&&r.parsedType!==de.number){let i=Ke.objectValues(n);return ue(r,{expected:Ke.joinValues(i),received:r.parsedType,code:ie.invalid_type}),ke}if(this._cache||(this._cache=new Set(Ke.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=Ke.objectValues(n);return ue(r,{received:r.data,code:ie.invalid_enum_value,options:i}),ke}return Ar(t.data)}get enum(){return this._def.values}};Vc.create=(e,t)=>new Vc({values:e,typeName:Re.ZodNativeEnum,...ze(t)});var sl=class extends qe{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==de.promise&&n.common.async===!1)return ue(n,{code:ie.invalid_type,expected:de.promise,received:n.parsedType}),ke;let r=n.parsedType===de.promise?n.data:Promise.resolve(n.data);return Ar(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};sl.create=(e,t)=>new sl({type:e,typeName:Re.ZodPromise,...ze(t)});var mo=class extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{ue(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let a=i.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return ke;let u=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return u.status==="aborted"?ke:u.status==="dirty"?Oc(u.value):n.value==="dirty"?Oc(u.value):u});{if(n.value==="aborted")return ke;let s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?ke:s.status==="dirty"?Oc(s.value):n.value==="dirty"?Oc(s.value):s}}if(i.type==="refinement"){let a=s=>{let u=i.refinement(s,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ke:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?ke:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!il(a))return ke;let s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>il(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):ke);Ke.assertNever(i)}};mo.create=(e,t,n)=>new mo({schema:e,typeName:Re.ZodEffects,effect:t,...ze(n)});mo.createWithPreprocess=(e,t,n)=>new mo({schema:t,effect:{type:"preprocess",transform:e},typeName:Re.ZodEffects,...ze(n)});var po=class extends qe{_parse(t){return this._getType(t)===de.undefined?Ar(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};po.create=(e,t)=>new po({innerType:e,typeName:Re.ZodOptional,...ze(t)});var Ya=class extends qe{_parse(t){return this._getType(t)===de.null?Ar(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ya.create=(e,t)=>new Ya({innerType:e,typeName:Re.ZodNullable,...ze(t)});var Gc=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===de.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Gc.create=(e,t)=>new Gc({innerType:e,typeName:Re.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ze(t)});var Yc=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return op(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new xi(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new xi(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Yc.create=(e,t)=>new Yc({innerType:e,typeName:Re.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ze(t)});var fp=class extends qe{_parse(t){if(this._getType(t)!==de.nan){let r=this._getOrReturnCtx(t);return ue(r,{code:ie.invalid_type,expected:de.nan,received:r.parsedType}),ke}return{status:"valid",value:t.data}}};fp.create=e=>new fp({typeName:Re.ZodNaN,...ze(e)});var Vte=Symbol("zod_brand"),Fg=class extends qe{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Dg=class e extends qe{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ke:o.status==="dirty"?(n.dirty(),Oc(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ke:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new e({in:t,out:n,typeName:Re.ZodPipeline})}},Xc=class extends qe{_parse(t){let n=this._def.innerType._parse(t),r=i=>(il(i)&&(i.value=Object.freeze(i.value)),i);return op(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};Xc.create=(e,t)=>new Xc({innerType:e,typeName:Re.ZodReadonly,...ze(t)});function w$(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function D$(e,t={},n){return e?al.create().superRefine((r,i)=>{let o=e(r);if(o instanceof Promise)return o.then(a=>{if(!a){let s=w$(t,r),u=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:u})}});if(!o){let a=w$(t,r),s=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:s})}}):al.create()}var Gte={object:vi.lazycreate},Re;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Re||(Re={}));var Yte=(e,t={message:`Input not instance of ${e.name}`})=>D$(n=>n instanceof e,t),k$=ol.create,T$=$c.create,Xte=fp.create,Zte=Pc.create,R$=Lc.create,Kte=Ic.create,Qte=sp.create,Jte=Bc.create,ene=zc.create,tne=al.create,nne=Ys.create,rne=Xo.create,ine=up.create,one=Xs.create,ane=vi.create,sne=vi.strictCreate,une=Uc.create,lne=Iv.create,cne=jc.create,fne=Ga.create,dne=Bv.create,pne=lp.create,hne=cp.create,mne=zv.create,gne=qc.create,yne=Hc.create,xne=Wc.create,vne=Vc.create,bne=sl.create,Ene=mo.create,Ane=po.create,wne=Ya.create,Cne=mo.createWithPreprocess,_ne=Dg.create,Sne=()=>k$().optional(),Fne=()=>T$().optional(),Dne=()=>R$().optional(),kne={string:(e=>ol.create({...e,coerce:!0})),number:(e=>$c.create({...e,coerce:!0})),boolean:(e=>Lc.create({...e,coerce:!0})),bigint:(e=>Pc.create({...e,coerce:!0})),date:(e=>Ic.create({...e,coerce:!0}))};var Tne=ke;var Rne=Z.object({selector:Z.string(),route:Z.union([Z.string(),Z.array(Z.string())])}).strict(),M$=["ui.click","ui.scroll","ui.input","ui.change","ui.submit","ui.hover","ui.idle","ui.scroll_thrash","ui.focus_bounce","nav.page_view","nav.page_leave","behavior.rage_click","behavior.hesitation","behavior.confusion"],N$=Z.enum(M$).describe("Event name to count. ui.* = user interactions and behavioral detectors, nav.* = page navigation, behavior.* = derived behavioral signals."),O$=["time_on_page","page_views","scroll_depth"],$$=Z.enum(O$).describe("Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.");var P$=Z.object({type:Z.literal("page_url"),url:Z.string().describe('URL path to match (e.g. "/pricing", "/dashboard")')}).describe('Fires when the current page URL matches. Use for page-specific actions. Example: {"type": "page_url", "url": "/pricing"}'),L$=Z.object({type:Z.literal("route"),routeId:Z.string().describe("Named route ID from the route filter")}).describe("Fires when the current route matches a named route ID."),I$=Z.object({type:Z.literal("anchor_visible"),anchorId:Z.string().describe("CSS selector of the anchor element"),state:Z.enum(["visible","present","absent"]).describe('"visible" = in viewport, "present" = in DOM, "absent" = not in DOM')}).describe(`Fires based on a DOM element's visibility state. Example: {"type": "anchor_visible", "anchorId": "#cta-button", "state": "visible"}`),B$=Z.object({type:Z.literal("event_occurred"),eventName:Z.string().describe('Event name (e.g. "ui.click", "$pageview")'),withinMs:Z.number().optional().describe("Time window in ms. Omit = any time this session.")}).describe('Fires when a specific event has occurred during this session. Example: {"type": "event_occurred", "eventName": "ui.click", "withinMs": 5000}'),z$=Z.object({type:Z.literal("state_equals"),key:Z.string().describe("Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set()."),value:Z.unknown().describe("Expected value to match against")}).describe("Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type."),U$=Z.object({type:Z.literal("viewport"),minWidth:Z.number().optional().describe("Minimum viewport width in pixels"),maxWidth:Z.number().optional().describe("Maximum viewport width in pixels"),minHeight:Z.number().optional().describe("Minimum viewport height in pixels"),maxHeight:Z.number().optional().describe("Maximum viewport height in pixels")}).describe('Fires based on viewport (screen) size. Use for responsive behavior. Example: {"type": "viewport", "minWidth": 768} \u2014 fires on tablet and larger.'),j$=Z.object({type:Z.literal("session_metric"),key:$$,operator:Z.enum(["gte","lte","eq","gt","lt"]),threshold:Z.number().describe("Numeric threshold to compare against")}).describe('Fires when a session metric crosses a threshold. Valid keys: "time_on_page" (seconds), "page_views" (count), "scroll_depth" (0-100). Example: {"type": "session_metric", "key": "time_on_page", "operator": "gte", "threshold": 30}'),q$=Z.object({type:Z.literal("dismissed"),key:Z.string().describe("Dismissal key (usually a tile or action ID)"),inverted:Z.boolean().optional().describe("When true, fires if NOT dismissed (default behavior)")}).describe("Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed."),H$=Z.object({type:Z.literal("cooldown_active"),key:Z.string().describe("Cooldown key"),inverted:Z.boolean().optional().describe("When true, fires if cooldown is NOT active")}).describe("Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently."),W$=Z.object({type:Z.literal("frequency_limit"),key:Z.string().describe("Frequency counter key"),limit:Z.number().describe("Maximum allowed count"),inverted:Z.boolean().optional().describe("When true, fires if limit NOT reached")}).describe("Checks if a frequency limit has been reached. Use to cap how many times an action fires per session."),V$=Z.object({equals:Z.union([Z.string(),Z.number(),Z.boolean()]).optional(),contains:Z.string().optional()}).describe("Match operator for counter filters. Exactly one of equals or contains must be specified."),G$=Z.object({events:Z.array(N$).min(1).describe("Event names to count. Use values from the countable events enum."),match:Z.record(Z.string(),V$).optional().describe("Property filters. Keys are event prop names or element-chain fields (tag_name, $el_text, attr__*). All entries AND together.")}).describe("Defines what events to count. Registered as an accumulator predicate at config-load time."),Y$=Z.object({type:Z.literal("event_count"),key:Z.string().describe("Unique key for this counter (used for accumulator registration)"),operator:Z.enum(["gte","lte","eq","gt","lt"]),count:Z.number().int().min(0).describe("Target count threshold"),withinMs:Z.number().positive().optional().describe("Time window in ms. Omit = count across entire session."),counter:G$.optional().describe("Inline counter definition. Defines what events to count.")}).describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. Example: {"type": "event_count", "key": "pricing-clicks", "operator": "gte", "count": 3, "counter": {"events": ["ui.click"], "match": {"attr__data-cta": {"contains": "pricing"}}}}'),X$=Z.discriminatedUnion("type",[P$,L$,I$,B$,z$,U$,j$,q$,H$,W$,Y$]),Z$=Z.object({conditions:Z.array(X$).describe("Array of conditions \u2014 ALL must match (AND logic) for this rule to fire."),value:Z.unknown().describe("Value returned when all conditions match. For triggerWhen: true = fire the action.")}).describe("A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated top-to-bottom \u2014 first rule where all conditions match wins and returns its value."),K$=Z.object({type:Z.literal("rules"),rules:Z.array(Z$).describe("Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins."),default:Z.unknown().describe("Fallback value when no rule matches. For triggerWhen: false = do not fire by default.")}).describe("Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match returns its value. If no rule matches, returns default. For triggerWhen: set value=true on matching rules, default=false."),Q$=Z.object({type:Z.literal("score"),field:Z.string(),threshold:Z.number(),above:Z.unknown(),below:Z.unknown()}).describe("Score-based strategy. Compares a field value against a threshold."),J$=Z.object({type:Z.literal("model"),modelId:Z.string(),inputs:Z.array(Z.string()),outputMapping:Z.record(Z.string(),Z.unknown()),default:Z.unknown()}).describe("ML model strategy. Sends inputs to a model and maps outputs."),eP=Z.object({type:Z.literal("external"),endpoint:Z.string(),method:Z.enum(["GET","POST"]).optional(),default:Z.unknown(),timeoutMs:Z.number().optional()}).describe("External API strategy. Calls an endpoint to determine the value."),tP=Z.discriminatedUnion("type",[K$,Q$,J$,eP]),Mne=tP.nullable().optional();var Nne=Z.object({events:Z.array(Z.string()),urlContains:Z.string().optional(),props:Z.record(Z.union([Z.string(),Z.number(),Z.boolean()])).optional()}),One=Z.object({title:Z.string().optional(),body:Z.string().optional(),icon:Z.string().optional()}).nullable().optional();var Uv=globalThis,qv=Uv.ShadowRoot&&(Uv.ShadyCSS===void 0||Uv.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rP=Symbol(),nP=new WeakMap,jv=class{constructor(t,n,r){if(this._$cssResult$=!0,r!==rP)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}get styleSheet(){let t=this.o,n=this.t;if(qv&&t===void 0){let r=n!==void 0&&n.length===1;r&&(t=nP.get(n)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&nP.set(n,t))}return t}toString(){return this.cssText}},iP=e=>new jv(typeof e=="string"?e:e+"",void 0,rP);var oP=(e,t)=>{if(qv)e.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(let n of t){let r=document.createElement("style"),i=Uv.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=n.cssText,e.appendChild(r)}},IS=qv?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let n="";for(let r of t.cssRules)n+=r.cssText;return iP(n)})(e):e;var{is:$ne,defineProperty:Pne,getOwnPropertyDescriptor:Lne,getOwnPropertyNames:Ine,getOwnPropertySymbols:Bne,getPrototypeOf:zne}=Object,ul=globalThis,aP=ul.trustedTypes,Une=aP?aP.emptyScript:"",jne=ul.reactiveElementPolyfillSupport,kg=(e,t)=>e,BS={toAttribute(e,t){switch(t){case Boolean:e=e?Une:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},uP=(e,t)=>!$ne(e,t),sP={attribute:!0,type:String,converter:BS,reflect:!1,useDefault:!1,hasChanged:uP};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ul.litPropertyMetadata??(ul.litPropertyMetadata=new WeakMap);var Zs=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,n=sP){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(t,n),!n.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(t,r,n);i!==void 0&&Pne(this.prototype,t,i)}}static getPropertyDescriptor(t,n,r){let{get:i,set:o}=Lne(this.prototype,t)??{get(){return this[n]},set(a){this[n]=a}};return{get:i,set(a){let s=i?.call(this);o?.call(this,a),this.requestUpdate(t,s,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??sP}static _$Ei(){if(this.hasOwnProperty(kg("elementProperties")))return;let t=zne(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(kg("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(kg("properties"))){let n=this.properties,r=[...Ine(n),...Bne(n)];for(let i of r)this.createProperty(i,n[i])}let t=this[Symbol.metadata];if(t!==null){let n=litPropertyMetadata.get(t);if(n!==void 0)for(let[r,i]of n)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[n,r]of this.elementProperties){let i=this._$Eu(n,r);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let n=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let i of r)n.unshift(IS(i))}else t!==void 0&&n.push(IS(t));return n}static _$Eu(t,n){let r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,n=this.constructor.elementProperties;for(let r of n.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return oP(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,n,r){this._$AK(t,r)}_$ET(t,n){let r=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,r);if(i!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:BS).toAttribute(n,r.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,n){let r=this.constructor,i=r._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=r.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:BS;this._$Em=i;let s=a.fromAttribute(n,o.type);this[i]=s??this._$Ej?.get(i)??s,this._$Em=null}}requestUpdate(t,n,r,i=!1,o){if(t!==void 0){let a=this.constructor;if(i===!1&&(o=this[t]),r??(r=a.getPropertyOptions(t)),!((r.hasChanged??uP)(o,n)||r.useDefault&&r.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(a._$Eu(t,r))))return;this.C(t,n,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,n,{useDefault:r,reflect:i,wrapped:o},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,a??n??this[t]),o!==!0||a!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(n=void 0),this._$AL.set(t,n)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[i,o]of r){let{wrapped:a}=o,s=this[i];a!==!0||this._$AL.has(i)||s===void 0||this.C(i,void 0,o,s)}}let t=!1,n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(n)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(n)}willUpdate(t){}_$AE(t){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(n=>this._$ET(n,this[n]))),this._$EM()}updated(t){}firstUpdated(t){}};Zs.elementStyles=[],Zs.shadowRootOptions={mode:"open"},Zs[kg("elementProperties")]=new Map,Zs[kg("finalized")]=new Map,jne?.({ReactiveElement:Zs}),(ul.reactiveElementVersions??(ul.reactiveElementVersions=[])).push("2.1.2");var Rg=globalThis,lP=e=>e,Hv=Rg.trustedTypes,cP=Hv?Hv.createPolicy("lit-html",{createHTML:e=>e}):void 0,gP="$lit$",ll=`lit$${Math.random().toFixed(9).slice(2)}$`,yP="?"+ll,qne=`<${yP}>`,Qc=document,Mg=()=>Qc.createComment(""),Ng=e=>e===null||typeof e!="object"&&typeof e!="function",VS=Array.isArray,Hne=e=>VS(e)||typeof e?.[Symbol.iterator]=="function",zS=`[
|
|
196
196
|
\f\r]`,Tg=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,fP=/-->/g,dP=/>/g,Zc=RegExp(`>|${zS}(?:([^\\s"'>=/]+)(${zS}*=${zS}*(?:[^
|
|
197
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),pP=/'/g,hP=/"/g,xP=/^(?:script|style|textarea|title)$/i,GS=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),vP=GS(1),j3e=GS(2),q3e=GS(3),Jc=Symbol.for("lit-noChange"),In=Symbol.for("lit-nothing"),mP=new WeakMap,Kc=Qc.createTreeWalker(Qc,129);function bP(e,t){if(!VS(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return cP!==void 0?cP.createHTML(t):t}var Wne=(e,t)=>{let n=e.length-1,r=[],i,o=t===2?"<svg>":t===3?"<math>":"",a=Tg;for(let s=0;s<n;s++){let u=e[s],l,c,f=-1,d=0;for(;d<u.length&&(a.lastIndex=d,c=a.exec(u),c!==null);)d=a.lastIndex,a===Tg?c[1]==="!--"?a=fP:c[1]!==void 0?a=dP:c[2]!==void 0?(xP.test(c[2])&&(i=RegExp("</"+c[2],"g")),a=Zc):c[3]!==void 0&&(a=Zc):a===Zc?c[0]===">"?(a=i??Tg,f=-1):c[1]===void 0?f=-2:(f=a.lastIndex-c[2].length,l=c[1],a=c[3]===void 0?Zc:c[3]==='"'?hP:pP):a===hP||a===pP?a=Zc:a===fP||a===dP?a=Tg:(a=Zc,i=void 0);let p=a===Zc&&e[s+1].startsWith("/>")?" ":"";o+=a===Tg?u+qne:f>=0?(r.push(l),u.slice(0,f)+gP+u.slice(f)+ll+p):u+ll+(f===-2?s:p)}return[bP(e,o+(e[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},Og=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let o=0,a=0,s=t.length-1,u=this.parts,[l,c]=Wne(t,n);if(this.el=e.createElement(l,r),Kc.currentNode=this.el.content,n===2||n===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=Kc.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let f of i.getAttributeNames())if(f.endsWith(gP)){let d=c[a++],p=i.getAttribute(f).split(ll),h=/([.?@])?(.*)/.exec(d);u.push({type:1,index:o,name:h[2],strings:p,ctor:h[1]==="."?jS:h[1]==="?"?qS:h[1]==="@"?HS:pp}),i.removeAttribute(f)}else f.startsWith(ll)&&(u.push({type:6,index:o}),i.removeAttribute(f));if(xP.test(i.tagName)){let f=i.textContent.split(ll),d=f.length-1;if(d>0){i.textContent=Hv?Hv.emptyScript:"";for(let p=0;p<d;p++)i.append(f[p],Mg()),Kc.nextNode(),u.push({type:2,index:++o});i.append(f[d],Mg())}}}else if(i.nodeType===8)if(i.data===yP)u.push({type:2,index:o});else{let f=-1;for(;(f=i.data.indexOf(ll,f+1))!==-1;)u.push({type:7,index:o}),f+=ll.length-1}o++}}static createElement(t,n){let r=Qc.createElement("template");return r.innerHTML=t,r}};function dp(e,t,n=e,r){if(t===Jc)return t;let i=r!==void 0?n._$Co?.[r]:n._$Cl,o=Ng(t)?void 0:t._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(e),i._$AT(e,n,r)),r!==void 0?(n._$Co??(n._$Co=[]))[r]=i:n._$Cl=i),i!==void 0&&(t=dp(e,i._$AS(e,t.values),i,r)),t}var US=class{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:n},parts:r}=this._$AD,i=(t?.creationScope??Qc).importNode(n,!0);Kc.currentNode=i;let o=Kc.nextNode(),a=0,s=0,u=r[0];for(;u!==void 0;){if(a===u.index){let l;u.type===2?l=new $g(o,o.nextSibling,this,t):u.type===1?l=new u.ctor(o,u.name,u.strings,this,t):u.type===6&&(l=new WS(o,this,t)),this._$AV.push(l),u=r[++s]}a!==u?.index&&(o=Kc.nextNode(),a++)}return Kc.currentNode=Qc,i}p(t){let n=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,n),n+=r.strings.length-2):r._$AI(t[n])),n++}},$g=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,n,r,i){this.type=2,this._$AH=In,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,n=this._$AM;return n!==void 0&&t?.nodeType===11&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){t=dp(this,t,n),Ng(t)?t===In||t==null||t===""?(this._$AH!==In&&this._$AR(),this._$AH=In):t!==this._$AH&&t!==Jc&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Hne(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==In&&Ng(this._$AH)?this._$AA.nextSibling.data=t:this.T(Qc.createTextNode(t)),this._$AH=t}$(t){let{values:n,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Og.createElement(bP(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(n);else{let o=new US(i,this),a=o.u(this.options);o.p(n),this.T(a),this._$AH=o}}_$AC(t){let n=mP.get(t.strings);return n===void 0&&mP.set(t.strings,n=new Og(t)),n}k(t){VS(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let o of t)i===n.length?n.push(r=new e(this.O(Mg()),this.O(Mg()),this,this.options)):r=n[i],r._$AI(o),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(t=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);t!==this._$AB;){let r=lP(t).nextSibling;lP(t).remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},pp=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,r,i,o){this.type=1,this._$AH=In,this._$AN=void 0,this.element=t,this.name=n,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=In}_$AI(t,n=this,r,i){let o=this.strings,a=!1;if(o===void 0)t=dp(this,t,n,0),a=!Ng(t)||t!==this._$AH&&t!==Jc,a&&(this._$AH=t);else{let s=t,u,l;for(t=o[0],u=0;u<o.length-1;u++)l=dp(this,s[r+u],n,u),l===Jc&&(l=this._$AH[u]),a||(a=!Ng(l)||l!==this._$AH[u]),l===In?t=In:t!==In&&(t+=(l??"")+o[u+1]),this._$AH[u]=l}a&&!i&&this.j(t)}j(t){t===In?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},jS=class extends pp{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===In?void 0:t}},qS=class extends pp{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==In)}},HS=class extends pp{constructor(t,n,r,i,o){super(t,n,r,i,o),this.type=5}_$AI(t,n=this){if((t=dp(this,t,n,0)??In)===Jc)return;let r=this._$AH,i=t===In&&r!==In||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==In&&(r===In||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},WS=class{constructor(t,n,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){dp(this,t)}};var Vne=Rg.litHtmlPolyfillSupport;Vne?.(Og,$g),(Rg.litHtmlVersions??(Rg.litHtmlVersions=[])).push("3.3.2");var EP=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let o=n?.renderBefore??null;r._$litPart$=i=new $g(t.insertBefore(Mg(),o),o,void 0,n??{})}return i._$AI(e),i};var Pg=globalThis,cl=class extends Zs{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var n;let t=super.createRenderRoot();return(n=this.renderOptions).renderBefore??(n.renderBefore=t.firstChild),t}update(t){let n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=EP(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Jc}};cl._$litElement$=!0,cl.finalized=!0,Pg.litElementHydrateSupport?.({LitElement:cl});var Gne=Pg.litElementPolyfillSupport;Gne?.({LitElement:cl});(Pg.litElementVersions??(Pg.litElementVersions=[])).push("4.2.2");var Yne="https://vega.github.io/schema/vega-lite/v5.json";function YS(e){let t={x:{field:e.xField,type:"nominal"},y:{field:e.yField,type:"quantitative"}};e.colorField&&(t.color={field:e.colorField,type:"nominal"});let n={$schema:Yne,data:{values:e.data},mark:"bar",encoding:t};return e.title&&(n.title=e.title),n}var Xne="https://vega.github.io/schema/vega-lite/v5.json";function XS(e){let t={x:{field:e.xField,type:"quantitative"},y:{field:e.yField,type:"quantitative"}};e.seriesField&&(t.color={field:e.seriesField,type:"nominal"});let n={$schema:Xne,data:{values:e.data},mark:"line",encoding:t};return e.title&&(n.title=e.title),n}var Zne="https://vega.github.io/schema/vega-lite/v5.json";function ZS(e){let t={type:"arc"};typeof e.innerRadius=="number"&&(t.innerRadius=e.innerRadius);let n={$schema:Zne,data:{values:e.data},mark:t,encoding:{theta:{field:e.valueField,type:"quantitative"},color:{field:e.categoryField,type:"nominal"},tooltip:[{field:e.categoryField,type:"nominal"},{field:e.valueField,type:"quantitative"}]}};return e.title&&(n.title=e.title),n}var Kne="https://vega.github.io/schema/vega-lite/v5.json";function KS(e){let t=e.columns.map((i,o)=>({mark:{type:"text",align:"left",baseline:"middle"},encoding:{x:{value:o*120},y:{field:"_row",type:"ordinal",axis:null},text:{field:i.field}}})),n=e.data.map((i,o)=>({...i,_row:o})),r={$schema:Kne,data:{values:n},layer:t};return e.title&&(r.title=e.title),r}function AP(e){switch(e.layout){case"bar":return YS(e);case"line":return XS(e);case"table":return KS(e);case"pie":return ZS(e);default:{let t=e;throw new Error(`Unknown chart layout: ${e.layout??"undefined"}`)}}}function Wv(e,t){let n=e.getPropertyValue(t).trim();return n.length>0?n:void 0}function wP(e){let t=getComputedStyle(e),n=Wv(t,"--sc-color-primary"),r=Wv(t,"--sc-font-family"),i=Wv(t,"--sc-overlay-text-color"),o=Wv(t,"--sc-tile-background"),a={};return n&&(a.mark={color:n}),r&&(a.title={font:r},a.axis={labelFont:r,titleFont:r},a.legend={labelFont:r,titleFont:r}),i&&(a.axis={...a.axis??{},labelColor:i,titleColor:i},a.legend={...a.legend??{},labelColor:i,titleColor:i},a.title={...a.title??{},color:i}),o&&(a.background=o),a}var nl,ute,lte,g$,Ov=class extends cl{constructor(){super(...arguments);v$(this,nl);this.chartProps=void 0}createRenderRoot(){return this}async updated(n){n.has("chartProps")&&await _g(this,nl,ute).call(this)}render(){return vP`<div data-syntro-viz-chart-container style="width:100%; min-height:200px;"></div>`}};nl=new WeakSet,ute=async function(){let n=this.querySelector("[data-syntro-viz-chart-container]");if(!n)return;if(!this.chartProps){n.textContent="(no chart configured)";return}if(this.chartProps.layout==="table"){_g(this,nl,lte).call(this,n,this.chartProps);return}let r;try{r=AP(this.chartProps)}catch(o){n.textContent=`Chart error: ${o.message}`;return}let i=wP(this);try{let{default:o}=await Promise.resolve().then(()=>(ste(),ate));await o(n,r,{actions:!1,config:i,renderer:"svg",ast:!0})}catch(o){n.textContent=`Chart render error: ${o.message}`}},lte=function(n,r){if(n.innerHTML="",n.style.minHeight="0",r.title){let u=document.createElement("div");u.style.cssText="font-weight:600;font-size:14px;margin-bottom:8px;color:var(--syntro-text-color, currentColor);",u.textContent=r.title,n.appendChild(u)}let i=document.createElement("table");i.style.cssText="width:100%;border-collapse:collapse;font-size:13px;color:var(--syntro-text-color, currentColor);";let o=document.createElement("thead"),a=document.createElement("tr");for(let u of r.columns){let l=document.createElement("th");l.textContent=u.header,l.style.cssText="text-align:left;padding:6px 8px;font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:0.04em;opacity:0.7;border-bottom:1px solid var(--syntro-border-color, rgba(255,255,255,0.12));",a.appendChild(l)}o.appendChild(a),i.appendChild(o);let s=document.createElement("tbody");for(let u of r.data){let l=document.createElement("tr");for(let c of r.columns)l.appendChild(_g(this,nl,g$).call(this,c,u));s.appendChild(l)}if(i.appendChild(s),r.footer){let u=document.createElement("tfoot"),l=document.createElement("tr");r.columns.forEach((c,f)=>{if(f===0){let d=document.createElement("td");d.textContent=r.footer?.label??"",d.style.cssText="padding:8px;border-top:2px solid var(--syntro-border-color, rgba(255,255,255,0.18));font-weight:600;",l.appendChild(d)}else{let d=r.footer?.values??{},p=_g(this,nl,g$).call(this,c,d);p.style.borderTop="2px solid var(--syntro-border-color, rgba(255,255,255,0.18))",p.style.borderBottom="none",p.style.fontWeight="600",l.appendChild(p)}}),u.appendChild(l),i.appendChild(u)}n.appendChild(i)},g$=function(n,r){let i=document.createElement("td");i.style.cssText="padding:6px 8px;border-bottom:1px solid var(--syntro-border-color, rgba(255,255,255,0.06));vertical-align:middle;word-break:break-word;";let o=r[n.field],a=n.kind??"text";if(a==="bar"){let s=n.kind==="bar"&&n.max!==void 0?n.max:100,u=n.kind==="bar"&&n.suffix!==void 0?n.suffix:"%",l=n.kind==="bar"?n.colorField:void 0,c=typeof o=="number"?o:Number.parseFloat(String(o??""));if(Number.isFinite(c)){let f=Math.max(0,Math.min(100,c/s*100)),d=l?String(r[l]??"var(--syntro-accent-color, #4a9a8a)"):"var(--syntro-accent-color, #4a9a8a)",p=document.createElement("div");p.dataset.barWrapper="",p.style.cssText="display:flex;align-items:center;gap:6px;min-width:70px;";let h=document.createElement("span");h.dataset.barLabel="",h.textContent=`${c}${u}`,h.style.cssText="font-variant-numeric:tabular-nums;min-width:32px;font-size:12px;",p.appendChild(h);let m=document.createElement("div");m.dataset.barTrack="",m.style.cssText="flex:1;height:6px;border-radius:3px;background:var(--syntro-border-color, rgba(255,255,255,0.08));overflow:hidden;";let g=document.createElement("div");g.dataset.barFill="",g.style.cssText="height:100%;border-radius:3px;",g.style.width=`${f}%`,g.style.background=d,m.appendChild(g),p.appendChild(m),i.appendChild(p)}else i.textContent="";return i}if(a==="icon"){let s=typeof o=="string"?o:"",u=OS(s,{size:16});return u?i.innerHTML=u:i.textContent=s,i}if(a==="colorDot"){let s=typeof o=="string"?o:"transparent",u=document.createElement("span");return u.style.cssText="display:inline-block;width:10px;height:10px;border-radius:50%;",u.style.background=s,i.appendChild(u),i}return i.textContent=o==null?"":String(o),i},Ov.properties={chartProps:{attribute:!1}};var y$="syntro-viz-chart";typeof customElements<"u"&&!customElements.get(y$)&&customElements.define(y$,Ov);var JTe={mount(e,t){let{instanceId:n,...r}=t??{},i=document.createElement(y$);return i.chartProps=r,e.appendChild(i),()=>i.remove()}},rp={id:"adaptive-viz",version:"1.0.0",name:"Chart",description:"Vega-Lite-backed data visualization tile with baked layouts (bar, line, table) plus a custom escape hatch.",executors:[],widgets:[{id:"adaptive-viz:chart",component:JTe,metadata:{name:"Chart",description:"Bar / line / table / custom Vega-Lite chart",icon:"\u{1F4CA}"}}]};var cte={id:rp.id,version:rp.version,name:rp.name,description:rp.description,runtime:{actions:(rp.executors||[]).map(({kind:e,executor:t})=>({kind:e,executor:t})),widgets:rp.widgets},metadata:{isBuiltIn:!1}};if(typeof window<"u"){let e=window.SynOS;e?.appRegistry?.register&&e.appRegistry.register(cte)}var Igt=cte;})();
|
|
197
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),pP=/'/g,hP=/"/g,xP=/^(?:script|style|textarea|title)$/i,GS=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),vP=GS(1),j3e=GS(2),q3e=GS(3),Jc=Symbol.for("lit-noChange"),In=Symbol.for("lit-nothing"),mP=new WeakMap,Kc=Qc.createTreeWalker(Qc,129);function bP(e,t){if(!VS(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return cP!==void 0?cP.createHTML(t):t}var Wne=(e,t)=>{let n=e.length-1,r=[],i,o=t===2?"<svg>":t===3?"<math>":"",a=Tg;for(let s=0;s<n;s++){let u=e[s],l,c,f=-1,d=0;for(;d<u.length&&(a.lastIndex=d,c=a.exec(u),c!==null);)d=a.lastIndex,a===Tg?c[1]==="!--"?a=fP:c[1]!==void 0?a=dP:c[2]!==void 0?(xP.test(c[2])&&(i=RegExp("</"+c[2],"g")),a=Zc):c[3]!==void 0&&(a=Zc):a===Zc?c[0]===">"?(a=i??Tg,f=-1):c[1]===void 0?f=-2:(f=a.lastIndex-c[2].length,l=c[1],a=c[3]===void 0?Zc:c[3]==='"'?hP:pP):a===hP||a===pP?a=Zc:a===fP||a===dP?a=Tg:(a=Zc,i=void 0);let p=a===Zc&&e[s+1].startsWith("/>")?" ":"";o+=a===Tg?u+qne:f>=0?(r.push(l),u.slice(0,f)+gP+u.slice(f)+ll+p):u+ll+(f===-2?s:p)}return[bP(e,o+(e[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},Og=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let o=0,a=0,s=t.length-1,u=this.parts,[l,c]=Wne(t,n);if(this.el=e.createElement(l,r),Kc.currentNode=this.el.content,n===2||n===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=Kc.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let f of i.getAttributeNames())if(f.endsWith(gP)){let d=c[a++],p=i.getAttribute(f).split(ll),h=/([.?@])?(.*)/.exec(d);u.push({type:1,index:o,name:h[2],strings:p,ctor:h[1]==="."?jS:h[1]==="?"?qS:h[1]==="@"?HS:pp}),i.removeAttribute(f)}else f.startsWith(ll)&&(u.push({type:6,index:o}),i.removeAttribute(f));if(xP.test(i.tagName)){let f=i.textContent.split(ll),d=f.length-1;if(d>0){i.textContent=Hv?Hv.emptyScript:"";for(let p=0;p<d;p++)i.append(f[p],Mg()),Kc.nextNode(),u.push({type:2,index:++o});i.append(f[d],Mg())}}}else if(i.nodeType===8)if(i.data===yP)u.push({type:2,index:o});else{let f=-1;for(;(f=i.data.indexOf(ll,f+1))!==-1;)u.push({type:7,index:o}),f+=ll.length-1}o++}}static createElement(t,n){let r=Qc.createElement("template");return r.innerHTML=t,r}};function dp(e,t,n=e,r){if(t===Jc)return t;let i=r!==void 0?n._$Co?.[r]:n._$Cl,o=Ng(t)?void 0:t._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(e),i._$AT(e,n,r)),r!==void 0?(n._$Co??(n._$Co=[]))[r]=i:n._$Cl=i),i!==void 0&&(t=dp(e,i._$AS(e,t.values),i,r)),t}var US=class{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:n},parts:r}=this._$AD,i=(t?.creationScope??Qc).importNode(n,!0);Kc.currentNode=i;let o=Kc.nextNode(),a=0,s=0,u=r[0];for(;u!==void 0;){if(a===u.index){let l;u.type===2?l=new $g(o,o.nextSibling,this,t):u.type===1?l=new u.ctor(o,u.name,u.strings,this,t):u.type===6&&(l=new WS(o,this,t)),this._$AV.push(l),u=r[++s]}a!==u?.index&&(o=Kc.nextNode(),a++)}return Kc.currentNode=Qc,i}p(t){let n=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,n),n+=r.strings.length-2):r._$AI(t[n])),n++}},$g=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,n,r,i){this.type=2,this._$AH=In,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,n=this._$AM;return n!==void 0&&t?.nodeType===11&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){t=dp(this,t,n),Ng(t)?t===In||t==null||t===""?(this._$AH!==In&&this._$AR(),this._$AH=In):t!==this._$AH&&t!==Jc&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Hne(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==In&&Ng(this._$AH)?this._$AA.nextSibling.data=t:this.T(Qc.createTextNode(t)),this._$AH=t}$(t){let{values:n,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Og.createElement(bP(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(n);else{let o=new US(i,this),a=o.u(this.options);o.p(n),this.T(a),this._$AH=o}}_$AC(t){let n=mP.get(t.strings);return n===void 0&&mP.set(t.strings,n=new Og(t)),n}k(t){VS(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let o of t)i===n.length?n.push(r=new e(this.O(Mg()),this.O(Mg()),this,this.options)):r=n[i],r._$AI(o),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(t=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);t!==this._$AB;){let r=lP(t).nextSibling;lP(t).remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},pp=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,r,i,o){this.type=1,this._$AH=In,this._$AN=void 0,this.element=t,this.name=n,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=In}_$AI(t,n=this,r,i){let o=this.strings,a=!1;if(o===void 0)t=dp(this,t,n,0),a=!Ng(t)||t!==this._$AH&&t!==Jc,a&&(this._$AH=t);else{let s=t,u,l;for(t=o[0],u=0;u<o.length-1;u++)l=dp(this,s[r+u],n,u),l===Jc&&(l=this._$AH[u]),a||(a=!Ng(l)||l!==this._$AH[u]),l===In?t=In:t!==In&&(t+=(l??"")+o[u+1]),this._$AH[u]=l}a&&!i&&this.j(t)}j(t){t===In?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},jS=class extends pp{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===In?void 0:t}},qS=class extends pp{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==In)}},HS=class extends pp{constructor(t,n,r,i,o){super(t,n,r,i,o),this.type=5}_$AI(t,n=this){if((t=dp(this,t,n,0)??In)===Jc)return;let r=this._$AH,i=t===In&&r!==In||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==In&&(r===In||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},WS=class{constructor(t,n,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){dp(this,t)}};var Vne=Rg.litHtmlPolyfillSupport;Vne?.(Og,$g),(Rg.litHtmlVersions??(Rg.litHtmlVersions=[])).push("3.3.2");var EP=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let o=n?.renderBefore??null;r._$litPart$=i=new $g(t.insertBefore(Mg(),o),o,void 0,n??{})}return i._$AI(e),i};var Pg=globalThis,cl=class extends Zs{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var n;let t=super.createRenderRoot();return(n=this.renderOptions).renderBefore??(n.renderBefore=t.firstChild),t}update(t){let n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=EP(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Jc}};cl._$litElement$=!0,cl.finalized=!0,Pg.litElementHydrateSupport?.({LitElement:cl});var Gne=Pg.litElementPolyfillSupport;Gne?.({LitElement:cl});(Pg.litElementVersions??(Pg.litElementVersions=[])).push("4.2.2");var Yne="https://vega.github.io/schema/vega-lite/v5.json";function YS(e){let t={x:{field:e.xField,type:"nominal",axis:{labelAngle:0},sort:null},y:{field:e.yField,type:"quantitative"}};e.colorField&&(t.color={field:e.colorField,type:"nominal"});let n={$schema:Yne,data:{values:e.data},mark:"bar",encoding:t};return e.title&&(n.title=e.title),n}var Xne="https://vega.github.io/schema/vega-lite/v5.json";function XS(e){let t={x:{field:e.xField,type:"quantitative"},y:{field:e.yField,type:"quantitative"}};e.seriesField&&(t.color={field:e.seriesField,type:"nominal"});let n={$schema:Xne,data:{values:e.data},mark:"line",encoding:t};return e.title&&(n.title=e.title),n}var Zne="https://vega.github.io/schema/vega-lite/v5.json";function ZS(e){let t={type:"arc"};typeof e.innerRadius=="number"&&(t.innerRadius=e.innerRadius);let n={$schema:Zne,data:{values:e.data},mark:t,encoding:{theta:{field:e.valueField,type:"quantitative"},color:{field:e.categoryField,type:"nominal"},tooltip:[{field:e.categoryField,type:"nominal"},{field:e.valueField,type:"quantitative"}]}};return e.title&&(n.title=e.title),n}var Kne="https://vega.github.io/schema/vega-lite/v5.json";function KS(e){let t=e.columns.map((i,o)=>({mark:{type:"text",align:"left",baseline:"middle"},encoding:{x:{value:o*120},y:{field:"_row",type:"ordinal",axis:null},text:{field:i.field}}})),n=e.data.map((i,o)=>({...i,_row:o})),r={$schema:Kne,data:{values:n},layer:t};return e.title&&(r.title=e.title),r}function AP(e){switch(e.layout){case"bar":return YS(e);case"line":return XS(e);case"table":return KS(e);case"pie":return ZS(e);default:{let t=e;throw new Error(`Unknown chart layout: ${e.layout??"undefined"}`)}}}function Wv(e,t){let n=e.getPropertyValue(t).trim();return n.length>0?n:void 0}function wP(e){let t=getComputedStyle(e),n=Wv(t,"--sc-color-primary"),r=Wv(t,"--sc-font-family"),i=Wv(t,"--sc-overlay-text-color"),o=Wv(t,"--sc-tile-background"),a={};return n&&(a.mark={color:n}),r&&(a.title={font:r},a.axis={labelFont:r,titleFont:r},a.legend={labelFont:r,titleFont:r}),i&&(a.axis={...a.axis??{},labelColor:i,titleColor:i},a.legend={...a.legend??{},labelColor:i,titleColor:i},a.title={...a.title??{},color:i}),o&&(a.background=o),a}var nl,ute,lte,g$,Ov=class extends cl{constructor(){super(...arguments);v$(this,nl);this.chartProps=void 0}createRenderRoot(){return this}async updated(n){n.has("chartProps")&&await _g(this,nl,ute).call(this)}render(){return vP`<div data-syntro-viz-chart-container style="width:100%; min-height:200px;"></div>`}};nl=new WeakSet,ute=async function(){let n=this.querySelector("[data-syntro-viz-chart-container]");if(!n)return;if(!this.chartProps){n.textContent="(no chart configured)";return}if(this.chartProps.layout==="table"){_g(this,nl,lte).call(this,n,this.chartProps);return}let r;try{r=AP(this.chartProps)}catch(o){n.textContent=`Chart error: ${o.message}`;return}let i=wP(this);try{let o={width:"container",autosize:{type:"fit",contains:"padding",resize:!0},...r},{default:a}=await Promise.resolve().then(()=>(ste(),ate));await a(n,o,{actions:!1,config:i,renderer:"svg",ast:!0})}catch(o){n.textContent=`Chart render error: ${o.message}`}},lte=function(n,r){if(n.innerHTML="",n.style.minHeight="0",r.title){let u=document.createElement("div");u.style.cssText="font-weight:600;font-size:14px;margin-bottom:8px;color:var(--syntro-text-color, currentColor);",u.textContent=r.title,n.appendChild(u)}let i=document.createElement("table");i.style.cssText="width:100%;border-collapse:collapse;font-size:13px;color:var(--syntro-text-color, currentColor);";let o=document.createElement("thead"),a=document.createElement("tr");for(let u of r.columns){let l=document.createElement("th");l.textContent=u.header,l.style.cssText="text-align:left;padding:6px 8px;font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:0.04em;opacity:0.7;border-bottom:1px solid var(--syntro-border-color, rgba(255,255,255,0.12));",a.appendChild(l)}o.appendChild(a),i.appendChild(o);let s=document.createElement("tbody");for(let u of r.data){let l=document.createElement("tr");for(let c of r.columns)l.appendChild(_g(this,nl,g$).call(this,c,u));s.appendChild(l)}if(i.appendChild(s),r.footer){let u=document.createElement("tfoot"),l=document.createElement("tr");r.columns.forEach((c,f)=>{if(f===0){let d=document.createElement("td");d.textContent=r.footer?.label??"",d.style.cssText="padding:8px;border-top:2px solid var(--syntro-border-color, rgba(255,255,255,0.18));font-weight:600;",l.appendChild(d)}else{let d=r.footer?.values??{},p=_g(this,nl,g$).call(this,c,d);p.style.borderTop="2px solid var(--syntro-border-color, rgba(255,255,255,0.18))",p.style.borderBottom="none",p.style.fontWeight="600",l.appendChild(p)}}),u.appendChild(l),i.appendChild(u)}n.appendChild(i)},g$=function(n,r){let i=document.createElement("td");i.style.cssText="padding:6px 8px;border-bottom:1px solid var(--syntro-border-color, rgba(255,255,255,0.06));vertical-align:middle;word-break:break-word;";let o=r[n.field],a=n.kind??"text";if(a==="bar"){let s=n.kind==="bar"&&n.max!==void 0?n.max:100,u=n.kind==="bar"&&n.suffix!==void 0?n.suffix:"%",l=n.kind==="bar"?n.colorField:void 0,c=typeof o=="number"?o:Number.parseFloat(String(o??""));if(Number.isFinite(c)){let f=Math.max(0,Math.min(100,c/s*100)),d=l?String(r[l]??"var(--syntro-accent-color, #4a9a8a)"):"var(--syntro-accent-color, #4a9a8a)",p=document.createElement("div");p.dataset.barWrapper="",p.style.cssText="display:flex;align-items:center;gap:6px;min-width:70px;";let h=document.createElement("span");h.dataset.barLabel="",h.textContent=`${c}${u}`,h.style.cssText="font-variant-numeric:tabular-nums;min-width:32px;font-size:12px;",p.appendChild(h);let m=document.createElement("div");m.dataset.barTrack="",m.style.cssText="flex:1;height:6px;border-radius:3px;background:var(--syntro-border-color, rgba(255,255,255,0.08));overflow:hidden;";let g=document.createElement("div");g.dataset.barFill="",g.style.cssText="height:100%;border-radius:3px;",g.style.width=`${f}%`,g.style.background=d,m.appendChild(g),p.appendChild(m),i.appendChild(p)}else i.textContent="";return i}if(a==="icon"){let s=typeof o=="string"?o:"",u=OS(s,{size:16});return u?i.innerHTML=u:i.textContent=s,i}if(a==="colorDot"){let s=typeof o=="string"?o:"transparent",u=document.createElement("span");return u.style.cssText="display:inline-block;width:10px;height:10px;border-radius:50%;",u.style.background=s,i.appendChild(u),i}return i.textContent=o==null?"":String(o),i},Ov.properties={chartProps:{attribute:!1}};var y$="syntro-viz-chart";typeof customElements<"u"&&!customElements.get(y$)&&customElements.define(y$,Ov);var JTe={mount(e,t){let{instanceId:n,...r}=t??{},i=document.createElement(y$);return i.chartProps=r,e.appendChild(i),()=>i.remove()}},rp={id:"adaptive-viz",version:"1.0.0",name:"Chart",description:"Vega-Lite-backed data visualization tile with baked layouts (bar, line, table) plus a custom escape hatch.",executors:[],widgets:[{id:"adaptive-viz:chart",component:JTe,metadata:{name:"Chart",description:"Bar / line / table / custom Vega-Lite chart",icon:"\u{1F4CA}"}}]};var cte={id:rp.id,version:rp.version,name:rp.name,description:rp.description,runtime:{actions:(rp.executors||[]).map(({kind:e,executor:t})=>({kind:e,executor:t})),widgets:rp.widgets},metadata:{isBuiltIn:!1}};if(typeof window<"u"){let e=window.SynOS;e?.appRegistry?.register&&e.appRegistry.register(cte)}var Igt=cte;})();
|
|
198
198
|
/*! Bundled license information:
|
|
199
199
|
|
|
200
200
|
fast-json-patch/module/helpers.mjs:
|