@northgraindata/dsui 0.4.1 → 0.5.0
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/bin/dsui.mjs +1 -1
- package/dist/plugin-sdk.mjs +1 -1
- package/dist/runtime/plugins/code-repository.browser.mjs +60 -0
- package/dist/runtime/plugins/code-repository.mjs +2 -2
- package/dist/runtime/plugins/example-plugin.mjs +1 -1
- package/dist/runtime/plugins/health.browser.mjs +202 -68
- package/dist/runtime/plugins/health.mjs +97 -6
- package/dist/runtime/plugins/monitoring.mjs +11 -1
- package/dist/runtime/plugins/status-pages.browser.mjs +5033 -0
- package/dist/runtime/plugins/status-pages.mjs +52 -0
- package/dist/server.mjs +205 -188
- package/package.json +1 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@northgraindata/dsui-ui/src/components/input.tsx +2 -5
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@northgraindata/dsui-ui/src/components/suggest-input.tsx +197 -0
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@northgraindata/dsui-ui/src/index.tsx +5 -0
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@northgraindata/dsui-ui/src/styles.css +54 -0
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/dist/cjs/index.cjs +3 -2
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/dist/cjs/index.cjs.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/dist/esm/index.js +3 -2
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/dist/esm/index.js.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/package.json +2 -2
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/src/index.tsx +11 -2
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs +79 -26
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.d.cts +12 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/scroll-classifier.cjs +14 -2
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/scroll-classifier.cjs.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/scroll-classifier.d.cts +3 -2
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.d.ts +12 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.js +79 -26
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.js.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/scroll-classifier.d.ts +3 -2
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/scroll-classifier.js +14 -2
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/scroll-classifier.js.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/package.json +1 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/src/index.ts +135 -24
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/src/scroll-classifier.ts +31 -3
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/adapter/define.ts +22 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/adapter/index.ts +1 -0
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/adapter/presentation.test.ts +73 -0
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/adapter/presentation.ts +34 -0
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/adapter/types.ts +23 -0
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/components/ui/layout/gauge.tsx +14 -2
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/dataset/dataset.test.ts +134 -0
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/dataset/index.ts +141 -0
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/index.ts +23 -0
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/dist/cjs/index.cjs +3 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/dist/cjs/index.cjs.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/dist/esm/index.js +3 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/dist/esm/index.js.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/package.json +2 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/src/index.tsx +11 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs +79 -26
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.d.cts +12 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/scroll-classifier.cjs +14 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/scroll-classifier.cjs.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/scroll-classifier.d.cts +3 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.d.ts +12 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.js +79 -26
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.js.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/scroll-classifier.d.ts +3 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/scroll-classifier.js +14 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/scroll-classifier.js.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/package.json +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/src/index.ts +135 -24
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/src/scroll-classifier.ts +31 -3
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/adapter/define.ts +22 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/adapter/index.ts +1 -0
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/adapter/presentation.test.ts +73 -0
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/adapter/presentation.ts +34 -0
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/adapter/types.ts +23 -0
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/components/ui/layout/gauge.tsx +14 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/dataset/dataset.test.ts +134 -0
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/dataset/index.ts +141 -0
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/index.ts +23 -0
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/react-virtual/dist/cjs/index.cjs +3 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/react-virtual/dist/cjs/index.cjs.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/react-virtual/dist/esm/index.js +3 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/react-virtual/dist/esm/index.js.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/react-virtual/package.json +2 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/react-virtual/src/index.tsx +11 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs +79 -26
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.d.cts +12 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/cjs/scroll-classifier.cjs +14 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/cjs/scroll-classifier.cjs.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/cjs/scroll-classifier.d.cts +3 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.d.ts +12 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.js +79 -26
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.js.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/esm/scroll-classifier.d.ts +3 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/esm/scroll-classifier.js +14 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/esm/scroll-classifier.js.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/package.json +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/src/index.ts +135 -24
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/src/scroll-classifier.ts +31 -3
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/package.json +2 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/src/diagnostics.ts +24 -0
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/src/events.ts +6 -0
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/src/index.ts +162 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/src/modal.test.ts +76 -0
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/src/modal.ts +200 -0
- package/sdk/node_modules/@northgraindata/dsui-ui/src/components/input.tsx +2 -5
- package/sdk/node_modules/@northgraindata/dsui-ui/src/components/suggest-input.tsx +197 -0
- package/sdk/node_modules/@northgraindata/dsui-ui/src/index.tsx +5 -0
- package/sdk/node_modules/@northgraindata/dsui-ui/src/styles.css +54 -0
- package/web/assets/index-DQkPkPN7.css +1 -0
- package/web/assets/index-w07fgRf1.js +218 -0
- package/web/index.html +2 -2
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/components/ui/keyed-items.test.ts +0 -23
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/components/ui/query-editor/column-profile.test.ts +0 -109
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/components/ui/query-editor/query-explorer.test.ts +0 -29
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/components/ui/table-data.test.ts +0 -65
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/components/ui/keyed-items.test.ts +0 -23
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/components/ui/query-editor/column-profile.test.ts +0 -109
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/components/ui/query-editor/query-explorer.test.ts +0 -29
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/src/components/ui/table-data.test.ts +0 -65
- package/web/assets/index-BBd7EEtd.js +0 -98
- package/web/assets/index-C16grSph.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var pN=Object.defineProperty;var rN=($)=>$;function aN($,N){this[$]=rN.bind(null,N)}var dN=($,N)=>{for(var G in N)pN($,G,{get:N[G],enumerable:!0,configurable:!0,set:aN.bind(N,G)})};var M={};dN(M,{void:()=>DG,util:()=>A,unknown:()=>wG,union:()=>xG,undefined:()=>fG,tuple:()=>lG,transformer:()=>nG,symbol:()=>CG,string:()=>CN,strictObject:()=>vG,setErrorMap:()=>oN,set:()=>ZG,record:()=>hG,quotelessJson:()=>nN,promise:()=>dG,preprocess:()=>tG,pipeline:()=>sG,ostring:()=>eG,optional:()=>iG,onumber:()=>$W,oboolean:()=>NW,objectUtil:()=>I$,object:()=>TG,number:()=>fN,nullable:()=>oG,null:()=>KG,never:()=>kG,nativeEnum:()=>aG,nan:()=>UG,map:()=>yG,makeIssue:()=>z$,literal:()=>pG,lazy:()=>uG,late:()=>jG,isValid:()=>u,isDirty:()=>E$,isAsync:()=>W$,isAborted:()=>K$,intersection:()=>mG,instanceof:()=>AG,getParsedType:()=>I,getErrorMap:()=>G$,function:()=>cG,enum:()=>rG,effect:()=>nG,discriminatedUnion:()=>IG,defaultErrorMap:()=>h,datetimeRegex:()=>UN,date:()=>PG,custom:()=>PN,coerce:()=>GW,boolean:()=>KN,bigint:()=>bG,array:()=>gG,any:()=>EG,addIssueToContext:()=>q,ZodVoid:()=>j$,ZodUnknown:()=>p,ZodUnion:()=>Y$,ZodUndefined:()=>X$,ZodType:()=>j,ZodTuple:()=>l,ZodTransformer:()=>x,ZodSymbol:()=>O$,ZodString:()=>D,ZodSet:()=>s,ZodSchema:()=>j,ZodRecord:()=>A$,ZodReadonly:()=>V$,ZodPromise:()=>e,ZodPipeline:()=>P$,ZodParsedType:()=>J,ZodOptional:()=>T,ZodObject:()=>U,ZodNumber:()=>r,ZodNullable:()=>Z,ZodNull:()=>_$,ZodNever:()=>m,ZodNativeEnum:()=>S$,ZodNaN:()=>b$,ZodMap:()=>U$,ZodLiteral:()=>q$,ZodLazy:()=>J$,ZodIssueCode:()=>Y,ZodIntersection:()=>B$,ZodFunction:()=>R$,ZodFirstPartyTypeKind:()=>z,ZodError:()=>E,ZodEnum:()=>d,ZodEffects:()=>x,ZodDiscriminatedUnion:()=>w$,ZodDefault:()=>M$,ZodDate:()=>o,ZodCatch:()=>L$,ZodBranded:()=>k$,ZodBoolean:()=>Q$,ZodBigInt:()=>a,ZodArray:()=>g,ZodAny:()=>t,Schema:()=>j,ParseStatus:()=>C,OK:()=>K,NEVER:()=>WW,INVALID:()=>V,EMPTY_PATH:()=>tN,DIRTY:()=>i,BRAND:()=>OG});var A;(function($){$.assertEqual=(W)=>{};function N(W){}$.assertIs=N;function G(W){throw Error()}$.assertNever=G,$.arrayToEnum=(W)=>{let Q={};for(let R of W)Q[R]=R;return Q},$.getValidEnumValues=(W)=>{let Q=$.objectKeys(W).filter((_)=>typeof W[W[_]]!=="number"),R={};for(let _ of Q)R[_]=W[_];return $.objectValues(R)},$.objectValues=(W)=>{return $.objectKeys(W).map(function(Q){return W[Q]})},$.objectKeys=typeof Object.keys==="function"?(W)=>Object.keys(W):(W)=>{let Q=[];for(let R in W)if(Object.prototype.hasOwnProperty.call(W,R))Q.push(R);return Q},$.find=(W,Q)=>{for(let R of W)if(Q(R))return R;return},$.isInteger=typeof Number.isInteger==="function"?(W)=>Number.isInteger(W):(W)=>typeof W==="number"&&Number.isFinite(W)&&Math.floor(W)===W;function H(W,Q=" | "){return W.map((R)=>typeof R==="string"?`'${R}'`:R).join(Q)}$.joinValues=H,$.jsonStringifyReplacer=(W,Q)=>{if(typeof Q==="bigint")return Q.toString();return Q}})(A||(A={}));var I$;(function($){$.mergeShapes=(N,G)=>{return{...N,...G}}})(I$||(I$={}));var J=A.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),I=($)=>{switch(typeof $){case"undefined":return J.undefined;case"string":return J.string;case"number":return Number.isNaN($)?J.nan:J.number;case"boolean":return J.boolean;case"function":return J.function;case"bigint":return J.bigint;case"symbol":return J.symbol;case"object":if(Array.isArray($))return J.array;if($===null)return J.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return J.promise;if(typeof Map<"u"&&$ instanceof Map)return J.map;if(typeof Set<"u"&&$ instanceof Set)return J.set;if(typeof Date<"u"&&$ instanceof Date)return J.date;return J.object;default:return J.unknown}};var Y=A.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"]),nN=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class E extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(G)=>{this.issues=[...this.issues,G]},this.addIssues=(G=[])=>{this.issues=[...this.issues,...G]};let N=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,N);else this.__proto__=N;this.name="ZodError",this.issues=$}format($){let N=$||function(W){return W.message},G={_errors:[]},H=(W)=>{for(let Q of W.issues)if(Q.code==="invalid_union")Q.unionErrors.map(H);else if(Q.code==="invalid_return_type")H(Q.returnTypeError);else if(Q.code==="invalid_arguments")H(Q.argumentsError);else if(Q.path.length===0)G._errors.push(N(Q));else{let R=G,_=0;while(_<Q.path.length){let B=Q.path[_];if(_!==Q.path.length-1)R[B]=R[B]||{_errors:[]};else R[B]=R[B]||{_errors:[]},R[B]._errors.push(N(Q));R=R[B],_++}}};return H(this),G}static assert($){if(!($ instanceof E))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,A.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(N)=>N.message){let N={},G=[];for(let H of this.issues)if(H.path.length>0){let W=H.path[0];N[W]=N[W]||[],N[W].push($(H))}else G.push($(H));return{formErrors:G,fieldErrors:N}}get formErrors(){return this.flatten()}}E.create=($)=>{return new E($)};var iN=($,N)=>{let G;switch($.code){case Y.invalid_type:if($.received===J.undefined)G="Required";else G=`Expected ${$.expected}, received ${$.received}`;break;case Y.invalid_literal:G=`Invalid literal value, expected ${JSON.stringify($.expected,A.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:G=`Unrecognized key(s) in object: ${A.joinValues($.keys,", ")}`;break;case Y.invalid_union:G="Invalid input";break;case Y.invalid_union_discriminator:G=`Invalid discriminator value. Expected ${A.joinValues($.options)}`;break;case Y.invalid_enum_value:G=`Invalid enum value. Expected ${A.joinValues($.options)}, received '${$.received}'`;break;case Y.invalid_arguments:G="Invalid function arguments";break;case Y.invalid_return_type:G="Invalid function return type";break;case Y.invalid_date:G="Invalid date";break;case Y.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(G=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")G=`${G} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)G=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)G=`Invalid input: must end with "${$.validation.endsWith}"`;else A.assertNever($.validation);else if($.validation!=="regex")G=`Invalid ${$.validation}`;else G="Invalid";break;case Y.too_small:if($.type==="array")G=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")G=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")G=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")G=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")G=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else G="Invalid input";break;case Y.too_big:if($.type==="array")G=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")G=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")G=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")G=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")G=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else G="Invalid input";break;case Y.custom:G="Invalid input";break;case Y.invalid_intersection_types:G="Intersection results could not be merged";break;case Y.not_multiple_of:G=`Number must be a multiple of ${$.multipleOf}`;break;case Y.not_finite:G="Number must be finite";break;default:G=N.defaultError,A.assertNever($)}return{message:G}},h=iN;var FN=h;function oN($){FN=$}function G$(){return FN}var z$=($)=>{let{data:N,path:G,errorMaps:H,issueData:W}=$,Q=[...G,...W.path||[]],R={...W,path:Q};if(W.message!==void 0)return{...W,path:Q,message:W.message};let _="",B=H.filter((X)=>!!X).slice().reverse();for(let X of B)_=X(R,{data:N,defaultError:_}).message;return{...W,path:Q,message:_}},tN=[];function q($,N){let G=G$(),H=z$({issueData:N,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,G,G===h?void 0:h].filter((W)=>!!W)});$.common.issues.push(H)}class C{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,N){let G=[];for(let H of N){if(H.status==="aborted")return V;if(H.status==="dirty")$.dirty();G.push(H.value)}return{status:$.value,value:G}}static async mergeObjectAsync($,N){let G=[];for(let H of N){let W=await H.key,Q=await H.value;G.push({key:W,value:Q})}return C.mergeObjectSync($,G)}static mergeObjectSync($,N){let G={};for(let H of N){let{key:W,value:Q}=H;if(W.status==="aborted")return V;if(Q.status==="aborted")return V;if(W.status==="dirty")$.dirty();if(Q.status==="dirty")$.dirty();if(W.value!=="__proto__"&&(typeof Q.value<"u"||H.alwaysSet))G[W.value]=Q.value}return{status:$.value,value:G}}}var V=Object.freeze({status:"aborted"}),i=($)=>({status:"dirty",value:$}),K=($)=>({status:"valid",value:$}),K$=($)=>$.status==="aborted",E$=($)=>$.status==="dirty",u=($)=>$.status==="valid",W$=($)=>typeof Promise<"u"&&$ instanceof Promise;var L;(function($){$.errToObj=(N)=>typeof N==="string"?{message:N}:N||{},$.toString=(N)=>typeof N==="string"?N:N?.message})(L||(L={}));class v{constructor($,N,G,H){this._cachedPath=[],this.parent=$,this.data=N,this._path=G,this._key=H}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var zN=($,N)=>{if(u(N))return{success:!0,data:N.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let G=new E($.common.issues);return this._error=G,this._error}}}};function O($){if(!$)return{};let{errorMap:N,invalid_type_error:G,required_error:H,description:W}=$;if(N&&(G||H))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(N)return{errorMap:N,description:W};return{errorMap:(R,_)=>{let{message:B}=$;if(R.code==="invalid_enum_value")return{message:B??_.defaultError};if(typeof _.data>"u")return{message:B??H??_.defaultError};if(R.code!=="invalid_type")return{message:_.defaultError};return{message:B??G??_.defaultError}},description:W}}class j{get description(){return this._def.description}_getType($){return I($.data)}_getOrReturnCtx($,N){return N||{common:$.parent.common,data:$.data,parsedType:I($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new C,ctx:{common:$.parent.common,data:$.data,parsedType:I($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let N=this._parse($);if(W$(N))throw Error("Synchronous parse encountered promise.");return N}_parseAsync($){let N=this._parse($);return Promise.resolve(N)}parse($,N){let G=this.safeParse($,N);if(G.success)return G.data;throw G.error}safeParse($,N){let G={common:{issues:[],async:N?.async??!1,contextualErrorMap:N?.errorMap},path:N?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:I($)},H=this._parseSync({data:$,path:G.path,parent:G});return zN(G,H)}"~validate"($){let N={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:I($)};if(!this["~standard"].async)try{let G=this._parseSync({data:$,path:[],parent:N});return u(G)?{value:G.value}:{issues:N.common.issues}}catch(G){if(G?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;N.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:N}).then((G)=>u(G)?{value:G.value}:{issues:N.common.issues})}async parseAsync($,N){let G=await this.safeParseAsync($,N);if(G.success)return G.data;throw G.error}async safeParseAsync($,N){let G={common:{issues:[],contextualErrorMap:N?.errorMap,async:!0},path:N?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:I($)},H=this._parse({data:$,path:G.path,parent:G}),W=await(W$(H)?H:Promise.resolve(H));return zN(G,W)}refine($,N){let G=(H)=>{if(typeof N==="string"||typeof N>"u")return{message:N};else if(typeof N==="function")return N(H);else return N};return this._refinement((H,W)=>{let Q=$(H),R=()=>W.addIssue({code:Y.custom,...G(H)});if(typeof Promise<"u"&&Q instanceof Promise)return Q.then((_)=>{if(!_)return R(),!1;else return!0});if(!Q)return R(),!1;else return!0})}refinement($,N){return this._refinement((G,H)=>{if(!$(G))return H.addIssue(typeof N==="function"?N(G,H):N),!1;else return!0})}_refinement($){return new x({schema:this,typeName:z.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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 T.create(this,this._def)}nullable(){return Z.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return g.create(this)}promise(){return e.create(this,this._def)}or($){return Y$.create([this,$],this._def)}and($){return B$.create(this,$,this._def)}transform($){return new x({...O(this._def),schema:this,typeName:z.ZodEffects,effect:{type:"transform",transform:$}})}default($){let N=typeof $==="function"?$:()=>$;return new M$({...O(this._def),innerType:this,defaultValue:N,typeName:z.ZodDefault})}brand(){return new k$({typeName:z.ZodBranded,type:this,...O(this._def)})}catch($){let N=typeof $==="function"?$:()=>$;return new L$({...O(this._def),innerType:this,catchValue:N,typeName:z.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return P$.create(this,$)}readonly(){return V$.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var sN=/^c[^\s-]{8,}$/i,eN=/^[0-9a-z]+$/,$G=/^[0-9A-HJKMNP-TV-Z]{26}$/i,NG=/^[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,GG=/^[a-z0-9_-]{21}$/i,WG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,HG=/^[-+]?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)?)??$/,RG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,QG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",m$,XG=/^(?:(?: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])$/,_G=/^(?:(?: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])$/,YG=/^(([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]))$/,BG=/^(([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])$/,JG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qG=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,jN="((\\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])))",SG=new RegExp(`^${jN}$`);function AN($){let N="[0-5]\\d";if($.precision)N=`${N}\\.\\d{${$.precision}}`;else if($.precision==null)N=`${N}(\\.\\d+)?`;let G=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${N})${G}`}function MG($){return new RegExp(`^${AN($)}$`)}function UN($){let N=`${jN}T${AN($)}`,G=[];if(G.push($.local?"Z?":"Z"),$.offset)G.push("([+-]\\d{2}:?\\d{2})");return N=`${N}(${G.join("|")})`,new RegExp(`^${N}$`)}function LG($,N){if((N==="v4"||!N)&&XG.test($))return!0;if((N==="v6"||!N)&&YG.test($))return!0;return!1}function VG($,N){if(!WG.test($))return!1;try{let[G]=$.split(".");if(!G)return!1;let H=G.replace(/-/g,"+").replace(/_/g,"/").padEnd(G.length+(4-G.length%4)%4,"="),W=JSON.parse(atob(H));if(typeof W!=="object"||W===null)return!1;if("typ"in W&&W?.typ!=="JWT")return!1;if(!W.alg)return!1;if(N&&W.alg!==N)return!1;return!0}catch{return!1}}function FG($,N){if((N==="v4"||!N)&&_G.test($))return!0;if((N==="v6"||!N)&&BG.test($))return!0;return!1}class D extends j{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==J.string){let W=this._getOrReturnCtx($);return q(W,{code:Y.invalid_type,expected:J.string,received:W.parsedType}),V}let G=new C,H=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.length<W.value)H=this._getOrReturnCtx($,H),q(H,{code:Y.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),G.dirty()}else if(W.kind==="max"){if($.data.length>W.value)H=this._getOrReturnCtx($,H),q(H,{code:Y.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),G.dirty()}else if(W.kind==="length"){let Q=$.data.length>W.value,R=$.data.length<W.value;if(Q||R){if(H=this._getOrReturnCtx($,H),Q)q(H,{code:Y.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});else if(R)q(H,{code:Y.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});G.dirty()}}else if(W.kind==="email"){if(!RG.test($.data))H=this._getOrReturnCtx($,H),q(H,{validation:"email",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="emoji"){if(!m$)m$=new RegExp(QG,"u");if(!m$.test($.data))H=this._getOrReturnCtx($,H),q(H,{validation:"emoji",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="uuid"){if(!NG.test($.data))H=this._getOrReturnCtx($,H),q(H,{validation:"uuid",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="nanoid"){if(!GG.test($.data))H=this._getOrReturnCtx($,H),q(H,{validation:"nanoid",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="cuid"){if(!sN.test($.data))H=this._getOrReturnCtx($,H),q(H,{validation:"cuid",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="cuid2"){if(!eN.test($.data))H=this._getOrReturnCtx($,H),q(H,{validation:"cuid2",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="ulid"){if(!$G.test($.data))H=this._getOrReturnCtx($,H),q(H,{validation:"ulid",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="url")try{new URL($.data)}catch{H=this._getOrReturnCtx($,H),q(H,{validation:"url",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="regex"){if(W.regex.lastIndex=0,!W.regex.test($.data))H=this._getOrReturnCtx($,H),q(H,{validation:"regex",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="trim")$.data=$.data.trim();else if(W.kind==="includes"){if(!$.data.includes(W.value,W.position))H=this._getOrReturnCtx($,H),q(H,{code:Y.invalid_string,validation:{includes:W.value,position:W.position},message:W.message}),G.dirty()}else if(W.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(W.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(W.kind==="startsWith"){if(!$.data.startsWith(W.value))H=this._getOrReturnCtx($,H),q(H,{code:Y.invalid_string,validation:{startsWith:W.value},message:W.message}),G.dirty()}else if(W.kind==="endsWith"){if(!$.data.endsWith(W.value))H=this._getOrReturnCtx($,H),q(H,{code:Y.invalid_string,validation:{endsWith:W.value},message:W.message}),G.dirty()}else if(W.kind==="datetime"){if(!UN(W).test($.data))H=this._getOrReturnCtx($,H),q(H,{code:Y.invalid_string,validation:"datetime",message:W.message}),G.dirty()}else if(W.kind==="date"){if(!SG.test($.data))H=this._getOrReturnCtx($,H),q(H,{code:Y.invalid_string,validation:"date",message:W.message}),G.dirty()}else if(W.kind==="time"){if(!MG(W).test($.data))H=this._getOrReturnCtx($,H),q(H,{code:Y.invalid_string,validation:"time",message:W.message}),G.dirty()}else if(W.kind==="duration"){if(!HG.test($.data))H=this._getOrReturnCtx($,H),q(H,{validation:"duration",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="ip"){if(!LG($.data,W.version))H=this._getOrReturnCtx($,H),q(H,{validation:"ip",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="jwt"){if(!VG($.data,W.alg))H=this._getOrReturnCtx($,H),q(H,{validation:"jwt",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="cidr"){if(!FG($.data,W.version))H=this._getOrReturnCtx($,H),q(H,{validation:"cidr",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="base64"){if(!JG.test($.data))H=this._getOrReturnCtx($,H),q(H,{validation:"base64",code:Y.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="base64url"){if(!qG.test($.data))H=this._getOrReturnCtx($,H),q(H,{validation:"base64url",code:Y.invalid_string,message:W.message}),G.dirty()}else A.assertNever(W);return{status:G.value,value:$.data}}_regex($,N,G){return this.refinement((H)=>$.test(H),{validation:N,code:Y.invalid_string,...L.errToObj(G)})}_addCheck($){return new D({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...L.errToObj($)})}url($){return this._addCheck({kind:"url",...L.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...L.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...L.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...L.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...L.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...L.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...L.errToObj($)})}base64($){return this._addCheck({kind:"base64",...L.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...L.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...L.errToObj($)})}ip($){return this._addCheck({kind:"ip",...L.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...L.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...L.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...L.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...L.errToObj($)})}regex($,N){return this._addCheck({kind:"regex",regex:$,...L.errToObj(N)})}includes($,N){return this._addCheck({kind:"includes",value:$,position:N?.position,...L.errToObj(N?.message)})}startsWith($,N){return this._addCheck({kind:"startsWith",value:$,...L.errToObj(N)})}endsWith($,N){return this._addCheck({kind:"endsWith",value:$,...L.errToObj(N)})}min($,N){return this._addCheck({kind:"min",value:$,...L.errToObj(N)})}max($,N){return this._addCheck({kind:"max",value:$,...L.errToObj(N)})}length($,N){return this._addCheck({kind:"length",value:$,...L.errToObj(N)})}nonempty($){return this.min(1,L.errToObj($))}trim(){return new D({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let N of this._def.checks)if(N.kind==="min"){if($===null||N.value>$)$=N.value}return $}get maxLength(){let $=null;for(let N of this._def.checks)if(N.kind==="max"){if($===null||N.value<$)$=N.value}return $}}D.create=($)=>{return new D({checks:[],typeName:z.ZodString,coerce:$?.coerce??!1,...O($)})};function zG($,N){let G=($.toString().split(".")[1]||"").length,H=(N.toString().split(".")[1]||"").length,W=G>H?G:H,Q=Number.parseInt($.toFixed(W).replace(".","")),R=Number.parseInt(N.toFixed(W).replace(".",""));return Q%R/10**W}class r extends j{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==J.number){let W=this._getOrReturnCtx($);return q(W,{code:Y.invalid_type,expected:J.number,received:W.parsedType}),V}let G=void 0,H=new C;for(let W of this._def.checks)if(W.kind==="int"){if(!A.isInteger($.data))G=this._getOrReturnCtx($,G),q(G,{code:Y.invalid_type,expected:"integer",received:"float",message:W.message}),H.dirty()}else if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)G=this._getOrReturnCtx($,G),q(G,{code:Y.too_small,minimum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),H.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)G=this._getOrReturnCtx($,G),q(G,{code:Y.too_big,maximum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),H.dirty()}else if(W.kind==="multipleOf"){if(zG($.data,W.value)!==0)G=this._getOrReturnCtx($,G),q(G,{code:Y.not_multiple_of,multipleOf:W.value,message:W.message}),H.dirty()}else if(W.kind==="finite"){if(!Number.isFinite($.data))G=this._getOrReturnCtx($,G),q(G,{code:Y.not_finite,message:W.message}),H.dirty()}else A.assertNever(W);return{status:H.value,value:$.data}}gte($,N){return this.setLimit("min",$,!0,L.toString(N))}gt($,N){return this.setLimit("min",$,!1,L.toString(N))}lte($,N){return this.setLimit("max",$,!0,L.toString(N))}lt($,N){return this.setLimit("max",$,!1,L.toString(N))}setLimit($,N,G,H){return new r({...this._def,checks:[...this._def.checks,{kind:$,value:N,inclusive:G,message:L.toString(H)}]})}_addCheck($){return new r({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:L.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:L.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:L.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:L.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:L.toString($)})}multipleOf($,N){return this._addCheck({kind:"multipleOf",value:$,message:L.toString(N)})}finite($){return this._addCheck({kind:"finite",message:L.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:L.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:L.toString($)})}get minValue(){let $=null;for(let N of this._def.checks)if(N.kind==="min"){if($===null||N.value>$)$=N.value}return $}get maxValue(){let $=null;for(let N of this._def.checks)if(N.kind==="max"){if($===null||N.value<$)$=N.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&A.isInteger($.value))}get isFinite(){let $=null,N=null;for(let G of this._def.checks)if(G.kind==="finite"||G.kind==="int"||G.kind==="multipleOf")return!0;else if(G.kind==="min"){if(N===null||G.value>N)N=G.value}else if(G.kind==="max"){if($===null||G.value<$)$=G.value}return Number.isFinite(N)&&Number.isFinite($)}}r.create=($)=>{return new r({checks:[],typeName:z.ZodNumber,coerce:$?.coerce||!1,...O($)})};class a extends j{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==J.bigint)return this._getInvalidInput($);let G=void 0,H=new C;for(let W of this._def.checks)if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)G=this._getOrReturnCtx($,G),q(G,{code:Y.too_small,type:"bigint",minimum:W.value,inclusive:W.inclusive,message:W.message}),H.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)G=this._getOrReturnCtx($,G),q(G,{code:Y.too_big,type:"bigint",maximum:W.value,inclusive:W.inclusive,message:W.message}),H.dirty()}else if(W.kind==="multipleOf"){if($.data%W.value!==BigInt(0))G=this._getOrReturnCtx($,G),q(G,{code:Y.not_multiple_of,multipleOf:W.value,message:W.message}),H.dirty()}else A.assertNever(W);return{status:H.value,value:$.data}}_getInvalidInput($){let N=this._getOrReturnCtx($);return q(N,{code:Y.invalid_type,expected:J.bigint,received:N.parsedType}),V}gte($,N){return this.setLimit("min",$,!0,L.toString(N))}gt($,N){return this.setLimit("min",$,!1,L.toString(N))}lte($,N){return this.setLimit("max",$,!0,L.toString(N))}lt($,N){return this.setLimit("max",$,!1,L.toString(N))}setLimit($,N,G,H){return new a({...this._def,checks:[...this._def.checks,{kind:$,value:N,inclusive:G,message:L.toString(H)}]})}_addCheck($){return new a({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:L.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:L.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:L.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:L.toString($)})}multipleOf($,N){return this._addCheck({kind:"multipleOf",value:$,message:L.toString(N)})}get minValue(){let $=null;for(let N of this._def.checks)if(N.kind==="min"){if($===null||N.value>$)$=N.value}return $}get maxValue(){let $=null;for(let N of this._def.checks)if(N.kind==="max"){if($===null||N.value<$)$=N.value}return $}}a.create=($)=>{return new a({checks:[],typeName:z.ZodBigInt,coerce:$?.coerce??!1,...O($)})};class Q$ extends j{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==J.boolean){let G=this._getOrReturnCtx($);return q(G,{code:Y.invalid_type,expected:J.boolean,received:G.parsedType}),V}return K($.data)}}Q$.create=($)=>{return new Q$({typeName:z.ZodBoolean,coerce:$?.coerce||!1,...O($)})};class o extends j{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==J.date){let W=this._getOrReturnCtx($);return q(W,{code:Y.invalid_type,expected:J.date,received:W.parsedType}),V}if(Number.isNaN($.data.getTime())){let W=this._getOrReturnCtx($);return q(W,{code:Y.invalid_date}),V}let G=new C,H=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.getTime()<W.value)H=this._getOrReturnCtx($,H),q(H,{code:Y.too_small,message:W.message,inclusive:!0,exact:!1,minimum:W.value,type:"date"}),G.dirty()}else if(W.kind==="max"){if($.data.getTime()>W.value)H=this._getOrReturnCtx($,H),q(H,{code:Y.too_big,message:W.message,inclusive:!0,exact:!1,maximum:W.value,type:"date"}),G.dirty()}else A.assertNever(W);return{status:G.value,value:new Date($.data.getTime())}}_addCheck($){return new o({...this._def,checks:[...this._def.checks,$]})}min($,N){return this._addCheck({kind:"min",value:$.getTime(),message:L.toString(N)})}max($,N){return this._addCheck({kind:"max",value:$.getTime(),message:L.toString(N)})}get minDate(){let $=null;for(let N of this._def.checks)if(N.kind==="min"){if($===null||N.value>$)$=N.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let N of this._def.checks)if(N.kind==="max"){if($===null||N.value<$)$=N.value}return $!=null?new Date($):null}}o.create=($)=>{return new o({checks:[],coerce:$?.coerce||!1,typeName:z.ZodDate,...O($)})};class O$ extends j{_parse($){if(this._getType($)!==J.symbol){let G=this._getOrReturnCtx($);return q(G,{code:Y.invalid_type,expected:J.symbol,received:G.parsedType}),V}return K($.data)}}O$.create=($)=>{return new O$({typeName:z.ZodSymbol,...O($)})};class X$ extends j{_parse($){if(this._getType($)!==J.undefined){let G=this._getOrReturnCtx($);return q(G,{code:Y.invalid_type,expected:J.undefined,received:G.parsedType}),V}return K($.data)}}X$.create=($)=>{return new X$({typeName:z.ZodUndefined,...O($)})};class _$ extends j{_parse($){if(this._getType($)!==J.null){let G=this._getOrReturnCtx($);return q(G,{code:Y.invalid_type,expected:J.null,received:G.parsedType}),V}return K($.data)}}_$.create=($)=>{return new _$({typeName:z.ZodNull,...O($)})};class t extends j{constructor(){super(...arguments);this._any=!0}_parse($){return K($.data)}}t.create=($)=>{return new t({typeName:z.ZodAny,...O($)})};class p extends j{constructor(){super(...arguments);this._unknown=!0}_parse($){return K($.data)}}p.create=($)=>{return new p({typeName:z.ZodUnknown,...O($)})};class m extends j{_parse($){let N=this._getOrReturnCtx($);return q(N,{code:Y.invalid_type,expected:J.never,received:N.parsedType}),V}}m.create=($)=>{return new m({typeName:z.ZodNever,...O($)})};class j$ extends j{_parse($){if(this._getType($)!==J.undefined){let G=this._getOrReturnCtx($);return q(G,{code:Y.invalid_type,expected:J.void,received:G.parsedType}),V}return K($.data)}}j$.create=($)=>{return new j$({typeName:z.ZodVoid,...O($)})};class g extends j{_parse($){let{ctx:N,status:G}=this._processInputParams($),H=this._def;if(N.parsedType!==J.array)return q(N,{code:Y.invalid_type,expected:J.array,received:N.parsedType}),V;if(H.exactLength!==null){let Q=N.data.length>H.exactLength.value,R=N.data.length<H.exactLength.value;if(Q||R)q(N,{code:Q?Y.too_big:Y.too_small,minimum:R?H.exactLength.value:void 0,maximum:Q?H.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:H.exactLength.message}),G.dirty()}if(H.minLength!==null){if(N.data.length<H.minLength.value)q(N,{code:Y.too_small,minimum:H.minLength.value,type:"array",inclusive:!0,exact:!1,message:H.minLength.message}),G.dirty()}if(H.maxLength!==null){if(N.data.length>H.maxLength.value)q(N,{code:Y.too_big,maximum:H.maxLength.value,type:"array",inclusive:!0,exact:!1,message:H.maxLength.message}),G.dirty()}if(N.common.async)return Promise.all([...N.data].map((Q,R)=>{return H.type._parseAsync(new v(N,Q,N.path,R))})).then((Q)=>{return C.mergeArray(G,Q)});let W=[...N.data].map((Q,R)=>{return H.type._parseSync(new v(N,Q,N.path,R))});return C.mergeArray(G,W)}get element(){return this._def.type}min($,N){return new g({...this._def,minLength:{value:$,message:L.toString(N)}})}max($,N){return new g({...this._def,maxLength:{value:$,message:L.toString(N)}})}length($,N){return new g({...this._def,exactLength:{value:$,message:L.toString(N)}})}nonempty($){return this.min(1,$)}}g.create=($,N)=>{return new g({type:$,minLength:null,maxLength:null,exactLength:null,typeName:z.ZodArray,...O(N)})};function H$($){if($ instanceof U){let N={};for(let G in $.shape){let H=$.shape[G];N[G]=T.create(H$(H))}return new U({...$._def,shape:()=>N})}else if($ instanceof g)return new g({...$._def,type:H$($.element)});else if($ instanceof T)return T.create(H$($.unwrap()));else if($ instanceof Z)return Z.create(H$($.unwrap()));else if($ instanceof l)return l.create($.items.map((N)=>H$(N)));else return $}class U extends j{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),N=A.objectKeys($);return this._cached={shape:$,keys:N},this._cached}_parse($){if(this._getType($)!==J.object){let B=this._getOrReturnCtx($);return q(B,{code:Y.invalid_type,expected:J.object,received:B.parsedType}),V}let{status:G,ctx:H}=this._processInputParams($),{shape:W,keys:Q}=this._getCached(),R=[];if(!(this._def.catchall instanceof m&&this._def.unknownKeys==="strip")){for(let B in H.data)if(!Q.includes(B))R.push(B)}let _=[];for(let B of Q){let X=W[B],F=H.data[B];_.push({key:{status:"valid",value:B},value:X._parse(new v(H,F,H.path,B)),alwaysSet:B in H.data})}if(this._def.catchall instanceof m){let B=this._def.unknownKeys;if(B==="passthrough")for(let X of R)_.push({key:{status:"valid",value:X},value:{status:"valid",value:H.data[X]}});else if(B==="strict"){if(R.length>0)q(H,{code:Y.unrecognized_keys,keys:R}),G.dirty()}else if(B==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let B=this._def.catchall;for(let X of R){let F=H.data[X];_.push({key:{status:"valid",value:X},value:B._parse(new v(H,F,H.path,X)),alwaysSet:X in H.data})}}if(H.common.async)return Promise.resolve().then(async()=>{let B=[];for(let X of _){let F=await X.key,P=await X.value;B.push({key:F,value:P,alwaysSet:X.alwaysSet})}return B}).then((B)=>{return C.mergeObjectSync(G,B)});else return C.mergeObjectSync(G,_)}get shape(){return this._def.shape()}strict($){return L.errToObj,new U({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(N,G)=>{let H=this._def.errorMap?.(N,G).message??G.defaultError;if(N.code==="unrecognized_keys")return{message:L.errToObj($).message??H};return{message:H}}}:{}})}strip(){return new U({...this._def,unknownKeys:"strip"})}passthrough(){return new U({...this._def,unknownKeys:"passthrough"})}extend($){return new U({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new U({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:z.ZodObject})}setKey($,N){return this.augment({[$]:N})}catchall($){return new U({...this._def,catchall:$})}pick($){let N={};for(let G of A.objectKeys($))if($[G]&&this.shape[G])N[G]=this.shape[G];return new U({...this._def,shape:()=>N})}omit($){let N={};for(let G of A.objectKeys(this.shape))if(!$[G])N[G]=this.shape[G];return new U({...this._def,shape:()=>N})}deepPartial(){return H$(this)}partial($){let N={};for(let G of A.objectKeys(this.shape)){let H=this.shape[G];if($&&!$[G])N[G]=H;else N[G]=H.optional()}return new U({...this._def,shape:()=>N})}required($){let N={};for(let G of A.objectKeys(this.shape))if($&&!$[G])N[G]=this.shape[G];else{let W=this.shape[G];while(W instanceof T)W=W._def.innerType;N[G]=W}return new U({...this._def,shape:()=>N})}keyof(){return bN(A.objectKeys(this.shape))}}U.create=($,N)=>{return new U({shape:()=>$,unknownKeys:"strip",catchall:m.create(),typeName:z.ZodObject,...O(N)})};U.strictCreate=($,N)=>{return new U({shape:()=>$,unknownKeys:"strict",catchall:m.create(),typeName:z.ZodObject,...O(N)})};U.lazycreate=($,N)=>{return new U({shape:$,unknownKeys:"strip",catchall:m.create(),typeName:z.ZodObject,...O(N)})};class Y$ extends j{_parse($){let{ctx:N}=this._processInputParams($),G=this._def.options;function H(W){for(let R of W)if(R.result.status==="valid")return R.result;for(let R of W)if(R.result.status==="dirty")return N.common.issues.push(...R.ctx.common.issues),R.result;let Q=W.map((R)=>new E(R.ctx.common.issues));return q(N,{code:Y.invalid_union,unionErrors:Q}),V}if(N.common.async)return Promise.all(G.map(async(W)=>{let Q={...N,common:{...N.common,issues:[]},parent:null};return{result:await W._parseAsync({data:N.data,path:N.path,parent:Q}),ctx:Q}})).then(H);else{let W=void 0,Q=[];for(let _ of G){let B={...N,common:{...N.common,issues:[]},parent:null},X=_._parseSync({data:N.data,path:N.path,parent:B});if(X.status==="valid")return X;else if(X.status==="dirty"&&!W)W={result:X,ctx:B};if(B.common.issues.length)Q.push(B.common.issues)}if(W)return N.common.issues.push(...W.ctx.common.issues),W.result;let R=Q.map((_)=>new E(_));return q(N,{code:Y.invalid_union,unionErrors:R}),V}}get options(){return this._def.options}}Y$.create=($,N)=>{return new Y$({options:$,typeName:z.ZodUnion,...O(N)})};var y=($)=>{if($ instanceof J$)return y($.schema);else if($ instanceof x)return y($.innerType());else if($ instanceof q$)return[$.value];else if($ instanceof d)return $.options;else if($ instanceof S$)return A.objectValues($.enum);else if($ instanceof M$)return y($._def.innerType);else if($ instanceof X$)return[void 0];else if($ instanceof _$)return[null];else if($ instanceof T)return[void 0,...y($.unwrap())];else if($ instanceof Z)return[null,...y($.unwrap())];else if($ instanceof k$)return y($.unwrap());else if($ instanceof V$)return y($.unwrap());else if($ instanceof L$)return y($._def.innerType);else return[]};class w$ extends j{_parse($){let{ctx:N}=this._processInputParams($);if(N.parsedType!==J.object)return q(N,{code:Y.invalid_type,expected:J.object,received:N.parsedType}),V;let G=this.discriminator,H=N.data[G],W=this.optionsMap.get(H);if(!W)return q(N,{code:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[G]}),V;if(N.common.async)return W._parseAsync({data:N.data,path:N.path,parent:N});else return W._parseSync({data:N.data,path:N.path,parent:N})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,N,G){let H=new Map;for(let W of N){let Q=y(W.shape[$]);if(!Q.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let R of Q){if(H.has(R))throw Error(`Discriminator property ${String($)} has duplicate value ${String(R)}`);H.set(R,W)}}return new w$({typeName:z.ZodDiscriminatedUnion,discriminator:$,options:N,optionsMap:H,...O(G)})}}function l$($,N){let G=I($),H=I(N);if($===N)return{valid:!0,data:$};else if(G===J.object&&H===J.object){let W=A.objectKeys(N),Q=A.objectKeys($).filter((_)=>W.indexOf(_)!==-1),R={...$,...N};for(let _ of Q){let B=l$($[_],N[_]);if(!B.valid)return{valid:!1};R[_]=B.data}return{valid:!0,data:R}}else if(G===J.array&&H===J.array){if($.length!==N.length)return{valid:!1};let W=[];for(let Q=0;Q<$.length;Q++){let R=$[Q],_=N[Q],B=l$(R,_);if(!B.valid)return{valid:!1};W.push(B.data)}return{valid:!0,data:W}}else if(G===J.date&&H===J.date&&+$===+N)return{valid:!0,data:$};else return{valid:!1}}class B$ extends j{_parse($){let{status:N,ctx:G}=this._processInputParams($),H=(W,Q)=>{if(K$(W)||K$(Q))return V;let R=l$(W.value,Q.value);if(!R.valid)return q(G,{code:Y.invalid_intersection_types}),V;if(E$(W)||E$(Q))N.dirty();return{status:N.value,value:R.data}};if(G.common.async)return Promise.all([this._def.left._parseAsync({data:G.data,path:G.path,parent:G}),this._def.right._parseAsync({data:G.data,path:G.path,parent:G})]).then(([W,Q])=>H(W,Q));else return H(this._def.left._parseSync({data:G.data,path:G.path,parent:G}),this._def.right._parseSync({data:G.data,path:G.path,parent:G}))}}B$.create=($,N,G)=>{return new B$({left:$,right:N,typeName:z.ZodIntersection,...O(G)})};class l extends j{_parse($){let{status:N,ctx:G}=this._processInputParams($);if(G.parsedType!==J.array)return q(G,{code:Y.invalid_type,expected:J.array,received:G.parsedType}),V;if(G.data.length<this._def.items.length)return q(G,{code:Y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;if(!this._def.rest&&G.data.length>this._def.items.length)q(G,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N.dirty();let W=[...G.data].map((Q,R)=>{let _=this._def.items[R]||this._def.rest;if(!_)return null;return _._parse(new v(G,Q,G.path,R))}).filter((Q)=>!!Q);if(G.common.async)return Promise.all(W).then((Q)=>{return C.mergeArray(N,Q)});else return C.mergeArray(N,W)}get items(){return this._def.items}rest($){return new l({...this._def,rest:$})}}l.create=($,N)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new l({items:$,typeName:z.ZodTuple,rest:null,...O(N)})};class A$ extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:N,ctx:G}=this._processInputParams($);if(G.parsedType!==J.object)return q(G,{code:Y.invalid_type,expected:J.object,received:G.parsedType}),V;let H=[],W=this._def.keyType,Q=this._def.valueType;for(let R in G.data)H.push({key:W._parse(new v(G,R,G.path,R)),value:Q._parse(new v(G,G.data[R],G.path,R)),alwaysSet:R in G.data});if(G.common.async)return C.mergeObjectAsync(N,H);else return C.mergeObjectSync(N,H)}get element(){return this._def.valueType}static create($,N,G){if(N instanceof j)return new A$({keyType:$,valueType:N,typeName:z.ZodRecord,...O(G)});return new A$({keyType:D.create(),valueType:$,typeName:z.ZodRecord,...O(N)})}}class U$ extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:N,ctx:G}=this._processInputParams($);if(G.parsedType!==J.map)return q(G,{code:Y.invalid_type,expected:J.map,received:G.parsedType}),V;let H=this._def.keyType,W=this._def.valueType,Q=[...G.data.entries()].map(([R,_],B)=>{return{key:H._parse(new v(G,R,G.path,[B,"key"])),value:W._parse(new v(G,_,G.path,[B,"value"]))}});if(G.common.async){let R=new Map;return Promise.resolve().then(async()=>{for(let _ of Q){let B=await _.key,X=await _.value;if(B.status==="aborted"||X.status==="aborted")return V;if(B.status==="dirty"||X.status==="dirty")N.dirty();R.set(B.value,X.value)}return{status:N.value,value:R}})}else{let R=new Map;for(let _ of Q){let{key:B,value:X}=_;if(B.status==="aborted"||X.status==="aborted")return V;if(B.status==="dirty"||X.status==="dirty")N.dirty();R.set(B.value,X.value)}return{status:N.value,value:R}}}}U$.create=($,N,G)=>{return new U$({valueType:N,keyType:$,typeName:z.ZodMap,...O(G)})};class s extends j{_parse($){let{status:N,ctx:G}=this._processInputParams($);if(G.parsedType!==J.set)return q(G,{code:Y.invalid_type,expected:J.set,received:G.parsedType}),V;let H=this._def;if(H.minSize!==null){if(G.data.size<H.minSize.value)q(G,{code:Y.too_small,minimum:H.minSize.value,type:"set",inclusive:!0,exact:!1,message:H.minSize.message}),N.dirty()}if(H.maxSize!==null){if(G.data.size>H.maxSize.value)q(G,{code:Y.too_big,maximum:H.maxSize.value,type:"set",inclusive:!0,exact:!1,message:H.maxSize.message}),N.dirty()}let W=this._def.valueType;function Q(_){let B=new Set;for(let X of _){if(X.status==="aborted")return V;if(X.status==="dirty")N.dirty();B.add(X.value)}return{status:N.value,value:B}}let R=[...G.data.values()].map((_,B)=>W._parse(new v(G,_,G.path,B)));if(G.common.async)return Promise.all(R).then((_)=>Q(_));else return Q(R)}min($,N){return new s({...this._def,minSize:{value:$,message:L.toString(N)}})}max($,N){return new s({...this._def,maxSize:{value:$,message:L.toString(N)}})}size($,N){return this.min($,N).max($,N)}nonempty($){return this.min(1,$)}}s.create=($,N)=>{return new s({valueType:$,minSize:null,maxSize:null,typeName:z.ZodSet,...O(N)})};class R$ extends j{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:N}=this._processInputParams($);if(N.parsedType!==J.function)return q(N,{code:Y.invalid_type,expected:J.function,received:N.parsedType}),V;function G(R,_){return z$({data:R,path:N.path,errorMaps:[N.common.contextualErrorMap,N.schemaErrorMap,G$(),h].filter((B)=>!!B),issueData:{code:Y.invalid_arguments,argumentsError:_}})}function H(R,_){return z$({data:R,path:N.path,errorMaps:[N.common.contextualErrorMap,N.schemaErrorMap,G$(),h].filter((B)=>!!B),issueData:{code:Y.invalid_return_type,returnTypeError:_}})}let W={errorMap:N.common.contextualErrorMap},Q=N.data;if(this._def.returns instanceof e){let R=this;return K(async function(..._){let B=new E([]),X=await R._def.args.parseAsync(_,W).catch((w)=>{throw B.addIssue(G(_,w)),B}),F=await Reflect.apply(Q,this,X);return await R._def.returns._def.type.parseAsync(F,W).catch((w)=>{throw B.addIssue(H(F,w)),B})})}else{let R=this;return K(function(..._){let B=R._def.args.safeParse(_,W);if(!B.success)throw new E([G(_,B.error)]);let X=Reflect.apply(Q,this,B.data),F=R._def.returns.safeParse(X,W);if(!F.success)throw new E([H(X,F.error)]);return F.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new R$({...this._def,args:l.create($).rest(p.create())})}returns($){return new R$({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,N,G){return new R$({args:$?$:l.create([]).rest(p.create()),returns:N||p.create(),typeName:z.ZodFunction,...O(G)})}}class J$ extends j{get schema(){return this._def.getter()}_parse($){let{ctx:N}=this._processInputParams($);return this._def.getter()._parse({data:N.data,path:N.path,parent:N})}}J$.create=($,N)=>{return new J$({getter:$,typeName:z.ZodLazy,...O(N)})};class q$ extends j{_parse($){if($.data!==this._def.value){let N=this._getOrReturnCtx($);return q(N,{received:N.data,code:Y.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:$.data}}get value(){return this._def.value}}q$.create=($,N)=>{return new q$({value:$,typeName:z.ZodLiteral,...O(N)})};function bN($,N){return new d({values:$,typeName:z.ZodEnum,...O(N)})}class d extends j{_parse($){if(typeof $.data!=="string"){let N=this._getOrReturnCtx($),G=this._def.values;return q(N,{expected:A.joinValues(G),received:N.parsedType,code:Y.invalid_type}),V}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let N=this._getOrReturnCtx($),G=this._def.values;return q(N,{received:N.data,code:Y.invalid_enum_value,options:G}),V}return K($.data)}get options(){return this._def.values}get enum(){let $={};for(let N of this._def.values)$[N]=N;return $}get Values(){let $={};for(let N of this._def.values)$[N]=N;return $}get Enum(){let $={};for(let N of this._def.values)$[N]=N;return $}extract($,N=this._def){return d.create($,{...this._def,...N})}exclude($,N=this._def){return d.create(this.options.filter((G)=>!$.includes(G)),{...this._def,...N})}}d.create=bN;class S$ extends j{_parse($){let N=A.getValidEnumValues(this._def.values),G=this._getOrReturnCtx($);if(G.parsedType!==J.string&&G.parsedType!==J.number){let H=A.objectValues(N);return q(G,{expected:A.joinValues(H),received:G.parsedType,code:Y.invalid_type}),V}if(!this._cache)this._cache=new Set(A.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let H=A.objectValues(N);return q(G,{received:G.data,code:Y.invalid_enum_value,options:H}),V}return K($.data)}get enum(){return this._def.values}}S$.create=($,N)=>{return new S$({values:$,typeName:z.ZodNativeEnum,...O(N)})};class e extends j{unwrap(){return this._def.type}_parse($){let{ctx:N}=this._processInputParams($);if(N.parsedType!==J.promise&&N.common.async===!1)return q(N,{code:Y.invalid_type,expected:J.promise,received:N.parsedType}),V;let G=N.parsedType===J.promise?N.data:Promise.resolve(N.data);return K(G.then((H)=>{return this._def.type.parseAsync(H,{path:N.path,errorMap:N.common.contextualErrorMap})}))}}e.create=($,N)=>{return new e({type:$,typeName:z.ZodPromise,...O(N)})};class x extends j{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:N,ctx:G}=this._processInputParams($),H=this._def.effect||null,W={addIssue:(Q)=>{if(q(G,Q),Q.fatal)N.abort();else N.dirty()},get path(){return G.path}};if(W.addIssue=W.addIssue.bind(W),H.type==="preprocess"){let Q=H.transform(G.data,W);if(G.common.async)return Promise.resolve(Q).then(async(R)=>{if(N.value==="aborted")return V;let _=await this._def.schema._parseAsync({data:R,path:G.path,parent:G});if(_.status==="aborted")return V;if(_.status==="dirty")return i(_.value);if(N.value==="dirty")return i(_.value);return _});else{if(N.value==="aborted")return V;let R=this._def.schema._parseSync({data:Q,path:G.path,parent:G});if(R.status==="aborted")return V;if(R.status==="dirty")return i(R.value);if(N.value==="dirty")return i(R.value);return R}}if(H.type==="refinement"){let Q=(R)=>{let _=H.refinement(R,W);if(G.common.async)return Promise.resolve(_);if(_ instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return R};if(G.common.async===!1){let R=this._def.schema._parseSync({data:G.data,path:G.path,parent:G});if(R.status==="aborted")return V;if(R.status==="dirty")N.dirty();return Q(R.value),{status:N.value,value:R.value}}else return this._def.schema._parseAsync({data:G.data,path:G.path,parent:G}).then((R)=>{if(R.status==="aborted")return V;if(R.status==="dirty")N.dirty();return Q(R.value).then(()=>{return{status:N.value,value:R.value}})})}if(H.type==="transform")if(G.common.async===!1){let Q=this._def.schema._parseSync({data:G.data,path:G.path,parent:G});if(!u(Q))return V;let R=H.transform(Q.value,W);if(R instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:N.value,value:R}}else return this._def.schema._parseAsync({data:G.data,path:G.path,parent:G}).then((Q)=>{if(!u(Q))return V;return Promise.resolve(H.transform(Q.value,W)).then((R)=>({status:N.value,value:R}))});A.assertNever(H)}}x.create=($,N,G)=>{return new x({schema:$,typeName:z.ZodEffects,effect:N,...O(G)})};x.createWithPreprocess=($,N,G)=>{return new x({schema:N,effect:{type:"preprocess",transform:$},typeName:z.ZodEffects,...O(G)})};class T extends j{_parse($){if(this._getType($)===J.undefined)return K(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}T.create=($,N)=>{return new T({innerType:$,typeName:z.ZodOptional,...O(N)})};class Z extends j{_parse($){if(this._getType($)===J.null)return K(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Z.create=($,N)=>{return new Z({innerType:$,typeName:z.ZodNullable,...O(N)})};class M$ extends j{_parse($){let{ctx:N}=this._processInputParams($),G=N.data;if(N.parsedType===J.undefined)G=this._def.defaultValue();return this._def.innerType._parse({data:G,path:N.path,parent:N})}removeDefault(){return this._def.innerType}}M$.create=($,N)=>{return new M$({innerType:$,typeName:z.ZodDefault,defaultValue:typeof N.default==="function"?N.default:()=>N.default,...O(N)})};class L$ extends j{_parse($){let{ctx:N}=this._processInputParams($),G={...N,common:{...N.common,issues:[]}},H=this._def.innerType._parse({data:G.data,path:G.path,parent:{...G}});if(W$(H))return H.then((W)=>{return{status:"valid",value:W.status==="valid"?W.value:this._def.catchValue({get error(){return new E(G.common.issues)},input:G.data})}});else return{status:"valid",value:H.status==="valid"?H.value:this._def.catchValue({get error(){return new E(G.common.issues)},input:G.data})}}removeCatch(){return this._def.innerType}}L$.create=($,N)=>{return new L$({innerType:$,typeName:z.ZodCatch,catchValue:typeof N.catch==="function"?N.catch:()=>N.catch,...O(N)})};class b$ extends j{_parse($){if(this._getType($)!==J.nan){let G=this._getOrReturnCtx($);return q(G,{code:Y.invalid_type,expected:J.nan,received:G.parsedType}),V}return{status:"valid",value:$.data}}}b$.create=($)=>{return new b$({typeName:z.ZodNaN,...O($)})};var OG=Symbol("zod_brand");class k$ extends j{_parse($){let{ctx:N}=this._processInputParams($),G=N.data;return this._def.type._parse({data:G,path:N.path,parent:N})}unwrap(){return this._def.type}}class P$ extends j{_parse($){let{status:N,ctx:G}=this._processInputParams($);if(G.common.async)return(async()=>{let W=await this._def.in._parseAsync({data:G.data,path:G.path,parent:G});if(W.status==="aborted")return V;if(W.status==="dirty")return N.dirty(),i(W.value);else return this._def.out._parseAsync({data:W.value,path:G.path,parent:G})})();else{let H=this._def.in._parseSync({data:G.data,path:G.path,parent:G});if(H.status==="aborted")return V;if(H.status==="dirty")return N.dirty(),{status:"dirty",value:H.value};else return this._def.out._parseSync({data:H.value,path:G.path,parent:G})}}static create($,N){return new P$({in:$,out:N,typeName:z.ZodPipeline})}}class V$ extends j{_parse($){let N=this._def.innerType._parse($),G=(H)=>{if(u(H))H.value=Object.freeze(H.value);return H};return W$(N)?N.then((H)=>G(H)):G(N)}unwrap(){return this._def.innerType}}V$.create=($,N)=>{return new V$({innerType:$,typeName:z.ZodReadonly,...O(N)})};function ON($,N){let G=typeof $==="function"?$(N):typeof $==="string"?{message:$}:$;return typeof G==="string"?{message:G}:G}function PN($,N={},G){if($)return t.create().superRefine((H,W)=>{let Q=$(H);if(Q instanceof Promise)return Q.then((R)=>{if(!R){let _=ON(N,H),B=_.fatal??G??!0;W.addIssue({code:"custom",..._,fatal:B})}});if(!Q){let R=ON(N,H),_=R.fatal??G??!0;W.addIssue({code:"custom",...R,fatal:_})}return});return t.create()}var jG={object:U.lazycreate},z;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(z||(z={}));var AG=($,N={message:`Input not instance of ${$.name}`})=>PN((G)=>G instanceof $,N),CN=D.create,fN=r.create,UG=b$.create,bG=a.create,KN=Q$.create,PG=o.create,CG=O$.create,fG=X$.create,KG=_$.create,EG=t.create,wG=p.create,kG=m.create,DG=j$.create,gG=g.create,TG=U.create,vG=U.strictCreate,xG=Y$.create,IG=w$.create,mG=B$.create,lG=l.create,hG=A$.create,yG=U$.create,ZG=s.create,cG=R$.create,uG=J$.create,pG=q$.create,rG=d.create,aG=S$.create,dG=e.create,nG=x.create,iG=T.create,oG=Z.create,tG=x.createWithPreprocess,sG=P$.create,eG=()=>CN().optional(),$W=()=>fN().optional(),NW=()=>KN().optional(),GW={string:($)=>D.create({...$,coerce:!0}),number:($)=>r.create({...$,coerce:!0}),boolean:($)=>Q$.create({...$,coerce:!0}),bigint:($)=>a.create({...$,coerce:!0}),date:($)=>o.create({...$,coerce:!0})};var WW=V;var HW=M.object({id:M.string(),signalId:M.string(),type:M.enum(["info","success","warning","error"]),sourceType:M.string(),sourceId:M.string(),serviceId:M.string().optional(),payload:M.unknown(),occurredAt:M.string()});function D$($){if(typeof $==="function"){let G=$;return G.kind==="action"&&typeof G.id==="string"?{actionId:G.id}:void 0}if(Array.isArray($))return $.map(D$);if(!$||typeof $!=="object")return $;let N=$;if(N.kind==="action-binding"&&typeof N.actionId==="string")return{actionId:N.actionId,..."input"in N?{input:D$(N.input)}:{}};return Object.fromEntries(Object.entries(N).map(([G,H])=>[G,D$(H)]))}function S($){if(!$.id)throw Error("Component id must be a non-empty string");if(!$.render&&!$.path)throw Error("Component requires either render or path");if($.render&&$.path)throw Error("Component accepts either render or path, not both");if($.path!==void 0&&!$.path)throw Error("Component path must be a non-empty string");return Object.assign((G)=>{if(!$.path)return $.render(G);let H=G??{},W=$.props?$.props.parse(H):H;return{kind:"custom",props:{component:$.id,path:$.path,props:D$(W)}}},{kind:"component",id:$.id})}var h$=S({id:"badge",path:"./ui/badge"});var y$=S({id:"button",path:"./ui/button"});var $$=S({id:"card",render:($)=>({kind:"card",props:{...$,variant:$.variant??"default"}})});var VW=M.object({time:M.number().finite(),value:M.number().finite()}),FW=M.object({label:M.string().min(1),secs:M.number().positive()}),Z$=S({id:"chart",path:"./ui/chart",props:M.object({source:M.custom().optional(),points:M.array(VW).optional(),windows:M.array(FW).optional(),kind:M.enum(["line","area"]).optional(),exaggerate:M.boolean().optional(),lineWidth:M.number().optional(),showValue:M.boolean().optional(),label:M.string().min(1).optional(),scale:M.enum(["higher-is-better","higher-is-worse"]).optional(),referenceLine:M.object({value:M.number(),label:M.string().optional()}).optional(),referenceLines:M.array(M.object({value:M.number(),label:M.string().optional()})).optional(),yRange:M.object({min:M.number().finite(),max:M.number().finite(),unit:M.string().optional()}).refine(($)=>$.max>$.min,{message:"Chart yRange max must be greater than min"}).optional()}).refine(($)=>!($.source&&$.points),{message:"Chart accepts either a source or points, not both"})});var c$=S({id:"code-block",path:"./ui/code-block"});var u$=S({id:"code-editor",render:($)=>({kind:"code-editor",props:{...$}})});var p$=S({id:"code-explorer",path:"./ui/code-explorer"});var r$=S({id:"collection",render:($)=>{if(!$.source&&!$.field)throw Error("Collection requires a source or context field");return{kind:"collection",props:{...$}}}});var a$=S({id:"columns",render:($)=>{if($.columns.length===0)throw Error("Columns requires at least one column");return{kind:"columns",props:{...$,columns:[...$.columns]}}}});var d$=S({id:"flex",render:($)=>({kind:"flex",props:{...$,direction:$.direction??"row",gap:$.gap??"md",align:$.align??"stretch",justify:$.justify??"start",wrap:$.wrap??!1}})});var n$=S({id:"form",render:($)=>({kind:"form",props:{...$,fields:$.fields?[...$.fields]:void 0}})});var i$=S({id:"gauge",render:($)=>{let N=$.value;if(!Number.isFinite(N))throw Error("Gauge value must be a finite number");let G=$.max??100;if(!Number.isFinite(G)||G<=0)throw Error("Gauge max must be a positive number");return{kind:"gauge",props:{value:N,max:G,...$.tone?{tone:$.tone}:{},...$.scale?{scale:$.scale}:{},...$.showValue===!1?{showValue:!1}:{},...$.label?{label:$.label}:{}}}}});var C$=S({id:"grid",render:($)=>{if($.columns!==void 0&&(!Number.isInteger($.columns)||$.columns<1||$.columns>6))throw Error("Grid columns must be an integer between 1 and 6");return{kind:"grid",props:{...$,gap:$.gap??"md"}}}});var o$=S({id:"icon",path:"./ui/icon"});var t$=S({id:"key-value",path:"./ui/key-value"});var s$=S({id:"link",path:"./ui/link"});var DN=S({id:"list",path:"./ui/list"});var e$=S({id:"meter",render:($)=>{if($.data){if($.data.segments.length===0)throw Error("Meter requires at least one segment");for(let N of $.data.segments){if(!N.label)throw Error("Meter segments require a label");if(!Number.isFinite(N.value)||N.value<0)throw Error("Meter segment values must be finite and non-negative")}}return{kind:"meter",props:{...$,data:$.data?{...$.data,segments:[...$.data.segments]}:void 0}}}});var $N=S({id:"notebook",path:"./ui/notebook"});var NN=S({id:"notebook-catalog",path:"./ui/notebook-catalog"});var GN=S({id:"page-header",render:($)=>{if(!$.title)throw Error("PageHeader requires a title");return{kind:"page-header",props:{...$}}}});var WN=S({id:"query-editor",path:"./ui/query-editor"});var HN=S({id:"resource",render:($)=>({kind:"resource",props:{...$}})});var RN=S({id:"resource-tree",render:($)=>{if(!$.label)throw Error("ResourceTree requires a label");return{kind:"resource-tree",props:{...$}}}});var f$=S({id:"section",render:($)=>{if(!$.title)throw Error("Section requires a title");if($.link?.path&&!$.link.path.startsWith("/"))throw Error("Section link path must be absolute");return{kind:"section",props:{...$}}}});var QN=S({id:"select",path:"./ui/select"});var XN=S({id:"split-pane",render:($)=>({kind:"split-pane",props:{...$}})});var _N=S({id:"stack",render:($)=>({kind:"stack",props:{...$,gap:$.gap??"md"}})});var YN=S({id:"table",path:"./ui/table"});var BN=S({id:"tabs",render:($)=>{if($.items.length===0)throw Error("Tabs requires at least one item");for(let N of $.items)if(N.link&&!N.link.startsWith("/"))throw Error("Tabs item link must be absolute");if($.defaultIndex!==void 0&&($.defaultIndex<0||$.defaultIndex>=$.items.length))throw Error("Tabs defaultIndex must reference an item");return{kind:"tabs",props:{items:[...$.items],...$.defaultIndex===void 0?{}:{defaultIndex:$.defaultIndex},...$.variant?{variant:$.variant}:{}}}}});var gN=S({id:"target",path:"./ui/target"});var JN=S({id:"text-input",path:"./ui/text-input"});var qN=S({id:"value",path:"./ui/value"});class N$ extends Error{constructor($){super($);this.name="UnserializablePageError"}}function c($){return{resourceId:$.resourceId,...$.input===void 0?{}:{input:$.input},...$.refresh?{refresh:$.refresh}:{}}}function k($){if(typeof $==="string")return{actionId:$};if("field"in $)return $;return $.kind==="action-binding"?{actionId:$.actionId,input:$.input}:{actionId:$.id}}function TN($){return{source:c($.source),...$.nameField?{nameField:$.nameField}:{},...$.typeField?{typeField:$.typeField}:{},...$.children?{children:TN($.children)}:{}}}function vN($){return{source:c($.source),...$.nameField?{nameField:$.nameField}:{},...$.typeField?{typeField:$.typeField}:{},...$.rowLink?{rowLink:{path:$.rowLink.path,params:{...$.rowLink.params}}}:{},...$.children?{children:vN($.children)}:{}}}function f($){return(Array.isArray($)?$:[$]).map(SN)}function SN($){switch($.kind){case"page-header":return{kind:$.kind,props:{title:$.props.title,...$.props.description?{description:$.props.description}:{},...$.props.badge?{badge:{...$.props.badge}}:{},...$.props.meta?{meta:$.props.meta}:{},...$.props.variant?{variant:$.props.variant}:{},...$.props.tags?{tags:f($.props.tags)}:{},...$.props.actions?{actions:f($.props.actions)}:{}}};case"table":return{kind:$.kind,props:{...$.props.source?{source:c($.props.source)}:{},...$.props.columnsSource?{columnsSource:c($.props.columnsSource)}:{},...$.props.data?{data:$.props.data}:{},...$.props.variant?{variant:$.props.variant}:{},...$.props.searchable?{searchable:!0}:{},...$.props.filters?{filters:$.props.filters.map((N)=>({field:N.field,label:N.label,options:N.options.map((G)=>({...G}))}))}:{},...$.props.pageSize?{pageSize:$.props.pageSize}:{},...$.props.columns?{columns:$.props.columns.map((N)=>({id:N.id,label:N.label,...N.format?{format:N.format}:{},...N.renderCell?{renderCell:f(N.renderCell)}:{}}))}:{},...$.props.rowLink?{rowLink:{path:$.props.rowLink.path,params:{...$.props.rowLink.params}}}:{},...$.props.rowActions?{rowActions:$.props.rowActions.map((N)=>({label:N.label,...N.icon?{icon:N.icon}:{},...N.variant?{variant:N.variant}:{},...N.action?{action:{actionId:typeof N.action==="string"?N.action:N.action.id,...N.input?{input:{...N.input}}:{}}}:{},...N.link?{link:{path:N.link.path,params:{...N.link.params}}}:{},...N.successLink?{successLink:{path:N.successLink.path,params:{...N.successLink.params}}}:{},...N.when?{when:{...N.when}}:{},...N.disabledWhen?{disabledWhen:{...N.disabledWhen}}:{},...N.confirmation?{confirmation:{...N.confirmation}}:{}}))}:{},...$.props.actions?{actions:$.props.actions.map((N)=>({label:N.label,...N.link?{link:{path:N.link.path,params:{...N.link.params}}}:{},...N.action?{action:{actionId:typeof N.action==="string"?N.action:N.action.id,...N.input?{input:{...N.input}}:{}}}:{},...N.successLink?{successLink:{path:N.successLink.path,params:{...N.successLink.params}}}:{},...N.when?{when:{...N.when}}:{},...N.confirmation?{confirmation:{...N.confirmation}}:{}}))}:{}}};case"button":return{kind:$.kind,props:{label:$.props.label,...$.props.icon?{icon:$.props.icon}:{},...$.props.description?{description:$.props.description}:{},...$.props.kbd?{kbd:$.props.kbd}:{},...$.props.variant?{variant:$.props.variant}:{},...$.props.action?{action:k($.props.action)}:{},...$.props.successLink?{successLink:{path:$.props.successLink.path,params:{...$.props.successLink.params}}}:{},...$.props.link?{link:$.props.link}:{},...$.props.confirmation?{confirmation:$.props.confirmation}:{}}};case"icon":return{kind:$.kind,props:{name:$.props.name,...$.props.size?{size:$.props.size}:{}}};case"badge":return{kind:$.kind,props:{label:$.props.label,...$.props.tone?{tone:$.props.tone}:{},...$.props.dot?{dot:!0}:{}}};case"tabs":return{kind:$.kind,props:{items:$.props.items.map((N)=>({label:N.label,content:f(N.content),...N.link?{link:N.link}:{}})),...$.props.defaultIndex===void 0?{}:{defaultIndex:$.props.defaultIndex},...$.props.variant?{variant:$.props.variant}:{}}};case"key-value":return{kind:$.kind,props:{...$.props.title?{title:$.props.title}:{},...$.props.source?{source:c($.props.source)}:{},...$.props.data?{data:{...$.props.data}}:{}}};case"query-editor":return{kind:$.kind,props:{language:$.props.language,...$.props.value!==void 0?{value:$.props.value}:{},action:k($.props.action),...$.props.explorer?{explorer:TN($.props.explorer)}:{}}};case"resource-tree":return{kind:$.kind,props:{label:$.props.label,branch:vN($.props.branch),...$.props.selectedPath?{selectedPath:$.props.selectedPath}:{},...$.props.stateKey?{stateKey:$.props.stateKey}:{},...$.props.searchPlaceholder?{searchPlaceholder:$.props.searchPlaceholder}:{}}};case"resource":{let N=$.props;return{kind:$.kind,props:{...N.source?{source:c(N.source)}:{},content:f(N.content)}}}case"link":return{kind:$.kind,props:{...$.props}};case"code-block":return{kind:$.kind,props:{...$.props}};case"notebook":return{kind:$.kind,props:{...$.props.id?{id:$.props.id}:{},title:$.props.title,...$.props.description?{description:$.props.description}:{},...$.props.notebooks?{notebooks:$.props.notebooks.map((N)=>({...N}))}:{},...$.props.openTabs?{openTabs:$.props.openTabs.map((N)=>({...N}))}:{},...$.props.metadata?{metadata:{...$.props.metadata}}:{},...$.props.actions?{actions:{...$.props.actions.save?{save:k($.props.actions.save)}:{},...$.props.actions.select?{select:k($.props.actions.select)}:{},...$.props.actions.create?{create:k($.props.actions.create)}:{},...$.props.actions.delete?{delete:k($.props.actions.delete)}:{},...$.props.actions.duplicate?{duplicate:k($.props.actions.duplicate)}:{},...$.props.actions.import?{import:k($.props.actions.import)}:{},...$.props.actions.close?{close:k($.props.actions.close)}:{}}}:{},blocks:$.props.blocks.map((N)=>N.kind==="code"?{...N,action:k(N.action)}:{...N})}};case"notebook-catalog":return{kind:$.kind,props:{notebooks:$.props.notebooks.map((N)=>({...N})),...$.props.actions?{actions:{...$.props.actions.create?{create:k($.props.actions.create)}:{},...$.props.actions.import?{import:k($.props.actions.import)}:{}}}:{}}};case"split-pane":return{kind:$.kind,props:{sidebar:f($.props.sidebar),content:f($.props.content),...$.props.inspector?{inspector:f($.props.inspector)}:{}}};case"select":if($.props.onChange)throw new N$("Select callbacks cannot be serialized");return{kind:$.kind,props:{name:$.props.name,...$.props.label?{label:$.props.label}:{},options:$.props.options,...$.props.value!==void 0?{value:$.props.value}:{},...$.props.placeholder?{placeholder:$.props.placeholder}:{}}};case"text-input":if($.props.onChange)throw new N$("Text input callbacks cannot be serialized");return{kind:$.kind,props:{name:$.props.name,...$.props.label?{label:$.props.label}:{},...$.props.value!==void 0?{value:$.props.value}:{},...$.props.placeholder?{placeholder:$.props.placeholder}:{},...$.props.secret?{secret:!0}:{}}};case"form":return{kind:$.kind,props:{fields:f($.props.fields??[]),action:k($.props.onSubmit),...$.props.submitLabel?{submitLabel:$.props.submitLabel}:{}}};case"code-editor":throw new N$("Code editor nodes require a browser-state protocol");case"custom":return{kind:$.kind,props:{component:$.props.component,path:$.props.path,...$.props.browserUrl?{browserUrl:$.props.browserUrl}:{},...$.props.props?{props:{...$.props.props}}:{}}};case"section":return{kind:$.kind,props:{title:$.props.title,...$.props.description?{description:$.props.description}:{},...$.props.link?{link:{...$.props.link}}:{},content:f($.props.content)}};case"card":{let N=$.props;return{kind:$.kind,props:{...N.title?{title:N.title}:{},...N.description?{description:N.description}:{},...N.icon?{icon:N.icon}:{},...N.badge?{badge:N.badge}:{},...N.badgeTone?{badgeTone:N.badgeTone}:{},...N.link?{link:{...N.link}}:{},...N.variant?{variant:N.variant}:{},...N.content?{content:f(N.content)}:{}}}}case"collection":{let N=$.props;return{kind:$.kind,props:{...N.source?{source:c(N.source)}:{},...N.field?{field:N.field}:{},content:f(N.content)}}}case"flex":{let N=$.props;return{kind:$.kind,props:{direction:N.direction,...N.gap?{gap:N.gap}:{},...N.align?{align:N.align}:{},...N.justify?{justify:N.justify}:{},...N.wrap?{wrap:!0}:{},content:f(N.content)}}}case"columns":return{kind:$.kind,props:{columns:$.props.columns.map((N)=>({...N.weight!==void 0?{weight:N.weight}:{},content:f(N.content)}))}};case"grid":{let N=$.props;return{kind:$.kind,props:{...N.columns!==void 0?{columns:N.columns}:{},...N.gap?{gap:N.gap}:{},content:f(N.content)}}}case"stack":{let N=$.props;return{kind:$.kind,props:{...N.gap?{gap:N.gap}:{},content:f(N.content)}}}case"value":{let N=$.props;return{kind:$.kind,props:{...N.source?{source:c(N.source)}:{},field:N.field,...N.format?{format:N.format}:{},...N.fallback?{fallback:N.fallback}:{}}}}case"gauge":return{kind:$.kind,props:{value:$.props.value,...$.props.max!==void 0?{max:$.props.max}:{},...$.props.tone?{tone:$.props.tone}:{},...$.props.scale?{scale:$.props.scale}:{},...$.props.showValue===!1?{showValue:!1}:{},...$.props.label?{label:$.props.label}:{}}};case"meter":return{kind:$.kind,props:{...$.props.field?{field:$.props.field}:{},...$.props.source?{source:c($.props.source)}:{},...$.props.format?{format:$.props.format}:{},...$.props.data?{data:{segments:$.props.data.segments.map((N)=>({...N})),...$.props.data.format?{format:$.props.data.format}:{},...$.props.data.footer?{footer:$.props.data.footer}:{}}}:{}}};default:throw new N$(`Unsupported component kind: ${$.kind}`)}}function F$($){return f($)}class MN extends Error{code;constructor($,N){super(N);this.name="SdkError",this.code=$}}class b extends MN{constructor($){super("INVALID_DEFINITION",$);this.name="InvalidDefinitionError"}}function LN($){if(!$.path.startsWith("/"))throw new b(`Page path must start with "/": ${$.path}`);return{kind:"page",path:$.path,render:$.render}}function lN($,N,G){return $.query(N,G)}function VN($,N){if(!N||typeof N!=="string")throw new b(`${$} id must be a non-empty string`)}function T$($){if(VN("Slot",$.id),!$.slot)throw new b("Slot name must be a non-empty string");if($.slot==="overlay"&&!$.presentation)throw new b('Overlay slots require a presentation, such as { mode: "modal" }');if($.slot!=="overlay"&&$.presentation)throw new b("Only overlay slots may specify a presentation");if($.presentation?.mode==="anchored"&&!$.presentation.target.trim())throw new b("Anchored overlays require a target id");if($.presentation?.mode==="anchored"&&$.presentation.placement!==void 0&&!["top","right","bottom","left"].includes($.presentation.placement))throw new b("Invalid anchored overlay placement");if($.presentation&&$.presentation.mode!=="modal"&&$.presentation.mode!=="drawer"&&$.presentation.mode!=="anchored")throw new b("Invalid overlay presentation mode");if($.presentation?.mode==="anchored"&&$.presentation.path!==void 0&&(!$.presentation.path.startsWith("/")||$.presentation.path.startsWith("//")||Array.from($.presentation.path).some((N)=>N==="\\"||N.charCodeAt(0)<32)))throw new b("Overlay paths must be local app paths");if($.presentation?.mode==="anchored"){let{dock:N,advanceOn:G}=$.presentation;if(N!==void 0&&N!=="bottom-right")throw new b("Invalid overlay dock");if(G&&(!G.target.trim()||!G.event.trim()||!G.overlay.trim()||G.serviceId!==void 0&&!G.serviceId.trim()||G.pluginId!==void 0&&!G.pluginId.trim()||G.serviceId!==void 0&&G.pluginId!==void 0))throw new b("Invalid overlay interaction binding")}if($.presentation?.mode==="drawer"&&$.presentation.width!==void 0&&(!Number.isInteger($.presentation.width)||$.presentation.width<320||$.presentation.width>900))throw new b("Drawer width must be between 320 and 900 pixels");return{kind:"slot",id:$.id,slot:$.slot,...$.order===void 0?{}:{order:$.order},...$.presentation?{presentation:$.presentation}:{},render:$.render}}function v$(){throw Error("Plugin host capability is unavailable")}function hN($){return{kind:"dsui-plugin",...$,prepare(G,H){let W=$.configSchema.parse(G),Q=new Map,R={pluginId:$.metadata.id,config:W,services:{...H.services,executeAction:(_,B,X,F)=>H.services.executeAction(_,B,X,{...F,origin:{pluginId:$.metadata.id,...F?.origin?.runId?{runId:F.origin.runId}:{}}})},plugins:{...H.plugins,executeAction:(_,B,X,F)=>H.plugins.executeAction(_,B,X,{...F,origin:{pluginId:$.metadata.id,...F?.origin?.runId?{runId:F.origin.runId}:{}}})},storage:H.storage,stores:{get:(_)=>H.stores.get(_),create:(_)=>H.stores.create(_)},logger:H.logger,access:H.access??{require:async()=>v$()},jobs:H.jobs??{enqueue:async()=>v$()},events:{read:async(_)=>{if(!H.events?.read)v$();return H.events.read(_)},emit:async(_,B,X)=>{let F=Q.get(_);if(!F)throw Error(`Undeclared plugin signal "${_}"`);if(!H.events)v$();await H.events.emit(_,F.payload.parse(B),X,F.type??"info")}}};return{setup(_){let B={signal:(X)=>{if(!/^[a-z][a-z0-9-]*$/.test(X.id)||Q.has(X.id))throw new b("Invalid or duplicate plugin signal");Q.set(X.id,X)},page:(X,F)=>{if(F.public&&!$.metadata.security)throw new b("Only plugins declaring security: true may register a public page");_.page({id:F.id,path:X.path,title:F.title,...F.description?{description:F.description}:{},...F.public?{public:F.public}:{},...F.settings?{settings:F.settings}:{},...F.shell?{shell:F.shell}:{},render:async(P)=>F$(await X.render({context:R,params:P,resource:(w,uN)=>lN(w,uN,R)}))})},navigation:(X)=>_.navigation(X),slot:(X)=>_.slot({id:X.id,slot:X.slot,order:X.order,...X.presentation?{presentation:X.presentation}:{},render:async({service:F,principal:P})=>F$(await X.render({context:R,service:F,principal:P}))}),action:(X)=>_.action({id:X.id,input:X.input??M.undefined(),...X.output?{output:X.output}:{},permission:X.permission,invoke:async(F)=>{let P=X.input==null?F:X.input.parse(F),w=await X.run(P,R);return X.output?X.output.parse(w):w}}),job:(X)=>_.job({id:X.id,...X.inputSchema?{input:X.inputSchema}:{},...X.schedule?{schedule:X.schedule}:{},...X.intervalMs!==void 0?{intervalMs:X.intervalMs}:{},...X.onSignals?{onSignals:[...X.onSignals]}:{},concurrency:X.concurrency,timeoutMs:X.timeoutMs,retry:X.retry,invoke:async(F,P)=>{let w=X.inputSchema==null?F:X.inputSchema.parse(F);await X.run({input:w,runId:P.runId,context:{pluginId:$.metadata.id,config:R.config,services:R.services,plugins:R.plugins,storage:R.storage,stores:R.stores,access:R.access,jobs:R.jobs,events:R.events,signal:P.signal,logger:{info:P.logger.info,warn:P.logger.warn,error:P.logger.error},reportSideEffect:()=>P.reportSideEffect()}})}}),resource:(X)=>_.resource({id:X.id,...X.input?{input:X.input}:{},refresh:X.refresh,invoke:async(F)=>{let P=X.input==null?F:X.input.parse(F);return X.query(P,R)}}),procedure:(X)=>_.procedure({id:X.id,input:X.input,output:X.output,permission:X.permission,invoke:async(F)=>{let P=X.input.parse(F),w=await X.handler(R,P);return X.output?X.output.parse(w):w}}),authentication:(X)=>{if(!$.metadata.security)throw Error("Authentication plugins must declare security: true");_.authentication(X)},authorization:(X)=>{if(!$.metadata.security)throw Error("Authorization plugins must declare security: true");_.authorization(X)}};$.setup(B,W)},start:()=>$.start?.(R)}}}}var x$=S({id:"example-plugin/service-summary",path:"./browser.mjs",props:M.object({name:M.string(),adapter:M.string()})});var yN=LN({path:"/example",render:async({context:$})=>{let{items:N}=await $.services.list({limit:12});return[f$({title:"Connected services",content:N.length>0?C$({columns:2,content:N.map((G)=>$$({title:G.name,description:G.adapter,variant:"panel",content:x$({name:G.name,adapter:G.adapter})}))}):$$({title:"No services configured",description:"Add a service to see it listed here."})})]}}),ZN=T$({id:"service-card-status",slot:"dashboard.service-card.trailing",order:100,render:({service:$})=>x$({name:$.name,adapter:$.adapter})}),cN=T$({id:"workspace-summary",slot:"service.workspace.after-header",order:100,render:({service:$})=>$$({title:"Plugin extension",content:x$({name:$.name,adapter:$.adapter})})});var TW=M.object({id:M.string(),name:M.string(),adapter:M.string(),managedBy:M.enum(["configuration","ui"])}),i3=hN({metadata:{id:"example-plugin",name:"Example plugin",version:"1.0.0",apiVersion:1},configSchema:M.object({greeting:M.string().default("Hello")}),setup($){$.page(yN,{id:"overview",title:"Plugin example",description:"A trusted extension can add navigation and call the sanitized service catalog."}),$.navigation({id:"overview-link",area:"primary",label:"Plugin example",pageId:"overview",order:100}),$.slot(ZN),$.slot(cN),$.procedure({id:"list-services",permission:"inspect",input:M.object({cursor:M.string().optional(),limit:M.number().int().positive().max(100).optional()}),output:M.object({items:M.array(TW),nextCursor:M.string().optional()}),handler:(N,G)=>N.services.list(G)}),$.procedure({id:"greet",permission:"inspect",input:M.object({name:M.string().min(1)}),output:M.string(),handler:(N,G)=>`${N.config.greeting}, ${G.name}`})}});export{i3 as default};
|
|
2
|
+
var sN=Object.defineProperty;var eN=($)=>$;function $G($,N){this[$]=eN.bind(null,N)}var NG=($,N)=>{for(var G in N)sN($,G,{get:N[G],enumerable:!0,configurable:!0,set:$G.bind(N,G)})};var R={};NG(R,{void:()=>hG,util:()=>A,unknown:()=>mG,union:()=>uG,undefined:()=>vG,tuple:()=>dG,transformer:()=>GW,symbol:()=>TG,string:()=>kN,strictObject:()=>cG,setErrorMap:()=>HG,set:()=>iG,record:()=>aG,quotelessJson:()=>GG,promise:()=>NW,preprocess:()=>QW,pipeline:()=>XW,ostring:()=>YW,optional:()=>WW,onumber:()=>RW,oboolean:()=>_W,objectUtil:()=>h$,object:()=>ZG,number:()=>EN,nullable:()=>HW,null:()=>xG,never:()=>lG,nativeEnum:()=>$W,nan:()=>EG,map:()=>nG,makeIssue:()=>O$,literal:()=>sG,lazy:()=>tG,late:()=>wG,isValid:()=>p,isDirty:()=>w$,isAsync:()=>W$,isAborted:()=>f$,intersection:()=>rG,instanceof:()=>kG,getParsedType:()=>I,getErrorMap:()=>G$,function:()=>oG,enum:()=>eG,effect:()=>GW,discriminatedUnion:()=>pG,defaultErrorMap:()=>h,datetimeRegex:()=>bN,date:()=>gG,custom:()=>wN,coerce:()=>JW,boolean:()=>DN,bigint:()=>DG,array:()=>yG,any:()=>IG,addIssueToContext:()=>L,ZodVoid:()=>U$,ZodUnknown:()=>r,ZodUnion:()=>_$,ZodUndefined:()=>Y$,ZodType:()=>U,ZodTuple:()=>l,ZodTransformer:()=>x,ZodSymbol:()=>j$,ZodString:()=>D,ZodSet:()=>s,ZodSchema:()=>U,ZodRecord:()=>A$,ZodReadonly:()=>S$,ZodPromise:()=>e,ZodPipeline:()=>z$,ZodParsedType:()=>q,ZodOptional:()=>T,ZodObject:()=>C,ZodNumber:()=>d,ZodNullable:()=>Z,ZodNull:()=>R$,ZodNever:()=>m,ZodNativeEnum:()=>L$,ZodNaN:()=>P$,ZodMap:()=>C$,ZodLiteral:()=>q$,ZodLazy:()=>B$,ZodIssueCode:()=>J,ZodIntersection:()=>J$,ZodFunction:()=>Q$,ZodFirstPartyTypeKind:()=>O,ZodError:()=>w,ZodEnum:()=>n,ZodEffects:()=>x,ZodDiscriminatedUnion:()=>k$,ZodDefault:()=>M$,ZodDate:()=>o,ZodCatch:()=>V$,ZodBranded:()=>E$,ZodBoolean:()=>X$,ZodBigInt:()=>a,ZodArray:()=>g,ZodAny:()=>t,Schema:()=>U,ParseStatus:()=>K,OK:()=>f,NEVER:()=>BW,INVALID:()=>S,EMPTY_PATH:()=>QG,DIRTY:()=>i,BRAND:()=>fG});var A;(function($){$.assertEqual=(W)=>{};function N(W){}$.assertIs=N;function G(W){throw Error()}$.assertNever=G,$.arrayToEnum=(W)=>{let X={};for(let Q of W)X[Q]=Q;return X},$.getValidEnumValues=(W)=>{let X=$.objectKeys(W).filter((_)=>typeof W[W[_]]!=="number"),Q={};for(let _ of X)Q[_]=W[_];return $.objectValues(Q)},$.objectValues=(W)=>{return $.objectKeys(W).map(function(X){return W[X]})},$.objectKeys=typeof Object.keys==="function"?(W)=>Object.keys(W):(W)=>{let X=[];for(let Q in W)if(Object.prototype.hasOwnProperty.call(W,Q))X.push(Q);return X},$.find=(W,X)=>{for(let Q of W)if(X(Q))return Q;return},$.isInteger=typeof Number.isInteger==="function"?(W)=>Number.isInteger(W):(W)=>typeof W==="number"&&Number.isFinite(W)&&Math.floor(W)===W;function H(W,X=" | "){return W.map((Q)=>typeof Q==="string"?`'${Q}'`:Q).join(X)}$.joinValues=H,$.jsonStringifyReplacer=(W,X)=>{if(typeof X==="bigint")return X.toString();return X}})(A||(A={}));var h$;(function($){$.mergeShapes=(N,G)=>{return{...N,...G}}})(h$||(h$={}));var q=A.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),I=($)=>{switch(typeof $){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN($)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":if(Array.isArray($))return q.array;if($===null)return q.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return q.promise;if(typeof Map<"u"&&$ instanceof Map)return q.map;if(typeof Set<"u"&&$ instanceof Set)return q.set;if(typeof Date<"u"&&$ instanceof Date)return q.date;return q.object;default:return q.unknown}};var J=A.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"]),GG=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class w extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(G)=>{this.issues=[...this.issues,G]},this.addIssues=(G=[])=>{this.issues=[...this.issues,...G]};let N=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,N);else this.__proto__=N;this.name="ZodError",this.issues=$}format($){let N=$||function(W){return W.message},G={_errors:[]},H=(W)=>{for(let X of W.issues)if(X.code==="invalid_union")X.unionErrors.map(H);else if(X.code==="invalid_return_type")H(X.returnTypeError);else if(X.code==="invalid_arguments")H(X.argumentsError);else if(X.path.length===0)G._errors.push(N(X));else{let Q=G,_=0;while(_<X.path.length){let B=X.path[_];if(_!==X.path.length-1)Q[B]=Q[B]||{_errors:[]};else Q[B]=Q[B]||{_errors:[]},Q[B]._errors.push(N(X));Q=Q[B],_++}}};return H(this),G}static assert($){if(!($ instanceof w))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,A.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(N)=>N.message){let N={},G=[];for(let H of this.issues)if(H.path.length>0){let W=H.path[0];N[W]=N[W]||[],N[W].push($(H))}else G.push($(H));return{formErrors:G,fieldErrors:N}}get formErrors(){return this.flatten()}}w.create=($)=>{return new w($)};var WG=($,N)=>{let G;switch($.code){case J.invalid_type:if($.received===q.undefined)G="Required";else G=`Expected ${$.expected}, received ${$.received}`;break;case J.invalid_literal:G=`Invalid literal value, expected ${JSON.stringify($.expected,A.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:G=`Unrecognized key(s) in object: ${A.joinValues($.keys,", ")}`;break;case J.invalid_union:G="Invalid input";break;case J.invalid_union_discriminator:G=`Invalid discriminator value. Expected ${A.joinValues($.options)}`;break;case J.invalid_enum_value:G=`Invalid enum value. Expected ${A.joinValues($.options)}, received '${$.received}'`;break;case J.invalid_arguments:G="Invalid function arguments";break;case J.invalid_return_type:G="Invalid function return type";break;case J.invalid_date:G="Invalid date";break;case J.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(G=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")G=`${G} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)G=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)G=`Invalid input: must end with "${$.validation.endsWith}"`;else A.assertNever($.validation);else if($.validation!=="regex")G=`Invalid ${$.validation}`;else G="Invalid";break;case J.too_small:if($.type==="array")G=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")G=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")G=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")G=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")G=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else G="Invalid input";break;case J.too_big:if($.type==="array")G=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")G=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")G=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")G=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")G=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else G="Invalid input";break;case J.custom:G="Invalid input";break;case J.invalid_intersection_types:G="Intersection results could not be merged";break;case J.not_multiple_of:G=`Number must be a multiple of ${$.multipleOf}`;break;case J.not_finite:G="Number must be finite";break;default:G=N.defaultError,A.assertNever($)}return{message:G}},h=WG;var AN=h;function HG($){AN=$}function G$(){return AN}var O$=($)=>{let{data:N,path:G,errorMaps:H,issueData:W}=$,X=[...G,...W.path||[]],Q={...W,path:X};if(W.message!==void 0)return{...W,path:X,message:W.message};let _="",B=H.filter((Y)=>!!Y).slice().reverse();for(let Y of B)_=Y(Q,{data:N,defaultError:_}).message;return{...W,path:X,message:_}},QG=[];function L($,N){let G=G$(),H=O$({issueData:N,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,G,G===h?void 0:h].filter((W)=>!!W)});$.common.issues.push(H)}class K{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,N){let G=[];for(let H of N){if(H.status==="aborted")return S;if(H.status==="dirty")$.dirty();G.push(H.value)}return{status:$.value,value:G}}static async mergeObjectAsync($,N){let G=[];for(let H of N){let W=await H.key,X=await H.value;G.push({key:W,value:X})}return K.mergeObjectSync($,G)}static mergeObjectSync($,N){let G={};for(let H of N){let{key:W,value:X}=H;if(W.status==="aborted")return S;if(X.status==="aborted")return S;if(W.status==="dirty")$.dirty();if(X.status==="dirty")$.dirty();if(W.value!=="__proto__"&&(typeof X.value<"u"||H.alwaysSet))G[W.value]=X.value}return{status:$.value,value:G}}}var S=Object.freeze({status:"aborted"}),i=($)=>({status:"dirty",value:$}),f=($)=>({status:"valid",value:$}),f$=($)=>$.status==="aborted",w$=($)=>$.status==="dirty",p=($)=>$.status==="valid",W$=($)=>typeof Promise<"u"&&$ instanceof Promise;var V;(function($){$.errToObj=(N)=>typeof N==="string"?{message:N}:N||{},$.toString=(N)=>typeof N==="string"?N:N?.message})(V||(V={}));class v{constructor($,N,G,H){this._cachedPath=[],this.parent=$,this.data=N,this._path=G,this._key=H}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var CN=($,N)=>{if(p(N))return{success:!0,data:N.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let G=new w($.common.issues);return this._error=G,this._error}}}};function j($){if(!$)return{};let{errorMap:N,invalid_type_error:G,required_error:H,description:W}=$;if(N&&(G||H))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(N)return{errorMap:N,description:W};return{errorMap:(Q,_)=>{let{message:B}=$;if(Q.code==="invalid_enum_value")return{message:B??_.defaultError};if(typeof _.data>"u")return{message:B??H??_.defaultError};if(Q.code!=="invalid_type")return{message:_.defaultError};return{message:B??G??_.defaultError}},description:W}}class U{get description(){return this._def.description}_getType($){return I($.data)}_getOrReturnCtx($,N){return N||{common:$.parent.common,data:$.data,parsedType:I($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new K,ctx:{common:$.parent.common,data:$.data,parsedType:I($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let N=this._parse($);if(W$(N))throw Error("Synchronous parse encountered promise.");return N}_parseAsync($){let N=this._parse($);return Promise.resolve(N)}parse($,N){let G=this.safeParse($,N);if(G.success)return G.data;throw G.error}safeParse($,N){let G={common:{issues:[],async:N?.async??!1,contextualErrorMap:N?.errorMap},path:N?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:I($)},H=this._parseSync({data:$,path:G.path,parent:G});return CN(G,H)}"~validate"($){let N={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:I($)};if(!this["~standard"].async)try{let G=this._parseSync({data:$,path:[],parent:N});return p(G)?{value:G.value}:{issues:N.common.issues}}catch(G){if(G?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;N.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:N}).then((G)=>p(G)?{value:G.value}:{issues:N.common.issues})}async parseAsync($,N){let G=await this.safeParseAsync($,N);if(G.success)return G.data;throw G.error}async safeParseAsync($,N){let G={common:{issues:[],contextualErrorMap:N?.errorMap,async:!0},path:N?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:I($)},H=this._parse({data:$,path:G.path,parent:G}),W=await(W$(H)?H:Promise.resolve(H));return CN(G,W)}refine($,N){let G=(H)=>{if(typeof N==="string"||typeof N>"u")return{message:N};else if(typeof N==="function")return N(H);else return N};return this._refinement((H,W)=>{let X=$(H),Q=()=>W.addIssue({code:J.custom,...G(H)});if(typeof Promise<"u"&&X instanceof Promise)return X.then((_)=>{if(!_)return Q(),!1;else return!0});if(!X)return Q(),!1;else return!0})}refinement($,N){return this._refinement((G,H)=>{if(!$(G))return H.addIssue(typeof N==="function"?N(G,H):N),!1;else return!0})}_refinement($){return new x({schema:this,typeName:O.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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 T.create(this,this._def)}nullable(){return Z.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return g.create(this)}promise(){return e.create(this,this._def)}or($){return _$.create([this,$],this._def)}and($){return J$.create(this,$,this._def)}transform($){return new x({...j(this._def),schema:this,typeName:O.ZodEffects,effect:{type:"transform",transform:$}})}default($){let N=typeof $==="function"?$:()=>$;return new M$({...j(this._def),innerType:this,defaultValue:N,typeName:O.ZodDefault})}brand(){return new E$({typeName:O.ZodBranded,type:this,...j(this._def)})}catch($){let N=typeof $==="function"?$:()=>$;return new V$({...j(this._def),innerType:this,catchValue:N,typeName:O.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return z$.create(this,$)}readonly(){return S$.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var XG=/^c[^\s-]{8,}$/i,YG=/^[0-9a-z]+$/,RG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_G=/^[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,JG=/^[a-z0-9_-]{21}$/i,BG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,qG=/^[-+]?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)?)??$/,LG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,MG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",y$,VG=/^(?:(?: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])$/,SG=/^(?:(?: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])$/,FG=/^(([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]))$/,OG=/^(([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])$/,jG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UG=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zN="((\\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])))",AG=new RegExp(`^${zN}$`);function KN($){let N="[0-5]\\d";if($.precision)N=`${N}\\.\\d{${$.precision}}`;else if($.precision==null)N=`${N}(\\.\\d+)?`;let G=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${N})${G}`}function CG($){return new RegExp(`^${KN($)}$`)}function bN($){let N=`${zN}T${KN($)}`,G=[];if(G.push($.local?"Z?":"Z"),$.offset)G.push("([+-]\\d{2}:?\\d{2})");return N=`${N}(${G.join("|")})`,new RegExp(`^${N}$`)}function PG($,N){if((N==="v4"||!N)&&VG.test($))return!0;if((N==="v6"||!N)&&FG.test($))return!0;return!1}function zG($,N){if(!BG.test($))return!1;try{let[G]=$.split(".");if(!G)return!1;let H=G.replace(/-/g,"+").replace(/_/g,"/").padEnd(G.length+(4-G.length%4)%4,"="),W=JSON.parse(atob(H));if(typeof W!=="object"||W===null)return!1;if("typ"in W&&W?.typ!=="JWT")return!1;if(!W.alg)return!1;if(N&&W.alg!==N)return!1;return!0}catch{return!1}}function KG($,N){if((N==="v4"||!N)&&SG.test($))return!0;if((N==="v6"||!N)&&OG.test($))return!0;return!1}class D extends U{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==q.string){let W=this._getOrReturnCtx($);return L(W,{code:J.invalid_type,expected:q.string,received:W.parsedType}),S}let G=new K,H=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.length<W.value)H=this._getOrReturnCtx($,H),L(H,{code:J.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),G.dirty()}else if(W.kind==="max"){if($.data.length>W.value)H=this._getOrReturnCtx($,H),L(H,{code:J.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),G.dirty()}else if(W.kind==="length"){let X=$.data.length>W.value,Q=$.data.length<W.value;if(X||Q){if(H=this._getOrReturnCtx($,H),X)L(H,{code:J.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});else if(Q)L(H,{code:J.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});G.dirty()}}else if(W.kind==="email"){if(!LG.test($.data))H=this._getOrReturnCtx($,H),L(H,{validation:"email",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="emoji"){if(!y$)y$=new RegExp(MG,"u");if(!y$.test($.data))H=this._getOrReturnCtx($,H),L(H,{validation:"emoji",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="uuid"){if(!_G.test($.data))H=this._getOrReturnCtx($,H),L(H,{validation:"uuid",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="nanoid"){if(!JG.test($.data))H=this._getOrReturnCtx($,H),L(H,{validation:"nanoid",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="cuid"){if(!XG.test($.data))H=this._getOrReturnCtx($,H),L(H,{validation:"cuid",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="cuid2"){if(!YG.test($.data))H=this._getOrReturnCtx($,H),L(H,{validation:"cuid2",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="ulid"){if(!RG.test($.data))H=this._getOrReturnCtx($,H),L(H,{validation:"ulid",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="url")try{new URL($.data)}catch{H=this._getOrReturnCtx($,H),L(H,{validation:"url",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="regex"){if(W.regex.lastIndex=0,!W.regex.test($.data))H=this._getOrReturnCtx($,H),L(H,{validation:"regex",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="trim")$.data=$.data.trim();else if(W.kind==="includes"){if(!$.data.includes(W.value,W.position))H=this._getOrReturnCtx($,H),L(H,{code:J.invalid_string,validation:{includes:W.value,position:W.position},message:W.message}),G.dirty()}else if(W.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(W.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(W.kind==="startsWith"){if(!$.data.startsWith(W.value))H=this._getOrReturnCtx($,H),L(H,{code:J.invalid_string,validation:{startsWith:W.value},message:W.message}),G.dirty()}else if(W.kind==="endsWith"){if(!$.data.endsWith(W.value))H=this._getOrReturnCtx($,H),L(H,{code:J.invalid_string,validation:{endsWith:W.value},message:W.message}),G.dirty()}else if(W.kind==="datetime"){if(!bN(W).test($.data))H=this._getOrReturnCtx($,H),L(H,{code:J.invalid_string,validation:"datetime",message:W.message}),G.dirty()}else if(W.kind==="date"){if(!AG.test($.data))H=this._getOrReturnCtx($,H),L(H,{code:J.invalid_string,validation:"date",message:W.message}),G.dirty()}else if(W.kind==="time"){if(!CG(W).test($.data))H=this._getOrReturnCtx($,H),L(H,{code:J.invalid_string,validation:"time",message:W.message}),G.dirty()}else if(W.kind==="duration"){if(!qG.test($.data))H=this._getOrReturnCtx($,H),L(H,{validation:"duration",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="ip"){if(!PG($.data,W.version))H=this._getOrReturnCtx($,H),L(H,{validation:"ip",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="jwt"){if(!zG($.data,W.alg))H=this._getOrReturnCtx($,H),L(H,{validation:"jwt",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="cidr"){if(!KG($.data,W.version))H=this._getOrReturnCtx($,H),L(H,{validation:"cidr",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="base64"){if(!jG.test($.data))H=this._getOrReturnCtx($,H),L(H,{validation:"base64",code:J.invalid_string,message:W.message}),G.dirty()}else if(W.kind==="base64url"){if(!UG.test($.data))H=this._getOrReturnCtx($,H),L(H,{validation:"base64url",code:J.invalid_string,message:W.message}),G.dirty()}else A.assertNever(W);return{status:G.value,value:$.data}}_regex($,N,G){return this.refinement((H)=>$.test(H),{validation:N,code:J.invalid_string,...V.errToObj(G)})}_addCheck($){return new D({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...V.errToObj($)})}url($){return this._addCheck({kind:"url",...V.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...V.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...V.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...V.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...V.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...V.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...V.errToObj($)})}base64($){return this._addCheck({kind:"base64",...V.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...V.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...V.errToObj($)})}ip($){return this._addCheck({kind:"ip",...V.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...V.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...V.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...V.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...V.errToObj($)})}regex($,N){return this._addCheck({kind:"regex",regex:$,...V.errToObj(N)})}includes($,N){return this._addCheck({kind:"includes",value:$,position:N?.position,...V.errToObj(N?.message)})}startsWith($,N){return this._addCheck({kind:"startsWith",value:$,...V.errToObj(N)})}endsWith($,N){return this._addCheck({kind:"endsWith",value:$,...V.errToObj(N)})}min($,N){return this._addCheck({kind:"min",value:$,...V.errToObj(N)})}max($,N){return this._addCheck({kind:"max",value:$,...V.errToObj(N)})}length($,N){return this._addCheck({kind:"length",value:$,...V.errToObj(N)})}nonempty($){return this.min(1,V.errToObj($))}trim(){return new D({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let N of this._def.checks)if(N.kind==="min"){if($===null||N.value>$)$=N.value}return $}get maxLength(){let $=null;for(let N of this._def.checks)if(N.kind==="max"){if($===null||N.value<$)$=N.value}return $}}D.create=($)=>{return new D({checks:[],typeName:O.ZodString,coerce:$?.coerce??!1,...j($)})};function bG($,N){let G=($.toString().split(".")[1]||"").length,H=(N.toString().split(".")[1]||"").length,W=G>H?G:H,X=Number.parseInt($.toFixed(W).replace(".","")),Q=Number.parseInt(N.toFixed(W).replace(".",""));return X%Q/10**W}class d extends U{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==q.number){let W=this._getOrReturnCtx($);return L(W,{code:J.invalid_type,expected:q.number,received:W.parsedType}),S}let G=void 0,H=new K;for(let W of this._def.checks)if(W.kind==="int"){if(!A.isInteger($.data))G=this._getOrReturnCtx($,G),L(G,{code:J.invalid_type,expected:"integer",received:"float",message:W.message}),H.dirty()}else if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)G=this._getOrReturnCtx($,G),L(G,{code:J.too_small,minimum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),H.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)G=this._getOrReturnCtx($,G),L(G,{code:J.too_big,maximum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),H.dirty()}else if(W.kind==="multipleOf"){if(bG($.data,W.value)!==0)G=this._getOrReturnCtx($,G),L(G,{code:J.not_multiple_of,multipleOf:W.value,message:W.message}),H.dirty()}else if(W.kind==="finite"){if(!Number.isFinite($.data))G=this._getOrReturnCtx($,G),L(G,{code:J.not_finite,message:W.message}),H.dirty()}else A.assertNever(W);return{status:H.value,value:$.data}}gte($,N){return this.setLimit("min",$,!0,V.toString(N))}gt($,N){return this.setLimit("min",$,!1,V.toString(N))}lte($,N){return this.setLimit("max",$,!0,V.toString(N))}lt($,N){return this.setLimit("max",$,!1,V.toString(N))}setLimit($,N,G,H){return new d({...this._def,checks:[...this._def.checks,{kind:$,value:N,inclusive:G,message:V.toString(H)}]})}_addCheck($){return new d({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:V.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString($)})}multipleOf($,N){return this._addCheck({kind:"multipleOf",value:$,message:V.toString(N)})}finite($){return this._addCheck({kind:"finite",message:V.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.toString($)})}get minValue(){let $=null;for(let N of this._def.checks)if(N.kind==="min"){if($===null||N.value>$)$=N.value}return $}get maxValue(){let $=null;for(let N of this._def.checks)if(N.kind==="max"){if($===null||N.value<$)$=N.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&A.isInteger($.value))}get isFinite(){let $=null,N=null;for(let G of this._def.checks)if(G.kind==="finite"||G.kind==="int"||G.kind==="multipleOf")return!0;else if(G.kind==="min"){if(N===null||G.value>N)N=G.value}else if(G.kind==="max"){if($===null||G.value<$)$=G.value}return Number.isFinite(N)&&Number.isFinite($)}}d.create=($)=>{return new d({checks:[],typeName:O.ZodNumber,coerce:$?.coerce||!1,...j($)})};class a extends U{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==q.bigint)return this._getInvalidInput($);let G=void 0,H=new K;for(let W of this._def.checks)if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)G=this._getOrReturnCtx($,G),L(G,{code:J.too_small,type:"bigint",minimum:W.value,inclusive:W.inclusive,message:W.message}),H.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)G=this._getOrReturnCtx($,G),L(G,{code:J.too_big,type:"bigint",maximum:W.value,inclusive:W.inclusive,message:W.message}),H.dirty()}else if(W.kind==="multipleOf"){if($.data%W.value!==BigInt(0))G=this._getOrReturnCtx($,G),L(G,{code:J.not_multiple_of,multipleOf:W.value,message:W.message}),H.dirty()}else A.assertNever(W);return{status:H.value,value:$.data}}_getInvalidInput($){let N=this._getOrReturnCtx($);return L(N,{code:J.invalid_type,expected:q.bigint,received:N.parsedType}),S}gte($,N){return this.setLimit("min",$,!0,V.toString(N))}gt($,N){return this.setLimit("min",$,!1,V.toString(N))}lte($,N){return this.setLimit("max",$,!0,V.toString(N))}lt($,N){return this.setLimit("max",$,!1,V.toString(N))}setLimit($,N,G,H){return new a({...this._def,checks:[...this._def.checks,{kind:$,value:N,inclusive:G,message:V.toString(H)}]})}_addCheck($){return new a({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:V.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString($)})}multipleOf($,N){return this._addCheck({kind:"multipleOf",value:$,message:V.toString(N)})}get minValue(){let $=null;for(let N of this._def.checks)if(N.kind==="min"){if($===null||N.value>$)$=N.value}return $}get maxValue(){let $=null;for(let N of this._def.checks)if(N.kind==="max"){if($===null||N.value<$)$=N.value}return $}}a.create=($)=>{return new a({checks:[],typeName:O.ZodBigInt,coerce:$?.coerce??!1,...j($)})};class X$ extends U{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==q.boolean){let G=this._getOrReturnCtx($);return L(G,{code:J.invalid_type,expected:q.boolean,received:G.parsedType}),S}return f($.data)}}X$.create=($)=>{return new X$({typeName:O.ZodBoolean,coerce:$?.coerce||!1,...j($)})};class o extends U{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==q.date){let W=this._getOrReturnCtx($);return L(W,{code:J.invalid_type,expected:q.date,received:W.parsedType}),S}if(Number.isNaN($.data.getTime())){let W=this._getOrReturnCtx($);return L(W,{code:J.invalid_date}),S}let G=new K,H=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.getTime()<W.value)H=this._getOrReturnCtx($,H),L(H,{code:J.too_small,message:W.message,inclusive:!0,exact:!1,minimum:W.value,type:"date"}),G.dirty()}else if(W.kind==="max"){if($.data.getTime()>W.value)H=this._getOrReturnCtx($,H),L(H,{code:J.too_big,message:W.message,inclusive:!0,exact:!1,maximum:W.value,type:"date"}),G.dirty()}else A.assertNever(W);return{status:G.value,value:new Date($.data.getTime())}}_addCheck($){return new o({...this._def,checks:[...this._def.checks,$]})}min($,N){return this._addCheck({kind:"min",value:$.getTime(),message:V.toString(N)})}max($,N){return this._addCheck({kind:"max",value:$.getTime(),message:V.toString(N)})}get minDate(){let $=null;for(let N of this._def.checks)if(N.kind==="min"){if($===null||N.value>$)$=N.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let N of this._def.checks)if(N.kind==="max"){if($===null||N.value<$)$=N.value}return $!=null?new Date($):null}}o.create=($)=>{return new o({checks:[],coerce:$?.coerce||!1,typeName:O.ZodDate,...j($)})};class j$ extends U{_parse($){if(this._getType($)!==q.symbol){let G=this._getOrReturnCtx($);return L(G,{code:J.invalid_type,expected:q.symbol,received:G.parsedType}),S}return f($.data)}}j$.create=($)=>{return new j$({typeName:O.ZodSymbol,...j($)})};class Y$ extends U{_parse($){if(this._getType($)!==q.undefined){let G=this._getOrReturnCtx($);return L(G,{code:J.invalid_type,expected:q.undefined,received:G.parsedType}),S}return f($.data)}}Y$.create=($)=>{return new Y$({typeName:O.ZodUndefined,...j($)})};class R$ extends U{_parse($){if(this._getType($)!==q.null){let G=this._getOrReturnCtx($);return L(G,{code:J.invalid_type,expected:q.null,received:G.parsedType}),S}return f($.data)}}R$.create=($)=>{return new R$({typeName:O.ZodNull,...j($)})};class t extends U{constructor(){super(...arguments);this._any=!0}_parse($){return f($.data)}}t.create=($)=>{return new t({typeName:O.ZodAny,...j($)})};class r extends U{constructor(){super(...arguments);this._unknown=!0}_parse($){return f($.data)}}r.create=($)=>{return new r({typeName:O.ZodUnknown,...j($)})};class m extends U{_parse($){let N=this._getOrReturnCtx($);return L(N,{code:J.invalid_type,expected:q.never,received:N.parsedType}),S}}m.create=($)=>{return new m({typeName:O.ZodNever,...j($)})};class U$ extends U{_parse($){if(this._getType($)!==q.undefined){let G=this._getOrReturnCtx($);return L(G,{code:J.invalid_type,expected:q.void,received:G.parsedType}),S}return f($.data)}}U$.create=($)=>{return new U$({typeName:O.ZodVoid,...j($)})};class g extends U{_parse($){let{ctx:N,status:G}=this._processInputParams($),H=this._def;if(N.parsedType!==q.array)return L(N,{code:J.invalid_type,expected:q.array,received:N.parsedType}),S;if(H.exactLength!==null){let X=N.data.length>H.exactLength.value,Q=N.data.length<H.exactLength.value;if(X||Q)L(N,{code:X?J.too_big:J.too_small,minimum:Q?H.exactLength.value:void 0,maximum:X?H.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:H.exactLength.message}),G.dirty()}if(H.minLength!==null){if(N.data.length<H.minLength.value)L(N,{code:J.too_small,minimum:H.minLength.value,type:"array",inclusive:!0,exact:!1,message:H.minLength.message}),G.dirty()}if(H.maxLength!==null){if(N.data.length>H.maxLength.value)L(N,{code:J.too_big,maximum:H.maxLength.value,type:"array",inclusive:!0,exact:!1,message:H.maxLength.message}),G.dirty()}if(N.common.async)return Promise.all([...N.data].map((X,Q)=>{return H.type._parseAsync(new v(N,X,N.path,Q))})).then((X)=>{return K.mergeArray(G,X)});let W=[...N.data].map((X,Q)=>{return H.type._parseSync(new v(N,X,N.path,Q))});return K.mergeArray(G,W)}get element(){return this._def.type}min($,N){return new g({...this._def,minLength:{value:$,message:V.toString(N)}})}max($,N){return new g({...this._def,maxLength:{value:$,message:V.toString(N)}})}length($,N){return new g({...this._def,exactLength:{value:$,message:V.toString(N)}})}nonempty($){return this.min(1,$)}}g.create=($,N)=>{return new g({type:$,minLength:null,maxLength:null,exactLength:null,typeName:O.ZodArray,...j(N)})};function H$($){if($ instanceof C){let N={};for(let G in $.shape){let H=$.shape[G];N[G]=T.create(H$(H))}return new C({...$._def,shape:()=>N})}else if($ instanceof g)return new g({...$._def,type:H$($.element)});else if($ instanceof T)return T.create(H$($.unwrap()));else if($ instanceof Z)return Z.create(H$($.unwrap()));else if($ instanceof l)return l.create($.items.map((N)=>H$(N)));else return $}class C extends U{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),N=A.objectKeys($);return this._cached={shape:$,keys:N},this._cached}_parse($){if(this._getType($)!==q.object){let B=this._getOrReturnCtx($);return L(B,{code:J.invalid_type,expected:q.object,received:B.parsedType}),S}let{status:G,ctx:H}=this._processInputParams($),{shape:W,keys:X}=this._getCached(),Q=[];if(!(this._def.catchall instanceof m&&this._def.unknownKeys==="strip")){for(let B in H.data)if(!X.includes(B))Q.push(B)}let _=[];for(let B of X){let Y=W[B],F=H.data[B];_.push({key:{status:"valid",value:B},value:Y._parse(new v(H,F,H.path,B)),alwaysSet:B in H.data})}if(this._def.catchall instanceof m){let B=this._def.unknownKeys;if(B==="passthrough")for(let Y of Q)_.push({key:{status:"valid",value:Y},value:{status:"valid",value:H.data[Y]}});else if(B==="strict"){if(Q.length>0)L(H,{code:J.unrecognized_keys,keys:Q}),G.dirty()}else if(B==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let B=this._def.catchall;for(let Y of Q){let F=H.data[Y];_.push({key:{status:"valid",value:Y},value:B._parse(new v(H,F,H.path,Y)),alwaysSet:Y in H.data})}}if(H.common.async)return Promise.resolve().then(async()=>{let B=[];for(let Y of _){let F=await Y.key,z=await Y.value;B.push({key:F,value:z,alwaysSet:Y.alwaysSet})}return B}).then((B)=>{return K.mergeObjectSync(G,B)});else return K.mergeObjectSync(G,_)}get shape(){return this._def.shape()}strict($){return V.errToObj,new C({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(N,G)=>{let H=this._def.errorMap?.(N,G).message??G.defaultError;if(N.code==="unrecognized_keys")return{message:V.errToObj($).message??H};return{message:H}}}:{}})}strip(){return new C({...this._def,unknownKeys:"strip"})}passthrough(){return new C({...this._def,unknownKeys:"passthrough"})}extend($){return new C({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new C({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:O.ZodObject})}setKey($,N){return this.augment({[$]:N})}catchall($){return new C({...this._def,catchall:$})}pick($){let N={};for(let G of A.objectKeys($))if($[G]&&this.shape[G])N[G]=this.shape[G];return new C({...this._def,shape:()=>N})}omit($){let N={};for(let G of A.objectKeys(this.shape))if(!$[G])N[G]=this.shape[G];return new C({...this._def,shape:()=>N})}deepPartial(){return H$(this)}partial($){let N={};for(let G of A.objectKeys(this.shape)){let H=this.shape[G];if($&&!$[G])N[G]=H;else N[G]=H.optional()}return new C({...this._def,shape:()=>N})}required($){let N={};for(let G of A.objectKeys(this.shape))if($&&!$[G])N[G]=this.shape[G];else{let W=this.shape[G];while(W instanceof T)W=W._def.innerType;N[G]=W}return new C({...this._def,shape:()=>N})}keyof(){return fN(A.objectKeys(this.shape))}}C.create=($,N)=>{return new C({shape:()=>$,unknownKeys:"strip",catchall:m.create(),typeName:O.ZodObject,...j(N)})};C.strictCreate=($,N)=>{return new C({shape:()=>$,unknownKeys:"strict",catchall:m.create(),typeName:O.ZodObject,...j(N)})};C.lazycreate=($,N)=>{return new C({shape:$,unknownKeys:"strip",catchall:m.create(),typeName:O.ZodObject,...j(N)})};class _$ extends U{_parse($){let{ctx:N}=this._processInputParams($),G=this._def.options;function H(W){for(let Q of W)if(Q.result.status==="valid")return Q.result;for(let Q of W)if(Q.result.status==="dirty")return N.common.issues.push(...Q.ctx.common.issues),Q.result;let X=W.map((Q)=>new w(Q.ctx.common.issues));return L(N,{code:J.invalid_union,unionErrors:X}),S}if(N.common.async)return Promise.all(G.map(async(W)=>{let X={...N,common:{...N.common,issues:[]},parent:null};return{result:await W._parseAsync({data:N.data,path:N.path,parent:X}),ctx:X}})).then(H);else{let W=void 0,X=[];for(let _ of G){let B={...N,common:{...N.common,issues:[]},parent:null},Y=_._parseSync({data:N.data,path:N.path,parent:B});if(Y.status==="valid")return Y;else if(Y.status==="dirty"&&!W)W={result:Y,ctx:B};if(B.common.issues.length)X.push(B.common.issues)}if(W)return N.common.issues.push(...W.ctx.common.issues),W.result;let Q=X.map((_)=>new w(_));return L(N,{code:J.invalid_union,unionErrors:Q}),S}}get options(){return this._def.options}}_$.create=($,N)=>{return new _$({options:$,typeName:O.ZodUnion,...j(N)})};var y=($)=>{if($ instanceof B$)return y($.schema);else if($ instanceof x)return y($.innerType());else if($ instanceof q$)return[$.value];else if($ instanceof n)return $.options;else if($ instanceof L$)return A.objectValues($.enum);else if($ instanceof M$)return y($._def.innerType);else if($ instanceof Y$)return[void 0];else if($ instanceof R$)return[null];else if($ instanceof T)return[void 0,...y($.unwrap())];else if($ instanceof Z)return[null,...y($.unwrap())];else if($ instanceof E$)return y($.unwrap());else if($ instanceof S$)return y($.unwrap());else if($ instanceof V$)return y($._def.innerType);else return[]};class k$ extends U{_parse($){let{ctx:N}=this._processInputParams($);if(N.parsedType!==q.object)return L(N,{code:J.invalid_type,expected:q.object,received:N.parsedType}),S;let G=this.discriminator,H=N.data[G],W=this.optionsMap.get(H);if(!W)return L(N,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[G]}),S;if(N.common.async)return W._parseAsync({data:N.data,path:N.path,parent:N});else return W._parseSync({data:N.data,path:N.path,parent:N})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,N,G){let H=new Map;for(let W of N){let X=y(W.shape[$]);if(!X.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let Q of X){if(H.has(Q))throw Error(`Discriminator property ${String($)} has duplicate value ${String(Q)}`);H.set(Q,W)}}return new k$({typeName:O.ZodDiscriminatedUnion,discriminator:$,options:N,optionsMap:H,...j(G)})}}function Z$($,N){let G=I($),H=I(N);if($===N)return{valid:!0,data:$};else if(G===q.object&&H===q.object){let W=A.objectKeys(N),X=A.objectKeys($).filter((_)=>W.indexOf(_)!==-1),Q={...$,...N};for(let _ of X){let B=Z$($[_],N[_]);if(!B.valid)return{valid:!1};Q[_]=B.data}return{valid:!0,data:Q}}else if(G===q.array&&H===q.array){if($.length!==N.length)return{valid:!1};let W=[];for(let X=0;X<$.length;X++){let Q=$[X],_=N[X],B=Z$(Q,_);if(!B.valid)return{valid:!1};W.push(B.data)}return{valid:!0,data:W}}else if(G===q.date&&H===q.date&&+$===+N)return{valid:!0,data:$};else return{valid:!1}}class J$ extends U{_parse($){let{status:N,ctx:G}=this._processInputParams($),H=(W,X)=>{if(f$(W)||f$(X))return S;let Q=Z$(W.value,X.value);if(!Q.valid)return L(G,{code:J.invalid_intersection_types}),S;if(w$(W)||w$(X))N.dirty();return{status:N.value,value:Q.data}};if(G.common.async)return Promise.all([this._def.left._parseAsync({data:G.data,path:G.path,parent:G}),this._def.right._parseAsync({data:G.data,path:G.path,parent:G})]).then(([W,X])=>H(W,X));else return H(this._def.left._parseSync({data:G.data,path:G.path,parent:G}),this._def.right._parseSync({data:G.data,path:G.path,parent:G}))}}J$.create=($,N,G)=>{return new J$({left:$,right:N,typeName:O.ZodIntersection,...j(G)})};class l extends U{_parse($){let{status:N,ctx:G}=this._processInputParams($);if(G.parsedType!==q.array)return L(G,{code:J.invalid_type,expected:q.array,received:G.parsedType}),S;if(G.data.length<this._def.items.length)return L(G,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;if(!this._def.rest&&G.data.length>this._def.items.length)L(G,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N.dirty();let W=[...G.data].map((X,Q)=>{let _=this._def.items[Q]||this._def.rest;if(!_)return null;return _._parse(new v(G,X,G.path,Q))}).filter((X)=>!!X);if(G.common.async)return Promise.all(W).then((X)=>{return K.mergeArray(N,X)});else return K.mergeArray(N,W)}get items(){return this._def.items}rest($){return new l({...this._def,rest:$})}}l.create=($,N)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new l({items:$,typeName:O.ZodTuple,rest:null,...j(N)})};class A$ extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:N,ctx:G}=this._processInputParams($);if(G.parsedType!==q.object)return L(G,{code:J.invalid_type,expected:q.object,received:G.parsedType}),S;let H=[],W=this._def.keyType,X=this._def.valueType;for(let Q in G.data)H.push({key:W._parse(new v(G,Q,G.path,Q)),value:X._parse(new v(G,G.data[Q],G.path,Q)),alwaysSet:Q in G.data});if(G.common.async)return K.mergeObjectAsync(N,H);else return K.mergeObjectSync(N,H)}get element(){return this._def.valueType}static create($,N,G){if(N instanceof U)return new A$({keyType:$,valueType:N,typeName:O.ZodRecord,...j(G)});return new A$({keyType:D.create(),valueType:$,typeName:O.ZodRecord,...j(N)})}}class C$ extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:N,ctx:G}=this._processInputParams($);if(G.parsedType!==q.map)return L(G,{code:J.invalid_type,expected:q.map,received:G.parsedType}),S;let H=this._def.keyType,W=this._def.valueType,X=[...G.data.entries()].map(([Q,_],B)=>{return{key:H._parse(new v(G,Q,G.path,[B,"key"])),value:W._parse(new v(G,_,G.path,[B,"value"]))}});if(G.common.async){let Q=new Map;return Promise.resolve().then(async()=>{for(let _ of X){let B=await _.key,Y=await _.value;if(B.status==="aborted"||Y.status==="aborted")return S;if(B.status==="dirty"||Y.status==="dirty")N.dirty();Q.set(B.value,Y.value)}return{status:N.value,value:Q}})}else{let Q=new Map;for(let _ of X){let{key:B,value:Y}=_;if(B.status==="aborted"||Y.status==="aborted")return S;if(B.status==="dirty"||Y.status==="dirty")N.dirty();Q.set(B.value,Y.value)}return{status:N.value,value:Q}}}}C$.create=($,N,G)=>{return new C$({valueType:N,keyType:$,typeName:O.ZodMap,...j(G)})};class s extends U{_parse($){let{status:N,ctx:G}=this._processInputParams($);if(G.parsedType!==q.set)return L(G,{code:J.invalid_type,expected:q.set,received:G.parsedType}),S;let H=this._def;if(H.minSize!==null){if(G.data.size<H.minSize.value)L(G,{code:J.too_small,minimum:H.minSize.value,type:"set",inclusive:!0,exact:!1,message:H.minSize.message}),N.dirty()}if(H.maxSize!==null){if(G.data.size>H.maxSize.value)L(G,{code:J.too_big,maximum:H.maxSize.value,type:"set",inclusive:!0,exact:!1,message:H.maxSize.message}),N.dirty()}let W=this._def.valueType;function X(_){let B=new Set;for(let Y of _){if(Y.status==="aborted")return S;if(Y.status==="dirty")N.dirty();B.add(Y.value)}return{status:N.value,value:B}}let Q=[...G.data.values()].map((_,B)=>W._parse(new v(G,_,G.path,B)));if(G.common.async)return Promise.all(Q).then((_)=>X(_));else return X(Q)}min($,N){return new s({...this._def,minSize:{value:$,message:V.toString(N)}})}max($,N){return new s({...this._def,maxSize:{value:$,message:V.toString(N)}})}size($,N){return this.min($,N).max($,N)}nonempty($){return this.min(1,$)}}s.create=($,N)=>{return new s({valueType:$,minSize:null,maxSize:null,typeName:O.ZodSet,...j(N)})};class Q$ extends U{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:N}=this._processInputParams($);if(N.parsedType!==q.function)return L(N,{code:J.invalid_type,expected:q.function,received:N.parsedType}),S;function G(Q,_){return O$({data:Q,path:N.path,errorMaps:[N.common.contextualErrorMap,N.schemaErrorMap,G$(),h].filter((B)=>!!B),issueData:{code:J.invalid_arguments,argumentsError:_}})}function H(Q,_){return O$({data:Q,path:N.path,errorMaps:[N.common.contextualErrorMap,N.schemaErrorMap,G$(),h].filter((B)=>!!B),issueData:{code:J.invalid_return_type,returnTypeError:_}})}let W={errorMap:N.common.contextualErrorMap},X=N.data;if(this._def.returns instanceof e){let Q=this;return f(async function(..._){let B=new w([]),Y=await Q._def.args.parseAsync(_,W).catch((k)=>{throw B.addIssue(G(_,k)),B}),F=await Reflect.apply(X,this,Y);return await Q._def.returns._def.type.parseAsync(F,W).catch((k)=>{throw B.addIssue(H(F,k)),B})})}else{let Q=this;return f(function(..._){let B=Q._def.args.safeParse(_,W);if(!B.success)throw new w([G(_,B.error)]);let Y=Reflect.apply(X,this,B.data),F=Q._def.returns.safeParse(Y,W);if(!F.success)throw new w([H(Y,F.error)]);return F.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new Q$({...this._def,args:l.create($).rest(r.create())})}returns($){return new Q$({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,N,G){return new Q$({args:$?$:l.create([]).rest(r.create()),returns:N||r.create(),typeName:O.ZodFunction,...j(G)})}}class B$ extends U{get schema(){return this._def.getter()}_parse($){let{ctx:N}=this._processInputParams($);return this._def.getter()._parse({data:N.data,path:N.path,parent:N})}}B$.create=($,N)=>{return new B$({getter:$,typeName:O.ZodLazy,...j(N)})};class q$ extends U{_parse($){if($.data!==this._def.value){let N=this._getOrReturnCtx($);return L(N,{received:N.data,code:J.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:$.data}}get value(){return this._def.value}}q$.create=($,N)=>{return new q$({value:$,typeName:O.ZodLiteral,...j(N)})};function fN($,N){return new n({values:$,typeName:O.ZodEnum,...j(N)})}class n extends U{_parse($){if(typeof $.data!=="string"){let N=this._getOrReturnCtx($),G=this._def.values;return L(N,{expected:A.joinValues(G),received:N.parsedType,code:J.invalid_type}),S}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let N=this._getOrReturnCtx($),G=this._def.values;return L(N,{received:N.data,code:J.invalid_enum_value,options:G}),S}return f($.data)}get options(){return this._def.values}get enum(){let $={};for(let N of this._def.values)$[N]=N;return $}get Values(){let $={};for(let N of this._def.values)$[N]=N;return $}get Enum(){let $={};for(let N of this._def.values)$[N]=N;return $}extract($,N=this._def){return n.create($,{...this._def,...N})}exclude($,N=this._def){return n.create(this.options.filter((G)=>!$.includes(G)),{...this._def,...N})}}n.create=fN;class L$ extends U{_parse($){let N=A.getValidEnumValues(this._def.values),G=this._getOrReturnCtx($);if(G.parsedType!==q.string&&G.parsedType!==q.number){let H=A.objectValues(N);return L(G,{expected:A.joinValues(H),received:G.parsedType,code:J.invalid_type}),S}if(!this._cache)this._cache=new Set(A.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let H=A.objectValues(N);return L(G,{received:G.data,code:J.invalid_enum_value,options:H}),S}return f($.data)}get enum(){return this._def.values}}L$.create=($,N)=>{return new L$({values:$,typeName:O.ZodNativeEnum,...j(N)})};class e extends U{unwrap(){return this._def.type}_parse($){let{ctx:N}=this._processInputParams($);if(N.parsedType!==q.promise&&N.common.async===!1)return L(N,{code:J.invalid_type,expected:q.promise,received:N.parsedType}),S;let G=N.parsedType===q.promise?N.data:Promise.resolve(N.data);return f(G.then((H)=>{return this._def.type.parseAsync(H,{path:N.path,errorMap:N.common.contextualErrorMap})}))}}e.create=($,N)=>{return new e({type:$,typeName:O.ZodPromise,...j(N)})};class x extends U{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===O.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:N,ctx:G}=this._processInputParams($),H=this._def.effect||null,W={addIssue:(X)=>{if(L(G,X),X.fatal)N.abort();else N.dirty()},get path(){return G.path}};if(W.addIssue=W.addIssue.bind(W),H.type==="preprocess"){let X=H.transform(G.data,W);if(G.common.async)return Promise.resolve(X).then(async(Q)=>{if(N.value==="aborted")return S;let _=await this._def.schema._parseAsync({data:Q,path:G.path,parent:G});if(_.status==="aborted")return S;if(_.status==="dirty")return i(_.value);if(N.value==="dirty")return i(_.value);return _});else{if(N.value==="aborted")return S;let Q=this._def.schema._parseSync({data:X,path:G.path,parent:G});if(Q.status==="aborted")return S;if(Q.status==="dirty")return i(Q.value);if(N.value==="dirty")return i(Q.value);return Q}}if(H.type==="refinement"){let X=(Q)=>{let _=H.refinement(Q,W);if(G.common.async)return Promise.resolve(_);if(_ instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Q};if(G.common.async===!1){let Q=this._def.schema._parseSync({data:G.data,path:G.path,parent:G});if(Q.status==="aborted")return S;if(Q.status==="dirty")N.dirty();return X(Q.value),{status:N.value,value:Q.value}}else return this._def.schema._parseAsync({data:G.data,path:G.path,parent:G}).then((Q)=>{if(Q.status==="aborted")return S;if(Q.status==="dirty")N.dirty();return X(Q.value).then(()=>{return{status:N.value,value:Q.value}})})}if(H.type==="transform")if(G.common.async===!1){let X=this._def.schema._parseSync({data:G.data,path:G.path,parent:G});if(!p(X))return S;let Q=H.transform(X.value,W);if(Q instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:N.value,value:Q}}else return this._def.schema._parseAsync({data:G.data,path:G.path,parent:G}).then((X)=>{if(!p(X))return S;return Promise.resolve(H.transform(X.value,W)).then((Q)=>({status:N.value,value:Q}))});A.assertNever(H)}}x.create=($,N,G)=>{return new x({schema:$,typeName:O.ZodEffects,effect:N,...j(G)})};x.createWithPreprocess=($,N,G)=>{return new x({schema:N,effect:{type:"preprocess",transform:$},typeName:O.ZodEffects,...j(G)})};class T extends U{_parse($){if(this._getType($)===q.undefined)return f(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}T.create=($,N)=>{return new T({innerType:$,typeName:O.ZodOptional,...j(N)})};class Z extends U{_parse($){if(this._getType($)===q.null)return f(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Z.create=($,N)=>{return new Z({innerType:$,typeName:O.ZodNullable,...j(N)})};class M$ extends U{_parse($){let{ctx:N}=this._processInputParams($),G=N.data;if(N.parsedType===q.undefined)G=this._def.defaultValue();return this._def.innerType._parse({data:G,path:N.path,parent:N})}removeDefault(){return this._def.innerType}}M$.create=($,N)=>{return new M$({innerType:$,typeName:O.ZodDefault,defaultValue:typeof N.default==="function"?N.default:()=>N.default,...j(N)})};class V$ extends U{_parse($){let{ctx:N}=this._processInputParams($),G={...N,common:{...N.common,issues:[]}},H=this._def.innerType._parse({data:G.data,path:G.path,parent:{...G}});if(W$(H))return H.then((W)=>{return{status:"valid",value:W.status==="valid"?W.value:this._def.catchValue({get error(){return new w(G.common.issues)},input:G.data})}});else return{status:"valid",value:H.status==="valid"?H.value:this._def.catchValue({get error(){return new w(G.common.issues)},input:G.data})}}removeCatch(){return this._def.innerType}}V$.create=($,N)=>{return new V$({innerType:$,typeName:O.ZodCatch,catchValue:typeof N.catch==="function"?N.catch:()=>N.catch,...j(N)})};class P$ extends U{_parse($){if(this._getType($)!==q.nan){let G=this._getOrReturnCtx($);return L(G,{code:J.invalid_type,expected:q.nan,received:G.parsedType}),S}return{status:"valid",value:$.data}}}P$.create=($)=>{return new P$({typeName:O.ZodNaN,...j($)})};var fG=Symbol("zod_brand");class E$ extends U{_parse($){let{ctx:N}=this._processInputParams($),G=N.data;return this._def.type._parse({data:G,path:N.path,parent:N})}unwrap(){return this._def.type}}class z$ extends U{_parse($){let{status:N,ctx:G}=this._processInputParams($);if(G.common.async)return(async()=>{let W=await this._def.in._parseAsync({data:G.data,path:G.path,parent:G});if(W.status==="aborted")return S;if(W.status==="dirty")return N.dirty(),i(W.value);else return this._def.out._parseAsync({data:W.value,path:G.path,parent:G})})();else{let H=this._def.in._parseSync({data:G.data,path:G.path,parent:G});if(H.status==="aborted")return S;if(H.status==="dirty")return N.dirty(),{status:"dirty",value:H.value};else return this._def.out._parseSync({data:H.value,path:G.path,parent:G})}}static create($,N){return new z$({in:$,out:N,typeName:O.ZodPipeline})}}class S$ extends U{_parse($){let N=this._def.innerType._parse($),G=(H)=>{if(p(H))H.value=Object.freeze(H.value);return H};return W$(N)?N.then((H)=>G(H)):G(N)}unwrap(){return this._def.innerType}}S$.create=($,N)=>{return new S$({innerType:$,typeName:O.ZodReadonly,...j(N)})};function PN($,N){let G=typeof $==="function"?$(N):typeof $==="string"?{message:$}:$;return typeof G==="string"?{message:G}:G}function wN($,N={},G){if($)return t.create().superRefine((H,W)=>{let X=$(H);if(X instanceof Promise)return X.then((Q)=>{if(!Q){let _=PN(N,H),B=_.fatal??G??!0;W.addIssue({code:"custom",..._,fatal:B})}});if(!X){let Q=PN(N,H),_=Q.fatal??G??!0;W.addIssue({code:"custom",...Q,fatal:_})}return});return t.create()}var wG={object:C.lazycreate},O;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(O||(O={}));var kG=($,N={message:`Input not instance of ${$.name}`})=>wN((G)=>G instanceof $,N),kN=D.create,EN=d.create,EG=P$.create,DG=a.create,DN=X$.create,gG=o.create,TG=j$.create,vG=Y$.create,xG=R$.create,IG=t.create,mG=r.create,lG=m.create,hG=U$.create,yG=g.create,ZG=C.create,cG=C.strictCreate,uG=_$.create,pG=k$.create,rG=J$.create,dG=l.create,aG=A$.create,nG=C$.create,iG=s.create,oG=Q$.create,tG=B$.create,sG=q$.create,eG=n.create,$W=L$.create,NW=e.create,GW=x.create,WW=T.create,HW=Z.create,QW=x.createWithPreprocess,XW=z$.create,YW=()=>kN().optional(),RW=()=>EN().optional(),_W=()=>DN().optional(),JW={string:($)=>D.create({...$,coerce:!0}),number:($)=>d.create({...$,coerce:!0}),boolean:($)=>X$.create({...$,coerce:!0}),bigint:($)=>a.create({...$,coerce:!0}),date:($)=>o.create({...$,coerce:!0})};var BW=S;var qW=R.object({id:R.string(),signalId:R.string(),type:R.enum(["info","success","warning","error"]),sourceType:R.string(),sourceId:R.string(),serviceId:R.string().optional(),actor:R.string().optional(),payload:R.unknown(),occurredAt:R.string()});var D$=1000,g$=500,T$=R.object({namespace:R.string().min(1).max(512).optional(),name:R.string().min(1).max(512)}),vN=R.string().regex(/^[a-z][a-z0-9-]*$/,"Dataset kind must be kebab-case").max(64),c$=R.object({name:R.string().min(1).max(512),type:R.string().max(256).optional(),nullable:R.boolean().optional()}),xN=R.object({ref:T$,kind:vN,title:R.string().max(512).optional(),columns:R.array(c$).max(5000).optional()}),VW=R.object({cursor:R.string().max(2048).optional(),limit:R.number().int().min(1).max(D$).default(500)}),SW=R.object({items:R.array(xN).max(D$),nextCursor:R.string().max(2048).optional()}),TN=R.string().datetime({offset:!0}),IN=R.object({ref:T$,at:TN,rowCount:R.number().int().min(0).optional(),rowCountExact:R.boolean().optional(),bytes:R.number().int().min(0).optional(),lastModifiedAt:TN.optional(),changeCounter:R.number().int().min(0).optional(),columns:R.array(c$).max(5000).optional()}),FW=R.object({refs:R.array(T$).min(1).max(g$)}),OW=R.array(IN).max(g$);var jW=R.object({category:R.string().trim().min(1).optional(),overview:R.string().trim().min(1).optional(),features:R.array(R.object({title:R.string().trim().min(1),description:R.string().trim().min(1).optional()})).optional(),compatibility:R.array(R.string().trim().min(1)).optional(),limitations:R.array(R.string().trim().min(1)).optional(),links:R.array(R.object({kind:R.enum(["website","documentation","source"]).optional(),label:R.string().trim().min(1),href:R.string().url().refine(($)=>/^https?:\/\//i.test($),"Catalog links must use HTTP or HTTPS")})).optional()});function v$($){if(typeof $==="function"){let G=$;return G.kind==="action"&&typeof G.id==="string"?{actionId:G.id}:void 0}if(Array.isArray($))return $.map(v$);if(!$||typeof $!=="object")return $;let N=$;if(N.kind==="action-binding"&&typeof N.actionId==="string")return{actionId:N.actionId,..."input"in N?{input:v$(N.input)}:{}};return Object.fromEntries(Object.entries(N).map(([G,H])=>[G,v$(H)]))}function M($){if(!$.id)throw Error("Component id must be a non-empty string");if(!$.render&&!$.path)throw Error("Component requires either render or path");if($.render&&$.path)throw Error("Component accepts either render or path, not both");if($.path!==void 0&&!$.path)throw Error("Component path must be a non-empty string");return Object.assign((G)=>{if(!$.path)return $.render(G);let H=G??{},W=$.props?$.props.parse(H):H;return{kind:"custom",props:{component:$.id,path:$.path,props:v$(W)}}},{kind:"component",id:$.id})}var u$=M({id:"badge",path:"./ui/badge"});var p$=M({id:"button",path:"./ui/button"});var $$=M({id:"card",render:($)=>({kind:"card",props:{...$,variant:$.variant??"default"}})});var EW=R.object({time:R.number().finite(),value:R.number().finite()}),DW=R.object({label:R.string().min(1),secs:R.number().positive()}),r$=M({id:"chart",path:"./ui/chart",props:R.object({source:R.custom().optional(),points:R.array(EW).optional(),windows:R.array(DW).optional(),kind:R.enum(["line","area"]).optional(),exaggerate:R.boolean().optional(),lineWidth:R.number().optional(),showValue:R.boolean().optional(),label:R.string().min(1).optional(),scale:R.enum(["higher-is-better","higher-is-worse"]).optional(),referenceLine:R.object({value:R.number(),label:R.string().optional()}).optional(),referenceLines:R.array(R.object({value:R.number(),label:R.string().optional()})).optional(),yRange:R.object({min:R.number().finite(),max:R.number().finite(),unit:R.string().optional()}).refine(($)=>$.max>$.min,{message:"Chart yRange max must be greater than min"}).optional()}).refine(($)=>!($.source&&$.points),{message:"Chart accepts either a source or points, not both"})});var d$=M({id:"code-block",path:"./ui/code-block"});var a$=M({id:"code-editor",render:($)=>({kind:"code-editor",props:{...$}})});var n$=M({id:"code-explorer",path:"./ui/code-explorer"});var i$=M({id:"collection",render:($)=>{if(!$.source&&!$.field)throw Error("Collection requires a source or context field");return{kind:"collection",props:{...$}}}});var o$=M({id:"columns",render:($)=>{if($.columns.length===0)throw Error("Columns requires at least one column");return{kind:"columns",props:{...$,columns:[...$.columns]}}}});var t$=M({id:"flex",render:($)=>({kind:"flex",props:{...$,direction:$.direction??"row",gap:$.gap??"md",align:$.align??"stretch",justify:$.justify??"start",wrap:$.wrap??!1}})});var s$=M({id:"form",render:($)=>({kind:"form",props:{...$,fields:$.fields?[...$.fields]:void 0}})});var e$=M({id:"gauge",render:($)=>{let N=$.value;if(!Number.isFinite(N))throw Error("Gauge value must be a finite number");let G=$.max??100;if(!Number.isFinite(G)||G<=0)throw Error("Gauge max must be a positive number");return{kind:"gauge",props:{value:N,max:G,...$.tone?{tone:$.tone}:{},...$.scale?{scale:$.scale}:{},...$.showValue===!1?{showValue:!1}:{},...$.label?{label:$.label}:{}}}}});var K$=M({id:"grid",render:($)=>{if($.columns!==void 0&&(!Number.isInteger($.columns)||$.columns<1||$.columns>6))throw Error("Grid columns must be an integer between 1 and 6");return{kind:"grid",props:{...$,gap:$.gap??"md"}}}});var $N=M({id:"icon",path:"./ui/icon"});var NN=M({id:"key-value",path:"./ui/key-value"});var GN=M({id:"link",path:"./ui/link"});var hN=M({id:"list",path:"./ui/list"});var WN=M({id:"meter",render:($)=>{if($.data){if($.data.segments.length===0)throw Error("Meter requires at least one segment");for(let N of $.data.segments){if(!N.label)throw Error("Meter segments require a label");if(!Number.isFinite(N.value)||N.value<0)throw Error("Meter segment values must be finite and non-negative")}}return{kind:"meter",props:{...$,data:$.data?{...$.data,segments:[...$.data.segments]}:void 0}}}});var HN=M({id:"notebook",path:"./ui/notebook"});var QN=M({id:"notebook-catalog",path:"./ui/notebook-catalog"});var XN=M({id:"page-header",render:($)=>{if(!$.title)throw Error("PageHeader requires a title");return{kind:"page-header",props:{...$}}}});var YN=M({id:"query-editor",path:"./ui/query-editor"});var RN=M({id:"resource",render:($)=>({kind:"resource",props:{...$}})});var _N=M({id:"resource-tree",render:($)=>{if(!$.label)throw Error("ResourceTree requires a label");return{kind:"resource-tree",props:{...$}}}});var b$=M({id:"section",render:($)=>{if(!$.title)throw Error("Section requires a title");if($.link?.path&&!$.link.path.startsWith("/"))throw Error("Section link path must be absolute");return{kind:"section",props:{...$}}}});var JN=M({id:"select",path:"./ui/select"});var BN=M({id:"split-pane",render:($)=>({kind:"split-pane",props:{...$}})});var qN=M({id:"stack",render:($)=>({kind:"stack",props:{...$,gap:$.gap??"md"}})});var LN=M({id:"table",path:"./ui/table"});var MN=M({id:"tabs",render:($)=>{if($.items.length===0)throw Error("Tabs requires at least one item");for(let N of $.items)if(N.link&&!N.link.startsWith("/"))throw Error("Tabs item link must be absolute");if($.defaultIndex!==void 0&&($.defaultIndex<0||$.defaultIndex>=$.items.length))throw Error("Tabs defaultIndex must reference an item");return{kind:"tabs",props:{items:[...$.items],...$.defaultIndex===void 0?{}:{defaultIndex:$.defaultIndex},...$.variant?{variant:$.variant}:{}}}}});var yN=M({id:"target",path:"./ui/target"});var VN=M({id:"text-input",path:"./ui/text-input"});var SN=M({id:"value",path:"./ui/value"});class N$ extends Error{constructor($){super($);this.name="UnserializablePageError"}}function u($){return{resourceId:$.resourceId,...$.input===void 0?{}:{input:$.input},...$.refresh?{refresh:$.refresh}:{}}}function E($){if(typeof $==="string")return{actionId:$};if("field"in $)return $;return $.kind==="action-binding"?{actionId:$.actionId,input:$.input}:{actionId:$.id}}function ZN($){return{source:u($.source),...$.nameField?{nameField:$.nameField}:{},...$.typeField?{typeField:$.typeField}:{},...$.children?{children:ZN($.children)}:{}}}function cN($){return{source:u($.source),...$.nameField?{nameField:$.nameField}:{},...$.typeField?{typeField:$.typeField}:{},...$.rowLink?{rowLink:{path:$.rowLink.path,params:{...$.rowLink.params}}}:{},...$.children?{children:cN($.children)}:{}}}function b($){return(Array.isArray($)?$:[$]).map(FN)}function FN($){switch($.kind){case"page-header":return{kind:$.kind,props:{title:$.props.title,...$.props.description?{description:$.props.description}:{},...$.props.badge?{badge:{...$.props.badge}}:{},...$.props.meta?{meta:$.props.meta}:{},...$.props.variant?{variant:$.props.variant}:{},...$.props.tags?{tags:b($.props.tags)}:{},...$.props.actions?{actions:b($.props.actions)}:{}}};case"table":return{kind:$.kind,props:{...$.props.source?{source:u($.props.source)}:{},...$.props.columnsSource?{columnsSource:u($.props.columnsSource)}:{},...$.props.data?{data:$.props.data}:{},...$.props.variant?{variant:$.props.variant}:{},...$.props.searchable?{searchable:!0}:{},...$.props.filters?{filters:$.props.filters.map((N)=>({field:N.field,label:N.label,options:N.options.map((G)=>({...G}))}))}:{},...$.props.pageSize?{pageSize:$.props.pageSize}:{},...$.props.columns?{columns:$.props.columns.map((N)=>({id:N.id,label:N.label,...N.format?{format:N.format}:{},...N.renderCell?{renderCell:b(N.renderCell)}:{}}))}:{},...$.props.rowLink?{rowLink:{path:$.props.rowLink.path,params:{...$.props.rowLink.params}}}:{},...$.props.rowActions?{rowActions:$.props.rowActions.map((N)=>({label:N.label,...N.icon?{icon:N.icon}:{},...N.variant?{variant:N.variant}:{},...N.action?{action:{actionId:typeof N.action==="string"?N.action:N.action.id,...N.input?{input:{...N.input}}:{}}}:{},...N.link?{link:{path:N.link.path,params:{...N.link.params}}}:{},...N.successLink?{successLink:{path:N.successLink.path,params:{...N.successLink.params}}}:{},...N.when?{when:{...N.when}}:{},...N.disabledWhen?{disabledWhen:{...N.disabledWhen}}:{},...N.confirmation?{confirmation:{...N.confirmation}}:{}}))}:{},...$.props.actions?{actions:$.props.actions.map((N)=>({label:N.label,...N.link?{link:{path:N.link.path,params:{...N.link.params}}}:{},...N.action?{action:{actionId:typeof N.action==="string"?N.action:N.action.id,...N.input?{input:{...N.input}}:{}}}:{},...N.successLink?{successLink:{path:N.successLink.path,params:{...N.successLink.params}}}:{},...N.when?{when:{...N.when}}:{},...N.confirmation?{confirmation:{...N.confirmation}}:{}}))}:{}}};case"button":return{kind:$.kind,props:{label:$.props.label,...$.props.icon?{icon:$.props.icon}:{},...$.props.description?{description:$.props.description}:{},...$.props.kbd?{kbd:$.props.kbd}:{},...$.props.variant?{variant:$.props.variant}:{},...$.props.action?{action:E($.props.action)}:{},...$.props.successLink?{successLink:{path:$.props.successLink.path,params:{...$.props.successLink.params}}}:{},...$.props.link?{link:$.props.link}:{},...$.props.confirmation?{confirmation:$.props.confirmation}:{}}};case"icon":return{kind:$.kind,props:{name:$.props.name,...$.props.size?{size:$.props.size}:{}}};case"badge":return{kind:$.kind,props:{label:$.props.label,...$.props.tone?{tone:$.props.tone}:{},...$.props.dot?{dot:!0}:{}}};case"tabs":return{kind:$.kind,props:{items:$.props.items.map((N)=>({label:N.label,content:b(N.content),...N.link?{link:N.link}:{}})),...$.props.defaultIndex===void 0?{}:{defaultIndex:$.props.defaultIndex},...$.props.variant?{variant:$.props.variant}:{}}};case"key-value":return{kind:$.kind,props:{...$.props.title?{title:$.props.title}:{},...$.props.source?{source:u($.props.source)}:{},...$.props.data?{data:{...$.props.data}}:{}}};case"query-editor":return{kind:$.kind,props:{language:$.props.language,...$.props.value!==void 0?{value:$.props.value}:{},action:E($.props.action),...$.props.explorer?{explorer:ZN($.props.explorer)}:{}}};case"resource-tree":return{kind:$.kind,props:{label:$.props.label,branch:cN($.props.branch),...$.props.selectedPath?{selectedPath:$.props.selectedPath}:{},...$.props.stateKey?{stateKey:$.props.stateKey}:{},...$.props.searchPlaceholder?{searchPlaceholder:$.props.searchPlaceholder}:{}}};case"resource":{let N=$.props;return{kind:$.kind,props:{...N.source?{source:u(N.source)}:{},content:b(N.content)}}}case"link":return{kind:$.kind,props:{...$.props}};case"code-block":return{kind:$.kind,props:{...$.props}};case"notebook":return{kind:$.kind,props:{...$.props.id?{id:$.props.id}:{},title:$.props.title,...$.props.description?{description:$.props.description}:{},...$.props.notebooks?{notebooks:$.props.notebooks.map((N)=>({...N}))}:{},...$.props.openTabs?{openTabs:$.props.openTabs.map((N)=>({...N}))}:{},...$.props.metadata?{metadata:{...$.props.metadata}}:{},...$.props.actions?{actions:{...$.props.actions.save?{save:E($.props.actions.save)}:{},...$.props.actions.select?{select:E($.props.actions.select)}:{},...$.props.actions.create?{create:E($.props.actions.create)}:{},...$.props.actions.delete?{delete:E($.props.actions.delete)}:{},...$.props.actions.duplicate?{duplicate:E($.props.actions.duplicate)}:{},...$.props.actions.import?{import:E($.props.actions.import)}:{},...$.props.actions.close?{close:E($.props.actions.close)}:{}}}:{},blocks:$.props.blocks.map((N)=>N.kind==="code"?{...N,action:E(N.action)}:{...N})}};case"notebook-catalog":return{kind:$.kind,props:{notebooks:$.props.notebooks.map((N)=>({...N})),...$.props.actions?{actions:{...$.props.actions.create?{create:E($.props.actions.create)}:{},...$.props.actions.import?{import:E($.props.actions.import)}:{}}}:{}}};case"split-pane":return{kind:$.kind,props:{sidebar:b($.props.sidebar),content:b($.props.content),...$.props.inspector?{inspector:b($.props.inspector)}:{}}};case"select":if($.props.onChange)throw new N$("Select callbacks cannot be serialized");return{kind:$.kind,props:{name:$.props.name,...$.props.label?{label:$.props.label}:{},options:$.props.options,...$.props.value!==void 0?{value:$.props.value}:{},...$.props.placeholder?{placeholder:$.props.placeholder}:{}}};case"text-input":if($.props.onChange)throw new N$("Text input callbacks cannot be serialized");return{kind:$.kind,props:{name:$.props.name,...$.props.label?{label:$.props.label}:{},...$.props.value!==void 0?{value:$.props.value}:{},...$.props.placeholder?{placeholder:$.props.placeholder}:{},...$.props.secret?{secret:!0}:{}}};case"form":return{kind:$.kind,props:{fields:b($.props.fields??[]),action:E($.props.onSubmit),...$.props.submitLabel?{submitLabel:$.props.submitLabel}:{}}};case"code-editor":throw new N$("Code editor nodes require a browser-state protocol");case"custom":return{kind:$.kind,props:{component:$.props.component,path:$.props.path,...$.props.browserUrl?{browserUrl:$.props.browserUrl}:{},...$.props.props?{props:{...$.props.props}}:{}}};case"section":return{kind:$.kind,props:{title:$.props.title,...$.props.description?{description:$.props.description}:{},...$.props.link?{link:{...$.props.link}}:{},content:b($.props.content)}};case"card":{let N=$.props;return{kind:$.kind,props:{...N.title?{title:N.title}:{},...N.description?{description:N.description}:{},...N.icon?{icon:N.icon}:{},...N.badge?{badge:N.badge}:{},...N.badgeTone?{badgeTone:N.badgeTone}:{},...N.link?{link:{...N.link}}:{},...N.variant?{variant:N.variant}:{},...N.content?{content:b(N.content)}:{}}}}case"collection":{let N=$.props;return{kind:$.kind,props:{...N.source?{source:u(N.source)}:{},...N.field?{field:N.field}:{},content:b(N.content)}}}case"flex":{let N=$.props;return{kind:$.kind,props:{direction:N.direction,...N.gap?{gap:N.gap}:{},...N.align?{align:N.align}:{},...N.justify?{justify:N.justify}:{},...N.wrap?{wrap:!0}:{},content:b(N.content)}}}case"columns":return{kind:$.kind,props:{columns:$.props.columns.map((N)=>({...N.weight!==void 0?{weight:N.weight}:{},content:b(N.content)}))}};case"grid":{let N=$.props;return{kind:$.kind,props:{...N.columns!==void 0?{columns:N.columns}:{},...N.gap?{gap:N.gap}:{},content:b(N.content)}}}case"stack":{let N=$.props;return{kind:$.kind,props:{...N.gap?{gap:N.gap}:{},content:b(N.content)}}}case"value":{let N=$.props;return{kind:$.kind,props:{...N.source?{source:u(N.source)}:{},field:N.field,...N.format?{format:N.format}:{},...N.fallback?{fallback:N.fallback}:{}}}}case"gauge":return{kind:$.kind,props:{value:$.props.value,...$.props.max!==void 0?{max:$.props.max}:{},...$.props.tone?{tone:$.props.tone}:{},...$.props.scale?{scale:$.props.scale}:{},...$.props.showValue===!1?{showValue:!1}:{},...$.props.label?{label:$.props.label}:{}}};case"meter":return{kind:$.kind,props:{...$.props.field?{field:$.props.field}:{},...$.props.source?{source:u($.props.source)}:{},...$.props.format?{format:$.props.format}:{},...$.props.data?{data:{segments:$.props.data.segments.map((N)=>({...N})),...$.props.data.format?{format:$.props.data.format}:{},...$.props.data.footer?{footer:$.props.data.footer}:{}}}:{}}};default:throw new N$(`Unsupported component kind: ${$.kind}`)}}function F$($){return b($)}class ON extends Error{code;constructor($,N){super(N);this.name="SdkError",this.code=$}}class P extends ON{constructor($){super("INVALID_DEFINITION",$);this.name="InvalidDefinitionError"}}function jN($){if(!$.path.startsWith("/"))throw new P(`Page path must start with "/": ${$.path}`);return{kind:"page",path:$.path,render:$.render}}function dN($,N,G){return $.query(N,G)}function UN($,N){if(!N||typeof N!=="string")throw new P(`${$} id must be a non-empty string`)}function I$($){if(UN("Slot",$.id),!$.slot)throw new P("Slot name must be a non-empty string");if($.slot==="overlay"&&!$.presentation)throw new P('Overlay slots require a presentation, such as { mode: "modal" }');if($.slot!=="overlay"&&$.presentation)throw new P("Only overlay slots may specify a presentation");if($.presentation?.mode==="anchored"&&!$.presentation.target.trim())throw new P("Anchored overlays require a target id");if($.presentation?.mode==="anchored"&&$.presentation.placement!==void 0&&!["top","right","bottom","left"].includes($.presentation.placement))throw new P("Invalid anchored overlay placement");if($.presentation&&$.presentation.mode!=="modal"&&$.presentation.mode!=="drawer"&&$.presentation.mode!=="anchored")throw new P("Invalid overlay presentation mode");if($.presentation?.mode==="anchored"&&$.presentation.path!==void 0&&(!$.presentation.path.startsWith("/")||$.presentation.path.startsWith("//")||Array.from($.presentation.path).some((N)=>N==="\\"||N.charCodeAt(0)<32)))throw new P("Overlay paths must be local app paths");if($.presentation?.mode==="anchored"){let{dock:N,advanceOn:G}=$.presentation;if(N!==void 0&&N!=="bottom-right")throw new P("Invalid overlay dock");if(G&&(!G.target.trim()||!G.event.trim()||!G.overlay.trim()||G.serviceId!==void 0&&!G.serviceId.trim()||G.pluginId!==void 0&&!G.pluginId.trim()||G.serviceId!==void 0&&G.pluginId!==void 0))throw new P("Invalid overlay interaction binding")}if($.presentation?.mode==="drawer"&&$.presentation.width!==void 0&&(!Number.isInteger($.presentation.width)||$.presentation.width<320||$.presentation.width>900))throw new P("Drawer width must be between 320 and 900 pixels");return{kind:"slot",id:$.id,slot:$.slot,...$.order===void 0?{}:{order:$.order},...$.presentation?{presentation:$.presentation}:{},render:$.render}}function m$(){throw Error("Plugin host capability is unavailable")}function aN($){return{kind:"dsui-plugin",...$,prepare(G,H){let W=$.configSchema.parse(G),X=new Map,Q={pluginId:$.metadata.id,config:W,services:{...H.services,executeAction:(_,B,Y,F)=>H.services.executeAction(_,B,Y,{...F,origin:{pluginId:$.metadata.id,...F?.origin?.runId?{runId:F.origin.runId}:{}}})},plugins:{...H.plugins,executeAction:(_,B,Y,F)=>H.plugins.executeAction(_,B,Y,{...F,origin:{pluginId:$.metadata.id,...F?.origin?.runId?{runId:F.origin.runId}:{}}})},storage:H.storage,stores:{get:(_)=>H.stores.get(_),create:(_)=>H.stores.create(_)},logger:H.logger,access:H.access??{require:async()=>m$()},diagnostics:H.diagnostics,jobs:H.jobs??{enqueue:async()=>m$()},events:{read:async(_)=>{if(!H.events?.read)m$();return H.events.read(_)},emit:async(_,B,Y)=>{let F=X.get(_);if(!F)throw Error(`Undeclared plugin signal "${_}"`);if(!H.events)m$();await H.events.emit(_,F.payload.parse(B),Y,F.type??"info")}}};return{setup(_){let B={signal:(Y)=>{if(!/^[a-z][a-z0-9-]*$/.test(Y.id)||X.has(Y.id))throw new P("Invalid or duplicate plugin signal");X.set(Y.id,Y),_.signal?.({id:Y.id,type:Y.type??"info",scope:Y.scope??"global"})},page:(Y,F)=>{if(F.public&&!$.metadata.security)throw new P("Only plugins declaring security: true may register a public page");_.page({id:F.id,path:Y.path,title:F.title,...F.description?{description:F.description}:{},...F.public?{public:F.public}:{},...F.settings?{settings:F.settings}:{},...F.shell?{shell:F.shell}:{},render:async(z)=>F$(await Y.render({context:Q,params:z,resource:(k,tN)=>dN(k,tN,Q)}))})},navigation:(Y)=>_.navigation(Y),slot:(Y)=>_.slot({id:Y.id,slot:Y.slot,order:Y.order,...Y.presentation?{presentation:Y.presentation}:{},render:async({service:F,principal:z})=>F$(await Y.render({context:Q,service:F,principal:z}))}),action:(Y)=>_.action({id:Y.id,input:Y.input??R.undefined(),...Y.output?{output:Y.output}:{},permission:Y.permission,invoke:async(F)=>{let z=Y.input==null?F:Y.input.parse(F),k=await Y.run(z,Q);return Y.output?Y.output.parse(k):k}}),job:(Y)=>_.job({id:Y.id,...Y.inputSchema?{input:Y.inputSchema}:{},...Y.schedule?{schedule:Y.schedule}:{},...Y.intervalMs!==void 0?{intervalMs:Y.intervalMs}:{},...Y.onSignals?{onSignals:[...Y.onSignals]}:{},concurrency:Y.concurrency,timeoutMs:Y.timeoutMs,retry:Y.retry,invoke:async(F,z)=>{let k=Y.inputSchema==null?F:Y.inputSchema.parse(F);await Y.run({input:k,runId:z.runId,context:{pluginId:$.metadata.id,config:Q.config,services:Q.services,plugins:Q.plugins,storage:Q.storage,stores:Q.stores,access:Q.access,diagnostics:Q.diagnostics,jobs:Q.jobs,events:Q.events,signal:z.signal,logger:{info:z.logger.info,warn:z.logger.warn,error:z.logger.error},reportSideEffect:()=>z.reportSideEffect()}})}}),resource:(Y)=>_.resource({id:Y.id,...Y.input?{input:Y.input}:{},refresh:Y.refresh,invoke:async(F)=>{let z=Y.input==null?F:Y.input.parse(F);return Y.query(z,Q)}}),procedure:(Y)=>_.procedure({id:Y.id,input:Y.input,output:Y.output,permission:Y.permission,invoke:async(F)=>{let z=Y.input.parse(F),k=await Y.handler(Q,z);return Y.output?Y.output.parse(k):k}}),authentication:(Y)=>{if(!$.metadata.security)throw Error("Authentication plugins must declare security: true");_.authentication(Y)},authorization:(Y)=>{if(!$.metadata.security)throw Error("Authorization plugins must declare security: true");_.authorization(Y)},secrets:(Y)=>_.secrets(Y)};$.setup(B,W)},start:()=>$.start?.(Q)}}}}var l$=M({id:"example-plugin/service-summary",path:"./browser.mjs",props:R.object({name:R.string(),adapter:R.string()})});var nN=jN({path:"/example",render:async({context:$})=>{let{items:N}=await $.services.list({limit:12});return[b$({title:"Connected services",content:N.length>0?K$({columns:2,content:N.map((G)=>$$({title:G.name,description:G.adapter,variant:"panel",content:l$({name:G.name,adapter:G.adapter})}))}):$$({title:"No services configured",description:"Add a service to see it listed here."})})]}}),iN=I$({id:"service-card-status",slot:"dashboard.service-card.trailing",order:100,render:({service:$})=>l$({name:$.name,adapter:$.adapter})}),oN=I$({id:"workspace-summary",slot:"service.workspace.after-header",order:100,render:({service:$})=>$$({title:"Plugin extension",content:l$({name:$.name,adapter:$.adapter})})});var aW=R.object({id:R.string(),name:R.string(),adapter:R.string(),managedBy:R.enum(["configuration","ui"])}),O9=aN({metadata:{id:"example-plugin",name:"Example plugin",version:"1.0.0",apiVersion:1},configSchema:R.object({greeting:R.string().default("Hello")}),setup($){$.page(nN,{id:"overview",title:"Plugin example",description:"A trusted extension can add navigation and call the sanitized service catalog."}),$.navigation({id:"overview-link",area:"primary",label:"Plugin example",pageId:"overview",order:100}),$.slot(iN),$.slot(oN),$.procedure({id:"list-services",permission:"inspect",input:R.object({cursor:R.string().optional(),limit:R.number().int().positive().max(100).optional()}),output:R.object({items:R.array(aW),nextCursor:R.string().optional()}),handler:(N,G)=>N.services.list(G)}),$.procedure({id:"greet",permission:"inspect",input:R.object({name:R.string().min(1)}),output:R.string(),handler:(N,G)=>`${N.config.greeting}, ${G.name}`})}});export{O9 as default};
|