forked from bombastictranz/public-docs
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
be5c4d306768b843f013.js.download
8 lines (8 loc) · 256 KB
/
be5c4d306768b843f013.js.download
1
2
3
4
5
6
7
8
(()=>{var e,t,r={554:(e,t)=>{for(var r,n=256,s=[];n--;)s[n]=(n+256).toString(16).substring(1);t.v4=function(){var e,t=0,o="";if(!r||n+16>256){for(r=Array(t=256);t--;)r[t]=256*Math.random()|0;t=n=0}for(;t<16;t++)e=r[n+t],o+=6==t?s[15&e|64]:8==t?s[63&e|128]:s[e],1&t&&t>1&&t<11&&(o+="-");return n++,o}},7948:e=>{"use strict";const{AbortController:t,AbortSignal:r}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t},1291:(e,t,r)=>{"use strict";const n=r(6150),s=r(6086);class o extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t=(e=[...e].map((e=>e instanceof Error?e:null!==e&&"object"==typeof e?Object.assign(new Error(e.message),e):new Error(e)))).map((e=>"string"==typeof e.stack?s(e.stack).replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""):String(e))).join("\n");t="\n"+n(t,4),super(t),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:e})}*[Symbol.iterator](){for(const e of this._errors)yield e}}e.exports=o},6086:(e,t,r)=>{"use strict";const n=r(1209),s=/\s+at.*(?:\(|\s)(.*)\)?/,o=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,a=void 0===n.homedir?"":n.homedir();e.exports=(e,t)=>(t=Object.assign({pretty:!1},t),e.replace(/\\/g,"/").split("\n").filter((e=>{const t=e.match(s);if(null===t||!t[1])return!0;const r=t[1];return!r.includes(".app/Contents/Resources/electron.asar")&&!r.includes(".app/Contents/Resources/default_app.asar")&&!o.test(r)})).filter((e=>""!==e.trim())).map((e=>t.pretty?e.replace(s,((e,t)=>e.replace(t,t.replace(a,"~")))):e)).join("\n"))},3531:e=>{e.exports=function(e){return btoa(e)}},8879:function(e){e.exports=function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",s="second",o="minute",a="hour",i="day",c="week",u="month",l="quarter",d="year",p="date",f="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},g=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},v={s:g,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),s=r%60;return(t<=0?"+":"-")+g(n,2,"0")+":"+g(s,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),s=t.clone().add(n,u),o=r-s<0,a=t.clone().add(n+(o?-1:1),u);return+(-(n+(r-s)/(o?s-a:a-s))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:d,w:c,d:i,D:p,h:a,m:o,s,ms:n,Q:l}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",w={};w[b]=y;var $=function(e){return e instanceof O},_=function(e,t,r){var n;if(!e)return b;if("string"==typeof e)w[e]&&(n=e),t&&(w[e]=t,n=e);else{var s=e.name;w[s]=e,n=s}return!r&&n&&(b=n),n||!r&&b},E=function(e,t){if($(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new O(r)},S=v;S.l=_,S.i=$,S.w=function(e,t){return E(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var O=function(){function y(e){this.$L=_(e.locale,null,!0),this.parse(e)}var g=y.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(S.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(h);if(n){var s=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return S},g.isValid=function(){return!(this.$d.toString()===f)},g.isSame=function(e,t){var r=E(e);return this.startOf(t)<=r&&r<=this.endOf(t)},g.isAfter=function(e,t){return E(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<E(e)},g.$g=function(e,t,r){return S.u(e)?this[t]:this.set(r,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var r=this,n=!!S.u(t)||t,l=S.p(e),f=function(e,t){var s=S.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return n?s:s.endOf(i)},h=function(e,t){return S.w(r.toDate()[e].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},m=this.$W,y=this.$M,g=this.$D,v="set"+(this.$u?"UTC":"");switch(l){case d:return n?f(1,0):f(31,11);case u:return n?f(1,y):f(0,y+1);case c:var b=this.$locale().weekStart||0,w=(m<b?m+7:m)-b;return f(n?g-w:g+(6-w),y);case i:case p:return h(v+"Hours",0);case a:return h(v+"Minutes",1);case o:return h(v+"Seconds",2);case s:return h(v+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var r,c=S.p(e),l="set"+(this.$u?"UTC":""),f=(r={},r[i]=l+"Date",r[p]=l+"Date",r[u]=l+"Month",r[d]=l+"FullYear",r[a]=l+"Hours",r[o]=l+"Minutes",r[s]=l+"Seconds",r[n]=l+"Milliseconds",r)[c],h=c===i?this.$D+(t-this.$W):t;if(c===u||c===d){var m=this.clone().set(p,1);m.$d[f](h),m.init(),this.$d=m.set(p,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](h);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[S.p(e)]()},g.add=function(n,l){var p,f=this;n=Number(n);var h=S.p(l),m=function(e){var t=E(f);return S.w(t.date(t.date()+Math.round(e*n)),f)};if(h===u)return this.set(u,this.$M+n);if(h===d)return this.set(d,this.$y+n);if(h===i)return m(1);if(h===c)return m(7);var y=(p={},p[o]=t,p[a]=r,p[s]=e,p)[h]||1,g=this.$d.getTime()+n*y;return S.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||f;var n=e||"YYYY-MM-DDTHH:mm:ssZ",s=S.z(this),o=this.$H,a=this.$m,i=this.$M,c=r.weekdays,u=r.months,l=function(e,r,s,o){return e&&(e[r]||e(t,n))||s[r].substr(0,o)},d=function(e){return S.s(o%12||12,e,"0")},p=r.meridiem||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n},h={YY:String(this.$y).slice(-2),YYYY:this.$y,M:i+1,MM:S.s(i+1,2,"0"),MMM:l(r.monthsShort,i,u,3),MMMM:l(u,i),D:this.$D,DD:S.s(this.$D,2,"0"),d:String(this.$W),dd:l(r.weekdaysMin,this.$W,c,2),ddd:l(r.weekdaysShort,this.$W,c,3),dddd:c[this.$W],H:String(o),HH:S.s(o,2,"0"),h:d(1),hh:d(2),a:p(o,a,!0),A:p(o,a,!1),m:String(a),mm:S.s(a,2,"0"),s:String(this.$s),ss:S.s(this.$s,2,"0"),SSS:S.s(this.$ms,3,"0"),Z:s};return n.replace(m,(function(e,t){return t||h[e]||s.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(n,p,f){var h,m=S.p(p),y=E(n),g=(y.utcOffset()-this.utcOffset())*t,v=this-y,b=S.m(this,y);return b=(h={},h[d]=b/12,h[u]=b,h[l]=b/3,h[c]=(v-g)/6048e5,h[i]=(v-g)/864e5,h[a]=v/r,h[o]=v/t,h[s]=v/e,h)[m]||v,f?b:S.a(b)},g.daysInMonth=function(){return this.endOf(u).$D},g.$locale=function(){return w[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=_(e,t,!0);return n&&(r.$L=n),r},g.clone=function(){return S.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},y}(),P=O.prototype;return E.prototype=P,[["$ms",n],["$s",s],["$m",o],["$H",a],["$W",i],["$M",u],["$y",d],["$D",p]].forEach((function(e){P[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),E.extend=function(e,t){return e.$i||(e(t,O,E),e.$i=!0),E},E.locale=_,E.isDayjs=$,E.unix=function(e){return E(1e3*e)},E.en=w[b],E.Ls=w,E.p={},E}()},2699:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function s(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&m(e,"error",t,r)}(e,s,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function i(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var s,o,a,u;if(i(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(s=c(e))>0&&a.length>s&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=l.bind(n);return s.listener=r,n.wrapFn=s,s}function p(e,t,r){var n=e._events;if(void 0===n)return[];var s=n[t];return void 0===s?[]:"function"==typeof s?r?[s.listener||s]:[s]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(s):h(s,s.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function m(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function s(o){n.once&&e.removeEventListener(t,s),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var s="error"===e,o=this._events;if(void 0!==o)s=s&&void 0===o.error;else if(!s)return!1;if(s){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var i=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw i.context=a,i}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,l=h(c,u);for(r=0;r<u;++r)n(l[r],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return i(t),this.on(e,d(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return i(t),this.prependListener(e,d(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,s,o,a;if(i(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(s=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,s=o;break}if(s<0)return this;0===s?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,s),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var s,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(s=o[n])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9378:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(s=n;0!=s--;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(s=n;0!=s--;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;0!=s--;){var a=o[s];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r}},6150:e=>{"use strict";e.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},"string"!=typeof e)throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof t)throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if("string"!=typeof r.indent)throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(0===t)return e;const n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}},9522:e=>{"use strict";var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),r(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function r(e,n,s,o,a,i,c,u,l,d){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var p in n(o,a,i,c,u,l,d),o){var f=o[p];if(Array.isArray(f)){if(p in t.arrayKeywords)for(var h=0;h<f.length;h++)r(e,n,s,f[h],a+"/"+p+"/"+h,i,a,p,o,h)}else if(p in t.propsKeywords){if(f&&"object"==typeof f)for(var m in f)r(e,n,s,f[m],a+"/"+p+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),i,a,p,o,m)}else(p in t.keywords||e.allKeys&&!(p in t.skipKeywords))&&r(e,n,s,f,a+"/"+p,i,a,p,o)}s(o,a,i,c,u,l,d)}}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},2854:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,s=1;s<n;++s)t[s]=t[s].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function s(e){return e.toUpperCase()}function o(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function a(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}function i(e){var n="[A-Za-z]",s="[0-9]",o=t(s,"[A-Fa-f]"),a=r(r("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+r("%[89A-Fa-f]"+o+"%"+o+o)+"|"+r("%"+o+o)),i="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=t("[\\:\\/\\?\\#\\[\\]\\@]",i),u=e?"[\\uE000-\\uF8FF]":"[]",l=t(n,s,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),d=r(n+t(n,s,"[\\+\\-\\.]")+"*"),p=r(r(a+"|"+t(l,i,"[\\:]"))+"*"),f=(r(r("25[0-5]")+"|"+r("2[0-4]"+s)+"|"+r("1"+s+s)+"|"+r("[1-9]"+s)+"|"+s),r(r("25[0-5]")+"|"+r("2[0-4]"+s)+"|"+r("1"+s+s)+"|"+r("0?[1-9]"+s)+"|0?0?"+s)),h=r(f+"\\."+f+"\\."+f+"\\."+f),m=r(o+"{1,4}"),y=r(r(m+"\\:"+m)+"|"+h),g=r(r(m+"\\:")+"{6}"+y),v=r("\\:\\:"+r(m+"\\:")+"{5}"+y),b=r(r(m)+"?\\:\\:"+r(m+"\\:")+"{4}"+y),w=r(r(r(m+"\\:")+"{0,1}"+m)+"?\\:\\:"+r(m+"\\:")+"{3}"+y),$=r(r(r(m+"\\:")+"{0,2}"+m)+"?\\:\\:"+r(m+"\\:")+"{2}"+y),_=r(r(r(m+"\\:")+"{0,3}"+m)+"?\\:\\:"+m+"\\:"+y),E=r(r(r(m+"\\:")+"{0,4}"+m)+"?\\:\\:"+y),S=r(r(r(m+"\\:")+"{0,5}"+m)+"?\\:\\:"+m),O=r(r(r(m+"\\:")+"{0,6}"+m)+"?\\:\\:"),P=r([g,v,b,w,$,_,E,S,O].join("|")),j=r(r(l+"|"+a)+"+"),T=(r(P+"\\%25"+j),r(P+r("\\%25|\\%(?!"+o+"{2})")+j)),x=r("[vV]"+o+"+\\."+t(l,i,"[\\:]")+"+"),k=r("\\["+r(T+"|"+P+"|"+x)+"\\]"),A=r(r(a+"|"+t(l,i))+"*"),C=r(k+"|"+h+"(?!"+A+")|"+A),I=r(s+"*"),N=r(r(p+"@")+"?"+C+r("\\:"+I)+"?"),D=r(a+"|"+t(l,i,"[\\:\\@]")),R=r(D+"*"),M=r(D+"+"),q=r(r(a+"|"+t(l,i,"[\\@]"))+"+"),F=r(r("\\/"+R)+"*"),L=r("\\/"+r(M+F)+"?"),U=r(q+F),V=r(M+F),z="(?!"+D+")",H=(r(F+"|"+L+"|"+U+"|"+V+"|"+z),r(r(D+"|"+t("[\\/\\?]",u))+"*")),K=r(r(D+"|[\\/\\?]")+"*"),B=r(r("\\/\\/"+N+F)+"|"+L+"|"+V+"|"+z),J=r(d+"\\:"+B+r("\\?"+H)+"?"+r("\\#"+K)+"?"),G=r(r("\\/\\/"+N+F)+"|"+L+"|"+U+"|"+z),Y=r(G+r("\\?"+H)+"?"+r("\\#"+K)+"?");return r(J+"|"+Y),r(d+"\\:"+B+r("\\?"+H)+"?"),r(r("\\/\\/("+r("("+p+")@")+"?("+C+")"+r("\\:("+I+")")+"?)")+"?("+F+"|"+L+"|"+V+"|"+z+")"),r("\\?("+H+")"),r("\\#("+K+")"),r(r("\\/\\/("+r("("+p+")@")+"?("+C+")"+r("\\:("+I+")")+"?)")+"?("+F+"|"+L+"|"+U+"|"+z+")"),r("\\?("+H+")"),r("\\#("+K+")"),r(r("\\/\\/("+r("("+p+")@")+"?("+C+")"+r("\\:("+I+")")+"?)")+"?("+F+"|"+L+"|"+V+"|"+z+")"),r("\\?("+H+")"),r("\\#("+K+")"),r("("+p+")@"),r("\\:("+I+")"),{NOT_SCHEME:new RegExp(t("[^]",n,s,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",l,i),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",l,i),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",l,i),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",l,i),"g"),NOT_QUERY:new RegExp(t("[^\\%]",l,i,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",l,i,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",l,i),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(a,"g"),IPV4ADDRESS:new RegExp("^("+h+")$"),IPV6ADDRESS:new RegExp("^\\[?("+P+")"+r(r("\\%25|\\%(?!"+o+"{2})")+"("+j+")")+"?\\]?$")}}var c=i(!1),u=i(!0),l=function(){function e(e,t){var r=[],n=!0,s=!1,o=void 0;try{for(var a,i=e[Symbol.iterator]();!(n=(a=i.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){s=!0,o=e}finally{try{!n&&i.return&&i.return()}finally{if(s)throw o}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},p=2147483647,f=36,h=1,m=26,y=38,g=700,v=72,b=128,w="-",$=/^xn--/,_=/[^\0-\x7E]/,E=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=f-h,P=Math.floor,j=String.fromCharCode;function T(e){throw new RangeError(S[e])}function x(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}function k(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+x((e=e.replace(E,".")).split("."),t).join(".")}function A(e){for(var t=[],r=0,n=e.length;r<n;){var s=e.charCodeAt(r++);if(s>=55296&&s<=56319&&r<n){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&s)<<10)+(1023&o)+65536):(t.push(s),r--)}else t.push(s)}return t}var C=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:f},I=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},N=function(e,t,r){var n=0;for(e=r?P(e/g):e>>1,e+=P(e/t);e>O*m>>1;n+=f)e=P(e/O);return P(n+(O+1)*e/(e+y))},D=function(e){var t=[],r=e.length,n=0,s=b,o=v,a=e.lastIndexOf(w);a<0&&(a=0);for(var i=0;i<a;++i)e.charCodeAt(i)>=128&&T("not-basic"),t.push(e.charCodeAt(i));for(var c=a>0?a+1:0;c<r;){for(var u=n,l=1,d=f;;d+=f){c>=r&&T("invalid-input");var y=C(e.charCodeAt(c++));(y>=f||y>P((p-n)/l))&&T("overflow"),n+=y*l;var g=d<=o?h:d>=o+m?m:d-o;if(y<g)break;var $=f-g;l>P(p/$)&&T("overflow"),l*=$}var _=t.length+1;o=N(n-u,_,0==u),P(n/_)>p-s&&T("overflow"),s+=P(n/_),n%=_,t.splice(n++,0,s)}return String.fromCodePoint.apply(String,t)},R=function(e){var t=[],r=(e=A(e)).length,n=b,s=0,o=v,a=!0,i=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var d=u.value;d<128&&t.push(j(d))}}catch(e){i=!0,c=e}finally{try{!a&&l.return&&l.return()}finally{if(i)throw c}}var y=t.length,g=y;for(y&&t.push(w);g<r;){var $=p,_=!0,E=!1,S=void 0;try{for(var O,x=e[Symbol.iterator]();!(_=(O=x.next()).done);_=!0){var k=O.value;k>=n&&k<$&&($=k)}}catch(e){E=!0,S=e}finally{try{!_&&x.return&&x.return()}finally{if(E)throw S}}var C=g+1;$-n>P((p-s)/C)&&T("overflow"),s+=($-n)*C,n=$;var D=!0,R=!1,M=void 0;try{for(var q,F=e[Symbol.iterator]();!(D=(q=F.next()).done);D=!0){var L=q.value;if(L<n&&++s>p&&T("overflow"),L==n){for(var U=s,V=f;;V+=f){var z=V<=o?h:V>=o+m?m:V-o;if(U<z)break;var H=U-z,K=f-z;t.push(j(I(z+H%K,0))),U=P(H/K)}t.push(j(I(U,0))),o=N(s,C,g==y),s=0,++g}}}catch(e){R=!0,M=e}finally{try{!D&&F.return&&F.return()}finally{if(R)throw M}}++s,++n}return t.join("")},M=function(e){return k(e,(function(e){return $.test(e)?D(e.slice(4).toLowerCase()):e}))},q=function(e){return k(e,(function(e){return _.test(e)?"xn--"+R(e):e}))},F={version:"2.1.0",ucs2:{decode:A,encode:function(e){return String.fromCodePoint.apply(String,d(e))}},decode:D,encode:R,toASCII:q,toUnicode:M},L={};function U(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function V(e){for(var t="",r=0,n=e.length;r<n;){var s=parseInt(e.substr(r+1,2),16);if(s<128)t+=String.fromCharCode(s),r+=3;else if(s>=194&&s<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&s)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(s>=224){if(n-r>=9){var a=parseInt(e.substr(r+4,2),16),i=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&s)<<12|(63&a)<<6|63&i)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function z(e,t){function r(e){var r=V(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,U).replace(t.PCT_ENCODED,s)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,U).replace(t.PCT_ENCODED,s)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,U).replace(t.PCT_ENCODED,s)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,U).replace(t.PCT_ENCODED,s)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,U).replace(t.PCT_ENCODED,s)),e}function H(e){return e.replace(/^0*(.*)/,"$1")||"0"}function K(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=l(r,2)[1];return n?n.split(".").map(H).join("."):e}function B(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=l(r,3),s=n[1],o=n[2];if(s){for(var a=s.toLowerCase().split("::").reverse(),i=l(a,2),c=i[0],u=i[1],d=u?u.split(":").map(H):[],p=c.split(":").map(H),f=t.IPV4ADDRESS.test(p[p.length-1]),h=f?7:8,m=p.length-h,y=Array(h),g=0;g<h;++g)y[g]=d[g]||p[m+g]||"";f&&(y[h-1]=K(y[h-1],t));var v=y.reduce((function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],b=void 0;if(v&&v.length>1){var w=y.slice(0,v.index),$=y.slice(v.index+v.length);b=w.join(":")+"::"+$.join(":")}else b=y.join(":");return o&&(b+="%"+o),b}return e}var J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,G=void 0==="".match(/(){0}/)[1];function Y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?u:c;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var s=e.match(J);if(s){G?(r.scheme=s[1],r.userinfo=s[3],r.host=s[4],r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=s[7],r.fragment=s[8],isNaN(r.port)&&(r.port=s[5])):(r.scheme=s[1]||void 0,r.userinfo=-1!==e.indexOf("@")?s[3]:void 0,r.host=-1!==e.indexOf("//")?s[4]:void 0,r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=-1!==e.indexOf("?")?s[7]:void 0,r.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),r.host&&(r.host=B(K(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=L[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)z(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=F.toASCII(r.host.replace(n.PCT_ENCODED,V).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}z(r,c)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function W(e,t){var r=!1!==t.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(B(K(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var X=/^\.\.?\//,Q=/^\/\.(\/|$)/,Z=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(Q))e=e.replace(Q,"/");else if(e.match(Z))e=e.replace(Z,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(ee);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?u:c,n=[],s=L[(t.scheme||e.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||s&&s.domainHost)try{e.host=t.iri?F.toUnicode(e.host):F.toASCII(e.host.replace(r.PCT_ENCODED,V).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}z(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=W(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var a=e.path;t.absolutePath||s&&s.absolutePath||(a=te(a)),void 0===o&&(a=a.replace(/^\/\//,"/%2F")),n.push(a)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=Y(re(e,r),r),t=Y(re(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=te(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function se(e,t,r){var n=a({scheme:"null"},r);return re(ne(Y(e,n),Y(t,n),n,!0),n)}function oe(e,t){return"string"==typeof e?e=re(Y(e,t),t):"object"===n(e)&&(e=Y(re(e,t),t)),e}function ae(e,t,r){return"string"==typeof e?e=re(Y(e,r),r):"object"===n(e)&&(e=re(e,r)),"string"==typeof t?t=re(Y(t,r),r):"object"===n(t)&&(t=re(t,r)),e===t}function ie(e,t){return e&&e.toString().replace(t&&t.iri?u.ESCAPE:c.ESCAPE,U)}function ce(e,t){return e&&e.toString().replace(t&&t.iri?u.PCT_ENCODED:c.PCT_ENCODED,V)}var ue={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var pe={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=de(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(de(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),n=l(r,2),s=n[0],o=n[1];e.path=s&&"/"!==s?s:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},fe={scheme:"wss",domainHost:pe.domainHost,parse:pe.parse,serialize:pe.serialize},he={},me="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ye="[0-9A-Fa-f]",ge=r(r("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+r("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+r("%"+ye+ye)),ve="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",$e=new RegExp(me,"g"),_e=new RegExp(ge,"g"),Ee=new RegExp(t("[^]",ve,"[\\.]",'[\\"]',be),"g"),Se=new RegExp(t("[^]",me,we),"g"),Oe=Se;function Pe(e){var t=V(e);return t.match($e)?t:e}var je={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var s=!1,o={},a=r.query.split("&"),i=0,c=a.length;i<c;++i){var u=a[i].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),d=0,p=l.length;d<p;++d)n.push(l[d]);break;case"subject":r.subject=ce(u[1],t);break;case"body":r.body=ce(u[1],t);break;default:s=!0,o[ce(u[0],t)]=ce(u[1],t)}}s&&(r.headers=o)}r.query=void 0;for(var f=0,h=n.length;f<h;++f){var m=n[f].split("@");if(m[0]=ce(m[0]),t.unicodeSupport)m[1]=ce(m[1],t).toLowerCase();else try{m[1]=F.toASCII(ce(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[f]=m.join("@")}return r},serialize:function(e,t){var r=e,n=o(e.to);if(n){for(var a=0,i=n.length;a<i;++a){var c=String(n[a]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(_e,Pe).replace(_e,s).replace(Ee,U),d=c.slice(u+1);try{d=t.iri?F.toUnicode(d):F.toASCII(ce(d,t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}n[a]=l+"@"+d}r.path=n.join(",")}var p=e.headers=e.headers||{};e.subject&&(p.subject=e.subject),e.body&&(p.body=e.body);var f=[];for(var h in p)p[h]!==he[h]&&f.push(h.replace(_e,Pe).replace(_e,s).replace(Se,U)+"="+p[h].replace(_e,Pe).replace(_e,s).replace(Oe,U));return f.length&&(r.query=f.join("&")),r}},Te=/^([^\:]+)\:(.*)/,xe={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(Te),n=e;if(r){var s=t.scheme||n.scheme||"urn",o=r[1].toLowerCase(),a=r[2],i=s+":"+(t.nid||o),c=L[i];n.nid=o,n.nss=a,n.path=void 0,c&&(n=c.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,s=r+":"+(t.nid||n),o=L[s];o&&(e=o.serialize(e,t));var a=e,i=e.nss;return a.path=(n||t.nid)+":"+i,a}},ke=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Ae={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ke)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};L[ue.scheme]=ue,L[le.scheme]=le,L[pe.scheme]=pe,L[fe.scheme]=fe,L[je.scheme]=je,L[xe.scheme]=xe,L[Ae.scheme]=Ae,e.SCHEMES=L,e.pctEncChar=U,e.pctDecChars=V,e.parse=Y,e.removeDotSegments=te,e.serialize=re,e.resolveComponents=ne,e.resolve=se,e.normalize=oe,e.equal=ae,e.escapeComponent=ie,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(t)},1766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonCustomerFields=void 0,t.commonCustomerFields=function(e){return{customerId:{label:"Customer ID",description:"The user's customer ID.",type:"string",required:Boolean(e.requireCustomerId),default:{"@if":{exists:{"@path":"$.properties.customerId"},then:{"@path":"$.properties.customerId"},else:{"@path":"$.userId"}}}},anonymousId:{label:"Anonymous ID",description:"The user's anonymous ID.",type:"string",required:!1,default:{"@path":"$.anonymousId"}},email:{label:"Email",description:"The user's email address.",type:"string",required:Boolean(e.requireEmail),default:{"@path":"$.properties.email"}},isNewCustomer:{label:"New Customer Flag",description:"Flag to indicate whether the user is a new customer.",type:"boolean",required:!1,default:{"@path":"$.properties.isNewCustomer"}},loyaltyStatus:{label:"Loyalty Program Status",description:'The status of the user in your loyalty program. Valid values are "in", "out", or "blocked".',type:"string",required:!1,default:{"@path":"$.properties.loyaltyStatus"}},firstName:{label:"First Name",description:"The user's given name.",type:"string",required:!1,default:{"@path":"$.properties.firstName"}},lastName:{label:"Last Name",description:"The user's surname.",type:"string",required:!1,default:{"@path":"$.properties.lastName"}},name:{label:"Name",description:"The user's full name.",type:"string",required:!1,default:{"@path":"$.properties.name"}},age:{label:"Age",description:"The user's age.",type:"number",required:!1,default:{"@path":"$.properties.age"}},birthday:{label:"Birthday",description:'The user\'s birthday in the format "YYYY-MM-DD", or "0000-MM-DD" to omit the year.',type:"string",format:"date",default:{"@path":"$.properties.birthday"}}}}},6756:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contextAttributes=t.contextFields=void 0,t.contextFields={pageUrl:{label:"Page URL",description:"The URL of the web page the event was generated on.",type:"string",format:"uri",required:!1,default:{"@path":"$.context.page.url"}},pageTitle:{label:"Page Title",description:"The title of the web page the event was generated on.",type:"string",required:!1,default:{"@path":"$.context.page.title"}},userAgent:{label:"User Agent",description:"The browser's User-Agent string.",type:"string",required:!1,default:{"@path":"$.context.userAgent"}},ipAddress:{label:"IP Address",description:"The users's IP address.",type:"string",required:!1,default:{"@path":"$.context.ip"}}},t.contextAttributes=function(e){return[["pageUrl",e.pageUrl],["pageTitle",e.pageTitle],["userAgent",e.userAgent],["ipAddress",e.ipAddress]]}},4791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=t.mapEventHelper=t.mapEvent=t.DROP=t.COPY=t.ROOT=void 0;const n=r(5333),s=r(3384);function o(e,r){r.friendbuyAttributes&&("object"==typeof r.friendbuyAttributes&&(r=Object.assign({},r.friendbuyAttributes,r)),delete r.friendbuyAttributes);let n=Object.assign({},e.defaultObject);for(const[i,c]of Object.entries(r)){const r="object"==typeof e.fields&&e.fields[i];if(r)if(r===t.DROP);else{const e=r.name||i;let t=r.convert?r.convert(c):c;switch(r.type){case"object":t=o(r,t);break;case"array":r.fields&&(t=t.reduce(((e,t)=>{const n=o(r,t);return void 0!==n&&e.push(n),e}),[]))}if(s.isNonEmpty(t))if("string"==typeof e)n[e]=t;else{let r=n;for(let t=0;t<e.length-1;t++)e[t]in r||(r[e[t]]={}),r=r[e[t]];r[e[e.length-1]]=t}}else{let r=c;if(s.isNonEmpty(c)&&e.unmappedFieldObject){let s=n;e.unmappedFieldObject!==t.ROOT&&(s="object"!=typeof n[e.unmappedFieldObject]?n[e.unmappedFieldObject]={}:n[e.unmappedFieldObject],r=a(c)),s[i]=r}}}return e.finalize&&(n=e.finalize(n)),s.isNonEmpty(n)?n:void 0}function a(e){switch(typeof e){case"string":return e;case"object":return JSON.stringify(e);default:return e.toString()}}t.ROOT=Symbol("ROOT"),t.COPY={},Object.freeze(t.COPY),t.DROP=Symbol("DROP"),t.mapEvent=function(e,t){const r=o(e,t);if(!r)throw new n.IntegrationError("Payload has no supported fields","INVALID_REQUEST_DATA",400);return r},t.mapEventHelper=o,t.stringify=a},7510:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trackCustomEventFields=void 0;t.trackCustomEventFields=e=>({eventType:{type:"string",required:!0,description:"The type of the event to track.",label:"Event Type",default:{"@path":"$.event"}},eventProperties:{type:"object",required:!0,description:"Object containing the properties for the event being tracked. All of the fields in this object will be sent in the root of the Friendbuy track event.",label:"Event Properties",default:{"@path":"$.properties"}},deduplicationId:{type:"string",required:!1,description:"An identifier for the event being tracked to prevent the same event from being rewarded more than once.",label:"Event ID",default:{"@path":"$.properties.deduplicationId"}},customerId:{label:"Customer ID",description:"The user's customer ID.",type:"string",required:!0,default:{"@if":{exists:{"@path":"$.properties.customerId"},then:{"@path":"$.properties.customerId"},else:{"@path":"$.userId"}}}},anonymousId:{label:"Anonymous ID",description:"The user's anonymous id",type:"string",required:!1,default:{"@path":"$.anonymousId"}},email:{label:"Email",description:"The user's email address.",type:"string",required:Boolean(e.requireEmail),default:{"@path":"$.properties.email"}}})},9242:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trackCustomerFields=void 0,t.trackCustomerFields={customerId:{label:"Customer ID",description:"The user's customer ID.",type:"string",required:!0,default:{"@path":"$.userId"}},anonymousId:{label:"Anonymous ID",description:"The user's anonymous id.",type:"string",required:!1,default:{"@path":"$.anonymousId"}},email:{label:"Email",description:"The user's email address.",type:"string",required:!0,default:{"@path":"$.traits.email"}},firstName:{label:"First Name",description:"The user's given name.",type:"string",required:!1,default:{"@path":"$.traits.firstName"}},lastName:{label:"Last Name",description:"The user's surname.",type:"string",required:!1,default:{"@path":"$.traits.lastName"}},name:{label:"Name",description:"The user's full name. If the name trait doesn't exist then it will be automatically derived from the firstName and lastName traits if they are defined.",type:"string",required:!1,default:{"@path":"$.traits.name"}},age:{label:"Age",description:"The user's age.",type:"number",required:!1,default:{"@path":"$.traits.age"}},birthday:{label:"Birthday",description:'The user\'s birthday in the format "YYYY-MM-DD", or "0000-MM-DD" to omit the year.',type:"string",format:"date",required:!1,default:{"@path":"$.traits.birthday"}},language:{label:"Language",description:"The user's language.",type:"string",required:!1,default:{"@path":"$.traits.language"}},addressCountry:{label:"Country",description:"The user's country.",type:"string",required:!1,default:{"@path":"$.traits.address.country"}},addressState:{label:"State",description:"The user's state.",type:"string",required:!1,default:{"@path":"$.traits.address.state"}},addressCity:{label:"City",description:"The user's city.",type:"string",required:!1,default:{"@path":"$.traits.address.city"}},addressPostalCode:{label:"State",description:"The user's postal code.",type:"string",required:!1,default:{"@path":"$.traits.address.postalCode"}},customerSince:{label:"Customer Since",description:"The date the user became a customer.",type:"string",format:"date-time",required:!1,default:{"@path":"$.traits.customerSince"}},loyaltyStatus:{label:"Loyalty Status",description:'The status of the user in your loyalty program. Valid values are "in", "out", or "blocked".',type:"string",required:!1,default:{"@path":"$.traits.loyaltyStatus"}},isNewCustomer:{label:"New Customer Flag",description:"Flag to indicate whether the user is a new customer.",type:"boolean",required:!1,default:{"@path":"$.traits.isNewCustomer"}},friendbuyAttributes:{label:"Custom Attributes",description:"Custom attributes to send to Friendbuy. You should pass an object whose keys are the names of the custom attributes and whose values are strings. Non-string-valued attributes will be dropped.",type:"object",required:!1,default:{"@path":"$.traits.friendbuyAttributes"}}}},3881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trackPurchaseFields=void 0;const n=r(1766);t.trackPurchaseFields=e=>({orderId:{label:"Order ID",description:"The order ID.",type:"string",required:!0,default:{"@path":"$.properties.order_id"}},amount:{label:"Purchase Amount",description:"Purchase amount to be considered when evaluating reward rules.",type:"number",required:!0,default:{"@path":"$.properties.total"}},currency:{label:"Currency",description:"The currency of the purchase amount.",type:"string",required:!0,default:{"@path":"$.properties.currency"}},coupon:{label:"Coupon",description:"The coupon code of any coupon redeemed with the order.",type:"string",required:!1,default:{"@path":"$.properties.coupon"}},attributionId:{label:"Friendbuy Attribution ID",description:"Friendbuy attribution ID that associates the purchase with the advocate who referred the purchaser.",type:"string",required:!1,default:{"@path":"$.properties.attributionId"}},referralCode:{label:"Friendbuy Referral ID",description:"Friendbuy referral code that associates the purchase with the advocate who referred the purchaser.",type:"string",required:!1,default:{"@path":"$.properties.referralCode"}},giftCardCodes:{label:"Gift Card Codes",description:"An array of gift card codes applied to the order.",type:"string",multiple:!0,required:!1,default:{"@path":"$.properties.giftCardCodes"}},products:{label:"Products",description:"Products purchased.",type:"object",multiple:!0,required:!1,properties:{sku:{label:"Product SKU",type:"string",required:!1},name:{label:"Product Name",type:"string",required:!1},quantity:{label:"Quantity (default 1)",type:"integer",required:!1},price:{label:"Price",type:"number",required:!0},description:{label:"Product Description",type:"string",required:!1},category:{label:"Product Category",type:"string",required:!1},url:{label:"Product URL",type:"string",required:!1},image_url:{label:"Product Image URL",type:"string",required:!1}},default:{"@path":"$.properties.products"}},...n.commonCustomerFields(e),friendbuyAttributes:{label:"Custom Attributes",description:"Custom attributes to send to Friendbuy. You should pass an object whose keys are the names of the custom attributes and whose values are strings. Non-string-valued attributes will be dropped.",type:"object",required:!1,default:{"@path":"$.properties.friendbuyAttributes"}}})},4716:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trackSignUpFields=void 0;const n=r(1766);t.trackSignUpFields=e=>({...n.commonCustomerFields(e),coupon:{label:"Coupon Code",description:"Coupon code that customer supplied when they signed up.",type:"string",required:!1,default:{"@path":"$.properties.coupon"}},attributionId:{label:"Friendbuy Attribution ID",description:"Friendbuy attribution ID that associates the customer who is signing up with the advocate who referred them.",type:"string",required:!1,default:{"@path":"$.properties.attributionId"}},referralCode:{label:"Friendbuy Referral ID",description:"Friendbuy referral code that associates the customer who is signing up with the advocate who referred them.",type:"string",required:!1,default:{"@path":"$.properties.referralCode"}},friendbuyAttributes:{label:"Custom Attributes",description:"Custom attributes to send to Friendbuy. You should pass an object whose keys are the names of the custom attributes and whose values are strings. Non-string-valued attributes will be dropped.",type:"object",required:!1,default:{"@path":"$.properties.friendbuyAttributes"}}})},3384:(e,t)=>{"use strict";function r(e){if(void 0===e||""===e)return!1;if("object"!=typeof e)return!0;for(const t in e)return!0;return null===e}function n(e,t={}){const n={};return e.forEach((([e,s])=>{void 0===s||""===s||t.dropEmpty&&!r(s)||(n[e]=s)})),n}Object.defineProperty(t,"__esModule",{value:!0}),t.enjoinString=t.enjoinNumber=t.enjoinInteger=t.parseDate=t.filterFriendbuyAttributes=t.createFriendbuyPayload=t.isNonEmpty=t.moveEventPropertiesToRoot=t.removeCustomerIfNoId=t.addName=t.getName=void 0,t.getName=function(e){return e.name?e.name:e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:void 0},t.addName=function(e){"object"==typeof e&&!e.name&&e.firstName&&e.lastName&&(e.name=`${e.firstName} ${e.lastName}`)},t.removeCustomerIfNoId=function(e){return"object"!=typeof e||"object"!=typeof e.customer||e.customer.id||delete(e={...e}).customer,e},t.moveEventPropertiesToRoot=function(e){if("object"!=typeof e||"object"!=typeof e.eventProperties)return e;const t={...e.eventProperties||{},...e};return delete t.eventProperties,t},t.isNonEmpty=r,t.createFriendbuyPayload=n,t.filterFriendbuyAttributes=function(e,t){const r=[];return t&&Object.entries(t).forEach((e=>{if("string"==typeof e[1])if("birthday"===e[0]){const t=o(e[1]);t&&r.push([e[0],t])}else r.push(e)})),0===r.length?[]:"mapi"===e?[["additionalProperties",n(r)]]:r};const s=/^(?:(\d\d\d\d)-)?(\d\d)-(\d\d)(?:[^\d]|$)/;function o(e){if("object"==typeof e&&(!("year"in e)||"number"==typeof e.year)&&"number"==typeof e.month&&"number"==typeof e.day)return e;if("string"!=typeof e)return;const t=s.exec(e);if(!t)return;const r=t[1]&&"0000"!==t[1]?{year:parseInt(t[1],10)}:{};return{month:parseInt(t[2],10),day:parseInt(t[3],10),...r}}t.parseDate=o;const a=/^-?(?:0|[1-9][0-9]*)$/,i=/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$/;t.enjoinInteger=function(e){return"string"==typeof e&&a.test(e)?parseInt(e):e},t.enjoinNumber=function(e){return"string"==typeof e&&i.test(e)?parseFloat(e):e},t.enjoinString=function(e){return"number"==typeof e?e.toString():e}},7899:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(1766),t),s(r(6756),t),s(r(4791),t),s(r(9242),t),s(r(7510),t),s(r(3881),t),s(r(4716),t),s(r(3384),t)},9699:(e,t,r)=>{"use strict";r.d(t,{Y:()=>i});var n=r(4028),s=r(4473);const o={fieldLabels:"title",includeOriginalError:!1,includeData:!1};class a extends Error{constructor(e,t={}){super(),this.options={},this.redundant=!1,this.options={...o,...t},this.pointer=e.instancePath,this.path=(0,s.YS)(e.instancePath);const r=(0,n.F)(e,this.options);null!==r?(this.message=`${(0,s.kC)(r)}.`,this.options.includeOriginalError&&(this.original=e),this.options.includeData&&(this.data=e.data)):this.redundant=!0}toJSON(){const e={path:this.path,pointer:this.pointer,message:this.message};return this.options.includeOriginalError&&(e.original=this.original),this.options.includeData&&(e.data=this.data),e}}class i extends Error{constructor(e,t={}){super(),this.name="AggregateAjvError",this.errors=(null!=e?e:[]).map((e=>new a(e,t))).filter((e=>!e.redundant)),this.message=this.errors.map((e=>e.message)).join(" ")}toJSON(){return this.errors.map((e=>e.toJSON()))}*[Symbol.iterator](){for(const e of this.errors)yield e}}},4028:(e,t,r)=>{"use strict";r.d(t,{F:()=>o});var n=r(4473);const s={"date-time":"date and time",time:"time",date:"date",email:"email address",hostname:"hostname",ipv4:"IPv4 address",ipv6:"IPv6 address",uri:"URI","uri-reference":"URI Reference","uri-template":"URI-template","json-pointer":"JSON Pointer","relative-json-pointer":"relative JSON Pointer",regex:"regular expression"},o=({data:e,keyword:t,message:r,params:o,parentSchema:a,schemaPath:i,instancePath:c},{fieldLabels:u})=>{const l=(({instancePath:e,parentSchema:t},{fieldLabels:r})=>{switch(r){case"js":return""===e?"the root value":`the value at ${(0,n.YS)(e).replace(/^\$/,"")}`;case"jsonPath":return`the value at ${(0,n.YS)(e)}`;case"jsonPointer":case"instancePath":return""===e?"the root value":`the value at ${e}`;case"title":return(null==t?void 0:t.title)?t.title:""===e?"the root value":`the value at ${e}`;default:throw new Error(`invalid fieldLabels value: ${r}`)}})({instancePath:c,parentSchema:a},{fieldLabels:u});if(null==a?void 0:a.errorMessage)return`${l} ${a.errorMessage}`;switch(t){case"enum":{const e=o.allowedValues.map(JSON.stringify);return`${l} must be one of: ${(0,n.Fx)(e,"or")}`}case"type":{const t=Array.isArray(o.type)?o.type:o.type.split(","),r=(0,n.Fx)(t,"or"),s=(0,n.$M)(e);return`${l} must be ${(0,n.Ao)(r)} ${r} but it was ${s}`}case"minLength":{const t=o.limit,r=(0,n._6)("character",t),s=e.length;return`${l} must be ${t} ${r} or more but it was ${s} ${(0,n._6)("character",s)}`}case"maxLength":{const t=o.limit,r=(0,n._6)("character",t),s=e.length;return`${l} must be ${t} ${r} or fewer but it was ${s} ${(0,n._6)("character",s)}`}case"pattern":{if(i.endsWith("propertyNames/pattern"))return null;const e=null==a?void 0:a.patternLabel;return e?`${l} must be ${e} but it was not`:`${l} is an invalid string`}case"format":return`${l} must be a valid ${s[o.format]||o.format} string but it was not`;case"multipleOf":return`${l} must be a multiple of ${o.multipleOf}`;case"minimum":return`${l} must be equal to or greater than ${o.limit}`;case"exclusiveMinimum":return`${l} must be greater than ${o.limit}`;case"maximum":return`${l} must be equal to or less than ${o.limit}`;case"exclusiveMaximum":return`${l} must be less than ${o.limit}`;case"additionalProperties":{const e=Object.keys(null==a?void 0:a.properties).join(", ");return`${l} has an unexpected property, ${o.additionalProperty}, which is not in the list of allowed properties (${e})`}case"required":return`${l} is missing the required field '${o.missingProperty}'`;case"propertyNames":return`${l} has an invalid property name ${JSON.stringify(o.propertyName)}`;case"minProperties":return`${l} must have ${o.limit} or more properties but it has ${Object.keys(e).length}`;case"maxProperties":return`${l} must have ${o.limit} or fewer properties but it has ${Object.keys(e).length}`;case"dependencies":{const e=o.property;return`${l} must have property ${o.missingProperty} when ${e} is present`}case"minItems":return`${l} must have ${o.limit} or more items but it has ${e.length}`;case"maxItems":return`${l} must have ${o.limit} or fewer items but it has ${e.length}`;case"uniqueItems":{const{i:e,j:t}=o;return`${l} must be unique but elements ${t} and ${e} are the same`}default:return`${l} ${r}`}}},5375:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AggregateAjvError:()=>n.Y});var n=r(9699)},4473:(e,t,r)=>{"use strict";r.d(t,{$M:()=>i,Ao:()=>a,Fx:()=>c,YS:()=>o,_6:()=>s,kC:()=>n});const n=e=>"string"!=typeof e||0===e.length?e:e.charAt(0).toUpperCase()+e.slice(1),s=(e,t)=>1===t?e:`${e}s`,o=e=>{if(""===e)return"$";const t=e.substring(1).split(/\//).map((e=>e.replace(/~1/g,"/").replace(/~0/g,"~").replace(/\./g,"\\."))).map((e=>/^\d+$/.exec(e)?`[${e}]`:`.${e}`)).join("");return"$"+t},a=e=>{switch(e[0]){case"a":case"e":case"i":case"o":case"u":return"an";default:return"a"}},i=e=>{const t=typeof e;switch(t){case"object":return null===e?"null":Array.isArray(e)?"an array":"an object";case"undefined":return"undefined";default:return`${a(t)} ${t}`}},c=(e,t="and")=>0===e.length?"nothing":1===e.length?e[0]:2===e.length?`${e[0]} ${t} ${e[1]}`:`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`},6943:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrifyFields=t.arrify=void 0;const n=r(7309);function s(e,t=!0){return null==e?t?[]:e:n.isArray(e)?e:[e]}t.arrify=s,t.arrifyFields=function(e,t={}){if(!n.isObject(e))return e;if(!t.properties)return e;for(const r of Object.keys(e)){const n=t.properties[r];n&&("array"===n.type&&(e[r]=s(e[r],!1)))}return e}},2715:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=a(r(9909)),c=a(r(8296)),u=a(r(2930)),l=o(r(2748)),d=l.default({timeout:l.DEFAULT_REQUEST_TIMEOUT,headers:{"user-agent":"Segment (Actions)"},beforeRequest:[i.default],afterResponse:[u.default,c.default]});t.default=function(...e){let t=d;for(const r of e??[])t=t.extend(r);return(e,r)=>t(e,r)}},6810:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTestEvent=void 0;const n=r(554);t.createTestEvent=function(e={}){return{anonymousId:"anonId1234",context:{ip:"8.8.8.8",library:{name:"analytics.js",version:"2.11.1"},locale:"en-US",location:{city:"San Francisco",country:"United States",latitude:40.2964197,longitude:-76.9411617,speed:0},page:{path:"/academy/",referrer:"",search:"",title:"Analytics Academy",url:"https://segment.com/academy/"},timezone:"Europe/Amsterdam",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1"},event:"Test Event",messageId:n.v4(),properties:{},receivedAt:(new Date).toISOString(),sentAt:(new Date).toISOString(),timestamp:(new Date).toISOString(),traits:{},type:"track",userId:"user1234",...e}}},9751:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTestIntegration=void 0;const n=r(6810),s=r(7537),o=r(5814),a=()=>{};class i extends s.Destination{constructor(e){super(e),this.responses=[],this.results=[]}async testDynamicField(e,t,r,n){return await super.executeDynamicField(e,t,r,n)}async testAction(e,{event:t,mapping:r,settings:s,useDefaultMappings:i,auth:c,features:u,statsContext:l,logger:d,dataFeedCache:p,transactionContext:f,stateContext:h}){if(this.results=[],r=r??{},i){const t=this.definition.actions[e].fields;r={...o.mapValues(t,"default"),...r}}this.results=await super.executeAction(e,{event:n.createTestEvent(t),mapping:r,settings:s??{},auth:c,features:u??{},statsContext:l??{},logger:d??{info:a,error:a},dataFeedCache:p??{},transactionContext:f??{},stateContext:h??{}});const m=this.responses;return this.responses=[],m}async testBatchAction(e,{events:t,mapping:r,settings:s,useDefaultMappings:a,auth:i,features:c,statsContext:u,logger:l,dataFeedCache:d,transactionContext:p,stateContext:f}){if(this.results=[],r=r??{},a){const t=this.definition.actions[e].fields;r={...o.mapValues(t,"default"),...r}}t&&t.length||(t=[{type:"track"}]),this.results=await super.executeBatch(e,{events:t.map((e=>n.createTestEvent(e))),mapping:r,settings:s??{},auth:i,features:c??{},statsContext:u??{},logger:l??{},dataFeedCache:d??{},transactionContext:p??{},stateContext:f??{}});const h=this.responses;return this.responses=[],h}}t.createTestIntegration=function(e){return new i(e)}},5796:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultValues=void 0,t.defaultValues=function(e){const t={};for(const r of Object.keys(e)){const n=e[r].default;void 0!==n&&(t[r]=n)}return t}},2054:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Action=t.hookTypeStrings=void 0;const s=r(2699),o=n(r(2715)),a=r(5862),i=r(6565),c=r(3506),u=r(9446),l=r(816),d=r(2848);t.hookTypeStrings=["onMappingSave","retlOnMappingSave"];class p extends s.EventEmitter{constructor(e,t,r){if(super(),this.definition=t,this.destinationName=e,this.extendRequest=r,this.hasBatchSupport="function"==typeof t.performBatch,this.hasHookSupport=void 0!==t.hooks,Object.keys(t.fields??{}).length&&(this.schema=i.fieldsToJsonSchema(t.fields)),t.hooks)for(const e in t.hooks){const r=t.hooks[e];if(r?.inputFields){this.hookSchemas||(this.hookSchemas={});const t={};for(const e in r.inputFields){const n=r.inputFields[e];n.dynamic?t[e]={...n,dynamic:!0}:t[e]={...n,dynamic:!1}}this.hookSchemas[e]=i.fieldsToJsonSchema(t)}}}async execute(e){const t=[];let r=a.transform(e.mapping,e.data);if(t.push({output:"Mappings resolved"}),r=d.removeEmptyValues(r,this.schema,!0),this.schema){const n=`${this.destinationName}:${this.definition.title}`;u.validateSchema(r,this.schema,{schemaKey:n,statsContext:e.statsContext}),t.push({output:"Payload validated"})}let n={};if(this.definition.hooks)for(const t in this.definition.hooks){const r=e.mapping?.[t];r&&(n={...n,[t]:r})}const s={rawData:e.data,rawMapping:e.mapping,settings:e.settings,payload:r,auth:e.auth,features:e.features,statsContext:e.statsContext,logger:e.logger,dataFeedCache:e.dataFeedCache,transactionContext:e.transactionContext,stateContext:e.stateContext,audienceSettings:e.audienceSettings,hookOutputs:n},o=await this.performRequest(this.definition.perform,s);return t.push({data:o,output:"Action Executed"}),t}async executeBatch(e){const t=[{output:"Action Executed"}];if(!this.hasBatchSupport)throw new l.IntegrationError("This action does not support batched requests.","NotImplemented",501);let r=a.transformBatch(e.mapping,e.data);if(this.schema){const t=this.schema,n={schemaKey:`${this.destinationName}:${this.definition.title}`,throwIfInvalid:!1,statsContext:e.statsContext};r=r.map((e=>d.removeEmptyValues(e,t))).filter((e=>u.validateSchema(e,t,n)))}let n={};if(this.definition.hooks)for(const t in this.definition.hooks){const r=e.mapping?.[t];r&&(n={...n,[t]:r})}if(0===r.length)return t;if(this.definition.performBatch){const s={rawData:e.data,rawMapping:e.mapping,settings:e.settings,audienceSettings:e.audienceSettings,payload:r,auth:e.auth,features:e.features,statsContext:e.statsContext,logger:e.logger,dataFeedCache:e.dataFeedCache,transactionContext:e.transactionContext,stateContext:e.stateContext,hookOutputs:n},o=await this.performRequest(this.definition.performBatch,s);return t[0].data=o,t}return t}async executeDynamicField(e,t,r){let n;return n=r&&"function"==typeof r?r:this.definition.dynamicFields?.[e],"function"!=typeof n?Promise.resolve({choices:[],nextPage:"",error:{message:`No dynamic field named ${e} found.`,code:"404"}}):await this.performRequest(n,t)}async executeHook(e,t){if(!this.hasHookSupport)throw new l.IntegrationError("This action does not support any hooks.","NotImplemented",501);const r=this.definition.hooks?.[e]?.performHook;if(!r)throw new l.IntegrationError(`Missing implementation for hook: ${e}.`,"NotImplemented",501);if(this.hookSchemas?.[e]){const r=this.hookSchemas[e];u.validateSchema(t.hookInputs,r)}return await this.performRequest(r,t)}async performRequest(e,t){const r=this.createRequestClient(t),n=await e(r,t);return this.parseResponse(n)}createRequestClient(e){const t=this.extendRequest?.(e)??{};return o.default(t,{afterResponse:[this.afterResponse.bind(this)],statsContext:e.statsContext})}afterResponse(e,t,r){const n=r;return n.request=e,n.options=t,this.emit("response",n),n}parseResponse(e){return e instanceof c.Response?e.data??e.content:e}}t.Action=p},6565:(e,t)=>{"use strict";function r(e){switch(e){case"string":case"text":case"password":return"string";case"datetime":return["string","number"];default:return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.fieldsToJsonSchema=void 0,t.fieldsToJsonSchema=function e(t={},n){const s=[],o={};for(const[a,i]of Object.entries(t)){const t=r(i.type);let c={title:i.label,description:i.description,type:t,format:i.format,default:i.default};"datetime"===i.type?(c.format="date-like",n?.tsType&&(c.tsType="string | number")):"password"===i.type?c.format="password":"text"===i.type&&(c.format="text"),i.choices&&(c.enum=i.choices.map((e=>"string"==typeof e?e:e.value))),"allowNull"in i&&i.allowNull&&(c.type=[].concat(t,"null"),c.enum&&(c.enum=[...c.enum,null]),"string"!=typeof c.tsType||c.tsType.includes("null")||(c.tsType+=" | null"));const u="multiple"in i&&i.multiple;u&&(c.items={type:t},c.type="array",c.enum&&(c.items.enum=c.enum,delete c.enum)),"object"===t&&i.properties&&(u?c.items=e(i.properties,{additionalProperties:i?.additionalProperties||!1}):c={...c,...e(i.properties,{additionalProperties:i?.additionalProperties||!1})}),o[a]=c,i.required&&s.push(a)}return{$schema:"http://json-schema.org/schema#",type:"object",additionalProperties:n?.additionalProperties||!1,properties:o,required:s}}},7537:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Destination=t.fieldsToJsonSchema=t.hookTypeStrings=void 0;const s=r(4625),o=r(2054);Object.defineProperty(t,"hookTypeStrings",{enumerable:!0,get:function(){return o.hookTypeStrings}});const a=r(7305),i=r(6565);Object.defineProperty(t,"fieldsToJsonSchema",{enumerable:!0,get:function(){return i.fieldsToJsonSchema}});const c=n(r(2715)),u=r(9446),l=r(816),d=r(5232),p=r(9101),f=e=>"createAudience"in e&&"getAudience"in e;t.Destination=class{constructor(e){this.definition=e,this.name=e.name,this.extendRequest=e.extendRequest,this.actions={},this.authentication=e.authentication,this.responses=[],this.definition.onDelete&&(this.onDelete=this._onDelete),this.authentication?.fields&&(this.settingsSchema=i.fieldsToJsonSchema(this.authentication.fields));for(const t of Object.keys(e.actions))this.partnerAction(t,e.actions[t])}validateSettings(e){if(this.settingsSchema)try{u.validateSchema(e,this.settingsSchema,{schemaKey:`${this.name}:settings`})}catch(e){const t=e;throw"AggregateAjvError"!==t.name&&"ValidationError"!==t.name||(t.status=400),t}}async createAudience(e){const t=this.definition;if(!f(t.audienceConfig))throw new Error("Unexpected call to createAudience");const r=this.getDestinationSettings(e.settings),n=d.getAuthData(e.settings),s={audienceSettings:e.audienceSettings,settings:r,payload:void 0,auth:n},o=this.extendRequest?.(s)??{},a=c.default({...o,statsContext:s.statsContext});return t.audienceConfig?.createAudience(a,e)}async getAudience(e){const t=this.definition;if(!f(t.audienceConfig))throw new Error("Unexpected call to getAudience");const r=this.getDestinationSettings(e.settings),n=d.getAuthData(e.settings),s={audienceSettings:e.audienceSettings,settings:r,payload:void 0,auth:n},o=this.extendRequest?.(s)??{},a=c.default({...o,statsContext:s.statsContext});return t.audienceConfig?.getAudience(a,e)}async testAuthentication(e){const t=this.getDestinationSettings(e),r=d.getAuthData(e),n={settings:t,auth:r},s={settings:t,payload:void 0,auth:r};if(this.validateSettings(t),!this.authentication?.testAuthentication)return;const o=this.extendRequest?.(s)??{},a=c.default({...o,statsContext:s.statsContext});try{await this.authentication.testAuthentication(a,n)}catch(e){throw new Error(`Credentials are invalid: ${e?.response?.status??""} ${e.message}`)}}async refreshAccessToken(e,t,r){if("oauth2"!==this.authentication?.scheme&&"oauth-managed"!==this.authentication?.scheme)throw new l.IntegrationError("refreshAccessToken is only valid with oauth2 authentication scheme","NotImplemented",501);const n={settings:e,payload:void 0,auth:d.getAuthData(e)},s=this.extendRequest?.(n)??{},o=c.default({...s,statsContext:n.statsContext});if(this.authentication?.refreshAccessToken)return await(r?.()),this.authentication.refreshAccessToken(o,{settings:e,auth:t})}partnerAction(e,t){const r=new o.Action(this.name,t,this.extendRequest);return r.on("response",(e=>{e&&this.responses.push(e)})),this.actions[e]=r,this}async executeAction(e,{event:t,mapping:r,settings:n,auth:s,features:o,statsContext:a,logger:i,dataFeedCache:c,transactionContext:u,stateContext:l}){const d=this.actions[e];if(!d)return[];let p={};return t.context?.personas&&(p=t.context?.personas?.audience_settings),d.execute({mapping:r,data:t,settings:n,audienceSettings:p,auth:s,features:o,statsContext:a,logger:i,dataFeedCache:c,transactionContext:u,stateContext:l})}async executeBatch(e,{events:t,mapping:r,settings:n,auth:s,features:o,statsContext:a,logger:i,dataFeedCache:c,transactionContext:u,stateContext:l}){const d=this.actions[e];if(!d)return[];let p={};return t[0].context?.personas&&(p=t[0].context?.personas?.audience_settings),d.executeBatch({mapping:r,data:t,settings:n,audienceSettings:p,auth:s,features:o,statsContext:a,logger:i,dataFeedCache:c,transactionContext:u,stateContext:l})}async executeDynamicField(e,t,r,n){const s=this.actions[e];return s?s.executeDynamicField(t,r,n):[]}async onSubscription(e,t,r,n,o){const i=a.time(),c=e.partnerAction,u={mapping:e.mapping||{},settings:r,auth:n,features:o?.features||{},statsContext:o?.statsContext||{},logger:o?.logger,dataFeedCache:o?.dataFeedCache,transactionContext:o?.transactionContext,stateContext:o?.stateContext};let l=null;try{if(!e.subscribe||"string"!=typeof e.subscribe)return l=[{output:"invalid subscription"}],l;const r=s.parseFql(e.subscribe);if(r.error)return l=[{output:`invalid subscription : ${r.error.message}`}],l;const n=Array.isArray(t),d=(n?t:[t]).filter((e=>s.validate(r,e)));return 0===d.length?(l=[{output:"not subscribed"}],l):n?await this.executeBatch(c,{...u,events:d}):await this.executeAction(c,{...u,event:d[0]})}catch(e){const t=e;throw l=[{error:{message:t.message}}],"AggregateAjvError"!==t.name&&"ValidationError"!==t.name||(t.status=400),t}finally{const r=a.time(),n=a.duration(i,r);o?.onComplete?.({duration:n,destination:this.name,action:c,subscribe:e.subscribe,input:{data:t,mapping:u.mapping,settings:u.settings},output:l})}}onEvent(e,t,r){return this.onSubscriptions(e,t,r)}onBatch(e,t,r){return this.onSubscriptions(e,t,r)}async _onDelete(e,t,r){const{userId:n,anonymousId:s}=e,o={userId:n,anonymousId:s},a=this.getDestinationSettings(t);this.validateSettings(a);const i=d.getAuthData(t),u={payload:o,settings:a,auth:i},f={settings:a,payload:o,auth:i},h=this.extendRequest?.(f)??{},m=c.default({...h,statsContext:f.statsContext});return await p.retry((async()=>await(this.definition.onDelete?.(m,u))??{output:"no onDelete defined"}),{retries:2,onFailedAttempt:async e=>{if(401!==(e?.status??e?.response?.status??500)||"oauth2"!==this.authentication?.scheme&&"oauth-managed"!==this.authentication?.scheme)throw e;const n=d.getOAuth2Data(t),s=await this.refreshAccessToken(a,n,r?.synchronizeRefreshAccessToken);if(!s)throw new l.InvalidAuthenticationError("Failed to refresh access token",l.ErrorCodes.OAUTH_REFRESH_FAILED);t=d.updateOAuthSettings(t,s),await(r?.onTokenRefresh?.(s))}})}async onSubscriptions(e,t,r){const n=this.getSubscriptions(t),s=this.getDestinationSettings(t);this.validateSettings(s);return await p.retry((async()=>{const o=d.getAuthData(t),a=n.map((t=>this.onSubscription(t,e,s,o,r))),i=await Promise.all(a);return[].concat(...i)}),{retries:2,onFailedAttempt:async e=>{if(401!==(e?.status??e?.response?.status??500)||"oauth2"!==this.authentication?.scheme&&"oauth-managed"!==this.authentication?.scheme)throw e;const n=d.getOAuth2Data(t),o=await this.refreshAccessToken(s,n,r?.synchronizeRefreshAccessToken);if(!o)throw new l.InvalidAuthenticationError("Failed to refresh access token",l.ErrorCodes.OAUTH_REFRESH_FAILED);t=d.updateOAuthSettings(t,o),await(r?.onTokenRefresh?.(o))}})}getSubscriptions(e){const{subscription:t,subscriptions:r}=e;let n;return n=t?[t]:Array.isArray(r)?r:[],n}getDestinationSettings(e){const{subcription:t,subscriptions:r,oauth:n,...s}=e;return s}}},5232:(e,t)=>{"use strict";function r(e){const{oauth:t}=e;return{accessToken:t?.access_token,refreshToken:t?.refresh_token,clientId:t?.clientId,clientSecret:t?.clientSecret,refreshTokenUrl:t?.refresh_token_url}}Object.defineProperty(t,"__esModule",{value:!0}),t.updateOAuthSettings=t.getOAuth2Data=t.getAuthData=void 0,t.getAuthData=function(e){const t=r(e);return{accessToken:t.accessToken,refreshToken:t.refreshToken,refreshTokenUrl:t.refreshTokenUrl}},t.getOAuth2Data=r,t.updateOAuthSettings=function(e,t){const{oauth:r,...n}=e;if(r){const e=r;e.access_token=t.accessToken,t.refreshToken&&(e.refresh_token=t.refreshToken),n.oauth=e}return n}},816:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCodes=t.SelfTimeoutError=t.APIError=t.PayloadValidationError=t.InvalidAuthenticationError=t.RetryableError=t.IntegrationError=void 0;const n=r(2501);class s extends n.CustomError{constructor(e,t,r){super(e),this.status=r,this.code=t}}t.IntegrationError=s;class o extends n.CustomError{constructor(e="",t=500){super(e),this.code=i.RETRYABLE_ERROR,this.status=t}}t.RetryableError=o;class a extends n.CustomError{constructor(e="",t=i.INVALID_AUTHENTICATION){super(e),this.status=401,this.code=t}}t.InvalidAuthenticationError=a;t.PayloadValidationError=class extends s{constructor(e){super(e,i.PAYLOAD_VALIDATION_FAILED,400)}};t.APIError=class extends s{constructor(e,t){super(e,t.toString(),t)}};var i;t.SelfTimeoutError=class extends s{constructor(e){super(e,i.SELF_TIMEOUT,408)}},function(e){e.INVALID_AUTHENTICATION="INVALID_AUTHENTICATION",e.PAYLOAD_VALIDATION_FAILED="PAYLOAD_VALIDATION_FAILED",e.INVALID_CURRENCY_CODE="INVALID_CURRENCY_CODE",e.RETRYABLE_ERROR="RETRYABLE_ERROR",e.REFRESH_TOKEN_EXPIRED="REFRESH_TOKEN_EXPIRED",e.OAUTH_REFRESH_FAILED="OAUTH_REFRESH_FAILED",e.SELF_TIMEOUT="SELF_TIMEOUT"}(i=t.ErrorCodes||(t.ErrorCodes={}))},3506:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Response=t.Request=t.Headers=void 0;const a=o(r(3033));Object.defineProperty(t,"Headers",{enumerable:!0,get:function(){return a.Headers}}),Object.defineProperty(t,"Request",{enumerable:!0,get:function(){return a.Request}}),Object.defineProperty(t,"Response",{enumerable:!0,get:function(){return a.Response}}),t.default=a.default},3115:(e,t)=>{"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.get=void 0;try{r=new RegExp("\\[(?=\"|'|\\d)|\\.|(?<=\"|'|\\d)]+","g")}catch(e){r=/\[|\.|]+/g}t.get=function(e,t){if(""===t||"."===t)return e;if(null===t||null==t)return;return(Array.isArray(t)?t:t.split(r).filter((e=>e)).map((e=>e.replace(/'|"/g,"")))).reduce(((e,t)=>e&&e[t]),e)}},5333:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Headers=t.Response=t.Request=t.fetch=t.DEFAULT_REQUEST_TIMEOUT=t.HTTPError=t.isString=t.isArray=t.isObject=t.realTypeOf=t.duration=t.time=t.removeUndefined=t.omit=t.get=t.ErrorCodes=t.APIError=t.SelfTimeoutError=t.PayloadValidationError=t.RetryableError=t.InvalidAuthenticationError=t.IntegrationError=t.defaultValues=t.createInstance=t.createTestIntegration=t.createTestEvent=t.isJSONDirective=t.isTemplateDirective=t.isReplaceDirective=t.isPathDirective=t.isLiteralDirective=t.isIfDirective=t.isDirective=t.isCaseDirective=t.isArrayPathDirective=t.getFieldValueKeys=t.getFieldValue=t.transform=t.getAuthData=t.fieldsToJsonSchema=t.Destination=void 0;var s=r(7537);Object.defineProperty(t,"Destination",{enumerable:!0,get:function(){return s.Destination}}),Object.defineProperty(t,"fieldsToJsonSchema",{enumerable:!0,get:function(){return s.fieldsToJsonSchema}});var o=r(5232);Object.defineProperty(t,"getAuthData",{enumerable:!0,get:function(){return o.getAuthData}});var a=r(5862);Object.defineProperty(t,"transform",{enumerable:!0,get:function(){return a.transform}});var i=r(2399);Object.defineProperty(t,"getFieldValue",{enumerable:!0,get:function(){return i.getFieldValue}}),Object.defineProperty(t,"getFieldValueKeys",{enumerable:!0,get:function(){return i.getFieldValueKeys}}),Object.defineProperty(t,"isArrayPathDirective",{enumerable:!0,get:function(){return i.isArrayPathDirective}}),Object.defineProperty(t,"isCaseDirective",{enumerable:!0,get:function(){return i.isCaseDirective}}),Object.defineProperty(t,"isDirective",{enumerable:!0,get:function(){return i.isDirective}}),Object.defineProperty(t,"isIfDirective",{enumerable:!0,get:function(){return i.isIfDirective}}),Object.defineProperty(t,"isLiteralDirective",{enumerable:!0,get:function(){return i.isLiteralDirective}}),Object.defineProperty(t,"isPathDirective",{enumerable:!0,get:function(){return i.isPathDirective}}),Object.defineProperty(t,"isReplaceDirective",{enumerable:!0,get:function(){return i.isReplaceDirective}}),Object.defineProperty(t,"isTemplateDirective",{enumerable:!0,get:function(){return i.isTemplateDirective}}),Object.defineProperty(t,"isJSONDirective",{enumerable:!0,get:function(){return i.isJSONDirective}});var c=r(6810);Object.defineProperty(t,"createTestEvent",{enumerable:!0,get:function(){return c.createTestEvent}});var u=r(9751);Object.defineProperty(t,"createTestIntegration",{enumerable:!0,get:function(){return u.createTestIntegration}});var l=r(2748);Object.defineProperty(t,"createInstance",{enumerable:!0,get:function(){return n(l).default}});var d=r(5796);Object.defineProperty(t,"defaultValues",{enumerable:!0,get:function(){return d.defaultValues}});var p=r(816);Object.defineProperty(t,"IntegrationError",{enumerable:!0,get:function(){return p.IntegrationError}}),Object.defineProperty(t,"InvalidAuthenticationError",{enumerable:!0,get:function(){return p.InvalidAuthenticationError}}),Object.defineProperty(t,"RetryableError",{enumerable:!0,get:function(){return p.RetryableError}}),Object.defineProperty(t,"PayloadValidationError",{enumerable:!0,get:function(){return p.PayloadValidationError}}),Object.defineProperty(t,"SelfTimeoutError",{enumerable:!0,get:function(){return p.SelfTimeoutError}}),Object.defineProperty(t,"APIError",{enumerable:!0,get:function(){return p.APIError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return p.ErrorCodes}});var f=r(3115);Object.defineProperty(t,"get",{enumerable:!0,get:function(){return f.get}});var h=r(8179);Object.defineProperty(t,"omit",{enumerable:!0,get:function(){return h.omit}});var m=r(3684);Object.defineProperty(t,"removeUndefined",{enumerable:!0,get:function(){return m.removeUndefined}});var y=r(7305);Object.defineProperty(t,"time",{enumerable:!0,get:function(){return y.time}}),Object.defineProperty(t,"duration",{enumerable:!0,get:function(){return y.duration}});var g=r(7309);Object.defineProperty(t,"realTypeOf",{enumerable:!0,get:function(){return g.realTypeOf}}),Object.defineProperty(t,"isObject",{enumerable:!0,get:function(){return g.isObject}}),Object.defineProperty(t,"isArray",{enumerable:!0,get:function(){return g.isArray}}),Object.defineProperty(t,"isString",{enumerable:!0,get:function(){return g.isString}});var v=r(2748);Object.defineProperty(t,"HTTPError",{enumerable:!0,get:function(){return v.HTTPError}}),Object.defineProperty(t,"DEFAULT_REQUEST_TIMEOUT",{enumerable:!0,get:function(){return v.DEFAULT_REQUEST_TIMEOUT}});var b=r(3506);Object.defineProperty(t,"fetch",{enumerable:!0,get:function(){return n(b).default}}),Object.defineProperty(t,"Request",{enumerable:!0,get:function(){return b.Request}}),Object.defineProperty(t,"Response",{enumerable:!0,get:function(){return b.Response}}),Object.defineProperty(t,"Headers",{enumerable:!0,get:function(){return b.Headers}})},5814:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapValues=void 0,t.mapValues=function(e,t){return Object.entries(e).reduce(((e,[r,n])=>(e[r]=n[t],e)),{})}},8732:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenObject=void 0;const n=r(7309);t.flattenObject=(e,r="",s=".")=>n.isObject(e)||n.isArray(e)?Object.entries(e).reduce(((e,[n,o])=>{const a=r?`${r}${s}${n}`:n;return{...e,...t.flattenObject(o,a,s)}}),{}):{[r]:e}},5862:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.transformBatch=t.transform=t.MAX_REPLACEMENT_LENGTH=t.MAX_PATTERN_LENGTH=void 0;const s=r(3115),o=r(2837),a=r(6305),i=r(7309),c=r(3684),u=n(r(5474)),l=r(6943),d=r(8732),p={},f=/^@[a-z][a-zA-Z0-9]+$/;function h(e,t){if(!f.exec(e))throw new Error(`"${e}" is an invalid directive name`);p[e]=t}function m(e,t){h(e,((r,n)=>{const s=g(r,n);if("string"!=typeof s)throw new Error(`${e}: expected string, got ${i.realTypeOf(s)}`);return t(s,n)}))}function y(e,r,n,s){if(r.length>t.MAX_PATTERN_LENGTH)throw new Error(`@replace requires a "pattern" less than ${t.MAX_PATTERN_LENGTH} characters`);if(n.length>t.MAX_REPLACEMENT_LENGTH)throw new Error(`@replace requires a "replacement" less than ${t.MAX_REPLACEMENT_LENGTH} characters`);return r=r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),e.replace(new RegExp(r,s),n)}function g(e,t){if(!i.isObject(e)&&!i.isArray(e))return e;if(o.isDirective(e))return function(e,t){const r=Object.keys(e).find((e=>e.startsWith("@"))),n=p[r],s=e[r];if("function"!=typeof n)throw new Error(`${r} is not a valid directive, got ${i.realTypeOf(n)}`);return n(s,t)}(e,t);if(Array.isArray(e))return e.map((e=>g(e,t)));const r={};for(const n of Object.keys(e))r[n]=g(e[n],t);return r}h("@if",((e,t)=>{let r=!1;if(!i.isObject(e))throw new Error('@if requires an object with an "exists" key');if(!e.exists&&!e.blank)throw new Error('@if requires an "exists" key or a "blank" key');if(void 0!==e.exists){const n=g(e.exists,t);r=null!=n}else if(void 0!==e.blank){const n=g(e.blank,t);r=null!=n&&""!=n}return r&&void 0!==e.then?g(e.then,t):!r&&e.else?g(e.else,t):void 0})),h("@case",((e,t)=>{if(!i.isObject(e))throw new Error('@case requires an object with a "operator" key');if(!e.operator)throw new Error('@case requires a "operator" key');const r=e.operator;if(e.value){const n=g(e.value,t);if("string"==typeof n)switch(r){case"lower":return n.toLowerCase();case"upper":return n.toUpperCase();default:throw new Error('operator key should have a value of "lower" or "upper"')}return n}})),t.MAX_PATTERN_LENGTH=10,t.MAX_REPLACEMENT_LENGTH=10,h("@replace",((e,t)=>{if(!i.isObject(e))throw new Error('@replace requires an object with a "pattern" key');if(!e.pattern)throw new Error('@replace requires a "pattern" key');null==e.replacement&&(e.replacement=""),e.pattern2&&null==e.replacement2&&(e.replacement2=""),null==e.ignorecase&&(e.ignorecase=!1),null==e.global&&(e.global=!0);const r=e.pattern,n=e.replacement,s=e.ignorecase,o=e.global;if(e.value){let a=g(e.value,t),i="";if("boolean"!=typeof a&&"number"!=typeof a||(a=String(a)),"string"==typeof a&&"string"==typeof r&&"string"==typeof n&&"boolean"==typeof s&&"boolean"==typeof o){let t="";o&&(t+="g"),s&&(t+="i"),i=y(a,r,n,t),e.pattern2&&"string"==typeof e.pattern2&&"string"==typeof e.replacement2&&(i=y(i,e.pattern2,e.replacement2,t))}return i}})),h("@arrayPath",((e,t)=>{if(!Array.isArray(e))throw new Error(`@arrayPath expected array, got ${i.realTypeOf(e)}`);const[r,n]=e,o="string"==typeof r?s.get(t,r.replace("$.","")):g(r,t);return["object","array"].includes(i.realTypeOf(o))&&"object"===i.realTypeOf(n)&&Object.keys(n).length>0?l.arrify(o).map((e=>g(n,e))):o})),m("@path",((e,t)=>s.get(t,e.replace("$.","")))),m("@template",((e,t)=>a.render(e,t))),h("@literal",((e,t)=>g(e,t))),h("@flatten",((e,t)=>{if(!i.isObject(e))throw new Error('@flatten requires an object with a "separator" key');if(!e.separator)throw new Error('@flatten requires a "separator" key');const r=g(e.separator,t);if("string"!=typeof r)throw new Error("@flatten requires a string separator");const n=g(e.value,t);return d.flattenObject(n,"",r)})),h("@json",((e,t)=>{if(!i.isObject(e))throw new Error('@json requires an object with a "value" key');if(!e.mode)throw new Error('@json requires a "mode" key');if(!e.value)throw new Error('@json requires a "value" key');const r=g(e.value,t);return"encode"===e.mode?JSON.stringify(r):"decode"===e.mode?"string"==typeof r?JSON.parse(r):r:void 0})),h("@merge",((e,t)=>{if(!i.isObject(e))throw new Error('@merge requires an object with an "objects" key and a "direction" key');if(!e.direction)throw new Error('@merge requires a "direction" key');const r=g(e.direction,t);if(!e.objects)throw new Error('@merge requires a "objects" key');if(!Array.isArray(e.objects))throw new Error("@merge: expected opts.array, got "+typeof e.objects);const n=e.objects.map((e=>g(e,t)));return"left"===r&&n.reverse(),Object.assign({},...n)})),t.transform=function(e,t={}){const r=i.realTypeOf(t);if("object"!==r)throw new Error(`data must be an object, got ${r}`);u.default(e);const n=g(e,t);return c.removeUndefined(n)},t.transformBatch=function(e,t=[]){const r=i.realTypeOf(t);if(!i.isArray(t))throw new Error(`data must be an array, got ${r}`);u.default(e);const n=t.map((t=>g(e,t)));return c.removeUndefined(n)}},2837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDirective=void 0;const n=r(7309);t.isDirective=function(e){if(!n.isObject(e))return!1;const t=Object.keys(e);return!!t.some((e=>e.startsWith("@")))&&0===t.filter((e=>!e.startsWith("@")&&"_metadata"!==e)).length}},6305:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.render=void 0;const n=r(3115),s=r(7309);t.render=function(e,t={}){if("string"!=typeof e)throw new TypeError(`Invalid template! Template should be a "string" but ${s.realTypeOf(e)} was given.`);function r(e){return r=>{r=r.slice(e,-e).trim();return n.get(t,r)??""}}return e.replace(/\{\{\{([^}]+)\}\}\}/g,r(3)).replace(/\{\{([^}]+)\}\}/g,r(2))}},5474:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(r(1291)),o=r(2501),a=r(2837),i=r(7309),c=r(5862);class u extends o.CustomError{constructor(e,t=[]){super(`/${t.join("/")} ${e}.`)}}function l(e){const t=[];return e.forEach((e=>{e instanceof s.default?t.push(...e):t.push(e)})),t}function d(e){const t=i.realTypeOf(e);return"object"===t&&Object.keys(e).some((e=>e.startsWith("@")))?"directive":t}const p={};function f(e,t=[]){if(!a.isDirective(e)&&!i.isObject(e)){const r=i.realTypeOf(e);throw new u(`should be a directive object but it is ${O(r)} ${r}`,t)}const r=Object.keys(e),n=r.filter((e=>e.startsWith("@")));if(n.length>1)throw new u(`should only have one @-prefixed key but it has ${n.length} keys`,t);if(r.filter((e=>!e.startsWith("@")&&"_metadata"!==e)).length>0)throw new u(`should only have one @-prefixed key but it has ${r.length} keys`,t);const s=n[0],o=p[s];if("function"!=typeof o)throw new u(`has an invalid directive: ${s}`,t);o(e[s],t)}function h(e,t=[]){const r=d(e);switch(r){case"directive":return f(e,t);case"object":case"array":case"boolean":case"string":case"number":case"null":return;default:throw new u(`should be a mapping directive or a JSON value but it is ${O(r)} ${r}`,t)}}function m(e,t=[]){const r=d(e);switch(r){case"directive":return f(e,t);case"string":return;default:throw new u(`should be a string or a mapping directive but it is ${O(r)} ${r}`,t)}}function y(...e){return(t,r=[])=>{e.forEach((e=>{e(t,r)}))}}function g(e,t){return(r,n=[])=>{if("string"==typeof r&&r.length<e)throw new u(`should be a string of length ${e} or greater`,n);if("string"==typeof r&&r.length>t)throw new u(`should be a string of length ${t} or less`,n)}}function v(e,t=[]){const r=d(e);if("string"!==r)throw new u(`should be a string but it is ${O(r)} ${r}`,t)}function b(...e){return(t,r=[])=>{v(t,r);const n=t;if(!e.includes(n.toLowerCase()))throw new u(`should be one of ${e.join(", ")} but it is ${JSON.stringify(n)}`,r)}}function w(e,t=[]){const r=d(e);if("boolean"!==r)throw new u(`should be a boolean but it is ${O(r)} ${r}`,t)}function $(e,t=[]){const r=d(e);if("object"!==r)throw new u(`should be an object but it is ${O(r)} ${r}`,t);const n=e,o=Object.keys(n),a=o.find((e=>"@"===e.charAt(0)));if(a)throw new u(`shouldn't have directive (@-prefixed) keys but it has ${JSON.stringify(a)}`,t);const i=[];if(o.forEach((e=>{try{P(n[e],[...t,e])}catch(e){i.push(e)}})),i.length)throw new s.default(l(i))}function _(e,t,r=[]){$(e,r);const n=[],o=e;if(Object.entries(t).forEach((([e,{required:t,optional:s}])=>{try{if(t){if(void 0===o[e])throw new u(`should have field ${JSON.stringify(e)} but it doesn't`,r);t(o[e],[...r,e])}else s&&void 0!==o[e]&&s(o[e],[...r,e])}catch(e){n.push(e)}})),n.length)throw new s.default(l(n))}function E(e,t=[]){const r=i.realTypeOf(e);if("array"!==r)throw new u(`should be an array but it is ${O(r)} ${r}`,t)}function S(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{p[e]=(r,n=[])=>{try{t(r,[...n,e])}catch(e){const t=e;if(e instanceof u||e instanceof s.default)throw e;throw new u(t.message,n)}}}))}function O(e){switch(e.charAt(0)){case"a":case"e":case"i":case"o":case"u":return"an";default:return"a"}}function P(e,t=[]){switch(d(e)){case"directive":return f(e,t);case"object":return $(e,t);case"array":return E(e,t);default:return null}}S("@if",((e,t)=>{_(e,{exists:{optional:h},then:{optional:h},else:{optional:h}},t)})),S("@case",((e,t)=>{_(e,{operator:{optional:v},value:{optional:m}},t)})),S("@replace",((e,t)=>{_(e,{pattern:{required:y(v,g(1,c.MAX_PATTERN_LENGTH))},replacement:{optional:y(v,g(0,c.MAX_REPLACEMENT_LENGTH))},value:{required:m},ignorecase:{optional:w},global:{optional:w}},t)})),S("@arrayPath",((e,t)=>{const r=e;E(r,t),m(r[0],t),P(r[1],t)})),S("@path",((e,t)=>{m(e,t)})),S("@json",((e,t)=>{_(e,{value:{required:h},mode:{required:b("encode","decode")}},t)})),S("@flatten",((e,t)=>{_(e,{separator:{optional:v},value:{required:h}},t)})),S("@merge",((e,t)=>{_(e,{direction:{optional:b("left","right")},objects:{required:E}},t);e.objects.forEach((e=>{!function(e,t=[]){const r=d(e);switch(r){case"directive":return f(e,t);case"object":return $(e,t);default:throw new u(`should be a object or a mapping directive but it is ${O(r)} ${r}`,t)}}(e)}))})),S("@template",((e,t)=>{m(e,t)})),S("@literal",((e,t)=>{h(e,t)})),t.default=P},2399:(e,t)=>{"use strict";function r(e){return null!==e&&"object"==typeof e}function n(e){return null!==e&&"object"==typeof e&&Object.keys(e).some((e=>["@if","@path","@template","@literal","@arrayPath","@case","@replace","@json","@flatten","@merge"].includes(e)))}function s(e){return n(e)&&"@literal"in e}function o(e){return n(e)&&"@template"in e}function a(e){return n(e)&&"@path"in e}function i(e){return n(e)&&"@if"in e&&null!==e["@if"]&&"object"==typeof e["@if"]&&("exists"in e["@if"]||"blank"in e["@if"])}function c(e){return n(e)&&"@arrayPath"in e&&Array.isArray(e["@arrayPath"])}function u(e){return n(e)&&"@case"in e&&null!==e["@case"]&&"object"==typeof e["@case"]&&"operator"in e["@case"]}function l(e){return n(e)&&"@replace"in e&&null!==e["@replace"]&&"object"==typeof e["@replace"]&&"pattern"in e["@replace"]}function d(e){return n(e)&&"@json"in e&&null!==e["@json"]&&"object"==typeof e["@json"]&&"value"in e["@json"]}function p(e){return n(e)&&"@flatten"in e&&null!==e["@flatten"]&&"object"==typeof e["@flatten"]&&"value"in e["@flatten"]}function f(e){return n(e)?(t=e,y={"@arrayPath":e=>e["@arrayPath"].flatMap(h),"@case":e=>h(e["@case"].value),"@if":e=>[...h(e["@if"].blank),...h(e["@if"].exists),...h(e["@if"].then),...h(e["@if"].else)],"@literal":e=>[""],"@path":e=>[e["@path"]],"@replace":e=>h(e["@replace"].value),"@template":e=>m(e["@template"]),"@json":e=>h(e["@json"].value),"@flatten":e=>h(e["@flatten"].value),"@merge":e=>h(e["@merge"].objects)},c(t)?y["@arrayPath"](t):u(t)?y["@case"](t):i(t)?y["@if"](t):s(t)?y["@literal"](t):a(t)?y["@path"](t):l(t)?y["@replace"](t):o(t)?y["@template"](t):d(t)?y["@json"](t):p(t)?y["@flatten"](t):null)?.filter((e=>e))??[]:r(e)?Object.values(e).flatMap(f):[];var t,y}function h(e){return n(e)?f(e):r(e)?Object.values(e).flatMap(f):[]}function m(e){return Array.from(e.matchAll(/{{(.*?)}}/g),(e=>e[1]))}Object.defineProperty(t,"__esModule",{value:!0}),t.getTemplateKeys=t.getRawKeys=t.getFieldValueKeys=t.isMergeDirective=t.isFlattenDirective=t.isJSONDirective=t.isReplaceDirective=t.isCaseDirective=t.isArrayPathDirective=t.isIfDirective=t.isPathDirective=t.getFieldValue=t.isTemplateDirective=t.isLiteralDirective=t.isDirective=void 0,t.isDirective=n,t.isLiteralDirective=s,t.isTemplateDirective=o,t.getFieldValue=function(e){return o(e)?e["@template"]:e},t.isPathDirective=a,t.isIfDirective=i,t.isArrayPathDirective=c,t.isCaseDirective=u,t.isReplaceDirective=l,t.isJSONDirective=d,t.isFlattenDirective=p,t.isMergeDirective=function(e){return n(e)&&"@merge"in e&&null!==e["@merge"]&&"object"==typeof e["@merge"]&&"objects"in e["@merge"]},t.getFieldValueKeys=f,t.getRawKeys=h,t.getTemplateKeys=m},8296:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=async(e,t,r)=>(Object.defineProperty(r.headers,"toJSON",{enumerable:!1,value:()=>(e=>{const t={};for(const[r,n]of e.entries())t[r]=n;return t})(r.headers)}),r)},2930:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=async(e,t,r)=>{const n=t.statsContext?.statsClient,s=r;let o;if(t.skipResponseCloning)o=await r.text();else{n?.incr("before-response-clone",1);const e=r.clone();o=await e.text(),n?.incr("after-response-clone",1)}const a=t.agent;let i;a&&a.destroy();try{i=s.headers.get("content-type")?.includes("application/json")?JSON.parse(o):o}catch(e){}return s.content=o,s.data=i,s}},9909:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(r(3531));t.default=e=>{if(e.username||e.password){const t=e.username||"",r=e.password||"";return{headers:{Authorization:`Basic ${s.default(`${t}:${r}`)}`}}}}},8179:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.omit=void 0,t.omit=function(e,t){return Object.keys(e||{}).reduce(((r,n)=>(-1===t.indexOf(n)&&(r[n]=e[n]),r)),{})}},7309:(e,t)=>{"use strict";function r(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}Object.defineProperty(t,"__esModule",{value:!0}),t.isString=t.isArray=t.isObject=t.realTypeOf=void 0,t.realTypeOf=r,t.isObject=function(e){return"object"===r(e)},t.isArray=function(e){return Array.isArray(e)},t.isString=function(e){return"string"==typeof e}},2848:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmptyValues=void 0;const n=r(7309),s=r(6943);t.removeEmptyValues=function e(t,r={},o=!1){if(!r.type&&!r.enum)return t;if(n.isArray(t))return r.items?t.filter((t=>void 0!==e(t,r.items))):t;if(n.isObject(t)){if(!r.properties)return t;const n={...t};for(const t of Object.keys(n))n[t]=e(n[t],r.properties[t]),void 0===n[t]&&delete n[t],""===n[t]&&o&&delete n[t];return n}const a=s.arrify(r.type);return null===t&&!a.includes("null")||""===t&&!a.includes("string")?void 0:t}},3684:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeUndefined=void 0;const n=r(7309);t.removeUndefined=function e(t){if(Array.isArray(t))return t.map((t=>e(t)));if(n.isObject(t)){const r=Object.assign({},t);return Object.keys(r).forEach((t=>{void 0===r[t]?delete r[t]:r[t]=e(r[t])})),r}return t}},2748:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TimeoutError=t.HTTPError=t.DEFAULT_REQUEST_TIMEOUT=void 0;const i=a(r(7948)),c=r(2501),u=o(r(3506)),l=r(7309);if(null!=globalThis.process&&"object"==typeof globalThis.process.env&&globalThis.process.env.DEFAULT_REQUEST_TIMEOUT){const e=parseInt(globalThis.process.env.DEFAULT_REQUEST_TIMEOUT,10);Number.isNaN(e)}t.DEFAULT_REQUEST_TIMEOUT=1e4;const d=e=>null!==e&&"object"==typeof e;function p(e,t){const r=new u.Headers(e||{});return new u.Headers(t||{}).forEach(((e,t)=>{"undefined"===e?r.delete(t):r.set(t,e)})),r}function f(...e){let t={},r={};for(const n of e){if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(d(n)){for(let[e,r]of Object.entries(n))d(r)&&e in t&&(r=f(t[e],r)),t[e]=r;d(n.headers)&&(r=p(r,n.headers))}t.headers=r}return t}function h(...e){for(const t of e)if(!l.isObject(t))throw new TypeError("The 'options' argument must be an object");return f({},...e)}class m extends c.CustomError{constructor(e,t,r){super(e.statusText??String(e.status??"Unknown response error")),this.response=e,this.request=t,this.options=r}}t.HTTPError=m;class y extends c.CustomError{constructor(e,t){super("Request timed out"),this.request=e,this.options=t,this.code="ETIMEDOUT"}}t.TimeoutError=y;class g{constructor(e,t={}){this.setOptions(e,t)}setOptions(e,r){var n;if(this.options={...r,method:(n=r.method??"get",n.toUpperCase()),throwHttpErrors:!1!==r.throwHttpErrors,timeout:r.timeout??t.DEFAULT_REQUEST_TIMEOUT},this.abortController=new i.default,this.options.signal&&this.options.signal.addEventListener("abort",(()=>{this.abortController.abort()})),this.options.signal=this.abortController.signal,this.request=new u.Request(e,this.options),this.options.searchParams){const e=new URLSearchParams(this.options.searchParams),t=new URL(this.request.url);t.search=e.toString(),this.request=new u.Request(new u.Request(t.toString(),this.request),this.options)}void 0!==this.options.json&&(this.options.body=JSON.stringify(this.options.json),this.request.headers.set("content-type","application/json"),this.request=new u.Request(this.request,{body:this.options.body}))}async executeRequest(){let e=await this.fetch();for(const t of this.options.afterResponse??[]){const r=await t(this.request,this.options,e);r instanceof u.Response&&(e=r)}if(!e.ok&&this.options.throwHttpErrors)throw new m(e,this.request,this.options);return e}async fetch(){for(const e of this.options.beforeRequest??[]){const t=await e({...this.options});t&&l.isObject(t)&&this.setOptions(this.request.url,h(this.options,t))}return!1===this.options.timeout?u.default(this.request.clone()):(e=this.request.clone(),t=this.abortController,r=this.options,new Promise(((n,s)=>{const o=setTimeout((()=>{t&&t.abort(),s(new y(e,r))}),r.timeout);u.default(e).then(n).catch(s).then((()=>clearTimeout(o)))})));var e,t,r}}t.default=function e(t={}){const r=(e,r={})=>new g(e,h(t,r)).executeRequest();return r.extend=r=>e(h(t,r)),r}},9101:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retry=void 0;t.retry=async function(e,t){const r=t?.retries??2;for(let n=1;n<=r;n++)try{return await e(n)}catch(e){if(t?.onFailedAttempt&&await t.onFailedAttempt(e,n),!e||n>=r)throw e}throw new Error("Exhausted all retries.")}},9446:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchema=void 0;const s=r(5375),o=n(r(3944)),a=n(r(3052)),i=n(r(8879)),c=r(6943),u=a.default(new o.default({coerceTypes:"array",allErrors:!0,allowUnionTypes:!0,verbose:!0,removeAdditional:!0}));u.addFormat("text",!0),u.addFormat("date-like",(e=>{let t=i.default(e);return String(Number(e))===e&&(13===e.length&&(t=i.default(Number(e))),t=i.default.unix(Number(e))),t.isValid()})),t.validateSchema=function(e,t,r){const{schemaKey:n,throwIfInvalid:o=!0,statsContext:a}=r??{};let i;i=n?u.getSchema(n)||u.addSchema(t,n).getSchema(n):u.compile(t),c.arrifyFields(e,t);const l=i(e);if(o&&!l&&i.errors)throw a?.statsClient?.incr("ajv.discard",1,a.tags),new s.AggregateAjvError(i.errors);return l}},7305:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.duration=t.time=void 0,t.time=function(){return process.hrtime.bigint()},t.duration=function(e,t){return Number(t-e)/1e6}},7128:(e,t,r)=>{"use strict";let n;r.d(t,{U:()=>s});try{n=new RegExp("\\[(?=\"|'|\\d)|\\.|(?<=\"|'|\\d)]+","g")}catch(e){n=/\[|\.|]+/g}function s(e,t){if(""===t||"."===t)return e;if(null===t||null==t)return;return(Array.isArray(t)?t:t.split(n).filter((e=>e)).map((e=>e.replace(/'|"/g,"")))).reduce(((e,t)=>e&&e[t]),e)}},3807:(e,t,r)=>{"use strict";r.d(t,{tY:()=>N,a8:()=>D,vs:()=>q});var n=r(7128),s=r(6933);function o(e){if(!(0,s.Kn)(e))return!1;const t=Object.keys(e);if(!t.some((e=>e.startsWith("@"))))return!1;return 0===t.filter((e=>!e.startsWith("@")&&"_metadata"!==e)).length}function a(e){if(Array.isArray(e))return e.map((e=>a(e)));if((0,s.Kn)(e)){const t=Object.assign({},e);return Object.keys(t).forEach((e=>{void 0===t[e]?delete t[e]:t[e]=a(t[e])})),t}return e}var i=r(1291),c=r.n(i),u=r(2501);class l extends u.CustomError{constructor(e,t=[]){super(`/${t.join("/")} ${e}.`)}}function d(e){const t=[];return e.forEach((e=>{e instanceof c()?t.push(...e):t.push(e)})),t}function p(e){const t=(0,s.X6)(e);return"object"===t&&Object.keys(e).some((e=>e.startsWith("@")))?"directive":t}const f={};function h(e,t=[]){if(!o(e)&&!(0,s.Kn)(e)){const r=(0,s.X6)(e);throw new l(`should be a directive object but it is ${P(r)} ${r}`,t)}const r=Object.keys(e),n=r.filter((e=>e.startsWith("@")));if(n.length>1)throw new l(`should only have one @-prefixed key but it has ${n.length} keys`,t);if(r.filter((e=>!e.startsWith("@")&&"_metadata"!==e)).length>0)throw new l(`should only have one @-prefixed key but it has ${r.length} keys`,t);const a=n[0],i=f[a];if("function"!=typeof i)throw new l(`has an invalid directive: ${a}`,t);i(e[a],t)}function m(e,t=[]){const r=p(e);switch(r){case"directive":return h(e,t);case"object":case"array":case"boolean":case"string":case"number":case"null":return;default:throw new l(`should be a mapping directive or a JSON value but it is ${P(r)} ${r}`,t)}}function y(e,t=[]){const r=p(e);switch(r){case"directive":return h(e,t);case"string":return;default:throw new l(`should be a string or a mapping directive but it is ${P(r)} ${r}`,t)}}function g(...e){return(t,r=[])=>{e.forEach((e=>{e(t,r)}))}}function v(e,t){return(r,n=[])=>{if("string"==typeof r&&r.length<e)throw new l(`should be a string of length ${e} or greater`,n);if("string"==typeof r&&r.length>t)throw new l(`should be a string of length ${t} or less`,n)}}function b(e,t=[]){const r=p(e);if("string"!==r)throw new l(`should be a string but it is ${P(r)} ${r}`,t)}function w(...e){return(t,r=[])=>{b(t,r);const n=t;if(!e.includes(n.toLowerCase()))throw new l(`should be one of ${e.join(", ")} but it is ${JSON.stringify(n)}`,r)}}function $(e,t=[]){const r=p(e);if("boolean"!==r)throw new l(`should be a boolean but it is ${P(r)} ${r}`,t)}function _(e,t=[]){const r=p(e);if("object"!==r)throw new l(`should be an object but it is ${P(r)} ${r}`,t);const n=e,s=Object.keys(n),o=s.find((e=>"@"===e.charAt(0)));if(o)throw new l(`shouldn't have directive (@-prefixed) keys but it has ${JSON.stringify(o)}`,t);const a=[];if(s.forEach((e=>{try{j(n[e],[...t,e])}catch(e){a.push(e)}})),a.length)throw new(c())(d(a))}function E(e,t,r=[]){_(e,r);const n=[],s=e;if(Object.entries(t).forEach((([e,{required:t,optional:o}])=>{try{if(t){if(void 0===s[e])throw new l(`should have field ${JSON.stringify(e)} but it doesn't`,r);t(s[e],[...r,e])}else o&&void 0!==s[e]&&o(s[e],[...r,e])}catch(e){n.push(e)}})),n.length)throw new(c())(d(n))}function S(e,t=[]){const r=(0,s.X6)(e);if("array"!==r)throw new l(`should be an array but it is ${P(r)} ${r}`,t)}function O(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{f[e]=(r,n=[])=>{try{t(r,[...n,e])}catch(e){const t=e;if(e instanceof l||e instanceof c())throw e;throw new l(t.message,n)}}}))}function P(e){switch(e.charAt(0)){case"a":case"e":case"i":case"o":case"u":return"an";default:return"a"}}function j(e,t=[]){switch(p(e)){case"directive":return h(e,t);case"object":return _(e,t);case"array":return S(e,t);default:return null}}function T(e,t=!0){return null==e?t?[]:e:(0,s.kJ)(e)?e:[e]}O("@if",((e,t)=>{E(e,{exists:{optional:m},then:{optional:m},else:{optional:m}},t)})),O("@case",((e,t)=>{E(e,{operator:{optional:b},value:{optional:y}},t)})),O("@replace",((e,t)=>{E(e,{pattern:{required:g(b,v(1,N))},replacement:{optional:g(b,v(0,D))},value:{required:y},ignorecase:{optional:$},global:{optional:$}},t)})),O("@arrayPath",((e,t)=>{const r=e;S(r,t),y(r[0],t),j(r[1],t)})),O("@path",((e,t)=>{y(e,t)})),O("@json",((e,t)=>{E(e,{value:{required:m},mode:{required:w("encode","decode")}},t)})),O("@flatten",((e,t)=>{E(e,{separator:{optional:b},value:{required:m}},t)})),O("@merge",((e,t)=>{E(e,{direction:{optional:w("left","right")},objects:{required:S}},t);e.objects.forEach((e=>{!function(e,t=[]){const r=p(e);switch(r){case"directive":return h(e,t);case"object":return _(e,t);default:throw new l(`should be a object or a mapping directive but it is ${P(r)} ${r}`,t)}}(e)}))})),O("@template",((e,t)=>{y(e,t)})),O("@literal",((e,t)=>{m(e,t)}));const x=(e,t="",r=".")=>(0,s.Kn)(e)||(0,s.kJ)(e)?Object.entries(e).reduce(((e,[n,s])=>({...e,...x(s,t?`${t}${r}${n}`:n,r)})),{}):{[t]:e},k={},A=/^@[a-z][a-zA-Z0-9]+$/;function C(e,t){if(!A.exec(e))throw new Error(`"${e}" is an invalid directive name`);k[e]=t}function I(e,t){C(e,((r,n)=>{const o=M(r,n);if("string"!=typeof o)throw new Error(`${e}: expected string, got ${(0,s.X6)(o)}`);return t(o,n)}))}C("@if",((e,t)=>{let r=!1;if(!(0,s.Kn)(e))throw new Error('@if requires an object with an "exists" key');if(!e.exists&&!e.blank)throw new Error('@if requires an "exists" key or a "blank" key');if(void 0!==e.exists){const n=M(e.exists,t);r=null!=n}else if(void 0!==e.blank){const n=M(e.blank,t);r=null!=n&&""!=n}return r&&void 0!==e.then?M(e.then,t):!r&&e.else?M(e.else,t):void 0})),C("@case",((e,t)=>{if(!(0,s.Kn)(e))throw new Error('@case requires an object with a "operator" key');if(!e.operator)throw new Error('@case requires a "operator" key');const r=e.operator;if(e.value){const n=M(e.value,t);if("string"==typeof n)switch(r){case"lower":return n.toLowerCase();case"upper":return n.toUpperCase();default:throw new Error('operator key should have a value of "lower" or "upper"')}return n}}));const N=10,D=10;function R(e,t,r,n){if(t.length>N)throw new Error(`@replace requires a "pattern" less than ${N} characters`);if(r.length>D)throw new Error(`@replace requires a "replacement" less than ${D} characters`);return t=t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),e.replace(new RegExp(t,n),r)}function M(e,t){if(!(0,s.Kn)(e)&&!(0,s.kJ)(e))return e;if(o(e))return function(e,t){const r=Object.keys(e).find((e=>e.startsWith("@"))),n=k[r],o=e[r];if("function"!=typeof n)throw new Error(`${r} is not a valid directive, got ${(0,s.X6)(n)}`);return n(o,t)}(e,t);if(Array.isArray(e))return e.map((e=>M(e,t)));const r={};for(const n of Object.keys(e))r[n]=M(e[n],t);return r}function q(e,t={}){const r=(0,s.X6)(t);if("object"!==r)throw new Error(`data must be an object, got ${r}`);j(e);return a(M(e,t))}C("@replace",((e,t)=>{if(!(0,s.Kn)(e))throw new Error('@replace requires an object with a "pattern" key');if(!e.pattern)throw new Error('@replace requires a "pattern" key');null==e.replacement&&(e.replacement=""),e.pattern2&&null==e.replacement2&&(e.replacement2=""),null==e.ignorecase&&(e.ignorecase=!1),null==e.global&&(e.global=!0);const r=e.pattern,n=e.replacement,o=e.ignorecase,a=e.global;if(e.value){let s=M(e.value,t),i="";if("boolean"!=typeof s&&"number"!=typeof s||(s=String(s)),"string"==typeof s&&"string"==typeof r&&"string"==typeof n&&"boolean"==typeof o&&"boolean"==typeof a){let t="";a&&(t+="g"),o&&(t+="i"),i=R(s,r,n,t),e.pattern2&&"string"==typeof e.pattern2&&"string"==typeof e.replacement2&&(i=R(i,e.pattern2,e.replacement2,t))}return i}})),C("@arrayPath",((e,t)=>{if(!Array.isArray(e))throw new Error(`@arrayPath expected array, got ${(0,s.X6)(e)}`);const[r,o]=e,a="string"==typeof r?(0,n.U)(t,r.replace("$.","")):M(r,t);return["object","array"].includes((0,s.X6)(a))&&"object"===(0,s.X6)(o)&&Object.keys(o).length>0?T(a).map((e=>M(o,e))):a})),I("@path",((e,t)=>(0,n.U)(t,e.replace("$.","")))),I("@template",((e,t)=>function(e,t={}){if("string"!=typeof e)throw new TypeError(`Invalid template! Template should be a "string" but ${(0,s.X6)(e)} was given.`);function r(e){return r=>(r=r.slice(e,-e).trim(),(0,n.U)(t,r)??"")}return e.replace(/\{\{\{([^}]+)\}\}\}/g,r(3)).replace(/\{\{([^}]+)\}\}/g,r(2))}(e,t))),C("@literal",((e,t)=>M(e,t))),C("@flatten",((e,t)=>{if(!(0,s.Kn)(e))throw new Error('@flatten requires an object with a "separator" key');if(!e.separator)throw new Error('@flatten requires a "separator" key');const r=M(e.separator,t);if("string"!=typeof r)throw new Error("@flatten requires a string separator");const n=M(e.value,t);return x(n,"",r)})),C("@json",((e,t)=>{if(!(0,s.Kn)(e))throw new Error('@json requires an object with a "value" key');if(!e.mode)throw new Error('@json requires a "mode" key');if(!e.value)throw new Error('@json requires a "value" key');const r=M(e.value,t);return"encode"===e.mode?JSON.stringify(r):"decode"===e.mode?"string"==typeof r?JSON.parse(r):r:void 0})),C("@merge",((e,t)=>{if(!(0,s.Kn)(e))throw new Error('@merge requires an object with an "objects" key and a "direction" key');if(!e.direction)throw new Error('@merge requires a "direction" key');const r=M(e.direction,t);if(!e.objects)throw new Error('@merge requires a "objects" key');if(!Array.isArray(e.objects))throw new Error("@merge: expected opts.array, got "+typeof e.objects);const n=e.objects.map((e=>M(e,t)));return"left"===r&&n.reverse(),Object.assign({},...n)}))},6933:(e,t,r)=>{"use strict";function n(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function s(e){return"object"===n(e)}function o(e){return Array.isArray(e)}r.d(t,{Kn:()=>s,X6:()=>n,kJ:()=>o})},1745:(e,t)=>{"use strict";function r(e,t){return{validate:e,compare:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(o,a),time:r(c,u),"date-time":r((function(e){const t=e.split(l);return 2===t.length&&o(t[0])&&c(t[1],!0)}),d),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return p.test(e)&&f.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(y.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return h.lastIndex=0,h.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=2147483647&&e>=-2147483648}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:m},double:{type:"number",validate:m},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(e){const t=n.exec(e);if(!t)return!1;const r=+t[1],o=+t[2],a=+t[3];return o>=1&&o<=12&&a>=1&&a<=(2===o&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:s[o])}function a(e,t){if(e&&t)return e>t?1:e<t?-1:0}const i=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function c(e,t){const r=i.exec(e);if(!r)return!1;const n=+r[1],s=+r[2],o=+r[3],a=r[5];return(n<=23&&s<=59&&o<=59||23===n&&59===s&&60===o)&&(!t||""!==a)}function u(e,t){if(!e||!t)return;const r=i.exec(e),n=i.exec(t);return r&&n?(e=r[1]+r[2]+r[3]+(r[4]||""))>(t=n[1]+n[2]+n[3]+(n[4]||""))?1:e<t?-1:0:void 0}const l=/t|\s/i;function d(e,t){if(!e||!t)return;const[r,n]=e.split(l),[s,o]=t.split(l),i=a(r,s);return void 0!==i?i||u(n,o):void 0}const p=/\/|:/,f=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;const h=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m(){return!0}const y=/[^\\]\\Z/},3052:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1745),s=r(373),o=r(9143),a=new o.Name("fullFormats"),i=new o.Name("fastFormats"),c=(e,t={keywords:!0})=>{if(Array.isArray(t))return u(e,t,n.fullFormats,a),e;const[r,o]="fast"===t.mode?[n.fastFormats,i]:[n.fullFormats,a];return u(e,t.formats||n.formatNames,r,o),t.keywords&&s.default(e),e};function u(e,t,r,n){var s,a;null!==(s=(a=e.opts.code).formats)&&void 0!==s||(a.formats=o._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,r[n])}c.get=(e,t="full")=>{const r=("fast"===t?n.fastFormats:n.fullFormats)[e];if(!r)throw new Error(`Unknown format "${e}"`);return r},e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c},373:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const n=r(3944),s=r(9143),o=s.operators,a={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},i={message:({keyword:e,schemaCode:t})=>s.str`should be ${a[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>s._`{comparison: ${a[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:i,code(e){const{gen:t,data:r,schemaCode:o,keyword:i,it:c}=e,{opts:u,self:l}=c;if(!u.validateFormats)return;const d=new n.KeywordCxt(c,l.RULES.all.format.definition,"format");function p(e){return s._`${e}.compare(${r}, ${o}) ${a[i].fail} 0`}d.$data?function(){const r=t.scopeValue("formats",{ref:l.formats,code:u.code.formats}),n=t.const("fmt",s._`${r}[${d.schemaCode}]`);e.fail$data(s.or(s._`typeof ${n} != "object"`,s._`${n} instanceof RegExp`,s._`typeof ${n}.compare != "function"`,p(n)))}():function(){const r=d.schema,n=l.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${i}": format "${r}" does not define "compare" function`);const o=t.scopeValue("formats",{key:r,ref:n,code:u.code.formats?s._`${u.code.formats}${s.getProperty(r)}`:void 0});e.fail$data(p(o))}()},dependencies:["format"]};t.default=e=>(e.addKeyword(t.formatLimitDefinition),e)},3944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const n=r(3993),s=r(7578),o=r(242),a=r(2081),i=["/properties"],c="http://json-schema.org/draft-07/schema";class u extends n.default{_addVocabularies(){super._addVocabularies(),s.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(a,i):a;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var l=r(5344);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var d=r(9143);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}})},9782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class s extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function o(e,...t){const r=[e[0]];let n=0;for(;n<t.length;)c(r,t[n]),r.push(e[++n]);return new s(r)}t._Code=s,t.nil=new s(""),t._=o;const a=new s("+");function i(e,...t){const r=[l(e[0])];let n=0;for(;n<t.length;)r.push(a),c(r,t[n]),r.push(a,l(e[++n]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const r=u(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new s(r)}function c(e,t){var r;t instanceof s?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:l(Array.isArray(r)?r.join(","):r))}function u(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function l(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=i,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:i`${e}${t}`},t.stringify=function(e){return new s(l(e))},t.safeStringify=l,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new s(`.${e}`):o`[${e}]`},t.regexpCode=function(e){return new s(e.toString())}},9143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(9782),s=r(8167);var o=r(9782);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}});var a=r(8167);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class i{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends i{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?s.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=A(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class u extends i{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=A(this.rhs,e,t),this}get names(){return k(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class l extends u{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class p extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class f extends i{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class h extends i{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=A(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends i{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const s=r[n];s.optimizeNames(e,t)||(C(e,s.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>x(e,t.names)),{})}}class y extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class g extends m{}class v extends y{}v.kind="else";class b extends y{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(I(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=A(this.condition,e,t),this}get names(){const e=super.names;return k(e,this.condition),this.else&&x(e,this.else.names),e}}b.kind="if";class w extends y{}w.kind="for";class $ extends w{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=A(this.iteration,e,t),this}get names(){return x(super.names,this.iteration.names)}}class _ extends w{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?s.varKinds.var:this.varKind,{name:r,from:n,to:o}=this;return`for(${t} ${r}=${n}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){const e=k(super.names,this.from);return k(e,this.to)}}class E extends w{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=A(this.iterable,e,t),this}get names(){return x(super.names,this.iterable.names)}}class S extends y{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}S.kind="func";class O extends m{render(e){return"return "+super.render(e)}}O.kind="return";class P extends y{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&x(e,this.catch.names),this.finally&&x(e,this.finally.names),e}}class j extends y{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}j.kind="catch";class T extends y{render(e){return"finally"+super.render(e)}}T.kind="finally";function x(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function k(e,t){return t instanceof n._CodeOrName?x(e,t.names):e}function A(e,t,r){return e instanceof n.Name?o(e):(s=e)instanceof n._Code&&s._items.some((e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str]))?new n._Code(e._items.reduce(((e,t)=>(t instanceof n.Name&&(t=o(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e)),[])):e;var s;function o(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function C(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function I(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${M(e)}`}t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new s.Scope({parent:e}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const s=this._scope.toName(t);return void 0!==r&&n&&(this._constants[s.str]=r),this._leafNode(new c(e,s,r)),s}const(e,t,r){return this._def(s.varKinds.const,e,t,r)}let(e,t,r){return this._def(s.varKinds.let,e,t,r)}var(e,t,r){return this._def(s.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new u(e,t,r))}add(e,r){return this._leafNode(new l(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new h(e)),this}object(...e){const t=["{"];for(const[r,s]of e)t.length>1&&t.push(","),t.push(r),(r!==s||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,s));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new b(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(b,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new $(e),t)}forRange(e,t,r,n,o=(this.opts.es5?s.varKinds.var:s.varKinds.let)){const a=this._scope.toName(e);return this._for(new _(o,a,t,r),(()=>n(a)))}forOf(e,t,r,o=s.varKinds.const){const a=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,(t=>{this.var(a,n._`${e}[${t}]`),r(a)}))}return this._for(new E("of",o,a,t),(()=>r(a)))}forIn(e,t,r,o=(this.opts.es5?s.varKinds.var:s.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const a=this._scope.toName(e);return this._for(new E("in",o,a,t),(()=>r(a)))}endFor(){return this._endBlockNode(w)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new p(e))}return(e){const t=new O;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(O)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new P;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new j(e),t(e)}return r&&(this._currNode=n.finally=new T,this.code(r)),this._endBlockNode(j,T)}throw(e){return this._leafNode(new f(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,s){return this._blockNode(new S(e,t,r)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=I;const N=R(t.operators.AND);t.and=function(...e){return e.reduce(N)};const D=R(t.operators.OR);function R(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${M(t)} ${e} ${M(r)}`}function M(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(D)}},8167:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(9782);class s extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class a{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=a;class i extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=i;const c=n._`\n`;t.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:n.nil}}get(){return this._scope}name(e){return new i(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:s}=n,o=null!==(r=t.key)&&void 0!==r?r:t.ref;let a=this._values[s];if(a){const e=a.get(o);if(e)return e}else a=this._values[s]=new Map;a.set(o,n);const i=this._scope[s]||(this._scope[s]=[]),c=i.length;return i[c]=t.ref,n.setValue(t,{property:s,itemIndex:c}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,a={},i){let c=n.nil;for(const u in e){const l=e[u];if(!l)continue;const d=a[u]=a[u]||new Map;l.forEach((e=>{if(d.has(e))return;d.set(e,o.Started);let a=r(e);if(a){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;c=n._`${c}${r} ${e} = ${a};${this.opts._n}`}else{if(!(a=null==i?void 0:i(e)))throw new s(e);c=n._`${c}${a}${this.opts._n}`}d.set(e,o.Completed)}))}return c}}},3127:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(9143),s=r(2493),o=r(8460);function a(e,t){const r=e.const("err",t);e.if(n._`${o.default.vErrors} === null`,(()=>e.assign(o.default.vErrors,n._`[${r}]`)),n._`${o.default.vErrors}.push(${r})`),e.code(n._`${o.default.errors}++`)}function i(e,t){const{gen:r,validateName:s,schemaEnv:o}=e;o.$async?r.throw(n._`new ${e.ValidationError}(${t})`):(r.assign(n._`${s}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,s,o){const{it:c}=e,{gen:l,compositeRule:d,allErrors:p}=c,f=u(e,r,s);(null!=o?o:d||p)?a(l,f):i(c,n._`[${f}]`)},t.reportExtraError=function(e,r=t.keywordError,n){const{it:s}=e,{gen:c,compositeRule:l,allErrors:d}=s;a(c,u(e,r,n)),l||d||i(s,o.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(n._`${o.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(n._`${o.default.vErrors}.length`,t)),(()=>e.assign(o.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:s,errsCount:a,it:i}){if(void 0===a)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",a,o.default.errors,(a=>{e.const(c,n._`${o.default.vErrors}[${a}]`),e.if(n._`${c}.instancePath === undefined`,(()=>e.assign(n._`${c}.instancePath`,(0,n.strConcat)(o.default.instancePath,i.errorPath)))),e.assign(n._`${c}.schemaPath`,n.str`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign(n._`${c}.schema`,r),e.assign(n._`${c}.data`,s))}))};const c={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function u(e,t,r){const{createErrors:s}=e.it;return!1===s?n._`{}`:function(e,t,r={}){const{gen:s,it:a}=e,i=[l(a,r),d(e,r)];return function(e,{params:t,message:r},s){const{keyword:a,data:i,schemaValue:u,it:l}=e,{opts:d,propertyName:p,topSchemaRef:f,schemaPath:h}=l;s.push([c.keyword,a],[c.params,"function"==typeof t?t(e):t||n._`{}`]),d.messages&&s.push([c.message,"function"==typeof r?r(e):r]);d.verbose&&s.push([c.schema,u],[c.parentSchema,n._`${f}${h}`],[o.default.data,i]);p&&s.push([c.propertyName,p])}(e,t,i),s.object(...i)}(e,t,r)}function l({errorPath:e},{instancePath:t}){const r=t?n.str`${e}${(0,s.getErrorPath)(t,s.Type.Str)}`:e;return[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,r)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:o}){let a=o?t:n.str`${t}/${e}`;return r&&(a=n.str`${a}${(0,s.getErrorPath)(r,s.Type.Str)}`),[c.schemaPath,a]}},4335:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(9143),s=r(2569),o=r(8460),a=r(21),i=r(2493),c=r(5344),u=r(2854);class l{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,a.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function d(e){const t=f.call(this,e);if(t)return t;const r=(0,a.getFullPath)(e.root.baseId),{es5:i,lines:u}=this.opts.code,{ownProperties:l}=this.opts,d=new n.CodeGen(this.scope,{es5:i,lines:u,ownProperties:l});let p;e.$async&&(p=d.scopeValue("Error",{ref:s.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const h=d.scopeName("validate");e.validateName=h;const m={gen:d,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:h,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let y;try{this._compilations.add(e),(0,c.validateFunctionCode)(m),d.optimize(this.opts.code.optimize);const t=d.toString();y=`${d.scopeRefs(o.default.scope)}return ${t}`,this.opts.code.process&&(y=this.opts.code.process(y,e));const r=new Function(`${o.default.self}`,`${o.default.scope}`,y)(this,this.scope.get());if(this.scope.value(h,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:h,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=m;r.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},r.source&&(r.source.evaluated=(0,n.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,y&&this.logger.error("Error compiling schema, function code:",y),t}finally{this._compilations.delete(e)}}function p(e){return(0,a.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:d.call(this,e)}function f(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function h(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||m.call(this,e,t)}function m(e,t){const r=u.parse(t),n=(0,a._getFullPath)(r);let s=(0,a.getFullPath)(e.baseId);if(Object.keys(e.schema).length>0&&n===s)return g.call(this,r,e);const o=(0,a.normalizeId)(n),i=this.refs[o]||this.schemas[o];if("string"==typeof i){const t=m.call(this,e,i);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,r,t)}if("object"==typeof(null==i?void 0:i.schema)){if(i.validate||d.call(this,i),o===(0,a.normalizeId)(t)){const{schema:t}=i,{schemaId:r}=this.opts,n=t[r];return n&&(s=(0,a.resolveUrl)(s,n)),new l({schema:t,schemaId:r,root:e,baseId:s})}return g.call(this,r,i)}}t.SchemaEnv=l,t.compileSchema=d,t.resolveRef=function(e,t,r){var n;r=(0,a.resolveUrl)(t,r);const s=e.refs[r];if(s)return s;let o=h.call(this,e,r);if(void 0===o){const s=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:a}=this.opts;s&&(o=new l({schema:s,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[r]=p.call(this,o):void 0},t.getCompilingSchema=f,t.resolveSchema=m;const y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:r,root:n}){var s;if("/"!==(null===(s=e.fragment)||void 0===s?void 0:s[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,i.unescapeFragment)(n)];if(void 0===e)return;const s="object"==typeof(r=e)&&r[this.opts.schemaId];!y.has(n)&&s&&(t=(0,a.resolveUrl)(t,s))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,i.schemaHasRulesButRef)(r,this.RULES)){const e=(0,a.resolveUrl)(t,r.$ref);o=m.call(this,n,e)}const{schemaId:c}=this.opts;return o=o||new l({schema:r,schemaId:c,root:n,baseId:t}),o.schema!==o.root.schema?o:void 0}},8460:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=s},2589:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(21);class s extends Error{constructor(e,t,r){super(r||`can't resolve reference ${t} from id ${e}`),this.missingRef=(0,n.resolveUrl)(e,t),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(this.missingRef))}}t.default=s},21:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(2493),s=r(9378),o=r(9522),a=r(2854),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!u(e):!!t&&l(e)<=t)};const c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function u(e){for(const t in e){if(c.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(u))return!0;if("object"==typeof r&&u(r))return!0}return!1}function l(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!i.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],(e=>t+=l(e))),t===1/0))return 1/0}return t}function d(e="",t){!1!==t&&(e=h(e));return p(a.parse(e))}function p(e){return a.serialize(e).split("#")[0]+"#"}t.getFullPath=d,t._getFullPath=p;const f=/#\/?$/;function h(e){return e?e.replace(f,""):""}t.normalizeId=h,t.resolveUrl=function(e,t){return t=h(t),a.resolve(e,t)};const m=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r}=this.opts,n=h(e[r]||t),i={"":n},c=d(n,!1),u={},l=new Set;return o(e,{allKeys:!0},((e,t,n,s)=>{if(void 0===s)return;const o=c+t;let d=i[s];function y(t){if(t=h(d?a.resolve(d,t):t),l.has(t))throw f(t);l.add(t);let r=this.refs[t];return"string"==typeof r&&(r=this.refs[r]),"object"==typeof r?p(e,r.schema,t):t!==h(o)&&("#"===t[0]?(p(e,u[t],t),u[t]=e):this.refs[t]=o),t}function g(e){if("string"==typeof e){if(!m.test(e))throw new Error(`invalid anchor "${e}"`);y.call(this,`#${e}`)}}"string"==typeof e[r]&&(d=y.call(this,e[r])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),i[t]=d})),u;function p(e,t,r){if(void 0!==t&&!s(e,t))throw f(r)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},5766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},2493:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(9143),s=r(9782);function o(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const s=n.RULES.keywords;for(const r in t)s[r]||h(e,`unknown keyword: "${r}"`)}function a(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function i(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function u({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:s}){return(o,a,i,c)=>{const u=void 0===i?a:i instanceof n.Name?(a instanceof n.Name?e(o,a,i):t(o,a,i),i):a instanceof n.Name?(t(o,i,a),a):r(a,i);return c!==n.Name||u instanceof n.Name?u:s(o,u)}}function l(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",n._`{}`);return void 0!==t&&d(e,r,t),r}function d(e,t,r){Object.keys(r).forEach((r=>e.assign(n._`${t}${(0,n.getProperty)(r)}`,!0)))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!a(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=a,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,s,o){if(!o){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return n._`${r}`}return n._`${e}${t}${(0,n.getProperty)(s)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(i(e))},t.escapeJsonPointer=i,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:u({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>{e.if(n._`${t} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,n._`${r} || {}`).code(n._`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>{!0===t?e.assign(r,!0):(e.assign(r,n._`${r} || {}`),d(e,r,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:l}),items:u({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,n._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>e.assign(r,!0===t||n._`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=l,t.setEvaluated=d;const p={};var f;function h(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:p[t.code]||(p[t.code]=new s._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(f=t.Type||(t.Type={})),t.getErrorPath=function(e,t,r){if(e instanceof n.Name){const s=t===f.Num;return r?s?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:s?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+i(e)},t.checkStrictMode=h},9032:(e,t)=>{"use strict";function r(e,t){return t.rules.some((t=>n(e,t)))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){const s=t.RULES.types[n];return s&&!0!==s&&r(e,s)},t.shouldUseGroup=r,t.shouldUseRule=n},4997:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(3127),s=r(9143),o=r(8460),a={message:"boolean schema is false"};function i(e,t){const{gen:r,data:s}=e,o={gen:r,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(o,a,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?i(e,!1):"object"==typeof r&&!0===r.$async?t.return(o.default.data):(t.assign(s._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),i(e)):r.var(t,!0)}},4327:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const n=r(5766),s=r(9032),o=r(3127),a=r(9143),i=r(2493);var c;function u(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=u(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=u,t.coerceAndCheckDataType=function(e,t){const{gen:r,data:n,opts:o}=e,i=function(e,t){return t?e.filter((e=>l.has(e)||"array"===t&&"array"===e)):[]}(t,o.coerceTypes),u=t.length>0&&!(0===i.length&&1===t.length&&(0,s.schemaHasRulesForType)(e,t[0]));if(u){const s=p(t,n,o.strictNumbers,c.Wrong);r.if(s,(()=>{i.length?function(e,t,r){const{gen:n,data:s,opts:o}=e,i=n.let("dataType",a._`typeof ${s}`),c=n.let("coerced",a._`undefined`);"array"===o.coerceTypes&&n.if(a._`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,(()=>n.assign(s,a._`${s}[0]`).assign(i,a._`typeof ${s}`).if(p(t,s,o.strictNumbers),(()=>n.assign(c,s)))));n.if(a._`${c} !== undefined`);for(const e of r)(l.has(e)||"array"===e&&"array"===o.coerceTypes)&&u(e);function u(e){switch(e){case"string":return void n.elseIf(a._`${i} == "number" || ${i} == "boolean"`).assign(c,a._`"" + ${s}`).elseIf(a._`${s} === null`).assign(c,a._`""`);case"number":return void n.elseIf(a._`${i} == "boolean" || ${s} === null
|| (${i} == "string" && ${s} && ${s} == +${s})`).assign(c,a._`+${s}`);case"integer":return void n.elseIf(a._`${i} === "boolean" || ${s} === null
|| (${i} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(c,a._`+${s}`);case"boolean":return void n.elseIf(a._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(c,!1).elseIf(a._`${s} === "true" || ${s} === 1`).assign(c,!0);case"null":return n.elseIf(a._`${s} === "" || ${s} === 0 || ${s} === false`),void n.assign(c,null);case"array":n.elseIf(a._`${i} === "string" || ${i} === "number"
|| ${i} === "boolean" || ${s} === null`).assign(c,a._`[${s}]`)}}n.else(),h(e),n.endIf(),n.if(a._`${c} !== undefined`,(()=>{n.assign(s,c),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(a._`${t} !== undefined`,(()=>e.assign(a._`${t}[${r}]`,n)))}(e,c)}))}(e,t,i):h(e)}))}return u};const l=new Set(["string","number","integer","boolean","null"]);function d(e,t,r,n=c.Correct){const s=n===c.Correct?a.operators.EQ:a.operators.NEQ;let o;switch(e){case"null":return a._`${t} ${s} null`;case"array":o=a._`Array.isArray(${t})`;break;case"object":o=a._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=i(a._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return a._`typeof ${t} ${s} ${e}`}return n===c.Correct?o:(0,a.not)(o);function i(e=a.nil){return(0,a.and)(a._`typeof ${t} == "number"`,e,r?a._`isFinite(${t})`:a.nil)}}function p(e,t,r,n){if(1===e.length)return d(e[0],t,r,n);let s;const o=(0,i.toHash)(e);if(o.array&&o.object){const e=a._`typeof ${t} != "object"`;s=o.null?e:a._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else s=a.nil;o.number&&delete o.integer;for(const e in o)s=(0,a.and)(s,d(e,t,r,n));return s}t.checkDataType=d,t.checkDataTypes=p;const f={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?a._`{type: ${e}}`:a._`{type: ${t}}`};function h(e){const t=function(e){const{gen:t,data:r,schema:n}=e,s=(0,i.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}(e);(0,o.reportError)(t,f)}t.reportTypeError=h},3633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const n=r(9143),s=r(2493);function o(e,t,r){const{gen:o,compositeRule:a,data:i,opts:c}=e;if(void 0===r)return;const u=n._`${i}${(0,n.getProperty)(t)}`;if(a)return void(0,s.checkStrictMode)(e,`default is ignored for: ${u}`);let l=n._`${u} === undefined`;"empty"===c.useDefaults&&(l=n._`${l} || ${u} === null || ${u} === ""`),o.if(l,n._`${u} = ${(0,n.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)o(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>o(e,r,t.default)))}},5344:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const n=r(4997),s=r(4327),o=r(9032),a=r(4327),i=r(3633),c=r(9264),u=r(692),l=r(9143),d=r(8460),p=r(21),f=r(2493),h=r(3127);function m({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){s.code.es5?e.func(t,l._`${d.default.data}, ${d.default.valCxt}`,n.$async,(()=>{e.code(l._`"use strict"; ${y(r,s)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,l._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,l._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,l._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,l._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,l._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,l._`""`),e.var(d.default.parentData,l._`undefined`),e.var(d.default.parentDataProperty,l._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,l._`{}`)}))}(e,s),e.code(o)})):e.func(t,l._`${d.default.data}, ${function(e){return l._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?l._`, ${d.default.dynamicAnchors}={}`:l.nil}}={}`}(s)}`,n.$async,(()=>e.code(y(r,s)).code(o)))}function y(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?l._`/*# sourceURL=${r} */`:l.nil}function g(e,t){b(e)&&(w(e),v(e))?function(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&_(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,p.resolveUrl)(e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=n.const("_errs",d.default.errors);$(e,o),n.var(t,l._`${o} === ${d.default.errors}`)}(e,t):(0,n.boolOrEmptySchema)(e,t)}function v({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function b(e){return"boolean"!=typeof e.schema}function w(e){(0,f.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function $(e,t){if(e.opts.jtd)return E(e,[],!1,t);const r=(0,s.getSchemaTypes)(e.schema);E(e,r,!(0,s.coerceAndCheckDataType)(e,r),t)}function _({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const o=r.$comment;if(!0===s.$comment)e.code(l._`${d.default.self}.logger.log(${o})`);else if("function"==typeof s.$comment){const r=l.str`${n}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code(l._`${d.default.self}.opts.$comment(${o}, ${r}, ${s}.schema)`)}}function E(e,t,r,n){const{gen:s,schema:i,data:c,allErrors:u,opts:p,self:h}=e,{RULES:m}=h;function y(f){(0,o.shouldUseGroup)(i,f)&&(f.type?(s.if((0,a.checkDataType)(f.type,c,p.strictNumbers)),S(e,f),1===t.length&&t[0]===f.type&&r&&(s.else(),(0,a.reportTypeError)(e)),s.endIf()):S(e,f),u||s.if(l._`${d.default.errors} === ${n||0}`))}!i.$ref||!p.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(i,m)?(p.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{P(e.dataTypes,t)||j(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),e.dataTypes=e.dataTypes.filter((e=>P(t,e)))})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&j(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if("object"==typeof s&&(0,o.shouldUseRule)(e.schema,s)){const{type:r}=s.definition;r.length&&!r.some((e=>O(t,e)))&&j(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes)}(e,t),s.block((()=>{for(const e of m.rules)y(e);y(m.post)}))):s.block((()=>x(e,"$ref",m.all.$ref.definition)))}function S(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,i.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,o.shouldUseRule)(n,r)&&x(e,r.keyword,r.definition,t.type)}))}function O(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function P(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function j(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,f.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){b(e)&&(w(e),v(e))?function(e){const{schema:t,opts:r,gen:n}=e;m(e,(()=>{r.$comment&&t.$comment&&_(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,f.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(d.default.vErrors,null),n.let(d.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",l._`${r}.evaluated`),t.if(l._`${e.evaluated}.dynamicProps`,(()=>t.assign(l._`${e.evaluated}.props`,l._`undefined`))),t.if(l._`${e.evaluated}.dynamicItems`,(()=>t.assign(l._`${e.evaluated}.items`,l._`undefined`)))}(e),$(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;r.$async?t.if(l._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(l._`new ${s}(${d.default.vErrors})`))):(t.assign(l._`${n}.errors`,d.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof l.Name&&e.assign(l._`${t}.props`,r);n instanceof l.Name&&e.assign(l._`${t}.items`,n)}(e),t.return(l._`${d.default.errors} === 0`))}(e)}))}(e):m(e,(()=>(0,n.topBoolOrEmptySchema)(e)))};class T{constructor(e,t,r){if((0,c.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",C(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,r){this.failResult((0,l.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,l.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(l._`${t} !== undefined && (${(0,l.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?h.reportExtraError:h.reportError)(this,this.def.error,t)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=l.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=l.nil,t=l.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:s,def:o}=this;r.if((0,l.or)(l._`${n} === undefined`,t)),e!==l.nil&&r.assign(e,!0),(s.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==l.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:s}=this;return(0,l.or)(function(){if(r.length){if(!(t instanceof l.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return l._`${(0,a.checkDataTypes)(e,t,s.opts.strictNumbers,a.DataType.Wrong)}`}return l.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return l._`!${r}(${t})`}return l.nil}())}subschema(e,t){const r=(0,u.getSubschema)(this.it,e);(0,u.extendSubschemaData)(r,this.it,e),(0,u.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return g(n,t),n}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=f.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=f.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,l.Name))),!0}}function x(e,t,r,n){const s=new T(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,c.funcKeywordCode)(s,r):"macro"in r?(0,c.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,c.funcKeywordCode)(s,r)}t.KeywordCxt=T;const k=/^\/(?:[^~]|~0|~1)*$/,A=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function C(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(""===e)return d.default.rootData;if("/"===e[0]){if(!k.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,o=d.default.rootData}else{const a=A.exec(e);if(!a)throw new Error(`Invalid JSON-pointer: ${e}`);const i=+a[1];if(s=a[2],"#"===s){if(i>=t)throw new Error(c("property/index",i));return n[t-i]}if(i>t)throw new Error(c("data",i));if(o=r[t-i],!s)return o}let a=o;const i=s.split("/");for(const e of i)e&&(o=l._`${o}${(0,l.getProperty)((0,f.unescapeJsonPointer)(e))}`,a=l._`${a} && ${o}`);return a;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=C},9264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=r(9143),s=r(8460),o=r(5255),a=r(3127);function i(e){const{gen:t,data:r,it:s}=e;t.if(s.parentData,(()=>t.assign(r,n._`${s.parentData}[${s.parentDataProperty}]`)))}function c(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:s,schema:o,parentSchema:a,it:i}=e,u=t.macro.call(i.self,o,a,i),l=c(r,s,u);!1!==i.opts.validateSchema&&i.self.validateSchema(u,!0);const d=r.name("valid");e.subschema({schema:u,schemaPath:n.nil,errSchemaPath:`${i.errSchemaPath}/${s}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var r;const{gen:u,keyword:l,schema:d,parentSchema:p,$data:f,it:h}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(h,t);const m=!f&&t.compile?t.compile.call(h.self,d,p,h):t.validate,y=c(u,l,m),g=u.let("valid");function v(r=(t.async?n._`await `:n.nil)){const a=h.opts.passContext?s.default.this:s.default.self,i=!("compile"in t&&!f||!1===t.schema);u.assign(g,n._`${r}${(0,o.callValidateCode)(e,y,a,i)}`,t.modifying)}function b(e){var r;u.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:g),e)}e.block$data(g,(function(){if(!1===t.errors)v(),t.modifying&&i(e),b((()=>e.error()));else{const r=t.async?function(){const e=u.let("ruleErrs",null);return u.try((()=>v(n._`await `)),(t=>u.assign(g,!1).if(n._`${t} instanceof ${h.ValidationError}`,(()=>u.assign(e,n._`${t}.errors`)),(()=>u.throw(t))))),e}():function(){const e=n._`${y}.errors`;return u.assign(e,null),v(n.nil),e}();t.modifying&&i(e),b((()=>function(e,t){const{gen:r}=e;r.if(n._`Array.isArray(${t})`,(()=>{r.assign(s.default.vErrors,n._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`).assign(s.default.errors,n._`${s.default.vErrors}.length`),(0,a.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:g)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw new Error("ajv implementation error");const a=s.dependencies;if(null==a?void 0:a.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}}},692:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const n=r(9143),s=r(2493);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:o,schemaPath:a,errSchemaPath:i,topSchemaRef:c}){if(void 0!==t&&void 0!==o)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const o=e.schema[t];return void 0===r?{schema:o,schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[r],schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,s.escapeFragment)(r)}`}}if(void 0!==o){if(void 0===a||void 0===i||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:a,topSchemaRef:c,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:o,data:a,dataTypes:i,propertyName:c}){if(void 0!==a&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:u}=t;if(void 0!==r){const{errorPath:a,dataPathArr:i,opts:c}=t;l(u.let("data",n._`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=n.str`${a}${(0,s.getErrorPath)(r,o,c.jsPropertySyntax)}`,e.parentDataProperty=n._`${r}`,e.dataPathArr=[...i,e.parentDataProperty]}if(void 0!==a){l(a instanceof n.Name?a:u.let("data",a,!0)),void 0!==c&&(e.propertyName=c)}function l(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}i&&(e.dataTypes=i)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){void 0!==n&&(e.compositeRule=n),void 0!==s&&(e.createErrors=s),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}},3993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(5344);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var s=r(9143);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});const o=r(2569),a=r(2589),i=r(5766),c=r(4335),u=r(9143),l=r(21),d=r(4327),p=r(2493),f=r(7814),h=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function v(e){var t,r,n,s,o,a,i,c,u,l,d,p,f,h,m,y,g,v,b,w,$,_;const E=e.strict,S=null===(t=e.code)||void 0===t?void 0:t.optimize,O=!0===S||void 0===S?1:S||0;return{strictSchema:null===(n=null!==(r=e.strictSchema)&&void 0!==r?r:E)||void 0===n||n,strictNumbers:null===(o=null!==(s=e.strictNumbers)&&void 0!==s?s:E)||void 0===o||o,strictTypes:null!==(i=null!==(a=e.strictTypes)&&void 0!==a?a:E)&&void 0!==i?i:"log",strictTuples:null!==(u=null!==(c=e.strictTuples)&&void 0!==c?c:E)&&void 0!==u?u:"log",strictRequired:null!==(d=null!==(l=e.strictRequired)&&void 0!==l?l:E)&&void 0!==d&&d,code:e.code?{...e.code,optimize:O}:{optimize:O},loopRequired:null!==(p=e.loopRequired)&&void 0!==p?p:200,loopEnum:null!==(f=e.loopEnum)&&void 0!==f?f:200,meta:null===(h=e.meta)||void 0===h||h,messages:null===(m=e.messages)||void 0===m||m,inlineRefs:null===(y=e.inlineRefs)||void 0===y||y,schemaId:null!==(g=e.schemaId)&&void 0!==g?g:"$id",addUsedSchema:null===(v=e.addUsedSchema)||void 0===v||v,validateSchema:null===(b=e.validateSchema)||void 0===b||b,validateFormats:null===(w=e.validateFormats)||void 0===w||w,unicodeRegExp:null===($=e.unicodeRegExp)||void 0===$||$,int32range:null===(_=e.int32range)||void 0===_||_}}class b{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=function(e){if(!1===e)return P;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),w.call(this,y,e,"NOT SUPPORTED"),w.call(this,g,e,"DEPRECATED","warn"),this._metaOpts=O.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),_.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=f;"id"===r&&(n={...f},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await s.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||o.call(this,r)}async function s(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return i.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function i({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await u.call(this,e);this.refs[e]||await s.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let s;if("object"==typeof e){const{schemaId:t}=this.opts;if(s=e[t],void 0!==s&&"string"!=typeof s)throw new Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=$.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new c.SchemaEnv({schema:{},schemaId:r});if(t=c.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=$.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,l.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(T.call(this,r,t),!t)return(0,p.eachItem)(r,(e=>x.call(this,e))),this;A.call(this,t);const n={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,p.eachItem)(r,0===n.type.length?e=>x.call(this,e,n):e=>n.type.forEach((t=>x.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let s=e;for(const e of t)s=s[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,o=s[e];n&&o&&(s[e]=I(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let o;const{schemaId:a}=this.opts;if("object"==typeof e)o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let i=this._cache.get(e);if(void 0!==i)return i;r=(0,l.normalizeId)(o||r);const u=l.getSchemaRefs.call(this,e,r);return i=new c.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:u}),this._cache.set(i.schema,i),s&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=i),n&&this.validateSchema(e,!0),i}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function w(e,t,r,n="error"){for(const s in e){const o=s;o in t&&this.logger[n](`${r}: option ${s}. ${e[o]}`)}}function $(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function _(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function E(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function S(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function O(){const e={...this.opts};for(const t of h)delete e[t];return e}t.default=b,b.ValidationError=o.default,b.MissingRefError=a.default;const P={log(){},warn(){},error(){}};const j=/^[a-z_$][a-z0-9_$:-]*$/i;function T(e,t){const{RULES:r}=this;if((0,p.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!j.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function x(e,t,r){var n;const s=null==t?void 0:t.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let a=s?o.post:o.rules.find((({type:e})=>e===r));if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;const i={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?k.call(this,a,i,t.before):a.rules.push(i),o.all[e]=i,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function k(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function A(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=I(t)),e.validateSchema=this.compile(t,!0))}const C={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function I(e){return{anyOf:[e,C]}}},3717:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9378);n.code='require("ajv/dist/runtime/equal").default',t.default=n},158:(e,t)=>{"use strict";function r(e){const t=e.length;let r,n=0,s=0;for(;s<t;)n++,r=e.charCodeAt(s++),r>=55296&&r<=56319&&s<t&&(r=e.charCodeAt(s),56320==(64512&r)&&s++);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},2569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=r},5971:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const n=r(9143),s=r(2493),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?a(e,n):(0,s.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function a(e,t){const{gen:r,schema:o,data:a,keyword:i,it:c}=e;c.items=!0;const u=r.const("len",n._`${a}.length`);if(!1===o)e.setParams({len:t.length}),e.pass(n._`${u} <= ${t.length}`);else if("object"==typeof o&&!(0,s.alwaysValidSchema)(c,o)){const o=r.var("valid",n._`${u} <= ${t.length}`);r.if((0,n.not)(o),(()=>function(o){r.forRange("i",t.length,u,(t=>{e.subschema({keyword:i,dataProp:t,dataPropType:s.Type.Num},o),c.allErrors||r.if((0,n.not)(o),(()=>r.break()))}))}(o))),e.ok(o)}}t.validateAdditionalItems=a,t.default=o},2012:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5255),s=r(9143),o=r(8460),a=r(2493),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>s._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:i,data:c,errsCount:u,it:l}=e;if(!u)throw new Error("ajv implementation error");const{allErrors:d,opts:p}=l;if(l.props=!0,"all"!==p.removeAdditional&&(0,a.alwaysValidSchema)(l,r))return;const f=(0,n.allSchemaProperties)(i.properties),h=(0,n.allSchemaProperties)(i.patternProperties);function m(e){t.code(s._`delete ${c}[${e}]`)}function y(n){if("all"===p.removeAdditional||p.removeAdditional&&!1===r)m(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(d||t.break());if("object"==typeof r&&!(0,a.alwaysValidSchema)(l,r)){const r=t.name("valid");"failing"===p.removeAdditional?(g(n,r,!1),t.if((0,s.not)(r),(()=>{e.reset(),m(n)}))):(g(n,r),d||t.if((0,s.not)(r),(()=>t.break())))}}}function g(t,r,n){const s={keyword:"additionalProperties",dataProp:t,dataPropType:a.Type.Str};!1===n&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(s,r)}t.forIn("key",c,(r=>{f.length||h.length?t.if(function(r){let o;if(f.length>8){const e=(0,a.schemaRefOrVal)(l,i.properties,"properties");o=(0,n.isOwnProperty)(t,e,r)}else o=f.length?(0,s.or)(...f.map((e=>s._`${r} === ${e}`))):s.nil;return h.length&&(o=(0,s.or)(o,...h.map((t=>s._`${(0,n.usePattern)(e,t)}.test(${r})`)))),(0,s.not)(o)}(r),(()=>y(r))):y(r)})),e.ok(s._`${u} === ${o.default.errors}`)}};t.default=i},7206:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2493),s={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const o=t.name("valid");r.forEach(((t,r)=>{if((0,n.alwaysValidSchema)(s,t))return;const a=e.subschema({keyword:"allOf",schemaProp:r},o);e.ok(o),e.mergeEvaluated(a)}))}};t.default=s},569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(5255).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},2063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s=r(2493),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?n.str`must contain at least ${e} valid item(s)`:n.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?n._`{minContains: ${e}}`:n._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:o,data:a,it:i}=e;let c,u;const{minContains:l,maxContains:d}=o;i.opts.next?(c=void 0===l?1:l,u=d):c=1;const p=t.const("len",n._`${a}.length`);if(e.setParams({min:c,max:u}),void 0===u&&0===c)return void(0,s.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==u&&c>u)return(0,s.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,s.alwaysValidSchema)(i,r)){let t=n._`${p} >= ${c}`;return void 0!==u&&(t=n._`${t} && ${p} <= ${u}`),void e.pass(t)}i.items=!0;const f=t.name("valid");if(void 0===u&&1===c)h(f,(()=>t.if(f,(()=>t.break()))));else{t.let(f,!1);const e=t.name("_valid"),r=t.let("count",0);h(e,(()=>t.if(e,(()=>function(e){t.code(n._`${e}++`),void 0===u?t.if(n._`${e} >= ${c}`,(()=>t.assign(f,!0).break())):(t.if(n._`${e} > ${u}`,(()=>t.assign(f,!1).break())),1===c?t.assign(f,!0):t.if(n._`${e} >= ${c}`,(()=>t.assign(f,!0))))}(r)))))}function h(r,n){t.forRange("i",0,p,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:s.Type.Num,compositeRule:!0},r),n()}))}e.result(f,(()=>e.reset()))}};t.default=o},337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const n=r(9143),s=r(2493),o=r(5255);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const s=1===t?"property":"properties";return n.str`must have ${s} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:s}})=>n._`{property: ${e},
missingProperty: ${s},
depsCount: ${t},
deps: ${r}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e){if("__proto__"===n)continue;(Array.isArray(e[n])?t:r)[n]=e[n]}return[t,r]}(e);i(e,t),c(e,r)}};function i(e,t=e.schema){const{gen:r,data:s,it:a}=e;if(0===Object.keys(t).length)return;const i=r.let("missing");for(const c in t){const u=t[c];if(0===u.length)continue;const l=(0,o.propertyInData)(r,s,c,a.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),a.allErrors?r.if(l,(()=>{for(const t of u)(0,o.checkReportMissingProp)(e,t)})):(r.if(n._`${l} && (${(0,o.checkMissingProp)(e,u,i)})`),(0,o.reportMissingProp)(e,i),r.else())}}function c(e,t=e.schema){const{gen:r,data:n,keyword:a,it:i}=e,c=r.name("valid");for(const u in t)(0,s.alwaysValidSchema)(i,t[u])||(r.if((0,o.propertyInData)(r,n,u,i.opts.ownProperties),(()=>{const t=e.subschema({keyword:a,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>r.var(c,!0))),e.ok(c))}t.validatePropertyDeps=i,t.validateSchemaDeps=c,t.default=a},599:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s=r(2493),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>n.str`must match "${e.ifClause}" schema`,params:({params:e})=>n._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:o}=e;void 0===r.then&&void 0===r.else&&(0,s.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const i=a(o,"then"),c=a(o,"else");if(!i&&!c)return;const u=t.let("valid",!0),l=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(t)}(),e.reset(),i&&c){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(l,d("then",r),d("else",r))}else i?t.if(l,d("then")):t.if((0,n.not)(l),d("else"));function d(r,s){return()=>{const o=e.subschema({keyword:r},l);t.assign(u,l),e.mergeValidEvaluated(o,u),s?t.assign(s,n._`${r}`):e.setParams({ifClause:r})}}e.pass(u,(()=>e.error(!0)))}};function a(e,t){const r=e.schema[t];return void 0!==r&&!(0,s.alwaysValidSchema)(e,r)}t.default=o},5068:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5971),s=r(2340),o=r(8606),a=r(7287),i=r(2063),c=r(337),u=r(7884),l=r(2012),d=r(4280),p=r(5295),f=r(3015),h=r(569),m=r(2336),y=r(7206),g=r(599),v=r(1277);t.default=function(e=!1){const t=[f.default,h.default,m.default,y.default,g.default,v.default,u.default,l.default,c.default,d.default,p.default];return e?t.push(s.default,a.default):t.push(n.default,o.default),t.push(i.default),t}},8606:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const n=r(9143),s=r(2493),o=r(5255),a={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return i(e,"additionalItems",t);r.items=!0,(0,s.alwaysValidSchema)(r,t)||e.ok((0,o.validateArray)(e))}};function i(e,t,r=e.schema){const{gen:o,parentSchema:a,data:i,keyword:c,it:u}=e;!function(e){const{opts:n,errSchemaPath:o}=u,a=r.length,i=a===e.minItems&&(a===e.maxItems||!1===e[t]);if(n.strictTuples&&!i){const e=`"${c}" is ${a}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,s.checkStrictMode)(u,e,n.strictTuples)}}(a),u.opts.unevaluated&&r.length&&!0!==u.items&&(u.items=s.mergeEvaluated.items(o,r.length,u.items));const l=o.name("valid"),d=o.const("len",n._`${i}.length`);r.forEach(((t,r)=>{(0,s.alwaysValidSchema)(u,t)||(o.if(n._`${d} > ${r}`,(()=>e.subschema({keyword:c,schemaProp:r,dataProp:r},l))),e.ok(l))}))}t.validateTuple=i,t.default=a},7287:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s=r(2493),o=r(5255),a=r(5971),i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,(0,s.alwaysValidSchema)(n,t)||(i?(0,a.validateAdditionalItems)(e,i):e.ok((0,o.validateArray)(e)))}};t.default=i},3015:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2493),s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:s}=e;if((0,n.alwaysValidSchema)(s,r))return void e.fail();const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=s},2336:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s=r(2493),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:o,it:a}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(a.opts.discriminator&&o.discriminator)return;const i=r,c=t.let("valid",!1),u=t.let("passing",null),l=t.name("_valid");e.setParams({passing:u}),t.block((function(){i.forEach(((r,o)=>{let i;(0,s.alwaysValidSchema)(a,r)?t.var(l,!0):i=e.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},l),o>0&&t.if(n._`${l} && ${c}`).assign(c,!1).assign(u,n._`[${u}, ${o}]`).else(),t.if(l,(()=>{t.assign(c,!0),t.assign(u,o),i&&e.mergeEvaluated(i,n.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=o},5295:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5255),s=r(9143),o=r(2493),a=r(2493),i={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:i,parentSchema:c,it:u}=e,{opts:l}=u,d=(0,n.allSchemaProperties)(r),p=d.filter((e=>(0,o.alwaysValidSchema)(u,r[e])));if(0===d.length||p.length===d.length&&(!u.opts.unevaluated||!0===u.props))return;const f=l.strictSchema&&!l.allowMatchingProperties&&c.properties,h=t.name("valid");!0===u.props||u.props instanceof s.Name||(u.props=(0,a.evaluatedPropsToName)(t,u.props));const{props:m}=u;function y(e){for(const t in f)new RegExp(e).test(t)&&(0,o.checkStrictMode)(u,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function g(r){t.forIn("key",i,(o=>{t.if(s._`${(0,n.usePattern)(e,r)}.test(${o})`,(()=>{const n=p.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:o,dataPropType:a.Type.Str},h),u.opts.unevaluated&&!0!==m?t.assign(s._`${m}[${o}]`,!0):n||u.allErrors||t.if((0,s.not)(h),(()=>t.break()))}))}))}!function(){for(const e of d)f&&y(e),u.allErrors?g(e):(t.var(h,!0),g(e),t.if(h))}()}};t.default=i},2340:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8606),s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=s},4280:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5344),s=r(5255),o=r(2493),a=r(2012),i={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:i,data:c,it:u}=e;"all"===u.opts.removeAdditional&&void 0===i.additionalProperties&&a.default.code(new n.KeywordCxt(u,a.default,"additionalProperties"));const l=(0,s.allSchemaProperties)(r);for(const e of l)u.definedProperties.add(e);u.opts.unevaluated&&l.length&&!0!==u.props&&(u.props=o.mergeEvaluated.props(t,(0,o.toHash)(l),u.props));const d=l.filter((e=>!(0,o.alwaysValidSchema)(u,r[e])));if(0===d.length)return;const p=t.name("valid");for(const r of d)f(r)?h(r):(t.if((0,s.propertyInData)(t,c,r,u.opts.ownProperties)),h(r),u.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(p);function f(e){return u.opts.useDefaults&&!u.compositeRule&&void 0!==r[e].default}function h(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}};t.default=i},7884:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s=r(2493),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>n._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:o,it:a}=e;if((0,s.alwaysValidSchema)(a,r))return;const i=t.name("valid");t.forIn("key",o,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},i),t.if((0,n.not)(i),(()=>{e.error(!0),a.allErrors||t.break()}))})),e.ok(i)}};t.default=o},1277:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2493),s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=s},5255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const n=r(9143),s=r(2493),o=r(8460);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function i(e,t,r){return n._`${a(e)}.call(${t}, ${r})`}function c(e,t,r,s){const o=n._`${t}${(0,n.getProperty)(r)} === undefined`;return s?(0,n.or)(o,(0,n.not)(i(e,t,r))):o}function u(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:s,it:o}=e;r.if(c(r,s,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:n._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},s,o){return(0,n.or)(...s.map((s=>(0,n.and)(c(e,t,s,r.ownProperties),n._`${o} = ${s}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=i,t.propertyInData=function(e,t,r,s){const o=n._`${t}${(0,n.getProperty)(r)} !== undefined`;return s?n._`${o} && ${i(e,t,r)}`:o},t.noPropertyInData=c,t.allSchemaProperties=u,t.schemaProperties=function(e,t){return u(t).filter((r=>!(0,s.alwaysValidSchema)(e,t[r])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:s,schemaPath:a,errorPath:i},it:c},u,l,d){const p=d?n._`${e}, ${t}, ${s}${a}`:t,f=[[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,i)],[o.default.parentData,c.parentData],[o.default.parentDataProperty,c.parentDataProperty],[o.default.rootData,o.default.rootData]];c.opts.dynamicRef&&f.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);const h=n._`${p}, ${r.object(...f)}`;return l!==n.nil?n._`${u}.call(${l}, ${h})`:n._`${u}(${h})`},t.usePattern=function({gen:e,it:{opts:t}},r){const s=t.unicodeRegExp?"u":"";return e.scopeValue("pattern",{key:r,ref:new RegExp(r,s),code:n._`new RegExp(${r}, ${s})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:o,it:a}=e,i=t.name("valid");if(a.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(i,!0),c((()=>t.break())),i;function c(a){const c=t.const("len",n._`${r}.length`);t.forRange("i",0,c,(r=>{e.subschema({keyword:o,dataProp:r,dataPropType:s.Type.Num},i),t.if((0,n.not)(i),a)}))}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:o,it:a}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,s.alwaysValidSchema)(a,e)))&&!a.opts.unevaluated)return;const i=t.let("valid",!1),c=t.name("_valid");t.block((()=>r.forEach(((r,s)=>{const a=e.subschema({keyword:o,schemaProp:s,compositeRule:!0},c);t.assign(i,n._`${i} || ${c}`);e.mergeValidEvaluated(a,c)||t.if((0,n.not)(i))})))),e.result(i,(()=>e.reset()),(()=>e.error(!0)))}},4404:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},4031:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4404),s=r(8126),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,s.default];t.default=o},8126:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const n=r(2589),s=r(5255),o=r(9143),a=r(8460),i=r(4335),c=r(2493),u={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:s}=e,{baseId:a,schemaEnv:c,validateName:u,opts:p,self:f}=s,{root:h}=c;if(("#"===r||"#/"===r)&&a===h.baseId)return function(){if(c===h)return d(e,u,c,c.$async);const r=t.scopeValue("root",{ref:h});return d(e,o._`${r}.validate`,h,h.$async)}();const m=i.resolveRef.call(f,h,a,r);if(void 0===m)throw new n.default(a,r);return m instanceof i.SchemaEnv?function(t){const r=l(e,t);d(e,r,t,t.$async)}(m):function(n){const s=t.scopeValue("schema",!0===p.code.source?{ref:n,code:(0,o.stringify)(n)}:{ref:n}),a=t.name("valid"),i=e.subschema({schema:n,dataTypes:[],schemaPath:o.nil,topSchemaRef:s,errSchemaPath:r},a);e.mergeEvaluated(i),e.ok(a)}(m)}};function l(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):o._`${r.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,r,n){const{gen:i,it:u}=e,{allErrors:l,schemaEnv:d,opts:p}=u,f=p.passContext?a.default.this:o.nil;function h(e){const t=o._`${e}.errors`;i.assign(a.default.vErrors,o._`${a.default.vErrors} === null ? ${t} : ${a.default.vErrors}.concat(${t})`),i.assign(a.default.errors,o._`${a.default.vErrors}.length`)}function m(e){var t;if(!u.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==u.props)if(n&&!n.dynamicProps)void 0!==n.props&&(u.props=c.mergeEvaluated.props(i,n.props,u.props));else{const t=i.var("props",o._`${e}.evaluated.props`);u.props=c.mergeEvaluated.props(i,t,u.props,o.Name)}if(!0!==u.items)if(n&&!n.dynamicItems)void 0!==n.items&&(u.items=c.mergeEvaluated.items(i,n.items,u.items));else{const t=i.var("items",o._`${e}.evaluated.items`);u.items=c.mergeEvaluated.items(i,t,u.items,o.Name)}}n?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(o._`await ${(0,s.callValidateCode)(e,t,f)}`),m(t),l||i.assign(r,!0)}),(e=>{i.if(o._`!(${e} instanceof ${u.ValidationError})`,(()=>i.throw(e))),h(e),l||i.assign(r,!1)})),e.ok(r)}():e.result((0,s.callValidateCode)(e,t,f),(()=>m(t)),(()=>h(t)))}t.getValidate=l,t.callRef=d,t.default=u},242:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s=r(448),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===s.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>n._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:o,parentSchema:a,it:i}=e,{oneOf:c}=a;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const u=o.propertyName;if("string"!=typeof u)throw new Error("discriminator: requires propertyName");if(o.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");const l=t.let("valid",!1),d=t.const("tag",n._`${r}${(0,n.getProperty)(u)}`);function p(r){const s=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:r},s);return e.mergeEvaluated(o,n.Name),s}t.if(n._`typeof ${d} == "string"`,(()=>function(){const r=function(){var e;const t={},r=s(a);let n=!0;for(let t=0;t<c.length;t++){const a=c[t],i=null===(e=a.properties)||void 0===e?void 0:e[u];if("object"!=typeof i)throw new Error(`discriminator: oneOf schemas must have "properties/${u}"`);n=n&&(r||s(a)),o(i,t)}if(!n)throw new Error(`discriminator: "${u}" must be required`);return t;function s({required:e}){return Array.isArray(e)&&e.includes(u)}function o(e,t){if(e.const)i(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`);for(const r of e.enum)i(r,t)}}function i(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${u}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(n._`${d} === ${e}`),t.assign(l,p(r[e]));t.else(),e.error(!1,{discrError:s.DiscrError.Mapping,tag:d,tagName:u}),t.endIf()}()),(()=>e.error(!1,{discrError:s.DiscrError.Tag,tag:d,tagName:u}))),e.ok(l)}};t.default=o},448:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t.DiscrError||(t.DiscrError={}))},7578:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4031),s=r(9013),o=r(5068),a=r(3610),i=r(508),c=[n.default,s.default,(0,o.default)(),a.default,i.metadataVocabulary,i.contentVocabulary];t.default=c},3095:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match format "${e}"`,params:({schemaCode:e})=>n._`{format: ${e}}`},code(e,t){const{gen:r,data:s,$data:o,schema:a,schemaCode:i,it:c}=e,{opts:u,errSchemaPath:l,schemaEnv:d,self:p}=c;u.validateFormats&&(o?function(){const o=r.scopeValue("formats",{ref:p.formats,code:u.code.formats}),a=r.const("fDef",n._`${o}[${i}]`),c=r.let("fType"),l=r.let("format");r.if(n._`typeof ${a} == "object" && !(${a} instanceof RegExp)`,(()=>r.assign(c,n._`${a}.type || "string"`).assign(l,n._`${a}.validate`)),(()=>r.assign(c,n._`"string"`).assign(l,a))),e.fail$data((0,n.or)(!1===u.strictSchema?n.nil:n._`${i} && !${l}`,function(){const e=d.$async?n._`(${a}.async ? await ${l}(${s}) : ${l}(${s}))`:n._`${l}(${s})`,r=n._`(typeof ${l} == "function" ? ${e} : ${l}.test(${s}))`;return n._`${l} && ${l} !== true && ${c} === ${t} && !${r}`}()))}():function(){const o=p.formats[a];if(!o)return void function(){if(!1===u.strictSchema)return void p.logger.warn(e());throw new Error(e());function e(){return`unknown format "${a}" ignored in schema at path "${l}"`}}();if(!0===o)return;const[i,c,f]=function(e){const t=e instanceof RegExp?(0,n.regexpCode)(e):u.code.formats?n._`${u.code.formats}${(0,n.getProperty)(a)}`:void 0,s=r.scopeValue("formats",{key:a,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,n._`${s}.validate`];return["string",e,s]}(o);i===t&&e.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!d.$async)throw new Error("async format in sync schema");return n._`await ${f}(${s})`}return"function"==typeof c?n._`${f}(${s})`:n._`${f}.test(${s})`}())}())}};t.default=s},3610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=[r(3095).default];t.default=n},508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},5684:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s=r(2493),o=r(3717),a={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:a,schemaCode:i,schema:c}=e;a||c&&"object"==typeof c?e.fail$data(n._`!${(0,s.useFunc)(t,o.default)}(${r}, ${i})`):e.fail(n._`${c} !== ${r}`)}};t.default=a},3216:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s=r(2493),o=r(3717),a={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>n._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:a,schema:i,schemaCode:c,it:u}=e;if(!a&&0===i.length)throw new Error("enum must have non-empty array");const l=i.length>=u.opts.loopEnum,d=(0,s.useFunc)(t,o.default);let p;if(l||a)p=t.let("valid"),e.block$data(p,(function(){t.assign(p,!1),t.forOf("v",c,(e=>t.if(n._`${d}(${r}, ${e})`,(()=>t.assign(p,!0).break()))))}));else{if(!Array.isArray(i))throw new Error("ajv implementation error");const e=t.const("vSchema",c);p=(0,n.or)(...i.map(((t,s)=>function(e,t){const s=i[t];return"object"==typeof s&&null!==s?n._`${d}(${r}, ${e}[${t}])`:n._`${r} === ${s}`}(e,s))))}e.pass(p)}};t.default=a},9013:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(167),s=r(7935),o=r(905),a=r(7103),i=r(2267),c=r(4022),u=r(2999),l=r(8906),d=r(5684),p=r(3216),f=[n.default,s.default,o.default,a.default,i.default,c.default,u.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,p.default];t.default=f},2999:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxItems"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s}=e,o="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`${r}.length ${o} ${s}`)}};t.default=s},905:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s=r(2493),o=r(158),a={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxLength"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:a,it:i}=e,c="maxLength"===t?n.operators.GT:n.operators.LT,u=!1===i.opts.unicode?n._`${r}.length`:n._`${(0,s.useFunc)(e.gen,o.default)}(${r})`;e.fail$data(n._`${u} ${c} ${a}`)}};t.default=a},167:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s=n.operators,o={maximum:{okStr:"<=",ok:s.LTE,fail:s.GT},minimum:{okStr:">=",ok:s.GTE,fail:s.LT},exclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},exclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},a={message:({keyword:e,schemaCode:t})=>n.str`must be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${o[e].okStr}, limit: ${t}}`},i={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:a,code(e){const{keyword:t,data:r,schemaCode:s}=e;e.fail$data(n._`${r} ${o[t].fail} ${s} || isNaN(${r})`)}};t.default=i},2267:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxProperties"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s}=e,o="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`Object.keys(${r}).length ${o} ${s}`)}};t.default=s},7935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9143),s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>n.str`must be multiple of ${e}`,params:({schemaCode:e})=>n._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:s,it:o}=e,a=o.opts.multipleOfPrecision,i=t.let("res"),c=a?n._`Math.abs(Math.round(${i}) - ${i}) > 1e-${a}`:n._`${i} !== parseInt(${i})`;e.fail$data(n._`(${s} === 0 || (${i} = ${r}/${s}, ${c}))`)}};t.default=s},7103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5255),s=r(9143),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>s.str`must match pattern "${e}"`,params:({schemaCode:e})=>s._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:o,schemaCode:a,it:i}=e,c=i.opts.unicodeRegExp?"u":"",u=r?s._`(new RegExp(${a}, ${c}))`:(0,n.usePattern)(e,o);e.fail$data(s._`!${u}.test(${t})`)}};t.default=o},4022:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5255),s=r(9143),o=r(2493),a={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>s.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>s._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:a,data:i,$data:c,it:u}=e,{opts:l}=u;if(!c&&0===r.length)return;const d=r.length>=l.loopRequired;if(u.allErrors?function(){if(d||c)e.block$data(s.nil,p);else for(const t of r)(0,n.checkReportMissingProp)(e,t)}():function(){const o=t.let("missing");if(d||c){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,o){e.setParams({missingProperty:r}),t.forOf(r,a,(()=>{t.assign(o,(0,n.propertyInData)(t,i,r,l.ownProperties)),t.if((0,s.not)(o),(()=>{e.error(),t.break()}))}),s.nil)}(o,r))),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,o)),(0,n.reportMissingProp)(e,o),t.else()}(),l.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${u.schemaEnv.baseId+u.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(u,t,u.opts.strictRequired)}}function p(){t.forOf("prop",a,(r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,i,r,l.ownProperties),(()=>e.error()))}))}}};t.default=a},8906:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4327),s=r(9143),o=r(2493),a=r(3717),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>s.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>s._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:i,schema:c,parentSchema:u,schemaCode:l,it:d}=e;if(!i&&!c)return;const p=t.let("valid"),f=u.items?(0,n.getSchemaTypes)(u.items):[];function h(o,a){const i=t.name("item"),c=(0,n.checkDataTypes)(f,i,d.opts.strictNumbers,n.DataType.Wrong),u=t.const("indices",s._`{}`);t.for(s._`;${o}--;`,(()=>{t.let(i,s._`${r}[${o}]`),t.if(c,s._`continue`),f.length>1&&t.if(s._`typeof ${i} == "string"`,s._`${i} += "_"`),t.if(s._`typeof ${u}[${i}] == "number"`,(()=>{t.assign(a,s._`${u}[${i}]`),e.error(),t.assign(p,!1).break()})).code(s._`${u}[${i}] = ${o}`)}))}function m(n,i){const c=(0,o.useFunc)(t,a.default),u=t.name("outer");t.label(u).for(s._`;${n}--;`,(()=>t.for(s._`${i} = ${n}; ${i}--;`,(()=>t.if(s._`${c}(${r}[${n}], ${r}[${i}])`,(()=>{e.error(),t.assign(p,!1).break(u)}))))))}e.block$data(p,(function(){const n=t.let("i",s._`${r}.length`),o=t.let("j");e.setParams({i:n,j:o}),t.assign(p,!0),t.if(s._`${n} > 1`,(()=>(f.length>0&&!f.some((e=>"object"===e||"array"===e))?h:m)(n,o)))}),s._`${l} === false`),e.ok(p)}};t.default=i},3033:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,s="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,a="ArrayBuffer"in e;if(a)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:s&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&s&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e,t,r,n=f(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=h(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(e,t){e=u(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},p.prototype.delete=function(e){delete this.map[u(e)]},p.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},p.prototype.set=function(e,t){this.map[u(e)]=l(t)},p.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),d(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),d(e)},n&&(p.prototype[Symbol.iterator]=p.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,s=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,s||null==e._bodyInit||(s=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),v.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(s)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),s=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(s))}})),t}function $(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call($.prototype),$.prototype.clone=function(){return new $(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},$.error=function(){var e=new $(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];$.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new $(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,r){return new Promise((function(n,o){var a=new b(e,r);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var i=new XMLHttpRequest;function c(){i.abort()}i.onload=function(){var e,t,r={status:i.status,statusText:i.statusText,headers:(e=i.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var s=r.join(":").trim();t.append(n,s)}})),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var s="response"in i?i.response:i.responseText;n(new $(s,r))},i.onerror=function(){o(new TypeError("Network request failed"))},i.ontimeout=function(){o(new TypeError("Network request failed"))},i.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},i.open(a.method,a.url,!0),"include"===a.credentials?i.withCredentials=!0:"omit"===a.credentials&&(i.withCredentials=!1),"responseType"in i&&s&&(i.responseType="blob"),a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",c),i.onreadystatechange=function(){4===i.readyState&&a.signal.removeEventListener("abort",c)}),i.send(void 0===a._bodyInit?null:a._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=p,e.Request=b,e.Response=$),t.Headers=p,t.Request=b,t.Response=$,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var s=n;(t=s.fetch).default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t},4625:(e,t,r)=>{"use strict";r.r(t),r.d(t,{generateFql:()=>u,parseFql:()=>l.Z,validate:()=>n.Z});var n=r(1374);const s=e=>"boolean"==typeof e||"number"==typeof e?String(e):`"${e}"`,o=(e,t,r)=>{switch(t){case"contains":return`contains(${e}, ${s(r)})`;case"not_contains":return`!contains(${e}, ${s(r)})`;case"exists":return`${e} != null`;case"not_exists":return`${e} = null`;case"is_true":return`${e} = true`;case"is_false":return`${e} = false`;case"starts_with":return`match(${e}, "${String(r)}*")`;case"not_starts_with":return`!match(${e}, "${String(r)}*")`;case"ends_with":return`match(${e}, "*${String(r)}")`;case"not_ends_with":return`!match(${e}, "*${String(r)}")`;case"<":case">":case"<=":case">=":return`${e} ${t} ${Number(r)}`;default:return`${e} ${t} ${s(r)}`}},a=e=>e.children.map((e=>"group"===e.type?`(${a(e)})`:c(e))).join(` ${e.operator} `),i=e=>"string"==typeof e?e.replace(/[^a-zA-Z0-9._-]/g,"\\$&"):e,c=e=>{let t="";switch(e.type){case"name":case"userId":case"event":t+=o(e.type,e.operator,e.value);break;case"event-type":t+=o("type",e.operator,e.value);break;case"event-property":{const r=i(e.name);t+=o(`properties.${r}`,e.operator,e.value);break}case"event-trait":{const r=i(e.name);t+=o(`traits.${r}`,e.operator,e.value);break}case"event-context":{const r=i(e.name);t+=o(`context.${r}`,e.operator,e.value);break}default:throw new Error("Unknown condition type")}return t},u=e=>{if(e.error)throw e.error;const t=a(e);return t.startsWith("(")&&t.endsWith(")")&&2===(e=>{let t=0;for(const r of e.split(""))"("!==r&&")"!==r||t++;return t})(t)?t.slice(1,-1):t};var l=r(6146)},6146:(e,t,r)=>{"use strict";var n;r.d(t,{Z:()=>A}),function(e){e.Err="err",e.Ident="ident",e.Dot="dot",e.Operator="operator",e.Conditional="conditional",e.String="string",e.Number="number",e.Null="null",e.BrackLeft="brackleft",e.BrackRight="brackright",e.ParenLeft="parenleft",e.ParenRight="parenright",e.Comma="comma",e.EOS="eos"}(n||(n={}));const s=e=>({type:n.Ident,value:e}),o=()=>({type:n.Dot,value:"."}),a=e=>({type:n.Operator,value:e}),i=e=>({type:n.Conditional,value:e}),c=e=>({type:n.String,value:e}),u=e=>({type:n.Number,value:e}),l=()=>({type:n.Null,value:"null"}),d=()=>({type:n.BrackLeft,value:"["}),p=()=>({type:n.BrackRight,value:"]"}),f=()=>({type:n.ParenLeft,value:"("}),h=()=>({type:n.ParenRight,value:")"}),m=()=>({type:n.Comma,value:","}),y=()=>({type:n.EOS,value:"eos"});class g{constructor(e){this.code=e,this.position=0}forward(){if(this.code.length===this.position)return{char:"",isEOS:!0};const e=this.code.charAt(this.position);return this.position+=1,{char:e,isEOS:!1}}backward(){if(0===this.position)throw new RangeError;const e=this.code.charAt(this.position);return this.position-=1,{char:e,isEOS:!1}}getPosition(){return this.position}}const v="-1";function b(e){return"\r"===e||"\n"===e}function w(e){return" "===e||"\t"===e||"\n"===e}function $(e){return!!e.match(/[a-z]/i)}function _(e){return e!==v&&(!isNaN(parseFloat(e))&&isFinite(parseInt(e,10)))}function E(e){return e===v||w(e)||","===e||"]"===e||")"===e}class S extends Error{constructor(e,t){super(e),this.message=e,this.name="LexerError",this.stack=(new Error).stack,this.cursor=t}}class O{constructor(e){this.reader=new g(e),this.cursor={line:0,column:0}}lex(){const e=[];for(;;){const{char:t,isEOS:r}=this.next();if(r)return e.push(y()),e;if(!w(t)){if("!"===t){const t=this.peek();if($(t)||"("===t){e.push(a("!"));continue}}if($(t)||"!"===t||"="===t||">"===t||"<"===t||"\\"===t||"_"===t)e.push(this.lexOperatorOrConditional(t));else if(_(t)||"-"===t||"+"===t)e.push(this.lexNumber(t));else if('"'!==t&&"'"!==t)if("."!==t)if("["!==t)if("]"!==t)if(","!==t)if("("!==t){if(")"!==t)throw new S(`invalid character "${t}"`,this.cursor);e.push(h())}else e.push(f());else e.push(m());else e.push(p());else e.push(d());else e.push(o());else e.push(this.lexString(t))}}}lexString(e){let t="";for(;this.peek()!==e;){const{char:e,isEOS:r}=this.next();if(t+=e,r)throw new S("unterminated string",this.cursor);if(t.length>=1e5)throw new S("unreasonable string length",this.cursor)}return this.accept(e),c(`${e}${t}${e}`)}lexNumber(e){let t="",r=this.peek(),n=!1;for(;_(r)||"."===r;){const{char:e}=this.next();if(t+=e,"."===r){if(E(this.peek()))throw new S("unexpected terminator after decimal point",this.cursor);if(n)throw new S("multiple decimal points in one number",this.cursor);n=!0}if(t.length>=1e5)throw new S("unreasonable number length",this.cursor);r=this.peek()}return u(e+t)}lexOperatorOrConditional(e){if("="===e)return a("=");if("!"===e){if(this.accept("="))return a("!=");throw new S(`expected '=' after '!', got '${this.peek()}'`,this.cursor)}return"a"===e?this.accept("nd")?i("and"):this.lexIdent(e):"o"===e?this.accept("r")?i("or"):this.lexIdent(e):"n"===e?this.accept("ull")?l():this.lexIdent(e):"<"===e||">"===e?this.accept("=")?a(e+"="):a(e):this.lexIdent(e)}lexIdent(e){let t="",r=e;for(;;){if("\\"===r){if(this.peek()===v)throw new S("expected character after escape character, got EOS",this.cursor);r=this.next().char}if(t+=r,t.length>=1e5)throw new S("unreasonable literal length",this.cursor);if((n=this.peek())===v||!$(n)&&!_(n)&&"_"!==n&&"-"!==n&&"\\"!==n)break;r=this.next().char}var n;const o=this.peek();if(o!==v&&!E(o)&&"."!==o&&"("!==o&&"="!==o&&"!"!==o)throw new S(`expected termination character after identifier, got ${o}`,this.cursor);return s(t)}accept(e){let t="";for(const r of e){const{char:e,isEOS:r}=this.next();if(t+=e,r)return!1;if(E(e))break}return!(e!==t||!E(this.peek()))||(this.backup(t.length),!1)}next(){const{char:e,isEOS:t}=this.reader.forward();b(e)?(this.cursor.line+=1,this.cursor.column=0):this.cursor.column+=1;return{char:t?v:e,isEOS:t}}peek(){const{char:e,isEOS:t}=this.next();return t||this.backup(1),e}backup(e){for(let t=e;t>0;t--){let e;try{e=this.reader.backward().char}catch(e){return}b(e)?(this.cursor.line-=1,this.cursor.column=0):this.cursor.column-=1}}}const P={type:"event-type",event:"event",name:"name",userId:"userId",context:"event-context",properties:"event-property",traits:"event-trait"},j=e=>"string"===e.type?e.value.replace(/^"/,"").replace(/"$/,""):"number"===e.type?Number(e.value):"ident"===e.type&&["true","false"].includes(e.value)?"true"===e.value:String(e.value),T=e=>"ident"===e.type&&["contains","match"].includes(e.value),x=(e,t,r,{negate:n}={negate:!1})=>{if("contains"===e){r.shift();const e=r.shift();if(!e)throw new Error("contains() is missing a 1st argument");r.shift();const s=r.shift();if(!s)throw new Error("contains() is missing a 2nd argument");r.shift(),["event","name","userId"].includes(e.value)&&t.push({type:e.value,operator:n?"not_contains":"contains",value:String(j(s))}),/^(properties)/.test(e.value)&&t.push({type:"event-property",name:e.value.replace(/^(properties)\./,""),operator:n?"not_contains":"contains",value:String(j(s))}),/^(traits)/.test(e.value)&&t.push({type:"event-trait",name:e.value.replace(/^(traits)\./,""),operator:n?"not_contains":"contains",value:String(j(s))}),/^(context)/.test(e.value)&&t.push({type:"event-context",name:e.value.replace(/^(context)\./,""),operator:n?"not_contains":"contains",value:String(j(s))})}if("match"===e){r.shift();const e=r.shift();if(!e)throw new Error("match() is missing a 1st argument");r.shift();const s=r.shift();if(!s)throw new Error("match() is missing a 2nd argument");let o,a;r.shift(),s.value.endsWith('*"')?(o=n?"not_starts_with":"starts_with",a=String(j(s)).slice(0,-1)):(o=n?"not_ends_with":"ends_with",a=String(j(s)).slice(1)),["event","name","userId"].includes(e.value)&&t.push({type:e.value,operator:o,value:a}),/^(properties)/.test(e.value)&&t.push({type:"event-property",name:e.value.replace(/^(properties)\./,""),operator:o,value:a}),/^(traits)/.test(e.value)&&t.push({type:"event-trait",name:e.value.replace(/^(traits)\./,""),operator:o,value:a}),/^(context)/.test(e.value)&&t.push({type:"event-context",name:e.value.replace(/^(context)\./,""),operator:o,value:a})}},k=e=>{var t;const r=[];let s="and",o=e.shift();for(;o&&"eos"!==o.type;){if("ident"===o.type){const[n]=(null!==(t=o.value)&&void 0!==t?t:"").split("."),s=P[n];if(s){const t=e.shift();if(!t)throw new Error("Operator token is missing");const n=e.shift();if(!n)throw new Error("Value token is missing");const a="="===t.value&&"true"===n.value,i="="===t.value&&"false"===n.value,c="!="===t.value&&"null"===n.value,u="="===t.value&&"null"===n.value;"event"===s?r.push({type:"event",operator:t.value,value:String(j(n))}):"event-type"===s?r.push({type:"event-type",operator:t.value,value:String(j(n))}):"name"===s?c?r.push({type:"name",operator:"exists"}):u?r.push({type:"name",operator:"not_exists"}):r.push({type:"name",operator:t.value,value:String(j(n))}):"userId"===s?c?r.push({type:"userId",operator:"exists"}):u?r.push({type:"userId",operator:"not_exists"}):a?r.push({type:"userId",operator:"is_true"}):i?r.push({type:"userId",operator:"is_false"}):r.push({type:"userId",operator:t.value,value:String(j(n))}):"event-property"===s?c?r.push({type:"event-property",name:o.value.replace(/^(properties)\./,""),operator:"exists"}):u?r.push({type:"event-property",name:o.value.replace(/^(properties)\./,""),operator:"not_exists"}):a?r.push({type:"event-property",name:o.value.replace(/^(properties)\./,""),operator:"is_true"}):i?r.push({type:"event-property",name:o.value.replace(/^(properties)\./,""),operator:"is_false"}):r.push({type:"event-property",name:o.value.replace(/^(properties)\./,""),operator:t.value,value:j(n)}):"event-trait"===s?c?r.push({type:"event-trait",name:o.value.replace(/^(traits)\./,""),operator:"exists"}):u?r.push({type:"event-trait",name:o.value.replace(/^(traits)\./,""),operator:"not_exists"}):a?r.push({type:"event-trait",name:o.value.replace(/^(traits)\./,""),operator:"is_true"}):i?r.push({type:"event-trait",name:o.value.replace(/^(traits)\./,""),operator:"is_false"}):r.push({type:"event-trait",name:o.value.replace(/^(traits)\./,""),operator:t.value,value:j(n)}):"event-context"===s&&(c?r.push({type:"event-context",name:o.value.replace(/^(context)\./,""),operator:"exists"}):u?r.push({type:"event-context",name:o.value.replace(/^(context)\./,""),operator:"not_exists"}):a?r.push({type:"event-context",name:o.value.replace(/^(context)\./,""),operator:"is_true"}):i?r.push({type:"event-context",name:o.value.replace(/^(context)\./,""),operator:"is_false"}):r.push({type:"event-context",name:o.value.replace(/^(context)\./,""),operator:t.value,value:j(n)}))}T(o)&&x(o.value,r,e)}if("operator"===o.type&&"!"===o.value&&T(e[0])){const t=e[0].value;e.shift(),x(t,r,e,{negate:!0})}if("parenleft"===o.type){const t=[];let s=e.shift();for(;"parenright"!==s.type;)t.push(s),s=e.shift();t.push({type:n.EOS,value:"eos"}),r.push(k(t))}"conditional"===o.type&&(s=o.value),o=e.shift()}return r.length>1?{type:"group",operator:s,children:r}:r[0]},A=e=>{try{const t=k((e=>{const t=[];let r=0;for(;e[r];){const s=t[t.length-1],o=e[r],a=e[r+1];if("ident"===(null==s?void 0:s.type)&&"dot"===o.type&&"ident"===(null==a?void 0:a.type)){const e=t.pop();t.push({type:n.Ident,value:`${null==e?void 0:e.value}${o.value}${a.value}`}),r+=2}else t.push(e[r]),r++}return t})(function(e){try{return{tokens:new O(e).lex()}}catch(e){return{tokens:[],error:e}}}(e).tokens));return"group"!==t.type?{type:"group",operator:"and",children:[t]}:t}catch(t){return{error:t instanceof Error?t:new Error(`Error while parsing ${e}`)}}}},1374:(e,t,r)=>{"use strict";function n(e,t,r){if(!t)return r;const n=(Array.isArray(t)?t:t.match(/([^[.\]])+/g)).reduce(((e,t)=>e&&e[t]),e);return void 0===n?r:n}r.d(t,{Z:()=>o});const s=(e,t)=>"and"===e.operator?e.children.every((e=>a(e,t))):"or"===e.operator&&e.children.some((e=>a(e,t))),o=(e,t)=>!e.error&&void 0!==t&&s(e,t),a=(e,t)=>"event-type"===e.type?i(t.type,e.operator,e.value):"event"===e.type?i(t.event,e.operator,e.value):"name"===e.type?i(t.name,e.operator,e.value):"userId"===e.type?i(t.userId,e.operator,e.value):"event-property"===e.type?i(n(t.properties,e.name),e.operator,e.value):"event-trait"===e.type?i(n(t.traits,e.name),e.operator,e.value):"event-context"===e.type?i(n(t.context,e.name),e.operator,e.value):"group"===e.type&&s(e,t),i=(e,t,r)=>{switch(t){case"=":return e===String(r);case"!=":return e!==String(r);case"<":return"number"==typeof e&&Number(e)<Number(r);case"<=":return"number"==typeof e&&Number(e)<=Number(r);case">":return"number"==typeof e&&Number(e)>Number(r);case">=":return"number"==typeof e&&Number(e)>=Number(r);case"contains":return"string"==typeof e&&e.includes(String(r));case"not_contains":return"string"==typeof e&&!e.includes(String(r));case"starts_with":return"string"==typeof e&&e.startsWith(String(r));case"not_starts_with":return"string"==typeof e&&!e.startsWith(String(r));case"ends_with":return"string"==typeof e&&e.endsWith(String(r));case"not_ends_with":return"string"==typeof e&&!e.endsWith(String(r));case"exists":return null!=e;case"not_exists":return null==e;case"is_true":return"boolean"==typeof e&&!0===e;case"is_false":return"boolean"==typeof e&&!1===e;default:return!1}}},1209:()=>{},2501:(e,t,r)=>{"use strict";function n(e,t){void 0===t&&(t=e.constructor);var r=Error.captureStackTrace;r&&r(e,t)}r.r(t),r.d(t,{CustomError:()=>a,customErrorFactory:()=>c});var s,o=(s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},s(e,t)},function(e,t){function r(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=function(e){function t(t){var r,s,o,a=this.constructor,i=e.call(this,t)||this;return Object.defineProperty(i,"name",{value:a.name,enumerable:!1,configurable:!0}),r=i,s=a.prototype,(o=Object.setPrototypeOf)?o(r,s):r.__proto__=s,n(i),i}return o(t,e),t}(Error),i=function(){for(var e=arguments,t=0,r=0,n=arguments.length;r<n;r++)t+=e[r].length;var s=Array(t),o=0;for(r=0;r<n;r++)for(var a=arguments[r],i=0,c=a.length;i<c;i++,o++)s[o]=a[i];return s};function c(e,t){function r(){for(var s=arguments,o=[],a=0;a<arguments.length;a++)o[a]=s[a];if(!(this instanceof r))return new(r.bind.apply(r,i([void 0],o)));t.apply(this,o),Object.defineProperty(this,"name",{value:e.name||t.name,enumerable:!1,configurable:!0}),e.apply(this,o),n(this,r)}return void 0===t&&(t=Error),Object.defineProperties(r,{prototype:{value:Object.create(t.prototype,{constructor:{value:r,writable:!0,configurable:!0}})}})}},7814:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},2081:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},n={};function s(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e].call(o.exports,o,o.exports,s),o.exports}s.m=r,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,r)=>(s.f[r](e,t),t)),[])),s.u=e=>e+"/6f86f4850472bffb83f9.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="Destination:",s.l=(r,n,o,a)=>{if(e[r])e[r].push(n);else{var i,c;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var d=u[l];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==t+o){i=d;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",t+o),i.src=r),e[r]=[n];var p=(t,n)=>{i.onerror=i.onload=null,clearTimeout(f);var s=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),s&&s.forEach((e=>e(n))),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),c&&document.head.appendChild(i)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&!e;)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e+"../"})(),(()=>{var e={421:0};s.f.j=(t,r)=>{var n=s.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,s)=>n=e[t]=[r,s]));r.push(n[2]=o);var a=s.p+s.u(t),i=new Error;s.l(a,(r=>{if(s.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[a,i,c]=r,u=0;if(a.some((t=>0!==e[t]))){for(n in i)s.o(i,n)&&(s.m[n]=i[n]);if(c)c(s)}for(t&&t(r);u<a.length;u++)o=a[u],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=self.webpackChunkDestination=self.webpackChunkDestination||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var o={};(()=>{"use strict";s.d(o,{default:()=>L});s(2699);var e=s(3531),t=s.n(e);const r=e=>{if(e.username||e.password){const r=e.username||"",n=e.password||"";return{headers:{Authorization:`Basic ${t()(`${r}:${n}`)}`}}}},n=async(e,t,r)=>(Object.defineProperty(r.headers,"toJSON",{enumerable:!1,value:()=>(e=>{const t={};for(const[r,n]of e.entries())t[r]=n;return t})(r.headers)}),r),a=async(e,t,r)=>{const n=t.statsContext?.statsClient,s=r;let o;if(t.skipResponseCloning)o=await r.text();else{n?.incr("before-response-clone",1);const e=r.clone();o=await e.text(),n?.incr("after-response-clone",1)}const a=t.agent;let i;a&&a.destroy();try{i=s.headers.get("content-type")?.includes("application/json")?JSON.parse(o):o}catch(e){}return s.content=o,s.data=i,s};var i=s(7948),c=s.n(i),u=s(2501),l=s(3033);const d=s.n(l)();var p=s(6933);if(null!=globalThis.process&&"object"==typeof globalThis.process.env&&globalThis.process.env.DEFAULT_REQUEST_TIMEOUT){const e=parseInt(globalThis.process.env.DEFAULT_REQUEST_TIMEOUT,10);Number.isNaN(e)}const f=e=>null!==e&&"object"==typeof e;function h(e,t){const r=new l.Headers(e||{});return new l.Headers(t||{}).forEach(((e,t)=>{"undefined"===e?r.delete(t):r.set(t,e)})),r}function m(...e){let t={},r={};for(const n of e){if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(f(n)){for(let[e,r]of Object.entries(n))f(r)&&e in t&&(r=m(t[e],r)),t[e]=r;f(n.headers)&&(r=h(r,n.headers))}t.headers=r}return t}function y(...e){for(const t of e)if(!(0,p.Kn)(t))throw new TypeError("The 'options' argument must be an object");return m({},...e)}class g extends u.CustomError{constructor(e,t,r){super(e.statusText??String(e.status??"Unknown response error")),this.response=e,this.request=t,this.options=r}}class v extends u.CustomError{constructor(e,t){super("Request timed out"),this.request=e,this.options=t,this.code="ETIMEDOUT"}}class b{constructor(e,t={}){this.setOptions(e,t)}setOptions(e,t){var r;if(this.options={...t,method:(r=t.method??"get",r.toUpperCase()),throwHttpErrors:!1!==t.throwHttpErrors,timeout:t.timeout??1e4},this.abortController=new(c()),this.options.signal&&this.options.signal.addEventListener("abort",(()=>{this.abortController.abort()})),this.options.signal=this.abortController.signal,this.request=new l.Request(e,this.options),this.options.searchParams){const e=new URLSearchParams(this.options.searchParams),t=new URL(this.request.url);t.search=e.toString(),this.request=new l.Request(new l.Request(t.toString(),this.request),this.options)}void 0!==this.options.json&&(this.options.body=JSON.stringify(this.options.json),this.request.headers.set("content-type","application/json"),this.request=new l.Request(this.request,{body:this.options.body}))}async executeRequest(){let e=await this.fetch();for(const t of this.options.afterResponse??[]){const r=await t(this.request,this.options,e);r instanceof l.Response&&(e=r)}if(!e.ok&&this.options.throwHttpErrors)throw new g(e,this.request,this.options);return e}async fetch(){for(const e of this.options.beforeRequest??[]){const t=await e({...this.options});t&&(0,p.Kn)(t)&&this.setOptions(this.request.url,y(this.options,t))}return!1===this.options.timeout?d(this.request.clone()):(e=this.request.clone(),t=this.abortController,r=this.options,new Promise(((n,s)=>{const o=setTimeout((()=>{t&&t.abort(),s(new v(e,r))}),r.timeout);d(e).then(n).catch(s).then((()=>clearTimeout(o)))})));var e,t,r}}(function e(t={}){const r=(e,r={})=>new b(e,y(t,r)).executeRequest();return r.extend=r=>e(y(t,r)),r})({timeout:1e4,headers:{"user-agent":"Segment (Actions)"},beforeRequest:[r],afterResponse:[a,n]});s(3807),s(5375);var w=s(3944),$=s.n(w),_=s(3052),E=s.n(_),S=s(8879),O=s.n(S);const P=E()(new($())({coerceTypes:"array",allErrors:!0,allowUnionTypes:!0,verbose:!0,removeAdditional:!0}));P.addFormat("text",!0),P.addFormat("date-like",(e=>{let t=O()(e);return String(Number(e))===e&&(13===e.length&&(t=O()(Number(e))),t=O().unix(Number(e))),t.isValid()}));var j;!function(e){e.INVALID_AUTHENTICATION="INVALID_AUTHENTICATION",e.PAYLOAD_VALIDATION_FAILED="PAYLOAD_VALIDATION_FAILED",e.INVALID_CURRENCY_CODE="INVALID_CURRENCY_CODE",e.RETRYABLE_ERROR="RETRYABLE_ERROR",e.REFRESH_TOKEN_EXPIRED="REFRESH_TOKEN_EXPIRED",e.OAUTH_REFRESH_FAILED="OAUTH_REFRESH_FAILED",e.SELF_TIMEOUT="SELF_TIMEOUT"}(j||(j={}));for(var T=256,x=[];T--;)x[T]=(T+256).toString(16).substring(1);function k(e){const t={};for(const r of Object.keys(e)){const n=e[r].default;void 0!==n&&(t[r]=n)}return t}s(7128);var A=s(7899);function C(e){if("number"==typeof e){let t=O().unix(e).unix();return 13==t.toString().length&&(t=Math.floor(t/1e3)),t}return O()(e).unix()}function I(e){const t={};if(e)for(const[r,n]of Object.entries(e))(0,p.kJ)(n)||(0,p.Kn)(n)||(t[r]=n);return t}function N(e,t){const r={};return void 0!==e&&(r.hide_default_launcher=e),"#IntercomDefaultWidget"!==t&&(r.widget={activator:t}),r}function D(e){return!(0,A.isNonEmpty)(e)}const R={title:"Track Event",description:"Submit an event to Intercom.",defaultSubscription:'type = "track"',platform:"web",fields:{event_name:{description:"The name of the event.",label:"Event Name",type:"string",required:!0,default:{"@path":"$.event"}},revenue:{description:"The amount associated with a purchase. Segment will multiply by 100 as Intercom requires the amount in cents.",label:"Revenue",type:"number",required:!1,default:{"@path":"$.properties.revenue"}},currency:{description:"The currency of the purchase amount. Segment will default to USD if revenue is provided without a currency.",label:"Currency",type:"string",required:!1,default:{"@path":"$.properties.currency"}},event_metadata:{description:"Optional metadata describing the event.",label:"Event Metadata",type:"object",required:!1,default:{"@path":"$.properties"}}},perform:(e,t)=>{const{event_name:r,event_metadata:n,...s}=t.payload,o={...s},a=e.richLinkProperties?e.richLinkProperties:[],i={};n&&0!=a.length&&Object.entries(n).forEach((([e,t])=>{a.includes(e)&&(i[e]=t)}));const c=I(n);let u={};o.revenue&&(u={amount:100*o.revenue,currency:o.currency??"USD"},delete c.revenue,delete c.currency),e("trackEvent",r,{...c,...i,...!D(u)&&{price:u}})}},M={company_id:{description:"The unique identifier of the company.",label:"Company ID",type:"string",required:!0},name:{description:"The name of the company.",label:"Company Name",type:"string",required:!0},created_at:{description:"The time the company was created in your system.",label:"Company Creation Time",type:"datetime",required:!1},plan:{description:"The name of the plan you have associated with the company.",label:"Company Plan",type:"string",required:!1},monthly_spend:{description:"The monthly spend of the company, e.g. how much revenue the company generates for your business.",label:"Monthly Spend",type:"integer",required:!1},size:{description:"The number of employees in the company.",label:"Company Size",type:"integer",required:!1},website:{description:"The URL for the company website.",label:"Company Website",type:"string",required:!1},industry:{description:"The industry that the company operates in.",label:"Industry",type:"string",required:!1},company_custom_traits:{description:"The custom attributes for the company object.",label:"Company Custom Attributes",type:"object",required:!1,defaultObjectUI:"keyvalue"}},q={title:"Identify User",description:"Create or update a user in Intercom.",defaultSubscription:'type = "identify" or type = "page"',platform:"web",fields:{user_id:{description:"A unique identifier for the user.",label:"User ID",type:"string",required:!1,default:{"@path":"$.userId"}},custom_traits:{description:"The user's custom attributes.",label:"Custom Attributes",type:"object",required:!1,defaultObjectUI:"keyvalue"},name:{description:"The user's name.",label:"Name",type:"string",required:!1,default:{"@path":"$.traits.name"}},phone:{description:"The user's phone number.",label:"Phone Number",type:"string",required:!1,default:{"@path":"$.traits.phone"}},unsubscribed_from_emails:{description:"The user's email unsubscribe status.",label:"Unsubscribed From Emails",type:"boolean",required:!1},language_override:{description:"The user's messenger language (instead of relying on browser language settings).",label:"Language Override",type:"string",required:!1},email:{description:"The user's email address.",label:"Email Address",type:"string",required:!1,default:{"@path":"$.traits.email"}},created_at:{description:"The time the user was created in your system.",label:"User Creation Time",type:"datetime",required:!1,default:{"@if":{exists:{"@path":"$.traits.createdAt"},then:{"@path":"$.traits.createdAt"},else:{"@path":"$.traits.created_at"}}}},avatar_image_url:{description:"The URL for the user's avatar/profile image.",label:"Avatar",type:"string",required:!1,default:{"@path":"$.traits.avatar"}},user_hash:{description:"The user hash used for identity verification. See [Intercom docs](https://www.intercom.com/help/en/articles/183-enable-identity-verification-for-web-and-mobile) for more information on how to set this field.",label:"User Hash",type:"string",required:!1,default:{"@if":{exists:{"@path":"$.integrations.Intercom.user_hash"},then:{"@path":"$.integrations.Intercom.user_hash"},else:{"@path":"$.integrations.Intercom.userHash"}}}},company:{description:"The user's company.",label:"Company",type:"object",required:!1,properties:M,default:{company_id:{"@path":"$.traits.company.id"},name:{"@path":"$.traits.company.name"},created_at:{"@if":{exists:{"@path":"$.traits.company.createdAt"},then:{"@path":"$.traits.company.createdAt"},else:{"@path":"$.traits.company.created_at"}}},plan:{"@path":"$.traits.company.plan"},size:{"@path":"$.traits.company.size"},website:{"@path":"$.traits.company.website"},industry:{"@path":"$.traits.company.industry"},monthly_spend:{"@path":"$.traits.company.monthly_spend"}}},companies:{description:"The array of companies the user is associated to.",label:"Companies",type:"object",multiple:!0,required:!1,properties:M,default:{"@arrayPath":["$.traits.companies",{company_id:{"@path":"$.id"},name:{"@path":"$.name"},created_at:{"@if":{exists:{"@path":"$.createdAt"},then:{"@path":"$.createdAt"},else:{"@path":"$.created_at"}}},plan:{"@path":"$.plan"},size:{"@path":"$.size"},website:{"@path":"$.website"},industry:{"@path":"$.industry"},monthly_spend:{"@path":"$.monthly_spend"}}]}},hide_default_launcher:{description:"Selectively show the chat widget. As per [Intercom docs](https://www.intercom.com/help/en/articles/189-turn-off-show-or-hide-the-intercom-messenger), you want to first hide the Messenger for all users inside the Intercom UI using Messenger settings. Then think about how you want to programmatically decide which users you would like to show the widget to.",label:"Hide Default Launcher",type:"boolean",required:!1,default:{"@if":{exists:{"@path":"$.context.Intercom.hideDefaultLauncher"},then:{"@path":"$.context.Intercom.hideDefaultLauncher"},else:{"@path":"$.context.Intercom.hide_default_launcher"}}}}},perform:(e,t)=>{const{custom_traits:r,avatar_image_url:n,...s}=t.payload,o={...s};D(o.company?.company_custom_traits)&&o.company?.company_custom_traits,D(o.company)&&delete o.company;const a=Array.isArray(o.companies)?[...o.companies]:[],i=[o,o.company,...a];for(const e of i)e&&e?.created_at&&(e.created_at=C(e.created_at));const c=I(r);if(o.company){const{company_custom_traits:e,...t}=o.company,r=I(e);o.company={...t,...r}}o.companies&&(o.companies=o.companies.map((e=>{const{company_custom_traits:t,...r}=e;return e={...r,...I(t)}})));const u=N(o.hide_default_launcher,e.activator);let l={};n&&(l={image_url:n,type:"avatar"}),e("update",{...o,...c,...u,...!D(l)&&{avatar:l}})}},F={title:"Identify Company",description:"Create or update a company in Intercom.",defaultSubscription:'type = "group"',platform:"web",fields:{company:{description:"The user's company.",label:"Company",type:"object",required:!0,properties:{company_id:{description:"The unique identifier of the company.",label:"Company ID",type:"string",required:!0},name:{description:"The name of the company.",label:"Company Name",type:"string",required:!0},created_at:{description:"The time the company was created in your system.",label:"Company Creation Time",type:"datetime",required:!1},plan:{description:"The name of the plan you have associated with the company.",label:"Company Plan",type:"string",required:!1},monthly_spend:{description:"The monthly spend of the company, e.g. how much revenue the company generates for your business.",label:"Monthly Spend",type:"integer",required:!1},size:{description:"The number of employees in the company.",label:"Company Size",type:"integer",required:!1},website:{description:"The URL for the company website.",label:"Company Website",type:"string",required:!1},industry:{description:"The industry that the company operates in.",label:"Industry",type:"string",required:!1},company_custom_traits:{description:"The custom attributes for the company object.",label:"Company Custom Attributes",type:"object",required:!1,defaultObjectUI:"keyvalue"}},default:{company_id:{"@path":"$.groupId"},name:{"@path":"$.traits.name"},created_at:{"@if":{exists:{"@path":"$.traits.createdAt"},then:{"@path":"$.traits.createdAt"},else:{"@path":"$.traits.created_at"}}},plan:{"@path":"$.traits.plan"},size:{"@path":"$.traits.size"},website:{"@path":"$.traits.website"},industry:{"@path":"$.traits.industry"},monthly_spend:{"@path":"$.traits.monthly_spend"}}},hide_default_launcher:{description:"Selectively show the chat widget. As per [Intercom docs](https://www.intercom.com/help/en/articles/189-turn-off-show-or-hide-the-intercom-messenger), you want to first hide the Messenger for all users inside the Intercom UI using Messenger settings. Then think about how you want to programmatically decide which users you would like to show the widget to.",label:"Hide Default Launcher",type:"boolean",required:!1,default:{"@if":{exists:{"@path":"$.context.Intercom.hideDefaultLauncher"},then:{"@path":"$.context.Intercom.hideDefaultLauncher"},else:{"@path":"$.context.Intercom.hide_default_launcher"}}}}},perform:(e,t)=>{const{company_custom_traits:r,...n}=t.payload.company;let s={...n};s?.created_at&&(s.created_at=C(s.created_at));const o=I(r);s={...s,...o};e("update",{company:s,...N(t.payload.hide_default_launcher,e.activator)})}},L=function(e){const t=async t=>(await s.e(845).then(s.bind(s,3962))).generatePlugins(e,t,t.subscriptions||[]);return t.pluginName=e.name,t}({name:"Intercom Web (Actions)",slug:"actions-intercom-web",mode:"device",presets:[{name:"Track Event",subscribe:'type = "track"',partnerAction:"trackEvent",mapping:k(R.fields),type:"automatic"},{name:"Identify User",subscribe:'type = "identify" or type = "page"',partnerAction:"identifyUser",mapping:k(q.fields),type:"automatic"},{name:"Identify Company",subscribe:'type = "group"',partnerAction:"identifyCompany",mapping:k(F.fields),type:"automatic"}],settings:{appId:{description:"The app_id of your Intercom app which will indicate where to store any data.",label:"App ID",type:"string",required:!0},activator:{description:'By default, Intercom will inject their own inbox button onto the page, but you can choose to use your own custom button instead by providing a CSS selector, e.g. #my-button. You must have the "Show the Intercom Inbox" setting enabled for this to work. The default value is #IntercomDefaultWidget.',label:"Custom Inbox Button Selector",type:"string",required:!1,default:"#IntercomDefaultWidget"},richLinkProperties:{description:"A list of rich link property keys.",label:"Rich Link Properties",type:"string",multiple:!0,required:!1},apiBase:{description:"The regional API to use for processing the data",label:"Regional Data Hosting",type:"string",choices:[{label:"US",value:"https://api-iam.intercom.io"},{label:"EU",value:"https://api-iam.eu.intercom.io"},{label:"Australia",value:"https://api-iam.au.intercom.io"}],default:"https://api-iam.intercom.io",required:!1}},initialize:async({settings:e},t)=>{!function({appId:e}){var t=e;!function(){var e=window,r=e.Intercom;if("function"==typeof r)r("reattach_activator"),r("update",e.intercomSettings);else{var n=document,s=function(){s.c(arguments)};s.q=[],s.c=function(e){s.q.push(e)},e.Intercom=s;var o=function(){var e=n.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://widget.intercom.io/widget/"+t;var r=n.getElementsByTagName("script")[0];r.parentNode.insertBefore(e,r)};"complete"===document.readyState?o():e.attachEvent?e.attachEvent("onload",o):e.addEventListener("load",o,!1)}}()}({appId:e.appId}),function({appId:e}){window.intercomSettings?(window.intercomSettings.app_id=e,window.intercomSettings.installation_type="s"):window.intercomSettings={app_id:e,installation_type:"s"}}({appId:e.appId});const r=window.Intercom;return function(e,t={}){window&&window.Intercom&&window.Intercom("boot",{app_id:e,installation_type:"s",...t})}(e.appId,{api_base:e.apiBase}),await t.resolveWhen((()=>window.Intercom!==r),100),window.Intercom.richLinkProperties=e.richLinkProperties,window.Intercom.appId=e.appId,window.Intercom.activator=e.activator,window.Intercom},actions:{trackEvent:R,identifyUser:q,identifyCompany:F}})})(),window.intercomDestination=o.default})();
//# sourceMappingURL=be5c4d306768b843f013.js.map