@getuserfeedback/sdk 0.21.0 → 0.22.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/dist/index.d.ts +7 -4
- package/dist/index.js +2 -2
- package/dist/index.js.map +8 -7
- package/dist/internal/customer-occurrence-command.d.ts +13 -3
- package/dist/internal/customer-occurrence-command.js +2 -2
- package/dist/internal/customer-occurrence-command.js.map +3 -3
- package/dist/internal/feedback-command.d.ts +7 -0
- package/dist/internal/feedback-command.js +4 -0
- package/dist/internal/feedback-command.js.map +25 -0
- package/dist/internal/inline-flow.d.ts +6 -3
- package/dist/internal/inline-flow.js +2 -2
- package/dist/internal/inline-flow.js.map +2 -2
- package/dist/internal/react-container.d.ts +6 -3
- package/package.json +6 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppEventJsonInputValue,
|
|
1
|
+
import { AppEventJsonInputValue, PublicCommandPayload } from '@getuserfeedback/protocol';
|
|
2
2
|
import { TrackOptions } from '@getuserfeedback/protocol/host';
|
|
3
3
|
|
|
4
4
|
type EventProperties = Record<string, AppEventJsonInputValue>;
|
|
@@ -6,9 +6,19 @@ type EventOptions = TrackOptions;
|
|
|
6
6
|
type CustomerOccurrenceCommand = Extract<PublicCommandPayload, {
|
|
7
7
|
kind: "track";
|
|
8
8
|
}>;
|
|
9
|
-
declare const buildCustomerOccurrenceCommand: (input: {
|
|
10
|
-
type:
|
|
9
|
+
declare const buildCustomerOccurrenceCommand: (input: ({
|
|
10
|
+
type: "track";
|
|
11
11
|
event: string;
|
|
12
|
+
} | {
|
|
13
|
+
type: "page" | "screen";
|
|
14
|
+
event?: string | undefined;
|
|
15
|
+
}) & {
|
|
16
|
+
page?: {
|
|
17
|
+
url: string;
|
|
18
|
+
path: string;
|
|
19
|
+
search: string;
|
|
20
|
+
referrer?: string | undefined;
|
|
21
|
+
};
|
|
12
22
|
properties?: EventProperties;
|
|
13
23
|
options?: EventOptions;
|
|
14
24
|
}) => CustomerOccurrenceCommand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var p=(e)=>e!==null&&typeof e==="object"&&!Array.isArray(e),f=(e)=>{if(!p(e))return!1;let t=Object.entries(e).find(([r])=>r==="externalIds")?.[1];return Array.isArray(t)&&t.length>0&&t.every(l)},l=(e)=>{if(!p(e))return!1;return typeof e.id==="string"&&typeof e.type==="string"&&e.collection==="users"&&e.encoding==="none"},d=({argument:e,commandName:t,valueArgumentName:r,callShape:n})=>{if(!f(e))return;throw Error(`${t} received externalIds in the ${r} argument. Use ${n} instead.`)};function a(e,t){if(typeof e!=="string")throw Error(`${t} must be a non-empty string`);let r=e.trim();if(r.length===0)throw Error(`${t} must be a non-empty string`);if(r.length>255)throw Error(`${t} must be at most 255 characters`);return r}function m(e){if(e===void 0)return;if(typeof e!=="string"||e.trim().length===0)throw Error("messageId must be a non-empty string");if(e.length>255)throw Error("messageId must be at most 255 characters");return e}function c(e){if(e!==null&&typeof e==="object"){let t;try{t=Date.prototype.getTime.call(e)}catch{}if(t!==void 0){if(!Number.isFinite(t))throw RangeError("Invalid Date");return Date.prototype.toISOString.call(e)}}if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r+=1){if(!Object.hasOwn(e,r))throw TypeError("Sparse arrays are not supported");t.push(c(e[r]))}return t}if(e!==null&&typeof e==="object"){let t=Object.getPrototypeOf(e),r=Reflect.ownKeys(e);if(r.includes("__proto__")||r.some((s)=>typeof s==="symbol"))throw TypeError('JSON objects cannot contain own "__proto__" or symbol keys.');let n,o;try{n=t===null||t===Object.prototype?void 0:Object.getOwnPropertyDescriptor(t,"constructor")?.value,o=typeof n==="function"?Object.getOwnPropertyDescriptor(n,"name")?.value:void 0}catch{throw TypeError("Expected a plain JSON object")}if(t!==null&&t!==Object.prototype&&!(Object.getPrototypeOf(t)===null&&typeof n==="function"&&o==="Object"))throw TypeError("Expected a plain JSON object");for(let s of r)if(!Object.getOwnPropertyDescriptor(e,s)?.enumerable)throw TypeError("Non-enumerable JSON properties are not supported");let i={};for(let s of r)if(typeof s==="string")Object.defineProperty(i,s,{value:c(Reflect.get(e,s)),enumerable:!0,configurable:!0,writable:!0});return i}return e}var u={page:"page(name, properties, { externalIds })",screen:"screen(name, properties, { externalIds })",track:"track(eventName, properties, { externalIds })"},y={page:"pageName",screen:"screenName",track:"eventName"},N=(e)=>{let t=e.type!=="track"&&e.event!==void 0?a(e.event,y[e.type]):void 0,r=m(e.options?.messageId),n=e.properties===void 0?void 0:c(e.properties);d({argument:n,commandName:e.type,valueArgumentName:"properties",callShape:u[e.type]});let o=e.type==="track"?{kind:"track",origin:"customer",event:a(e.event,"eventName")}:{kind:"track",origin:"customer",type:e.type};if(t!==void 0)o.event=t;if(n!==void 0)o.properties=n;if(r!==void 0)o.messageId=r;if(e.options?.externalIds!==void 0)o.context={externalIds:e.options.externalIds};if(e.page!==void 0)o.context={...o.context,page:e.page};return o};export{N as buildCustomerOccurrenceCommand};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=8F1236765204CDAB64756E2164756E21
|
|
4
4
|
//# sourceMappingURL=customer-occurrence-command.js.map
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"const isObjectRecord = (value) => value !== null && typeof value === \"object\" && !Array.isArray(value);\nconst hasSegmentExternalIdsProperty = (value) => {\n if (!isObjectRecord(value)) {\n return false;\n }\n const externalIds = Object.entries(value).find(([key]) => key === \"externalIds\")?.[1];\n return (Array.isArray(externalIds) &&\n externalIds.length > 0 &&\n externalIds.every(isSegmentExternalIdLike));\n};\nconst isSegmentExternalIdLike = (value) => {\n if (!isObjectRecord(value)) {\n return false;\n }\n return (typeof value.id === \"string\" &&\n typeof value.type === \"string\" &&\n value.collection === \"users\" &&\n value.encoding === \"none\");\n};\nexport const assertNoSegmentExternalIdsInValueArgument = ({ argument, commandName, valueArgumentName, callShape, }) => {\n if (!hasSegmentExternalIdsProperty(argument)) {\n return;\n }\n throw new Error(`${commandName} received externalIds in the ${valueArgumentName} argument. Use ${callShape} instead.`);\n};\n",
|
|
6
6
|
"const MAX_MESSAGE_ID_LENGTH = 255;\nconst MAX_OCCURRENCE_NAME_LENGTH = 255;\n// Governed by docs/specs/2026-08-28-sdk-customer-occurrence.md.\n/** @internal Validates and normalizes an SDK-supplied occurrence name. */\nexport function parseCustomerOccurrenceName(name, argumentName) {\n if (typeof name !== \"string\") {\n throw new Error(`${argumentName} must be a non-empty string`);\n }\n const normalized = name.trim();\n if (normalized.length === 0) {\n throw new Error(`${argumentName} must be a non-empty string`);\n }\n if (normalized.length > MAX_OCCURRENCE_NAME_LENGTH) {\n throw new Error(`${argumentName} must be at most ${MAX_OCCURRENCE_NAME_LENGTH} characters`);\n }\n return normalized;\n}\n/** @internal Validates an SDK-supplied occurrence ID without normalizing it. */\nexport function parseTrackMessageId(messageId) {\n if (messageId === undefined) {\n return undefined;\n }\n if (typeof messageId !== \"string\" || messageId.trim().length === 0) {\n throw new Error(\"messageId must be a non-empty string\");\n }\n if (messageId.length > MAX_MESSAGE_ID_LENGTH) {\n throw new Error(`messageId must be at most ${MAX_MESSAGE_ID_LENGTH} characters`);\n }\n return messageId;\n}\n",
|
|
7
7
|
"export function normalizeDateValuesInProtocolJsonValue(value) {\n if (value !== null && typeof value === \"object\") {\n let time;\n try {\n time = Date.prototype.getTime.call(value);\n }\n catch {\n // Non-Date objects continue through the JSON container checks below.\n }\n if (time !== undefined) {\n if (!Number.isFinite(time)) {\n throw new RangeError(\"Invalid Date\");\n }\n return Date.prototype.toISOString.call(value);\n }\n }\n if (Array.isArray(value)) {\n const normalized = [];\n for (let index = 0; index < value.length; index += 1) {\n if (!Object.hasOwn(value, index)) {\n throw new TypeError(\"Sparse arrays are not supported\");\n }\n normalized.push(normalizeDateValuesInProtocolJsonValue(value[index]));\n }\n return normalized;\n }\n if (value !== null && typeof value === \"object\") {\n const prototype = Object.getPrototypeOf(value);\n const ownKeys = Reflect.ownKeys(value);\n if (ownKeys.includes(\"__proto__\") ||\n ownKeys.some((key) => typeof key === \"symbol\")) {\n throw new TypeError('JSON objects cannot contain own \"__proto__\" or symbol keys.');\n }\n let objectConstructor;\n let objectConstructorName;\n try {\n objectConstructor =\n prototype === null || prototype === Object.prototype\n ? undefined\n : Object.getOwnPropertyDescriptor(prototype, \"constructor\")?.value;\n objectConstructorName =\n typeof objectConstructor === \"function\"\n ? Object.getOwnPropertyDescriptor(objectConstructor, \"name\")?.value\n : undefined;\n }\n catch {\n throw new TypeError(\"Expected a plain JSON object\");\n }\n if (prototype !== null &&\n prototype !== Object.prototype &&\n !(Object.getPrototypeOf(prototype) === null &&\n typeof objectConstructor === \"function\" &&\n objectConstructorName === \"Object\")) {\n throw new TypeError(\"Expected a plain JSON object\");\n }\n for (const key of ownKeys) {\n if (!Object.getOwnPropertyDescriptor(value, key)?.enumerable) {\n throw new TypeError(\"Non-enumerable JSON properties are not supported\");\n }\n }\n const normalized = {};\n for (const key of ownKeys) {\n if (typeof key === \"string\") {\n Object.defineProperty(normalized, key, {\n value: normalizeDateValuesInProtocolJsonValue(Reflect.get(value, key)),\n enumerable: true,\n configurable: true,\n writable: true,\n });\n }\n }\n return normalized;\n }\n return value;\n}\n// oxlint-enable anti-slop/no-unknown-returns\n",
|
|
8
|
-
"import type {\n\tAppEventJsonInputValue,\n\
|
|
8
|
+
"import type {\n\tAppEventJsonInputValue,\n\tPublicCommandPayload,\n} from \"@getuserfeedback/protocol\";\nimport type { TrackOptions } from \"@getuserfeedback/protocol/host\";\nimport { assertNoSegmentExternalIdsInValueArgument } from \"@getuserfeedback/protocol/host\";\nimport {\n\tparseCustomerOccurrenceName,\n\tparseTrackMessageId,\n} from \"@getuserfeedback/protocol/internal/sdk-event-options\";\nimport { normalizeDateValuesInProtocolJsonValue } from \"@getuserfeedback/protocol/json-date-normalization\";\n\nexport type EventProperties = Record<string, AppEventJsonInputValue>;\nexport type EventOptions = TrackOptions;\n\ntype CustomerOccurrenceCommand = Extract<\n\tPublicCommandPayload,\n\t{ kind: \"track\" }\n>;\n\nconst occurrenceCallShapes = {\n\tpage: \"page(name, properties, { externalIds })\",\n\tscreen: \"screen(name, properties, { externalIds })\",\n\ttrack: \"track(eventName, properties, { externalIds })\",\n} as const;\n\nconst occurrenceArgumentNames = {\n\tpage: \"pageName\",\n\tscreen: \"screenName\",\n\ttrack: \"eventName\",\n} as const;\n\nexport const buildCustomerOccurrenceCommand = (\n\tinput: (\n\t\t| { type: \"track\"; event: string }\n\t\t| { type: \"page\" | \"screen\"; event?: string | undefined }\n\t) & {\n\t\tpage?: {\n\t\t\turl: string;\n\t\t\tpath: string;\n\t\t\tsearch: string;\n\t\t\treferrer?: string | undefined;\n\t\t};\n\t\tproperties?: EventProperties;\n\t\toptions?: EventOptions;\n\t},\n): CustomerOccurrenceCommand => {\n\tconst event =\n\t\tinput.type !== \"track\" && input.event !== undefined\n\t\t\t? parseCustomerOccurrenceName(\n\t\t\t\t\tinput.event,\n\t\t\t\t\toccurrenceArgumentNames[input.type],\n\t\t\t\t)\n\t\t\t: undefined;\n\tconst messageId = parseTrackMessageId(input.options?.messageId);\n\tconst properties =\n\t\tinput.properties === undefined\n\t\t\t? undefined\n\t\t\t: normalizeDateValuesInProtocolJsonValue(input.properties);\n\tassertNoSegmentExternalIdsInValueArgument({\n\t\targument: properties,\n\t\tcommandName: input.type,\n\t\tvalueArgumentName: \"properties\",\n\t\tcallShape: occurrenceCallShapes[input.type],\n\t});\n\n\tconst command: CustomerOccurrenceCommand =\n\t\tinput.type === \"track\"\n\t\t\t? {\n\t\t\t\t\tkind: \"track\",\n\t\t\t\t\torigin: \"customer\",\n\t\t\t\t\tevent: parseCustomerOccurrenceName(input.event, \"eventName\"),\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tkind: \"track\",\n\t\t\t\t\torigin: \"customer\",\n\t\t\t\t\ttype: input.type,\n\t\t\t\t};\n\tif (event !== undefined) {\n\t\tcommand.event = event;\n\t}\n\tif (properties !== undefined) {\n\t\tcommand.properties = properties;\n\t}\n\tif (messageId !== undefined) {\n\t\tcommand.messageId = messageId;\n\t}\n\tif (input.options?.externalIds !== undefined) {\n\t\tcommand.context = { externalIds: input.options.externalIds };\n\t}\n\tif (input.page !== undefined) {\n\t\tcommand.context = { ...command.context, page: input.page };\n\t}\n\treturn command;\n};\n"
|
|
9
9
|
],
|
|
10
|
-
"mappings": "AAAA,IAAM,EAAiB,CAAC,IAAU,IAAU,MAAQ,OAAO,IAAU,UAAY,CAAC,MAAM,QAAQ,CAAK,EAC/F,EAAgC,CAAC,IAAU,CAC7C,GAAI,CAAC,EAAe,CAAK,EACrB,MAAO,GAEX,IAAM,EAAc,OAAO,QAAQ,CAAK,EAAE,KAAK,EAAE,KAAS,IAAQ,aAAa,IAAI,GACnF,OAAQ,MAAM,QAAQ,CAAW,GAC7B,EAAY,OAAS,GACrB,EAAY,MAAM,CAAuB,GAE3C,EAA0B,CAAC,IAAU,CACvC,GAAI,CAAC,EAAe,CAAK,EACrB,MAAO,GAEX,OAAQ,OAAO,EAAM,KAAO,UACxB,OAAO,EAAM,OAAS,UACtB,EAAM,aAAe,SACrB,EAAM,WAAa,QAEd,EAA4C,EAAG,WAAU,cAAa,oBAAmB,eAAiB,CACnH,GAAI,CAAC,EAA8B,CAAQ,EACvC,OAEJ,MAAU,MAAM,GAAG,iCAA2C,mBAAmC,YAAoB,GCnBlH,SAAS,CAA2B,CAAC,EAAM,EAAc,CAC5D,GAAI,OAAO,IAAS,SAChB,MAAU,MAAM,GAAG,8BAAyC,EAEhE,IAAM,EAAa,EAAK,KAAK,EAC7B,GAAI,EAAW,SAAW,EACtB,MAAU,MAAM,GAAG,8BAAyC,EAEhE,GAAI,EAAW,OAXgB,IAY3B,MAAU,MAAM,GAAG,kCAAuE,EAE9F,OAAO,EAGJ,SAAS,CAAmB,CAAC,EAAW,CAC3C,GAAI,IAAc,OACd,OAEJ,GAAI,OAAO,IAAc,UAAY,EAAU,KAAK,EAAE,SAAW,EAC7D,MAAU,MAAM,s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204CDAB64756E2164756E21",
|
|
12
12
|
"names": []
|
|
13
13
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Answer, FeedbackOptions, PublicCommandPayload } from '@getuserfeedback/protocol';
|
|
2
|
+
|
|
3
|
+
declare function buildFeedbackCommand(answers: string | Answer | readonly Answer[], options?: FeedbackOptions): Extract<PublicCommandPayload, {
|
|
4
|
+
kind: "feedback";
|
|
5
|
+
}>;
|
|
6
|
+
|
|
7
|
+
export { buildFeedbackCommand };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
function De(e,t){if(typeof t==="bigint")return t.toString();return t}class Ne{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function ce(e){return new Ne(e)}function Fe(e){return e===null||e===void 0}function ue(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}var Me=Symbol("evaluating");function Le(e,t,r){let n=void 0;Object.defineProperty(e,t,{get(){if(n===Me)return;if(n===void 0)n=Me,n=r();return n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function ae(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function je(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}var le="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function B(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function pe(e){if(B(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(B(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function fe(e){if(pe(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}function G(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function H(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function g(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function Ue(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Ve=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))();function E(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Be(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function I(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function V(e){return typeof e==="string"?e:e?.message}function me(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;if(o>=0)t.push([o,r])}return t}function J(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function k(e,t,r){var n;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(n=e).schema??(n.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,c=e.message?e.message:V(e.inst?._zod.def?.error?.(e))??V(i?.(e))??V(t?.error?.(e))??V(r.customError?.(e))??V(r.localeError?.(e))??"Invalid input",s={};for(let l of Object.keys(e)){if(l==="inst"||l==="schema"||l==="continue"||l==="input"||l==="__proto__")continue;s[l]=e[l]}if(s.path??(s.path=[]),s.message=c,t?.reportInput)s.input=e.input;return s}var ur=/[\uD800-\uDBFF]/;function de(e){let t=e.length;if(!ur.test(e))return t;let r=t;for(let n=0;n<t-1;n++)if((e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320)r--,n++;return r}function he(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function _e(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function Ke(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else ar(e,r,n.value)}}function D(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function ge(e,t,r){return D(e,t,r,!1)}function ar(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:D(this,t,r.bind(this))},set(n){D(this,t,n)}})}function lr(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var se,C=!1,pr={configurable:!0,get(){C=!0;return}};function x(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&se!==e._zod){se=void 0;return}se=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,pr);let o=C;C=!1;try{let i=r(this);if(C)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return C=C||o,i}catch(i){throw delete this[t],C=C||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function We(e,t,r,n){let o=lr(e,t);if(!o)return;Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var qe;var xe={value:void 0,enumerable:!1},Ge="captureStackTrace"in Error?Error:null;function fr(e){let t=Ge;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return Ge=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function p(e,t,r,n){let o={};function i(f){this.def=f,this.constr=m,this.traits=new Set}i.prototype=o;let c=r,s=c&&new WeakSet;function l(f,h){if(!f._zod){xe.value=new i(h);try{Object.defineProperty(f,"_zod",xe)}finally{xe.value=void 0}}else if(f._zod.traits.has(e))return;if(f._zod.traits.add(e),t(f,h),s){let _=Object.getPrototypeOf(f),S=f._zod.constr.prototype,P=_;while(P&&P!==S)P=Object.getPrototypeOf(P);let F=P??_;if(!s.has(F))s.add(F),Ke(F,c)}let d=m.prototype;for(let _ in d){if(!Object.prototype.hasOwnProperty.call(d,_))continue;if(!(_ in f))f[_]=d[_].bind(f)}}let u=n?.Parent??Object;class a extends u{}Object.defineProperty(a,"name",{value:e});function m(f){let h=n?.Parent?fr(a):this;l(h,f);let d=h._zod.deferred;if(d){for(let S of d)S();h._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;if(_)_(h);return h}return Object.defineProperty(m,"init",{value:l}),Object.defineProperty(m,Symbol.hasInstance,{value:(f)=>{if(n?.Parent&&f instanceof n.Parent)return!0;return f?._zod?.traits?.has(e)}}),Object.defineProperty(m,"name",{value:e}),m}class T extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}(qe=globalThis).__zod_globalConfig??(qe.__zod_globalConfig={});var L=globalThis.__zod_globalConfig;function A(e){if(e)Object.assign(L,e);return L}function mr(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,De,2)),e.message}function dr(e){this._zod.message=e}var hr={get:mr,set:dr,enumerable:!0,configurable:!0},ve={value:void 0,enumerable:!1},He=new WeakSet([Object.prototype,Error.prototype]),Je=(e,t)=>{e.name="$ZodError",ve.value=t,Object.defineProperty(e,"issues",ve),ve.value=void 0,Object.defineProperty(e,"message",hr);let r=Object.getPrototypeOf(e);if(!He.has(r))He.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}})},ln=p("$ZodError",Je),K=p("$ZodError",Je,void 0,{Parent:Error});var gr=(e)=>{let t=(r,n,o,i)=>{let c=o?{...o,async:!1}:{async:!1},s=r._zod.run({value:n,issues:[]},c);if(s instanceof Promise)throw new T;if(s.issues.length){let l=new(i?.Err??e)(s.issues.map((u)=>k(u,c,A())));throw le(l,i?.callee??t),l}return s.value};return t},be=gr(K),xr=(e)=>{let t=async(r,n,o,i)=>{let c=o?{...o,async:!0}:{async:!0},s=r._zod.run({value:n,issues:[]},c);if(s instanceof Promise)s=await s;if(s.issues.length){let l=new(i?.Err??e)(s.issues.map((u)=>k(u,c,A())));throw le(l,i?.callee??t),l}return s.value};return t},$e=xr(K),zr=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new T;return i.issues.length?Xe(e,i.issues,o):{success:!0,data:i.value}},ye=zr(K);function Xe(e,t,r){let n;return{success:!1,get error(){if(!n)n=new e(t.map((o)=>k(o,r,A()))),t=void 0,r=void 0;return n},set error(o){n=o,t=void 0,r=void 0}}}var vr=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)i=await i;return i.issues.length?Xe(e,i.issues,o):{success:!0,data:i.value}},we=vr(K);var br="(?:(?:\\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])))";function Ye(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Qe(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ye({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${Ye({precision:e.precision})}`:r;return new RegExp(`^${br}T(?:${n})$`)}var et=/^[\s\S]{0,}$/;var Se=/^-?\d+(?:\.\d+)?$/,tt=/^(?:true|false)$/i,rt=/^null$/i;var R=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var ot=(e)=>{let t=e.value;return!Fe(t)&&t.length!==void 0};var it=p("$ZodCheckNumberFormat",(e,t)=>{R.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Ve[t.format];e._zod.check=(c)=>{let s=c.value;if(r){if(!Number.isInteger(s)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){if(s>0)c.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else c.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(s<o)c.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(s>i)c.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var st=p("$ZodCheckMaxLength",(e,t)=>{var r;R.init(e,t),(r=e._zod.def).when??(r.when=ot),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>t.maximum?de(o):i)<=t.maximum)return;let s=he(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ct=p("$ZodCheckMinLength",(e,t)=>{var r;R.init(e,t),(r=e._zod.def).when??(r.when=ot),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>=t.minimum&&i<t.minimum*2?de(o):i)>=t.minimum)return;let s=he(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var ut=p("$ZodCheckStringFormat",(e,t)=>{var r,n;if(R.init(e,t),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})});var lt={major:4,minor:6,patch:7};var v=p("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=lt;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let c of i._zod.onattach)c(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(s,l,u)=>{if(s.memo)return s;let a=E(s),m;for(let f of l){if(f._zod.def.when){if(Be(s))continue;if(!f._zod.def.when(s))continue}else if(a)continue;let h=s.issues.length,d=f._zod.check(s);if(d instanceof Promise&&u?.async===!1)throw new T;if(m||d instanceof Promise)m=(m??Promise.resolve()).then(async()=>{if(await d,s.issues.length===h)return;if(J(s.issues,h,e),!a)a=E(s,h)});else{if(s.issues.length===h)continue;if(J(s.issues,h,e),!a)a=E(s,h)}}if(m)return m.then(()=>s);return s},c=(s,l,u)=>{if(E(s))return s.aborted=!0,s;let a=i(l,o,u);if(a instanceof Promise){if(u.async===!1)throw new T;return a.then((m)=>e._zod.parse(m,u))}return e._zod.parse(a,u)};e._zod.run=(s,l)=>{if(l.skipChecks)return e._zod.parse(s,l);if(l.direction==="backward"){let a=e._zod.parse({value:s.value,issues:[]},{...l,skipChecks:!0});if(a instanceof Promise)return a.then((m)=>c(m,s,l));return c(a,s,l)}let u=e._zod.parse(s,l);if(u instanceof Promise){if(l.async===!1)throw new T;return u.then((a)=>i(a,o,l))}return i(u,o,l)}}},{get "~standard"(){return ge(this,"~standard",yr(this))},set "~standard"(e){D(this,"~standard",e)}}),_t=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>k(r,t,A()))}:{value:e.value};async function $r(e,t){let r={async:!0};return _t(await e._zod.run({value:t,issues:[]},r),r)}function yr(e){return{validate:(t)=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return _t(n,r)}catch(n){}return $r(e,t)},vendor:"zod",version:1}}var Ze=p("$ZodString",(e,t)=>{v.init(e,t),e._zod.pattern=t.pattern??et,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(o){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Pe=p("$ZodStringFormat",(e,t)=>{ut.init(e,t),Ze.init(e,t)});var gt=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Qe(t)),Pe.init(e,t)});var Ee=p("$ZodNumber",(e,t)=>{v.init(e,t),e._zod.pattern=Se,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(c){}let o=r.value;if(typeof o==="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o==="number"?Number.isNaN(o)?"NaN":!Number.isFinite(o)?String(o):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),xt=p("$ZodNumberFormat",(e,t)=>{it.init(e,t),Ee.init(e,t)}),zt=p("$ZodBoolean",(e,t)=>{v.init(e,t),e._zod.pattern=tt,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(i){}let o=r.value;if(typeof o==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var vt=p("$ZodNull",(e,t)=>{v.init(e,t),e._zod.pattern=rt,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;if(o===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}});var bt=p("$ZodUnknown",(e,t)=>{v.init(e,t),e._zod.parse=(r)=>r}),$t=p("$ZodNever",(e,t)=>{v.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function wr(e,t){let r=me(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map((i)=>i[0])),o=e._zod.parse;e._zod.parse=(i,c)=>{let s=t(i.value);if(s>n&&!c?.skipChecks&&c?.direction!=="backward"){for(let[l,u]of me(e._zod.def.checks))if(s>l&&u._zod.def.when(i)){let a=i.issues.length;return u._zod.check(i),i.issues[a].continue=!1,J(i.issues,a,e),i}}return o(i,c)}}var Sr=(e)=>Array.isArray(e)?e.length:-1;function pt(e,t,r){if(e.issues.length)t.issues.push(...I(r,e.issues));t.value[r]=e.value}var yt=p("$ZodArray",(e,t)=>{v.init(e,t);let r=L.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let c=[],s=o?.abortEarly;for(let l=0;l<i.length;l++){let u=i[l],a=t.element._zod.run({value:u,issues:[]},o);if(a instanceof Promise)c.push(a.then((m)=>pt(m,n,l)));else if(pt(a,n,l),s&&a.issues.length!==0&&E(a))break}if(c.length)return Promise.all(c).then(()=>n);return n},wr(e,Sr)});function Y(e,t,r,n,o,i){let c=r in n,s=i==="optional";if(!c&&s&&o==="optional")return;if(e.issues.length){if(o!==void 0&&s&&!c)return;t.issues.push(...I(r,e.issues))}if(!c&&o===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(c||o==="defaulted"&&!s)t.value[r]=void 0}else t.value[r]=e.value}var Zr=[];function Pr(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:Zr,o=n.length?[...t,...n]:t;for(let c of o)if(!e.shape?.[c]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(c)}": expected a Zod schema`);let i=Ue(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function Er(e,t,r,n,o,i,c){let s=[],l=o.keySet,u=o.catchall._zod,a=u.def.type,{optin:m,optout:f}=u,h=0;for(let d in t){if(c&&r.issues.length!==h){if(E(r,h))break;h=r.issues.length}if(l.has(d))continue;if(d==="__proto__"){if(a==="never")s.push(d);continue}if(a==="never"){s.push(d);continue}let _=u.run({value:t[d],issues:[]},n);if(_ instanceof Promise)e.push(_.then((S)=>Y(S,r,d,t,m,f)));else Y(_,r,d,t,m,f)}if(s.length)r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var wt=p("$ZodObject",(e,t)=>{v.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let u=()=>{let a={...n};return Object.defineProperty(t,"shape",{value:a}),u.raw=a,a};u.raw=n,Object.defineProperty(t,"shape",{get:u})}let o=ce(()=>Pr(t));x(e,"propValues",(u)=>{let a=u.def.shape,m={};for(let f in a){let h=a[f]._zod;if(h.values){if(!Object.prototype.hasOwnProperty.call(m,f))ae(m,f,new Set);for(let d of h.values)m[f].add(d);if(h.optin!==void 0)m[f].add(void 0)}}return m});let i=B,c=t.catchall,s,l=L.memoizer;l?.attach(e),e._zod.parse=(u,a)=>{s??(s=o.value);let m=u.value;if(!i(m))return u.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),u;u.value=l?l.alloc(e,u,{},a):{};let f=[],h=s.shape,d=a?.abortEarly,_=u.issues.length;for(let S of s.allKeys){if(d&&u.issues.length!==_){if(E(u,_))break;_=u.issues.length}if(S==="__proto__")continue;let P=h[S],F=P._zod.optin,Re=P._zod.optout,ie=P._zod.run({value:m[S],issues:[]},a);if(ie instanceof Promise)f.push(ie.then((cr)=>Y(cr,u,S,m,F,Re)));else Y(ie,u,S,m,F,Re)}if(!c)return f.length?Promise.all(f).then(()=>u):u;return Er(f,m,u,a,o.value,e,d===!0)}});function ft(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter((i)=>!E(i));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((c)=>k(c,n,A())))}),t}var ke=p("$ZodUnion",(e,t)=>{v.init(e,t),x(e,"optin",(n)=>n.def.options.some((o)=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some((o)=>o._zod.optin!==void 0)?"optional":void 0),x(e,"optout",(n)=>n.def.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),x(e,"values",(n)=>{if(n.def.options.every((o)=>o._zod.values))return new Set(n.def.options.flatMap((o)=>Array.from(o._zod.values)));return}),x(e,"pattern",(n)=>{if(n.def.options.every((o)=>o._zod.pattern)){let o=n.def.options.map((i)=>i._zod.pattern);return new RegExp(`^(${o.map((i)=>ue(i.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,c=[];for(let s of t.options){let l=s._zod.run({value:n.value,issues:[]},o);if(l instanceof Promise)c.push(l),i=!0;else{if(l.issues.length===0)return l;c.push(l)}}if(!i)return ft(c,n,e,o);return Promise.all(c).then((s)=>ft(s,n,e,o))}});function kr(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||n.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let o of n)if(t.has(o)){if(o!==void 0)throw Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null)}else t.set(o,r)}return t}var St=p("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ke.init(e,t);let r=e._zod.parse;x(e,"propValues",(o)=>{let i={},c=0;for(let s of o.def.options){let l=s._zod.propValues;if(!l||Object.keys(l).length===0)throw Error(`Invalid discriminated union option at index "${o.def.options.indexOf(s)}"`);if(l[o.def.discriminator]?.has(void 0))c++;for(let[u,a]of Object.entries(l)){if(!Object.prototype.hasOwnProperty.call(i,u))ae(i,u,new Set);for(let m of a)i[u].add(m)}}if(!o.def.unionFallback&&c>1)i[o.def.discriminator]?.delete(void 0);return i}),t.options.forEach((o,i)=>{let c=je(o._zod.def);if(c&&!Object.prototype.hasOwnProperty.call(c,t.discriminator))throw Error(`Invalid discriminated union option at index "${i}"`)});let n=ce(()=>kr(t));e._zod.parse=(o,i)=>{let c=o.value;if(!B(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let s=c?.[t.discriminator],l=n.value.get(s);if(l&&(s!==void 0||i.direction!=="backward"))return l._zod.run(o,i);if(t.unionFallback||i.direction==="backward")return r(o,i);return o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter((u)=>n.value.get(u)!==null),input:c,path:[t.discriminator],inst:e}),o}});var Zt=p("$ZodRecord",(e,t)=>{v.init(e,t);let r=L.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!pe(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let c=[],s=t.keyType._zod.values;if(s&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let l=new Set;for(let a of s)if(typeof a==="string"||typeof a==="number"||typeof a==="symbol"){if(l.add(typeof a==="number"?a.toString():a),a==="__proto__")continue;let m=t.keyType._zod.run({value:a,issues:[]},o);if(m instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(m.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map((d)=>k(d,o,A())),input:a,path:[a],inst:e});continue}let f=m.value;if(f==="__proto__")continue;let h=t.valueType._zod.run({value:i[a],issues:[]},o);if(h instanceof Promise)c.push(h.then((d)=>{if(d.issues.length)n.issues.push(...I(a,d.issues));n.value[f]=d.value}));else{if(h.issues.length)n.issues.push(...I(a,h.issues));n.value[f]=h.value}}let u;for(let a in i)if(!l.has(a))if(t.mode==="loose"){if(a==="__proto__")continue;n.value[a]=i[a]}else u=u??[],u.push(a);if(u&&u.length>0)n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:!0})}else{n.value=r?r.alloc(e,n,{},o):{};let l;for(let u of Reflect.ownKeys(i)){if(u==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(i,u))continue;let a=t.keyType._zod.run({value:u,issues:[]},o);if(a instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof u==="string"&&Se.test(u)&&a.issues.length){let d=t.keyType._zod.run({value:Number(u),issues:[]},o);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length===0)a=d}if(a.issues.length){if(t.mode==="loose")n.value[u]=i[u];else if(s)l=l??[],l.push(u);else n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map((d)=>k(d,o,A())),input:u,path:[u],inst:e});continue}let f=a.value;if(f==="__proto__")continue;let h=t.valueType._zod.run({value:i[u],issues:[]},o);if(h instanceof Promise)c.push(h.then((d)=>{if(d.issues.length)n.issues.push(...I(u,d.issues));n.value[f]=d.value}));else{if(h.issues.length)n.issues.push(...I(u,h.issues));n.value[f]=h.value}}if(l&&l.length>0)n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}if(c.length)return Promise.all(c).then(()=>n);return n}});var Pt=p("$ZodLiteral",(e,t)=>{v.init(e,t);let r=new Set(t.values);e._zod.values=r,x(e,"pattern",(n)=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map((i)=>typeof i==="string"?G(i):i?G(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;if(r.has(i))return n;return n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});function mt(e,t){return e.value=t.issues.length?void 0:t.value,e}var Et=p("$ZodOptional",(e,t)=>{v.init(e,t),x(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",x(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),x(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${ue(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>mt(r,i));return mt(r,o)}return t.innerType._zod.run(r,n)}});var kt=p("$ZodDefault",(e,t)=>{v.init(e,t),e._zod.optin="defaulted",x(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>dt(i,t));return dt(o,t)}});function dt(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var At=p("$ZodPipe",(e,t)=>{v.init(e,t),x(e,"values",(r)=>r.def.in._zod.values),x(e,"optin",(r)=>r.def.in._zod.optin),x(e,"optout",(r)=>r.def.out._zod.optout),x(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);if(i instanceof Promise)return i.then((c)=>X(c,t.in,n));return X(i,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>X(i,t.out,n));return X(o,t.out,n)}});function X(e,t,r){if(e.issues.some((n)=>n.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Ot=p("$ZodLazy",(e,t)=>{v.init(e,t),Le(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),x(e,"pattern",(r)=>r.innerType?._zod?.pattern),x(e,"propValues",(r)=>r.innerType?._zod?.propValues),x(e,"optin",(r)=>r.innerType?._zod?.optin??void 0),x(e,"optout",(r)=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),Ct=p("$ZodCustom",(e,t)=>{R.init(e,t),v.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=(r)=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then((i)=>ht(i,r,n,e));ht(o,r,n,e);return}});function ht(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(_e(o))}}function It(e){if(e.checks)e.checks=[...e.checks];return e}function Tt(e,t){return new e(It({type:"string",...g(t)}))}function Rt(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function Mt(e,t){return new e(It({type:"number",checks:[],...g(t)}))}function Dt(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function Nt(e,t){return new e({type:"boolean",...g(t)})}function Ft(e,t){return new e({type:"null",...g(t)})}function Lt(e){return new e({type:"unknown"})}function jt(e,t){return new e({type:"never",...g(t)})}function Q(e,t){return new st({check:"max_length",...g(t),maximum:e})}function ee(e,t){return new ct({check:"min_length",...g(t),minimum:e})}function Ut(e,t,r){let n=g(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Vt(e,t,r){return new e({type:"custom",check:"custom",fn:t,...g(r)})}var b=p("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");v.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){D(this,"with",e)},parse(e,t){return be(this,e,t,{callee:this.parse})},parseAsync(e,t){return $e(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return ye(this,e,t)},safeParseAsync(e,t){return we(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]},{parent:!0})},clone(e,t){return H(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}}),Wt=p("ZodMiniString",(e,t)=>{Ze.init(e,t),b.init(e,t)});function z(e){return Tt(Wt,e)}var qt=p("ZodMiniStringFormat",(e,t)=>{Pe.init(e,t),Wt.init(e,t)});var Gt=p("ZodMiniNumber",(e,t)=>{Ee.init(e,t),b.init(e,t)});function j(e){return Mt(Gt,e)}var Or=p("ZodMiniNumberFormat",(e,t)=>{xt.init(e,t),Gt.init(e,t)});function te(e){return Dt(Or,e)}var Cr=p("ZodMiniBoolean",(e,t)=>{zt.init(e,t),b.init(e,t)});function W(e){return Nt(Cr,e)}var Ir=p("ZodMiniNull",(e,t)=>{vt.init(e,t),b.init(e,t)});function Ht(e){return Ft(Ir,e)}var Tr=p("ZodMiniUnknown",(e,t)=>{bt.init(e,t),b.init(e,t)});function Jt(){return Lt(Tr)}var Rr=p("ZodMiniNever",(e,t)=>{$t.init(e,t),b.init(e,t)});function Mr(e){return jt(Rr,e)}var Dr=p("ZodMiniArray",(e,t)=>{yt.init(e,t),b.init(e,t)});function M(e,t){return new Dr({type:"array",element:e,...g(t)})}var Nr=p("ZodMiniObject",(e,t)=>{wt.init(e,t),b.init(e,t),We(e,"shape",(r)=>r._zod.def.shape,!1)});function y(e,t){return new Nr({type:"object",shape:e,catchall:Mr(),...g(t)})}var Fr=p("ZodMiniUnion",(e,t)=>{ke.init(e,t),b.init(e,t)});function U(e,t){return new Fr({type:"union",options:e,...g(t)})}var Lr=p("ZodMiniDiscriminatedUnion",(e,t)=>{St.init(e,t),b.init(e,t)});function Xt(e,t,r){return new Lr({type:"union",options:t,discriminator:e,...g(r)})}var Bt=p("ZodMiniRecord",(e,t)=>{Zt.init(e,t),b.init(e,t)});function q(e,t,r){if(!t||!t._zod)return new Bt({type:"record",keyType:z(),valueType:e,...g(t)});return new Bt({type:"record",keyType:e,valueType:t,...g(r)})}var jr=p("ZodMiniLiteral",(e,t)=>{Pt.init(e,t),b.init(e,t)});function O(e,t){return new jr({type:"literal",values:Array.isArray(e)?e:[e],...g(t)})}var Ur=p("ZodMiniOptional",(e,t)=>{Et.init(e,t),b.init(e,t)});function w(e){return new Ur({type:"optional",innerType:e})}var Vr=p("ZodMiniDefault",(e,t)=>{kt.init(e,t),b.init(e,t)});function Ae(e,t){return new Vr({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():fe(t)}})}var Br=p("ZodMiniPipe",(e,t)=>{At.init(e,t),b.init(e,t)});function Oe(e,t){return new Br({type:"pipe",in:e,out:t})}var Kr=p("ZodMiniLazy",(e,t)=>{Ot.init(e,t),b.init(e,t)});function Yt(e){return new Kr({type:"lazy",getter:e})}var Qt=p("ZodMiniCustom",(e,t)=>{Ct.init(e,t),b.init(e,t)});function er(e,t){return Ut(Qt,e??(()=>!0),t)}function Z(e,t={}){return Vt(Qt,e,t)}var Hr=p("ZodMiniISODateTime",(e,t)=>{gt.init(e,t),qt.init(e,t)});function tr(e){return Rt(Hr,e)}var re={text:z(),key:w(z()),description:w(z())},Jr=y({value:z(),label:z()}),Xr=Xt("type",[y({type:O("option"),value:z()}),y({type:O("text"),value:z()})]),Yr=y({type:O("text"),...re}),Qr=y({type:O("quantity"),...re,unit:w(z()),min:w(j()),max:w(j())}),en=y({type:O("scale"),...re,min:te(),max:te(),labels:w(q(z(),z()))}),tn=y({type:O("choice"),...re,options:M(Jr),multiple:Ae(W(),!1),allowOther:Ae(W(),!1)}),rn=y({value:M(Xr),question:tn}).check(Z((e)=>{if(!e.question.multiple&&e.value.length>1)return!1;let t=new Set(e.question.options.map((r)=>r.value));return e.value.every((r)=>r.type==="option"?t.has(r.value):e.question.allowOther)},{message:"Choice entries must respect offered options, multiple and Other."})),nn=y({value:j(),question:Qr}).check(Z((e)=>(e.question.min===void 0||e.value>=e.question.min)&&(e.question.max===void 0||e.value<=e.question.max)&&(e.question.min===void 0||e.question.max===void 0||e.question.min<=e.question.max),{message:"Quantity must be within coherent bounds."})),on=y({value:te(),question:en}).check(Z((e)=>e.question.min<=e.question.max&&e.value>=e.question.min&&e.value<=e.question.max&&Object.keys(e.question.labels??{}).every((t)=>Number.isSafeInteger(Number(t))&&String(Number(t))===t&&Number(t)>=e.question.min&&Number(t)<=e.question.max),{message:"Scale must use coherent integer scores and score labels."})),ne=U([y({value:z(),question:w(Yr)}),nn,on,rn]),lc=M(ne);function oe(e){if(e!==null&&typeof e==="object"){let t;try{t=Date.prototype.getTime.call(e)}catch{}if(t!==void 0){if(!Number.isFinite(t))throw RangeError("Invalid Date");return Date.prototype.toISOString.call(e)}}if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r+=1){if(!Object.hasOwn(e,r))throw TypeError("Sparse arrays are not supported");t.push(oe(e[r]))}return t}if(e!==null&&typeof e==="object"){let t=Object.getPrototypeOf(e),r=Reflect.ownKeys(e);if(r.includes("__proto__")||r.some((c)=>typeof c==="symbol"))throw TypeError('JSON objects cannot contain own "__proto__" or symbol keys.');let n,o;try{n=t===null||t===Object.prototype?void 0:Object.getOwnPropertyDescriptor(t,"constructor")?.value,o=typeof n==="function"?Object.getOwnPropertyDescriptor(n,"name")?.value:void 0}catch{throw TypeError("Expected a plain JSON object")}if(t!==null&&t!==Object.prototype&&!(Object.getPrototypeOf(t)===null&&typeof n==="function"&&o==="Object"))throw TypeError("Expected a plain JSON object");for(let c of r)if(!Object.getOwnPropertyDescriptor(e,c)?.enumerable)throw TypeError("Non-enumerable JSON properties are not supported");let i={};for(let c of r)if(typeof c==="string")Object.defineProperty(i,c,{value:oe(Reflect.get(e,c)),enumerable:!0,configurable:!0,writable:!0});return i}return e}var sn=j().check(Z(Number.isFinite,{message:"Expected a finite JSON number."})),or=Jt().check(Z((e)=>!(typeof e==="object"&&e!==null&&Reflect.ownKeys(e).some((t)=>t==="__proto__"||typeof t==="symbol")),{message:'JSON objects cannot contain own "__proto__" or symbol keys.'})),Ce=Yt(()=>U([z(),sn,W(),Ht(),M(Ce),Oe(or,q(z(),Ce))])),ir=Oe(or,q(z(),Ce));var Ie=ne,sr=z().check(ee(1),Q(255)).check(Z((e)=>e.trim().length>0,{message:"Correlation identifiers must be nonblank."})),Te=y({items:M(ne).check(ee(1)),properties:w(er((e)=>ir.safeParse(e).success)),formId:w(sr),messageId:w(sr),timestamp:w(U([tr({offset:!1}),tr({offset:!1,precision:-1})]).check(Z((e)=>!e.startsWith("0000-"),{message:"Timestamp must use a supported UTC date."})))}),cn=y({ok:O(!0)});function tf(e,t){let n={items:(typeof e==="string"?[{value:e}]:Array.isArray(e)?e:[e]).map((o)=>Ie.parse(o))};if(t?.properties!==void 0)n.properties=oe(t.properties);if(t?.formId!==void 0)n.formId=t.formId;if(t?.messageId!==void 0)n.messageId=t.messageId;if(t?.timestamp!==void 0){if(!(t.timestamp instanceof Date)||!Number.isFinite(t.timestamp.getTime()))throw Error("Feedback timestamp must be a valid Date.");n.timestamp=t.timestamp.toISOString()}return{kind:"feedback",response:Te.parse(n)}}export{tf as buildFeedbackCommand};
|
|
2
|
+
|
|
3
|
+
//# debugId=855377AFA152279E64756E2164756E21
|
|
4
|
+
//# sourceMappingURL=feedback-command.js.map
|