@walkeros/web-destination-api
Version:
Web API destination for walkerOS
1 lines • 130 kB
JavaScript
"use strict";function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function _assert_this_initialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function asyncGeneratorStep(e,t,r,n,a,i,o){try{var s=e[i](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,a)}function _async_to_generator(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function o(e){asyncGeneratorStep(i,n,a,o,s,"next",e)}function s(e){asyncGeneratorStep(i,n,a,o,s,"throw",e)}o(void 0)})}}function _call_super(e,t,r){return t=_get_prototype_of(t),_possible_constructor_return(e,_is_native_reflect_construct()?Reflect.construct(t,r||[],_get_prototype_of(e).constructor):t.apply(e,r))}function _class_call_check(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _construct(e,t,r){return _construct=_is_native_reflect_construct()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&_set_prototype_of(a,r.prototype),a},_construct.apply(null,arguments)}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _create_class(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _define_property(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _get_prototype_of(e){return _get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_get_prototype_of(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_set_prototype_of(e,t)}function _instanceof(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _is_native_function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);o=!0);}catch(e){s=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw a}}return i}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_define_property(e,t,r[t])})}return e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _object_spread_props(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function _object_without_properties(e,t){if(null==e)return{};var r,n,a=_object_without_properties_loose(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function _object_without_properties_loose(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}function _possible_constructor_return(e,t){return!t||"object"!==_type_of(t)&&"function"!=typeof t?_assert_this_initialized(e):t}function _set_prototype_of(e,t){return _set_prototype_of=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_set_prototype_of(e,t)}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _unsupported_iterable_to_array(e,t){if(e){if("string"==typeof e)return _array_like_to_array(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(e,t):void 0}}function _wrap_native_super(e){var t="function"==typeof Map?new Map:void 0;return _wrap_native_super=function(e){if(null===e||!_is_native_function(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _construct(e,arguments,_get_prototype_of(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_set_prototype_of(r,e)},_wrap_native_super(e)}function _is_native_reflect_construct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_is_native_reflect_construct=function(){return!!e})()}function _ts_generator(e,t){var r,n,a,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(a=2&s[0]?n.return:s[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;switch(n=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var Walkerjs=function(){var e=function(e){re=e},t=function(){return re},r=function(e,r){var n=t(),a=ne({issueData:r,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===te?void 0:te].filter(function(e){return!!e})});e.common.issues.push(a)},n=function(e){if(!e)return{};var t=e.errorMap,r=e.invalid_type_error,n=e.required_error,a=e.description;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:function(t,a){var i,o,s=e.message;return"invalid_enum_value"===t.code?{message:null!=s?s:a.defaultError}:void 0===a.data?{message:null!==(i=null!=s?s:n)&&void 0!==i?i:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(o=null!=s?s:r)&&void 0!==o?o:a.defaultError}},description:a}},a=function(e){var t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):null==e.precision&&(t="".concat(t,"(\\.\\d+)?"));var r=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(r)},i=function(e){return new RegExp("^".concat(a(e),"$"))},o=function(e){var t="".concat(Ne,"T").concat(a(e)),r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(r.join("|"),")"),new RegExp("^".concat(t,"$"))},s=function(e,t){return!("v4"!==t&&t||!Se.test(e))||!("v6"!==t&&t||!Oe.test(e))},u=function(e,t){if(!je.test(e))return!1;try{var r=_sliced_to_array(e.split("."),1)[0];if(!r)return!1;var n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return"object"===(void 0===a?"undefined":_type_of(a))&&null!==a&&((!("typ"in a)||"JWT"===(null==a?void 0:a.typ))&&(!!a.alg&&(!t||a.alg===t)))}catch(e){return!1}},c=function(e,t){return!("v4"!==t&&t||!Ze.test(e))||!("v6"!==t&&t||!Ae.test(e))},l=function(e,t){var r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)},d=function(e,t){return new ot(_object_spread({values:e,typeName:gt.ZodEnum},n(t)))},_=function(e,t){var r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return e?$e.create().superRefine(function(n,a){var i=e(n);if(_instanceof(i,Promise))return i.then(function(e){if(!e){var i,o,s=_(t,n),u=null===(o=null!==(i=s.fatal)&&void 0!==i?i:r)||void 0===o||o;a.addIssue(_object_spread_props(_object_spread({code:"custom"},s),{fatal:u}))}});if(!i){var o,s,u=_(t,n),c=null===(s=null!==(o=u.fatal)&&void 0!==o?o:r)||void 0===s||s;a.addIssue(_object_spread_props(_object_spread({code:"custom"},u),{fatal:c}))}}):$e.create()},p=function(e,t,r,n){(null==n?void 0:n.errorMessages)&&r&&(e.errorMessage=_object_spread_props(_object_spread({},e.errorMessage),_define_property({},t,r)))},h=function(e,t,r,n,a){e[t]=r,p(e,t,n,a)},y=function(e){if("openAi"!==e.target)return{};var t=_to_consumable_array(e.basePath).concat([e.definitionPath,e.openAiAnyTypeName]);return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===e.$refStrategy?dr(t,e.currentPath):t.join("/")}},v=function(e,t){return kr(e.type._def,t)},m=function(e,t){var r={type:"string"};if(e.checks){var n=!0,a=!1,i=void 0;try{for(var o,s=e.checks[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;switch(u.kind){case"min":h(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,u.value):u.value,u.message,t);break;case"max":h(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,u.value):u.value,u.message,t);break;case"email":switch(t.emailStrategy){case"format:email":k(r,"email",u.message,t);break;case"format:idn-email":k(r,"idn-email",u.message,t);break;case"pattern:zod":j(r,yr.email,u.message,t)}break;case"url":k(r,"uri",u.message,t);break;case"uuid":k(r,"uuid",u.message,t);break;case"regex":j(r,u.regex,u.message,t);break;case"cuid":j(r,yr.cuid,u.message,t);break;case"cuid2":j(r,yr.cuid2,u.message,t);break;case"startsWith":j(r,RegExp("^".concat(g(u.value,t))),u.message,t);break;case"endsWith":j(r,RegExp("".concat(g(u.value,t),"$")),u.message,t);break;case"datetime":k(r,"date-time",u.message,t);break;case"date":k(r,"date",u.message,t);break;case"time":k(r,"time",u.message,t);break;case"duration":k(r,"duration",u.message,t);break;case"length":h(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,u.value):u.value,u.message,t),h(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,u.value):u.value,u.message,t);break;case"includes":j(r,RegExp(g(u.value,t)),u.message,t);break;case"ip":"v6"!==u.version&&k(r,"ipv4",u.message,t),"v4"!==u.version&&k(r,"ipv6",u.message,t);break;case"base64url":j(r,yr.base64url,u.message,t);break;case"jwt":j(r,yr.jwt,u.message,t);break;case"cidr":"v6"!==u.version&&j(r,yr.ipv4Cidr,u.message,t),"v4"!==u.version&&j(r,yr.ipv6Cidr,u.message,t);break;case"emoji":j(r,yr.emoji(),u.message,t);break;case"ulid":j(r,yr.ulid,u.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":k(r,"binary",u.message,t);break;case"contentEncoding:base64":h(r,"contentEncoding","base64",u.message,t);break;case"pattern:zod":j(r,yr.base64,u.message,t)}break;case"nanoid":j(r,yr.nanoid,u.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:(function(){})()}}}catch(e){a=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}}return r},g=function(e,t){return"escape"===t.patternStrategy?b(e):e},b=function(e){for(var t="",r=0;r<e.length;r++)vr.has(e[r])||(t+="\\"),t+=e[r];return t},k=function(e,t,r,n){var a;e.format||(null===(a=e.anyOf)||void 0===a?void 0:a.some(function(e){return e.format}))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push(_object_spread({format:e.format},e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}})),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push(_object_spread({format:t},r&&n.errorMessages&&{errorMessage:{format:r}}))):h(e,"format",t,r,n)},j=function(e,t,r,n){var a;e.pattern||(null===(a=e.allOf)||void 0===a?void 0:a.some(function(e){return e.pattern}))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push(_object_spread({pattern:e.pattern},e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}})),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push(_object_spread({pattern:x(t,n)},r&&n.errorMessages&&{errorMessage:{pattern:r}}))):h(e,"pattern",x(t,n),r,n)},x=function(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;for(var r=e.flags.includes("i"),n=e.flags.includes("m"),a=e.flags.includes("s"),i=r?e.source.toLowerCase():e.source,o="",s=!1,u=!1,c=!1,l=0;l<i.length;l++)if(s)o+=i[l],s=!1;else{if(r)if(u){if(i[l].match(/[a-z]/)){var d;c?(o+=i[l],o+="".concat(i[l-2],"-").concat(i[l]).toUpperCase(),c=!1):"-"===i[l+1]&&(null===(d=i[l+2])||void 0===d?void 0:d.match(/[a-z]/))?(o+=i[l],c=!0):o+="".concat(i[l]).concat(i[l].toUpperCase());continue}}else if(i[l].match(/[a-z]/)){o+="[".concat(i[l]).concat(i[l].toUpperCase(),"]");continue}if(n){if("^"===i[l]){o+="(^|(?<=[\r\n]))";continue}if("$"===i[l]){o+="($|(?=[\r\n]))";continue}}a&&"."===i[l]?o+=u?"".concat(i[l],"\r\n"):"[".concat(i[l],"\r\n]"):(o+=i[l],"\\"===i[l]?s=!0:u&&"]"===i[l]?u=!1:u||"["!==i[l]||(u=!0))}try{new RegExp(o)}catch(r){return console.warn("Could not convert regex pattern at ".concat(t.currentPath.join("/")," to a flag-independent form! Falling back to the flag-ignorant source")),e.source}return o},w=function(e,t){var r,n,a,i,o,s,u;if("openAi"===t.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===t.target&&(null===(r=e.keyType)||void 0===r?void 0:r._def.typeName)===gt.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce(function(r,n){var a;return _object_spread_props(_object_spread({},r),_define_property({},n,null!==(a=kr(e.valueType._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["properties",n])})))&&void 0!==a?a:y(t)))},{}),additionalProperties:t.rejectedAdditionalProperties};var c={type:"object",additionalProperties:null!==(u=kr(e.valueType._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["additionalProperties"])})))&&void 0!==u?u:t.allowedAdditionalProperties};if("openApi3"===t.target)return c;if((null===(n=e.keyType)||void 0===n?void 0:n._def.typeName)===gt.ZodString&&(null===(a=e.keyType._def.checks)||void 0===a?void 0:a.length)){var l=m(e.keyType._def,t),d=(l.type,_object_without_properties(l,["type"]));return _object_spread_props(_object_spread({},c),{propertyNames:d})}if((null===(i=e.keyType)||void 0===i?void 0:i._def.typeName)===gt.ZodEnum)return _object_spread_props(_object_spread({},c),{propertyNames:{enum:e.keyType._def.values}});if((null===(o=e.keyType)||void 0===o?void 0:o._def.typeName)===gt.ZodBranded&&e.keyType._def.type._def.typeName===gt.ZodString&&(null===(s=e.keyType._def.type._def.checks)||void 0===s?void 0:s.length)){var _=v(e.keyType._def,t),f=(_.type,_object_without_properties(_,["type"]));return _object_spread_props(_object_spread({},c),{propertyNames:f})}return c},S=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return kr(e.catchall._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["additionalProperties"])}));switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}},Z=function(e){try{return e.isOptional()}catch(e){return!0}},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r=_object_spread({},Ir,r);var n=Object.entries(t).reduce(function(t,n){var a=_sliced_to_array(n,2),i=a[0],o=a[1],s=e[i];return r.merge&&Array.isArray(s)&&Array.isArray(o)?t[i]=o.reduce(function(e,t){return e.includes(t)?e:_to_consumable_array(e).concat([t])},_to_consumable_array(s)):(r.extend||i in e)&&(t[i]=o),t},{});return r.shallow?_object_spread({},e,n):(Object.assign(e,n),e)},A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"entity action",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.timestamp||(new Date).setHours(0,13,37,0),n={data:{id:"ers",name:"Everyday Ruck Snack",color:"black",size:"l",price:420}},a={data:{id:"cc",name:"Cool Cap",size:"one size",price:42}};return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.timestamp||(new Date).setHours(0,13,37,0),r=e.group||"gr0up",n=e.count||1,a=O({name:"entity action",data:{string:"foo",number:1,boolean:!0,array:[0,"text",!1],not:void 0},context:{dev:["test",1]},globals:{lang:"elb"},custom:{completely:"random"},user:{id:"us3r",device:"c00k13",session:"s3ss10n"},nested:[{entity:"child",data:{is:"subordinated"},nested:[],context:{element:["child",0]}}],consent:{functional:!0},id:"".concat(t,"-").concat(r,"-").concat(n),trigger:"test",entity:"entity",action:"action",timestamp:t,timing:3.14,group:r,count:n,version:{source:"0.2.1",tagging:1},source:{type:"web",id:"https://localhost:80",previous_id:"http://remotehost:9001"}},e,{merge:!1});if(e.name){var i,o=_sliced_to_array(null!==(i=e.name.split(" "))&&void 0!==i?i:[],2),s=o[0],u=o[1];s&&u&&(a.entity=s,a.action=u)}return a}(_object_spread_props(_object_spread({},{"cart view":{data:{currency:"EUR",value:2*n.data.price},context:{shopping:["cart",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",data:_object_spread_props(_object_spread({},n.data),{quantity:2}),context:{shopping:["cart",0]},nested:[]}],trigger:"load"},"checkout view":{data:{step:"payment",currency:"EUR",value:n.data.price+a.data.price},context:{shopping:["checkout",0]},globals:{pagegroup:"shop"},nested:[_object_spread_props(_object_spread({entity:"product"},n),{context:{shopping:["checkout",0]},nested:[]}),_object_spread_props(_object_spread({entity:"product"},a),{context:{shopping:["checkout",0]},nested:[]})],trigger:"load"},"order complete":{data:{id:"0rd3r1d",currency:"EUR",shipping:5.22,taxes:73.76,total:555},context:{shopping:["complete",0]},globals:{pagegroup:"shop"},nested:[_object_spread_props(_object_spread({entity:"product"},n),{context:{shopping:["complete",0]},nested:[]}),_object_spread_props(_object_spread({entity:"product"},a),{context:{shopping:["complete",0]},nested:[]}),{entity:"gift",data:{name:"Surprise"},context:{shopping:["complete",0]},nested:[]}],trigger:"load"},"page view":{data:{domain:"www.example.com",title:"walkerOS documentation",referrer:"https://www.elbwalker.com/",search:"?foo=bar",hash:"#hash",id:"/docs/"},globals:{pagegroup:"docs"},trigger:"load"},"product add":_object_spread_props(_object_spread({},n),{context:{shopping:["intent",0]},globals:{pagegroup:"shop"},nested:[],trigger:"click"}),"product view":_object_spread_props(_object_spread({},n),{context:{shopping:["detail",0]},globals:{pagegroup:"shop"},nested:[],trigger:"load"}),"product visible":{data:_object_spread_props(_object_spread({},n.data),{position:3,promo:!0}),context:{shopping:["discover",0]},globals:{pagegroup:"shop"},nested:[],trigger:"load"},"promotion visible":{data:{name:"Setting up tracking easily",position:"hero"},context:{ab_test:["engagement",0]},globals:{pagegroup:"homepage"},trigger:"visible"},"session start":{data:{id:"s3ss10n",start:r,isNew:!0,count:1,runs:1,isStart:!0,storage:!0,referrer:"",device:"c00k13"},user:{id:"us3r",device:"c00k13",session:"s3ss10n",hash:"h4sh",address:"street number",email:"user@example.com",phone:"+49 123 456 789",userAgent:"Mozilla...",browser:"Chrome",browserVersion:"90",deviceType:"desktop",language:"de-DE",country:"DE",region:"HH",city:"Hamburg",zip:"20354",timezone:"Berlin",os:"walkerOS",osVersion:"1.0",screenSize:"1337x420",ip:"127.0.0.0",internal:!0,custom:"value"}}}[e],t),{name:e}))},P=function(e,t,r){return function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];try{return e.apply(void 0,_to_consumable_array(a))}catch(e){if(!t)return;return t(e)}finally{null==r||r()}}},T=function(e,t,r){return function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return _async_to_generator(function(){var n;return _ts_generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,4,6]),[4,e.apply(void 0,_to_consumable_array(a))];case 1:case 3:return[2,i.sent()];case 2:return n=i.sent(),t?[4,t(n)]:[2];case 4:return[4,null==r?void 0:r()];case 5:return i.sent(),[7];case 6:return[2]}})})()}},N=function(e){return void 0===e||function(e,t){return(void 0===e?"undefined":_type_of(e))==(void 0===t?"undefined":_type_of(t))}(e,"")?e:JSON.stringify(e)},C=function(){return O({"Content-Type":"application/json; charset=utf-8"},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},E=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{transport:"fetch"};switch(r.transport||"fetch"){case"beacon":return M(e,t);case"xhr":return R(e,t,r);default:return I(e,t,r)}},I=function(e,t){return _async_to_generator(function(e,t){var r,n,a,i=arguments;return _ts_generator(this,function(o){return n=C((r=i.length>2&&void 0!==i[2]?i[2]:{}).headers),a=N(t),[2,T(function(){return _async_to_generator(function(){var t,i,o;return _ts_generator(this,function(s){switch(s.label){case 0:return[4,fetch(e,{method:r.method||"POST",headers:n,keepalive:!0,credentials:r.credentials||"same-origin",mode:r.noCors?"no-cors":"cors",body:a})];case 1:return t=s.sent(),r.noCors?(o="",[3,4]):[3,2];case 2:return[4,t.text()];case 3:o=s.sent(),s.label=4;case 4:return i=o,[2,{ok:t.ok,data:i,error:t.ok?void 0:t.statusText}]}})})()},function(e){return{ok:!1,error:e.message}})()]})}).apply(this,arguments)},M=function(e,t){var r=N(t),n=navigator.sendBeacon(e,r);return{ok:n,error:n?void 0:"Failed to send beacon"}},R=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=C(r.headers),a=r.method||"POST",i=N(t);return P(function(){var t=new XMLHttpRequest;for(var r in t.open(a,e,!1),n)t.setRequestHeader(r,n[r]);t.send(i);var o=t.status>=200&&t.status<300;return{ok:o,data:P(JSON.parse,function(){return t.response})(t.response),error:o?void 0:"".concat(t.status," ").concat(t.statusText)}},function(e){return{ok:!1,error:e.message}})()},F=function(){var e=A("entity action");return JSON.stringify(e.data)},z=Object.defineProperty,L=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,$=Object.prototype.hasOwnProperty,V=function(e,t){for(var r in t)z(e,r,{get:t[r],enumerable:!0})},U={};V(U,{DestinationAPI:function(){return Mr},default:function(){return Wr},destinationAPI:function(){return Kr},examples:function(){return Rr}});var B,K,W,q={};V(q,{BRAND:function(){return ht},DIRTY:function(){return se},EMPTY_PATH:function(){return ae},INVALID:function(){return oe},NEVER:function(){return sr},OK:function(){return ue},ParseStatus:function(){return ie},Schema:function(){return ye},ZodAny:function(){return $e},ZodArray:function(){return Ke},ZodBigInt:function(){return Me},ZodBoolean:function(){return Re},ZodBranded:function(){return yt},ZodCatch:function(){return ft},ZodDate:function(){return Fe},ZodDefault:function(){return _t},ZodDiscriminatedUnion:function(){return Ge},ZodEffects:function(){return ct},ZodEnum:function(){return ot},ZodError:function(){return X},ZodFirstPartyTypeKind:function(){return gt},ZodFunction:function(){return nt},ZodIntersection:function(){return Xe},ZodIssueCode:function(){return G},ZodLazy:function(){return at},ZodLiteral:function(){return it},ZodMap:function(){return tt},ZodNaN:function(){return pt},ZodNativeEnum:function(){return st},ZodNever:function(){return Ue},ZodNull:function(){return De},ZodNullable:function(){return dt},ZodNumber:function(){return Ie},ZodObject:function(){return qe},ZodOptional:function(){return lt},ZodParsedType:function(){return J},ZodPipeline:function(){return vt},ZodPromise:function(){return ut},ZodReadonly:function(){return mt},ZodRecord:function(){return et},ZodSchema:function(){return ye},ZodSet:function(){return rt},ZodString:function(){return Ee},ZodSymbol:function(){return ze},ZodTransformer:function(){return ct},ZodTuple:function(){return Qe},ZodType:function(){return ye},ZodUndefined:function(){return Le},ZodUnion:function(){return Je},ZodUnknown:function(){return Ve},ZodVoid:function(){return Be},addIssueToContext:function(){return r},any:function(){return Ct},array:function(){return Rt},bigint:function(){return Zt},boolean:function(){return Ot},coerce:function(){return or},custom:function(){return f},date:function(){return At},datetimeRegex:function(){return o},defaultErrorMap:function(){return te},discriminatedUnion:function(){return Dt},effect:function(){return Xt},enum:function(){return Ht},function:function(){return Wt},getErrorMap:function(){return t},getParsedType:function(){return H},instanceof:function(){return jt},intersection:function(){return $t},isAborted:function(){return ce},isAsync:function(){return _e},isDirty:function(){return le},isValid:function(){return de},late:function(){return kt},lazy:function(){return qt},literal:function(){return Jt},makeIssue:function(){return ne},map:function(){return Bt},nan:function(){return St},nativeEnum:function(){return Gt},never:function(){return It},null:function(){return Nt},nullable:function(){return er},number:function(){return wt},object:function(){return Ft},objectUtil:function(){return W},oboolean:function(){return ir},onumber:function(){return ar},optional:function(){return Qt},ostring:function(){return nr},pipeline:function(){return rr},preprocess:function(){return tr},promise:function(){return Yt},quotelessJson:function(){return Y},record:function(){return Ut},set:function(){return Kt},setErrorMap:function(){return e},strictObject:function(){return zt},string:function(){return xt},symbol:function(){return Pt},transformer:function(){return Xt},tuple:function(){return Vt},undefined:function(){return Tt},union:function(){return Lt},unknown:function(){return Et},util:function(){return B},void:function(){return Mt}}),(K=B||(B={})).assertEqual=function(e){},K.assertIs=function(e){},K.assertNever=function(e){throw new Error},K.arrayToEnum=function(e){var t={},r=!0,n=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done);r=!0){var s=i.value;t[s]=s}}catch(e){n=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw a}}return t},K.getValidEnumValues=function(e){var t=K.objectKeys(e).filter(function(t){return"number"!=typeof e[e[t]]}),r={},n=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;r[u]=e[u]}}catch(e){a=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return K.objectValues(r)},K.objectValues=function(e){return K.objectKeys(e).map(function(t){return e[t]})},K.objectKeys="function"==typeof Object.keys?function(e){return Object.keys(e)}:function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},K.find=function(e,t){var r=!0,n=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done);r=!0){var s=i.value;if(t(s))return s}}catch(e){n=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw a}}},K.isInteger="function"==typeof Number.isInteger?function(e){return Number.isInteger(e)}:function(e){return"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e},K.joinValues=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" | ";return e.map(function(e){return"string"==typeof e?"'".concat(e,"'"):e}).join(t)},K.jsonStringifyReplacer=function(e,t){return"bigint"===(void 0===t?"undefined":_type_of(t))?t.toString():t},(W||(W={})).mergeShapes=function(e,t){return _object_spread({},e,t)};var J=B.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),H=function(e){switch(void 0===e?"undefined":_type_of(e)){case"undefined":return J.undefined;case"string":return J.string;case"number":return Number.isNaN(e)?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":return Array.isArray(e)?J.array:null===e?J.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?J.promise:"undefined"!=typeof Map&&_instanceof(e,Map)?J.map:"undefined"!=typeof Set&&_instanceof(e,Set)?J.set:"undefined"!=typeof Date&&_instanceof(e,Date)?J.date:J.object;default:return J.unknown}},G=B.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"]),Y=function(e){return JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:")},X=function(e){function t(e){var r;_class_call_check(this,t),(r=_call_super(this,t)).issues=[],r.addIssue=function(e){r.issues=_to_consumable_array(r.issues).concat([e])},r.addIssues=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];r.issues=_to_consumable_array(r.issues).concat(_to_consumable_array(e))};var n=(_instanceof(this,t)?this.constructor:void 0).prototype;return Object.setPrototypeOf?Object.setPrototypeOf(r,n):r.__proto__=n,r.name="ZodError",r.issues=e,r}return _inherits(t,e),_create_class(t,[{key:"errors",get:function(){return this.issues}},{key:"format",value:function(e){var t=e||function(e){return e.message},r={_errors:[]},n=function(e){var a=!0,i=!1,o=void 0;try{for(var s,u=e.issues[Symbol.iterator]();!(a=(s=u.next()).done);a=!0){var c=s.value;if("invalid_union"===c.code)c.unionErrors.map(n);else if("invalid_return_type"===c.code)n(c.returnTypeError);else if("invalid_arguments"===c.code)n(c.argumentsError);else if(0===c.path.length)r._errors.push(t(c));else for(var l=r,d=0;d<c.path.length;){var _=c.path[d];d===c.path.length-1?(l[_]=l[_]||{_errors:[]},l[_]._errors.push(t(c))):l[_]=l[_]||{_errors:[]},l=l[_],d++}}}catch(e){i=!0,o=e}finally{try{a||null==u.return||u.return()}finally{if(i)throw o}}};return n(this),r}},{key:"toString",value:function(){return this.message}},{key:"message",get:function(){return JSON.stringify(this.issues,B.jsonStringifyReplacer,2)}},{key:"isEmpty",get:function(){return 0===this.issues.length}},{key:"flatten",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e.message},t={},r=[],n=!0,a=!1,i=void 0;try{for(var o,s=this.issues[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;if(u.path.length>0){var c=u.path[0];t[c]=t[c]||[],t[c].push(e(u))}else r.push(e(u))}}catch(e){a=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return{formErrors:r,fieldErrors:t}}},{key:"formErrors",get:function(){return this.flatten()}}],[{key:"assert",value:function(e){if(!_instanceof(e,t))throw new Error("Not a ZodError: ".concat(e))}}]),t}(_wrap_native_super(Error));X.create=function(e){return new X(e)};var Q,ee,te=function(e,t){var r;switch(e.code){case G.invalid_type:r=e.received===J.undefined?"Required":"Expected ".concat(e.expected,", received ").concat(e.received);break;case G.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,B.jsonStringifyReplacer));break;case G.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(B.joinValues(e.keys,", "));break;case G.invalid_union:r="Invalid input";break;case G.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(B.joinValues(e.options));break;case G.invalid_enum_value:r="Invalid enum value. Expected ".concat(B.joinValues(e.options),", received '").concat(e.received,"'");break;case G.invalid_arguments:r="Invalid function arguments";break;case G.invalid_return_type:r="Invalid function return type";break;case G.invalid_date:r="Invalid date";break;case G.invalid_string:"object"===_type_of(e.validation)?"includes"in e.validation?(r='Invalid input: must include "'.concat(e.validation.includes,'"'),"number"==typeof e.validation.position&&(r="".concat(r," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?r='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?r='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):B.assertNever(e.validation):r="regex"!==e.validation?"Invalid ".concat(e.validation):"Invalid";break;case G.too_small:r="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):"number"===e.type||"bigint"===e.type?"Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):"date"===e.type?"Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):"Invalid input";break;case G.too_big:r="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):"number"===e.type?"Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"bigint"===e.type?"BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"date"===e.type?"Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):"Invalid input";break;case G.custom:r="Invalid input";break;case G.invalid_intersection_types:r="Intersection results could not be merged";break;case G.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case G.not_finite:r="Number must be finite";break;default:r=t.defaultError,B.assertNever(e)}return{message:r}},re=te,ne=function(e){var t=e.data,r=e.path,n=e.errorMaps,a=e.issueData,i=_to_consumable_array(r).concat(_to_consumable_array(a.path||[])),o=_object_spread_props(_object_spread({},a),{path:i});if(void 0!==a.message)return _object_spread_props(_object_spread({},a),{path:i,message:a.message});var s="",u=n.filter(function(e){return!!e}).slice().reverse(),c=!0,l=!1,d=void 0;try{for(var _,f=u[Symbol.iterator]();!(c=(_=f.next()).done);c=!0){s=(0,_.value)(o,{data:t,defaultError:s}).message}}catch(e){l=!0,d=e}finally{try{c||null==f.return||f.return()}finally{if(l)throw d}}return _object_spread_props(_object_spread({},a),{path:i,message:s})},ae=[],ie=function(){function e(){_class_call_check(this,e),this.value="valid"}return _create_class(e,[{key:"dirty",value:function(){"valid"===this.value&&(this.value="dirty")}},{key:"abort",value:function(){"aborted"!==this.value&&(this.value="aborted")}}],[{key:"mergeArray",value:function(e,t){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;if("aborted"===u.status)return oe;"dirty"===u.status&&e.dirty(),r.push(u.value)}}catch(e){a=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return{status:e.value,value:r}}},{key:"mergeObjectAsync",value:function(t,r){return _async_to_generator(function(){var n,a,i,o,s,u,c,l,d,_;return _ts_generator(this,function(f){switch(f.label){case 0:n=[],a=!0,i=!1,o=void 0,f.label=1;case 1:f.trys.push([1,7,8,9]),s=r[Symbol.iterator](),f.label=2;case 2:return(a=(u=s.next()).done)?[3,6]:[4,(c=u.value).key];case 3:return l=f.sent(),[4,c.value];case 4:d=f.sent(),n.push({key:l,value:d}),f.label=5;case 5:return a=!0,[3,2];case 6:return[3,9];case 7:return _=f.sent(),i=!0,o=_,[3,9];case 8:try{a||null==s.return||s.return()}finally{if(i)throw o}return[7];case 9:return[2,e.mergeObjectSync(t,n)]}})})()}},{key:"mergeObjectSync",value:function(e,t){var r={},n=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value,c=u.key,l=u.value;if("aborted"===c.status)return oe;if("aborted"===l.status)return oe;"dirty"===c.status&&e.dirty(),"dirty"===l.status&&e.dirty(),"__proto__"===c.value||void 0===l.value&&!u.alwaysSet||(r[c.value]=l.value)}}catch(e){a=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return{status:e.value,value:r}}}]),e}(),oe=Object.freeze({status:"aborted"}),se=function(e){return{status:"dirty",value:e}},ue=function(e){return{status:"valid",value:e}},ce=function(e){return"aborted"===e.status},le=function(e){return"dirty"===e.status},de=function(e){return"valid"===e.status},_e=function(e){return"undefined"!=typeof Promise&&_instanceof(e,Promise)};(ee=Q||(Q={})).errToObj=function(e){return"string"==typeof e?{message:e}:e||{}},ee.toString=function(e){return"string"==typeof e?e:null==e?void 0:e.message};var fe,pe=function(){function e(t,r,n,a){_class_call_check(this,e),this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}return _create_class(e,[{key:"path",get:function(){var e,t;this._cachedPath.length||(Array.isArray(this._key)?(e=this._cachedPath).push.apply(e,_to_consumable_array(this._path).concat(_to_consumable_array(this._key))):(t=this._cachedPath).push.apply(t,_to_consumable_array(this._path).concat([this._key])));return this._cachedPath}}]),e}(),he=function(e,t){if(de(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;var t=new X(e.common.issues);return this._error=t,this._error}}},ye=function(){function e(t){var r=this;_class_call_check(this,e),this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:function(e){return r["~validate"](e)}}}return _create_class(e,[{key:"description",get:function(){return this._def.description}},{key:"_getType",value:function(e){return H(e.data)}},{key:"_getOrReturnCtx",value:function(e,t){return t||{common:e.parent.common,data:e.data,parsedType:H(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}},{key:"_processInputParams",value:function(e){return{status:new ie,ctx:{common:e.parent.common,data:e.data,parsedType:H(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}},{key:"_parseSync",value:function(e){var t=this._parse(e);if(_e(t))throw new Error("Synchronous parse encountered promise.");return t}},{key:"_parseAsync",value:function(e){var t=this._parse(e);return Promise.resolve(t)}},{key:"parse",value:function(e,t){var r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}},{key:"safeParse",value:function(e,t){var r,n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:H(e)},a=this._parseSync({data:e,path:n.path,parent:n});return he(n,a)}},{key:"~validate",value:function(e){var t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:H(e)};if(!this["~standard"].async)try{var r=this._parseSync({data:e,path:[],parent:t});return de(r)?{value:r.value}:{issues:t.common.issues}}catch(e){var n,a;(null==e||null===(a=e.message)||void 0===a||null===(n=a.toLowerCase())||void 0===n?void 0:n.includes("encountered"))&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(function(e){return de(e)?{value:e.value}:{issues:t.common.issues}})}},{key:"parseAsync",value:function(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(n){switch(n.label){case 0:return[4,this.safeParseAsync(e,t)];case 1:if((r=n.sent()).success)return[2,r.data];throw r.error}})}).call(this)}},{key:"safeParseAsync",value:function(e,t){return _async_to_generator(function(){var r,n,a;return _ts_generator(this,function(i){switch(i.label){case 0:return r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:H(e)},n=this._parse({data:e,path:r.path,parent:r}),[4,_e(n)?n:Promise.resolve(n)];case 1:return a=i.sent(),[2,he(r,a)]}})}).call(this)}},{key:"refine",value:function(e,t){return this._refinement(function(r,n){var a=e(r),i=function(){return n.addIssue(_object_spread({code:G.custom},function(e){return"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t}(r)))};return"undefined"!=typeof Promise&&_instanceof(a,Promise)?a.then(function(e){return!!e||(i(),!1)}):!!a||(i(),!1)})}},{key:"refinement",value:function(e,t){return this._refinement(function(r,n){return!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)})}},{key:"_refinement",value:function(e){return new ct({schema:this,typeName:gt.ZodEffects,effect:{type:"refinement",refinement:e}})}},{key:"superRefine",value:function(e){return this._refinement(e)}},{key:"optional",value:function(){return lt.create(this,this._def)}},{key:"nullable",value:function(){return dt.create(this,this._def)}},{key:"nullish",value:function(){return this.nullable().optional()}},{key:"array",value:function(){return Ke.create(this)}},{key:"promise",value:function(){return ut.create(this,this._def)}},{key:"or",value:function(e){return Je.create([this,e],this._def)}},{key:"and",value:function(e){return Xe.create(this,e,this._def)}},{key:"transform",value:function(e){return new ct(_object_spread_props(_object_spread({},n(this._def)),{schema:this,typeName:gt.ZodEffects,effect:{type:"transform",transform:e}}))}},{key:"default",value:function(e){var t="function"==typeof e?e:function(){return e};return new _t(_object_spread_props(_object_spread({},n(this._def)),{innerType:this,defaultValue:t,typeName:gt.ZodDefault}))}},{key:"brand",value:function(){return new yt(_object_spread({typeName:gt.ZodBranded,type:this},n(this._def)))}},{key:"catch",value:function(e){var t="function"==typeof e?e:function(){return e};return new ft(_object_spread_props(_object_spread({},n(this._def)),{innerType:this,catchValue:t,typeName:gt.ZodCatch}))}},{key:"describe",value:function(e){return new(0,this.constructor)(_object_spread_props(_object_spread({},this._def),{description:e}))}},{key:"pipe",value:function(e){return vt.create(this,e)}},{key:"readonly",value:function(){return mt.create(this)}},{key:"isOptional",value:function(){return this.safeParse(void 0).success}},{key:"isNullable",value:function(){return this.safeParse(null).success}}]),e}(),ve=/^c[^\s-]{8,}$/i,me=/^[0-9a-z]+$/,ge=/^[0-9A-HJKMNP-TV-Z]{26}$/i,be=/^[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,ke=/^[a-z0-9_-]{21}$/i,je=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,xe=/^[-+]?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)?)??$/,we=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Se=/^(?:(?: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])$/,Ze=/^(?:(?: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])$/,Oe=/^(([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]))$/,Ae=/^(([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])$/,Pe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Te=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ne="((\\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])))",Ce=new RegExp("^".concat(Ne,"$")),Ee=function(e){function t(){return _class_call_check(this,t),_call_super(this,t,arguments)}return _inherits(t,e),_create_class(t,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==J.string){var t=this._getOrReturnCtx(e);return r(t,{code:G.invalid_type,expected:J.string,received:t.parsedType}),oe}var n=new ie,a=void 0,l=!0,d=!1,_=void 0;try{for(var f,p=this._def.checks[Symbol.iterator]();!(l=(f=p.next()).done);l=!0){var h=f.value;if("min"===h.kind)e.data.length<h.value&&(a=this._getOrReturnCtx(e,a),r(a,{code:G.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),n.dirty());else if("max"===h.kind)e.data.length>h.value&&(a=this._getOrReturnCtx(e,a),r(a,{code:G.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),n.dirty());else if("length"===h.kind){var y=e.data.length>h.value,v=e.data.length<h.value;(y||v)&&(a=this._getOrReturnCtx(e,a),y?r(a,{code:G.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):v&&r(a,{code:G.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),n.dirty())}else if("email"===h.kind)we.test(e.data)||(a=this._getOrReturnCtx(e,a),r(a,{validation:"email",code:G.invalid_string,message:h.message}),n.dirty());else if("emoji"===h.kind)fe||(fe=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),fe.test(e.data)||(a=this._getOrReturnCtx(e,a),r(a,{validation:"emoji",code:G.invalid_string,message:h.message}),n.dirty());else if("uuid"===h.kind)be.test(e.data)||(a=this._getOrReturnCtx(e,a),r(a,{validation:"uuid",code:G.