0801f79c-c3b0-44f6-9f5a-37611e3c986d.edge.permutive.app Open in urlscan Pro
2606:4700:4400::ac40:98f3  Public Scan

URL: https://0801f79c-c3b0-44f6-9f5a-37611e3c986d.edge.permutive.app/08cdfe71-67da-407d-b4cc-64aaab77de67-web.js
Submission: On September 16 via api from IT — Scanned from IT

Form analysis 0 forms found in the DOM

Text Content

/*! permutive-javascript-sdk v20.9.2 (web) (built 2024-09-13T08:34:49.318Z) */(()=>{"use strict";var __webpack_modules__={2688:(e,t,n)=>{function r(e){return e instanceof Error?e:new Error("string"==typeof e?e:JSON.stringify(e))}n.d(t,{w:()=>r})},787:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(3735),i=n(2884);function o(e){return(0,r.zG)((0,i.Y3)((()=>JSON.parse(e))),(0,i.fS)(r.gn))}},3992:(e,t,n)=>{n.d(t,{GL:()=>s,HJ:()=>c,N1:()=>l,NC:()=>r,RP:()=>i,SF:()=>d,UM:()=>u,ho:()=>g,iE:()=>f});const r=performance.now(),i=(new Date).getTime();let o=[],a=!1;const s=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c((()=>e(...n)))},c=(e,t)=>{if(!a){const n=self.setTimeout(e,t);return()=>self.clearTimeout(n)}let n;const r=()=>{void 0!==n&&a&&o.length<1e4&&o.push([n,performance.now()]),n=void 0},i=[self.setTimeout((()=>{n=performance.now(),self.requestAnimationFrame(r),e()}),t),self.setTimeout(r,t)];return()=>{void 0===n&&i.forEach((e=>self.clearTimeout(e)))}},u=(e,t)=>{if(!a){const n=self.setInterval(e,t);return()=>self.clearInterval(n)}let n=!1,r=()=>{};const i=self.setInterval((()=>{r=c((()=>{n||e()}))}),t);return()=>{n=!0,r(),self.clearInterval(i)}},l=e=>()=>{return t=e(),new Promise(((e,n)=>t.then(s(e),s(n))));var t},d=e=>{const t=l(e);return()=>new Promise((e=>c((()=>e(t())))))},f=()=>{const e=o;return o=[],e},g=e=>{a=e}},2851:(e,t,n)=>{n.d(t,{ap:()=>y,a9:()=>h,Ue:()=>p,gS:()=>m,D8:()=>U,VS:()=>w,xH:()=>E,En:()=>v,p4:()=>P,UI:()=>b,Rp:()=>S,vP:()=>I,bw:()=>G,YP:()=>_});var r=n(2688),i=n(365),o=n(3735),a=n(2884),s=n(3328),c=n(2652);function u(e){let t=e,n=[],r=!1;return{addListener(e){if(r)return()=>{};let i=t;const o=()=>{Object.is(t,i)||(i=t,e(t))};n=[...n,o];return()=>{n=n.filter((e=>e!==o))}},notify(e){if(r)throw new Error("Ref bug: Attempted to notify a terminated notifier");Object.is(e,t)||(t=e,n.forEach((e=>e())))},terminate(){r=!0,n=[]}}}function l(e,t){let n=0;return function(){try{if(n++>0)throw new Error(e);return t(...arguments)}finally{n--}}}function d(e,t){let n=[...new Set(e)].filter((e=>"final"!==e.state));if(0===n.length)return{state:"final",onStateChange:()=>()=>{}};const r=()=>0===n.length?"final":n.some((e=>"might_change"===e.state))?"might_change":"nominal",[i,o]=f(r(),(e=>"might_change"!==e&&t())),a=()=>o(r());return n.forEach((t=>{t.onStateChange((t=>{switch(t){case"final":n=e.filter((e=>"final"!==e.state)),a();break;case"might_change":o("might_change");break;case"nominal":a();break;default:throw new Error(`Ref bug: Invalid state ${t}`)}}))})),i}function f(e,t){if("final"===e)return[{state:"final",onStateChange:()=>()=>{}},()=>{}];const{terminate:n,notify:r,addListener:i}=u(e),o={state:e,onStateChange:i},a=l("Disallowed recursion in Branch.",(e=>{if("final"===o.state){if("final"===e)return;throw new Error(`Attempted to change state of final branch to ${e}.`)}try{null==t||t(e),o.state=e,r(e)}finally{"final"===e&&n()}}));return[o,a]}var g=n(6392);function p(e){const[t,n,r]=function(){const[e,t]=f("nominal"),n=l("Disallowed recursion in Branch.",(n=>{if("final"===e.state)throw new Error("Attempted to mutate a finalized Ref.");const r=e.state;try{t("might_change"),n()}finally{t(r)}}));return[e,n,()=>t("final")]}(),[i,o]=D(t,e);return[i,e=>n((()=>o(e))),r]}function m(e){let t=e.empty;const n=()=>()=>{const n=t;return t=e.empty,n},[r,i,o]=p(n());return[r,r=>{t=e.concat(t,r),i(n())},o]}function v(e,t){return n=>{let r=new Array(e).fill(t.empty);return new Array(e).fill(null).map(((e,i)=>(0,o.zG)(n,b(g.UI((e=>{const n=t.concat(r[i],e);return r=r.map(((n,r)=>r===i?t.empty:t.concat(n,e))),n}))))))}}function h(e){return{get current(){return e},onChange:()=>()=>{},branch:{state:"final",onStateChange:()=>()=>{}}}}function _(e){return t=>{const n=t.onChange(e);return e(t.current),n}}function b(e,t){if(t){const[n,r]=D(t.branch,e(t.current));return t.onChange((t=>r(e(t)))),n}return t=>b(e,t)}const y=e=>w((t=>b(t)(e)));function w(e,t){return t?E(b(e,t)):t=>E(b(e,t))}function E(e){if("final"===e.branch.state)return e.current;const[t,n]=function(e,t){let n=t;const r=[e.state,n.state].includes("might_change")?"might_change":"nominal",[i,o]=f(r),a=e=>t=>{switch(t){case"final":o(e().state);break;case"might_change":o("might_change");break;case"nominal":"might_change"===e().state?o("might_change"):o("nominal");break;default:throw new Error(`Ref bug: Unexpected upstream state ${t}`)}};e.onStateChange(a((()=>n)));const s=a((()=>e));let c=n.onStateChange(s);return[i,e=>{n=e,c(),c=e.onStateChange(s),s(n.state)}]}(e.branch,e.current.branch),[r,i]=D(t,e.current.current);let o=e.current.onChange(i);return e.onChange((e=>{o(),o=e.onChange(i),n(e.branch),i(e.current)})),r}function S(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{if(2===t.length){let n=t[0];return b((e=>(n=t[1](n,e),n)),e)}let n=a.bM();return b((e=>{const r=t[0](n,e);return n=a.G(r),r}),e)}}function I(){if(0===arguments.length||z(arguments.length<=0?void 0:arguments[0]))return k(...arguments);const e=arguments.length<=0?void 0:arguments[0],t=Object.keys(e);return(0,o.zG)(Object.values(e),(e=>k(...e)),b((0,o.ls)(s.Su(((e,n)=>[t[e],n])),Object.fromEntries)))}function k(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return h([]);if(1===t.length)return b((e=>[e]))(t[0]);let r=!1;t.forEach((e=>e.onChange((()=>{if("might_change"!==e.branch.state)throw new Error("Ref bug: Received a change notification without a `might_change` state.");r=!0}))));const i=t.map((0,c.vg)("branch")),o=()=>{r&&(r=!1,u(t.map((e=>e.current))))},a=d(i,o),[s,u]=D(a,t.map((e=>e.current)));return s}function P(e){const[t,n,s]=p(a.YP);return e.then(i.F2).catch((0,o.ls)(r.w,i.t$)).then((0,o.ls)(a.G,n,s)),t}function U(e){const t=e.hasOwnProperty("equals")?e.equals:e;return function(e){return t=>{if("final"===t.branch.state)return t;let n=a.YP;return b((t=>{if(a.Wi(n))return n=a.G(t),t;const r=e(n.value,t);return n=a.G(r),r}),t)}}(((e,n)=>t(e,n)?e:n))}function G(e){return t=>(_(e)(t),t)}function D(e,t){if("final"===e.state)return[h(t),()=>{}];const n=u(t);e.onStateChange((e=>{"final"===e&&n.terminate()}));let r=t;return[{get current(){return r},onChange:n.addListener,branch:e},l("Disallowed recursion in Ref.",(e=>{r=e,n.notify(r)}))]}function z(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"function"==typeof e.onChange}},2116:(e,t,n)=>{n.d(t,{K4:()=>c,KD:()=>m,UI:()=>d,ak:()=>p,bw:()=>f,dQ:()=>u,of:()=>l,vP:()=>g});var r=n(2851),i=n(3735),o=n(2652),a=n(4923),s=n(2884);const c=e=>(0,i.ls)((t=>{let{previousState:n,...r}=t;return e(r)}),(e=>({value:e,state:r.a9(void 0)}))),u=i.yR,l=(0,i.ls)(i.a9,c),d=e=>t=>(0,i.ls)(t,(0,o.rO)({value:e})),f=e=>t=>(0,i.ls)(t,(0,o.rO)({value:(0,o.bw)(e)}));function g(e){return t=>{let{previousState:n,...o}=t;const s=_(n)?n:{},c=(0,i.zG)(e,a.Su(((e,t)=>t({previousState:s[e],...o}))));return{value:(0,i.zG)(c,a.UI((e=>e.value))),state:(0,i.zG)(c,a.UI((e=>e.state)),(e=>r.vP(e)))}}}function p(e,t){return n=>(0,i.ls)((0,o.rO)({previousState:h}),(o=>{const a=n(o),s=t(a.value)({...o,previousState:o.previousState[e]});return{value:(0,i.zG)([a.value,s.value],(t=>{let[n,r]=t;if(!_(n))throw new Error("Service.bind() was passed an upstream Service with a non-record value.");return{...n,[e]:r}})),state:(0,i.zG)(r.vP(a.state,s.state),r.UI((t=>{let[n,r]=t;if(void 0===n)return{[e]:r};if(!_(n))throw new Error("Service.bind() was passed an upstream Service with a non-record state.");return{...n,[e]:r}})))}}))}const m=e=>{const t=e.slice(0,-1),n=e.slice(-1)[0],a=[...t.map((e=>{let[t,n]=e;return[t,(0,i.a9)(n)]})),(0,i.a9)(n)];return s=(0,o.lo)(a),(0,i.ls)(r.UI(s),v);var s};function v(e){const t=(0,i.zG)(e,r.Rp(0,(e=>e+1)));return n=>{let{previousState:o,stopped:a,...c}=n;return(0,i.zG)(r.vP(e,t),r.Rp(((e,n)=>{let[u,l]=n;return(0,i.zG)(e,s.UI((e=>e.state.current)),s.fS((()=>o)),(e=>u({previousState:e,stopped:(0,i.zG)(r.vP(a,t),r.UI((e=>{let[t,n]=e;return t||n!==l}))),...c})))})),(e=>({value:r.UI((e=>e.value),e),state:r.VS((e=>e.state),e)})))}}function h(e){return _(e)?e:{}}function _(e){return"object"==typeof e&&null!==e}},6967:(e,t,n)=>{n(2497)},8612:(e,t,n)=>{n.d(t,{lg:()=>m,Bt:()=>h});var r=n(5851),i=n(3735),o=n(2884),a=n(2751),s=n(2652);class c{userId;network;api;logger;constructor(e,t,n,r){this.userId=e,this.network=t,this.api=n,this.logger=r}tag="appnexus";ttlInSeconds=86400;usedForThirdPartyData=!0;url="https://ib.adnxs.com/getuidj";invalidAliases=["","0","-1"];getId(){return this.logger.debug("identities[appnexus]: start HTTP request"),(0,s.G6)(navigator.userAgent)?Promise.resolve({type:"skipped"}):this.api.appnexus(this.url).then((e=>(this.logger.debug("identities[appnexus]: end HTTP request"),{type:"attempted",result:(0,i.zG)((0,o.DT)((e=>this.isValidAlias(e.uid)))(e),(0,o.UI)((e=>e.uid)))})),(e=>({type:"attempted",result:o.YP})))}reset(){return Promise.resolve()}isValidAlias(e){return!!e&&-1===this.invalidAliases.indexOf(e)}}class u{config;network;api;userId;logger;url;resetUrl;constructor(e,t,n,r,i){this.config=e,this.network=t,this.api=n,this.userId=r,this.logger=i,this.url=`https://0801f79c-c3b0-44f6-9f5a-37611e3c986d.${this.config.pxidHost}/${this.config.apiVersion}/pxid`,this.resetUrl=this.url+"/reset"}tag="pxid";ttlInSeconds=86400;usedForThirdPartyData=!1;getId(){return this.logger.debug("identities[pxid]: start HTTP request"),(0,s.G6)(navigator.userAgent)?Promise.resolve({type:"skipped"}):this.api.pxid(this.url).then((e=>(this.logger.debug("identities[pxid]: end HTTP request"),{type:"attempted",result:(0,o.ij)(e.uid)})),(e=>({type:"attempted",result:o.YP})))}reset(){return(0,s.G6)(navigator.userAgent)?Promise.resolve():this.api.pxidReset(this.resetUrl)}}var l=n(2851),d=n(4923),f=n(2197),g=n(365);const p=f.ff((e=>void 0===e));class m{metrics;trace;permutiveData;identityProviderEnv;logger;ref;setReady;thirdParty;rawRef;identityMapRef;setIdentityMap;providers={};static emailSHA256Regex=/^[a-f0-9]{64}$/;constructor(e,t,n,r,c){this.metrics=e,this.trace=t,this.permutiveData=n,this.identityProviderEnv=r,this.logger=c;const u=this.getCachedIdentitiesAndMigrateIfRequired(),[f,g]=l.Ue(u);this.identityMapRef=f,this.setIdentityMap=g,f.onChange((0,i.ls)(d.z7((e=>!v.has(e))),(0,s.bw)((e=>{this.logger.debug("[identities] Persisting",e),this.permutiveData.setData("identities",e)})))),this.rawRef=(0,i.zG)(f,l.UI((0,i.ls)(d.UI((e=>e.value)),d.hX(p))),l.D8(d.Eh(a.Eq)));const[m,h]=l.Ue(!1);this.ref=(0,i.zG)(l.vP(m,this.rawRef),l.UI((e=>{let[t,n]=e;return(0,i.zG)(n,(0,o.DT)((()=>t)))}))),this.setReady=()=>{e.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"identity_ready",time_origin:"sdk_init"}),h(!0)},this.thirdParty=this.prepareThirdPartyIdentities()}get identities(){return this.identityMapRef.current}prepareThirdPartyIdentities(){this.logger.debug("[Identities]","loading 3rd party identities");const e=this.metrics.startTimer("sdk_get_third_party_identities_task_duration_seconds",{}),t=this.trace.startSpan("load_tpd_ids"),n=[{load:e=>{return t=e.config,n=e.network,r=e.api,i=e.userId,a=e.logger,(0,o.G)(new u(t,n,r,i,a));var t,n,r,i,a}},{load:e=>{return t=e.userId,n=e.network,r=e.api,i=e.logger,(0,o.G)(new c(t,n,r,i));var t,n,r,i}},{load:e=>(e.cookies,e.messages,o.YP)},{load:e=>(e.cookies,o.YP)},{load:e=>(e.metrics,e.permutiveData,e.permutive,e.messages,o.YP)}],a=(0,r.oA)(n.map((e=>e.load(this.identityProviderEnv)))).map((e=>this.shouldAskForNewIdentity(e)?this.retrieveIdentity(e):Promise.resolve((0,i.bc)(e,this.getCachedTPDIdentity(e.tag)))));return Promise.all(a).then((e=>e.map((e=>{let[t,n]=e;return this.providers[t.tag]=t,this.mapTPDIdentityIfPresent(t.tag,n,t.ttlInSeconds)})))).then((e=>this.setIdentities(e))).then((0,s.bw)((()=>{this.metrics.stopTimer("sdk_get_third_party_identities_task_duration_seconds",e),t.finish()})))}getPrioritizedIdentities(e){const t={default:0,pxid:1,appnexus:1},n=Object.entries(e).map((e=>{let[t,{id:n,expiry:r,priority:i}]=e;return{tag:t,...n?{id:n}:{},...r?{expiry:r}:{},...void 0!==i?{priority:i}:{}}})),i=n.filter((e=>((e,t)=>!!e.id&&!(0,r.t9)(a.Eq)(e.tag,t))(e,Object.values(this.providers).map((e=>e.tag))))),s=n.filter((e=>((e,t)=>!!e.id&&!!(0,r.t9)(a.Eq)(e.tag,t))(e,Object.values(this.providers).map((e=>e.tag))))),c=(0,r.DZ)((e=>(0,o.ij)(e.priority)))(i),u=c.length>0?Math.max(...c):0,l=i.map((e=>void 0!==e.priority?{...e,priority:e.priority}:{...e,priority:u+1})),d=s.map((e=>void 0===t[e.tag]?{tag:e.tag,id:e.id,priority:u+_}:{tag:e.tag,id:e.id,priority:u+b}));return l.concat(d)}getIdentitiesMap(){return this.getFilteredIdentities(((e,t)=>!!t.value))}parseCustomerDefinedIdentities(e){const t=`Identify must be passed a non-empty string or list of { tag, id, priority? } tuples, value passed was '${JSON.stringify(e)}'`,n=e=>"string"==typeof e.id&&"string"==typeof e.tag,o=e=>"email_sha256"!==e.tag||m.emailSHA256Regex.test(e.id);return"string"==typeof e?(s=e).length>0?{left:[],right:[{id:s,tag:"default"}]}:{left:[t],right:[]}:Array.isArray(e)?(a=e,(0,i.zG)(a,r.tV((0,i.ls)(g.DT(n,(()=>t)),g.Y$(o,(()=>"Identify called with unsupported format of email_sha256 ID. The support format is hex-encoded 64 character long lowercase string.")))))):{left:[t],right:[]};var a,s}extractIdentifyFromQueue(e){let{global:t}=e;const n=()=>t.q.findIndex((e=>"identify"===e.functionName)),r=(e,i)=>{if(e<0)return i;const o=t.q.splice(e,1)[0],a=this.parseCustomerDefinedIdentities(o.arguments[0]);return r(n(),{left:i.left.concat(a.left),right:i.right.concat(a.right)})},{left:i,right:o}=r(n(),{left:[],right:[]});return i.forEach((e=>this.logger.warn("Invalid identity provided during init",e))),o}setIdentities(e){const t=e.reduce(((e,t)=>{let{tag:n,id:r,expiry:i,priority:o}=t;return void 0===this.identities[n]&&this.logger.debug(`identities[${n}]: added`),e[n]={...r?{value:r}:{},...i?{expiry:i}:{},...void 0!==o?{priority:o}:{}},e}),{}),n=this.rawRef.current;this.setIdentityMap({...this.identities,...t});const r=this.rawRef.current;return{identifyRequestRequired:()=>!d.xb(r)&&!d.Eh(a.Eq).equals(n,r)}}async reset(){this.setIdentityMap({}),await Promise.all(Object.values(this.providers).map((e=>e.reset())))}getFilteredIdentities(e){return(0,s.m8)(...Object.entries(this.identities).filter((t=>{let[n,r]=t;return e(n,r)})).map((e=>{let[t,{value:n,expiry:r,priority:o}]=e;return(0,i.bc)(t,{id:n,...r?{expiry:r}:{},...void 0!==o?{priority:o}:{}})})))}shouldAskForNewIdentity(e){var t;const n=(0,o.ij)(null===(t=this.identities)||void 0===t?void 0:t[e.tag]);return(0,o.g_)((()=>!0),this.isIdentityExpired)(n)}getCachedTPDIdentity(e){return this.identities[e]?(0,o.ij)(this.identities[e].value):o.YP}mapTPDIdentityIfPresent(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:86400;const r=()=>Date.now()+Math.floor(1e3*n);return(0,o.g_)((()=>({tag:e,expiry:r()})),(t=>({tag:e,id:t,expiry:r()})))(t)}retrieveIdentity(e){return e.getId().then((t=>"skipped"===t.type?(0,i.bc)(e,o.YP):(0,i.zG)(t.result,(t=>this.metrics.track({name:(0,o.pC)(t)?"sdk_third_party_identity_present_count":"sdk_third_party_identity_missing_count",value:1,labels:{identity_tag:e.tag}})),(n=>(0,i.bc)(e,t.result)))))}isIdentityExpired(e){return"number"==typeof e.expiry&&Date.now()>=e.expiry}getCachedIdentitiesAndMigrateIfRequired(){return(e=>(0,s.m8)(...Object.entries(e).filter((e=>{let[t,n]=e;return!this.isIdentityExpired(n)&&!v.has(t)}))))(this.permutiveData.getData("identities")||{})}}const v=new Set(["public","email","email_md5","email_sha256","ip_address"]),h=(e,t,n,i,o)=>{const s=(e,t)=>{const n=["(null)"];return n.indexOf(e)>-1||!!w[e]||(0,r.jV)(a.Eq)(t,n).length>0},c=e=>"721d6d85-35f0-4e35-bb38-13eb0d465158"===e,u={"be668577-07f5-444d-98e0-222b990951b1":s,"e43c8a90-d17b-4790-bfda-81b069b3b8c2":(e,t,n)=>["thestudentroom.co.uk"].some((e=>n.indexOf(e)>-1))&&(0,r.jV)(a.Eq)(t,["tsr-"]).length>0,"5d79bce7-5d2b-427e-a6c4-b89b6c7bf048":s,"366ab8da-5efa-4355-ab00-84db3b68ded2":e=>"96539955-4d7e-40df-882b-7e2fbacedb1c"===e||"345600e7-fb5f-48b1-9aa6-cde5396419b0"===e,"f3a06674-ebb9-4b9d-ba8f-0052018c0687":c,"38dadd0d-257a-4641-b332-b8b0fd20a6cb":c,"10453011-272d-49cd-9043-1964fdb36fd8":e=>"936ba6ac-9a8b-454d-ba98-facebd7553fe"===e},l={"fe68d1f7-c9f4-45b3-8905-7cda73d3fd74":e=>!!y[e]},d=u[e]||l[t];return!!d&&d(o,n,i)},_=2,b=3,y={},w={}},7658:(e,t,n)=>{n.d(t,{z:()=>r});class r{ingestIfEligible(e){return Promise.resolve()}}},922:(e,t,n)=>{n.d(t,{CL:()=>s,EW:()=>c,PH:()=>a,eV:()=>i,jH:()=>u,t2:()=>o});var r=n(9853);const i=(0,r.MU)("track_form_submission",!0),o=((0,r.MU)("track_pageview_complete",!0),(0,r.MU)("track_pageview_engagement",!0)),a=((0,r.$S)("sync_segments_cookie",!1),(0,r.$S)("track_slot_clicked",!0)),s=(0,r.$S)("track_slot_rendered",!0),c=(0,r.$S)("track_slot_viewable",!1),u=(0,r.$S)("track_targeting_keys",!1)},8975:(e,t,n)=>{n.d(t,{v:()=>a});class r{logger;permutive;id;segmentCode;triggerType;config;workspaceLevelConfig;prefix="[Activation]";constructor(e,t,n,r,i,o,a){this.logger=e,this.permutive=t,this.id=n,this.segmentCode=r,this.triggerType=i,this.config=o,this.workspaceLevelConfig=a}getSegmentCode(){return this.segmentCode}getTriggerType(){return this.triggerType}getConfig(){return this.config}getWorkspaceLevelConfig(){return this.workspaceLevelConfig}trackImpression(e){return this.trackActivation("impression",e)}trackConversion(e){return this.trackActivation("conversion",e)}trackActivation(e,t){const n={reaction_id:this.id,type:e};this.permutive.track("Reaction",n,t),this.logger.log(this.prefix,n.type,n)}}var i=n(9853);const o={dfp:{dfp:[140003,140015,139991,172181,140022,140016,14e4,139987,140001,140015,140010,144173,140014,139984,139995,140020,140034,139988,140025,140010,140003,144178,160773,140014,144174,158121,139996,139999,140012,146592,140032,140026,139989,139995,140047,166963,140030,144171,140032,140011,144167,140018,140031,140009,140029,139987,140004,158122,144175,139993,139997,150948,158118,144170,140017,140005,139986,140006,146596,140026,175723,139990,139982,157017,139981,140035,172632,148101,139985,140018,172346,138503,139993,139986,139996,140025,140028,175586,139985,140013,140024,140023,139988,140011,140030,138503,140034,140002,140004,139984,140002,140019,140019,139999,139981,139998,140027,158221,140029,140008,140005,139991,140008,140007,139994,144176,158119,139990,140020,139994,139989,156991,140006,146178,140009,140007,158123,139982,139997,140035,167956,140023,171120,140017,144177,140036,140024,140028,140027,140031,140012,146592,172180,139998,140022,14e4,146596,140001,175734,140047,140036,158120,140016,140013,144168,172620,175881,178078,178079,178080,178081,178082,178083,178932,183355,147118,183841,146475,147116,147117,147119,147120,147121,146712,146714,146718,146720,147114,147115,182822,182801,182795,146713,146715,146716,146717,146719,146721,146723,182805,182815,182818,182809,182804,182796,182799,182806,182803,182807,182821,182800,182816,182814,182797,182798,182811,182808,182823,182824,182812,182820,182813,182817,183991,183992,184053,184821,184822,185645,187010,187746,187747,189774,190203,190221,191591,191592,144177,193903,198875,200880,125609,125609],dfp_legacy:{}},eyeota_pixel:[],dbm:{omitted:0},appnexus:{},appnexus_adserver:[],nativo:[],rubicon_ssp:[],smart:[],freewheel:[125609,177058,177059,156676,172181,147009,172620,139988,140006,156714,156713,140003,171120,156702,139996,139989,155623,156680,140011,156710,139997,153774,153424,140007,156691,140022,156991,140020,167753,139982,140008,140025,139990,160773,140031,156698,154307,158221,156695,14e4,140001,139995,140016,140017,140028,156700,157017,156699,146178,140014,156711,146596,156697,172392,154023,156678,172180,155624,158123,139998,140024,175723,156677,139985,156703,140018,156686,156683,158118,172632,140005,153858,158121,156692,156682,140047,140009,139991,151045,140013,140030,155626,139987,139984,139999,158119,156693,156704,156717,175586,139986,167956,153427,139993,139994,140032,155207,125609,138503,140029,158122,140012,140034,147230,156675,140036,156707,156709,156679,175734,140019,156705,156687,158120,150650,140026,140027,140004,141331,140035,156669,155625,153425,173384,140002,156712,140010,156708,166963,156674,139981,156696,140015,155204,153426,140023,172346,156694,156688,156706,146592,175346,181503,175881,174777,175878,175879,178078,178079,178080,178081,178082,178083,178932,182828,182827,183155,183355,183503,179616,180067,182829,179443,183841,184053,184821,184822,185645,185925,187010,179632,184121,188777,189568,188778,189569,189774,190203,190221,191591,191592,191865,191866,192110,192111,192128,192527,192529,194771,194772,194773,188560,193417,194774,193570,194775,193903,194706,194770,194766,195364,195869,198875,199263,199256,200148,200235,195363,200758,200880]};class a{logger;permutive;clientContext;constructor(e,t,n){this.logger=e,this.permutive=t,this.clientContext=n}getSpecializedActivations(e){return o[e]}getActivations(e){return(0,i.Hn)(e)("activationConfigs",[]).filter((e=>this.areContextCriteriaSatisfied(e))).map((e=>new r(this.logger,this.permutive,e.id,e.sc,e.tt,e.c,e.wc)))}areContextCriteriaSatisfied(e){const t=e.cc,n=e=>{const t=this.clientContext.getContext()[e.key];switch(e.comparison){case"EQUALS":return t===e.value;case"NOT_EQUALS":return t!==e.value;case"CONTAINS":return"string"==typeof t&&t.indexOf(e.value)>=0;case"NOT_CONTAINS":return"string"==typeof t&&t.indexOf(e.value)<0}};return!t||("AND"===(r=t).operator?r.criteria.every(n):r.criteria.some(n));var r}}},9853:(e,t,n)=>{n.d(t,{$S:()=>a,Hn:()=>i,MU:()=>o});const r={web:{auto_init:!1,track_pageview_engagement:!0,track_form_submission:!1,track_link_click:!0,track_pageview_complete:!0,add_alchemy_taxonomy:!1,add_alchemy_entities:!1,engagement_edge_only:!0,segment_transition_edge_only:!0,activationConfigs:[]},tradedesk:{auto_init:!0,advertiser_id:"elm9crd",activationConfigs:[{id:"2db7373d-97c2-4b37-99db-57e0dc64acd5",tt:"EveryTime",sc:144171,c:{},wc:{advertiser_id:"elm9crd"}},{id:"1eae7c89-7dbf-4225-b692-15f7344f2805",tt:"EveryTime",sc:144170,c:{},wc:{advertiser_id:"elm9crd"}},{id:"35c227e5-a516-41a9-bc80-d9a33e5842af",tt:"EveryTime",sc:144174,c:{},wc:{advertiser_id:"elm9crd"}},{id:"148d558a-0950-4f4b-8081-4031a99fbd83",tt:"EveryTime",sc:144175,c:{},wc:{advertiser_id:"elm9crd"}},{id:"291099f8-e9c5-4499-bb72-c05ac05d0506",tt:"EveryTime",sc:144176,c:{},wc:{advertiser_id:"elm9crd"}},{id:"6689d4d8-43ed-4e23-b3b9-60a4ab57787b",tt:"EveryTime",sc:144178,c:{},wc:{advertiser_id:"elm9crd"}},{id:"67d50403-9cf5-430a-ae81-95c44fed1dea",tt:"EveryTime",sc:144177,c:{},wc:{advertiser_id:"elm9crd"}},{id:"97f4badb-26ec-4475-a461-bdccf2ef3bd5",tt:"EveryTime",sc:144173,c:{},wc:{advertiser_id:"elm9crd"}},{id:"a7b03264-03a8-4f6c-9a9b-2336264bbf9f",tt:"EveryTime",sc:144168,c:{},wc:{advertiser_id:"elm9crd"}},{id:"afcd4df0-f136-406a-86c0-9d70ea31c6c4",tt:"EveryTime",sc:144167,c:{},wc:{advertiser_id:"elm9crd"}},{id:"b4a30046-9f43-4e94-852f-adc2f272aae6",tt:"EveryTime",sc:146712,c:{},wc:{advertiser_id:"elm9crd"}},{id:"31a59941-8711-4496-b13d-f975a31e2c5a",tt:"EveryTime",sc:146713,c:{},wc:{advertiser_id:"elm9crd"}},{id:"4ef70e4b-44d9-40f3-aef5-7657a265ac87",tt:"EveryTime",sc:182816,c:{},wc:{advertiser_id:"elm9crd"}},{id:"137b9310-2b74-45a8-846f-59134c50a0e9",tt:"EveryTime",sc:147119,c:{},wc:{advertiser_id:"elm9crd"}},{id:"2fad7f57-0f0e-4dc6-a2f7-ddbbf825cf92",tt:"EveryTime",sc:146475,c:{},wc:{advertiser_id:"elm9crd"}},{id:"ce5297f2-6aee-4708-9e5c-985e590693f8",tt:"EveryTime",sc:147116,c:{},wc:{advertiser_id:"elm9crd"}},{id:"b8d91c4d-0a3c-4bc2-b4f1-0d79a3c1dbc1",tt:"EveryTime",sc:147117,c:{},wc:{advertiser_id:"elm9crd"}},{id:"bc70519a-73a1-4aad-8872-e85c2e10b6c9",tt:"EveryTime",sc:147118,c:{},wc:{advertiser_id:"elm9crd"}},{id:"68943fc3-7a68-4e38-a7ca-d78659dae5de",tt:"EveryTime",sc:147120,c:{},wc:{advertiser_id:"elm9crd"}},{id:"78bab6ad-44c7-49dc-bce2-17bb79975661",tt:"EveryTime",sc:147121,c:{},wc:{advertiser_id:"elm9crd"}},{id:"2e213a12-2cc3-42b4-b069-62f761053a67",tt:"EveryTime",sc:146714,c:{},wc:{advertiser_id:"elm9crd"}},{id:"9b7a08e6-930c-4441-828e-92d397586523",tt:"EveryTime",sc:146717,c:{},wc:{advertiser_id:"elm9crd"}},{id:"8aae98d0-7a7b-4154-a9f7-653ff73a81ad",tt:"EveryTime",sc:146721,c:{},wc:{advertiser_id:"elm9crd"}},{id:"91dc687c-858e-4b19-80f1-ecb6668c17c3",tt:"EveryTime",sc:147114,c:{},wc:{advertiser_id:"elm9crd"}},{id:"9831f2bb-be9b-44c8-8063-0506021c3e38",tt:"EveryTime",sc:147115,c:{},wc:{advertiser_id:"elm9crd"}},{id:"bdfd51bb-eeca-4ca7-a0a7-39b9e18d6791",tt:"EveryTime",sc:182805,c:{},wc:{advertiser_id:"elm9crd"}},{id:"7398ad98-7bef-4c16-a637-cc1f2cb92bed",tt:"EveryTime",sc:182815,c:{},wc:{advertiser_id:"elm9crd"}},{id:"16e4cec4-cba0-40d0-8473-474d4c2ec2e0",tt:"EveryTime",sc:182809,c:{},wc:{advertiser_id:"elm9crd"}},{id:"79f78330-3966-42ae-b892-048526126521",tt:"EveryTime",sc:182796,c:{},wc:{advertiser_id:"elm9crd"}},{id:"f96272a4-e648-4e54-8b04-2f4d631a5f17",tt:"EveryTime",sc:182801,c:{},wc:{advertiser_id:"elm9crd"}},{id:"5d824049-8dea-4a37-8eb5-d6fc93c348c4",tt:"EveryTime",sc:182799,c:{},wc:{advertiser_id:"elm9crd"}},{id:"c39b0774-90c7-4787-94a4-4043fa19d002",tt:"EveryTime",sc:146715,c:{},wc:{advertiser_id:"elm9crd"}},{id:"157132cf-a3a0-4d2d-a1e6-0bbf2d5ddcd0",tt:"EveryTime",sc:146716,c:{},wc:{advertiser_id:"elm9crd"}},{id:"051e77bc-2aef-4832-aa10-e20581f04835",tt:"EveryTime",sc:146718,c:{},wc:{advertiser_id:"elm9crd"}},{id:"1379ead7-35d6-41bb-a39b-8be7aad9f3cf",tt:"EveryTime",sc:146719,c:{},wc:{advertiser_id:"elm9crd"}},{id:"3045e73f-7abd-40f5-b214-722f24dd7ef9",tt:"EveryTime",sc:146720,c:{},wc:{advertiser_id:"elm9crd"}},{id:"629bb66f-3895-4e8a-b5e1-d919e8e0aeb4",tt:"EveryTime",sc:146723,c:{},wc:{advertiser_id:"elm9crd"}},{id:"9e22fd6a-e34e-4fe5-8314-eb984a5aff9b",tt:"EveryTime",sc:182818,c:{},wc:{advertiser_id:"elm9crd"}},{id:"8f7eaab9-b3b0-4ea9-8417-6a01d63ce058",tt:"EveryTime",sc:182804,c:{},wc:{advertiser_id:"elm9crd"}},{id:"8f4dd357-7278-4183-ab80-834d099a8118",tt:"EveryTime",sc:182822,c:{},wc:{advertiser_id:"elm9crd"}},{id:"9e62b99c-f251-438f-901e-fee4d5d1e7c7",tt:"EveryTime",sc:182806,c:{},wc:{advertiser_id:"elm9crd"}},{id:"5af38140-d983-4f35-8b2b-c5d13b0ed569",tt:"EveryTime",sc:182803,c:{},wc:{advertiser_id:"elm9crd"}},{id:"3c870deb-8d0a-4c19-8bc0-af1421395b8b",tt:"EveryTime",sc:182795,c:{},wc:{advertiser_id:"elm9crd"}},{id:"29bf256a-992f-478c-8219-0c183f21c42c",tt:"EveryTime",sc:182807,c:{},wc:{advertiser_id:"elm9crd"}},{id:"54e979d0-57a0-4fc0-be3d-2ed59f54d5b9",tt:"EveryTime",sc:182821,c:{},wc:{advertiser_id:"elm9crd"}},{id:"ba846426-d462-4a43-a916-b2088e1210f7",tt:"EveryTime",sc:182800,c:{},wc:{advertiser_id:"elm9crd"}},{id:"2f69a2ea-ab96-4f28-87cd-7396805769e9",tt:"EveryTime",sc:182814,c:{},wc:{advertiser_id:"elm9crd"}},{id:"8f20065d-1f53-407c-b97a-adb541cb1cd4",tt:"EveryTime",sc:182797,c:{},wc:{advertiser_id:"elm9crd"}},{id:"0e2d3af9-5eef-4c7f-98a2-396c4e11389c",tt:"EveryTime",sc:182798,c:{},wc:{advertiser_id:"elm9crd"}},{id:"eea6b52a-9299-407b-a8f1-ece84c45e749",tt:"EveryTime",sc:182811,c:{},wc:{advertiser_id:"elm9crd"}},{id:"37c37137-d9d7-4d0f-aad3-f43afa34f2bc",tt:"EveryTime",sc:182808,c:{},wc:{advertiser_id:"elm9crd"}},{id:"d2c4ccb7-1c13-46dd-b4ea-79d94c513445",tt:"EveryTime",sc:182823,c:{},wc:{advertiser_id:"elm9crd"}},{id:"33f88196-877d-40e0-8bbe-f84050f110d7",tt:"EveryTime",sc:182824,c:{},wc:{advertiser_id:"elm9crd"}},{id:"a7550f69-3826-4544-b0e4-7a919a8d34b5",tt:"EveryTime",sc:182812,c:{},wc:{advertiser_id:"elm9crd"}},{id:"0906477d-8703-4f62-8a71-394f2b85cd0a",tt:"EveryTime",sc:182820,c:{},wc:{advertiser_id:"elm9crd"}},{id:"000201f4-c08f-4166-8d3c-7b7c14ee270d",tt:"EveryTime",sc:182813,c:{},wc:{advertiser_id:"elm9crd"}},{id:"78d5c1a3-2c63-47a9-922e-8d34b3e0c3bd",tt:"EveryTime",sc:182817,c:{},wc:{advertiser_id:"elm9crd"}}]},pubmatic:{auto_init:!0,dpid:"1003",activationConfigs:[]},dfp:{auto_init:!0,track_slot_rendered:!1,track_slot_viewable:!0,track_slot_clicked:!0,activationConfigs:[]},tracking_pixel:{auto_init:!0,activationConfigs:[]},dbm:{auto_init:!0,entity_id:2140931,product_type:"INVITE_PARTNER",activationConfigs:[]},freewheel:{auto_init:!0,activationConfigs:[]},local_storage:{auto_init:!0,activationConfigs:[]},ctv:{auto_init:!1,ctv_engagement_enabled:!0,ctv_engagement_event_seconds:0,activationConfigs:[]}},i=e=>{const t=r[e];return(e,n)=>(null==t?void 0:t[e])??n},o=i("web"),a=i("dfp");i("facebook_pixel_v2")},2836:(e,t,n)=>{n.d(t,{z:()=>o,k:()=>a});var r=n(3030);class i{context;constructor(e){this.context=e}getContext(){return this.context}updateContext(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach((e=>{let[t,n]=e;this.context[t]=n}))}}class o extends i{constructor(e){super(e)}getClient(){return Promise.resolve(a())}}const a=()=>{const e="PermutiveWebSDK/v20.9.2";return{type:"web",user_agent:navigator.userAgent?`${navigator.userAgent} ${e}`:e,url:(0,r.bk)(window.location.href),domain:window.location.hostname||"",title:document.title,referrer:(0,r.bk)(document.referrer)}}},1568:(e,t,n)=>{n.d(t,{J:()=>c});var r=n(3735),i=n(2884),o=n(7554);const a=e=>t=>class extends t{key=e;put(e){return this.db.then((t=>t.put(e,this.key))).then(r.Q1)}getIfPresent(){return this.db.then((e=>e.get(this.key))).then(i.ij)}reset(){return this.db.then((e=>e.delete(this.key)))}},s=e=>(0,r.zG)(class{db;constructor(e){this.db=Promise.resolve((0,o.E)(e.namespace,e.logger,e.consent))}},a(e));class c extends(s("permutive-unprocessed-pba")){constructor(e){super(e)}}},5700:(e,t,n)=>{n.d(t,{LP:()=>o,dG:()=>r,eP:()=>i});const r=4096,i=`Cookie exceeds maximum supported size of ${r} bytes for most browsers.`,o="Cookie is missing required parameters."},5619:(e,t,n)=>{n.d(t,{Eq:()=>d,X:()=>f,b:()=>l});var r=n(2851),i=n(2116),o=n(4268),a=n(2751),s=n(4011),c=n(3735),u=n(2884);const l=()=>({continent:void 0,environment:"",events_count:0,os:"",sample_rate:0,sdk_version:"",segments_count:0,session_count:0,session_init_count:0,session_view_count:0,user_agent:""}),d=o.n_({continent:{equals:(e,t)=>e===t},environment:a.Eq,events_count:s.Eq,os:a.Eq,sample_rate:s.Eq,sdk_version:a.Eq,segments_count:s.Eq,session_count:s.Eq,session_init_count:s.Eq,session_view_count:s.Eq,user_agent:a.Eq}),f=e=>{const t=p(e.userId),n=(0,c.zG)(r.vP(e.userId,e.sessionId),r.UI((e=>{let[t,n]=e;return`${t},${n}`})),p),o=String(Math.random()),a=(0,c.zG)(e.sdkVariant,u.UI((e=>`-${e}`)),u.fS((()=>""))),s={environment:"web",events_count:0,os:g(window.navigator.userAgent||""),sample_rate:e.sampleRate,sdk_version:"v20.9.2"+a,segments_count:0,user_agent:window.navigator.userAgent||""};return(0,c.zG)(i.vP({session_count:t(e.sessionId),session_init_count:n(r.a9(o)),session_view_count:n(e.viewId)}),i.UI((0,c.ls)((t=>r.vP({...t,continent:(0,c.zG)(e.continent,r.UI(u.FS))})),r.UI((e=>({...s,...e}))))))},g=e=>{const t=e.toLowerCase();return t.includes("windows")?"windows":t.includes("iphone")||t.includes("ipad")?"ios":t.includes("android")?"android":t.includes("macintosh")?"macos":t.includes("linux")?"linux":"unknown"},p=e=>t=>i.dQ((n=>{let{previousState:i}=n;const u=(0,c.zG)(r.vP(e,t),r.Rp(function(e){if(null!==e&&"object"==typeof e&&"scope"in e&&"lastValue"in e&&"count"in e)return e;return{scope:"",lastValue:"",count:1}}(i),((e,t)=>{let[n,r]=t;return{scope:n,lastValue:r,count:n!==e.scope?1:r!==e.lastValue?e.count+1:e.count}})),r.D8(o.n_({scope:a.Eq,lastValue:a.Eq,count:s.Eq})));return{state:u,value:(0,c.zG)(u,r.UI((e=>e.count)))}}))},6478:(e,t,n)=>{n.d(t,{p:()=>f});var r=n(2688),i=n(3735),o=n(2652),a=n(5619),s=n(2851),c=n(3328),u=n(2707),l=n(7407),d=n(3992);const f=e=>{let t=e.context.current;(0,i.zG)(e.context,s.D8(a.Eq),s.Rp((0,i.bc)(a.b(),a.b()),((e,t)=>{let[,n]=e;return(0,i.bc)(n,t)})),(e=>e.onChange((e=>{let[n,r]=e;a.Eq.equals({...n,continent:void 0},{...r,continent:void 0})||g({beacon:!1}),t=r}))));const n="[Metrics Reporter]";let f=!0;const g=async o=>{let{beacon:a}=o;const s=t,d=(0,i.zG)(u.of(e.metrics.consume()),u.Y$((()=>f),(()=>{})),u.tS(c.EQ((()=>u.of(void 0)),(t=>u.Y3((()=>(async(t,n)=>{if(!t)return e.api.metrics(n);if(!e.api.metricsBeacon(n))throw new Error("Failed to send beacon.")})(a,{context:s,items:t})),(i=>{f=!1,function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.logger.error(n,...r)}(`Failed to publish metrics ${(0,r.w)(i).message}`,t)}))))),l.UI(i.Q1));return d()};(0,d.HJ)((()=>g({beacon:!1})),5e3),(0,o.Bf)((()=>g({beacon:!0})),{capture:!1})}},7575:(e,t,n)=>{n.d(t,{u:()=>r});class r{trace;metrics;messages;_isRealtime=!1;_isReady=!1;constructor(e,t,n){this.trace=e,this.metrics=t,this.messages=n}isRealtime(){return this._isRealtime}isReady(){return this._isReady}setAsRealtime(e){const t=performance.now();this._isRealtime=!0,this.trace.measureSinceInit("sdk_realtime").finish(),this.messages.emit("permutive:realtime"),this.metrics.trackTimeSinceInit("sdk_realtime_targeting_set_task_duration_seconds",{},t),this.metrics.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"sdk_realtime",time_origin:"sdk_init"},t),this.metrics.track({name:"sdk_user_segments_count",value:e,labels:{}})}setAsReady(){const e=performance.now();this._isReady=!0,this.trace.measureSinceInit("sdk_ready").finish(),this.messages.emit("permutive:ready"),this.metrics.trackTimeSinceInit("sdk_initialisation_task_duration_seconds",{},e),this.metrics.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"sdk_ready",time_origin:"sdk_init"},e),window.performance&&window.performance.memory&&(this.metrics.track({name:"sdk_heap_memory_bytes_used",value:window.performance.memory.usedJSHeapSize,labels:{}}),this.metrics.track({name:"sdk_heap_memory_limit_fraction_used",value:window.performance.memory.usedJSHeapSize/window.performance.memory.jsHeapSizeLimit,labels:{}}))}}},3898:(e,t,n)=>{n.d(t,{a:()=>b});var r=n(3735),i=n(4923),o=n(2751),a=(n(5605),i.dp,i.xb,function(e){return function(t){return Object.keys(t).sort(e.compare)}}),s=a(o.Df);i.dx,i.e$;i.Bu,i.P5,i.Su,i.UI;i.ri;function c(e){return i.vP(e)}i._r;i.jt;i.yW,i.G,i.t9;var u=i.HA,l=(i.nn,i.kp),d=i.CC,f=i.RF,g=(i.I8,i.mS,i.RJ,i._Y,i.V_),p=i.EW,m=i.nu,v=(i.SW,i.zV,i.Ub,i.vA,i.qS),h=(i.mK,function(e){return function(t){var n=a(e);return function(e,r){var i=n(e);if(0===i.length)return t.of({});for(var o=t.of({}),a=function(n){o=t.ap(t.map(o,(function(e){return function(t){return e[n]=t,e}})),r(n,e[n]))},s=0,c=i;s<c.length;s++){a(c[s])}return o}}});i.hX,i.DZ,i.uK,i.tV;i.oA,i.oh;var _="Record";i.Eh,i.uZ,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,i.nr,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df,o.Df;class b{config;localStorage;logger;permutiveData;cookies;externalData;constructor(e,t,n,r,i,o){this.config=e,this.localStorage=t,this.logger=n,this.permutiveData=r,this.cookies=i,this.externalData=o}async reset(){return this.logger.log("Resetting State"),(0,r.zG)(this.cookies.deleteCookie(this.config.cookieName),(e=>this.externalData.removeExternalData(this.config.cookieName)),(e=>s({_paols:!0,_papns:!0,_pcrdbs:!0,_pcrprs:!0,_pdfps:!0,_pfws:!0,_pnativo:!0,_prps:!0,_prubicons:!0,_psegs:!0,_psmart:!0,"permutive-id":!0,"permutive-loaded":!0,"permutive-prebid-rtd":!0,"permutive-events-cache":!0,_pssps:!0,_ppsts:!0}).forEach((e=>this.externalData.removeExternalData(e)))),(e=>this.permutiveData.reset()),(e=>Promise.all([this.localStorage.delete(this.config.permutiveDataMiscKey),this.localStorage.delete(this.config.permutiveDataQueriesKey)])),r.Q1)}}},7274:(e,t,n)=>{n.d(t,{u:()=>r});class r{permutiveData;permutiveReset;userId;viewId;logger;constructor(e,t,n,r,i){this.permutiveData=e,this.permutiveReset=t,this.userId=n,this.viewId=r,this.logger=i}getPermutiveData(e){return this.permutiveData.getData(e)}setPermutiveData(e,t){return this.permutiveData.setData(e,t)}getStateSizeInBytes(){return this.logger.warn("getStateSizeInBytes needs to be updated to reflect new event persistence"),this.permutiveData.getDataSize()}reset(){return this.permutiveReset.reset()}}},9880:(e,t,n)=>{n.d(t,{W:()=>r});class r{ref;constructor(e){this.ref=e}get(){return this.ref.current}}},7554:(e,t,n)=>{n.d(t,{E:()=>i});var r=n(8259);const i=(e,t,n)=>{const i=window.localStorage;return(0,r.rK)(i,"[Local Storage]",e,t,n)}},9332:(e,t,n)=>{n.d(t,{u:()=>i});n(2233);var r=n(8259);const i=(e,t,n)=>{const i=window.sessionStorage;return(0,r.rK)(i,"[Session Storage]",e,t,n)}},8259:(e,t,n)=>{n.d(t,{oP:()=>c,rK:()=>d});var r=n(2688),i=n(787),o=n(365),a=n(3735),s=n(4769);class c{storage;namespace;constructor(e,t){this.storage=e,this.namespace=t}async put(e,t){const n=this.namespace.getNamespacedStorageKey(t.toString());return this.storage.setItem(n,JSON.stringify(e)),t}async get(e){const t=this.namespace.getNamespacedStorageKey(e.toString()),n=this.storage.getItem(t);return null===n?null:(0,i.A)(n)}async delete(e){const t=this.namespace.getNamespacedStorageKey(e.toString());this.storage.removeItem(t)}async deleteStore(){}}const u=e=>{const{logger:t,consent:n,prefix:r}=e,i=(e,n)=>(t.debug(`${r} Failed to write ${String(n)} as consent is revoked`),Promise.resolve(n));return e=>class extends e{put=(0,s.v)(super.put.bind(this),i,(()=>!n.current))}},l=e=>{const{logger:t,prefix:n,storage:i}=e;return e=>class extends e{isSupported=null;isStorageSupported(){return null!==this.isSupported||(this.isSupported=o.Y3((()=>{const e="_permutive_ls_test";return i.setItem(e,e),i.getItem(e),i.removeItem(e),!0}),r.w),(0,a.zG)(this.isSupported,o.EQ((e=>{t.warn(`${n} Is NOT supported`,e)}),(()=>{t.debug(`${n} Is supported`)})))),this.isSupported}async put(e,t){return(0,a.zG)(this.isStorageSupported(),o.EQ((e=>{throw e}),(()=>super.put(e,t))))}async get(e){return(0,a.zG)(this.isStorageSupported(),o.EQ((()=>null),(()=>super.get(e))))}async delete(e){return(0,a.zG)(this.isStorageSupported(),o.EQ(a.Q1,(()=>super.delete(e))))}async deleteStore(){return(0,a.zG)(this.isStorageSupported(),o.EQ(a.Q1,(()=>super.deleteStore())))}}},d=(e,t,n,r,i)=>new((0,a.zG)(c,l({logger:r,prefix:t,storage:e}),u({logger:r,consent:i,prefix:t})))(e,n)},2497:(e,t,n)=>{n.d(t,{SD:()=>d});var r=n(2884),i=n(3328),o=n(4923),a=n(3735),s=n(2851),c=n(2652);const u={tradedesk:21,ddp:755,appnexus:32,pubmatic:76,neustar_fabrick:468},l="[TCF]",d=(e,t)=>{const[n,d,g]=(0,a.zG)(s.Ue(r.YP),(e=>{let[n,...i]=e;return[(0,a.zG)(n,s.bw(r.UI((e=>{t.debug(l,`Status "${e.type}"`,e)})))),...i]})),p=e.__tcfapi;if(p){const e=new Set(["tcloaded","useractioncomplete"]);p("addEventListener",2,((n,i)=>{i?"loaded"===n.cmpStatus&&e.has(n.eventStatus)&&(t.debug(l,"TCF API loaded",n),d(r.G({type:"loaded",data:n}))):(t.warn(l,"TCF API failed to register event listener"),d(r.G({type:"aborted"})),g())}))}else t.debug(l,"TCF API missing from the page"),d(r.G({type:"missing"})),g();const[m,v]=(0,a.zG)(s.gS(i.uZ()),(e=>{let[t,n]=e;return[t,(0,a.ls)(i.of,n)]}));return(0,a.zG)(s.vP(n,m),s.bw((e=>{let[n,i]=e;return(0,a.zG)(n,r.UI((e=>{const n=i();switch(t.debug(l,`Processing ${n.length} listeners`,n),e.type){case"missing":n.forEach((n=>{let[r,i]=n;t.debug(l,`Invoking ${r} as TCF API missing`),i(e)}));break;case"aborted":n.forEach((e=>{let[n]=e;t.debug(l,`Invoking ${n} skipped as TCF API aborted`)}));break;case"loaded":n.forEach((n=>{let[i,s]=n;(0,a.zG)(f(e.data),r.EQ((()=>{t.debug(l,`Invoking ${i} as GDPR does not apply`),s(e)}),(n=>(0,a.zG)(u,o.P5(i),r.tS((e=>(0,a.zG)(n,o.P5(e.toString())))),r.UI((n=>{n?(t.debug(l,`${i} has consent`,{vendor:i}),s(e)):t.debug(l,`${i} does not have consent`,{vendor:i})}))))))}))}})))}))),{registerVendorOnValidConsent:(e,t)=>v([e,t]),getStatusOrAbortOnTimeout:e=>new Promise((t=>{const i=setTimeout((()=>t({type:"aborted"})),e);(0,a.zG)(n,s.UI(r.UI((e=>{clearTimeout(i),t(e)}))))})).then((0,c.bw)((e=>t.debug(l,"TCF status resolved as",{status:e}))))}},f=e=>e.gdprApplies?r.G(e.vendor.consents):r.YP},6037:(e,t,n)=>{n.d(t,{C:()=>c});var r=n(5851),i=n(3735);var o=n(7305);const a=(s=[[{name:"dfp",import:Promise.resolve().then(n.bind(n,4388))}],[],[],[],[],[],[],[{name:"dbm",import:Promise.resolve().then(n.bind(n,8431))}],[{name:"ddp",import:Promise.resolve().then(n.bind(n,3512))}],[],[],[],[{name:"freewheel",import:Promise.resolve().then(n.bind(n,2097))}],[],[{name:"local_storage",import:Promise.resolve().then(n.bind(n,2271))}],[],[],[],[],[],[],[{name:"pubmatic",import:Promise.resolve().then(n.bind(n,1840))}],[],[],[],[{name:"tracking_pixel",import:Promise.resolve().then(n.bind(n,3792))}],[{name:"tradedesk",import:Promise.resolve().then(n.bind(n,696))}],[],[{name:"web",import:Promise.resolve().then(n.bind(n,4400))}],[],[{name:"ctv",import:Promise.resolve(o)}],[],[]],(0,i.zG)((0,r.xH)(s),(0,r.u4)({},((e,t)=>({...e,[t.name]:t.import})))));var s;const c=e=>{const t=Object.entries(a).map((async t=>{let[n,r]=t;return e.logger.log(`Loading addon ${n}`),(await r).load(e)}));return Promise.all(t)}},9658:(e,t,n)=>{n.r(t),n.d(t,{createAddon:()=>S,getCachedDFPSegments:()=>w});var r=n(2688),i=n(365),o=n(3735),a=n(2884),s=n(3328),c=n(2851),u=n(9853),l=n(2652);const d="_pdfps";n(5700);var f=n(5851),g=n(2751);let p=!1;let m=null;const v=(e,t)=>{const{logger:n}=t;(0,o.zG)(e,a.UI((e=>{!0!==p&&e.pubadsReady&&(m??=r=>{let{slot:i}=r;const{getContentUrl:a}=i;if(!a||"function"!=typeof a)return;(0,o.zG)(a(),(0,g.pn)("&trunc=1"))&&(n.debug("DFP content URL has been truncated!"),(e=>{let{metrics:t,logger:n}=e;p||(t.track({name:"sdk_targeting_size_limit_exceeded_count",value:1,labels:{target:"dfp"}}),p=!0,n.debug("DFP has exceeded targeting limit"))})(t),m&&e.pubads().removeEventListener("slotRenderEnded",m),m=null)},e.pubads().addEventListener("slotRenderEnded",m))})))},h=(e,t,n,r)=>{const{logger:i}=t;v(e,t);(0,o.zG)(e,a.UI((e=>(e=>{e.cmd.push((()=>{const{getTargeting:t,setTargeting:o}=e.pubads(),a=t("permutive")||[],s=Object.values(n.eligibleSegments).map(String).concat(n.allSeenCloudCohorts).concat("rts"),c=(0,f.uK)((e=>s.includes(e))),{left:u}=c(a),l=r.concat(u).concat("rts");i.debug("DFP setting GPT targeting to",l),o("permutive",l)}))})(e))))};var _=n(4388);const b={liveSegments:[],cloudCohorts:[],allSeenCloudCohorts:[],eligibleSegments:{}},y={segments:b,getGAMKeyValues:()=>({permutive:""})},w=e=>e.getExternalJsonData(d)||[],E=(e,t,n)=>{const{logger:i,externalData:o,api:a}=t;let s=n.map(String).concat(b.cloudCohorts);i.debug("DFP is updating with targeting values",s),h(e,t,b,s);try{o.setExternalJsonData(d,s)}catch(e){const t=(0,r.w)(e),n="DFP failed to set data. Got:";i.error(n,t),a.reportError(`${n} ${t.message}`)}return((e,t)=>{let{api:n,logger:r}=e;(0,u.$S)("sync_segments_cookie",!1)?(r.debug("DFP syncing segment cookie _pdfps"),n.segmentSync({key:d,value:t})):r.debug("DFP sync segments cookie not enabled, skipping sync")})(t,JSON.stringify(s)),i.debug("DFP live segments updated to",n),n},S=async e=>{const{api:t,logger:n,activationManager:r,messages:u,externalData:f,nextGenOutput:g,userId:p,cookies:m}=e,v=await(0,l.a4)((()=>window.googletag),(()=>!!window.googletag),{waitTimeInMs:10,maxAttempts:200,exponentialBackOff:!1});a.Wi(v)&&n.error("[DFP]: unable to find google tag script on the page"),(0,o.zG)(v,a.UI((e=>(e=>e.cmd.push((()=>e.pubads().setTargeting("prmtvsdk","web"))))(e))));y.getGAMKeyValues=()=>({...(0,o.zG)((0,_.generateProjectSpecificKVs)(e),i.Vn((e=>{var n;return n=e,t.reportError(`[DFP] ${n}`,p.get()),e})),i.fS((()=>({})))),permutive:y.segments.liveSegments.join(",")}),b.eligibleSegments=(e=>{const t=e.getSpecializedActivations("dfp"),n={};for(const e of t.dfp)n[e]=e;for(const e of Object.keys(t.dfp_legacy)){const r=Number(e);n[r]=t.dfp_legacy[r]}return n})(r);const h=(0,o.zG)(g.queryLanguageCohorts.all,c.UI((e=>(n.debug("DFP received QL segments",{qlSegments:e}),((e,t)=>e.filter((e=>e in t)).map((e=>t[e])))(e,b.eligibleSegments)))),c.D8(l.cO)),w=g.activations.dfp??c.a9(s.bM()),S=(0,o.zG)(w,c.Rp(s.bM(),((e,t)=>[...new Set([...e,...t])])));return(0,o.zG)(c.vP(h,w,S),c.YP((0,l.Z_)(t,p,(t=>{let[r,i,o]=t;n.debug("DFP received updated cohorts",{filteredQlSegments:r,cloudCohorts:i}),b.cloudCohorts=i,b.allSeenCloudCohorts=o,b.liveSegments=E(v,e,r)})))),n.debug("DFP initialised with segments",b),u.on("permutive:reset",(0,l.Z_)(t,p,(()=>{n.debug("DFP received 'permutive:reset' event"),f.removeExternalData(d),m.deleteCookie(d)}))),u.emit("permutive:dfp:ready"),y}},4388:(e,t,n)=>{n.r(t),n.d(t,{generateProjectSpecificKVs:()=>U,load:()=>f});var r=n(2688),i=n(365),o=n(2884),a=n(3735),s=n(922),c=n(9853),u=n(2652),l=n(9658);const d={},f=e=>{(0,c.Hn)("dfp")("auto_init",!1)&&e.q.push({functionName:"addon",arguments:["dfp",{}]}),window.googletag=window.googletag||{},window.googletag.cmd.push((()=>g(e)))},g=e=>{e.permutive.ready((0,u.Z_)(e.api,e.userId,(()=>S(e.metrics))),"realtime");I(e.externalData);(0,a.zG)(U(e),i.tS((e=>i.Y3((()=>(0,u.qh)(e).forEach((e=>{let[t,n]=e;googletag.pubads().setTargeting(t,n)}))),r.w))),i.Vn((t=>e.api.reportError(`[DFP:load], ${t}`,e.userId.get())))),b(e.permutive),googletag.cmd.push((()=>{y(e.permutive),w(e.permutive)})),window.addEventListener("message",m(e.permutive),!1)},p=e=>{let{advertiserId:t,campaignId:n,lineItemId:r,creativeId:i}=e;return{advertiser_id:(0,u.rH)(t),campaign_id:(0,u.rH)(n),line_item_id:(0,u.rH)(r),creative_id:(0,u.rH)(i)}},m=e=>t=>{try{const n=JSON.parse(t.data);if(!n.permutive_type||"google_ad_click"!==n.permutive_type)return;const{ad_unit_path:r,creative_id:i,advertiser_id:o,order_id:a,line_item_id:s}=(null==n?void 0:n.data)??{},c=p({lineItemId:s,advertiserId:o,campaignId:a,creativeId:i});let u;Object.keys(d).some((e=>{const{slot:t,creative_id:n}=d[e];if((null==t?void 0:t.ad_unit_path)===r&&n===c.creative_id)return u=d[e],!0})),u=u??{...c,is_empty:!1},v(e,u)}catch{}},v=(e,t)=>{s.PH&&t&&e.track("SlotClicked",t)},h={},_=(e,t,n)=>{d[t]=n,E(e,n),h[t]&&h[t](),h[t]=P(e,t)},b=e=>{const t=googletag.pubadsReady&&googletag.pubads().getSlots();t&&t.forEach((t=>{const n=t.getResponseInformation();if(!n)return;const r={...p(n),is_empty:!1,service_name:"publisher_ads",slot:k(t)},i=t.getSlotElementId();_(e,i,r)}))},y=e=>{googletag.pubads().addEventListener("slotRenderEnded",(t=>{const n={...p(t),is_empty:t.isEmpty,service_name:t.serviceName,slot:k(t.slot)};if(t.size){const[e,r]=t.size;"number"==typeof e&&"number"==typeof r&&(n.width=e,n.height=r)}const r=t.slot.getSlotElementId();_(e,r,n)}))},w=e=>{s.EW&&googletag.pubads().addEventListener("impressionViewable",(t=>{let{slot:n,serviceName:r}=t;const i=n.getResponseInformation();if(!i)return;const o={...p(i),service_name:r,slot:k(n)};e.track("SlotViewable",o)}))},E=(e,t)=>{if(!s.CL)return;var n;n={...t,rendered_timestamp:Date.now()},e.track("SlotRendered",n)},S=e=>{let t=0;const n=googletag.pubadsReady&&googletag.pubads().getSlots();n&&n.forEach((e=>e.getResponseInformation()&&t++));const r=0===t?"sdk_targeting_realtime_success_count":"sdk_targeting_realtime_fail_count";e.track({name:r,value:1,labels:{target:"dfp"}})},I=e=>{const t=(0,l.getCachedDFPSegments)(e);googletag.cmd.push((()=>{const{getTargeting:e,setTargeting:n}=googletag.pubads(),r=e("permutive")||[];n("permutive",[...new Set([...t.map(String),...r])])}))},k=e=>{const t={ad_unit_path:e.getAdUnitPath(),slot_element_id:e.getSlotElementId()};return s.jH?{...t,...(()=>{const t={},n=[];let r=[];const i=(e,i)=>{const o="slot"===e?e=>t[e]=1:()=>{},a=i.getTargetingKeys();r=a;for(let a=0;a<r.length;a++){const s=r[a];if(void 0!==t[s]&&"service"===e)continue;const c=[],u=i.getTargeting(s);for(let e=0;e<u.length;e++)c.push(u[e].toString());c.length>0&&(o(s),n.push({key:s,value:c}))}};return i("slot",e),i("service",googletag.pubads()),{targeting_keys:n}})()}:t},P=(e,t)=>{let n=[];const r=()=>(0,a.zG)((0,a.bc)((0,a.zG)(o.Y3((()=>document.getElementById(t))),o.tS(o.ij),o.tS(o.KQ((e=>e.querySelector("iframe"))))),o.ij(document.activeElement)),o.RD,o.UI((n=>{let[r,i]=n;"hidden"===document.visibilityState&&r===i&&v(e,d[t])})));return document.addEventListener("visibilitychange",r),n.push((()=>document.removeEventListener("visibilitychange",r))),()=>{n.forEach((e=>e())),n=[]}},U=e=>{let{userId:t,viewId:n}=e;return i.Y3((()=>({})),r.w)}},2271:(e,t,n)=>{n.r(t),n.d(t,{LocalStorageAddon:()=>c,load:()=>s});var r=n(9853),i=n(2652),o=n(2851),a=n(3735);const s=e=>{(0,r.Hn)("local_storage")("auto_init",!1)&&e.q.push({functionName:"addon",arguments:["local_storage",{}]})};class c{options;activations;storageKeyToSegments;constructor(e){this.options=e;const t=this;this.activations=this.options.activationManager.getActivations("local_storage"),this.storageKeyToSegments={};for(let e=0;e<this.activations.length;e++){const t=this.activations[e],n=t.getSegmentCode(),r=t.getConfig().storage_key;r in this.storageKeyToSegments||(this.storageKeyToSegments[r]={}),this.storageKeyToSegments[r][n]=!0}(0,a.zG)(e.nextGenOutput.queryLanguageCohorts.all,o.YP((0,i.Z_)(this.options.api,this.options.userId,(e=>t.exportSegments(e)))))}exportSegments(e){const t=this;Object.keys(this.storageKeyToSegments).forEach((n=>{const r=[],i=t.storageKeyToSegments[n];e.forEach((e=>{e in i&&r.push(e.toString())})),r.length>0&&this.options.externalData.setExternalData(n,JSON.stringify(r))}))}}},6733:(e,t,n)=>{n.d(t,{B:()=>r});class r{options;storageKey;syncTimeoutSeconds;tcfStatus;constructor(e,t,n){this.options=e,this.storageKey=t,this.syncTimeoutSeconds=n,this.tcfStatus=e.tcfStatus,this.sendPixel()}sendPixel(){const e=this.options.permutiveData.getData(this.storageKey);e&&!this.isExpired(e)||this.makeUrl(this.options.config.apiKey,this.options.state.userId.get()).then((e=>{this.fire(e),this.options.permutiveData.setData(this.storageKey,(new Date).getTime())}))}fire(e){(new Image).src=e}isExpired(e){return isNaN(e)||(new Date).getTime()>e+1e3*this.syncTimeoutSeconds}}},8431:(e,t,n)=>{n.r(t),n.d(t,{load:()=>i});var r=n(9853);const i=e=>{(0,r.Hn)("dbm")("auto_init",!1)&&e.q.push({functionName:"addon",arguments:["dbm",{}]})}},3512:(e,t,n)=>{n.r(t),n.d(t,{DDPPixel:()=>c,load:()=>u});var r=n(6733),i=n(365),o=n(3735),a=n(2652);const s=("https:"===location.protocol?"https:":"http:")+"//cm.g.doubleclick.net/pixel?google_nid=permutive_dmp&google_cm&type=ddp";class c extends r.B{constructor(e){super(e,"addon:ddp",86400)}async makeUrl(e,t){return(0,o.zG)(this.addGDPRParams(),i.Vn((0,a.bw)((e=>this.options.api.reportError(`Failed to make ddp url. ${e}`,t)))),i.EQ((()=>""),(n=>`${s}&k=${e}&u=${t}&${n}`)))}addGDPRParams(){return i.Y3((()=>{if("missing"===this.options.tcfStatus.type)return"gdpr=0";return`gdpr=1&gdpr_consent=${"loaded"===this.options.tcfStatus.type?this.options.tcfStatus.data.tcString:""}`}),(e=>`Failed to retrieve GDPR query params. Got ${e}`))}}const u=()=>{}},696:(e,t,n)=>{n.r(t),n.d(t,{TradeDeskPixel:()=>a,load:()=>s});var r=n(9853),i=n(6733);const o=`${"https:"===location.protocol?"https:":"http:"}//match.adsrvr.org/track/cmf/generic?ttd_pid=dbegppc&ttd_tpi=1&ttd_puid=`;class a extends i.B{constructor(e){super(e,"addon:tradedesk",86400)}async makeUrl(e,t){const n=this.addGDPRParams();return`${o}${e},${t}${n}`}addGDPRParams(){if("missing"===this.tcfStatus.type)return"&gdpr=0";return`&gdpr=1&gdpr_consent=${"loaded"===this.tcfStatus.type?this.tcfStatus.data.tcString:""}`}}const s=e=>{((0,r.Hn)("tradedesk")("auto_init",!1)||(0,r.Hn)("thirdparty_tradedesk")("auto_init",!1))&&e.q.push({functionName:"addon",arguments:["tradedesk",{}]})}},1840:(e,t,n)=>{n.r(t),n.d(t,{PubMaticAddon:()=>u,load:()=>s});var r=n(9853),i=n(2652),o=n(365),a=n(3735);const s=e=>{(0,r.Hn)("pubmatic")("auto_init",!1)&&e.q.push({functionName:"addon",arguments:["pubmatic",{}]})},c="[pubmatic]";class u{options;activations;liveDpidsToSegments;eligibleSegments;defaultDpid;constructor(e){const t=this;this.options=e;const n=(0,r.Hn)("pubmatic");this.defaultDpid=n("dpid",""),this.eligibleSegments={},this.liveDpidsToSegments={},this.activations=this.options.activationManager.getActivations("pubmatic");for(let e=0;e<this.activations.length;e++){const t=this.activations[e],n=t.getSegmentCode(),r=t.getConfig().dpid||this.defaultDpid;this.eligibleSegments[n]=this.eligibleSegments[n]||[],this.eligibleSegments[n].push(r)}const o=e.nextGenOutput.queryLanguageCohorts.all,a=this.options.permutiveData.getData("pubmatic");e.logger.log(c,"Initialised with",{defaultDpid:this.defaultDpid,activations:this.activations,eligibleSegments:this.eligibleSegments,lastUpdated:a}),void 0===a?this.updateIfNecessary(o.current):(this.liveDpidsToSegments=this.dpidsToSegments(o.current),this.options.logger.debug(c,"Updated liveDpidsToSegments to",this.liveDpidsToSegments)),o.onChange((0,i.Z_)(e.api,e.userId,(e=>t.updateIfNecessary(e))))}updateIfNecessary(e){const t=this.dpidsToSegments(e);this.options.logger.debug(c,"Updating if necessary",{dpidsToSegmentsMapping:t});for(const e in t)this.options.logger.debug(c,`Checking dpid ${e}`,{dpidsToSegmentsMapping:t}),t.hasOwnProperty(e)&&this.embedPixel(e,t[e]);this.options.state.setPermutiveData("pubmatic",(new Date).toISOString()),this.liveDpidsToSegments=t,this.options.logger.debug(c,"Updated liveDpidsToSegments to",this.liveDpidsToSegments)}embedPixel(e,t){const n=!(0,i.cO)(t,this.liveDpidsToSegments[e]);if(this.options.logger.debug(c,"Should embed pixel",n,{segments:t,dpidSegments:this.liveDpidsToSegments[e]}),n){const n="https:"===location.protocol?"https:":"http:",r=encodeURIComponent(n+"//aud.pubmatic.com/AdServer/Artemis?uidtype=0&dpid="+e+"&segid="+t.join(","));this.options.logger.debug(c,`Embedding pixel for dpid ${e}`,{segments:t}),(0,a.zG)(this.addGDPRParams(),o.UI((e=>{const t=`${n}//image6.pubmatic.com/AdServer/UCookieSetPug`;(new Image).src=`${t}?${e}&rd=${r}`,this.options.metrics.track({name:"sdk_http_request_count_total",value:1,labels:{request_method:"GET",request_path:t,request_content_length:r.length}})})),o.fS((e=>{this.options.api.reportError(`[pubmatic] Failed to create pixel. ${e}`,this.options.userId.get())})))}}addGDPRParams(){return o.Y3((()=>{if("missing"===this.options.tcfStatus.type)return"gdpr=0";return`gdpr=1&gdpr_consent=${"loaded"===this.options.tcfStatus.type?this.options.tcfStatus.data.tcString:""}`}),(e=>`Failed to retrieve GDPR query params. Got ${e}`))}dpidsToSegments(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];if(null!=this.eligibleSegments[r]){const e=this.eligibleSegments[r];for(let n=0;n<e.length;n++){const i=e[n];t[i]=t[i]||[],t[i].push(r)}}}return t}}},3792:(e,t,n)=>{n.r(t),n.d(t,{PixelAddon:()=>a,load:()=>o});var r=n(9853),i=n(2652);const o=e=>{(0,r.Hn)("tracking_pixel")("auto_init",!1)&&e.q.push({functionName:"addon",arguments:["tracking_pixel",{}]})};class a{options;activations;latestStateByDomain;eligibleSegmentsForEntries;eligibleSegmentsForExits;constructor(e){const t=this;this.options=e,this.latestStateByDomain=this.options.permutiveData.getData("addon:tracking_pixel")||{},this.activations=this.options.activationManager.getActivations("tracking_pixel");const n=0===Object.keys(this.latestStateByDomain).length;this.eligibleSegmentsForEntries={},this.eligibleSegmentsForExits={};for(let e=0;e<this.activations.length;e++){const t=this.activations[e],n=t.getTriggerType(),r=t.getSegmentCode(),i=t.getConfig().pixel_url,o=this.extractPixelType(i);"OnEntry"===n?(o in this.eligibleSegmentsForEntries||(this.eligibleSegmentsForEntries[o]={}),this.eligibleSegmentsForEntries[o][r]=t):"OnExit"===n&&(o in this.eligibleSegmentsForExits||(this.eligibleSegmentsForExits[o]={}),this.eligibleSegmentsForExits[o][r]=t)}const r=e.nextGenOutput.queryLanguageCohorts.all;n&&(0,i.Z_)(e.api,e.userId,(()=>this.firePixelsIfNecessary(r.current))),r.onChange((0,i.Z_)(e.api,e.userId,(e=>t.firePixelsIfNecessary(e))))}extractPixelType(e){return e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0]}firePixelsIfNecessary(e){const t=Object.keys({...this.eligibleSegmentsForEntries,...this.eligibleSegmentsForExits}),n={},r=this.eligibleSegmentsForEntries,i=this.eligibleSegmentsForExits;t.forEach((t=>{n[t]=n[t]||[];for(let o=0;o<e.length;o++){const a=e[o];(r[t]&&r[t][a]||i[t]&&i[t][a])&&n[t].push(e[o])}})),t.forEach((e=>{const t=n[e]||[],o=Array.isArray(this.latestStateByDomain[e])?this.latestStateByDomain[e]:[];for(let n=0;n<t.length;n++){const i=t[n];if(-1===o.indexOf(i)){const t=r[e]&&r[e][i];"OnEntry"===(null==t?void 0:t.getTriggerType())&&this.firePixel(t)}}for(let n=0;n<o.length;n++){const r=o[n];if(-1===t.indexOf(r)){const t=i[e]&&i[e][r];"OnExit"===(null==t?void 0:t.getTriggerType())&&this.firePixel(t)}}})),this.latestStateByDomain=n,this.options.state.setPermutiveData("addon:tracking_pixel",this.latestStateByDomain)}firePixel(e){(new Image).src=e.getConfig().pixel_url,e.trackImpression()}}},4400:(e,t,n)=>{n.r(t),n.d(t,{WebAddon:()=>E,load:()=>w});var r=n(2688),i=n(365),o=n(3735),a=n(4011),s=n(2884),c=n(7209),u=n(922),l=n(9853),d=n(2652);const f=(0,l.MU)("add_alchemy_entities",!1),g=(0,l.MU)("add_alchemy_taxonomy",!1);function p(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{...e&&g?{taxonomy_labels:"$alchemy_taxonomy_labels"}:{},...e&&f?{entity_names:"$alchemy_entity_names"}:{}}}function m(e,t,n,r){const i={isp_info:"$ip_isp_info",geo_info:"$ip_geo_info",...v(),...e,...t};n.track("Pageview",i).then((e=>{e&&r.emit("permutive:event:pageview",e)}))}function v(){return{}}var h=n(3992);const _=["mousemove","click","scroll"],b=["email","tel","submit","reset","button","file","password","radio","checkbox"],y=["email","e-mail","password","tel","telephone","phone","name_first","name_last","sa_zip"],w=e=>{(0,l.Hn)("web")("auto_init",!1)&&e.q.push({functionName:"addon",arguments:["web",{auto_init:!0}]})};class E{permutive;options;api;clientContext;logger;dirtyState=!1;cancelEngagementTimer=()=>{};totalCompletion=0;totalEngagedTime=0;pageEngagementDetected;cleanupPageEngagementDetection=o.Q1;constructor(e){this.permutive=e.permutive,this.options=e,this.api=e.api,this.clientContext=e.clientContext,this.logger=e.logger,this.options.customProperties.setCustomProps(e.page||{});this.pageEngagementDetected=(()=>{this.dirtyState=!0}).bind(this),m(p(this.clientContext.getContext().isArticle),this.options.customProperties.getCustomProps(),this.permutive,this.options.messages),this.enablePageEngagementDetection(),"loading"!==document.readyState?this.attachListeners():window.addEventListener("DOMContentLoaded",this.attachListeners.bind(this),!1),u.t2&&(this.cancelEngagementTimer=this.registerEngagementInterval(this.getEventInterval()))}sendFormSubmissionEvent(e){{const t=e.currentTarget,n={form:{method:t.method||"GET",properties:this.serializeForm(t),..."string"==typeof t.id?{id:t.id}:{},...t.name&&"string"==typeof t.name?{name:t.name}:{},...t.action&&"string"==typeof t.action?{action:t.action}:{}}};this.permutive.track("FormSubmission",n)}}async trackEngagementInterval(e){const t=this.updateState(e);!function(e,t,n,r,i,o){const a={isp_info:"$ip_isp_info",geo_info:"$ip_geo_info",engaged_time:e,total_engaged_time:t,...i,completion:n,total_completion:r};o.track("PageviewEngagement",a)}(t.engaged_time,t.total_engaged_time,t.completion,t.total_completion,this.options.customProperties.getCustomProps(),this.permutive)}async reset(e){this.disablePageEngagementDetection(),this.dirtyState=!1;const t=this.updateWebOptions(e);this.options.pageviewState.setState(((e,n)=>{var r,i;return{viewId:(null===(r=t.context)||void 0===r?void 0:r.view_id)??(0,d.k$)(),watsonEnabled:(null===(i=t.watson)||void 0===i?void 0:i.enabled)??n.watsonEnabled}})),this.totalCompletion=0,this.totalEngagedTime=0,this.options.customProperties.setCustomProps(this.options.page||{}),this.enablePageEngagementDetection(),m(p(this.clientContext.getContext().isArticle),this.options.customProperties.getCustomProps(),this.permutive,this.options.messages),u.t2&&(this.cancelEngagementTimer(),this.cancelEngagementTimer=this.registerEngagementInterval(this.getEventInterval()))}serializeForm(e){return[...e.getElementsByTagName("input")].filter((e=>!(!e.type||!e.id||e.disabled||e.checked||"fieldset"===e.nodeName.toLowerCase()||-1!==b.indexOf(e.type.toLowerCase())||-1!==y.indexOf(e.name.toLowerCase())))).map((e=>({name:e.name||e.id,value:e.value}))).filter((e=>e.value.length<120))}registerEngagementInterval(e){return(0,h.UM)((()=>{this.dirtyState&&this.trackEngagementInterval(e)}),1e3*e)}attachListeners(){const e=e=>"a"===e.tagName.toLowerCase(),t=e=>e instanceof Element,n=t=>e(t)?(0,s.G)(t):t.parentElement?e(t.parentElement)?(0,s.G)(t.parentElement):n(t.parentElement):s.YP;u.eV&&[].slice.call(document.getElementsByTagName("form"),0).forEach((e=>e.addEventListener("submit",(0,o.ls)(s.DT(this.canTrackPermutiveEvent("FormSubmission")),s.UI((0,d.Z_)(this.options.api,this.options.userId,this.sendFormSubmissionEvent.bind(this)))))));(0,l.MU)("track_link_click",!0)&&document.body.addEventListener("click",(0,o.ls)(s.DT(this.canTrackPermutiveEvent("LinkClick")),s.UI((e=>({event:e,anchor:(0,o.zG)(e.target,s.ij,s.tS(s.DT(t)),s.tS(n))}))),s.DZ((e=>{let{event:t,anchor:n}=e;return s.pC(n)?s.G({event:t,anchor:n.value}):s.YP})),s.UI((e=>{let{event:t,anchor:n}=e;return S(this.permutive,n,(r=t,!("_blank"===n.target||r.metaKey||r.ctrlKey||r.shiftKey||2===r.which||3===r.which)));var r}))),{capture:!0})}updateState(e){const t=Math.max(this.totalCompletion,this.getCurrentCompletion()),n=t-this.totalCompletion;return this.totalEngagedTime+=e,this.totalCompletion=t,this.dirtyState=!1,{engaged_time:e,total_engaged_time:this.totalEngagedTime,completion:n,total_completion:this.totalCompletion}}getCurrentCompletion(){if("function"==typeof this.options.getPageCompletion)return(0,o.zG)((0,i.Y3)((0,o.ls)(this.options.getPageCompletion,Number,(e=>isNaN(e)?0:e),(0,c.uZ)(a.Df)(0,1)),r.w),(0,i.EQ)((e=>(this.logger.warn("Web: invoking getPageCompletion threw an error. Got",e),0)),(e=>(this.logger.debug("Web: invoking getPageCompletion returned",e),e))));return(()=>{const e=document.documentElement.scrollHeight,t=window.pageYOffset+window.innerHeight;return t<=0?0:t>=e?1:t/e})()}registerPageEngagementCleanup(e){"function"==typeof e?this.cleanupPageEngagementDetection=()=>(0,i.Y3)((()=>{e(),this.cleanupPageEngagementDetection=o.Q1}),(e=>this.logger.warn("Page detection cleanup threw an error",(0,r.w)(e)))):this.logger.warn("No page detection cleanup was registered")}enablePageEngagementDetection(){this.options.addPageEngagementDetection&&(0,o.zG)(this.options.addPageEngagementDetection(this.pageEngagementDetected),(e=>this.registerPageEngagementCleanup(e))),this.setDirtyEventListenersTo(!0,this.getDirtyEvents())}disablePageEngagementDetection(){this.cleanupPageEngagementDetection(),this.setDirtyEventListenersTo(!1,this.getDirtyEvents())}setDirtyEventListenersTo(e,t){const n=e?window.addEventListener:window.removeEventListener;return t.forEach((e=>n(e,this.pageEngagementDetected))),null}getDirtyEvents(){return this.options.dirtyEvents||_}getEventInterval(){return this.options.eventInterval||5}canTrackPermutiveEvent(e){return t=>{var n,a;return(0,o.zG)(null===(n=this.options)||void 0===n||null===(a=n.filterPermutiveEvent)||void 0===a?void 0:a[e],s.DT((e=>"function"==typeof e)),s.tS((0,o.ls)((e=>i.Y3((()=>e(t)),(e=>new Error(`Threw an unexpected error: ${(0,r.w)(e)}`)))),i.tS(i.DT((e=>"boolean"==typeof e),(()=>new Error("Did not return a boolean")))),(0,d.bw)(i.Vn((t=>this.logger.error(`Filter predicate for "${e}" event failed`,t)))),s.Uo)),s.fS((()=>!0)))}}updateWebOptions(e){(0,d.Kn)(e)||(e={}),e.watson&&"object"==typeof e.watson&&"enabled"in e.watson&&"boolean"==typeof e.watson.enabled||delete e.watson,"object"==typeof e.filterPermutiveEvent&&null!==e.filterPermutiveEvent||delete e.filterPermutiveEvent,"context"in e&&!(0,d.Kn)(e.context)&&delete e.context;const t={addPageEngagementDetection:void 0,context:void 0,dirtyEvents:void 0,eventInterval:void 0,filterPermutiveEvent:void 0,getPageCompletion:void 0,page:void 0,watson:void 0};return this.options={...this.options,...t,...e}}}const S=(e,t,n)=>{if(window.location.href&&t.href){const r=0===t.href.indexOf("data:")?"NOT_URL":t.href;e.track("LinkClick",{dest_url:r},{useBeacon:n})}}},9078:(e,t,n)=>{n.d(t,{a:()=>r});class r{messages;handlers={};messageQueue={};constructor(e){var t,n;this.messages=e;null===(t=(n=window).addEventListener)||void 0===t||t.call(n,"message",(e=>{var t;"permutive"===(null==e||null===(t=e.data)||void 0===t?void 0:t.origin)&&this.handle(e)}),!1),this.messages.once("permutive:api:ready",(function(){var e,t;null===(e=(t=window).postMessage)||void 0===e||e.call(t,{origin:"permutive",type:"sdk-init"},"*")}))}listen(e,t){if(e in this.handlers||(this.handlers[e]=[]),this.handlers[e].push(t),e in this.messageQueue){const t=this.messageQueue[e];if(void 0===t)return;for(let e=0;e<t.length;e++){const n=t[e];this.handle(n)}}}handle(e){if(e.data.type in this.handlers)this.handlers[e.data.type].forEach((t=>{t(e)}));else{(this.messageQueue[e.data.type]??=[]).push(e)}}}},533:(e,t,n)=>{n.d(t,{o:()=>r,s:()=>i});class r extends Error{static errorName="NetworkRequestFailedError";name=r.errorName;constructor(){super(r.defaultMessage)}static get defaultMessage(){return"Network request failed"}}class i extends Error{static errorName="NetworkRequestTimeoutError";name=i.errorName;constructor(){super(i.defaultMessage)}static get defaultMessage(){return"Network request timed out"}}},7423:(e,t,n)=>{n.d(t,{F:()=>d});var r=n(2688),i=n(3735),o=n(2884),a=n(3328),s=n(3030),c=n(533),u=n(6392);class l{urls;config;network;metricsCollector;logger;webClient;prefix="[API]";constructor(e,t,n,r,i){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>o.YP;this.urls=e,this.config=t,this.network=n,this.metricsCollector=r,this.logger=i,this.webClient=a}async reportError(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date;const l=(0,r.w)(e);if(this.logError("Reporting error:\n",l),!this.config.sendClientErrors)return void this.logDebug("Send errors not enabled. Skipping");const d=(0,i.zG)(this.webClient,u.UI(o.fS((()=>{var e,t,n,r;return{domain:(null===(e=self.location)||void 0===e?void 0:e.hostname)??"",referrer:"document"in self?null===(t=self.document)||void 0===t?void 0:t.referrer:"",url:(null===(n=self.location)||void 0===n?void 0:n.href)??"",user_agent:(null===(r=navigator)||void 0===r?void 0:r.userAgent)??""}}))),u.UI((e=>{var r,i;const o={error_message:(null==l||null===(r=l.message)||void 0===r?void 0:r.toString())??"",stack_trace:null==l||null===(i=l.stack)||void 0===i?void 0:i.split("\n")},a=t?{user_id:t}:{};return{platform:"web",sdk_version:"v20.9.2",ql_runtime_version:"v10.0.2",timestamp:n,domain:e.domain,url:(0,s.bk)(e.url),referrer:(0,s.bk)(e.referrer),user_agent:e.user_agent,error_message:o.error_message??String(l),stack_trace:o.stack_trace,...a}}))),f=e=>this.network.req({url:this.urls.getSdkErrorsUrl("/errors",o.G(this.config.sdkErrorsApiVersion)),method:"POST",payload:[e],contentType:"text/plain",dataType:"text",withCredentials:!1}),g=e=>{this.metricsCollector.trackCounter({name:"sdk_http_generic_network_request_fail_count_total",value:1,labels:{network_error_type:e}})};await(0,i.zG)([c.o,c.s],a.Ew((e=>l.name===e.errorName||l.message.indexOf(e.errorName)>=0||l.message.indexOf(e.defaultMessage)>=0)),o.g_((()=>{const e=d();return f(e).catch((0,i.ls)(r.w,(e=>this.logError(e))))}),(async e=>g(e.errorName))))}logDebug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.debug(this.prefix,...t)}logError(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.error(this.prefix,...t)}}class d extends l{identifyPromise;identify(e,t,n){const r=()=>this.reqWithMetrics(e,"sdk_http_identify_seconds",{url:this.urls.getEndpointUrl("/identify",o.G(this.config.apiVersion)),method:"POST",payload:{user_id:t.get(),aliases:n},contentType:"text/plain",dataType:"json",withCredentials:!0});return this.identifyPromise?this.identifyPromise=this.identifyPromise.then(r):this.identifyPromise=r()}metrics(e){return this.network.req({url:this.urls.getEndpointUrl("/internal/metrics",o.G(this.config.apiVersion)),method:"POST",payload:e,contentType:"text/plain",dataType:"text",withCredentials:!1})}metricsBeacon(e){return this.network.reqWithBeacon({url:this.urls.getEndpointUrl("/internal/metrics",o.G(this.config.apiVersion)),payload:e})}reset(e){return this.reqWithMetrics(e,"sdk_http_reset_seconds",{url:this.urls.getEndpointUrl("/reset",o.G(this.config.apiVersion)),method:"POST",payload:null,contentType:"text/plain",dataType:"json",withCredentials:!0})}segmentSync(e){return this.network.req({url:`https://${this.config.segmentSyncApiHost}/sync/${e.key}`,method:"POST",payload:`value=${encodeURIComponent(e.value)}`,contentType:"application/x-www-form-urlencoded",dataType:"json",withCredentials:!0})}appnexus(e){return this.network.req({url:e,method:"GET",contentType:"text/plain",dataType:"json",withCredentials:!0,timeout:2e3})}pxid(e){return this.network.req({url:this.urls.makeAuthenticatedUrl(e),method:"GET",contentType:"text/plain",dataType:"json",withCredentials:!0,timeout:2e3})}queries(){const e={addons:{dfp:{activations:{dfp:[],dfp_legacy:{}},auto_init:!0,track_slot_rendered:!1,track_slot_viewable:!1,track_slot_clicked:!1,track_targeting_keys:!1,sync_segments_cookie:!1},web:{auto_init:!1,track_pageview_engagement:!0,track_pageview_complete:!0,track_form_submission:!1,track_link_click:!1,engagement_edge_only:!0,segment_transition_edge_only:!1}},queries:{queries:{},eventSegments:{},eventsLookup:[],literalsLookup:[],subexpressionsLookup:[],stateSyncReplays:[],propertiesLookup:[]},queries_metadata:{}},t=`${this.config.cdnBaseUrl.startsWith("dev.local:")?"http":"https"}://${this.config.cdnBaseUrl}/queries/08cdfe71-67da-407d-b4cc-64aaab77de67-amp.json`;return this.network.req({url:t,withCredentials:!1,dataType:"json",method:"GET"}).catch((()=>e))}pxidReset(e){return this.network.req({url:this.urls.makeAuthenticatedUrl(e),method:"POST",payload:null,contentType:"text/plain",dataType:"json",withCredentials:!0})}uploadCohortMemberships(e,t){return this.reqWithMetrics(e,"sdk_http_upload_cohort_memberships_seconds",{url:this.urls.getCCSCohortMembershipEndpointUrl("/amp/cohorts",o.G("alpha"),[["i",t.user_id]]),method:"POST",payload:t,contentType:"text/plain",dataType:"json",withCredentials:!1})}reqWithMetrics(e,t,n){const r=e.startTimer(t,{});return this.network.req(n).then((n=>(0,i.zG)(e.stopTimer(t,r),(e=>n))))}}},7354:(e,t,n)=>{n.d(t,{E:()=>b});var r=n(365),i=n(3735),o=n(533),a=n(3992),s=n(2884),c=n(9384),u=function(e){return"Left"===e._tag},l=function(e){return"Right"===e._tag};function d(e){return{_tag:"Left",left:e}}function f(e){return{_tag:"Right",right:e}}function g(e,t){return{_tag:"Both",left:e,right:t}}var p=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},m=p;m(f,d,(function(e,t){return g(t,e)}));var v=f,h="These",_=(i.yR,i.yR,c.Xl,n(2652));class b{metrics;constructor(e){this.metrics=e}req(e){return this.reqImpl(e).then((e=>(0,i.MZ)(e)))}reqWithBeacon(e){var t,n;let{url:r,payload:i}=e;const o=JSON.stringify(i),a=(null===(t=navigator)||void 0===t||null===(n=t.sendBeacon)||void 0===n?void 0:n.call(t,r,JSON.stringify(i)))??!1;return this.trackRequestMetrics({is_beacon:!0,is_error:!a,request:{method:"POST",url:r,content_length:o.length}}),a}reqImpl(e){const t="arraybuffer",{url:n,dataType:u,contentType:l,method:d,withCredentials:p,timeout:m}=e;return new Promise(((v,h)=>{const b=new XMLHttpRequest,y="POST"===e.method?"string"==typeof(w=e.payload)?w:JSON.stringify(w):null;var w;const E=e=>this.trackRequestMetrics({is_beacon:!1,request:{method:d,url:n,content_length:(null==y?void 0:y.length)??0},response:e});b.onload=(0,a.GL)((()=>{var e,n;return(0,i.zG)(b.status,r.DT((e=>e<400),(()=>{const e="text"===b.responseType||""===b.responseType?b.responseText:"Couldn't access response text";return`Failed ajax request. Status code was ${b.status}. ${e}`})),r.tS((()=>"json"===u?b.responseText?r.Y3((()=>JSON.parse(b.responseText)),(e=>`Failed to parse response as JSON. Response was ${JSON.stringify(b.responseText)}. Got ${e}`)):r.F2(null):"text"===u?r.F2(b.responseText):r.F2(b.response))),(0,_.bw)((0,i.ls)(s.IS,(n={content_length:"text"===b.responseType||""===b.responseType?(null===(e=b.responseText)||void 0===e?void 0:e.length)??0:b.responseType===t?b.response.byteLength:0,response_time_ms:self.performance.now()-S,status_code:b.status},function(e){return c.Wi(e)?f(n):g(e.value,n)}),E)),r.EQ(h,v))})),b.onerror=(0,a.GL)((()=>{E(r.t$("network error")),h(new o.o)})),b.ontimeout=(0,a.GL)((()=>{E(r.t$("timeout")),h(new o.s)})),b.open(d,n,!0),l&&b.setRequestHeader("content-type",l),b.timeout=m||b.timeout,b.withCredentials=p||b.withCredentials,b.responseType="binary"===u?t:b.responseType;const S=self.performance.now();b.send(y)}))}trackRequestMetrics(e){var t;if(null===(t=this.metrics)||void 0===t||!t.isEnabled())return;const n=new URL(e.request.url).pathname;if(n.includes("metrics"))return;const r=t=>this.metrics.track({name:"sdk_http_request_count_total",value:1,labels:{request_method:e.request.method,request_path:n,request_content_length:e.request.content_length,...t}});var o;!0===e.is_beacon?r({is_beacon:!0,is_error:e.is_error}):(0,i.zG)((o=e.response,u(o)?c.YP:(l(o),c.G(o.right))),s.aD((()=>({})),(e=>({response_content_length:e.content_length,response_status:e.status_code,response_time_ms:e.response_time_ms}))),(t=>({is_beacon:!1,is_error:!l(e.response),...t})),r)}}},7548:(e,t,n)=>{n.d(t,{X:()=>i,k:()=>r});const r=e=>({id:e.id,name:e.name,time:new Date(e.time),properties:e.properties||{},session_id:e.session_id,view_id:e.view_id}),i=e=>({id:e.id,name:e.name,time:(o(e.time)?e.time:new Date).toISOString(),properties:e.properties||{},session_id:e.session_id,view_id:e.view_id}),o=e=>isFinite(e)&&e instanceof Date},9145:(e,t,n)=>{n.r(t),n.d(t,{startMaster:()=>ue});var r=n(2851),i=n(3735),o=n(2116),a=n(2884),s=n(3328),c=n(2652),u=n(6392),l=n(4923),d=n(1828),f=n(6017),g=n(7241);var p=n(7407),m=n(6862),v=n(7341),h=n(4870);function _(e,t){return function(n){return e.map(n,t.compact)}}function b(e,t,n){var r=_(e,t),o=(0,v.UI)(e,n);return function(e){return h.s4(r((0,i.zG)(e,o(a.IS))),r((0,i.zG)(e,o(a.EK))))}}function y(e,t){return function(n){return function(r){return e.map(r,(function(e){return t.filter(e,n)}))}}}function w(e,t){return function(n){return function(r){return e.map(r,(function(e){return t.filterMap(e,n)}))}}}function E(e,t){var n=y(e,t);return function(e){var t=n((0,f.ff)(e)),r=n(e);return function(e){return(0,h.s4)(t(e),r(e))}}}function S(e,t){var n=w(e,t);return function(e){return function(t){return(0,h.s4)((0,i.zG)(t,n((function(t){return(0,a.IS)(e(t))}))),(0,i.zG)(t,n((function(t){return(0,a.EK)(e(t))}))))}}}var I=n(9384);function k(e){return(0,i.ls)(a.G,e.of)}function P(e){return(0,i.a9)(e.of(a.YP))}function U(e){return function(t){return e.map(t,a.G)}}function G(e){return(0,i.ls)(a.ij,e.of)}function D(e){var t=G(e);return function(e){return(0,i.ls)(e,t)}}function z(e){var t=F(e),n=D(e);return function(e){return t(n(e))}}function T(e){return function(t){return(0,i.ls)(t,e.of)}}function C(e){var t=F(e),n=T(e);return function(e){return t(n(e))}}function q(e){return function(t){return function(n){return e.of(a.DT(t)(n))}}}function O(e){return(0,i.ls)(a.Uo,e.of)}function x(e){return function(t,n){return function(r){return e.map(r,a.EQ(t,n))}}}function M(e){return function(t,n){return function(r){return e.chain(r,a.EQ(t,n))}}}function R(e){return function(t){return function(n){return e.chain(n,a.EQ(t,e.of))}}}function A(e){return(0,v.UI)(e,a.dO)}function L(e){return(0,d.ap)(e,a.G5)}function F(e){var t=P(e);return function(n){return function(r){return e.chain(r,a.EQ((function(){return t()}),n))}}}function $(e){var t=k(e);return function(n){return function(r){return e.chain(r,a.EQ(n,t))}}}var B=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},N=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Y=k(p.PM),K=(p.PM,p.of,p.PM,p.dO,p.UI(a.Uo)),j=(p.dO,p.qo,p.UA,p.PM,function(e){return function(){return B(void 0,void 0,void 0,(function(){return N(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(I.G)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,I.YP];case 3:return[2]}}))}))}}),Q=(p.PM,p.UA,p.PM,p.UA,A(p.dO)),W=L(p.Hi),H=Y,V=F(p.UA),J=(p.UA,p.PM,p.dO,a.Ri,p.dO,a.Ri,a.dO,p.dO,a.xu,p.dO,a.xu,p.dO,a.xu,p.dO,a.xu,function(e,t){return(0,i.zG)(e,Q(t))}),Z=function(e,t){return(0,i.zG)(e,W(t))},X=function(e,t){return(0,i.zG)(e,V(t))},ee="TaskOption",te={URI:ee,map:J},ne={URI:ee,map:J,ap:Z,chain:X},re=(I.F4,(0,v.YO)(te)),ie=(0,m.a)(ne),oe=(I.Xl,n(3992)),ae=n(8377);const se=(e,t)=>{const[n,o]=r.gS(s.uZ());return(0,i.zG)(t,r.UI(u.UI((t=>{s.Od(t)&&e.all().then((e=>(0,i.zG)(t,s.UI((0,ae.H5)((()=>e))),o)))}))),r.UI((e=>e()))),n},ce=(e,t)=>{let n=!1;return r.UI(u.UI((0,c.bw)((r=>{n||(n=(0,i.zG)(r,s.G((e=>{let[,t]=e;return"Pageview"===t.name}))),n&&e.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:t,time_origin:"sdk_init"}))}))))};function ue(e){let{eventsCacheFactory:t,metrics:m,trace:v,migratedStateMaps:h,worker:_,...b}=e;return e=>o.dQ((0,i.ls)((0,c.rO)({previousState:le}),(o=>{let{stopped:c,previousState:y}=o;(0,i.zG)(c,r.YP((e=>e&&_.stop()))),_.send({...b,migratedStateMaps:y.stateMigrated?{external:a.YP,internal:a.YP}:h(),previousState:y.workerState}),v.measureSinceInit("post_worker_config_duration").finish(),m.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"master_sent_worker_config",time_origin:"sdk_init"},performance.now());const w=v.startSpan("worker_config_response_duration"),E=_.next();E.then((()=>{w.finish(),m.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"master_received_worker_config_response",time_origin:"sdk_init"},performance.now())}));const S=((e,t)=>{const o=(0,i.zG)((()=>t),p.UI((e=>a.lo(!e))),V((()=>K(e()))),re("eventsCache"),ie("eventsCacheService",(()=>(0,i.zG)((0,oe.N1)(j((()=>Promise.resolve().then(n.bind(n,7476))))),Q((e=>e.eventCacheService)))))),c=o();return e=>{let{priorCachedEventsRequests:t,...n}=e;return e=>{let{previousState:o,stopped:l}=e;const d=r.a9(u.of(s.bM())),[f,g]=r.Ue({eventsToPublish:r.a9(u.of(s.bM())),priorCachedEventsResponses:d,state:r.a9(o)});return c.then(a.EQ((()=>g({eventsToPublish:n.eventsToPublish,priorCachedEventsResponses:d,state:r.a9(void 0)})),(e=>{let{eventsCache:r,eventsCacheService:i}=e;const{state:a,value:{newEvents:s}}=i({eventsCache:r,eventsToProcessOnPageUnload:n.eventsToPublishOnPageUnload,newEvents:n.eventsToPublish})({previousState:o,stopped:l});g({eventsToPublish:s,priorCachedEventsResponses:se(r,t),state:a})}))),{state:(0,i.zG)(f,r.VS((e=>e.state))),value:(0,i.bc)((0,i.zG)(f,r.VS((e=>e.priorCachedEventsResponses))),{...n,eventsToPublish:(0,i.zG)(f,r.VS((e=>e.eventsToPublish)))})}}}})(t,E.then((e=>e.eventsCachedInWorker)));return(0,i.zG)((()=>_.read()),function(e,t){const n=e=>(0,i.zG)(e,l.Hd((e=>e in t)),(e=>{let{left:t,right:n}=e;return{buffers:n,nonBuffers:t}}));return o=>{const{buffers:a,nonBuffers:s}=n(e),[c,u]=r.Ue({...s,...(0,i.zG)(a,l.Su((e=>()=>{const n=a[e];return a[e]=t[e].empty,n})))});return(async()=>{for(;;){const e=(0,i.zG)(await o(),g.UI(n),g.ur({concat:(e,n)=>({nonBuffers:{...e.nonBuffers,...n.nonBuffers},buffers:(()=>{const r={...e.buffers};for(const e in n.buffers)r[e]=e in r?t[e].concat(r[e],n.buffers[e]):n.buffers[e];return r})()})})),r=(0,i.zG)(e.buffers,l.Su(((e,n)=>(a[e]=t[e].concat(a[e],n),()=>{const n=a[e];return a[e]=t[e].empty,n}))));u({...c.current,...e.nonBuffers,...r})}})(),(0,i.zG)(e,l.Su((e=>(0,i.zG)(c,r.UI((t=>t[e]))))))}}({activations:y.activations,cohorts:y.cohorts,context:{},eventsToPublish:s.cS,eventsToPublishOnPageUnload:s.cS,externalData:{},geoIP:a.YP,metrics:s.cS,priorCachedEventsRequests:s.cS,realtime:!1,state:y.workerState,transitionsSinceInit:{segmentsEntered:s.cS,segmentsExited:s.cS},workerStateFlushed:!1,stateMigratedThisInitialisation:!1},{eventsToPublish:s.uZ(),metrics:s.uZ(),priorCachedEventsRequests:s.uZ()}),(e=>{let{metrics:t,...n}=e;return t.onChange((e=>e().forEach((e=>m.track(e))))),n}),(t=>{let{workerStateFlushed:n,stateMigratedThisInitialisation:o,activations:g,cohorts:p,state:v,...h}=t;const{value:[b,w],state:E}=S(h)({stopped:c,previousState:y.masterEventsCache});return function(e,t,n){const o=(0,i.zG)(r.vP(t),r.UI((0,i.ls)(l.UI((e=>"function"==typeof e?e:u.of(e))),(0,d.Yt)(u.G5))));let s=o.current();e(s),(0,i.zG)(o,r.YP((t=>{const r=t(),o=(0,i.zG)(r,l.z7(((e,t)=>{var r;return t!==s[e]&&(null===(r=n[e])||void 0===r||!r.isEmpty(t))})),a.DT((0,f.ff)(l.xb)));a.pC(o)&&(s={...s,...o.value},e(o.value))})))}(_.send,{consent:e.consent,contextualCohorts:e.contextualCohorts,enrichmentReplacementMap:e.enrichmentReplacementMap,eventSourceId:e.eventSourceId,identities:e.identities,userId:e.userId,userIdIsNewlyGenerated:e.userIdIsNewlyGenerated,newEvents:(0,i.zG)(e.newEvents,ce(m,"pageview_sent_to_worker")),sessionId:e.sessionId,viewId:e.viewId,webClient:e.webClient,pageviewState:e.pageviewState,priorCachedEventsResponses:b},{newEvents:{isEmpty:s.xb},priorCachedEventsResponses:{isEmpty:s.xb}}),m.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"master_sent_worker_input",time_origin:"sdk_init"},performance.now()),{state:r.vP({activations:g,cohorts:p,masterEventsCache:E,workerState:v,stateMigrated:(0,i.zG)(r.vP(n,o),r.Rp(y.stateMigrated,((e,t)=>{let[n,r]=t;return e||n&&r})))}),value:{...w,stateMigratedThisInitialisation:o,activations:{dfp:r.UI((e=>e.dfp),g),xandr_ssp:r.UI((e=>e.xandr_ssp),g)},cohorts:{all:r.UI((e=>e.all),p),ql:r.UI((e=>e.ql),p),qlCustom:r.UI((e=>e.qlCustom),p),qlStandard:r.UI((e=>e.qlStandard),p)}}}}))})))}const le=e=>me(e)?{activations:de(e.activations),cohorts:ge(e.cohorts),masterEventsCache:e.masterEventsCache,workerState:e.workerState,stateMigrated:!!e.stateMigrated}:{activations:de(null),cohorts:ge(null),masterEventsCache:null,workerState:null,stateMigrated:!1},de=e=>me(e)?{dfp:pe(e.dfp),xandr_ssp:pe(e.xandr_ssp)}:fe(),fe=()=>({dfp:s.cS,xandr_ssp:s.cS}),ge=e=>me(e)?{all:pe(e.all),ql:pe(e.ql),qlCustom:pe(e.qlCustom),qlStandard:pe(e.qlStandard)}:ve(),pe=e=>Array.isArray(e)?e:s.cS,me=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),ve=()=>({all:s.cS,ql:s.cS,qlCustom:s.cS,qlStandard:s.cS})},3931:(e,t,n)=>{n.r(t),n.d(t,{runNextGenFeatures:()=>Ze});var r=n(3735),i=n(2851),o=n(2116),a=n(3992),s=n(2884),c=n(2652);function u(e){let{messages:t}=e;const[n,r]=i.Ue(new Set);return t.on("permutive:addon:preinit",(e=>r(new Set([...n.current,e])))),n}function l(){const e=()=>Math.floor(Date.now()/1e3),[t,n]=i.Ue(e());return(0,a.UM)((()=>n(e())),1e3),t}function d(){const[e,t]=i.Ue(!1);return(0,c.aT)((()=>t(!0)),navigator.userAgent),e}var f=n(3328),g=n(2688),p=n(365),m=n(7241),v=n(2197),h=n(4923),_=n(4870),b=n(9853);const y="[PrebidJS]";function w(e){const t=(()=>{const e=["pbjs",...window._pbjsGlobals||[]];return[...new Set(e)]})();e.logger.debug(y,"Found keys",t);return o.K4((()=>(0,r.zG)(t,f.UI((0,r.ls)((e=>(e=>{const t={maxAttempts:100,waitTimeInMs:50};let n;return{windowPropertyKey:e,pbjs:(0,c.a4)((()=>n),(()=>{const t=(0,r.zG)(window,(0,c.vg)(e));return!(null==t||!t.que||"function"!=typeof(null==t?void 0:t.getEvents)||(n=t,0))}),t)}})(e)),(t=>(0,r.zG)(i.p4(t.pbjs),i.UI((n=>{const i=p.pF((n=>(n.message=`Failed to resolve key "${t.windowPropertyKey}". ${n.message}`,e.reportError(`${y} ${n.toString()}`),s.YP)));return(0,r.zG)(n,(0,c.bw)(s.UI((n=>e.logger.debug(y,`Completed check for key "${t.windowPropertyKey}"`,{result:n})))),s.UI(i),s.UI(s.UI((e=>({windowPropertyKey:t.windowPropertyKey,pbjs:e})))))})))))),(e=>i.vP(...e)),i.UI((e=>({completedChecks:e.every(s.pC),pbjsKeyPairs:e.map(s.xH)}))),i.UI((e=>{let{pbjsKeyPairs:t,completedChecks:n}=e;const i=t.filter(s.pC),[o,...a]=i;return{completedChecks:n,mainPair:o??s.YP,otherPairs:(0,r.zG)(a,f.DZ(r.yR))}})))))}const E="[Prebid Monitoring]",S=(e,t)=>{e.metrics.trackCounter({name:"sdk_prebid_monitoring_key_flag_count_total",labels:t,value:1})},I=(e,t)=>{e.metrics.trackCounter({name:"sdk_prebid_monitoring_key_bidder_flag_count_total",labels:t,value:1})},k=function(e,t){const n=P(e);return o.K4((()=>(0,r.zG)(t,i.UI((0,r.ls)(s.DT((e=>e.consent)),s.UI((e=>e.prebidJS)))),i.D8(s.Eh((0,c.Or)())),i.bw((0,r.ls)(s.tS((e=>e.completedChecks?e.mainPair:s.YP)),s.UI((t=>S(e,{flag:"prebid_main_key",prebid_key:t.windowPropertyKey}))))),i.UI(s.UI((e=>(0,r.zG)(e.mainPair,s.UI((t=>[t,...e.otherPairs])),s.fS((()=>e.otherPairs)))))),i.Rp(new Set,((t,i)=>(0,r.zG)(i,s.UI(f.hX((e=>!t.has(e.windowPropertyKey)))),s.hX(f.Od),(0,c.bw)(s.EQ((()=>e.logger.debug(E,"Nothing to report")),(t=>e.logger.debug(E,"Reporting",t)))),s.fS((()=>[])),f.UI((t=>(0,r.zG)((t=>(0,r.zG)(p.Y3((function(){var n;const{pbjs:i,windowPropertyKey:o}=t;e.logger.log(E,`Reporting on "${o}"`,t);const a=U(i);e.logger.debug(E,`Version ${i.version} parsed as`,a);const s="function"==typeof(c=i).readConfig?c.readConfig():c.getConfig();var c;e.logger.debug(E,"Read config",s);const u=(0,r.zG)((null===(n=s.realTimeData)||void 0===n?void 0:n.dataProviders)??[],f.Ew((e=>"permutive"===e.name)));return e.logger.debug(E,"Read data provider config",u),{pbjs:i,config:s,dataProviderConfig:u,installedModules:i.installedModules||[],version:a,windowPropertyKey:o}}),g.w),p.ak("bidders",(e=>n.acBidders(e))),p.ak("permutiveRTDProvider",(e=>n.permutiveRTDProvider(e))),p.ak("consent",(e=>n.consent(e))),p.ak("targeting",(e=>n.targeting(e)))))(t),p.Pd((n=>e.reportError(`[Prebid Monitoring] Failed to report pair "${t.windowPropertyKey}", ${n.message}`)),(()=>t.windowPropertyKey))))),f.hp,(e=>new Set([...t,...e]))))),(e=>({reportedKeys:e})))))};const P=e=>({acBidders:t=>p.Y3((()=>{(0,b.Hn)("prebid")("data_provider_config",{ac_bidders:[]});const n=[],i=(0,r.zG)(t.dataProviderConfig,s.UI((e=>{var t;return(null==e||null===(t=e.params)||void 0===t?void 0:t.acBidders)??[]})),s.fS((()=>[]))),o=[...new Set([...n,...i])];return e.logger.debug(E,"Determined acBidders as",{acBidders:o,dynamicBidders:n,staticBidders:i}),o.forEach((n=>{I(e,{flag:"prebid_ac_bidder",prebid_key:t.windowPropertyKey,prebid_bidder:n})})),{acBidders:o,dynamicBidders:n,readBidders:i}}),g.w),consent:t=>p.Y3((()=>{var n,r,i,o,a,s;const c=t.windowPropertyKey;t.config.consentManagement&&"object"==typeof t.config.consentManagement&&S(e,{prebid_key:c,flag:"prebid_has_consent_management"});const u=t.installedModules.includes("gdprEnforcement");u&&S(e,{prebid_key:c,flag:"prebid_gdpr_enforcement_module"});const l=(null===(n=t.config)||void 0===n||null===(r=n.consentManagement)||void 0===r||null===(i=r.gdpr)||void 0===i||null===(o=i.rules)||void 0===o||null===(a=o.find((e=>"storage"===(null==e?void 0:e.purpose))))||void 0===a||null===(s=a.vendorExceptions)||void 0===s?void 0:s.includes("permutive"))||!1;return l&&S(e,{prebid_key:c,flag:"prebid_storage_exception"}),{hasGDPREnforcementModule:u,addedAsStorageException:l}}),g.w),permutiveRTDProvider:t=>p.Y3((()=>{const n=t.installedModules.includes("permutiveRtdProvider");return n&&S(e,{prebid_key:t.windowPropertyKey,flag:"prebid_permutive_rtd"}),n}),g.w),targeting:t=>{const n=(0,r.ls)(f.UI((e=>[e,null])),h.sq),i=(t,n)=>(0,r.zG)(t,(0,c.bw)((t=>e.logger.debug(E,`Processing ${t.length} bidder request(s)`,t))),f.hX((e=>n.hasOwnProperty(e.bidderCode)&&null===n[e.bidderCode])),m.vM((e=>e.bidderCode)),h.DZ(f.f2((0,c.lo)([[e=>(e=>{var t,n,r;const i=null==e||null===(t=e.user)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.find((e=>"permutive.com"===e.name));return!(null==i||null===(r=i.segment)||void 0===r||!r.length)})(e.ortb2),()=>s.G("ortb2")],[e=>{return t=e.params,["permutive","p_standard"].some((e=>{var n,r,i,o;return(null==t||null===(n=t.visitor)||void 0===n||null===(r=n[e])||void 0===r?void 0:r.length)||(null==t||null===(i=t.keywords)||void 0===i||null===(o=i[e])||void 0===o?void 0:o.length)}));var t},()=>s.G("params")],()=>s.YP]))),(0,c.bw)((t=>e.logger.debug(E,"Bidders targeting method's updated",t)))),o=o=>{e.logger.debug(E,"Bidders found with no targeting method",o);let a=n(o);const s=n=>(0,r.zG)(i([n],a),(0,c.bw)((e=>{a={...a,...e}})),(0,c.bw)(h.Su(((n,r)=>I(e,{flag:`prebid_${r}_targeting_success`,prebid_key:t.windowPropertyKey,prebid_bidder:n})))),(0,c.bw)((()=>{Object.values(a).includes(null)||(e.logger.debug(E,`Cleaning up "bidRequested" listener for ${t.windowPropertyKey}`),t.pbjs.offEvent("bidRequested",s))})));t.pbjs.onEvent("bidRequested",s)};return p.Y3((()=>{const a=(0,r.zG)(t.pbjs.getEvents(),f.DZ((0,r.ls)(s.DT((e=>"bidRequested"===e.eventType)),s.UI((0,c.vg)("args")))));return(0,r.zG)(t.bidders.acBidders,s.DT(f.Od),s.EQ((()=>e.logger.debug(E,"No bidders for targeting")),(0,r.ls)(n,(e=>({...e,...i(a,e)})),h.uK(v.ff((e=>null===e))),_.Pd((0,r.ls)(h.XP,s.DT(f.Od),s.UI(o)),h.Su(((n,r)=>I(e,{prebid_bidder:n,prebid_key:t.windowPropertyKey,flag:`prebid_${r}_targeting_success`})))))))}),g.w)}}),U=e=>{const[t,n,r]=e.version.split("-")[0].replace("v","").split(".").map((e=>parseInt(e)));return{major:t,minor:n,patch:r}},G=function(e,t){const n=(0,r.zG)(t.pbjs,i.VS((0,r.ls)(s.tS(s.KQ((e=>{var t;return null===(t=e.getUserIdsAsync)||void 0===t?void 0:t.call(e).then((()=>{var t;return(null===(t=e.getUserIdsAsEids)||void 0===t?void 0:t.call(e))??[]}))}))),s.UI(i.p4),s.fS((()=>i.a9(s.YP))))),i.UI(s.tS(s.Uo)),i.bw(s.mU((t=>(t.length>0?t.forEach((t=>{e.metrics.trackCounter({name:"sdk_prebid_alternative_identifiers_count_total",labels:{alternative_user_id_name:t.source},value:1})})):e.metrics.trackCounter({name:"sdk_prebid_alternative_identifiers_count_total",labels:{identifier:"NONE"},value:1}),s.YP))))),a=(0,r.zG)(t.pbjs,i.UI(s.tS(s.KQ((e=>{var t;return null===(t=e.getUserIdsAsEids)||void 0===t?void 0:t.call(e)})))));return o.K4((()=>(0,r.zG)(i.vP(n,a),i.UI((e=>{let[t,n]=e;return(0,r.zG)(t,s.wp((()=>n)))})),i.UI((0,r.ls)(s.UI(f.DZ((e=>{var t,n;return"string"==typeof(null===(t=e.uids)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.id)?s.G((0,r.bc)(e.source,{id:e.uids[0].id})):s.YP}))),s.tS(m.c2),s.UI(h.sq))),i.bw((t=>{s.pC(t)&&e.logger.debug("[Prebid Identifiers]","Found identifiers",t.value)})))))};var D=n(2097);const z=new Set(["AdRequest","Reaction","PageviewEngagement","SegmentEntry","SegmentExit","VideoEngagement"]);class T{events;listeners;static highVolumeEvents=(()=>{const e=new Set([...z]);return e.delete("Reaction"),e})();constructor(){this.events=[],this.listeners=[]}newEvent(e,t){T.highVolumeEvents.has(e.name)||this.events.push([e,t]),[...this.listeners].forEach((n=>{this.handle(e,t,n)}))}addListener(e){this.listeners.push(e);const t={replay:()=>(this.replay(e),t),remove:()=>(this.remove(e),t)};return t}handle(e,t,n){const r="string"==typeof n.name&&e.name===n.name,i=n.name.test&&n.name.test(e.name),o=r||i;if(o)try{n.callback(e,t)}catch(e){window.console&&window.console.error&&window.console.error("callback error: ",e)}o&&n.once&&this.remove(n)}replay(e){let t=-1!==this.listeners.indexOf(e);for(let n=0;n<this.events.length&&t;n++)this.handle(this.events[n][0],this.events[n][1],e),t=-1!==this.listeners.indexOf(e)}remove(e){const t=this.listeners.indexOf(e);-1!==t&&this.listeners.splice(t,1)}}var C=n(6392),q=n(1828);var O=n(8377),x=n(2707),M=n(7407);const R="[Event Upload]",A=(e,t,n,s)=>o.dQ((o=>{let{stopped:u,previousState:l}=o;Array.isArray(l)&&(0,r.zG)(l,N(e))();const d=new Set([...z]),[g,{appendUntrackedEvents:m,appendUploadResults:v}]=(0,r.zG)((()=>{const[e,t]=i.gS(f.uZ()),[n,o]=i.gS(f.uZ());return(0,r.bc)({uploadResults:e,untrackedEvents:n},{appendUploadResults:t,appendUntrackedEvents:o})})(),(0,O.pL)((0,r.ls)((function(e){const[t,n]=(0,r.zG)(e.uploadResults,Y(f.bj));return{...e,uploadResults:t,erroredEventsAsJSON:n}}),(function(e){const[t,n]=(0,r.zG)(e.erroredEventsAsJSON,Y(f.UI((0,O.H5)((0,c.rO)({event:(0,c.rO)({time:e=>new Date(e)})})))));return{...e,erroredEventsAsJSON:t,erroredEvents:n}}),(function(e){let{uploadResults:t,untrackedEvents:n,...o}=e;const a=(0,r.zG)(t,i.UI(C.UI((0,r.ls)(f.hp,f.UI((0,O.H5)((0,c.rO)({time:e=>new Date(e)}))))))),s=(0,r.zG)(i.vP(a,n),i.UI(C.RD),i.UI(C.UI((e=>{let[t,n]=e;return n.concat(t)}))));return{...o,successEvents:s}}),(function(e){const[t,n]=(0,r.zG)(e.successEvents,Y(f.UI((0,O.H5)((0,c.rO)({time:e=>e.toISOString()})))));return{...e,successEvents:t,successEventsAsJSON:n}})))),[h,_]=i.Ue(0),[b,y]=i.Ue(0),w=(0,r.zG)(t,i.UI(C.UI((e=>(0,r.zG)(e,f.uK((e=>{let[,t]=e;return!d.has(t.event.name)})),(e=>{let{left:t,right:n}=e;return(0,r.zG)(t,f.UI((0,O.H5)((e=>e.event))),m),n}))))),i.UI(C.UI((e=>(e.length>0&&((0,a.HJ)((()=>_(h.current+e.length)),500),(0,a.HJ)((()=>y(b.current+e.length)),5e3)),e))))),E=e=>t=>(0,r.zG)(e,f.hX((e=>{let[n]=e;return!t.closeEventsProcessed.includes(n)})),f.zo(t.queue)),S=(0,r.zG)(i.vP(h,b,w,n,u,s),i.Rp({closeEventsProcessed:f.cS,noQueueItemsProcessed:0,queue:f.cS},((t,n)=>{let[i,o,a,s,u,l]=n;return u?t:(0,r.zG)(t,(0,c.rO)({queue:f.zo(a())}),(t=>l?(0,r.zG)(t,(t=>n=>(0,r.zG)(n,E(t),B(e),(0,c.rO)({right:(0,c.bw)((0,r.ls)(f.UI((0,r.ls)((0,O.H5)((0,c.rO)({time:e=>e.toISOString()})),p.F2)),v))}),(e=>{let{left:t,right:i}=e;return(0,r.zG)(n,(0,c.rO)({closeEventsProcessed:(0,r.zG)(i,f.UI(O.li),f.zo),queue:(0,r.zG)(t.map(O.li),(e=>new Set(e)),(e=>f.hX((t=>{let[n]=t;return e.has(n)})))),noQueueItemsProcessed:e=>e+n.queue.length}))})))(s)):o>t.noQueueItemsProcessed||i===t.noQueueItemsProcessed+t.queue.length?(t=>((0,r.zG)(t.queue,N(e),M.UI(v))(),{closeEventsProcessed:t.closeEventsProcessed,noQueueItemsProcessed:t.noQueueItemsProcessed+t.queue.length,queue:f.cS}))(t):t))}))),I=(0,r.zG)(n,i.UI(E),i.ap(S),i.D8(f.Eh({equals:(e,t)=>e[0]===t[0]})));return{state:I,value:g}})),L=(e,t)=>e.permutiveUrls.getEndpointUrl("/batch/events",s.G(e.config.apiVersion),[["enrich",JSON.stringify(t.requiresEnrichment)],["sdkp",JSON.stringify(t.sdkProcessed)]]),F=e=>(0,r.zG)(e.events,f.UI((0,r.ls)(O.Yg,(e=>e.event)))),$=(0,r.ls)(m.vM((e=>{let[t,n]=e;return`${n.requiresEnrichment}${n.sdkProcessed}`})),(e=>Object.values(e)),f.UI((e=>({requiresEnrichment:e[0][1].requiresEnrichment,events:e,sdkProcessed:e[0][1].sdkProcessed})))),B=e=>(0,r.ls)($,f.YO("request"),f.Hr("success",(t=>{let{request:n}=t;return e.logger.debug(R,"Uploading via beacon",n),e.permutiveApi.reqWithBeacon({url:L(e,n),payload:F(n)})})),f.tS((e=>(0,r.zG)(e.request.events,f.UI((t=>{let[n,{event:i}]=t;return e.success?p.F2((0,r.bc)(n,i)):p.t$((0,r.bc)(n,i))}))))),f.UI((0,c.bw)(p.EQ((t=>{let[,n]=t;return e.metrics.trackCounter({name:"sdk_event_beacon_fail_count_total",labels:{event_name:n.name},value:1})}),(t=>{let[,n]=t;return e.metrics.trackCounter({name:"sdk_event_beacon_success_count_total",labels:{event_name:n.name},value:1})})))),f.oh),N=e=>t=>(0,r.zG)($(t),M.uU((t=>(0,r.zG)(t,(e=>t=>(e.logger.debug(R,"Uploading",t),x.Y3((()=>e.permutiveApi.req({payload:F(t),url:L(e,t),method:"POST",contentType:"text/plain",dataType:"json",withCredentials:!1})),(t=>(e.reportError(`Error sending events batch. Got ${p.KC(t)}`),t)))))(e),x.UI(f.UI((e=>e.body))),x.EQ((e=>(0,r.zG)(t.events,f.UI((()=>p.t$(e))))),f.UI(p.F2)),M.UI(f.$R(t.events))))),M.UI(f.tS(f.UI((t=>{let[n,[i,{event:o}]]=t;return(0,r.zG)(n,p.EQ((e=>p.t$((0,r.bc)(i,{event:{...o,time:o.time.toISOString()},error:e}))),(e=>"request_id"in e?p.t$((0,r.bc)(i,{event:{...o,time:o.time.toISOString()},error:e})):p.F2((0,r.bc)(i,{...o,id:e.id,time:e.time})))),(0,c.bw)(p.EQ((t=>{let[,{event:n}]=t;return e.metrics.trackCounter({name:"sdk_event_upload_fail_count_total",labels:{event_name:n.name},value:1})}),(t=>{let[,n]=t;return e.metrics.trackCounter({name:"sdk_event_upload_success_count_total",labels:{event_name:n.name},value:1})}))))}))))),Y=e=>t=>(0,r.zG)(t,i.En(2,f.uZ()),(0,O.H5)(i.UI(C.UI(e)))),K=(e,t,n,a)=>(0,r.zG)(o.K4((()=>{const[e,t]=i.Ue(i.a9(C.of([])));return{eventsToPublishBufferRef:i.xH(e),publishEvents:n=>{(0,r.zG)(i.vP(e.current,n),i.UI(C.RD),i.UI(C.UI(f.xH)),t)}}})),o.ak("eventUpload",(t=>{let{eventsToPublishBufferRef:r}=t;return A(e,r,n,a)})),o.ak("eventHandler",(e=>{let{eventUpload:t}=e;return n=t.successEventsAsJSON,a=t.erroredEventsAsJSON,o.K4((()=>{const e=new T;return(0,r.zG)(n,i.UI((e=>e())),i.bw((t=>t.forEach((t=>{let[,n]=t;return e.newEvent(n,null)}))))),(0,r.zG)(a,i.UI((e=>e())),i.bw((t=>t.forEach((t=>{let[,{event:n,error:r}]=t;return e.newEvent(n,r)}))))),{eventHandlerAfterUpload:e}}));var n,a})),o.ak("eventResolver",(e=>{let{eventUpload:n}=e;return((e,t,n,a)=>o.K4((()=>{(0,r.zG)(i.vP({unresolvedEvents:t,erroredEvents:a,successEvents:n}),i.UI((0,q.Yt)(C.G5)),i.Rp({},((e,t)=>{const n=t();return(0,r.zG)(n.unresolvedEvents,s.DT(f.Od),s.UI((0,r.ls)(h.sq,(t=>({...e,...t})))),s.fS((()=>e)),(e=>(0,r.zG)(n.successEvents,f.u4(e,((e,t)=>{let[n,i]=t;return(0,r.zG)(h.P5(n,e),s.UI((t=>(t.succeed(i),h.EG(n)(e)))),s.fS((()=>e)))})))),(e=>(0,r.zG)(n.erroredEvents,f.u4(e,((e,t)=>{let[n,{event:i,error:o}]=t;return(0,r.zG)(h.P5(n,e),s.UI((t=>(t.fail(`Failed to track ${i.name}. ${"error"in o?o.error.message:o.message}`),h.EG(n)(e)))),s.fS((()=>e)))})))))})))})))(0,t,n.successEvents,n.erroredEvents)})),o.UI((e=>{let{publishEvents:t,eventHandler:n}=e;return{eventHandlerAfterUpload:n.eventHandlerAfterUpload,publishEvents:t}}))),j="_pnativo",Q=function(e){let{externalData:t}=e;return o.K4((()=>{t.removeExternalData(j)}))};var W,H,V,J,Z,X=-1,ee=function(e){addEventListener("pageshow",(function(t){t.persisted&&(X=t.timeStamp,e(t))}),!0)},te=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},ne=function(){var e=te();return e&&e.activationStart||0},re=function(e,t){var n=te(),r="navigate";return X>=0?r="back-forward-cache":n&&(document.prerendering||ne()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},ie=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},oe=function(e,t,n,r){var i,o;return function(a){t.value>=0&&(a||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},ae=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},se=function(e){var t=function(t){"pagehide"!==t.type&&"hidden"!==document.visibilityState||e(t)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},ce=function(e){var t=!1;return function(n){t||(e(n),t=!0)}},ue=-1,le=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},de=function(e){"hidden"===document.visibilityState&&ue>-1&&(ue="visibilitychange"===e.type?e.timeStamp:0,ge())},fe=function(){addEventListener("visibilitychange",de,!0),addEventListener("prerenderingchange",de,!0)},ge=function(){removeEventListener("visibilitychange",de,!0),removeEventListener("prerenderingchange",de,!0)},pe=function(){return ue<0&&(ue=le(),fe(),ee((function(){setTimeout((function(){ue=le(),fe()}),0)}))),{get firstHiddenTime(){return ue}}},me=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},ve=[1800,3e3],he=[.1,.25],_e=function(e,t){t=t||{},function(e,t){t=t||{},me((function(){var n,r=pe(),i=re("FCP"),o=ie("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-ne(),0),i.entries.push(e),n(!0)))}))}));o&&(n=oe(e,i,ve,t.reportAllChanges),ee((function(r){i=re("FCP"),n=oe(e,i,ve,t.reportAllChanges),ae((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))}(ce((function(){var n,r=re("CLS",0),i=0,o=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,n())},s=ie("layout-shift",a);s&&(n=oe(e,r,he,t.reportAllChanges),se((function(){a(s.takeRecords()),n(!0)})),ee((function(){i=0,r=re("CLS",0),n=oe(e,r,he,t.reportAllChanges),ae((function(){return n()}))})),setTimeout(n,0))})))},be={passive:!0,capture:!0},ye=new Date,we=function(e,t){W||(W=t,H=e,V=new Date,Ie(removeEventListener),Ee())},Ee=function(){if(H>=0&&H<V-ye){var e={entryType:"first-input",name:W.type,target:W.target,cancelable:W.cancelable,startTime:W.timeStamp,processingStart:W.timeStamp+H};J.forEach((function(t){t(e)})),J=[]}},Se=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){we(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,be),removeEventListener("pointercancel",r,be)};addEventListener("pointerup",n,be),addEventListener("pointercancel",r,be)}(t,e):we(t,e)}},Ie=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,Se,be)}))},ke=[100,300],Pe=0,Ue=1/0,Ge=0,De=function(e){e.forEach((function(e){e.interactionId&&(Ue=Math.min(Ue,e.interactionId),Ge=Math.max(Ge,e.interactionId),Pe=Ge?(Ge-Ue)/7+1:0)}))},ze=function(){return Z?Pe:performance.interactionCount||0},Te=function(){"interactionCount"in performance||Z||(Z=ie("event",De,{type:"event",buffered:!0,durationThreshold:0}))},Ce=[200,500],qe=0,Oe=function(){return ze()-qe},xe=[],Me={},Re=function(e){var t=xe[xe.length-1],n=Me[e.interactionId];if(n||xe.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};Me[r.id]=r,xe.push(r)}xe.sort((function(e,t){return t.latency-e.latency})),xe.splice(10).forEach((function(e){delete Me[e.id]}))}},Ae=[2500,4e3],Le={};const Fe=function(e){let t=0;const n=n=>{if(0===t)return;const r=$e(n);r&&e.metrics.track({name:`sdk_web_vitals_${r.suffix}`,labels:{},value:r.value})},a=(0,c.HP)((()=>{_e(n),function(e,t){t=t||{},me((function(){var n,r=pe(),i=re("LCP"),o=function(e){var t=e[e.length-1];t&&t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-ne(),0),i.entries=[t],n())},a=ie("largest-contentful-paint",o);if(a){n=oe(e,i,Ae,t.reportAllChanges);var s=ce((function(){Le[i.id]||(o(a.takeRecords()),a.disconnect(),Le[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,s,!0)})),se(s),ee((function(r){i=re("LCP"),n=oe(e,i,Ae,t.reportAllChanges),ae((function(){i.value=performance.now()-r.timeStamp,Le[i.id]=!0,n(!0)}))}))}}))}(n),function(e,t){t=t||{},me((function(){var n,r=pe(),i=re("FID"),o=function(e){e.startTime<r.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),n(!0))},a=function(e){e.forEach(o)},s=ie("first-input",a);n=oe(e,i,ke,t.reportAllChanges),s&&se(ce((function(){a(s.takeRecords()),s.disconnect()}))),s&&ee((function(){var r;i=re("FID"),n=oe(e,i,ke,t.reportAllChanges),J=[],H=-1,W=null,Ie(addEventListener),r=o,J.push(r),Ee()}))}))}(n),function(e,t){t=t||{},me((function(){Te();var n,r=re("INP"),i=function(e){e.forEach((function(e){e.interactionId&&Re(e),"first-input"===e.entryType&&!xe.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&Re(e)}));var t,i=(t=Math.min(xe.length-1,Math.floor(Oe()/50)),xe[t]);i&&i.latency!==r.value&&(r.value=i.latency,r.entries=i.entries,n())},o=ie("event",i,{durationThreshold:t.durationThreshold||40});n=oe(e,r,Ce,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),se((function(){i(o.takeRecords()),r.value<0&&Oe()>0&&(r.value=0,r.entries=[]),n(!0)})),ee((function(){xe=[],qe=ze(),r=re("INP"),n=oe(e,r,Ce,t.reportAllChanges)})))}))}(n)}));return o.K4((n=>{let{stopped:o}=n;t++,(0,r.zG)(o,i.YP((e=>{e&&t--}))),e.metrics.isEnabled()&&a()}))};const $e=e=>(e=>"CLS"===e.name)(e)?{value:e.value,suffix:`${e.name.toLowerCase()}_score`}:(e=>["INP","FID","LCP"].includes(e.name))(e)?{value:e.value/1e3,suffix:`${e.name.toLowerCase()}_seconds`}:void 0;var Be=n(926);const Ne=(e,t)=>{const{activationManager:n,externalData:a,metrics:s,permutiveData:c}=e;return(0,r.zG)(o.of({}),o.ak("psegs",(()=>((e,t)=>o.K4((n=>{let{stopped:o}=n;const a="_psegs";(0,r.zG)(i.vP(t,o),i.YP((t=>{let[n,i]=t;i||(0,r.zG)(n,f.EQ((()=>e.removeExternalData(a)),(t=>e.setExternalJsonData(a,t))))})))})))(e.externalData,t.qlSegments))),o.ak("webVitals",(()=>Fe(e))),o.ak("nativo",(()=>Q({activationManager:n,externalData:a,metrics:s,queryLanguageCohorts:t.qlSegments,...t}))),o.ak("twitterPixel",(()=>(0,Be.eJ)({activationManager:n,metrics:s,permutiveData:c,queryLanguageCohorts:t.qlSegments,...t}))),o.ak("prebidJS",(()=>w(e))))};var Ye=n(5619);const Ke=()=>{const[e,t]=i.gS(f.uZ());return{trackEvent:e=>{let n,r,{event:i,useBeacon:o}=e;const a=new Promise(((e,t)=>{n=e,r=t}));return t([{localId:(0,c.k$)(),event:i,fail:r,succeed:n,useBeacon:o}]),a},trackedEvents:e}};n(4564);const je=function(e,t){return o.K4((()=>({addon:()=>({}),cohorts:i.a9(s.YP)})))};const Qe=(e,t)=>o.vP({contextual:je(e,t)}),We=function(e,t,n){return o.of({replacementMap:i.a9(s.of({$privacy_sandbox_topics_v2:[]}))})};i.a9([]),i.a9([]),i.a9([]),i.a9(Ye.b()),i.a9(s.YP),i.a9({segmentsEntered:[],segmentsExited:[]}),i.a9(!1),i.a9((e=>{let{event:t}=e;return Promise.resolve(t)})),new T,i.a9(s.YP),i.a9(!1);function He(e,t,n){const{addonsLoaded:u,consent:l,currentTimestampSecs:d,enabledAddons:g,identities:p,sdkVariant:m,sessionId:v,userId:h,userIdIsNewlyGenerated:_,viewId:b,pageviewState:y}=t,[w,E]=(0,r.zG)(i.Ue(i.a9(f.cS)),(e=>{let[t,n]=e;return[i.xH(t),n]})),S=s.ij(e.permutiveData.getData("event-source-id")),I=(0,r.zG)(h,i.Rp(-1,(e=>e+1)),i.UI((t=>(0,r.zG)(S,s.hX((()=>0===t)),s.fS((()=>{const t=(0,c.k$)();return e.permutiveData.setData("event-source-id",t),t}))))));return(0,r.zG)(o.vP({computeTimeMetrics:(P=e.metrics,o.K4((e=>{let{stopped:t}=e;const n=(0,a.HJ)((()=>{(0,r.zG)((0,a.iE)(),(0,c.bw)((()=>(0,a.ho)(!1))),f.UI((e=>{let[t,n]=e;return(n-t)/1e3})),(e=>{P.track({name:"sdk_ui_thread_compute_first10s_total_seconds",value:e.reduce(((e,t)=>e+t),0),labels:{}}),P.track({name:"sdk_ui_thread_compute_first10s_total_task_overrun_seconds",value:(0,r.zG)(e,f.hX((e=>e>.05)),f.UI((e=>e-.05)),f.u4(0,((e,t)=>e+t))),labels:{}}),P.track({name:"sdk_ui_thread_compute_first10s_longest_task_seconds",value:Math.max(0,...e),labels:{}})}))}),1e4);(0,r.zG)(t,i.YP((e=>e&&n())))}))),audiences:Qe(e,t),privacySandboxTopics:We(e,v,l)}),o.UI((e=>{const{reset:t,trackEvent:n,trackedEvents:o}=((e,t)=>{const[n,o]=i.Ue(0),a=(0,r.zG)(i.vP(n,t),i.UI((()=>[]))),s=(0,r.zG)(i.vP(a,e),i.D8(((e,t)=>{let[,n]=e,[,r]=t;return n===r})),i.UI((e=>{let[t]=e;const n=Ke();return t.forEach(n.trackEvent),n})));return{reset:()=>o(n.current+1),trackEvent:(0,r.zG)(i.vP(s,a),i.UI((e=>{let[t,n]=e;return e=>(n.push(e),t.trackEvent(e))}))),trackedEvents:(0,r.zG)(s,i.VS((e=>e.trackedEvents)))}})(h,b),[a,s,c]=(0,r.zG)(o,i.En(3,f.uZ()));return{...e,reset:t,trackEvent:n,unresolvedEvents:(0,r.zG)(a,i.UI(C.UI(f.UI((e=>(0,r.bc)(e.localId,{fail:e.fail,succeed:e.succeed})))))),eventsToProcessLocally:(0,r.zG)(s,i.UI(C.UI(f.hX((e=>!e.useBeacon))))),eventsToUploadViaBeacon:(0,r.zG)(c,i.UI(C.UI(f.hX((e=>e.useBeacon)))))}})),o.ak("eventPublication",(n=>{let{unresolvedEvents:r}=n;return K(e,r,w,t.sdkClosing)})),o.ak("core",(a=>{let{audiences:c,eventPublication:u,eventsToProcessLocally:g,privacySandboxTopics:m}=a;return(0,r.zG)(n({contextualCohorts:c.contextual.cohorts,consent:l,currentTimestampSecs:d,enrichmentReplacementMap:m.replacementMap,eventSourceId:I,identities:p,newEvents:(0,r.zG)(g,i.UI(C.UI(f.UI((e=>(0,r.bc)(e.localId,e.event)))))),sessionId:v,userId:h,userIdIsNewlyGenerated:_,viewId:b,webClient:t.webClient,pageviewState:y}),o.bw((e=>{let{eventsToPublish:t}=e;return(0,r.zG)(t,i.UI(C.UI(Ve)),u.publishEvents)})),o.bw((e=>{let{eventsToPublishOnPageUnload:t}=e;return(0,r.zG)(t,i.UI(Ve),E)})),o.bw((t=>{let{externalData:n}=t;return(0,r.zG)(n,i.UI((t=>(0,r.zG)(Object.entries(t),f.UI((t=>{let[n,i]=t;return(0,r.zG)(i,s.EQ((()=>e.externalData.removeExternalData(n)),(t=>e.externalData.setExternalJsonData(n,t))))}))))))})),o.bw((t=>{let{context:n}=t;return(0,r.zG)(n,i.UI((t=>{const n=Object.entries(t);e.clientContext.updateContext(...n)})))})))})),o.bw((e=>{let{core:n,eventPublication:o,eventsToUploadViaBeacon:a}=e;return(0,r.zG)(i.vP({cohorts:n.cohorts.all,eventsIO:a,segments:n.cohorts.ql,sessionId:v,userId:h,viewId:b,webClient:t.webClient}),i.UI((e=>{let{webClient:t,...n}=e;return(0,r.zG)(t,s.UI((e=>({...n,webClient:e}))))})),i.UI(s.EQ((()=>C.of(f.bM())),(e=>{let{cohorts:t,eventsIO:n,segments:i,sessionId:o,userId:a,viewId:s,webClient:c}=e;return(0,r.zG)(n,C.UI(f.UI((e=>{let{event:n,localId:u}=e;return(0,r.bc)(u,{requiresEnrichment:!0,sdkProcessed:!1,event:{user_id:a,name:n.name,segments:i,cohorts:t,properties:{...n.properties,client:{...c,...n.properties.client??{}}},session_id:o,time:new Date,view_id:s}})}))))}))),o.publishEvents)})),o.ak("metricContext",(e=>{let{core:n}=e;return(0,r.zG)(n.geoIP,i.UI(s.tS((e=>{var t;return s.ij(null===(t=e.geo_info)||void 0===t?void 0:t.continent)}))),(e=>Ye.X({continent:e,sampleRate:t.metricSampleRate,sdkVariant:m,sessionId:v,userId:h,viewId:b})))})),o.ak("sdkql",(t=>{let{core:n}=t;return Ne(e,{addonsLoaded:u,consent:l,initdAddons:g,qlSegments:n.cohorts.ql})})),o.ak("strategicPartnerships",(t=>{let{sdkql:n}=t;return((e,t)=>o.vP({prebid_identifiers:G(e,t)}))(e,{pbjs:(0,r.zG)(n.prebidJS,i.UI((e=>(0,r.zG)(e.mainPair,s.UI((e=>e.pbjs))))))})})),o.ak("mediaAndEntertainment",(t=>{let{core:n}=t;return((e,t)=>(0,r.zG)(o.vP({freewheel:(0,D.freewheelService)({activationManager:e.activationManager,externalData:e.externalData,...t})}),o.UI((0,r.a9)({}))))(e,{addonsLoaded:u,consent:l,initdAddons:g,queryLanguageCohorts:n.cohorts.ql})})),o.ak("advertisers",(t=>{let{sdkql:n}=t;return((e,t)=>(0,r.zG)(o.of(t),o.ak("prebidMonitoring",(t=>{let{consent:n,prebidJS:r}=t;return k(e,i.vP({consent:n,prebidJS:r}))})),o.UI(r.Q1)))(e,{consent:l,prebidJS:n.prebidJS})})),o.UI((e=>{let{core:t,audiences:n,metricContext:r,sdkql:o,trackEvent:a,eventPublication:s,strategicPartnerships:c,reset:u}=e;return{activations:t.activations,addons:{contextual:n.contextual.addon},metricContext:r,pbjsPair:i.UI((e=>e.mainPair),o.prebidJS),queryLanguageCohorts:{all:t.cohorts.ql,custom:t.cohorts.qlCustom,standard:t.cohorts.qlStandard},segmentTransitionsSinceInit:t.transitionsSinceInit,trackEvent:a,realtime:t.realtime,eventHandlerAfterUpload:s.eventHandlerAfterUpload,prebidIdentifiers:c.prebid_identifiers,reset:u,stateMigratedThisInitialisation:t.stateMigratedThisInitialisation}})));var P}const Ve=f.UI((0,O.H5)((e=>({event:e,requiresEnrichment:!1,sdkProcessed:!0}))));function Je(e){return(0,r.ls)((0,c.rO)({previousState:e=>{if("string"!=typeof e)return{};try{return JSON.parse(e)}catch{return{}}}}),e,(0,c.rO)({state:i.UI(JSON.stringify)}))}function Ze(e){const t=function(e){const{activationManager:t,api:n,clientContext:r,config:i,externalData:o,logger:a,metrics:s,permutiveData:c,network:u,urls:l,namespace:d,trace:f}=e;return{activationManager:t,api:n,clientContext:r,config:i,externalData:o,logger:a,metrics:s,permutiveData:c,permutiveApi:u,permutiveUrls:l,reportError:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.reportError(e,null==t?void 0:t.userId,null==t?void 0:t.timestamp)},namespace:d,trace:f}}(e),n=function(e){const t={addonsLoaded:e.addonsLoaded,consent:(n=e.consentTracking,(0,r.zG)(n,s.EQ((()=>i.a9(!0)),(e=>e.consentRef)))),currentTimestampSecs:l(),enabledAddons:u(e),identities:e.identities,sdkClosing:d(),metricSampleRate:e.config.metricsSamplingPercentage/100,sdkVariant:s.ij(e.sdkVariant),sessionId:i.a9(e.sessionManager.getSessionId()),userId:e.userId.ref,userIdIsNewlyGenerated:e.userId.isNewlyGenerated,viewId:e.viewId.ref,pageviewState:e.pageviewState,webClient:e.webClient};var n;return t}(e);return function(e,t,n,s){const u=5e3;return(0,r.zG)(e,function(e,t){return n=>o=>{const{value:s,state:c}=n(o),[u,l]=i.Ue(c.current),d=(0,a.UM)((()=>l(c.current)),e),f=(0,r.zG)(i.vP(c,u),i.UI((e=>{let[t,n]=e;return t===n})));return(0,r.zG)(t,i.bw((e=>e&&d()))),{value:(0,r.bc)(f,s),state:(0,r.zG)(i.vP(t,c,u),i.UI((e=>{let[t,n,r]=e;return t?n:r})))}}}(u,s),Je,function(e){return t=>(0,r.ls)((0,c.rO)({previousState:t=>e.current?t:void 0}),t,(0,c.rO)({state:(0,r.ls)((t=>i.vP(e,t)),i.UI((e=>{let[t,n]=e;return t?n:void 0})))}))}(n),function(e){return t=>(0,r.ls)((0,c.rO)({previousState:()=>localStorage.getItem(e)}),t,(0,c.rO)({state:(0,c.bw)(i.YP((t=>{switch(typeof t){case"string":localStorage.setItem(e,t);break;case"undefined":localStorage.removeItem(e);break;case"object":if(null===t){localStorage.removeItem(e);break}throw new Error("Permutive app raised an invalid state.");default:throw new Error("Permutive app raised an invalid state.")}})))}))}(t),o.UI((e=>{let[t,n]=e;return n})))({stopped:i.a9(!1)}).value}(He(t,n,e.core),e.namespace.getNamespacedStorageKey("permutive-app"),n.consent,n.sdkClosing)}},2233:(e,t,n)=>{n.d(t,{iq:()=>d,B9:()=>p,ti:()=>v});var r=n(2688),i=n(787),o=n(365),a=n(2884),s=n(3735),c=n(2652);var u=n(3030);const l="__permutive.",d="__permutiveConfigQueryParams";const f={default:{windowKey:"permutive",environment:"default",apiHost:"api.permutive.com",apiKey:"",apiProtocol:"https",cdnBaseUrl:"cdn.permutive.com",cdnProtocol:"https",pxidHost:"prmutv.co",apiVersion:"v2.0",sdkErrorsApiVersion:"v2",advertiserApiVersion:"v2",classificationModelsApiVersion:"v1",loggingEnabled:!1,tracingEnabled:!1,requestTimeout:5e3,cookieDomain:"."+(0,u._Y)(window.location.hostname),cookieName:"permutive-id",cookieExpiry:function(){const e=new Date;return e.setMonth(e.getMonth()+6),e.toUTCString()}(),eventsTTLInDays:null,permutiveDataMiscKey:"permutive-data-misc",permutiveDataQueriesKey:"permutive-data-queries",stateNamespace:"",sendClientErrors:!0,metricsSamplingPercentage:20,eventsCacheLimitBytes:25e5,segmentSyncApiHost:"0801f79c-c3b0-44f6-9f5a-37611e3c986d.partner.permutive.app",consentRequired:!1,sdkType:"stable",viewId:null,localStorageDebouncedKeys:[],localStorageWriteDelay:1e3,localStorageWriteMaxDelay:1500,watson:{enabled:!0}},production:{},development:{apiProtocol:"http",loggingEnabled:!0,tracingEnabled:!0,sendClientErrors:!1}},g=e=>{const t={consentRequired:!0,loggingEnabled:!0,sendClientErrors:!0,tracingEnabled:!0},n={eventsTTLInDays:!0,eventsCacheLimitBytes:!0,metricsSamplingPercentage:!0,requestTimeout:!0,localStorageWriteDelay:!0,localStorageWriteMaxDelay:!0};return Object.keys(e).reduce(((r,i)=>{if(t.hasOwnProperty(i)){const t="true"===e[i];return{...r,[i]:t}}if(n.hasOwnProperty(i)){const t=Number(e[i]);return isNaN(t)?r:{...r,[i]:t}}return{...r,[i]:e[i]}}),{})},p=function(){let{getQueryParams:e=u.zM}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e=>Object.entries(e).reduce(((e,t)=>{let[n,r]=t;if(!(0===n.indexOf(l)))return e;const i=n.replace(l,"");return[...e,[i,r]]}),[]);return(0,s.zG)(o.Y3((()=>(0,s.zG)(e(),t,(e=>(0,c.m8)(...e)),g,(e=>m({queryConfig:e})))),(e=>`Failed to parse query params. Got ${(0,r.w)(e).message}`)))},m=e=>{let{queryConfig:t}=e;const n=(0,s.zG)(a.Y3((()=>window.sessionStorage.getItem(d))),a.tS(a.ij),a.tS((0,s.ls)(i.A,a.ij)),a.fS((()=>({}))));return(0,c.PM)(n,t)},v=(e,t)=>{const n=(e.environment&&f[e.environment])??{};return(0,c.PM)(f.default,n,e,t)}},4564:(e,t,n)=>{n.d(t,{NY:()=>m,vk:()=>f,qA:()=>d});var r=n(2688),i=n(365),o=n(3735),a=n(2707),s=n(8259),c=n(1410),u=n(2851);var l=n(30);const d=()=>({opt_in:!0,token:c.L}),f=()=>({opt_in:!1,token:""}),g=e=>{return(0,o.ls)((t=e,e=>(0,o.zG)((0,l.J)(t.consentRequired,e),(e=>{let{consentData:n,isValid:r}=e;return t.consentDatabase.put(n,c.L),r}))),(e=>{let{logger:t,messages:n}=e;return e=>{const r=e?"given":"revoked";return t.log("Consent has been",r),n.emit(`permutive:consent:${r}`),e}})(e));var t},p=e=>(t,n)=>{e.on("permutive:consent:revoked",t),e.on("permutive:consent:given",n)},m=async e=>{const{logger:t,namespace:n,consentRequired:d,messages:f}=e,m=new s.oP(window.localStorage,n),v=(0,l.J)(d,await m.get(c.L)),h=await(0,o.zG)(a.Y3((()=>m.put(v.consentData,c.L)),(e=>new Error(`LocalStorage access is required. ${(0,r.w)(e).message}`))),(e=>e()));if(i.nM(h))return h;const{consentRef:_,giveConsent:b,revokeConsent:y,isRevoked:w,isGiven:E}=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const[t,n]=u.Ue(e),r=()=>!0===t.current;return{consentRef:t,revokeConsent:()=>(n(!1),t.current),giveConsent:()=>(n(!0),t.current),isRevoked:()=>!r(),isGiven:r}}(v.isValid),S={consentRef:_,isGiven:E,isRevoked:w,listenForConsent:p(f)};S.listenForConsent(y,b);const I=g({consentDatabase:m,consentRequired:d,logger:t,messages:f});return i.F2({consentTracking:S,consentValidation:I,consentDatabase:m})}},1410:(e,t,n)=>{n.d(t,{L:()=>r});const r="permutive-consent"},4769:(e,t,n)=>{n.d(t,{v:()=>r});const r=(e,t,n)=>function(){const r=n()?t:e;return r(...arguments)}},30:(e,t,n)=>{n.d(t,{J:()=>a});var r=n(3735),i=n(2884),o=n(4564);const a=(e,t)=>(0,r.zG)((0,i.ij)(t),(t=>!1===e&&(0,i.Wi)(t)?{isValid:!0,consentData:(0,o.qA)()}:(e=>(0,i.pC)(e)&&(e=>null!==e&&"object"==typeof e)(e.value)&&(e=>{var t;return!0===e.opt_in&&"string"==typeof e.token&&(null===(t=e.token)||void 0===t?void 0:t.length)>0})(e.value))(t)?{isValid:!0,consentData:t.value}:{isValid:!1,consentData:(0,o.vk)()}))},3298:(e,t,n)=>{n.d(t,{S:()=>h});var r=n(3735),i=n(2884),o=n(5851),a=n(2851),s=n(8612),c=n(2497),u=n(3992);var l=n(2652);class d{wait_prev;block_next;task;started;complete;constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.wait_prev=t.wait_prev||!1,this.block_next=t.block_next||!1,this.started=!1,this.complete=!1,this.task=e}waits(){return this.wait_prev}blocks(){return this.block_next}execute(e){this.started=!0,this.task((()=>{this.complete=!0,e()}))}}var f=n(6315),g=n(7305);class p{logger;api;activationManager;sessionManager;metrics;viewId;userId;network;clientContext;unprocessedEvents;taskQueue;identities;permutiveReset;messages;addons;trace;permutiveRealtime;state;customProperties;config;permutiveData;externalData;cookies;identitiesIngestor;global;nextGen;pageviewState;initialisedAddons=[];tcf;constructor(e,t,n,r,i,o,a,s,u,l,d,f,g,p,m,v,h,_,b,y,w,E,S,I,k,P,U){this.logger=e,this.api=t,this.activationManager=n,this.sessionManager=r,this.metrics=i,this.viewId=o,this.userId=a,this.network=s,this.clientContext=u,this.unprocessedEvents=l,this.taskQueue=d,this.identities=f,this.permutiveReset=g,this.messages=p,this.addons=m,this.trace=v,this.permutiveRealtime=h,this.state=_,this.customProperties=b,this.config=y,this.permutiveData=w,this.externalData=E,this.cookies=S,this.identitiesIngestor=I,this.global=k,this.nextGen=P,this.pageviewState=U,this.tcf=(0,c.SD)(window,this.logger)}identify(e){const t="[Identify]";this.logger.debug("<call> identify",e);const n=(0,l.b2)(),{left:a,right:c}=this.identities.parseCustomerDefinedIdentities(e);if(a.length>0)throw new Error(a.join(" "));const u={...this.identities.getIdentitiesMap(),...c.reduce(((e,t)=>{let{tag:n,id:r,priority:i,expiry:o}=t;return{...e,[n]:{id:r,...void 0!==i?{priority:i}:{},...void 0!==o?{expiry:o}:{}}}}),{})},g=(0,r.zG)(Object.values(u),o.DZ((e=>i.ij(e.id)))),p=this.identities.getPrioritizedIdentities(u);if("string"==typeof e&&(0,s.Bt)("08cdfe71-67da-407d-b4cc-64aaab77de67","0801f79c-c3b0-44f6-9f5a-37611e3c986d",g,window.location.hostname,this.userId.get()))return n.resolve(),n.promise;const m=async e=>{await(0,f.Yj)({clientContext:this.clientContext,global:this.global,identities:this.identities,logger:this.logger,reset:this.permutiveReset,userId:this.userId},e.user_id)};return this.taskQueue.add(new d((async e=>{this.logger.debug("<task> identify",c);const r=async()=>{this.logger.log(t,"request identity");const e=await this.api.identify(this.metrics,this.userId,p);this.userId.isEqual(e.user_id)?this.metrics.track({name:"sdk_identity_remained_total",value:1,labels:{identify_reason:"identify_call"}}):(this.metrics.track({name:"sdk_identity_changed_total",value:1,labels:{identify_reason:"identify_call"}}),await m(e))};this.identities.setIdentities(c).identifyRequestRequired()?await r():this.logger.log(t,"skip request"),this.logger.debug("<done> identify",c),e(),n.resolve(),await this.identitiesIngestor.ingestIfEligible(c).catch((e=>this.api.reportError(`Couldn't ingest identities, got ${e}`,this.userId.get())))}),{wait_prev:!0,block_next:!0})),n.promise}on(e,t){return this.nextGen.eventHandlerAfterUpload.addListener({name:e,callback:t,once:!1})}once(e,t){return this.nextGen.eventHandlerAfterUpload.addListener({name:e,callback:t,once:!0})}pageviewTracked=!1;track(){const[e,t,n]=[arguments.length<=0?void 0:arguments[0],(arguments.length<=1?void 0:arguments[1])||{},(arguments.length<=2?void 0:arguments[2])||{}],r=this.trace.startSpan(`track("${e}")`);this.logger.log("<call> track",e);const i=(0,l.b2)();this.pageviewTracked||"Pageview"!==e||(this.pageviewTracked=!0,this.metrics.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"pageview_tracked",time_origin:"sdk_init"})),this.metrics.trackCounter({name:"sdk_event_track_count_total",labels:{event_name:e},value:1}),i.promise.then((()=>{this.metrics.trackCounter({name:"sdk_event_track_success_count_total",labels:{event_name:e},value:1}),r.finish()}),(()=>{this.metrics.trackCounter({name:"sdk_event_track_fail_count_total",labels:{event_name:e},value:1}),r.finish()}));const o=n.unprocessedData??{},a=o.sessionId??this.sessionManager.getSessionId(),s=o.viewId??this.viewId.get(),c={success:n.success||(e=>{}),error:n.error||((e,t)=>{})};return this.taskQueue.add(new d((r=>{this.logger.log("<task> track",e);return(o.client?Promise.resolve(o.client):this.clientContext.getClient()).then((o=>{const u={name:e,properties:{...t,client:t.client?(0,l.PM)(o,t.client):o},session_id:a,view_id:s,time:new Date};return this.nextGen.trackEvent.current({event:u,useBeacon:n.useBeacon??!1}).then((e=>{this.logger.log("<done> track",u.name),c.success(e),i.resolve(u),r()})).catch((e=>{c.error(e),this.api.reportError(e,this.userId.get()),i.reject(e)}))}))}))),i.promise}trigger(e,t,n){const r=(0,l.b2)();this.logger.log("<call> trigger",e);const i=t=>(i,o)=>{if(i.properties.segment_number===e){const a={result:t};this.logger.debug("<fire> trigger",{event:i,error:o,segmentCode:e,payload:a}),n(a),r.resolve(a)}};return this.nextGen.eventHandlerAfterUpload.addListener({name:"SegmentEntry",callback:i(!0),once:!1}),this.nextGen.eventHandlerAfterUpload.addListener({name:"SegmentExit",callback:i(!1),once:!1}),this.logger.log("<done> trigger",e),r.promise}query(){return Promise.resolve({result:!1})}segment(e,t){const n=(0,l.b2)();this.logger.log("<call> segment",e);return this.taskQueue.add(new d((r=>{this.logger.log("<task> segment",e);const i=this.nextGen.queryLanguageCohorts.all.current.includes(e)||!1;t(i),n.resolve(),this.logger.log("<done> segment",e),r()}))),n.promise}segments(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";const n=(0,l.b2)();this.logger.log("<call> segments");return this.taskQueue.add(new d((r=>{this.logger.log("<task> segments ("+t+")");const i=i=>{e(i),n.resolve(i),this.logger.log("<done> segments ("+t+")"),r()};"dfp"===t?this.messages.once("permutive:dfp:ready",(()=>{this.addons.dfp&&i([...this.addons.dfp.segments.liveSegments])})):i([...this.nextGen.queryLanguageCohorts.all.current])}))),n.promise}reset(){return Promise.all([this.api.reset(this.metrics),this.identities.reset(),this.permutiveReset.reset(),this.nextGen.reset(),this.userId.reset()]).then((()=>{this.messages.emit("permutive:reset")})).catch((e=>{this.api.reportError(`Error resetting internals. Got ${e}`)}))}addon(e,t){this.logger.debug("[Addon]",`Called for ${e}`,t);const o={...t,permutive:this,api:this.api,activationManager:this.activationManager,network:this.network,clientContext:this.clientContext,logger:this.logger,unprocessedEvents:this.unprocessedEvents,metrics:this.metrics,state:this.state,messages:this.messages,userId:this.userId,viewId:this.viewId,customProperties:this.customProperties,config:this.config,permutiveData:this.permutiveData,sessionManager:this.sessionManager,addons:this.addons,externalData:this.externalData,cookies:this.cookies,nextGenOutput:this.nextGen,identities:this.identities,pageviewState:this.pageviewState,tcf:this.tcf},s=((0,r.zG)(this.nextGen.pbjsPair,a.UI(i.UI((0,l.vg)("pbjs")))),e=>{this.initialisedAddons.push(e),this.messages.emit("permutive:addon:preinit",e)});if(-1===this.initialisedAddons.indexOf(e)){if(s(e),"ctv"===e)return this.addons.ctv=g.makeCtvAddonFactory(o);switch(e){case"web":Promise.resolve().then(n.bind(n,4400)).then((e=>this.addons.web=new e.WebAddon(o))).then((()=>this.messages.emit("permutive:web:ready")));break;case"publishers":case"overlays":case"scriptrunner":case"nativo":case"facebook_pixel_v2":case"tiktok_pixel":case"eyeota_pixel":case"rubicon":case"rubicon_ssp":case"twitter_pixel":case"pinterest_pixel":case"appnexus_adserver":case"prebid":case"classification_models":case"clean_room":case"gam_log":case"smart":case"appnexus":case"ssp":0;break;case"dfp":Promise.resolve().then(n.bind(n,9658)).then((async e=>this.addons.dfp=await e.createAddon(o)));break;case"freewheel":Promise.resolve().then(n.bind(n,2097)).then((e=>this.addons.freewheel=new e.FreeWheelAddon(o)));break;case"tracking_pixel":Promise.resolve().then(n.bind(n,3792)).then((e=>this.addons.tracking_pixel=new e.PixelAddon(o)));break;case"local_storage":Promise.resolve().then(n.bind(n,2271)).then((e=>this.addons.local_storage=new e.LocalStorageAddon(o)));break;case"tradedesk":Promise.resolve().then(n.bind(n,696)).then((e=>this.tcf.registerVendorOnValidConsent("tradedesk",(t=>this.addons.tradedesk=new e.TradeDeskPixel({...o,tcfStatus:t})))));break;case"ddp":case"dbm":Promise.resolve().then(n.bind(n,3512)).then((e=>this.tcf.registerVendorOnValidConsent("ddp",(t=>this.addons.ddp=new e.DDPPixel({...o,tcfStatus:t})))));break;case"pubmatic":Promise.resolve().then(n.bind(n,1840)).then((e=>this.tcf.registerVendorOnValidConsent("pubmatic",(t=>this.addons.pubmatic=new e.PubMaticAddon({...o,tcfStatus:t})))))}}else if("web"===e&&!0!==t.auto_init)((e,t,n,r)=>new Promise(((o,a)=>{const s=(0,i.Y3)(e);if((0,i.pC)(s))return o(s.value);n.once(t,(()=>(0,i.g_)((()=>a(new Error(`Error after waiting for event ${t}`))),o)((0,i.Y3)(e))));const c=(null==r?void 0:r.timeout)??1e4;(0,u.HJ)((()=>a(new Error(`Event ${t} was not received within the timeout period ${c}ms`))),c)})))((()=>{if(!this.addons.web)throw new Error('"web" addon not ready');return this.addons.web.reset(t)}),"permutive:web:ready",this.messages).catch((e=>{this.api.reportError(`Got error while trying to reset web. Got ${e.message}`,this.state.userId.get())}));else if("ctv"===e&&!0!==(null==t?void 0:t.auto_init))return this.addons.ctv=g.makeCtvAddonFactory(o)}ready(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"initialised";const n=(0,l.b2)(),r=()=>{e(),n.resolve()};switch(t){case"initialised":this.permutiveRealtime.isReady()?r():this.messages.on("permutive:ready",r);break;case"realtime":this.permutiveRealtime.isRealtime()?r():this.messages.once("permutive:realtime",r)}return n.promise}}var m=n(4769);const v=e=>{const{logger:t,consentTracking:n}=e,i=function(){return t.debug("Methods[track]: Cannot track as consent is revoked"),Promise.resolve(null)};return e=>class extends e{constructor(){super(...arguments),n.isRevoked()&&this.consentRevoked(),n.listenForConsent((()=>this.consentRevoked()),r.Q1)}async consentRevoked(){return await this.sessionManager.reset(),this.reset()}track=(0,m.v)(super.track.bind(this),i,n.isRevoked)}},h=(e,t,n,i,o,a,s,c,u,l,d,f,g,m,h,_,b,y,w,E,S,I,k,P,U,G,D,z)=>new((0,r.zG)(p,v({consentTracking:G,logger:e})))(e,t,n,i,o,a,s,c,u,l,d,f,g,m,h,_,b,y,w,E,S,I,k,P,U,D,z)},6315:(e,t,n)=>{n.d(t,{Yj:()=>c,TZ:()=>s});var r=n(2688),i=n(2652);var o=n(8612);const a=async e=>{await e.identities.thirdParty,await function(e,t){return(0,o.Bt)("08cdfe71-67da-407d-b4cc-64aaab77de67","0801f79c-c3b0-44f6-9f5a-37611e3c986d",e.identities.getPrioritizedIdentities(e.identities.getIdentitiesMap()).map((e=>e.id)),window.location.hostname,e.userId.get())?t.reset():Promise.resolve()}(e,e.permutiveMethods);const t=await function(e){const t=e.trace.startSpan("identify");0;return(async e=>{const t="[Identify Init]",{logger:n,api:r,userId:o,identities:a,metrics:s,identitiesIngestor:c,messages:u,sessionManager:l}=e,d=await a.thirdParty,f=a.extractIdentifyFromQueue(e),g={...a.getIdentitiesMap(),...f.reduce(((e,t)=>{let{tag:n,id:r,priority:i,expiry:o}=t;return{...e,[n]:{id:r,...o?{expiry:o}:{},...void 0!==i?{priority:i}:{}}}}),{})},p=a.setIdentities(Object.entries(g).map((e=>{let[t,{id:n,priority:r,expiry:i}]=e;return{tag:t,id:n,...i?{expiry:i}:{},...void 0!==r?{priority:r}:{}}})));a.setReady();const m=a.getPrioritizedIdentities(g);n.log("Begin identification");const v=e.sessionCount>1&&l.sessionHasChanged()||d.identifyRequestRequired()||p.identifyRequestRequired()?await(n.debug(t,"request identity"),r.identify(s,o,m).then((e=>{const r=e.user_id;return o.isEqual(r)?{identityChanged:!1}:(n.debug(t,"fetch received new user id",r),{identityChanged:!0,userId:r})})).catch((e=>(r.reportError(`${t} Fetch failed. Got ${e}`,o.get()),{identityChanged:!1}))).then((0,i.bw)((t=>e.metrics.track({name:`sdk_identity_${t.identityChanged?"changed":"remained"}_total`,value:1,labels:{identify_reason:"sdk_init"}}))))):(n.debug(t,"skip request"),{identityChanged:!1});return c.ingestIfEligible(m).catch((e=>r.reportError(`Couldn't ingest identities, got ${e}`,v.identityChanged?v.userId:o.get()))),u.emit("permutive:user:ready"),n.debug(t,"result",v),v})(e).catch((t=>(e.api.reportError(`Failed to identify. Got ${(0,r.w)(t)}`),{identityChanged:!1}))).then((e=>(t.finish(),e)))}(e);return t.identityChanged?await c(e,t.userId):e.logger.log("Identity has not changed"),t},s=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>{};a(e).then(t),u(e.global,e.clientContext)};async function c(e,t){e.logger.log("Identity has changed"),await e.reset.reset(),e.userId.set(t),u(e.global,e.clientContext),e.identities.setIdentities([])}function u(e,t){return e.context=t.getContext()}},5919:(e,t,n)=>{function r(e,t,n,r){r.debug("set SDK as ready"),e.emit("permutive:api:ready"),e.emit("permutive:queries:initialised"),t.track({name:"sdk_local_storage_byte_total",value:n.getStateSizeInBytes(),labels:{}}),r.warn("sdk_query_states_byte_total metric needs re-implementing")}n.d(t,{R:()=>r})},7078:(e,t,n)=>{n.d(t,{LA:()=>s});var r=n(5851),i=n(7209),o=n(2652);const a=(e,t,n)=>{let{api:r,state:i}=n;r.reportError(`Function "permutive.${t.functionName}" caused an error: ${e.message}`,i.userId.get())};function s(e,t,n,r,i,o){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:d;const u=c(e),l=o.startSpan("queued_methods"),f={api:i,state:t},g=e=>{if(e.functionName in n){n[e.functionName].apply(r,e.arguments)}else a(new Error("Does not exist."),e,f)},p=e=>!s.includes(e);u.forEach((e=>{try{p(e.functionName)&&g(e)}catch(t){const n=t instanceof Error?t:new Error("Unknown error.");a(n,e,f)}})),l.finish()}function c(e){const t=(0,r.uK)((e=>-1!==l.indexOf(e.functionName)))(e),n=t.right,a=t.left.filter((e=>"consent"!==e.functionName)),s=(0,i.Zt)(((e,t)=>u(e)&&u(t)?(0,o.lW)(f).compare(e.arguments[0],t.arguments[0]):(0,o.lW)(l).compare(e.functionName,t.functionName)));return(0,r.DY)(s)(n).concat(a)}const u=e=>"addon"===e.functionName,l=["identify","trigger","addon","track"],d=["identify"],f=["dfp","appnexus_adserver","web"]},7271:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{initialiseWebSDK:()=>initialiseWebSDK});var _permutive_permutive_utils_ts_error__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(2688),fp_ts_Option__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(2884),fp_ts_Either__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__(365),fp_ts_function__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(3735),fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(2707),_framework_ref__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(2851),_identity_legacy_NeustarFabrickIdentitiesIngestor__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(6967),_identity_legacy_PermutiveIdentities__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(8612),_identity_legacy_PermutiveIdentitiesIngestorNoOp__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(7658),_sdkql_blockers__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__(122),_core_activations_PermutiveActivationManagerWeb__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(8975),_core_activations_PermutiveAddons__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(9853),_core_context_PermutiveClientContextWeb__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(2836),_sdkql_event_collection_events_cache_store_crypto_HashcodeDigest__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(6197),_sdkql_event_collection_events_cache_store_crypto_SHA256Digest__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(6272),_sdkql_event_collection_PermutiveEventCustomProps__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(7748),_core_events_unprocessed_UnprocessedPrebidAuctions__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(1568),_core_metrics_MetricReporter__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(6478),_core_state_PermutiveRealtime__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(7575),_core_state_PermutiveReset__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(3898),_core_state_PermutiveStateWeb__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(7274),_core_state_PermutiveViewId__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(9880),_core_store_LocalStorage__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(7554),_core_tcf_TCF__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(2497),_dynamic_addons_LoadAddons__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(6037),_dynamic_messages_PermutiveMessages__WEBPACK_IMPORTED_MODULE_37__=__webpack_require__(9078),_http_PermutiveApi__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(7423),_utils_PermutiveUtils__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(2652),_utils_task_queue_PermutiveTaskQueue__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(4996),_utils_urls_UrlHelpers__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(3030),_Config__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(2233),_initialisation_identity__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(6315),_initialisation_initialisationLifecycle__WEBPACK_IMPORTED_MODULE_38__=__webpack_require__(5919),_initialisation_queuedMethods__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(7078),_PermutiveMethodsWeb__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(3298),_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(3992),fp_ts_Task__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(7407),main_core_store_SessionStorage__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(9332),main_http_PermutiveNetwork__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(7354);const prefix="[Initialisation Web]",initialiseWebSDK=_ref=>{let{cookieStore,consentModule,core,externalData,localStorage,logger,messages,metrics,namespace,pageviewState,partialTagWithKey,permutiveData,sessionManager,tag,trace,configFromQueryParams,urls,userId}=_ref;return(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_21__.Y3)((async()=>{const windowKey=partialTagWithKey.key,permutiveGlobal=window[windowKey],config=tag.config,viewId=(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)(pageviewState.ref,_framework_ref__WEBPACK_IMPORTED_MODULE_0__.UI((e=>e.viewId)),(e=>new _core_state_PermutiveViewId__WEBPACK_IMPORTED_MODULE_23__.W(e))),network=new main_http_PermutiveNetwork__WEBPACK_IMPORTED_MODULE_20__.E(metrics),sessionStorage=(0,main_core_store_SessionStorage__WEBPACK_IMPORTED_MODULE_19__.u)(namespace,logger,consentModule.consentTracking.consentRef),{consentTracking,consentValidation}=consentModule;(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)(consentTracking.consentRef,_framework_ref__WEBPACK_IMPORTED_MODULE_0__.YP((e=>{e?sessionStorage.put(configFromQueryParams,_Config__WEBPACK_IMPORTED_MODULE_14__.iq).then(fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.Q1,(e=>{logger.warn(prefix,`Failed to cache "${_Config__WEBPACK_IMPORTED_MODULE_14__.iq}".`,(0,_permutive_permutive_utils_ts_error__WEBPACK_IMPORTED_MODULE_24__.w)(e))})):sessionStorage.delete(_Config__WEBPACK_IMPORTED_MODULE_14__.iq)}))),window[windowKey].consent=consentValidation;const context=(0,_utils_PermutiveUtils__WEBPACK_IMPORTED_MODULE_12__.PM)(tag.context||{},{path:window.location.pathname,url:(0,_utils_urls_UrlHelpers__WEBPACK_IMPORTED_MODULE_25__.bk)(window.location.href),referrer:(0,_utils_urls_UrlHelpers__WEBPACK_IMPORTED_MODULE_25__.bk)(document.referrer),view_id:viewId.get()}),createInternalsSpan=trace.startSpan("internals"),clientContext=new _core_context_PermutiveClientContextWeb__WEBPACK_IMPORTED_MODULE_26__.z(context);(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)(viewId.ref,_framework_ref__WEBPACK_IMPORTED_MODULE_0__.YP((e=>clientContext.updateContext(["view_id",e])))),(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)(userId.ref,_framework_ref__WEBPACK_IMPORTED_MODULE_0__.YP((e=>clientContext.updateContext(["user_id",e]))));const api=new _http_PermutiveApi__WEBPACK_IMPORTED_MODULE_11__.F(urls,config,network,metrics,logger),identityProviderEnv={permutive:permutiveGlobal,network,api,userId,metrics,permutiveData,messages,config,cookies:cookieStore,logger},identities=new _identity_legacy_PermutiveIdentities__WEBPACK_IMPORTED_MODULE_2__.lg(metrics,trace,permutiveData,identityProviderEnv,logger),identitiesIngestor=new _identity_legacy_PermutiveIdentitiesIngestorNoOp__WEBPACK_IMPORTED_MODULE_27__.z,permutiveRealtime=new _core_state_PermutiveRealtime__WEBPACK_IMPORTED_MODULE_28__.u(trace,metrics,messages),unprocessedArgs={consent:consentTracking.consentRef,logger,namespace},unprocessedEvents={PrebidAuctions:new _core_events_unprocessed_UnprocessedPrebidAuctions__WEBPACK_IMPORTED_MODULE_29__.J(unprocessedArgs)},customProperties=new _sdkql_event_collection_PermutiveEventCustomProps__WEBPACK_IMPORTED_MODULE_7__.X,permutiveReset=new _core_state_PermutiveReset__WEBPACK_IMPORTED_MODULE_30__.a(config,localStorage,logger,permutiveData,cookieStore,externalData),taskQueue=new _utils_task_queue_PermutiveTaskQueue__WEBPACK_IMPORTED_MODULE_13__.i(messages),activationManager=new _core_activations_PermutiveActivationManagerWeb__WEBPACK_IMPORTED_MODULE_3__.v(logger,permutiveGlobal,clientContext),[addonsLoadedRef,setAddonsLoaded]=_framework_ref__WEBPACK_IMPORTED_MODULE_0__.Ue(!1),webClient=(()=>{const[e,t]=_framework_ref__WEBPACK_IMPORTED_MODULE_0__.Ue(Date.now());return(0,_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_18__.UM)((()=>t(Date.now())),1e3),(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)(_framework_ref__WEBPACK_IMPORTED_MODULE_0__.vP(viewId.ref,e),_framework_ref__WEBPACK_IMPORTED_MODULE_0__.UI((()=>(0,_core_context_PermutiveClientContextWeb__WEBPACK_IMPORTED_MODULE_26__.k)())),_framework_ref__WEBPACK_IMPORTED_MODULE_0__.D8(((e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t))))})(),eventCacheStoreFactory=()=>(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)((0,_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_18__.N1)((0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)((0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_21__.Y3)((()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__,9381))),String),trace.traceTask("import-DBStore-main-thread"))),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_21__.UI)((e=>{let{DBStore:t}=e;return new t((0,_core_store_LocalStorage__WEBPACK_IMPORTED_MODULE_31__.E)(namespace,logger,consentTracking.consentRef))}))),eventsCacheFactory=()=>(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)((0,_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_18__.SF)((0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)((0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_21__.Y3)((()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__,5717))),String),trace.traceTask("import-events-cache"))),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_21__.tS)((e=>{let{EventsCache:t}=e;return(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)(t.initialise(config,logger,(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};api.reportError(e,null==t?void 0:t.userId,null==t?void 0:t.timestamp)}),trace,metrics,userId.ref,eventCacheStoreFactory),trace.traceTask("initialise-events-cache-main-thread"))}))),nextGen=await(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)((0,_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_18__.SF)((()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__,3931)))),trace.traceTask("import-next-gen"),fp_ts_Task__WEBPACK_IMPORTED_MODULE_32__.Qt("configureCore",core),fp_ts_Task__WEBPACK_IMPORTED_MODULE_32__.UI((e=>{let{runNextGenFeatures:t,configureCore:n}=e;return t({activationManager,addonsLoaded:addonsLoadedRef,api,clientContext,config,consentTracking:fp_ts_Option__WEBPACK_IMPORTED_MODULE_33__.G(consentTracking),core:n({eventsCacheFactory,migratedStateMaps:()=>({internal:(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)(permutiveData.getData("internal_query_states"),fp_ts_Option__WEBPACK_IMPORTED_MODULE_33__.DT(_utils_PermutiveUtils__WEBPACK_IMPORTED_MODULE_12__.Kn)),external:(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)(permutiveData.getData("external_query_states"),fp_ts_Option__WEBPACK_IMPORTED_MODULE_33__.DT(_utils_PermutiveUtils__WEBPACK_IMPORTED_MODULE_12__.Kn))})}),externalData,identities:identities.ref,logger,messages,metrics,namespace,network,permutiveData,sessionManager,urls,userId,viewId,pageviewState:pageviewState.ref,trace,webClient:(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)(webClient,_framework_ref__WEBPACK_IMPORTED_MODULE_0__.UI(fp_ts_Option__WEBPACK_IMPORTED_MODULE_33__.of))})})))();(0,_core_metrics_MetricReporter__WEBPACK_IMPORTED_MODULE_8__.p)({api,context:nextGen.metricContext,logger,messages,metrics});const state=new _core_state_PermutiveStateWeb__WEBPACK_IMPORTED_MODULE_34__.u(permutiveData,permutiveReset,userId,viewId,logger),addons={},permutiveMethods=(0,_PermutiveMethodsWeb__WEBPACK_IMPORTED_MODULE_17__.S)(logger,api,activationManager,sessionManager,metrics,viewId,userId,network,clientContext,unprocessedEvents,taskQueue,identities,permutiveReset,messages,addons,trace,permutiveRealtime,state,customProperties,config,permutiveData,externalData,cookieStore,identitiesIngestor,permutiveGlobal,consentTracking,nextGen,pageviewState);createInternalsSpan.finish(),[].forEach((s=>{fp_ts_Either__WEBPACK_IMPORTED_MODULE_35__.Y3((()=>eval(s)),(e=>{api.reportError({...e,message:`Error running custom script ${s}`},userId.get())}))}));const blockers=(0,_sdkql_blockers__WEBPACK_IMPORTED_MODULE_36__.X)({logger,messages});blockers.addBlocker("permutive:queries:initialised");const initialIdentifyResult=(0,_utils_PermutiveUtils__WEBPACK_IMPORTED_MODULE_12__.b2)();let globalIdentifyBound=!1;messages.on("permutive:user:ready",(()=>{permutiveGlobal.identify=permutiveMethods.identify.bind(permutiveMethods),globalIdentifyBound=!0;const e=identities.extractIdentifyFromQueue({global:permutiveGlobal});e.length>0?initialIdentifyResult.resolve(permutiveGlobal.identify(e)):initialIdentifyResult.resolve()})),messages.on("permutive:blockers:empty",(()=>{if(!globalIdentifyBound){const e=permutiveGlobal.identify;permutiveGlobal.identify=t=>(e(t),initialIdentifyResult.promise)}permutiveGlobal.on=permutiveMethods.on.bind(permutiveMethods),permutiveGlobal.once=permutiveMethods.once.bind(permutiveMethods),permutiveGlobal.track=permutiveMethods.track.bind(permutiveMethods),permutiveGlobal.trigger=permutiveMethods.trigger.bind(permutiveMethods),permutiveGlobal.query=permutiveMethods.query.bind(permutiveMethods),permutiveGlobal.segment=permutiveMethods.segment.bind(permutiveMethods),permutiveGlobal.segments=permutiveMethods.segments.bind(permutiveMethods),permutiveGlobal.reset=permutiveMethods.reset.bind(permutiveMethods),permutiveGlobal.ready=permutiveMethods.ready.bind(permutiveMethods),permutiveGlobal.addon=permutiveMethods.addon.bind(permutiveMethods),permutiveGlobal.context=clientContext.getContext(),permutiveGlobal.addons=addons,permutiveGlobal.config=config,permutiveRealtime.setAsReady(),(0,_initialisation_queuedMethods__WEBPACK_IMPORTED_MODULE_16__.LA)(permutiveGlobal.q,state,permutiveGlobal,permutiveMethods,api,trace),setAddonsLoaded(!0)}));const loadAddonsSpan=trace.startSpan("load_addons");(0,_dynamic_addons_LoadAddons__WEBPACK_IMPORTED_MODULE_10__.C)({extMessages:new _dynamic_messages_PermutiveMessages__WEBPACK_IMPORTED_MODULE_37__.a(messages),nextGen,messages,viewId,state,sessionManager,api,clientContext,externalData,logger,metrics,namespace,network,permutive:permutiveGlobal,q:permutiveGlobal.q,userId}),loadAddonsSpan.finish(),await(0,_initialisation_identity__WEBPACK_IMPORTED_MODULE_15__.TZ)({api,clientContext,externalData,global:permutiveGlobal,identities,identitiesIngestor,logger,messages,metrics,network,permutiveMethods,reset:permutiveReset,trace,userId,sessionManager,sessionCount:nextGen.metricContext.current.session_count}),(0,_initialisation_initialisationLifecycle__WEBPACK_IMPORTED_MODULE_38__.R)(messages,metrics,state,logger),(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_22__.zG)(_framework_ref__WEBPACK_IMPORTED_MODULE_0__.vP(nextGen.realtime,nextGen.queryLanguageCohorts.all),_framework_ref__WEBPACK_IMPORTED_MODULE_0__.D8(((e,t)=>e[0]===t[0])),_framework_ref__WEBPACK_IMPORTED_MODULE_0__.bw((e=>{let[t,n]=e;t&&permutiveRealtime.setAsRealtime(n.length)})))}),(e=>`Exception during initialisation. Got ${e}`))}},4095:(e,t,n)=>{n.r(t),n.d(t,{runSdk:()=>te});var r=n(365),i=n(3735);var o=n(2707),a=n(7407),s=n(2884);var c=n(5700);class u{namespace;config;logger;constructor(e,t,n){this.namespace=e,this.config=t,this.logger=n}makeCookie(e,t,n){return[encodeURIComponent(this.namespace.getNamespacedStorageKey(e)),"=",t?encodeURIComponent(t):"","; expires=",n,"; domain=",this.config.cookieDomain,"; path=/; samesite=none; secure"].join("")}setCookie(e,t){if(!(t&&e&&this.config.cookieExpiry&&this.config.cookieDomain)){const{cookieExpiry:n,cookieDomain:r}=this.config??{};throw this.logger.warn(`Unable to set cookie. ${c.LP}`,{value:t,cookieName:e,cookieExpiry:n,cookieDomain:r}),new Error(c.LP)}const n=this.makeCookie(e,t,this.config.cookieExpiry);if(n.length>c.dG)throw this.logger.warn(`Unable to set cookie ${this.namespace.getNamespacedStorageKey(e)}. ${c.eP}`),new Error(c.eP);return this.logger.debug(`Setting cookie ${n}`),document.cookie=n,!0}getCookie(e){const t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?e:this.namespace.getNamespacedStorageKey(e),n=new RegExp("\\b"+encodeURIComponent(t)+"=([^;]+)").exec(document.cookie);return null!==n?decodeURIComponent(n[1]):null}deleteCookie(e){if(!e||!this.config.cookieDomain)return!1;const t=this.makeCookie(e,void 0,"Thu, 01 Jan 1970 00:00:00 UTC");return this.logger.debug(`Deleting cookie ${t}`),document.cookie=t,!0}}var l=n(4769);const d=e=>{const{logger:t,consentTracking:n}=e,r=e=>(t.debug(`Cookie: Failed to set cookie ${e} as consent is revoked`),!1);return e=>class extends e{setCookie=(0,l.v)(super.setCookie.bind(this),r,n.isRevoked)}};var f=n(2688),g=n(787);class p{namespace;constructor(e){this.namespace=e}getExternalData(e){const t=this.namespace.getNamespacedStorageKey(e);return window.localStorage.getItem(t)}getExternalJsonData(e){const t=this.getExternalData(e);return null===t?null:(0,g.A)(t)}setExternalData(e,t){const n=this.namespace.getNamespacedStorageKey(e);try{window.localStorage.setItem(n,t)}catch(e){}}setExternalJsonData(e,t){return(0,i.zG)((n=t,(0,r.Y3)((function(){var e=JSON.stringify(n);if("string"!=typeof e)throw new Error("Converting unsupported structure to JSON");return e}),i.yR)),(0,r.UI)((t=>this.setExternalData(e,t))),(0,r.g_)((e=>{throw(0,f.w)(e)}),i.Q1));var n}removeExternalData(e){const t=this.namespace.getNamespacedStorageKey(e);window.localStorage.removeItem(t)}}const m=e=>{const{logger:t,consentTracking:n}=e,r=e=>{t.debug(`External Data: Failed to set key ${e} as consent is revoked`)},i=r,o=r;return e=>class extends e{setExternalData=(0,l.v)(super.setExternalData.bind(this),i,n.isRevoked);setExternalJsonData=(0,l.v)(super.setExternalJsonData.bind(this),o,n.isRevoked)}};var v=n(3992);class h{sdkInitTimestamp;prefix="[Permutive]"+(self.document?"[Main]":"[Worker]");debugStyle=["color: blue"].join(";");constructor(e){this.sdkInitTimestamp=e}get timeDeltaFromInit(){return`[${(new Date).getTime()-this.sdkInitTimestamp}ms]`}log(){return console.log.bind(self.console,this.timeDeltaFromInit,this.prefix)(...arguments)}debug(){return console.debug.bind(self.console,"%s%c%s",this.timeDeltaFromInit,this.debugStyle,this.prefix)(...arguments)}warn(){return console.warn.bind(self.console,this.timeDeltaFromInit,this.prefix)(...arguments)}error(){return console.error.bind(self.console,this.timeDeltaFromInit,this.prefix)(...arguments)}}class _{log(){}debug(){}warn(){}error(){}}const b="[MESSAGES]";class y{logger;messageListenerMap={};replayQueue={};onceTracker={};defaultMessageOptions={withReplay:!1,once:!1};constructor(e){this.logger=e}on(e,t,n){const r=this.mergeMessageOptions(n);r.withReplay&&this.processReplayQueue(e,t);const i=w(e,this.messageListenerMap).push(t)-1;return r.once&&this.addToOnceTracker(e,i),i}once(e,t){return this.on(e,t,{once:!0})}off(e,t){if(null==t)return this.messageListenerMap[e]=[],void(this.replayQueue[e]=[]);t<0?this.logError('Index for "off" fell out of range',{index:t}):w(e,this.messageListenerMap)[t]=i.Q1}emit(e,t,n){const r=this.mergeMessageOptions(n);w(e,this.messageListenerMap).length>0?(this.logDebug(`Emitting Event: ${e}`),this.emitMessageWithPayload(e,t)):r.withReplay&&this.addToReplayQueue(e,t)}addToReplayQueue(e,t){w(e,this.replayQueue).push(t)}processReplayQueue(e,t){var n;null===(n=this.replayQueue[e])||void 0===n||n.forEach((e=>t(e)))}emitMessageWithPayload(e,t){var n;null===(n=this.messageListenerMap[e])||void 0===n||n.forEach(((n,r)=>{n(t),this.removeListenerIfSetToFireOnlyOnce(e,r)}))}addToOnceTracker(e,t){w(e,this.onceTracker).push(t)}removeListenerIfSetToFireOnlyOnce(e,t){var n;null!==(n=this.onceTracker[e])&&void 0!==n&&n.includes(t)&&this.off(e,t)}mergeMessageOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{...this.defaultMessageOptions,...e}}logError(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.error(b,...t)}logDebug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.debug(b,...t)}}const w=(e,t)=>t[e]??=[];var E=n(1828);class S{sdkInitTimestamp;timeOriginSdkInit;logger;prefix="[Metrics]";timeOriginForContext=P();pendingMetrics=[];pendingCounters={};pendingTimers={};constructor(e,t,n){this.sdkInitTimestamp=e,this.timeOriginSdkInit=t,this.logger=n}isEnabled(){return!0}consume(){const e=this.pendingMetrics.concat(Object.values(this.pendingCounters).flat());return this.pendingMetrics=[],this.pendingCounters={},e}track(e){this.logDebug(`Tracking ${e.name}`,{metric:e}),this.pendingMetrics.push(e)}trackCounter(e){if(this.logDebug(`Tracking ${e.name}`,{metric:e}),e.name in this.pendingCounters){const t=Object.keys(e.labels),n=this.pendingCounters[e.name].findIndex((n=>Object.keys(n.labels).length===t.length&&t.every((t=>n.labels[t]===e.labels[t]))));-1===n?this.pendingCounters[e.name].push(e):this.pendingCounters[e.name][n]=k(this.pendingCounters[e.name][n],e.value)}else this.pendingCounters[e.name]=[e]}synchroniseTimeBetweenContexts(e){return(0,i.zG)(E.gz(s.G5)(this.timeOriginForContext,this.timeOriginSdkInit),s.UI((t=>{let[n,r]=t;return e+n-r})))}trackTimeSinceInit(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:performance.now();(0,i.zG)(this.synchroniseTimeBetweenContexts(n),s.UI((e=>(e-this.sdkInitTimestamp)/1e3)),s.UI((n=>this.track({name:e,value:n,labels:t}))))}startTimer(e,t){const n=performance.now(),r=this.generateRandomKey(e);return this.pendingTimers[r]={startTime:n,labels:t},r}stopTimer(e,t){const n=this.pendingTimers[t];if(n){const r=(performance.now()-n.startTime)/1e3;this.logDebug("timer stopped",e,r),this.track({name:e,value:r,labels:n.labels}),delete this.pendingTimers[t]}}generateRandomKey(e){return`${e}-${[...Array(24)].map((()=>Math.random().toString(36)[2])).join("")}`}logDebug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.debug(this.prefix,...t)}}class I{isEnabled(){return!1}consume(){return[]}track(e){}trackCounter(e){}trackTimeSinceInit(e,t){}startTimer(e,t){return""}stopTimer(e,t){}}const k=(e,t)=>({...e,value:e.value+t}),P=()=>(0,i.zG)(s.Y3((()=>performance.timeOrigin)),s.hX((e=>"number"==typeof e&&!Number.isNaN(e))));var U=n(2652),G=n(4730),D=n(926);class z{config;namespace;logger;prefix="[Data Store]";permutiveData={};permutiveDataSize=0;localStorageScheduler;localStorageQueue=new Set;debouncedStorageKeys;debouncedFlush;constructor(e,t,n){this.config=e,this.namespace=t,this.logger=n,this.localStorageScheduler=new G.b(e.localStorageWriteDelay,e.localStorageWriteMaxDelay),this.debouncedFlush=this.localStorageScheduler.schedule(this.flushLocalStorageQueue.bind(this)),this.debouncedStorageKeys=new Set(e.localStorageDebouncedKeys),this.localStorageScheduler.scheduleForPageUnload(this.flushLocalStorageQueue.bind(this)),this.permutiveData=this.buildData()}reset(){this.permutiveData={}}getDataSize(){return this.permutiveDataSize}getData(e){return this.permutiveData[e]}setData(e,t){this.permutiveData[e]=t,this.requestWrite(e)}deleteKey(e){delete this.permutiveData[e],this.requestWrite(e)}requestWrite(e){this.debouncedStorageKeys.has(e)?(this.localStorageQueue.add(e),this.debouncedFlush()):this.writeData(e)}flushLocalStorageQueue(){for(let e of this.localStorageQueue)this.writeData(e);this.localStorageQueue.clear()}buildData(){return{...this.getDataChunk("misc"),...this.getDataChunk("queries")}}getDataChunk(e){const t=this.namespace.getNamespacedStorageKey(this.chunkKeyToStorageKey(e)),n=window.localStorage.getItem(t),r=null===n?null:(0,g.A)(n);return n&&r?(this.permutiveDataSize+=2*n.length,r):{}}chunkKeyToStorageKey(e){switch(e){case"queries":return this.config.permutiveDataQueriesKey;case"misc":return this.config.permutiveDataMiscKey;default:throw new Error(`Unhandled chunk key "${e}"`)}}writeData(e){this.logger.debug(`Data Store: Writing ${e} to localStorage`);const[t,n]=this.dataKeyToChunkInfo(e);return r.Y3((()=>window.localStorage.setItem(this.namespace.getNamespacedStorageKey(t),JSON.stringify(n))),(t=>{const n=(0,f.w)(t);return this.logError(`Failed to set ${e}. Got ${n}`),n}))}dataKeyToChunkInfo(e){const t=e=>(0,U.eu)(this.permutiveData,e);switch(e){case"internal_query_states":case"external_query_states":case"event-source-id":return[this.chunkKeyToStorageKey("queries"),t(T)];case D.Kd:case"identities":case"amp_ready":case"metricsEnabled":case"addon:tradedesk":case"addon:tracking_pixel":case"addon:eyeota_pixel":case"addon:pinterest_pixel":case"addon:facebook_pixel_v2":case"addon:tiktok_pixel":case"addon:appnexus":case"addon:ddp":case"addon:gigya":case"addon:neustar_fabrick":case"pubmatic":case"lotame":return[this.chunkKeyToStorageKey("misc"),t(C)];default:throw new Error(`Unhandled data key "${e}"`)}}logError(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.error(this.prefix,...t)}}const T=["internal_query_states","external_query_states","event-source-id"],C=[D.Kd,"identities","amp_ready","metricsEnabled","addon:tradedesk","addon:tracking_pixel","addon:eyeota_pixel","addon:pinterest_pixel","addon:facebook_pixel_v2","addon:tiktok_pixel","addon:appnexus","addon:ddp","addon:gigya","addon:neustar_fabrick","pubmatic","lotame"],q=e=>{const{logger:t,consentTracking:n}=e,i=e=>(t.debug(`Data Store: Failed to write ${e} as consent is revoked`),r.F2(void 0));return e=>class extends e{writeData=(0,l.v)(super.writeData.bind(this),i,n.isRevoked)}};class O{config;constructor(e){this.config=e}getNamespacedStorageKey(e){return`${this.config.stateNamespace}${e}`}}var x=n(2851);class M{config;cookies;externalData;ref;isNewlyGenerated;setState;constructor(e,t,n,r){this.config=e,this.cookies=t,this.externalData=n;const[o,a]=x.Ue(this.getOrGenerateUserId());this.ref=(0,i.zG)(o,x.UI((e=>e.userId))),this.isNewlyGenerated=(0,i.zG)(o,x.UI((e=>e.isNewlyGenerated))),this.setState=a,(0,i.zG)(x.vP(this.ref,r),x.YP((e=>{let[t,n]=e;n?(this.cookies.setCookie(this.config.cookieName,t),this.externalData.setExternalData(this.config.cookieName,t)):(this.cookies.deleteCookie(this.config.cookieName),this.externalData.removeExternalData(this.config.cookieName))})))}isEqual(e){return this.ref.current===e}get(){return this.ref.current}set(e){this.setState({userId:e,isNewlyGenerated:!1})}reset(){this.setState({userId:(0,U.k$)(),isNewlyGenerated:!0})}getOrGenerateUserId(){return(0,i.zG)(this.getUserIdFromCookie(),s.wp((()=>this.getUserIdFromLocalStorage())),s.UI((e=>({userId:e,isNewlyGenerated:!1}))),s.fS((()=>({userId:(0,U.k$)(),isNewlyGenerated:!0}))))}getUserIdFromCookie(){return this.getUserIdFromStorageIfValid("cookie")}getUserIdFromLocalStorage(){return this.getUserIdFromStorageIfValid("localStorage")}getUserIdFromStorageIfValid(e){const t=s.DT(U.Gz);return(0,i.zG)("cookie"===e?this.cookies.getCookie(this.config.cookieName):this.externalData.getExternalData(this.config.cookieName),s.ij,s.tS(t))}}class R{config;PATH_JOINER_Q="?";PATH_JOINER_A="&";constructor(e){this.config=e}getBaseUrl(){return`${this.config.apiProtocol}://${this.config.apiHost}`}getEndpointUrl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.getUrl("base",e,t,n)}getSdkErrorsUrl(e,t){return this.getUrl("sdk-errors",e,t,[])}getAdvertiserEndpointUrl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.getUrl("adv",e,t,n)}getClassificationModelsEndpointUrl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.getUrl("clm",e,t,n)}getAudienceMatchingEndpointUrl(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const i=`${e}/${n}/audiences`;return this.getUrl("audience-matching",i,t,r)}getCCSCohortMembershipEndpointUrl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.getUrl("ccs",e,t,n)}makeAuthenticatedUrl(e){return this.makeUrlWithQueryParams(e,[["k",this.config.apiKey]])}getUrlPrefix(e){switch(e){case"base":return"";case"adv":return"/adv";case"sdk-errors":return"/sdk-errors";case"clm":return"/clm";case"audience-matching":return"/audience-matching";case"ccs":return"/ccs"}}getUrl(e,t,n,r){const i=this.getUrlPrefix(e),o=(0,s.g_)((()=>""),(e=>`/${e}`))(n),a=`${this.getBaseUrl()}${i}${o}${t}`;return this.makeUrlWithQueryParams(a,r.concat([["k",this.config.apiKey]]))}makeUrlWithQueryParams(e,t){const n=t.map((e=>{let[t,n]=e;return`${t}=${n}`})).join(this.PATH_JOINER_A),r=e.includes(this.PATH_JOINER_Q)?this.PATH_JOINER_A:this.PATH_JOINER_Q;return`${e}${r}${n}`}}const A=`permutive.${self.document?"main":"worker"}.`;class L{config;shouldUsePerformanceMark=!1;constructor(e){var t;this.config=e,this.shouldUsePerformanceMark=((null===(t=self.performance)||void 0===t?void 0:t.mark)&&this.config.tracingEnabled)??!1}startSpan(e){const t=this.generateSpan(e);return t.start(),{spanId:t.spanId,finish:t.finish}}measureSinceInit(e){const t=this.generateSpan(`${e}_since_init`);return t.start({startTime:v.NC}),{spanId:t.spanId,finish:t.finish}}traceTask(e){return t=>async()=>{const n=this.startSpan(e),r=await t();return n.finish(),r}}measureBetween(e,t,n){const r=this.generateSpan(e);r.start({startTime:t}),r.finish({startTime:n})}generateSpan(e){if(!this.shouldUsePerformanceMark)return{spanId:null,start:()=>{},finish:()=>{}};const{spanName:t,startMarkerName:n,endMarkerName:r}=L.generateUniqueMarkerNames(e);return{spanId:n,start:e=>{var t;return null===(t=self.performance)||void 0===t?void 0:t.mark(n,e)},finish:e=>{var i,o,a;null===(i=self.performance)||void 0===i||i.mark(r,{startTime:(null==e?void 0:e.startTime)??performance.now()}),null===(o=self.performance)||void 0===o||null===(a=o.measure)||void 0===a||a.call(o,t,n,r)}}}static generateUniqueMarkerNames(e){const t=`${A}${e}`,n=`${t}${L.generateId()}`;return{spanName:t,startMarkerName:`${n}_start`,endMarkerName:`${n}_end`}}static generateId(){return"_"+Math.random().toString(36).substr(2,9)}}var F=n(2233),$=n(4564),B=n(5851),N=n(7271),Y=n(1410),K=n(30);const j=e=>{const{partialTagWithKey:t}=e,n=t.key;var o;window[n].consent=(o=e,(0,i.ls)(o.consentModule.consentValidation,s.DT(Boolean),s.UI((0,N.initialiseWebSDK)(o)),i.Q1));const c=(0,s.EQ)((()=>{return t={consentDatabase:e.consentModule.consentDatabase,consentRequired:e.tag.config.consentRequired},(0,i.zG)((0,i.a9)(t.consentDatabase.get(Y.L)),(0,a.UI)((e=>(0,K.J)(t.consentRequired,e).isValid)));var t}),a.of);return(0,i.zG)((0,i.zG)((e=>{let{consentModule:t,tag:n}=e;const r=(0,B.Ew)((function(e){return"consent"===e.functionName}))(n.q);return(0,s.UI)((e=>t.consentValidation(e.arguments[0])))(r)})(e),c),(0,a.UI)((e=>e?(0,r.F2)(!0):(0,r.t$)("No consent to run on the page"))))},Q=e=>(0,i.zG)((e=>"function"==typeof e.Map?(0,r.F2)(new e.Map([["a",1]])):(0,r.t$)("Maps not supported"))(e),r.tS((e=>1===e.size?(0,r.F2)(null):(0,r.t$)("Iterable Maps not supported")))),W=e=>(0,i.zG)((e=>"function"==typeof e.Set?(0,r.F2)(new e.Set([1,2])):(0,r.t$)("Sets not supported"))(e),r.tS((e=>2===e.size?(0,r.F2)(null):(0,r.t$)("Iterable Sets not supported")))),H=e=>(0,i.zG)((0,E.gz)(r.G5)(Q(e),W(e),(e=>e.Worker&&e.Blob?(0,r.F2)(null):(0,r.t$)("WebWorkers not supported"))(e)),(e=>(0,r.UI)(i.Q1)(e)));const V=()=>{const e=(0,n(8537).Z)(),t=(e=>{const t=[],n=[],r=()=>{for(;t.length>0&&n.length>0;)n.shift()()},i=e=>new Promise((t=>{n.push((()=>t(e()))),(0,v.HJ)(r)}));return e.addEventListener("message",(0,v.GL)((e=>{null!==e.data&&(t.push(e.data),(0,v.HJ)(r))}))),{next:()=>i((()=>t.shift())),read:()=>i((()=>t.splice(0)))}})(e);return e.postMessage(null),r=>function(e){let{worker:t,trace:r,metrics:o,...c}=e;return t.send({...c,globals:self._____workerGlobals,initialTimestampSecs:(0,i.zG)(s.lo(!1),s.UI((()=>Math.floor(Date.now()/1e3)))),metricsEnabled:o.isEnabled(),timeOriginMainContext:P()}),(0,i.zG)((0,v.SF)((()=>Promise.resolve().then(n.bind(n,9145)))),r.traceTask("import-master-low-priority"),a.UI((e=>n=>e.startMaster({...n,metrics:o,trace:r,worker:t}))))}({...r,worker:{...t,send:t=>e.postMessage(t),stop:()=>e.terminate()}})};var J=n(7554);class Z{db;options;constructor(e,t){this.db=e,this.options=t}getSessionId(){return this.options.session_id}sessionHasChanged(){return this.options.hasChanged}static decodeSessionData(e){return e&&"object"==typeof e&&e.hasOwnProperty("session_id")&&e.hasOwnProperty("last_updated")?{...e,last_updated:new Date(e.last_updated)}:null}reset(){return this.db.delete(this.options.session_data_key)}async persistSessionData(e){const t=e.last_updated.toISOString();await this.db.put({...e,last_updated:t},this.options.session_data_key)}static generateNewSession(e){return{session_id:(0,U.k$)(),last_updated:e}}static hasExpired(e,t,n){if(isNaN(t.getTime()))return!0;return e>new Date(t.getTime()+1e3*n)}static async initialise(e,t,n){const r={timeout_seconds:1800,session_data_key:"permutive-session",hasChanged:!1,logger:n};e.deleteCookie(r.session_data_key);const o=new Date,a=await t.get(r.session_data_key).catch(i.gn),s=Z.decodeSessionData(a),c=null===s||Z.hasExpired(o,s.last_updated,r.timeout_seconds)?{...Z.generateNewSession(o),hasChanged:!0}:{...s,last_updated:o,hasChanged:!1},u=new Z(t,(0,U.PM)(r,c));return await u.persistSessionData(c),u}}var X=n(2836);const ee=e=>(0,i.zG)(o.Do,o.Qt("support",o.Uo(H(self))),o.Qt("partialTagWithKey",o.Uo((e=>{var t,n;const o="0801f79c-c3b0-44f6-9f5a-37611e3c986d",a=void 0!==(null===(t=e[o])||void 0===t?void 0:t.q)&&void 0!==(null===(n=e[o])||void 0===n?void 0:n.config)?o:"permutive";return(0,i.zG)(e[a],(0,r.ij)("Can't find permutive tag on the page"),(0,r.UI)((e=>({tag:e,key:a}))))})(window))),o.Qt("configFromQueryParams",o.Uo((0,F.B9)())),o.Hr("tag",(e=>((e,t)=>{let{tag:n,key:r}=e;return{...n,config:(0,F.ti)({...n.config,windowKey:r},t)}})(e.partialTagWithKey,e.configFromQueryParams))),o.UI((e=>{{const n=e.partialTagWithKey.key,r=window[n];t=r,window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push((()=>{const e=googletag.pubads(),n=()=>{t.track("AdRequest",{ad_server_id:"dfp",cohorts:e.getTargeting("permutive")})},r=e.getSlots().filter((e=>e.getResponseInformation())).length;for(let e=0;e<r;e++)n();e.addEventListener("slotRequested",n)}))}var t;return e})),o.Hr("trace",(e=>{let{tag:t}=e;return new L(t.config)})),o.Hr("namespace",(e=>{let{tag:t}=e;return new O(t.config)})),o.Hr("logger",(e=>{let{tag:t}=e;return function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v.RP;return e.loggingEnabled&&void 0!==(null===(t=self.console)||void 0===t?void 0:t.log)?new h(n):new _}(t.config)})),o.Hr("urls",(e=>{let{tag:t}=e;return new R(t.config)})),o.Hr("messages",(e=>{let{logger:t}=e;return new y(t)})),o.Hr("worker",(()=>V())),o.ak("consentModule",(e=>(0,i.zG)((()=>(0,$.NY)({...e,consentRequired:e.tag.config.consentRequired})),o.Vn((e=>e.message))))),o.Hr("cookieStore",(e=>{let{consentModule:t,logger:n,namespace:r,tag:o}=e;return((e,t,n,r)=>new((0,i.zG)(u,d({consentTracking:r,logger:n})))(e,t,n))(r,o.config,n,t.consentTracking)})),o.Hr("externalData",(e=>{let{consentModule:t,logger:n,namespace:r}=e;return((e,t,n)=>new((0,i.zG)(p,m({consentTracking:n,logger:t})))(e))(r,n,t.consentTracking)})),o.Hr("userId",(e=>{let{cookieStore:t,consentModule:n,externalData:r,tag:i}=e;return new M(i.config,t,r,n.consentTracking.consentRef)})),o.Hr("permutiveData",(e=>{let{tag:t,namespace:n,logger:r,consentModule:o}=e;return((e,t,n,r)=>new((0,i.zG)(z,q({consentTracking:r,logger:n})))(e,t,n))(t.config,n,r,o.consentTracking)})),o.Hr("metrics",(t=>{let{tag:n,logger:r,permutiveData:i}=t;return function(e,t,n,r,i){const o=r.getData("metricsEnabled")??(()=>{const e=Math.random()<=n.metricsSamplingPercentage/100;return r.setData("metricsEnabled",e),e})()?new S(e,t,i):new I;return o.track({name:"sdk_initialisation_start_time_seconds",value:e/1e3,labels:{}}),o}(e.contextsInitTimestampPerformance,P(),n.config,i,r)})),o.Hr("pageviewState",(e=>{let{tag:t}=e;return(e=>{const t={viewId:(0,i.zG)(e.viewId,s.DT((e=>"string"==typeof e&&(0,U.Gz)(e))),s.fS(U.k$)),watsonEnabled:e.watson.enabled};return(0,i.zG)(x.Ue(t),(e=>{let[n,r]=e;return{ref:n,setState:(0,i.ls)((e=>e(n.current,t)),r)}}))})(t.config)})),(0,i.ls)(o.Hr("localStorage",(e=>{let{logger:t,namespace:n,consentModule:r}=e;return(0,J.E)(n,t,r.consentTracking.consentRef)})),o.ak("sessionManager",(e=>{let{cookieStore:t,localStorage:n,logger:r}=e;return o.Y3((()=>Z.initialise(t,n,r)),(e=>`Failed to initialise session manager: ${e.message}`))})),o.Hr("core",(t=>{let{consentModule:n,metrics:r,pageviewState:o,permutiveData:a,sessionManager:c,trace:u,tag:l,userId:d,worker:f}=t;const{eventSourceId:g,isFirstPageview:p}=(0,i.zG)(s.ij(a.getData("event-source-id")),s.hX(U.Gz),s.UI((e=>({eventSourceId:e,isFirstPageview:!1}))),s.fS((()=>{const e=(0,U.k$)();return a.setData("event-source-id",e),{eventSourceId:e,isFirstPageview:!0}})));return f({consent:n.consentTracking.consentRef.current,eventSourceId:g,isFirstPageview:p,isSecureContext:(m=l.config,"development"===m.environment?self.isSecureContext:"https:"===self.location.protocol),metrics:r,permutiveConfig:l.config,organizationId:"0801f79c-c3b0-44f6-9f5a-37611e3c986d",pageviewState:o.ref.current,sdkInitTimestampPerformance:e.contextsInitTimestampPerformance,sdkInitTimestampDate:e.contextsInitTimestamp,sessionId:c.getSessionId(),trace:u,trackPageviewComplete:!0,userId:d.get(),userIdIsNewlyGenerated:d.isNewlyGenerated.current,webClient:(0,X.k)()});var m})),o.ak("consent",(e=>j(e))),o.tS((e=>(0,i.zG)((0,v.SF)((()=>Promise.resolve().then(n.bind(n,7271)))),e.trace.traceTask("permutive.main.import_permutiveWebLowPriority"),a.tS((t=>t.initialiseWebSDK(e)))))))),te=e=>(e=>{e().then((0,r.g_)((e=>console.warn(`Permutive was not initialized. ${e}`)),i.Q1))})(ee(e))},2652:(e,t,n)=>{n.d(t,{BJ:()=>f,Bf:()=>w,G6:()=>P,Gz:()=>S,HD:()=>d,HP:()=>q,Kn:()=>l,Or:()=>D,PM:()=>m,PQ:()=>U,Z_:()=>T,a4:()=>h,aT:()=>y,b2:()=>v,bw:()=>x,cO:()=>G,eu:()=>_,jn:()=>g,k$:()=>E,lW:()=>z,lo:()=>M,m8:()=>I,qh:()=>p,rH:()=>A,rO:()=>O,vg:()=>C});var r=n(5851),i=n(3735),o=n(2884),a=n(7209),s=n(6017),c=n(2751),u=n(3992);const l=e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,d=e=>"string"==typeof e,f=e=>"number"==typeof e&&!Number.isNaN(e),g=e=>"boolean"==typeof e,p=e=>Object.entries(e);function m(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(((e,t)=>({...e,...t})),{})}s.ff(c.xb);function v(){let e,t;return{promise:new Promise(((n,r)=>{e=n,t=r})),reject:t,resolve:e}}function h(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={waitTimeInMs:50,exponentialBackOff:!1,maxAttempts:20},{waitTimeInMs:a,exponentialBackOff:s,maxAttempts:c}=m(r,n);let l=0;const d=n=>new Promise((r=>Promise.resolve(t()).then((t=>t?Promise.resolve(e()).then((e=>r((0,o.G)(e)))):(0,i.zG)(l++,(e=>e<c?(0,u.HJ)((()=>r(d(n*(s?2:1)))),n):r(o.YP)))))));return d(a)}function _(e,t){const n=Object.create(null);for(const r of t)n[r]=e[r];return n}let b=[];function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:navigator.userAgent;if(b.unshift(e),b.length>1)return;const n=["beforeunload","pagehide"],r=n.concat(["visibilitychange"]),i=e=>{if(!o&&e){o=!0;const e=b;b=[],e.forEach((e=>{try{e()}catch{}}))}};let o=!1;r.forEach((e=>{window.addEventListener(e,(()=>{const n=("visibilitychange"!==e||document.hidden)&&k(t);i(n)}))})),n.forEach((e=>{window.addEventListener(e,(()=>i(!0)))}))}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t={capture:!0,...t};const n=["visibilitychange","pagehide"];n.forEach((n=>window.addEventListener(n,(()=>o.Y3((()=>{"pagehide"!==n&&"hidden"!==document.visibilityState||e()}))),{capture:t.capture})))}function E(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^(self.crypto||self.msCrypto).getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))}function S(e){return 36===e.length&&/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(e)}function I(){const e={},t=arguments.length;for(let n=0;n<t;n++){const[t,r]=n<0||arguments.length<=n?void 0:arguments[n];e[t]=r}return e}function k(e){return/Mobi|Android/i.test(e)}function P(e){return/^((?!chrome|android).)*safari/i.test(e)}function U(e,t){return new Promise((n=>{(0,u.HJ)((()=>{Promise.resolve(e()).then(n)}),(null==t?void 0:t.timeout)??0)}))}function G(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}const D=()=>({equals:(e,t)=>Object.is(e,t)});function z(e){return(0,a.Zt)(((t,n)=>{const r=e.indexOf(t),i=e.indexOf(n);switch(!0){case-1===r&&-1===i:return 0;case-1!==r&&-1===i:return-1;case-1===r&&-1!==i:return 1;default:return r<=i?-1:1}}))}function T(e,t,n){return function(){try{return n(...arguments)}catch(n){e.reportError(n,t.get())}}}function C(e){return t=>null!=t&&e in t?t[e]:void 0}function q(e){let t=o.YP;const n=(0,o.fS)((()=>{const n=e();return t=(0,o.G)(n),n}));return()=>n(t)}const O=e=>t=>{const n={...t};for(const i in e){var r;n[i]=null===(r=e[i])||void 0===r?void 0:r.call(e,t[i])}return n};function x(e){return t=>(e(t),t)}const M=e=>t=>{const n=e.slice(0,-1),a=e.slice(-1)[0];return(0,i.zG)(n,r.f2((e=>{let[n,r]=e;return(0,i.zG)(t,o.DT(n),o.UI(r))})),o.fS((()=>a(t))))},R=e=>t=>{if("number"==typeof t)return t;if("string"==typeof t){const n=e(t);return Number.isNaN(n)?void 0:n}},A=R(parseInt);R(parseFloat)},4730:(e,t,n)=>{n.d(t,{b:()=>o});var r=n(2652),i=n(3992);class o{timeoutDurationInMilliseconds;maxTimeOutDurationInMilliseconds;constructor(e,t){this.timeoutDurationInMilliseconds=e,this.maxTimeOutDurationInMilliseconds=t}schedule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.timeoutDurationInMilliseconds,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.maxTimeOutDurationInMilliseconds;return this.debounce(e,t,n)}scheduleAccumulated(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.timeoutDurationInMilliseconds,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.maxTimeOutDurationInMilliseconds;return this.debounce(e,n,r,t)}scheduleForPageUnload(e){return(0,r.aT)(e)}debounce(e,t,n,o){let a,s,c,u=[];return l=>{o&&(c=o.concat(c??o.empty,l));const d=(0,r.b2)();u.push(d);var f;return null===(f=a)||void 0===f||f(),a=(0,i.HJ)((()=>{var t;null===(t=s)||void 0===t||t(),s=void 0;const n=e(c||l);u.forEach((e=>e.resolve(n))),c=null==o?void 0:o.empty,u=[]}),t),s||(s=(0,i.HJ)((()=>{var t;null===(t=a)||void 0===t||t(),s=void 0;const n=e(c||l);u.forEach((e=>e.resolve(n))),c=null==o?void 0:o.empty,u=[]}),n)),d.promise}}}},4996:(e,t,n)=>{n.d(t,{i:()=>i});var r=n(3992);class i{messages;queue=[];nextNotify=null;constructor(e){this.messages=e,e.on("permutive:taskQueue:update",(()=>{this.execute()}))}add(e){this.queue.push(e),this.notify()}notify(){const e=()=>{this.messages.emit("permutive:taskQueue:update")},t=(new Date).getTime();null===this.nextNotify||this.nextNotify<t-50?(this.nextNotify=t,e()):this.nextNotify<=t&&(this.nextNotify=t+50,(0,r.HJ)(e,50))}execute(){if(0===this.queue.length)return;let e=!1,t=!1,n=0;for(let r=0;r<this.queue.length;r++){const i=this.queue[r];if(i.complete)n+=1;else if(i.started)t=!0,e=e||i.blocks();else{if(i.waits()&&t)break;e||(t=!0,e=e||i.blocks(),i.execute((()=>{this.notify()})))}}this.queue.splice(0,n)}size(){return this.queue.length}}},3030:(e,t,n)=>{n.d(t,{_Y:()=>a,bk:()=>o,zM:()=>i});var r=n(3735);const i=()=>{var e,t;const n=null===(e=window.location.href.split("?")[1])||void 0===e||null===(t=e.split("#")[0])||void 0===t?void 0:t.split("&");return void 0===n?{}:n.reduce(((e,t)=>{const[n,r]=t.split("=");return{...e,[n]:r}}),{})},o=e=>{if(!e)return"";return(0,r.zG)(e,(e=>{const t=e.length-1;return"/"===e[t]?e.slice(0,t):e}))};function a(e){const t=e.match(/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/),n=e.match(/[a-z0-9][a-z0-9-]+\.[a-z.]{2,24}$/i),r=e.match(/localhost/);if(n&&n.length>0){const t=e.split(".").reverse();return t.length>=3&&t[1].match(/^(com|edu|gov|net|mil|org|nom|co|ac|name|info|biz)$/i)?t[2]+"."+t[1]+"."+t[0]:t[1]+"."+t[0]}return t&&(null==t?void 0:t.length)>0?t[0]:r&&(null==r?void 0:r.length)>0?"localhost":""}},7305:(e,t,n)=>{n.r(t),n.d(t,{load:()=>u,makeCtvAddonFactory:()=>l});var r=n(3735),i=n(2884),o=n(9853),a=n(2652),s=n(3992);const c="ctv",u=function(e){(0,o.Hn)(c)("auto_init",!1)&&e.q.push({functionName:"addon",arguments:[c,{}]})};const l=function(e){const t=(0,o.Hn)(c),n=t("ctv_engagement_enabled",!0),u=t("ctv_engagement_event_seconds",5);function l(){const e=new Date,t=-e.getTimezoneOffset(),n=t>=0?"+":"-",r=e=>e.toString().padStart(2,"0");return e.getFullYear()+"-"+r(e.getMonth()+1)+"-"+r(e.getDate())+"T"+r(e.getHours())+":"+r(e.getMinutes())+":"+r(e.getSeconds())+n+r(Math.floor(Math.abs(t)/60))+":"+r(Math.abs(t)%60)}return new class{options;input;trackerState;clearInterval;commonPlaybackState;pausedState;resumedState;shouldTrackCTVEngagement=n&&u>0;DEFAULT_DURATION=0;eventProperties;constructor(e){this.options=e,this.input=this.sanitiseOrPassThroughInput({duration:e.duration,videoProperties:e.videoProperties,client:e.client}),this.eventProperties={isp_info:"$ip_isp_info",geo_info:"$ip_geo_info",video:this.input.videoProperties,client:this.input.client},this.updateClientContext(this.input.videoProperties),this.options.pageviewState.setState((0,a.rO)({viewId:a.k$})),this.trackerState="Paused",this.commonPlaybackState={},this.resumedState={},this.pausedState={},this.setDuration(this.input.duration),this.trackVideoView()}play(e){const t=()=>{this.shouldTrackCTVEngagement&&!this.clearInterval&&(this.clearInterval=this.registerEngagementInterval(u))},n=e=>(0,r.zG)(this.sanitisePosition(e??this.pausedState.pausedPosition,(()=>0)),(e=>(this.updateResumedState({resumedPosition:e,resumedTimestamp:Date.now()}),e)),(e=>this.calculateMaximumViewedPosition(e)),(e=>this.updateCommonPlayBackState({maximumViewedPosition:e,percentageViewed:this.calculatePercentageViewed(e)})));switch(this.trackerState){case"Paused":t(),this.updateTrackerState("Resumed"),n(e);break;case"Resumed":n(e)}}pause(e){const t=e=>(0,r.zG)(this.sanitisePosition(e,(()=>this.calculateCurrentPosition())),(e=>(this.updatePausedState({pausedPosition:e,pausedTimestamp:Date.now()}),e)),(e=>this.calculateMaximumViewedPosition(e)),(e=>this.updateCommonPlayBackState({maximumViewedPosition:e,percentageViewed:this.calculatePercentageViewed(e),accumulatedEngagementTime:this.calculateAccumulatedEngagementTime()})));var n;"Resumed"===this.trackerState&&(null===(n=this.clearInterval)||void 0===n||n.call(this),this.clearInterval=void 0,this.updateTrackerState("Paused"),t(e))}stop(e){var t;null===(t=this.clearInterval)||void 0===t||t.call(this),this.clearInterval=void 0,"Resumed"===this.trackerState&&(0,r.zG)(this.sanitisePosition(e,(()=>this.calculateCurrentPosition())),(e=>this.calculateMaximumViewedPosition(e)),(e=>this.updateCommonPlayBackState({maximumViewedPosition:e,percentageViewed:this.calculatePercentageViewed(e)})));const n="Resumed"===this.trackerState?this.calculateTotalEngagedTime():this.commonPlaybackState.accumulatedEngagementTime;this.updateTrackerState("Stopped"),this.trackVideoCompletion({completion:this.commonPlaybackState.percentageViewed,engaged_time:n})}setDuration(e){this.commonPlaybackState.totalVideoDuration=e}track(){this.options.permutive.track(...arguments)}trackVideoView(){this.track("Videoview",{...this.eventProperties,local_time:l()})}trackVideoEngagement(e){this.track("VideoEngagement",{...this.eventProperties,local_time:l(),engaged_time:e})}trackVideoCompletion(e){this.track("VideoCompletion",{...this.eventProperties,local_time:l(),aggregations:{VideoEngagement:e}})}updateTrackerState(e){this.trackerState=e}registerEngagementInterval(e){return(0,s.UM)((()=>{this.trackVideoEngagement(e)}),1e3*e)}sanitisePosition(e,t){return(0,r.zG)(e,i.ij,i.EQ(t,(e=>"number"!=typeof e||Number.isNaN(e)?t():Math.max(e,0))))}calculateCurrentPosition(){return Date.now()-this.resumedState.resumedTimestamp+this.resumedState.resumedPosition}updateResumedState(e){this.resumedState={...this.resumedState,...e}}updatePausedState(e){this.pausedState={...this.pausedState,...e}}updateCommonPlayBackState(e){const t=e.accumulatedEngagementTime?e.accumulatedEngagementTime+this.commonPlaybackState.accumulatedEngagementTime??0:this.commonPlaybackState.accumulatedEngagementTime??0;this.commonPlaybackState={...this.commonPlaybackState,...e,accumulatedEngagementTime:t}}calculateAccumulatedEngagementTime(){return this.pausedState.pausedTimestamp-this.resumedState.resumedTimestamp}calculateMaximumViewedPosition(e){return Math.max(e,this.commonPlaybackState.maximumViewedPosition??0)}calculateTotalEngagedTime(){return Date.now()-this.resumedState.resumedTimestamp+this.commonPlaybackState.accumulatedEngagementTime}calculatePercentageViewed(e){if(0===this.commonPlaybackState.totalVideoDuration)return 0;const t=e/this.commonPlaybackState.totalVideoDuration;return t>1||t<0?0:t}updateClientContext(e){const t=(0,a.qh)(e);this.options.clientContext.updateContext(...t)}logDebug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.options.logger.debug("[ctv]",...t)}sanitiseOrPassThroughInput(e){const t=e=>(0,r.ls)(i.DT(e),i.pF(r.r5)),n=t(a.jn),o=t(a.HD),s=t(a.BJ),c=t((e=>Array.isArray(e)&&e.every(a.HD))),u=(0,r.ls)(i.DT(a.Kn),i.UI((0,a.rO)({age_rating:o,audio_language:o,consecutive_episodes:s,content_type:c,country:o,episode_number:s,genre:c,iab_categories:c,original_language:o,runtime:s,season_number:s,subtitles:(0,r.ls)(i.DT(a.Kn),i.UI((0,a.rO)({enabled:n,language:o})),i.pF(r.r5)),title:o})),i.fS((()=>({}))));return(0,r.zG)(e,(0,a.rO)({client:(0,r.ls)(i.DT(a.Kn),i.fS((()=>({})))),duration:(0,r.ls)(i.DT(a.BJ),i.pF((()=>this.DEFAULT_DURATION))),videoProperties:u}),(0,a.bw)((t=>this.logDebug("validated input",{original:e,validated:t}))))}}(e)}},2097:(e,t,n)=>{n.r(t),n.d(t,{FreeWheelAddon:()=>p,freewheelService:()=>u,load:()=>g,realService:()=>d,stubService:()=>l});var r=n(9853),i=n(2851),o=n(3735),a=n(3328),s=n(2116),c=n(4011);const u=d;function l(e){let{externalData:t}=e;return s.K4((()=>{t.removeExternalData(m)}))}function d(e){const{activationManager:t,consent:n,externalData:r,initdAddons:u,queryLanguageCohorts:l,addonsLoaded:d}=e;return(0,o.zG)(i.vP({consent:n,addonsLoaded:d,addonInitd:i.UI((e=>e.has(f)),u)}),s.KD([[e=>{let{consent:t,addonsLoaded:n,addonInitd:r}=e;return!t||n&&!r},s.K4((()=>r.removeExternalData(m)))],[e=>{let{addonsLoaded:t,addonInitd:n}=e;return!t&&!n},s.K4(o.Q1)],s.K4((e=>{let{stopped:n}=e;const s=t.getSpecializedActivations(f),u=new Set([...s]);(0,o.zG)(l,i.UI(a.hX((e=>u.has(e)))),i.D8(a.Eh(c.Eq)),i.UI(a.UI((e=>e.toString()))),(e=>i.vP(e,n)),i.YP((e=>{let[t,n]=e;n||r.setExternalJsonData(m,t)})))}))]),s.UI(o.Q1))}const f="freewheel",g=e=>{(0,r.Hn)(f)("auto_init",!1)&&e.q.push({functionName:"addon",arguments:[f,{}]})};class p{constructor(e){}}const m="_pfws"},122:(e,t,n)=>{n.d(t,{X:()=>r});const r=e=>{let t=!0;const n=[];return{addBlocker:r=>{n.push(r),e.logger.log("<blockers> added blocker "+r),e.messages.on(r,(()=>{if(t){const i=n.indexOf(r);i>=0&&(n.splice(i,1),e.logger.log("<blockers> removed blocker "+r)),0===n.length&&(t=!1,e.messages.emit("permutive:blockers:empty"),e.logger.log("<blockers> complete"))}}))}}}},7748:(e,t,n)=>{n.d(t,{X:()=>i});var r=n(2851);class i{ref;setCustomProps;constructor(){const[e,t]=r.Ue({});this.ref=e,this.setCustomProps=t}getCustomProps(){return this.ref.current}}},5717:(e,t,n)=>{n.r(t),n.d(t,{EventsCache:()=>y,RESET_HISTORICAL:()=>h});var r=n(2688),i=n(1828),o=n(3328),a=n(365),s=n(3735),c=n(2884),u=n(7407),l=n(2707),d=n(7548),f=n(2652),g=n(4730);class p extends Error{constructor(e){super(e),this.name="StoreClosingError"}}const m="permutive-events-cache",v="permutive-events-for-page",h="historical",_="[EVENTSCACHE]",b=e=>"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name;class y{config;logger;reportError;trace;metrics;userId;makeEventsStore;eventStore;eventsCache=this.makeEventsRepository(m);eventsForPage=this.makeEventsRepository(v);eventsTTLInMilliseconds;readiness;debouncedReportError=(()=>new g.b(5e3,5e3).schedule((e=>this.reportError(e.errorMessage,{userId:e.userId}))))();static initialise(e,t,n,r,i,o,a){return(0,s.zG)(a(),l.UI((s=>new y(e,t,n,r,i,o,a,s))))}constructor(e,t,n,r,i,o,a,l){this.config=e,this.logger=t,this.reportError=n,this.trace=r,this.metrics=i,this.userId=o,this.makeEventsStore=a,this.eventStore=l,this.eventsTTLInMilliseconds=(0,s.zG)((0,c.ij)(this.config.eventsTTLInDays),(0,c.tS)((e=>"number"==typeof e&&e>0?(0,c.G)(24*e*3600):c.YP))),this.eventsCache.events=(0,f.HP)((()=>(0,f.PQ)((0,s.zG)(u.tD((()=>this.trace.startSpan("load_event_cache"))),u.tS((e=>(0,s.zG)(this.loadFromDisk(),u.At((t=>()=>{e.finish(),this.logDebug(`Event cache loaded, #e ${t.length}`)}))))))))),this.readiness=this.eventsCache.events().then((()=>this.migratePreviousPagesEvents())),o.onChange((()=>this.reset()))}async migratePreviousPagesEvents(){const e=this.trace.startSpan("migrate_previous_for_page_events"),t=(0,u.pE)((e=>(0,l.Y3)((()=>e.flush()),r.w)));return(0,s.zG)([this.eventsForPage,this.eventsCache],t,(0,u.UI)((t=>{const n=o.bj(t);return n.length>0&&this.reportError(`Migrate previous events failed. Got:\n${n.join("\n ")}`,{userId:this.userId.current}),e.finish()})),(e=>e()))}all(){return Promise.all([this.eventsCache.events(),this.eventsForPage.events()]).then(o.xH)}async add(e,t){let{persistOnDisk:n}=t;return this.logDebug("Adding to cache",e),this.eventsForPage.events=(0,s.zG)(this.eventsForPage.events,u.UI((t=>[...t,e])),f.HP),n&&this.readiness.then((()=>this.eventsForPage.flush())),e}filterEventsByWorkspace(e){return e}pruneEventsToSizeLimit(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.config.eventsCacheLimitBytes;if(n<=0||t<=n)return this.logDebug(`Event size of ${t} less than limit of ${n}`),{events:e,sizeInBytes:t};this.logDebug("Events before pruning",{count:e.length,sizeInBytes:t,byteLimit:n});let r=1,i=[...e];for(;t>n;)i.splice(0,r),r*=2,t=2*JSON.stringify(i).length;return this.logDebug("Events after pruning",{count:i.length,sizeInBytes:t}),{events:i,sizeInBytes:t}}loadFromDisk(){const e=()=>[],t=(0,s.zG)(this.eventsTTLInMilliseconds,c.EQ((()=>s.yR),(e=>o.hX((t=>e>Date.now()-t.time.getTime())))));return(0,s.zG)(u.tD((()=>(this.logLog("Loading event cache..."),this.metrics.startTimer("sdk_load_events_cache_task_duration_seconds",{})))),u.YO("loadEventsCacheTask"),u.ak("eventsFromDisk",(()=>(0,s.zG)(o.nI([this.eventStore.get(m),this.eventStore.get(v)]),o.UI(l.LV((0,f.lo)([[e=>e instanceof p,(0,s.ls)(e,u.of)],t=>(0,s.zG)(u.tD((()=>this.reportError(`Error fetching data from store. Got ${t}`,{userId:this.userId.current}))),u.tS((()=>()=>this.reset("historical"))),u.UI(e))]),(0,s.ls)(c.fS(e),u.of))),o.vP(u.qA)))),u.At((e=>{let{eventsFromDisk:t,loadEventsCacheTask:n}=e;return()=>{this.logDebug("Read events from store:",t),this.metrics.stopTimer("sdk_load_events_cache_task_duration_seconds",n)}})),u.UI((0,s.ls)((0,f.vg)("eventsFromDisk"),o.xH,this.filterEventsByWorkspace,(e=>this.pruneEventsToSizeLimit(e,2*JSON.stringify(e).length)),(e=>(this.eventsCache.sizeInBytes=e.sizeInBytes,this.eventsCache.sizeInBytesLastSuccessfulWrite=e.sizeInBytes,e.events.length>0&&(this.metrics.track({name:"sdk_events_cache_byte_total",value:e.sizeInBytes,labels:{}}),this.metrics.track({name:"sdk_events_cache_size_total",value:e.events.length,labels:{}})),e.events)),o.UI(d.k),t)))}async reset(e){return(0,s.zG)(u.tD((()=>this.logDebug("Resetting Events Cache"))),u.tS((()=>this.eventStore.deleteStore())),l.tS((()=>this.makeEventsStore())),l.Zl((t=>(this.eventStore=t,e===h?i.gz(l.Ij)(this.eventsCache.reset,this.eventsForPage.flush):i.gz(l.Ij)(this.eventsCache.reset,this.eventsForPage.reset)))),l.wE((()=>()=>this.all())),l.fS((()=>u.of(w()))),(e=>e()))}getStateSizeInBytes(){return this.eventsForPage.sizeInBytes+this.eventsCache.sizeInBytes}makeEventsRepository(e){const t=(()=>{let e=Promise.resolve(a.F2((0,s.Q1)()));return t=>e=e.then(t)})(),n=e=>(0,s.zG)(u.tD((()=>this.logDebug(`Writing ${e.length} events to ${h.key}`))),u.tS((()=>this.eventStore.put(e.map(d.X),h.key))),l.UI(s.Q1)),i=(0,s.zG)(u.tD((()=>this.logDebug(`Deleting events for ${h.key}`))),u.tS((()=>this.eventStore.delete(h.key))),l.Vn(r.w)),o=(0,s.ls)(u.of,u.At((e=>()=>this.logError(`Events cache failed to put ${h.key}. Got ${e}`))),u.tS((0,f.lo)([[e=>b(e)&&h.retryAttempts<9,()=>(0,s.zG)(u.tD((()=>{h.retryAttempts+=1,this.logDebug(`Attempt #${h.retryAttempts} to write ${h.key} to EventsStore`)})),u.tS((()=>v)),u.tS((()=>g)))],[e=>b(e),e=>(0,s.zG)(u.tD((()=>this.logDebug(`Attempted ${h.retryAttempts} rewrite attempts and reached limit of 9 max writes.`,"Reporting QuotaExceededError to API"))),u.tS((()=>()=>this.debouncedReportError({errorMessage:`Events cache failed to put ${h.key}. Got ${e}`,userId:this.userId.current}))),u.tS((()=>l.t$(e))))],l.t$]))),c=e=>l.tD((()=>{this.logDebug(`Successfully wrote events for ${h.key} after ${h.retryAttempts} attempts`),h.retryAttempts=0,h.sizeInBytes=2*JSON.stringify(e).length,h.sizeInBytesLastSuccessfulWrite=h.sizeInBytes})),g=(0,s.zG)((()=>h.events()),u.tS((e=>(0,s.zG)(n(e),u.mU(a.EQ(o,(()=>c(e)))))))),p=(e,t)=>(0,s.zG)(e.events,u.UI((n=>{const r=2*JSON.stringify(n).length,i=this.pruneEventsToSizeLimit(n,r,t);return e.events=u.of(i.events),e.sizeInBytes=i.sizeInBytes,t-e.sizeInBytes}))),m=(e,t)=>{let[n,...r]=e;return n&&0!==t?(0,s.zG)(p(n,t),u.tS((e=>(this.logDebug(`${e} left after pruning ${n.key}`),m(r,e))))):u.of((0,s.Q1)())},v=(0,s.zG)(l.tD((()=>this.eventsForPage.sizeInBytes-this.eventsForPage.sizeInBytesLastSuccessfulWrite)),l.fX(a.DT((e=>e>0),(e=>new Error(`${this.eventsForPage.key} failed to write the same or smaller events cache of size ${e}`)))),l.tS((e=>{const t=1.2*e,n=[this.eventsCache,this.eventsForPage];return this.logDebug(`Pruning ${t} bytes from`,n),(0,s.zG)(m(n,t),l.fF)}))),h={key:e,events:u.of([]),sizeInBytes:0,sizeInBytesLastSuccessfulWrite:0,retryAttempts:0,flush:()=>(0,s.zG)(u.tD((()=>this.trace.startSpan(`write_${h.key}`))),u.tS((e=>(0,s.zG)(g,u.At((()=>()=>e.finish()))))),t),reset:()=>(0,s.zG)(u.tD((()=>{h.events=u.of([]),h.sizeInBytes=0,h.sizeInBytesLastSuccessfulWrite=0})),u.tS((()=>i)),t)};return h}logDebug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.debug(_,...t)}logWarn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.warn(_,...t)}logError(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.error(_,...t)}logLog(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.log(_,...t)}}const w=()=>[]},9381:(e,t,n)=>{n.r(t),n.d(t,{DBStore:()=>a});var r=n(2688),i=n(2884),o=n(2707);class a{db;constructor(e){this.db=Promise.resolve(e)}put(e,t){return(0,o.Y3)((()=>this.db.then((n=>n.put(e,t)))),r.w)}get(e){return(0,o.Y3)((()=>this.db.then((t=>t.get(e))).then(i.ij)),r.w)}delete(e){return(0,o.Y3)((()=>this.db.then((t=>t.delete(e)))),(e=>String(e)))}deleteStore(){return(0,o.Y3)((()=>this.db.then((e=>e.deleteStore()))),(e=>String(e)))}}},6197:(e,t,n)=>{n(2652)},6272:(e,t,n)=>{n(3992)},7476:(e,t,n)=>{n.r(t),n.d(t,{eventCacheService:()=>d,eventNameBlacklist:()=>g});var r=n(2851),i=n(2116),o=n(6392),a=n(3735),s=n(3328),c=n(2652),u=n(8377),l=n(7548);const d=e=>i.dQ((0,a.ls)((e=>{let{previousState:t}=e;return function(e){if(e&&"object"==typeof e)return{previousUnloadEvents:"previousUnloadEvents"in e?f(e.previousUnloadEvents):[]};return{previousUnloadEvents:[]}}(t)}),(t=>{let{previousUnloadEvents:n}=t;n.forEach((t=>e.eventsCache.add((0,l.k)(t),{persistOnDisk:!0})));return{value:{newEvents:(0,a.zG)(e.newEvents,r.UI(o.UI((0,c.bw)(s.UI((t=>{let[,n]=t;g.has(n.name)||e.eventsCache.add(n,{persistOnDisk:!0})})))))),priorEvents:()=>e.eventsCache.all()},state:(0,a.zG)(e.eventsToProcessOnPageUnload,r.UI(s.hX((e=>{let[,t]=e;return!g.has(t.name)}))),r.UI(s.UI((0,a.ls)(u.Yg,l.X))),r.UI((e=>({previousUnloadEvents:e}))))}})));function f(e){return e&&Array.isArray(e)?e:[]}const g=new Set(["AdRequest","PageviewEngagement","PrebidAuctions","Reaction","SegmentEntry","SegmentExit","SlotRendered","ThirdPartySegments","VideoEngagement"])},926:(e,t,n)=>{n.d(t,{Kd:()=>i,eJ:()=>o});n(9853);var r=n(2116);n(2851),n(2652);const i="addon:twitter_pixel",o=function(e){return r.K4((()=>{}))}},1828:(e,t,n)=>{n.d(t,{Qt:()=>a,Yt:()=>d,ap:()=>o,gz:()=>l});var r=n(3735),i=n(9384);function o(e,t){return function(n){return function(r){return e.ap(e.map(r,(function(e){return function(n){return t.ap(e,n)}})),n)}}}function a(e){return function(t,n){return function(r){return e.ap(e.map(r,(function(e){return function(n){var r;return Object.assign({},e,((r={})[t]=n,r))}})),n)}}}function s(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,0===t?e.apply(null,i):s(e,t-1,i)}}var c={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function u(e){return i.e$.call(c,e)||(c[e]=s(r.bc,e-1,[])),c[e]}function l(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=u(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function d(e){return function(t){for(var n=Object.keys(t),r=n.length,i=function(e){var t=e.length;switch(t){case 1:return function(t){var n;return(n={})[e[0]]=t,n};case 2:return function(t){return function(n){var r;return(r={})[e[0]]=t,r[e[1]]=n,r}};case 3:return function(t){return function(n){return function(r){var i;return(i={})[e[0]]=t,i[e[1]]=n,i[e[2]]=r,i}}};case 4:return function(t){return function(n){return function(r){return function(i){var o;return(o={})[e[0]]=t,o[e[1]]=n,o[e[2]]=r,o[e[3]]=i,o}}}};case 5:return function(t){return function(n){return function(r){return function(i){return function(o){var a;return(a={})[e[0]]=t,a[e[1]]=n,a[e[2]]=r,a[e[3]]=i,a[e[4]]=o,a}}}}};default:return s((function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i}),t-1,[])}}(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}},5851:(e,t,n)=>{n.d(t,{oA:()=>y,t9:()=>g,DZ:()=>b,Ew:()=>u,f2:()=>l,xH:()=>h,jV:()=>p,uK:()=>w,tV:()=>S,u4:()=>k,DY:()=>f});var r=n(3735),i=(n(7341),n(9384)),o=n(7241);i.r1;var a=function(e){return[e]};o.xP,o.Lx,o.u4,o.OE,o.nq,o.iw,o.YM,o.ZN,o.Eh,i.F4,o.YM,o.Z$,o.VV,o.Fp,o.j0;o.ur;var s=n(3328),c=n(4870);n(5605);s.P5,s.YM,s.Z$;s.cx;function u(e){return s.Ew(e)}var l=s.f2;s.JO,s.qr;var d=function(e){return e.slice()},f=function(e){return function(t){return t.length<=1?d(t):t.slice().sort(e.compare)}};var g=s.t9;function p(e){var t=g(e);return function(n,r){if(void 0===r){var i=p(e);return function(e){return i(e,n)}}return n.filter((function(e){return t(e,r)}))}}s.kp,s.Eq;var m=a,v=function(e){return function(t){return(0,r.zG)(t,function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}}((function(t,n){return e(n)})))}},h=v(r.yR),_=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var o=e(r,t[r]);i.pC(o)&&n.push(o.value)}return n}},b=function(e){return _((function(t,n){return e(n)}))},y=b(r.yR),w=function(e){return E((function(t,n){return e(n)}))},E=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return(0,c.s4)(n,r)}},S=function(e){return I((function(t,n){return e(n)}))},I=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);"Left"===o._tag?n.push(o.left):r.push(o.right)}return(0,c.s4)(n,r)}},k=(s.Lx,s.xP,s.u4);s.OE,s.nq,s.iw,s.ZN,s.Eh,s.pR,s.pJ,s.oR,s.yW,s.j0,i.F4},6862:(e,t,n)=>{function r(e){return function(t){return function(n){return e.chain(n,(function(n){return e.map(t(n),(function(){return n}))}))}}}function i(e){return function(t,n){return function(r){return e.chain(r,(function(r){return e.map(n(r),(function(e){var n;return Object.assign({},r,((n={})[t]=e,n))}))}))}}}n.d(t,{a:()=>i,m:()=>r})},365:(e,t,n)=>{n.d(t,{G5:()=>h,dO:()=>p,Pd:()=>w,ak:()=>A,tS:()=>b,Y$:()=>C,g_:()=>D,ij:()=>O,DT:()=>I,fS:()=>T,pF:()=>z,nM:()=>k,t$:()=>s,UI:()=>g,Vn:()=>E,EQ:()=>G,F2:()=>c,LF:()=>q,KC:()=>R,i$:()=>M,Y3:()=>x});var r=n(6862),i=n(2690),o=n(3735),a=(n(7341),n(9384)),s=a.t$,c=a.F2,u=function(e,t){return(0,o.zG)(e,g(t))},l=function(e,t){return(0,o.zG)(e,v(t))},d=function(e,t){return(0,o.zG)(e,b(t))},f="Either",g=function(e){return function(t){return k(t)?t:c(e(t.right))}},p={URI:f,map:u},m=c,v=function(e){return function(t){return k(t)?t:k(e)?e:c(t.right(e.right))}},h={URI:f,map:u,ap:l},_=function(e){return function(t){return k(t)?t:e(t.right)}},b=_,y={URI:f,map:u,ap:l,chain:d},w=function(e,t){return function(n){return k(n)?s(e(n.left)):c(t(n.right))}},E=function(e){return function(t){return k(t)?s(e(t.left)):t}},S={URI:f,fromEither:o.yR},I=(0,i.DT)(S),k=a.nM,P=(a.tO,function(e,t){return function(n){return k(n)?e(n.left):t(n.right)}}),U=P,G=P,D=G,z=function(e){return function(t){return k(t)?e(t.left):t.right}},T=z,C=(0,i.Y$)(S,y),q=function(e){return k(e)?c(e.left):s(e.right)},O=function(e){return function(t){return null==t?s(e):c(t)}},x=function(e,t){try{return c(e())}catch(e){return s(t(e))}},M=U(o.yR,o.yR);function R(e){return e instanceof Error?e:new Error(String(e))}a.F4;var A=(0,r.a)(y);a.Xl},4268:(e,t,n)=>{n.d(t,{f7:()=>r,n_:()=>i,w4:()=>o});n(3735);var r=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},i=function(e){return r((function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0}))},o={equals:function(e,t){return e===t}};o.equals},2690:(e,t,n)=>{n.d(t,{DT:()=>o,Y$:()=>c,fX:()=>s});var r=n(3735),i=n(9384);function o(e){return function(t,n){return function(r){return e.fromEither(t(r)?i.F2(r):i.t$(n(r)))}}}function a(e){return function(t){return(0,r.ls)(t,e.fromEither)}}function s(e,t){var n=a(e);return function(e){return function(r){return t.chain(r,n(e))}}}function c(e,t){return function(n,r){return function(o){return t.chain(o,(function(t){return e.fromEither(n(t)?i.F2(t):i.t$(r(t)))}))}}}},7341:(e,t,n)=>{function r(e,t){return function(n){return function(r){return e.map(r,(function(e){return t.map(e,n)}))}}}function i(e){return function(t){return function(n){return e.map(n,(function(e){var n;return(n={})[t]=e,n}))}}}function o(e){return function(t,n){return function(r){return e.map(r,(function(e){var r;return Object.assign({},e,((r={})[t]=n(e),r))}))}}}n.d(t,{Hr:()=>o,UI:()=>r,YO:()=>i})},6392:(e,t,n)=>{n.d(t,{G5:()=>l,RD:()=>p,UI:()=>s,of:()=>c});var r=n(3735),i=(n(7341),n(9384)),o=function(e,t){return function(){return t(e())}},a=function(e,t){return function(){return e()(t())}},s=function(e){return function(t){return o(t,e)}},c=r.a9,u="IO",l={URI:u,map:o,ap:a},d=(r.yR,r.yR,i.F4,c(i.Xl)),f=function(e){var t=function(e){return function(t){return function(){for(var n=[e(0,i.YM(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}}(e);return function(e){return i.Od(e)?t(e):d}},g=function(e){return f((function(t,n){return e(n)}))},p=g(r.yR)},2884:(e,t,n)=>{n.d(t,{G5:()=>U,Ri:()=>M,xu:()=>$,dO:()=>I,wp:()=>z,tS:()=>G,mU:()=>J,hX:()=>R,DZ:()=>A,xH:()=>V,g_:()=>Q,Uo:()=>B,ij:()=>Z,KQ:()=>ee,DT:()=>d,Eh:()=>E,IS:()=>f,fS:()=>H,pF:()=>W,EK:()=>g,lo:()=>C,Wi:()=>Y,pC:()=>N,UI:()=>S,EQ:()=>j,aD:()=>K,YP:()=>u,of:()=>k,RD:()=>ie,G:()=>l,FS:()=>te,Y3:()=>X,bM:()=>T});var r=n(6862),i=n(3735),o=(n(7341),n(9384)),a=n(6017),s=n(4870);n(5605);function c(e,t){return function(n){return n?t.of(void 0):e.zero()}}var u=o.YP,l=o.G;function d(e){return function(t){return e(t)?l(t):u}}var f=function(e){return"Right"===e._tag?u:l(e.left)},g=function(e){return"Left"===e._tag?u:l(e.right)},p=function(e,t){return(0,i.zG)(e,S(t))},m=function(e,t){return(0,i.zG)(e,P(t))},v=function(e,t){return(0,i.zG)(e,G(t))},h=function(e,t){return(0,i.zG)(e,R(t))},_=function(e,t){return(0,i.zG)(e,A(t))},b=function(e,t){return(0,i.zG)(e,L(t))},y=function(e,t){return(0,i.zG)(e,F(t))},w="Option",E=function(e){return{equals:function(t,n){return t===n||(Y(t)?Y(n):!Y(n)&&e.equals(t.value,n.value))}}},S=function(e){return function(t){return Y(t)?u:l(e(t.value))}},I={URI:w,map:p},k=l,P=function(e){return function(t){return Y(t)||Y(e)?u:l(t.value(e.value))}},U={URI:w,map:p,ap:m},G=function(e){return function(t){return Y(t)?u:e(t.value)}},D={URI:w,map:p,ap:m,chain:v},z=function(e){return function(t){return Y(t)?e():t}},T=function(){return u},C=c({URI:w,zero:T},{URI:w,of:k}),q=G(i.yR),O=(0,s.s4)(u,u),x=function(e){return Y(e)?O:(0,s.s4)(f(e.value),g(e.value))},M={URI:w,compact:q,separate:x},R=function(e){return function(t){return Y(t)?u:e(t.value)?t:u}},A=function(e){return function(t){return Y(t)?u:e(t.value)}},L=function(e){return function(t){return(0,s.s4)(h(t,(0,a.ff)(e)),h(t,e))}},F=function(e){return(0,i.ls)(S(e),x)},$={URI:w,map:p,compact:q,separate:x,filter:h,filterMap:_,partition:b,partitionMap:y},B=g,N=o.pC,Y=function(e){return"None"===e._tag},K=function(e,t){return function(n){return Y(n)?e():t(n.value)}},j=K,Q=j,W=function(e){return function(t){return Y(t)?e():t.value}},H=W,V=q,J=(0,r.m)(D),Z=function(e){return null==e?u:l(e)},X=function(e){try{return l(e())}catch(e){return u}},ee=function(e){return(0,i.ls)(e,Z)},te=j(i.r5,i.yR);o.F4;var ne=k(o.Xl),re=function(e){var t=function(e){return function(t){var n=e(0,o.YM(t));if(Y(n))return u;for(var r=[n.value],i=1;i<t.length;i++){var a=e(i,t[i]);if(Y(a))return u;r.push(a.value)}return l(r)}}(e);return function(e){return o.Od(e)?t(e):ne}},ie=function(e){return re((function(t,n){return e(n)}))}(i.yR)},7209:(e,t,n)=>{n.d(t,{Fp:()=>c,VV:()=>s,Zt:()=>a,uZ:()=>u});var r=n(4268),i=n(3735),o=function(e){return function(t,n){return t===n||0===e(t,n)}},a=function(e){return{equals:o(e),compare:function(t,n){return t===n?0:e(t,n)}}},s=(i.W8,function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}}),c=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},u=function(e){var t=s(e),n=c(e);return function(e,r){return function(i){return n(t(i,r),e)}}};r.w4.equals},6017:(e,t,n)=>{n.d(t,{ff:()=>r});n(3735);var r=function(e){return function(t){return!e(t)}}},3328:(e,t,n)=>{n.d(t,{$R:()=>U,DZ:()=>N,EQ:()=>m,Eh:()=>ne,Eq:()=>q,Ew:()=>w,G:()=>le,Hr:()=>ge,JO:()=>S,Lx:()=>W,OE:()=>H,Od:()=>g,P5:()=>h,Su:()=>L,UI:()=>A,YM:()=>_,YO:()=>fe,Z$:()=>b,ZN:()=>ee,bM:()=>x,bj:()=>P,cS:()=>ce,cx:()=>y,f2:()=>E,hX:()=>$,hp:()=>k,iw:()=>J,j0:()=>de,kp:()=>C,nI:()=>se,nq:()=>V,oR:()=>ae,of:()=>O,oh:()=>F,pJ:()=>oe,pR:()=>re,qr:()=>I,t9:()=>G,tS:()=>M,u4:()=>Q,uK:()=>Y,uZ:()=>te,vP:()=>Z,xH:()=>R,xP:()=>j,xb:()=>f,yW:()=>ue,zo:()=>D});var r=n(4268),i=n(3735),o=n(7341),a=n(9384),s=n(4011),c=n(7209),u=n(7241),l=n(4870),d=(n(5605),function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}),f=function(e){return 0===e.length},g=u.Od,p=(u.Ce,u.ws,u.R3);u.Im;var m=function(e,t){return function(n){return g(n)?t(n):e()}},v=u.dC;function h(e,t){return void 0===t?function(t){return h(e,t)}:v(e,t)?a.YP:a.G(t[e])}var _=function(e){return g(e)?a.G(u.YM(e)):a.YP},b=function(e){return g(e)?a.G(u.Z$(e)):a.YP};var y=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return a.G(n);return a.YP}};function w(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return a.G(t[n]);return a.YP}}var E=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(a.pC(r))return r}return a.YP}};var S=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(a.pC(r))return r}return a.YP}},I=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return a.G(n);return a.YP}},k=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];"Right"===r._tag&&t.push(r.right)}return t},P=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];"Left"===r._tag&&t.push(r.left)}return t};function U(e,t){return void 0===t?function(t){return U(t,e)}:function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r}(e,t,(function(e,t){return[e,t]}))}function G(e){return function(t,n){if(void 0===n){var r=G(e);return function(e){return r(t,e)}}for(var i,o=0;o<n.length;o++)if(i=n[o],e.equals(i,t))return!0;return!1}}var D=function(e){return function(t){return f(t)?e:f(e)?t:t.concat(e)}};var z=function(e,t){return(0,i.zG)(e,A(t))},T=function(e,t,n){return(0,i.zG)(e,Q(t,n))},C=function(e,t){return(0,i.zG)(e,oe(t))},q=function(e,t){return(0,i.zG)(e,ae(t))},O=u.of,x=function(){return ce},M=function(e){return function(t){return(0,i.zG)(t,function(e){return function(t){if(f(t))return ce;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}}((function(t,n){return e(n)})))}},R=M(i.yR),A=function(e){return function(t){return t.map((function(t){return e(t)}))}},L=function(e){return function(t){return t.map((function(t,n){return e(n,t)}))}},F=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];"Left"===o._tag?t.push(o.left):n.push(o.right)}return(0,l.s4)(t,n)},$=function(e){return function(t){return t.filter(e)}},B=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);a.pC(i)&&n.push(i.value)}return n}},N=function(e){return B((function(t,n){return e(n)}))},Y=(i.yR,function(e){return K((function(t,n){return e(n)}))}),K=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return(0,l.s4)(n,r)}},j=function(e){return function(t){return function(n){return n.reduce((function(n,r,i){return e.concat(n,t(i,r))}),e.empty)}}},Q=function(e,t){return H(e,(function(e,n,r){return t(n,r)}))},W=function(e){var t=j(e);return function(e){return t((function(t,n){return e(n)}))}},H=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},V=function(e,t){return J(e,(function(e,n,r){return t(n,r)}))},J=function(e,t){return function(n){return n.reduceRight((function(e,n,r){return t(r,n,e)}),e)}},Z=function(e){return function(t){return T(t,e.of(x()),(function(t,n){return e.ap(e.map(t,(function(e){return function(t){return(0,i.zG)(e,p(t))}})),n)}))}},X="ReadonlyArray",ee=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},te=function(){return{concat:function(e,t){return f(e)?t:f(t)?e:e.concat(t)},empty:ce}},ne=function(e){return(0,r.f7)((function(t,n){return t.length===n.length&&t.every((function(t,r){return e.equals(t,n[r])}))}))},re=function(e){return(0,c.Zt)((function(t,n){for(var r=t.length,i=n.length,o=Math.min(r,i),a=0;a<o;a++){var c=e.compare(t[a],n[a]);if(0!==c)return c}return s.Df.compare(r,i)}))},ie={URI:X,map:z},oe=function(e){return function(t){for(var n=d([],e(t),!0),r=[];n.length>0;){var i=n.shift();a.nM(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},ae=function(e){return function(t){var n=e(t),r=[],i=[];function o(t){a.nM(t)?e(t.left).forEach((function(e){return r.push(e)})):i.push(t.right)}for(var s=0,c=n;s<c.length;s++){o(c[s])}for(;r.length>0;)o(r.shift());return i}},se=(u.oo,function(e){return f(e)?ce:e.slice()}),ce=u.cS;function ue(e){return function(t){return t.every(e)}}var le=function(e){return function(t){return t.some(e)}},de=function(e){var t=u.j0(e);return function(n){return m((function(){return e.empty}),t(n))}},fe=(a.F4,(0,o.YO)(ie)),ge=(0,o.Hr)(ie);u.w6,u.QI,u.Ss},7241:(e,t,n)=>{n.d(t,{R3:()=>h,Im:()=>v,ur:()=>B,QI:()=>Y,cS:()=>d,Lx:()=>D,xP:()=>C,c2:()=>b,Eh:()=>M,ZN:()=>x,vM:()=>S,YM:()=>R,j0:()=>N,Od:()=>f,dC:()=>g,Z$:()=>L,UI:()=>P,Fp:()=>$,VV:()=>F,of:()=>k,Ce:()=>m,ws:()=>p,w6:()=>w,u4:()=>G,nq:()=>z,iw:()=>q,OE:()=>T,Ss:()=>K,oo:()=>_});var r,i=n(4268),o=n(3735),a=(n(7341),n(9384)),s=n(7209),c=function(e){return{concat:s.VV(e)}},u=function(e){return{concat:s.Fp(e)}};r=void 0;var l=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},d=a.Xl,f=a.Od,g=function(e,t){return e<0||e>=t.length},p=function(e){return function(t){return l([e],t,!0)}},m=p,v=function(e){return function(t){return l(l([],t,!0),[e],!1)}},h=v,_=function(e,t,n){if(f(n)){var r=a.r1(n);return r.splice(e,0,t),r}return[t]},b=function(e){return f(e)?a.G(e):a.YP},y=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},w=function(e,t){return e<=t?y((function(t){return e+t}))(t-e+1):[e]};function E(e,t){return t?e.concat(t):function(t){return t.concat(e)}}var S=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],s=e(o);a.e$.call(n,s)?n[s].push(o):n[s]=[o]}return n}};var I=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},k=a.ri,P=function(e){return U((function(t,n){return e(n)}))},U=function(e){return function(t){for(var n=[e(0,R(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},G=function(e,t){return T(e,(function(e,n,r){return t(n,r)}))},D=function(e){return function(t){return function(n){return n.slice(1).reduce((function(n,r){return e.concat(n,t(r))}),t(n[0]))}}},z=function(e,t){return q(e,(function(e,n,r){return t(n,r)}))},T=function(e,t){return function(n){return n.reduce((function(e,n,r){return t(r,e,n)}),e)}},C=function(e){return function(t){return function(n){return n.slice(1).reduce((function(n,r,i){return e.concat(n,t(i+1,r))}),t(0,n[0]))}}},q=function(e,t){return function(n){return n.reduceRight((function(e,n,r){return t(r,n,e)}),e)}},O=a.YM,x=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},M=function(e){return(0,i.f7)((function(t,n){return t.length===n.length&&t.every((function(t,r){return e.equals(t,n[r])}))}))},R=(a.F4,O),A=a.Gb,L=function(e){return e[e.length-1]},F=function(e){var t=c(e);return function(e){return e.reduce(t.concat)}},$=function(e){var t=u(e);return function(e){return e.reduce(t.concat)}},B=function(e){return function(t){return t.reduce(e.concat)}},N=function(e){var t=B(e);return function(e){return(0,o.ls)(function(e){return function(t){var n=A(t);return f(n)?(0,o.zG)(n,I(e),m(R(t))):t}}(e),t)}};function Y(e,t){return void 0===t?m(e):(0,o.zG)(t,m(e))}var K=function(e,t){return(0,o.zG)(e,E([t]))}},4923:(e,t,n)=>{n.d(t,{Bu:()=>m,CC:()=>M,DZ:()=>X,EG:()=>p,EW:()=>N,Eh:()=>ce,G:()=>T,HA:()=>q,Hd:()=>P,I8:()=>A,P5:()=>v,RF:()=>R,RJ:()=>F,SW:()=>K,Su:()=>_,UI:()=>b,Ub:()=>Q,V_:()=>B,XP:()=>d,_Y:()=>$,_r:()=>k,dp:()=>c,dx:()=>f,e$:()=>g,hX:()=>Z,jt:()=>U,kp:()=>x,mK:()=>V,mS:()=>L,nn:()=>O,nr:()=>le,nu:()=>Y,oA:()=>oe,oh:()=>ae,qS:()=>H,ri:()=>S,sq:()=>D,t9:()=>C,tV:()=>te,uK:()=>ee,uZ:()=>ue,vA:()=>W,vP:()=>I,xb:()=>u,yW:()=>z,z7:()=>G,zV:()=>j});var r=n(4268),i=n(3735),o=n(9384),a=n(4870),s=n(2751),c=(n(5605),function(e){return Object.keys(e).length}),u=function(e){for(var t in e)if(o.e$.call(e,t))return!1;return!0},l=function(e){return function(t){return Object.keys(t).sort(e.compare)}},d=l(s.Df);var f=function(e,t){return function(n){if(o.e$.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},g=function(e,t){return o.e$.call(t,e)};function p(e){return function(t){if(!o.e$.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}function m(e){return function(t,n){if(void 0===n){var r=m(e);return function(e){return r(e,t)}}for(var i in t)if(!o.e$.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function v(e,t){return void 0===t?function(t){return v(e,t)}:o.e$.call(t,e)?o.G(t[e]):o.YP}var h={};function _(e){return function(t){var n={};for(var r in t)o.e$.call(t,r)&&(n[r]=e(r,t[r]));return n}}function b(e){return _((function(t,n){return e(n)}))}function y(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(2===e.length)return y(s.Df).apply(void 0,e);var n=l(e[0]);return function(e,t){return function(r){for(var i=e,o=n(r),a=o.length,s=0;s<a;s++){var c=o[s];i=t(c,i,r[c])}return i}}}function w(e){if("compare"in e){var t=l(e);return function(e){return function(n){return function(r){for(var i=e.empty,o=t(r),a=o.length,s=0;s<a;s++){var c=o[s];i=e.concat(i,n(c,r[c]))}return i}}}}return w(s.Df)(e)}function E(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(2===e.length)return E(s.Df).apply(void 0,e);var n=l(e[0]);return function(e,t){return function(r){for(var i=e,o=n(r),a=o.length-1;a>=0;a--){var s=o[a];i=t(s,r[s],i)}return i}}}var S=function(e,t){var n;return(n={})[e]=t,n};function I(e){return V(s.Df)(e)}function k(e){return function(t){var n={},r={};for(var i in t)if(o.e$.call(t,i)){var s=e(i,t[i]);switch(s._tag){case"Left":n[i]=s.left;break;case"Right":r[i]=s.right}}return(0,a.s4)(n,r)}}function P(e){return function(t){var n={},r={};for(var i in t)if(o.e$.call(t,i)){var s=t[i];e(i,s)?r[i]=s:n[i]=s}return(0,a.s4)(n,r)}}function U(e){return function(t){var n={};for(var r in t)if(o.e$.call(t,r)){var i=e(r,t[r]);o.pC(i)&&(n[r]=i.value)}return n}}function G(e){return function(t){var n={},r=!1;for(var i in t)if(o.e$.call(t,i)){var a=t[i];e(i,a)?n[i]=a:r=!0}return r?n:t}}var D=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function z(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function T(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function C(e){return function(t,n){if(void 0===n){var r=C(e);return function(e){return r(t,e)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var q=function(e,t){return(0,i.zG)(e,b(t))},O=function(e,t){return(0,i.zG)(e,_(t))},x=function(e){var t=ne(e);return function(e,n,r){return(0,i.zG)(e,t(n,r))}},M=function(e){return function(t){var n=re(e)(t);return function(e,t){return(0,i.zG)(e,n(t))}}},R=function(e){var t=ie(e);return function(e,n,r){return(0,i.zG)(e,t(n,r))}},A=function(e,t){return(0,i.zG)(e,Z(t))},L=function(e,t){return(0,i.zG)(e,X(t))},F=function(e,t){return(0,i.zG)(e,ee(t))},$=function(e,t){return(0,i.zG)(e,te(t))},B=function(e){var t=y(e);return function(e,n,r){return(0,i.zG)(e,t(n,r))}},N=function(e){var t=w(e);return function(e){var n=t(e);return function(e,t){return(0,i.zG)(e,n(t))}}},Y=function(e){var t=E(e);return function(e,n,r){return(0,i.zG)(e,t(n,r))}},K=function(e,t){return(0,i.zG)(e,k(t))},j=function(e,t){return(0,i.zG)(e,P(t))},Q=function(e,t){return(0,i.zG)(e,U(t))},W=function(e,t){return(0,i.zG)(e,G(t))},H=function(e){var t=J(e);return function(e){var n=t(e);return function(e,t){return n(e,(0,i.ls)(i.SK,t))}}},V=function(e){var t=H(e);return function(e){var n=t(e);return function(e){return n(e,i.yR)}}},J=function(e){return function(t){var n=l(e);return function(e,r){var i=n(e);if(0===i.length)return t.of(h);for(var o=t.of({}),a=function(n){o=t.ap(t.map(o,(function(e){return function(t){var r;return Object.assign({},e,((r={})[n]=t,r))}})),r(n,e[n]))},s=0,c=i;s<c.length;s++){a(c[s])}return o}}},Z=function(e){return G((function(t,n){return e(n)}))},X=function(e){return U((function(t,n){return e(n)}))},ee=function(e){return P((function(t,n){return e(n)}))},te=function(e){return k((function(t,n){return e(n)}))};function ne(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){var n=y(e[0]);return function(e,t){return n(e,(function(e,n,r){return t(n,r)}))}}return ne(s.Df).apply(void 0,e)}function re(e){if("compare"in e){var t=w(e);return function(e){var n=t(e);return function(e){return n((function(t,n){return e(n)}))}}}return re(s.Df)(e)}function ie(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){var n=E(e[0]);return function(e,t){return n(e,(function(e,n,r){return t(n,r)}))}}return ie(s.Df).apply(void 0,e)}var oe=function(e){var t={};for(var n in e)if(o.e$.call(e,n)){var r=e[n];o.pC(r)&&(t[n]=r.value)}return t},ae=function(e){var t={},n={};for(var r in e)if(o.e$.call(e,r)){var i=e[r];o.nM(i)?t[r]=i.left:n[r]=i.right}return(0,a.s4)(t,n)},se="ReadonlyRecord";function ce(e){var t=m(e);return(0,r.f7)((function(e,n){return t(e)(n)&&t(n)(e)}))}function ue(e){return{concat:function(t,n){if(u(t))return n;if(u(n))return t;var r=Object.assign({},t);for(var i in n)o.e$.call(n,i)&&(r[i]=o.e$.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:h}}s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df;function le(e,t){return o.e$.call(void 0===t?this:t,e)}s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df,s.Df},8377:(e,t,n)=>{n.d(t,{H5:()=>a,Yg:()=>i,li:()=>r,pL:()=>o});n(3735);function r(e){return e[0]}function i(e){return e[1]}var o=function(e){return function(t){return[e(r(t)),i(t)]}},a=function(e){return function(t){return[r(t),e(i(t))]}}},2197:(e,t,n)=>{n.d(t,{ff:()=>r});var r=function(e){return function(t){return!e(t)}}},4870:(e,t,n)=>{n.d(t,{Pd:()=>i,s4:()=>r});n(3735);var r=function(e,t){return{left:e,right:t}},i=function(e,t){return function(n){return r(e(o(n)),t(a(n)))}},o=function(e){return e.left},a=function(e){return e.right}},7407:(e,t,n)=>{n.d(t,{qA:()=>w,Hi:()=>y,qo:()=>E,dO:()=>_,UA:()=>S,PM:()=>b,Qt:()=>D,ak:()=>G,YO:()=>U,tS:()=>v,mU:()=>I,At:()=>P,tD:()=>u,UI:()=>g,of:()=>m,uU:()=>q,pE:()=>O});var r=n(1828),i=n(6862),o=n(3735);function a(e,t){var n=(0,i.m)(t);return function(t){return n((0,o.ls)(t,e.fromIO))}}var s=n(7341),c=n(9384),u=function(e){return function(){return Promise.resolve().then(e)}};var l=function(e,t){return(0,o.zG)(e,g(t))},d=function(e,t){return(0,o.zG)(e,p(t))},f=function(e,t){return(0,o.zG)(e,v(t))},g=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},p=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then((function(e){return(0,e[0])(e[1])}))}}},m=function(e){return function(){return Promise.resolve(e)}},v=function(e){return function(t){return function(){return Promise.resolve().then(t).then((function(t){return e(t)()}))}}},h="Task";var _={URI:h,map:l},b={URI:h,of:m},y={URI:h,map:l,ap:d},w={URI:h,map:l,ap:d,of:m},E={URI:h,map:l,ap:d,chain:f},S={URI:h,map:l,of:m,ap:d,chain:f},I=(o.yR,(0,i.m)(E)),k={URI:h,fromIO:u},P=a(k,E),U=(c.F4,(0,s.YO)(_)),G=(0,i.a)(E),D=(0,r.Qt)(y),z=m(c.Xl),T=function(e){var t=function(e){return function(t){return function(){return Promise.all(t.map((function(t,n){return Promise.resolve().then((function(){return e(n,t)()}))})))}}}(e);return function(e){return c.Od(e)?t(e):z}},C=function(e){var t=function(e){return function(t){return function(){return c.Gb(t).reduce((function(t,n,r){return t.then((function(t){return Promise.resolve().then(e(r+1,n)).then((function(e){return t.push(e),t}))}))}),Promise.resolve().then(e(0,c.YM(t))).then(c.ri))}}}(e);return function(e){return c.Od(e)?t(e):z}},q=function(e){return T((function(t,n){return e(n)}))},O=function(e){return C((function(t,n){return e(n)}))}},2707:(e,t,n)=>{n.d(t,{Do:()=>he,Qt:()=>ye,ak:()=>be,tS:()=>re,fX:()=>ge,wE:()=>ve,Zl:()=>ie,Y$:()=>pe,Uo:()=>B,tD:()=>F,fF:()=>$,fS:()=>K,t$:()=>x,Hr:()=>_e,UI:()=>X,Vn:()=>te,EQ:()=>N,LV:()=>Y,of:()=>ae,Ij:()=>we,Y3:()=>j});var r=n(1828),i=n(6862),o=n(365),a=n(3735),s=n(7341);function c(e){return(0,a.ls)(o.F2,e.of)}function u(e){return(0,a.ls)(o.t$,e.of)}function l(e){return function(t){return e.map(t,o.F2)}}function d(e){return function(t){return e.map(t,o.t$)}}function f(e){return function(t){return(0,a.ls)(o.ij(t),e.of)}}function g(e){var t=f(e);return function(e){var n=t(e);return function(e){return(0,a.ls)(e,n)}}}function p(e){var t=h(e),n=g(e);return function(e){var r=n(e);return function(e){return t(r(e))}}}function m(e){return(0,s.UI)(e,o.dO)}function v(e){return(0,r.ap)(e,o.G5)}function h(e){return function(t){return function(n){return e.chain(n,(function(n){return o.nM(n)?e.of(n):t(n.right)}))}}}function _(e){return function(t){return function(n){return e.chain(n,(function(n){return o.nM(n)?t():e.of(n)}))}}}function b(e){return function(t,n){return function(r){return e.map(r,o.Pd(t,n))}}}function y(e){return function(t){return function(n){return e.map(n,o.Vn(t))}}}function w(e){return function(t,n){return function(r){return e.map(r,o.EQ(t,n))}}}function E(e){return function(t,n){return function(r){return e.chain(r,o.EQ(t,n))}}}function S(e){return function(t){return function(n){return e.chain(n,o.EQ(t,e.of))}}}function I(e){return function(t){return function(n){return e.chain(n,(function(n){return o.nM(n)?t(n.left):e.of(n)}))}}}function k(e){var t=I(e);return function(n){return t((function(t){return e.map(n(t),(function(e){return o.nM(e)?e:o.t$(t)}))}))}}function P(e){return function(t){return function(n){return e.chain(n,o.EQ((function(n){return e.map(t(n),o.t$)}),(function(t){return e.of(o.F2(t))})))}}}function U(e){return function(t){return e.map(t,o.LF)}}function G(e){return function(t){return e.map(t,o.i$)}}var D=n(2690);function z(e,t){return function(n){var r=(0,a.ls)(n,e.fromTask);return function(e){return t.chain(e,r)}}}var T=n(9384),C=n(7407),q=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},O=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},x=u(C.PM),M=c(C.PM),R=l(C.dO),A=d(C.dO),L=(0,a.ls)(C.tD,R),F=(C.tD,L),$=R,B=C.of,N=(C.tD,w(C.dO)),Y=E(C.UA),K=S(C.UA),j=function(e,t){return function(){return q(void 0,void 0,void 0,(function(){var n;return O(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(T.F2)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,T.t$(t(n))];case 3:return[2]}}))}))}},Q=(C.dO,C.PM,C.PM,C.UA,C.UA,C.UA,C.UA,C.dO,function(e,t){return(0,a.zG)(e,X(t))}),W=function(e,t){return(0,a.zG)(e,ne(t))},H=function(e,t){return(0,a.zG)(e,re(t))},V=function(e,t,n){return(0,a.zG)(e,ee(t,n))},J=function(e,t){return(0,a.zG)(e,te(t))},Z=function(e,t){return(0,a.zG)(e,oe(t))},X=m(C.dO),ee=b(C.dO),te=y(C.dO),ne=v(C.Hi),re=h(C.UA),ie=re,oe=_(C.UA),ae=M,se=x,ce="TaskEither";var ue={URI:ce,map:Q},le={URI:ce,map:Q,ap:W},de={URI:ce,map:Q,ap:W,chain:H},fe={URI:ce,fromEither:B},ge=(0,D.fX)(fe,de),pe=(0,D.Y$)(fe,de),me={URI:ce,fromIO:F,fromTask:$},ve=z(me,de);var he=ae(T.F4),_e=(0,s.Hr)(ue),be=(0,i.a)(de),ye=(0,r.Qt)(le),we=(T.Xl,{URI:ce,bimap:V,mapLeft:J,map:Q,of:ae,ap:W,chain:H,alt:Z,fromIO:F,fromTask:$,throwError:se})},5605:(e,t,n)=>{function r(e,t){return function(n){var r=e.traverse(n);return function(e,i){return n.map(r(e,i),t.separate)}}}function i(e,t){return function(n){var r=e.traverse(n);return function(e,i){return n.map(r(e,i),t.compact)}}}n.d(t,{BL:()=>i,Fj:()=>r})},3735:(e,t,n)=>{n.d(t,{MZ:()=>i,Q1:()=>u,SK:()=>g,W8:()=>a,a9:()=>o,bc:()=>d,gn:()=>s,ls:()=>l,r5:()=>c,yR:()=>r,zG:()=>f});function r(e){return e}var i=r;function o(e){return function(){return e}}var a=o(!0),s=o(null),c=o(void 0),u=c;function l(e,t,n,r,i,o,a,s,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return c(s(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function d(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function f(e,t,n,r,i,o,a,s,c){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return s(a(o(i(r(n(t(e)))))));case 9:return c(s(a(o(i(r(n(t(e))))))));default:for(var u=arguments[0],l=1;l<arguments.length;l++)u=arguments[l](u);return u}}var g=function(e,t){return t}},9384:(e,t,n)=>{n.d(t,{F2:()=>d,F4:()=>h,G:()=>s,Gb:()=>m,Od:()=>g,Wi:()=>i,Xl:()=>v,YM:()=>p,YP:()=>a,e$:()=>_,nM:()=>c,pC:()=>o,r1:()=>b,ri:()=>f,t$:()=>l,tO:()=>u});var r=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},i=function(e){return"None"===e._tag},o=function(e){return"Some"===e._tag},a={_tag:"None"},s=function(e){return{_tag:"Some",value:e}},c=function(e){return"Left"===e._tag},u=function(e){return"Right"===e._tag},l=function(e){return{_tag:"Left",left:e}},d=function(e){return{_tag:"Right",right:e}},f=function(e){return[e]},g=function(e){return e.length>0},p=function(e){return e[0]},m=function(e){return e.slice(1)},v=[],h={},_=Object.prototype.hasOwnProperty,b=function(e){return r([e[0]],e.slice(1),!0)}},4011:(e,t,n)=>{n.d(t,{Df:()=>i,Eq:()=>r});var r={equals:function(e,t){return e===t}},i={equals:r.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};r.equals,i.compare},2751:(e,t,n)=>{n.d(t,{Df:()=>i,Eq:()=>r,pn:()=>a,xb:()=>o});var r={equals:function(e,t){return e===t}},i={equals:r.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},o=function(e){return 0===e.length},a=function(e,t){return function(n){return n.endsWith(e,t)}}},8537:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(477),i=n.n(r);function o(){return i()('/*! permutive-javascript-sdk v20.9.2 (web) (built 2024-09-13T08:34:49.318Z) */(()=>{"use strict";var e={688:(e,t,n)=>{function r(e){return e instanceof Error?e:new Error("string"==typeof e?e:JSON.stringify(e))}n.d(t,{w:()=>r})},992:(e,t,n)=>{n.d(t,{GL:()=>a,HJ:()=>s,N1:()=>l,NC:()=>r,RP:()=>i,UM:()=>u,t_:()=>f});const r=performance.now(),i=(new Date).getTime();let o=[],c=!1;const a=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return s((()=>e(...n)))},s=(e,t)=>{if(!c){const n=self.setTimeout(e,t);return()=>self.clearTimeout(n)}let n;const r=()=>{void 0!==n&&c&&o.length<1e4&&o.push([n,performance.now()]),n=void 0},i=[self.setTimeout((()=>{n=performance.now(),self.requestAnimationFrame(r),e()}),t),self.setTimeout(r,t)];return()=>{void 0===n&&i.forEach((e=>self.clearTimeout(e)))}},u=(e,t)=>{if(!c){const n=self.setInterval(e,t);return()=>self.clearInterval(n)}let n=!1,r=()=>{};const i=self.setInterval((()=>{r=s((()=>{n||e()}))}),t);return()=>{n=!0,r(),self.clearInterval(i)}},f=e=>new Promise(((t,n)=>e.then(a(t),a(n)))),l=e=>()=>f(e())},851:(e,t,n)=>{n.d(t,{g1:()=>z,YO:()=>I,oQ:()=>A,a9:()=>y,Ue:()=>v,gS:()=>h,D8:()=>x,VS:()=>U,xH:()=>k,En:()=>b,p4:()=>D,fF:()=>C,Hr:()=>E,UI:()=>S,u4:()=>q,Rp:()=>P,vP:()=>T,bw:()=>M,YP:()=>w});var r=n(688),i=n(365),o=n(735),c=n(567),a=n(328),s=n(652);function u(e){let t=e,n=[],r=!1;return{addListener(e){if(r)return()=>{};let i=t;const o=()=>{Object.is(t,i)||(i=t,e(t))};n=[...n,o];return()=>{n=n.filter((e=>e!==o))}},notify(e){if(r)throw new Error("Ref bug: Attempted to notify a terminated notifier");Object.is(e,t)||(t=e,n.forEach((e=>e())))},terminate(){r=!0,n=[]}}}function f(e,t){let n=0;return function(){try{if(n++>0)throw new Error(e);return t(...arguments)}finally{n--}}}function l(e,t){let n=[...new Set(e)].filter((e=>"final"!==e.state));if(0===n.length)return{state:"final",onStateChange:()=>()=>{}};const r=()=>0===n.length?"final":n.some((e=>"might_change"===e.state))?"might_change":"nominal",[i,o]=d(r(),(e=>"might_change"!==e&&t())),c=()=>o(r());return n.forEach((t=>{t.onStateChange((t=>{switch(t){case"final":n=e.filter((e=>"final"!==e.state)),c();break;case"might_change":o("might_change");break;case"nominal":c();break;default:throw new Error(`Ref bug: Invalid state ${t}`)}}))})),i}function d(e,t){if("final"===e)return[{state:"final",onStateChange:()=>()=>{}},()=>{}];const{terminate:n,notify:r,addListener:i}=u(e),o={state:e,onStateChange:i},c=f("Disallowed recursion in Branch.",(e=>{if("final"===o.state){if("final"===e)return;throw new Error(`Attempted to change state of final branch to ${e}.`)}try{null==t||t(e),o.state=e,r(e)}finally{"final"===e&&n()}}));return[o,c]}var g=n(341),p=n(392);const m="Ref";function v(e){const[t,n,r]=function(){const[e,t]=d("nominal"),n=f("Disallowed recursion in Branch.",(n=>{if("final"===e.state)throw new Error("Attempted to mutate a finalized Ref.");const r=e.state;try{t("might_change"),n()}finally{t(r)}}));return[e,n,()=>t("final")]}(),[i,o]=R(t,e);return[i,e=>n((()=>o(e))),r]}function h(e){let t=e.empty;const n=()=>()=>{const n=t;return t=e.empty,n},[r,i,o]=v(n());return[r,r=>{t=e.concat(t,r),i(n())},o]}function b(e,t){return n=>{let r=new Array(e).fill(t.empty);return new Array(e).fill(null).map(((e,i)=>(0,o.zG)(n,S(p.UI((e=>{const n=t.concat(r[i],e);return r=r.map(((n,r)=>r===i?t.empty:t.concat(n,e))),n}))))))}}function y(e){return{get current(){return e},onChange:()=>()=>{},branch:{state:"final",onStateChange:()=>()=>{}}}}function w(e){return t=>{const n=t.onChange(e);return e(t.current),n}}function S(e,t){if(t){const[n,r]=R(t.branch,e(t.current));return t.onChange((t=>r(e(t)))),n}return t=>S(e,t)}const _={URI:m,map:(e,t)=>S(t)(e)},I=g.YO(_),E=g.Hr(_),G=e=>U((t=>S(t)(e))),z={URI:m,of:y,map:_.map,ap:(e,t)=>G(t)(e)};function U(e,t){return t?k(S(e,t)):t=>k(S(e,t))}function k(e){if("final"===e.branch.state)return e.current;const[t,n]=function(e,t){let n=t;const r=[e.state,n.state].includes("might_change")?"might_change":"nominal",[i,o]=d(r),c=e=>t=>{switch(t){case"final":o(e().state);break;case"might_change":o("might_change");break;case"nominal":"might_change"===e().state?o("might_change"):o("nominal");break;default:throw new Error(`Ref bug: Unexpected upstream state ${t}`)}};e.onStateChange(c((()=>n)));const a=c((()=>e));let s=n.onStateChange(a);return[i,e=>{n=e,s(),s=e.onStateChange(a),a(n.state)}]}(e.branch,e.current.branch),[r,i]=R(t,e.current.current);let o=e.current.onChange(i);return e.onChange((e=>{o(),o=e.onChange(i),n(e.branch),i(e.current)})),r}function q(e){return t=>{if("final"===t.branch.state)return t;let n=c.YP;return S((t=>{if(c.Wi(n))return n=c.G(t),t;const r=e(n.value,t);return n=c.G(r),r}),t)}}function P(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{if(2===t.length){let n=t[0];return S((e=>(n=t[1](n,e),n)),e)}let n=c.bM();return S((e=>{const r=t[0](n,e);return n=c.G(r),r}),e)}}function T(){if(0===arguments.length||Y(arguments.length<=0?void 0:arguments[0]))return O(...arguments);const e=arguments.length<=0?void 0:arguments[0],t=Object.keys(e);return(0,o.zG)(Object.values(e),(e=>O(...e)),S((0,o.ls)(a.Su(((e,n)=>[t[e],n])),Object.fromEntries)))}function O(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return y([]);if(1===t.length)return S((e=>[e]))(t[0]);let r=!1;t.forEach((e=>e.onChange((()=>{if("might_change"!==e.branch.state)throw new Error("Ref bug: Received a change notification without a `might_change` state.");r=!0}))));const i=t.map((0,s.vg)("branch")),o=()=>{r&&(r=!1,u(t.map((e=>e.current))))},c=l(i,o),[a,u]=R(c,t.map((e=>e.current)));return a}function C(e){const[t,n,r]=v(c.YP);return e().then((0,o.ls)(c.G,n,r)),t}function D(e){const[t,n,a]=v(c.YP);return e.then(i.F2).catch((0,o.ls)(r.w,i.t$)).then((0,o.ls)(c.G,n,a)),t}function x(e){const t=e.hasOwnProperty("equals")?e.equals:e;return q(((e,n)=>t(e,n)?e:n))}function A(e){return Y(e)?e:y(e)}function M(e){return t=>(w(e)(t),t)}function R(e,t){if("final"===e.state)return[y(t),()=>{}];const n=u(t);e.onStateChange((e=>{"final"===e&&n.terminate()}));let r=t;return[{get current(){return r},onChange:n.addListener,branch:e},f("Disallowed recursion in Ref.",(e=>{r=e,n.notify(r)}))]}function Y(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"function"==typeof e.onChange}},116:(e,t,n)=>{n.d(t,{Hr:()=>v,K4:()=>s,KD:()=>y,UI:()=>l,VS:()=>g,YO:()=>h,ak:()=>m,bw:()=>d,dQ:()=>u,kR:()=>w,of:()=>f,vP:()=>p,yi:()=>b});var r=n(851),i=n(735),o=n(652),c=n(923),a=n(567);const s=e=>(0,i.ls)((t=>{let{previousState:n,...r}=t;return e(r)}),(e=>({value:e,state:r.a9(void 0)}))),u=i.yR,f=(0,i.ls)(i.a9,s),l=e=>t=>(0,i.ls)(t,(0,o.rO)({value:e})),d=e=>t=>(0,i.ls)(t,(0,o.rO)({value:(0,o.bw)(e)}));function g(e){return t=>n=>{let{previousState:i,...o}=n;const c=t({previousState:Array.isArray(i)?i[0]:void 0,...o}),a=e(c.value)({previousState:Array.isArray(i)?i[1]:void 0,...o});return{value:a.value,state:r.vP(c.state,a.state)}}}function p(e){return t=>{let{previousState:n,...o}=t;const a=I(n)?n:{},s=(0,i.zG)(e,c.Su(((e,t)=>t({previousState:a[e],...o}))));return{value:(0,i.zG)(s,c.UI((e=>e.value))),state:(0,i.zG)(s,c.UI((e=>e.state)),(e=>r.vP(e)))}}}function m(e,t){return n=>(0,i.ls)((0,o.rO)({previousState:_}),(o=>{const c=n(o),a=t(c.value)({...o,previousState:o.previousState[e]});return{value:(0,i.zG)([c.value,a.value],(t=>{let[n,r]=t;if(!I(n))throw new Error("Service.bind() was passed an upstream Service with a non-record value.");return{...n,[e]:r}})),state:(0,i.zG)(r.vP(c.state,a.state),r.UI((t=>{let[n,r]=t;if(void 0===n)return{[e]:r};if(!I(n))throw new Error("Service.bind() was passed an upstream Service with a non-record state.");return{...n,[e]:r}})))}}))}const v=(e,t)=>l((n=>({...n,[e]:t(n)})));function h(e){return t=>(0,i.ls)((0,o.rO)({previousState:(0,i.ls)(_,(t=>t[e]))}),t,(0,o.rO)({value:t=>({[e]:t}),state:r.UI((t=>({[e]:t})))}))}const b=(e,t)=>{const n=t||(t=>t===e);return t=>u((c=>{let{previousState:a,...s}=c;const u=Array.isArray(a)&&2===a.length&&n(a[0])?a[1]:void 0;return(0,i.zG)({previousState:u,...s},t,(0,o.rO)({state:r.UI((t=>[e,t]))}))}))},y=e=>{const t=e.slice(0,-1),n=e.slice(-1)[0],r=[...t.map((e=>{let[t,n]=e;return[t,(0,i.a9)(n)]})),(0,i.a9)(n)];return w((0,o.lo)(r))};function w(e){return(0,i.ls)(r.UI(e),S)}function S(e){const t=(0,i.zG)(e,r.Rp(0,(e=>e+1)));return n=>{let{previousState:o,stopped:c,...s}=n;return(0,i.zG)(r.vP(e,t),r.Rp(((e,n)=>{let[u,f]=n;return(0,i.zG)(e,a.UI((e=>e.state.current)),a.fS((()=>o)),(e=>u({previousState:e,stopped:(0,i.zG)(r.vP(c,t),r.UI((e=>{let[t,n]=e;return t||n!==f}))),...s})))})),(e=>({value:r.UI((e=>e.value),e),state:r.VS((e=>e.state),e)})))}}function _(e){return I(e)?e:{}}function I(e){return"object"==typeof e&&null!==e}},930:(e,t,n)=>{n.d(t,{d:()=>l,m:()=>f});var r=n(735),i=n(365),o=n(567),c=n(851),a=n(652),s=n(116),u=n(268);const f=e=>s.dQ((t=>{let{stopped:n,previousState:s}=t;const u=function(e){return v(e)?e:{validityKey:"",lastSuccess:o.YP}}(s),f=(0,r.zG)(u,(e=>({...e,inFlight:o.YP,lastSuccess:(0,r.zG)(e.lastSuccess,o.UI(i.F2))}))),l=(0,r.zG)(e,c.UI((e=>"currentTimestampSecs"in e&&"freshness"in e&&"validity"in e?e:{currentTimestampSecs:0,validity:{key:e.validityKey,maxAge:Number.MAX_SAFE_INTEGER},freshness:{key:e.freshnessKey,maxAge:Number.MAX_SAFE_INTEGER},refresh:e.refresh})),(e=>c.vP(e,n)),c.Rp(c.a9(f),((e,t)=>{let[n,s]=t;if(s)return e;const u=n.validity.key(),f=o.hX((e=>n.currentTimestampSecs-e.timestamp<=n.validity.maxAge)),l=(0,a.HP)(n.freshness.key),d=o.hX((e=>n.currentTimestampSecs-e.timestamp<=n.freshness.maxAge&&e.freshnessKey===l())),g=(0,r.zG)(e,c.UI((0,r.ls)(o.DT((e=>e.validityKey===u)),o.EQ((()=>({validityKey:u,inFlight:o.YP,lastSuccess:o.YP})),(0,a.rO)({inFlight:f,lastSuccess:o.tS(i.EQ((e=>o.G(i.t$(e))),(0,r.ls)(o.G,f,o.UI((e=>i.F2(e))))))})))),c.D8(p()));if((0,r.zG)(g.current,(e=>(0,r.zG)(e.inFlight,o.wp((()=>(0,r.zG)(e.lastSuccess,o.tS(o.Uo)))),d,o.pC))))return g;const m=()=>({timestamp:n.currentTimestampSecs,freshnessKey:l(),output:o.YP});return(0,r.zG)(n.refresh,o.EQ((()=>g),(0,r.ls)(c.fF,c.UI(o.EQ((()=>(0,r.zG)(g,c.UI((0,a.rO)({inFlight:()=>o.G(m())})))),i.EQ((e=>(0,r.zG)(g,c.UI((0,a.rO)({inFlight:()=>o.YP,lastSuccess:(0,r.ls)(o.tS((0,r.ls)(o.Uo,o.hX((e=>o.pC(e.output))))),i.Yo((()=>e)),o.G)})))),(e=>c.a9({validityKey:u,inFlight:o.YP,lastSuccess:o.G(i.F2({...m(),output:o.G(e)}))}))))),c.xH)))})),c.xH,c.D8(p())),d=(0,r.zG)(l,c.UI((e=>({validityKey:e.validityKey,lastSuccess:(0,r.zG)(e.lastSuccess,o.tS(o.Uo))}))),c.D8(m())),g=(0,r.zG)(d,c.Rp(-1,(e=>e+1)));return{value:(0,r.zG)(l,c.UI((0,r.ls)((0,a.vg)("lastSuccess"),o.UI(i.UI((e=>e.output))),o.fS((()=>i.F2(o.YP)))))),state:(0,r.zG)(c.vP(d,g),c.UI((e=>{let[t,n]=e;return n>0?t:m().equals(t,u)?s:t})))}})),l=e=>t=>(0,r.ls)((0,a.rO)({previousState:(0,r.ls)(o.DT(v),o.YO("s1"),o.Hr("s2",(t=>{let{s1:n}=t;return(0,r.zG)(n,(0,a.rO)({lastSuccess:o.UI((0,a.rO)({output:o.tS(e)}))}))})),o.UI((e=>{let{s1:t,s2:n}=e;return m().equals(t,n)?t:n})),o.FS)}),t),d=()=>u.n_({freshnessKey:(0,a.Or)(),timestamp:(0,a.Or)(),output:o.Eh((0,a.Or)())});function g(e){return"object"==typeof e&&null!==e&&(!(!("freshnessKey"in e)||!h(e.freshnessKey))&&("timestamp"in e&&"number"==typeof e.timestamp&&!(!("output"in e)||!(0,a.El)(e.output))))}const p=()=>u.n_({validityKey:(0,a.Or)(),inFlight:o.Eh(d()),lastSuccess:o.Eh(i.Eh((0,a.Or)(),d()))}),m=()=>u.n_({validityKey:(0,a.Or)(),lastSuccess:o.Eh(d())});function v(e){return"object"==typeof e&&null!==e&&(!(!("validityKey"in e)||!h(e.validityKey))&&!!("lastSuccess"in e&&(0,a.El)(e.lastSuccess)&&(0,r.zG)(e.lastSuccess,o.EQ((()=>!0),g))))}function h(e){return null===e||"string"==typeof e||"number"==typeof e}},975:(e,t,n)=>{n.r(t),n.d(t,{PermutiveActivationManagerWeb:()=>c,optimisedActivationsConfig:()=>o});class r{logger;permutive;id;segmentCode;triggerType;config;workspaceLevelConfig;prefix="[Activation]";constructor(e,t,n,r,i,o,c){this.logger=e,this.permutive=t,this.id=n,this.segmentCode=r,this.triggerType=i,this.config=o,this.workspaceLevelConfig=c}getSegmentCode(){return this.segmentCode}getTriggerType(){return this.triggerType}getConfig(){return this.config}getWorkspaceLevelConfig(){return this.workspaceLevelConfig}trackImpression(e){return this.trackActivation("impression",e)}trackConversion(e){return this.trackActivation("conversion",e)}trackActivation(e,t){const n={reaction_id:this.id,type:e};this.permutive.track("Reaction",n,t),this.logger.log(this.prefix,n.type,n)}}var i=n(853);const o={dfp:{dfp:[140003,140015,139991,172181,140022,140016,14e4,139987,140001,140015,140010,144173,140014,139984,139995,140020,140034,139988,140025,140010,140003,144178,160773,140014,144174,158121,139996,139999,140012,146592,140032,140026,139989,139995,140047,166963,140030,144171,140032,140011,144167,140018,140031,140009,140029,139987,140004,158122,144175,139993,139997,150948,158118,144170,140017,140005,139986,140006,146596,140026,175723,139990,139982,157017,139981,140035,172632,148101,139985,140018,172346,138503,139993,139986,139996,140025,140028,175586,139985,140013,140024,140023,139988,140011,140030,138503,140034,140002,140004,139984,140002,140019,140019,139999,139981,139998,140027,158221,140029,140008,140005,139991,140008,140007,139994,144176,158119,139990,140020,139994,139989,156991,140006,146178,140009,140007,158123,139982,139997,140035,167956,140023,171120,140017,144177,140036,140024,140028,140027,140031,140012,146592,172180,139998,140022,14e4,146596,140001,175734,140047,140036,158120,140016,140013,144168,172620,175881,178078,178079,178080,178081,178082,178083,178932,183355,147118,183841,146475,147116,147117,147119,147120,147121,146712,146714,146718,146720,147114,147115,182822,182801,182795,146713,146715,146716,146717,146719,146721,146723,182805,182815,182818,182809,182804,182796,182799,182806,182803,182807,182821,182800,182816,182814,182797,182798,182811,182808,182823,182824,182812,182820,182813,182817,183991,183992,184053,184821,184822,185645,187010,187746,187747,189774,190203,190221,191591,191592,144177,193903,198875,200880,125609,125609],dfp_legacy:{}},eyeota_pixel:[],dbm:{omitted:0},appnexus:{},appnexus_adserver:[],nativo:[],rubicon_ssp:[],smart:[],freewheel:[125609,177058,177059,156676,172181,147009,172620,139988,140006,156714,156713,140003,171120,156702,139996,139989,155623,156680,140011,156710,139997,153774,153424,140007,156691,140022,156991,140020,167753,139982,140008,140025,139990,160773,140031,156698,154307,158221,156695,14e4,140001,139995,140016,140017,140028,156700,157017,156699,146178,140014,156711,146596,156697,172392,154023,156678,172180,155624,158123,139998,140024,175723,156677,139985,156703,140018,156686,156683,158118,172632,140005,153858,158121,156692,156682,140047,140009,139991,151045,140013,140030,155626,139987,139984,139999,158119,156693,156704,156717,175586,139986,167956,153427,139993,139994,140032,155207,125609,138503,140029,158122,140012,140034,147230,156675,140036,156707,156709,156679,175734,140019,156705,156687,158120,150650,140026,140027,140004,141331,140035,156669,155625,153425,173384,140002,156712,140010,156708,166963,156674,139981,156696,140015,155204,153426,140023,172346,156694,156688,156706,146592,175346,181503,175881,174777,175878,175879,178078,178079,178080,178081,178082,178083,178932,182828,182827,183155,183355,183503,179616,180067,182829,179443,183841,184053,184821,184822,185645,185925,187010,179632,184121,188777,189568,188778,189569,189774,190203,190221,191591,191592,191865,191866,192110,192111,192128,192527,192529,194771,194772,194773,188560,193417,194774,193570,194775,193903,194706,194770,194766,195364,195869,198875,199263,199256,200148,200235,195363,200758,200880]};class c{logger;permutive;clientContext;constructor(e,t,n){this.logger=e,this.permutive=t,this.clientContext=n}getSpecializedActivations(e){return o[e]}getActivations(e){return(0,i.Hn)(e)("activationConfigs",[]).filter((e=>this.areContextCriteriaSatisfied(e))).map((e=>new r(this.logger,this.permutive,e.id,e.sc,e.tt,e.c,e.wc)))}areContextCriteriaSatisfied(e){const t=e.cc,n=e=>{const t=this.clientContext.getContext()[e.key];switch(e.comparison){case"EQUALS":return t===e.value;case"NOT_EQUALS":return t!==e.value;case"CONTAINS":return"string"==typeof t&&t.indexOf(e.value)>=0;case"NOT_CONTAINS":return"string"==typeof t&&t.indexOf(e.value)<0}};return!t||("AND"===(r=t).operator?r.criteria.every(n):r.criteria.some(n));var r}}},853:(e,t,n)=>{n.d(t,{Hn:()=>i});const r={web:{auto_init:!1,track_pageview_engagement:!0,track_form_submission:!1,track_link_click:!0,track_pageview_complete:!0,add_alchemy_taxonomy:!1,add_alchemy_entities:!1,engagement_edge_only:!0,segment_transition_edge_only:!0,activationConfigs:[]},tradedesk:{auto_init:!0,advertiser_id:"elm9crd",activationConfigs:[{id:"2db7373d-97c2-4b37-99db-57e0dc64acd5",tt:"EveryTime",sc:144171,c:{},wc:{advertiser_id:"elm9crd"}},{id:"1eae7c89-7dbf-4225-b692-15f7344f2805",tt:"EveryTime",sc:144170,c:{},wc:{advertiser_id:"elm9crd"}},{id:"35c227e5-a516-41a9-bc80-d9a33e5842af",tt:"EveryTime",sc:144174,c:{},wc:{advertiser_id:"elm9crd"}},{id:"148d558a-0950-4f4b-8081-4031a99fbd83",tt:"EveryTime",sc:144175,c:{},wc:{advertiser_id:"elm9crd"}},{id:"291099f8-e9c5-4499-bb72-c05ac05d0506",tt:"EveryTime",sc:144176,c:{},wc:{advertiser_id:"elm9crd"}},{id:"6689d4d8-43ed-4e23-b3b9-60a4ab57787b",tt:"EveryTime",sc:144178,c:{},wc:{advertiser_id:"elm9crd"}},{id:"67d50403-9cf5-430a-ae81-95c44fed1dea",tt:"EveryTime",sc:144177,c:{},wc:{advertiser_id:"elm9crd"}},{id:"97f4badb-26ec-4475-a461-bdccf2ef3bd5",tt:"EveryTime",sc:144173,c:{},wc:{advertiser_id:"elm9crd"}},{id:"a7b03264-03a8-4f6c-9a9b-2336264bbf9f",tt:"EveryTime",sc:144168,c:{},wc:{advertiser_id:"elm9crd"}},{id:"afcd4df0-f136-406a-86c0-9d70ea31c6c4",tt:"EveryTime",sc:144167,c:{},wc:{advertiser_id:"elm9crd"}},{id:"b4a30046-9f43-4e94-852f-adc2f272aae6",tt:"EveryTime",sc:146712,c:{},wc:{advertiser_id:"elm9crd"}},{id:"31a59941-8711-4496-b13d-f975a31e2c5a",tt:"EveryTime",sc:146713,c:{},wc:{advertiser_id:"elm9crd"}},{id:"4ef70e4b-44d9-40f3-aef5-7657a265ac87",tt:"EveryTime",sc:182816,c:{},wc:{advertiser_id:"elm9crd"}},{id:"137b9310-2b74-45a8-846f-59134c50a0e9",tt:"EveryTime",sc:147119,c:{},wc:{advertiser_id:"elm9crd"}},{id:"2fad7f57-0f0e-4dc6-a2f7-ddbbf825cf92",tt:"EveryTime",sc:146475,c:{},wc:{advertiser_id:"elm9crd"}},{id:"ce5297f2-6aee-4708-9e5c-985e590693f8",tt:"EveryTime",sc:147116,c:{},wc:{advertiser_id:"elm9crd"}},{id:"b8d91c4d-0a3c-4bc2-b4f1-0d79a3c1dbc1",tt:"EveryTime",sc:147117,c:{},wc:{advertiser_id:"elm9crd"}},{id:"bc70519a-73a1-4aad-8872-e85c2e10b6c9",tt:"EveryTime",sc:147118,c:{},wc:{advertiser_id:"elm9crd"}},{id:"68943fc3-7a68-4e38-a7ca-d78659dae5de",tt:"EveryTime",sc:147120,c:{},wc:{advertiser_id:"elm9crd"}},{id:"78bab6ad-44c7-49dc-bce2-17bb79975661",tt:"EveryTime",sc:147121,c:{},wc:{advertiser_id:"elm9crd"}},{id:"2e213a12-2cc3-42b4-b069-62f761053a67",tt:"EveryTime",sc:146714,c:{},wc:{advertiser_id:"elm9crd"}},{id:"9b7a08e6-930c-4441-828e-92d397586523",tt:"EveryTime",sc:146717,c:{},wc:{advertiser_id:"elm9crd"}},{id:"8aae98d0-7a7b-4154-a9f7-653ff73a81ad",tt:"EveryTime",sc:146721,c:{},wc:{advertiser_id:"elm9crd"}},{id:"91dc687c-858e-4b19-80f1-ecb6668c17c3",tt:"EveryTime",sc:147114,c:{},wc:{advertiser_id:"elm9crd"}},{id:"9831f2bb-be9b-44c8-8063-0506021c3e38",tt:"EveryTime",sc:147115,c:{},wc:{advertiser_id:"elm9crd"}},{id:"bdfd51bb-eeca-4ca7-a0a7-39b9e18d6791",tt:"EveryTime",sc:182805,c:{},wc:{advertiser_id:"elm9crd"}},{id:"7398ad98-7bef-4c16-a637-cc1f2cb92bed",tt:"EveryTime",sc:182815,c:{},wc:{advertiser_id:"elm9crd"}},{id:"16e4cec4-cba0-40d0-8473-474d4c2ec2e0",tt:"EveryTime",sc:182809,c:{},wc:{advertiser_id:"elm9crd"}},{id:"79f78330-3966-42ae-b892-048526126521",tt:"EveryTime",sc:182796,c:{},wc:{advertiser_id:"elm9crd"}},{id:"f96272a4-e648-4e54-8b04-2f4d631a5f17",tt:"EveryTime",sc:182801,c:{},wc:{advertiser_id:"elm9crd"}},{id:"5d824049-8dea-4a37-8eb5-d6fc93c348c4",tt:"EveryTime",sc:182799,c:{},wc:{advertiser_id:"elm9crd"}},{id:"c39b0774-90c7-4787-94a4-4043fa19d002",tt:"EveryTime",sc:146715,c:{},wc:{advertiser_id:"elm9crd"}},{id:"157132cf-a3a0-4d2d-a1e6-0bbf2d5ddcd0",tt:"EveryTime",sc:146716,c:{},wc:{advertiser_id:"elm9crd"}},{id:"051e77bc-2aef-4832-aa10-e20581f04835",tt:"EveryTime",sc:146718,c:{},wc:{advertiser_id:"elm9crd"}},{id:"1379ead7-35d6-41bb-a39b-8be7aad9f3cf",tt:"EveryTime",sc:146719,c:{},wc:{advertiser_id:"elm9crd"}},{id:"3045e73f-7abd-40f5-b214-722f24dd7ef9",tt:"EveryTime",sc:146720,c:{},wc:{advertiser_id:"elm9crd"}},{id:"629bb66f-3895-4e8a-b5e1-d919e8e0aeb4",tt:"EveryTime",sc:146723,c:{},wc:{advertiser_id:"elm9crd"}},{id:"9e22fd6a-e34e-4fe5-8314-eb984a5aff9b",tt:"EveryTime",sc:182818,c:{},wc:{advertiser_id:"elm9crd"}},{id:"8f7eaab9-b3b0-4ea9-8417-6a01d63ce058",tt:"EveryTime",sc:182804,c:{},wc:{advertiser_id:"elm9crd"}},{id:"8f4dd357-7278-4183-ab80-834d099a8118",tt:"EveryTime",sc:182822,c:{},wc:{advertiser_id:"elm9crd"}},{id:"9e62b99c-f251-438f-901e-fee4d5d1e7c7",tt:"EveryTime",sc:182806,c:{},wc:{advertiser_id:"elm9crd"}},{id:"5af38140-d983-4f35-8b2b-c5d13b0ed569",tt:"EveryTime",sc:182803,c:{},wc:{advertiser_id:"elm9crd"}},{id:"3c870deb-8d0a-4c19-8bc0-af1421395b8b",tt:"EveryTime",sc:182795,c:{},wc:{advertiser_id:"elm9crd"}},{id:"29bf256a-992f-478c-8219-0c183f21c42c",tt:"EveryTime",sc:182807,c:{},wc:{advertiser_id:"elm9crd"}},{id:"54e979d0-57a0-4fc0-be3d-2ed59f54d5b9",tt:"EveryTime",sc:182821,c:{},wc:{advertiser_id:"elm9crd"}},{id:"ba846426-d462-4a43-a916-b2088e1210f7",tt:"EveryTime",sc:182800,c:{},wc:{advertiser_id:"elm9crd"}},{id:"2f69a2ea-ab96-4f28-87cd-7396805769e9",tt:"EveryTime",sc:182814,c:{},wc:{advertiser_id:"elm9crd"}},{id:"8f20065d-1f53-407c-b97a-adb541cb1cd4",tt:"EveryTime",sc:182797,c:{},wc:{advertiser_id:"elm9crd"}},{id:"0e2d3af9-5eef-4c7f-98a2-396c4e11389c",tt:"EveryTime",sc:182798,c:{},wc:{advertiser_id:"elm9crd"}},{id:"eea6b52a-9299-407b-a8f1-ece84c45e749",tt:"EveryTime",sc:182811,c:{},wc:{advertiser_id:"elm9crd"}},{id:"37c37137-d9d7-4d0f-aad3-f43afa34f2bc",tt:"EveryTime",sc:182808,c:{},wc:{advertiser_id:"elm9crd"}},{id:"d2c4ccb7-1c13-46dd-b4ea-79d94c513445",tt:"EveryTime",sc:182823,c:{},wc:{advertiser_id:"elm9crd"}},{id:"33f88196-877d-40e0-8bbe-f84050f110d7",tt:"EveryTime",sc:182824,c:{},wc:{advertiser_id:"elm9crd"}},{id:"a7550f69-3826-4544-b0e4-7a919a8d34b5",tt:"EveryTime",sc:182812,c:{},wc:{advertiser_id:"elm9crd"}},{id:"0906477d-8703-4f62-8a71-394f2b85cd0a",tt:"EveryTime",sc:182820,c:{},wc:{advertiser_id:"elm9crd"}},{id:"000201f4-c08f-4166-8d3c-7b7c14ee270d",tt:"EveryTime",sc:182813,c:{},wc:{advertiser_id:"elm9crd"}},{id:"78d5c1a3-2c63-47a9-922e-8d34b3e0c3bd",tt:"EveryTime",sc:182817,c:{},wc:{advertiser_id:"elm9crd"}}]},pubmatic:{auto_init:!0,dpid:"1003",activationConfigs:[]},dfp:{auto_init:!0,track_slot_rendered:!1,track_slot_viewable:!0,track_slot_clicked:!0,activationConfigs:[]},tracking_pixel:{auto_init:!0,activationConfigs:[]},dbm:{auto_init:!0,entity_id:2140931,product_type:"INVITE_PARTNER",activationConfigs:[]},freewheel:{auto_init:!0,activationConfigs:[]},local_storage:{auto_init:!0,activationConfigs:[]},ctv:{auto_init:!1,ctv_engagement_enabled:!0,ctv_engagement_event_seconds:0,activationConfigs:[]}},i=e=>{const t=r[e];return(e,n)=>(null==t?void 0:t[e])??n};i("web"),i("dfp"),i("facebook_pixel_v2")},548:(e,t,n)=>{n.d(t,{X:()=>i,k:()=>r});const r=e=>({id:e.id,name:e.name,time:new Date(e.time),properties:e.properties||{},session_id:e.session_id,view_id:e.view_id}),i=e=>({id:e.id,name:e.name,time:(o(e.time)?e.time:new Date).toISOString(),properties:e.properties||{},session_id:e.session_id,view_id:e.view_id}),o=e=>isFinite(e)&&e instanceof Date},656:(e,t,n)=>{n.d(t,{F:()=>u,I:()=>s});var r=n(851),i=n(392),o=n(328),c=n(735),a=n(652);const s=(e,t)=>{let n=!1;return r.UI(i.UI((0,a.bw)((r=>{n||(n=(0,c.zG)(r,o.G((e=>{let[,t]=e;return"Pageview"===t.name}))),n&&e.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:t,time_origin:"sdk_init"}))}))))},u=(e,t)=>{const n=s(e,t);return(0,c.ls)(r.En(2,o.uZ()),(e=>{let[t,i]=e;return(0,c.zG)(i,n,r.UI((e=>e()))),t}))}},373:(e,t,n)=>{n.r(t),n.d(t,{service:()=>di});var r=n(735),i=n(116),o=n(851),c=n(567),a=n(377);const s=e=>{const t=e.current;return(0,r.zG)(e,o.UI((e=>e===t?{segmentsEntered:[],segmentsExited:[]}:{segmentsEntered:(0,r.zG)(e,f(t)),segmentsExited:(0,r.zG)(t,f(e))})))},u=e=>new Set(e),f=e=>t=>(0,r.zG)(t,l((t=>!e.has(t)))),l=e=>t=>{const n=[];return t.forEach((t=>e(t)&&n.push(t))),n};var d=n(392),g=n(328),p=n(652),m=n(268),v=n(751);const h=e=>{let{events:t,...n}=e;return i.K4((e=>{let{stopped:i}=e;const[a,s,u]=(0,r.zG)(t,o.En(3,g.uZ())),f=(0,r.zG)(o.vP(n.viewId,n.currentTimestampSecs,u,i),o.Rp(c.YP,((e,t)=>{let[n,i,o,a]=t;if(a)return e;const s=o();return(0,r.zG)(e,c.hX((e=>e.id===n)),c.EQ((()=>({id:n,lastEngagementTime:i})),(e=>({id:n,lastEngagementTime:(0,r.zG)(s,g.dF((e=>{let[,t]=e;return"PageviewEngagement"===t.name})),c.EQ((()=>e.lastEngagementTime),(e=>{let[,t]=e;return Math.floor(t.time.getTime()/1e3)})))}))),c.G)})),(e=>o.vP(e,n.currentTimestampSecs)),o.UI((e=>{let[t,n]=e;return(0,r.zG)(t,c.hX((e=>600>n-e.lastEngagementTime)),c.UI((e=>e.id)))})),o.D8(c.Eh(v.Eq))),l={PageviewEngagement:{engaged_time:0},SegmentEntry:new Set,SegmentExit:new Set,CohortEntry:new Set,CohortExit:new Set},h=(0,r.zG)(o.vP({events:a,sessionId:n.sessionId,viewIdOpt:f,stopped:i}),o.Rp(c.YP,((e,t)=>{let{events:n,sessionId:i,viewIdOpt:o,stopped:a}=t;if(a)return e;const s=(0,r.zG)(o,c.UI((t=>(0,r.zG)(e,c.tS((0,p.vg)("unprocessedPVC")),c.hX((e=>e.viewId===t)),c.fS((()=>({aggregations:l,customProperties:{},sessionId:i,viewId:t}))),(e=>(0,r.zG)(n(),g.u4(e,((e,t)=>{let[,n]=t;return function(e,t){switch(t.name){case"Pageview":return t.view_id!==e.viewId?e:{...e,customProperties:t.properties};case"SegmentEntry":{const n=t.properties.segment_number;return(0,r.zG)(e,(0,p.rO)({aggregations:e=>e.SegmentExit.has(n)?(0,r.zG)(e,(0,p.rO)({CohortExit:w(String(n)),SegmentExit:w(n)})):(0,r.zG)(e,(0,p.rO)({CohortEntry:y(String(n)),SegmentEntry:y(n)}))}))}case"SegmentExit":{const n=t.properties.segment_number;return(0,r.zG)(e,(0,p.rO)({aggregations:e=>e.SegmentEntry.has(n)?(0,r.zG)(e,(0,p.rO)({CohortEntry:w(String(n)),SegmentEntry:w(n)})):(0,r.zG)(e,(0,p.rO)({CohortExit:y(String(n)),SegmentExit:y(n)}))}))}case"PageviewEngagement":{if(t.view_id!==e.viewId)return e;const n=t.properties;return(0,r.zG)(e,(0,p.rO)({aggregations:(0,p.rO)({PageviewEngagement:()=>({engaged_time:n.total_engaged_time,completion:n.total_completion})})}))}default:return e}}(e,n)})))))))),u=(0,r.zG)(e,c.EQ((()=>d.of(g.cS)),(e=>(0,r.zG)(e.unprocessedPVC,c.hX((e=>{var t;return e.viewId!==(null===(t=c.FS(s))||void 0===t?void 0:t.viewId)})),c.EQ((()=>e.pvcsToProcessImmediately),(t=>{let n=[...e.pvcsToProcessImmediately(),b(t)];return()=>{const e=n;return n=g.cS,e}}))))));return c.G({pvcsToProcessImmediately:u,unprocessedPVC:s})})));return{eventsToProcessImmediately:(0,r.zG)(h,o.UI(c.EQ((()=>()=>g.cS),(e=>e.pvcsToProcessImmediately))),(e=>o.vP(e,s)),o.UI(d.RD),o.UI(d.UI(g.xH))),eventsToProcessOnPageUnload:(0,r.zG)(h,o.UI(c.tS((0,p.vg)("unprocessedPVC"))),o.D8(c.Eh((0,m.MW)({aggregations:(0,p.Or)(),customProperties:(0,p.Or)(),sessionId:(0,p.Or)(),viewId:(0,p.Or)()}))),o.UI((0,r.ls)(c.UI(b),g.Yo)))}}))},b=e=>(0,r.bc)(`PageviewComplete-${e.viewId}`,{name:"PageviewComplete",time:new Date,session_id:e.sessionId,view_id:e.viewId,properties:{...e.customProperties,aggregations:(0,r.zG)(e.aggregations,(0,p.rO)({SegmentEntry:S,SegmentExit:S,CohortEntry:S,CohortExit:S}))}});const y=e=>t=>{const n=new Set(t);return n.add(e),n},w=e=>t=>{const n=new Set(t);return n.delete(e),n},S=e=>[...e];var _=n(992);const I=()=>({kind:"null",value:null}),E=e=>({kind:"string",value:e}),G=e=>({kind:"number",value:e}),z=e=>({kind:"array",value:e}),U=e=>({kind:"object",value:e}),k=e=>e,q=()=>({kind:"bottom"}),P=e=>({kind:"inner",a:e}),T=e=>({kind:"top",error:e}),O=e=>({kind:"unbounded",group:e}),C=(e,t)=>({kind:"windowed",key:t,group:e}),D=(e,t,n)=>({kind:"countLimit",n,limit:t,group:e}),x=(e,t,n)=>({kind:"uniqueLimit",n,limit:t,group:e}),A=e=>({kind:"numberGroup",group:e}),M=e=>({kind:"stringGroup",group:e}),R=e=>({kind:"tuple",tuple:e}),Y=e=>({state:e}),F=(e,t)=>({commands:e,payload:t});var L=n(209);const j=(e,t)=>{switch(e.kind){case"bottom":return{kind:"bottom"};case"inner":return P(t(e.a));case"top":return T(e.error)}},N=e=>(0,L.Zt)(((t,n)=>{if("bottom"===t.kind&&"bottom"===n.kind)return 0;if("bottom"===t.kind)return-1;if("bottom"===n.kind)return 1;if("top"===t.kind&&"top"===n.kind)return v.Df.compare(t.error,n.error);if("top"===t.kind)return 1;if("top"===n.kind)return-1;if("inner"===t.kind&&"inner"===n.kind)return e.compare(t.a,n.a);throw new Error("Non exhaustive match in extendedAlgebraOrd")}));var $=n(885),Q=n(500),B=n(365),H=function(e){return-1===e?1:1===e?-1:0};function K(e,t){return(0,Q.oA)(e.map(t))}function V(e,t,n,r){const i=(e,t)=>{if(0===e.length)return(0,Q.oA)(t.map((e=>(0,c.G)({1:e[1],2:n(c.YP,(0,c.G)(e[2]))}))));if(0===t.length)return(0,Q.oA)(e.map((e=>(0,c.G)({1:e[1],2:n((0,c.G)(e[2]),c.YP)}))));if(e.length>0&&t.length>0&&(0,L.lt)(r)(e[0][1],t[0][1])){const[r,...o]=e,a=r[1],s=r[2];return(0,Q.Ce)({1:a,2:n((0,c.G)(s),c.YP)})(i(o,t))}if(e.length>0&&t.length>0&&(0,L.gt)(r)(e[0][1],t[0][1])){const[r,...o]=t,a=r[1],s=r[2];return(0,Q.Ce)({1:a,2:n(c.YP,(0,c.G)(s))})(i(e,o))}if(e.length>0&&t.length>0){const[r,...o]=e,[a,...s]=t,u=r[1],f=r[2],l=a[2];return(0,Q.Ce)({1:u,2:n((0,c.G)(f),(0,c.G)(l))})(i(o,s))}throw new Error("Non exhaustive match in mapOption2")},o=(0,L.Uz)((e=>e[1]))(r),a=(e=>{const t=K(e,(e=>(0,c.pC)(e[2])?(0,c.G)({1:e[1],2:e[2].value}):c.YP));return 0===t.length?c.YP:(0,c.G)(t)})(i((0,Q.DY)(o)([...e].map((e=>({1:e[0],2:e[1]})))),(0,Q.DY)(o)([...t].map((e=>({1:e[0],2:e[1]}))))));return(0,c.UI)((e=>new Map(e.map((e=>[e[1],e[2]])))))(a)}function W(e,t,n,r){const i=(0,L.Uz)((e=>e[0]))(r),o=(0,Q.DY)(i)([...t]).reduceRight(((e,t)=>{if((0,B.nM)(e)){const r=n(t[1],e.left);return(0,c.pC)(r)?(0,B.t$)(r.value):(0,B.F2)(t[0])}return e}),(0,B.t$)(e));return(0,c.Uo)(o)}function J(e,t){return new Map([...e].map(t))}function X(e,t){return new Map([...e].filter(t))}var Z=n(11);function ee(e){return JSON.stringify(te(e))}function te(e){switch(e.kind){case"null":return ie.encode(e);case"string":return oe.encode(e);case"number":return ce.encode(e);case"array":return ae.encode(e);case"object":return se.encode(e)}}function ne(e){return null===e?ie.decode(e):"number"==typeof e?ce.decode(e):"string"==typeof e?oe.decode(e):Array.isArray(e)?ae.decode(e):se.decode(e)}const re=(e,t)=>(0,B.t$)(`Failed to decode. Input was ${JSON.stringify(e)}. Codec type was ${t}`),ie={encode:e=>null,decode:e=>null===e?(0,B.F2)({kind:"null",value:null}):re(e,"SimpleNull")},oe={encode:e=>e.value,decode:e=>"string"==typeof e?(0,B.F2)(E(e)):re(e,"SimpleString")},ce={encode:e=>e.value,decode:e=>"number"==typeof e?(0,B.F2)(G(e)):re(e,"SimpleNumber")},ae={encode:e=>e.value.map(te),decode:e=>{if(Array.isArray(e)){const t=(0,Q.fw)(B.g1)(ne)(e);return(0,B.UI)(z)(t)}return re(e,"SimpleArray")}},se={encode:e=>{const t=[...e.value.entries()];return Object.assign({},...Array.from(t,(([e,t])=>({[e]:te(t)}))))},decode:e=>{if(e&&e.constructor===Object){const t=(0,Q.fw)(B.g1)((([e,t])=>(0,r.zG)(ne(t),(0,B.UI)((t=>(0,r.bc)(e,t))))))(Object.entries(e));return(0,B.UI)((e=>U(new Map([...e]))))(t)}return re(e,"SimpleObject")}};function ue(e){return(0,r.zG)(e,le,(0,c.UI)(ee),(0,c.fS)((()=>"<encode error>")))}function fe(e){return(0,c.UI)(he)(function(e){switch(e.state.kind){case"top":return(0,c.G)(E(e.state.error));case"bottom":return c.YP;case"inner":return le(e.state.a)}}(e))}function le(e){return function(e){switch(e.kind){case"numberGroup":case"stringGroup":return de(e.group);case"tuple":return e.tuple.length>0}}(e.payload)?(0,c.G)(z(function(e,t){const n=(0,c.UI)((e=>(0,Q.Ce)(e)(t)))(e);return(0,c.fS)((()=>t))(n)}((0,c.UI)((e=>E(function(e){const t=e=>(0,c.EQ)((()=>""),(e=>"b"+JSON.stringify(e)))(e.bound),n=e=>{switch(e.operation){case"add":return"p";case"mul":return"m";case"max":return"v";case"min":return"n"}},r=e=>{const r=t(e[1])+n(e[1]);return 1===e[2]?r:r+JSON.stringify(e[2])};return e.map(r).join("")}(e))))(e.commands),function(e){const t=e=>{switch(e.kind){case"bottom":return{kind:"null",value:null};case"top":return E(e.error);case"inner":return G(e.a)}},n=e=>K([ge,pe,e=>(0,r.zG)(e,ve,U,c.G)],(t=>t(e))),i=e=>K([ge,me,e=>(0,r.zG)(e,ve,(e=>J(e,(([e,t])=>[JSON.stringify(e),t]))),U,c.G)],(t=>t(e)));switch(e.kind){case"tuple":return e.tuple.map(t);case"stringGroup":return n(e.group);case"numberGroup":return i(e.group)}}(e.payload)))):c.YP}function de(e){switch(e.kind){case"unbounded":return e.group.size>0;case"windowed":return e.group.size>0||(0,c.pC)(e.key);case"countLimit":case"uniqueLimit":return e.group.size>0||(0,c.pC)(e.limit)}}function ge(e){switch(e.kind){case"unbounded":return c.YP;case"windowed":return(0,c.G)(E("w"));case"countLimit":return(0,c.G)(E(1===e.n?"x":`x${e.n}`));case"uniqueLimit":return(0,c.G)(E(1===e.n?"u":`u${e.n}`))}}function pe(e){switch(e.kind){case"unbounded":return c.YP;case"windowed":return(0,c.G)(E((0,c.pC)(e.key)?e.key.value:""));case"countLimit":case"uniqueLimit":return(0,c.G)(E((0,c.pC)(e.limit)?e.limit.value:""))}}function me(e){switch(e.kind){case"unbounded":return c.YP;case"windowed":return(0,c.pC)(e.key)?(0,c.G)(G(e.key.value)):(0,c.G)({kind:"null",value:null});case"countLimit":case"uniqueLimit":return(0,c.pC)(e.limit)?(0,c.G)(G(e.limit.value)):(0,c.G)({kind:"null",value:null})}}function ve(e){switch(e.kind){case"unbounded":case"windowed":case"countLimit":case"uniqueLimit":return e.group}}function he(e){switch(e.kind){case"array":return 0===e.value.length?{kind:"null",value:null}:1===e.value.length?he(e.value[0]):z(e.value.map(he));case"object":return(0,r.zG)(X(e.value,(([e,t])=>"null"!==t.kind)),(e=>J(e,(e=>[e[0],he(e[1])]))),U);default:return e}}function be(e){const t=e=>{if(0===e.length)return{kind:"bottom"};const t=(e=>{if(4!==e.length)return c.YP;const[t,n,r,i]=e;if("string"===t.kind&&"string"===n.kind&&"object"===i.kind){const e=(0,c.DT)((e=>ye(e[1].value)&&we(e[2].value)))({1:t,2:n});return(0,c.UI)((e=>({prim:e[1].value,grp:e[2].value,cutoff:r,m:i.value})))(e)}return c.YP})(e);if((0,c.pC)(t)){const{prim:e,grp:n,cutoff:r,m:i}=t.value,o=Se(r,i,_e(n));return"string"==typeof o?T(o):P(F(Ie(e),o))}const n=(e=>{if(3!==e.length)return c.YP;const[t,n,r]=e;if("string"===t.kind&&"object"===r.kind){const e=(0,c.DT)((e=>we(e.value)))(t);return(0,c.UI)((e=>({grp:e.value,cutoff:n,m:r.value})))(e)}return c.YP})(e);if((0,c.pC)(n)){const{grp:e,cutoff:t,m:r}=n.value,i=Se(t,r,_e(e));return"string"==typeof i?T(i):P(F(c.YP,i))}const r=(e=>{if(2!==e.length)return c.YP;const[t,n]=e;if("string"===t.kind&&"object"===n.kind){const e=(0,c.DT)((e=>ye(e.value)))(t);return(0,c.UI)((e=>({prim:e.value,m:n.value})))(e)}return c.YP})(e);if((0,c.pC)(r)){const{prim:e,m:t}=r.value;return P(F(Ie(e),M(O(t))))}const i=(e=>{if(1!==e.length)return c.YP;const[t]=e;return"object"===t.kind?(0,c.G)({m:t.value}):c.YP})(e);if((0,c.pC)(i)){const{m:e}=i.value;return P(F(c.YP,M(O(e))))}const o=(e=>{if(e.length<1)return c.YP;const[t,...n]=e;if("string"===t.kind){const e=(0,c.DT)((e=>ye(e.value)))(t);return(0,c.UI)((e=>({prim:e.value,rest:n})))(e)}return c.YP})(e);if((0,c.pC)(o)){const{prim:e,rest:t}=o.value;return P(F(Ie(e),Ge(t)))}return P(F(c.YP,Ge(e)))},n=e=>"array"===e.kind?(0,Q.tS)(n)(e.value):[e];return"null"===e.kind?Y({kind:"bottom"}):Y(t(n(e)))}function ye(e){const t=e.split("");if(!0==(0===t.length))return!1;{const[e,...n]=t;return-1!=="bpmvn".indexOf(e)&&n.every((e=>-1!=="bpmvn0123456789.".indexOf(e)))}}function we(e){const t=e.split("");switch(!0){case 0===t.length:return!1;case"w"===t[0]&&void 0===t[1]:return!0;default:{const[e,...n]=t;return-1!=="ux".indexOf(e)&&-1===n.map((e=>!isNaN(parseInt(e)))).indexOf(!1)}}}function Se(e,t,n){switch(e.kind){case"string":return M(n({1:(0,c.G)(e.value),2:t}));case"number":case"null":return A(n({1:"null"===e.kind?c.YP:(0,c.G)(e.value),2:X(J(t,(([e,t])=>[Number(e),t])),(e=>!isNaN(e[0])))}));default:return"{bad cutoff}"}}function _e(e){const t=e=>t=>x(t[2],t[1],e),n=e=>t=>D(t[2],t[1],e),r=e.split("");switch(!0){case"w"===r[0]&&void 0===r[1]:return e=>C(e[2],e[1]);case"u"===r[0]&&void 0===r[1]:return t(1);case"u"===r[0]&&void 0!==r[1]:return t(parseInt(r.slice(1).join("")));case"x"===r[0]&&void 0===r[1]:return n(1);case"x"===r[0]&&void 0!==r[1]:return n(parseInt(r.slice(1).join("")));default:throw new Error("This should never happen if you use isGroupCommand")}}function Ie(e){const t=e=>(0,c.Wi)(e.bound)||"add"===e.operation||"mul"===e.operation?(0,c.G)(e):c.YP,n=(e,n,i)=>{const o=((e,n)=>(0,r.zG)(e,(e=>{switch(e){case"p":return(0,c.G)("add");case"m":return(0,c.G)("mul");case"v":return(0,c.G)("max");case"n":return(0,c.G)("min");default:return c.YP}}),c.UI((e=>({operation:e,bound:n}))),c.tS(t)))(e,i);return(0,c.UI)((e=>{const{init:t,rest:r}=(0,Q.zT)((e=>{return"number"==typeof(t=parseInt(e))&&isFinite(t)&&Math.floor(t)===t;var t}))(n);return{1:{1:e,2:0===t.length?1:parseInt(t.join(""))},2:r.join("")}}))(o)};return(0,c.UI)(k)((0,$.nI)(Ee(e,(e=>{const t=e.split("");if(0===t.length)return c.YP;const[i,...o]=t;if("b"===i){const{init:e,rest:t}=(0,r.zG)(o,(0,Q.zT)((e=>-1!=="1234567890.".indexOf(e))));if(0===e.length||0===t.length)return c.YP;const i=parseFloat(e.join("")),[a,...s]=t;return n(a,s,(0,c.G)(i))}return n(i,o,c.YP)}))))}function Ee(e,t){const n=t(e);return(0,c.fS)((()=>[]))((0,c.UI)((e=>[e[1]].concat(Ee(e[2],t))))(n))}function Ge(e){return R(e.map(ze))}function ze(e){switch(e.kind){case"number":return P(e.value);case"string":return T(e.value);case"null":return{kind:"bottom"};case"object":return T("{object}");case"array":return T("{array}")}}var Ue=n(828);const ke={strategy:(e,t,n)=>r=>{if((0,c.Wi)(n))return t;if("delta"===e&&(0,c.Wi)(t))return c.YP;if((0,c.Wi)(t))return n;if((0,c.pC)(t)&&(0,c.pC)(n))return r(t.value,n.value);throw new Error("Non exhaustive match in combineCommand.strategy")},operation:(e,t,n,i,o,a)=>{const s=(0,Q.pR)(N(a)),u=(0,r.zG)(t.bound,c.EQ((()=>r.yR),(e=>t=>(0,L.VV)(a)(o.fromNumber(e),t))));if("append"===e&&"add"===t.operation)return(0,Q.yL)(n,i,xe("append",(0,r.ls)(o.plus,u)));if("append"===e&&"mul"===t.operation)return(0,Q.yL)(n,i,xe("append",(0,r.ls)(o.times,u)));if("append"===e&&"max"===t.operation)return(0,L.Fp)(s)(n,i);if("join"===e&&"add"===t.operation)return(0,Q.yL)(n,i,xe("join",(0,L.Fp)(a)));if("join"===e&&"mul"===t.operation)return(0,Q.yL)(n,i,xe("join",(0,L.Fp)(a)));if("join"===e&&"max"===t.operation)return(0,L.Fp)(s)(n,i);if("min"===t.operation)return ke.operation(e,{operation:"max",bound:t.bound},n,i,o,function(e){return(0,L.Zt)(((t,n)=>H(e.compare(t,n))))}(a));if("delta"===e&&"max"===t.operation)return(0,L.gt)(s)(n,i)?n:i.map(q);if("delta"===e)return(0,Q.yL)(n,i,((e,t)=>(0,L.gt)(N(a))(e,t)?j(e,u):{kind:"bottom"}));throw new Error("Non exhaustive match in combineCommand.operation")},extend:(e,t,n,r)=>{if("delta"===e&&"top"===n.kind&&"top"===r.kind)return(0,L.gt)(v.Df)(n.error,r.error)?T(n.error):{kind:"bottom"};if("delta"===e&&"bottom"===r.kind)return n;if("delta"===e&&"bottom"===n.kind)return{kind:"bottom"};if("top"===n.kind&&"top"===r.kind)return T((0,L.Fp)(v.Df)(n.error,r.error));if("top"===n.kind)return n;if("top"===r.kind)return r;if("inner"===n.kind&&"inner"===r.kind)return t(n.a,r.a);if("bottom"===n.kind)return r;if("bottom"===r.kind)return n;throw new Error("Non exhaustive match in extend")}},qe={fromNumber:r.yR,plus:(e,t)=>e+t,times:(e,t)=>e*t};function Pe(e,t,n,r){if("unbounded"===e.kind&&"unbounded"===t.kind){const i=e.group,o=t.group;return(0,c.fS)(q)((0,c.UI)((e=>P(O(e))))(V(i,o,n,r)))}if("windowed"===e.kind&&"windowed"===t.kind){const i=e.key,o=e.group,a=t.key,s=t.group,u=(0,L.Fp)((0,c.pR)(r))(i,a);return(0,c.fS)(q)((0,c.UI)((e=>P(C(e,u))))(V(o,s,n,r)))}if("countLimit"===e.kind&&"countLimit"===t.kind){const i=e.n,o=t.n;if(i===o){const o=e.limit,a=e.group,s=t.limit,u=t.group,f=(0,L.Fp)((0,c.pR)(r))(o,s);return(0,c.fS)(q)((0,c.UI)((e=>P(D(e,f,i))))(V(a,u,n,r)))}return T("Non matching counts")}if("uniqueLimit"===e.kind&&"uniqueLimit"===t.kind){const i=e.n,o=t.n;if(i===o){const o=e.limit,a=e.group,s=t.limit,u=t.group,f=(0,L.Fp)((0,c.pR)(r))(o,s);return(0,c.fS)(q)((0,c.UI)((e=>P(x(e,f,i))))(V(a,u,n,r)))}return T("Non matching counts")}return T("Non matching group types")}function Te(e,t,n){return(0,c.fS)(I)(Oe(e,c.YP)(t,n))}function Oe(e,t){const n=t=>(n,r)=>ke.strategy(e,n,r)(Oe(e,t)),i=(t,r,i)=>{if("stringGroup"===r.kind&&"stringGroup"===i.kind){const e=Pe(r.group,i.group,n(t),v.Df);return j(e,(e=>M(De(e,v.Df))))}if("numberGroup"===r.kind&&"numberGroup"===i.kind){const e=Pe(r.group,i.group,n(t),Z.Df);return j(e,(e=>A(De(e,Z.Df))))}if("tuple"===r.kind&&"tuple"===i.kind){const n=(0,c.pC)(t)?t.value:[];return P(R(function(e,t,n,r,i,o){const a=(e,t)=>({1:(0,Q.ke)(e)(t).concat((0,Q.KB)(Math.max(0,e-t.length),q)),2:(0,Q.md)(e)(t)}),s=(t,n,r)=>{if(0===t.length)return ke.operation(e,{operation:"max",bound:c.YP},n,r,i,o);if(t.length>0){const[c,...u]=t,f=a(c[2],n),l=f[1],d=f[2],g=a(c[2],r),p=g[1],m=g[2];return ke.operation(e,c[1],l,p,i,o).concat(s(u,d,m))}throw new Error("Non exhaustive match in recurse")};return(0,Q.GY)((0,Q.Qp)((e=>"bottom"===e.kind))((0,Q.GY)(s(t,n,r))))}(e,n,r.tuple,i.tuple,qe,Z.Df)))}throw new Error(`Non matching payload. Got ${r.kind} and ${i.kind}`)},o=(e,n)=>{if((0,c.Eh)((0,$.Eh)((0,m.n_)({1:(0,m.n_)({operation:v.Eq,bound:(0,c.Eh)(Z.Eq)}),2:Z.Eq}))).equals(e.commands,n.commands)){const r=(0,c.Wi)(e.commands)?t:e.commands,o=i(r,e.payload,n.payload);return j(o,(t=>F(e.commands,t)))}if(o=e.commands,a=n.commands,(0,c.Eh)((0,$.Eh)((0,m.n_)({1:(0,m.n_)({operation:v.Eq}),2:Z.Eq}))).equals(o,a)){const o=(0,r.zG)(((e,t)=>(0,r.zG)((0,Ue.gz)(c.G5)(e,t),(0,c.UI)((([e,t])=>$.yL(e,t,((e,t)=>({1:{operation:e[1].operation,bound:(0,r.zG)((0,Ue.gz)(c.G5)(e[1].bound,t[1].bound),c.UI((([e,t])=>Math.min(e,t))),c.wp((()=>e[1].bound)),c.wp((()=>t[1].bound)))},2:e[2]})))))))(e.commands,n.commands),c.wp((()=>t))),a=i(o,e.payload,n.payload);return j(a,(e=>F(o,e)))}throw new Error(`Non matching primitive strings. Got ${ue(e)} and ${ue(n)}`);var o,a};return(t,n)=>fe(Y(ke.extend(e,o,be(t).state,be(n).state)))}function Ce(e,t,n){const r=(0,c.UI)((t=>X(e,(([e,r])=>(0,L.gf)(n)(e,t)))))(t);return(0,c.fS)((()=>e))(r)}function De(e,t){switch(e.kind){case"unbounded":return e;case"windowed":return(0,c.Wi)(e.key)?e:C(Ce(e.group,e.key,t),e.key);case"countLimit":{const n=e.limit,r=e.n,i=e.group,o=W(r,i,((e,t)=>t<=1?c.YP:(0,c.G)(t-1)),t),a=(0,L.Fp)((0,c.pR)(t))(n,o);return D(Ce(i,a,t),a,r)}case"uniqueLimit":{const n=e.limit,r=e.n,i=e.group,o=(e,t)=>{if("object"===e.kind){const n=[...e.value.keys(),...t.keys()],i=new Set(n);return i.size>=r?c.YP:(0,c.G)(i)}return c.YP},a=W(new Set,i,o,t),s=(0,L.Fp)((0,c.pR)(t))(n,a);return x(Ce(i,s,t),s,r)}}}function xe(e,t){return(n,r)=>ke.extend(e,((e,n)=>P(t(e,n))),n,r)}function Ae(e,t){return Te("append",e,t)}function Me(e,t){return Te("join",e,t)}var Re=n(923),Ye=n(17),Fe=n(767),Le=n(862),je=n(341),Ne=n(870);function $e(e,t){return function(n){return e.map(n,t.compact)}}function Qe(e,t,n){var i=$e(e,t),o=(0,je.UI)(e,n);return function(e){return Ne.s4(i((0,r.zG)(e,o(c.IS))),i((0,r.zG)(e,o(c.EK))))}}function Be(e,t){return function(n){return function(r){return e.map(r,(function(e){return t.filter(e,n)}))}}}function He(e,t){return function(n){return function(r){return e.map(r,(function(e){return t.filterMap(e,n)}))}}}function Ke(e,t){var n=Be(e,t);return function(e){var t=n((0,Ye.ff)(e)),r=n(e);return function(e){return(0,Ne.s4)(t(e),r(e))}}}function Ve(e,t){var n=He(e,t);return function(e){return function(t){return(0,Ne.s4)((0,r.zG)(t,n((function(t){return(0,c.IS)(e(t))}))),(0,r.zG)(t,n((function(t){return(0,c.EK)(e(t))}))))}}}var We=n(679),Je=n(384);function Xe(e){return(0,r.ls)(c.G,e.of)}function Ze(e){return(0,r.a9)(e.of(c.YP))}function et(e){return function(t){return e.map(t,c.G)}}function tt(e){return(0,r.ls)(c.ij,e.of)}function nt(e){var t=tt(e);return function(e){return(0,r.ls)(e,t)}}function rt(e){var t=gt(e),n=nt(e);return function(e){return t(n(e))}}function it(e){return function(t){return(0,r.ls)(t,e.of)}}function ot(e){var t=gt(e),n=it(e);return function(e){return t(n(e))}}function ct(e){return function(t){return function(n){return e.of(c.DT(t)(n))}}}function at(e){return(0,r.ls)(c.Uo,e.of)}function st(e){return function(t,n){return function(r){return e.map(r,c.EQ(t,n))}}}function ut(e){return function(t,n){return function(r){return e.chain(r,c.EQ(t,n))}}}function ft(e){return function(t){return function(n){return e.chain(n,c.EQ(t,e.of))}}}function lt(e){return(0,je.UI)(e,c.dO)}function dt(e){return(0,Ue.ap)(e,c.G5)}function gt(e){var t=Ze(e);return function(n){return function(r){return e.chain(r,c.EQ((function(){return t()}),n))}}}function pt(e){var t=Xe(e);return function(n){return function(r){return e.chain(r,c.EQ(n,t))}}}var mt=n(151),vt=Xe(mt.PM),ht=(mt.PM,mt.of),bt=(mt.PM,function(e){return yt(mt.tD(e))}),yt=et(mt.dO),wt=mt.UI(c.Uo),St=(mt.dO,ut(mt.qo)),_t=(mt.UA,mt.PM,mt.PM,mt.UA,mt.PM,ot(mt.UA)),It=lt(mt.dO),Et=dt(mt.Hi),Gt=vt,zt=gt(mt.UA),Ut=(mt.UA,mt.PM,mt.dO,c.Ri,mt.dO,c.Ri,c.dO,Be(mt.dO,c.xu)),kt=(mt.dO,c.xu,mt.dO,c.xu,mt.dO,c.xu,function(e,t){return(0,r.zG)(e,It(t))}),qt=function(e,t){return(0,r.zG)(e,Et(t))},Pt=function(e,t){return(0,r.zG)(e,zt(t))},Tt="TaskOption",Ot={URI:Tt,map:kt,ap:qt,chain:Pt},Ct={URI:Tt,fromIO:bt,fromTask:yt},Dt=(0,We.oU)(Ct,Ot),xt=(Je.F4,(0,Le.a)(Ot)),At=(Je.Xl,Xe(d.PM)),Mt=(d.PM,d.of,d.PM,d.dO,c.Uo,d.dO,d.qo,d.UA,d.UI(c.FS),d.UI(c.WG),d.PM,d.PM,d.UA,d.PM,d.UA,d.dO,d.G5,At),Rt=(d.UA,pt(d.UA));d.PM,d.dO,c.Ri,d.dO,c.Ri,c.dO,d.dO,c.xu,d.dO,c.xu,d.dO,c.xu,d.dO,c.xu,Je.F4,Je.Xl;const Yt=new Set(["AdRequest","Reaction","PageviewEngagement","SegmentEntry","SegmentExit","VideoEngagement"]),Ft=e=>i.dQ((t=>{let{previousState:n}=t;const[i,a]=o.Ue(!1);const[s,u]=o.gS({empty:c.YP,concat:(e,t)=>(0,r.zG)(g.oA([e,t]),c.DT(g.Od),c.UI((e=>e.reduce(((e,t)=>({...e,...t}))))))}),f=(0,r.zG)((0,p.Kn)(n)?n:{},(0,p.rO)({stateOffset:(0,r.ls)(c.DT(p.BJ),c.fS((()=>0))),fetchUnseenKey:(0,r.ls)(c.DT(p.HD),c.fS((()=>"")))})),l=(0,r.zG)(o.gS(c.uZ({concat:function(e,t){return Object.assign({},e,t)}})),(t=>{let[n,i]=t;return(0,r.zG)(o.vP(e.lastProcessedEvents,e.internalStateDiff,e.queryLanguageProcessing),o.bw((e=>{let[t,n,r]=e;if(r)return;return t().filter((e=>!Yt.has(e.name))).length>0?i(n()):void 0}))),(0,r.zG)(o.vP({internalStateDiff:n,internalStateMap:e.internalStateMap}),o.D8(((e,t)=>e.internalStateDiff===t.internalStateDiff)))})),d=(0,r.zG)(o.vP(e.sessionId,l,i),o.Rp(o.a9({...f,inFlightRequest:!1,previousDecodedState:(0,r.zG)(e.internalStateMap.current,jt,ne,B.fS((()=>U(new Map)))),sendFullStateWithUnseen:!1}),((t,n)=>{let[i,{internalStateDiff:a,internalStateMap:s},f]=n;return(0,r.zG)(t,o.VS((t=>{if(t.inFlightRequest)return o.a9(t);const n=!f&&t.sendFullStateWithUnseen,l=n||!e.groupIdIsNewlyGenerated&&i!==t.fetchUnseenKey;return(0,r.zG)(n?Mt(s):a,Rt((()=>()=>(0,r.zG)({},c.DT((()=>l))))),mt.tD,zt((0,r.ls)($t(t.previousDecodedState),Fe.Vn((0,p.bw)((t=>e.logger.error(t)))),wt)),St((()=>mt.of({...t,inFlightRequest:!1})),(0,r.ls)(mt.of,mt.ak("processed",(n=>(0,r.zG)(e,Lt({delta:n.delta,stateOffset:t.stateOffset,fetchUnseen:l}),mt.UI((0,p.bw)((0,r.ls)(c.UI((0,p.vg)("stateDelta")),c.hX(Ye.ff(Re.xb)),u)))))),mt.UI((e=>({fetchUnseenKey:i,inFlightRequest:!1,sendFullStateWithUnseen:t.sendFullStateWithUnseen&&!n,previousDecodedState:e.decodedState,stateOffset:(0,r.zG)(e.processed,c.UI((e=>e.response.state_offset)),c.fS((()=>t.stateOffset)))}))))),o.fF,o.UI(c.fS((()=>({...t,inFlightRequest:!0})))))})))})),o.xH,o.UI((e=>({stateOffset:e.stateOffset,fetchUnseenKey:e.fetchUnseenKey}))),o.D8((0,m.MW)({stateOffset:Z.Eq,fetchUnseenKey:v.Eq})));return{state:d,value:{externalStateDelta:s}}})),Lt=e=>t=>(0,r.zG)(e,c.DT((e=>e.fetchUnseen||Ye.ff(Re.xb)(e.delta))),ht,zt((e=>{return(0,r.zG)(t,(n={event_source_id:t.eventSourceId,fetch_unseen:e.fetchUnseen,group_id:t.groupId,last_seen_offset:e.stateOffset,state:e.delta},e=>Fe.Y3((()=>e.permutiveApi.req({url:e.permutiveUrls.getEndpointUrl("/state",c.G("v1.0"),[["fetch_unseen",JSON.stringify(n.fetch_unseen)]]),method:"POST",payload:{group_id:n.group_id,event_source_id:n.event_source_id,state:JSON.stringify(n.state),last_seen_offset:n.last_seen_offset},contentType:"text/plain",dataType:"json",withCredentials:!1})),(e=>`Error sending state delta. Got ${B.KC(e)}`))),Fe.Vn((0,p.bw)((e=>t.reportError(e)))),wt,Ut((e=>!!e)),_t((0,r.ls)(B.of,B.YO("response"),B.ak("stateDelta",(e=>{return t=e.response.state,(0,B.Y3)((function(){return JSON.parse(t)}),r.yR);var t})),B.Vn((0,p.bw)((e=>t.reportError(`Failed to parse State API response, got ${e}`)))),c.Uo)));var n}))),jt=e=>(0,p.b0)(e,((e,t)=>t.state?c.G({[t.checksum]:t.state}):c.YP)),Nt=e=>t=>{const n=(0,r.zG)(t,jt,ne,B.fS((()=>U(new Map))),(t=>Te("delta",t,e)));return{decodedState:Me(n,e),delta:(0,r.zG)(n,te,c.ij,c.fS((()=>({}))))}},$t=e=>t=>()=>new Promise((n=>(0,_.HJ)((()=>(0,r.zG)(t,B.it(Nt(e),(e=>`Failed to compute delta for state sync. Got ${e}`)),n)))));n(605),Re.dp;var Qt=Re.xb,Bt=function(e){return function(t){return Object.keys(t).sort(e.compare)}};v.Df;Re.dx,Re.e$;Re.Bu,Re.P5,Re.Su;var Ht=Re.UI;Re.ri;function Kt(e){return Re.vP(e)}Re._r;Re.jt;Re.yW,Re.G,Re.t9;var Vt=Re.HA,Wt=(Re.nn,Re.kp),Jt=Re.CC,Xt=Re.RF,Zt=(Re.I8,Re.mS,Re.RJ,Re._Y,Re.V_),en=Re.EW,tn=Re.nu,nn=(Re.SW,Re.zV,Re.Ub,Re.vA,Re.qS),rn=(Re.mK,function(e){return function(t){var n=Bt(e);return function(e,r){var i=n(e);if(0===i.length)return t.of({});for(var o=t.of({}),c=function(n){o=t.ap(t.map(o,(function(e){return function(t){return e[n]=t,e}})),r(n,e[n]))},a=0,s=i;a<s.length;a++){c(s[a])}return o}}}),on=Re.hX;Re.DZ,Re.uK,Re.tV;Re.oA,Re.oh;var cn="Record";Re.Eh,Re.uZ,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,Re.nr,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df,v.Df;var an,sn,un=n(688),fn=n(241),ln=function(e){return function(t){return[void 0,e(t)]}},dn=function(e){return function(t){return[e(t),t]}},gn=function(e,t){return(0,r.zG)(e,vn(t))},pn=function(e,t){return(0,r.zG)(e,hn(t))},mn=function(e,t){return(0,r.zG)(e,yn(t))},vn=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},hn=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1],c=e(o),a=c[0],s=c[1];return[i(a),s]}}},bn=function(e){return function(t){return[e,t]}},yn=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},wn="State",Sn={URI:wn,map:gn},_n={URI:wn,map:gn,ap:pn},In=(0,Ue.N)(_n),En={URI:wn,map:gn,ap:pn,of:bn},Gn={URI:wn,map:gn,ap:pn,chain:mn},zn=(0,Le.m)(Gn),Un=(r.yR,(0,je.YO)(Sn)),kn=(0,Le.a)(Gn),qn=function(e){var t=function(e){return function(t){return function(n){for(var r=e(0,Je.YM(t))(n),i=[r[0]],o=r[1],c=1;c<t.length;c++){var a=e(c,t[c])(o),s=a[0],u=a[1];i.push(s),o=u}return[i,o]}}}(e);return function(e){return Je.Od(e)?t(e):bn(Je.Xl)}},Pn=function(e){return qn((function(t,n){return e(n)}))},Tn=Pn(r.yR);!function(e){e.init=function(e){return e&&"object"==typeof e&&"externalStateMap"in e&&"internalStateMap"in e?e:{externalStateMap:c.YP,internalStateMap:{}}}}(an||(an={})),function(e){e.sequenceNonEmptyArray=e=>{if(1===e.length)return e[0];const t=(0,r.bc)([],{},[]);for(const n of e){t[0].push(...n[0]);for(const e in n[1])t[1][e]=n[1][e];t[2].push(...n[2])}return t},e.sequenceArray=t=>(0,r.zG)(t,c.DT(g.Od),c.UI(e.sequenceNonEmptyArray)),e.empty=[g.cS,Re.cS,g.cS]}(sn||(sn={}));const On=e=>t=>(0,r.zG)(Cn((e=>({...e,getCurrentSession:()=>t.environment.sessionId,getCurrentView:()=>t.environment.viewId}))),yn((()=>{return Tn([Dn(e),An(t.environment.thirdPartyData),(i=t.environment.lookalikeModels,(0,r.zG)((function(e){return[e,e]}),yn((e=>Jn.equals(e.lal,i)?bn(g.cS):(0,r.zG)(ln((0,p.rO)({lal:(0,r.a9)(i)})),In(Cn(function(e){const t=(0,r.zG)(e,c.fS((()=>({}))));return e=>({...e,getLookalikeModels:()=>t})}(i))),yn((()=>(0,r.zG)(g.Yo(i),Pn((()=>Rn("updateLAL"))),vn(g.xH))))))))),(0,r.zG)(t.externalStateDelta,c.UI(Mn),c.fS((()=>bn(g.bM())))),(n=t.cloudLiftedState,(0,r.zG)(n,g.tS((e=>Object.entries(e))),Pn((e=>{let[t,n]=e;return dn((e=>(0,r.bc)(t,e.queries.cloudLiftedQueries[t],n)))})),yn((e=>Ln(B.F2(e)))))),Yn(t.newEvents)]);var n,i})),vn((0,r.ls)(g.xH,c.DT(g.Od),c.tS(sn.sequenceArray))),(e=>t=>{let[n,i]=e(t);if(c.pC(n)){let e=n.value,t=0;for(;e[2].length>t;)t=e[2].length,[e,i]=(0,r.zG)(i,(0,r.zG)(Yn(e[2]),vn((t=>sn.sequenceNonEmptyArray([e,...t])))));n=c.G(e)}return(0,r.bc)(n,i)}),nr(e,"query_language_process_duration")),Cn=e=>ln((0,p.rO)({effects:e}));function Dn(e){return(0,r.zG)((function(e){return[e,e]}),yn((t=>{let{bootstrapped:n,effects:i,eventsForReplay:o}=t;return n?bn(g.cS):(0,r.zG)(ln((e=>({...e,bootstrapped:!0,eventsForReplay:[]}))),yn((()=>(0,r.zG)(o,g.R3(tr(i)),Pn(Fn("bootstrap")),vn(g.xH)))),nr(e,"query_language_bootstrap_duration"))})))}const xn=(0,r.zG)(dn((e=>e.tpdQueries)),yn(c.EQ((()=>(0,r.zG)(dn((e=>new Set([...e.queries.queriesByEvent["!UpdateSecondPartyData"]||[],...e.queries.queriesByEvent["!UpdateThirdPartyData"]||[]]))),zn((e=>ln((0,p.rO)({tpdQueries:()=>c.G(e)})))))),bn)));function An(e){const t=(0,r.zG)(e,c.UI(a.li));return(0,r.zG)((function(e){return[e,e]}),yn((n=>{if(c.Eh(Z.Eq).equals(t,n.tpdHashInEffectsObject))return bn(g.cS);const i=c.FS(t);return(0,r.zG)(ln((0,p.rO)({persistentState:(0,p.rO)({tpdHash:(0,r.a9)(i)}),tpdHashInEffectsObject:(0,r.a9)(t),tpdReady:(0,r.a9)(c.pC(e))})),vn((()=>(0,r.zG)(e,c.UI(a.Yg)))),zn((e=>Cn(function(e){const t=Xn((()=>(0,r.zG)(e,c.fS((()=>({"3p":{}}))))));return e=>{const n=Xn((()=>({...t(),...e.get1PSegments()})));return{...e,getSegments:n,getSegmentsArray:Xn((()=>er(n()))),get3PSegments:t}}}(e)))),yn(c.fw(En)((()=>(0,r.zG)(n.tpdEventsToProcess,g.EQ((()=>i!==n.persistentState.tpdHash?Rn("updateTPD"):bn(g.cS)),(0,r.ls)(Pn(Fn("updateTPD")),In(ln((e=>({...e,tpdEventsToProcess:[]})))),vn(g.xH))))))),vn(c.fS((()=>g.bM()))))})))}function Mn(e){return(0,r.zG)(dn((t=>(0,r.zG)(e,Re.jt(((e,n)=>(0,r.zG)(Re.P5(e,t.queries.metadata),c.tS((e=>Re.P5(e,n))),c.tS((0,r.ls)(ne,c.Uo))))),(e=>(0,r.zG)(t.persistentState.externalStateMap,c.UI(Re.DZ((0,r.ls)(ne,c.Uo))),c.EQ((()=>e),(t=>(0,r.zG)({...t,...e},Re.Su(((e,n)=>(0,r.zG)(Re.P5(e,t),c.tS((e=>c.Y3((()=>Me(n,e))))),c.fS((()=>n)))))))))),Re.UI(te)))),yn((e=>ln((0,p.rO)({persistentState:(0,p.rO)({externalStateMap:(0,r.a9)(c.G(e))})})))),yn((()=>Rn("updateExternalState"))))}function Rn(e){return(0,r.zG)(dn((e=>tr(e.effects))),yn(Fn(e)))}function Yn(e){return(0,r.zG)(e,g.EQ((()=>bn(g.bM())),(0,r.ls)($n,yn(Pn((e=>{let[t,n]=e;return(0,r.zG)(n,Fn(t))}))),vn(g.xH))))}function Fn(e){return(0,r.ls)(bn,zn((e=>"Pageview"!==e.name?bn(void 0):ln((0,p.rO)({pageviewProperties:(0,r.a9)(e.properties)})))),zn((e=>{return Hn(e)?Cn((t=e.properties.segment_number,n="SegmentEntry"===e.name,e=>{return(0,r.zG)(e,(i={"1p":{...e.get1PSegments()["1p"],[t]:n}},e=>{const t=Xn((()=>({...i,...e.get3PSegments()})));return{...e,getSegments:t,getSegmentsArray:Xn((()=>er(t()))),get1PSegments:()=>i}}));var i})):bn(void 0);var t,n})),Un("event"),kn("queriesToProcess",(t=>{let{event:n}=t;return function(e,t){return(0,r.zG)((function(e){return[e,e]}),Un("state"),kn("tpdQueriesToReject",(e=>{let{state:{tpdReady:t}}=e;return t?bn(c.bM()):(0,r.zG)(xn,vn(c.DT((e=>e.size>0))))})),yn((n=>{let{state:i,tpdQueriesToReject:o}=n;const a=(0,r.zG)(o,c.UI((e=>g.hX((t=>!e.has(t))))),c.fS((()=>e=>e)));switch(e){case"bootstrap":return bn((0,r.zG)(i.queriesForReplay,a));case"event":const e=i.tpdReady?bn(void 0):ln((0,p.rO)({tpdEventsToProcess:g.R3(t)}));return(0,r.zG)(bn(i.locallyLiftedQueriesByEvent[t.name]||[]),vn(a),In(e));case"lookalikeTransition":return bn(i.locallyLiftedQueriesByEvent[t.name]||[]);case"transition":const n=i.locallyLiftedQueriesByEvent[t.name]||[];if(c.pC(i.lal)){const e=i.locallyLiftedQueriesByEvent["!UpdateLookalikeModels"]||[];return bn(n.concat(e))}return bn(n);case"updateExternalState":return bn((0,r.zG)(i.persistentState.externalStateMap,c.fS((()=>({}))),Re.XP));case"updateLAL":return bn(i.locallyLiftedQueriesByEvent["!UpdateLookalikeModels"]||[]);case"updateTPD":return bn([...i.locallyLiftedQueriesByEvent["!UpdateSecondPartyData"]||[],...i.locallyLiftedQueriesByEvent["!UpdateThirdPartyData"]||[]]);default:return bn([])}})))}(e,n)})),yn((t=>{let{event:n,queriesToProcess:i}=t;return(0,r.zG)(i,g.EQ((()=>bn(g.bM())),(t=>(0,r.zG)(dn((t=>"bootstrap"!==e?t.effects:{...t.effects,getCurrentTime:()=>n.time,getCurrentView:()=>n.view_id,getCurrentSession:()=>n.session_id})),yn((e=>(0,r.zG)(t,Pn((e=>dn((t=>(0,r.bc)(e,t.queries.locallyLiftedQueries[e]??t.cloudLiftQueriesForReplay[e]))))),yn((t=>Ln(B.t$((0,r.bc)(t,n)),e))))))))))})))}const Ln=(e,t)=>(0,r.zG)(e,B.EQ((e=>{let[n,i]=e;return(0,r.zG)(n,Pn((e=>{let[n,r]=e;return jn(n,B.t$([r,i]),t)})))}),Pn((e=>{let[t,n,r]=e;return jn(t,B.F2([n,r]))}))),vn(sn.sequenceArray),zn(c.fw(En)((e=>{let[,t]=e;return ln((0,p.rO)({persistentState:(0,p.rO)({internalStateMap:e=>({...e,...t})})}))}))),vn(g.Yo)),jn=(e,t,n)=>(0,r.zG)(dn(B.it((i=>{var o,s,u;const f=n??i.effects,l=(0,r.zG)(t,B.EQ(a.li,a.li)),d=(0,r.zG)(t,B.UI(a.Yg),B.fS((e=>{let[t,n]=e;return t.lift(n,f)}))),p=(0,r.zG)(i.persistentState.externalStateMap,c.tS((0,r.ls)(Re.P5(e),c.UI(Vn)))),m=i.persistentState.internalStateMap[e]||{checksum:i.queries.metadata[e]},v=Wn(e,f,l,m,p,d),h=Boolean(null===(o=v.result)||void 0===o?void 0:o.result)!==Boolean(null===(s=i.persistentState.internalStateMap[e])||void 0===s||null===(u=s.result)||void 0===u?void 0:u.result),b=(0,r.zG)(g.lo(h),g.UI((()=>{var t;return{name:null!==(t=v.result)&&void 0!==t&&t.result?"SegmentEntry":"SegmentExit",time:f.getCurrentTime(),view_id:f.getCurrentView(),session_id:f.getCurrentSession(),properties:{...i.pageviewProperties,segment_number:Number(e)}}})));return(0,r.bc)(v,b)}),(t=>`Failed to interpret query ${e}. Got ${t}`))),yn(B.EQ((e=>bn([[e],Re.cS,g.cS])),(t=>{let[n,i]=t;return(0,r.zG)(n.dropExternalState?Nn(e):bn(void 0),vn((()=>[g.cS,{[e]:n},i])))})))),Nn=e=>ln((0,p.rO)({persistentState:(0,p.rO)({externalStateMap:c.UI(Re.EG(e))})}));function $n(e){const t=e=>t=>(0,r.bc)(e,t);return dn((n=>(0,r.zG)(e,g.pO(fn.aL(((e,t)=>{const n=Hn(e);return(0,r.zG)(t,g.zT((e=>Hn(e)===n)),(e=>{let{init:t,rest:n}=e;return(0,r.bc)(t,n)}),(0,a.pL)(((e,t)=>n=>(0,r.bc)(e,(0,r.zG)(n,g.Ce(t))))(n,e)))}))),g.tS((e=>{let[i,o]=e;if(!i)return(0,r.zG)(o,g.UI(t("event")));const c=(0,r.zG)(o,g.yW((e=>n.lookalikeTransitionSegmentNumbers.has(e.properties.segment_number))),(e=>e?"lookalikeTransition":"transition"));return(0,r.zG)(o,fn.ut(((e,n)=>(0,r.zG)(e,g.UI(t("event")),g.R3((0,r.zG)(n,t(c)))))))})))))}const Qn=(0,r.ls)(Re.hX((e=>{var t;return Boolean(null===(t=e.result)||void 0===t?void 0:t.result)})),Re.XP,g.UI(parseInt)),Bn=(0,r.ls)(Ht((e=>e.activations??{})),on((0,r.zG)(Boolean,(0,Ye.xD)((0,Ye.ff)(Qt)))));function Hn(e){var t;return("SegmentEntry"===e.name||"SegmentExit"===e.name)&&void 0!==(null===(t=e.properties)||void 0===t?void 0:t.segment_number)}const Kn=I,Vn=(0,r.ls)(ne,B.fS(Kn)),Wn=(e,t,n,i,o,a)=>{const s={...i.activations},u={...t,setSegmentActivation:(t,n,r)=>{if(r!=e)throw new Error(`QL called setSegmentActivation for query ${r} while interpreting query ${e}`);t in s?s[t].includes(n)||(s[t]=[...s[t],n]):s[t]=[n]}},f=Vn(i.state||null),l=Vn(a),d=(0,r.zG)(B.Y3((()=>Ae(f,l)),un.w),B.pF((e=>{throw(0,un.w)(`Failed to append lifted event ${ee(l)} to internal state ${ee(f)}. Got ${e}`)}))),[g,p]=(0,r.zG)(o,c.g_((()=>(0,r.bc)(d,!1)),(e=>(0,r.zG)(B.Y3((()=>(0,r.bc)(Ae(d,e),!1)),r.Q1),B.fS((()=>(0,r.bc)(d,!0))))))),m=te(d),v=n.interpret(te(g),u);return{checksum:i.checksum,...null===m?{}:{state:m},...!1===v.result?{}:{result:v},...Qt(s)?{}:{activations:s},...!1===p?{}:{dropExternalState:p}}},Jn=c.Eh({equals:(e,t)=>e===t});function Xn(e){let t,n=!1;return()=>(n||(t=e(),n=!0),t)}function Zn(e){const t=Xn((()=>(0,r.zG)(e,Re.hX((e=>{var t;return Boolean(null===(t=e.result)||void 0===t?void 0:t.result)})),Re.UI((()=>!0)),(e=>({"1p":e}))))),n={"3p":{}},i=Xn((()=>({...t(),...n})));return{getSegments:i,getSegmentsArray:Xn((()=>er(i()))),get1PSegments:t,get3PSegments:()=>n}}function er(e){return Object.keys(e).reduce(((t,n)=>{const r=Object.keys(e[n]),i=[];return r.forEach((t=>{!0===e[n][t]&&i.push(t)})),t[n]=i,t}),{})}const tr=e=>({name:"",properties:{},session_id:e.getCurrentSession(),view_id:e.getCurrentView(),time:e.getCurrentTime()}),nr=(e,t)=>n=>r=>{const i=e.startSpan(t),o=n(r);return i.finish(),o};var rr=n(706),ir=n(656);const or=()=>e=>((0,r.zG)(e,o.UI((e=>e()))),o.a9({newResults:d.of(g.cS),pendingEvents:g.cS})),cr=()=>()=>Fe.of((()=>({}))),ar=e=>[e,mt.of(e)],sr=a.li,ur=a.Yg,fr=e=>t=>(0,r.zG)(ur(t),(t=>()=>new Promise((n=>{const r=t();r.then(c.G).then(n);const i=(0,_.HJ)((()=>n(c.YP)),e);r.then(i)})))),lr="RefEventual",dr=o.UI(ar),gr=e=>t=>o.vP((0,r.zG)(t,o.UI(sr),o.UI(e)),(0,r.zG)(t,o.UI(ur),o.UI(mt.UI(e)))),pr=e=>t=>o.vP((0,r.zG)(o.vP((0,r.zG)(e,o.UI(sr)),(0,r.zG)(t,o.UI(sr))),o.UI((e=>{let[t,n]=e;return n(t)}))),(0,r.zG)(o.vP((0,r.zG)(e,o.UI(ur)),(0,r.zG)(t,o.UI(ur))),o.UI((e=>{let[t,n]=e;return mt.ap(t)(n)})))),mr=e=>t=>(0,r.zG)(t.current,fr(e),mt.UI(c.fS((()=>(e=>sr(e.current))(t))))),vr=o.UI(sr),hr=o.UI(ur),br={URI:lr,map:(e,t)=>gr(t)(e)},yr={URI:lr,map:br.map,ap:(e,t)=>pr(t)(e)},wr=e=>i.dQ((t=>{let{previousState:n}=t;const[i,s]=(0,r.zG)(e.newEvents,o.En(2,g.uZ()),(0,rr.H5)(or(e.permutiveApi,e.permutiveUrls,(u=e.customQueries,(0,r.zG)(Object.entries(u.queriesByEvent),g.hX((e=>{let[,t]=e;return(0,r.zG)(t,g.G((e=>e in u.cloudLiftedQueries)))})),g.UI(a.li))))));var u;const f=o.vP({lookalikeModels:e.lookalikeModels,sessionId:e.sessionId,thirdPartyData:(0,r.zG)(e.thirdPartyData,o.UI(c.UI((0,rr.H5)(Re.UI((e=>{const t={};return e.forEach((e=>t[e]=!0)),t})))))),viewId:e.viewId}),l=(0,r.zG)(o.vP({cloudLiftedState:(0,r.zG)(s,o.UI((e=>e.newResults))),environment:f,externalStateDelta:e.externalStateDelta,newEvents:(0,r.zG)(i,(0,ir.I)(e.metrics,"query_language_began_processing_pageview"))}),o.UI((0,p.rO)({environment:e=>d.of(e)})),o.UI((0,Ue.Yt)(d.G5))),m=an.init(n);const v=(0,r.zG)(n?mt.of({processedState:m,stateMigratedThisInitialisation:!1}):(e.metrics.track({name:"sdk_query_state_migrated_workerisation_count_total",labels:{},value:1}),(0,r.zG)(e.migratedStateMaps,mt.UI((e=>{let{internal:t,external:n}=e;return{stateMigratedThisInitialisation:!0,processedState:{externalStateMap:n,internalStateMap:(0,r.zG)(t,c.fS((()=>({}))))}}})))),mt.Hr("environment",(()=>f.current)),mt.ak("process",(t=>{let{environment:n,processedState:i}=t;return(0,r.zG)((o={downloadCloudLiftQueries:cr(e.permutiveApi,e.permutiveUrls),environment:n,initialState:i,pastEvents:e.priorEvents,queries:e.customQueries},(0,r.zG)(mt.Do,mt.Hr("invalidatedLocalQueries",(()=>(0,r.zG)(o.queries.locallyLiftedQueries,Re.z7((e=>{var t;return(null===(t=o.initialState.internalStateMap[e])||void 0===t?void 0:t.checksum)!==o.queries.metadata[e]}))))),mt.Hr("invalidatedCloudLiftQueries",(()=>(0,r.zG)(o.queries.cloudLiftedQueries,Re.z7((e=>{var t;return(null===(t=o.initialState.internalStateMap[e])||void 0===t?void 0:t.checksum)!==o.queries.metadata[e]}))))),mt.Hr("hasInvalidatedQueries",(e=>{let{invalidatedCloudLiftQueries:t,invalidatedLocalQueries:n}=e;return!(Re.xb(t)&&Re.xb(n))})),mt.ak("eventsForReplay",(e=>{let{hasInvalidatedQueries:t}=e;return t?o.pastEvents:mt.of(g.bM())})),mt.ak("cloudLiftQueriesForReplay",(0,r.ls)(c.DT((e=>e.eventsForReplay.length>0)),c.UI((e=>Object.keys(e.invalidatedCloudLiftQueries))),c.hX(g.Od),c.UI((0,r.ls)(o.downloadCloudLiftQueries,Fe.OV(o.queries.env),mt.UI(B.fS((()=>({})))))),c.fS((()=>mt.of({}))))),mt.Hr("queriesForReplay",(e=>{let{cloudLiftQueriesForReplay:t,invalidatedLocalQueries:n}=e;return[...Object.keys(n),...Object.keys(t)]})),mt.Hr("internalStateMap",(e=>{let{invalidatedCloudLiftQueries:t,invalidatedLocalQueries:n}=e;return(0,r.zG)(o.queries.metadata,Re.Su(((e,r)=>e in n||e in t?{checksum:r}:o.initialState.internalStateMap[e])))})),mt.Hr("persistentState",(e=>{let{internalStateMap:t}=e;return{...o.initialState,internalStateMap:t}})),mt.UI((e=>{let{cloudLiftQueriesForReplay:t,eventsForReplay:n,queriesForReplay:i,persistentState:a}=e;return{bootstrapped:!1,cloudLiftQueriesForReplay:t,effects:{getCurrentTime:()=>new Date,getCurrentSession:()=>o.environment.sessionId,getCurrentView:()=>o.environment.viewId,getLookalikeModels:()=>({}),setSegmentActivation:(e,t,n)=>{throw new Error(`setSegmentActivation() called for segment ${n} without being overridden first.`)},...Zn(a.internalStateMap)},eventsForReplay:n,lal:c.YP,locallyLiftedQueriesByEvent:(0,r.zG)(o.queries.queriesByEvent,Re.DZ(c.KQ(g.hX((e=>e in o.queries.locallyLiftedQueries))))),lookalikeTransitionSegmentNumbers:(0,r.zG)(o.queries.queriesByEvent["!UpdateLookalikeModels"]||g.cS,g.UI(parseInt),(e=>new Set(e))),pageviewProperties:{},numEventsForReplay:n.length,queries:o.queries,queriesForReplay:i,persistentState:a,tpdEventsToProcess:g.cS,tpdHashInEffectsObject:c.YP,tpdQueries:c.YP,tpdReady:!1}})))),e.trace.traceTask("query_language_initialisation_duration"),mt.UI((0,p.bw)((t=>{var n;e.metrics.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"query_language_ready",time_origin:"sdk_init"},performance.now()),e.metrics.trackCounter({name:"sdk_queries_to_replay_count",value:(n=t,0===n.numEventsForReplay?0:n.queriesForReplay.length),labels:{}})}))),mt.UI((t=>{let n=t;return t=>{const[i,o]=(0,r.zG)(t,On(e.trace))(n);return n=o,[i,o.persistentState]}})));var o})),o.fF),h=(0,r.zG)(v,o.UI(c.UI((e=>e.process)))),b=(0,r.zG)(v,o.UI(c.EQ((()=>!1),(e=>e.stateMigratedThisInitialisation))));let y=g.bM();const w=(0,r.zG)(o.vP({processInput:h,inputIO:(0,r.zG)(l,o.UI(c.G))}),o.UI((0,Ue.Yt)(c.G5)),o.UI(c.UI((e=>{let{processInput:t,inputIO:n}=e;const i=n(),[o,s]=(0,r.zG)(i,(0,p.rO)({newEvents:g.UI(a.Yg),cloudLiftedState:g.UI((e=>e.state))}),(e=>t({...e}))),u=(0,r.zG)(o,c.EQ((()=>({errors:[],events:i.newEvents,internalStateDiff:c.YP})),(e=>{let[t,n,r]=e;return{errors:t,events:i.newEvents.concat(r.map((e=>[(0,p.k$)(),e]))),internalStateDiff:c.G(n)}})));return y=(0,r.zG)(y,g.R3(u)),{consumeDeltas:()=>{const e=y;return y=g.cS,e},modelState:s}})))),S=(0,r.zG)(w,o.UI(c.UI((e=>e.modelState)))),_=(0,r.zG)(w,o.UI(c.UI((e=>e.consumeDeltas))),o.UI(c.fS((()=>d.of(g.bM()))))),I=(0,r.zG)(o.vP(S,s),o.Rp(((e,t)=>{let[n,i]=t;const o=(0,r.zG)(e,c.UI((e=>{let[,t]=e;return(0,r.zG)(n,c.EQ((()=>t),(e=>(0,r.zG)(t,g.hX((t=>!t(e,i.pendingEvents)))))))})),c.fS((()=>g.bM())));if(c.pC(n)&&g.xb(i.pendingEvents))return[ar(n.value),o];const a=(0,p.b2)(),s=(0,r.zG)(n,c.fS((()=>m)));var u;return[(0,r.zG)((()=>a.promise),(u=s,e=>[u,e])),(0,r.zG)(o,g.R3(((e,t)=>{const n=g.xb(t)||(0,r.zG)(i.pendingEvents,g.yW((e=>!t.includes(e))));return n&&a.resolve(e),n})))]})),o.UI(a.li)),E=(0,r.zG)(_,o.En(3,g.uZ()),(t=>{let[n,i,a]=t;return{errors:(0,r.zG)(n,o.UI(d.UI(g.tS((e=>e.errors))))),events:(0,r.zG)(i,o.UI(d.UI(g.tS((e=>e.events)))),(0,ir.F)(e.metrics,"query_language_processed_pageview")),internalStateDiff:(0,r.zG)(a,o.UI(d.UI((0,r.ls)(g.DZ((e=>e.internalStateDiff)),c.DT(g.Od),c.UI((e=>e.reduce(((e,t)=>({...e,...t})))))))))}})),G=(0,r.zG)(I,gr((e=>e.internalStateMap))),z=vr(G);return{state:vr(I),value:{...E,stateMigratedThisInitialisation:b,internalStateMap:z,processing:(0,r.zG)(o.vP(w,s),o.UI((e=>{let[t,n]=e;return c.Wi(t)||g.Od(n.pendingEvents)}))),segments:(0,r.zG)(G,gr(Sr)),tpdUsage:(0,r.zG)(o.vP(e.thirdPartyData,z),o.UI((e=>{let[t,n]=e;return(0,r.zG)(t,c.UI((()=>Bn(n))))})))}}})),Sr=e=>(0,r.zG)(Qn(e),(e=>(0,r.zG)(e,g.uK((e=>e<1e7)),(t=>{let{left:n,right:r}=t;return{all:e,custom:r,standard:n}}))));n(856);const _r=je.UI(br,B.dO),Ir=(B.G5,e=>gr(B.F2)(e)),Er=e=>gr(B.fS(e)),Gr=e=>vr(e.all),zr=(e,t)=>n=>({all:(0,r.zG)(n,_r(e)),byAdServer:(0,p.mQ)((0,r.ls)(t,c.UI((e=>(0,r.zG)(n,_r(e))))))}),Ur=e=>(0,r.zG)(e,gr(B.F2),zr(r.yR,(e=>c.G(e.filterCohorts)))),kr=e=>({all:(0,r.zG)(e.all,Er((()=>g.bM()))),byAdServer:(0,p.mQ)((0,r.ls)(e.byAdServer,c.UI(Er((()=>g.bM())))))}),qr=e=>(0,r.zG)(e,kr,Gr);var Pr=n(548);const Tr=e=>i.dQ((0,r.ls)((e=>{let{previousState:t}=e;return function(e){if(e&&"object"==typeof e)return{previousUnloadEvents:"previousUnloadEvents"in e?Or(e.previousUnloadEvents):[]};return{previousUnloadEvents:[]}}(t)}),(t=>{let{previousUnloadEvents:n}=t;n.forEach((t=>e.eventsCache.add((0,Pr.k)(t),{persistOnDisk:!0})));return{value:{newEvents:(0,r.zG)(e.newEvents,o.UI(d.UI((0,p.bw)(g.UI((t=>{let[,n]=t;Cr.has(n.name)||e.eventsCache.add(n,{persistOnDisk:!0})})))))),priorEvents:()=>e.eventsCache.all()},state:(0,r.zG)(e.eventsToProcessOnPageUnload,o.UI(g.hX((e=>{let[,t]=e;return!Cr.has(t.name)}))),o.UI(g.UI((0,r.ls)(a.Yg,Pr.X))),o.UI((e=>({previousUnloadEvents:e}))))}})));function Or(e){return e&&Array.isArray(e)?e:[]}const Cr=new Set(["AdRequest","PageviewEngagement","PrebidAuctions","Reaction","SegmentEntry","SegmentExit","SlotRendered","ThirdPartySegments","VideoEngagement"]),Dr=function(){return(0,r.bc)(...arguments)},xr=e=>(0,r.zG)(i.K4((t=>{let{stopped:n}=t;const[i,a]=o.Ue(o.a9(d.of(c.YP)));let s;const u=new Promise((e=>{s=e}));return{priorEvents:()=>u.then((e=>e())),externalStateDelta:o.xH(i),newEvents:(0,r.zG)(o.vP(e.newEvents,n),o.UI((e=>{let[t,n]=e;return n?()=>[]:t}))),setCachedPriorEvents:s,setExternalStateDelta:a}})),i.ak("segmentationService",(t=>{let{newEvents:n,priorEvents:r,externalStateDelta:i}=t;return wr({...e,externalStateDelta:i,newEvents:n,priorEvents:r})})),i.UI((t=>(0,r.zG)(t.segmentationService.events,o.En(4,g.uZ()),(n=>{let[i,s,u,f]=n;return{...t,newEvents:i,realtime:(0,r.zG)(s,o.Rp(!1,((e,t)=>{const n=t();return e||n.some((e=>{let[,t]=e;return"Pageview"===t.name}))})),(e=>o.vP(e,t.segmentationService.processing)),o.UI((e=>{let[t,n]=e;return t&&!n})),o.u4(((e,t)=>e||t))),currentPageviewSegments:(l={processedEvents:(0,r.zG)(u,o.UI(d.UI(g.UI(a.Yg)))),segments:t.segmentationService.segments,viewId:e.viewId},(0,r.zG)(o.vP(l.processedEvents,l.viewId,l.segments),o.Rp({pageviewProcessed:!1,resolvePageviewSegments:e=>{},segments:ar({all:[],custom:[],standard:[]}),viewId:""},((e,t)=>{let[n,i,o]=t;const a=n();return(0,r.zG)(e,c.DT((e=>e.viewId===i)),c.EQ((()=>{if((0,r.zG)(a,g.G((e=>"Pageview"===e.name&&e.view_id===i))))return{pageviewProcessed:!0,resolvePageviewSegments:()=>{},segments:o,viewId:i};{const e=(0,p.b2)();return{pageviewProcessed:!1,resolvePageviewSegments:t=>e.resolve(ur(t)()),segments:Dr(sr(o),(()=>e.promise)),viewId:i}}}),(e=>e.pageviewProcessed?{...e,segments:o}:(0,r.zG)(a,g.G((e=>"Pageview"===e.name&&e.view_id===i)))?(e.resolvePageviewSegments(o),{pageviewProcessed:!0,resolvePageviewSegments:()=>{},segments:o,viewId:i}):{...e,segments:o})))})),o.UI((e=>e.segments)))),lastProcessedEvents:(0,r.zG)(f,o.UI(d.UI(g.UI(a.Yg))))};var l})))),i.Hr("cohorts",(t=>{let{segmentationService:n}=t;return(0,r.zG)(o.fF(e.nonQlCohorts),o.UI(c.UI((e=>(0,r.zG)(n.segments,gr((e=>e.all)),gr(g.UI(String)),Ur,(t=>({query_language:t,...e})))))))})),i.ak("stateSync",(t=>{let{segmentationService:n,lastProcessedEvents:r}=t;return Ft({eventSourceId:e.eventSourceId,groupId:e.groupId,groupIdIsNewlyGenerated:e.groupIdIsNewlyGenerated,internalStateDiff:n.internalStateDiff,internalStateMap:n.internalStateMap,lastProcessedEvents:r,logger:e.logger,permutiveApi:e.permutiveApi,permutiveUrls:e.permutiveUrls,queryLanguageProcessing:n.processing,reportError:e.reportError,sessionId:e.sessionId,viewId:e.viewId})})),i.bw((e=>{let{stateSync:t,setExternalStateDelta:n}=e;return n(t.externalStateDelta)})),i.ak("segmentTransitions",(t=>{let{segmentationService:n}=t;return(e=>(0,r.zG)(i.vP({currentSegmentsSet:i.K4((()=>(0,r.zG)(e.segments,o.UI(u))))}),i.ak("transitionsSinceInit",(e=>{let{currentSegmentsSet:t}=e;return i.of(s(t))})),i.UI((e=>{let{currentSegmentsSet:t,...n}=e;return n}))))({segments:(0,r.zG)(vr(n.segments),o.UI((e=>e.all))),viewId:e.viewId})})),i.Hr("cohortsRef",(e=>{let{cohorts:t}=e;return(0,r.zG)(t,o.VS(c.EQ((()=>o.a9(g.bM())),(0,r.ls)((e=>Object.values(e)),g.UI((0,r.ls)(kr,(e=>e.all),vr,o.D8(g.Eh(v.Eq)))),g.vP(o.g1),o.UI(g.xH)))))})),i.Hr("createTrackRequest",(t=>{let{cohortsRef:n,segmentationService:i}=t;return(0,r.zG)(o.vP({cohorts:(0,r.zG)(n,o.UI(c.G)),qlSegments:(0,r.zG)(vr(i.segments),o.UI(c.G)),webClient:e.webClient}),o.UI((0,Ue.Yt)(c.G5)),o.UI(c.UI((t=>{let{cohorts:n,qlSegments:r,webClient:i}=t;return t=>({...t,segments:r.all,user_id:e.groupId,cohorts:n,properties:{...t.properties,client:{...i,...t.properties.client??{}}}})}))))})),e.trackPageviewComplete?(0,r.ls)(i.ak("pageviewComplete",(t=>{let{newEvents:n}=t;return h({currentTimestampSecs:e.currentTimestampSecs,events:n,sessionId:e.sessionId,viewId:e.viewId})})),i.UI((e=>{let{pageviewComplete:t,...n}=e;return{...n,eventsToCacheOnPageUnload:t.eventsToProcessOnPageUnload,eventsToPublishOnPageUnload:(0,r.zG)(o.vP(n.createTrackRequest,t.eventsToProcessOnPageUnload),o.UI((e=>{let[t,n]=e;return(0,r.zG)(t,c.EQ((()=>g.cS),(e=>(0,r.zG)(n,g.UI((0,a.H5)(e))))))}))),newEvents:t.eventsToProcessImmediately}}))):i.UI((e=>({...e,eventsToCacheOnPageUnload:o.a9(g.cS),eventsToPublishOnPageUnload:o.a9(g.cS)}))),i.ak("eventCache",(t=>{let{eventsToCacheOnPageUnload:n,newEvents:o,setCachedPriorEvents:c}=t;return(0,r.zG)(e.eventsCache,B.EQ((e=>(c(e),i.of({newEvents:o}))),(e=>(0,r.zG)(Tr({eventsCache:e,eventsToProcessOnPageUnload:n,newEvents:o}),i.UI((e=>{let{newEvents:t,priorEvents:n}=e;return c(n),{newEvents:t}}))))))})),i.UI((e=>({...e,newEvents:e.eventCache.newEvents}))),i.Hr("eventsToPublish",(t=>{let{cohorts:n,newEvents:i,segmentationService:s}=t;return(0,r.zG)(o.vP(i,e.webClient,s.segments,(0,r.zG)(n,o.UI(c.UI((0,r.ls)((e=>Object.values(e)),g.UI(kr),g.UI((e=>e.all))))))),o.UI((t=>{let[n,i,o,s]=t;return(0,r.zG)(c.Do,c.Qt("webClient",i),c.Qt("cohorts",s),c.ak("events",(()=>(0,r.zG)(n(),c.DT(g.Od)))),ht,xt("segments",(()=>(0,r.zG)(ur(o),yt))),Dt((e=>(0,r.zG)(e.cohorts,mt.uU(mr(1e3)),mt.UI(g.xH),mt.UI((t=>({...e,cohorts:t})))))),It((t=>{let{cohorts:n,events:i,segments:o,webClient:c}=t;return(0,r.zG)(i,g.UI((0,a.H5)((t=>({...t,segments:o.all,user_id:e.groupId,cohorts:n,properties:{...t.properties,client:{...c,...t.properties.client??{}}}})))))})),mt.UI(c.fS((()=>g.bM()))))})),(e=>{const[t,n]=o.gS(g.uZ());return(0,r.zG)(e,o.UI((e=>e().then(n)))),t}))})));var Ar=n(963);function Mr(e){return t=>(0,r.zG)(o.oQ(e),o.UI((0,p.rO)({backoffAfterErrorMs:e=>e??0,backoffAfterSuccessMs:e=>e??0})),(e=>i.dQ((n=>{let{previousState:i}=n;const[a,s]=o.Ue(function(e){if("object"!=typeof e||null===e)return{lastSuccess:0,lastError:0};return e}(i)),u=(0,r.zG)(o.vP(a,e),o.UI((e=>{let[t,n]=e;return Math.max(t.lastError+n.backoffAfterErrorMs,t.lastSuccess+n.backoffAfterSuccessMs)})));return{state:a,value:(0,r.ls)(c.DT((()=>Date.now()>=u.current)),c.UI(t),c.UI((0,p.bw)((e=>e.then((()=>s({...a.current,lastSuccess:Date.now()})),(()=>s({...a.current,lastError:Date.now()})))))))}}))))}const Rr=function(e,t){return i.of(c.YP)};var Yr=n(930);const Fr=["pug"],Lr=function(e,t){return(0,r.zG)(jr(e),Mr({backoffAfterErrorMs:6e5}),i.VS((e=>Yr.m((0,r.zG)(t,o.UI((0,p.rO)({tpdUsage:c.UI((0,r.ls)(Re.UI(Re.z7((e=>!Fr.includes(e)))),Re.hX((0,Ye.ff)(Re.xb))))})),o.UI((t=>{let{tpdUsage:n,userId:i}=t;return{validityKey:()=>i,freshnessKey:(0,r.ls)((()=>n),c.EQ((()=>0),(0,r.ls)(JSON.stringify,p.vp))),refresh:(0,r.zG)(n,c.hX((e=>Object.keys(e).length>0)),c.UI(Fe.it((t=>(0,r.zG)(e({user_id:i,time:new Date,tpd_segments:t}),c.fS((()=>Promise.reject("Blocked by backoff."))))),(e=>`Failed to report TPD usage. Got ${e}`))))}})))))),i.UI(r.Q1))};const jr=e=>t=>{const{config:n,metrics:r,permutiveApi:i,permutiveUrls:o}=e,a=r.startTimer("sdk_http_tpd_usage_seconds",{});return i.req({url:o.getEndpointUrl("/tpd/usage",c.G(n.apiVersion)),method:"POST",payload:t,contentType:"text/plain",dataType:"json",withCredentials:!1}).then((e=>(r.stopTimer("sdk_http_tpd_usage_seconds",a),e)))};function Nr(e,t){const n=["amp","gigya","pxid","sailthru"],a=(0,r.zG)(t.identities,o.UI(c.UI(Re.z7((e=>!n.includes(e)))))),s=e=>(0,p.vp)(JSON.stringify(e)),u=e=>[s(e),e];return(0,r.zG)(i.vP({fetchFromNewEndpoint:(0,r.zG)($r(e),Mr({backoffAfterErrorMs:6e5})),fetchFromLegacyEndpoint:(0,r.zG)(Qr(e),Mr({backoffAfterErrorMs:6e5}))}),i.VS((n=>{let{fetchFromNewEndpoint:s,fetchFromLegacyEndpoint:f}=n;return(0,r.zG)(Yr.m((0,r.zG)(o.vP(t.userId,t.sessionId,a),o.UI((t=>{let[n,i,o]=t;return{validityKey:()=>n,freshnessKey:()=>`${Br(o)},${i}`,refresh:(0,r.zG)(o,c.UI((t=>Re.xb(t)?Fe.of({}):Fe.Y3((()=>(0,r.zG)((t=>(0,r.zG)(s(t),c.UI((e=>e.catch((()=>(0,r.zG)(f(t.identities),c.fS((()=>e))))))),c.wp((()=>f(t.identities))),c.UI((0,p.bw)((t=>{const n=e.metrics.startTimer("sdk_get_third_party_data_task_duration_seconds",{});t.catch(r.Q1).then((()=>{e.metrics.stopTimer("sdk_get_third_party_data_task_duration_seconds",n)}))})))))({userId:n,identities:t}),c.fS((()=>Promise.reject("Blocked by persistent backoff"))))),(e=>`Error fetching TPD. Got ${e}`)))),c.UI(Fe.UI(u)))}})))),Yr.d((e=>c.G((e=>Array.isArray(e)?e:u(e))(e)))),i.UI(o.UI(B.fS((t=>(e.logger.warn("[TPD]",`Failed to retrieve usable value, using zero value. ${t}`),c.G(u({}))))))),i.bw((0,r.ls)(o.UI(c.pC),o.UI((t=>{t&&e.metrics.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"audience_matching_ready",time_origin:"sdk_init"})})))))})))}const $r=e=>async t=>{const n=e.metrics.startTimer("sdk_http_audience_matching_seconds",{}),i=await e.permutiveApi.req({url:e.permutiveUrls.getAudienceMatchingEndpointUrl("/id",c.G("v1"),t.userId),payload:{identities:(0,r.zG)(t.identities,Re.Yz,g.UI((e=>{let[t,n]=e;return{tag:t,id:n}})))},method:"POST",withCredentials:!1,dataType:"json"});return e.metrics.stopTimer("sdk_http_audience_matching_seconds",n),i.items},Qr=e=>async t=>{const n=e.metrics.startTimer("sdk_http_tpd_seconds",{}),r=await e.permutiveApi.req({url:e.permutiveUrls.getEndpointUrl("/tpd",c.G(e.config.apiVersion)),method:"POST",payload:{user_id:t},contentType:"text/plain",dataType:"json",withCredentials:!1});return e.metrics.stopTimer("sdk_http_tpd_seconds",n),r},Br=(0,r.ls)(JSON.stringify,p.vp);const Hr=(e,t)=>(0,r.zG)(i.vP({data:Nr(e,{identities:t.identities,sessionId:t.sessionId,userId:t.userId}),usageReporting:Lr(e,o.vP({tpdUsage:t.tpdUsage,userId:t.userId}))}),i.ak("analytics",(e=>{let{data:n}=e;return function(e){return i.dQ((t=>{let{previousState:n}=t;const[i,a]=o.gS(g.uZ());var s;return{state:(0,r.zG)(o.vP(e.userId,e.providerSegments,e.sessionId,e.viewId),o.D8(((e,t)=>{let[n,r]=e,[i,o]=t;return n===i&&r===o})),o.Rp(null!==(s=n)&&"object"==typeof s?s:{userId:"",providerHashes:{}},((e,t)=>{let[n,i,o,s]=t;const u=(0,r.zG)(i,c.fS((()=>({})))),f=(0,r.zG)(u,Re.UI((0,p.SL)(p.vp))),l=(0,r.zG)(e,c.DT((e=>e.userId===n)),c.UI((e=>e.providerHashes)),c.fS((()=>({}))));return(0,r.zG)(u,Re.z7((e=>f[e]!==(l[e]||0))),(e=>Object.entries(e)),g.UI((e=>{let[t,n]=e;return(0,r.bc)((0,p.k$)(),{name:"ThirdPartySegments",properties:{data_provider:t,segments:[...n]},session_id:o,time:new Date,view_id:s})})),a),{userId:n,providerHashes:f}}))),value:i}}))}({providerSegments:(0,r.zG)(n,o.UI(c.UI(rr.Yg))),sessionId:t.sessionId,userId:t.userId,viewId:t.viewId})})),i.UI((e=>{let{data:t,analytics:n}=e;return{data:t,analyticsEvents:n}}))),Kr=function(e){const t={include_geo:!0,include_isp:!0,include_ip_hash:!0,include_ip:!1},n=e.trace.startSpan("geoip_data_retrieval");return(0,r.zG)(Yr.m((0,r.zG)(e.sessionId,o.UI((n=>({validityKey:()=>(0,p.vp)(JSON.stringify(t)),freshnessKey:()=>n,refresh:c.G(Fe.Y3((()=>Vr(e.permutiveApi,e.metrics,e.config,t,e.permutiveUrls)),(e=>`Error fetching geoip. Got ${e}`)))}))))),i.UI(o.UI(B.fS((t=>(e.logger.warn("[geoip]",`Failed to retrieve usable value, using zero value. ${t}`),c.G({})))))),i.bw((0,r.ls)(o.UI(c.pC),o.UI((t=>{t&&(e.metrics.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"geoip_data_ready",time_origin:"sdk_init"},performance.now()),n.finish())})))))};const Vr=(e,t,n,r,i)=>{const o=[];r.include_geo&&o.push(["include","geo"]),r.include_isp&&o.push(["include","isp"]),r.include_ip&&o.push(["include","ip"]),r.include_ip_hash&&o.push(["include","ip_hash"]);const a=t.startTimer("sdk_http_geoip_seconds",{});return e.req({url:i.getEndpointUrl("/geoip",c.G(n.apiVersion),o),method:"GET",contentType:"text/plain",dataType:"json",withCredentials:!1}).then((e=>(t.stopTimer("sdk_http_geoip_seconds",a),e)))},Wr=e=>t=>{const n=r=>{const i={...r};for(let o in r){const c=r[o];t.hasOwnProperty(c)?null!=e&&e.dropUnenriched&&void 0===t[c]?delete i[o]:i[o]=t[c]:null!==c&&"object"==typeof c&&c.constructor===Object&&(i[o]=n(c))}return i};return n};var Jr=n(965);n(853);const Xr=function(e,t,n,r){return i.of({cohorts:c.YP,externalData:{[Zr]:o.a9(c.YP)}})};const Zr="_pssps",ei=e=>{const t=(0,r.zG)((null==e?void 0:e.dfp)??[],g.UI(String),(e=>new Set(e)));return{id:"dfp",filterCohorts:g.hX((e=>t.has(e)))}};const ti=e=>{if(!e.metrics.isEnabled())return()=>{};const t=(0,r.zG)(e.adServers,g.UI((e=>(0,r.bc)(e.id,e))),Re.sq,Re.UI((t=>{const n=(0,r.zG)(e.cohorts,Re.DZ((e=>e.byAdServer(t))),(e=>o.vP(e)),o.UI(Re.UI((i=5e3,a="Timeout",e=>(0,r.zG)(e,fr(i),mt.UI(c.pF((()=>B.t$(a)))))))),o.UI((0,Ue.Yt)(mt.Hi)),o.UI(mt.UI((0,r.ls)(Re.oh,Ne.Vn(Re.Su(((t,n)=>{e.logger.warn("[Targeting Metrics]",`[${t}]`,n)}))),Ne.F2))),(e=>()=>e.current));var i,a;return(0,r.ls)(g.of,g.UI((e=>e.cohorts)),ri,g.UI((e=>{let[t,n]=e;return{allCohorts:new Set(t),cohortCountByType:ni(t),requestCount:n}})),(i=>(0,r.zG)(n(),mt.UI(Re.Su(((t,n)=>(i,o)=>{(0,r.zG)(n,g.Hr("actualCohortCount",(e=>{let{cohortCountByType:t}=e;return(0,r.zG)(t,Re.P5(i))})),g.UI((n=>{const a={cohort_type:i,target:t},s=o.reduce(((e,t)=>n.allCohorts.has(t)?e+1:e),0),u=o.length-s;e.metrics.track({name:"sdk_ad_request_missed_cohorts",labels:a,value:n.requestCount*u}),e.metrics.track({name:"sdk_ad_request_successful_cohorts",labels:a,value:n.requestCount*s}),(0,r.zG)(n.actualCohortCount,c.UI((t=>{const r=t-s;e.metrics.track({name:"sdk_ad_request_superfluous_cohorts",labels:a,value:n.requestCount*r})})))})))})(t.id,i))))),(e=>e()))})));return e=>{if("AdRequest"===e.name)(n=e.properties).ad_server_id in t&&t[n.ad_server_id](n);var n}},ni=e=>({ql:(0,r.zG)(e,g.u4(0,((e,t)=>isNaN(parseInt(t))?e:e+1)))}),ri=e=>(0,r.zG)(e,g.pO((e=>{const{init:t,rest:n}=(0,r.zG)(e,g.zT((t=>t===e[0])));return[t,n]})),g.UI((e=>[e[0],e.length]))),ii=e=>c.YP;const oi=m.n_({cohorts:g.Eh((0,p.Or)()),ctx:(0,p.Or)()}),ci=g.cS;Promise.resolve(B.F2(ci)),m.n_({userId:(0,p.Or)(),lastSuccess:{equals:(e,t)=>e&&t&&oi.equals(e,t)||e===t}});const ai=m.n_({cohorts:Q.Eh(m.n_({code:v.Eq,groups:Q.Eh(Z.Eq)})),groups:Q.Eh(Z.Eq)}),si=(m.n_({userId:(0,p.Or)(),lastSuccess:{equals:(e,t)=>e===t||!!e&&!!t&&m.bc(v.Eq,ai).equals(e,t)}}),(e,t)=>(e.log("[advertiser] pass_cohorts_to_prebid: false"),{_pcrdbs:o.a9(c.YP),_pcrprs:o.a9(c.YP)}));const ui=function(e,t){return i.of({cohorts:c.YP,externalData:si(e.logger,c.YP)})};const fi=i.K4((()=>{}));const li=e=>t=>(0,r.zG)(e,Re.UI((e=>t.reduce(((t,n)=>t+Number(e.has(n))),0)))),di=e=>t=>{const{consent:n,currentTimestampSecs:s,identities:u,sessionId:f,userId:l,viewId:h,pageviewState:b}=t;return(0,r.zG)(i.K4((()=>{let n;const r=new Promise((e=>{n=e})),[i,a]=o.Ue(o.a9(c.YP));return{...t,adServers:[ei(e.optimisedActivationsConfig.dfp)],nonQlCohortsT:()=>r,setNonQlCohorts:n,setTpdUsage:a,tpdUsage:o.xH(i)}})),i.ak("geoip",(()=>(e=>(0,r.zG)(e,Kr,i.YO("data"),i.Hr("replacementMap",(e=>{let{data:t}=e;return(0,r.zG)(t,o.UI(c.UI((e=>{var t;return{$ip_geo_info:e.geo_info,$ip_geo_info_continent:null===(t=e.geo_info)||void 0===t?void 0:t.continent,$ip_isp_info:e.isp_info,$ip_address:e.ip,$ip_address_hash:e.ip_hash}}))))})),i.Hr("permutiveContext",(e=>{let{data:t}=e;return(0,r.zG)(t,o.UI(c.EQ((()=>({})),(e=>{var t,n,r,i,o,c,a,s,u;return{isp:null===(t=e.isp_info)||void 0===t?void 0:t.isp,organization:null===(n=e.isp_info)||void 0===n?void 0:n.organization,autonomous_system_number:null===(r=e.isp_info)||void 0===r?void 0:r.autonomous_system_number,autonomous_system_organization:null===(i=e.isp_info)||void 0===i?void 0:i.autonomous_system_organization,continent:null===(o=e.geo_info)||void 0===o?void 0:o.continent,country:null===(c=e.geo_info)||void 0===c?void 0:c.country,city:null===(a=e.geo_info)||void 0===a?void 0:a.city,province:null===(s=e.geo_info)||void 0===s?void 0:s.province,postal_code:null===(u=e.geo_info)||void 0===u?void 0:u.postal_code}}))))}))))({...e,sessionId:f}))),i.Hr("watson",(t=>{let{webClient:n}=t;return(0,r.zG)(e.watson,c.fS((()=>(0,r.zG)(n,o.UI(c.UI((e=>e.url))),o.D8(c.Eh(v.Eq)),(t=>(0,Jr.watson)({...e,pageUrl:t,watsonEnabled:(0,r.zG)(b,o.UI((e=>e.watsonEnabled)))}))))))})),i.ak("audienceMatching",(t=>{let{tpdUsage:n}=t;return Hr(e,{identities:u,sessionId:f,tpdUsage:n,userId:l,viewId:h})})),i.UI((e=>{let{audienceMatching:{analyticsEvents:t,...n},newEvents:i,...c}=e;return{...c,audienceMatching:n,newEvents:(0,r.zG)(o.vP(i,t),o.UI(d.RD),o.UI(d.UI(g.xH)))}})),i.UI((e=>{const[t,n,i]=o.Ue(c.bM()),[a,s]=(0,r.zG)(e.newEvents,o.En(2,g.uZ())),u=(0,r.zG)(o.vP(a,t),o.UI((e=>{let[t,n]=e;return(0,r.zG)(n,c.UI((e=>(0,r.zG)(t,d.UI(g.UI((0,p.bw)((t=>{let[,n]=t;return e(n)}))))))),c.fS((()=>d.of(g.bM()))))})));return{...e,newEvents:u,newEventsForAdvertiserSegmentation:s,collectTargetingSuccessMetrics:e=>{n(c.G(e)),i()}}})),i.ak("enrichedEvents",(t=>{let{enrichmentReplacementMap:n,geoip:s,newEvents:u,watson:f}=t;return(0,r.zG)(o.vP({misc:n,geoip:s.replacementMap,watson:f.replacementMap}),o.UI((0,Ue.Yt)(c.G5)),o.UI(c.UI((e=>{let{misc:t,geoip:n,watson:r}=e;return{...t,...n,...r}}))),(t=>i.K4((()=>((e,t,n,i)=>((0,r.zG)(t,o.UI(c.pC),o.YP((t=>{t&&e.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"event_enrichment_ready",time_origin:"sdk_init"})}))),(0,r.zG)(n,o.VS((()=>(0,r.zG)(o.vP((0,r.zG)(t,o.UI(c.UI(Wr({dropUnenriched:!0})))),i),o.UI((0,r.ls)((e=>{let[t,n]=e;return()=>(0,r.zG)(t,c.EQ((()=>[]),(e=>(0,r.zG)(n(),g.UI((0,a.H5)((0,p.rO)({properties:e})))))))})))))))))(e.metrics,t,l,u)))))})),i.UI((0,p.rO)({enrichedEvents:(0,ir.F)(e.metrics,"pageview_enriched")})),i.ak("lookalikeModels",(()=>(0,r.zG)(e.lookalikeModels,c.EQ((()=>(0,Ar.lookalikeModelsService)({...e,consent:n,currentTimestampSecs:s})),i.of)))),i.ak("queryLanguage",(n=>{let{audienceMatching:c,nonQlCohortsT:a,enrichedEvents:s,lookalikeModels:u,setTpdUsage:f,userIdIsNewlyGenerated:d}=n;return(0,r.zG)((g={...e,...t,newEvents:s,thirdPartyData:c.data,groupId:l,groupIdIsNewlyGenerated:d,nonQlCohorts:a,lookalikeModels:u,migratedStateMaps:e.migratedStateMaps},(0,r.zG)(o.vP(g.eventSourceId,g.groupId,g.groupIdIsNewlyGenerated),o.D8((0,r.zG)(v.Eq,m.Uz((e=>{let[t]=e;return t})))),i.kR((e=>{let[t,n,o]=e;return(0,r.zG)(xr({...g,eventSourceId:t,groupId:n,groupIdIsNewlyGenerated:o,migratedStateMaps:g.migratedStateMaps}),i.yi(t))})),i.UI((e=>({stateMigratedThisInitialisation:(0,r.zG)(e,o.VS((e=>e.segmentationService.stateMigratedThisInitialisation))),cohorts:(0,r.zG)(e,o.VS((e=>e.cohortsRef))),currentPageviewSegments:{all:(0,r.zG)(e,o.VS((e=>e.currentPageviewSegments)),gr((e=>e.all))),custom:(0,r.zG)(e,o.VS((e=>e.currentPageviewSegments)),gr((e=>e.custom))),standard:(0,r.zG)(e,o.VS((e=>e.currentPageviewSegments)),gr((e=>e.standard)))},eventsToPublish:(0,r.zG)(e,o.VS((e=>e.eventsToPublish))),eventsToPublishOnPageUnload:(0,r.zG)(e,o.VS((e=>e.eventsToPublishOnPageUnload))),realtime:(0,r.zG)(e,o.VS((e=>e.realtime)),o.Rp(!1,((e,t)=>e||t)),o.bw((e=>{e&&g.metrics.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"worker_realtime",time_origin:"sdk_init"},performance.now())}))),segments:{all:(0,r.zG)(e,o.VS((e=>vr(e.segmentationService.segments))),o.UI((e=>e.all))),custom:(0,r.zG)(e,o.VS((e=>vr(e.segmentationService.segments))),o.UI((e=>e.custom))),standard:(0,r.zG)(e,o.VS((e=>vr(e.segmentationService.segments))),o.UI((e=>e.standard)))},thirdPartyDataUsage:(0,r.zG)(e,o.VS((e=>e.segmentationService.tpdUsage))),transitionsSinceInit:(0,r.zG)(e,o.VS((e=>e.segmentTransitions.transitionsSinceInit)))}))))),i.bw((e=>{let{thirdPartyDataUsage:t}=e;return f(t)})));var g})),i.ak("classificationModels",(t=>{let{queryLanguage:r}=t;return Rr(e,o.vP({consent:n,currentTimestampSecs:s,queryLanguageCohorts:hr(r.currentPageviewSegments.all),realtime:r.realtime,userId:l}))})),i.ak("demandPartners",(n=>{let{queryLanguage:a}=n;return((e,t)=>(0,r.zG)(Xr(e.permutiveApi,e.permutiveUrls,e.reportError,t),i.UI((e=>{let{cohorts:t,externalData:n}=e;return{ssp:t,externalData:n}}))))(e,{cohorts:Ir(a.currentPageviewSegments.all),consent:t.consent,url:(0,r.zG)(t.webClient,o.UI(c.UI((e=>e.url))))})})),i.ak("advertiserSegmentation",(t=>{let{queryLanguage:r,newEventsForAdvertiserSegmentation:i}=t;return ui(e,o.vP({consent:n,customCohorts:hr(r.currentPageviewSegments.custom),realtime:r.realtime,sessionId:f,standardCohorts:hr(r.currentPageviewSegments.standard),userId:l,viewId:h,events:i}))})),i.ak("ipIdentifier",(e=>{let{userId:t,geoip:n}=e;return(0,r.zG)(n.data,o.UI(c.tS(c.KQ((e=>e.ip))))),fi})),i.ak("nonQlCohorts",(e=>{let{advertiserSegmentation:t,classificationModels:n,contextualCohorts:o,setNonQlCohorts:c,demandPartners:a,viewId:s}=e;return(0,r.zG)(i.of(Re.oA({advertiser:t.cohorts,classificationModel:n,contextual:ii({contextualCohorts:o,viewId:s}),ssp:a.ssp})),i.bw(c))})),i.Hr("qlCohorts",(e=>{let{queryLanguage:t}=e;return(0,r.zG)(t.segments.all,o.UI(g.UI(String)))})),i.bw((t=>{return t.collectTargetingSuccessMetrics(ti({adServers:t.adServers,cohorts:{...t.nonQlCohorts,query_language:(n=t.qlCohorts,(0,r.zG)(n,dr,Ur))},logger:e.logger,metrics:e.metrics}));var n})),i.Hr("eventsToPublish",(t=>{let{qlCohorts:n,queryLanguage:i,nonQlCohorts:c}=t;const a=(e=>{if(!e.metrics.isEnabled())return e=>{};const t=(0,r.zG)(e.cohortsByType,Re.UI(o.Rp(new Set,((e,t)=>new Set([...e,...t])))),(e=>o.vP(e)));return n=>{"Pageview"===n.name&&(0,_.HJ)((()=>(0,r.zG)(n.cohorts,li(t.current),Re.Su(((t,n)=>e.metrics.track({name:"sdk_pageview_cohort_count",labels:{cohort_type:t},value:n}))))))}})({cohortsByType:(0,r.zG)(c,Re.UI(qr),Re.dx("query_language",n)),metrics:e.metrics});return(0,r.zG)(i.eventsToPublish,o.UI(d.UI(g.UI((0,p.bw)((e=>{let[,t]=e;return a(t)}))))))})),i.UI((e=>{let{adServers:t,advertiserSegmentation:n,demandPartners:i,eventsToPublish:c,geoip:a,queryLanguage:s,nonQlCohorts:u,watson:f}=e;return{activations:(0,r.zG)(t,g.UI((e=>(0,r.zG)(Object.values(u),g.UI(kr),g.DZ((t=>t.byAdServer(e))),g.UI(vr),g.UI(o.D8(g.Eh(v.Eq))),(e=>o.vP(...e)),o.UI(g.xH),(t=>(0,r.bc)(e.id,t))))),Re.sq),cohorts:{all:s.cohorts,ql:s.segments.all,qlCustom:s.segments.custom,qlStandard:s.segments.standard},context:(0,r.zG)(o.vP(f.permutiveContext,a.permutiveContext),o.UI((e=>{let[t,n]=e;return{...t,...n}}))),eventsToPublish:c,eventsToPublishOnPageUnload:s.eventsToPublishOnPageUnload,externalData:o.vP({...n.externalData,...i.externalData}),geoIP:a.data,realtime:s.realtime,stateMigratedThisInitialisation:s.stateMigratedThisInitialisation,transitionsSinceInit:s.transitionsSinceInit}})))}},652:(e,t,n)=>{n.d(t,{BJ:()=>l,El:()=>P,G6:()=>w,HD:()=>f,HP:()=>E,Kn:()=>u,Or:()=>_,PQ:()=>S,SL:()=>g,aT:()=>v,b0:()=>b,b2:()=>p,bw:()=>U,k$:()=>h,lo:()=>k,mQ:()=>G,rO:()=>z,vg:()=>I,vp:()=>d});var r=n(500),i=n(735),o=n(567),c=n(17),a=n(751),s=n(992);const u=e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,f=e=>"string"==typeof e,l=e=>"number"==typeof e&&!Number.isNaN(e);function d(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}function g(e){return t=>{let n=0;for(let r of t){n=n+e(r)|0}return n}}c.ff(a.xb);function p(){let e,t;return{promise:new Promise(((n,r)=>{e=n,t=r})),reject:t,resolve:e}}let m=[];function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:navigator.userAgent;if(m.unshift(e),m.length>1)return;const n=["beforeunload","pagehide"],r=n.concat(["visibilitychange"]),i=e=>{if(!o&&e){o=!0;const e=m;m=[],e.forEach((e=>{try{e()}catch{}}))}};let o=!1;r.forEach((e=>{window.addEventListener(e,(()=>{const n=("visibilitychange"!==e||document.hidden)&&y(t);i(n)}))})),n.forEach((e=>{window.addEventListener(e,(()=>i(!0)))}))}function h(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^(self.crypto||self.msCrypto).getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))}function b(e,t){const n=Object.keys(e),r=n.length,i={};for(let c=0;c<r;c++){const r=n[c],a=t(r,e[r]);(0,o.pC)(a)&&(i[r]=a.value)}return i}function y(e){return/Mobi|Android/i.test(e)}function w(e){return/^((?!chrome|android).)*safari/i.test(e)}function S(e,t){return new Promise((n=>{(0,s.HJ)((()=>{Promise.resolve(e()).then(n)}),(null==t?void 0:t.timeout)??0)}))}const _=()=>({equals:(e,t)=>Object.is(e,t)});function I(e){return t=>null!=t&&e in t?t[e]:void 0}function E(e){let t=o.YP;const n=(0,o.fS)((()=>{const n=e();return t=(0,o.G)(n),n}));return()=>n(t)}const G=e=>{const t=new Map;return n=>(t.has(n)||t.set(n,e(n)),t.get(n))},z=e=>t=>{const n={...t};for(const i in e){var r;n[i]=null===(r=e[i])||void 0===r?void 0:r.call(e,t[i])}return n};function U(e){return t=>(e(t),t)}const k=e=>t=>{const n=e.slice(0,-1),c=e.slice(-1)[0];return(0,i.zG)(n,r.f2((e=>{let[n,r]=e;return(0,i.zG)(t,o.DT(n),o.UI(r))})),o.fS((()=>c(t))))},q=e=>t=>{if("number"==typeof t)return t;if("string"==typeof t){const n=e(t);return Number.isNaN(n)?void 0:n}};q(parseInt),q(parseFloat);function P(e){return"object"==typeof e&&null!==e&&"_tag"in e&&["None","Some"].includes(e._tag)}},963:(e,t,n)=>{n.r(t),n.d(t,{lookalikeModelsService:()=>w,realService:()=>_,stubService:()=>S});var r=n(735),i=n(567);const o=(e,t,n,r)=>t+(n-t)*r/(Math.pow(2,e)-1),c=(e,t)=>{const n=(e,t)=>{const n=e.toString(16);return("0".repeat(t)+n).slice(Math.min(-t,-n.length))};return`${n(e.getUint32(t),8)}-${n(e.getUint16(t+4),4)}-${n(e.getUint16(t+6),4)}-${n(e.getUint16(t+8),4)}-${n(e.getUint32(t+10),8)}${n(e.getUint16(t+14),4)}`},a=e=>{const t=[1,2],n=e.getInt8(0);if(1===n)return s(e);if(2===n)return u(e);{const r=(0,i.Y3)((()=>c(e,1))),o=(0,i.g_)((()=>"Couldn\'t decode model id"),(e=>`Model id was ${e}`))(r);throw new Error(`Decoding only supported for version(s): ${t}; Supplied version was ${n}; ${o}`)}},s=e=>f(e,1),u=e=>f(e,2),f=(e,t)=>{const n=c(e,1),r=((e,t)=>{switch(String.fromCharCode(e.getInt8(t))){case"1":return"1p";case"3":return"3p"}})(e,17),i=e.getInt8(18),o=e.getFloat32(19),a=e.getFloat32(23),[s,u]=((e,t,n,r,i,o)=>{const c={};let a=0;do{let n;1===o?(a=e.getUint16(t),n=e.getUint16(t+2),t+=4):(a=e.getUint32(t),n=e.getUint16(t+4),t+=6),c[0===a?"const":a]=n.toString(36)}while(0!==a);return[c,t]})(e,27,0,0,0,t);return[{version:t,id:n,data_preference:r,weights:s,precision:i,min:o,max:a},u]};var l=n(767),d=n(151),g=n(992),p=n(116),m=n(851),v=n(365),h=n(930),b=n(652);const y=()=>i.G({}),w=_;function S(e){return p.K4((()=>m.a9(y())))}function _(e){e.logger.warn("add cleanup of legacy LAL cache");const t=e.trace.startSpan("lookalike_models_data_retrieval_duration");return(0,r.zG)(h.m((0,r.zG)(m.vP(e.consent,e.currentTimestampSecs),m.UI((t=>{let[n,c]=t;return{currentTimestampSecs:c,validity:{maxAge:604800,key:()=>null},freshness:{maxAge:86400,key:()=>null},refresh:(0,r.zG)(n,i.DT(Boolean),i.UI((()=>l.fF(function(e){const t="Failed fetching binary models, reverting to JSON.\\nError: ",n="Failed fetching json models.\\nError: ";return(0,r.zG)(l.Y3((()=>E(e)),(e=>e.message)),g.N1,l.oU((e=>()=>function(e){const t=[];let n=0;for(;n<e.byteLength;){const[r,i]=a(new DataView(e,n));t.push(r),n+=i}return t}(e))),g.N1,l.UI(I((e=>{let{precision:t,max:n,min:r}=e;return{"1p":{},precision:t,min:r,max:n}}))),l.Vn((n=>(e.logger.log(t+n),e.metrics.track({name:"sdk_binary_models_missing_count",value:1,labels:{}}),n))),l.wp((()=>(0,r.zG)(l.Y3((()=>G(e)),(e=>e.message)),l.UI((e=>e.models)),l.UI(I((()=>({"1p":{}}))))))),l.UI((e=>(e=>{const t=Object.keys(e);return t.length>0&&e[t[0]].hasOwnProperty("precision")})(e)?(e=>{const t={},n=Object.keys(e),r=e=>{const t={"1p":{}},{precision:n,min:r,max:i}=e,c=e["1p"],a=Object.keys(c);for(let e=0;e<a.length;e++){const s=a[e],u=parseInt(c[s],36);t["1p"][s]=o(n,r,i,u)}return t};for(let i=0;i<n.length;i++){const o=n[i],c=e[o];t[o]=r(c)}return t})(e):e)),l.fS((t=>(e.reportError(n+t),d.of({})))))}(e)))))}})))),p.UI(m.UI((0,r.ls)(v.fS((t=>(e.logger.warn("[LAL]",`Failed to refresh, using zero value. ${t}`),y()))),(0,b.bw)(i.UI((()=>{t.finish(),e.metrics.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"lookalike_models_ready",time_origin:"sdk_init"})})))))))}function I(e){return t=>{const n={};for(let r=0;r<t.length;r++){const i=t[r],{id:o,weights:c}=i;if(void 0===o||void 0===c)continue;const a=e(i);Object.keys(c).forEach((e=>{a["1p"][e]=c[e]})),n[o]=a}return n}}const E=e=>{const{permutiveApi:t,config:n,metrics:r}=e,i=r.startTimer("sdk_http_models_seconds",{});return t.req({url:z(n.cdnProtocol,n.cdnBaseUrl,"binary"),method:"GET",contentType:"text/plain",dataType:"binary",withCredentials:!1}).then((e=>(r.stopTimer("sdk_http_models_seconds",i),e)))},G=e=>{const{permutiveApi:t,config:n,metrics:r}=e,i=r.startTimer("sdk_http_models_seconds",{});return t.req({url:z(n.cdnProtocol,n.cdnBaseUrl,"json"),method:"GET",contentType:"text/plain",dataType:"json",withCredentials:!1}).then((e=>(r.stopTimer("sdk_http_models_seconds",i),e)))};function z(e,t,n){const r=`${e}://${t}`;switch(n){case"binary":return`${r}/models/v2/08cdfe71-67da-407d-b4cc-64aaab77de67-models.bin`;case"json":return`${r}/models/08cdfe71-67da-407d-b4cc-64aaab77de67-models.json`}}},869:(e,t,n)=>{n.d(t,{K:()=>k,O:()=>z});let r,i;const o=new WeakMap,c=new WeakMap,a=new WeakMap,s=new WeakMap,u=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return c.get(e);if("objectStoreNames"===t)return e.objectStoreNames||a.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function l(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(i||(i=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(p(this),t),g(o.get(this))}:function(...t){return g(e.apply(p(this),t))}:function(t,...n){const r=e.call(p(this),t,...n);return a.set(r,t.sort?t.sort():[t]),g(r)}}function d(e){return"function"==typeof e?l(e):(e instanceof IDBTransaction&&function(e){if(c.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)}));c.set(e,t)}(e),t=e,(r||(r=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(g(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",o)}));return t.then((t=>{t instanceof IDBCursor&&o.set(t,e)})).catch((()=>{})),u.set(t,e),t}(e);if(s.has(e))return s.get(e);const t=d(e);return t!==e&&(s.set(e,t),u.set(t,e)),t}const p=e=>u.get(e);const m=["get","getKey","getAll","getAllKeys","count"],v=["put","add","delete","clear"],h=new Map;function b(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(h.get(t))return h.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=v.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!m.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,i?"readwrite":"readonly");let c=o.store;return r&&(c=c.index(t.shift())),(await Promise.all([c[n](...t),i&&o.done]))[0]};return h.set(t,o),o}f=(e=>({...e,get:(t,n,r)=>b(t,n)||e.get(t,n,r),has:(t,n)=>!!b(t,n)||e.has(t,n)}))(f);var y=n(688),w=n(365),S=n(735),_=n(151),I=n(767),E=n(652),G=n(992);const z="[IDB]",U=(e,t,n,r,i,o)=>(0,S.zG)((0,_.of)(e.getNamespacedStorageKey(i)),(0,_.tS)((e=>(0,I.Y3)((async()=>n.put(r,o,e)),y.w))),(0,_.UI)((0,w.g_)((e=>{throw t.error(z,`Failed to store crypto key to ${r} due to unexpected error,\\n`,e),e}),(()=>o))),(e=>e()));class k{namespace;logger;cryptoAlg;idb;mainObjectStore;keyObjectStore;keyObjectKey;cryptoKey;MAX_CONSECUTIVE_PUTS=30;puts=1;hasForcedCompaction=!1;constructor(e,t,n,r,i,o,c,a){this.namespace=e,this.logger=t,this.cryptoAlg=n,this.idb=r,this.mainObjectStore=i,this.keyObjectStore=o,this.keyObjectKey=c,this.cryptoKey=a,this.logDebug("Created",this.idb)}static initialise(e,t,n,r,i,o,c,a,s,u){const f=(0,E.G6)(navigator.userAgent)&&!1,l=[u,r.isAvailable(),!f].every((e=>!0===e)),d=async(t,i,o)=>(0,S.zG)(await t.get(o,e.getNamespacedStorageKey(i)),(async e=>e??r.generateKey(!1)),(async r=>U(e,n,t,c,a,await r))).catch((e=>{const t=(0,y.w)(e);throw n.error(z,"Get crypto key failed. Got\\n",t),t})),g=(e,t,n)=>t.includes(n)?(0,S.Q1)():e.createObjectStore(n),p=()=>q(i,s,{upgrade:e=>{const t=[...e.objectStoreNames];g(e,t,o),g(e,t,c)}}).then((e=>{const t=[...e.objectStoreNames];return t.includes(o)&&t.includes(c)?e:Promise.reject(new Error("Object store(s) missing."))})),m=l?(0,w.Y3)((()=>function(e){if(!(0,E.G6)(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let t=()=>{},n=0;return new Promise((e=>{const r=()=>(n++,indexedDB.databases().finally((0,G.GL)(e)));t=(0,G.UM)(r,100),r()})).finally((()=>{t(),e.track({name:"sdk_idb_conn_attempt_safari_count",value:n,labels:{}})}))}(t).then((()=>p())).catch((e=>(n.error(`Re-creating IDB database ${i} due to error`,e),P(i).then((()=>p())))))),String):(0,w.t$)("Connection not attempted. Default to localStorage");return(0,w.g_)((e=>(0,I.t$)(e)),(t=>(0,S.zG)((0,I.Y3)((()=>t.then((async e=>({db:e,cryptoKey:await d(e,a,c)})))),String),(0,I.UI)((t=>{let{db:i,cryptoKey:s}=t;return new k(e,n,r,i,o,c,a,s)})))))(m)}async put(e,t){return(0,S.zG)((async()=>(0,S.bc)(JSON.stringify(e),this.cryptoKey)),(0,_.tS)((e=>{let[t,n]=e;return(0,_.of)(this.cryptoAlg.encrypt(n,t))})),(0,_.tS)((e=>async()=>(await this.recreateIfNecessary(this.puts++),e))),(0,_.tS)((e=>(0,I.Y3)((()=>this.idb.put(this.mainObjectStore,e,this.namespace.getNamespacedStorageKey(String(t)))),y.w))),(0,_.UI)((0,w.g_)((n=>{throw this.logError(`Failed to put "${t.toString()}" value`,e,". Got \\n",n),"QuotaExceededError"===n.name&&this.forceCompaction(),n}),(()=>t))),(e=>e()))}get(e){return(0,S.zG)(this.namespace.getNamespacedStorageKey(String(e)),(t=>this.idb.get(this.mainObjectStore,t).then((async e=>e?JSON.parse(await this.cryptoAlg.decrypt(this.cryptoKey,e)):null)).catch((t=>{const n=(0,y.w)(t);throw this.logError(`Get ${e.toString()} failed. Got`,n),n}))))}delete(e){return(0,S.zG)(this.namespace.getNamespacedStorageKey(String(e)),(e=>this.idb.delete(this.mainObjectStore,e)))}deleteStore(){return this.logDebug("Deleting",this.idb),this.idb.close(),P(this.idb.name)}forceCompaction(){if(this.hasForcedCompaction)return null;this.hasForcedCompaction=!0,this.logDebug("Attempting to force compaction");const e=`__${this.mainObjectStore}`;return q(e).then((t=>(t.close(),P(e))))}recreateIfNecessary(e){return(0,E.G6)(navigator.userAgent)&&e%this.MAX_CONSECUTIVE_PUTS==0?this.recreate():Promise.resolve()}async recreate(){const e=this.idb.name,t=this.idb.version,n=await this.idb.getAllKeys(this.mainObjectStore),r=[];for(const e of n)r.push([e,await this.idb.get(this.mainObjectStore,e)]);await this.deleteStore(),this.idb=await q(e,t,{upgrade:e=>{e.createObjectStore(this.mainObjectStore),e.createObjectStore(this.keyObjectStore)}}),await Promise.all(r.map((e=>{let[t,n]=e;return this.idb.put(this.mainObjectStore,n,t)}))),await U(this.namespace,this.logger,this.idb,this.keyObjectStore,this.keyObjectKey,this.cryptoKey),this.logDebug("Reset to",this.idb)}logDebug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.debug(z,...t)}logError(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.error(z,...t)}}const q=(0,S.ls)((function(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const c=indexedDB.open(e,t),a=g(c);return r&&c.addEventListener("upgradeneeded",(e=>{r(g(c.result),e.oldVersion,e.newVersion,g(c.transaction))})),n&&c.addEventListener("blocked",(()=>n())),a.then((e=>{o&&e.addEventListener("close",(()=>o())),i&&e.addEventListener("versionchange",(()=>i()))})).catch((()=>{})),a}),G.t_,(e=>e.then((e=>({close:e.close.bind(e),createObjectStore:(0,S.ls)(e.createObjectStore.bind(e),S.Q1),delete:(0,S.ls)(e.delete.bind(e),G.t_),get:(0,S.ls)(e.get.bind(e),G.t_),getAllKeys:(0,S.ls)(e.getAllKeys.bind(e),G.t_),get name(){return e.name},get objectStoreNames(){return e.objectStoreNames},put:(0,S.ls)(e.put.bind(e),G.t_),get version(){return e.version}}))))),P=(0,S.ls)((function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(()=>t())),g(n).then((()=>{}))}),G.t_)},569:(e,t,n)=>{n.r(t),n.d(t,{make:()=>c});var r=n(735),i=n(869);const o=e=>{const{logger:t,consent:n,prefix:r}=e,i=(e,n)=>(t.debug(`${r} Failed to write ${String(n)} as consent is revoked`),Promise.resolve(n));return e=>class extends e{put=((e,t,n)=>function(){return(n()?t:e)(...arguments)})(super.put.bind(this),i,(()=>!n.current))}},c=(e,t,n,c,a,s,u,f,l,d,g)=>(0,r.zG)(i.K,o({logger:l,consent:d,prefix:i.O})).initialise(e,t,l,n,c,a,s,u,f,g)},965:(e,t,n)=>{n.r(t),n.d(t,{watson:()=>f});var r=n(851),i=n(735),o=n(567),c=n(365),a=n(328),s=n(751),u=n(706);const f=e=>(0,i.zG)(d(e),r.YO("data"),r.Hr("replacementMap",(e=>{let{data:t}=e;return(0,i.zG)(t,o.YO("data"),o.Hr("taxonomyLabels",(e=>{let{data:t}=e;return function(e){const t=e=>{const t=e.split("/").filter((e=>e));return t.map(((e,n)=>"/"+t.slice(0,n+1).join("/")))},n=a.xH(e.filter(Boolean).map((e=>t(e.label))));return a.jj(s.Eq)(n)}(t.taxonomy??[])})),o.UI((e=>{var t,n,r;let{data:o,taxonomyLabels:c}=e;return{$alchemy_concepts:o.concepts??[],$alchemy_document_emotion:(null===(t=o.emotion)||void 0===t||null===(n=t.document)||void 0===n?void 0:n.emotion)??null,$alchemy_document_sentiment:(null===(r=o.sentiment)||void 0===r?void 0:r.document)??null,$alchemy_entities:o.entities??[],$alchemy_entity_names:(0,i.zG)(o.entities??[],a.UI((e=>e.text))),$alchemy_keywords:o.keywords??[],$alchemy_taxonomy:o.taxonomy??[],$alchemy_taxonomy_labels:c,$taxonomy_labels:c}})))})),r.Hr("permutiveContext",(e=>{let{data:t}=e;return(0,i.zG)(t,o.EQ((()=>({})),(e=>({watson:e}))))})),(e=>({permutiveContext:(0,i.zG)(e,r.UI((e=>e.permutiveContext))),replacementMap:(0,i.zG)(e,r.UI((e=>e.replacementMap)))}))),l=()=>r.a9(o.G({})),d=e=>(0,i.zG)(r.vP(e.watsonEnabled,e.pageUrl),r.UI((0,i.ls)(o.DT(u.li),o.tS(u.Yg))),r.UI(o.UI((0,i.ls)(g(e.permutiveApi,e.metrics,e.config,e.permutiveUrls,e.trace),r.p4,r.UI(o.UI(c.fS((()=>({})))))))),r.VS(o.fS(l))),g=(e,t,n,r,i)=>c=>{const a=t.startTimer("sdk_http_watson_seconds",{}),s=i.startSpan("watson_data_retrieval");return e.req({url:r.getEndpointUrl("/watson",o.G(n.apiVersion)),method:"POST",contentType:"text/plain",dataType:"json",withCredentials:!1,payload:{url:c,classify:!0}}).then((e=>(t.stopTimer("sdk_http_watson_seconds",a),t.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"watson_data_ready",time_origin:"sdk_init"},performance.now()),s.finish(),e)))}},828:(e,t,n)=>{n.d(t,{N:()=>c,Qt:()=>a,Yt:()=>d,ap:()=>o,gz:()=>l});var r=n(735),i=n(384);function o(e,t){return function(n){return function(r){return e.ap(e.map(r,(function(e){return function(n){return t.ap(e,n)}})),n)}}}function c(e){return function(t){return function(n){return e.ap(e.map(n,(function(e){return function(){return e}})),t)}}}function a(e){return function(t,n){return function(r){return e.ap(e.map(r,(function(e){return function(n){var r;return Object.assign({},e,((r={})[t]=n,r))}})),n)}}}function s(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,0===t?e.apply(null,i):s(e,t-1,i)}}var u={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function f(e){return i.e$.call(u,e)||(u[e]=s(r.bc,e-1,[])),u[e]}function l(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=f(r),o=e.map(t[0],i),c=1;c<r;c++)o=e.ap(o,t[c]);return o}}function d(e){return function(t){for(var n=Object.keys(t),r=n.length,i=function(e){var t=e.length;switch(t){case 1:return function(t){var n;return(n={})[e[0]]=t,n};case 2:return function(t){return function(n){var r;return(r={})[e[0]]=t,r[e[1]]=n,r}};case 3:return function(t){return function(n){return function(r){var i;return(i={})[e[0]]=t,i[e[1]]=n,i[e[2]]=r,i}}};case 4:return function(t){return function(n){return function(r){return function(i){var o;return(o={})[e[0]]=t,o[e[1]]=n,o[e[2]]=r,o[e[3]]=i,o}}}};case 5:return function(t){return function(n){return function(r){return function(i){return function(o){var c;return(c={})[e[0]]=t,c[e[1]]=n,c[e[2]]=r,c[e[3]]=i,c[e[4]]=o,c}}}}};default:return s((function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i}),t-1,[])}}(n),o=e.map(t[n[0]],i),c=1;c<r;c++)o=e.ap(o,t[n[c]]);return o}}},500:(e,t,n)=>{n.d(t,{Ce:()=>u,DY:()=>I,Eh:()=>R,GY:()=>_,Gb:()=>p,KB:()=>l,Lx:()=>D,Qp:()=>y,Su:()=>q,UI:()=>U,YM:()=>g,f2:()=>w,fw:()=>A,hX:()=>C,ke:()=>m,md:()=>b,oA:()=>O,pR:()=>Y,tS:()=>k,yL:()=>E,yW:()=>F,zT:()=>h});var r=n(735),i=(n(341),n(384)),o=n(885),c=n(328),a=(n(870),n(605),function(e){return 0===e.length}),s=o.Od,u=o.Ce,f=(o.ws,o.R3),l=(o.Im,function(e,t){return e<=0?[]:o.KB(t)(e)});var d=o.dC,g=(c.P5,c.YM),p=(c.Z$,function(e){return s(e)?i.G(o.Gb(e)):i.YP}),m=function(e){return function(t){return d(e,t)?S(t):t.slice(0,e)}};var v=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function h(e){return function(t){var n=G(v(t,e))(t);return{init:n[0],rest:n[1]}}}var b=function(e){return function(t){return e<=0||a(t)?S(t):e>=t.length?[]:t.slice(e,t.length)}};function y(e){return function(t){return t.slice(v(t,e))}}c.cx;var w=c.f2;c.JO,c.qr;var S=function(e){return e.slice()},_=function(e){return a(e)?[]:e.slice().reverse()},I=function(e){return function(t){return t.length<=1?S(t):t.slice().sort(e.compare)}},E=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};c.t9;var G=function(e){return function(t){return e>=1&&s(t)?o.lx(e)(t):a(t)?[S(t),[]]:[[],S(t)]}};c.kp,c.Eq;var z=o.of,U=function(e){return function(t){return t.map((function(t){return e(t)}))}},k=function(e){return function(t){return(0,r.zG)(t,function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}}((function(t,n){return e(n)})))}},q=function(e){return function(t){return t.map((function(t,n){return e(n,t)}))}},P=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var o=e(r,t[r]);i.pC(o)&&n.push(o.value)}return n}},T=function(e){return P((function(t,n){return e(n)}))},O=T(r.yR),C=function(e){return function(t){return t.filter(e)}},D=c.Lx,x=(c.xP,c.u4,c.OE),A=(c.nq,c.iw,function(e){var t=M(e);return function(e){return t((function(t,n){return e(n)}))}}),M=function(e){return function(t){return x(e.of([]),(function(n,i,o){return e.ap(e.map(i,(function(e){return function(t){return(0,r.zG)(e,f(t))}})),t(n,o))}))}},R=(c.ZN,c.Eh),Y=c.pR,F=(c.pJ,c.oR,o.oo,c.yW);c.j0,i.F4,o.w6,o.QI,o.Ss},862:(e,t,n)=>{function r(e){return function(t){return function(n){return e.chain(n,(function(n){return e.map(t(n),(function(){return n}))}))}}}function i(e){return function(t,n){return function(r){return e.chain(r,(function(r){return e.map(n(r),(function(e){var n;return Object.assign({},r,((n={})[t]=e,n))}))}))}}}n.d(t,{a:()=>i,m:()=>r})},365:(e,t,n)=>{n.d(t,{g1:()=>w,G5:()=>y,dO:()=>v,Pd:()=>E,ak:()=>N,YO:()=>j,tS:()=>_,g_:()=>C,ij:()=>M,Yo:()=>k,DT:()=>U,Eh:()=>p,fS:()=>x,pF:()=>D,nM:()=>q,t$:()=>s,UI:()=>m,Vn:()=>G,EQ:()=>O,of:()=>h,F2:()=>u,LF:()=>A,KC:()=>L,i$:()=>F,Y3:()=>R,it:()=>Y});var r=n(862),i=n(690),o=n(735),c=n(341),a=n(384),s=a.t$,u=a.F2,f=function(e,t){return(0,o.zG)(e,m(t))},l=function(e,t){return(0,o.zG)(e,b(t))},d=function(e,t){return(0,o.zG)(e,_(t))},g="Either",p=function(e,t){return{equals:function(n,r){return n===r||(q(n)?q(r)&&e.equals(n.left,r.left):P(r)&&t.equals(n.right,r.right))}}},m=function(e){return function(t){return q(t)?t:u(e(t.right))}},v={URI:g,map:f},h=u,b=function(e){return function(t){return q(t)?t:q(e)?e:u(t.right(e.right))}},y={URI:g,map:f,ap:l},w={URI:g,map:f,ap:l,of:h},S=function(e){return function(t){return q(t)?t:e(t.right)}},_=S,I={URI:g,map:f,ap:l,chain:d},E=function(e,t){return function(n){return q(n)?s(e(n.left)):u(t(n.right))}},G=function(e){return function(t){return q(t)?s(e(t.left)):t}},z={URI:g,fromEither:o.yR},U=(0,i.DT)(z),k=(0,i.Yo)(z),q=a.nM,P=a.tO,T=function(e,t){return function(n){return q(n)?e(n.left):t(n.right)}},O=T,C=O,D=function(e){return function(t){return q(t)?e(t.left):t.right}},x=D,A=function(e){return q(e)?u(e.left):s(e.right)},M=function(e){return function(t){return null==t?s(e):u(t)}},R=function(e,t){try{return u(e())}catch(e){return s(t(e))}},Y=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return R((function(){return e.apply(void 0,n)}),t)}},F=T(o.yR,o.yR);function L(e){return e instanceof Error?e:new Error(String(e))}a.F4;var j=(0,c.YO)(v),N=(0,r.a)(I);a.Xl},856:(e,t,n)=>{n.d(t,{EQ:()=>w,F2:()=>a,KQ:()=>d,LF:()=>z,LU:()=>G,LV:()=>S,NG:()=>g,Pd:()=>b,UI:()=>p,Vn:()=>y,ap:()=>m,dQ:()=>E,fS:()=>_,i$:()=>U,ij:()=>l,m8:()=>u,pk:()=>f,t$:()=>s,tS:()=>v,vx:()=>I,wp:()=>h});var r=n(828),i=n(365),o=n(735),c=n(341);function a(e){return(0,o.ls)(i.F2,e.of)}function s(e){return(0,o.ls)(i.t$,e.of)}function u(e){return function(t){return e.map(t,i.F2)}}function f(e){return function(t){return e.map(t,i.t$)}}function l(e){return function(t){return(0,o.ls)(i.ij(t),e.of)}}function d(e){var t=l(e);return function(e){var n=t(e);return function(e){return(0,o.ls)(e,n)}}}function g(e){var t=v(e),n=d(e);return function(e){var r=n(e);return function(e){return t(r(e))}}}function p(e){return(0,c.UI)(e,i.dO)}function m(e){return(0,r.ap)(e,i.G5)}function v(e){return function(t){return function(n){return e.chain(n,(function(n){return i.nM(n)?e.of(n):t(n.right)}))}}}function h(e){return function(t){return function(n){return e.chain(n,(function(n){return i.nM(n)?t():e.of(n)}))}}}function b(e){return function(t,n){return function(r){return e.map(r,i.Pd(t,n))}}}function y(e){return function(t){return function(n){return e.map(n,i.Vn(t))}}}function w(e){return function(t,n){return function(r){return e.map(r,i.EQ(t,n))}}}function S(e){return function(t,n){return function(r){return e.chain(r,i.EQ(t,n))}}}function _(e){return function(t){return function(n){return e.chain(n,i.EQ(t,e.of))}}}function I(e){return function(t){return function(n){return e.chain(n,(function(n){return i.nM(n)?t(n.left):e.of(n)}))}}}function E(e){var t=I(e);return function(n){return t((function(t){return e.map(n(t),(function(e){return i.nM(e)?e:i.t$(t)}))}))}}function G(e){return function(t){return function(n){return e.chain(n,i.EQ((function(n){return e.map(t(n),i.t$)}),(function(t){return e.of(i.F2(t))})))}}}function z(e){return function(t){return e.map(t,i.LF)}}function U(e){return function(t){return e.map(t,i.i$)}}},268:(e,t,n)=>{n.d(t,{MW:()=>s,Uz:()=>c,bc:()=>o,f7:()=>r,n_:()=>i,w4:()=>a});n(735);var r=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},i=function(e){return r((function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0}))},o=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r((function(t,n){return e.every((function(e,r){return e.equals(t[r],n[r])}))}))},c=function(e){return function(t){return r((function(n,r){return t.equals(e(n),e(r))}))}},a={equals:function(e,t){return e===t}},s=i;a.equals},690:(e,t,n)=>{n.d(t,{DT:()=>c,Yo:()=>o,fX:()=>s});var r=n(735),i=n(384);function o(e){return function(t){return function(n){return e.fromEither(i.Wi(n)?i.t$(t()):i.F2(n.value))}}}function c(e){return function(t,n){return function(r){return e.fromEither(t(r)?i.F2(r):i.t$(n(r)))}}}function a(e){return function(t){return(0,r.ls)(t,e.fromEither)}}function s(e,t){var n=a(e);return function(e){return function(r){return t.chain(r,n(e))}}}},130:(e,t,n)=>{n.d(t,{At:()=>c,oU:()=>o});var r=n(862),i=n(735);function o(e,t){return function(n){var r=(0,i.ls)(n,e.fromIO);return function(e){return t.chain(e,r)}}}function c(e,t){var n=(0,r.m)(t);return function(t){return n((0,i.ls)(t,e.fromIO))}}},679:(e,t,n)=>{n.d(t,{oU:()=>i});var r=n(735);function i(e,t){return function(n){var i=(0,r.ls)(n,e.fromTask);return function(e){return t.chain(e,i)}}}},341:(e,t,n)=>{function r(e,t){return function(n){return function(r){return e.map(r,(function(e){return t.map(e,n)}))}}}function i(e){return function(t){return function(n){return e.map(n,(function(e){return e(t)}))}}}function o(e){return function(t){return function(n){return e.map(n,(function(e){var n;return(n={})[t]=e,n}))}}}function c(e){return function(t,n){return function(r){return e.map(r,(function(e){var r;return Object.assign({},e,((r={})[t]=n(e),r))}))}}}n.d(t,{Hr:()=>c,OV:()=>i,UI:()=>r,YO:()=>o})},392:(e,t,n)=>{n.d(t,{G5:()=>g,PM:()=>d,RD:()=>y,UA:()=>m,UI:()=>s,dO:()=>l,of:()=>u,qo:()=>p});var r=n(735),i=(n(341),n(384)),o=function(e,t){return function(){return t(e())}},c=function(e,t){return function(){return e()(t())}},a=function(e,t){return function(){return t(e())()}},s=function(e){return function(t){return o(t,e)}},u=r.a9,f="IO",l={URI:f,map:o},d={URI:f,of:u},g={URI:f,map:o,ap:c},p={URI:f,map:o,ap:c,chain:a},m={URI:f,map:o,ap:c,of:u,chain:a},v=(r.yR,r.yR,i.F4,u(i.Xl)),h=function(e){var t=function(e){return function(t){return function(){for(var n=[e(0,i.YM(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}}(e);return function(e){return i.Od(e)?t(e):v}},b=function(e){return h((function(t,n){return e(n)}))},y=b(r.yR)},885:(e,t,n)=>{n.d(t,{Ce:()=>f,Eh:()=>_,Gb:()=>E,Im:()=>l,KB:()=>v,Od:()=>a,QI:()=>G,R3:()=>d,Ss:()=>z,dC:()=>s,lx:()=>S,nI:()=>m,of:()=>y,oo:()=>g,w6:()=>h,ws:()=>u,yL:()=>w});var r=n(735),i=(n(341),n(384)),o=n(241),c=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},a=function(e){return e.length>0},s=function(e,t){return e<0||e>=t.length},u=function(e){return function(t){return c([e],t,!0)}},f=u,l=function(e){return function(t){return c(c([],t,!0),[e],!1)}},d=l,g=function(e,t,n){if(a(n)){var r=p(n);return r.splice(e,0,t),r}return[t]},p=i.r1,m=function(e){return a(e)?i.G(e):i.YP},v=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},h=function(e,t){return e<=t?v((function(t){return e+t}))(t-e+1):[e]};var b=p,y=function(e){return[e]},w=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};o.xP,o.Lx;var S=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[b(t),[]]:[(0,r.zG)(t.slice(1,n),f(I(t))),t.slice(n)]}},_=(o.u4,o.OE,o.nq,o.iw,o.YM,o.ZN,o.Eh),I=(i.F4,o.YM),E=function(e){return e.slice(1)};o.Z$,o.VV,o.Fp,o.j0;function G(e,t){return void 0===t?f(e):(0,r.zG)(t,f(e))}var z=function(e,t){return(0,r.zG)(e,d(t))};o.ur},567:(e,t,n)=>{n.d(t,{DT:()=>g,Do:()=>se,EK:()=>m,EQ:()=>Z,Eh:()=>E,FS:()=>ae,G:()=>d,G5:()=>O,Hr:()=>fe,IS:()=>p,KQ:()=>oe,Qt:()=>de,Ri:()=>j,UI:()=>U,Uo:()=>V,WG:()=>ce,Wi:()=>J,Y3:()=>ie,YO:()=>ue,YP:()=>l,aD:()=>X,ak:()=>le,bM:()=>A,dO:()=>k,fS:()=>ne,fw:()=>K,g_:()=>ee,hX:()=>N,ij:()=>re,lo:()=>R,pC:()=>W,pF:()=>te,pR:()=>G,tS:()=>C,uZ:()=>z,wp:()=>x,xu:()=>H});var r=n(828),i=n(862),o=n(735),c=n(341),a=n(384),s=n(17),u=n(870),f=(n(605),n(560)),l=a.YP,d=a.G;function g(e){return function(t){return e(t)?d(t):l}}var p=function(e){return"Right"===e._tag?l:d(e.left)},m=function(e){return"Left"===e._tag?l:d(e.right)},v=function(e,t){return(0,o.zG)(e,U(t))},h=function(e,t){return(0,o.zG)(e,T(t))},b=function(e,t){return(0,o.zG)(e,C(t))},y=function(e,t){return(0,o.zG)(e,N(t))},w=function(e,t){return(0,o.zG)(e,$(t))},S=function(e,t){return(0,o.zG)(e,Q(t))},_=function(e,t){return(0,o.zG)(e,B(t))},I="Option",E=function(e){return{equals:function(t,n){return t===n||(J(t)?J(n):!J(n)&&e.equals(t.value,n.value))}}},G=function(e){return{equals:E(e).equals,compare:function(t,n){return t===n?0:W(t)?W(n)?e.compare(t.value,n.value):1:-1}}},z=function(e){return{concat:function(t,n){return J(t)?n:J(n)?t:d(e.concat(t.value,n.value))},empty:l}},U=function(e){return function(t){return J(t)?l:d(e(t.value))}},k={URI:I,map:v},q=d,P={URI:I,of:q},T=function(e){return function(t){return J(t)||J(e)?l:d(t.value(e.value))}},O={URI:I,map:v,ap:h},C=function(e){return function(t){return J(t)?l:e(t.value)}},D={URI:I,map:v,ap:h,chain:b},x=function(e){return function(t){return J(t)?e():t}},A=function(){return l},M={URI:I,zero:A},R=(0,f.l)(M,P),Y=C(o.yR),F=(0,u.s4)(l,l),L=function(e){return J(e)?F:(0,u.s4)(p(e.value),m(e.value))},j={URI:I,compact:Y,separate:L},N=function(e){return function(t){return J(t)?l:e(t.value)?t:l}},$=function(e){return function(t){return J(t)?l:e(t.value)}},Q=function(e){return function(t){return(0,u.s4)(y(t,(0,s.ff)(e)),y(t,e))}},B=function(e){return(0,o.ls)(U(e),L)},H={URI:I,map:v,compact:Y,separate:L,filter:y,filterMap:w,partition:S,partitionMap:_},K=function(e){return function(t){return function(n){return J(n)?e.of(l):e.map(t(n.value),d)}}},V=m,W=a.pC,J=function(e){return"None"===e._tag},X=function(e,t){return function(n){return J(n)?e():t(n.value)}},Z=X,ee=Z,te=function(e){return function(t){return J(t)?e():t.value}},ne=te,re=function(e){return null==e?l:d(e)},ie=function(e){try{return d(e())}catch(e){return l}},oe=function(e){return(0,o.ls)(e,re)},ce=Z(o.gn,o.yR),ae=Z(o.r5,o.yR);var se=q(a.F4),ue=(0,c.YO)(k),fe=(0,c.Hr)(k),le=(0,i.a)(D),de=(0,r.Qt)(O);a.Xl},209:(e,t,n)=>{n.d(t,{Fp:()=>d,Uz:()=>a,VV:()=>l,Zt:()=>c,gf:()=>f,gt:()=>u,lt:()=>s});var r=n(268),i=n(735),o=function(e){return function(t,n){return t===n||0===e(t,n)}},c=function(e){return{equals:o(e),compare:function(t,n){return t===n?0:e(t,n)}}},a=function(e){return function(t){return c((function(n,r){return t.compare(e(n),e(r))}))}},s=(i.W8,function(e){return function(t,n){return-1===e.compare(t,n)}}),u=function(e){return function(t,n){return 1===e.compare(t,n)}},f=function(e){return function(t,n){return-1!==e.compare(t,n)}},l=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},d=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};r.w4.equals},17:(e,t,n)=>{n.d(t,{ff:()=>r,xD:()=>i});n(735);var r=function(e){return function(t){return!e(t)}},i=function(e){return function(t){return function(n){return t(n)&&e(n)}}}},328:(e,t,n)=>{n.d(t,{Ce:()=>m,DZ:()=>K,EQ:()=>b,Eh:()=>se,Eq:()=>Y,Ew:()=>z,G:()=>ye,Hr:()=>Se,JO:()=>q,Lx:()=>ee,OE:()=>te,Od:()=>p,P5:()=>w,R3:()=>v,Su:()=>Q,UI:()=>$,YM:()=>S,Yo:()=>h,Z$:()=>_,ZN:()=>ce,bM:()=>L,bj:()=>T,cS:()=>he,cx:()=>G,dF:()=>k,f2:()=>U,hX:()=>B,iw:()=>re,j0:()=>we,jj:()=>C,kp:()=>R,lo:()=>ge,nI:()=>ve,nq:()=>ne,oA:()=>V,oR:()=>me,of:()=>F,pJ:()=>pe,pO:()=>D,pR:()=>ue,qr:()=>P,t9:()=>O,tS:()=>j,u4:()=>Z,uK:()=>W,uZ:()=>ae,vP:()=>ie,xH:()=>N,xP:()=>X,xb:()=>g,yW:()=>be,zT:()=>E});var r=n(268),i=n(735),o=n(341),c=n(384),a=n(11),s=n(209),u=n(241),f=n(870),l=(n(605),n(560)),d=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},g=function(e){return 0===e.length},p=u.Od,m=u.Ce,v=(u.ws,u.R3);u.Im;var h=function(e){return c.Wi(e)?he:[e.value]},b=function(e,t){return function(n){return p(n)?t(n):e()}},y=u.dC;function w(e,t){return void 0===t?function(t){return w(e,t)}:y(e,t)?c.YP:c.G(t[e])}var S=function(e){return p(e)?c.G(u.YM(e)):c.YP},_=function(e){return p(e)?c.G(u.Z$(e)):c.YP};var I=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function E(e){return function(t){var n=x(I(t,e))(t);return{init:n[0],rest:n[1]}}}var G=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return c.G(n);return c.YP}};function z(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return c.G(t[n]);return c.YP}}var U=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(c.pC(r))return r}return c.YP}};function k(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return c.G(t[n]);return c.YP}}var q=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(c.pC(r))return r}return c.YP}},P=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return c.G(n);return c.YP}},T=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];"Left"===r._tag&&t.push(r.left)}return t};function O(e){return function(t,n){if(void 0===n){var r=O(e);return function(e){return r(t,e)}}for(var i,o=0;o<n.length;o++)if(i=n[o],e.equals(i,t))return!0;return!1}}var C=function(e){var t=u.jj(e);return function(e){return p(e)?t(e):e}},D=function(e){var t=u.pO(e);return function(e){return p(e)?t(e):he}},x=function(e){return function(t){return e>=1&&p(t)?u.lx(e)(t):g(t)?[t,he]:[he,t]}};var A=function(e,t){return(0,i.zG)(e,$(t))},M=function(e,t,n){return(0,i.zG)(e,Z(t,n))},R=function(e,t){return(0,i.zG)(e,pe(t))},Y=function(e,t){return(0,i.zG)(e,me(t))},F=u.of,L=function(){return he},j=function(e){return function(t){return(0,i.zG)(t,function(e){return function(t){if(g(t))return he;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}}((function(t,n){return e(n)})))}},N=j(i.yR),$=function(e){return function(t){return t.map((function(t){return e(t)}))}},Q=function(e){return function(t){return t.map((function(t,n){return e(n,t)}))}},B=function(e){return function(t){return t.filter(e)}},H=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);c.pC(i)&&n.push(i.value)}return n}},K=function(e){return H((function(t,n){return e(n)}))},V=K(i.yR),W=function(e){return J((function(t,n){return e(n)}))},J=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return(0,f.s4)(n,r)}},X=function(e){return function(t){return function(n){return n.reduce((function(n,r,i){return e.concat(n,t(i,r))}),e.empty)}}},Z=function(e,t){return te(e,(function(e,n,r){return t(n,r)}))},ee=function(e){var t=X(e);return function(e){return t((function(t,n){return e(n)}))}},te=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},ne=function(e,t){return re(e,(function(e,n,r){return t(n,r)}))},re=function(e,t){return function(n){return n.reduceRight((function(e,n,r){return t(r,n,e)}),e)}},ie=function(e){return function(t){return M(t,e.of(L()),(function(t,n){return e.ap(e.map(t,(function(e){return function(t){return(0,i.zG)(e,v(t))}})),n)}))}},oe="ReadonlyArray",ce=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},ae=function(){return{concat:function(e,t){return g(e)?t:g(t)?e:e.concat(t)},empty:he}},se=function(e){return(0,r.f7)((function(t,n){return t.length===n.length&&t.every((function(t,r){return e.equals(t,n[r])}))}))},ue=function(e){return(0,s.Zt)((function(t,n){for(var r=t.length,i=n.length,o=Math.min(r,i),c=0;c<o;c++){var s=e.compare(t[c],n[c]);if(0!==s)return s}return a.Df.compare(r,i)}))},fe={URI:oe,map:A},le={URI:oe,of:F},de={URI:oe,zero:L},ge=(0,l.l)(de,le),pe=function(e){return function(t){for(var n=d([],e(t),!0),r=[];n.length>0;){var i=n.shift();c.nM(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},me=function(e){return function(t){var n=e(t),r=[],i=[];function o(t){c.nM(t)?e(t.left).forEach((function(e){return r.push(e)})):i.push(t.right)}for(var a=0,s=n;a<s.length;a++){o(s[a])}for(;r.length>0;)o(r.shift());return i}},ve=(u.oo,function(e){return g(e)?he:e.slice()}),he=u.cS;function be(e){return function(t){return t.every(e)}}var ye=function(e){return function(t){return t.some(e)}},we=function(e){var t=u.j0(e);return function(n){return b((function(){return e.empty}),t(n))}},Se=(c.F4,(0,o.Hr)(fe));u.w6,u.QI,u.Ss},241:(e,t,n)=>{n.d(t,{R3:()=>h,Im:()=>v,pO:()=>G,ur:()=>Q,QI:()=>V,cS:()=>l,Lx:()=>T,xP:()=>D,c2:()=>w,Eh:()=>R,ZN:()=>M,YM:()=>Y,j0:()=>K,Od:()=>d,dC:()=>g,Z$:()=>L,UI:()=>k,aL:()=>B,ut:()=>H,Fp:()=>$,VV:()=>N,of:()=>U,Ce:()=>m,ws:()=>p,w6:()=>_,u4:()=>P,nq:()=>O,iw:()=>x,OE:()=>C,Ss:()=>W,lx:()=>z,jj:()=>y,oo:()=>b});var r,i=n(268),o=n(735),c=(n(341),n(384)),a=n(209),s=function(e){return{concat:a.VV(e)}},u=function(e){return{concat:a.Fp(e)}};r=void 0;var f=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},l=c.Xl,d=c.Od,g=function(e,t){return e<0||e>=t.length},p=function(e){return function(t){return f([e],t,!0)}},m=p,v=function(e){return function(t){return f(f([],t,!0),[e],!1)}},h=v,b=function(e,t,n){if(d(n)){var r=c.r1(n);return r.splice(e,0,t),r}return[t]},y=function(e){return function(t){if(1===t.length)return t;for(var n=[Y(t)],r=function(t){n.every((function(n){return!e.equals(n,t)}))&&n.push(t)},i=0,o=F(t);i<o.length;i++){r(o[i])}return n}},w=function(e){return d(e)?c.G(e):c.YP},S=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},_=function(e,t){return e<=t?S((function(t){return e+t}))(t-e+1):[e]};function I(e,t){return t?e.concat(t):function(t){return t.concat(e)}}var E=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},G=function(e){return function(t){for(var n=e(t),r=[n[0]],i=n[1];d(i);){var o=e(i),c=o[0],a=o[1];r.push(c),i=a}return r}},z=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,l]:[(0,o.zG)(t.slice(1,n),m(Y(t))),t.slice(n)]}},U=c.ri,k=function(e){return q((function(t,n){return e(n)}))},q=function(e){return function(t){for(var n=[e(0,Y(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},P=function(e,t){return C(e,(function(e,n,r){return t(n,r)}))},T=function(e){return function(t){return function(n){return n.slice(1).reduce((function(n,r){return e.concat(n,t(r))}),t(n[0]))}}},O=function(e,t){return x(e,(function(e,n,r){return t(n,r)}))},C=function(e,t){return function(n){return n.reduce((function(e,n,r){return t(r,e,n)}),e)}},D=function(e){return function(t){return function(n){return n.slice(1).reduce((function(n,r,i){return e.concat(n,t(i+1,r))}),t(0,n[0]))}}},x=function(e,t){return function(n){return n.reduceRight((function(e,n,r){return t(r,n,e)}),e)}},A=c.YM,M=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},R=function(e){return(0,i.f7)((function(t,n){return t.length===n.length&&t.every((function(t,r){return e.equals(t,n[r])}))}))},Y=(c.F4,A),F=c.Gb,L=function(e){return e[e.length-1]},j=function(e){return e.slice(0,-1)},N=function(e){var t=s(e);return function(e){return e.reduce(t.concat)}},$=function(e){var t=u(e);return function(e){return e.reduce(t.concat)}},Q=function(e){return function(t){return t.reduce(e.concat)}},B=function(e){return function(t){return e(Y(t),F(t))}},H=function(e){return function(t){return e(j(t),L(t))}},K=function(e){var t=Q(e);return function(e){return(0,o.ls)(function(e){return function(t){var n=F(t);return d(n)?(0,o.zG)(n,E(e),m(Y(t))):t}}(e),t)}};function V(e,t){return void 0===t?m(e):(0,o.zG)(t,m(e))}var W=function(e,t){return(0,o.zG)(e,I([t]))}},923:(e,t,n)=>{n.d(t,{Bu:()=>h,CC:()=>Y,DZ:()=>ne,EG:()=>v,EW:()=>B,Eh:()=>le,G:()=>D,HA:()=>A,Hd:()=>k,I8:()=>L,P5:()=>b,RF:()=>F,RJ:()=>N,SW:()=>K,Su:()=>w,UI:()=>S,Ub:()=>W,V_:()=>Q,XP:()=>l,Yz:()=>T,_Y:()=>$,_r:()=>U,cS:()=>y,dp:()=>s,dx:()=>p,e$:()=>m,hX:()=>te,jt:()=>q,kp:()=>R,mK:()=>Z,mS:()=>j,nn:()=>M,nr:()=>ge,nu:()=>H,oA:()=>se,oh:()=>ue,qS:()=>X,ri:()=>G,sq:()=>O,t9:()=>x,tV:()=>ie,uK:()=>re,uZ:()=>de,vA:()=>J,vP:()=>z,xb:()=>u,yW:()=>C,z7:()=>P,zV:()=>V});var r=n(268),i=n(735),o=n(384),c=n(870),a=n(751),s=(n(605),function(e){return Object.keys(e).length}),u=function(e){for(var t in e)if(o.e$.call(e,t))return!1;return!0},f=function(e){return function(t){return Object.keys(t).sort(e.compare)}},l=f(a.Df);function d(e){if("function"==typeof e)return d(a.Df)(e);var t=f(e);return function(e){return function(n){for(var r=[],i=0,o=t(n);i<o.length;i++){var c=o[i];r.push(e(c,n[c]))}return r}}}var g=d(a.Df)((function(e,t){return[e,t]}));var p=function(e,t){return function(n){if(o.e$.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},m=function(e,t){return o.e$.call(t,e)};function v(e){return function(t){if(!o.e$.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}function h(e){return function(t,n){if(void 0===n){var r=h(e);return function(e){return r(e,t)}}for(var i in t)if(!o.e$.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function b(e,t){return void 0===t?function(t){return b(e,t)}:o.e$.call(t,e)?o.G(t[e]):o.YP}var y={};function w(e){return function(t){var n={};for(var r in t)o.e$.call(t,r)&&(n[r]=e(r,t[r]));return n}}function S(e){return w((function(t,n){return e(n)}))}function _(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(2===e.length)return _(a.Df).apply(void 0,e);var n=f(e[0]);return function(e,t){return function(r){for(var i=e,o=n(r),c=o.length,a=0;a<c;a++){var s=o[a];i=t(s,i,r[s])}return i}}}function I(e){if("compare"in e){var t=f(e);return function(e){return function(n){return function(r){for(var i=e.empty,o=t(r),c=o.length,a=0;a<c;a++){var s=o[a];i=e.concat(i,n(s,r[s]))}return i}}}}return I(a.Df)(e)}function E(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(2===e.length)return E(a.Df).apply(void 0,e);var n=f(e[0]);return function(e,t){return function(r){for(var i=e,o=n(r),c=o.length-1;c>=0;c--){var a=o[c];i=t(a,r[a],i)}return i}}}var G=function(e,t){var n;return(n={})[e]=t,n};function z(e){return Z(a.Df)(e)}function U(e){return function(t){var n={},r={};for(var i in t)if(o.e$.call(t,i)){var a=e(i,t[i]);switch(a._tag){case"Left":n[i]=a.left;break;case"Right":r[i]=a.right}}return(0,c.s4)(n,r)}}function k(e){return function(t){var n={},r={};for(var i in t)if(o.e$.call(t,i)){var a=t[i];e(i,a)?r[i]=a:n[i]=a}return(0,c.s4)(n,r)}}function q(e){return function(t){var n={};for(var r in t)if(o.e$.call(t,r)){var i=e(r,t[r]);o.pC(i)&&(n[r]=i.value)}return n}}function P(e){return function(t){var n={},r=!1;for(var i in t)if(o.e$.call(t,i)){var c=t[i];e(i,c)?n[i]=c:r=!0}return r?n:t}}var T=g,O=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function C(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function D(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function x(e){return function(t,n){if(void 0===n){var r=x(e);return function(e){return r(t,e)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var A=function(e,t){return(0,i.zG)(e,S(t))},M=function(e,t){return(0,i.zG)(e,w(t))},R=function(e){var t=oe(e);return function(e,n,r){return(0,i.zG)(e,t(n,r))}},Y=function(e){return function(t){var n=ce(e)(t);return function(e,t){return(0,i.zG)(e,n(t))}}},F=function(e){var t=ae(e);return function(e,n,r){return(0,i.zG)(e,t(n,r))}},L=function(e,t){return(0,i.zG)(e,te(t))},j=function(e,t){return(0,i.zG)(e,ne(t))},N=function(e,t){return(0,i.zG)(e,re(t))},$=function(e,t){return(0,i.zG)(e,ie(t))},Q=function(e){var t=_(e);return function(e,n,r){return(0,i.zG)(e,t(n,r))}},B=function(e){var t=I(e);return function(e){var n=t(e);return function(e,t){return(0,i.zG)(e,n(t))}}},H=function(e){var t=E(e);return function(e,n,r){return(0,i.zG)(e,t(n,r))}},K=function(e,t){return(0,i.zG)(e,U(t))},V=function(e,t){return(0,i.zG)(e,k(t))},W=function(e,t){return(0,i.zG)(e,q(t))},J=function(e,t){return(0,i.zG)(e,P(t))},X=function(e){var t=ee(e);return function(e){var n=t(e);return function(e,t){return n(e,(0,i.ls)(i.SK,t))}}},Z=function(e){var t=X(e);return function(e){var n=t(e);return function(e){return n(e,i.yR)}}},ee=function(e){return function(t){var n=f(e);return function(e,r){var i=n(e);if(0===i.length)return t.of(y);for(var o=t.of({}),c=function(n){o=t.ap(t.map(o,(function(e){return function(t){var r;return Object.assign({},e,((r={})[n]=t,r))}})),r(n,e[n]))},a=0,s=i;a<s.length;a++){c(s[a])}return o}}},te=function(e){return P((function(t,n){return e(n)}))},ne=function(e){return q((function(t,n){return e(n)}))},re=function(e){return k((function(t,n){return e(n)}))},ie=function(e){return U((function(t,n){return e(n)}))};function oe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){var n=_(e[0]);return function(e,t){return n(e,(function(e,n,r){return t(n,r)}))}}return oe(a.Df).apply(void 0,e)}function ce(e){if("compare"in e){var t=I(e);return function(e){var n=t(e);return function(e){return n((function(t,n){return e(n)}))}}}return ce(a.Df)(e)}function ae(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){var n=E(e[0]);return function(e,t){return n(e,(function(e,n,r){return t(n,r)}))}}return ae(a.Df).apply(void 0,e)}var se=function(e){var t={};for(var n in e)if(o.e$.call(e,n)){var r=e[n];o.pC(r)&&(t[n]=r.value)}return t},ue=function(e){var t={},n={};for(var r in e)if(o.e$.call(e,r)){var i=e[r];o.nM(i)?t[r]=i.left:n[r]=i.right}return(0,c.s4)(t,n)},fe="ReadonlyRecord";function le(e){var t=h(e);return(0,r.f7)((function(e,n){return t(e)(n)&&t(n)(e)}))}function de(e){return{concat:function(t,n){if(u(t))return n;if(u(n))return t;var r=Object.assign({},t);for(var i in n)o.e$.call(n,i)&&(r[i]=o.e$.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:y}}a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df;function ge(e,t){return o.e$.call(void 0===t?this:t,e)}a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df,a.Df},377:(e,t,n)=>{n.d(t,{H5:()=>a,Kl:()=>s,Lx:()=>f,Pd:()=>o,Yg:()=>i,li:()=>r,nq:()=>l,pL:()=>c,u4:()=>u});n(735);function r(e){return e[0]}function i(e){return e[1]}var o=function(e,t){return function(n){return[t(r(n)),e(i(n))]}},c=function(e){return function(t){return[e(r(t)),i(t)]}},a=function(e){return function(t){return[r(t),e(i(t))]}},s=r,u=function(e,t){return function(n){return t(e,r(n))}},f=function(){return function(e){return function(t){return e(r(t))}}},l=function(e,t){return function(n){return t(r(n),e)}}},870:(e,t,n)=>{n.d(t,{F2:()=>c,Vn:()=>i,s4:()=>r});n(735);var r=function(e,t){return{left:e,right:t}},i=function(e){return function(t){return r(e(o(t)),c(t))}},o=function(e){return e.left},c=function(e){return e.right}},151:(e,t,n)=>{n.d(t,{At:()=>G,Do:()=>z,Hi:()=>y,Hr:()=>k,PM:()=>b,UA:()=>_,UI:()=>d,YO:()=>U,ak:()=>q,ap:()=>g,dO:()=>h,mU:()=>I,of:()=>p,pE:()=>D,qA:()=>w,qo:()=>S,tD:()=>s,tS:()=>m,uU:()=>C});var r=n(862),i=n(130),o=n(735),c=n(341),a=n(384),s=function(e){return function(){return Promise.resolve().then(e)}};var u=function(e,t){return(0,o.zG)(e,d(t))},f=function(e,t){return(0,o.zG)(e,g(t))},l=function(e,t){return(0,o.zG)(e,m(t))},d=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},g=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then((function(e){return(0,e[0])(e[1])}))}}},p=function(e){return function(){return Promise.resolve(e)}},m=function(e){return function(t){return function(){return Promise.resolve().then(t).then((function(t){return e(t)()}))}}},v="Task";var h={URI:v,map:u},b={URI:v,of:p},y={URI:v,map:u,ap:f},w={URI:v,map:u,ap:f,of:p},S={URI:v,map:u,ap:f,chain:l},_={URI:v,map:u,of:p,ap:f,chain:l},I=(o.yR,(0,r.m)(S)),E={URI:v,fromIO:s},G=(0,i.At)(E,S),z=p(a.F4),U=(0,c.YO)(h),k=(0,c.Hr)(h),q=(0,r.a)(S),P=p(a.Xl),T=function(e){var t=function(e){return function(t){return function(){return Promise.all(t.map((function(t,n){return Promise.resolve().then((function(){return e(n,t)()}))})))}}}(e);return function(e){return a.Od(e)?t(e):P}},O=function(e){var t=function(e){return function(t){return function(){return a.Gb(t).reduce((function(t,n,r){return t.then((function(t){return Promise.resolve().then(e(r+1,n)).then((function(e){return t.push(e),t}))}))}),Promise.resolve().then(e(0,a.YM(t))).then(a.ri))}}}(e);return function(e){return a.Od(e)?t(e):P}},C=function(e){return T((function(t,n){return e(n)}))},D=function(e){return O((function(t,n){return e(n)}))}},767:(e,t,n)=>{n.d(t,{At:()=>Z,DT:()=>W,EQ:()=>I,Hi:()=>B,Hr:()=>re,Ij:()=>ce,LV:()=>E,OV:()=>Q,Qt:()=>oe,UI:()=>D,Vn:()=>A,Y3:()=>z,YO:()=>ne,Zl:()=>Y,ak:()=>ie,fF:()=>S,fS:()=>G,fX:()=>V,it:()=>U,oU:()=>X,of:()=>L,t$:()=>m,tD:()=>w,tS:()=>R,wE:()=>te,wp:()=>F});var r=n(828),i=n(862),o=n(856),c=n(690),a=n(130),s=n(679),u=n(735),f=n(341),l=n(384),d=n(151),g=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function c(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,a)}s((r=r.apply(e,t||[])).next())}))},p=function(e,t){var n,r,i,o,c={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,r=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!(i=c.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){c.label=o[1];break}if(6===o[0]&&c.label<i[1]){c.label=i[1],i=o;break}if(i&&c.label<i[2]){c.label=i[2],c.ops.push(o);break}i[2]&&c.ops.pop(),c.trys.pop();continue}o=t.call(e,c)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},m=o.t$(d.PM),v=o.F2(d.PM),h=o.m8(d.dO),b=o.pk(d.dO),y=(0,u.ls)(d.tD,h),w=(d.tD,y),S=h,_=d.of,I=(d.tD,o.EQ(d.dO)),E=o.LV(d.UA),G=o.fS(d.UA),z=function(e,t){return function(){return g(void 0,void 0,void 0,(function(){var n;return p(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(l.F2)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,l.t$(t(n))];case 3:return[2]}}))}))}},U=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return z((function(){return e.apply(void 0,n)}),t)}},k=(d.dO,d.PM,d.PM,d.UA,d.UA,d.UA,d.UA,d.dO,function(e,t){return(0,u.zG)(e,D(t))}),q=function(e,t){return(0,u.zG)(e,M(t))},P=function(e,t){return(0,u.zG)(e,R(t))},T=function(e,t,n){return(0,u.zG)(e,x(t,n))},O=function(e,t){return(0,u.zG)(e,A(t))},C=function(e,t){return(0,u.zG)(e,F(t))},D=o.UI(d.dO),x=o.Pd(d.dO),A=o.Vn(d.dO),M=o.ap(d.Hi),R=o.tS(d.UA),Y=R,F=o.wp(d.UA),L=v,j=m,N="TaskEither";var $={URI:N,map:k},Q=(0,f.OV)($),B={URI:N,map:k,ap:q},H={URI:N,map:k,ap:q,chain:P},K={URI:N,fromEither:_},V=(0,c.fX)(K,H),W=(0,c.DT)(K),J={URI:N,fromIO:w},X=(0,a.oU)(J,H),Z=(0,a.At)(J,H),ee={URI:N,fromIO:w,fromTask:S},te=(0,s.oU)(ee,H);l.F4;var ne=(0,f.YO)($),re=(0,f.Hr)($),ie=(0,i.a)(H),oe=(0,r.Qt)(B),ce=(l.Xl,{URI:N,bimap:T,mapLeft:O,map:k,of:L,ap:q,chain:P,alt:C,fromIO:w,fromTask:S,throwError:j})},706:(e,t,n)=>{n.d(t,{H5:()=>c,Yg:()=>o,li:()=>i});var r=n(377),i=(n(735),r.li),o=r.Yg;var c=function(e){return function(t){return[i(t),e(o(t))]}};r.Kl,r.Lx,r.u4,r.nq},605:(e,t,n)=>{function r(e,t){return function(n){var r=e.traverse(n);return function(e,i){return n.map(r(e,i),t.separate)}}}function i(e,t){return function(n){var r=e.traverse(n);return function(e,i){return n.map(r(e,i),t.compact)}}}n.d(t,{BL:()=>i,Fj:()=>r})},560:(e,t,n)=>{function r(e,t){return function(n){return n?t.of(void 0):e.zero()}}n.d(t,{l:()=>r})},735:(e,t,n)=>{n.d(t,{MZ:()=>i,Q1:()=>u,SK:()=>g,W8:()=>c,a9:()=>o,bc:()=>l,gn:()=>a,ls:()=>f,r5:()=>s,yR:()=>r,zG:()=>d});function r(e){return e}var i=r;function o(e){return function(){return e}}var c=o(!0),a=o(null),s=o(void 0),u=s;function f(e,t,n,r,i,o,c,a,s){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return c(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return a(c(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return s(a(c(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function l(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function d(e,t,n,r,i,o,c,a,s){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return c(o(i(r(n(t(e))))));case 8:return a(c(o(i(r(n(t(e)))))));case 9:return s(a(c(o(i(r(n(t(e))))))));default:for(var u=arguments[0],f=1;f<arguments.length;f++)u=arguments[f](u);return u}}var g=function(e,t){return t}},384:(e,t,n)=>{n.d(t,{F2:()=>l,F4:()=>h,G:()=>a,Gb:()=>m,Od:()=>g,Wi:()=>i,Xl:()=>v,YM:()=>p,YP:()=>c,e$:()=>b,nM:()=>s,pC:()=>o,r1:()=>y,ri:()=>d,t$:()=>f,tO:()=>u});var r=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},i=function(e){return"None"===e._tag},o=function(e){return"Some"===e._tag},c={_tag:"None"},a=function(e){return{_tag:"Some",value:e}},s=function(e){return"Left"===e._tag},u=function(e){return"Right"===e._tag},f=function(e){return{_tag:"Left",left:e}},l=function(e){return{_tag:"Right",right:e}},d=function(e){return[e]},g=function(e){return e.length>0},p=function(e){return e[0]},m=function(e){return e.slice(1)},v=[],h={},b=Object.prototype.hasOwnProperty,y=function(e){return r([e[0]],e.slice(1),!0)}},11:(e,t,n)=>{n.d(t,{Df:()=>i,Eq:()=>r,Pc:()=>c});var r={equals:function(e,t){return e===t}},i={equals:r.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},o=(r.equals,i.compare,{concat:function(e,t){return e+t}}),c={concat:o.concat,empty:0}},751:(e,t,n)=>{n.d(t,{Df:()=>i,Eq:()=>r,xb:()=>o});var r={equals:function(e,t){return e===t}},i={equals:r.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},o=function(e){return 0===e.length}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e=n(992),t=n(851),r=n(735),i=n(116),o=n(567),c=n(328),a=n(652),s=n(767);function u(e,n){return(0,r.zG)(s.Y3((()=>e.get(n)),(e=>`Failed to read previous state from IndexedDB: ${e}.`)),s.UI((e=>e??void 0)),s.UI((i=>o=>(0,r.ls)((0,a.rO)({previousState:()=>i}),o,(o=>{let{value:c,state:s}=o;const[u,f]=t.Ue(!1),l=(0,r.zG)(s,t.Rp(-1,(e=>e+1)));return{value:(0,r.bc)(u,c),state:(0,r.zG)(t.vP(s,l),(0,a.bw)(t.YP((t=>{let[r,o]=t;if(0!==o||r!==i)switch(f(!1),typeof r){case"undefined":e.delete(n).then((()=>f(!0)));break;case"object":null===r?e.delete(n).then((()=>f(!0))):e.put(r,n).then((()=>f(!0)));break;default:e.put(r,n).then((()=>f(!0)))}}))))}})))))}function f(e){return n=>(0,r.ls)((0,a.rO)({previousState:t=>e.current?t:void 0}),n,(0,a.rO)({state:(0,r.ls)((n=>t.vP(e,n)),t.UI((e=>{let[t,n]=e;return t?n:void 0})))}))}var l=n(365);class d extends Error{static errorName="NetworkRequestFailedError";name=d.errorName;constructor(){super(d.defaultMessage)}static get defaultMessage(){return"Network request failed"}}class g extends Error{static errorName="NetworkRequestTimeoutError";name=g.errorName;constructor(){super(g.defaultMessage)}static get defaultMessage(){return"Network request timed out"}}var p=n(384),m=function(e){return"Left"===e._tag},v=function(e){return"Right"===e._tag};function h(e){return{_tag:"Left",left:e}}function b(e){return{_tag:"Right",right:e}}function y(e,t){return{_tag:"Both",left:e,right:t}}var w=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},S=w;S(b,h,(function(e,t){return y(t,e)}));var _=b,I="These";r.yR,r.yR,p.Xl;class E{metrics;constructor(e){this.metrics=e}req(e){return this.reqImpl(e).then((e=>(0,r.MZ)(e)))}reqWithBeacon(e){var t,n;let{url:r,payload:i}=e;const o=JSON.stringify(i),c=(null===(t=navigator)||void 0===t||null===(n=t.sendBeacon)||void 0===n?void 0:n.call(t,r,JSON.stringify(i)))??!1;return this.trackRequestMetrics({is_beacon:!0,is_error:!c,request:{method:"POST",url:r,content_length:o.length}}),c}reqImpl(t){const n="arraybuffer",{url:i,dataType:c,contentType:s,method:u,withCredentials:f,timeout:m}=t;return new Promise(((v,h)=>{const w=new XMLHttpRequest,S="POST"===t.method?"string"==typeof(_=t.payload)?_:JSON.stringify(_):null;var _;const I=e=>this.trackRequestMetrics({is_beacon:!1,request:{method:u,url:i,content_length:(null==S?void 0:S.length)??0},response:e});w.onload=(0,e.GL)((()=>{var e,t;return(0,r.zG)(w.status,l.DT((e=>e<400),(()=>{const e="text"===w.responseType||""===w.responseType?w.responseText:"Couldn\'t access response text";return`Failed ajax request. Status code was ${w.status}. ${e}`})),l.tS((()=>"json"===c?w.responseText?l.Y3((()=>JSON.parse(w.responseText)),(e=>`Failed to parse response as JSON. Response was ${JSON.stringify(w.responseText)}. Got ${e}`)):l.F2(null):"text"===c?l.F2(w.responseText):l.F2(w.response))),(0,a.bw)((0,r.ls)(o.IS,(t={content_length:"text"===w.responseType||""===w.responseType?(null===(e=w.responseText)||void 0===e?void 0:e.length)??0:w.responseType===n?w.response.byteLength:0,response_time_ms:self.performance.now()-E,status_code:w.status},function(e){return p.Wi(e)?b(t):y(e.value,t)}),I)),l.EQ(h,v))})),w.onerror=(0,e.GL)((()=>{I(l.t$("network error")),h(new d)})),w.ontimeout=(0,e.GL)((()=>{I(l.t$("timeout")),h(new g)})),w.open(u,i,!0),s&&w.setRequestHeader("content-type",s),w.timeout=m||w.timeout,w.withCredentials=f||w.withCredentials,w.responseType="binary"===c?n:w.responseType;const E=self.performance.now();w.send(S)}))}trackRequestMetrics(e){var t;if(null===(t=this.metrics)||void 0===t||!t.isEnabled())return;const n=new URL(e.request.url).pathname;if(n.includes("metrics"))return;const i=t=>this.metrics.track({name:"sdk_http_request_count_total",value:1,labels:{request_method:e.request.method,request_path:n,request_content_length:e.request.content_length,...t}});var c;!0===e.is_beacon?i({is_beacon:!0,is_error:e.is_error}):(0,r.zG)((c=e.response,m(c)?p.YP:(v(c),p.G(c.right))),o.aD((()=>({})),(e=>({response_content_length:e.content_length,response_status:e.status_code,response_time_ms:e.response_time_ms}))),(t=>({is_beacon:!1,is_error:!v(e.response),...t})),i)}}class G{config;PATH_JOINER_Q="?";PATH_JOINER_A="&";constructor(e){this.config=e}getBaseUrl(){return`${this.config.apiProtocol}://${this.config.apiHost}`}getEndpointUrl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.getUrl("base",e,t,n)}getSdkErrorsUrl(e,t){return this.getUrl("sdk-errors",e,t,[])}getAdvertiserEndpointUrl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.getUrl("adv",e,t,n)}getClassificationModelsEndpointUrl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.getUrl("clm",e,t,n)}getAudienceMatchingEndpointUrl(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const i=`${e}/${n}/audiences`;return this.getUrl("audience-matching",i,t,r)}getCCSCohortMembershipEndpointUrl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.getUrl("ccs",e,t,n)}makeAuthenticatedUrl(e){return this.makeUrlWithQueryParams(e,[["k",this.config.apiKey]])}getUrlPrefix(e){switch(e){case"base":return"";case"adv":return"/adv";case"sdk-errors":return"/sdk-errors";case"clm":return"/clm";case"audience-matching":return"/audience-matching";case"ccs":return"/ccs"}}getUrl(e,t,n,r){const i=this.getUrlPrefix(e),c=(0,o.g_)((()=>""),(e=>`/${e}`))(n),a=`${this.getBaseUrl()}${i}${c}${t}`;return this.makeUrlWithQueryParams(a,r.concat([["k",this.config.apiKey]]))}makeUrlWithQueryParams(e,t){const n=t.map((e=>{let[t,n]=e;return`${t}=${n}`})).join(this.PATH_JOINER_A),r=e.includes(this.PATH_JOINER_Q)?this.PATH_JOINER_A:this.PATH_JOINER_Q;return`${e}${r}${n}`}}var z=n(869),U=n(828);class k{sdkInitTimestamp;timeOriginSdkInit;logger;prefix="[Metrics]";timeOriginForContext=T();pendingMetrics=[];pendingCounters={};pendingTimers={};constructor(e,t,n){this.sdkInitTimestamp=e,this.timeOriginSdkInit=t,this.logger=n}isEnabled(){return!0}consume(){const e=this.pendingMetrics.concat(Object.values(this.pendingCounters).flat());return this.pendingMetrics=[],this.pendingCounters={},e}track(e){this.logDebug(`Tracking ${e.name}`,{metric:e}),this.pendingMetrics.push(e)}trackCounter(e){if(this.logDebug(`Tracking ${e.name}`,{metric:e}),e.name in this.pendingCounters){const t=Object.keys(e.labels),n=this.pendingCounters[e.name].findIndex((n=>Object.keys(n.labels).length===t.length&&t.every((t=>n.labels[t]===e.labels[t]))));-1===n?this.pendingCounters[e.name].push(e):this.pendingCounters[e.name][n]=P(this.pendingCounters[e.name][n],e.value)}else this.pendingCounters[e.name]=[e]}synchroniseTimeBetweenContexts(e){return(0,r.zG)(U.gz(o.G5)(this.timeOriginForContext,this.timeOriginSdkInit),o.UI((t=>{let[n,r]=t;return e+n-r})))}trackTimeSinceInit(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:performance.now();(0,r.zG)(this.synchroniseTimeBetweenContexts(n),o.UI((e=>(e-this.sdkInitTimestamp)/1e3)),o.UI((n=>this.track({name:e,value:n,labels:t}))))}startTimer(e,t){const n=performance.now(),r=this.generateRandomKey(e);return this.pendingTimers[r]={startTime:n,labels:t},r}stopTimer(e,t){const n=this.pendingTimers[t];if(n){const r=(performance.now()-n.startTime)/1e3;this.logDebug("timer stopped",e,r),this.track({name:e,value:r,labels:n.labels}),delete this.pendingTimers[t]}}generateRandomKey(e){return`${e}-${[...Array(24)].map((()=>Math.random().toString(36)[2])).join("")}`}logDebug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.debug(this.prefix,...t)}}class q{isEnabled(){return!1}consume(){return[]}track(e){}trackCounter(e){}trackTimeSinceInit(e,t){}startTimer(e,t){return""}stopTimer(e,t){}}const P=(e,t)=>({...e,value:e.value+t}),T=()=>(0,r.zG)(o.Y3((()=>performance.timeOrigin)),o.hX((e=>"number"==typeof e&&!Number.isNaN(e))));class O{sdkInitTimestamp;prefix="[Permutive]"+(self.document?"[Main]":"[Worker]");debugStyle=["color: blue"].join(";");constructor(e){this.sdkInitTimestamp=e}get timeDeltaFromInit(){return`[${(new Date).getTime()-this.sdkInitTimestamp}ms]`}log(){return console.log.bind(self.console,this.timeDeltaFromInit,this.prefix)(...arguments)}debug(){return console.debug.bind(self.console,"%s%c%s",this.timeDeltaFromInit,this.debugStyle,this.prefix)(...arguments)}warn(){return console.warn.bind(self.console,this.timeDeltaFromInit,this.prefix)(...arguments)}error(){return console.error.bind(self.console,this.timeDeltaFromInit,this.prefix)(...arguments)}}class C{log(){}debug(){}warn(){}error(){}}class D{crypto=self.crypto||self.msCrypto;ALG_NAME="AES-GCM";isAvailable(){var e;return!(null===(e=this.crypto)||void 0===e||!e.subtle)}generateKey(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,e.t_)(this.crypto.subtle.generateKey({name:this.ALG_NAME,length:256},t,["encrypt","decrypt"]))}encrypt(e,t){const[n,r]=this._encrypt(e,this.str2bytes(t));return n.then((e=>{const t=new Uint8Array(16+e.byteLength);return t.set(r,0),t.set(new Uint8Array(Uint32Array.of(e.byteLength).buffer),12),t.set(new Uint8Array(e),16),t.buffer}))}decrypt(e,t){const n=new Uint8Array(t,0,12),r=new Uint32Array(t,12,1)[0],i=t.slice(16,16+r);return this._decrypt(e,n,i).then(this.bytes2str)}_encrypt(t,n){const r=this.crypto.getRandomValues(new Uint8Array(12));return[(0,e.t_)(this.crypto.subtle.encrypt({name:this.ALG_NAME,iv:r},t,n)),r]}_decrypt(t,n,r){return(0,e.t_)(this.crypto.subtle.decrypt({name:this.ALG_NAME,iv:n},t,r))}str2bytes(e){return(new TextEncoder).encode(e).buffer}bytes2str(e){return(new TextDecoder).decode(e)}}class x{config;constructor(e){this.config=e}getNamespacedStorageKey(e){return`${this.config.stateNamespace}${e}`}}var A=n(151),M=n(392),R=n(923),Y=n(17),F=n(241);var L=n(688),j=n(548);class N{timeoutDurationInMilliseconds;maxTimeOutDurationInMilliseconds;constructor(e,t){this.timeoutDurationInMilliseconds=e,this.maxTimeOutDurationInMilliseconds=t}schedule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.timeoutDurationInMilliseconds,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.maxTimeOutDurationInMilliseconds;return this.debounce(e,t,n)}scheduleAccumulated(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.timeoutDurationInMilliseconds,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.maxTimeOutDurationInMilliseconds;return this.debounce(e,n,r,t)}scheduleForPageUnload(e){return(0,a.aT)(e)}debounce(t,n,r,i){let o,c,s,u=[];return f=>{i&&(s=i.concat(s??i.empty,f));const l=(0,a.b2)();u.push(l);var d;return null===(d=o)||void 0===d||d(),o=(0,e.HJ)((()=>{var e;null===(e=c)||void 0===e||e(),c=void 0;const n=t(s||f);u.forEach((e=>e.resolve(n))),s=null==i?void 0:i.empty,u=[]}),n),c||(c=(0,e.HJ)((()=>{var e;null===(e=o)||void 0===e||e(),c=void 0;const n=t(s||f);u.forEach((e=>e.resolve(n))),s=null==i?void 0:i.empty,u=[]}),r)),l.promise}}}class $ extends Error{constructor(e){super(e),this.name="StoreClosingError"}}const Q="permutive-events-cache",B="permutive-events-for-page",H="[EVENTSCACHE]",K=e=>"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name;class V{config;logger;reportError;trace;metrics;userId;makeEventsStore;eventStore;eventsCache=this.makeEventsRepository(Q);eventsForPage=this.makeEventsRepository(B);eventsTTLInMilliseconds;readiness;debouncedReportError=(()=>new N(5e3,5e3).schedule((e=>this.reportError(e.errorMessage,{userId:e.userId}))))();static initialise(e,t,n,i,o,c,a){return(0,r.zG)(a(),s.UI((r=>new V(e,t,n,i,o,c,a,r))))}constructor(e,t,n,i,c,s,u,f){this.config=e,this.logger=t,this.reportError=n,this.trace=i,this.metrics=c,this.userId=s,this.makeEventsStore=u,this.eventStore=f,this.eventsTTLInMilliseconds=(0,r.zG)((0,o.ij)(this.config.eventsTTLInDays),(0,o.tS)((e=>"number"==typeof e&&e>0?(0,o.G)(24*e*3600):o.YP))),this.eventsCache.events=(0,a.HP)((()=>(0,a.PQ)((0,r.zG)(A.tD((()=>this.trace.startSpan("load_event_cache"))),A.tS((e=>(0,r.zG)(this.loadFromDisk(),A.At((t=>()=>{e.finish(),this.logDebug(`Event cache loaded, #e ${t.length}`)}))))))))),this.readiness=this.eventsCache.events().then((()=>this.migratePreviousPagesEvents())),s.onChange((()=>this.reset()))}async migratePreviousPagesEvents(){const e=this.trace.startSpan("migrate_previous_for_page_events"),t=(0,A.pE)((e=>(0,s.Y3)((()=>e.flush()),L.w)));return(0,r.zG)([this.eventsForPage,this.eventsCache],t,(0,A.UI)((t=>{const n=c.bj(t);return n.length>0&&this.reportError(`Migrate previous events failed. Got:\\n${n.join("\\n ")}`,{userId:this.userId.current}),e.finish()})),(e=>e()))}all(){return Promise.all([this.eventsCache.events(),this.eventsForPage.events()]).then(c.xH)}async add(e,t){let{persistOnDisk:n}=t;return this.logDebug("Adding to cache",e),this.eventsForPage.events=(0,r.zG)(this.eventsForPage.events,A.UI((t=>[...t,e])),a.HP),n&&this.readiness.then((()=>this.eventsForPage.flush())),e}filterEventsByWorkspace(e){return e}pruneEventsToSizeLimit(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.config.eventsCacheLimitBytes;if(n<=0||t<=n)return this.logDebug(`Event size of ${t} less than limit of ${n}`),{events:e,sizeInBytes:t};this.logDebug("Events before pruning",{count:e.length,sizeInBytes:t,byteLimit:n});let r=1,i=[...e];for(;t>n;)i.splice(0,r),r*=2,t=2*JSON.stringify(i).length;return this.logDebug("Events after pruning",{count:i.length,sizeInBytes:t}),{events:i,sizeInBytes:t}}loadFromDisk(){const e=()=>[],t=(0,r.zG)(this.eventsTTLInMilliseconds,o.EQ((()=>r.yR),(e=>c.hX((t=>e>Date.now()-t.time.getTime())))));return(0,r.zG)(A.tD((()=>(this.logLog("Loading event cache..."),this.metrics.startTimer("sdk_load_events_cache_task_duration_seconds",{})))),A.YO("loadEventsCacheTask"),A.ak("eventsFromDisk",(()=>(0,r.zG)(c.nI([this.eventStore.get(Q),this.eventStore.get(B)]),c.UI(s.LV((0,a.lo)([[e=>e instanceof $,(0,r.ls)(e,A.of)],t=>(0,r.zG)(A.tD((()=>this.reportError(`Error fetching data from store. Got ${t}`,{userId:this.userId.current}))),A.tS((()=>()=>this.reset("historical"))),A.UI(e))]),(0,r.ls)(o.fS(e),A.of))),c.vP(A.qA)))),A.At((e=>{let{eventsFromDisk:t,loadEventsCacheTask:n}=e;return()=>{this.logDebug("Read events from store:",t),this.metrics.stopTimer("sdk_load_events_cache_task_duration_seconds",n)}})),A.UI((0,r.ls)((0,a.vg)("eventsFromDisk"),c.xH,this.filterEventsByWorkspace,(e=>this.pruneEventsToSizeLimit(e,2*JSON.stringify(e).length)),(e=>(this.eventsCache.sizeInBytes=e.sizeInBytes,this.eventsCache.sizeInBytesLastSuccessfulWrite=e.sizeInBytes,e.events.length>0&&(this.metrics.track({name:"sdk_events_cache_byte_total",value:e.sizeInBytes,labels:{}}),this.metrics.track({name:"sdk_events_cache_size_total",value:e.events.length,labels:{}})),e.events)),c.UI(j.k),t)))}async reset(e){return(0,r.zG)(A.tD((()=>this.logDebug("Resetting Events Cache"))),A.tS((()=>this.eventStore.deleteStore())),s.tS((()=>this.makeEventsStore())),s.Zl((t=>(this.eventStore=t,"historical"===e?U.gz(s.Ij)(this.eventsCache.reset,this.eventsForPage.flush):U.gz(s.Ij)(this.eventsCache.reset,this.eventsForPage.reset)))),s.wE((()=>()=>this.all())),s.fS((()=>A.of(W()))),(e=>e()))}getStateSizeInBytes(){return this.eventsForPage.sizeInBytes+this.eventsCache.sizeInBytes}makeEventsRepository(e){const t=(()=>{let e=Promise.resolve(l.F2((0,r.Q1)()));return t=>e=e.then(t)})(),n=e=>(0,r.zG)(A.tD((()=>this.logDebug(`Writing ${e.length} events to ${p.key}`))),A.tS((()=>this.eventStore.put(e.map(j.X),p.key))),s.UI(r.Q1)),i=(0,r.zG)(A.tD((()=>this.logDebug(`Deleting events for ${p.key}`))),A.tS((()=>this.eventStore.delete(p.key))),s.Vn(L.w)),o=(0,r.ls)(A.of,A.At((e=>()=>this.logError(`Events cache failed to put ${p.key}. Got ${e}`))),A.tS((0,a.lo)([[e=>K(e)&&p.retryAttempts<9,()=>(0,r.zG)(A.tD((()=>{p.retryAttempts+=1,this.logDebug(`Attempt #${p.retryAttempts} to write ${p.key} to EventsStore`)})),A.tS((()=>g)),A.tS((()=>u)))],[e=>K(e),e=>(0,r.zG)(A.tD((()=>this.logDebug(`Attempted ${p.retryAttempts} rewrite attempts and reached limit of 9 max writes.`,"Reporting QuotaExceededError to API"))),A.tS((()=>()=>this.debouncedReportError({errorMessage:`Events cache failed to put ${p.key}. Got ${e}`,userId:this.userId.current}))),A.tS((()=>s.t$(e))))],s.t$]))),c=e=>s.tD((()=>{this.logDebug(`Successfully wrote events for ${p.key} after ${p.retryAttempts} attempts`),p.retryAttempts=0,p.sizeInBytes=2*JSON.stringify(e).length,p.sizeInBytesLastSuccessfulWrite=p.sizeInBytes})),u=(0,r.zG)((()=>p.events()),A.tS((e=>(0,r.zG)(n(e),A.mU(l.EQ(o,(()=>c(e)))))))),f=(e,t)=>(0,r.zG)(e.events,A.UI((n=>{const r=2*JSON.stringify(n).length,i=this.pruneEventsToSizeLimit(n,r,t);return e.events=A.of(i.events),e.sizeInBytes=i.sizeInBytes,t-e.sizeInBytes}))),d=(e,t)=>{let[n,...i]=e;return n&&0!==t?(0,r.zG)(f(n,t),A.tS((e=>(this.logDebug(`${e} left after pruning ${n.key}`),d(i,e))))):A.of((0,r.Q1)())},g=(0,r.zG)(s.tD((()=>this.eventsForPage.sizeInBytes-this.eventsForPage.sizeInBytesLastSuccessfulWrite)),s.fX(l.DT((e=>e>0),(e=>new Error(`${this.eventsForPage.key} failed to write the same or smaller events cache of size ${e}`)))),s.tS((e=>{const t=1.2*e,n=[this.eventsCache,this.eventsForPage];return this.logDebug(`Pruning ${t} bytes from`,n),(0,r.zG)(d(n,t),s.fF)}))),p={key:e,events:A.of([]),sizeInBytes:0,sizeInBytesLastSuccessfulWrite:0,retryAttempts:0,flush:()=>(0,r.zG)(A.tD((()=>this.trace.startSpan(`write_${p.key}`))),A.tS((e=>(0,r.zG)(u,A.At((()=>()=>e.finish()))))),t),reset:()=>(0,r.zG)(A.tD((()=>{p.events=A.of([]),p.sizeInBytes=0,p.sizeInBytesLastSuccessfulWrite=0})),A.tS((()=>i)),t)};return p}logDebug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.debug(H,...t)}logWarn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.warn(H,...t)}logError(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.error(H,...t)}logLog(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.log(H,...t)}}const W=()=>[],J=`permutive.${self.document?"main":"worker"}.`;class X{config;shouldUsePerformanceMark=!1;constructor(e){var t;this.config=e,this.shouldUsePerformanceMark=((null===(t=self.performance)||void 0===t?void 0:t.mark)&&this.config.tracingEnabled)??!1}startSpan(e){const t=this.generateSpan(e);return t.start(),{spanId:t.spanId,finish:t.finish}}measureSinceInit(t){const n=this.generateSpan(`${t}_since_init`);return n.start({startTime:e.NC}),{spanId:n.spanId,finish:n.finish}}traceTask(e){return t=>async()=>{const n=this.startSpan(e),r=await t();return n.finish(),r}}measureBetween(e,t,n){const r=this.generateSpan(e);r.start({startTime:t}),r.finish({startTime:n})}generateSpan(e){if(!this.shouldUsePerformanceMark)return{spanId:null,start:()=>{},finish:()=>{}};const{spanName:t,startMarkerName:n,endMarkerName:r}=X.generateUniqueMarkerNames(e);return{spanId:n,start:e=>{var t;return null===(t=self.performance)||void 0===t?void 0:t.mark(n,e)},finish:e=>{var i,o,c;null===(i=self.performance)||void 0===i||i.mark(r,{startTime:(null==e?void 0:e.startTime)??performance.now()}),null===(o=self.performance)||void 0===o||null===(c=o.measure)||void 0===c||c.call(o,t,n,r)}}}static generateUniqueMarkerNames(e){const t=`${J}${e}`,n=`${t}${X.generateId()}`;return{spanName:t,startMarkerName:`${n}_start`,endMarkerName:`${n}_end`}}static generateId(){return"_"+Math.random().toString(36).substr(2,9)}}class Z{db;static version=3;static connect(t,i,o,c,a,u,f,l,d,g){return(0,r.zG)(s.Y3((()=>Promise.resolve().then(n.bind(n,569))),String),e.N1,s.tS((e=>e.make(t,i,o,c,a,u,f,Z.version,l,d,g))),s.UI((e=>new Z(Promise.resolve(e)))))}constructor(e){this.db=e}shouldThrowStoreClosingError(e){return"NotFoundError"===e.name||"InvalidStateError"===e.name}makeStoreClosingDuringOpertationError(e){return new $(`Attempted ${e} when the current store is closing.`)}put(e,t){return(0,s.Y3)((()=>this.db.then((n=>n.put(e,t)))),(e=>{const t=(0,L.w)(e);return this.shouldThrowStoreClosingError(t)?this.makeStoreClosingDuringOpertationError("put"):t}))}get(e){return(0,s.Y3)((()=>this.db.then((t=>t.get(e))).then(o.ij)),(e=>{const t=(0,L.w)(e);return this.shouldThrowStoreClosingError(t)?this.makeStoreClosingDuringOpertationError("get"):t}))}delete(e){return(0,s.Y3)((()=>this.db.then((t=>t.delete(e)))),(e=>String(e)))}deleteStore(){return(0,s.Y3)((()=>this.db.then((e=>e.deleteStore()))),(e=>String(e)))}}const ee=e=>{if(!e)return"";return(0,r.zG)(e,(e=>{const t=e.length-1;return"/"===e[t]?e.slice(0,t):e}))};class te{urls;config;network;metricsCollector;logger;webClient;prefix="[API]";constructor(e,t,n,r,i){let c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>o.YP;this.urls=e,this.config=t,this.network=n,this.metricsCollector=r,this.logger=i,this.webClient=c}async reportError(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date;const i=(0,L.w)(e);if(this.logError("Reporting error:\\n",i),!this.config.sendClientErrors)return void this.logDebug("Send errors not enabled. Skipping");const a=(0,r.zG)(this.webClient,M.UI(o.fS((()=>{var e,t,n,r;return{domain:(null===(e=self.location)||void 0===e?void 0:e.hostname)??"",referrer:"document"in self?null===(t=self.document)||void 0===t?void 0:t.referrer:"",url:(null===(n=self.location)||void 0===n?void 0:n.href)??"",user_agent:(null===(r=navigator)||void 0===r?void 0:r.userAgent)??""}}))),M.UI((e=>{var r,o;const c={error_message:(null==i||null===(r=i.message)||void 0===r?void 0:r.toString())??"",stack_trace:null==i||null===(o=i.stack)||void 0===o?void 0:o.split("\\n")},a=t?{user_id:t}:{};return{platform:"web",sdk_version:"v20.9.2",ql_runtime_version:"v10.0.2",timestamp:n,domain:e.domain,url:ee(e.url),referrer:ee(e.referrer),user_agent:e.user_agent,error_message:c.error_message??String(i),stack_trace:c.stack_trace,...a}}))),s=e=>this.network.req({url:this.urls.getSdkErrorsUrl("/errors",o.G(this.config.sdkErrorsApiVersion)),method:"POST",payload:[e],contentType:"text/plain",dataType:"text",withCredentials:!1}),u=e=>{this.metricsCollector.trackCounter({name:"sdk_http_generic_network_request_fail_count_total",value:1,labels:{network_error_type:e}})};await(0,r.zG)([d,g],c.Ew((e=>i.name===e.errorName||i.message.indexOf(e.errorName)>=0||i.message.indexOf(e.defaultMessage)>=0)),o.g_((()=>{const e=a();return s(e).catch((0,r.ls)(L.w,(e=>this.logError(e))))}),(async e=>u(e.errorName))))}logDebug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.debug(this.prefix,...t)}logError(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.logger.error(this.prefix,...t)}}const ne=function(e){let t=o.YP;const n=o.fS((()=>{const n=e();return t=o.G(n),n}));return()=>n(t)}((()=>{var e;(()=>{var a={234:function(e,a,s){var u=this&&this.__assign||function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},u.apply(this,arguments)},f=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},l=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)c.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return c},d=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},g=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.env=void 0;var p=g(s(783)),m=g(s(269));a.env=function(){function e(e){return"number"==typeof e?t[e]:e}function a(e){return"number"==typeof e?n[e]:e}function s(e){return"number"==typeof e?r[e]:e}function g(e){switch(e.length){case 0:return null;case 1:return e[0];default:return e}}function v(e,t,n){void 0===n&&(n=y);var r=s(t).reduce((function(e,t){return e&&null!=e[t]?e[t]:null}),e);return null===r?null:n(r)}function h(e,t){var n=s(t).slice();return n.unshift(e),n}function b(e,t,n){return void 0===n&&(n=y),v(e,h("properties",t),n)}var y=function(e){return e},w=function(e){return!0};function S(e,t){return function(n){for(var r=0;r<e.length;r++){if((e[r](n)||!1)===t)return t}return!t}}function _(e){return S(e,!0)}function I(e){return S(e,!1)}var E=function(e){return function(t){return!e(t)}},G=function(e,t){return function(n){return n>=e&&n<=t}},z=function(e){return new Date(e).getTime()},U=function(e){return v(e,["time"],z)},k=function(e,t){return v(t,e,z)},q=function(e,t,n,r,i,o){return function(c){var a=v(c,e,(function(e){return e.filter(r).map((function(e){return v(e,t)})).reduce(i,o)}));return n(null===a?o:a)}};function P(e,t,n,r){var i,o;try{for(var c=f(e),a=c.next();!a.done;a=c.next()){var s=a.value;if(n(s)&&t(s)===r)return r}}catch(e){i={error:e}}finally{try{a&&!a.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}return!r}var T=function(e){return function(t){return("string"==typeof e||"number"==typeof e)&&"string"==typeof t&&t.toLowerCase().indexOf(a(e).toLowerCase())>-1}},O=function(e){return function(t){return null!=t&&Array.isArray(t)&&t.indexOf(e)>=0}};function C(e,t,n,r,i){var o=v(e.getSegments(),[t,n])||!1;return i&&(r||o)&&e.setSegmentActivation(t,n,i),o}function D(e,t,n){return v(e.getSegments(),[t,n])||!1}function x(e,t,n){return void 0===n&&(n=18e5),function(r){return{a:{m:function(e,t){return[t[0],r.a.m(null!=e[0]&&e[0][0]===t[0][0]?e[1]:r.a.z,t[1])]},z:[[],r.a.z]},p:function(n,i){return[[e(n)],v(i,t)===e(n)?r.p(n,i):r.a.z]},r:function(t,n){return r.r(t,0!==n[0].length&&n[0][0]===e(t)?n[1]:r.a.z)},d:r.d.sq||{l:function(i,o){var c=v(i,t),a=e(o);if(c!==a)return null;var s=r.d.l(i,o);if(!(Array.isArray(s)&&s.length>1))return null;var u=l(s),f=u[0],d=u.slice(1),g=+(U(i)||o.getCurrentTime()),p=Math.floor(g/n),m={};return m[p]={},m[p][a]=1===d.length?d[0]:d,[f,"u",null,m]},i:function(t,n){if(!Array.isArray(t)||"object"!=typeof t[3])return[[],r.a.z];var i=e(n),o=t[3];return[[i],Object.keys(o).map((function(e){return o[e][i]})).filter((function(e){return e})).map((function(e){return r.d.i([t[0]].concat(e))})).reduce(r.a.m,r.a.z)]}}}}}var A=x((function(e){return e.getCurrentSession()}),["session_id"],18e5),M=x((function(e){return e.getCurrentView()}),["view_id"],3e5);function R(t,n,r,i){return void 0===i&&(i=1),{a:{m:function(e,t){return e.concat(t).slice(-r)},z:[]},p:function(r,i){return v(i,["name"])===e(n)?[t.p(r,i)]:[]},r:function(e,n){return t.r(e,n.reduce((function(e,n){return t.a.m(e,n)}),t.a.z))},d:t.d.ftn||{l:function(e,n){var o,c=t.d.l(e,n),a=v(e,["time"],z)*i;return c&&[c[0],"x"+r,null,(o={},o[a]=2==c.length?c[1]:c.slice(1),o)]},i:function(e,n){return e?Object.keys(e[3]||{}).sort().reverse().map((function(t){return Array.isArray(t)?d([e[0]],l(e[3][t]),!1):[e[0],e[3][t]]})).map((function(e){return t.d.i(e,n)})):[]}}}}var Y=function(e,t){return null===e?null==t?null:{b:t}:null==t?{a:e}:{a:e,b:t}},F=function(e,t){return e&&t?e(t):null},L=function(e,t,n){if(n&&n.result&&Array.isArray(n.result)){var r=F(e.d&&e.d.m,{result:n.result[0]}),i=F(t.d&&t.d.m,{result:n.result[1]});return Y(r,i)}return null};var j=function(e){return function(t){function n(e){for(var t=e[0],n=1;n<e.length;n++)t=[t,e[n]];return t}function r(e){for(var n=e,r=Array(t.length),i=t.length-1;i>0;i--)r[i]=n[1],n=n[0];return r[0]=n,r}return{p:function(e,r){return n(t.map((function(t){return t.p(e,r)})))},r:function(n,i){var o=r(i);return e(t.map((function(e,t){return function(){return e.r(n,o[t])}})))({})},a:{z:n(t.map((function(e){return e.a.z}))),m:function(e,i){var o=r(e),c=r(i);return n(t.map((function(e,t){return function(e,t,n){return null===t?n:null===n?t:e.a.m(t,n)}(e,o[t],c[t])})))}},d:{l:function(e,n){return function(e){for(var t=e[0],n=1;n<e.length;n++){var r=e[n],i=t;t={},null!==i&&(t.a=i),null!==r&&(t.b=r)}return t}(t.map((function(t){return t.d.l(e,n)})))},i:function(e,r){return function(e,r){for(var i=e,o=t.map((function(e){return e.a.z})),c=function(e,n){return t[e].d.i(n,r)},a=t.length-1;a>0&&i;a--)i.b&&(o[a]=c(a,i.b)),i.a&&1===a&&(o[0]=c(0,i.a)),i=i.a;return n(o)}(e,r)}}}}},N=j(_),$=j(I);function Q(e,t){var n=i[e];if(!t||!n)return!1;if(!n.length)return!0;for(var r=0,o=!1,c=function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);if(r>=55296&&r<=56319){var i=e.charCodeAt(n+1);if(i>=56320&&i<=57343){t.push(e.slice(n,n+2)),++n;continue}}t.push(e.charAt(n))}return t}(t.toLowerCase()),a=0;a<c.length;a++){for(var s=c[a];r>0&&!n[r][s];)r=n[r].su?n[r].su:0;if(n[r][s]&&(o=!!n[r=n[r][s]].te))break}return o}var B=function(e){return(0,p.default)(e).toString(m.default).slice(0,8)},H=function(e,t){var n,r,i=B(e);if(0===t.length)return!1;if(t[0]===i)return!0;for(var o=0,c=t.length,a=!1;(a=(n=t[r=o+(c-o>>1)])!==i)&&(n<i?o=r:c=r,!(o>=c-1)););return!a},K=function(e,t){return function(n){return H(v(n,e),t)}},V=function(e,t){return function(n){return H(b(n,e),t)}};return{q:function(e){return{lift:function(t,n){return e.d.l(t,n)},interpret:function(t,n){return function(t,n){return{result:e.r(t,n)}}(n,e.d.i(t,n))},migrate:function(t){return t&&e.d.m?e.d.m(t):null},m:e.a.m,z:e.a.z,p:e.p,r:e.r,i:e.d.i}},a:I,acq:function(e,t){return{p:function(n,r){return[e.p(n,r),t.p(n,r)]},r:function(n,r){return e.r(n,r[0])&&t.r(n,r[1])},a:{z:[e.a.z,t.a.z],m:function(n,r){return[e.a.m(n[0],r[0]),t.a.m(n[1],r[1])]}},d:{l:function(n,r){return Y(e.d.l(n,r),t.d.l(n,r))},i:function(n,r){return n?[e.d.i(n.a||null,r),t.d.i(n.b||null,r)]:[e.a.z,t.a.z]},m:function(n){return L(e,t,n)}}}},acqs:$,acs:Q,acs_:function(e,t){return function(n){return Q(t,v(n,e))}},af_i:function(e,t,n){return void 0===n&&(n=w),function(r){return v(r,e,(function(e){return P(e,t,n,!1)}))&&!0}},af_l:function(e,t,n){return void 0===n&&(n=w),function(r){var i=v(r,e,(function(e){return e.filter(n).length}));return t(null===i?0:i)}},af_m:function(e,t,n,r){return void 0===r&&(r=w),function(i){var o=v(i,e,(function(e){return e.filter(r)}));return null===o||0===o.length?n(0):n(o.map((function(e){return v(e,t)})).reduce((function(e,t){return e+t}),0)/o.length)}},af_n:function(e,t,n,r){return void 0===r&&(r=w),q(e,t,n,r,(function(e,t){return Math.min(e,t)}),Number.POSITIVE_INFINITY)},af_p:function(e,t,n,r){return void 0===r&&(r=w),q(e,t,n,r,(function(e,t){return e*t}),1)},af_s:function(e,t,n,r){return void 0===r&&(r=w),q(e,t,n,r,(function(e,t){return e+t}),0)},af_u:function(e,t,n){return void 0===n&&(n=w),function(r){return v(r,e,(function(e){return P(e,t,n,!0)}))||!1}},af_x:function(e,t,n,r){return void 0===r&&(r=w),q(e,t,n,r,(function(e,t){return Math.max(e,t)}),Number.NEGATIVE_INFINITY)},as:function(e,t,n){var r=h("properties",t);return function(t){for(var i=v(t,r),o=n.length,c=!0,a=0;a<o;a++){var s=n[a];if(!(c=e(s)(i)))break}return c}},c:O,c_:function(e,t){return function(n){return O(t)(v(n,e))}},cl_:function(e,t){return function(n){return O(a(t))(v(n,e))}},cx:function(e){return function(t){return O(a(e))(t)}},ctu:function(t,n,r,i){return{a:i?{m:function(e,t){return e.filter((function(e){return-1===t.indexOf(e)})).concat(t).slice(-i)},z:[]}:{m:function(e,t){return e.filter((function(e){return-1===t.indexOf(e)})).concat(t)},z:[]},p:function(i,o){return v(o,["name"])===e(t)&&n(o)?v(o,r):[]},r:function(e,t){return t},d:{l:function(){return null},i:function(){return[]}}}},ctv:function(t,n,r,i){function o(e,t){var n,r=function(e){return{k:e.k,c:1+e.c}},i={arr:[],add:{k:t,c:1}};return t?(n=e.reduce((function(e,t){return e.add.k===t.k?{arr:e.arr,add:r(t)}:{arr:e.arr.concat(t),add:e.add}}),i)).arr.concat(n.add):e}return{a:i?{m:function(e,t){return o(e,t).slice(-i)},z:[]}:{m:function(e,t){return o(e,t)},z:[]},p:function(i,o){return v(o,["name"])===e(t)&&n(o)?v(o,r):null},r:function(e,t){return t.reduce((function(e,t){var n;return u(u({},e),((n={})[t.k]=t.c,n))}),{})},d:{l:function(e){return null},i:function(e){return[]}}}},ctw:function(t,n,r,i){return{a:i?{m:function(e,t){return e.concat(t).slice(-i)},z:[]}:{m:function(e,t){return e.concat(t)},z:[]},p:function(i,o){return v(o,["name"])===e(t)&&n(o)?v(o,r):[]},r:function(e,t){return t},d:{l:function(){return null},i:function(){return[]}}}},cw:function(t,n,r){return void 0===r&&(r=y),{a:{m:function(e,t){return e+t},z:0},p:function(r,i){return v(i,["name"])===e(t)&&n(i)?1:0},r:function(e,t){return r(t)},d:{l:function(r){return v(r,["name"])===e(t)&&n(r)?["p",1]:null},i:function(e){return e?Array.isArray(e)?e.slice(-1)[0]:e:0},m:function(e){return e&&e.result?["p",e.result]:null}}}},cb:function(t,n,r,i){return{a:{m:function(e,t){return Math.min(e+t,i)},z:0},p:function(r,i){return v(i,["name"])===e(t)&&n(i)?1:0},r:function(e,t){return r(t)},d:{l:function(r){return v(r,["name"])===e(t)&&n(r)?["b".concat(i,"p"),1]:null},i:function(e){return e?Array.isArray(e)?e.slice(-1)[0]:e:0},m:function(e){return e&&e.result?["b".concat(i,"p"),Math.min(i,e.result)]:null}}}},e:function(e){return function(t){return t===e}},e_:function(e,t){return function(n){return v(n,e)===t}},fm:function(e,t){return{p:t.p,r:function(n,r){return e(t.r(n,r))},a:t.a,d:t.d}},frontDecode:function(e){var t=e.split("\\t");if(0===t.length)return[];var n=t[0],r=new Array(Math.ceil(t.length/2));r[0]=t[0];for(var i=1;i<t.length/2;i+=1){var o=t[2*i-1],c=t[2*i];if(""===o)n=c;else{var a=parseInt(o);n=n.slice(0,a)+c}r[i]=n}return r},ftn:function(t,n,r){return{a:{m:function(e,t){return e.concat(t.slice(0,r-e.length))},z:[]},p:function(r,i){return v(i,["name"])===e(n)?[t.p(r,i)]:[]},r:function(e,n){return t.r(e,n.reduce((function(e,n){return t.a.m(e,n)}),t.a.z))},d:R(t,n,r,-1).d}},fw:function(t,n,r,i){return void 0===i&&(i=y),{a:{m:function(e,t){return null===e?t:e},z:null},p:function(i,o){return v(o,["name"])===e(t)&&n(o)?v(o,r):null},r:function(e,t){return t},d:{l:function(r){return v(r,["name"])===e(t)&&n(r)?["p",1]:null},i:function(e){return e?Array.isArray(e)?e.slice(-1)[0]:e:0},m:function(e){return e&&e.result?["p",e.result]:null}}}},g:function(e){return function(t){return t>e}},g_:function(e,t){return function(n){return v(n,e)>t}},gb:function(e,t,n){return{a:{m:function(n,r){return Object.keys(n).concat(Object.keys(r)).filter((function(e,t,n){return n.indexOf(e)===t})).sort((function(e,t){return Math.max(v(n,[t,1]),v(r,[t,1]))-Math.max(v(n,[e,1]),v(r,[e,1]))})).slice(0,t).reduce((function(t,i){var o=e.a.m(v(n,[i,0])||e.a.z,v(r,[i,0])||e.a.z);return t[i]=[o,Math.max(v(n,[i,1]),v(r,[i,1]))],t}),{})},z:{}},p:function(t,r){var i,o,c=v(r,h("properties",n)),a=e.p(t,r);return null==c||(null==(o=a)||"object"==typeof o&&0===Object.keys(o).length||o===e.a.z)?{}:((i={})[c]=[a,v(r,["time"],z)],i)},r:function(t,n){var r={};return Object.keys(n).forEach((function(i){return r[i]=e.r(t,n[i][0])})),r},d:{l:function(){return null},i:function(){return{}}}}},ge:function(e){return function(t){return t>=e}},ge_:function(e,t){return function(n){return v(n,e)>=t}},bse:function(e,t){return function(n){var r=v(n,e);return B(r)===t}},bsne:function(e,t){return function(n){var r=v(n,e);return B(r)!==t}},bsc:K,bsnc:function(e,t){return E(K(e,t))},bsc_:V,bsnc_:function(e,t){return E(V(e,t))},i_:y,ifp:function(e){return{a:{m:function(e,t){return t},z:null},p:function(e){return null},r:function(t,n){return function(t){return D(t,"1p",e)}(t)},d:{l:function(e,t){return null},i:function(e){return null}}}},isp:function(e,t,n,r){return{a:{m:function(e,t){return t},z:!1},p:function(n,r){return D(n,e,t)},r:function(i,o){return C(i,e,t,n,r)},d:{l:function(e,t){return null},i:function(e){return Array.isArray(e)&&(!!+e[2]||!1)}}}},itp:function(e,t,n,r){return{a:{m:function(e,t){return t},z:!1},p:function(n,r){return D(n,e,t)},r:function(i,o){return C(i,e,t,n,r)},d:{l:function(e,t){return null},i:function(e){return Array.isArray(e)&&(!!+e[2]||!1)}}}},k:v,l:function(e){return function(t){return t<e}},l_:function(e,t){return function(n){var r=v(n,e);return null!==r&&r<t}},le:function(e){return function(t){return t<=e}},le_:function(e,t){return function(n){var r=v(n,e);return null!==r&&r<=t}},lm:function(e,t){var n=function(t){return function(e,t,n){if(void 0===t[n])return NaN;var r=e||{};if(0==(r["1p"]||[]).length)return NaN;var i,o=t[n]||{},c=(o["1p"]||{}).const||0;return Object.keys(r).forEach((function(e){r[e].forEach((function(t){var n=(o[e]||{})[t]||0;c+=n}))})),i=c,1/(1+Math.pow(Math.E,-i))}(t.getSegmentsArray(),t.getLookalikeModels(),e)};return{a:{m:function(e,t){return t},z:null},p:function(e){return null},r:function(e,r){return t(n(e))},d:{l:function(e,t){return null},i:function(e){return null}}}},ltn:R,mnw:function(t,n,r,i){void 0===i&&(i=y);var o=Number.POSITIVE_INFINITY;return{a:{m:function(e,t){return e<t?e:t},z:o},p:function(i,c){return v(c,["name"])===e(t)&&n(c)?v(c,r):o},r:function(e,t){return i(t)},d:{l:function(i){return v(i,["name"])===e(t)&&n(i)?["n",v(i,r)]:null},i:function(e){return e?Array.isArray(e)?e.slice(-1)[0]:e:o}}}},mxw:function(t,n,r,i){void 0===i&&(i=y);var o=Number.NEGATIVE_INFINITY;return{a:{m:function(e,t){return e>t?e:t},z:o},p:function(i,c){return v(c,["name"])===e(t)&&n(c)?v(c,r):o},r:function(e,t){return i(t)},d:{l:function(i){return v(i,["name"])===e(t)&&n(i)?["v",v(i,r)]:null},i:function(e){return e?Array.isArray(e)?e.slice(-1)[0]:e:o}}}},n0:E(y),n:function(e){return function(t){return t!==e}},nt:E,n_:function(e,t){return function(n){return v(n,e)!==t}},o:_,ocq:function(e,t){return{p:function(n,r){return[e.p(n,r),t.p(n,r)]},r:function(n,r){return e.r(n,r[0])||t.r(n,r[1])},a:{z:[e.a.z,t.a.z],m:function(n,r){return[e.a.m(n[0],r[0]),t.a.m(n[1],r[1])]}},d:{l:function(n,r){return Y(e.d.l(n,r),t.d.l(n,r))},i:function(n,r){return n?[e.d.i(n.a||null,r),t.d.i(n.b||null,r)]:[e.a.z,t.a.z]},m:function(n){return L(e,t,n)}}}},ocqs:N,oe:function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r},os:function(e,t,n){var r=h("properties",t);return function(t){for(var i=v(t,r),o=n.length,c=!1,a=0;a<o;a++){var s=n[a];if(c=e(s)(i))break}return c}},pacs:function(e,t){return function(n){return Q(t,b(n,e))}},pb:function(e,t,n){return function(r){return G(t,n)(b(r,e))}},pc:function(e,t){return function(n){var r=b(n,e);return null!=r&&Array.isArray(r)&&r.indexOf(t)>=0}},pc_:function(e,t){return function(n){var r=b(n,e),i=a(t);return null!=r&&Array.isArray(r)&&r.indexOf(i)>=0}},pe:function(e,t){return function(n){return b(n,e)===t}},pg:function(e,t){return function(n){return b(n,e)>t}},pge:function(e,t){return function(n){return b(n,e)>=t}},pl:function(e,t){return function(n){var r=b(n,e);return null!==r&&r<t}},ple:function(e,t){return function(n){var r=b(n,e);return null!==r&&r<=t}},pn:function(e,t){return function(n){return b(n,e)!==t}},ps:function(e,t){return function(n){return T(t)(b(n,e))}},pw:function(t,n,r,i){return void 0===i&&(i=y),{a:{m:function(e,t){return e*t},z:1},p:function(i,o){return v(o,["name"])===e(t)&&n(o)?v(o,r):1},r:function(e,t){return i(t)},d:{l:function(i){return v(i,["name"])===e(t)&&n(i)?(o=v(i,r))>=1?["m2p",o]:o>0?["m2p",null,1/o]:0==o?["m2p",0]:o>-1?["m2p",null,1/o,1]:["m2p",o,null,1]:null;var o},i:function(e){return e?Array.isArray(e)?0===(t=e.slice(1))[0]?0:Math.pow(-1,t[2]||0)*(t[0]||1)/(t[1]||1):e:1;var t}}}},r:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return c[e].apply(c,d([],l(t),!1))},ref:function(e){return function(t){return o[e](t)}},s:T,s_:function(e,t){return function(n){return T(t)(v(n,e))}},scq:function(e,t,n){return void 0===n&&(n=y),{p:function(n,r){return[e.p(n,r),t.p(n,r)]},r:function(r,i){return n(e.r(r,i[0])+t.r(r,i[1]))},a:{z:[e.a.z,t.a.z],m:function(n,r){return[e.a.m(n[0],r[0]),t.a.m(n[1],r[1])]}},d:{l:function(n,r){return Y(e.d.l(n,r),t.d.l(n,r))},i:function(n,r){return n?[e.d.i(n.a||null,r),t.d.i(n.b||null,r)]:[e.a.z,t.a.z]},m:function(n){return L(e,t,n)}}}},sq:A,dscq:function(t,n,r,i){var o="x".concat(i),c=function(e){return e?2===e.length?["p",o,"",e[1]]:e:null},a=function(r){var i,c=function(e){return v(e,["session_id"])}(r);return c&&v(r,["name"])===e(t)&&n(r)?["p",o,"",(i={},i[c]=1,i)]:null};return{a:{m:function(e,t){var n=c(e),r=c(t);return n?r?["p",o,"",u(u({},n[3]),r[3])]:n:r},z:null},p:function(e,t){return a(t)},r:function(e,t){var n=t&&t[3]&&"object"==typeof t[3]?Object.keys(t[3]).length:0;return r(n)},d:{l:function(e,t){return a(e)},i:function(e,t){return c(e)}}}},sw:function(t,n,r,i){return void 0===i&&(i=y),{a:{m:function(e,t){return e+t},z:0},p:function(i,o){return v(o,["name"])===e(t)&&n(o)?v(o,r):0},r:function(e,t){return i(t)},d:{l:function(i){return function(r){return v(r,["name"])===e(t)&&n(r)}(i)?(o=v(i,r))<0?["p2",null,-o]:["p2",o]:null;var o},i:function(e){return e?Array.isArray(e)?((t="p2"===e[0]?e.slice(1):e)[0]||0)-(t[1]||0):e:0;var t}}}},t:w,tb:function(e,t){return function(n){return G(e,t)(U(n))}},te:function(e){return function(t){return U(t)===e}},te_:function(e,t){return function(n){return k(e,n)===t}},tg:function(e){return function(t){return U(t)>e}},tg_:function(e,t){return function(n){return k(e,n)>t}},tge:function(e){return function(t){return U(t)>=e}},tge_:function(e,t){return function(n){return k(e,n)>=t}},ti:z,tl:function(e){return function(t){return U(t)<e}},tl_:function(e,t){return function(n){return k(e,n)<t}},tle:function(e){return function(t){return U(t)<e}},tle_:function(e,t){return function(n){return k(e,n)<t}},tn:function(e){return function(t){return U(t)!==e}},tn_:function(e,t){return function(n){return k(e,n)!==t}},tw:function(e,t,n){var r=n||100,i=Math.ceil(t/r),o=function(e){return Math.floor(e/i)},c=function(e,n,r){var i;return[o(e.getTime()-t),(i={},i[o(n)]=r,i)]},a=function(t,n){var r=Math.max(t[0],n[0]),i=Object.keys(t[1]).filter((function(e){return e>=r})).concat(Object.keys(n[1]).filter((function(e){return e>=r}))).filter((function(e,t,n){return n.indexOf(e)===t})).reduce((function(r,i){var o=e.a.m(t[1][i]||e.a.z,n[1][i]||e.a.z);return o!==e.a.z&&(r[i]=o),r}),{});return[r,i]},s=[Number.NEGATIVE_INFINITY,{}],u=function(e){var t=function(t){return t.map((function(t){var n=l(t,3),r=n[0],i=(n[1],n[2]);return c(e.t,i,r)})).reduce(a,s)};return a(t(e.in),t(e.out))},f=function(t){if(void 0!==t.result)return f(t.result);if(void 0!==t.w)return f(u(t));var n=l(t,2),r=(n[0],n[1]),i=null,o={};for(var c in r){var a=e.d.m({result:r[c]});a&&Array.isArray(a)&&(i=a[0],o[c]=g(a.slice(1)))}return i&&[i,"w",t[0],o]};return{a:{m:function(e,t){var n=e.w?u(e):e;return a(n,t)},z:s},p:function(t,n){return c(t.getCurrentTime(),v(n,["time"],z),e.p(t,n))},r:function(t,n){var r=(n.w?u(n):n)[1];return e.r(t,Object.keys(r).reduce((function(t,n){return e.a.m(t,r[n])}),e.a.z))},d:e.d.tw||{l:function(t,n){var r=e.d.l(t,n),i=e.d.i(r,n);return r&&d([r[0],"w"],l(c(n.getCurrentTime(),v(t,["time"],z),i)),!1)},i:function(e,n){var r=Array.isArray(e)?e:[],i=n.getCurrentTime(),c=o(i.getTime()-t);return[r[2]||null,Object.keys(r[3]||{}).map((function(e){var t;return(t={})[e]=r[3][e],t})).reduce((function(e,t){return Object.keys(t).filter((function(e){return parseInt(e)>=c})).forEach((function(n){return e[n]=t[n]})),e}),{})]},m:e.d.m&&f}}},vgw:function(t,n,r,i){void 0===i&&(i=y);var o={v:0,k:0};return{a:{m:function(e,t){var n=e.k+t.k;return{v:n?e.v+t.k*(t.v-e.v)/n:0,k:n}},z:o},p:function(i,c){return v(c,["name"])===e(t)&&n(c)?{v:v(c,r),k:1}:o},r:function(e,t){return i(t.v)},d:{l:function(i){return v(i,["name"])===e(t)&&n(i)?0==(o=v(i,r))?["p3",1]:o<0?["p3",1,null,-o]:["p3",1,o]:null;var o},i:function(e){return e?Array.isArray(e)?{v:(((t=e.slice(1))[1]||0)-(t[2]||0))/(t[0]||1),k:t[0]||0}:void 0:o;var t}}}},vq:M,w:function(e){return function(t){return t===a(e)}},x:function(e){return function(t){return t!==a(e)}},y:function(e,t){return function(r){return b(r,e)===n[t]}},y_:function(e,t){return function(r){return v(r,e)===n[t]}},z:function(e,t){return function(r){return b(r,e)!==n[t]}},z_:function(e,t){return function(r){return v(r,e)!==n[t]}}}}()},249:function(e,t,n){var r;e.exports=(r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(480)}catch(e){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),c={},a=c.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var c=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=c<<24-(r+o)%4*8}else for(var a=0;a<i;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new u.init(t,e)}}),f=c.enc={},l=f.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},d=f.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},g=f.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=g.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,c=this.blockSize,a=o/(4*c),s=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*c,f=e.min(4*s,o);if(s){for(var l=0;l<s;l+=c)this._doProcessBlock(i,l);n=i.splice(0,s),r.sigBytes-=f}return new u.init(n,f)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),m=(a.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new m.HMAC.init(e,n).finalize(t)}}}),c.algo={});return c}(Math),r)},269:function(e,t,n){var r;e.exports=(r=n(249),function(){var e=r,t=e.lib.WordArray;function n(e,n,r){for(var i=[],o=0,c=0;c<n;c++)if(c%4){var a=r[e.charCodeAt(c-1)]<<c%4*2|r[e.charCodeAt(c)]>>>6-c%4*2;i[o>>>2]|=a<<24-o%4*8,o++}return t.create(i,o)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var c=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<n;a++)i.push(r.charAt(c>>>6*(3-a)&63));var s=r.charAt(64);if(s)for(;i.length%4;)i.push(s);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<r.length;o++)i[r.charCodeAt(o)]=o}var c=r.charAt(64);if(c){var a=e.indexOf(c);-1!==a&&(t=a)}return n(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64)},783:function(e,t,n){var r,i,o,c,a,s,u,f;e.exports=(f=n(249),i=(r=f).lib,o=i.WordArray,c=i.Hasher,a=r.algo,s=[],u=a.SHA1=c.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],c=n[3],a=n[4],u=0;u<80;u++){if(u<16)s[u]=0|e[t+u];else{var f=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=f<<1|f>>>31}var l=(r<<5|r>>>27)+a+s[u];l+=u<20?1518500249+(i&o|~i&c):u<40?1859775393+(i^o^c):u<60?(i&o|i&c|o&c)-1894007588:(i^o^c)-899497514,a=c,c=o,o=i<<30|i>>>2,i=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+c|0,n[4]=n[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=c._createHelper(u),r.HmacSHA1=c._createHmacHelper(u),f.SHA1)},480:()=>{}},s={};function u(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return a[e].call(n.exports,n,n.exports,u),n.exports}u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var f=u(234);e=f.env})();var t=["PageviewComplete","SegmentEntry","Pageview","VideoProgress","SlotViewable","VideoView","PixelConversion"],n=e.frontDecode("1500\\t1\\t600\\t\\tCartoni\\t\\tFantasy\\t1\\tiction\\t\\tHorror\\t\\tLifestyle\\t\\tMovie\\t\\tScienza e Tecnologia\\t1\\terie TV\\t1\\toap opera\\t1\\tport\\t\\tThriller\\t\\tX-Style\\t\\ta\\t1\\tlimentazione\\t1\\tndroidworld\\t\\tb\\t1\\tellezza\\t2\\tnessere\\t\\tc\\t1\\tancro\\t1\\teliachia\\t3\\tlulite\\t1\\thampions\\t2\\temioterapia\\t1\\tolesterolo\\t2\\tmputer\\t\\td\\t1\\tieta\\t\\te\\t\\tf\\t1\\tocus\\t\\tg\\t1\\taming\\t1\\tiallozafferano\\t\\th\\t1\\tbbtv\\t1\\tttps://healthy.thewom.it\\t8\\tmediasetinfinity.mediaset.it/kids\\t8\\twww.tgcom24.mediaset.it/cucina/\\t32\\teconomia/\\t32\\tlifestyle/\\t32\\tmastergames\\t\\ticonwheels\\t1\\tntegratori alimentari\\t\\tlineartv\\t\\tmastergame\\t1\\tediasetinfinity\\t1\\tovies\\t1\\tplay-hbbtv\\t\\tnutrizione\\t\\toncologia\\t\\tpc\\t\\tr101\\t1\\tadio105\\t5\\tmontecarlo\\t5\\tterapia\\t\\tsenza glutine\\t1\\tmartworld\\t1\\toldionline\\t1\\tportmediaset\\t1\\ttampant\\t\\ttgcom24\\t2\\ttech\\t1\\thewom\\t1\\tumore\\t\\tvirginradio\\t\\twebboh\\t1\\tittytv"),r=[["segment_number"],["site_name"],["live","liveType"],["client","url"],["genre"],["semantic_label"],["live","programProgress"],["user","age_range"],["label"],["user","gender"],["campaign_id"],["category"],["platform"],["brand"],["page","section"],["client","type"],["text"],["type"],["live","channelName"],["campaign"]],i=[],o=[e.bsc_(4,["8Ygk5V2U","8bMqGTrc","LaXer7ZJ","Og4Ykv+D","Tvtst8AY","WJPR5NmB","YURUb0nq"]),e.os(e.s,4,[24]),e.bsc_(1,["+WJxZaqJ","zK07YKBk"]),e.bsc_(3,["/bWKE45H"]),e.bsc_(1,["Hp7rvYEi","pBDZqKuh"]),e.os(e.w,11,[4,9]),e.bsc_(1,["0L7MIGaR","5dgiFq57","eJGNyvIs"]),e.bsc_(1,["0UDd0w9p","QkRGvRul","roLRN++5","yA6M1BSe"]),e.os(e.s,14,[27,34,53]),e.bsc_(4,["6q46SgSw"]),e.os(e.w,1,[16,59]),e.bsc_(1,["0L7MIGaR","5dgiFq57"]),e.os(e.w,4,[3,5,12]),e.bsc_(3,["bS7nmlsb","sMQD2/7y"]),e.bsc_(3,["NEjdD8UP","f/xCHOfR"]),e.bsc_(1,["3zKNlPyv","F7jX4QHm","GXeNunlm","OtRwzQ/x","V5FYt74F","zY0A1OPC"]),e.os(e.w,1,[68,69]),e.os(e.w,1,[32,63])],c=[(t,n,r,i,o,c,a)=>e.q(e.acqs([e.cb(2,t,n,r),e.cb(i,o,c,a)])),(t,n)=>e.q(e.acqs([e.cb(2,e.y(9,t),e.ge(1),1),e.cb(2,e.y(7,n),e.ge(1),1)])),(t,n,r,i)=>e.q(e.acqs([e.scq(n,r,i),t])),(t,n)=>e.q(e.acqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],141321)),e.cw(1,e.pe(0,141321)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],t)),e.cw(1,e.pe(0,n)),e.ge(1))])),(t,n)=>e.q(e.acqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147114)),e.cw(1,e.pe(0,147114)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],t)),e.cw(1,e.pe(0,n)),e.ge(1))])),(t,n)=>e.q(e.acqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147115)),e.cw(1,e.pe(0,147115)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],t)),e.cw(1,e.pe(0,n)),e.ge(1))])),(t,n,r,i)=>e.q(e.acqs([e.tw(e.cb(2,n,r,i),2592e6),t])),(t,n,r)=>e.q(e.acqs([e.tw(e.cb(2,e.bsc_(1,t),e.ge(2),2),2592e6),e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],146475)),e.cw(1,e.pe(0,146475)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147116)),e.cw(1,e.pe(0,147116)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],n)),e.cw(1,e.pe(0,r)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147119)),e.cw(1,e.pe(0,147119)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147120)),e.cw(1,e.pe(0,147120)),e.e(0))])])),(t,n,r)=>e.q(e.acqs([e.tw(e.cb(2,e.bsc_(1,t),e.ge(2),2),2592e6),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],n)),e.cw(1,e.pe(0,r)),e.e(0))])),(t,n)=>e.q(e.cb(t,n,e.ge(1),1)),(t,n,r)=>e.q(e.cb(t,e.bsc_(n,r),e.ge(1),1)),(t,n,r)=>e.q(e.cb(t,e.y(n,r),e.ge(1),1)),(t,n,r)=>e.q(e.cb(t,e.ps(n,r),e.ge(1),1)),()=>e.q(e.cb(2,e.t,e.ge(1),1)),t=>e.q(e.cb(4,e.pe(10,t),e.ge(1),1)),()=>e.q(e.cb(4,e.pe(10,3127655944),e.ge(1),1)),()=>e.q(e.cb(4,e.pe(10,3506741949),e.ge(1),1)),t=>e.q(e.ocqs(t)),(t,n,r,i)=>e.q(e.ocqs([t,n,r,i])),(t,n,r,i,o)=>e.q(e.ocqs([t,n,r,i,o])),(t,n,r,i,o,c,a,s,u,f,l,d)=>e.q(e.ocqs([t,e.scq(o,c,a),e.scq(s,u,f),n,r,i,e.tw(l,d)])),(t,n,r,i,o,c,a,s,u,f,l,d,g,p,m,v,h,b,y,w,S,_,I,E)=>e.q(e.ocqs([t,e.scq(e.cw(0,e.pc(h,b)),e.cw(1,e.pe(y,w)),e.ge(1)),e.scq(e.cw(0,e.pc(S,_)),e.cw(1,e.pe(I,E)),e.ge(1)),e.scq(e.cw(d,g),e.cw(p,m),e.ge(v)),e.scq(e.cw(a,s),e.cw(u,f),e.ge(l)),n,e.tw(e.cb(r,i,o,c),2592e6)])),(t,n,r)=>e.q(e.ocqs([e.lm(t,e.ge(r)),e.ifp(n)])),t=>e.q(e.ocqs([e.lm("2eed38e3-873e-49f8-baab-5305959811dc",e.ge(t)),e.ifp("163634")])),t=>e.q(e.ocqs([e.lm("313ec24c-243f-49bc-9eb9-aca5dfe7eab0",e.ge(t)),e.ifp("174702")])),t=>e.q(e.ocqs([e.lm("4b51e219-1e56-4752-aa59-9e75a9698137",e.ge(t)),e.ifp("179010")])),t=>e.q(e.ocqs([e.lm("644dab00-6e28-4b2c-918f-f0374a38d5bc",e.ge(t)),e.ifp("172226")])),t=>e.q(e.ocqs([e.lm("7bc2ff67-d9b1-4518-8eb8-0c65cd37e51e",e.ge(t)),e.ifp("199263")])),t=>e.q(e.ocqs([e.lm("b74d02f7-25d5-4f8b-82e8-b85e4e24bbb9",e.ge(t)),e.ifp("172348")])),t=>e.q(e.ocqs([e.lm("d006d4f0-fae8-46b6-ba79-7463a359cebb",e.ge(t)),e.ifp("175346")])),t=>e.q(e.ocqs([e.lm("db8c914c-c6e4-4c37-b627-c5c35ceb57df",e.ge(t)),e.ifp("149334")])),(t,n,r)=>e.q(e.ocqs([e.isp("1p_customaudience",t,!1,n),e.cb(4,e.pe(10,r),e.ge(1),1)])),(t,n,r,i)=>e.q(e.ocqs([e.isp("1p_customaudience",t,!1,n),e.isp("1p_customaudience",r,!1,i)])),(t,n,r,i)=>e.q(e.ocqs([e.isp("1p_demographic",t,!1,n),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],r)),e.cw(1,e.pe(0,i)),e.ge(1))])),(t,n,r,i,o,c,a,s,u,f,l,d)=>e.q(e.ocqs([e.scq(a,s,u),e.scq(f,l,d),t,n,e.tw(e.cb(r,i,o,c),2592e6)])),(t,n,r,i,o,c,a,s,u,f,l,d,g,p,m,v)=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(s,u)),e.cw(1,e.pe(f,l)),e.ge(1)),e.scq(e.cw(0,e.pc(d,g)),e.cw(1,e.pe(p,m)),e.ge(1)),t,e.tw(e.cb(2,r,e.ge(v),2),2592e6),e.tw(e.cb(i,o,c,a),2592e6),n])),(t,n,r,i,o)=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],t)),e.cw(1,e.pe(0,n)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],r)),e.cw(1,e.pe(i,o)),e.ge(1))])),(t,n,r,i,o,c)=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],t)),e.cw(1,e.pe(0,n)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],r)),e.cw(1,e.pe(0,i)),e.ge(1)),e.tw(o,c)])),(t,n,r,i,o,c,a,s,u,f)=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],i)),e.cw(1,e.pe(0,o)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],c)),e.cw(1,e.pe(0,a)),e.ge(1)),e.tw(e.cb(u,f,e.ge(2),2),2592e6),e.tw(e.cb(t,n,e.ge(s),r),2592e6)])),(t,n,r,i,o,c,a,s,u,f,l,d,g,p,m,v)=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],c)),e.cw(1,e.pe(0,a)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],s)),e.cw(1,e.pe(0,u)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],f)),e.cw(1,e.pe(0,l)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],d)),e.cw(1,e.pe(0,g)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],p)),e.cw(1,e.pe(0,m)),e.ge(1)),t,n,e.tw(e.cb(r,i,e.ge(v),o),2592e6)])),(t,n,r,i,o,c,a,s,u,f,l,d,g,p,m,v)=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],u)),e.cw(1,e.pe(f,l)),e.ge(1)),e.scq(e.cw(0,e.pc(d,g)),e.cw(1,e.pe(p,m)),e.ge(1)),t,e.tw(e.cb(c,a,e.ge(v),s),2592e6),e.tw(e.cb(n,r,e.ge(o),i),2592e6)])),()=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144168)),e.cw(1,e.pe(0,144168)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145794)),e.cw(1,e.pe(0,145794)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145765)),e.cw(1,e.pe(0,145765)),e.ge(1))])),()=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144176)),e.cw(1,e.pe(0,144176)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145808)),e.cw(1,e.pe(0,145808)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145779)),e.cw(1,e.pe(0,145779)),e.ge(1))])),(t,n,r,i,o)=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144177)),e.cw(1,e.pe(0,144177)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],n)),e.cw(1,e.pe(0,r)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],i)),e.cw(1,e.pe(0,o)),e.ge(1)),e.tw(e.cb(2,t,e.ge(2),2),2592e6)])),(t,n,r,i,o,c,a,s,u,f,l,d)=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145787)),e.cw(1,e.pe(0,145787)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145758)),e.cw(1,e.pe(0,145758)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145792)),e.cw(1,e.pe(0,145792)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145763)),e.cw(1,e.pe(0,145763)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145794)),e.cw(1,e.pe(0,145794)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145765)),e.cw(1,e.pe(0,145765)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145796)),e.cw(1,e.pe(0,145796)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145768)),e.cw(1,e.pe(0,145768)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145808)),e.cw(1,e.pe(0,145808)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145779)),e.cw(1,e.pe(0,145779)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145809)),e.cw(1,e.pe(0,145809)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145780)),e.cw(1,e.pe(0,145780)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145813)),e.cw(1,e.pe(0,145813)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145784)),e.cw(1,e.pe(0,145784)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144174)),e.cw(1,e.pe(0,144174)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144178)),e.cw(1,e.pe(0,144178)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],t)),e.cw(1,e.pe(0,n)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],r)),e.cw(1,e.pe(0,i)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],o)),e.cw(1,e.pe(0,c)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],a)),e.cw(1,e.pe(0,s)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],u)),e.cw(1,e.pe(0,f)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],l)),e.cw(1,e.pe(0,d)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144177)),e.cw(1,e.pe(0,144177)),e.ge(1))])),()=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145795)),e.cw(1,e.pe(0,145795)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145766)),e.cw(1,e.pe(0,145766)),e.ge(1)),e.tw(e.cb(2,e.ps(3,19),e.ge(2),2),2592e6)])),()=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145808)),e.cw(1,e.pe(0,145808)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145779)),e.cw(1,e.pe(0,145779)),e.ge(1))])),(t,n,r,i,o,c)=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145810)),e.cw(1,e.pe(0,145810)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145781)),e.cw(1,e.pe(0,145781)),e.ge(1)),t,e.tw(e.cb(2,c,e.ge(2),2),2592e6),e.tw(e.cb(n,r,e.ge(o),i),2592e6)])),(t,n,r)=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145811)),e.cw(1,e.pe(0,145811)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145782)),e.cw(1,e.pe(0,145782)),e.ge(1)),e.tw(e.cb(2,e.a([n,e.ref(r)]),e.ge(2),2),2592e6),e.tw(e.cb(2,e.ps(3,64),e.ge(2),2),2592e6),e.tw(e.cb(3,e.a([e.y(4,8),e.y(2,46),e.pg(6,30)]),e.ge(1),1),2592e6),e.isp("2p_beintoo","84",!1,t)])),(t,n,r,i,o)=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145812)),e.cw(1,e.pe(0,145812)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145783)),e.cw(1,e.pe(0,145783)),e.ge(1)),e.tw(e.cb(5,t,e.ge(2),2),2592e6),e.tw(e.cb(3,e.a([e.y(i,o),n,r]),e.ge(1),1),2592e6)])),()=>e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145814)),e.cw(1,e.pe(0,145814)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145785)),e.cw(1,e.pe(0,145785)),e.ge(1)),e.tw(e.cb(2,e.y(1,59),e.ge(2),2),2592e6),e.tw(e.cb(2,e.ps(3,43),e.ge(2),2),2592e6)])),(t,n,r)=>e.q(e.ocqs([e.tw(e.cb(t,n,e.ge(2),2),2592e6),e.tw(e.cb(3,e.a(r),e.ge(1),1),2592e6)])),(t,n,r,i,o,c,a,s,u,f)=>e.q(e.ocqs([e.tw(e.cb(r,i,e.ge(f),o),t),e.tw(e.cb(c,a,s,u),n)])),(t,n,r,i,o,c,a,s,u,f,l)=>e.q(e.ocqs([e.tw(e.cb(2,o,e.ge(l),c),n),e.tw(e.cb(a,s,e.ge(1),1),r),t,e.tw(e.cb(u,f,e.ge(1),1),i)])),(t,n,r,i,o,c)=>e.q(e.ocqs([e.tw(e.cb(2,e.os(e.s,3,i),e.ge(1),1),t),e.tw(e.cb(2,e.os(e.cx,5,o),e.ge(1),1),n),e.tw(e.cb(2,e.af_u(["properties","classifications_watson","keywords"],e.o(c)),e.ge(1),1),r)])),()=>e.q(e.ocqs([e.tw(e.cb(2,e.ref(4),e.ge(2),2),2592e6),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144174)),e.cw(1,e.pe(0,144174)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145795)),e.cw(1,e.pe(0,145795)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145766)),e.cw(1,e.pe(0,145766)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145798)),e.cw(1,e.pe(0,145798)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145769)),e.cw(1,e.pe(0,145769)),e.ge(1)),e.tw(e.cb(2,e.y(3,38),e.ge(2),2),2592e6)])),(t,n)=>e.q(e.isp("1p_customaudience",t,!1,n)),t=>e.q(e.isp("1p_customaudience","02868d1ed0",!1,t)),t=>e.q(e.isp("1p_customaudience","5b1dbfc6a5",!1,t)),t=>e.q(e.isp("1p_customaudience","infosum_pg_oralb_mag23",!1,t)),(t,n)=>e.q(e.isp("2p_beintoo",t,!1,n)),(t,n)=>e.q(e.isp("2p_neodata",t,!1,n)),(t,n)=>e.q(e.isp("zeotap_mediaset",t,!1,n)),t=>e.q(e.isp("zeotap_mediaset","1221730297777131520",!1,t)),(t,n,r,i)=>e.q(e.tw(e.cb(t,n,e.ge(i),r),2592e6)),(t,n,r,i)=>e.q(e.tw(e.cb(t,e.a(i),e.ge(r),n),2592e6)),(t,n,r,i,o)=>e.q(e.tw(e.cb(n,r,i,o),t)),t=>e.q(e.tw(e.cb(2,e.af_u(["properties","classifications_watson","categories"],e.o([e.s_(8,t)])),e.ge(2),2),2592e6)),(t,n)=>e.q(e.tw(e.cb(2,e.af_u(["properties","classifications_watson","categories"],e.o([e.s_(8,t),e.s_(8,n)])),e.ge(2),2),2592e6)),t=>e.q(e.tw(e.cb(2,e.af_u(["properties","classifications_watson","categories"],e.e_(8,t)),e.ge(2),2),2592e6)),t=>e.q(e.tw(e.cb(2,e.af_u(["properties","classifications_watson","categories"],e.s_(8,t)),e.ge(2),2),2592e6)),t=>e.q(e.tw(e.cb(2,e.bsc_(1,t),e.ge(2),2),2592e6)),(t,n,r)=>e.q(e.tw(e.cb(2,e.pc_(5,r),e.ge(n),t),2592e6)),(t,n,r,i)=>e.q(e.tw(e.cb(2,e.y(r,i),e.ge(n),t),2592e6)),t=>e.q(e.tw(e.cb(2,e.pe(1,t),e.ge(2),2),2592e6)),(t,n,r,i)=>e.q(e.tw(e.cb(2,e.ps(r,i),e.ge(n),t),2592e6))],a={},s={125609:e.r(13),138503:e.r(13),139981:e.r(17,[e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145758)),e.cw(1,e.pe(0,145758)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145787)),e.cw(1,e.pe(0,145787)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145761)),e.cw(1,e.pe(0,145761)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145790)),e.cw(1,e.pe(0,145790)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145764)),e.cw(1,e.pe(0,145764)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145793)),e.cw(1,e.pe(0,145793)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145775)),e.cw(1,e.pe(0,145775)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145804)),e.cw(1,e.pe(0,145804)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145807)),e.cw(1,e.pe(0,145807)),e.ge(1)),e.tw(e.cb(2,e.y(1,32),e.ge(2),2),2592e6),e.tw(e.cb(3,e.a([e.y(2,46),e.pg(6,30),e.bsc_(4,["ByIRdEgm","hG3obag0","nP8jZTj6"])]),e.ge(1),1),2592e6),e.tw(e.cb(3,e.a([e.pe(11,"Documentari"),e.y(2,46),e.pg(6,30)]),e.ge(1),1),2592e6)]),139982:e.r(20,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145668)),e.cw(1,e.pe(0,145668)),e.ge(1)),e.tw(e.cb(2,e.ref(14),e.ge(2),2),2592e6),e.tw(e.cb(2,e.y(1,44),e.ge(2),2),2592e6),e.tw(e.cb(3,e.a([e.y(2,46),e.pg(6,20),e.os(e.w,4,["Formula E","Superbike","Motori"])]),e.ge(1),1),2592e6),e.cw(0,e.pc(["aggregations","SegmentEntry"],145786)),e.cw(1,e.pe(0,145786)),e.ge(1),e.cw(0,e.pc(["aggregations","SegmentEntry"],144167)),e.cw(1,e.pe(0,144167)),e.ge(1),e.cb(3,e.a([e.y(2,46),e.pg(6,20),e.bsc_(13,["7ZDdq7lY","VXD17xO1","kgfSp8uS"])]),e.ge(1),1),2592e6),139984:e.r(47,e.tw(e.cb(2,e.y(1,65),e.ge(2),2),2592e6),3,e.a([e.y(13,13),e.y(2,46),e.pg(6,30)]),1,1,e.ps(3,18)),139985:e.r(40,e.tw(e.cb(5,e.y(4,11),e.ge(2),2),2592e6),3,e.a([e.y(2,46),e.pg(6,30),e.bsc_(4,["5blPzyJZ","9Rf5+vaY","GFXC41cC","PptWqlip","Yhrr3gMF"])]),1,1,2,e.y(1,61),2,145809,0,145809,["aggregations","SegmentEntry"],145780,0,145780,2),139986:e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145799)),e.cw(1,e.pe(0,145799)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145770)),e.cw(1,e.pe(0,145770)),e.ge(1)),e.cb(5,e.y(17,7),e.ge(1),1),e.tw(e.cb(3,e.a([e.pe(11,"Film"),e.y(2,46),e.pg(6,30)]),e.ge(1),1),2592e6)])),139987:e.r(35,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145765)),e.cw(1,e.pe(0,145765)),e.ge(1)),e.tw(e.cb(3,e.a([e.pe(4,"Cucina"),e.y(2,46),e.pg(6,30)]),e.ge(1),1),2592e6),e.ref(7),2,e.y(3,40),e.ge(2),2,["aggregations","SegmentEntry"],144168,0,144168,["aggregations","SegmentEntry"],145794,0,145794,2),139988:e.r(46),139989:e.r(17,[e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144170)),e.cw(1,e.pe(0,144170)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145800)),e.cw(1,e.pe(0,145800)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145771)),e.cw(1,e.pe(0,145771)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145812)),e.cw(1,e.pe(0,145812)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145783)),e.cw(1,e.pe(0,145783)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145814)),e.cw(1,e.pe(0,145814)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145785)),e.cw(1,e.pe(0,145785)),e.ge(1)),e.tw(e.cb(2,e.ref(15),e.ge(2),2),2592e6),e.tw(e.cb(3,e.a([e.pe(11,"Intrattenimento"),e.y(2,46),e.pg(6,30)]),e.ge(1),1),2592e6)]),139990:e.r(35,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144174)),e.cw(1,e.pe(0,144174)),e.ge(1)),e.tw(e.cb(3,e.a([e.y(4,6),e.y(2,46),e.pg(6,30)]),e.ge(1),1),2592e6),e.y(1,65),2,e.ps(3,42),e.ge(2),2,["aggregations","SegmentEntry"],145810,0,145810,["aggregations","SegmentEntry"],145781,0,145781,2),139991:e.r(39,e.tw(e.cb(2,e.y(1,60),e.ge(2),2),2592e6),e.tw(e.cb(2,e.ps(3,41),e.ge(2),2),2592e6),3,e.a([e.pe(4,"Inchiesta"),e.y(2,46),e.pg(6,30)]),1,144171,144171,145788,145788,145759,145759,145802,145802,145773,145773,1),139993:e.r(42),139994:e.r(50),139995:e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145795)),e.cw(1,e.pe(0,145795)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145766)),e.cw(1,e.pe(0,145766)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145797)),e.cw(1,e.pe(0,145797)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145768)),e.cw(1,e.pe(0,145768)),e.ge(1)),e.tw(e.cb(2,e.y(1,32),e.ge(2),2),2592e6),e.tw(e.cb(3,e.a([e.y(2,46),e.pg(6,30),e.bsc_(13,["3E0nWlOA","etumgRrz"])]),e.ge(1),1),2592e6),e.isp("2p_beintoo","13",!1,"139995")])),139996:e.r(40,e.tw(e.cb(2,e.ref(17),e.ge(2),2),2592e6),3,e.a([e.y(2,46),e.pg(["progress"],30),e.bsc_(4,["cSI4uowJ","vWufQgbA"])]),1,1,3,e.a([e.y(2,46),e.pg(6,30),e.os(e.w,11,["TG","Informazione"])]),1,145801,0,145801,["aggregations","SegmentEntry"],145772,0,145772,1),139997:e.r(56,"564e41edac","139997"),139998:e.q(e.ocqs([e.tw(e.cb(2,e.y(1,65),e.ge(2),2),2592e6),e.isp("2p_beintoo","99",!1,"139998"),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],139990)),e.cw(1,e.pe(0,139990)),e.ge(1))])),139999:e.r(20,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144174)),e.cw(1,e.pe(0,144174)),e.ge(1)),e.tw(e.cb(2,e.y(1,65),e.ge(2),2),2592e6),e.cb(2,e.ref(3),e.ge(1),1),e.tw(e.cb(3,e.a([e.y(4,6),e.y(2,46),e.pg(6,30)]),e.ge(1),1),2592e6),e.cw(0,e.pc(["aggregations","SegmentEntry"],145810)),e.cw(1,e.pe(0,145810)),e.ge(1),e.cw(0,e.pc(["aggregations","SegmentEntry"],145781)),e.cw(1,e.pe(0,145781)),e.ge(1),e.cb(3,e.a([e.y(13,13),e.y(2,46),e.pg(6,30)]),e.ge(1),1),2592e6),14e4:e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145792)),e.cw(1,e.pe(0,145792)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145763)),e.cw(1,e.pe(0,145763)),e.ge(1)),e.tw(e.cb(2,e.ref(2),e.ge(2),2),2592e6),e.tw(e.cb(2,e.y(3,39),e.ge(2),2),2592e6),e.tw(e.cb(3,e.a([e.y(11,2),e.y(2,46),e.pg(6,30)]),e.ge(1),1),2592e6),e.tw(e.cb(3,e.a([e.y(2,46),e.pg(6,30),e.ref(0)]),e.ge(1),1),2592e6)])),140001:e.r(19,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145803)),e.cw(1,e.pe(0,145803)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145774)),e.cw(1,e.pe(0,145774)),e.ge(1)),e.tw(e.cb(3,e.a([e.y(2,46),e.pg(6,30),e.bsc_(4,["ALJnPiLp","ByIRdEgm"])]),e.ge(1),1),2592e6),e.isp("2p_beintoo","102",!1,"140001"),e.isp("2p_beintoo","374",!1,"140001")),140002:e.r(45),140003:e.r(41),140004:e.r(55),140005:e.r(34,e.tw(e.cb(2,e.ref(16),e.ge(2),2),2592e6),e.cb(5,e.ref(9),e.ge(1),1),3,e.a([e.y(2,46),e.pg(6,30),e.bsc_(4,["6q46SgSw","I/RrkrSI"])]),e.ge(1),1,e.cw(0,e.pc(["aggregations","SegmentEntry"],145812)),e.cw(1,e.pe(0,145812)),e.ge(1),e.cw(0,e.pc(["aggregations","SegmentEntry"],145783)),e.cw(1,e.pe(0,145783)),e.ge(1)),140006:e.r(40,e.tw(e.cb(2,e.ref(6),e.ge(2),2),2592e6),3,e.a([e.y(2,46),e.pg(6,30),e.bsc_(4,["1SMmQ+vO","hG3obag0"])]),1,1,2,e.ps(3,64),2,145811,0,145811,["aggregations","SegmentEntry"],145782,0,145782,2),140007:e.r(44,140047,140047,139986,139986,139987,139987,139990,139990,139995,139995,140006,140006),140008:e.r(40,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145813)),e.cw(1,e.pe(0,145813)),e.ge(1)),3,e.a([e.y(2,46),e.pg(6,30),e.bsc_(4,["BU26tjkb","ByIRdEgm"])]),1,1,2,e.ref(13),2,144177,0,144177,["aggregations","SegmentEntry"],145784,0,145784,2),140009:e.r(49,e.ref(5),e.pg(6,30),e.ref(5),2,46),140010:e.r(36,145914,145914,145929,0,145929),140011:e.r(36,145817,145817,145816,0,145816),140012:e.r(36,145819,145819,145818,0,145818),140013:e.r(36,145821,145821,145820,0,145820),140014:e.r(36,145823,145823,145822,0,145822),140015:e.r(36,145825,145825,145824,0,145824),140016:e.r(36,145827,145827,145826,0,145826),140017:e.r(36,145829,145829,145828,0,145828),140018:e.r(36,145831,145831,145830,0,145830),140019:e.r(36,145821,145821,145832,0,145832),140020:e.r(36,145835,145835,145834,0,145834),140022:e.r(36,145837,145837,145836,0,145836),140023:e.r(36,140467,140467,140468,0,140468),140024:e.r(36,145840,145840,145839,0,145839),140025:e.r(36,145842,145842,145841,0,145841),140026:e.r(36,145844,145844,145843,0,145843),140027:e.r(36,145845,145845,145846,0,145846),140028:e.r(36,145848,145848,145847,0,145847),140029:e.r(36,140455,140455,140456,0,140456),140030:e.r(36,140451,140451,140453,0,140453),140031:e.q(e.ocqs([e.tw(e.cb(2,e.ref(2),e.ge(2),2),2592e6),e.tw(e.cb(3,e.a([e.y(2,46),e.pg(6,30),e.bsc_(4,["Tvtst8AY","WJPR5NmB"])]),e.ge(1),1),2592e6),e.tw(e.cb(3,e.a([e.pg(6,30),e.bsc_(18,["3mwAE8Rl","qWB5bmbs"])]),e.ge(1),1),2592e6)])),140032:e.r(53,e.tw(e.cb(3,e.a([e.y(11,2),e.y(2,46),e.pg(6,30)]),e.ge(1),1),2592e6),2592e6,2592e6,2592e6,e.ref(2),2,3,e.a([e.y(2,46),e.pg(6,30),e.bsc_(4,["LaXer7ZJ","Og4Ykv+D","Tvtst8AY","WJPR5NmB","YURUb0nq"])]),3,e.a([e.pe(18,"Cartoonito HD"),e.pg(6,15)]),2),140034:e.r(51,2,e.ref(2),[e.y(2,46),e.pg(6,30),e.os(e.w,4,["Azione","Anime","Avventura","Family"])]),140035:e.r(21,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],140031)),e.cw(1,e.pe(0,140031)),e.ge(1)),e.tw(e.cb(3,e.a([e.y(2,46),e.pg(6,30),e.ref(0)]),e.ge(1),1),2592e6),3,e.a([e.y(11,2),e.y(2,46),e.pg(6,30)]),e.ge(1),1,0,e.pc(["aggregations","SegmentEntry"],145763),1,e.pe(0,145763),1,0,e.pc(["aggregations","SegmentEntry"],145792),1,e.pe(0,145792),1,["aggregations","SegmentEntry"],140032,0,140032,["aggregations","SegmentEntry"],140034,0,140034),140036:e.r(2,e.tw(e.cb(2,e.t,e.ge(2),2),2592e6),e.tw(e.cw(0,e.pc(["aggregations","SegmentEntry"],140035)),2592e6),e.tw(e.cw(1,e.pe(0,140035)),2592e6),e.e(0)),140047:e.r(37,145797,145797,145768,145768,e.cb(2,e.os(e.s,3,["arredamento","design","mobili"]),e.ge(1),1),5184e6),140451:e.r(33,"96fb8b43bd","140451",147115,147115),140453:e.r(11,2,9,14),140454:e.r(52,2592e6,2592e6,2,e.bsc_(1,["0UDd0w9p","roLRN++5","yA6M1BSe"]),2,2,e.ps(3,35),e.ge(2),2,2),140455:e.r(33,"bf320f6a1d","140455",147114,147114),140456:e.r(11,2,9,17),140457:e.r(73,2,2,1,48),140458:e.r(73,2,2,1,61),140459:e.r(71,["Hp7rvYEi","Um9Sc2rI"]),140460:e.r(71,["pBDZqKuh","sxFyVzeg"]),140462:e.r(75,2,2,1,63),140467:e.r(33,"f5d6bcc29c","140467",146717,146717),140468:e.r(1,14,20),141321:e.q(e.isp("1p_login","mdsloginall01",!1,"141321")),141331:e.r(13),142271:e.r(73,2,2,1,69),142479:e.r(61,"7122","142479"),143261:e.r(60,"858","143261"),144167:e.r(60,"2","144167"),144168:e.r(60,"3","144168"),144170:e.r(60,"4","144170"),144171:e.r(60,"5","144171"),144173:e.r(60,"38","144173"),144174:e.r(60,"7","144174"),144175:e.r(60,"8","144175"),144176:e.r(60,"9","144176"),144177:e.r(60,"10","144177"),144178:e.r(60,"11","144178"),145668:e.r(69,"/automotive and vehicles"),145758:e.r(70,"books"),145759:e.r(68,"business","finance"),145760:e.r(70,"careers"),145761:e.r(70,"education"),145762:e.r(67,"/art and entertainment/shows and events"),145763:e.r(69,"/family and parenting"),145764:e.r(70,"art"),145765:e.r(70,"food and drink"),145766:e.r(70,"/health and fitness"),145767:e.r(70,"hobbies"),145768:e.r(70,"home and garden"),145769:e.r(68,"/science/medicine","medical"),145770:e.r(67,49),145771:e.r(70,"music"),145772:e.r(68,"/law, govt and politics","news"),145773:e.r(67,"/finance/investing"),145774:e.r(70,"/pets"),145775:e.r(70,"pop culture"),145776:e.r(70,"real estate"),145777:e.r(70,"religion"),145778:e.r(70,"/science"),145779:e.r(70,"/shopping"),145780:e.r(70,"/sports"),145781:e.r(70,"/style and fashion"),145782:e.r(70,"technology"),145783:e.r(68,49,"television"),145784:e.r(70,"travel"),145785:e.r(70,"Video Gaming"),145786:e.r(72,2,2,"100"),145787:e.r(72,2,2,"200"),145788:e.r(72,2,2,"900"),145789:e.r(72,2,2,"1100"),145790:e.r(72,2,2,"1200"),145791:e.r(72,2,2,"800"),145792:e.r(72,2,2,"1300"),145793:e.r(72,2,2,"500"),145794:e.r(72,2,2,"1400"),145795:e.r(72,2,2,0),145796:e.r(72,2,2,"1700"),145797:e.r(72,2,2,"1900"),145798:e.r(72,2,2,1),145799:e.r(72,2,2,"400"),145800:e.r(72,2,2,"600"),145801:e.r(72,2,2,"2000"),145802:e.r(72,2,2,"2100"),145803:e.r(72,2,2,"2200"),145804:e.r(72,2,2,"300"),145805:e.r(72,1,1,"casa"),145806:e.r(72,2,2,"2400"),145807:e.r(72,2,2,"2500"),145808:e.r(72,2,2,"2600"),145809:e.r(72,2,2,"2700"),145810:e.r(72,2,2,"2900"),145811:e.r(72,2,2,"3000"),145812:e.r(72,2,2,"700"),145813:e.r(72,2,2,"3100"),145814:e.r(72,2,2,"1800"),145816:e.r(33,"ad6e943a70","145816",147116,147116),145817:e.r(11,2,7,28),145818:e.r(33,"c62070361b","145818",147117,147117),145819:e.r(11,2,7,30),145820:e.r(33,"cad760df9e","145820",147118,147118),145821:e.r(11,2,7,31),145822:e.r(33,"ea59550681","145822",147119,147119),145823:e.r(11,2,7,33),145824:e.r(33,"4489566bfe","145824",147120,147120),145825:e.r(11,2,7,36),145826:e.r(33,"8b469872c1","145826",147121,147121),145827:e.r(1,17,20),145828:e.r(33,"29908180b1","145828",146712,146712),145829:e.r(1,17,28),145830:e.r(33,"231cea7d4d","145830",146713,146713),145831:e.r(1,17,30),145832:e.r(33,"f6f5bd5363","145832",146714,146714),145833:e.r(1,17,31),145834:e.r(33,"4dab73d591","145834",146715,146715),145835:e.r(1,17,33),145836:e.r(33,"2c507a609f","145836",146716,146716),145837:e.r(1,17,36),145839:e.r(33,"80752191ec","145839",146718,146718),145840:e.r(1,14,28),145841:e.r(33,"a2d1f19d7f","145841",146719,146719),145842:e.r(1,14,30),145843:e.r(33,"e30904951b","145843",146720,146720),145844:e.r(1,14,31),145845:e.r(33,"1b9bce8db6","145845",146721,146721),145846:e.r(1,14,33),145847:e.r(33,"51636031e1","145847",146723,146723),145848:e.r(1,14,36),145914:e.r(11,2,7,20),145929:e.r(33,"c0f4a225b0","145929",146475,146475),146178:e.r(14,2661434057),146475:e.r(6,e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147116)),e.cw(1,e.pe(0,147116)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147117)),e.cw(1,e.pe(0,147117)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147118)),e.cw(1,e.pe(0,147118)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147119)),e.cw(1,e.pe(0,147119)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147120)),e.cw(1,e.pe(0,147120)),e.e(0))]),e.pe(1,"studenti"),e.ge(2),2),146592:e.r(9,2,e.a([e.pe(3,"https://www.my-personaltrainer.it/allenamento/allenamento-propriocettivo.html"),e.tge(16854912e5),e.tle(16881264e5)])),146596:e.r(0,e.bsc_(3,["YDgYBCkh"]),e.ge(3),3,2,e.bsc_(3,["qoPk3U0Y"]),e.ge(3),3),146712:e.r(4,147116,147116),146713:e.r(4,147117,147117),146714:e.r(4,147118,147118),146715:e.r(4,147119,147119),146716:e.r(4,147120,147120),146717:e.r(5,146475,146475),146718:e.r(5,147116,147116),146719:e.r(5,147117,147117),146720:e.r(5,147118,147118),146721:e.r(5,147119,147119),146723:e.r(5,147120,147120),147009:e.r(61,"16690","147009"),147114:e.r(8,["+WJxZaqJ","0UDd0w9p","2R8929lt","roLRN++5","yA6M1BSe","zK07YKBk"],147115,147115),147115:e.r(8,["5dgiFq57","L0AHo/Sk","d0Nashhs","eJGNyvIs","yl9t7hpS"],147114,147114),147116:e.q(e.acqs([e.tw(e.cb(2,e.bsc_(1,["+WJxZaqJ","5dgiFq57","d0Nashhs","zK07YKBk"]),e.ge(2),2),2592e6),e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],146475)),e.cw(1,e.pe(0,146475)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147117)),e.cw(1,e.pe(0,147117)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147118)),e.cw(1,e.pe(0,147118)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147119)),e.cw(1,e.pe(0,147119)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147120)),e.cw(1,e.pe(0,147120)),e.e(0))])])),147117:e.r(7,["+WJxZaqJ","3zKNlPyv","L0AHo/Sk","d0Nashhs","zK07YKBk","zY0A1OPC"],147118,147118),147118:e.r(7,["L0AHo/Sk","OtRwzQ/x","V5FYt74F","zY0A1OPC"],147117,147117),147119:e.r(6,e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],146475)),e.cw(1,e.pe(0,146475)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147116)),e.cw(1,e.pe(0,147116)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147117)),e.cw(1,e.pe(0,147117)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147118)),e.cw(1,e.pe(0,147118)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147120)),e.cw(1,e.pe(0,147120)),e.e(0))]),e.ref(7),e.ge(2),2),147120:e.r(6,e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],146475)),e.cw(1,e.pe(0,146475)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147116)),e.cw(1,e.pe(0,147116)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147117)),e.cw(1,e.pe(0,147117)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147118)),e.cw(1,e.pe(0,147118)),e.e(0)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],147119)),e.cw(1,e.pe(0,147119)),e.e(0))]),e.y(1,60),e.ge(2),2),147121:e.r(4,146475,146475),147130:e.r(73,2,2,1,65),147131:e.r(74,"nostrofiglio"),147132:e.r(73,2,2,1,55),147133:e.r(74,"cookaround"),147135:e.r(64,2,e.ref(11),2,2),147136:e.r(74,"pianetamamma"),147137:e.r(73,2,2,1,67),147139:e.r(73,2,2,1,56),147140:e.r(73,2,2,1,54),147230:e.r(61,"15086","147230"),148101:e.r(56,"2b1cc19130","148101"),148553:e.r(75,2,2,3,47),148555:e.r(65,2,2,2,[e.y(14,47),e.y(1,63)]),148644:e.r(56,"285d98fe19","148644"),149333:e.r(61,"17279","149333"),149334:e.r(61,"17280","149334"),149577:e.q(e.acqs([e.cb("LinkClick",e.as(e.s,["dest_url"],["amazon",59]),e.ge(1),1),e.cb(2,e.bsc_(3,["XmK4mBtv"]),e.ge(1),1)])),149676:e.r(22,"88ea9455-bdf0-4f64-af34-2a44f2c921a5","141321",.9357226),149682:e.r(56,"dc8a4d9582","149682"),150650:e.r(61,"13940","150650"),150819:e.q(e.tw(e.cb(2,e.bsc_(["geo_info","province"],["/nVRNwDQ","7HHT+4uE","7hLoPLvg","BAnHL03f","CvS3mooZ","NKxHb64b","P30XqOho","VsekwVL2","uWp0SpSE","v0fKKR6N","x6r7fG/r"]),e.ge(2),2),2592e6)),150948:e.r(56,"075c931b9b","150948"),151045:e.r(61,"12333","151045"),151120:e.r(73,1,1,12,50),151146:e.r(14,3203637996),151148:e.r(62,"1106096533835980800","151148"),153424:e.r(61,"16691","153424"),153425:e.r(61,"16708","153425"),153426:e.r(61,"16709","153426"),153427:e.r(61,"11376","153427"),153428:e.r(30,.7954694),153467:e.r(59,"153467"),153599:e.r(56,"infosum_pg_braun_mag23","153599"),153600:e.r(56,"infosum_pg_head_shoulders_mag23","153600"),153601:e.r(56,"infosum_pg_lenor_mag23","153601"),153611:e.r(71,["F7jX4QHm","GXeNunlm","L0AHo/Sk","d0Nashhs"]),153612:e.r(71,["+WJxZaqJ","0L7MIGaR","0UDd0w9p","2R8929lt","5dgiFq57","ADPKkohG","NZWnXDir","QkRGvRul","Um9Sc2rI","eJGNyvIs","l5zHMONa","roLRN++5","sxFyVzeg","yA6M1BSe","yl9t7hpS","zK07YKBk"]),153619:e.r(30,.50808614),153774:e.r(61,"11736","153774"),153858:e.r(37,145800,145800,145771,145771,e.cb(2,e.os(e.s,1,[54,55,56,67]),e.ge(2),2),2592e6),154023:e.r(61,"15390","154023"),154304:e.r(22,"a09b04a9-df73-4b2c-a771-9cc4146814eb","151146",.7211677),154307:e.r(61,"14514","154307"),154311:e.r(12,2,3,35),154312:e.r(12,2,3,61),154431:e.r(62,"1108436959081795584","154431"),154432:e.r(62,"1108436809940733952","154432"),154953:e.r(22,"611f0898-7818-4fc0-a8b6-c3c701ce83af","153467",.7831118),154954:e.r(22,"3aaa9f86-0c51-47b2-8a46-6bfe1bcae7ac","153599",.74410516),154955:e.r(22,"ea7bbc80-8ea0-4512-b985-288d58e597b4","153600",.6442488),154956:e.r(22,"b7b5c987-544e-4e92-97ca-924523578aa3","153601",.7340513),154960:e.r(12,2,3,63),154961:e.r(75,1,1,3,"my-personaltrainer"),154962:e.r(12,2,3,"valorinormali"),154964:e.r(12,2,12,"mplay-ctv"),154965:e.r(12,2,12,50),154967:e.r(9,2,e.os(e.s,["build_platform"],["amazon-androidtv","generic-androidtv","generic-tvsimulator","google-androidtv","hisense-vidaa","lge-webos",50,"nvidia-androidtv","panasonic-viera","philips-androidtv","philips-whaleos","samsung-tizen","skyglass","skyq","sony-androidtv","timbox-androidtv"])),154981:e.r(12,2,15,37),155204:e.r(61,"17424","155204"),155207:e.r(61,"17404","155207"),155257:e.r(11,5,15,37),155417:e.r(59,"155417"),155432:e.r(61,"17397","155432"),155614:e.q(e.acqs([e.cb(2,e.ps(12,50),e.ge(1),1),e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],140030)),e.cw(1,e.pe(0,140030)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],140029)),e.cw(1,e.pe(0,140029)),e.ge(1))])])),155623:e.r(61,"15816","155623"),155624:e.r(61,"12737","155624"),155625:e.r(61,"12334","155625"),155626:e.r(61,"12745","155626"),155922:e.r(0,e.ps(3,48),e.ge(1),1,2,e.bsc_(12,["YvblI8V6"]),e.ge(1),1),155925:e.r(10,2,12,["zXKYWa7L"]),156101:e.r(12,2,12,"giallozafferano-app"),156104:e.r(12,2,12,"tgcom24-app"),156105:e.r(12,2,12,"sportmediaset-app"),156669:e.r(61,"16525","156669"),156674:e.r(61,"14515","156674"),156675:e.r(61,"16167","156675"),156676:e.r(61,"15535","156676"),156677:e.r(61,"15811","156677"),156678:e.r(61,"15815","156678"),156679:e.r(61,"15814","156679"),156680:e.r(61,"11898","156680"),156682:e.r(61,"15813","156682"),156683:e.r(61,"12183","156683"),156686:e.r(61,"15817","156686"),156687:e.r(61,"12181","156687"),156688:e.r(61,"15812","156688"),156691:e.r(61,"6450","156691"),156692:e.r(61,"12325","156692"),156693:e.r(61,"12336","156693"),156694:e.r(61,"12335","156694"),156695:e.r(61,"15810","156695"),156696:e.r(61,"6564","156696"),156697:e.r(61,"6413","156697"),156698:e.r(61,"15809","156698"),156699:e.r(61,"15777","156699"),156700:e.r(61,"9525","156700"),156702:e.r(61,"8921","156702"),156703:e.r(61,"15776","156703"),156704:e.r(61,"12738","156704"),156705:e.r(61,"12747","156705"),156706:e.r(61,"14579","156706"),156707:e.r(61,"12746","156707"),156708:e.r(61,"11651","156708"),156709:e.r(61,"12739","156709"),156710:e.r(61,"6347","156710"),156711:e.r(61,"13106","156711"),156712:e.r(61,"13105","156712"),156713:e.r(61,"13152","156713"),156714:e.r(61,"12900","156714"),156717:e.r(61,"12899","156717"),156904:e.r(62,"1121423746020962304","156904"),156905:e.r(62,"1121426613259808768","156905"),156906:e.r(62,"1121427511201525760","156906"),156907:e.r(62,"1121428568543670272","156907"),156991:e.r(15),157017:e.r(14,3224470458),157098:e.r(22,"d76af06a-1bb4-4185-884e-b71c041996f8","156905",.8055673),158106:e.r(64,2,e.t,2,2),158118:e.r(14,3112485551),158119:e.r(15),158120:e.r(14,3226107754),158121:e.r(14,3127249397),158122:e.r(14,3228065238),158123:e.r(14,3127259471),158221:e.r(57,"158221"),160773:e.r(18,e.isp("1p_customaudience","7fbef3cd5d",!1,"160773"),e.isp("1p_customaudience","a5f06ce877",!1,"160773"),e.cb(4,e.os(e.e,10,[3232129677,3230233825]),e.ge(1),1),e.isp("1p_customaudience","fe18f4d6ec",!1,"160773")),163012:e.r(56,"dd8f4108c5","163012"),163634:e.q(e.ocqs([e.tw(e.cb(2,e.os(e.s,3,[26,"grassi","grasso","trigliceridi"]),e.ge(1),1),5184e6),e.tw(e.cb(2,e.os(e.cx,5,["obesità","sovrappeso",29,"colesterolemia","ipercolesterolemia","cardiovascolare","1654","colesterol"]),e.ge(1),1),5184e6),e.cb(2,e.af_u(["properties","classifications_watson","keywords"],e.s_(16,26)),e.ge(1),1)])),166341:e.r(12,2,13,"amici"),166391:e.r(52,5184e6,5184e6,2,e.ps(3,23),1,2,e.os(e.cx,5,["2908","2901","1675",1,"1502",0,"tessuto_adiposo","ritenzione_idrica","attività_fisica",23]),e.ge(1),1,1),166451:e.r(23,.74653256),166887:e.r(23,.20072246),166921:e.r(14,3234249333),166963:e.r(57,"166963"),167753:e.r(62,"1148188953003622400","167753"),167956:e.r(31,"17537b6732","167956",3255433125),170914:e.r(11,3,2,46),171116:e.r(22,"23dd8406-f54a-4236-8990-c09917fd1de3","167753",.8764927),171120:e.r(31,"d55e18fbfe","171120",3258597753),172076:e.r(56,"fe18f4d6ec","172076"),172140:e.r(65,3,1,1,[e.y(2,46),e.pg(6,30),e.os(e.w,4,["Sportivo",11])]),172150:e.r(56,"d55e18fbfe","172150"),172180:e.r(58,"172180"),172181:e.r(56,"9b12a79788","172181"),172226:e.r(56,"audience_infosum_henkel","172226"),172346:e.r(56,"862fb75b28","172346"),172348:e.r(56,"audience_infosum_mattel","172348"),172392:e.r(62,"1159485112037498880","172392"),172443:e.r(26,.7900717),172620:e.r(58,"172620"),172632:e.r(56,"b104f0c8d5","172632"),173384:e.r(28,.864567),174702:e.r(17,[e.isp("2p_beintoo","98",!1,"174702"),e.isp("2p_beintoo","850",!1,"174702"),e.isp("2p_beintoo","16",!1,"174702"),e.isp("2p_beintoo","425",!1,"174702"),e.isp("2p_beintoo","417",!1,"174702"),e.isp("2p_beintoo","435",!1,"174702"),e.isp("2p_beintoo","447",!1,"174702"),e.isp("2p_beintoo","446",!1,"174702"),e.isp("2p_beintoo","452",!1,"174702"),e.isp("2p_beintoo","482",!1,"174702"),e.isp("2p_beintoo","359",!1,"174702"),e.isp("2p_beintoo","501",!1,"174702"),e.isp("2p_beintoo","518",!1,"174702"),e.isp("2p_beintoo","529",!1,"174702"),e.isp("2p_beintoo","13",!1,"174702"),e.isp("2p_beintoo","563",!1,"174702"),e.isp("2p_beintoo","564",!1,"174702"),e.isp("2p_beintoo","144",!1,"174702"),e.isp("2p_beintoo","162",!1,"174702"),e.isp("2p_beintoo","683",!1,"174702"),e.isp("2p_beintoo","783",!1,"174702"),e.isp("2p_beintoo","649",!1,"174702"),e.isp("2p_beintoo","194",!1,"174702"),e.isp("2p_beintoo","195",!1,"174702"),e.isp("2p_beintoo","759",!1,"174702")]),174777:e.r(26,.89036024),175313:e.r(28,.5344603),175346:e.r(56,"audience_infosum_unipolsai","175346"),175467:e.r(24,.46907407),175570:e.r(54,5184e6,5184e6,5184e6,[15,29,"disturbi-alimentari",45,51],["integratore_alimentare",29,15,51],[e.s_(16,15),e.s_(16,29),e.s_(16,45),e.s_(16,51),e.s_(16,"punto di vista nutrizionale")]),175586:e.r(58,"175586"),175723:e.r(56,"50d245d8b5","175723"),175734:e.r(56,"da4421ef31","175734"),175757:e.r(24,.74159956),175878:e.r(29,.88973373),175879:e.r(29,.7767582),175881:e.r(56,"7089cb966f","175881"),177058:e.r(49,e.y(11,9),e.y(2,46),e.pg(6,30),11,9),177059:e.r(51,5,e.y(4,10),[e.y(4,10),e.y(2,46)]),178078:e.r(14,3290831219),178079:e.r(14,3292603917),178080:e.r(14,3291444705),178081:e.r(14,3292618293),178082:e.r(14,3289412362),178083:e.r(14,3290704493),178932:e.r(14,3275210556),179010:e.r(56,"audience_infosum_tim_feb24","179010"),179443:e.r(56,"audience_infosum_tim_feb24_2","179443"),179616:e.r(25,.84383357),179632:e.r(56,"audience_infosum_tim_feb24_3","179632"),180067:e.r(22,"a1dc8ee1-4b71-4f43-9268-9115b4cfb3fa","179632",.91548586),180912:e.r(56,"10aec2c708","180912"),181503:e.r(56,"3b2730fa95","181503"),182795:e.r(42),182796:e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145799)),e.cw(1,e.pe(0,145799)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145770)),e.cw(1,e.pe(0,145770)),e.ge(1)),e.cb(5,e.y(17,7),e.ge(1),1)])),182797:e.r(38,2,e.y(3,39),2,145792,145792,145763,145763,2,2,e.ref(2)),182798:e.r(36,145803,145803,145774,0,145774),182799:e.r(39,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145814)),e.cw(1,e.pe(0,145814)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145785)),e.cw(1,e.pe(0,145785)),e.ge(1)),2,e.ref(15),2,144170,144170,145800,145800,145771,145771,145812,145812,145783,145783,2),182800:e.r(73,2,2,1,65),182801:e.r(46),182803:e.r(21,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144171)),e.cw(1,e.pe(0,144171)),e.ge(1)),e.tw(e.cb(2,e.y(1,60),e.ge(2),2),2592e6),2,e.ps(3,41),e.ge(2),2,0,e.pc(["aggregations","SegmentEntry"],145773),1,e.pe(0,145773),1,0,e.pc(["aggregations","SegmentEntry"],145802),1,e.pe(0,145802),1,["aggregations","SegmentEntry"],145788,0,145788,["aggregations","SegmentEntry"],145759,0,145759),182804:e.r(38,2,e.y(1,61),2,145809,145809,145780,145780,2,5,e.y(4,11)),182805:e.r(36,145797,145797,145768,0,145768),182806:e.r(47,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144174)),e.cw(1,e.pe(0,144174)),e.ge(1)),2,e.ps(3,42),2,2,e.y(1,65)),182807:e.r(34,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145797)),e.cw(1,e.pe(0,145797)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145768)),e.cw(1,e.pe(0,145768)),e.ge(1)),2,e.y(1,32),e.ge(2),2,e.cw(0,e.pc(["aggregations","SegmentEntry"],145795)),e.cw(1,e.pe(0,145795)),e.ge(1),e.cw(0,e.pc(["aggregations","SegmentEntry"],145766)),e.cw(1,e.pe(0,145766)),e.ge(1)),182808:e.r(41),182809:e.r(38,2,e.ps(3,18),2,145810,145810,145781,145781,2,2,e.y(1,65)),182811:e.r(45),182812:e.r(38,2,e.ps(3,64),2,145811,145811,145782,145782,2,2,e.ref(6)),182813:e.r(43,e.ref(13),145784,145784,145813,145813),182814:e.r(19,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144174)),e.cw(1,e.pe(0,144174)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145810)),e.cw(1,e.pe(0,145810)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145781)),e.cw(1,e.pe(0,145781)),e.ge(1)),e.tw(e.cb(2,e.y(1,65),e.ge(2),2),2592e6),e.cb(2,e.ref(3),e.ge(1),1)),182815:e.r(17,[e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145758)),e.cw(1,e.pe(0,145758)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145787)),e.cw(1,e.pe(0,145787)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145761)),e.cw(1,e.pe(0,145761)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145790)),e.cw(1,e.pe(0,145790)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145764)),e.cw(1,e.pe(0,145764)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145793)),e.cw(1,e.pe(0,145793)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145775)),e.cw(1,e.pe(0,145775)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145804)),e.cw(1,e.pe(0,145804)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145807)),e.cw(1,e.pe(0,145807)),e.ge(1)),e.tw(e.cb(2,e.y(1,32),e.ge(2),2),2592e6)]),182816:e.r(50),182817:e.r(37,145812,145812,145783,145783,e.cb(5,e.ref(5),e.ge(2),2),2592e6),182818:e.r(40,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],144167)),e.cw(1,e.pe(0,144167)),e.ge(1)),2,e.y(1,44),2,2,2,e.ref(14),2,145668,0,145668,["aggregations","SegmentEntry"],145786,0,145786,2),182820:e.r(44,182805,182805,182796,182796,182822,182822,182806,182806,182807,182807,182812,182812),182821:e.r(37,145801,145801,145772,145772,e.cb(2,e.ref(17),e.ge(2),2),2592e6),182822:e.r(40,e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145765)),e.cw(1,e.pe(0,145765)),e.ge(1)),2,e.y(3,40),2,2,2,e.ref(7),2,144168,0,144168,["aggregations","SegmentEntry"],145794,0,145794,2),182823:e.r(55),182824:e.q(e.ocqs([e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145812)),e.cw(1,e.pe(0,145812)),e.ge(1)),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],145783)),e.cw(1,e.pe(0,145783)),e.ge(1)),e.tw(e.cb(2,e.ref(16),e.ge(2),2),2592e6),e.cb(5,e.ref(9),e.ge(1),1)])),182827:e.r(3,179616,179616),182828:e.r(3,180067,180067),182829:e.r(25,.7594271),183155:e.r(56,"audience_infosum_tim_feb24_4","183155"),183355:e.r(56,"860fe40c9a","183355"),183503:e.q(e.ocqs([e.tw(e.cb(5,e.ref(12),e.ge(1),1),5184e6),e.tw(e.cb(3,e.a([e.y(2,46),e.pg(6,15),e.ref(12)]),e.ge(1),1),5184e6)])),183841:e.r(56,"4504d6e263","183841"),183991:e.r(56,"ebd9b1b6b4","183991"),183992:e.r(56,"87a4b83bca","183992"),184053:e.r(16),184121:e.r(54,7776e6,7776e6,7776e6,[21,25,52,57,66],[57,25,21,66,52],[e.s_(16,"cancer"),e.s_(16,21),e.s_(16,"chemioterpia"),e.s_(16,52),e.s_(16,57),e.s_(16,66)]),184122:e.r(62,"1217411337833690000","184122"),184123:e.r(62,"1217411364811460608","184123"),184124:e.r(62,"1217411386034630000","184124"),184125:e.r(62,"1217411405903056896","184125"),184421:e.r(56,"a495f0fb09","184421"),184725:e.r(56,"fa9e033773","184725"),184821:e.r(16),184822:e.r(14,3503369900),185645:e.r(56,"66bf428b16","185645"),185698:e.r(56,"7785e02ce4","185698"),185703:e.r(62,"1219307982452183040","185703"),185708:e.r(63,"185708"),185709:e.r(62,"1221825470851980000","185709"),185710:e.r(62,"1,10844E+18","185710"),185711:e.r(62,"1225752435023704064","185711"),185712:e.r(62,"1225752317506359296","185712"),185713:e.r(56,"3e41c294e8","185713"),185925:e.r(56,"cdf5eb26d2","185925"),186058:e.r(52,2592e6,5184e6,2,e.y(1,32),2,5,e.pe(["esg"],!0),e.ge(2),2,2),186120:e.r(61,"19076","186120"),186121:e.r(61,"17847","186121"),187010:e.r(66,7776e6,2,e.ps(3,"https://www.giallozafferano.it/speciale/ricette-incrostanti"),e.ge(1),1),187746:e.r(56,"7199845af3","187746"),187747:e.r(56,"6796c9a483","187747"),187812:e.r(18,e.cb(5,e.ref(1),e.ge(1),1),e.cb(3,e.a([e.y(2,46),e.ref(1)]),e.ge(1),1),e.cb(2,e.pc_(5,"Champions League"),e.ge(1),1),e.isp("1p_customaudience","595481cf24",!1,"187812")),188560:e.r(56,"89e98c40df","188560"),188777:e.r(62,"1236972772456050688","188777"),188778:e.r(62,"1237351860479897600","188778"),189568:e.r(63,"189568"),189569:e.r(62,"1242456208482828288","189569"),189774:e.r(56,"164bf88dac","189774"),190203:e.r(12,4,3,"apparecchi-acustici"),190221:e.r(14,3540376225),191591:e.r(10,6,19,["wyElRvTi"]),191592:e.r(10,6,19,["Ci8qBHlB"]),191652:e.r(56,"92a120f4b6","191652"),191865:e.r(62,"1248639074420178944","191865"),191866:e.r(62,"1248640281471238144","191866"),192110:e.r(62,"1250749995035131904","192110"),192111:e.r(62,"1250749948038639616","192111"),192128:e.r(56,"e0a9c50be6","192128"),192527:e.r(66,1728e5,2,e.t,e.ge(1),1),192529:e.r(66,6048e5,3,e.y(2,46),e.ge(1),1),192832:e.r(48,"192832",e.ps(14,62),11),192833:e.r(48,"192833",e.ref(10),8),192841:e.q(e.ocqs([e.tw(e.cb(2,e.a([e.ps(14,62),e.ref(11)]),e.ge(2),2),2592e6),e.tw(e.cb(2,e.ps(3,64),e.ge(2),2),2592e6),e.tw(e.cb(3,e.a([e.y(4,8),e.y(2,46),e.pg(6,30)]),e.ge(1),1),2592e6),e.isp("2p_beintoo","84",!1,"192841"),e.tw(e.cb(2,e.pc_(5,"3010"),e.ge(2),2),108e6)])),192842:e.q(e.ocqs([e.tw(e.cb(2,e.a([e.ref(10),e.ref(8)]),e.ge(2),2),2592e6),e.tw(e.cb(2,e.ps(3,64),e.ge(2),2),2592e6),e.tw(e.cb(3,e.a([e.y(4,8),e.y(2,46),e.pg(6,30)]),e.ge(1),1),2592e6),e.isp("2p_beintoo","84",!1,"192842"),e.tw(e.cb(2,e.pc_(5,"3003"),e.ge(2),2),2592e6)])),193417:e.r(62,"1256191106016473088","193417"),193570:e.r(62,"1257355439144562688","193570"),193801:e.r(53,e.cb(2,e.af_u(["properties","classifications_watson","keywords"],e.o([e.s_(16,"alimentazione celiaci"),e.s_(16,22),e.s_(16,"intolleranza al glutine"),e.s_(16,58)])),e.ge(1),1),5184e6,5184e6,5184e6,e.os(e.s,3,[22,58]),1,2,e.os(e.cx,5,[22,"glutine"]),2,e.pc_(5,"S_2348"),1),193901:e.r(43,e.ps(3,"https://travel.thewom.it/"),145813,145813,145784,145784),193903:e.r(36,140003,140003,193901,0,193901),193975:e.r(56,"d2ff596bf1","193975"),194585:e.r(66,864e6,3,e.ps(15,37),e.ge(1),1),194706:e.r(62,"1261307725063651328","194706"),194766:e.r(32,"32f389a205","194766","8aa67d8eca","194766"),194770:e.r(32,"c7fa2c2e0f","194770","c5f271918b","194770"),194771:e.r(32,"b00e59dda7","194771","0d10c50caf","194771"),194772:e.r(32,"82e68cd552","194772","2f7e283605","194772"),194773:e.r(32,"f4c46cff23","194773","131485463c","194773"),194774:e.r(32,"e85bed8cbc","194774","4587dd03dc","194774"),194775:e.r(32,"5c3267cb7f","194775","63e1f1d880","194775"),195265:e.r(56,"c13ff6c54f","195265"),195266:e.r(56,"dac1bead29","195266"),195292:e.q(e.acqs([e.isp("1p_customaudience","c13ff6c54f",!1,"195292"),e.scq(e.cw(0,e.pc(["aggregations","SegmentEntry"],195266)),e.cw(1,e.pe(0,195266)),e.e(0))])),195363:e.r(22,"10c06a6f-76ec-486f-bbe9-88d3c438b00b","195265",.7054705),195364:e.r(22,"2802a10e-230d-4397-95bf-c4b1fbfdeceb","195292",.4600063),195869:e.r(56,"f02a42a968","195869"),198875:e.r(56,"b6a08c73ea","198875"),199256:e.r(56,"audience_infosum_tim_mobile_set24","199256"),199263:e.r(2,e.fm(e.n0,e.isp("1p_customaudience","audience_infosum_tim_mobile_set24",!0,"199263")),e.cw(0,e.pc(["aggregations","SegmentEntry"],195265)),e.cw(1,e.pe(0,195265)),e.ge(1)),200148:e.r(27,.5),200235:e.r(27,.19777794),200341:e.r(22,"e0e76c2b-eadf-490c-8320-f69004d40fe2","199256",.57594484),200758:e.r(62,"1283448773298884608","200758"),200880:e.r(56,"7e1e6d58d9","200880")};return{env:e,locallyLiftedQueries:s||{},cloudLiftedQueries:void 0===a?{}:a,queriesByEvent:{"!UpdateLookalikeModels":["149676","153428","153619","154304","154953","154954","154955","154956","157098","166451","166887","171116","172443","173384","174777","175313","175467","175757","175878","175879","179616","180067","182829","195363","195364","200148","200235","200341"],"!UpdateSecondPartyData":["139995","139997","139998","140001","140451","140455","140467","141321","142479","143261","144167","144168","144170","144171","144173","144174","144175","144176","144177","144178","145816","145818","145820","145822","145824","145826","145828","145830","145832","145834","145836","145839","145841","145843","145845","145847","145929","147009","147230","148101","148644","149333","149334","149682","150650","150948","151045","151148","153424","153425","153426","153427","153467","153599","153600","153601","153774","154023","154307","154431","154432","155204","155207","155417","155432","155623","155624","155625","155626","156669","156674","156675","156676","156677","156678","156679","156680","156682","156683","156686","156687","156688","156691","156692","156693","156694","156695","156696","156697","156698","156699","156700","156702","156703","156704","156705","156706","156707","156708","156709","156710","156711","156712","156713","156714","156717","156904","156905","156906","156907","158221","160773","163012","166963","167753","167956","171120","172076","172150","172180","172181","172226","172346","172348","172392","172620","172632","174702","175346","175586","175723","175734","175881","179010","179443","179632","180912","181503","183155","183355","183841","183991","183992","184122","184123","184124","184125","184421","184725","185645","185698","185703","185708","185709","185710","185711","185712","185713","185925","186120","186121","187746","187747","187812","188560","188777","188778","189568","189569","189774","191652","191865","191866","192110","192111","192128","192832","192833","192841","192842","193417","193570","193975","194706","194766","194770","194771","194772","194773","194774","194775","195265","195266","195292","195869","198875","199256","199263","200758","200880"],LinkClick:["149577"],Pageview:["125609","138503","139981","139982","139984","139985","139987","139989","139990","139991","139994","139995","139996","139998","139999","140000","140002","140004","140005","140006","140008","140031","140032","140034","140036","140047","140453","140454","140456","140457","140458","140459","140460","140462","140468","141331","142271","145668","145758","145759","145760","145761","145762","145763","145764","145765","145766","145767","145768","145769","145770","145771","145772","145773","145774","145775","145776","145777","145778","145779","145780","145781","145782","145783","145784","145785","145786","145787","145788","145789","145790","145791","145792","145793","145794","145795","145796","145797","145798","145799","145800","145801","145802","145803","145804","145805","145806","145807","145808","145809","145810","145811","145812","145813","145814","145817","145819","145821","145823","145825","145827","145829","145831","145833","145835","145837","145840","145842","145844","145846","145848","145914","146475","146592","146596","147114","147115","147116","147117","147118","147119","147120","147130","147131","147132","147133","147135","147136","147137","147139","147140","148553","148555","149577","150819","151120","153611","153612","153858","154311","154312","154960","154961","154962","154964","154965","154967","154981","155614","155922","155925","156101","156104","156105","158106","163634","166341","166391","175570","182797","182799","182800","182803","182804","182806","182807","182809","182811","182812","182813","182814","182815","182816","182818","182821","182822","182823","182824","184121","186058","187010","187812","192527","192832","192833","192841","192842","193801","193901"],PageviewComplete:["139981","139982","139984","139985","139986","139987","139988","139989","139990","139991","139993","139994","139995","139996","139998","139999","140000","140001","140002","140003","140004","140005","140006","140007","140008","140009","140010","140011","140012","140013","140014","140015","140016","140017","140018","140019","140020","140022","140023","140024","140025","140026","140027","140028","140029","140030","140035","140036","140047","140451","140455","140467","145816","145818","145820","145822","145824","145826","145828","145830","145832","145834","145836","145839","145841","145843","145845","145847","145929","146475","146712","146713","146714","146715","146716","146717","146718","146719","146720","146721","146723","147114","147115","147116","147117","147118","147119","147120","147121","153858","155614","177058","182795","182796","182797","182798","182799","182801","182803","182804","182805","182806","182807","182808","182809","182811","182812","182813","182814","182815","182816","182817","182818","182820","182821","182822","182823","182824","182827","182828","192832","192833","193901","193903","195292","199263"],PixelConversion:["191591","191592"],SegmentEntry:["139981","139982","139984","139985","139986","139987","139988","139989","139990","139991","139993","139994","139995","139996","139998","139999","140000","140001","140002","140003","140004","140005","140006","140007","140008","140009","140010","140011","140012","140013","140014","140015","140016","140017","140018","140019","140020","140022","140023","140024","140025","140026","140027","140028","140029","140030","140035","140036","140047","140451","140455","140467","145816","145818","145820","145822","145824","145826","145828","145830","145832","145834","145836","145839","145841","145843","145845","145847","145929","146475","146712","146713","146714","146715","146716","146717","146718","146719","146720","146721","146723","147114","147115","147116","147117","147118","147119","147120","147121","153858","155614","177058","182795","182796","182797","182798","182799","182801","182803","182804","182805","182806","182807","182808","182809","182811","182812","182813","182814","182815","182816","182817","182818","182820","182821","182822","182823","182824","182827","182828","192832","192833","193901","193903","195292","199263"],SegmentExit:[],SlotViewable:["146178","151146","156991","157017","158118","158119","158120","158121","158122","158123","160773","166921","167956","171120","178078","178079","178080","178081","178082","178083","178932","184053","184821","184822","190203","190221"],VideoProgress:["139981","139982","139984","139985","139986","139987","139989","139990","139991","139995","139996","139999","140000","140001","140005","140006","140008","140009","140031","140032","140034","140035","170914","172140","177058","177059","183503","187812","192529","192832","192833","192841","192842","194585"],VideoView:["139985","139986","140005","140009","155257","177058","177059","182796","182804","182817","182824","183503","186058","187812"]}||{},metadata:{125609:"0c8b70cdb7",138503:"0c8b70cdb7",139981:"d73aa9c141",139982:"339289454f",139984:"baf38b6a5f",139985:"8084fe0b91",139986:"79af047bdd",139987:"398a04d2f1",139988:"b874b5ee4d",139989:"49fb5d09dd",139990:"b4e5121a01",139991:"00660515d9",139993:"4d173a6f50",139994:"9d63d86c9b",139995:"98202a367d",139996:"be3ff050c6",139997:"698b7f209f",139998:"4b3c5b5705",139999:"03cf406a39",14e4:"c1acef80f2",140001:"b1b2785679",140002:"1e65391cc6",140003:"58fef4ee33",140004:"c956969c3c",140005:"9e8a7fd16d",140006:"8f376d498f",140007:"da14bd6dc8",140008:"f1419e7e73",140009:"64418164d2",140010:"197c340e10",140011:"df23a82bac",140012:"ca9434c360",140013:"0edb85cd6c",140014:"f0e85cd190",140015:"21e4c68dfb",140016:"85e2e4117d",140017:"2b1d188fb5",140018:"148f9e2c18",140019:"1bb06eb6ba",140020:"f0f51eb5f1",140022:"dd9e4d069b",140023:"208f140ea8",140024:"44001b582b",140025:"68b96a7410",140026:"e6b0b50e21",140027:"85c9bef364",140028:"2463a75afa",140029:"8905e0c4e3",140030:"23e21cbf8b",140031:"8bd9274504",140032:"6c97a57631",140034:"706d7c3fa8",140035:"9aa5ff2acc",140036:"f9946ddb71",140047:"ef88a0dab3",140451:"b46e9fcc4c",140453:"f8de5b1262",140454:"8eb33d05ea",140455:"87b151922e",140456:"0008009876",140457:"d62f7fc3f7",140458:"fe718b3271",140459:"8b92360e4c",140460:"2acfcabd9f",140462:"39ded9c8b6",140467:"655471fa4d",140468:"5e97c21bd7",141321:"325daf092b",141331:"0c8b70cdb7",142271:"0c6a488808",142479:"dc25065f81",143261:"8bab877520",144167:"f219ec6478",144168:"c7b328efad",144170:"98555770a4",144171:"d813660f53",144173:"3716330358",144174:"e3915b9c0b",144175:"3583aabc5b",144176:"791ce45980",144177:"cb1e35c180",144178:"a8792f0a8e",145668:"53fdb6665d",145758:"4017f7dcad",145759:"860346b587",145760:"580b78e6f7",145761:"57aa81a80f",145762:"037491ced6",145763:"1e1170bba2",145764:"7b0e251514",145765:"3296086187",145766:"24cec0c8cb",145767:"dc80096e95",145768:"76ba541048",145769:"992a0e5dc6",145770:"3b19438e98",145771:"14db26aa08",145772:"4dcdce2004",145773:"d6d0c64154",145774:"b97800b6a8",145775:"1785a66615",145776:"9cf32c696c",145777:"f34018b3d5",145778:"2f0d33bf3d",145779:"bb0a378015",145780:"9462c56ea0",145781:"d2cf02d2bc",145782:"3cd614cd84",145783:"e6e963a0cf",145784:"7ee8e7a623",145785:"8e9b7344ce",145786:"7e9ab90164",145787:"577a3760a5",145788:"7246df16fe",145789:"cffd9e1692",145790:"eb99e5c9e1",145791:"12537d829d",145792:"51c80fb0c7",145793:"2e53c358b4",145794:"657db0519c",145795:"a1cb4abd3a",145796:"9f0391c033",145797:"aa5f5d8d54",145798:"fb30dfaf22",145799:"0279e4858b",145800:"ce45e1cc40",145801:"7d220c158d",145802:"fd67252cea",145803:"7cf7d251ab",145804:"1a459d3fda",145805:"acd81fe8bc",145806:"c02f74871c",145807:"acf5f92eec",145808:"fce7db07b0",145809:"84014bebd2",145810:"9c259494a8",145811:"a18dc51813",145812:"59c5c24681",145813:"b4a1f4451d",145814:"49cf600bd7",145816:"ecfe83245f",145817:"b4bbbd2835",145818:"80a80b2fa1",145819:"e566b25e09",145820:"905cdcd8a0",145821:"3b306b1bfa",145822:"a7951eecbd",145823:"bf58712eee",145824:"e1e4eb11cb",145825:"1e47cc82a2",145826:"cb7d801293",145827:"a95de2694c",145828:"18416b2774",145829:"b07d316158",145830:"9b07e2565a",145831:"fa222917d5",145832:"567fe1d5d6",145833:"94fc15a9fd",145834:"618692d804",145835:"2ac2c8a87d",145836:"eeff6c7146",145837:"5e980b1c5b",145839:"51b555c020",145840:"760857e68c",145841:"f150ff326e",145842:"311de7f128",145843:"0cebc33c4e",145844:"9a03f63c10",145845:"c116df0abd",145846:"a7d0f1ff12",145847:"0e9809a80d",145848:"5ca6ab4925",145914:"869e2e51e1",145929:"2d8d6e6a65",146178:"6aa0ae9350",146475:"295978192e",146592:"9c698e736d",146596:"8410c036be",146712:"c3811e6dd5",146713:"2d67f100f6",146714:"892b28d664",146715:"1e42bc3cca",146716:"84a882759b",146717:"5d9015ec5a",146718:"a15376e8f2",146719:"1b64eea6ae",146720:"1196bbb0e5",146721:"14c1db9acd",146723:"c0e3922860",147009:"e0c14188ba",147114:"90d1a23c95",147115:"d7bc738adf",147116:"922891e73d",147117:"9eb8aa3341",147118:"51454e34a9",147119:"162a48d51a",147120:"d04019df1a",147121:"52a8fb0314",147130:"c341676ca9",147131:"55bf257dc8",147132:"1382967afd",147133:"c71a079ba8",147135:"43b6158c91",147136:"9aea333ea8",147137:"2255bf6e78",147139:"d34313761b",147140:"9de6c37e3f",147230:"f86dde4242",148101:"5f319c6a2f",148553:"06fe8e8820",148555:"7e5f55db8e",148644:"9a88814f2d",149333:"65fed5fc35",149334:"2586e18ceb",149577:"c083b43932",149676:"03cbe3724c",149682:"f803fdef6e",150650:"f6344e8a96",150819:"0bad41ca34",150948:"7bfde05541",151045:"8bdf7e2a22",151120:"35e03fb671",151146:"3c3035f60e",151148:"ac03bc9864",153424:"8211b3c5ca",153425:"1a3a926372",153426:"dadc763f82",153427:"73cbe8986e",153428:"1215be6d10",153467:"32c43aac1d",153599:"9ccecdfe18",153600:"58ebbcee01",153601:"1f4d6b7498",153611:"dea60eea26",153612:"95f8e57280",153619:"8d543837dd",153774:"7a0e422795",153858:"4af021f811",154023:"a4b43869ff",154304:"8c0160cb04",154307:"828c4e6e69",154311:"9a6bea08ac",154312:"b12cffec59",154431:"2ba386b84f",154432:"0cb5a7f268",154953:"b9ea3c14d5",154954:"ff8052970b",154955:"799bc3bc39",154956:"7fce048f8f",154960:"953252e435",154961:"f515fcebf6",154962:"d7f1a64eb2",154964:"c96904acc8",154965:"66c749d240",154967:"ffa4079503",154981:"297a31dd5f",155204:"830d0dc9be",155207:"5705a1512a",155257:"4aa9944664",155417:"32c43aac1d",155432:"aff785c670",155614:"484570fa82",155623:"1001807b0b",155624:"028b557233",155625:"295891f215",155626:"5ec19a0c0e",155922:"d9aa9a5964",155925:"aa65cdbad0",156101:"b65a16921d",156104:"f9a479f24f",156105:"c0567cd830",156669:"f36e1697f8",156674:"202c0e19b4",156675:"6f90932179",156676:"0a54f2e8de",156677:"2d30e0c4d9",156678:"2d8e66509b",156679:"37f579fa19",156680:"9ea0b93fbe",156682:"db611bea40",156683:"6d517f1605",156686:"906f39e521",156687:"b973af2862",156688:"a5e39df7f9",156691:"5876761649",156692:"d65e035655",156693:"f614012db1",156694:"c57cbc7965",156695:"4ae44987b0",156696:"637673b3bd",156697:"f8def23ea8",156698:"a495130b19",156699:"7eea8e68b0",156700:"cef49d78d4",156702:"7a38fb431d",156703:"a812efbb56",156704:"e7e008276b",156705:"e1c2e3880e",156706:"7ac710cf7f",156707:"ce72daad07",156708:"2250b49ff2",156709:"66ebcb665c",156710:"804a8df44c",156711:"8bf33b64ac",156712:"3799953b90",156713:"305c4e3e9a",156714:"bf7e594908",156717:"bb5efa8fd7",156904:"36cc499fe5",156905:"4a25d6494b",156906:"4c04408e24",156907:"b8dd3ddb56",156991:"3f05e43c81",157017:"a696d3be38",157098:"09ab0317f9",158106:"fbc2bef996",158118:"6dbbd59cbf",158119:"3f05e43c81",158120:"a8a0d3ac10",158121:"ca6cec25ce",158122:"ad35e5e8d0",158123:"4e10e2a500",158221:"d13999b27f",160773:"58b4e713ef",163012:"50b0e25eaf",163634:"405d777437",166341:"8f4668d6b5",166391:"d858d96a28",166451:"80cee93191",166887:"c0851d5c54",166921:"6f30cf761f",166963:"d13999b27f",167753:"e575a3097f",167956:"c8476fc1fb",170914:"477479ebc5",171116:"d89c9879b0",171120:"f60df89005",172076:"2741df9442",172140:"87b085e4bd",172150:"e1b83c1120",172180:"041e8e1d03",172181:"ebe3e55306",172226:"0de0afb3e9",172346:"3c14d19b47",172348:"c528a61fed",172392:"f8c7615cbe",172443:"ba5e9e3caf",172620:"041e8e1d03",172632:"4def3fff30",173384:"7f63e4aa00",174702:"0249b02ff2",174777:"9b17747258",175313:"b1b418c690",175346:"2132c36b33",175467:"288fc4880b",175570:"e2f5c45cb9",175586:"041e8e1d03",175723:"48fe7e057d",175734:"21f6cf6b9d",175757:"c5bfb46c54",175878:"d4f84787b8",175879:"f509a1f990",175881:"72c6f63865",177058:"0f2d01048f",177059:"3060bdcaab",178078:"98933b3d7d",178079:"2157c2b9df",178080:"0d6e464f15",178081:"c973066302",178082:"514856f8c3",178083:"8e3a0a05bd",178932:"9facf17b79",179010:"fe4b5237ea",179443:"7ffc84a848",179616:"54bd390af5",179632:"d7eba51767",180067:"c8298f2382",180912:"05fdf36632",181503:"5cd8ea57b2",182795:"4d173a6f50",182796:"7075aed9aa",182797:"a60de60107",182798:"38a4ed4c68",182799:"c4d47ff98b",182800:"c341676ca9",182801:"b874b5ee4d",182803:"57bf4faf75",182804:"de8b35a620",182805:"9283271f36",182806:"9b1243c93a",182807:"fcb21a67f1",182808:"58fef4ee33",182809:"1c4485b60c",182811:"1e65391cc6",182812:"c7490da925",182813:"e478b4344e",182814:"7af560aae9",182815:"b2ea106e69",182816:"9d63d86c9b",182817:"6c5c53d2e5",182818:"a7c715d0cb",182820:"690f1d6d05",182821:"8f29df9c4a",182822:"d3e5062805",182823:"c956969c3c",182824:"5dd704f425",182827:"910c20acd6",182828:"dcc88b7b1e",182829:"9da9c19df7",183155:"062b7cc8e6",183355:"fd4c4dc4b5",183503:"70ae5ce77e",183841:"8bfee221cc",183991:"3b7484c0e2",183992:"a9a18ca814",184053:"698b31fb81",184121:"7753d1e227",184122:"cd25ed4f5b",184123:"8b8e57af06",184124:"96470fe9be",184125:"5d2817240a",184421:"4244c94952",184725:"c2d263405c",184821:"698b31fb81",184822:"a49ed84020",185645:"89d577e62f",185698:"01550c2a1d",185703:"256311bb76",185708:"7aee6a3cb1",185709:"392a3af776",185710:"fc4964b6dc",185711:"c119f4acaa",185712:"06fa73d6cb",185713:"2d387e23f0",185925:"28bbda7acb",186058:"81b66f86e2",186120:"1936b74ceb",186121:"e80a1568a9",187010:"77008ed475",187746:"a829f4d10c",187747:"7e5683475f",187812:"52646e0f22",188560:"512b605740",188777:"fac1c178b4",188778:"407edeec12",189568:"7aee6a3cb1",189569:"aa907c5574",189774:"d6ecc5dfdb",190203:"be27ed3358",190221:"769f1d015d",191591:"2f60d3777c",191592:"eb0155b67d",191652:"cfac810f4f",191865:"08ece754fb",191866:"d7805a6b3e",192110:"c8ba7471b8",192111:"5f71f23f7f",192128:"66abf543d9",192527:"e966bed412",192529:"0fbabd5d07",192832:"b4a730c49d",192833:"192979b195",192841:"47648b4aa6",192842:"71156ac619",193417:"30d242fba9",193570:"b06c991555",193801:"8959db73d5",193901:"a7a26955d9",193903:"5de7406a34",193975:"9a97a9fbc0",194585:"95b7203266",194706:"916f49803f",194766:"41110ab56e",194770:"f99da9a7ae",194771:"fe99c3aa5a",194772:"3201fe20a1",194773:"986b1010f3",194774:"ebada6c4ba",194775:"e7c37a9993",195265:"f1c0deaa6c",195266:"d0fbc75d0b",195292:"f4ac378118",195363:"964f3602af",195364:"f1125f69dc",195869:"656ee43eb2",198875:"283de49112",199256:"9600f522ae",199263:"aacd5a1383",200148:"fdbf48ef9b",200235:"4218e6cca0",200341:"3db8acfd54",200758:"3c4a401170",200880:"cec4a3a7e0"}}}));var re=n(656),ie=n(751);async function oe(d){let{contextsInitTimestampPerformance:g,master:p}=d;const m=await p.next(),v=performance.now();Object.entries(m.globals??{}).forEach((e=>{let[t,n]=e;Object.defineProperty(self,t,{value:n})}));const h=new X(m.permutiveConfig);h.measureBetween("waiting_worker_high_priority_config",g,v);const b=function(t){var n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.RP;return t.loggingEnabled&&void 0!==(null===(n=self.console)||void 0===n?void 0:n.log)?new O(r):new C}(m.permutiveConfig,m.sdkInitTimestampDate),y=m.metricsEnabled?new k(m.sdkInitTimestampPerformance,m.timeOriginMainContext,b):new q;y.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"worker_evaluated",time_origin:"sdk_init"},g),y.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"worker_received_high_priority_config",time_origin:"sdk_init"},v);const w=(0,r.zG)(p.next,h.traceTask("waiting_worker_low_priority_config"))();w.then((()=>y.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"worker_received_low_priority_config",time_origin:"sdk_init"})));const S=(0,r.zG)((()=>p.read()),function(e,n){const i=e=>(0,r.zG)(e,R.Hd((e=>e in n)),(e=>{let{left:t,right:n}=e;return{buffers:n,nonBuffers:t}}));return o=>{const{buffers:c,nonBuffers:a}=i(e),[s,u]=t.Ue({...a,...(0,r.zG)(c,R.Su((e=>()=>{const t=c[e];return c[e]=n[e].empty,t})))});return(async()=>{for(;;){const e=(0,r.zG)(await o(),F.UI(i),F.ur({concat:(e,t)=>({nonBuffers:{...e.nonBuffers,...t.nonBuffers},buffers:(()=>{const r={...e.buffers};for(const e in t.buffers)r[e]=e in r?n[e].concat(r[e],t.buffers[e]):t.buffers[e];return r})()})})),t=(0,r.zG)(e.buffers,R.Su(((e,t)=>(c[e]=n[e].concat(c[e],t),()=>{const t=c[e];return c[e]=n[e].empty,t}))));u({...s.current,...e.nonBuffers,...t})}})(),(0,r.zG)(e,R.Su((e=>(0,r.zG)(s,t.UI((t=>t[e]))))))}}({contextualCohorts:o.YP,consent:m.consent,enrichmentReplacementMap:o.YP,eventSourceId:m.eventSourceId,identities:o.YP,newEvents:c.cS,pageviewState:m.pageviewState,priorCachedEventsResponses:c.cS,sessionId:m.sessionId,userId:m.userId,userIdIsNewlyGenerated:m.userIdIsNewlyGenerated,viewId:m.pageviewState.viewId,webClient:o.G(m.webClient)},{newEvents:c.uZ(),priorCachedEventsResponses:c.uZ()}),(0,a.rO)({newEvents:(0,re.F)(y,"pageview_received_by_worker")}),(e=>({...e,currentTimestampSecs:ce((0,r.zG)(m.initialTimestampSecs,o.EQ((()=>0),(e=>e-Date.now()/1e3))))}))),{eventsCachedInWorker:_,coreService:I}=await function(a,d,g,p,m,v){p.debug("SDK core started",a);const h=500,b=new E(v),y=new G(a.permutiveConfig),w=new te(y,a.permutiveConfig,b,v,p,(()=>g.webClient.current)),S=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w.reportError(e,null==t?void 0:t.userId,null==t?void 0:t.timestamp)},_=(0,r.zG)(s.Y3((()=>Promise.resolve().then(n.bind(n,965)).then((e=>e.watson))),(()=>"Failed to import watson.")),s.UI((e=>(0,r.zG)(g.webClient,t.UI(o.UI((e=>e.url))),t.D8(o.Eh(ie.Eq)),(n=>e({config:a.permutiveConfig,metrics:v,permutiveApi:b,permutiveUrls:y,pageUrl:n,trace:m,watsonEnabled:(0,r.zG)(g.pageviewState,t.UI((e=>e.watsonEnabled)))})))))),I=(0,r.zG)(V.initialise(a.permutiveConfig,p,S,m,v,g.userId,(()=>(0,r.zG)(Z.connect(new x(a.permutiveConfig),v,new D,a.organizationId,`events_${g.userId.current}`,`keys_${g.userId.current}`,"events",p,g.consent,a.isSecureContext),m.traceTask("connect_idb_events_cache")))),m.traceTask("initialise_events_cache"),s.At((()=>()=>v.trackTimeSinceInit("sdk_lifecycle_timestamps",{timestamp_name:"events_cache_initialised",time_origin:"sdk_init"},performance.now()))),s.EQ((e=>{p.error(`Worker failed to initialise IndexedDB event cache: ${e}`);const n={},[i,o]=t.gS(c.uZ()),a=()=>new Promise((e=>{const t=String(Math.random());n[t]=r=>{delete n[t],e(r)},o([[t,void 0]])}));return(0,r.zG)(g.priorCachedEventsResponses,t.UI((e=>(0,r.zG)(e(),c.UI((e=>{var t;let[r,i]=e;return null===(t=n[r])||void 0===t?void 0:t.call(n,i)})))))),{eventsCachedInWorker:!1,coreOutput:{priorCachedEventsRequests:i},coreConfig:{eventsCache:l.t$(a)}}}),(e=>({eventsCachedInWorker:!0,coreOutput:{priorCachedEventsRequests:t.a9(M.of(c.bM()))},coreConfig:{eventsCache:l.F2(e)}})))),k=(0,r.zG)(!0,s.DT(r.yR,(()=>"IndexedDB disabled.")),s.tS((()=>(0,r.zG)(z.K.initialise(new x(a.permutiveConfig),v,p,new D,`worker_${a.organizationId}`,"core_service_state","keys","core_service_state",4,a.isSecureContext),m.traceTask("initialise-core-idb")))),s.tS((e=>(0,U.Yt)(s.Hi)({persistCoreState:u(e,"core"),persistLalState:u(e,"lal")})))),q=()=>new Promise((e=>(0,r.zG)(g.consent,t.YP((t=>{t&&e()}))))),P=c=>(0,r.zG)(s.fF(k),s.YO("servicePersistence"),s.Qt("eventsCache",s.fF((()=>c))),s.Qt("coreService",(0,r.zG)(s.Y3((()=>Promise.resolve().then(n.bind(n,373)).then((e=>e.service))),(e=>`Failed to import core service: ${e}`)),m.traceTask("import-core-service"))),s.Qt("lookalikeModelsService",s.Y3((()=>Promise.resolve().then(n.bind(n,963)).then((e=>e.lookalikeModelsService))),(()=>"Failed to import lookalike models."))),s.Qt("optimisedActivationsConfig",s.Y3((()=>Promise.resolve().then(n.bind(n,975)).then((e=>e.optimisedActivationsConfig))),(()=>"Failed to import lookalike models."))),s.Qt("watson",_),A.mU((()=>q)),s.UI((n=>{let{coreService:c,eventsCache:s,lookalikeModelsService:u,optimisedActivationsConfig:w,servicePersistence:_,watson:I}=n;const E={config:a.permutiveConfig,customQueries:ne(),logger:p,metrics:v,optimisedActivationsConfig:w,permutiveApi:b,permutiveUrls:y,reportError:S,trackPageviewComplete:a.trackPageviewComplete,migratedStateMaps:(0,r.zG)(o.lo(!a.isFirstPageview),o.EQ((()=>A.of({external:o.bM(),internal:o.bM()})),(()=>M.of(d.then((e=>e.migratedStateMaps)))))),trace:m,watson:o.G(I)};return(0,r.zG)(_,l.UI((n=>{let{persistCoreState:a,persistLalState:l}=n;return(0,r.zG)(u({...E,...g}),l,i.VS((n=>{let[u,l]=n;return(0,r.zG)(g,c({...E,...s.coreConfig,lookalikeModels:o.G(l)}),(d=h,p=t.a9(!1),n=>i=>{const{value:o,state:c}=n(i),[a,s]=t.Ue(c.current),u=(0,e.UM)((()=>s(c.current)),d),f=(0,r.zG)(t.vP(c,a),t.UI((e=>{let[t,n]=e;return t===n})));return(0,r.zG)(p,t.bw((e=>e&&u()))),{value:(0,r.bc)(f,o),state:(0,r.zG)(t.vP(p,c,a),t.UI((e=>{let[t,n,r]=e;return t?n:r})))}}),f(g.consent),a,i.UI((e=>{let[n,[i,o]]=e;return{...o,stateFlushed:(0,r.zG)(t.vP(u,n,i),t.UI((e=>{let[t,n,r]=e;return t&&n&&r})))}})));var d,p})),(e=>{const{value:n}=e({stopped:t.a9(!1),previousState:{}});return e=>({value:n,state:t.a9(void 0)})}))})),l.fS((e=>(p.warn("Worker running in non-persistent mode.",e),(0,r.zG)(g,c({...E,...s.coreConfig,lookalikeModels:o.YP}),i.Hr("stateFlushed",(()=>t.a9(!0))),f(g.consent))))),i.UI((e=>({...e,...s.coreOutput}))))})));return async()=>{const e=I(),t=P(e)(),{eventsCachedInWorker:n}=await e;return{eventsCachedInWorker:n,coreService:t}}}(m,w,S,b,h,y)();p.send({eventsCachedInWorker:_});const P=await I;var T,L;if(l.nM(P))return b.error(`Failed to start worker: ${P.left}`),void(null===(T=(L=self).close)||void 0===T||T.call(L));const j=P.right,N=await w,$=(await j)({stopped:t.a9(!1),previousState:N.previousState});!function(e,n,i){const c=(0,r.zG)(t.vP(n),t.UI((0,r.ls)(R.UI((e=>"function"==typeof e?e:M.of(e))),(0,U.Yt)(M.G5))));let a=c.current();e(a),(0,r.zG)(c,t.YP((t=>{const n=t(),c=(0,r.zG)(n,R.z7(((e,t)=>{var n;return t!==a[e]&&(null===(n=i[e])||void 0===n||!n.isEmpty(t))})),o.DT((0,Y.ff)(R.xb)));o.pC(c)&&(a={...a,...c.value},e(c.value))})))}(p.send,{activations:t.vP($.value.activations),cohorts:t.vP($.value.cohorts),context:$.value.context,eventsToPublish:$.value.eventsToPublish,eventsToPublishOnPageUnload:$.value.eventsToPublishOnPageUnload,externalData:$.value.externalData,geoIP:$.value.geoIP,metrics:t.a9((()=>y.consume())),priorCachedEventsRequests:$.value.priorCachedEventsRequests,realtime:$.value.realtime,state:$.state,transitionsSinceInit:$.value.transitionsSinceInit,workerStateFlushed:$.value.stateFlushed,stateMigratedThisInitialisation:$.value.stateMigratedThisInitialisation},{eventsToPublish:{isEmpty:c.xb},metrics:{isEmpty:c.xb}})}function ce(n){const r=()=>Math.floor(Date.now()/1e3)+n,[i,o]=t.Ue(r());return(0,e.UM)((()=>o(r())),1e3),i}const ae=t=>{const n=[],r=[],i=()=>{for(;n.length>0&&r.length>0;)r.shift()()},o=t=>new Promise((n=>{r.push((()=>n(t()))),(0,e.HJ)(i)}));return t.addEventListener("message",(0,e.GL)((t=>{null!==t.data&&(n.push(t.data),(0,e.HJ)(i))}))),{next:()=>o((()=>n.shift())),read:()=>o((()=>n.splice(0)))}};!async function(){const t=self;oe({contextsInitTimestampPerformance:e.NC,master:{...ae(t),send:e=>t.postMessage(e)}})}()})()})();',"Worker",void 0,void 0)}},477:e=>{e.exports=function(e,t,n,r){var i=self||window;try{try{var o;try{o=new i.Blob([e])}catch(t){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(e),o=o.getBlob()}var a=i.URL||i.webkitURL,s=a.createObjectURL(o),c=new i[t](s,n);return a.revokeObjectURL(s),c}catch(r){return new i[t]("data:application/javascript,".concat(encodeURIComponent(e)),n)}}catch(e){if(!r)throw Error("Inline worker is not supported");return new i[t](r,n)}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={},_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_0__;_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(3992),(()=>{var e,t;(0,_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_0__.ho)(!0);const n="permutive.main.import_runWebSdk",r=`${n}_start`;null===(e=performance)||void 0===e||null===(t=e.mark)||void 0===t||t.call(e,r),(0,_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_0__.SF)((()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__,4095))))().then((e=>{var t,i;null===(t=performance)||void 0===t||null===(i=t.measure)||void 0===i||i.call(t,n,r),e.runSdk({contextsInitTimestampPerformance:_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_0__.NC,contextsInitTimestamp:_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_0__.RP})})).catch(console.error)})()})();