(self.webpackChunkDestination=self.webpackChunkDestination||[]).push([[845],{1291:(e,t,r)=>{"use strict";const n=r(6150),o=r(6086);class a 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?o(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=a},6086:(e,t,r)=>{"use strict";const n=r(1209),o=/\s+at.*(?:\(|\s)(.*)\)?/,a=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,i=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(o);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")&&!a.test(r)})).filter((e=>""!==e.trim())).map((e=>t.pretty?e.replace(o,((e,t)=>e.replace(t,t.replace(i,"~")))):e)).join("\n"))},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))}},3962:(e,t,r)=>{"use strict";r.r(t),r.d(t,{generatePlugins:()=>u});var n=r(3807),o=r(1374),a=r(6146);async function i(e,t){const r=Array.from(window.document.querySelectorAll("script")).find((t=>t.src===e));if(void 0!==r){const e=r?.getAttribute("status");if("loaded"===e)return r;if("loading"===e)return new Promise(((e,t)=>{r.addEventListener("load",(()=>e(r))),r.addEventListener("error",(e=>t(e)))}))}return new Promise(((r,n)=>{const o=window.document.createElement("script");o.type="text/javascript",o.src=e,o.async=!0,o.setAttribute("status","loading");for(const[e,r]of Object.entries(t??{}))o.setAttribute(e,r);o.onload=()=>{o.onerror=o.onload=null,o.setAttribute("status","loaded"),r(o)},o.onerror=()=>{o.onerror=o.onload=null,o.setAttribute("status","error"),n(new Error(`Failed to load ${e}`))};const a=window.document.getElementsByTagName("script")[0];a.parentElement?.insertBefore(o,a)}))}async function s(e,t){return new Promise(((r,n)=>{if(e())return void r();const o=()=>setTimeout((()=>{e()?r():o()}),t);o()}))}function u(e,t,r){let u,c,l,p=!1;const h=async(r,n)=>{p||(l?await l:(c=n,l=e.initialize?.({settings:t,analytics:c},{loadScript:i,resolveWhen:s}),u=await l,p=!0))};return Object.entries(e.actions).reduce(((i,[s,l])=>{const f=r.filter((e=>e.enabled&&e.partnerAction===s));if(0===f.length)return i;async function d(e){const r=[];for(const i of f){if(!(0,o.Z)((0,a.Z)(i.subscribe),e.event))continue;const s=i.mapping??{},p={payload:(0,n.vs)(s,e.event),mapping:s,settings:t,analytics:c,context:e};r.push(l.perform(u,p))}return await Promise.all(r),e}const y={name:`${e.name} ${s}`,type:l.lifecycleHook??"destination",version:"0.1.0",ready:()=>Promise.resolve(),isLoaded:()=>p,load:h,track:d,page:d,alias:d,identify:d,group:d};return i.push(y),i}),[])}},9768:e=>{e.exports={Liquid:class{constructor(e){this.args=e}parseAndRenderSync(e){return e}registerTag(e,t){}registerFilter(e,t){}}}},7128:(e,t,r)=>{"use strict";let n;r.d(t,{U:()=>o});try{n=new RegExp("\\[(?=\"|'|\\d)|\\.|(?<=\"|'|\\d)]+","g")}catch(e){n=/\[|\.|]+/g}function o(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:()=>J,a8:()=>R,vs:()=>U});var n=r(7128),o=r(6933);function a(e){if(!(0,o.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 i(e){if(Array.isArray(e))return e.map((e=>i(e)));if((0,o.Kn)(e)){const t=Object.assign({},e);return Object.keys(t).forEach((e=>{void 0===t[e]?delete t[e]:t[e]=i(t[e])})),t}return e}var s=r(1291),u=r.n(s),c=r(2501);class l extends c.CustomError{constructor(e,t=[]){super(`/${t.join("/")} ${e}.`)}}function p(e){const t=[];return e.forEach((e=>{e instanceof u()?t.push(...e):t.push(e)})),t}function h(e){const t=(0,o.X6)(e);return"object"===t&&Object.keys(e).some((e=>e.startsWith("@")))?"directive":t}const f={};function d(e,t=[]){if(!a(e)&&!(0,o.Kn)(e)){const r=(0,o.X6)(e);throw new l(`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 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 i=n[0],s=f[i];if("function"!=typeof s)throw new l(`has an invalid directive: ${i}`,t);s(e[i],t)}function y(e,t=[]){const r=h(e);switch(r){case"directive":return d(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 ${O(r)} ${r}`,t)}}function v(e,t=[]){const r=h(e);switch(r){case"directive":return d(e,t);case"string":return;default:throw new l(`should be a string or a mapping directive but it is ${O(r)} ${r}`,t)}}function g(e,t=[]){const r=h(e);switch(r){case"directive":return d(e,t);case"object":return k(e,t);default:throw new l(`should be a object or a mapping directive but it is ${O(r)} ${r}`,t)}}function m(...e){return(t,r=[])=>{e.forEach((e=>{e(t,r)}))}}function w(e,t){return(r,n=[])=>{if("string"==typeof r&&r.lengtht)throw new l(`should be a string of length ${t} or less`,n)}}function b(e,t=[]){const r=h(e);if("string"!==r)throw new l(`should be a string but it is ${O(r)} ${r}`,t)}function x(...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(e,t=[]){const r=h(e);if("boolean"!==r)throw new l(`should be a boolean but it is ${O(r)} ${r}`,t)}function k(e,t=[]){const r=h(e);if("object"!==r)throw new l(`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 l(`shouldn't have directive (@-prefixed) keys but it has ${JSON.stringify(a)}`,t);const i=[];if(o.forEach((e=>{try{q(n[e],[...t,e])}catch(e){i.push(e)}})),i.length)throw new(u())(p(i))}function _(e,t,r=[]){k(e,r);const n=[],o=e;if(Object.entries(t).forEach((([e,{required:t,optional:a}])=>{try{if(t){if(void 0===o[e])throw new l(`should have field ${JSON.stringify(e)} but it doesn't`,r);t(o[e],[...r,e])}else a&&void 0!==o[e]&&a(o[e],[...r,e])}catch(e){n.push(e)}})),n.length)throw new(u())(p(n))}function j(e,t=[]){const r=(0,o.X6)(e);if("array"!==r)throw new l(`should be an array but it is ${O(r)} ${r}`,t)}function $(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 u())throw e;throw new l(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 q(e,t=[]){switch(h(e)){case"directive":return d(e,t);case"object":return k(e,t);case"array":return j(e,t);default:return null}}function S(e,t=!0){return null==e?t?[]:e:(0,o.kJ)(e)?e:[e]}$("@if",((e,t)=>{_(e,{exists:{optional:y},then:{optional:y},else:{optional:y}},t)})),$("@case",((e,t)=>{_(e,{operator:{optional:b},value:{optional:v}},t)})),$("@replace",((e,t)=>{_(e,{pattern:{required:m(b,w(1,J))},replacement:{optional:m(b,w(0,R))},value:{required:v},ignorecase:{optional:E},global:{optional:E}},t)})),$("@arrayPath",((e,t)=>{const r=e;j(r,t),v(r[0],t),q(r[1],t)})),$("@path",((e,t)=>{v(e,t)})),$("@json",((e,t)=>{_(e,{value:{required:y},mode:{required:x("encode","decode")}},t)})),$("@flatten",((e,t)=>{_(e,{separator:{optional:b},value:{required:y}},t)})),$("@merge",((e,t)=>{_(e,{direction:{optional:x("left","right")},objects:{required:j}},t);e.objects.forEach((e=>{g(e)}))})),$("@template",((e,t)=>{v(e,t)})),$("@literal",((e,t)=>{y(e,t)})),$("@transform",((e,t)=>{_(e,{apply:{required:g},mapping:{required:g}},t)})),$("@excludeWhenNull",((e,t)=>{y(e,t)})),$("@liquid",((e,t)=>{b(e,t)}));const A=(e,t="",r=".",n=!1)=>(0,o.Kn)(e)||!n&&(0,o.kJ)(e)?Object.entries(e).reduce(((e,[o,a])=>({...e,...A(a,t?`${t}${r}${o}`:o,r,n)})),{}):{[t]:e};var N=r(5145),I=r(8599);const P="__segment_internal_directive",L={},C=/^@[a-z][a-zA-Z0-9]+$/;function K(e,t){if(!C.exec(e))throw new Error(`"${e}" is an invalid directive name`);L[e]=t}function W(e,t){K(e,((r,n)=>{const a=F(r,n);if("string"!=typeof a)throw new Error(`${e}: expected string, got ${(0,o.X6)(a)}`);return t(a,n)}))}function T(e,t,r){const n=Object.keys(e).find((e=>e.startsWith("@"))),a=L[n],i=e[n];if("function"!=typeof a)throw new Error(`${n} is not a valid directive, got ${(0,o.X6)(a)}`);return"@liquid"===n?a(i,t,r):a(i,t)}K("@if",((e,t)=>{let r=!1;if(!(0,o.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=F(e.exists,t);r=null!=n}else if(void 0!==e.blank){const n=F(e.blank,t);r=null!=n&&""!=n}return r&&void 0!==e.then?F(e.then,t):!r&&e.else?F(e.else,t):void 0})),K("@case",((e,t)=>{if(!(0,o.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=F(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 J=10,R=10;function X(e,t,r,n){if(t.length>J)throw new Error(`@replace requires a "pattern" less than ${J} characters`);if(r.length>R)throw new Error(`@replace requires a "replacement" less than ${R} characters`);return t=t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),e.replace(new RegExp(t,n),r)}function B(e){if((0,o.Kn)(e)){const t=Object.assign({},e);for(const r of Object.keys(e)){const n=e[r];null===n?t[r]=void 0:(0,o.Kn)(n)&&(t[r]=B(n))}return t}return e}function D(e){let t={...e};if(Object.keys(e).includes(P)){const r={};for(const t in e)t!==P&&(r[t]=e[t]);if(t=e[P],Object.keys(t).length>1)throw new Error("The root mapping must only have a single directive object");const n=t[Object.keys(t)[0]];if(!n||"object"!=typeof n)throw new Error("The root directive must be an object");n.mapping=r}return t}function F(e,t,r){if(!(0,o.Kn)(e)&&!(0,o.kJ)(e))return e;if(a(e))return(0,I.kg)(e)?T(e,t,r):T(e,t);if(Array.isArray(e))return e.map((e=>F(e,t,r)));const n={};for(const o of Object.keys(e)){let a=[];const i=void 0!==r?.tags;i&&(a=r.tags,r.tags=[...r.tags,`fieldKey:${o}`]),n[o]=F(e[o],t,r),i&&(r.tags=a)}return n}function U(e,t={},r){const n=(0,o.X6)(t);if("object"!==n)throw new Error(`data must be an object, got ${n}`);const a=D(e);q(a);return i(F(a,t,r))}K("@replace",((e,t)=>{if(!(0,o.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,a=e.ignorecase,i=e.global;if(e.value){let o=F(e.value,t),s="";if("boolean"!=typeof o&&"number"!=typeof o||(o=String(o)),"string"==typeof o&&"string"==typeof r&&"string"==typeof n&&"boolean"==typeof a&&"boolean"==typeof i){let t="";i&&(t+="g"),a&&(t+="i"),s=X(o,r,n,t),e.pattern2&&"string"==typeof e.pattern2&&"string"==typeof e.replacement2&&(s=X(s,e.pattern2,e.replacement2,t))}return s}})),K("@arrayPath",((e,t)=>{if(!Array.isArray(e))throw new Error(`@arrayPath expected array, got ${(0,o.X6)(e)}`);const[r,a]=e,i="string"==typeof r?(0,n.U)(t,r.replace("$.","")):F(r,t);return["object","array"].includes((0,o.X6)(i))&&"object"===(0,o.X6)(a)&&Object.keys(a).length>0?S(i).map((e=>F(a,e))):i})),W("@path",((e,t)=>(0,n.U)(t,e.replace("$.","")))),W("@template",((e,t)=>function(e,t={}){if("string"!=typeof e)throw new TypeError(`Invalid template! Template should be a "string" but ${(0,o.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))),K("@literal",((e,t)=>F(e,t))),K("@flatten",((e,t)=>{if(!(0,o.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=F(e.separator,t);if("string"!=typeof r)throw new Error("@flatten requires a string separator");const n=F(e.value,t);return A(n,"",r,Boolean(e.omitArrays))})),K("@json",((e,t)=>{if(!(0,o.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=F(e.value,t);return"encode"===e.mode?JSON.stringify(r):"decode"===e.mode?"string"==typeof r?JSON.parse(r):r:void 0})),K("@merge",((e,t)=>{if(!(0,o.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=F(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=>F(e,t)));return"left"===r&&n.reverse(),Object.assign({},...n)})),K("@transform",((e,t)=>{if(!(0,o.Kn)(e))throw new Error('@transform requires an object with an "apply" key and a "mapping" key');if(!e.mapping)throw new Error('@transform requires a "mapping" key');if(!e.apply)throw new Error('@transform requires a "apply" key');if(!(0,o.Kn)(e.apply))throw new Error('@transform "apply" key should be an object');const r=U(e.apply,t);return F(e.mapping,r)})),K("@excludeWhenNull",((e,t)=>{const r=F(e,t);if(null!==r)return B(r)})),K("@liquid",((e,t,r)=>(0,N.J)(e,t,r)))},5145:(e,t,r)=>{"use strict";r.d(t,{J:()=>a});var n=r(9768);const o=new n.Liquid({renderLimit:500,parseLimit:1e3,memoryLimit:1e8});function a(e,t,r){if("string"!=typeof e)throw new Error("liquid template value must be a string");if(0===e.length)return"";if(e.length>1e3)throw new Error("liquid template values are limited to 1000 characters");let n;const a=Date.now();let i="success";try{n=o.parseAndRenderSync(e,t)}catch(e){throw i="fail",e}finally{const e=Date.now()-a;r?.statsClient?.histogram("liquid.template.evaluation_ms",e,[...r.tags,`result:${i}`])}return"string"!=typeof n?"error":n}["case","for","include","layout","render","tablerow"].forEach((e=>{const t={parse:function(){throw new Error(`tag "${e}" is disabled`)},render:function(){throw new Error(`tag "${e}" is disabled`)}};o.registerTag(e,t)})),["array_to_sentence_string","concat","find","find_exp","find_index","find_index_exp","group_by","group_by_exp","has","has_exp","map","newline_to_br","reject","reject_exp","reverse","sort","sort_natural","uniq","where_exp","type"].forEach((e=>{var t;o.registerFilter(e,(t=e,function(){throw new Error(`filter "${t}" is disabled`)}))}))},8599:(e,t,r)=>{"use strict";r.d(t,{kg:()=>o});r(5145);function n(e){return null!==e&&"object"==typeof e&&Object.keys(e).some((e=>["@if","@path","@template","@literal","@arrayPath","@case","@replace","@json","@flatten","@merge","@transform","@excludeWhenNull","@liquid"].includes(e)))}function o(e){return n(e)&&"@liquid"in e&&"string"==typeof e["@liquid"]&&void 0!==e["@liquid"]}},6933:(e,t,r)=>{"use strict";function n(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function o(e){return"object"===n(e)}function a(e){return Array.isArray(e)}r.d(t,{Kn:()=>o,X6:()=>n,kJ:()=>a})},6146:(e,t,r)=>{"use strict";var n;r.d(t,{Z:()=>N}),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 o=e=>({type:n.Ident,value:e}),a=()=>({type:n.Dot,value:"."}),i=e=>({type:n.Operator,value:e}),s=e=>({type:n.Conditional,value:e}),u=e=>({type:n.String,value:e}),c=e=>({type:n.Number,value:e}),l=()=>({type:n.Null,value:"null"}),p=()=>({type:n.BrackLeft,value:"["}),h=()=>({type:n.BrackRight,value:"]"}),f=()=>({type:n.ParenLeft,value:"("}),d=()=>({type:n.ParenRight,value:")"}),y=()=>({type:n.Comma,value:","}),v=()=>({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 m="-1";function w(e){return"\r"===e||"\n"===e}function b(e){return" "===e||"\t"===e||"\n"===e}function x(e){return!!e.match(/[a-z]/i)}function E(e){return e!==m&&(!isNaN(parseFloat(e))&&isFinite(parseInt(e,10)))}function k(e){return e===m||b(e)||","===e||"]"===e||")"===e}class _ extends Error{constructor(e,t){super(e),this.message=e,this.name="LexerError",this.stack=(new Error).stack,this.cursor=t}}class j{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(v()),e;if(!b(t)){if("!"===t){const t=this.peek();if(x(t)||"("===t){e.push(i("!"));continue}}if(x(t)||"!"===t||"="===t||">"===t||"<"===t||"\\"===t||"_"===t)e.push(this.lexOperatorOrConditional(t));else if(E(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 _(`invalid character "${t}"`,this.cursor);e.push(d())}else e.push(f());else e.push(y());else e.push(h());else e.push(p());else e.push(a());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 _("unterminated string",this.cursor);if(t.length>=1e5)throw new _("unreasonable string length",this.cursor)}return this.accept(e),u(`${e}${t}${e}`)}lexNumber(e){let t="",r=this.peek(),n=!1;for(;E(r)||"."===r;){const{char:e}=this.next();if(t+=e,"."===r){if(k(this.peek()))throw new _("unexpected terminator after decimal point",this.cursor);if(n)throw new _("multiple decimal points in one number",this.cursor);n=!0}if(t.length>=1e5)throw new _("unreasonable number length",this.cursor);r=this.peek()}return c(e+t)}lexOperatorOrConditional(e){if("="===e)return i("=");if("!"===e){if(this.accept("="))return i("!=");throw new _(`expected '=' after '!', got '${this.peek()}'`,this.cursor)}return"a"===e?this.accept("nd")?s("and"):this.lexIdent(e):"o"===e?this.accept("r")?s("or"):this.lexIdent(e):"n"===e?this.accept("ull")?l():this.lexIdent(e):"<"===e||">"===e?this.accept("=")?i(e+"="):i(e):this.lexIdent(e)}lexIdent(e){let t="",r=e;for(;;){if("\\"===r){if(this.peek()===m)throw new _("expected character after escape character, got EOS",this.cursor);r=this.next().char}if(t+=r,t.length>=1e5)throw new _("unreasonable literal length",this.cursor);if((n=this.peek())===m||!x(n)&&!E(n)&&"_"!==n&&"-"!==n&&"\\"!==n)break;r=this.next().char}var n;const a=this.peek();if(a!==m&&!k(a)&&"."!==a&&"("!==a&&"="!==a&&"!"!==a)throw new _(`expected termination character after identifier, got ${a}`,this.cursor);return o(t)}accept(e){let t="";for(const r of e){const{char:e,isEOS:r}=this.next();if(t+=e,r)return!1;if(k(e))break}return!(e!==t||!k(this.peek()))||(this.backup(t.length),!1)}next(){const{char:e,isEOS:t}=this.reader.forward();w(e)?(this.cursor.line+=1,this.cursor.column=0):this.cursor.column+=1;return{char:t?m: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}w(e)?(this.cursor.line-=1,this.cursor.column=0):this.cursor.column-=1}}}const $={type:"event-type",event:"event",name:"name",userId:"userId",context:"event-context",properties:"event-property",traits:"event-trait"},O=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),q=e=>"ident"===e.type&&["contains","match"].includes(e.value),S=(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 o=r.shift();if(!o)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(O(o))}),/^(properties)/.test(e.value)&&t.push({type:"event-property",name:e.value.replace(/^(properties)\./,""),operator:n?"not_contains":"contains",value:String(O(o))}),/^(traits)/.test(e.value)&&t.push({type:"event-trait",name:e.value.replace(/^(traits)\./,""),operator:n?"not_contains":"contains",value:String(O(o))}),/^(context)/.test(e.value)&&t.push({type:"event-context",name:e.value.replace(/^(context)\./,""),operator:n?"not_contains":"contains",value:String(O(o))})}if("match"===e){r.shift();const e=r.shift();if(!e)throw new Error("match() is missing a 1st argument");r.shift();const o=r.shift();if(!o)throw new Error("match() is missing a 2nd argument");let a,i;r.shift(),o.value.endsWith('*"')?(a=n?"not_starts_with":"starts_with",i=String(O(o)).slice(0,-1)):(a=n?"not_ends_with":"ends_with",i=String(O(o)).slice(1)),["event","name","userId"].includes(e.value)&&t.push({type:e.value,operator:a,value:i}),/^(properties)/.test(e.value)&&t.push({type:"event-property",name:e.value.replace(/^(properties)\./,""),operator:a,value:i}),/^(traits)/.test(e.value)&&t.push({type:"event-trait",name:e.value.replace(/^(traits)\./,""),operator:a,value:i}),/^(context)/.test(e.value)&&t.push({type:"event-context",name:e.value.replace(/^(context)\./,""),operator:a,value:i})}},A=e=>{var t;const r=[];let o="and",a=e.shift();for(;a&&"eos"!==a.type;){if("ident"===a.type){const[n]=(null!==(t=a.value)&&void 0!==t?t:"").split("."),o=$[n];if(o){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 i="="===t.value&&"true"===n.value,s="="===t.value&&"false"===n.value,u="!="===t.value&&"null"===n.value,c="="===t.value&&"null"===n.value,l="="===t.value&&"number"===n.type,p="!="===t.value&&"number"===n.type;"event"===o?r.push({type:"event",operator:t.value,value:String(O(n))}):"event-type"===o?r.push({type:"event-type",operator:t.value,value:String(O(n))}):"name"===o?u?r.push({type:"name",operator:"exists"}):c?r.push({type:"name",operator:"not_exists"}):r.push({type:"name",operator:t.value,value:String(O(n))}):"userId"===o?u?r.push({type:"userId",operator:"exists"}):c?r.push({type:"userId",operator:"not_exists"}):i?r.push({type:"userId",operator:"is_true"}):s?r.push({type:"userId",operator:"is_false"}):r.push({type:"userId",operator:t.value,value:String(O(n))}):"event-property"===o?u?r.push({type:"event-property",name:a.value.replace(/^(properties)\./,""),operator:"exists"}):c?r.push({type:"event-property",name:a.value.replace(/^(properties)\./,""),operator:"not_exists"}):i?r.push({type:"event-property",name:a.value.replace(/^(properties)\./,""),operator:"is_true"}):s?r.push({type:"event-property",name:a.value.replace(/^(properties)\./,""),operator:"is_false"}):l?r.push({type:"event-property",name:a.value.replace(/^(properties)\./,""),operator:"number_equals",value:O(n)}):p?r.push({type:"event-property",name:a.value.replace(/^(properties)\./,""),operator:"number_not_equals",value:O(n)}):r.push({type:"event-property",name:a.value.replace(/^(properties)\./,""),operator:t.value,value:O(n)}):"event-trait"===o?u?r.push({type:"event-trait",name:a.value.replace(/^(traits)\./,""),operator:"exists"}):c?r.push({type:"event-trait",name:a.value.replace(/^(traits)\./,""),operator:"not_exists"}):i?r.push({type:"event-trait",name:a.value.replace(/^(traits)\./,""),operator:"is_true"}):s?r.push({type:"event-trait",name:a.value.replace(/^(traits)\./,""),operator:"is_false"}):l?r.push({type:"event-trait",name:a.value.replace(/^(traits)\./,""),operator:"number_equals",value:O(n)}):p?r.push({type:"event-trait",name:a.value.replace(/^(traits)\./,""),operator:"number_not_equals",value:O(n)}):r.push({type:"event-trait",name:a.value.replace(/^(traits)\./,""),operator:t.value,value:O(n)}):"event-context"===o&&(u?r.push({type:"event-context",name:a.value.replace(/^(context)\./,""),operator:"exists"}):c?r.push({type:"event-context",name:a.value.replace(/^(context)\./,""),operator:"not_exists"}):i?r.push({type:"event-context",name:a.value.replace(/^(context)\./,""),operator:"is_true"}):s?r.push({type:"event-context",name:a.value.replace(/^(context)\./,""),operator:"is_false"}):l?r.push({type:"event-context",name:a.value.replace(/^(context)\./,""),operator:"number_equals",value:O(n)}):p?r.push({type:"event-context",name:a.value.replace(/^(context)\./,""),operator:"number_not_equals",value:O(n)}):r.push({type:"event-context",name:a.value.replace(/^(context)\./,""),operator:t.value,value:O(n)}))}q(a)&&S(a.value,r,e)}if("operator"===a.type&&"!"===a.value&&q(e[0])){const t=e[0].value;e.shift(),S(t,r,e,{negate:!0})}if("parenleft"===a.type){const t=[];let o=e.shift();for(;"parenright"!==o.type;)t.push(o),o=e.shift();t.push({type:n.EOS,value:"eos"}),r.push(A(t))}"conditional"===a.type&&(o=a.value),a=e.shift()}return r.length>1?{type:"group",operator:o,children:r}:r[0]},N=e=>{try{const t=A((e=>{const t=[];let r=0;for(;e[r];){const o=t[t.length-1],a=e[r],i=e[r+1];if("ident"===(null==o?void 0:o.type)&&"dot"===a.type&&"ident"===(null==i?void 0:i.type)){const e=t.pop();t.push({type:n.Ident,value:`${null==e?void 0:e.value}${a.value}${i.value}`}),r+=2}else t.push(e[r]),r++}return t})(function(e){try{return{tokens:new j(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:()=>a});const o=(e,t)=>"and"===e.operator?e.children.every((e=>i(e,t))):"or"===e.operator&&e.children.some((e=>i(e,t))),a=(e,t)=>!e.error&&void 0!==t&&o(e,t),i=(e,t)=>"event-type"===e.type?s(t.type,e.operator,e.value):"event"===e.type?s(t.event,e.operator,e.value):"name"===e.type?s(t.name,e.operator,e.value):"userId"===e.type?s(t.userId,e.operator,e.value):"event-property"===e.type?s(n(t.properties,e.name),e.operator,e.value):"event-trait"===e.type?s(n(t.traits,e.name),e.operator,e.value):"event-context"===e.type?s(n(t.context,e.name),e.operator,e.value):"group"===e.type&&o(e,t),s=(e,t,r)=>{switch(t){case"=":return e===String(r);case"number_equals":return"number"==typeof e&&Number(e)===Number(r);case"!=":return e!==String(r);case"number_not_equals":return"number"==typeof e&&Number(e)!==Number(r);case"<":return"number"==typeof e&&Number(e)":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:()=>i,customErrorFactory:()=>u});var o,a=(o=function(e,t){return o=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])},o(e,t)},function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=function(e){function t(t){var r,o,a,i=this.constructor,s=e.call(this,t)||this;return Object.defineProperty(s,"name",{value:i.name,enumerable:!1,configurable:!0}),r=s,o=i.prototype,(a=Object.setPrototypeOf)?a(r,o):r.__proto__=o,n(s),s}return a(t,e),t}(Error),s=function(){for(var e=arguments,t=0,r=0,n=arguments.length;r