@rokt/dcui-orchestrator 0.2.1-rc.60 → 0.2.1-rc.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from"react";import a,{useEffect as o,useRef as r,createContext as s,useContext as l,useState as c,useMemo as d,useCallback as u,forwardRef as p}from"react";import{createRoot as f}from"react-dom/client";import{useDispatch as y,useSelector as m,connect as h,Provider as v}from"react-redux";import{path as g,assocPath as b,when as I,allPass as E,hasPath as S,complement as C,pathEq as w,cond as T,mergeDeepWith as x,T as O,flip as A,type as N,unary as L,identity as R,concat as _,zipWith as D,slice as k,compose as P,findIndex as $,equals as j,map as F,sortBy as G,toPairs as M,pathOr as B,prop as U,is as V,always as z,propOr as H,__ as W,memoizeWith as q,mapObjIndexed as K,where as Y,not as J,isEmpty as Z,forEachObjIndexed as Q,pipe as X,split as ee,replace as te,reduce as ne,reduced as ie,partial as ae,curry as oe,anyPass as re,keys as se,all as le,flatten as ce,values as de,ifElse as ue,isNil as pe,over as fe,lensPath as ye,zip as me,evolve as he,append as ve,gt as ge,lt as be,either as Ie,view as Ee,add as Se,lte as Ce,mergeWith as we,omit as Te,indexBy as xe,mergeRight as Oe,lensProp as Ae,defaultTo as Ne,reject as Le,whereEq as Re,uniqBy as _e,find as De,has as ke,assoc as Pe,gte as $e,clone as je,mergeDeepRight as Fe,isNotEmpty as Ge,F as Me}from"ramda";import{css as Be,cx as Ue,keyframes as Ve}from"@emotion/css";import{call as ze,actionChannel as He,take as We,put as qe,cancelled as Ke,select as Ye,all as Je,takeEvery as Ze,fork as Qe,spawn as Xe,takeLatest as et,race as tt,delay as nt}from"redux-saga/effects";import{configureStore as it,combineReducers as at}from"@reduxjs/toolkit";import ot,{buffers as rt,eventChannel as st,END as lt}from"redux-saga";import{all as ct,spawn as dt,takeEvery as ut,call as pt,put as ft,take as yt,delay as mt}from"@redux-saga/core/effects";import ht from"embla-carousel-react";import vt from"insane";import gt from"@emotion/css/create-instance";import bt from"embla-carousel-autoplay";import It from"embla-carousel-fade";function Et(e){const t=["elements","own"],n=["default","dimension","width","type"],i=["default","dimension","width","value"],a=["default","dimension","minWidth"],o=g(t,e);return o&&Array.isArray(o)&&o.length?b(t,o.map(I(E([S(n),C(S(a)),w("fixed",n)]),(e=>b(a,g(i,e),e)))),e):e}function St(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function Ct(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function wt(){return"ontouchstart"in document.documentElement}function Tt(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function xt(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function Ot(e){return xt(e)&&"Fulfillment"===e.action}function At(e){return xt(e)&&"Url"===e.action}function Nt(e){return xt(e)&&"ExternalPaymentTrigger"===e.action}function Lt(e){return(Ot(e)||At(e))&&"RealTime"===e.conversionType&&"rclid"in e}function Rt(e){return(Ot(e)||At(e))&&"RealTimeReferral"===e.conversionType&&"rclid"in e}const _t={pluginId:"shared",pageInstanceGuid:"N/A"};var Dt;!function(e){e.DCUI="DCUI",e.Partner="partner"}(Dt||(Dt={}));const kt=["SignalCartItemQuantitySelected","SignalProductItemResponse","SignalUserInteraction"],Pt="ERROR",$t="WARNING";class jt extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const Ft=["V2_CART_ITEM_UPDATED","CART_ITEM_INSTANT_PURCHASE","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_CONVERSION","REALTIME_OFFER_FULFILLMENT_SUCCESS","INITIATE_INSTANT_PURCHASE_EVENT","INITIATE_CART_ITEM_EVENT","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];const Gt=(e,t)=>_(e,k(e.length,t.length,t)),Mt=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?Gt(t,e):t,i=t.length>e.length?Gt(e,t):e;return D(Ht,i,n)}return t},Bt=e=>null==e,Ut=e=>!Bt(e),Vt=(e,t)=>Bt(t)?e:t,zt=(e,t)=>{throw new jt("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function Ht(e,t){return T([[(e,t)=>Ut(e)&&Ut(t)&&N(e)!==N(t)&&("Object"===N(e)||"Object"===N(t)),zt],[(e,t)=>Bt(e)||Bt(t),Vt],[(e,t)=>"Object"===N(e),x(Ht)],[(e,t)=>"Array"===N(e),Mt],[O,A(L(R))]])(e,t)}function Wt(e,t){return Ht(e,t)}function qt(e=0){return`breakpoint-${e}px`}function Kt(e,t){return t?`${t}-child${e}`:void 0}const Yt="GLOBAL/RAISE_METRIC",Jt="GLOBAL/OFFER_ENGAGEMENT";function Zt(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&Ot(e.responseOption)&&"fulfillment"in e&&Tt(e.fulfillment)}function Qt(e){return Nt(e)}function Xt(e){return At(e)}function en(e){return function(e){return xt(e)&&"CaptureOnly"===e.action}(e)}function tn(e){return!!(Lt(e)||"responseOption"in e&&Lt(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function nn(e){return!!(Rt(e)||"responseOption"in e&&Rt(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}const an="GLOBAL/RAISE_SIGNAL",on="GLOBAL/OFFER_LIFECYCLE",rn="GLOBAL/SET_CUSTOM_STATE",sn="GLOBAL/SEND_PARTNER",ln="GLOBAL/SET_DOMAIN_STATE",cn="GLOBAL/PREPARE_SIGNAL",dn="GLOBAL/OPEN_LINK",un="GLOBAL/SET_PARTNER_VALIDATION_STATUS",pn="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",fn="GLOBAL/LAUNCH_CHILD_LAYOUT",yn="GLOBAL/CART_ITEM_EVENT/INITIATE",mn="GLOBAL/CART_ITEM_EVENT/RESPONSE",hn="GLOBAL/CART_SERVICE/INITIALIZE",vn={RAISE_METRIC:Yt,PREPARE_SIGNAL:cn,OFFER_ENGAGEMENT:Jt,RAISE_SIGNAL:an,OFFER_LIFECYCLE:on,SEND_PARTNER:sn,SET_CUSTOM_STATE:rn,SET_DOMAIN_STATE:ln,OPEN_LINK:dn,SET_PARTNER_VALIDATION_STATUS:un,SET_GLOBAL_OFFER_DATA_CART:pn,LAUNCH_CHILD_LAYOUT:fn,INITIATE_CART_ITEM_EVENT:yn,CART_ITEM_RESPONSE:mn},gn="data-open-in-app",bn="data-click-signal-context";function In(e,t){function n(e){var n;if(!(e.target&&e.target instanceof HTMLElement))return;const i=null===(n=e.target)||void 0===n?void 0:n.closest("a");if(i){const n=i.getAttribute("href"),a=i.getAttribute(bn);if(a&&t({type:an,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),n){e.preventDefault();let a="newTab";i.hasAttribute(gn)&&(a="inApp"),t({type:dn,payload:{url:n,urlBehaviour:a}})}}}o((()=>null!==e?(e.addEventListener("click",n),()=>{e.removeEventListener("click",n)}):()=>{}),[e])}function En(){const e=r(null);return o((()=>{const t=t=>{"Tab"===t.key&&Sn(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const Sn=(e,t)=>{var n;const i=null===(n=t.current)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!i)return;const a=i[0],o=i[i.length-1],{activeElement:r}=window.document;if(1!==i.length)return r===a&&e.shiftKey?(o&&o.focus(),void e.preventDefault()):r!==o||e.shiftKey?void 0:(a&&a.focus(),void e.preventDefault());e.preventDefault()},Cn=G(U(1)),wn=F(U(0)),Tn="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function xn(e,t){return t?"false"!==Tn.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${qt(e)} ${t.trim()}`:`#app-container.${qt(e)} & {${t}}`:"";var n}const On={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"};function An(e){return function(e){return Object.keys(On).indexOf(e)>-1}(e)?On[e]:""}const Nn={container:{justifyContent:"justify-content",alignItems:"align-items",shadow:"box-shadow",gap:"gap",overflow:"overflow",blur:"filter",opacity:"opacity"},text:{textColor:"color",fontSize:"font-size",fontFamily:"font-family",fontWeight:"font-weight",fontStyle:"font-style",lineHeight:"line-height",lineLimit:"",letterSpacing:"letter-spacing",baselineTextAlign:"vertical-align",horizontalTextAlign:"text-align",textDecoration:"text-decoration",textTransform:"text-transform"},background:{backgroundColor:"background-color",backgroundImage:""},dimension:{width:"width",maxWidth:"max-width",minWidth:"min-width",height:"height",maxHeight:"max-height",minHeight:"min-height",rotateZ:"transform"},flexChild:{alignSelf:"align-self",weight:"flex",order:"order"},spacing:{margin:"margin",padding:"padding",offset:""},border:{borderColor:"border-color",borderRadius:"border-radius",borderWidth:"border-width",borderStyle:"border-style"}};function Ln(e,t){if(!Nn[e]||!Nn[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return Nn[e][t]}function Rn(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function _n(...e){let t="";const n=(...e)=>e.reduce(((e,n)=>(e&&n?e=e+t+n:n&&(e=n),e)),"");return 1===e.length?(t=e[0],n):n(...e)}function Dn(e,t){return`${e}:${t};`}function kn(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class Pn extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function $n(e,t){if(null===t)return!1;const n=("function"==typeof e?[e]:e).map((e=>e(t))).reduce(((e,t)=>t?e?e+=`, ${t}`:t:e),void 0);if(n)throw new Pn(n,JSON.stringify(t));return!0}function jn(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Fn(e){return t=>{const n=t&&"symbol"!=typeof t?t.toString():t;if(!(e.indexOf(n)>=0))return`value must be one of [${e.join(",")}]`}}function Gn(e){if(null==e||""===e)return"value must not be omitted"}function Mn(e){const t=new RegExp(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/);if("string"!=typeof e||!t.test(e))return"value must be a valid hex color"}function Bn(e){const t=new RegExp(/^(?:(?:data:image\/[^;]+;base64[^"]+)|(?:(?:https?:)?\/\/[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*(?::\d{1,10})?)?(?:\.\.?\/?)*\/(?:[a-zA-Z\d\-_]+\/)*[a-zA-Z\d\-_]+\.[a-zA-Z\d]{2,6}(?:\?(?:.+=.+&?)*)?)(?:#.+)?$/);if("string"!=typeof e||!t.test(e))return"value must be a valid CSS URL string"}function Un(e){if(null!=e&&""!==e)return"value must not be specified"}function Vn(e){return t=>{if(t&&"object"==typeof t&&"value"in t&&"type"in t&&"string"==typeof t.type&&function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t.type)&&"function"==typeof e[t.type]){const n=e[t.type](t.value);if(!n)return;return`object must have valid "value" for type: ${t.type}: ${n}`}return`value must be an object that has a "type" property that matches one of: [${Object.keys(e).join(", ")}] and a "value" property`}}function zn(...e){return t=>{if("string"==typeof t){const n=t.split(" ");if(n.length>1&&e.indexOf(n.length)>-1){if(!n.reduce(((e,t)=>e||jn(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function Hn(e,t){return n=>{const i=e(n),a=t(n);if(i&&a)return`one of these must be true: ${i} -OR- ${a}`}}function Wn(e){if("string"!=typeof e)return"value must be a string"}const qn=V(Object);function Kn(e){const t=Object.entries(e);return n=>qn(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function Yn(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function Jn(e,t,n){return $n(jn,n)?Dn(Ln(e,t),`${n}`):""}function Zn(e){return(t,n,i)=>$n(Fn(Object.keys(e)),i)?Dn(Ln(t,n),`${e[i]}`):""}function Qn(e){return $n(Gn,e)?Rn({light:t(Bn,!1),dark:t(Hn(Un,Bn),!0)},_n("\n "))(e):"";function t(e,t){return n=>{if($n(e,n)&&n){const e=Dn("background-image",`url("${n}")`);return t?kn(e):e}return""}}}function Xn(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),$n(Hn(Un,Fn(Object.keys(t))),e)&&e?Dn("background-size",t[e]):""}const ei=T([[j("top-left"),z("top left")],[j("top-right"),z("top right")],[j("bottom-left"),z("bottom left")],[j("bottom-right"),z("bottom right")],[O,R]]);function ti(e){const t="string"==typeof e?e.toLowerCase():e;return $n(Hn(Un,Fn(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Dn("background-position",ei(t)):""}function ni(e,t,n){return $n(Hn(jn,zn(2,3,4)),n)?Dn(Ln(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function ii(e){return(t,n,i)=>$n(Vn({fit:Fn(e),percentage:jn,fixed:jn}),i)?Dn(Ln(t,n),ai(i)):""}function ai(e){const t={"wrap-content":"fit-content","fit-width":"100%","fit-height":"100%"};switch(e.type){case"fixed":return`${e.value}px`;case"percentage":return`${e.value}%`;case"fit":return t[e.value]}}const oi=Kn({light:Mn,dark:Hn(Un,Mn)});function ri(e,t,n){return i=>{if(i){const a=Dn(Ln(e,t),li(String(i)));return n?kn(a):a}return""}}function si(e,t,n){return $n(oi,n)?Rn({light:ri(e,t,!1),dark:ri(e,t,!0)},_n("\n "))(n):""}function li(e){const t=e.toUpperCase();switch(t.length){case 5:return`#${t.substring(2,5)}${t[1]}`;case 9:return`#${t.substring(3,9)}${t[1]}${t[2]}`;default:return t.toUpperCase()}}const ci=Kn({offsetX:Hn(Un,jn),offsetY:Hn(Un,jn),blurRadius:Hn(Un,jn),spreadRadius:Hn(Un,jn),color:oi}),di=e=>t=>null!=t?String(t):e,ui=P(_(W,"px"),di("0")),pi=e=>t=>"string"==typeof t?e(t):t,fi=P(pi(_(W,"px")),di(void 0)),yi=P(pi(li),U("dark"));function mi(e,t,n){return Dn(e,Rn({offsetX:ui,offsetY:ui,blurRadius:t.spreadRadius?ui:fi,spreadRadius:fi,color:n},_n(" "))(t))}const hi={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},vi={container:{justifyContent:Zn(hi),alignItems:Zn(hi),shadow:function(e,t,n){var i;if($n(ci,n)){const a=Ln(e,t);return _n("\n")(mi(a,n,P(li,H("#80000000","light"))),(null===(i=n.color)||void 0===i?void 0:i.dark)?kn(mi(a,n,yi)):"")}return""},gap:ni,overflow:Zn({hidden:"hidden",visible:"visible"}),blur:function(e,t,n){return $n(Yn,n)?Dn(Ln(e,t),`blur(${n.toString()}px)`):""},opacity:Jn},text:{textColor:si,fontSize:ni,fontFamily:function(e,t,n){return $n(Wn,n)?Dn(Ln(e,t),(i=`${n}`,i.replace(/['();{}@:[\]!/=]/g,"")).split(",").map(((e,t)=>{const n=0===t?e:e.trim();if(n.includes(" ")){const e=n.startsWith('"')?"":'"',t=n.endsWith('"')?"":'"';return`${e}${n}${t}`}return n})).join(",")):"";var i},fontWeight:Zn({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:Zn({normal:"normal",italic:"italic"}),lineHeight:ni,lineLimit:function(e,t,n){return $n(jn,n)?`\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: ${n};\n line-clamp: ${n}; \n -webkit-box-orient: vertical;\n `:""},letterSpacing:ni,baselineTextAlign:Zn({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:Zn({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:Zn({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:Zn({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:si,backgroundImage:function(e,t,n){return $n(Gn,n)?Rn({url:Qn,position:ti,scale:Xn},_n)(n):""}},dimension:{width:ii(["wrap-content","fit-width"]),maxWidth:ni,minWidth:ni,height:ii(["wrap-content","fit-height"]),maxHeight:ni,minHeight:ni,rotateZ:(gi="Z",(e,t,n)=>{const i=`rotate${gi}`;return $n(jn,n)?Dn(Ln(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:Zn(hi),weight:Jn,order:Jn},spacing:{margin:ni,padding:ni,offset:function(e,t,n){return $n(zn(2),n)?`transform:translate(${n.split(" ").join("px, ")}px);`:""}},border:{borderColor:si,borderRadius:ni,borderWidth:ni,borderStyle:Zn({solid:"solid",dashed:"dashed"})}};var gi;function bi(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!vi[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=vi[n][i];if(!a)throw new Error(`No styling transformer exists for property: ${n}.${i.toString()}`);try{t+=a(n,i,e[n][i])}catch(e){throw e&&"object"==typeof e&&"message"in e&&(e.message=`Error parsing styling key ${n}.${i.toString()}: ${e.message}`),e}})),t)),"")}const Ii="FAILED_TEMPLATING_DATA",Ei=new Map;function Si(e){return String.fromCharCode(97+e)}function Ci(e,t,n){const i=`${e||_t.pluginId}-${void 0!==t?String(t):"outer"}`,a=Ei.get(i);if(a&&a.sheet.container.isConnected)return a.css;const o=function(e,t){const n={key:void 0!==e?`inner-css-${Si(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),gt(n)}(t,n);return Ei.set(i,o),o.css}const wi="%%%OWN_CLASS_REF%%%",Ti=q(((e,t,n,i)=>`${String(e)}-${t}-${n}`),xi);function xi(e,t,n,i){const a=Ci(t,n,i);let o=1;return function t(n,i=!1){var r;if("string"==typeof n){const e={scopeClass:n};return t.bind(e)}const s=n,l=this.scopeClass,c=Object.entries(null!==(r=s.elements)&&void 0!==r?r:{});try{const t=c.reduce(((t,[n,a])=>Object.assign(Object.assign({},t),{[n]:Oi(a,l,i,String(n),e)})),{}),n=Object.entries(t),r=i?"parent-"+o++:"",s=function(e){return"own"in e&&"string"==typeof e.own&&e.own.length>0}(t)?a(t.own):"";return n.reduce(((e,[t,n=""])=>{if("own"===t)return e;const i=n.replace(wi,r);return Object.assign(Object.assign({},e),{[t]:i?a(i):""})}),{own:`${s}${s&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function Oi(e,t,n,i,a){return e.map(function(e,t,n){return i=>Object.entries(i).map((([i,a])=>{const o=a?bi(a):"";switch(!0){case"default"===i:return o?`\n${o}\n`:"";case Boolean(e):return`\n .${e}${An(i)} & {\n${o}\n}\n`;case t&&"own"!==n:return`\n .${wi}${An(i)} & {\n${o}\n}\n`;default:return`\n &${An(i)} {\n${o}\n}\n`}})).join("")}(t,n,i)).reduce(((e,t,n)=>{const i=a[n];return void 0!==i?e+(0===n?t:`${xn(i,t)}\n`):e}),"")}const Ai=s(z(void 0)),Ni=()=>l(Ai),Li=s(null);function Ri(e,t){var n;const i=l(Li);return i&&null!==(n=t(i))&&void 0!==n?n:e}const _i=s((()=>{throw Error("Node Mapper Context does not have a mapper. Use the NodeMapperProvider with the default nodeMapper as a value before you consume this mapper")})),Di=_i.Consumer,ki=()=>l(_i),Pi=e=>a.createElement(_i.Provider,{value:(t,n,i)=>e.value(t,null!=n?n:e.overrides,i)},e.children),$i=s(null),ji=()=>l($i),Fi=s({get(){throw Error("Offer context has not been set")}}),Gi=e=>a.createElement(Fi.Provider,{value:{get:()=>e.context}},e.children),Mi=()=>l(Fi).get(),Bi=()=>{try{return l(Fi).get().creative.copy}catch(e){return}},Ui=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Vi=P(J,Z),zi=Y({url:Vi,title:Vi});function Hi(e,t,n){return t.reduce(((t,n)=>{const[i,a]=n.slice(0,-1).split("["),o=a?a.split(","):[];if(!i)throw new Error(qi(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){Wi(t,e,"openLinks",1,2);const i=Ki(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=Yi(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(Ui,((e,t)=>`<a ${gn} ${a?`${bn}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){Wi(t,e,"sliceText",2,2);const i=Ki(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=Ki(t,e,1,(e=>{const t=Number(e);return!Number.isNaN(t)&&t>=0?t:null}),"sliceText meta attribute second argument must be a positive number");if("Chars"===i)return function(e,t){const n=new RegExp(">.*(?:</a>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,-4).slice(0,t+1)+"</a>")):e.slice(0,t)}(n,a);throw Error(qi(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);default:throw new Error(qi(e,`Unknown Meta Attribute '${t}'.`))}}(e,i,o,t)}),n)}function Wi(e,t,n,i,a){const o=new Error(qi(t,`${n} meta attribute takes ${i!=a?`between ${i} and ${a}`:i} arguments; received ${e.length}.`));if(e.length<i||e.length>a)throw o}function qi(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function Ki(e,t,n,i,a){const o=Yi(e,n,i);if(null!==o)return o;throw Error(qi(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function Yi(e,t,n){return n(e[t])}const Ji="DATA",Zi="STATE",Qi=new RegExp(`^(${Ji}|${Zi})`),Xi=new RegExp(`^${Zi}`),ea=new RegExp(`%\\^(?:${Ji}|${Zi})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*(?:\\:[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,]*\\])*(?:\\|.*?)?\\^%`,"g"),ta=Symbol("invalid");function na(e,t="creativeCopy"){const n=ia({data:e},t);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:ia(t,n,this.dataMap)});let i=!1;const a=t,o=X(k(2,-2),ee("|"),(e=>{const t=ne(((e,t)=>{let n;if(Qi.test(t)){if(!this.dataMap.has(t)&&Xi.test(t))throw new jt(Ii,`Invalid use of STATE template key in a context it does not exist: ${t}`);const i=ee(":",t);if(i[0]){if(n=this.dataMap.get(i[0]),n&&n===ta)throw new jt(Ii,`Invalid template key referenced: "${t}" is an object but expected a string, boolean, number or empty. \nDid you mean to reference a child property of ${t}?`);if(i.length>1&&n)try{n=Hi(i[0],i.slice(1),n)}catch(e){throw new jt(Ii,`Failed to apply meta attributes. ${function(e){return null!=e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:String(e)}(e)}`)}}return n?ie({provided:!0,value:n}):e}return ie({provided:!0,value:t})}),{provided:!1,value:""},e);return t.provided||(i=!0),t.value})),r=te(ea,o,a);return!1===i?r:""}.bind({dataMap:n})}function ia(e,t,n){const i=new Map(n);return"data"in e&&a(e.data,`${Ji}${t?"."+t:""}`),"state"in e&&a(e.state,`${Zi}${t?"."+t:""}`),i;function a(e,t){"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?i.set(t,(null==e?void 0:e.toString())||""):i.set(t,ta),e&&"object"==typeof e&&Q(((e,n)=>a(e,`${t}.${n}`)),e)}}const aa=s(na({})),oa=aa.Consumer,ra=aa.Provider,sa=()=>l(aa),la=s(null),ca=la.Provider,da=s("OUTER"),ua=()=>"VARIANT"===l(da),pa=s(void 0),fa=()=>l(pa);var ya,ma,ha,va,ga,ba,Ia=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))},Ea=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},Sa=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class Ca{constructor(e,t,n,i,a){ya.set(this,void 0),ma.set(this,void 0),ha.set(this,new Set),va.set(this,void 0),ga.set(this,void 0),ba.set(this,void 0),Ea(this,ya,ae(e.subscribe.bind(e),[n]),"f"),Ea(this,ma,ae(e.dispatch.bind(e),[n]),"f"),Ea(this,va,t,"f"),Ea(this,ga,i,"f"),Ea(this,ba,a,"f"),this.onGlobalStateChange=this.onGlobalStateChange.bind(this),this.onInteractivityChange=this.onInteractivityChange.bind(this),this.onEvent=this.onEvent.bind(this),this.globalDispatch=this.globalDispatch.bind(this),this.createChildPlugin=this.createChildPlugin.bind(this)}onGlobalStateChange(e){const t=Sa(this,ya,"f").call(this,e),n=()=>{t(),Sa(this,ha,"f").delete(n)};return Sa(this,ha,"f").add(n),n}onInteractivityChange(e){return Sa(this,ga,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=Sa(this,ba,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),Sa(this,ha,"f").delete(n)};return Sa(this,ha,"f").add(n),n}globalDispatch(e){Sa(this,ma,"f").call(this,e)}dispose(){Sa(this,ha,"f").forEach((e=>e())),Ea(this,ha,new Set,"f"),Sa(this,ga,"f").clear()}createChildPlugin(e){return Sa(this,va,"f").call(this,e)}}ya=new WeakMap,ma=new WeakMap,ha=new WeakMap,va=new WeakMap,ga=new WeakMap,ba=new WeakMap;class wa{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>Ia(this,void 0,void 0,(function*(){})),onClose:()=>Ia(this,void 0,void 0,(function*(){})),putConfig:()=>Ia(this,void 0,void 0,(function*(){})),send:()=>Ia(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var Ta,xa,Oa=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},Aa=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class Na{constructor(e){Ta.set(this,void 0),xa.set(this,new Set),Oa(this,Ta,e,"f")}subscribe(e){return Aa(this,xa,"f").add(e),!0===e(Aa(this,Ta,"f"))&&Aa(this,xa,"f").delete(e),()=>{Aa(this,xa,"f").delete(e)}}publish(e){Oa(this,Ta,e,"f"),Aa(this,xa,"f").forEach((e=>{!0===e(Aa(this,Ta,"f"))&&Aa(this,xa,"f").delete(e)}))}clear(){Aa(this,xa,"f").clear()}}Ta=new WeakMap,xa=new WeakMap;var La=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},Ra=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n};const _a="breakpoint-0px";class Da{constructor(){this.logger=()=>{}}withAppFactory(e){return this.appFactory=e,this}withLogger(e){return this.logger=e,this}withGatewayFactory(e){return this.gatewayFactory=e,this}build(){var e,t,n,i,a,o,r,s,l,c,d,u,p,f;const y=this.appFactory,m=this.logger,h=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new wa;return f=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint"]}constructor(){super(),t.add(this),n.set(this,(()=>null)),i.set(this,(()=>null)),a.set(this,void 0),o.set(this,!1),r.set(this,null),s.set(this,null),l.set(this,null);const e=this.attachShadow({mode:"open"});Ra(this,a,document.createElement("div"),"f"),La(this,a,"f").id="app-container",La(this,a,"f").classList.add("default"),e.appendChild(La(this,a,"f"))}attributeChangedCallback(e,a,o){if(o!==a)switch(e){case"visible":La(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||La(this,i,"f").call(this,o);break;case"active-breakpoint":La(this,t,"m",c).call(this,o,a)}}makeInteractivityUpdateHandler(e){Ra(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,i,a){const o="true"===this.getAttribute("visible"),r=this.getAttribute("slotInstanceGuid");Ra(this,n,(o=>{o?(Ra(this,n,(()=>null),"f"),0===e&&a.globalDispatch({type:on,payload:{event:"Interactive"}}),i&&(a.globalDispatch({type:an,payload:{name:"SignalImpression",parentGuid:i}}),this.trackViewability(i,a)),r&&a.globalDispatch({type:an,payload:{name:"SignalImpression",parentGuid:r}})):La(this,t,"m",p).call(this)}),"f"),La(this,n,"f").call(this,o)}trackViewability(e,n){if(!La(this,o,"f"))if("IntersectionObserver"in window&&!La(this,r,"f")){const i=()=>{La(this,o,"f")||(n.globalDispatch({type:an,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!0}}),Ra(this,o,!0,"f"),La(this,t,"m",p).call(this),La(this,a,"f").removeEventListener("click",i))};La(this,a,"f").addEventListener("click",i),Ra(this,r,new IntersectionObserver((r=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=.5?La(this,t,"m",u).call(this,(()=>{La(this,o,"f")||(n.globalDispatch({type:an,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!1}}),Ra(this,o,!0,"f"),La(this,t,"m",p).call(this),La(this,a,"f").removeEventListener("click",i))})):La(this,t,"m",d).call(this)}))}),{threshold:.5}),"f"),Ra(this,l,(()=>{var e,n;"visible"===document.visibilityState?null===(e=La(this,r,"f"))||void 0===e||e.observe(La(this,a,"f")):(La(this,t,"m",d).call(this),null===(n=La(this,r,"f"))||void 0===n||n.disconnect())}),"f"),document.addEventListener("visibilitychange",La(this,l,"f")),La(this,l,"f").call(this)}else n.globalDispatch({type:an,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!1,inferred:!1}}),Ra(this,o,!0,"f")}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&v(`Offer position attribute (${e}) is invalid`),t}getJSONAttr(e,t="{}"){const n=this.getAttribute(e);try{return JSON.parse(null!=n?n:t)}catch(t){v(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){La(this,t,"m",p).call(this)}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),o=this.getAttribute("plugin-id");La(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),l=this.getJSONAttr("childLayouts","[]"),c=this.getJSONAttr("offerData"),d=new Na("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),u=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"",p=this.getJSONAttr("offerState","{}");y||v("Cannot create app without factory. Please build the connector withAppFactory.");const f=h({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==c?void 0:c.creative)||void 0===t?void 0:t.instanceGuid},d);this.makeInteractivityUpdateHandler(d),y({rootElement:La(this,a,"f"),gateway:f,logger:m,offerPositionIndex:r,offerData:c,layoutSchema:s,childLayouts:l,schemaVersion:u,pluginId:o||_t.pluginId,offerState:p}),this.makeVisbilityUpdateHandler(r,null===(n=null==c?void 0:c.creative)||void 0===n?void 0:n.instanceGuid,f)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,t=new WeakSet,c=function(e,t){La(this,a,"f").classList.remove(t||_a),La(this,a,"f").classList.add(e||_a)},d=function(){La(this,s,"f")&&(clearTimeout(La(this,s,"f")),Ra(this,s,null,"f"))},u=function(e){La(this,t,"m",d).call(this),Ra(this,s,window.setTimeout(e,1e3),"f")},p=function(){La(this,t,"m",d).call(this),La(this,r,"f")&&(La(this,r,"f").disconnect(),Ra(this,r,null,"f")),La(this,l,"f")&&(document.removeEventListener("visibilitychange",La(this,l,"f")),Ra(this,l,null,"f"))},f;function v(e){throw m({level:Pt,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const ka=s({get:()=>new wa}),Pa=e=>a.createElement(ka.Provider,{value:{get:()=>e.context}},e.children);const $a=s({get(){throw Error("Layout Schema context has not been set")}}),ja=e=>a.createElement($a.Provider,{value:{get:()=>e.context}},e.children),Fa=()=>l($a).get(),Ga=s("ENABLED"),Ma=()=>l(Ga);function Ba(e){const t=Va(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Va(t,this.dataMap)});if(!n)throw new jt("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");return g([n,t],this.dataMap)}.bind({dataMap:t})}const Ua={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function Va(e,t=Ua){return["images","links","icons","copy","responseOptionsMap"].reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},t[n]),e[n])})),t)}const za=s(Ba({}));za.Consumer;const Ha=za.Provider,Wa=e=>{const t=l(za),n=e.split("|");for(const e of n){const n=t(e.trim(),"images");if(n)return n}},qa=()=>l(za),Ka=s({});function Ya({info:e,children:t}){const n=l(Ka);return a.createElement(Ka.Provider,{value:Object.assign(Object.assign({},n),e)},t)}const Ja=s({get(){throw Error("Catalog Item context has not been set")}}),Za=e=>a.createElement(Ja.Provider,{value:{get:()=>e.context}},e.children),Qa=()=>l(Ja).get(),Xa=s(""),eo=()=>l(Xa),to=s(""),no=s(void 0);function io({children:e}){const t=d((()=>{const e=document.createElement("div");return e.inert=!0,{inert:!0===e.inert}}),[]);return a.createElement(no.Provider,{value:t},e)}const ao=P(re([Z,le(Z)]),ce,F(de),F(ue(pe,z({}),R)),de,H({},"value")),oo=P(Z,U("predicates"));function ro(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const so=oe(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(bi(i)),transitionBaseClassname:e(ro(t,(a=i,M(a).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?se(n).map((e=>Ln(t,e))):[]})))))};var a})),lo=re([ao,oo]);const co={is:j,"is-not":P(J,j),"is-below":be,"is-above":ge};function uo(e,t){return e.includes(t)}const po={is:j,"is-not":P(J,j),exists:uo,"not-exists":P(J,uo)},fo={exists:P(J,Ie(pe,Z)),"not-exists":Ie(pe,Z)},yo={"is-true":j(!0),"is-false":j(!1)},mo={is:j,"is-not":P(J,j)};function ho(e){return(t,n)=>n[e]}const vo=T([[(e,t)=>j("Breakpoint",e),ho("activeBreakpoint")],[(e,t)=>j("Progression",e),ho("progressionIndex")],[(e,t)=>j("Position",e),ho("positionIndex")]]);function go(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const bo=T([[j("Breakpoint"),(e,t,n)=>{const i=ye(["breakpoints",t]);return X(fe(i,Number),Ee(i))(n)}],[j("Progression"),(e,t,n)=>T([[ge(0),Se(n.totalGroups)],[Ce(0),R]])(Number(t))],[j("Position"),(e,t,n)=>T([[ge(0),Se(n.totalOffers)],[Ce(0),R]])(Number(t))]]),Io=P(J,isNaN);function Eo(e,t){return e.map((e=>{var n,i,a;switch(e.type){case"StaticString":return(0,mo[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,fo[e.predicate.condition])(go(t,e.predicate.value));case"StaticBoolean":return(0,yo[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,co[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,co[e.predicate.condition])(null!==(i=t.domainStates[e.predicate.key])&&void 0!==i?i:0,e.predicate.value);case"DarkMode":throw new Error("DarkMode has not yet been implemented.");case"Placeholder":return function(e){switch(e.predicate.type){case"TextValue":return(0,po[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,co[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,co[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=co[e.predicate.condition],i=null!==(a=vo(e.type,t))&&void 0!==a?a:NaN,o=bo(e.type,e.predicate.value,t);return!!Io(i)&&n(i,o)}}}))}function So(e){return B(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const Co={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{}};function wo(e,t,n,i){const a=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:i?"Position":e.type}):e)),{cached:o,uncached:r}=a.reduce(((t,i)=>function(e,t,n,i){const a=function(e,t){switch(e.type){case"Position":case"StaticBoolean":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"StaticString":return`${e.type}:${e.predicate.input}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"CreativeCopy":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${go(t,e.predicate.value)}:${t.totalGroups}`;case"CustomState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.customStates[e.predicate.key]}`;case"DomainState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.domainStates[e.predicate.key]}`;case"Placeholder":return`${e.type}:${e.predicate.type}:${e.predicate.content.condition}:data:${e.predicate.content.input}:${e.predicate.content.value}`;default:return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${vo(e.type,t)}:${t.totalGroups}`}}(e,t),o=n.current.get(a);return he(To(o)?{cached:ve(o)}:{uncached:ve({key:a,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),s=Eo(r.map((({predicate:e})=>e)),n);return me(r,s).forEach((([{key:t},n])=>{e.current.set(t,n)})),o.concat(s)}const To=V(Boolean);const xo=oe(((e,t,n)=>{var i,a,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:So(n),progressionIndex:null!==(a=null===(i=n.progression)||void 0===i?void 0:i.activeGroupIndex)&&void 0!==a?a:0,totalOffers:null!==(r=null===(o=n.progression)||void 0===o?void 0:o.totalOffers)&&void 0!==r?r:0,totalGroups:null!==(l=null===(s=n.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:0,customStates:n.customStates,domainStates:n.domainStates,positionIndex:e,creativeCopy:t}})),Oo=ye(["predicate","content","input"]),Ao=ye(["predicate","content","value"]),No=ye(["predicate","key"]);function Lo(e,t){const n=fe(Oo,(t=>t?e(t):"")),i=fe(Ao,(t=>"string"==typeof t?e(t):t)),a=P(n,i),o=fe(No,(t=>t?e(t):""));return t.map((e=>{switch(e.type){case"Placeholder":return"TextValue"===e.predicate.type?a(e):n(e);case"CustomState":return o(e);default:return e}}))}const Ro=le(j(!0));function _o(e){const t=ua(),n=fa(),i=r(new Map),a=Bi(),o=Ri(Co,xo(n,a)),s=sa();return d((()=>K((e=>{const n=Lo(s,e);return Ro(wo(i,n,o,t))}),e)),[i,e,o,t,s])}function Do(e){e&&(e.style.display="")}function ko(e){e&&(e.style.display="none")}function Po(e){return e.settings.duration}const $o=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],jo=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function Fo(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?$o:jo,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?Do(e):ko(e)},a.oncancel=()=>{t?Do(e):ko(e)},()=>{a.finish()}}return t?Do(e):ko(e),()=>{}}function Go({inTransitions:e,outTransitions:t,visible:n,children:i,containerClassName:s}){const l=r(null);return o((()=>n&&e?e.forEach((e=>{l.current&&function(e,t,n,i){if("FadeIn"===i)Fo(e,t,n)}(l.current,n,Po(e),e.type)})):!n&&t?t.forEach((e=>{l.current&&function(e,t,n,i){if("FadeOut"===i)Fo(e,t,n)}(l.current,n,Po(e),e.type)})):()=>{}),[n]),a.createElement("div",{ref:l,style:{display:"none"},className:s},i)}function Mo(e){const t=ki(),n=function(e){const t=ua(),n=fa(),i=r(new Map),a=Bi(),o=Ri(Co,xo(n,a)),s=Lo(sa(),e);return d((()=>Ro(wo(i,s,o,t))),[i,s,o,t])}(e.schema.predicates),i=a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0))));return e.schema.transition?a.createElement(Go,{inTransitions:e.schema.transition.inTransition,outTransitions:e.schema.transition.outTransition,visible:n},i):"functionally"===e.schema.hide?a.createElement(Ga.Provider,{value:n?"ENABLED":"DISABLED"},i):n?a.createElement(a.Fragment,null,i):null}const Bo=we(((e,t)=>`${e||""} ${t||""}`.trim())),Uo=e=>{var t;const n=l(la),i=fa(),a=ji()||document.head,o=eo(),r=Ci(o,i,a),s=u(Ti,[]),c=Ri([],(e=>Object.values(e.breakpoint.breakpoints))),d=n||s(c,o,i,a),p=e.styles?d(e.styles):{},f=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=so(e);return K((e=>lo(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(r,null===(t=e.styles)||void 0===t?void 0:t.conditionalTransitions):void 0,y=_o(f?K(H([],"predicates"),f):{}),m=K(((e,t)=>e?function(e,t){var n;if(e&&t in e)return null===(n=e[t])||void 0===n?void 0:n.classname}(f,t):void 0),y),h=f?K(U("transitionBaseClassname"),f):{},v=e.styles?(g=h,Bo(Bo(p,m),g)):void 0;var g;return e.children({classnames:v,mapperRef:d})};function Vo(e){const t=ki();return a.createElement(Uo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))}))}function zo(e){const t=ki();return a.createElement(Uo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))}))}const Ho={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",gn,bn],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},Wo=new Map([["&","_;^;_"]]),qo=new RegExp(`<a *(?=${Ho.allowedAttributes.a.join("|")}|>)`,"g"),Ko=new RegExp('<a [^>]*href="([^"]+)"',"g"),Yo=new RegExp("(<br *?>)|(<br *?/>)","g"),Jo="<br/>";function Zo(e){const t=sa(),n=Ma(),i=d((()=>{const n=t(e.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Ko,((e,t)=>{const n=t.replaceAll("&",Wo.get("&"));return e.replace(t,n)})).replaceAll(Yo,Jo)}(e);return t===vt(t,Ho)}(n))throw new jt("FAILED_SANITISING_HTML","Invalid HTML tags");return n.trim()?n:""}),[e.schema.value,t]),{tabIndex:o,styles:r,isDisabled:s}=St(n);return i?a.createElement(Uo,{styles:e.schema.styles},(({classnames:t})=>{const n=[(null==t?void 0:t.link)?`class = "${null==t?void 0:t.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0));return l=i,new RegExp("</(p|ul|ol)>").test(l)?a.createElement("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(qo,`<a ${n.join(" ")}`)}}):a.createElement("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(qo,`<a ${n.join(" ")}`)}});var l})):null}function Qo(e){const t=sa()(e.schema.value),n=Ma(),{tabIndex:i,styles:o,isDisabled:r}=St(n);return t?a.createElement(Uo,{styles:e.schema.styles},(({classnames:n})=>{const s={tabIndex:i,"aria-hidden":r,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"BasicText"};return e.isInline?a.createElement("span",Object.assign({style:o},s),t):a.createElement("p",Object.assign({style:o},s),t)})):null}function Xo(e,t,n){if("BasicText"===e.type)return a.createElement(Qo,{schema:e.node,testId:t,isInline:null!=n&&n})}function er(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Kt(i,n)))))}function tr(e){const t=Ni(),n=ki(),i=Mi(),r=sa(),s=fa(),l=Ma(),c=i.creative.responseOptionsMap[e.schema.responseKey],d=Nt(c);o((()=>{d&&t(function(e){if(e.paymentTriggerConfig)return{type:cn,payload:{criteria:{key:"PAYMENT_OFFER_SELECTED"},signal:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:"PAYMENT_OFFER_SELECTED"}}}};throw new Error(`Invalid External Response: No 'paymentTriggerConfig' found for external response option with instanceGuid: ${e.instanceGuid}`)}(c))}),[c,t,d]);const u=c?r({data:c},"creativeResponse"):r,{tabIndex:p,styles:f,isDisabled:y}=St(l);return xt(c)&&!d&&void 0!==s?a.createElement(Uo,{styles:e.schema.styles},(({classnames:o,mapperRef:r})=>a.createElement("button",{type:"button",tabIndex:p,"aria-disabled":y,"aria-label":e.schema.a11yLabel?u(e.schema.a11yLabel):void 0,style:Object.assign({cursor:"pointer"},f),"data-testid":e.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":e.schema.responseKey,onClick:n=>{n.preventDefault();const a=function(e,t,n){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(Tt(n))return{fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid,accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId};throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId,urlBehavior:n&&"internally"===n.toLowerCase()?"self":t.urlBehavior});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}(i,c,e.schema.openLinks);t({type:Jt,payload:a})},className:null==o?void 0:o.own,disabled:y},a.createElement(ra,{value:u},(null==o?void 0:o.own)?function(e,t,n,i,o){return a.createElement(ca,{value:n(t)},er(e,i,o))}(e.schema.children,o.own,r,n,e.testId):er(e.schema.children,n,e.testId))))):null}function nr(e){const t=Ma(),{styles:n,isDisabled:i}=St(t);return e.schema.url.light?a.createElement(Uo,{styles:Et(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},n),{display:"inline-block"}),alt:i?void 0:e.schema.alt||void 0,title:e.schema.title||void 0,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"StaticImage",src:e.schema.url.light}))):null}function ir(e){const t=Ma(),{styles:n,isDisabled:i}=St(t),o=Wa(e.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?a.createElement(Uo,{styles:Et(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},n),{display:"inline-block"}),alt:o.alt,title:o.title,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"DataImage",src:o.light}))):null;var r}const ar={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function or(e){const t=e.schema.name,n=e.schema.description,i=e.schema.styles?Wt(ar,e.schema.styles):ar,o=Ma(),{styles:r,isDisabled:s}=St(o);return t?a.createElement(Uo,{styles:i},(({classnames:i})=>a.createElement("span",Object.assign({style:Object.assign(Object.assign({},r),{display:"inline-block"}),className:"rokt-icon"+((null==i?void 0:i.own)?" "+i.own:""),"data-testid":e.testId,"data-e2e":`StaticIcon-${t}`},!s&&n?{title:n}:{"aria-hidden":"true"}),t))):null}const rr={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class sr extends a.Component{constructor(e){super(e),this.state={errorMessage:""}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidUpdate(e){this.state.errorMessage&&JSON.stringify(e.schema)!==JSON.stringify(this.props.schema)&&this.setState({errorMessage:""})}componentDidCatch(e,t){var n;this.props.reporter&&"true"===Tn.REPORT_RENDER_ERRORS&&this.props.reporter({level:Pt,code:null!==(n=e.code)&&void 0!==n?n:"UNHANDLED_RENDERING_EXCEPTION",message:e.message,additionalInformation:Object.assign({componentStack:t.componentStack,stack:e.stack},this.context||{})})}render(){return this.state.errorMessage?"true"===Tn.DISPLAY_ERRORS?a.createElement("pre",{style:rr},a.createElement("strong",null,"Error:")," [",a.createElement("em",null,this.props.schema.type),"]"," ",this.state.errorMessage):void 0:this.props.children}}sr.contextType=Ka;const lr={internally:"_top",externally:"_blank"};function cr(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function dr(e){var t;const n=lr[e.schema.open],i=ki(),o=Ma(),{tabIndex:r,styles:s,isDisabled:l}=St(o);return(null===(t=e.schema.children)||void 0===t?void 0:t.length)>0?a.createElement(Uo,{styles:e.schema.styles},(({classnames:t,mapperRef:o})=>{var c;return a.createElement("a",{href:e.schema.src,"data-testid":e.testId,"data-e2e":"StaticLink",target:null!=n?n:"_blank",tabIndex:r,"aria-disabled":l,"aria-label":null!==(c=e.schema.a11yLabel)&&void 0!==c?c:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:e.isInline?"inline":"block"},s),className:null==t?void 0:t.own},(null==t?void 0:t.own)?function(e,t,n,i,o){return a.createElement(ca,{value:n(t)},cr(e,i,o))}(e.schema.children,null==t?void 0:t.own,o,i,e.testId):cr(e.schema.children,i,e.testId))})):null}function ur(e,t,n){if("StaticLink"===e.type)return a.createElement(dr,{schema:e.node,testId:t,isInline:null!=n&&n})}const pr={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function fr(e){const t=(n=e.schema.iconKey,l(za)(n,"icons"));var n;const i=null==t?void 0:t.name,o=e.schema.styles?Wt(pr,e.schema.styles):pr,r=Ma(),{styles:s}=St(r);return i?a.createElement(Uo,{styles:o},(({classnames:t})=>a.createElement("span",{style:Object.assign(Object.assign({},s),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==t?void 0:t.own)?" "+t.own:""),"data-testid":e.testId,"data-e2e":`DataIcon-${i}`},i))):null}const yr=Be`
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from"react";import a,{useEffect as r,useRef as o,createContext as s,useContext as l,useState as c,useMemo as d,useCallback as u,forwardRef as p}from"react";import{createRoot as f}from"react-dom/client";import{useDispatch as y,useSelector as m,connect as h,Provider as v}from"react-redux";import{path as g,assocPath as b,when as I,allPass as E,hasPath as S,complement as C,pathEq as w,cond as T,mergeDeepWith as x,T as O,flip as A,type as N,unary as L,identity as R,concat as _,zipWith as D,slice as k,compose as P,findIndex as $,equals as j,map as F,sortBy as G,toPairs as M,pathOr as B,prop as U,is as V,always as z,propOr as H,__ as W,memoizeWith as q,mapObjIndexed as K,where as Y,not as J,isEmpty as Z,forEachObjIndexed as Q,pipe as X,split as ee,replace as te,reduce as ne,reduced as ie,partial as ae,curry as re,anyPass as oe,keys as se,all as le,flatten as ce,values as de,ifElse as ue,isNil as pe,over as fe,lensPath as ye,zip as me,evolve as he,append as ve,gt as ge,lt as be,either as Ie,view as Ee,add as Se,lte as Ce,mergeWith as we,omit as Te,indexBy as xe,mergeRight as Oe,lensProp as Ae,defaultTo as Ne,reject as Le,whereEq as Re,uniqBy as _e,find as De,has as ke,assoc as Pe,gte as $e,clone as je,mergeDeepRight as Fe,isNotEmpty as Ge,F as Me}from"ramda";import{css as Be,cx as Ue,keyframes as Ve}from"@emotion/css";import{call as ze,actionChannel as He,take as We,put as qe,cancelled as Ke,select as Ye,all as Je,takeEvery as Ze,fork as Qe,spawn as Xe,takeLatest as et,race as tt,delay as nt}from"redux-saga/effects";import{configureStore as it,combineReducers as at}from"@reduxjs/toolkit";import rt,{buffers as ot,eventChannel as st,END as lt}from"redux-saga";import{all as ct,spawn as dt,takeEvery as ut,call as pt,put as ft,take as yt,delay as mt}from"@redux-saga/core/effects";import ht from"embla-carousel-react";import vt from"insane";import gt from"@emotion/css/create-instance";import bt from"embla-carousel-autoplay";import It from"embla-carousel-fade";function Et(e){const t=["elements","own"],n=["default","dimension","width","type"],i=["default","dimension","width","value"],a=["default","dimension","minWidth"],r=g(t,e);return r&&Array.isArray(r)&&r.length?b(t,r.map(I(E([S(n),C(S(a)),w("fixed",n)]),(e=>b(a,g(i,e),e)))),e):e}function St(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function Ct(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function wt(){return"ontouchstart"in document.documentElement}function Tt(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function xt(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function Ot(e){return xt(e)&&"Fulfillment"===e.action}function At(e){return xt(e)&&"Url"===e.action}function Nt(e){return xt(e)&&"ExternalPaymentTrigger"===e.action}function Lt(e){return(Ot(e)||At(e))&&"RealTime"===e.conversionType&&"rclid"in e}function Rt(e){return(Ot(e)||At(e))&&"RealTimeReferral"===e.conversionType&&"rclid"in e}const _t={pluginId:"shared",pageInstanceGuid:"N/A"};var Dt;!function(e){e.DCUI="DCUI",e.Partner="partner"}(Dt||(Dt={}));const kt=["SignalCartItemQuantitySelected","SignalProductItemResponse","SignalUserInteraction"],Pt="ERROR",$t="WARNING";class jt extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const Ft=["V2_CART_ITEM_UPDATED","CART_ITEM_INSTANT_PURCHASE","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_CONVERSION","REALTIME_OFFER_FULFILLMENT_SUCCESS","INITIATE_INSTANT_PURCHASE_EVENT","INITIATE_CART_ITEM_EVENT","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];const Gt=(e,t)=>_(e,k(e.length,t.length,t)),Mt=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?Gt(t,e):t,i=t.length>e.length?Gt(e,t):e;return D(Ht,i,n)}return t},Bt=e=>null==e,Ut=e=>!Bt(e),Vt=(e,t)=>Bt(t)?e:t,zt=(e,t)=>{throw new jt("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function Ht(e,t){return T([[(e,t)=>Ut(e)&&Ut(t)&&N(e)!==N(t)&&("Object"===N(e)||"Object"===N(t)),zt],[(e,t)=>Bt(e)||Bt(t),Vt],[(e,t)=>"Object"===N(e),x(Ht)],[(e,t)=>"Array"===N(e),Mt],[O,A(L(R))]])(e,t)}function Wt(e,t){return Ht(e,t)}function qt(e=0){return`breakpoint-${e}px`}function Kt(e,t){return t?`${t}-child${e}`:void 0}const Yt="GLOBAL/RAISE_METRIC",Jt="GLOBAL/OFFER_ENGAGEMENT";function Zt(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&Ot(e.responseOption)&&"fulfillment"in e&&Tt(e.fulfillment)}function Qt(e){return Nt(e)}function Xt(e){return At(e)}function en(e){return function(e){return xt(e)&&"CaptureOnly"===e.action}(e)}function tn(e){return!!(Lt(e)||"responseOption"in e&&Lt(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function nn(e){return!!(Rt(e)||"responseOption"in e&&Rt(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}const an="GLOBAL/RAISE_SIGNAL",rn="GLOBAL/OFFER_LIFECYCLE",on="GLOBAL/SET_CUSTOM_STATE",sn="GLOBAL/SEND_PARTNER",ln="GLOBAL/SET_DOMAIN_STATE",cn="GLOBAL/PREPARE_SIGNAL",dn="GLOBAL/OPEN_LINK",un="GLOBAL/SET_PARTNER_VALIDATION_STATUS",pn="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",fn="GLOBAL/LAUNCH_CHILD_LAYOUT",yn="GLOBAL/CART_ITEM_EVENT/INITIATE",mn="GLOBAL/CART_ITEM_EVENT/RESPONSE",hn="GLOBAL/CART_SERVICE/INITIALIZE",vn={RAISE_METRIC:Yt,PREPARE_SIGNAL:cn,OFFER_ENGAGEMENT:Jt,RAISE_SIGNAL:an,OFFER_LIFECYCLE:rn,SEND_PARTNER:sn,SET_CUSTOM_STATE:on,SET_DOMAIN_STATE:ln,OPEN_LINK:dn,SET_PARTNER_VALIDATION_STATUS:un,SET_GLOBAL_OFFER_DATA_CART:pn,LAUNCH_CHILD_LAYOUT:fn,INITIATE_CART_ITEM_EVENT:yn,CART_ITEM_RESPONSE:mn},gn="data-open-in-app",bn="data-click-signal-context";function In(e,t){function n(e){var n;if(!(e.target&&e.target instanceof HTMLElement))return;const i=null===(n=e.target)||void 0===n?void 0:n.closest("a");if(i){const n=i.getAttribute("href"),a=i.getAttribute(bn);if(a&&t({type:an,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),n){e.preventDefault();let a="newTab";i.hasAttribute(gn)&&(a="inApp"),t({type:dn,payload:{url:n,urlBehaviour:a}})}}}r((()=>null!==e?(e.addEventListener("click",n),()=>{e.removeEventListener("click",n)}):()=>{}),[e])}function En(){const e=o(null);return r((()=>{const t=t=>{"Tab"===t.key&&Sn(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const Sn=(e,t)=>{var n;const i=null===(n=t.current)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!i)return;const a=i[0],r=i[i.length-1],{activeElement:o}=window.document;if(1!==i.length)return o===a&&e.shiftKey?(r&&r.focus(),void e.preventDefault()):o!==r||e.shiftKey?void 0:(a&&a.focus(),void e.preventDefault());e.preventDefault()},Cn=G(U(1)),wn=F(U(0)),Tn="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function xn(e,t){return t?"false"!==Tn.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${qt(e)} ${t.trim()}`:`#app-container.${qt(e)} & {${t}}`:"";var n}const On={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"};function An(e){return function(e){return Object.keys(On).indexOf(e)>-1}(e)?On[e]:""}const Nn={container:{justifyContent:"justify-content",alignItems:"align-items",shadow:"box-shadow",gap:"gap",overflow:"overflow",blur:"filter",opacity:"opacity"},text:{textColor:"color",fontSize:"font-size",fontFamily:"font-family",fontWeight:"font-weight",fontStyle:"font-style",lineHeight:"line-height",lineLimit:"",letterSpacing:"letter-spacing",baselineTextAlign:"vertical-align",horizontalTextAlign:"text-align",textDecoration:"text-decoration",textTransform:"text-transform"},background:{backgroundColor:"background-color",backgroundImage:""},dimension:{width:"width",maxWidth:"max-width",minWidth:"min-width",height:"height",maxHeight:"max-height",minHeight:"min-height",rotateZ:"transform"},flexChild:{alignSelf:"align-self",weight:"flex",order:"order"},spacing:{margin:"margin",padding:"padding",offset:""},border:{borderColor:"border-color",borderRadius:"border-radius",borderWidth:"border-width",borderStyle:"border-style"}};function Ln(e,t){if(!Nn[e]||!Nn[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return Nn[e][t]}function Rn(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function _n(...e){let t="";const n=(...e)=>e.reduce(((e,n)=>(e&&n?e=e+t+n:n&&(e=n),e)),"");return 1===e.length?(t=e[0],n):n(...e)}function Dn(e,t){return`${e}:${t};`}function kn(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class Pn extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function $n(e,t){if(null===t)return!1;const n=("function"==typeof e?[e]:e).map((e=>e(t))).reduce(((e,t)=>t?e?e+=`, ${t}`:t:e),void 0);if(n)throw new Pn(n,JSON.stringify(t));return!0}function jn(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Fn(e){return t=>{const n=t&&"symbol"!=typeof t?t.toString():t;if(!(e.indexOf(n)>=0))return`value must be one of [${e.join(",")}]`}}function Gn(e){if(null==e||""===e)return"value must not be omitted"}function Mn(e){const t=new RegExp(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/);if("string"!=typeof e||!t.test(e))return"value must be a valid hex color"}function Bn(e){const t=new RegExp(/^(?:(?:data:image\/[^;]+;base64[^"]+)|(?:(?:https?:)?\/\/[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*(?::\d{1,10})?)?(?:\.\.?\/?)*\/(?:[a-zA-Z\d\-_]+\/)*[a-zA-Z\d\-_]+\.[a-zA-Z\d]{2,6}(?:\?(?:.+=.+&?)*)?)(?:#.+)?$/);if("string"!=typeof e||!t.test(e))return"value must be a valid CSS URL string"}function Un(e){if(null!=e&&""!==e)return"value must not be specified"}function Vn(e){return t=>{if(t&&"object"==typeof t&&"value"in t&&"type"in t&&"string"==typeof t.type&&function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t.type)&&"function"==typeof e[t.type]){const n=e[t.type](t.value);if(!n)return;return`object must have valid "value" for type: ${t.type}: ${n}`}return`value must be an object that has a "type" property that matches one of: [${Object.keys(e).join(", ")}] and a "value" property`}}function zn(...e){return t=>{if("string"==typeof t){const n=t.split(" ");if(n.length>1&&e.indexOf(n.length)>-1){if(!n.reduce(((e,t)=>e||jn(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function Hn(e,t){return n=>{const i=e(n),a=t(n);if(i&&a)return`one of these must be true: ${i} -OR- ${a}`}}function Wn(e){if("string"!=typeof e)return"value must be a string"}const qn=V(Object);function Kn(e){const t=Object.entries(e);return n=>qn(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function Yn(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function Jn(e,t,n){return $n(jn,n)?Dn(Ln(e,t),`${n}`):""}function Zn(e){return(t,n,i)=>$n(Fn(Object.keys(e)),i)?Dn(Ln(t,n),`${e[i]}`):""}function Qn(e){return $n(Gn,e)?Rn({light:t(Bn,!1),dark:t(Hn(Un,Bn),!0)},_n("\n "))(e):"";function t(e,t){return n=>{if($n(e,n)&&n){const e=Dn("background-image",`url("${n}")`);return t?kn(e):e}return""}}}function Xn(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),$n(Hn(Un,Fn(Object.keys(t))),e)&&e?Dn("background-size",t[e]):""}const ei=T([[j("top-left"),z("top left")],[j("top-right"),z("top right")],[j("bottom-left"),z("bottom left")],[j("bottom-right"),z("bottom right")],[O,R]]);function ti(e){const t="string"==typeof e?e.toLowerCase():e;return $n(Hn(Un,Fn(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Dn("background-position",ei(t)):""}function ni(e,t,n){return $n(Hn(jn,zn(2,3,4)),n)?Dn(Ln(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function ii(e){return(t,n,i)=>$n(Vn({fit:Fn(e),percentage:jn,fixed:jn}),i)?Dn(Ln(t,n),ai(i)):""}function ai(e){const t={"wrap-content":"fit-content","fit-width":"100%","fit-height":"100%"};switch(e.type){case"fixed":return`${e.value}px`;case"percentage":return`${e.value}%`;case"fit":return t[e.value]}}const ri=Kn({light:Mn,dark:Hn(Un,Mn)});function oi(e,t,n){return i=>{if(i){const a=Dn(Ln(e,t),li(String(i)));return n?kn(a):a}return""}}function si(e,t,n){return $n(ri,n)?Rn({light:oi(e,t,!1),dark:oi(e,t,!0)},_n("\n "))(n):""}function li(e){const t=e.toUpperCase();switch(t.length){case 5:return`#${t.substring(2,5)}${t[1]}`;case 9:return`#${t.substring(3,9)}${t[1]}${t[2]}`;default:return t.toUpperCase()}}const ci=Kn({offsetX:Hn(Un,jn),offsetY:Hn(Un,jn),blurRadius:Hn(Un,jn),spreadRadius:Hn(Un,jn),color:ri}),di=e=>t=>null!=t?String(t):e,ui=P(_(W,"px"),di("0")),pi=e=>t=>"string"==typeof t?e(t):t,fi=P(pi(_(W,"px")),di(void 0)),yi=P(pi(li),U("dark"));function mi(e,t,n){return Dn(e,Rn({offsetX:ui,offsetY:ui,blurRadius:t.spreadRadius?ui:fi,spreadRadius:fi,color:n},_n(" "))(t))}const hi={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},vi={container:{justifyContent:Zn(hi),alignItems:Zn(hi),shadow:function(e,t,n){var i;if($n(ci,n)){const a=Ln(e,t);return _n("\n")(mi(a,n,P(li,H("#80000000","light"))),(null===(i=n.color)||void 0===i?void 0:i.dark)?kn(mi(a,n,yi)):"")}return""},gap:ni,overflow:Zn({hidden:"hidden",visible:"visible"}),blur:function(e,t,n){return $n(Yn,n)?Dn(Ln(e,t),`blur(${n.toString()}px)`):""},opacity:Jn},text:{textColor:si,fontSize:ni,fontFamily:function(e,t,n){return $n(Wn,n)?Dn(Ln(e,t),(i=`${n}`,i.replace(/['();{}@:[\]!/=]/g,"")).split(",").map(((e,t)=>{const n=0===t?e:e.trim();if(n.includes(" ")){const e=n.startsWith('"')?"":'"',t=n.endsWith('"')?"":'"';return`${e}${n}${t}`}return n})).join(",")):"";var i},fontWeight:Zn({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:Zn({normal:"normal",italic:"italic"}),lineHeight:ni,lineLimit:function(e,t,n){return $n(jn,n)?`\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: ${n};\n line-clamp: ${n}; \n -webkit-box-orient: vertical;\n `:""},letterSpacing:ni,baselineTextAlign:Zn({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:Zn({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:Zn({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:Zn({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:si,backgroundImage:function(e,t,n){return $n(Gn,n)?Rn({url:Qn,position:ti,scale:Xn},_n)(n):""}},dimension:{width:ii(["wrap-content","fit-width"]),maxWidth:ni,minWidth:ni,height:ii(["wrap-content","fit-height"]),maxHeight:ni,minHeight:ni,rotateZ:(gi="Z",(e,t,n)=>{const i=`rotate${gi}`;return $n(jn,n)?Dn(Ln(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:Zn(hi),weight:Jn,order:Jn},spacing:{margin:ni,padding:ni,offset:function(e,t,n){return $n(zn(2),n)?`transform:translate(${n.split(" ").join("px, ")}px);`:""}},border:{borderColor:si,borderRadius:ni,borderWidth:ni,borderStyle:Zn({solid:"solid",dashed:"dashed"})}};var gi;function bi(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!vi[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=vi[n][i];if(!a)throw new Error(`No styling transformer exists for property: ${n}.${i.toString()}`);try{t+=a(n,i,e[n][i])}catch(e){throw e&&"object"==typeof e&&"message"in e&&(e.message=`Error parsing styling key ${n}.${i.toString()}: ${e.message}`),e}})),t)),"")}const Ii="FAILED_TEMPLATING_DATA",Ei=new Map;function Si(e){return String.fromCharCode(97+e)}function Ci(e,t,n){const i=`${e||_t.pluginId}-${void 0!==t?String(t):"outer"}`,a=Ei.get(i);if(a&&a.sheet.container.isConnected)return a.css;const r=function(e,t){const n={key:void 0!==e?`inner-css-${Si(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),gt(n)}(t,n);return Ei.set(i,r),r.css}const wi="%%%OWN_CLASS_REF%%%",Ti=q(((e,t,n,i)=>`${String(e)}-${t}-${n}`),xi);function xi(e,t,n,i){const a=Ci(t,n,i);let r=1;return function t(n,i=!1){var o;if("string"==typeof n){const e={scopeClass:n};return t.bind(e)}const s=n,l=this.scopeClass,c=Object.entries(null!==(o=s.elements)&&void 0!==o?o:{});try{const t=c.reduce(((t,[n,a])=>Object.assign(Object.assign({},t),{[n]:Oi(a,l,i,String(n),e)})),{}),n=Object.entries(t),o=i?"parent-"+r++:"",s=function(e){return"own"in e&&"string"==typeof e.own&&e.own.length>0}(t)?a(t.own):"";return n.reduce(((e,[t,n=""])=>{if("own"===t)return e;const i=n.replace(wi,o);return Object.assign(Object.assign({},e),{[t]:i?a(i):""})}),{own:`${s}${s&&o?" ":""}${o}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function Oi(e,t,n,i,a){return e.map(function(e,t,n){return i=>Object.entries(i).map((([i,a])=>{const r=a?bi(a):"";switch(!0){case"default"===i:return r?`\n${r}\n`:"";case Boolean(e):return`\n .${e}${An(i)} & {\n${r}\n}\n`;case t&&"own"!==n:return`\n .${wi}${An(i)} & {\n${r}\n}\n`;default:return`\n &${An(i)} {\n${r}\n}\n`}})).join("")}(t,n,i)).reduce(((e,t,n)=>{const i=a[n];return void 0!==i?e+(0===n?t:`${xn(i,t)}\n`):e}),"")}const Ai=s(z(void 0)),Ni=()=>l(Ai),Li=s(null);function Ri(e,t){var n;const i=l(Li);return i&&null!==(n=t(i))&&void 0!==n?n:e}const _i=s((()=>{throw Error("Node Mapper Context does not have a mapper. Use the NodeMapperProvider with the default nodeMapper as a value before you consume this mapper")})),Di=_i.Consumer,ki=()=>l(_i),Pi=e=>a.createElement(_i.Provider,{value:(t,n,i)=>e.value(t,null!=n?n:e.overrides,i)},e.children),$i=s(null),ji=()=>l($i),Fi=s({get(){throw Error("Offer context has not been set")}}),Gi=e=>a.createElement(Fi.Provider,{value:{get:()=>e.context}},e.children),Mi=()=>l(Fi).get(),Bi=()=>{try{return l(Fi).get().creative.copy}catch(e){return}},Ui=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Vi=P(J,Z),zi=Y({url:Vi,title:Vi});function Hi(e,t,n){return t.reduce(((t,n)=>{const[i,a]=n.slice(0,-1).split("["),r=a?a.split(","):[];if(!i)throw new Error(qi(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){Wi(t,e,"openLinks",1,2);const i=Ki(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=Yi(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(Ui,((e,t)=>`<a ${gn} ${a?`${bn}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){Wi(t,e,"sliceText",2,2);const i=Ki(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=Ki(t,e,1,(e=>{const t=Number(e);return!Number.isNaN(t)&&t>=0?t:null}),"sliceText meta attribute second argument must be a positive number");if("Chars"===i)return function(e,t){const n=new RegExp(">.*(?:</a>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,-4).slice(0,t+1)+"</a>")):e.slice(0,t)}(n,a);throw Error(qi(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);default:throw new Error(qi(e,`Unknown Meta Attribute '${t}'.`))}}(e,i,r,t)}),n)}function Wi(e,t,n,i,a){const r=new Error(qi(t,`${n} meta attribute takes ${i!=a?`between ${i} and ${a}`:i} arguments; received ${e.length}.`));if(e.length<i||e.length>a)throw r}function qi(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function Ki(e,t,n,i,a){const r=Yi(e,n,i);if(null!==r)return r;throw Error(qi(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function Yi(e,t,n){return n(e[t])}const Ji="DATA",Zi="STATE",Qi=new RegExp(`^(${Ji}|${Zi})`),Xi=new RegExp(`^${Zi}`),ea=new RegExp(`%\\^(?:${Ji}|${Zi})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*(?:\\:[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,]*\\])*(?:\\|.*?)?\\^%`,"g"),ta=Symbol("invalid");function na(e,t="creativeCopy"){const n=ia({data:e},t);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:ia(t,n,this.dataMap)});let i=!1;const a=t,r=X(k(2,-2),ee("|"),(e=>{const t=ne(((e,t)=>{let n;if(Qi.test(t)){if(!this.dataMap.has(t)&&Xi.test(t))throw new jt(Ii,`Invalid use of STATE template key in a context it does not exist: ${t}`);const i=ee(":",t);if(i[0]){if(n=this.dataMap.get(i[0]),n&&n===ta)throw new jt(Ii,`Invalid template key referenced: "${t}" is an object but expected a string, boolean, number or empty. \nDid you mean to reference a child property of ${t}?`);if(i.length>1&&n)try{n=Hi(i[0],i.slice(1),n)}catch(e){throw new jt(Ii,`Failed to apply meta attributes. ${function(e){return null!=e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:String(e)}(e)}`)}}return n?ie({provided:!0,value:n}):e}return ie({provided:!0,value:t})}),{provided:!1,value:""},e);return t.provided||(i=!0),t.value})),o=te(ea,r,a);return!1===i?o:""}.bind({dataMap:n})}function ia(e,t,n){const i=new Map(n);return"data"in e&&a(e.data,`${Ji}${t?"."+t:""}`),"state"in e&&a(e.state,`${Zi}${t?"."+t:""}`),i;function a(e,t){"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?i.set(t,(null==e?void 0:e.toString())||""):i.set(t,ta),e&&"object"==typeof e&&Q(((e,n)=>a(e,`${t}.${n}`)),e)}}const aa=s(na({})),ra=aa.Consumer,oa=aa.Provider,sa=()=>l(aa),la=s(null),ca=la.Provider,da=s("OUTER"),ua=()=>"VARIANT"===l(da),pa=s(void 0),fa=()=>l(pa);var ya,ma,ha,va,ga,ba,Ia=function(e,t,n,i){return new(n||(n=Promise))((function(a,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((i=i.apply(e,t||[])).next())}))},Ea=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},Sa=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class Ca{constructor(e,t,n,i,a){ya.set(this,void 0),ma.set(this,void 0),ha.set(this,new Set),va.set(this,void 0),ga.set(this,void 0),ba.set(this,void 0),Ea(this,ya,ae(e.subscribe.bind(e),[n]),"f"),Ea(this,ma,ae(e.dispatch.bind(e),[n]),"f"),Ea(this,va,t,"f"),Ea(this,ga,i,"f"),Ea(this,ba,a,"f"),this.onGlobalStateChange=this.onGlobalStateChange.bind(this),this.onInteractivityChange=this.onInteractivityChange.bind(this),this.onEvent=this.onEvent.bind(this),this.globalDispatch=this.globalDispatch.bind(this),this.createChildPlugin=this.createChildPlugin.bind(this)}onGlobalStateChange(e){const t=Sa(this,ya,"f").call(this,e),n=()=>{t(),Sa(this,ha,"f").delete(n)};return Sa(this,ha,"f").add(n),n}onInteractivityChange(e){return Sa(this,ga,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=Sa(this,ba,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),Sa(this,ha,"f").delete(n)};return Sa(this,ha,"f").add(n),n}globalDispatch(e){Sa(this,ma,"f").call(this,e)}dispose(){Sa(this,ha,"f").forEach((e=>e())),Ea(this,ha,new Set,"f"),Sa(this,ga,"f").clear()}createChildPlugin(e){return Sa(this,va,"f").call(this,e)}}ya=new WeakMap,ma=new WeakMap,ha=new WeakMap,va=new WeakMap,ga=new WeakMap,ba=new WeakMap;class wa{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>Ia(this,void 0,void 0,(function*(){})),onClose:()=>Ia(this,void 0,void 0,(function*(){})),putConfig:()=>Ia(this,void 0,void 0,(function*(){})),send:()=>Ia(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var Ta,xa,Oa=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},Aa=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class Na{constructor(e){Ta.set(this,void 0),xa.set(this,new Set),Oa(this,Ta,e,"f")}subscribe(e){return Aa(this,xa,"f").add(e),!0===e(Aa(this,Ta,"f"))&&Aa(this,xa,"f").delete(e),()=>{Aa(this,xa,"f").delete(e)}}publish(e){Oa(this,Ta,e,"f"),Aa(this,xa,"f").forEach((e=>{!0===e(Aa(this,Ta,"f"))&&Aa(this,xa,"f").delete(e)}))}clear(){Aa(this,xa,"f").clear()}}Ta=new WeakMap,xa=new WeakMap;var La=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},Ra=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n};const _a="breakpoint-0px";class Da{constructor(){this.logger=()=>{}}withAppFactory(e){return this.appFactory=e,this}withLogger(e){return this.logger=e,this}withGatewayFactory(e){return this.gatewayFactory=e,this}build(){var e,t,n,i,a,r,o,s,l,c,d,u,p,f;const y=this.appFactory,m=this.logger,h=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new wa;return f=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint"]}constructor(){super(),t.add(this),n.set(this,(()=>null)),i.set(this,(()=>null)),a.set(this,void 0),r.set(this,!1),o.set(this,null),s.set(this,null),l.set(this,null);const e=this.attachShadow({mode:"open"});Ra(this,a,document.createElement("div"),"f"),La(this,a,"f").id="app-container",La(this,a,"f").classList.add("default"),e.appendChild(La(this,a,"f"))}attributeChangedCallback(e,a,r){if(r!==a)switch(e){case"visible":La(this,n,"f").call(this,"true"===r);break;case"interactivity":"ENABLED"!==r&&"DISABLED"!==r||La(this,i,"f").call(this,r);break;case"active-breakpoint":La(this,t,"m",c).call(this,r,a)}}makeInteractivityUpdateHandler(e){Ra(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,i,a){const r="true"===this.getAttribute("visible"),o=this.getAttribute("slotInstanceGuid");Ra(this,n,(r=>{r?(Ra(this,n,(()=>null),"f"),0===e&&a.globalDispatch({type:rn,payload:{event:"Interactive"}}),i&&(a.globalDispatch({type:an,payload:{name:"SignalImpression",parentGuid:i}}),this.trackViewability(i,a)),o&&a.globalDispatch({type:an,payload:{name:"SignalImpression",parentGuid:o}})):La(this,t,"m",p).call(this)}),"f"),La(this,n,"f").call(this,r)}trackViewability(e,n){if(!La(this,r,"f"))if("IntersectionObserver"in window&&!La(this,o,"f")){const i=()=>{La(this,r,"f")||(n.globalDispatch({type:an,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!0}}),Ra(this,r,!0,"f"),La(this,t,"m",p).call(this),La(this,a,"f").removeEventListener("click",i))};La(this,a,"f").addEventListener("click",i),Ra(this,o,new IntersectionObserver((o=>{o.forEach((o=>{o.isIntersecting&&o.intersectionRatio>=.5?La(this,t,"m",u).call(this,(()=>{La(this,r,"f")||(n.globalDispatch({type:an,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!1}}),Ra(this,r,!0,"f"),La(this,t,"m",p).call(this),La(this,a,"f").removeEventListener("click",i))})):La(this,t,"m",d).call(this)}))}),{threshold:.5}),"f"),Ra(this,l,(()=>{var e,n;"visible"===document.visibilityState?null===(e=La(this,o,"f"))||void 0===e||e.observe(La(this,a,"f")):(La(this,t,"m",d).call(this),null===(n=La(this,o,"f"))||void 0===n||n.disconnect())}),"f"),document.addEventListener("visibilitychange",La(this,l,"f")),La(this,l,"f").call(this)}else n.globalDispatch({type:an,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!1,inferred:!1}}),Ra(this,r,!0,"f")}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&v(`Offer position attribute (${e}) is invalid`),t}getJSONAttr(e,t="{}"){const n=this.getAttribute(e);try{return JSON.parse(null!=n?n:t)}catch(t){v(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){La(this,t,"m",p).call(this)}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),r=this.getAttribute("plugin-id");La(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const o=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),l=this.getJSONAttr("childLayouts","[]"),c=this.getJSONAttr("offerData"),d=new Na("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),u=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"",p=this.getJSONAttr("offerState","{}");y||v("Cannot create app without factory. Please build the connector withAppFactory.");const f=h({offerPositionIndex:o,creativeInstanceGuid:null===(t=null==c?void 0:c.creative)||void 0===t?void 0:t.instanceGuid},d);this.makeInteractivityUpdateHandler(d),y({rootElement:La(this,a,"f"),gateway:f,logger:m,offerPositionIndex:o,offerData:c,layoutSchema:s,childLayouts:l,schemaVersion:u,pluginId:r||_t.pluginId,offerState:p}),this.makeVisbilityUpdateHandler(o,null===(n=null==c?void 0:c.creative)||void 0===n?void 0:n.instanceGuid,f)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,r=new WeakMap,o=new WeakMap,s=new WeakMap,l=new WeakMap,t=new WeakSet,c=function(e,t){La(this,a,"f").classList.remove(t||_a),La(this,a,"f").classList.add(e||_a)},d=function(){La(this,s,"f")&&(clearTimeout(La(this,s,"f")),Ra(this,s,null,"f"))},u=function(e){La(this,t,"m",d).call(this),Ra(this,s,window.setTimeout(e,1e3),"f")},p=function(){La(this,t,"m",d).call(this),La(this,o,"f")&&(La(this,o,"f").disconnect(),Ra(this,o,null,"f")),La(this,l,"f")&&(document.removeEventListener("visibilitychange",La(this,l,"f")),Ra(this,l,null,"f"))},f;function v(e){throw m({level:Pt,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const ka=s({get:()=>new wa}),Pa=e=>a.createElement(ka.Provider,{value:{get:()=>e.context}},e.children);const $a=s({get(){throw Error("Layout Schema context has not been set")}}),ja=e=>a.createElement($a.Provider,{value:{get:()=>e.context}},e.children),Fa=()=>l($a).get(),Ga=s("ENABLED"),Ma=()=>l(Ga);function Ba(e){const t=Va(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Va(t,this.dataMap)});if(!n)throw new jt("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");return g([n,t],this.dataMap)}.bind({dataMap:t})}const Ua={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function Va(e,t=Ua){return["images","links","icons","copy","responseOptionsMap"].reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},t[n]),e[n])})),t)}const za=s(Ba({}));za.Consumer;const Ha=za.Provider,Wa=e=>{const t=l(za),n=e.split("|");for(const e of n){const n=t(e.trim(),"images");if(n)return n}},qa=()=>l(za),Ka=s({});function Ya({info:e,children:t}){const n=l(Ka);return a.createElement(Ka.Provider,{value:Object.assign(Object.assign({},n),e)},t)}const Ja=s({get(){throw Error("Catalog Item context has not been set")}}),Za=e=>a.createElement(Ja.Provider,{value:{get:()=>e.context}},e.children),Qa=()=>l(Ja).get(),Xa=s(""),er=()=>l(Xa),tr=s(""),nr=s(void 0);function ir({children:e}){const t=d((()=>{const e=document.createElement("div");return e.inert=!0,{inert:!0===e.inert}}),[]);return a.createElement(nr.Provider,{value:t},e)}const ar=P(oe([Z,le(Z)]),ce,F(de),F(ue(pe,z({}),R)),de,H({},"value")),rr=P(Z,U("predicates"));function or(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const sr=re(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(bi(i)),transitionBaseClassname:e(or(t,(a=i,M(a).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?se(n).map((e=>Ln(t,e))):[]})))))};var a})),lr=oe([ar,rr]);const cr={is:j,"is-not":P(J,j),"is-below":be,"is-above":ge};function dr(e,t){return e.includes(t)}const ur={is:j,"is-not":P(J,j),exists:dr,"not-exists":P(J,dr)},pr={exists:P(J,Ie(pe,Z)),"not-exists":Ie(pe,Z)},fr={"is-true":j(!0),"is-false":j(!1)},yr={is:j,"is-not":P(J,j)};function mr(e){return(t,n)=>n[e]}const hr=T([[(e,t)=>j("Breakpoint",e),mr("activeBreakpoint")],[(e,t)=>j("Progression",e),mr("progressionIndex")],[(e,t)=>j("Position",e),mr("positionIndex")]]);function vr(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const gr=T([[j("Breakpoint"),(e,t,n)=>{const i=ye(["breakpoints",t]);return X(fe(i,Number),Ee(i))(n)}],[j("Progression"),(e,t,n)=>T([[ge(0),Se(n.totalGroups)],[Ce(0),R]])(Number(t))],[j("Position"),(e,t,n)=>T([[ge(0),Se(n.totalOffers)],[Ce(0),R]])(Number(t))]]),br=P(J,isNaN);function Ir(e,t){return e.map((e=>{var n,i,a;switch(e.type){case"StaticString":return(0,yr[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,pr[e.predicate.condition])(vr(t,e.predicate.value));case"StaticBoolean":return(0,fr[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,cr[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,cr[e.predicate.condition])(null!==(i=t.domainStates[e.predicate.key])&&void 0!==i?i:0,e.predicate.value);case"DarkMode":throw new Error("DarkMode has not yet been implemented.");case"Placeholder":return function(e){switch(e.predicate.type){case"TextValue":return(0,ur[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,cr[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,cr[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=cr[e.predicate.condition],i=null!==(a=hr(e.type,t))&&void 0!==a?a:NaN,r=gr(e.type,e.predicate.value,t);return!!br(i)&&n(i,r)}}}))}function Er(e){return B(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const Sr={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{}};function Cr(e,t,n,i){const a=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:i?"Position":e.type}):e)),{cached:r,uncached:o}=a.reduce(((t,i)=>function(e,t,n,i){const a=function(e,t){switch(e.type){case"Position":case"StaticBoolean":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"StaticString":return`${e.type}:${e.predicate.input}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"CreativeCopy":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${vr(t,e.predicate.value)}:${t.totalGroups}`;case"CustomState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.customStates[e.predicate.key]}`;case"DomainState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.domainStates[e.predicate.key]}`;case"Placeholder":return`${e.type}:${e.predicate.type}:${e.predicate.content.condition}:data:${e.predicate.content.input}:${e.predicate.content.value}`;default:return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${hr(e.type,t)}:${t.totalGroups}`}}(e,t),r=n.current.get(a);return he(wr(r)?{cached:ve(r)}:{uncached:ve({key:a,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),s=Ir(o.map((({predicate:e})=>e)),n);return me(o,s).forEach((([{key:t},n])=>{e.current.set(t,n)})),r.concat(s)}const wr=V(Boolean);const Tr=re(((e,t,n)=>{var i,a,r,o,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:Er(n),progressionIndex:null!==(a=null===(i=n.progression)||void 0===i?void 0:i.activeGroupIndex)&&void 0!==a?a:0,totalOffers:null!==(o=null===(r=n.progression)||void 0===r?void 0:r.totalOffers)&&void 0!==o?o:0,totalGroups:null!==(l=null===(s=n.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:0,customStates:n.customStates,domainStates:n.domainStates,positionIndex:e,creativeCopy:t}})),xr=ye(["predicate","content","input"]),Or=ye(["predicate","content","value"]),Ar=ye(["predicate","key"]);function Nr(e,t){const n=fe(xr,(t=>t?e(t):"")),i=fe(Or,(t=>"string"==typeof t?e(t):t)),a=P(n,i),r=fe(Ar,(t=>t?e(t):""));return t.map((e=>{switch(e.type){case"Placeholder":return"TextValue"===e.predicate.type?a(e):n(e);case"CustomState":return r(e);default:return e}}))}const Lr=le(j(!0));function Rr(e){const t=ua(),n=fa(),i=o(new Map),a=Bi(),r=Ri(Sr,Tr(n,a)),s=sa();return d((()=>K((e=>{const n=Nr(s,e);return Lr(Cr(i,n,r,t))}),e)),[i,e,r,t,s])}function _r(e){e&&(e.style.display="")}function Dr(e){e&&(e.style.display="none")}function kr(e){return e.settings.duration}const Pr=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],$r=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function jr(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?Pr:$r,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?_r(e):Dr(e)},a.oncancel=()=>{t?_r(e):Dr(e)},()=>{a.finish()}}return t?_r(e):Dr(e),()=>{}}function Fr({inTransitions:e,outTransitions:t,visible:n,children:i,containerClassName:s}){const l=o(null);return r((()=>n&&e?e.forEach((e=>{l.current&&function(e,t,n,i){if("FadeIn"===i)jr(e,t,n)}(l.current,n,kr(e),e.type)})):!n&&t?t.forEach((e=>{l.current&&function(e,t,n,i){if("FadeOut"===i)jr(e,t,n)}(l.current,n,kr(e),e.type)})):()=>{}),[n]),a.createElement("div",{ref:l,style:{display:"none"},className:s},i)}function Gr(e){const t=ki(),n=function(e){const t=ua(),n=fa(),i=o(new Map),a=Bi(),r=Ri(Sr,Tr(n,a)),s=Nr(sa(),e);return d((()=>Lr(Cr(i,s,r,t))),[i,s,r,t])}(e.schema.predicates),i=a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0))));return e.schema.transition?a.createElement(Fr,{inTransitions:e.schema.transition.inTransition,outTransitions:e.schema.transition.outTransition,visible:n},i):"functionally"===e.schema.hide?a.createElement(Ga.Provider,{value:n?"ENABLED":"DISABLED"},i):n?a.createElement(a.Fragment,null,i):null}const Mr=we(((e,t)=>`${e||""} ${t||""}`.trim())),Br=e=>{var t;const n=l(la),i=fa(),a=ji()||document.head,r=er(),o=Ci(r,i,a),s=u(Ti,[]),c=Ri([],(e=>Object.values(e.breakpoint.breakpoints))),d=n||s(c,r,i,a),p=e.styles?d(e.styles):{},f=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=sr(e);return K((e=>lr(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(o,null===(t=e.styles)||void 0===t?void 0:t.conditionalTransitions):void 0,y=Rr(f?K(H([],"predicates"),f):{}),m=K(((e,t)=>e?function(e,t){var n;if(e&&t in e)return null===(n=e[t])||void 0===n?void 0:n.classname}(f,t):void 0),y),h=f?K(U("transitionBaseClassname"),f):{},v=e.styles?(g=h,Mr(Mr(p,m),g)):void 0;var g;return e.children({classnames:v,mapperRef:d})};function Ur(e){const t=ki();return a.createElement(Br,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))}))}function Vr(e){const t=ki();return a.createElement(Br,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))}))}const zr={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",gn,bn],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},Hr=new Map([["&","_;^;_"]]),Wr=new RegExp(`<a *(?=${zr.allowedAttributes.a.join("|")}|>)`,"g"),qr=new RegExp('<a [^>]*href="([^"]+)"',"g"),Kr=new RegExp("(<br *?>)|(<br *?/>)","g"),Yr="<br/>";function Jr(e){const t=sa(),n=Ma(),i=d((()=>{const n=t(e.schema.value);if(!function(e){const t=function(e){return e.replaceAll(qr,((e,t)=>{const n=t.replaceAll("&",Hr.get("&"));return e.replace(t,n)})).replaceAll(Kr,Yr)}(e);return t===vt(t,zr)}(n))throw new jt("FAILED_SANITISING_HTML","Invalid HTML tags");return n.trim()?n:""}),[e.schema.value,t]),{tabIndex:r,styles:o,isDisabled:s}=St(n);return i?a.createElement(Br,{styles:e.schema.styles},(({classnames:t})=>{const n=[(null==t?void 0:t.link)?`class = "${null==t?void 0:t.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0));return l=i,new RegExp("</(p|ul|ol)>").test(l)?a.createElement("div",{tabIndex:r,style:o,"aria-hidden":s,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Wr,`<a ${n.join(" ")}`)}}):a.createElement("p",{tabIndex:r,style:o,"aria-hidden":s,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Wr,`<a ${n.join(" ")}`)}});var l})):null}function Zr(e){const t=sa()(e.schema.value),n=Ma(),{tabIndex:i,styles:r,isDisabled:o}=St(n);return t?a.createElement(Br,{styles:e.schema.styles},(({classnames:n})=>{const s={tabIndex:i,"aria-hidden":o,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"BasicText"};return e.isInline?a.createElement("span",Object.assign({style:r},s),t):a.createElement("p",Object.assign({style:r},s),t)})):null}function Qr(e,t,n){if("BasicText"===e.type)return a.createElement(Zr,{schema:e.node,testId:t,isInline:null!=n&&n})}function Xr(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Kt(i,n)))))}function eo(e){const t=Ni(),n=ki(),i=Mi(),o=sa(),s=fa(),l=Ma(),c=i.creative.responseOptionsMap[e.schema.responseKey],d=Nt(c);r((()=>{d&&t(function(e){if(e.paymentTriggerConfig)return{type:cn,payload:{criteria:{key:"PAYMENT_OFFER_SELECTED"},signal:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:"PAYMENT_OFFER_SELECTED"}}}};throw new Error(`Invalid External Response: No 'paymentTriggerConfig' found for external response option with instanceGuid: ${e.instanceGuid}`)}(c))}),[c,t,d]);const u=c?o({data:c},"creativeResponse"):o,{tabIndex:p,styles:f,isDisabled:y}=St(l);return xt(c)&&!d&&void 0!==s?a.createElement(Br,{styles:e.schema.styles},(({classnames:r,mapperRef:o})=>a.createElement("button",{type:"button",tabIndex:p,"aria-disabled":y,"aria-label":e.schema.a11yLabel?u(e.schema.a11yLabel):void 0,style:Object.assign({cursor:"pointer"},f),"data-testid":e.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":e.schema.responseKey,onClick:n=>{n.preventDefault();const a=function(e,t,n){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(Tt(n))return{fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid,accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId};throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId,urlBehavior:n&&"internally"===n.toLowerCase()?"self":t.urlBehavior});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}(i,c,e.schema.openLinks);t({type:Jt,payload:a})},className:null==r?void 0:r.own,disabled:y},a.createElement(oa,{value:u},(null==r?void 0:r.own)?function(e,t,n,i,r){return a.createElement(ca,{value:n(t)},Xr(e,i,r))}(e.schema.children,r.own,o,n,e.testId):Xr(e.schema.children,n,e.testId))))):null}function to(e){const t=Ma(),{styles:n,isDisabled:i}=St(t);return e.schema.url.light?a.createElement(Br,{styles:Et(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},n),{display:"inline-block"}),alt:i?void 0:e.schema.alt||void 0,title:e.schema.title||void 0,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"StaticImage",src:e.schema.url.light}))):null}function no(e){const t=Ma(),{styles:n,isDisabled:i}=St(t),r=Wa(e.schema.imageKey);return null!=(o=r)&&"object"==typeof o&&"light"in o&&"string"==typeof o.light?a.createElement(Br,{styles:Et(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},n),{display:"inline-block"}),alt:r.alt,title:r.title,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"DataImage",src:r.light}))):null;var o}const io={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function ao(e){const t=e.schema.name,n=e.schema.description,i=e.schema.styles?Wt(io,e.schema.styles):io,r=Ma(),{styles:o,isDisabled:s}=St(r);return t?a.createElement(Br,{styles:i},(({classnames:i})=>a.createElement("span",Object.assign({style:Object.assign(Object.assign({},o),{display:"inline-block"}),className:"rokt-icon"+((null==i?void 0:i.own)?" "+i.own:""),"data-testid":e.testId,"data-e2e":`StaticIcon-${t}`},!s&&n?{title:n}:{"aria-hidden":"true"}),t))):null}const ro={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class oo extends a.Component{constructor(e){super(e),this.state={errorMessage:""}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidUpdate(e){this.state.errorMessage&&JSON.stringify(e.schema)!==JSON.stringify(this.props.schema)&&this.setState({errorMessage:""})}componentDidCatch(e,t){var n;this.props.reporter&&"true"===Tn.REPORT_RENDER_ERRORS&&this.props.reporter({level:Pt,code:null!==(n=e.code)&&void 0!==n?n:"UNHANDLED_RENDERING_EXCEPTION",message:e.message,additionalInformation:Object.assign({componentStack:t.componentStack,stack:e.stack},this.context||{})})}render(){return this.state.errorMessage?"true"===Tn.DISPLAY_ERRORS?a.createElement("pre",{style:ro},a.createElement("strong",null,"Error:")," [",a.createElement("em",null,this.props.schema.type),"]"," ",this.state.errorMessage):void 0:this.props.children}}oo.contextType=Ka;const so={internally:"_top",externally:"_blank"};function lo(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function co(e){var t;const n=so[e.schema.open],i=ki(),r=Ma(),{tabIndex:o,styles:s,isDisabled:l}=St(r);return(null===(t=e.schema.children)||void 0===t?void 0:t.length)>0?a.createElement(Br,{styles:e.schema.styles},(({classnames:t,mapperRef:r})=>{var c;return a.createElement("a",{href:e.schema.src,"data-testid":e.testId,"data-e2e":"StaticLink",target:null!=n?n:"_blank",tabIndex:o,"aria-disabled":l,"aria-label":null!==(c=e.schema.a11yLabel)&&void 0!==c?c:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:e.isInline?"inline":"block"},s),className:null==t?void 0:t.own},(null==t?void 0:t.own)?function(e,t,n,i,r){return a.createElement(ca,{value:n(t)},lo(e,i,r))}(e.schema.children,null==t?void 0:t.own,r,i,e.testId):lo(e.schema.children,i,e.testId))})):null}function uo(e,t,n){if("StaticLink"===e.type)return a.createElement(co,{schema:e.node,testId:t,isInline:null!=n&&n})}const po={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function fo(e){const t=(n=e.schema.iconKey,l(za)(n,"icons"));var n;const i=null==t?void 0:t.name,r=e.schema.styles?Wt(po,e.schema.styles):po,o=Ma(),{styles:s}=St(o);return i?a.createElement(Br,{styles:r},(({classnames:t})=>a.createElement("span",{style:Object.assign(Object.assign({},s),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==t?void 0:t.own)?" "+t.own:""),"data-testid":e.testId,"data-e2e":`DataIcon-${i}`},i))):null}const yo=Be`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
overflow: hidden;
|
|
@@ -6,7 +6,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
6
6
|
> * {
|
|
7
7
|
position: absolute !important;
|
|
8
8
|
}
|
|
9
|
-
`;function
|
|
9
|
+
`;function mo(e){const t=ki(),n=o(null);return r((()=>{const e=new ResizeObserver((()=>{requestAnimationFrame((()=>{if(n.current){const e=Array.from(n.current.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0);n.current.style.height=`${e}px`}}))}));return n.current&&Array.from(n.current.children).forEach((t=>{e.observe(t)})),()=>{e.disconnect()}}),[]),a.createElement(Br,{styles:e.schema.styles},(({classnames:i})=>{var r;return a.createElement("div",{ref:n,className:[yo,null==i?void 0:i.own].filter(Boolean).join(" ")||void 0,"aria-label":null!==(r=e.schema.a11yLabel)&&void 0!==r?r:void 0,"data-testid":e.testId,"data-e2e":"ZStack"},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))}))}const ho={elements:{own:[{default:{dimension:{width:{type:"percentage",value:100},height:{type:"fixed",value:50}},background:{backgroundColor:{light:"#000"}},border:{borderRadius:25}}}],thumb:[{default:{dimension:{width:{type:"fixed",value:50},height:{type:"fixed",value:50}},background:{backgroundColor:{light:"#FFF"}},text:{fontSize:22,fontFamily:"rokt-icons",horizontalTextAlign:"center"},border:{borderRadius:25}}}],fill:[{default:{background:{backgroundColor:{light:"#000"}}}}],label:[{default:{text:{fontSize:18,textColor:{light:"#FFF"},horizontalTextAlign:"center"}}}]}};function vo(e){const[t,n]=c(!1),[i,s]=c(!1),l=er(),d=Ma(),u=fa(),p=Ni(),{customStateValue:f,label:y,a11yLabel:m,thumb:h}=e.schema,{containerClass:v,trackClass:g,fillClass:b,thumbClass:I,labelClass:E,buttonClass:S}=function(e,t){const n=Ci(e,t);return{containerClass:n`
|
|
10
10
|
position: relative;
|
|
11
11
|
z-index: 1;
|
|
12
12
|
flex: 1;
|
|
@@ -54,7 +54,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
54
54
|
z-index: 0;
|
|
55
55
|
background-color: #00000000;
|
|
56
56
|
color: #00000000;
|
|
57
|
-
`}}(l,u),C=sa();if(!e.schema.customStateKey)throw new Error("No custom state key provided for state trigger node.");const w=C(e.schema.customStateKey),T={type:rn,payload:{key:w,value:null!=f?f:1}},x={type:an,payload:{name:"SignalUserInteraction",action:"Swipe",context:"SlideStateTrigger"}},O=e.schema.styles?Wt(hr,e.schema.styles):hr,A=r(null),N=r(null),L=r(null),R=r(!1),_=r(void 0),{isDisabled:D}=St(d);o((()=>{if(t)return wt()?(document.addEventListener("touchmove",$),document.addEventListener("touchend",k)):(document.addEventListener("mousemove",$),document.addEventListener("mouseup",k)),B}),[t]);const k=()=>{B(),_.current=void 0,n(!1),i||(M(!0),R.current?(G(F()),j()):G(0))},P=e=>{t||i||D||(_.current=br(e),M(!1),n(!0))},$=e=>{var t,n;if(gr(L)){const i=Math.min(Math.max(0,(null!==(t=br(e))&&void 0!==t?t:0)-(null!==(n=_.current)&&void 0!==n?n:0)),F());G(i),i/F()*100>=75?R.current=!0:R.current=!1}},j=()=>{var e,t;s(!0),p(T),p(x),null===(t=null===(e=gr(A).parentElement)||void 0===e?void 0:e.parentElement)||void 0===t||t.focus()},F=()=>gr(A).getBoundingClientRect().width-gr(L).getBoundingClientRect().width,G=e=>{var t;gr(L).style.transform=`translateX(${e}px)`,gr(N).style.transform=`translateX(${e+(null===(t=gr(L))||void 0===t?void 0:t.getBoundingClientRect().width)/2}px)`},M=e=>{e?(gr(L).style.transition="transform .2s",gr(N).style.transition="transform .2s"):(gr(L).style.transition="",gr(N).style.transition="")},B=()=>{document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",$),document.removeEventListener("touchend",k)};return a.createElement(Uo,{styles:O},(({classnames:t})=>{var n,o,r,s,l,c;return a.createElement("div",{className:`${v}`,"data-testid":e.testId,"data-e2e":"SlideStateTrigger"},a.createElement("div",{className:`${g} ${null!==(n=null==t?void 0:t.own)&&void 0!==n?n:""}`,ref:A,"aria-hidden":!0,"data-testid":e.testId&&`${e.testId}-track`},(null==y?void 0:y.value)?a.createElement("div",{className:`${E} ${null!==(o=null==t?void 0:t.label)&&void 0!==o?o:""}`,"data-testid":e.testId&&`${e.testId}-label`},y.value):null,a.createElement("div",{className:`${b} ${null!==(r=null==t?void 0:t.fill)&&void 0!==r?r:""}`,ref:N,"data-testid":e.testId&&`${e.testId}-fill`}),a.createElement("div",{className:`${I} ${null!==(s=null==t?void 0:t.thumb)&&void 0!==s?s:""}`,ref:L,"data-testid":e.testId&&`${e.testId}-thumb`,"data-e2e":"SlideStateTrigger-thumb",onMouseDown:P,onTouchStart:P},null!==(l=null==h?void 0:h.icon)&&void 0!==l?l:"ArrowForward")),a.createElement("button",{className:S,"aria-label":null!=m?m:void 0,onClick:j,disabled:i||D,"data-testid":e.testId&&`${e.testId}-button`},null!==(c=null==y?void 0:y.value)&&void 0!==c?c:"Unlock Offers"))}))}function gr(e){if(!e.current)throw new Error("Unexpected missing reference to required SlideStateTrigger Element");return e.current}function br(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX}function Ir(e){const t=ki();return a.createElement(Uo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row",flexWrap:"wrap"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))}))}function Er(e){const t=Ma(),n=Ni(),i=sa()(e.schema.customStateKey),o=Ri(0,(e=>e.customStates[i])),{tabIndex:r,styles:s,isDisabled:l}=St(t),c=()=>{n({type:rn,payload:{key:i,value:o?0:1}})};return a.createElement(Uo,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:c,"data-testid":e.testId,"data-e2e":"ToggleButtonStateTrigger",disabled:l,"aria-disabled":l,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:r,style:Object.assign({cursor:"pointer"},s)},a.createElement(Di,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function Sr(e){const t=ki();return a.createElement(Uo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row",overflowX:"auto"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))}))}function Cr(e){const t=ki();return a.createElement(Uo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"column",overflowY:"auto"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))}))}const wr=s({extensions:{ctx:new Map,cache:[]}}),Tr=()=>l(wr).extensions;function xr({extensions:e,extendStore:t,children:n}){const i=Tr(),o=new Map([...i.ctx,...e.ctx]),r=i.cache.concat(e.cache);return a.createElement(wr.Provider,{value:{extensions:{ctx:o,cache:r},extendStore:t}},n)}function Or(e,t){const n=function(e){try{const t=JSON.parse(e);if(null!=t&&"object"==typeof t&&"type"in t&&"Extension"===t.type&&"name"in t&&"string"==typeof t.name&&t.name.trim().length>0&&"body"in t&&"object"==typeof t.body)return{type:"Extension",name:t.name,body:t.body}}catch(e){}return null}(t),i=n?e.ctx.get(n.name):null;return n&&i?[n,i]:null}function Ar({data:e}){const t=Or(Tr(),e);var n;if((e=>{const{extendStore:t,extensions:n}=l(wr);o((()=>{e&&t&&!n.cache.includes(e.name)&&(t(e),n.cache.push(e.name))}),[e,n.cache,t])})((n=null==t?void 0:t[1])?{sagas:n.sagas,reducer:n.reducer,name:n.name,interceptors:n.interceptors}:void 0),t){const[e,n]=t;return n.componentFactory(e.body)}return null}function Nr(e,t){if(Ct("Extension",e))return a.createElement(Ar,{data:e.node.data})}function Lr(e){const t=qa(),n=Mi(),i=sa(),r=ki(),s=Ni(),l=d((()=>n.catalogItems||[]),[n]),c=(e,t)=>i({data:Object.assign(Object.assign({},e),{positionIndex:t})},"catalogItem");return o((()=>{for(const e of l)s({type:an,payload:{name:"SignalImpression",parentGuid:e.instanceGuid}})}),[l,s]),l.length>0?a.createElement(Uo,{styles:e.schema.styles},(({classnames:n})=>a.createElement("div",{"data-testid":e.testId,"data-e2e":"CatalogStackedCollection",className:null==n?void 0:n.own,style:{display:"flex",flexDirection:"column"}},a.Children.toArray(l.map(((n,i)=>a.createElement(Za,{context:n},a.createElement(Ha,{value:t(n)},a.createElement(ra,{value:c(n,i)},r(e.schema.template,void 0,Kt(i,e.testId))))))))))):null}const Rr={BasicText:(e,t)=>Xo(e,t,!0),StaticLink:(e,t)=>ur(e,t,!0)};function _r(e){const t=ki();return a.createElement(Pi,{value:t,overrides:Rr},a.createElement(Di,null,(t=>a.createElement(Uo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:null==n?void 0:n.own,"data-testid":e.testId,"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))})))))}function Dr(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Kt(i,n)))))}function kr(e){const t=Ma(),n=Ni(),i=ki(),o=sa(),{event:r}=e.schema,{tabIndex:s,styles:l,isDisabled:c}=St(t),d=K((e=>o(e)),r.data||{}),u=()=>{n({type:sn,payload:{name:r.type,body:{offerId:d.providerOfferId,title:d.title,description:d.description}}})};return a.createElement(Uo,{styles:e.schema.styles},(({classnames:t,mapperRef:n})=>{var r;return a.createElement("button",{"aria-disabled":c,"aria-label":null!==(r=e.schema.a11yLabel)&&void 0!==r?r:void 0,className:null==t?void 0:t.own,"data-e2e":"PartnerEventButtonTrigger","data-testid":e.testId,disabled:c,onClick:u,tabIndex:s,type:"button",style:Object.assign({cursor:"pointer"},l)},a.createElement(ra,{value:o},(null==t?void 0:t.own)?function(e,t,n,i,o){return a.createElement(ca,{value:n(t)},Dr(e,i,o))}(e.schema.children,t.own,n,i,e.testId):Dr(e.schema.children,i,e.testId)))}))}function Pr(e){const t=Ni(),n=sa(),i=e.schema.delay?e.schema.delay:1,a=n(e.schema.customStateKey),s=Ri(0,(e=>e.customStates[a]));return function({delay:e,callback:t}){const n=r(null);o((()=>{n.current=setTimeout(t,e)}),[])}({delay:i,callback:()=>{t({type:rn,payload:{key:a,value:s?0:1}})}}),null}function $r(e){const t=Ma(),n=sa(),i=n(e.schema.value),o=Ni(),r=n(e.schema.customStateKey),s=Ri(0,(e=>e.customStates[r])),{tabIndex:l,styles:c,isDisabled:d}=St(t),u=()=>{navigator.clipboard.writeText(i),s||(o({type:rn,payload:{key:r,value:1}}),o({type:an,payload:{name:"SignalUserInteraction",action:"Click",context:"CopyToClipboardButton"}}))};return a.createElement(Uo,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:u,"data-testid":e.testId,"data-e2e":"CopyToClipboardButton",disabled:d,"aria-disabled":d,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:l,style:Object.assign({cursor:"pointer"},c)},a.createElement(Di,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function jr(e){const t=Ma(),n=Ni(),i=sa()(e.schema.customStateKey),{value:o}=e.schema,{tabIndex:r,styles:s,isDisabled:l}=St(t),c=()=>{n({type:rn,payload:{key:i,value:o}})};return a.createElement(Uo,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:c,"data-testid":e.testId,"data-e2e":"ButtonStateTrigger",disabled:l,"aria-disabled":l,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:r,style:Object.assign({backgroundColor:"transparent",cursor:"pointer",margin:0,padding:0},s)},a.createElement(Di,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function Fr({schema:e,testId:t}){var n,i,r,s,l,c,u,p;const f=qa(),y=Mi(),m=ki(),h=Ni(),v=d((()=>y.catalogItems||[]),[y]),g=sa(),b=(e,t)=>g({data:Object.assign(Object.assign({},e),{positionIndex:t})},"catalogItem"),I=Ri(0,(e=>{return(t=e.breakpoint.activeBreakpoint,P($(j(t)),wn,Cn,M,B({},["breakpoint","breakpoints"])))({breakpoint:Object.assign(Object.assign({},e.breakpoint),{initialised:!0})});var t})),E=Ma(),{tabIndex:S,isDisabled:C,styles:w}=St(E),T=e.viewableItems.length-1,[x]=ht({slidesToScroll:null!==(n=e.viewableItems[Math.min(I,T)])&&void 0!==n?n:"auto",containScroll:"trimSnaps"});o((()=>{for(const e of v)h({type:an,payload:{name:"SignalImpression",parentGuid:e.instanceGuid}})}),[v,h]);const O=`${null!==(u=null===(c=null===(l=null===(s=null===(r=null===(i=e.styles)||void 0===i?void 0:i.elements)||void 0===r?void 0:r.own[I])||void 0===s?void 0:s.default)||void 0===l?void 0:l.container)||void 0===c?void 0:c.gap)&&void 0!==u?u:"0"}px`,A={overflow:"hidden"},N={backfaceVisibility:"hidden",display:"flex",touchAction:"pan-y",gap:O,alignItems:"stretch"},L=e.peekThroughSize[Math.min(I,e.peekThroughSize.length-1)],R=L?"fixed"===(_=L).type?`${_.value}px`:`${_.value}%`:"0px";var _;const D=null!==(p=e.viewableItems[Math.min(T,I)])&&void 0!==p?p:1,k={flex:`0 0 calc(${(e=>"0px"!==e&&"0%"!==e)(R)?`(100% - 2 * ${R} - (${D} + 1) * ${O})/${D}`:`(100% - (${D} - 1) * ${O})/${D}`})`,position:"relative",display:"flex",backgroundColor:"transparent"};return v.length>0?a.createElement(Uo,{styles:e.styles},(({classnames:n})=>a.createElement("div",{ref:x,style:Object.assign(Object.assign({},A),w),"aria-disabled":C,tabIndex:S,className:null==n?void 0:n.own,"data-e2e":"CarouselDistribution","data-testid":t&&`${t}`},a.createElement("div",{style:N,"data-testid":t&&`${t}-container`,"data-e2e":"CarouselDistribution-Container"},a.Children.toArray(v.map(((n,i)=>a.createElement(Za,{context:n},a.createElement(Ha,{value:f(n)},a.createElement(ra,{value:b(n,i)},a.createElement("div",{style:k,"data-testid":t&&`${t}-slide-${i}`,"data-e2e":`CarouselDistribution-Slide-${i}`},m(e.template,void 0,Kt(i,t))))))))))))):null}function Gr(e){var t;const n=null!==(t=e.activeIndicatorMode)&&void 0!==t?t:"timer",i={elements:{own:[],pseudoActiveIndicator:e.activeIndicatorStyles?e.activeIndicatorStyles.map((e=>({default:e.default?Te(["background"],e.default):{}}))):[],pseudoActiveIndicatorContents:e.activeIndicatorStyles?e.activeIndicatorStyles.map((e=>({default:e.default?Te(["spacing","container"],e.default):{}}))):[]}};return a.createElement(Uo,{styles:i},(({classnames:t})=>{var i;return a.createElement("div",{style:{display:"flex",flexDirection:"row",position:"absolute",zIndex:2},className:null===(i=e.indicatorClasses)||void 0===i?void 0:i.progressIndicatorContainer,"data-testid":e.testId},Array.from({length:e.count},((i,o)=>{var r,s,l,c;return a.createElement("span",{key:o,className:[null===(r=e.indicatorClasses)||void 0===r?void 0:r.indicator,o<e.activeIndex?null===(s=e.indicatorClasses)||void 0===s?void 0:s.seenIndicator:void 0,o===e.activeIndex&&"timer"!==n?null===(l=e.indicatorClasses)||void 0===l?void 0:l.activeIndicator:void 0,o===e.activeIndex&&"timer"===n&&(null==t?void 0:t.pseudoActiveIndicator)?t.pseudoActiveIndicator:void 0].filter(Boolean).join(" "),style:{display:"block",transition:"all 100ms linear"},"data-testid":e.testId&&`${e.testId}-indicator-${o}`},"timer"===n&&a.createElement("span",{className:[null===(c=e.indicatorClasses)||void 0===c?void 0:c.indicator,o===e.activeIndex&&(null==t?void 0:t.pseudoActiveIndicatorContents)?t.pseudoActiveIndicatorContents:void 0].filter(Boolean).join(" "),style:{display:"block",padding:0,margin:0,maxWidth:"100%",maxHeight:"100%",border:"none",transform:`translateX(${o===e.activeIndex?"0%":"-100%"})`,transition:o===e.activeIndex?`transform ${e.transitionDuration}ms linear`:""}}))})))}))}const Mr={elements:{own:[{default:{container:{alignItems:"flex-end",justifyContent:"center"}}}],progressIndicatorContainer:[{default:{dimension:{width:{type:"percentage",value:100}},spacing:{offset:"0 -10"},container:{gap:2,alignItems:"center",justifyContent:"center"}}}],indicator:[{default:{dimension:{height:{type:"fixed",value:2},maxWidth:75},container:{overflow:"hidden"},background:{backgroundColor:{light:"#66FFFFFF"}}}}],activeIndicator:[{default:{background:{backgroundColor:{light:"#FFFFFF"}}}}]}},Br={overflow:"hidden",position:"relative",display:"flex"},Ur={backfaceVisibility:"hidden",display:"flex",alignItems:"stretch",minWidth:"100%"},Vr={display:"inline-block",minWidth:"100%",maxWidth:"100%",height:"auto"};function zr(e){return null!=e&&"object"==typeof e&&"light"in e&&"string"==typeof e.light}function Hr(e,t){if("slide"===t)switch(e){case"fast":return 20;case"slow":return 60;default:return 30}switch(e){case"fast":return 20;case"slow":return 80;default:return 45}}function Wr(e){var t;const n=Ma(),{tabIndex:i,isDisabled:r,styles:s}=St(n),[l,u]=function(e,t){return d((()=>{var n,i,a,o;const r=bt({delay:null!==(n=e.duration)&&void 0!==n?n:3e3,playOnInit:"ENABLED"===t}),s={active:"ENABLED"===t,loop:!0,watchDrag:!1};return"SlideInOut"===(null===(i=e.transition)||void 0===i?void 0:i.type)?[Object.assign(Object.assign({},s),{duration:Hr(null===(a=e.transition)||void 0===a?void 0:a.settings.speed,"slide"),slidesToScroll:1,containScroll:"trimSnaps"}),[r]]:[Object.assign(Object.assign({},s),{duration:Hr(null===(o=e.transition)||void 0===o?void 0:o.settings.speed,"fade"),containScroll:!1,align:"center"}),[r,It()]]}),[e,t])}(e.schema,n),[p,f]=ht(l,u),[y,m]=c(-1);o((()=>{let e;return f&&(f.on("autoplay:timerset",(()=>{e&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame((()=>{m(f.selectedScrollSnap()),e=void 0}))})),f.on("autoplay:timerstopped",(()=>{m(-1)})),f.emit("autoplay:timerset")),()=>{null==f||f.destroy()}}),[f]);const h=Wa(e.schema.imageKey),v=(g=e.schema.imageKey,[Wa(`${g}.1`),Wa(`${g}.2`),Wa(`${g}.3`),Wa(`${g}.4`)].filter(zr));var g;const b=e.schema.styles?Wt(Mr,null!==(t=e.schema.styles)&&void 0!==t?t:{}):Mr;return 0===v.length&&h&&v.push(h),v.length>0?a.createElement(Uo,{styles:Et(b)},(({classnames:t})=>{var n,o,l,c,d,u,f;return a.createElement("div",{ref:p,style:Object.assign(Object.assign({},Br),s),"aria-disabled":r,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:i,className:null==t?void 0:t.own,"data-e2e":"DataImageCarousel","data-testid":e.testId},a.createElement("div",{style:Ur,"data-testid":e.testId&&`${e.testId}-container`,"data-e2e":"DataImageCarousel-Container"},v.map(((t,n)=>a.createElement("img",{key:n,"aria-hidden":r,style:Object.assign(Object.assign({},s),Vr),alt:t.alt,title:t.title,"data-testid":e.testId&&`${e.testId}-image-${n}`,"data-e2e":"DataImageCarousel-Image",src:t.light})))),!1!==(null===(o=e.schema.indicators)||void 0===o?void 0:o.show)&&v.length>1&&a.createElement(Gr,{indicatorClasses:null!=t?t:void 0,activeIndicatorStyles:null!==(d=null===(c=null===(l=e.schema.styles)||void 0===l?void 0:l.elements)||void 0===c?void 0:c.activeIndicator)&&void 0!==d?d:void 0,activeIndicatorMode:null===(u=e.schema.indicators)||void 0===u?void 0:u.activeIndicatorMode,activeIndex:y,count:v.length,transitionDuration:null!==(f=e.schema.duration)&&void 0!==f?f:3e3,testId:e.testId}))})):null}function qr(e){return()=>{throw new jt("FAILED_CREATING_UNHANDLED_NODE",`The default mapper does not handle the ${e} node. Make sure when you use the NodeMapperProvider, you pass an override for ${e} node.`)}}const Kr={Column:function(e,t){if("Column"===e.type)return a.createElement(Vo,{schema:e.node,testId:t})},Row:function(e,t){if("Row"===e.type)return a.createElement(zo,{schema:e.node,testId:t})},StaticImage:function(e,t){if("StaticImage"===e.type)return a.createElement(nr,{schema:e.node,testId:t})},DataImage:function(e,t){if("DataImage"===e.type)return a.createElement(ir,{schema:e.node,testId:t})},DataImageCarousel:function(e,t){if("DataImageCarousel"===e.type)return a.createElement(Wr,{schema:e.node,testId:t})},CreativeResponse:function(e,t){if("CreativeResponse"===e.type)return a.createElement(tr,{schema:e.node,testId:t})},OneByOneDistribution:qr("OneByOneDistribution"),StackedDistribution:qr("StackedDistribution"),CarouselDistribution:qr("CarouselDistribution"),GroupedDistribution:qr("GroupedDistribution"),ProgressIndicator:qr("ProgressIndicator"),ProgressControl:qr("ProgressControl"),When:function(e,t){if("When"===e.type)return a.createElement(Mo,{schema:e.node,testId:t})},Overlay:qr("Overlay"),CloseButton:qr("CloseButton"),RichText:function(e,t){if("RichText"===e.type)return a.createElement(Zo,{schema:e.node,testId:t})},BasicText:Xo,StaticLink:ur,DataIcon:function(e,t){if("DataIcon"===e.type)return a.createElement(fr,{schema:e.node,testId:t})},StaticIcon:function(e,t){if("StaticIcon"===e.type)return a.createElement(or,{schema:e.node,testId:t})},ZStack:function(e,t){if("ZStack"===e.type)return a.createElement(mr,{schema:e.node,testId:t})},FlowRow:function(e,t){if("FlowRow"===e.type)return a.createElement(Ir,{schema:e.node,testId:t})},SlideStateTrigger:function(e,t){if("SlideStateTrigger"===e.type)return a.createElement(vr,{schema:e.node,testId:t})},ToggleButtonStateTrigger:function(e,t){if("ToggleButtonStateTrigger"===e.type)return a.createElement(Er,{schema:e.node,testId:t})},PartnerEventButtonTrigger:function(e,t){if("PartnerEventButtonTrigger"===e.type)return a.createElement(kr,{schema:e.node,testId:t})},TimerStateTrigger:function(e,t){if("TimerStateTrigger"===e.type)return a.createElement(Pr,{schema:e.node})},CatalogStackedCollection:function(e,t){if("CatalogStackedCollection"===e.type)return a.createElement(Lr,{schema:e.node,testId:t})},CatalogResponseButton:qr("CatalogResponseButton"),ScrollableRow:function(e,t){if("ScrollableRow"===e.type)return a.createElement(Sr,{schema:e.node,testId:t})},ScrollableColumn:function(e,t){if("ScrollableColumn"===e.type)return a.createElement(Cr,{schema:e.node,testId:t})},EscapeHatch:Nr,BottomSheet:qr("BottomSheet"),CatalogQuantityOption:qr("CatalogQuantityOption"),CatalogRadioGroup:qr("CatalogRadioGroup"),CatalogQuantityCounter:qr("CatalogQuantityCounter"),InlineContainer:function(e,t){if("InlineContainer"===e.type)return a.createElement(_r,{schema:e.node,testId:t})},CopyToClipboardButton:function(e,t){if("CopyToClipboardButton"===e.type)return a.createElement($r,{schema:e.node,testId:t})},ButtonStateTrigger:function(e,t){if("ButtonStateTrigger"===e.type)return a.createElement(jr,{schema:e.node,testId:t})},CatalogCombinedCollection:qr("CatalogCombinedCollection"),CatalogCarouselCollection:function(e,t){if("CatalogCarouselCollection"===e.type)return a.createElement(Fr,{schema:e.node,testId:t})},IconGroup:qr("IconGroup")};function Yr(e){return function(t,n,i){const o=n&&n[t.type],r=null!=o?o:Kr[t.type];return a.createElement(sr,{schema:t,reporter:e},r&&r(t,i)||function(e){throw new jt("FAILED_CREATING_LAYOUT_NODE",`Failed to create layout node ${JSON.stringify(e)}`)}(t))}}const Jr={transformLinksToAnchorText:function(e={}){return{data:K((e=>zi(e)?`<a target="_blank" href="${e.url}">${e.title}</a>`:""),e)}}};function Zr(e){const{childLayouts:t}=e,n=Ni(),[i,a]=d((()=>{const e=xe(U("childLayoutId"),t);return[e,K((e=>e.childLayoutSchema.predicates),e)]}),[t]),r=_o(a);o((()=>{Object.entries(r).forEach((([e,t])=>{const a=i[e];t&&a&&n({type:fn,payload:a})}))}),[r,i,n])}function Qr(e){const{settings:t,dispatch:n,children:i}=e,r=na(t.offerData.creative.copy||{})(Jr.transformLinksToAnchorText(t.offerData.creative.links),"creativeLink"),s=Yr(t.logger),[l,d]=c("ENABLED");return o((()=>t.gateway.onInteractivityChange(d)),[t]),In(t.rootElement,n),a.createElement(da.Provider,{value:"VARIANT"},a.createElement($i.Provider,{value:t.rootElement},a.createElement(Xa.Provider,{value:t.pluginId},a.createElement(Pa,{context:t.gateway},a.createElement(ja,{context:t.layoutSchema},a.createElement(to.Provider,{value:t.schemaVersion},a.createElement(Gi,{context:t.offerData},a.createElement(Ha,{value:Ba(t.offerData.creative)},a.createElement(Ga.Provider,{value:l},a.createElement(Pi,{value:s},a.createElement(pa.Provider,{value:t.offerPositionIndex},a.createElement(Ai.Provider,{value:n},a.createElement(ra,{value:r},a.createElement(Xr,null,a.createElement(Zr,{childLayouts:t.childLayouts}),i))))))))))))))}function Xr(e){var t;const{children:n}=e,i=eo(),r=function(){const[e,t]=c(null),n=l(ka).get();return o((()=>n.onGlobalStateChange((n=>{j(n,e)||t(n)}))),[n]),e}(),s=l($i)||void 0,d=fa(),p=u((e=>xi(e,i,d,s)),[s]);return r?a.createElement(ca,{value:p(Object.values(null!==(t=null==r?void 0:r.breakpoint.breakpoints)&&void 0!==t?t:{}))},a.createElement(Li.Provider,{value:r},n)):null}function es(e){return a.createElement("style",{"data-testid":e.testId},"\n* {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n}\nbody {\n margin: 0;\n font-family: sans-serif;\n}\np {\n margin: 0;\n}\nimg {\n max-width: 100%;\n}\n")}function ts(e,t,n,i,a,o){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){o.current.isRunning=!0,a&&"in"===t&&function(e,t){e.style.height=`${t.clientHeight}px`}(a,e);const r=e.animate(n,{duration:i,iterations:1});return r.onfinish=()=>{"in"===t?Do(e):ko(e),o.current.isRunning=!1},r.oncancel=()=>{"in"===t?Do(e):ko(e),o.current.isRunning=!1},()=>{r.finish()}}return"in"===t?Do(e):ko(e),()=>{}}const ns={FadeInOut:{in:[{opacity:0,display:"none"},{opacity:0,display:"none",offset:.5},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],out:[{opacity:1},{opacity:0,offset:.75},{opacity:0}]}};function is({visible:e,effect:t,children:n,parentElement:i,containerClassName:s}){const[l,d]=c(e),u=r(null),p=r({isRunning:!1}),f=Po(t);return o((()=>{const t=new ResizeObserver((function(t){i&&e&&!p.current.isRunning&&requestAnimationFrame((()=>{t.forEach((e=>{e.contentBoxSize?function(e,t){var n;Array.isArray(e.contentBoxSize)&&e.contentBoxSize[0]?t.style.height=e.contentBoxSize[0].blockSize+"px":"object"==typeof(n=e.contentBoxSize)&&null!=n&&"blockSize"in n&&"number"==typeof n.blockSize&&"inlineSize"in n&&"number"==typeof n.inlineSize?t.style.height=e.contentBoxSize.blockSize+"px":t.style.height="auto"}(e,i):e.contentRect&&function(e,t){t.style.height=`${e.contentRect.height}px`}(e,i)}))}))}));return e&&u.current&&(Do(u.current),t.observe(u.current)),()=>{t.disconnect()}}),[e,i]),o((()=>e&&!l&&u.current&&i?(d(!0),ts(u.current,"in",ns[t.type].in,f,i,p)):!e&&l&&u.current&&i?(d(!1),ts(u.current,"out",ns[t.type].out,f/2,i,p)):()=>{}),[e,i,f]),a.createElement("div",{ref:u,style:{display:"none"},className:s},n)}function as(e){const t=ki();return a.createElement(Uo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:null==n?void 0:n.own,"data-testid":e.testId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},t(e.schema.template))}))}const os="ACTIVE/ADD",rs="ACTIVE/DELETE",ss="BREAKPOINT/UPDATE_ACTIVE",ls="BREAKPOINT/INITIALISE",cs="BREAKPOINT/SET_BREAKPOINTS",ds="FONTS/SET",us="LAYOUT/UPDATE",ps="CONFIG/HANDLE",fs="PLUGIN/CLOSE_PLUGIN",ys="SETTINGS/SET",ms="CACHE/ADD_SERIALIZED_VALUE",hs="CACHE/UPDATE_SERIALIZED_VALUE",vs="CACHE/CLEAR_SERIALIZED_VALUE",gs="SIGNAL/QUEUE",bs="SIGNAL/PROCESSED",Is="SIGNAL/PROCESS",Es="OVERLAY/DISMISS_OVERLAY",Ss="ERROR/REPORT",Cs="LOG",ws="CUSTOM_STATES/SET",Ts={LAYOUT_UPDATE:us,UPDATE_ACTIVE_BREAKPOINT:ss,INITIALISE_BREAKPOINT:ls,ACTIVE_ADD:os,ACTIVE_DELETE:rs,SET_FONTS:ds,QUEUE_SIGNAL:gs,SIGNAL_PROCESSED:bs,CACHE_SERIALIZED_VALUE:ms,UPDATE_CACHED_SERIALIZED_VALUE:hs,CLEAR_SERIALIZED_VALUE_FROM_CACHE:vs,SET_SETTINGS:ys,SET_CUSTOM_STATE:ws},xs={HANDLE_CONFIG:ps,SET_BREAKPOINTS:cs,CLOSE_PLUGIN:fs,RAISE_METRIC:Yt,PREPARE_SIGNAL:cn,DISMISS_OVERLAY:Es,REPORT_ERROR:Ss,LOG:Cs,OPEN_LINK:dn},Os="plugin-overlay",As="plugin";function Ns(t){var n;const i=t.schema.styles,o=y(),r={type:(null===(n=t.action)||void 0===n?void 0:n.type)||Es,payload:{id:Os,dismissalMethod:t.schema.dismissalMethod}},s=()=>{o(r)},l=Ma(),{tabIndex:c,styles:d,isDisabled:u}=St(l);return e(Uo,{styles:i,children:({classnames:n})=>{var i;return e("button",{title:"Close",className:null==n?void 0:n.own,onClick:s,"data-testid":t.testId,"data-e2e":"CloseButton",disabled:u,tabIndex:c,"aria-disabled":u,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:void 0,style:Object.assign({cursor:"pointer"},d),children:e(Di,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}const Ls={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var Rs;function _s({isOpen:n,schema:i,testId:r,children:s}){const l=En(),c=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),d=m((e=>e.active.has(As))),u=y(),p=()=>{u({type:xs.DISMISS_OVERLAY,payload:{id:Os,dismissalMethod:"rokt_backdrop"}})};o((()=>{c&&u({type:an,payload:{name:"SignalActivation",parentGuid:c}})}),[c]),o((()=>{d&&requestAnimationFrame((()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()}))}),[d]);const f=Ma(),{tabIndex:h,isDisabled:v,styles:g}=St(f),b=i.styles?Oe(Ls,i.styles):Ls;if(!n)return null;const I=e(Di,{children:e=>a.Children.toArray(i.children.map(((t,n)=>e(t,void 0,r?`${r}-child${n}`:void 0))))});return e(Uo,{styles:b,children:({classnames:n})=>{var a;return t("div",{className:null==n?void 0:n.wrapper,style:Object.assign({position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto"},g),"aria-label":null!==(a=i.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":v,role:"dialog","aria-modal":!0,tabIndex:h,"data-testid":r,"data-e2e":"Overlay-Wrapper",children:[e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:i.allowBackdropToClose?p:void 0,"data-testid":r&&`${r}-backdrop`,"data-e2e":"Overlay-Backdrop"}),s(I,l)]})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(Rs||(Rs={}));const Ds={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const ks=p((function({schema:t,testId:n,children:i},a){const o=t.styles?Oe(Ds,t.styles):Ds;return e(Uo,{styles:o,children:({classnames:t})=>e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none"},ref:a,tabIndex:-1,"data-e2e":"Overlay-Container","data-testid":n&&`${n}-container`,children:i})})}));const Ps=h((function(e){return{isOpen:e.active.has(Os)}}))((function(t){return e(_s,Object.assign({},t,{children:(n,i)=>e(ks,Object.assign({},t,{ref:i,children:n}))}))}));const $s=h((function(e){return{isOpen:e.active.has(Os)}})),js={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const Fs=p((function({schema:t,testId:n,children:i},a){const s=r(null),l=t.styles?Oe(js,t.styles):js;return o((()=>{if(s.current)return function(e){const t=requestAnimationFrame((()=>{e&&e.style.setProperty("max-height","100%")}));return()=>{cancelAnimationFrame(t)}}(s.current)}),[]),e(Uo,{styles:l,children:({classnames:t})=>e("div",{style:{width:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)",alignSelf:"flex-end"},ref:s,children:e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none",borderBottomLeftRadius:"0",borderBottomRightRadius:"0"},ref:a,tabIndex:-1,"data-testid":n&&`${n}-container`,"data-e2e":"BottomSheet-Container",children:i})})})}));const Gs=$s((function(t){const n=m((e=>e.breakpoint.activeBreakpoint));return e(_s,Object.assign({},t,{children:(i,a)=>e("default"===n?Fs:ks,Object.assign({},t,{ref:a,children:i}))}))}));const Ms="DisplayPreset.FULLSCREEN",Bs="DisplayPreset.EMBEDDED",Us="DisplayPreset.ATTACHED",Vs="ERROR",zs="INFO",Hs="WARNING";var Ws;!function(e){e.PAYPAL="Paypal"}(Ws||(Ws={}));const qs="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DCUI_SCHEMA_VERSION:"",ROKT_DOMAIN:""};function*Ks(e,t,n){(function(e){return"object"==typeof e&&null!==e&&"type"in e&&Object.values(vn).includes(e.type)})(n)&&!e.includes(n.type)&&(yield ze(t.globalDispatch.bind(t),n))}function Ys(e,t){return!e||t<1?null:{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,name:e.title,description:e.description,quantity:t,currency:e.currency||"$",unitPrice:e.price||0,totalPrice:(e.price||0)*t,linkedProductId:e.linkedProductId,quantityMustBeSynchronized:e.quantityMustBeSynchronized,providerData:e.providerData||""}}function Js(e){switch(typeof e){case"undefined":return"";case"object":return null===e?"":JSON.stringify(e);case"string":return e;default:return String(e)}}function Zs(e){return F(Js,e)}function*Qs(e,t){const n=yield He(e,rt.expanding(10));for(;n;){const e=yield We(n);yield ze(t,e)}}function*Xs(e,t){const n=yield We(e);yield ze(t,n)}function*el(e){for(;;){const t=yield We(e);yield qe(t)}}function*tl(e,t){const n=fe(Ae("moduleName"),Ne("orchestrator"),t.payload.additionalInformation||{}),i=Object.assign(Object.assign({},t.payload),{additionalInformation:n?Zs(n):{}});try{yield ze(e,i)}catch(e){}t.payload.level===Vs&&(yield qe({type:sn,payload:{name:"PLACEMENT_FAILURE"}}),yield qe({type:xs.CLOSE_PLUGIN}))}const nl="INVALID_RESPONSE_OBJECT",il="FAILED_TO_OPEN_LINK",al="NO_PARENT_GUID",ol="FAILED_TO_NOTIFY_INTERACTIVE",rl="FAILED_TO_ESTABLISH_PARTNER_VALIDATION";var sl=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n};function ll(e,t){return n=>n&&n.replace(e,t)}const cl=ll(/['""();{}@:[\]!/=]/g,""),dl=/^(normal|italic|oblique( \d+deg)*)$/i,ul=(e="")=>dl.test(e)?e:void 0,pl=ll(/[;{}@[\]!]/g,"");function fl(e){const{fontFamily:t,sources:n}=e,i=sl(e,["fontFamily","sources"]),a=document.fonts,o=new FontFace(t,n.join(", "),i);return a.add(o),o.load().catch((e=>(a.delete(o),Promise.reject(e))))}function yl(e=[]){const t=Array.from(document.fonts.values());return Promise.all(e.map((e=>{const n=function(e){return{fontFamily:cl(e.fontFamily)||"",style:ul(e.style),weight:cl(e.weight),sources:e.sources.map((e=>pl(e)||"")),display:e.display}}(e);return t.find((e=>e.family===n.fontFamily&&e.weight===n.weight&&(e.style===n.style||!n.style)))?Promise.resolve():fl(n).then((()=>{})).catch((e=>`${e}`.includes("SyntaxError")?(n.fontFamily='"'+n.fontFamily+'"',fl(n).then((()=>{}))):Promise.reject(e))).catch((e=>Promise.resolve(`Error loading font: [Font (${JSON.stringify(n)})] [Message - ${e}]`)))}))).then((e=>{const t=e.filter(Boolean);return t.length>0?Promise.reject(t):Promise.resolve()}))}function ml(e){const t=y(),n=m((e=>{const t=e.fonts.map((e=>({fontFamily:e.fontFamily,style:e.fontStyle||"normal",weight:e.fontWeight,sources:e.src}))),n=t.find((e=>"rokt-icons"===e.fontFamily));if(n)n.display="block";else{const e=null!==(i=qs.ROKT_DOMAIN)&&void 0!==i?i:"";t.push(function(e=""){return{fontFamily:"rokt-icons",weight:"400",sources:[`url("${e}/icons/rokt-icons.woff") format("woff")`],display:"block"}}(e))}var i;return JSON.stringify(t)}));return o((()=>{yl(JSON.parse(n)).catch((e=>{const n={type:Ss,payload:{level:zs,code:"FAILED_TO_LOAD_FONT",message:`Error loading fonts:\n\t${e.join("\n\t")}`}};t(n)}))}),[n]),o((()=>{const e=()=>{var e,t;null===(t=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===t||t.resize()};return document.fonts.addEventListener("loadingdone",e),()=>{document.fonts.removeEventListener("loadingdone",e)}}),[]),null}function hl(e){return null!=e?e:null}function vl(){return new Set([Os])}function gl(e){return e.breakpoint.breakpoints[e.breakpoint.activeBreakpoint]||0}const bl=G(U(1)),Il=F(U(0)),El=e=>P($(j(e)),Il,bl,M,B({},["breakpoint","breakpoints"]));function Sl(e){return El(e.breakpoint.activeBreakpoint)(e)}function Cl(e,t){return e.customStates[`module${t}`]||{}}function wl(e){return`${e.name}:${e.parentGuid}`}function Tl(e,t){return!e.processed.includes(wl(t))||(n=t.name,void 0!==kt.find((e=>e===n)));var n}function xl(){return new Map}const Ol={layout:function(e=hl(),t){return t.type===us?t.payload:e},breakpoint:function(e={breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},t){var n;switch(t.type){case ss:return Object.prototype.hasOwnProperty.call(e.breakpoints,t.payload.activeBreakpoint)?Object.assign(Object.assign({},e),{activeBreakpoint:t.payload.activeBreakpoint}):e;case ls:return{activeBreakpoint:null!==(n=t.payload.activeBreakpoint)&&void 0!==n?n:"default",breakpoints:Object.assign({default:0},t.payload.breakpoints),initialised:!0};default:return e}},active:function(e=vl(),t){var n,i;switch(t.type){case os:{const i=new Set(e);return i.add(null===(n=t.payload)||void 0===n?void 0:n.id),i}case rs:{const n=new Set(e);return n.delete(null===(i=t.payload)||void 0===i?void 0:i.id),n}default:return e}},fonts:function(e=[],t){return t.type===ds?t.payload:e},signal:function(e={queue:[],processed:[]},t){switch(t.type){case gs:return he({queue:n=>Tl(e,t.payload.signal)?_e(X(U("signal"),wl),n.concat(t.payload)):n},e);case bs:return he({queue:e=>Le(X(U("signal"),Re({name:t.payload.name,parentGuid:t.payload.parentGuid})))(e),processed:ve(wl(t.payload))},e);default:return e}},serializableCache:function(e=xl(),t){switch(t.type){case ms:case hs:if(t.payload.key&&t.payload.value){return new Map([...e]).set(t.payload.key,t.payload.value)}return e;case vs:{const n=new Map([...e]);return t.payload&&n.delete(t.payload),n}default:return e}},settings:function(e={closeOnComplete:!0},t){return t.type===ys?x(((e,t)=>pe(t)?e:t),e,t.payload):e},customStates:function(e={root:{}},t){if(t.type===ws){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:"root";return b([n,t.payload.key],Number(t.payload.value),e)}return e}return e}};function*Al(e,t){var n,i;try{const a=(null===(n=e.activeBreakpointEventChannel)||void 0===n?void 0:n.call(e,t.payload))||(i=t.payload,st((e=>{const t=Object.entries(i).reduce(((e,t)=>{const i=window.matchMedia(`(min-width: ${t[1]}px)`);return"addEventListener"in i&&"function"==typeof i.addEventListener?(i.addEventListener("change",n),e[t[0]]=i):"addListener"in i&&"function"==typeof i.addListener&&(i.addListener(n),e[t[0]]=i),e}),{});return setTimeout((()=>n()),0),()=>{Object.entries(t).forEach((e=>{const t=e[1];"removeEventListener"in t&&"function"==typeof t.removeEventListener?t.removeEventListener("change",n):"removeListener"in t&&"function"==typeof t.removeListener&&t.removeListener(n)}))};function n(){try{e(function(e,t){return Object.entries(e).reduce(((e,n)=>n[1].matches&&(t[n[0]]||0)>(t[e]||0)?n[0]:e),"default")}(t,i))}catch(t){e(t)}}})));try{let e=yield We(a);for(yield qe({type:Ts.INITIALISE_BREAKPOINT,payload:{activeBreakpoint:e,breakpoints:t.payload}});;)e=yield We(a),yield qe({type:Ts.UPDATE_ACTIVE_BREAKPOINT,payload:{activeBreakpoint:e}})}catch(e){const n=e;yield qe({type:Ss,payload:{level:Hs,code:"FAILED_TO_DETERMINE_BREAKPOINT",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}finally{(yield Ke())&&a.close()}}catch(e){const n=e;yield qe({type:Ss,payload:{level:Vs,code:"FAILED_TO_ESTABLISH_BREAKPOINT_CHANNEL",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}}function Nl(e,t,n){return st((i=>{const a=e.subscribe((e=>{const t=n(e);t&&i({type:ps,payload:t})}),(e=>{i(e)})),o=t.fonts.subscribe((e=>{i({type:ds,payload:e})}),(e=>{i(e)}));return()=>{a.unsubscribe(),o.unsubscribe()}}),rt.sliding(2))}var Ll=Object.freeze({__proto__:null,CartEvent:{UPDATE_CART_ITEM_MESSAGE:"UPDATE_CART_ITEM_MESSAGE",UPSERT_ALERT:"UPSERT_ALERT",DELETE_ALERT:"DELETE_ALERT",UPSERT_DELIVERY_DETAILS:"UPSERT_DELIVERY_DETAILS"}}),Rl=Object.freeze({__proto__:null,PartnerMessage:{UpdateCartItem:"V2_UPDATE_CART_ITEM"},PlacementMessage:{CartItemUpdated:"V2_CART_ITEM_UPDATED"}}),_l=Object.freeze({__proto__:null,V1:Ll,V2:Rl}),Dl=Object.freeze({__proto__:null,PartnerMessage:{CartItemInstantPurchaseResponse:"CART_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{CartItemInstantPurchase:"CART_ITEM_INSTANT_PURCHASE"}}),kl=Object.freeze({__proto__:null,PartnerValidationEvent:{SET_PARTNER_VALIDATION_STATUS:"SET_PARTNER_VALIDATION_STATUS",OPT_IN_TO_PARTNER_VALIDATION:"OPT_IN_TO_PARTNER_VALIDATION",SHOW_PARTNER_VALIDATION_STATUS:"SHOW_PARTNER_VALIDATION_STATUS"}});const Pl="LINK_NAVIGATION_REQUEST",$l="REALTIME_OFFER_FULFILLMENT_SUCCESS",jl="REALTIME_OFFER_FULFILLMENT_FAILURE";var Fl=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const Gl={newTab:"_blank",self:"_top",roktWebViewSDK:"roktWebViewSDK",inApp:"inApp",overrideLinkNavigation:"overrideLinkNavigation"};function Ml({url:e,urlBehavior:t,external:n},i=window){return Fl(this,void 0,void 0,(function*(){if(!e)return null;if("overrideLinkNavigation"===t)return n.partner.send(Pl,{url:e}).then((()=>null));const a=Gl[t];if(i.RoktWebViewSDK){const t=i.RoktWebViewSDK.open(e);return t?{ref:t}:null}if("_top"===a&&i.top)return i.top.location.href=e,null;const o=i.open(e,a);if(o)try{o.opener=null}catch(e){}return o?{ref:o}:null}))}var Bl=Object.freeze({__proto__:null,openLink:Ml});function Ul(e,t,n,i){const a=function(e){return"object"==typeof e&&null!=e&&"message"in e&&"string"==typeof e.message&&e.message.includes("timed out")}(e),o=a?{originErrorCode:n}:void 0;return{type:Ss,payload:{level:Hs,code:a?"COMMUNICATION_FAILURE_WITH_WSDK":n,message:t,additionalInformation:Object.assign(Object.assign({},o),i)}}}var Vl=Object.freeze({__proto__:null,makePluginWarningAction:Ul});function zl(e){return null!=e&&"object"==typeof e&&"ref"in e&&"object"==typeof e.ref&&!Array.isArray(e.ref)&&null!=e.ref}var Hl=Object.freeze({__proto__:null,isWindow:zl}),Wl=Object.assign(Object.assign(Object.assign({},Bl),Vl),Hl);function ql(e){switch(e){case"ATTACHED":return Us;case"EMBEDDED":return Bs;default:return Ms}}function Kl(e,t){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e.offsetBottom&&{bottom:ai(e.offsetBottom)}),e.offsetLeft&&{left:ai(e.offsetLeft)}),e.offsetRight&&{right:ai(e.offsetRight)}),e.offsetTop&&{top:ai(e.offsetTop)}),(e.offsetAnchorX||e.offsetAnchorY)&&{transform:`translate(${"center"===e.offsetAnchorX?e.offsetLeft?"-50%":"50%":"0"}, ${"center"===e.offsetAnchorY?e.offsetTop?"-50%":"50%":"0"})`}),e.maxWidth?{maxWidth:ai(e.maxWidth)}:void 0),e.zIndex?{zIndex:e.zIndex}:void 0),t)}function*Yl(e=10){(yield Ye((e=>e.signal.queue.length>0)))&&(yield mt(30),e>=1&&(yield*Yl(e-1)))}function*Jl(e){try{yield*Yl(10),yield pt(e.close)}catch(e){const t=Wl.makePluginWarningAction(e,"Failed to close the plugin","FAILED_TO_CLOSE_PLUGIN");yield ft(t)}}function*Zl(e,{payload:t}){var n;if("string"==typeof(n=t.name)&&Ft.includes(n))switch(t.name){case"V2_CART_ITEM_UPDATED":case"CART_ITEM_INSTANT_PURCHASE":case"UPSELL_CREATIVE_SENT":case"INITIATE_INSTANT_PURCHASE_EVENT":case"INITIATE_CART_ITEM_EVENT":case"REALTIME_OFFER_FULFILLMENT_REFERRAL":case"REALTIME_OFFER_FULFILLMENT_CONVERSION":case"REALTIME_OFFER_FULFILLMENT_SUCCESS":yield e.send(t.name,t.body);break;case"OFFER_ENGAGEMENT":case"PLACEMENT_CLOSED":case"PLACEMENT_COMPLETED":case"PLACEMENT_FAILURE":case"PLACEMENT_INTERACTIVE":case"POSITIVE_ENGAGEMENT":yield e.send(t.name);break;default:return}}const Ql=H("FAILED_TO_PARSE_CONFIG","code");function*Xl(e,t){var n;const i=yield pt(Nl,e.configService,e.themeService,t);for(;;)try{const e=yield yt(i);yield ft(e)}catch(e){const t=e;yield ft({type:Ss,payload:{level:Vs,code:Ql(t),message:null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"An error occured parsing or receiving Plugin config, fonts or configurables.",additionalInformation:{stack:null==t?void 0:t.stack}}})}}function*ec(e,t){yield ct([dt(Xl,e,t),ut(sn,Zl,e.partnerInteractionService)])}function*tc(e,t,n){const i=function(e,t){if(!t)return{preset:ql(e)};switch(e){case"ATTACHED":return{autoresize:!0,applyHighestZIndex:!0,replaceTargetElement:"body",outerCss:Kl(t,{position:"fixed",width:"100%",minWidth:"1px"}),innerCss:{width:"100%"}};case"EMBEDDED":return{autoresize:!0,css:Kl(t,{width:"1px",minWidth:"100%"})};default:return{autoresize:!1,applyHighestZIndex:!0,replaceTargetElement:"body",css:Kl(t,{position:"fixed",height:"100%",width:"100%"})}}}(t,n);yield pt(e.setDisplaySettings,i),yield ft({type:Ts.ACTIVE_ADD,payload:{id:As}})}function*nc(e,t){var n;const i=null!==(n=t.payload.data)&&void 0!==n?n:{};try{yield ze(e,{code:t.payload.code,level:zs,message:t.payload.message||"Plugin Generic Log",additionalInformation:Zs(i)})}catch(e){}}function*ic(e){yield qe({type:Ts.QUEUE_SIGNAL,payload:{signal:e.payload}}),yield qe({type:Is})}function*ac(e){yield qe({type:Ts.QUEUE_SIGNAL,payload:e.payload}),yield qe({type:Is})}function*oc(e,t){const n=yield Ye((e=>e.signal.queue.filter((t=>Tl(e.signal,t.signal)))));if(Array.isArray(n)&&n.length)for(const e of n){const t="criteria"in e?e.criteria:void 0;switch(e.signal.name){case"SignalActivation":case"SignalLoadComplete":case"SignalImpression":yield*rc(e.signal,i(t));break;case"SignalViewed":yield*sc(e.signal,i(t));break;case"SignalDismissal":yield*lc(e.signal,i(t));break;case"SignalInstantPurchaseDismissal":yield*cc(e.signal,i(t));break;case"SignalLoadStart":yield*dc(e.signal,i(t));break;case"SignalGatedResponse":case"SignalResponse":yield*uc(e.signal,i(t,!0));break;case"SignalProductItemResponse":yield*pc(e.signal,i(t));break;case"SignalUserInteraction":yield*fc(e.signal,i(t));break;case"SignalCartItemQuantitySelected":yield*yc(e.signal,i(t));break;case"SignalCartItemInstantPurchaseInitiated":yield*mc(e.signal,i(t));break;case"SignalCartItemInstantPurchase":yield*hc(e.signal,i(t));break;case"SignalCartItemInstantPurchaseFailure":yield*vc(e.signal,i(t))}yield qe({type:Ts.SIGNAL_PROCESSED,payload:e.signal})}function i(t,n=!1){return function(i,a,o){return t?ze(e.prepareExternalSignal,t.key,i,a,o):ze(n?e.issueSignalSync:e.issueSignal,i,a,o)}}}function*rc(e,t){let n;e.creativeInstanceGuid&&(n={},n.creativeInstanceGuid=e.creativeInstanceGuid);try{yield t(e.name,e.parentGuid,n)}catch(t){yield gc(e,t)}}function*sc(e,t){try{yield t(e.name,e.parentGuid,{objectData:{supportedByBrowser:e.supportedByBrowser.toString()},metadata:[{name:"inferred",value:e.inferred.toString()}]})}catch(t){yield gc(e,t)}}function*lc(e,t){try{yield t(e.name,e.parentGuid,e.dismissalMethod?{objectData:{dismissalMethod:e.dismissalMethod}}:void 0)}catch(t){yield gc(e,t)}}function*cc(e,t){try{yield t(e.name,e.parentGuid,void 0)}catch(t){yield gc(e,t)}}function*dc(e,t){var n;const i={overrideTimestamp:null!==(n=e.overrideTimestamp)&&void 0!==n?n:new Date};try{yield t(e.name,e.parentGuid,i)}catch(t){yield gc(e,t)}}function*uc(e,t){try{yield t(e.name,e.parentGuid,function(e){const t={creativeInstanceGuid:e.responseActionPayload.creativeInstanceGuid};"Url"===e.responseActionPayload.name&&(t.transformedTrafficURL=e.responseActionPayload.transformedTrafficURL);return t}(e))}catch(t){yield gc(e,t)}}function*pc(e,t){try{yield t(e.name,e.parentGuid,{objectData:{catalogItemId:e.objectData.catalogItemId,productSku:e.objectData.productSku,catalogId:e.objectData.catalogId,accountId:e.objectData.accountId}})}catch(t){yield gc(e,t)}}function*fc(e,t){const n=e.parentGuid?e.parentGuid:yield Ye((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));try{if(!n||"string"!=typeof n)throw new Error(`Cannot raise SignalUserInteraction, missing or invalid parent GUID: ${JSON.stringify(e)}`);yield t(e.name,n,{objectData:{action:e.action,context:e.context}})}catch(t){yield gc(e,t)}}function*yc(e,t){const n={objectData:{preselected:e.objectData.preselected.toString(),quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield gc(e,t)}}function*mc(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield gc(e,t)}}function*hc(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),initiatedBy:e.objectData.initiatedBy}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield gc(e,t)}}function*vc(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),failureReason:e.objectData.failureReason,providerId:e.objectData.providerId}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield gc(e,t)}}function gc(e,t){const n=Wl.makePluginWarningAction(t,(null==t?void 0:t.message)||"Failed to issue signal","FAILED_TO_ISSUE_SIGNAL",{signalName:null==e?void 0:e.name,parentGuid:null==e?void 0:e.parentGuid,stack:null==t?void 0:t.stack});return qe(n)}function*bc(e){yield qe({type:ws,payload:e.payload})}function*Ic(e,t){if("Interactive"===t.payload.name)try{yield*function*(e){const t="METRIC";(yield Ye((e=>e.serializableCache.has(t))))||(yield ze(e.notifyInteractive),yield qe({type:ms,payload:{key:t,value:"Interactive"}}))}(e)}catch(e){const t=e;yield*function*(e){var t;yield qe({type:Ss,payload:{level:zs,code:ol,message:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:"Failed to notify interactive",additionalInformation:{stack:null==e?void 0:e.stack}}})}(t)}}function*Ec(e,t){const n=e.context.getOverrideLinkNavigation()?"overrideLinkNavigation":t.payload.urlBehaviour;try{"inApp"===n?yield ze(e.createChildPlugin,{name:"url-modal",config:{url:t.payload.url,method:"GET"}}):yield ze(Ml,{url:t.payload.url,urlBehavior:n,external:e})}catch(e){yield qe(Ul(e,"Failed to open link",il,{url:t.payload.url,urlBehaviour:n}))}}function*Sc(e){const t=yield Ye((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:Ts.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:fs}),t?yield qe({type:an,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}):yield qe({type:Ss,payload:{level:zs,code:al,message:"ParentGuid does not exist"}})}const Cc=h((function(e){return{isOpen:e.active.has(Os)}})),wc="undefined"!=typeof window;function Tc(e,t){o((()=>{if(!wc||t)return;const n=e.current;if(!n)return;const i=e=>{e.preventDefault()},a=["wheel","touchmove"];a.forEach((e=>{n.addEventListener(e,i,{passive:!1})}));const o=e=>{["ArrowUp","ArrowDown","PageUp","PageDown","Space"].includes(e.code)&&e.preventDefault()};return window.addEventListener("keydown",o),()=>{a.forEach((e=>{n.removeEventListener(e,i)})),window.removeEventListener("keydown",o)}}),[e,t])}const xc="Minimized",Oc="Maximized",Ac=e=>{const t=r(null),n=r(null),i=r(null),a=r(null),s=r(null),l=r(0),c=r(0),d=r(!e),p=r(!1),f=e?Oc:xc,y=Ri(0,(e=>f?e.customStates[f]:0)),m=e?y?0:1:y,h=Ni(),v=Ma(),g=r(0),b=r(!1),I=r(0),E=r([]),S=r(void 0),{isDisabled:C}=St(v);Tc(t,!!m);const w=e=>{if(d.current)(()=>{const e=t.current,o=n.current,r=i.current,s=a.current;e&&o&&r&&s&&0!==s.clientHeight&&(G(s.clientHeight),requestAnimationFrame((()=>{M(!0,800),G(0),d.current=!1})))})();else if(M(!!e),m){const e=(c.current||0)-(l.current||0);G(e);const n=t.current;if(n){const e=(l.current||0)+1;n.style.height=e+"px"}}else G(0),t.current&&(t.current.style.height="100000px")},T=({key:e,value:t})=>({type:rn,payload:{key:e,value:t}}),x=()=>{const e=F();return m?e<=-.2:e>=.2},O=u((()=>{V(),S.current=void 0,b.current=!1,M(!0);x()?R():G(0)}),[x]);o((()=>{if(!p.current)return U(!m,i),U(!!m,a),void requestAnimationFrame((()=>{B(),p.current=!0}));m?(D(),h(Lc(!0))):(k(),h(Lc(!1)))}),[m,h]),o((()=>{const e=function(e,t){let n;return()=>{n&&clearTimeout(n),n=setTimeout((()=>{t(),n=void 0}),e)}}(100,(()=>{var e,t,n,o;l.current=null!==(t=null===(e=i.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,c.current=null!==(o=null===(n=a.current)||void 0===n?void 0:n.clientHeight)&&void 0!==o?o:0,w(d.current)})),t=new ResizeObserver(e),n=i.current,o=a.current;return n&&t.observe(n),o&&t.observe(o),()=>{t.disconnect()}}),[w]);const A=u((e=>{if(n.current){e.preventDefault();const t=L(e);G(t)}}),[n]),N=u((e=>{Date.now()-I.current<200||(I.current=Date.now(),m?_(!1):b.current||C||(b.current=!0,j(),S.current=Nc(e),M(!1),z()))}),[m,C]);o((()=>{const e=n.current;return e&&(e.addEventListener("mousedown",N),e.addEventListener("touchstart",N)),()=>{null==e||e.removeEventListener("mousedown",N),null==e||e.removeEventListener("touchstart",N)}}),[n,N]);const L=e=>{var t,n;return(null!==(t=Nc(e))&&void 0!==t?t:0)-(null!==(n=S.current)&&void 0!==n?n:0)},R=()=>{_(!m)},_=e=>{[T({key:xc,value:e?1:0}),T({key:Oc,value:e?0:1})].forEach((e=>{e&&h(e)}))},D=()=>{var e,t,n,o;if(d.current)return;const r=null!==(t=null===(e=i.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,s=(null!==(o=null===(n=a.current)||void 0===n?void 0:n.clientHeight)&&void 0!==o?o:0)-r;M(!0),B(!0,!0),G(s),U(!1,i),U(!0,a),H()},k=()=>{d.current||(M(!0),B(!0,!1),G(0),S.current=void 0,U(!0,i),U(!1,a),W())},P=u((()=>{b.current&&($(),requestAnimationFrame(P))}),[]),$=()=>{E.current.push({yPosition:g.current,timestamp:Date.now()}),E.current.length>20&&E.current.shift()},j=u((()=>{E.current=[],P()}),[P]),F=()=>{const e=E.current;if(!e)return 0;const t=e[0],n=e[e.length-1];if(!t||!n)return 0;const i=n.timestamp-t.timestamp;return(n.yPosition-t.yPosition)/i},G=e=>{const t=Math.round(e);g.current=t,n.current&&(n.current.style.transform=`translateY(${t}px)`)},M=(e,t=200)=>{e?n.current&&(n.current.style.transition=`transform ${t}ms`):n.current&&(n.current.style.transition="")},B=(e,t=!1)=>{const n=t?a:i,o=t?i:a;o.current&&(o.current.style.transition="opacity .5s"),n.current&&(n.current.style.transition="opacity .2s")},U=(e,t)=>{const n=t.current;if(!n)return;const i=e?0:1;n.style.opacity=`${i}`,e?n.style.pointerEvents="none":setTimeout((()=>{n.style.pointerEvents="auto"}),400)},V=u((()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",O),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",O)}),[A,O]),z=u((()=>{wt()?(document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",O)):(document.addEventListener("mousemove",A,{passive:!1}),document.addEventListener("mouseup",O))}),[A,O]),H=()=>{const e=t.current;e&&(s.current=setTimeout((()=>{var t;const n=((null===(t=i.current)||void 0===t?void 0:t.clientHeight)||0)+1;e.style.height=n+"px"}),200))},W=()=>{s.current&&clearTimeout(s.current),t.current&&(t.current.style.height="100000px")};return{wrapperRef:t,containerRef:n,minimizedChildRef:i,maximizedChildRef:a}};function Nc(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}const Lc=e=>({type:an,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}});const Rc={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var _c;function Dc({schema:t,testId:n}){var i;const a=En(),s=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),l=m((e=>e.active.has(As))),c=r(null),d=y(),u=()=>{d({type:xs.DISMISS_OVERLAY,payload:{id:Os,dismissalMethod:"rokt_backdrop"}})},p=null!==(i=t.startMinimized)&&void 0!==i&&i,f=p?Oc:xc,h=Ri(0,(e=>f?e.customStates[f]:0)),v=p?h?0:1:h;o((()=>{g(!!v)}),[v]),Tc(c,!!v);const g=e=>{const t=c.current;t&&(e?t.style.opacity="0":(t.style.display="flex",t.style.opacity="1"))};o((()=>{s&&d({type:an,payload:{name:"SignalActivation",parentGuid:s}})}),[s]),o((()=>{l&&requestAnimationFrame((()=>{var e;return null===(e=a.current)||void 0===e?void 0:e.focus()}))}),[l]);const b=Ma(),{tabIndex:I,isDisabled:E,styles:S}=St(b),C=t.styles?Oe(Rc,t.styles):Rc;return e(Uo,{styles:C,children:({classnames:i})=>{var a;return e("div",{className:null==i?void 0:i.wrapper,style:Object.assign({height:"100%",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9998",overflow:"hidden",display:"flex",opacity:p?"0":"1",transition:"opacity 0.2s ease-in-out"},S),"aria-label":null!==(a=t.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":E,role:"dialog","aria-modal":!0,tabIndex:I,"data-testid":n,"data-e2e":"Overlay-Wrapper",ref:c,children:e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:t.allowBackdropToClose?u:void 0,"data-testid":n&&`${n}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function kc(){return e("div",{style:{width:"48px",height:"4px",backgroundColor:"#C6C6C8",borderRadius:"2px",margin:"0 auto -4px",position:"relative",top:"6px"}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(_c||(_c={}));const Pc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};function $c(t){const n=m((e=>e.slots)),i=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return e(jc,Object.assign({},t,{slots:n,currentIndex:i}))}function jc(n){var i;const a=null!==(i=n.schema.startMinimized)&&void 0!==i&&i,{wrapperRef:o,containerRef:r,minimizedChildRef:s,maximizedChildRef:l}=Ac(a);return n.isOpen?t("div",{ref:o,style:{height:"100000px"},children:[e(Dc,Object.assign({},n)),e(Gc,Object.assign({},n,{startMinimized:a,containerRef:r,minimizedChildRef:s,maximizedChildRef:l}))]}):null}const Fc=Be`
|
|
57
|
+
`}}(l,u),C=sa();if(!e.schema.customStateKey)throw new Error("No custom state key provided for state trigger node.");const w=C(e.schema.customStateKey),T={type:on,payload:{key:w,value:null!=f?f:1}},x={type:an,payload:{name:"SignalUserInteraction",action:"Swipe",context:"SlideStateTrigger"}},O=e.schema.styles?Wt(ho,e.schema.styles):ho,A=o(null),N=o(null),L=o(null),R=o(!1),_=o(void 0),{isDisabled:D}=St(d);r((()=>{if(t)return wt()?(document.addEventListener("touchmove",$),document.addEventListener("touchend",k)):(document.addEventListener("mousemove",$),document.addEventListener("mouseup",k)),B}),[t]);const k=()=>{B(),_.current=void 0,n(!1),i||(M(!0),R.current?(G(F()),j()):G(0))},P=e=>{t||i||D||(_.current=bo(e),M(!1),n(!0))},$=e=>{var t,n;if(go(L)){const i=Math.min(Math.max(0,(null!==(t=bo(e))&&void 0!==t?t:0)-(null!==(n=_.current)&&void 0!==n?n:0)),F());G(i),i/F()*100>=75?R.current=!0:R.current=!1}},j=()=>{var e,t;s(!0),p(T),p(x),null===(t=null===(e=go(A).parentElement)||void 0===e?void 0:e.parentElement)||void 0===t||t.focus()},F=()=>go(A).getBoundingClientRect().width-go(L).getBoundingClientRect().width,G=e=>{var t;go(L).style.transform=`translateX(${e}px)`,go(N).style.transform=`translateX(${e+(null===(t=go(L))||void 0===t?void 0:t.getBoundingClientRect().width)/2}px)`},M=e=>{e?(go(L).style.transition="transform .2s",go(N).style.transition="transform .2s"):(go(L).style.transition="",go(N).style.transition="")},B=()=>{document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",$),document.removeEventListener("touchend",k)};return a.createElement(Br,{styles:O},(({classnames:t})=>{var n,r,o,s,l,c;return a.createElement("div",{className:`${v}`,"data-testid":e.testId,"data-e2e":"SlideStateTrigger"},a.createElement("div",{className:`${g} ${null!==(n=null==t?void 0:t.own)&&void 0!==n?n:""}`,ref:A,"aria-hidden":!0,"data-testid":e.testId&&`${e.testId}-track`},(null==y?void 0:y.value)?a.createElement("div",{className:`${E} ${null!==(r=null==t?void 0:t.label)&&void 0!==r?r:""}`,"data-testid":e.testId&&`${e.testId}-label`},y.value):null,a.createElement("div",{className:`${b} ${null!==(o=null==t?void 0:t.fill)&&void 0!==o?o:""}`,ref:N,"data-testid":e.testId&&`${e.testId}-fill`}),a.createElement("div",{className:`${I} ${null!==(s=null==t?void 0:t.thumb)&&void 0!==s?s:""}`,ref:L,"data-testid":e.testId&&`${e.testId}-thumb`,"data-e2e":"SlideStateTrigger-thumb",onMouseDown:P,onTouchStart:P},null!==(l=null==h?void 0:h.icon)&&void 0!==l?l:"ArrowForward")),a.createElement("button",{className:S,"aria-label":null!=m?m:void 0,onClick:j,disabled:i||D,"data-testid":e.testId&&`${e.testId}-button`},null!==(c=null==y?void 0:y.value)&&void 0!==c?c:"Unlock Offers"))}))}function go(e){if(!e.current)throw new Error("Unexpected missing reference to required SlideStateTrigger Element");return e.current}function bo(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX}function Io(e){const t=ki();return a.createElement(Br,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row",flexWrap:"wrap"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))}))}function Eo(e){const t=Ma(),n=Ni(),i=sa()(e.schema.customStateKey),r=Ri(0,(e=>e.customStates[i])),{tabIndex:o,styles:s,isDisabled:l}=St(t),c=()=>{n({type:on,payload:{key:i,value:r?0:1}})};return a.createElement(Br,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:c,"data-testid":e.testId,"data-e2e":"ToggleButtonStateTrigger",disabled:l,"aria-disabled":l,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:o,style:Object.assign({cursor:"pointer"},s)},a.createElement(Di,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function So(e){const t=ki();return a.createElement(Br,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row",overflowX:"auto"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))}))}function Co(e){const t=ki();return a.createElement(Br,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"column",overflowY:"auto"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))}))}const wo=s({extensions:{ctx:new Map,cache:[]}}),To=()=>l(wo).extensions;function xo({extensions:e,extendStore:t,children:n}){const i=To(),r=new Map([...i.ctx,...e.ctx]),o=i.cache.concat(e.cache);return a.createElement(wo.Provider,{value:{extensions:{ctx:r,cache:o},extendStore:t}},n)}function Oo(e,t){const n=function(e){try{const t=JSON.parse(e);if(null!=t&&"object"==typeof t&&"type"in t&&"Extension"===t.type&&"name"in t&&"string"==typeof t.name&&t.name.trim().length>0&&"body"in t&&"object"==typeof t.body)return{type:"Extension",name:t.name,body:t.body}}catch(e){}return null}(t),i=n?e.ctx.get(n.name):null;return n&&i?[n,i]:null}function Ao({data:e}){const t=Oo(To(),e);var n;if((e=>{const{extendStore:t,extensions:n}=l(wo);r((()=>{e&&t&&!n.cache.includes(e.name)&&(t(e),n.cache.push(e.name))}),[e,n.cache,t])})((n=null==t?void 0:t[1])?{sagas:n.sagas,reducer:n.reducer,name:n.name,interceptors:n.interceptors}:void 0),t){const[e,n]=t;return n.componentFactory(e.body)}return null}function No(e,t){if(Ct("Extension",e))return a.createElement(Ao,{data:e.node.data})}function Lo(e){const t=qa(),n=Mi(),i=sa(),o=ki(),s=Ni(),l=d((()=>n.catalogItems||[]),[n]),c=(e,t)=>i({data:Object.assign(Object.assign({},e),{positionIndex:t})},"catalogItem");return r((()=>{for(const e of l)s({type:an,payload:{name:"SignalImpression",parentGuid:e.instanceGuid}})}),[l,s]),l.length>0?a.createElement(Br,{styles:e.schema.styles},(({classnames:n})=>a.createElement("div",{"data-testid":e.testId,"data-e2e":"CatalogStackedCollection",className:null==n?void 0:n.own,style:{display:"flex",flexDirection:"column"}},a.Children.toArray(l.map(((n,i)=>a.createElement(Za,{context:n},a.createElement(Ha,{value:t(n)},a.createElement(oa,{value:c(n,i)},o(e.schema.template,void 0,Kt(i,e.testId))))))))))):null}const Ro={BasicText:(e,t)=>Qr(e,t,!0),StaticLink:(e,t)=>uo(e,t,!0)};function _o(e){const t=ki();return a.createElement(Pi,{value:t,overrides:Ro},a.createElement(Di,null,(t=>a.createElement(Br,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:null==n?void 0:n.own,"data-testid":e.testId,"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Kt(i,e.testId))))))})))))}function Do(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Kt(i,n)))))}function ko(e){const t=Ma(),n=Ni(),i=ki(),r=sa(),{event:o}=e.schema,{tabIndex:s,styles:l,isDisabled:c}=St(t),d=K((e=>r(e)),o.data||{}),u=()=>{n({type:sn,payload:{name:o.type,body:{offerId:d.providerOfferId,title:d.title,description:d.description}}})};return a.createElement(Br,{styles:e.schema.styles},(({classnames:t,mapperRef:n})=>{var o;return a.createElement("button",{"aria-disabled":c,"aria-label":null!==(o=e.schema.a11yLabel)&&void 0!==o?o:void 0,className:null==t?void 0:t.own,"data-e2e":"PartnerEventButtonTrigger","data-testid":e.testId,disabled:c,onClick:u,tabIndex:s,type:"button",style:Object.assign({cursor:"pointer"},l)},a.createElement(oa,{value:r},(null==t?void 0:t.own)?function(e,t,n,i,r){return a.createElement(ca,{value:n(t)},Do(e,i,r))}(e.schema.children,t.own,n,i,e.testId):Do(e.schema.children,i,e.testId)))}))}function Po(e){const t=Ni(),n=sa(),i=e.schema.delay?e.schema.delay:1,a=n(e.schema.customStateKey),s=Ri(0,(e=>e.customStates[a]));return function({delay:e,callback:t}){const n=o(null);r((()=>{n.current=setTimeout(t,e)}),[])}({delay:i,callback:()=>{t({type:on,payload:{key:a,value:s?0:1}})}}),null}function $o(e){const t=Ma(),n=sa(),i=n(e.schema.value),r=Ni(),o=n(e.schema.customStateKey),s=Ri(0,(e=>e.customStates[o])),{tabIndex:l,styles:c,isDisabled:d}=St(t),u=()=>{navigator.clipboard.writeText(i),s||(r({type:on,payload:{key:o,value:1}}),r({type:an,payload:{name:"SignalUserInteraction",action:"Click",context:"CopyToClipboardButton"}}))};return a.createElement(Br,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:u,"data-testid":e.testId,"data-e2e":"CopyToClipboardButton",disabled:d,"aria-disabled":d,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:l,style:Object.assign({cursor:"pointer"},c)},a.createElement(Di,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function jo(e){const t=Ma(),n=Ni(),i=sa()(e.schema.customStateKey),{value:r}=e.schema,{tabIndex:o,styles:s,isDisabled:l}=St(t),c=()=>{n({type:on,payload:{key:i,value:r}})};return a.createElement(Br,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:c,"data-testid":e.testId,"data-e2e":"ButtonStateTrigger",disabled:l,"aria-disabled":l,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:o,style:Object.assign({backgroundColor:"transparent",cursor:"pointer",margin:0,padding:0},s)},a.createElement(Di,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function Fo({schema:e,testId:t}){var n,i,o,s,l,c,u,p;const f=qa(),y=Mi(),m=ki(),h=Ni(),v=d((()=>y.catalogItems||[]),[y]),g=sa(),b=(e,t)=>g({data:Object.assign(Object.assign({},e),{positionIndex:t})},"catalogItem"),I=Ri(0,(e=>{return(t=e.breakpoint.activeBreakpoint,P($(j(t)),wn,Cn,M,B({},["breakpoint","breakpoints"])))({breakpoint:Object.assign(Object.assign({},e.breakpoint),{initialised:!0})});var t})),E=Ma(),{tabIndex:S,isDisabled:C,styles:w}=St(E),T=e.viewableItems.length-1,[x]=ht({slidesToScroll:null!==(n=e.viewableItems[Math.min(I,T)])&&void 0!==n?n:"auto",containScroll:"trimSnaps"});r((()=>{for(const e of v)h({type:an,payload:{name:"SignalImpression",parentGuid:e.instanceGuid}})}),[v,h]);const O=`${null!==(u=null===(c=null===(l=null===(s=null===(o=null===(i=e.styles)||void 0===i?void 0:i.elements)||void 0===o?void 0:o.own[I])||void 0===s?void 0:s.default)||void 0===l?void 0:l.container)||void 0===c?void 0:c.gap)&&void 0!==u?u:"0"}px`,A={overflow:"hidden"},N={backfaceVisibility:"hidden",display:"flex",touchAction:"pan-y",gap:O,alignItems:"stretch"},L=e.peekThroughSize[Math.min(I,e.peekThroughSize.length-1)],R=L?"fixed"===(_=L).type?`${_.value}px`:`${_.value}%`:"0px";var _;const D=null!==(p=e.viewableItems[Math.min(T,I)])&&void 0!==p?p:1,k={flex:`0 0 calc(${(e=>"0px"!==e&&"0%"!==e)(R)?`(100% - 2 * ${R} - (${D} + 1) * ${O})/${D}`:`(100% - (${D} - 1) * ${O})/${D}`})`,position:"relative",display:"flex",backgroundColor:"transparent"};return v.length>0?a.createElement(Br,{styles:e.styles},(({classnames:n})=>a.createElement("div",{ref:x,style:Object.assign(Object.assign({},A),w),"aria-disabled":C,tabIndex:S,className:null==n?void 0:n.own,"data-e2e":"CarouselDistribution","data-testid":t&&`${t}`},a.createElement("div",{style:N,"data-testid":t&&`${t}-container`,"data-e2e":"CarouselDistribution-Container"},a.Children.toArray(v.map(((n,i)=>a.createElement(Za,{context:n},a.createElement(Ha,{value:f(n)},a.createElement(oa,{value:b(n,i)},a.createElement("div",{style:k,"data-testid":t&&`${t}-slide-${i}`,"data-e2e":`CarouselDistribution-Slide-${i}`},m(e.template,void 0,Kt(i,t))))))))))))):null}function Go(e){var t;const n=null!==(t=e.activeIndicatorMode)&&void 0!==t?t:"timer",i={elements:{own:[],pseudoActiveIndicator:e.activeIndicatorStyles?e.activeIndicatorStyles.map((e=>({default:e.default?Te(["background"],e.default):{}}))):[],pseudoActiveIndicatorContents:e.activeIndicatorStyles?e.activeIndicatorStyles.map((e=>({default:e.default?Te(["spacing","container"],e.default):{}}))):[]}};return a.createElement(Br,{styles:i},(({classnames:t})=>{var i;return a.createElement("div",{style:{display:"flex",flexDirection:"row",position:"absolute",zIndex:2},className:null===(i=e.indicatorClasses)||void 0===i?void 0:i.progressIndicatorContainer,"data-testid":e.testId},Array.from({length:e.count},((i,r)=>{var o,s,l,c;return a.createElement("span",{key:r,className:[null===(o=e.indicatorClasses)||void 0===o?void 0:o.indicator,r<e.activeIndex?null===(s=e.indicatorClasses)||void 0===s?void 0:s.seenIndicator:void 0,r===e.activeIndex&&"timer"!==n?null===(l=e.indicatorClasses)||void 0===l?void 0:l.activeIndicator:void 0,r===e.activeIndex&&"timer"===n&&(null==t?void 0:t.pseudoActiveIndicator)?t.pseudoActiveIndicator:void 0].filter(Boolean).join(" "),style:{display:"block",transition:"all 100ms linear"},"data-testid":e.testId&&`${e.testId}-indicator-${r}`},"timer"===n&&a.createElement("span",{className:[null===(c=e.indicatorClasses)||void 0===c?void 0:c.indicator,r===e.activeIndex&&(null==t?void 0:t.pseudoActiveIndicatorContents)?t.pseudoActiveIndicatorContents:void 0].filter(Boolean).join(" "),style:{display:"block",padding:0,margin:0,maxWidth:"100%",maxHeight:"100%",border:"none",transform:`translateX(${r===e.activeIndex?"0%":"-100%"})`,transition:r===e.activeIndex?`transform ${e.transitionDuration}ms linear`:""}}))})))}))}const Mo={elements:{own:[{default:{container:{alignItems:"flex-end",justifyContent:"center"}}}],progressIndicatorContainer:[{default:{dimension:{width:{type:"percentage",value:100}},spacing:{offset:"0 -10"},container:{gap:2,alignItems:"center",justifyContent:"center"}}}],indicator:[{default:{dimension:{height:{type:"fixed",value:2},maxWidth:75},container:{overflow:"hidden"},background:{backgroundColor:{light:"#66FFFFFF"}}}}],activeIndicator:[{default:{background:{backgroundColor:{light:"#FFFFFF"}}}}]}},Bo={overflow:"hidden",position:"relative",display:"flex"},Uo={backfaceVisibility:"hidden",display:"flex",alignItems:"stretch",minWidth:"100%"},Vo={display:"inline-block",minWidth:"100%",maxWidth:"100%",height:"auto"};function zo(e){return null!=e&&"object"==typeof e&&"light"in e&&"string"==typeof e.light}function Ho(e,t){if("slide"===t)switch(e){case"fast":return 20;case"slow":return 60;default:return 30}switch(e){case"fast":return 20;case"slow":return 80;default:return 45}}function Wo(e){var t;const n=Ma(),{tabIndex:i,isDisabled:o,styles:s}=St(n),[l,u]=function(e,t){return d((()=>{var n,i,a,r;const o=bt({delay:null!==(n=e.duration)&&void 0!==n?n:3e3,playOnInit:"ENABLED"===t}),s={active:"ENABLED"===t,loop:!0,watchDrag:!1};return"SlideInOut"===(null===(i=e.transition)||void 0===i?void 0:i.type)?[Object.assign(Object.assign({},s),{duration:Ho(null===(a=e.transition)||void 0===a?void 0:a.settings.speed,"slide"),slidesToScroll:1,containScroll:"trimSnaps"}),[o]]:[Object.assign(Object.assign({},s),{duration:Ho(null===(r=e.transition)||void 0===r?void 0:r.settings.speed,"fade"),containScroll:!1,align:"center"}),[o,It()]]}),[e,t])}(e.schema,n),[p,f]=ht(l,u),[y,m]=c(-1);r((()=>{let e;return f&&(f.on("autoplay:timerset",(()=>{e&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame((()=>{m(f.selectedScrollSnap()),e=void 0}))})),f.on("autoplay:timerstopped",(()=>{m(-1)})),f.emit("autoplay:timerset")),()=>{null==f||f.destroy()}}),[f]);const h=Wa(e.schema.imageKey),v=(g=e.schema.imageKey,[Wa(`${g}.1`),Wa(`${g}.2`),Wa(`${g}.3`),Wa(`${g}.4`)].filter(zo));var g;const b=e.schema.styles?Wt(Mo,null!==(t=e.schema.styles)&&void 0!==t?t:{}):Mo;return 0===v.length&&h&&v.push(h),v.length>0?a.createElement(Br,{styles:Et(b)},(({classnames:t})=>{var n,r,l,c,d,u,f;return a.createElement("div",{ref:p,style:Object.assign(Object.assign({},Bo),s),"aria-disabled":o,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:i,className:null==t?void 0:t.own,"data-e2e":"DataImageCarousel","data-testid":e.testId},a.createElement("div",{style:Uo,"data-testid":e.testId&&`${e.testId}-container`,"data-e2e":"DataImageCarousel-Container"},v.map(((t,n)=>a.createElement("img",{key:n,"aria-hidden":o,style:Object.assign(Object.assign({},s),Vo),alt:t.alt,title:t.title,"data-testid":e.testId&&`${e.testId}-image-${n}`,"data-e2e":"DataImageCarousel-Image",src:t.light})))),!1!==(null===(r=e.schema.indicators)||void 0===r?void 0:r.show)&&v.length>1&&a.createElement(Go,{indicatorClasses:null!=t?t:void 0,activeIndicatorStyles:null!==(d=null===(c=null===(l=e.schema.styles)||void 0===l?void 0:l.elements)||void 0===c?void 0:c.activeIndicator)&&void 0!==d?d:void 0,activeIndicatorMode:null===(u=e.schema.indicators)||void 0===u?void 0:u.activeIndicatorMode,activeIndex:y,count:v.length,transitionDuration:null!==(f=e.schema.duration)&&void 0!==f?f:3e3,testId:e.testId}))})):null}function qo(e){return()=>{throw new jt("FAILED_CREATING_UNHANDLED_NODE",`The default mapper does not handle the ${e} node. Make sure when you use the NodeMapperProvider, you pass an override for ${e} node.`)}}const Ko={Column:function(e,t){if("Column"===e.type)return a.createElement(Ur,{schema:e.node,testId:t})},Row:function(e,t){if("Row"===e.type)return a.createElement(Vr,{schema:e.node,testId:t})},StaticImage:function(e,t){if("StaticImage"===e.type)return a.createElement(to,{schema:e.node,testId:t})},DataImage:function(e,t){if("DataImage"===e.type)return a.createElement(no,{schema:e.node,testId:t})},DataImageCarousel:function(e,t){if("DataImageCarousel"===e.type)return a.createElement(Wo,{schema:e.node,testId:t})},CreativeResponse:function(e,t){if("CreativeResponse"===e.type)return a.createElement(eo,{schema:e.node,testId:t})},OneByOneDistribution:qo("OneByOneDistribution"),StackedDistribution:qo("StackedDistribution"),CarouselDistribution:qo("CarouselDistribution"),GroupedDistribution:qo("GroupedDistribution"),ProgressIndicator:qo("ProgressIndicator"),ProgressControl:qo("ProgressControl"),When:function(e,t){if("When"===e.type)return a.createElement(Gr,{schema:e.node,testId:t})},Overlay:qo("Overlay"),CloseButton:qo("CloseButton"),RichText:function(e,t){if("RichText"===e.type)return a.createElement(Jr,{schema:e.node,testId:t})},BasicText:Qr,StaticLink:uo,DataIcon:function(e,t){if("DataIcon"===e.type)return a.createElement(fo,{schema:e.node,testId:t})},StaticIcon:function(e,t){if("StaticIcon"===e.type)return a.createElement(ao,{schema:e.node,testId:t})},ZStack:function(e,t){if("ZStack"===e.type)return a.createElement(mo,{schema:e.node,testId:t})},FlowRow:function(e,t){if("FlowRow"===e.type)return a.createElement(Io,{schema:e.node,testId:t})},SlideStateTrigger:function(e,t){if("SlideStateTrigger"===e.type)return a.createElement(vo,{schema:e.node,testId:t})},ToggleButtonStateTrigger:function(e,t){if("ToggleButtonStateTrigger"===e.type)return a.createElement(Eo,{schema:e.node,testId:t})},PartnerEventButtonTrigger:function(e,t){if("PartnerEventButtonTrigger"===e.type)return a.createElement(ko,{schema:e.node,testId:t})},TimerStateTrigger:function(e,t){if("TimerStateTrigger"===e.type)return a.createElement(Po,{schema:e.node})},CatalogStackedCollection:function(e,t){if("CatalogStackedCollection"===e.type)return a.createElement(Lo,{schema:e.node,testId:t})},CatalogResponseButton:qo("CatalogResponseButton"),ScrollableRow:function(e,t){if("ScrollableRow"===e.type)return a.createElement(So,{schema:e.node,testId:t})},ScrollableColumn:function(e,t){if("ScrollableColumn"===e.type)return a.createElement(Co,{schema:e.node,testId:t})},EscapeHatch:No,BottomSheet:qo("BottomSheet"),CatalogQuantityOption:qo("CatalogQuantityOption"),CatalogRadioGroup:qo("CatalogRadioGroup"),CatalogQuantityCounter:qo("CatalogQuantityCounter"),InlineContainer:function(e,t){if("InlineContainer"===e.type)return a.createElement(_o,{schema:e.node,testId:t})},CopyToClipboardButton:function(e,t){if("CopyToClipboardButton"===e.type)return a.createElement($o,{schema:e.node,testId:t})},ButtonStateTrigger:function(e,t){if("ButtonStateTrigger"===e.type)return a.createElement(jo,{schema:e.node,testId:t})},CatalogCombinedCollection:qo("CatalogCombinedCollection"),CatalogCarouselCollection:function(e,t){if("CatalogCarouselCollection"===e.type)return a.createElement(Fo,{schema:e.node,testId:t})},IconGroup:qo("IconGroup")};function Yo(e){return function(t,n,i){const r=n&&n[t.type],o=null!=r?r:Ko[t.type];return a.createElement(oo,{schema:t,reporter:e},o&&o(t,i)||function(e){throw new jt("FAILED_CREATING_LAYOUT_NODE",`Failed to create layout node ${JSON.stringify(e)}`)}(t))}}const Jo={transformLinksToAnchorText:function(e={}){return{data:K((e=>zi(e)?`<a target="_blank" href="${e.url}">${e.title}</a>`:""),e)}}};function Zo(e){const{childLayouts:t}=e,n=Ni(),[i,a]=d((()=>{const e=xe(U("childLayoutId"),t);return[e,K((e=>e.childLayoutSchema.predicates),e)]}),[t]),o=Rr(a);r((()=>{Object.entries(o).forEach((([e,t])=>{const a=i[e];t&&a&&n({type:fn,payload:a})}))}),[o,i,n])}function Qo(e){const{settings:t,dispatch:n,children:i}=e,o=na(t.offerData.creative.copy||{})(Jo.transformLinksToAnchorText(t.offerData.creative.links),"creativeLink"),s=Yo(t.logger),[l,d]=c("ENABLED");return r((()=>t.gateway.onInteractivityChange(d)),[t]),In(t.rootElement,n),a.createElement(da.Provider,{value:"VARIANT"},a.createElement($i.Provider,{value:t.rootElement},a.createElement(Xa.Provider,{value:t.pluginId},a.createElement(Pa,{context:t.gateway},a.createElement(ja,{context:t.layoutSchema},a.createElement(tr.Provider,{value:t.schemaVersion},a.createElement(Gi,{context:t.offerData},a.createElement(Ha,{value:Ba(t.offerData.creative)},a.createElement(Ga.Provider,{value:l},a.createElement(Pi,{value:s},a.createElement(pa.Provider,{value:t.offerPositionIndex},a.createElement(Ai.Provider,{value:n},a.createElement(oa,{value:o},a.createElement(Xo,null,a.createElement(Zo,{childLayouts:t.childLayouts}),i))))))))))))))}function Xo(e){var t;const{children:n}=e,i=er(),o=function(){const[e,t]=c(null),n=l(ka).get();return r((()=>n.onGlobalStateChange((n=>{j(n,e)||t(n)}))),[n]),e}(),s=l($i)||void 0,d=fa(),p=u((e=>xi(e,i,d,s)),[s]);return o?a.createElement(ca,{value:p(Object.values(null!==(t=null==o?void 0:o.breakpoint.breakpoints)&&void 0!==t?t:{}))},a.createElement(Li.Provider,{value:o},n)):null}function es(e){return a.createElement("style",{"data-testid":e.testId},"\n* {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n}\nbody {\n margin: 0;\n font-family: sans-serif;\n}\np {\n margin: 0;\n}\nimg {\n max-width: 100%;\n}\n")}function ts(e,t,n,i,a,r){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){r.current.isRunning=!0,a&&"in"===t&&function(e,t){e.style.height=`${t.clientHeight}px`}(a,e);const o=e.animate(n,{duration:i,iterations:1});return o.onfinish=()=>{"in"===t?_r(e):Dr(e),r.current.isRunning=!1},o.oncancel=()=>{"in"===t?_r(e):Dr(e),r.current.isRunning=!1},()=>{o.finish()}}return"in"===t?_r(e):Dr(e),()=>{}}const ns={FadeInOut:{in:[{opacity:0,display:"none"},{opacity:0,display:"none",offset:.5},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],out:[{opacity:1},{opacity:0,offset:.75},{opacity:0}]}};function is({visible:e,effect:t,children:n,parentElement:i,containerClassName:s}){const[l,d]=c(e),u=o(null),p=o({isRunning:!1}),f=kr(t);return r((()=>{const t=new ResizeObserver((function(t){i&&e&&!p.current.isRunning&&requestAnimationFrame((()=>{t.forEach((e=>{e.contentBoxSize?function(e,t){var n;Array.isArray(e.contentBoxSize)&&e.contentBoxSize[0]?t.style.height=e.contentBoxSize[0].blockSize+"px":"object"==typeof(n=e.contentBoxSize)&&null!=n&&"blockSize"in n&&"number"==typeof n.blockSize&&"inlineSize"in n&&"number"==typeof n.inlineSize?t.style.height=e.contentBoxSize.blockSize+"px":t.style.height="auto"}(e,i):e.contentRect&&function(e,t){t.style.height=`${e.contentRect.height}px`}(e,i)}))}))}));return e&&u.current&&(_r(u.current),t.observe(u.current)),()=>{t.disconnect()}}),[e,i]),r((()=>e&&!l&&u.current&&i?(d(!0),ts(u.current,"in",ns[t.type].in,f,i,p)):!e&&l&&u.current&&i?(d(!1),ts(u.current,"out",ns[t.type].out,f/2,i,p)):()=>{}),[e,i,f]),a.createElement("div",{ref:u,style:{display:"none"},className:s},n)}function as(e){const t=ki();return a.createElement(Br,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:null==n?void 0:n.own,"data-testid":e.testId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},t(e.schema.template))}))}const rs="ACTIVE/ADD",os="ACTIVE/DELETE",ss="BREAKPOINT/UPDATE_ACTIVE",ls="BREAKPOINT/INITIALISE",cs="BREAKPOINT/SET_BREAKPOINTS",ds="FONTS/SET",us="LAYOUT/UPDATE",ps="CONFIG/HANDLE",fs="PLUGIN/CLOSE_PLUGIN",ys="SETTINGS/SET",ms="CACHE/ADD_SERIALIZED_VALUE",hs="CACHE/UPDATE_SERIALIZED_VALUE",vs="CACHE/CLEAR_SERIALIZED_VALUE",gs="SIGNAL/QUEUE",bs="SIGNAL/PROCESSED",Is="SIGNAL/PROCESS",Es="OVERLAY/DISMISS_OVERLAY",Ss="ERROR/REPORT",Cs="LOG",ws="CUSTOM_STATES/SET",Ts={LAYOUT_UPDATE:us,UPDATE_ACTIVE_BREAKPOINT:ss,INITIALISE_BREAKPOINT:ls,ACTIVE_ADD:rs,ACTIVE_DELETE:os,SET_FONTS:ds,QUEUE_SIGNAL:gs,SIGNAL_PROCESSED:bs,CACHE_SERIALIZED_VALUE:ms,UPDATE_CACHED_SERIALIZED_VALUE:hs,CLEAR_SERIALIZED_VALUE_FROM_CACHE:vs,SET_SETTINGS:ys,SET_CUSTOM_STATE:ws},xs={HANDLE_CONFIG:ps,SET_BREAKPOINTS:cs,CLOSE_PLUGIN:fs,RAISE_METRIC:Yt,PREPARE_SIGNAL:cn,DISMISS_OVERLAY:Es,REPORT_ERROR:Ss,LOG:Cs,OPEN_LINK:dn},Os="plugin-overlay",As="plugin";function Ns(t){var n;const i=t.schema.styles,r=y(),o={type:(null===(n=t.action)||void 0===n?void 0:n.type)||Es,payload:{id:Os,dismissalMethod:t.schema.dismissalMethod}},s=()=>{r(o)},l=Ma(),{tabIndex:c,styles:d,isDisabled:u}=St(l);return e(Br,{styles:i,children:({classnames:n})=>{var i;return e("button",{title:"Close",className:null==n?void 0:n.own,onClick:s,"data-testid":t.testId,"data-e2e":"CloseButton",disabled:u,tabIndex:c,"aria-disabled":u,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:void 0,style:Object.assign({cursor:"pointer"},d),children:e(Di,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}const Ls={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var Rs;function _s({isOpen:n,schema:i,testId:o,children:s}){const l=En(),c=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),d=m((e=>e.active.has(As))),u=y(),p=()=>{u({type:xs.DISMISS_OVERLAY,payload:{id:Os,dismissalMethod:"rokt_backdrop"}})};r((()=>{c&&u({type:an,payload:{name:"SignalActivation",parentGuid:c}})}),[c]),r((()=>{d&&requestAnimationFrame((()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()}))}),[d]);const f=Ma(),{tabIndex:h,isDisabled:v,styles:g}=St(f),b=i.styles?Oe(Ls,i.styles):Ls;if(!n)return null;const I=e(Di,{children:e=>a.Children.toArray(i.children.map(((t,n)=>e(t,void 0,o?`${o}-child${n}`:void 0))))});return e(Br,{styles:b,children:({classnames:n})=>{var a;return t("div",{className:null==n?void 0:n.wrapper,style:Object.assign({position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto"},g),"aria-label":null!==(a=i.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":v,role:"dialog","aria-modal":!0,tabIndex:h,"data-testid":o,"data-e2e":"Overlay-Wrapper",children:[e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:i.allowBackdropToClose?p:void 0,"data-testid":o&&`${o}-backdrop`,"data-e2e":"Overlay-Backdrop"}),s(I,l)]})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(Rs||(Rs={}));const Ds={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const ks=p((function({schema:t,testId:n,children:i},a){const r=t.styles?Oe(Ds,t.styles):Ds;return e(Br,{styles:r,children:({classnames:t})=>e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none"},ref:a,tabIndex:-1,"data-e2e":"Overlay-Container","data-testid":n&&`${n}-container`,children:i})})}));const Ps=h((function(e){return{isOpen:e.active.has(Os)}}))((function(t){return e(_s,Object.assign({},t,{children:(n,i)=>e(ks,Object.assign({},t,{ref:i,children:n}))}))}));const $s=h((function(e){return{isOpen:e.active.has(Os)}})),js={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const Fs=p((function({schema:t,testId:n,children:i},a){const s=o(null),l=t.styles?Oe(js,t.styles):js;return r((()=>{if(s.current)return function(e){const t=requestAnimationFrame((()=>{e&&e.style.setProperty("max-height","100%")}));return()=>{cancelAnimationFrame(t)}}(s.current)}),[]),e(Br,{styles:l,children:({classnames:t})=>e("div",{style:{width:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)",alignSelf:"flex-end"},ref:s,children:e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none",borderBottomLeftRadius:"0",borderBottomRightRadius:"0"},ref:a,tabIndex:-1,"data-testid":n&&`${n}-container`,"data-e2e":"BottomSheet-Container",children:i})})})}));const Gs=$s((function(t){const n=m((e=>e.breakpoint.activeBreakpoint));return e(_s,Object.assign({},t,{children:(i,a)=>e("default"===n?Fs:ks,Object.assign({},t,{ref:a,children:i}))}))}));const Ms="DisplayPreset.FULLSCREEN",Bs="DisplayPreset.EMBEDDED",Us="DisplayPreset.ATTACHED",Vs="ERROR",zs="INFO",Hs="WARNING";var Ws;!function(e){e.PAYPAL="Paypal"}(Ws||(Ws={}));const qs="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DCUI_SCHEMA_VERSION:"",ROKT_DOMAIN:""};function*Ks(e,t,n){(function(e){return"object"==typeof e&&null!==e&&"type"in e&&Object.values(vn).includes(e.type)})(n)&&!e.includes(n.type)&&(yield ze(t.globalDispatch.bind(t),n))}function Ys(e,t){return!e||t<1?null:{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,name:e.title,description:e.description,quantity:t,currency:e.currency||"$",unitPrice:e.price||0,totalPrice:(e.price||0)*t,linkedProductId:e.linkedProductId,quantityMustBeSynchronized:e.quantityMustBeSynchronized,providerData:e.providerData||""}}function Js(e){switch(typeof e){case"undefined":return"";case"object":return null===e?"":JSON.stringify(e);case"string":return e;default:return String(e)}}function Zs(e){return F(Js,e)}function*Qs(e,t){const n=yield He(e,ot.expanding(10));for(;n;){const e=yield We(n);yield ze(t,e)}}function*Xs(e,t){const n=yield We(e);yield ze(t,n)}function*el(e){for(;;){const t=yield We(e);yield qe(t)}}function*tl(e,t){const n=fe(Ae("moduleName"),Ne("orchestrator"),t.payload.additionalInformation||{}),i=Object.assign(Object.assign({},t.payload),{additionalInformation:n?Zs(n):{}});try{yield ze(e,i)}catch(e){}t.payload.level===Vs&&(yield qe({type:sn,payload:{name:"PLACEMENT_FAILURE"}}),yield qe({type:xs.CLOSE_PLUGIN}))}const nl="INVALID_RESPONSE_OBJECT",il="FAILED_TO_OPEN_LINK",al="NO_PARENT_GUID",rl="FAILED_TO_NOTIFY_INTERACTIVE",ol="FAILED_TO_ESTABLISH_PARTNER_VALIDATION";var sl=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n};function ll(e,t){return n=>n&&n.replace(e,t)}const cl=ll(/['""();{}@:[\]!/=]/g,""),dl=/^(normal|italic|oblique( \d+deg)*)$/i,ul=(e="")=>dl.test(e)?e:void 0,pl=ll(/[;{}@[\]!]/g,"");function fl(e){const{fontFamily:t,sources:n}=e,i=sl(e,["fontFamily","sources"]),a=document.fonts,r=new FontFace(t,n.join(", "),i);return a.add(r),r.load().catch((e=>(a.delete(r),Promise.reject(e))))}function yl(e=[]){const t=Array.from(document.fonts.values());return Promise.all(e.map((e=>{const n=function(e){return{fontFamily:cl(e.fontFamily)||"",style:ul(e.style),weight:cl(e.weight),sources:e.sources.map((e=>pl(e)||"")),display:e.display}}(e);return t.find((e=>e.family===n.fontFamily&&e.weight===n.weight&&(e.style===n.style||!n.style)))?Promise.resolve():fl(n).then((()=>{})).catch((e=>`${e}`.includes("SyntaxError")?(n.fontFamily='"'+n.fontFamily+'"',fl(n).then((()=>{}))):Promise.reject(e))).catch((e=>Promise.resolve(`Error loading font: [Font (${JSON.stringify(n)})] [Message - ${e}]`)))}))).then((e=>{const t=e.filter(Boolean);return t.length>0?Promise.reject(t):Promise.resolve()}))}function ml(e){const t=y(),n=m((e=>{const t=e.fonts.map((e=>({fontFamily:e.fontFamily,style:e.fontStyle||"normal",weight:e.fontWeight,sources:e.src}))),n=t.find((e=>"rokt-icons"===e.fontFamily));if(n)n.display="block";else{const e=null!==(i=qs.ROKT_DOMAIN)&&void 0!==i?i:"";t.push(function(e=""){return{fontFamily:"rokt-icons",weight:"400",sources:[`url("${e}/icons/rokt-icons.woff") format("woff")`],display:"block"}}(e))}var i;return JSON.stringify(t)}));return r((()=>{yl(JSON.parse(n)).catch((e=>{const n={type:Ss,payload:{level:zs,code:"FAILED_TO_LOAD_FONT",message:`Error loading fonts:\n\t${e.join("\n\t")}`}};t(n)}))}),[n]),r((()=>{const e=()=>{var e,t;null===(t=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===t||t.resize()};return document.fonts.addEventListener("loadingdone",e),()=>{document.fonts.removeEventListener("loadingdone",e)}}),[]),null}function hl(e){return null!=e?e:null}function vl(){return new Set([Os])}function gl(e){return e.breakpoint.breakpoints[e.breakpoint.activeBreakpoint]||0}const bl=G(U(1)),Il=F(U(0)),El=e=>P($(j(e)),Il,bl,M,B({},["breakpoint","breakpoints"]));function Sl(e){return El(e.breakpoint.activeBreakpoint)(e)}function Cl(e,t){return e.customStates[`module${t}`]||{}}function wl(e){return`${e.name}:${e.parentGuid}`}function Tl(e,t){return!e.processed.includes(wl(t))||(n=t.name,void 0!==kt.find((e=>e===n)));var n}function xl(){return new Map}const Ol={layout:function(e=hl(),t){return t.type===us?t.payload:e},breakpoint:function(e={breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},t){var n;switch(t.type){case ss:return Object.prototype.hasOwnProperty.call(e.breakpoints,t.payload.activeBreakpoint)?Object.assign(Object.assign({},e),{activeBreakpoint:t.payload.activeBreakpoint}):e;case ls:return{activeBreakpoint:null!==(n=t.payload.activeBreakpoint)&&void 0!==n?n:"default",breakpoints:Object.assign({default:0},t.payload.breakpoints),initialised:!0};default:return e}},active:function(e=vl(),t){var n,i;switch(t.type){case rs:{const i=new Set(e);return i.add(null===(n=t.payload)||void 0===n?void 0:n.id),i}case os:{const n=new Set(e);return n.delete(null===(i=t.payload)||void 0===i?void 0:i.id),n}default:return e}},fonts:function(e=[],t){return t.type===ds?t.payload:e},signal:function(e={queue:[],processed:[]},t){switch(t.type){case gs:return he({queue:n=>Tl(e,t.payload.signal)?_e(X(U("signal"),wl),n.concat(t.payload)):n},e);case bs:return he({queue:e=>Le(X(U("signal"),Re({name:t.payload.name,parentGuid:t.payload.parentGuid})))(e),processed:ve(wl(t.payload))},e);default:return e}},serializableCache:function(e=xl(),t){switch(t.type){case ms:case hs:if(t.payload.key&&t.payload.value){return new Map([...e]).set(t.payload.key,t.payload.value)}return e;case vs:{const n=new Map([...e]);return t.payload&&n.delete(t.payload),n}default:return e}},settings:function(e={closeOnComplete:!0},t){return t.type===ys?x(((e,t)=>pe(t)?e:t),e,t.payload):e},customStates:function(e={root:{}},t){if(t.type===ws){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:"root";return b([n,t.payload.key],Number(t.payload.value),e)}return e}return e}};function*Al(e,t){var n,i;try{const a=(null===(n=e.activeBreakpointEventChannel)||void 0===n?void 0:n.call(e,t.payload))||(i=t.payload,st((e=>{const t=Object.entries(i).reduce(((e,t)=>{const i=window.matchMedia(`(min-width: ${t[1]}px)`);return"addEventListener"in i&&"function"==typeof i.addEventListener?(i.addEventListener("change",n),e[t[0]]=i):"addListener"in i&&"function"==typeof i.addListener&&(i.addListener(n),e[t[0]]=i),e}),{});return setTimeout((()=>n()),0),()=>{Object.entries(t).forEach((e=>{const t=e[1];"removeEventListener"in t&&"function"==typeof t.removeEventListener?t.removeEventListener("change",n):"removeListener"in t&&"function"==typeof t.removeListener&&t.removeListener(n)}))};function n(){try{e(function(e,t){return Object.entries(e).reduce(((e,n)=>n[1].matches&&(t[n[0]]||0)>(t[e]||0)?n[0]:e),"default")}(t,i))}catch(t){e(t)}}})));try{let e=yield We(a);for(yield qe({type:Ts.INITIALISE_BREAKPOINT,payload:{activeBreakpoint:e,breakpoints:t.payload}});;)e=yield We(a),yield qe({type:Ts.UPDATE_ACTIVE_BREAKPOINT,payload:{activeBreakpoint:e}})}catch(e){const n=e;yield qe({type:Ss,payload:{level:Hs,code:"FAILED_TO_DETERMINE_BREAKPOINT",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}finally{(yield Ke())&&a.close()}}catch(e){const n=e;yield qe({type:Ss,payload:{level:Vs,code:"FAILED_TO_ESTABLISH_BREAKPOINT_CHANNEL",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}}function Nl(e,t,n){return st((i=>{const a=e.subscribe((e=>{const t=n(e);t&&i({type:ps,payload:t})}),(e=>{i(e)})),r=t.fonts.subscribe((e=>{i({type:ds,payload:e})}),(e=>{i(e)}));return()=>{a.unsubscribe(),r.unsubscribe()}}),ot.sliding(2))}var Ll=Object.freeze({__proto__:null,CartEvent:{UPDATE_CART_ITEM_MESSAGE:"UPDATE_CART_ITEM_MESSAGE",UPSERT_ALERT:"UPSERT_ALERT",DELETE_ALERT:"DELETE_ALERT",UPSERT_DELIVERY_DETAILS:"UPSERT_DELIVERY_DETAILS"}}),Rl=Object.freeze({__proto__:null,PartnerMessage:{UpdateCartItem:"V2_UPDATE_CART_ITEM"},PlacementMessage:{CartItemUpdated:"V2_CART_ITEM_UPDATED"}}),_l=Object.freeze({__proto__:null,V1:Ll,V2:Rl}),Dl=Object.freeze({__proto__:null,PartnerMessage:{CartItemInstantPurchaseResponse:"CART_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{CartItemInstantPurchase:"CART_ITEM_INSTANT_PURCHASE"}}),kl=Object.freeze({__proto__:null,PartnerValidationEvent:{SET_PARTNER_VALIDATION_STATUS:"SET_PARTNER_VALIDATION_STATUS",OPT_IN_TO_PARTNER_VALIDATION:"OPT_IN_TO_PARTNER_VALIDATION",SHOW_PARTNER_VALIDATION_STATUS:"SHOW_PARTNER_VALIDATION_STATUS"}});const Pl="LINK_NAVIGATION_REQUEST",$l="REALTIME_OFFER_FULFILLMENT_SUCCESS",jl="REALTIME_OFFER_FULFILLMENT_FAILURE";var Fl=function(e,t,n,i){return new(n||(n=Promise))((function(a,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((i=i.apply(e,t||[])).next())}))};const Gl={newTab:"_blank",self:"_top",roktWebViewSDK:"roktWebViewSDK",inApp:"inApp",overrideLinkNavigation:"overrideLinkNavigation"};function Ml({url:e,urlBehavior:t,external:n},i=window){return Fl(this,void 0,void 0,(function*(){if(!e)return null;if("overrideLinkNavigation"===t)return n.partner.send(Pl,{url:e}).then((()=>null));const a=Gl[t];if(i.RoktWebViewSDK){const t=i.RoktWebViewSDK.open(e);return t?{ref:t}:null}if("_top"===a&&i.top)return i.top.location.href=e,null;const r=i.open(e,a);if(r)try{r.opener=null}catch(e){}return r?{ref:r}:null}))}var Bl=Object.freeze({__proto__:null,openLink:Ml});function Ul(e,t,n,i){const a=function(e){return"object"==typeof e&&null!=e&&"message"in e&&"string"==typeof e.message&&e.message.includes("timed out")}(e),r=a?{originErrorCode:n}:void 0;return{type:Ss,payload:{level:Hs,code:a?"COMMUNICATION_FAILURE_WITH_WSDK":n,message:t,additionalInformation:Object.assign(Object.assign({},r),i)}}}var Vl=Object.freeze({__proto__:null,makePluginWarningAction:Ul});function zl(e){return null!=e&&"object"==typeof e&&"ref"in e&&"object"==typeof e.ref&&!Array.isArray(e.ref)&&null!=e.ref}var Hl=Object.freeze({__proto__:null,isWindow:zl}),Wl=Object.assign(Object.assign(Object.assign({},Bl),Vl),Hl);function ql(e){switch(e){case"ATTACHED":return Us;case"EMBEDDED":return Bs;default:return Ms}}function Kl(e,t){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e.offsetBottom&&{bottom:ai(e.offsetBottom)}),e.offsetLeft&&{left:ai(e.offsetLeft)}),e.offsetRight&&{right:ai(e.offsetRight)}),e.offsetTop&&{top:ai(e.offsetTop)}),(e.offsetAnchorX||e.offsetAnchorY)&&{transform:`translate(${"center"===e.offsetAnchorX?e.offsetLeft?"-50%":"50%":"0"}, ${"center"===e.offsetAnchorY?e.offsetTop?"-50%":"50%":"0"})`}),e.maxWidth?{maxWidth:ai(e.maxWidth)}:void 0),e.zIndex?{zIndex:e.zIndex}:void 0),t)}function*Yl(e=10){(yield Ye((e=>e.signal.queue.length>0)))&&(yield mt(30),e>=1&&(yield*Yl(e-1)))}function*Jl(e){try{yield*Yl(10),yield pt(e.close)}catch(e){const t=Wl.makePluginWarningAction(e,"Failed to close the plugin","FAILED_TO_CLOSE_PLUGIN");yield ft(t)}}function*Zl(e,{payload:t}){var n;if("string"==typeof(n=t.name)&&Ft.includes(n))switch(t.name){case"V2_CART_ITEM_UPDATED":case"CART_ITEM_INSTANT_PURCHASE":case"UPSELL_CREATIVE_SENT":case"INITIATE_INSTANT_PURCHASE_EVENT":case"INITIATE_CART_ITEM_EVENT":case"REALTIME_OFFER_FULFILLMENT_REFERRAL":case"REALTIME_OFFER_FULFILLMENT_CONVERSION":case"REALTIME_OFFER_FULFILLMENT_SUCCESS":yield e.send(t.name,t.body);break;case"OFFER_ENGAGEMENT":case"PLACEMENT_CLOSED":case"PLACEMENT_COMPLETED":case"PLACEMENT_FAILURE":case"PLACEMENT_INTERACTIVE":case"POSITIVE_ENGAGEMENT":yield e.send(t.name);break;default:return}}const Ql=H("FAILED_TO_PARSE_CONFIG","code");function*Xl(e,t){var n;const i=yield pt(Nl,e.configService,e.themeService,t);for(;;)try{const e=yield yt(i);yield ft(e)}catch(e){const t=e;yield ft({type:Ss,payload:{level:Vs,code:Ql(t),message:null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"An error occured parsing or receiving Plugin config, fonts or configurables.",additionalInformation:{stack:null==t?void 0:t.stack}}})}}function*ec(e,t){yield ct([dt(Xl,e,t),ut(sn,Zl,e.partnerInteractionService)])}function*tc(e,t,n){const i=function(e,t){if(!t)return{preset:ql(e)};switch(e){case"ATTACHED":return{autoresize:!0,applyHighestZIndex:!0,replaceTargetElement:"body",outerCss:Kl(t,{position:"fixed",width:"100%",minWidth:"1px"}),innerCss:{width:"100%"}};case"EMBEDDED":return{autoresize:!0,css:Kl(t,{width:"1px",minWidth:"100%"})};default:return{autoresize:!1,applyHighestZIndex:!0,replaceTargetElement:"body",css:Kl(t,{position:"fixed",height:"100%",width:"100%"})}}}(t,n);yield pt(e.setDisplaySettings,i),yield ft({type:Ts.ACTIVE_ADD,payload:{id:As}})}function*nc(e,t){var n;const i=null!==(n=t.payload.data)&&void 0!==n?n:{};try{yield ze(e,{code:t.payload.code,level:zs,message:t.payload.message||"Plugin Generic Log",additionalInformation:Zs(i)})}catch(e){}}function*ic(e){yield qe({type:Ts.QUEUE_SIGNAL,payload:{signal:e.payload}}),yield qe({type:Is})}function*ac(e){yield qe({type:Ts.QUEUE_SIGNAL,payload:e.payload}),yield qe({type:Is})}function*rc(e,t){const n=yield Ye((e=>e.signal.queue.filter((t=>Tl(e.signal,t.signal)))));if(Array.isArray(n)&&n.length)for(const e of n){const t="criteria"in e?e.criteria:void 0;switch(e.signal.name){case"SignalActivation":case"SignalLoadComplete":case"SignalImpression":yield*oc(e.signal,i(t));break;case"SignalViewed":yield*sc(e.signal,i(t));break;case"SignalDismissal":yield*lc(e.signal,i(t));break;case"SignalInstantPurchaseDismissal":yield*cc(e.signal,i(t));break;case"SignalLoadStart":yield*dc(e.signal,i(t));break;case"SignalGatedResponse":case"SignalResponse":yield*uc(e.signal,i(t,!0));break;case"SignalProductItemResponse":yield*pc(e.signal,i(t));break;case"SignalUserInteraction":yield*fc(e.signal,i(t));break;case"SignalCartItemQuantitySelected":yield*yc(e.signal,i(t));break;case"SignalCartItemInstantPurchaseInitiated":yield*mc(e.signal,i(t));break;case"SignalCartItemInstantPurchase":yield*hc(e.signal,i(t));break;case"SignalCartItemInstantPurchaseFailure":yield*vc(e.signal,i(t))}yield qe({type:Ts.SIGNAL_PROCESSED,payload:e.signal})}function i(t,n=!1){return function(i,a,r){return t?ze(e.prepareExternalSignal,t.key,i,a,r):ze(n?e.issueSignalSync:e.issueSignal,i,a,r)}}}function*oc(e,t){let n;e.creativeInstanceGuid&&(n={},n.creativeInstanceGuid=e.creativeInstanceGuid);try{yield t(e.name,e.parentGuid,n)}catch(t){yield gc(e,t)}}function*sc(e,t){try{yield t(e.name,e.parentGuid,{objectData:{supportedByBrowser:e.supportedByBrowser.toString()},metadata:[{name:"inferred",value:e.inferred.toString()}]})}catch(t){yield gc(e,t)}}function*lc(e,t){try{yield t(e.name,e.parentGuid,e.dismissalMethod?{objectData:{dismissalMethod:e.dismissalMethod}}:void 0)}catch(t){yield gc(e,t)}}function*cc(e,t){try{yield t(e.name,e.parentGuid,void 0)}catch(t){yield gc(e,t)}}function*dc(e,t){var n;const i={overrideTimestamp:null!==(n=e.overrideTimestamp)&&void 0!==n?n:new Date};try{yield t(e.name,e.parentGuid,i)}catch(t){yield gc(e,t)}}function*uc(e,t){try{yield t(e.name,e.parentGuid,function(e){const t={creativeInstanceGuid:e.responseActionPayload.creativeInstanceGuid};"Url"===e.responseActionPayload.name&&(t.transformedTrafficURL=e.responseActionPayload.transformedTrafficURL);return t}(e))}catch(t){yield gc(e,t)}}function*pc(e,t){try{yield t(e.name,e.parentGuid,{objectData:{catalogItemId:e.objectData.catalogItemId,productSku:e.objectData.productSku,catalogId:e.objectData.catalogId,accountId:e.objectData.accountId}})}catch(t){yield gc(e,t)}}function*fc(e,t){const n=e.parentGuid?e.parentGuid:yield Ye((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));try{if(!n||"string"!=typeof n)throw new Error(`Cannot raise SignalUserInteraction, missing or invalid parent GUID: ${JSON.stringify(e)}`);yield t(e.name,n,{objectData:{action:e.action,context:e.context}})}catch(t){yield gc(e,t)}}function*yc(e,t){const n={objectData:{preselected:e.objectData.preselected.toString(),quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield gc(e,t)}}function*mc(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield gc(e,t)}}function*hc(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),initiatedBy:e.objectData.initiatedBy}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield gc(e,t)}}function*vc(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),failureReason:e.objectData.failureReason,providerId:e.objectData.providerId}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield gc(e,t)}}function gc(e,t){const n=Wl.makePluginWarningAction(t,(null==t?void 0:t.message)||"Failed to issue signal","FAILED_TO_ISSUE_SIGNAL",{signalName:null==e?void 0:e.name,parentGuid:null==e?void 0:e.parentGuid,stack:null==t?void 0:t.stack});return qe(n)}function*bc(e){yield qe({type:ws,payload:e.payload})}function*Ic(e,t){if("Interactive"===t.payload.name)try{yield*function*(e){const t="METRIC";(yield Ye((e=>e.serializableCache.has(t))))||(yield ze(e.notifyInteractive),yield qe({type:ms,payload:{key:t,value:"Interactive"}}))}(e)}catch(e){const t=e;yield*function*(e){var t;yield qe({type:Ss,payload:{level:zs,code:rl,message:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:"Failed to notify interactive",additionalInformation:{stack:null==e?void 0:e.stack}}})}(t)}}function*Ec(e,t){const n=e.context.getOverrideLinkNavigation()?"overrideLinkNavigation":t.payload.urlBehaviour;try{"inApp"===n?yield ze(e.createChildPlugin,{name:"url-modal",config:{url:t.payload.url,method:"GET"}}):yield ze(Ml,{url:t.payload.url,urlBehavior:n,external:e})}catch(e){yield qe(Ul(e,"Failed to open link",il,{url:t.payload.url,urlBehaviour:n}))}}function*Sc(e){const t=yield Ye((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:Ts.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:fs}),t?yield qe({type:an,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}):yield qe({type:Ss,payload:{level:zs,code:al,message:"ParentGuid does not exist"}})}const Cc=h((function(e){return{isOpen:e.active.has(Os)}})),wc="undefined"!=typeof window;function Tc(e,t){r((()=>{if(!wc||t)return;const n=e.current;if(!n)return;const i=e=>{e.preventDefault()},a=["wheel","touchmove"];a.forEach((e=>{n.addEventListener(e,i,{passive:!1})}));const r=e=>{["ArrowUp","ArrowDown","PageUp","PageDown","Space"].includes(e.code)&&e.preventDefault()};return window.addEventListener("keydown",r),()=>{a.forEach((e=>{n.removeEventListener(e,i)})),window.removeEventListener("keydown",r)}}),[e,t])}const xc="Minimized",Oc="Maximized",Ac=e=>{const t=o(null),n=o(null),i=o(null),a=o(null),s=o(null),l=o(0),c=o(0),d=o(!e),p=o(!1),f=e?Oc:xc,y=Ri(0,(e=>f?e.customStates[f]:0)),m=e?y?0:1:y,h=Ni(),v=Ma(),g=o(0),b=o(!1),I=o(0),E=o([]),S=o(void 0),{isDisabled:C}=St(v);Tc(t,!!m);const w=e=>{if(d.current)(()=>{const e=t.current,r=n.current,o=i.current,s=a.current;e&&r&&o&&s&&0!==s.clientHeight&&(G(s.clientHeight),requestAnimationFrame((()=>{M(!0,800),G(0),d.current=!1})))})();else if(M(!!e),m){const e=(c.current||0)-(l.current||0);G(e);const n=t.current;if(n){const e=(l.current||0)+1;n.style.height=e+"px"}}else G(0),t.current&&(t.current.style.height="100000px")},T=({key:e,value:t})=>({type:on,payload:{key:e,value:t}}),x=()=>{const e=F();return m?e<=-.2:e>=.2},O=u((()=>{V(),S.current=void 0,b.current=!1,M(!0);x()?R():G(0)}),[x]);r((()=>{if(!p.current)return U(!m,i),U(!!m,a),void requestAnimationFrame((()=>{B(),p.current=!0}));m?(D(),h(Lc(!0))):(k(),h(Lc(!1)))}),[m,h]),r((()=>{const e=function(e,t){let n;return()=>{n&&clearTimeout(n),n=setTimeout((()=>{t(),n=void 0}),e)}}(100,(()=>{var e,t,n,r;l.current=null!==(t=null===(e=i.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,c.current=null!==(r=null===(n=a.current)||void 0===n?void 0:n.clientHeight)&&void 0!==r?r:0,w(d.current)})),t=new ResizeObserver(e),n=i.current,r=a.current;return n&&t.observe(n),r&&t.observe(r),()=>{t.disconnect()}}),[w]);const A=u((e=>{if(n.current){e.preventDefault();const t=L(e);G(t)}}),[n]),N=u((e=>{Date.now()-I.current<200||(I.current=Date.now(),m?_(!1):b.current||C||(b.current=!0,j(),S.current=Nc(e),M(!1),z()))}),[m,C]);r((()=>{const e=n.current;return e&&(e.addEventListener("mousedown",N),e.addEventListener("touchstart",N)),()=>{null==e||e.removeEventListener("mousedown",N),null==e||e.removeEventListener("touchstart",N)}}),[n,N]);const L=e=>{var t,n;return(null!==(t=Nc(e))&&void 0!==t?t:0)-(null!==(n=S.current)&&void 0!==n?n:0)},R=()=>{_(!m)},_=e=>{[T({key:xc,value:e?1:0}),T({key:Oc,value:e?0:1})].forEach((e=>{e&&h(e)}))},D=()=>{var e,t,n,r;if(d.current)return;const o=null!==(t=null===(e=i.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,s=(null!==(r=null===(n=a.current)||void 0===n?void 0:n.clientHeight)&&void 0!==r?r:0)-o;M(!0),B(!0,!0),G(s),U(!1,i),U(!0,a),H()},k=()=>{d.current||(M(!0),B(!0,!1),G(0),S.current=void 0,U(!0,i),U(!1,a),W())},P=u((()=>{b.current&&($(),requestAnimationFrame(P))}),[]),$=()=>{E.current.push({yPosition:g.current,timestamp:Date.now()}),E.current.length>20&&E.current.shift()},j=u((()=>{E.current=[],P()}),[P]),F=()=>{const e=E.current;if(!e)return 0;const t=e[0],n=e[e.length-1];if(!t||!n)return 0;const i=n.timestamp-t.timestamp;return(n.yPosition-t.yPosition)/i},G=e=>{const t=Math.round(e);g.current=t,n.current&&(n.current.style.transform=`translateY(${t}px)`)},M=(e,t=200)=>{e?n.current&&(n.current.style.transition=`transform ${t}ms`):n.current&&(n.current.style.transition="")},B=(e,t=!1)=>{const n=t?a:i,r=t?i:a;r.current&&(r.current.style.transition="opacity .5s"),n.current&&(n.current.style.transition="opacity .2s")},U=(e,t)=>{const n=t.current;if(!n)return;const i=e?0:1;n.style.opacity=`${i}`,e?n.style.pointerEvents="none":setTimeout((()=>{n.style.pointerEvents="auto"}),400)},V=u((()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",O),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",O)}),[A,O]),z=u((()=>{wt()?(document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",O)):(document.addEventListener("mousemove",A,{passive:!1}),document.addEventListener("mouseup",O))}),[A,O]),H=()=>{const e=t.current;e&&(s.current=setTimeout((()=>{var t;const n=((null===(t=i.current)||void 0===t?void 0:t.clientHeight)||0)+1;e.style.height=n+"px"}),200))},W=()=>{s.current&&clearTimeout(s.current),t.current&&(t.current.style.height="100000px")};return{wrapperRef:t,containerRef:n,minimizedChildRef:i,maximizedChildRef:a}};function Nc(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}const Lc=e=>({type:an,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}});const Rc={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var _c;function Dc({schema:t,testId:n}){var i;const a=En(),s=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),l=m((e=>e.active.has(As))),c=o(null),d=y(),u=()=>{d({type:xs.DISMISS_OVERLAY,payload:{id:Os,dismissalMethod:"rokt_backdrop"}})},p=null!==(i=t.startMinimized)&&void 0!==i&&i,f=p?Oc:xc,h=Ri(0,(e=>f?e.customStates[f]:0)),v=p?h?0:1:h;r((()=>{g(!!v)}),[v]),Tc(c,!!v);const g=e=>{const t=c.current;t&&(e?t.style.opacity="0":(t.style.display="flex",t.style.opacity="1"))};r((()=>{s&&d({type:an,payload:{name:"SignalActivation",parentGuid:s}})}),[s]),r((()=>{l&&requestAnimationFrame((()=>{var e;return null===(e=a.current)||void 0===e?void 0:e.focus()}))}),[l]);const b=Ma(),{tabIndex:I,isDisabled:E,styles:S}=St(b),C=t.styles?Oe(Rc,t.styles):Rc;return e(Br,{styles:C,children:({classnames:i})=>{var a;return e("div",{className:null==i?void 0:i.wrapper,style:Object.assign({height:"100%",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9998",overflow:"hidden",display:"flex",opacity:p?"0":"1",transition:"opacity 0.2s ease-in-out"},S),"aria-label":null!==(a=t.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":E,role:"dialog","aria-modal":!0,tabIndex:I,"data-testid":n,"data-e2e":"Overlay-Wrapper",ref:c,children:e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:t.allowBackdropToClose?u:void 0,"data-testid":n&&`${n}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function kc(){return e("div",{style:{width:"48px",height:"4px",backgroundColor:"#C6C6C8",borderRadius:"2px",margin:"0 auto -4px",position:"relative",top:"6px"}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(_c||(_c={}));const Pc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};function $c(t){const n=m((e=>e.slots)),i=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return e(jc,Object.assign({},t,{slots:n,currentIndex:i}))}function jc(n){var i;const a=null!==(i=n.schema.startMinimized)&&void 0!==i&&i,{wrapperRef:r,containerRef:o,minimizedChildRef:s,maximizedChildRef:l}=Ac(a);return n.isOpen?t("div",{ref:r,style:{height:"100000px"},children:[e(Dc,Object.assign({},n)),e(Gc,Object.assign({},n,{startMinimized:a,containerRef:o,minimizedChildRef:s,maximizedChildRef:l}))]}):null}const Fc=Be`
|
|
58
58
|
display: flex;
|
|
59
59
|
position: relative;
|
|
60
60
|
overflow: hidden;
|
|
@@ -62,7 +62,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
62
62
|
> * {
|
|
63
63
|
position: absolute !important;
|
|
64
64
|
}
|
|
65
|
-
`,Gc=p((function({schema:n,testId:i,slots:s,currentIndex:l,minimizedChildRef:c,containerRef:d,maximizedChildRef:u},p){var f,y;const m=r(null),h=r(null),v=n.styles?Oe(Pc,n.styles):Pc,g=ki(),b=()=>{const e=h.current;if(!e)return;const t=(()=>{const e=h.current;return e?Array.from(e.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0):0})();e.style.height=`${t}px`};o((()=>{const e=new ResizeObserver((()=>{b()}));return h.current&&Array.from(h.current.children).forEach((t=>{e.observe(t)})),()=>{e.disconnect()}}),[]);const I=null===(y=null===(f=s[l])||void 0===f?void 0:f.offer)||void 0===y?void 0:y.creative,E=null==I?void 0:I.copy,S=na(E||{})(Jr.transformLinksToAnchorText(null==I?void 0:I.links),"creativeLink");return e(Uo,{styles:v,children:({classnames:o})=>{var r;return t("div",{style:{width:"100%",position:"absolute",bottom:"-1000px",zIndex:"9999",transform:"translateY(1000px)"},ref:d,children:[e("div",{style:{zIndex:"3",width:"100%",maxHeight:"0%",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)"},ref:m,children:t("div",{className:null==o?void 0:o.own,style:{height:"100%",position:"relative",outline:"none",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",border:"1px solid #D5D7DA",borderBottom:"none",margin:"0px -1px"},tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:[e(kc,{}),e("div",{ref:h,className:Fc,"aria-label":null!==(r=n.a11yLabel)&&void 0!==r?r:void 0,children:a.Children.toArray([e("div",{ref:u,style:{width:"100%"},children:g(n.children[0],void 0,Kt(0,i))},"0"),e(ra,{value:S,children:e(Ha,{value:Ba(I),children:e("div",{ref:c,style:{width:"100%"},children:E&&e("div",{children:g(n.children[1],void 0,Kt(1,i))})},"1")})})])})]})}),e("div",{style:{width:"100%",height:"1000px",backgroundColor:"white"}})]})}})}));function*Mc(){(yield Ye((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex})))===(yield Ye((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||1})))-1&&(yield qe({type:rn,payload:{key:"Minimized",value:1}}))}Cc($c);const Bc={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var Uc;function Vc({isOpen:t,schema:n,testId:i,children:r}){const s=En(),l=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),c=m((e=>e.active.has(As))),d=y();o((()=>{l&&d({type:an,payload:{name:"SignalActivation",parentGuid:l}})}),[l]),o((()=>{c&&requestAnimationFrame((()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}),[c]);const u=Ma(),{tabIndex:p,isDisabled:f,styles:h}=St(u),v=n.styles?Oe(Bc,n.styles):Bc;if(!t)return null;const g=e(Di,{children:e=>a.Children.toArray(n.children.map(((t,n)=>e(t,void 0,i?`${i}-child${n}`:void 0))))});return e(Uo,{styles:v,children:({classnames:t})=>{var a;return e("div",{className:null==t?void 0:t.wrapper,style:Object.assign({height:"10000px",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto",flexDirection:"column",justifyContent:"flex-end"},h),"aria-label":null!==(a=n.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":f,role:"dialog","aria-modal":!0,tabIndex:p,"data-testid":i,"data-e2e":"Overlay-Wrapper",children:r(g,s)})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(Uc||(Uc={}));const zc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const Hc=p((function({schema:t,testId:n,children:i},a){const o=t.styles?Oe(zc,t.styles):zc;return e(Uo,{styles:o,children:({classnames:o})=>{var r;return e("div",{className:null==o?void 0:o.own,style:{position:"relative",zIndex:"3",outline:"none",alignSelf:"center"},ref:a,tabIndex:-1,"data-e2e":"Overlay-Container","aria-label":null!==(r=t.a11yLabel)&&void 0!==r?r:void 0,role:"dialog","aria-modal":!0,"data-testid":n&&`${n}-container`,children:i})}})}));const Wc=h((function(e){return{isOpen:e.active.has(Os)}}))((function(t){return e(Vc,Object.assign({},t,{children:(n,i)=>e(Hc,Object.assign({},t,{ref:i,children:n}))}))})),qc=Cc($c),Kc={name:"minimized-bottomsheet-extension",sagas:function*(){yield Je([Ze("OFFER_LIFECYCLE",Mc)])},componentFactory:t=>"Overlay"===t.type?e(Wc,{schema:t}):function(e){const t=e.children instanceof Array;return t}(t)?e(qc,{schema:t}):e("div",{children:"Could not Render Bottom Sheet"})};const Yc=h((function(e,{schema:t}){var n,i,a;const o=t.startPosition||1;if((null===(n=e.progression)||void 0===n?void 0:n.totalCount)&&(null===(i=e.progression)||void 0===i?void 0:i.groupSize)){const t=(r=e.progression.totalCount,(s=e.progression.groupSize)<=0||r<=0||s>r?0:Math.ceil(r/s));let n;n=o>0?o-1:t+o>-1?t+o:0;return{numOfIndicators:t-n>-1?t-n:0,activeIndex:null!==(a=e.progression.currentGroupIndex)&&void 0!==a?a:0,startIndex:n}}var r,s;return{numOfIndicators:0,activeIndex:0,startIndex:0}})),Jc=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"37",height:"29",viewBox:"0 0 37 29",fill:"inherit",style:{maxWidth:"44px",maxHeight:"32px",width:"100%",height:"100%"}},a.createElement("path",{d:"M5.62263 14.7123L5.48251 5.86667L11.3433 4.79804L11.3655 6.53531L7.57989 7.22555L7.61586 9.03828L11.0283 8.41606L11.0513 10.1575L7.63884 10.7797L7.69779 14.3339L5.62263 14.7123ZM17.5824 3.66043L19.6534 3.28282L19.745 8.98818C19.7555 9.64756 19.6126 10.2497 19.3164 10.7947C19.0224 11.3363 18.6042 11.7908 18.0619 12.1583C17.5191 12.5229 16.8858 12.7712 16.1619 12.9032C15.4352 13.0357 14.7983 13.019 14.2512 12.8531C13.7035 12.6844 13.2748 12.3843 12.9651 11.9527C12.6549 11.5184 12.4931 10.9717 12.4799 10.3129L12.3882 4.60752L14.4634 4.22914L14.5473 9.74965C14.5538 10.0546 14.6243 10.3146 14.7588 10.5298C14.8957 10.7416 15.0825 10.8952 15.3194 10.9907C15.5557 11.0833 15.8276 11.1016 16.135 11.0455C16.4453 10.989 16.717 10.8716 16.9501 10.6933C17.1828 10.5123 17.3621 10.2919 17.488 10.0321C17.6134 9.76959 17.6728 9.48585 17.6663 9.18094L17.5824 3.66043ZM28.2611 1.71333L28.4012 10.5589L26.6405 10.88L23.1503 6.39639L23.0916 6.40709L23.1693 11.5129L21.0941 11.8913L20.954 3.04567L22.7399 2.72004L26.2075 7.19908L26.2788 7.18608L26.1901 2.09094L28.2611 1.71333ZM4.24231 28.1783L4.10219 19.3327L9.96295 18.2641L9.98516 20.0013L6.19957 20.6916L6.23554 22.5043L9.64803 21.8821L9.67101 23.6235L6.25852 24.2457L6.31747 27.7999L4.24231 28.1783ZM11.933 26.776L9.70271 27.1827L12.4594 17.8089L15.2221 17.3051L18.2591 25.6225L16.0288 26.0292L13.9145 19.7787L13.8474 19.7909L11.933 26.776ZM11.5852 23.3481L16.247 22.4981L16.2661 24.1233L11.6043 24.9733L11.5852 23.3481ZM26.4764 18.4671L24.4054 18.8447C24.3768 18.6247 24.3205 18.4343 24.2363 18.2735C24.1516 18.1099 24.0407 17.9771 23.9037 17.875C23.7662 17.7701 23.6063 17.7011 23.4241 17.6679C23.2419 17.6347 23.0376 17.6387 22.8113 17.68C22.3781 17.759 22.005 17.9382 21.6921 18.2176C21.3792 18.497 21.1409 18.861 20.9772 19.3096C20.8136 19.7581 20.7359 20.2747 20.7444 20.8594C20.7576 21.423 20.8423 21.8797 20.9985 22.2295C21.1575 22.5788 21.3782 22.823 21.6605 22.9621C21.9424 23.0985 22.2748 23.1317 22.6577 23.0619C22.9064 23.0165 23.1316 22.9451 23.3333 22.8477C23.5373 22.747 23.7155 22.6235 23.8679 22.4774C24.0203 22.3312 24.1446 22.1656 24.2408 21.9805C24.3393 21.7922 24.4051 21.591 24.4383 21.3771L26.5261 20.9964C26.4914 21.3926 26.3895 21.7996 26.2202 22.2174C26.0532 22.6319 25.8184 23.0227 25.5157 23.3898C25.213 23.7568 24.842 24.0743 24.4028 24.342C23.9636 24.6098 23.4548 24.7965 22.8762 24.902C22.0853 25.0462 21.371 24.993 20.7333 24.7426C20.0985 24.4916 19.5925 24.0525 19.2153 23.4253C18.8405 22.7948 18.6436 21.9846 18.6249 20.9947C18.6089 20.0359 18.7692 19.1967 19.1057 18.4769C19.4451 17.7566 19.9106 17.1736 20.5022 16.7279C21.0965 16.2817 21.764 15.991 22.5047 15.856C23.0413 15.7581 23.5366 15.7429 23.9907 15.8103C24.4471 15.8743 24.8501 16.0174 25.1996 16.2396C25.5486 16.459 25.8322 16.7552 26.0504 17.1284C26.2714 17.501 26.4134 17.9473 26.4764 18.4671ZM27.362 16.8329L27.3398 15.0956L34.5966 13.7725L34.6188 15.5097L32.0154 15.9844L32.1333 23.0928L30.0875 23.4658L29.9696 16.3575L27.362 16.8329Z",fill:"inherit"})),Zc="FunFactMode";function Qc({activeIndex:e,startIndex:t,numOfIndicators:n,schema:i,slots:r}){var s,l,d;const p=Ma(),f=y(),{tabIndex:m,styles:h,isDisabled:v}=St(p),g=Array(n+1).fill(i.indicator),[b,I]=c(new Set([t])),[E,S]=c(!1),C=Ri(0,(e=>e.customStates[Zc])),w=u((e=>b.has(e)||b.has(e-1)),[b]);o((()=>{I((t=>new Set([...t,e])))}),[e,C]),o((()=>{C&&S(!0)}),[C]);const T=()=>{f({type:rn,payload:{key:Zc,value:1}})},x=null===(l=null===(s=r[e])||void 0===s?void 0:s.offer)||void 0===l?void 0:l.creative,O=null===(d=null==x?void 0:x.images.creativeImage)||void 0===d?void 0:d.light;return n>0&&(N=n+t+1,(A=e)>=t&&A<=N)?a.createElement(oa,null,(o=>a.createElement(Uo,{styles:i.styles},(i=>{var r;const s=i.classnames,l=t=>{var i,a,o,r;return t===n&&C?`${null==s?void 0:s.indicator} ${null!==(i=null==s?void 0:s.activeIndicator)&&void 0!==i?i:""}`:t!==e||C?b.has(t)||t===n&&E?`${null==s?void 0:s.indicator} ${null!==(o=null==s?void 0:s.seenIndicator)&&void 0!==o?o:""}`:t==e+1?`${null==s?void 0:s.indicator} ${null!==(r=null==s?void 0:s.clickableIndicator)&&void 0!==r?r:""}`:`${null==s?void 0:s.indicator}`:`${null==s?void 0:s.indicator} ${null!==(a=null==s?void 0:s.activeIndicator)&&void 0!==a?a:""}`};return a.createElement("div",{className:null!==(r=null==s?void 0:s.own)&&void 0!==r?r:"",style:Object.assign({display:"flex",flexDirection:"row",gap:"8px"},h),"data-e2e":"ProgressIndicator",tabIndex:m,"aria-hidden":v},a.Children.toArray(g.map(((i,r)=>{return r===n?a.createElement("button",{onClick:E||e==n-1?T:void 0,className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",fill:C?"#101828":"#A3A3A3",cursor:E||e==n-1?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(i),a.createElement("div",{style:{marginTop:"3px",marginLeft:"2px"},"data-testid":"fun-fact-icon"},Jc)):r!==e||C?a.createElement("button",{onClick:(s=r,()=>{w(s)&&(f({type:"PROGRESSION/INITIALISE",payload:{totalCount:n,currentGroupIndex:s,groupSize:1}}),C&&f({type:rn,payload:{key:Zc,value:0}}))}),className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:w(r)?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(""),a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${r+1}`)):a.createElement("button",{className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:w(r)?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(""),O?a.createElement("img",{src:O,style:{marginTop:"3px"}}):a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${r+1}`));var s}))))})))):null;var A,N}const Xc=Yc(((e,t)=>{const n=m((e=>e.slots)),i=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return a.createElement(Qc,Object.assign({},e,{slots:n,currentIndex:i,partnerColor:t}))})),ed=({children:e,partnerColor:t,schema:n})=>{var i;const o=ki(),r=d((()=>Math.random()),[]),s=na((null!==(i=td[Math.floor(r*td.length)])&&void 0!==i?i:{text:"",header:""})||{},"funfact"),l=Be`
|
|
65
|
+
`,Gc=p((function({schema:n,testId:i,slots:s,currentIndex:l,minimizedChildRef:c,containerRef:d,maximizedChildRef:u},p){var f,y;const m=o(null),h=o(null),v=n.styles?Oe(Pc,n.styles):Pc,g=ki(),b=()=>{const e=h.current;if(!e)return;const t=(()=>{const e=h.current;return e?Array.from(e.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0):0})();e.style.height=`${t}px`};r((()=>{const e=new ResizeObserver((()=>{b()}));return h.current&&Array.from(h.current.children).forEach((t=>{e.observe(t)})),()=>{e.disconnect()}}),[]);const I=null===(y=null===(f=s[l])||void 0===f?void 0:f.offer)||void 0===y?void 0:y.creative,E=null==I?void 0:I.copy,S=na(E||{})(Jo.transformLinksToAnchorText(null==I?void 0:I.links),"creativeLink");return e(Br,{styles:v,children:({classnames:r})=>{var o;return t("div",{style:{width:"100%",position:"absolute",bottom:"-1000px",zIndex:"9999",transform:"translateY(1000px)"},ref:d,children:[e("div",{style:{zIndex:"3",width:"100%",maxHeight:"0%",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)"},ref:m,children:t("div",{className:null==r?void 0:r.own,style:{height:"100%",position:"relative",outline:"none",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",border:"1px solid #D5D7DA",borderBottom:"none",margin:"0px -1px"},tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:[e(kc,{}),e("div",{ref:h,className:Fc,"aria-label":null!==(o=n.a11yLabel)&&void 0!==o?o:void 0,children:a.Children.toArray([e("div",{ref:u,style:{width:"100%"},children:g(n.children[0],void 0,Kt(0,i))},"0"),e(oa,{value:S,children:e(Ha,{value:Ba(I),children:e("div",{ref:c,style:{width:"100%"},children:E&&e("div",{children:g(n.children[1],void 0,Kt(1,i))})},"1")})})])})]})}),e("div",{style:{width:"100%",height:"1000px",backgroundColor:"white"}})]})}})}));function*Mc(){(yield Ye((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex})))===(yield Ye((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||1})))-1&&(yield qe({type:on,payload:{key:"Minimized",value:1}}))}Cc($c);const Bc={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var Uc;function Vc({isOpen:t,schema:n,testId:i,children:o}){const s=En(),l=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),c=m((e=>e.active.has(As))),d=y();r((()=>{l&&d({type:an,payload:{name:"SignalActivation",parentGuid:l}})}),[l]),r((()=>{c&&requestAnimationFrame((()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}),[c]);const u=Ma(),{tabIndex:p,isDisabled:f,styles:h}=St(u),v=n.styles?Oe(Bc,n.styles):Bc;if(!t)return null;const g=e(Di,{children:e=>a.Children.toArray(n.children.map(((t,n)=>e(t,void 0,i?`${i}-child${n}`:void 0))))});return e(Br,{styles:v,children:({classnames:t})=>{var a;return e("div",{className:null==t?void 0:t.wrapper,style:Object.assign({height:"10000px",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto",flexDirection:"column",justifyContent:"flex-end"},h),"aria-label":null!==(a=n.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":f,role:"dialog","aria-modal":!0,tabIndex:p,"data-testid":i,"data-e2e":"Overlay-Wrapper",children:o(g,s)})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(Uc||(Uc={}));const zc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const Hc=p((function({schema:t,testId:n,children:i},a){const r=t.styles?Oe(zc,t.styles):zc;return e(Br,{styles:r,children:({classnames:r})=>{var o;return e("div",{className:null==r?void 0:r.own,style:{position:"relative",zIndex:"3",outline:"none",alignSelf:"center"},ref:a,tabIndex:-1,"data-e2e":"Overlay-Container","aria-label":null!==(o=t.a11yLabel)&&void 0!==o?o:void 0,role:"dialog","aria-modal":!0,"data-testid":n&&`${n}-container`,children:i})}})}));const Wc=h((function(e){return{isOpen:e.active.has(Os)}}))((function(t){return e(Vc,Object.assign({},t,{children:(n,i)=>e(Hc,Object.assign({},t,{ref:i,children:n}))}))})),qc=Cc($c),Kc={name:"minimized-bottomsheet-extension",sagas:function*(){yield Je([Ze("OFFER_LIFECYCLE",Mc)])},componentFactory:t=>"Overlay"===t.type?e(Wc,{schema:t}):function(e){const t=e.children instanceof Array;return t}(t)?e(qc,{schema:t}):e("div",{children:"Could not Render Bottom Sheet"})};const Yc=h((function(e,{schema:t}){var n,i,a;const r=t.startPosition||1;if((null===(n=e.progression)||void 0===n?void 0:n.totalCount)&&(null===(i=e.progression)||void 0===i?void 0:i.groupSize)){const t=(o=e.progression.totalCount,(s=e.progression.groupSize)<=0||o<=0||s>o?0:Math.ceil(o/s));let n;n=r>0?r-1:t+r>-1?t+r:0;return{numOfIndicators:t-n>-1?t-n:0,activeIndex:null!==(a=e.progression.currentGroupIndex)&&void 0!==a?a:0,startIndex:n}}var o,s;return{numOfIndicators:0,activeIndex:0,startIndex:0}})),Jc=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"37",height:"29",viewBox:"0 0 37 29",fill:"inherit",style:{maxWidth:"44px",maxHeight:"32px",width:"100%",height:"100%"}},a.createElement("path",{d:"M5.62263 14.7123L5.48251 5.86667L11.3433 4.79804L11.3655 6.53531L7.57989 7.22555L7.61586 9.03828L11.0283 8.41606L11.0513 10.1575L7.63884 10.7797L7.69779 14.3339L5.62263 14.7123ZM17.5824 3.66043L19.6534 3.28282L19.745 8.98818C19.7555 9.64756 19.6126 10.2497 19.3164 10.7947C19.0224 11.3363 18.6042 11.7908 18.0619 12.1583C17.5191 12.5229 16.8858 12.7712 16.1619 12.9032C15.4352 13.0357 14.7983 13.019 14.2512 12.8531C13.7035 12.6844 13.2748 12.3843 12.9651 11.9527C12.6549 11.5184 12.4931 10.9717 12.4799 10.3129L12.3882 4.60752L14.4634 4.22914L14.5473 9.74965C14.5538 10.0546 14.6243 10.3146 14.7588 10.5298C14.8957 10.7416 15.0825 10.8952 15.3194 10.9907C15.5557 11.0833 15.8276 11.1016 16.135 11.0455C16.4453 10.989 16.717 10.8716 16.9501 10.6933C17.1828 10.5123 17.3621 10.2919 17.488 10.0321C17.6134 9.76959 17.6728 9.48585 17.6663 9.18094L17.5824 3.66043ZM28.2611 1.71333L28.4012 10.5589L26.6405 10.88L23.1503 6.39639L23.0916 6.40709L23.1693 11.5129L21.0941 11.8913L20.954 3.04567L22.7399 2.72004L26.2075 7.19908L26.2788 7.18608L26.1901 2.09094L28.2611 1.71333ZM4.24231 28.1783L4.10219 19.3327L9.96295 18.2641L9.98516 20.0013L6.19957 20.6916L6.23554 22.5043L9.64803 21.8821L9.67101 23.6235L6.25852 24.2457L6.31747 27.7999L4.24231 28.1783ZM11.933 26.776L9.70271 27.1827L12.4594 17.8089L15.2221 17.3051L18.2591 25.6225L16.0288 26.0292L13.9145 19.7787L13.8474 19.7909L11.933 26.776ZM11.5852 23.3481L16.247 22.4981L16.2661 24.1233L11.6043 24.9733L11.5852 23.3481ZM26.4764 18.4671L24.4054 18.8447C24.3768 18.6247 24.3205 18.4343 24.2363 18.2735C24.1516 18.1099 24.0407 17.9771 23.9037 17.875C23.7662 17.7701 23.6063 17.7011 23.4241 17.6679C23.2419 17.6347 23.0376 17.6387 22.8113 17.68C22.3781 17.759 22.005 17.9382 21.6921 18.2176C21.3792 18.497 21.1409 18.861 20.9772 19.3096C20.8136 19.7581 20.7359 20.2747 20.7444 20.8594C20.7576 21.423 20.8423 21.8797 20.9985 22.2295C21.1575 22.5788 21.3782 22.823 21.6605 22.9621C21.9424 23.0985 22.2748 23.1317 22.6577 23.0619C22.9064 23.0165 23.1316 22.9451 23.3333 22.8477C23.5373 22.747 23.7155 22.6235 23.8679 22.4774C24.0203 22.3312 24.1446 22.1656 24.2408 21.9805C24.3393 21.7922 24.4051 21.591 24.4383 21.3771L26.5261 20.9964C26.4914 21.3926 26.3895 21.7996 26.2202 22.2174C26.0532 22.6319 25.8184 23.0227 25.5157 23.3898C25.213 23.7568 24.842 24.0743 24.4028 24.342C23.9636 24.6098 23.4548 24.7965 22.8762 24.902C22.0853 25.0462 21.371 24.993 20.7333 24.7426C20.0985 24.4916 19.5925 24.0525 19.2153 23.4253C18.8405 22.7948 18.6436 21.9846 18.6249 20.9947C18.6089 20.0359 18.7692 19.1967 19.1057 18.4769C19.4451 17.7566 19.9106 17.1736 20.5022 16.7279C21.0965 16.2817 21.764 15.991 22.5047 15.856C23.0413 15.7581 23.5366 15.7429 23.9907 15.8103C24.4471 15.8743 24.8501 16.0174 25.1996 16.2396C25.5486 16.459 25.8322 16.7552 26.0504 17.1284C26.2714 17.501 26.4134 17.9473 26.4764 18.4671ZM27.362 16.8329L27.3398 15.0956L34.5966 13.7725L34.6188 15.5097L32.0154 15.9844L32.1333 23.0928L30.0875 23.4658L29.9696 16.3575L27.362 16.8329Z",fill:"inherit"})),Zc="FunFactMode";function Qc({activeIndex:e,startIndex:t,numOfIndicators:n,schema:i,slots:o}){var s,l,d;const p=Ma(),f=y(),{tabIndex:m,styles:h,isDisabled:v}=St(p),g=Array(n+1).fill(i.indicator),[b,I]=c(new Set([t])),[E,S]=c(!1),C=Ri(0,(e=>e.customStates[Zc])),w=u((e=>b.has(e)||b.has(e-1)),[b]);r((()=>{I((t=>new Set([...t,e])))}),[e,C]),r((()=>{C&&S(!0)}),[C]);const T=()=>{f({type:on,payload:{key:Zc,value:1}})},x=null===(l=null===(s=o[e])||void 0===s?void 0:s.offer)||void 0===l?void 0:l.creative,O=null===(d=null==x?void 0:x.images.creativeImage)||void 0===d?void 0:d.light;return n>0&&(N=n+t+1,(A=e)>=t&&A<=N)?a.createElement(ra,null,(r=>a.createElement(Br,{styles:i.styles},(i=>{var o;const s=i.classnames,l=t=>{var i,a,r,o;return t===n&&C?`${null==s?void 0:s.indicator} ${null!==(i=null==s?void 0:s.activeIndicator)&&void 0!==i?i:""}`:t!==e||C?b.has(t)||t===n&&E?`${null==s?void 0:s.indicator} ${null!==(r=null==s?void 0:s.seenIndicator)&&void 0!==r?r:""}`:t==e+1?`${null==s?void 0:s.indicator} ${null!==(o=null==s?void 0:s.clickableIndicator)&&void 0!==o?o:""}`:`${null==s?void 0:s.indicator}`:`${null==s?void 0:s.indicator} ${null!==(a=null==s?void 0:s.activeIndicator)&&void 0!==a?a:""}`};return a.createElement("div",{className:null!==(o=null==s?void 0:s.own)&&void 0!==o?o:"",style:Object.assign({display:"flex",flexDirection:"row",gap:"8px"},h),"data-e2e":"ProgressIndicator",tabIndex:m,"aria-hidden":v},a.Children.toArray(g.map(((i,o)=>{return o===n?a.createElement("button",{onClick:E||e==n-1?T:void 0,className:l(o+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",fill:C?"#101828":"#A3A3A3",cursor:E||e==n-1?"pointer":"default"}},r({state:{indicatorPosition:String(o+1+t)}})(i),a.createElement("div",{style:{marginTop:"3px",marginLeft:"2px"},"data-testid":"fun-fact-icon"},Jc)):o!==e||C?a.createElement("button",{onClick:(s=o,()=>{w(s)&&(f({type:"PROGRESSION/INITIALISE",payload:{totalCount:n,currentGroupIndex:s,groupSize:1}}),C&&f({type:on,payload:{key:Zc,value:0}}))}),className:l(o+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:w(o)?"pointer":"default"}},r({state:{indicatorPosition:String(o+1+t)}})(""),a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${o+1}`)):a.createElement("button",{className:l(o+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:w(o)?"pointer":"default"}},r({state:{indicatorPosition:String(o+1+t)}})(""),O?a.createElement("img",{src:O,style:{marginTop:"3px"}}):a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${o+1}`));var s}))))})))):null;var A,N}const Xc=Yc(((e,t)=>{const n=m((e=>e.slots)),i=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return a.createElement(Qc,Object.assign({},e,{slots:n,currentIndex:i,partnerColor:t}))})),ed=({children:e,partnerColor:t,schema:n})=>{var i;const r=ki(),o=d((()=>Math.random()),[]),s=na((null!==(i=td[Math.floor(o*td.length)])&&void 0!==i?i:{text:"",header:""})||{},"funfact"),l=Be`
|
|
66
66
|
display: inline;
|
|
67
67
|
margin: 8px 16px;
|
|
68
68
|
p {
|
|
@@ -72,7 +72,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
72
72
|
font-size: 24px;
|
|
73
73
|
font-weight: 600;
|
|
74
74
|
color: ${t};
|
|
75
|
-
`;return a.createElement(
|
|
75
|
+
`;return a.createElement(oa,{value:s},a.createElement(Br,{styles:n.styles},(t=>{const n=t.classnames;return a.createElement(a.Fragment,null,a.Children.toArray(null==e?void 0:e.map(((e,t)=>a.createElement("div",{className:`${l} ${null==n?void 0:n.own}`},0===t?a.createElement(a.Fragment,null,a.createElement("p",{className:`${c} ${null==n?void 0:n.own}`},"Did you know...")," ",a.createElement("span",{className:`${null==n?void 0:n.own}`},r(e))):a.createElement("span",{className:`${null==n?void 0:n.own}`},r(e)))))))})))},td=[{header:"the Eiffel Tower can grow taller in summer?",text:"The heat causes the metal to expand, adding up to six inches to its height."},{header:"flamingos aren't born pink?",text:"Their feathers turn pink from eating shrimp and algae rich in carotenoids."},{header:"bananas are berries, but strawberries aren't?",text:"Botanically, strawberries are aggregate fruits, while bananas meet all the criteria for a true berry."},{header:"a day on Venus is longer than a year on Venus?",text:"It takes Venus 243 Earth days to rotate once but only 225 Earth days to orbit the Sun."},{header:"sea cucumbers can eject their guts when threatened?",text:"This defense mechanism helps them escape predators and they regenerate the lost organs later."},{header:"prunes used to be said instead of cheese for photos?",text:'In the 1840s, people said "prunes" to maintain a tight-lipped expression instead of smiling.'},{header:"some frogs can freeze solid and survive?",text:"Species like wood frogs produce special proteins that prevent ice from damaging their cells."},{header:"Venus is the only planet that spins clockwise?",text:"Its unusual rotation direction makes it stand out among other planets in our solar system."},{header:"cats have 230 bones while humans have only 206?",text:"Their extra bones make them incredibly flexible jumpers and climbers."},{header:"the Statue of Liberty once functioned as a lighthouse?",text:"From 1886 to 1902, its light could be seen up to 24 miles away."},{header:"the first commercial flight lasted just 23 minutes?",text:"It flew between St. Petersburg and Tampa, Florida, in 1914."},{header:"octopuses have blue blood and nine brains?",text:"Their unique blood helps them survive in low-oxygen environments, and each arm has its own mini-brain."},{header:"hummingbirds can fly backward?",text:"They're the only birds capable of this agile movement thanks to their unique wing structure."},{header:"gorillas burp when they're happy?",text:"It's one of their ways of expressing contentment and relaxation."},{header:"Australia is wider than the Moon?",text:"Australia spans about 2,485 miles across, while the Moon's diameter is only about 2,159 miles."},{header:"ants can carry up to 50 times their body weight?",text:"These tiny insects are incredibly strong for their size due to their muscle structure."},{header:"lightning is five times hotter than the surface of the Sun?",text:"A single bolt can reach temperatures of up to 50,000 degrees Fahrenheit."},{header:"sharks are the only fish that can blink with both eyes?",text:"They have an extra eyelid called a nictitating membrane for protection during attacks or feeding."},{header:"octopuses have three hearts?",text:"Two pump blood to the gills, while the third pumps it to the rest of the body—and it stops beating when they swim."},{header:"a group of flamingos is called a flamboyance?",text:"Their bright pink color and synchronized movements make this name quite fitting."},{header:"honey never spoils?",text:"Archaeologists have found pots of honey in ancient Egyptian tombs that are still edible."},{header:"cats can't taste sweetness?",text:"Their taste buds lack the receptors for sugary flavors, which might explain their disinterest in desserts."},{header:"a crocodile can't stick out its tongue?",text:"A special membrane holds their tongue in place, helping them swallow prey underwater."},{header:"sea otters hold hands while they sleep?",text:"This keeps them from drifting apart in the water, especially when they're napping in groups."},{header:"bananas glow blue under black light?",text:"This happens because of the way their peel breaks down as they ripen."},{header:"a watermelon is 92% water?",text:"That's why it's such a refreshing snack on a hot day!"},{header:"butterflies taste with their feet?",text:"Their taste sensors are located on their legs, helping them identify suitable plants for laying eggs."},{header:"an ostrich's eye is bigger than its brain?",text:"This might explain why these birds rely more on instinct than intelligence."},{header:"kangaroos can't walk backward?",text:"Their muscular tails and body structure make this movement impossible."},{header:"avocados are fruits, not vegetables?",text:"They're technically berries because of their fleshy pulp and single seed."},{header:"dolphins have names for each other?",text:"They use unique whistles to identify and call out to specific individuals in their pods."},{header:'the Hollywood sign originally said "Hollywoodland"?',text:"It was installed in 1923 as an advertisement for a real estate development."},{header:"giraffe tongues can be up to 20 inches long?",text:"Their dark color helps protect them from sunburn while reaching for leaves."},{header:"M&M's were the first candy eaten in space?",text:"Astronauts love them because they don't crumble and create messes in zero gravity."},{header:"starfish don't have brains?",text:"They rely on a simple nervous system to sense their surroundings and move around."},{header:"peanuts are legumes, not nuts?",text:"They grow underground like beans and peas, making them part of the legume family."},{header:"the shortest war in history lasted only 38 minutes?",text:"It was between Britain and Zanzibar on August 27, 1896."},{header:"clouds can weigh over a million pounds?",text:"Despite their massive weight, the water droplets are spread out enough to float in the air!"}];function*nd(){(yield Ye((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex})))===(yield Ye((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||1})))-1&&(yield qe({type:on,payload:{key:"FunFactMode",value:1}}))}const id={name:"logo-clickable-progression-extension",sagas:function*(){yield Je([Ze("OFFER_LIFECYCLE",nd)])},componentFactory:e=>e?"fun-fact"===e.variant?a.createElement(ed,{partnerColor:e.partnerColor,schema:e},e.children):a.createElement(Xc,{schema:Object.assign(Object.assign({},e),{indicator:""}),partnerColor:e.partnerColor}):a.createElement("div",null,"Could not render Logo Clickable Progression"),interceptors:{}};const ad=Be`
|
|
76
76
|
height: 20px;
|
|
77
77
|
border-radius: 4px;
|
|
78
78
|
width: 100%;
|
|
@@ -81,25 +81,25 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
81
81
|
background-size: 200% 100%;
|
|
82
82
|
animation: 1.5s ${Ve`to { background-position-x: -200%; }`} linear
|
|
83
83
|
infinite;
|
|
84
|
-
`,od=Be`
|
|
85
|
-
width: 75%;
|
|
86
84
|
`,rd=Be`
|
|
85
|
+
width: 75%;
|
|
86
|
+
`,od=Be`
|
|
87
87
|
height: 40px;
|
|
88
88
|
width: 200px;
|
|
89
89
|
`,sd=Be`
|
|
90
90
|
width: 150px;
|
|
91
|
-
`;function ld({hasLoaded:e,animationSpeedMS:t,styles:n}){const[i,
|
|
91
|
+
`;function ld({hasLoaded:e,animationSpeedMS:t,styles:n}){const[i,o]=c(!0);return r((()=>{if(e){const e=setTimeout((()=>{o(!1)}),t);return()=>clearTimeout(e)}return()=>null}),[e]),i?a.createElement("div",{"data-testid":"skeleton",className:Be(Object.assign({height:"100%"},null==n?void 0:n.skeleton))},a.createElement("div",{className:Be`
|
|
92
92
|
padding: 30px 24px;
|
|
93
93
|
display: flex;
|
|
94
94
|
flex-direction: column;
|
|
95
95
|
gap: 16px;
|
|
96
96
|
height: inherit;
|
|
97
97
|
justify-content: center;
|
|
98
|
-
`},a.createElement("div",{className:ad}),a.createElement("div",{className:ad}),a.createElement("div",{className:ad}),a.createElement("div",{className:Ue(ad,
|
|
98
|
+
`},a.createElement("div",{className:ad}),a.createElement("div",{className:ad}),a.createElement("div",{className:ad}),a.createElement("div",{className:Ue(ad,rd)}),a.createElement("div",{className:Be`
|
|
99
99
|
display: flex;
|
|
100
100
|
gap: 16px;
|
|
101
101
|
align-items: center;
|
|
102
|
-
`},a.createElement("div",{className:Ue(ad,
|
|
102
|
+
`},a.createElement("div",{className:Ue(ad,od)}),a.createElement("div",{className:Ue(ad,sd)})))):null}function cd({styles:e,hasLoaded:t,partnerText:n,animationSpeedMS:i}){if(!Array.isArray(n)||!(null==n?void 0:n.length))throw new Error("partnerText must be an string[]");const[o,s]=c(!0);return r((()=>{if(t){const e=setTimeout((()=>{s(!1)}),i);return()=>clearTimeout(e)}return()=>null}),[t]),o?a.createElement("div",{"data-testid":"partner-text",className:Be(Object.assign({height:"100%",width:"100%",display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:t?0:1,transition:`opacity ${i}ms ease-in-out`},null==e?void 0:e.partnerText))},n?a.Children.toArray(n.map((e=>a.createElement("p",{className:Be`
|
|
103
103
|
font-weight: 600;
|
|
104
104
|
font-size: 14px;
|
|
105
105
|
line-height: 21px;
|
|
@@ -107,7 +107,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
107
107
|
`},e)))):null):null}const dd=Ve`
|
|
108
108
|
0% { width: 0; }
|
|
109
109
|
100% { width: 100%; }
|
|
110
|
-
}`;function ud(e){const[t,n]=c(!1),[i,
|
|
110
|
+
}`;function ud(e){const[t,n]=c(!1),[i,o]=c(!1),s=y(),l=ki(),{type:d,children:u,durationMS:p,styles:f,partnerText:m,animationSpeedMS:h}=e.data;let v=null;switch(d){case"skeleton":v=a.createElement(ld,{hasLoaded:t,animationSpeedMS:h,styles:f});break;case"partnerText":v=a.createElement(cd,{partnerText:m,hasLoaded:t,animationSpeedMS:h,styles:f})}return r((()=>{let e=null;const t=setTimeout((()=>{n(!0),e=setTimeout((()=>{o(!0)}),h)}),1.25*p);return()=>{t&&clearTimeout(t),e&&clearTimeout(e)}}),[p,s]),a.createElement("div",{"data-testid":"Loading"},a.createElement("div",{className:Be`
|
|
111
111
|
position: relative;
|
|
112
112
|
`},a.createElement("div",{className:Be`
|
|
113
113
|
height: 4px;
|
|
@@ -133,15 +133,15 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
133
133
|
z-index: 10;
|
|
134
134
|
transition: opacity ${h}ms ease-in-out;
|
|
135
135
|
${i?"\n opacity: 1;\n user-select: auto;\n pointer-events: auto;\n ":"\n opacity: 0;\n user-select: none;\n pointer-events: none;\n "}
|
|
136
|
-
`},a.Children.toArray(u.map((e=>l(e))))))))}const pd={name:"loading-extension",componentFactory:e=>a.createElement(ud,{data:e}),interceptors:{}};function fd({linearGradient:e,color1:t,color2:n,color3:i,duration:s,additionalStyles:l,gradientAngle:c}){const u=r(null);o((()=>{const e=()=>{var e;if(null===(e=u.current)||void 0===e?void 0:e.parentElement){const e=u.current.parentElement;requestAnimationFrame((()=>{const t=Array.from(e.children).filter((e=>!e.classList.contains("background-shimmer")));if(t.length>0){const n=t.reduce(((e,t)=>Math.max(e,t.offsetHeight)),0),i=parseInt(e.style.height||"0");n>0&&n!==i&&(e.style.height=`${n}px`)}}))}};let t;const n=()=>{clearTimeout(t),t=setTimeout(e,100)};return window.addEventListener("resize",n),setTimeout(e,100),()=>{window.removeEventListener("resize",n),clearTimeout(t)}}),[]);const p=d((()=>`\n @keyframes slideGradient {\n 0% {\n left: -90%;\n opacity: 0;\n }\n 8% {\n left: -90%;\n opacity: 1;\n }\n 22% {\n left: 90%;\n opacity: 1;\n }\n 28% {\n left: 100%;\n opacity: 0;\n }\n 100% {\n left: 100%;\n opacity: 0;\n }\n }\n .background-shimmer {\n position: absolute !important;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n pointer-events: none;\n z-index: 0;\n }\n \n .background-shimmer::after {\n content: '';\n position: absolute;\n top: 0;\n left: -100%;\n right: 0;\n bottom: 0;\n width: 50%;\n background: ${e||`linear-gradient(\n ${c||"to right"},\n transparent 0%,\n ${t||"rgba(217, 217, 217, 0.30)"} 20%,\n ${n||"rgba(217, 217, 217, 0.50)"} 50%,\n ${i||"rgba(217, 217, 217, 0.30)"} 80%,\n transparent 100%\n )`};\n animation: slideGradient ${s||"3.94s"} linear infinite forwards;\n pointer-events: none;\n z-index: 0;\n }\n ${l}\n`),[e,t,n,i,s,l,c]);return a.createElement(oa,null,(e=>a.createElement(Uo,{styles:{}},(e=>{var t;const n=e.classnames;return a.createElement(a.Fragment,null,a.createElement("style",null,p),a.createElement("div",{ref:u,className:`${null!==(t=null==n?void 0:n.own)&&void 0!==t?t:""} background-shimmer`}))}))))}const yd={name:"shimmer-background-extension",componentFactory:e=>e?a.createElement(fd,{linearGradient:e.linearGradient,color1:e.color1,color2:e.color2,color3:e.color3,duration:e.duration,additionalStyles:e.additionalStyles}):a.createElement("div",null,"Could not render Shimmer Background"),interceptors:{}},md=1e3;function hd(e){const t=e.data,{minutes:n,seconds:i,timeRemaining:s,restartTimer:l}=function(e){const[t,n]=c(e),i=(new Date).getTime()/md,a=r(null),s=()=>{const t=(new Date).getTime()/md;n(Math.max(Math.floor(e-(t-i)),0))};return o((()=>(a.current=setInterval(s,md),()=>{a.current&&"number"==typeof a.current&&clearInterval(a.current)})),[]),{minutes:Math.floor(t/60).toString(),seconds:Math.floor(Math.min(t%60,59)).toLocaleString("en-US",{minimumIntegerDigits:2,maximumFractionDigits:0,useGrouping:!1}),timeRemaining:t,restartTimer:function(){a.current&&"number"==typeof a.current&&clearInterval(a.current),n(e),a.current=setInterval(s,md)}}}((null==t?void 0:t.duration)||300),d=m((e=>{const t=g(["progression","currentGroupIndex"],e);return"number"==typeof t?t:0})),u=y();o((()=>{l()}),[d]),o((()=>{0===s&&(u({type:an,payload:{name:"SignalUserInteraction",action:"TimerExpired",context:"TimerProgression"}}),u({type:"PROGRESSION/PROCESS",payload:{offerProcessStatus:"CONTINUE"}}))}),[n,i]);const p=Ma(),{tabIndex:f,styles:h,isDisabled:v}=St(p);return a.createElement("p",{tabIndex:f,style:Object.assign(Object.assign({},null==t?void 0:t.styles),h),"aria-hidden":v,"data-e2e":"Timer"},`${n}:${i}`)}const vd={name:"timer-progression-extension",componentFactory:e=>a.createElement(hd,{data:e}),interceptors:{}};function gd(e){var t,n,i,o,r;const s=!1===e.isValid&&!!e.error;return a.createElement("div",{"data-testid":e.testId},a.createElement("label",{className:null===(t=e.classnames)||void 0===t?void 0:t.label},e.schema.label),a.createElement("input",{className:s?`${null===(n=e.classnames)||void 0===n?void 0:n.error}`:`${null===(i=e.classnames)||void 0===i?void 0:i.field}`,type:"text",value:e.value||"",placeholder:e.schema.placeholder,required:"Required"===e.schema.validator,onChange:t=>{var n;let i=t.target.value;e.schema.inputFilter&&(i=function(e,t){if(!t)return e;if("object"==typeof t&&t.pattern){const n=new RegExp(t.pattern,"g");return e.replace(n,"")}return"numeric"===t?e.replace(/[^0-9]/g,""):e}(i,e.schema.inputFilter)),null===(n=e.onChange)||void 0===n||n.call(e,i)},"aria-invalid":!!s,"aria-describedby":s?`${e.testId}-error`:void 0}),s&&a.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"row"}},a.createElement("img",{src:e.errorIcon,className:null===(o=e.classnames)||void 0===o?void 0:o.errorIcon,alt:"Error"}),a.createElement("div",{className:null===(r=e.classnames)||void 0===r?void 0:r.errorText},e.error)))}function bd(e){const{schema:t,disabled:n,onClick:i,testId:o,classnames:r}=e,s=[null==r?void 0:r.button,n?"disabled":""].filter(Boolean).join(" ");return a.createElement("button",{type:"button",className:s,onClick:e=>{e.preventDefault(),e.stopPropagation(),i&&i()},disabled:n,"data-testid":o,"data-e2e":"FormButton","aria-label":t.ariaLabel||t.label,style:{cursor:n?"not-allowed":"pointer",pointerEvents:"auto",flexWrap:"wrap",minWidth:"max-content"}},a.createElement("span",{className:null==r?void 0:r.text},t.label))}const Id="FORMS/UPDATE",Ed=(e,t,n)=>{if(!t)return{isValid:!0};switch(t){case"Required":return e.trim()?{isValid:!0}:{isValid:!1,error:(null==n?void 0:n.missingLabel)||"This field is required"};case"PhoneNumber":if(!e.trim())return{isValid:!1,error:(null==n?void 0:n.missingLabel)||"Phone number is required"};return/^[+]?[1-9][\d]{0,15}$/.test(e.replace(/\s/g,""))?{isValid:!0}:{isValid:!1,error:(null==n?void 0:n.errorLabel)||"Invalid phone number"};case"Contains":{if(!e.trim())return{isValid:!1,error:(null==n?void 0:n.missingLabel)||"This field is required"};const t=(null==n?void 0:n.allowedValues)||[];return t.includes(e.trim())?{isValid:!0}:{isValid:!1,error:(null==n?void 0:n.errorLabel)||`Invalid value. Allowed values: ${t.join(", ")}`}}case"ZipCode":if(!e.trim())return{isValid:!1,error:(null==n?void 0:n.missingLabel)||"Postal code is required"};return/^\d{5}(-\d{4})?$/.test(e)?{isValid:!0}:{isValid:!1,error:(null==n?void 0:n.errorLabel)||"Invalid ZIP code"};default:return{isValid:!0}}};function Sd(e,t){const n={};return Object.keys(t).forEach((e=>{n[e]={value:"",isValid:!0,error:void 0}})),e&&"object"==typeof e&&Object.keys(t).forEach((t=>{const i=e[t],a=n[t];"string"==typeof i&&a&&(a.value=i)})),n}function Cd(e){var t,n,i,o;const r=y(),s=e.schema.noGroupBreakpoints||[],l=Ri(!0,(e=>{var t;return 0===s.length||!s.includes(null===(t=null==e?void 0:e.breakpoint)||void 0===t?void 0:t.activeBreakpoint)})),d=m((t=>{var n;return null===(n=t.forms)||void 0===n?void 0:n[e.schema.formId]})),p=m((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||0})),f=m((e=>e.slots||[])),h=f.length>0&&(null===(o=null===(i=null===(n=null===(t=f[0])||void 0===t?void 0:t.offer)||void 0===n?void 0:n.catalogItems)||void 0===i?void 0:i[0])||void 0===o?void 0:o.cartItemId);if(!h)return;const v=m((e=>{const t=e.globalOfferDataState||{},n=[];return Object.values(t).forEach((e=>{e.cart&&n.push(...e.cart)})),n})),g=e=>{null==e||e.forEach((e=>{"CUSTOM_EVENT"===e.type?r({type:rn,payload:e.payload}):"SLOT_EVENT"===e.type&&Array.from({length:p},((e,t)=>t)).forEach((t=>{r({type:"CUSTOM_STATES/SET",payload:Object.assign(Object.assign({},e.payload),{offerPositionIndex:t})})}))}))},b=Ma(),{tabIndex:I,isDisabled:E,styles:S}=St(b),{fields:C,fieldGroups:w,controls:T}=e.schema,[x,O]=c((()=>Sd(d,C))),[A,N]=c(!1),L=u((()=>Object.entries(x).reduce(((e,[t,n])=>(e[t]=n.value,e)),{})),[x]),R=()=>{var t;N(!0);const n=Object.assign({},x);let i=!0;if(Object.keys(C).forEach((e=>{var t;const a=C[e],o=(null===(t=x[e])||void 0===t?void 0:t.value)||"",r=Ed(o,null==a?void 0:a.validator,a);n[e]={value:o,isValid:r.isValid,error:r.error},r.isValid||(i=!1)})),O(n),i){const n=L();r({type:Id,payload:{formId:e.schema.formId,formData:n}});const i={firstName:n.firstName||"",lastName:n.lastName||"",address1:n.addressLine1||"",address2:n.addressLine2||"",city:n.city||"",state:n.state||"",postalCode:n.zip||"",phoneNumber:n.phone||""};r({type:yn,payload:{cartItemId:h,shipping:i,lineItems:v}}),g((null===(t=null==T?void 0:T.saveButton)||void 0===t?void 0:t.eventModels)||[])}},_=()=>{var e;O(Sd(d,C)),N(!1),g((null===(e=null==T?void 0:T.cancelButton)||void 0===e?void 0:e.eventModels)||[])};return a.createElement(Uo,{styles:e.schema.styles},(({classnames:t})=>a.createElement("div",{"data-testid":e.testId,"data-e2e":"Form",className:null==t?void 0:t.own,"aria-hidden":E,tabIndex:I,style:Object.assign({display:"flex",flexDirection:"column"},S)},A&&Object.values(x).some((e=>!e.isValid))&&a.createElement("div",{className:null==t?void 0:t.formError,style:{display:"flex",alignItems:"center",flexDirection:"row"}},a.createElement("img",{className:null==t?void 0:t.formErrorIcon,alt:"Error",src:e.schema.error.url.light}),a.createElement("span",{className:null==t?void 0:t.formErrorText},e.schema.error.text)),w.map(((n,i)=>{const o=l&&1!==n.fields.length?"row":"column";return a.createElement("div",{key:i,style:{display:"flex",flexDirection:o},className:"row"===o?null==t?void 0:t.groupRowWrapper:""},n.fields.map((n=>{const i=C[n],o=x[n]||{value:"",isValid:!0,error:void 0};return i?a.createElement("div",{key:n,style:{flex:"1"}},a.createElement(gd,{schema:i,value:o.value,error:o.error,errorIcon:e.schema.error.url.light,isValid:o.isValid,onChange:e=>((e,t)=>{const n=C[e];let i,a=!0;if((null==n?void 0:n.validateOnChange)&&n.validator){const e=Ed(t,n.validator,n);a=e.isValid,i=e.error}O((n=>Object.assign(Object.assign({},n),{[e]:{value:t,isValid:a,error:i}})))})(n,e),testId:`${e.testId}-${n}`,classnames:{label:null==t?void 0:t.fieldLabel,field:null==t?void 0:t.fieldInput,error:null==t?void 0:t.fieldError,errorText:null==t?void 0:t.fieldErrorText,errorIcon:null==t?void 0:t.fieldErrorIcon}})):null})))})),((null==T?void 0:T.saveButton)||(null==T?void 0:T.cancelButton))&&a.createElement("div",{className:null==t?void 0:t.buttonGroup,style:{display:"flex",flexDirection:l?"row":"column",justifyContent:"flex-end",gap:"12px",marginTop:"24px",pointerEvents:"auto"}},(null==T?void 0:T.cancelButton)&&a.createElement(bd,{schema:T.cancelButton,onClick:_,testId:`${e.testId}-cancel`,disabled:!1,classnames:{button:null==t?void 0:t.cancelButton}}),(null==T?void 0:T.saveButton)&&a.createElement(bd,{schema:T.saveButton,onClick:R,disabled:!1,testId:`${e.testId}-save`,classnames:{button:null==t?void 0:t.saveButton}})))))}function wd(e){const t=ki(),n=na(m((t=>{var n;return null===(n=t.forms)||void 0===n?void 0:n[e.schema.formId]}))||{},e.schema.formId);return a.createElement(ra,{value:n},t(e.schema.node,void 0,e.testId))}const Td={name:"address-form-extension",reducer:{forms:(e,t)=>{if(void 0===e)return{};if(t.type===Id){const n=t.payload,{formId:i,formData:a}=n;return Object.assign(Object.assign({},e),{[i]:a})}return e}},componentFactory:e=>{if(!e||"object"!=typeof e)return a.createElement("div",null,"Could not render Form - invalid data");if((e=>{if("object"!=typeof e||null===e)return!1;const t=e;return"type"in t&&"edit"===t.type&&"formId"in t&&"string"==typeof t.formId&&""!==t.formId.trim()&&"fields"in t&&"object"==typeof t.fields&&"node"in t&&"object"==typeof t.node&&null!==t.node})(e)){const t={formId:e.formId,fields:e.fields||{},node:e.node};return a.createElement(wd,{schema:t,testId:"edit-form-extension"})}if((e=>{if("object"!=typeof e||null===e)return!1;const t=e;return"type"in t&&"view"===t.type&&"formId"in t&&"string"==typeof t.formId&&""!==t.formId.trim()&&"fields"in t&&"object"==typeof t.fields&&null!==t.fields&&"fieldGroups"in t&&Array.isArray(t.fieldGroups)&&"error"in t&&"object"==typeof t.error&&null!==t.error})(e)){const t={formId:e.formId||"default-form",fields:e.fields,fieldGroups:e.fieldGroups||[],controls:e.controls,error:e.error||{url:{light:""},text:"Error occurred"},styles:e.styles,noGroupBreakpoints:e.noGroupBreakpoints||[]};return a.createElement(Cd,{schema:t,testId:"form-extension"})}return a.createElement("div",null,"Could not render Form - invalid type.")},interceptors:{}},xd="MODULE/ADD_LOADED",Od="MODULE/LOAD",Ad="PROGRESSION/INITIALISE",Nd="PROGRESSION/NEXT",Ld="PROGRESSION/PREV",Rd="PROGRESSION/UPDATE_GROUP_SIZE",_d="PROGRESSION/PROCESS",Dd="SLOTS/SET",kd="INSTANT_PURCHASE/DISMISS",Pd="OFFER_LIFECYCLE",$d="DOMAIN_STATES/SET",jd="OFFER_ENGAGEMENT",Fd="GLOBAL_OFFER_DATA_STATE/SET_CART",Gd=Object.assign(Object.assign({},Ts),{NEXT_IN_PROGRESSION:Nd,PREV_IN_PROGRESSION:Ld,INITIALISE_PROGRESSION:Ad,UPDATE_GROUP_SIZE:Rd,SET_SLOTS:Dd,ADD_LOADED_MODULE:xd,SET_DOMAIN_STATE:$d,SET_GLOBAL_OFFER_DATA_CART:Fd}),Md=Object.assign(Object.assign({},xs),{LOAD_MODULES:Od,DISMISS_INSTANT_PURCHASE:kd,PROCESS_PROGRESSION:_d,OFFER_LIFECYCLE:Pd,OFFER_ENGAGEMENT:jd,SET_PARTNER_VALIDATION_STATUS:un});function Bd(e,t){return t<=0||e<=0||t>e?0:Math.ceil(e/t)}function Ud(e,t){const n=[];if(t<=0||e<=0||t>e)throw Error(`Could not generate the progression groups with groupSize: ${t} and totalCount: ${e}`);for(let i=0;i<Bd(e,t);i++){const a=[];for(let n=0;n<t;n++)a.push(Math.min(i*t+n,e-1));n.push([...new Set(a)])}return n}const Vd=Symbol("root");function zd(){return{[Vd]:{}}}const Hd=Object.assign({progression:function(e=null,t){switch(t.type){case Ad:if(function(e){const{totalCount:t,currentGroupIndex:n,groupSize:i}=e;return t>=0&&i>=0&&n>=0&&i<=t&&n<Bd(t,i)}(t.payload)){const{totalCount:e,_:n,groupSize:i}=t.payload;return Object.assign(Object.assign({},t.payload),{indexGroups:Ud(e,i)})}return null;case Rd:{const{groupSize:n}=t.payload,i=null==e?void 0:e.totalCount;return i&&n<=i&&n>0?Object.assign(Object.assign({},e),{groupSize:n,indexGroups:Ud(i,n),currentGroupIndex:0}):null}case Nd:{if(!e)return null;const{totalCount:t,groupSize:n,currentGroupIndex:i}=e;return t>0&&n>0&&i>=0?Object.assign(Object.assign({},e),{currentGroupIndex:Math.min(i+1,Bd(t,n)-1)}):null}case Ld:{if(!e)return null;const{totalCount:t,groupSize:n,currentGroupIndex:i}=e;return t>0&&n>0&&i>=0?Object.assign(Object.assign({},e),{currentGroupIndex:Math.max(i-1,0)}):null}default:return e}},slots:function(e=[],t){return t.type===Dd?t.payload:e},module:function(e={loadedModules:[]},t){return t.type===xd?Object.assign(Object.assign({},e),{loadedModules:[...e.loadedModules,t.payload]}):e},domainStates:function(e=zd(),t){if(t.type===$d){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:Vd;return n===Vd?e:Object.assign(Object.assign({},b([n,t.payload.key],Number(t.payload.value),e)),{[Vd]:{}})}return e}return e},globalOfferDataState:function(e={},t){if(t.type===Fd){if(t.payload.cart){const n=`module${t.payload.offerPositionIndex}`;return Object.assign(Object.assign({},e),{[n]:{cart:t.payload.cart}})}return e}return e}},Ol);function Wd(e={}){return Object.assign(Object.assign(Object.assign({},function(e={}){return Object.assign({layout:hl(),breakpoint:{breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},active:vl(),fonts:[],signal:{queue:[],processed:[]},serializableCache:xl(),settings:{closeOnComplete:!0},customStates:{root:{}}},e)}(e)),{progression:null,slots:[],module:{loadedModules:[]},domainStates:zd(),globalOfferDataState:{}}),e)}function qd(e){var t;return!!e.progression&&(1===e.progression.groupSize&&e.progression.currentGroupIndex===(null===(t=e.progression)||void 0===t?void 0:t.totalCount)-1)}function Kd(e){return e.progression?{activeGroupIndex:e.progression.currentGroupIndex,totalOffers:e.progression.totalCount,totalGroups:Bd(e.progression.totalCount,e.progression.groupSize),isLast:qd(e)}:null}function Yd(e,t){return e.domainStates[`module${t}`]||{offerComplete:0,checkout:0}}function Jd(e){return Object.values(e.globalOfferDataState).reduce(((e,t)=>{if(t&&"object"==typeof t&&"cart"in t){const n=t.cart;if(Array.isArray(n))return e+n.reduce(((e,t)=>e+("number"==typeof t.quantity?t.quantity:0)),0)}return e}),0)}function Zd(i){var a;const{config:o,position:r,visible:s,container:c,testId:d}=i,u=eo(),p=Ma(),f=m(gl),y=m((e=>function(e,t){return e.globalOfferDataState[`module${t}`]}(e,r))),h=l(to),v=l(no),g=`rokt-${o.layoutVariant.moduleName}-${u}`;return t(n,{children:[!s&&e("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},"aria-hidden":"true"}),e(g,{style:{display:"flex",flexDirection:"column"===c?"column":"row",width:"100%"},slotInstanceGuid:o.instanceGuid,layoutSchema:JSON.stringify(o.layoutVariant.layoutVariantSchema),schemaVersion:h,childLayouts:JSON.stringify(null!==(a=o.layoutVariant.childLayouts)&&void 0!==a?a:[]),offerData:JSON.stringify(o.offer),offerPositionIndex:r,visible:s,container:c,interactivity:p,"data-testid":d,"data-e2e":`OfferSlot-${r}`,inert:(null==v?void 0:v.inert)&&!s?"":void 0,"aria-hidden":(null==v?void 0:v.inert)?void 0:!s,"module-component":!0,"plugin-id":u,"active-breakpoint":qt(f),offerState:JSON.stringify(y)})]})}function Qd({schema:t,testId:n}){const i=t.styles,o=m((e=>e.slots)),s=r(null),l=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),c=Ma(),{tabIndex:d,isDisabled:u,styles:p}=St(c);return o.length&&o[l]?e(Uo,{styles:i,children:({classnames:i})=>e("div",{ref:s,"data-testid":n,"data-e2e":"OneByOneDistribution",className:null==i?void 0:i.own,tabIndex:d,"aria-hidden":u,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},p),children:a.Children.toArray(o.map(((n,i)=>e(is,{effect:t.transition,visible:i===l,parentElement:s.current,children:e(Zd,{config:n,position:i,visible:i===l,container:"column"})}))))})}):null}const Xd=h((function(e,{schema:t}){var n,i,a;const o=t.startPosition||1;if((null===(n=e.progression)||void 0===n?void 0:n.totalCount)&&(null===(i=e.progression)||void 0===i?void 0:i.groupSize)){const t=Bd(e.progression.totalCount,e.progression.groupSize);let n;n=o>0?o-1:t+o>-1?t+o:0;return{numOfIndicators:t-n>-1?t-n:0,activeIndex:null!==(a=e.progression.currentGroupIndex)&&void 0!==a?a:0,startIndex:n}}return{numOfIndicators:0,activeIndex:0,startIndex:0}}))((function({activeIndex:t,startIndex:n,numOfIndicators:a,schema:o}){const r=Ma(),{tabIndex:s,styles:l,isDisabled:c}=St(r),d=Array(a).fill(o.indicator);return a>1&&(p=a+n-1,(u=t)>=n&&u<=p)?e(oa,{children:a=>e(Uo,{styles:o.styles,children:o=>{var r;const u=o.classnames,p=e=>{var n,i;return e===t?`${null==u?void 0:u.indicator} ${(null==u?void 0:u.activeIndicator)?u.activeIndicator:null!==(n=null==u?void 0:u.seenIndicator)&&void 0!==n?n:""}`:e<t?`${null==u?void 0:u.indicator} ${null!==(i=null==u?void 0:u.seenIndicator)&&void 0!==i?i:""}`:null==u?void 0:u.indicator};return e("div",{className:null!==(r=null==u?void 0:u.own)&&void 0!==r?r:"",style:Object.assign({display:"flex",flexDirection:"row"},l),"data-e2e":"ProgressIndicator",tabIndex:s,"aria-hidden":c,children:i.Children.toArray(d.map(((t,i)=>e("span",{className:p(i+n),style:{display:"flex"},children:a({state:{indicatorPosition:String(i+1+n)}})(t)}))))})}})}):null;var u,p}));const eu="partnerValidationUI",tu="stackedViewableItems";function nu(t){var n;const i=y(),r=m((e=>e.slots)),s=null!==(n=t.schema.viewableItems)&&void 0!==n?n:[],l=_o(s.reduce(((e,t,n)=>Object.assign(Object.assign({},e),{[n]:t.when})),{})),c=P((e=>{var t;return e&&(null===(t=s[e[0]])||void 0===t?void 0:t.value)||r.length}),De((([e,t])=>t)),M)(l);o((()=>{i({type:hs,payload:{key:tu,value:String(c)}})}),[c]);const d=r.slice(0,c),u=Ma(),{tabIndex:p,isDisabled:f,styles:h}=St(u);return(null==d?void 0:d.length)>0?e(Uo,{styles:t.schema.styles,children:({classnames:n})=>e("div",{"data-testid":t.testId,"data-e2e":"StackedDistribution",className:null==n?void 0:n.own,"aria-hidden":f,tabIndex:p,style:Object.assign({display:"flex",flexDirection:"column"},h),children:a.Children.toArray(d.map(((t,n)=>e(Zd,{config:t,position:n,visible:!0,container:"column"}))))})}):null}function iu(t){const n=t.schema.styles,i=y(),o=Ma(),r="Backward"===t.schema.direction?"Previous":"Next",{tabIndex:s,styles:l,isDisabled:c}=St(o),d=()=>{i({type:"Backward"===t.schema.direction?Gd.PREV_IN_PROGRESSION:Gd.NEXT_IN_PROGRESSION})};return e(Uo,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:r,className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"ProgressControl","data-e2e-direction":`${t.schema.direction}`,disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:r,tabIndex:s,style:Object.assign({cursor:"pointer"},l),children:e(Di,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}function au({schema:t,testId:n}){var i,r,s,l,c,d,u,p,f;const h=m((e=>e.progression)),v=null==h?void 0:h.indexGroups[null==h?void 0:h.currentGroupIndex],g=null!==(i=null==h?void 0:h.currentGroupIndex)&&void 0!==i?i:0,b=m((e=>e.slots)),I=m(Sl),E=t.viewableItems.length-1,[S,C]=ht({slidesToScroll:null!==(r=t.viewableItems[Math.min(I,E)])&&void 0!==r?r:"auto",containScroll:"trimSnaps"}),w=y(),T=Ma(),{tabIndex:x,isDisabled:O,styles:A}=St(T),N=`${null!==(p=null===(u=null===(d=null===(c=null===(l=null===(s=t.styles)||void 0===s?void 0:s.elements)||void 0===l?void 0:l.own[I])||void 0===c?void 0:c.default)||void 0===d?void 0:d.container)||void 0===u?void 0:u.gap)&&void 0!==p?p:"0"}px`;o((()=>{function e(e){var t,n;const i=null!==(t=null==e?void 0:e.selectedScrollSnap())&&void 0!==t?t:0,a=null!==(n=null==e?void 0:e.previousScrollSnap())&&void 0!==n?n:0;i!==g&&(i>a?w({type:Gd.NEXT_IN_PROGRESSION}):i<a&&w({type:Gd.PREV_IN_PROGRESSION}))}return null!=g&&(null==C||C.on("select",e),null==C||C.scrollTo(g)),()=>{null==C||C.off("select",e)}}),[C,g,w]);const L={overflow:"hidden"},R={backfaceVisibility:"hidden",display:"flex",touchAction:"pan-y",gap:N,alignItems:"stretch"},_=e=>{var t;return null!==(t=null==v?void 0:v.includes(e))&&void 0!==t&&t},D=t.peekThroughSize[Math.min(I,t.peekThroughSize.length-1)],k=D?"Fixed"===(P=D).type?`${P.value}px`:`${P.value}%`:"0px";var P;const $=null!==(f=t.viewableItems[Math.min(E,I)])&&void 0!==f?f:1,j={flex:`0 0 calc(${(e=>"0px"!==e&&"0%"!==e)(k)?`(100% - 2 * ${k} - (${$} + 1) * ${N})/${$}`:`(100% - (${$} - 1) * ${N})/${$}`})`,position:"relative",display:"flex",overflow:"auto"};return(null==b?void 0:b.length)>0?e(Uo,{styles:t.styles,children:({classnames:t})=>e("div",{ref:S,style:Object.assign(Object.assign({},L),A),"aria-disabled":O,tabIndex:x,className:null==t?void 0:t.own,"data-e2e":"CarouselDistribution","data-testid":n&&`${n}`,children:e("div",{style:R,"data-testid":n&&`${n}-container`,"data-e2e":"CarouselDistribution-Container",children:a.Children.toArray(b.map(((t,i)=>e("div",{style:j,"data-testid":n&&`${n}-slide-${i}`,"data-e2e":`CarouselDistribution-Slide-${i}`,children:e(Zd,{config:t,position:i,container:"row",visible:_(i)})}))))})})}):null}const ou=Object.freeze([]);function ru({schema:t,testId:n}){const i=eo(),o=d((()=>Ci(i)([{display:"flex",flexDirection:"column"}])),[i]),s=m((e=>{var t;return(null===(t=e.progression)||void 0===t?void 0:t.groupSize)||0})),l=m((e=>{var t;return(null===(t=e.progression)||void 0===t?void 0:t.indexGroups)||ou})),c=m((e=>e.slots||ou)),u=d((()=>l.map((e=>e.map((e=>c[e])).filter((e=>null!=e))))),[l,c]),p=r(null),f=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),y=Ma(),{tabIndex:h,isDisabled:v,styles:g}=St(y);return u.length?e(Uo,{styles:t.styles,children:({classnames:i})=>e("div",{ref:p,"data-testid":n,"data-e2e":"GroupedDistribution","aria-disabled":v,tabIndex:h,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},g),children:a.Children.toArray(u.map(((r,l)=>e(is,{effect:t.transition,visible:l===f,parentElement:p.current,containerClassName:[o,null==i?void 0:i.own].filter(Boolean).join(" ")||void 0,children:a.Children.toArray(r.map(((t,i)=>{const a=s*l+i;return e(Zd,{config:t,position:a,visible:l===f,container:"column",testId:n?`${n}-child${a}`:void 0})})))}))))})}):null}const su={action:{CaptureOnly:"CaptureOnly",Url:"Url",Fulfillment:"Fulfillment",ExternalPaymentTrigger:"ExternalPaymentTrigger"},urlBehavior:{newTab:"newTab",roktWebViewSDK:"roktWebViewSDK",self:"self"},signalType:{SignalResponse:"SignalResponse",SignalGatedResponse:"SignalGatedResponse",SignalSecondaryResponse:"SignalSecondaryResponse"},conversionType:{Default:"Default",RealTime:"RealTime",RealTimeReferral:"RealTimeReferral"}};function lu(e,t,n=!1){return Error(`Could not translate ${e} with guid: ${t}${n?" for child layout":""}`)}function cu(e,t=!1){var n;try{if(e.responseOptionsMap||t)return Object.assign(Object.assign({},e),{responseOptionsMap:K(du,null!==(n=e.responseOptionsMap)&&void 0!==n?n:{})});{const t=`Creative: ${e.instanceGuid}, did not receive a valid response options map.`;throw new jt("NO_CREATIVE_RESPONSE_OPTIONS_MAP",t)}}catch(n){throw n.message?n:lu("Creative",e.instanceGuid,t)}}function du(e){try{let t,n;if(e.urlBehavior&&(t=su.urlBehavior[e.urlBehavior]),e.conversionType&&(n=su.conversionType[e.conversionType]),"External"===e.action){const t=`Creative response with instanceGuid '${e.instanceGuid}' uses legacy action type 'External'. This should be 'ExternalPaymentTrigger'.`;throw new jt("LEGACY_EXTERNAL_ACTION_TYPE",t)}return Object.assign(Object.assign({},e),{urlBehavior:t,action:su.action[e.action],signalType:su.signalType[e.signalType],conversionType:n})}catch(t){throw t.message?t:lu("CreativeResponse",e.instanceGuid)}}function uu(e,t,n){try{return JSON.parse(e)}catch(e){throw Error(`Parse JSON failed, invalid JSON file for ${t} with guid ${n}.`)}}function pu(){o((()=>{const e=new ResizeObserver(function(e=100){let t;return()=>{t&&clearTimeout(t),t=setTimeout((()=>{var e,n;null===(n=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===n||n.resize(),t=void 0}),e)}}());return e.observe(document.body),()=>{e.disconnect()}}),[])}const fu={OneByOneDistribution:function(t){if("OneByOneDistribution"===t.type)return e(Qd,{schema:t.node})},StackedDistribution:function(t){if("StackedDistribution"===t.type)return e(nu,{schema:t.node})},ProgressIndicator:function(t){if("ProgressIndicator"===t.type)return e(Xd,{schema:t.node})},ProgressControl:function(t){if("ProgressControl"===t.type)return e(iu,{schema:t.node})},Overlay:function(t){if("Overlay"===t.type)return e(Ps,{schema:t.node})},CloseButton:function(t){if("CloseButton"===t.type)return e(Ns,{schema:t.node})},EscapeHatch:(yu=[function(t,n){if(Ct("CloseButton",t)){const n=JSON.parse(t.node.data);return e(Ns,{schema:n.node,action:n.action})}},Nr],e=>yu.reduce(((t,n)=>void 0===t?n(e):t),void 0)),CarouselDistribution:function(t){if("CarouselDistribution"===t.type)return e(au,{schema:t.node})},GroupedDistribution:function(t){if("GroupedDistribution"===t.type)return e(ru,{schema:t.node})},BottomSheet:function(t){if("BottomSheet"===t.type)return e(Gs,{schema:t.node})}};var yu;function mu(e,t){e({type:an,payload:{name:"SignalActivation",parentGuid:t}})}function hu({pageInstanceGuid:t}){var n,i,a,r,s,l;const c=m((e=>e.layout),j),d=y(),u=m((e=>({breakpoint:e.breakpoint,progression:Kd(e),customStates:e.customStates.root,domainStates:e.domainStates[Vd]})),j),p=m((e=>e.slots.length)),f=m((e=>{var t;const n=Number(null!==(t=e.serializableCache.get(tu))&&void 0!==t?t:"");return p-n})),h=m(Jd);In(ji(),d),o((()=>(c&&document.body.addEventListener("click",mu.bind(null,d,c.instanceGuid),{once:!0}),()=>{c&&document.body.removeEventListener("click",mu.bind(null,d,c.instanceGuid))})),[null==c?void 0:c.instanceGuid]),pu(),o((()=>{if(c){const e={type:an,payload:{name:"SignalImpression",parentGuid:c.instanceGuid}},t={type:Cs,payload:{code:"LAYOUT_IMPRESSED"}};d(e),d(t)}}),[c]);const v=e=>{d({type:Md.REPORT_ERROR,payload:e})},g=m((e=>e.breakpoint.initialised));if(c&&g){const o=na({})({state:{progression:(null!==(i=null===(n=u.progression)||void 0===n?void 0:n.activeGroupIndex)&&void 0!==i?i:0)+1,maxProgression:null!==(r=null===(a=u.progression)||void 0===a?void 0:a.totalGroups)&&void 0!==r?r:1,availableOffersCount:null!==(l=null===(s=u.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:p,selectedCatalogItemQuantity:h,hiddenItemCount:f}}),y=Yr(v);return e(Ya,{info:{layoutType:"OuterLayout",pageInstanceGuid:t},children:e(ra,{value:o,children:e(Pi,{value:y,overrides:fu,children:e(Li.Provider,{value:u,children:e(Ai.Provider,{value:d,children:e(da.Provider,{value:"OUTER",children:e(to.Provider,{value:c.layoutSchemaVersion,children:e(Di,{children:e=>e(c.layoutSchema)})})})})})})})})}return null}var vu=Object.freeze({__proto__:null,getDistribution:function e(t){var n;switch(t.type){case"OneByOneDistribution":case"StackedDistribution":case"CarouselDistribution":case"GroupedDistribution":return t;case"Row":case"Column":case"When":case"ZStack":case"FlowRow":case"InlineContainer":case"ScrollableRow":case"ScrollableColumn":case"BottomSheet":case"Overlay":for(const n of t.node.children){const t=e(n);if(t)return t}break;case"EscapeHatch":try{const{name:i,body:a}=JSON.parse(t.node.data);if(("loading-extension"===i||"minimized-bottomsheet-extension"===i)&&(null===(n=null==a?void 0:a.children)||void 0===n?void 0:n.length))for(const t of a.children){const n=e(t);if(n)return n}break}catch(e){break}case"StaticImage":case"DataImage":case"DataImageCarousel":case"RichText":case"BasicText":case"ProgressIndicator":case"CreativeResponse":case"StaticLink":case"CloseButton":case"ProgressControl":case"StaticIcon":case"DataIcon":case"SlideStateTrigger":case"ToggleButtonStateTrigger":case"TimerStateTrigger":case"CatalogStackedCollection":case"CatalogCarouselCollection":case"CatalogResponseButton":case"CatalogQuantityOption":case"CatalogRadioGroup":case"CatalogQuantityCounter":case"PartnerEventButtonTrigger":case"CopyToClipboardButton":case"ButtonStateTrigger":case"CatalogCombinedCollection":case"IconGroup":break;default:!function(e){throw Error(`Could not handle layout: ${JSON.stringify(e)}`)}(t)}},getDistributionViewableItems:function(e){switch(null==e?void 0:e.type){case"CarouselDistribution":case"GroupedDistribution":return e.node.viewableItems;default:return}}}),gu=Object.assign({},vu);function*bu(e,t){const n=gu.getDistribution(t),i=null==n?void 0:n.type,a=yield Ye(Sl),o=function(e=0,t){var n;switch(null==t?void 0:t.type){case"CarouselDistribution":case"GroupedDistribution":{const i=Math.min(t.node.viewableItems.length,e);return null!==(n=t.node.viewableItems[i])&&void 0!==n?n:1}default:return 1}}("number"==typeof a?a:0,n);"OneByOneDistribution"!==i&&"CarouselDistribution"!==i&&"GroupedDistribution"!==i||(yield ft({type:Gd.INITIALISE_PROGRESSION,payload:{currentGroupIndex:0,totalCount:e,groupSize:o}}))}function*Iu(e,t){var n;const{instanceGuid:i,layoutSchemaVersion:a,outerLayoutSchema:o,slots:r}=t.payload;i?yield ft({type:an,payload:{name:"SignalLoadComplete",parentGuid:i}}):yield ft({type:Ss,payload:{level:zs,code:al,message:"Layout instance guid does not exist"}}),yield ft({type:Od,payload:{modules:r.map((e=>e.layoutVariant.moduleName))}}),yield ft({type:cs,payload:o.breakpoints}),yield ft({type:Gd.LAYOUT_UPDATE,payload:{instanceGuid:i,layoutSchemaVersion:a,layoutSchema:o.layout,settings:o.settings}}),yield ft({type:Gd.SET_SLOTS,payload:r}),pe(o.settings)||(yield ft({type:Gd.SET_SETTINGS,payload:o.settings})),yield*bu(r.length,o.layout);const s=r.some((e=>{var t;return(null===(t=e.offer)||void 0===t?void 0:t.catalogItems)&&e.offer.catalogItems.length>0}));s&&(yield ft({type:hn}));const l=yield*function*(e,t,n){const i=null==t?void 0:t.enablePartnerValidation,a=["add-to-cart"],o=n.some((e=>a.some((t=>t===e.layoutVariant.moduleName))));if(i&&o)try{yield pt(e.send,kl.PartnerValidationEvent.OPT_IN_TO_PARTNER_VALIDATION),yield dt(Eu,e,kl.PartnerValidationEvent.SHOW_PARTNER_VALIDATION_STATUS,(()=>({type:"ACTIVE/ADD",payload:{id:eu}})))}catch(e){return yield ft({type:Ss,payload:{level:Vs,code:rl,message:"Failed to establish partner validation."}}),"FAILURE"}return"OK"}(e.partner,o.settings,r);"OK"===l&&(yield pt(tc,e.display,o.display,null===(n=o.settings)||void 0===n?void 0:n.frameControls))}function*Eu(e,t,n){const i=st((i=>{const a=e.onEvent(t).subscribe((e=>{i(n(e))}));return()=>{a.unsubscribe()}}));for(;;){const e=yield yt(i);yield ft(e)}}function Su(e){return cp(e)}function Cu(e,t){return Error(`Migration process from v0_0 to v0_1 failed: could not transform ${e} node. For more details: ${t}`)}const wu=le(re([function(e){return"Row"===e.type&&Au(e.node.children)},function(e){return"Column"===e.type&&Au(e.node.children)},_u,Du])),Tu=le(re([function(e){return"Row"===e.type&&Nu(e.node.children)},function(e){return"Column"===e.type&&Nu(e.node.children)},Du,_u,function(e){return"DataImage"===e.type},function(e){return"When"===e.type&&Nu(e.node.children)}])),xu=le(re([function(e){return"Row"===e.type&&Lu(e.node.children)},function(e){return"Column"===e.type&&Lu(e.node.children)},Du,_u])),Ou=le(re([function(e){return"Row"===e.type&&Ru(e.node.children)},function(e){return"Column"===e.type&&Ru(e.node.children)},_u,function(e){return"RichText"===e.type},Du,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&Ru(e.node.children)},function(e){return"StaticLink"===e.type&&Ru(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CloseButton"===e.type&&Ru(e.node.children)}]));function Au(e){return wu(e)}function Nu(e){return Tu(e)}function Lu(e){return xu(e)}function Ru(e){return Ou(e)}function _u(e){return"StaticImage"===e.type}function Du(e){return"BasicText"===e.type}const ku=ye(["styles","elements","link"]),Pu=ye(["styles","elements","activeIndicator"]),$u=ye(["styles","elements","indicator"]),ju=ye(["styles","elements","seenIndicator"]),Fu=ye(["focussed"]),Gu=ye(["hovered"]),Mu=ye(["default"]),Bu=ye(["pressed"]),Uu=e=>{var t;return{text:null!==(t=null==e?void 0:e.text)&&void 0!==t?t:{}}},Vu=I(S(["styles","elements","link"]),X(fe(ku,F((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default})))),fe(ku,F(I(ke("focussed"),fe(Fu,Uu)))),fe(ku,F(I(ke("hovered"),fe(Gu,Uu)))),fe(ku,F(I(ke("default"),fe(Mu,Uu)))),fe(ku,F(I(ke("pressed"),fe(Bu,Uu)))))),zu=X(I(S(["styles","elements","activeIndicator"]),fe(Pu,F((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","indicator"]),fe($u,F((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","seenIndicator"]),fe(ju,F((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))));function Hu(e,t){return e?{elements:{own:e.elements.own.map(t)}}:void 0}const Wu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),qu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),Ku=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),Yu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),Ju=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Zu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Qu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Xu=e=>{switch(e){case"is":return"is";case"is not":return"is-not";case"is below":return"is-below";case"is above":return"is-above";default:throw Cu("When",`Invalid condition: ${e}`)}},ep=e=>{switch(e){case"breakpoint":return"Breakpoint";case"progression":return"Progression";case"position":return"Position";default:throw Cu("When",`Invalid target: ${e}`)}},tp=e=>{const{target:t,condition:n,value:i}=e;return{type:ep(t),predicate:{condition:Xu(n),value:i}}};function np(e){return{predicates:e.predicates.map(tp),children:e.children.map((e=>cp(e)))}}function ip(e){const t={type:"FadeInOut",settings:{duration:e.transition.settings.duration}};return{styles:e.style,transition:t}}function ap(e){const t=e.children.map((e=>cp(e)));if(Au(t))return Object.assign(Object.assign({},e),{children:t,styles:Hu(e.styles,Ju)});throw Cu("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function op(e){const t=e.children.map((e=>cp(e)));if(Nu(t))return Object.assign(Object.assign({},e),{children:t,styles:Hu(e.styles,Zu)});throw Cu("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function rp(e){const t=e.children.map((e=>cp(e)));if(Lu(t))return Object.assign(Object.assign({},e),{children:t,styles:Hu(e.styles,Qu)});throw Cu("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}const sp=e=>({own:e.overlayContainer,wrapper:e.overlayWrapper});function lp(e){var t,n;const i=(null===(t=e.styles)||void 0===t?void 0:t.elements)?{elements:sp(null===(n=e.styles)||void 0===n?void 0:n.elements)}:void 0,a=e.children.map((e=>cp(e)));if(Ru(a))return Object.assign(Object.assign({},e),{styles:i,children:a});throw Cu("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function cp(e){switch(e.type){case"When":return{type:"When",node:np(e.node)};case"OneByOneDistribution":return{type:e.type,node:ip(e.node)};case"Overlay":return{type:e.type,node:lp(e.node)};case"Column":return{type:e.type,node:(r=e.node,{styles:Hu(r.styles,Wu),children:r.children.map((e=>cp(e)))})};case"Row":return{type:e.type,node:(o=e.node,{styles:Hu(o.styles,qu),children:o.children.map((e=>cp(e)))})};case"RichText":return{type:e.type,node:(a=e.node,Vu(a))};case"CloseButton":return{type:e.type,node:ap(e.node)};case"CreativeResponse":return{type:e.type,node:op(e.node)};case"StaticLink":return{type:e.type,node:rp(e.node)};case"StaticImage":return{type:e.type,node:(i=e.node,Object.assign(Object.assign({},i),{styles:Hu(i.styles,Ku)}))};case"DataImage":return{type:e.type,node:(n=e.node,Object.assign(Object.assign({},n),{styles:Hu(n.styles,Yu)}))};case"ProgressIndicator":return{type:e.type,node:(t=e.node,zu(t))};default:return e}var t,n,i,a,o,r}function dp(e){return vf(e)}function up(e,t){return Error(`Migration process from v0_23 to v1_0 failed: could not transform ${e} node. For more details: ${t}`)}const pp=e=>"scroll"===e||"auto"===e?"visible":e,fp=ye(["elements","own"]),yp=ye(["transitions","transition","value","own"]),mp=ye(["elements","wrapper"]),hp=ye(["transitions","transition","value","wrapper"]),vp=ye(["elements","indicator"]),gp=ye(["transitions","transition","value","indicator"]),bp=ye(["elements","activeIndicator"]),Ip=ye(["transitions","transition","value","activeIndicator"]),Ep=ye(["elements","seenIndicator"]),Sp=ye(["transitions","transition","value","seenIndicator"]),Cp=ye(["default","container","overflow"]),wp=ye(["pressed","container","overflow"]),Tp=ye(["hovered","container","overflow"]),xp=ye(["focussed","container","overflow"]),Op=ye(["disabled","container","overflow"]),Ap=ye(["container","overflow"]),Np=X(I(S(["default","container","overflow"]),fe(Cp,pp)),I(S(["pressed","container","overflow"]),fe(wp,pp)),I(S(["hovered","container","overflow"]),fe(Tp,pp)),I(S(["focussed","container","overflow"]),fe(xp,pp)),I(S(["disabled","container","overflow"]),fe(Op,pp))),Lp=I(S(["container","overflow"]),fe(Ap,pp)),Rp=X(I(S(["elements","own"]),fe(fp,F(Np))),I(S(["transitions","transition","value","own"]),fe(yp,Lp))),_p=I(ke("transitions"),(e=>{var t;return P(Te(["transitions"]),Pe("conditionalTransitions",null===(t=e.transitions)||void 0===t?void 0:t.transition))(e)})),Dp=X(Rp,_p),kp=X(I(S(["elements","wrapper"]),fe(mp,F(Np))),I(S(["transitions","transition","value","wrapper"]),fe(hp,Lp))),Pp=X(I(S(["elements","indicator"]),fe(vp,F(Np))),I(S(["transitions","transition","value","indicator"]),fe(gp,Lp))),$p=X(I(S(["elements","activeIndicator"]),fe(bp,F(Np))),I(S(["transitions","transition","value","activeIndicator"]),fe(Ip,Lp))),jp=X(I(S(["elements","seenIndicator"]),fe(Ep,F(Np))),I(S(["transitions","transition","value","seenIndicator"]),fe(Sp,Lp)));function Fp(e){return"StaticImage"===e.type}function Gp(e){return"StaticIcon"===e.type}function Mp(e){return"BasicText"===e.type}function Bp(e){return"DataImage"===e.type}function Up(e){return"DataIcon"===e.type}function Vp(e){return"RichText"===e.type}function zp(e){return"SlideStateTrigger"===e.type}function Hp(e){return"ToggleButtonStateTrigger"===e.type}const Wp=le(re([function(e){return"Row"===e.type&&qp(e.node.children)},function(e){return"Column"===e.type&&qp(e.node.children)},Fp,Gp,Vp,Mp,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&qp(e.node.children)},function(e){return"StaticLink"===e.type&&qp(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CarouselDistribution"===e.type},function(e){return"GroupedDistribution"===e.type},function(e){return"CloseButton"===e.type&&qp(e.node.children)},function(e){return"ProgressControl"===e.type&&af(e.node.children)},function(e){return"ZStack"===e.type&&qp(e.node.children)},function(e){return"FlowRow"===e.type&&qp(e.node.children)},zp,Hp]));function qp(e){return Wp(e)}const Kp=X(Rp,kp,_p);function Yp(e){const t=e.children.map((e=>vf(e)));if(qp(t))return Object.assign(Object.assign({},Te(["settings"],e)),{children:t,allowBackdropToClose:e.settings.allowBackdropToClose,styles:e.styles?Kp(e.styles):void 0});throw up("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function Jp(e){const t=e.children.map((e=>vf(e)));if(af(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Dp(e.styles):void 0});throw up("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function Zp(e){const t=e.children.map((e=>vf(e)));if(rf(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Dp(e.styles):void 0});throw up("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function Qp(e){const t=e.children.map((e=>vf(e)));if(af(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Dp(e.styles):void 0});throw up("ProgressControl",`Invalid schema: ${JSON.stringify(e)}`)}const Xp=X(Rp,Pp,$p,jp,_p);const ef=le(re([Mp,Fp,Gp,Bp,Up,function(e){return"Row"===e.type&&tf(e.node.children)},function(e){return"FlowRow"===e.type&&tf(e.node.children)},function(e){return"Column"===e.type&&tf(e.node.children)},function(e){return"ZStack"===e.type&&tf(e.node.children)},function(e){return"When"===e.type&&tf(e.node.children)}]));function tf(e){return ef(e)}const nf=le(re([Mp,Fp,Gp,function(e){return"Row"===e.type&&af(e.node.children)},function(e){return"FlowRow"===e.type&&af(e.node.children)},function(e){return"Column"===e.type&&af(e.node.children)},function(e){return"ZStack"===e.type&&af(e.node.children)},function(e){return"When"===e.type&&af(e.node.children)}]));function af(e){return nf(e)}const of=le(re([Mp,Fp,Gp,Bp,Up,function(e){return"Row"===e.type&&rf(e.node.children)},function(e){return"FlowRow"===e.type&&rf(e.node.children)},function(e){return"Column"===e.type&&rf(e.node.children)},function(e){return"ZStack"===e.type&&rf(e.node.children)},function(e){return"When"===e.type&&rf(e.node.children)}]));function rf(e){return of(e)}function sf(e){const t=e.children.map((e=>vf(e)));if(tf(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Dp(e.styles):void 0});throw up("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}function lf(e){const t=e.children.map((e=>vf(e)));if(rf(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Dp(e.styles):void 0});throw up("CatalogResponseButton",`Invalid schema: ${JSON.stringify(e)}`)}function cf(e){return"Row"===e.type&&pf(e.node.children)}function df(e){return"Column"===e.type&&pf(e.node.children)}const uf=le(re([Mp,Fp,Gp,Bp,Up,Vp,function(e){return"StaticLink"===e.type},zp,Hp,function(e){return"CatalogResponseButton"===e.type},cf,function(e){return"FlowRow"===e.type&&pf(e.node.children)},df,function(e){return"ZStack"===e.type&&pf(e.node.children)},function(e){return"When"===e.type&&pf(e.node.children)}]));function pf(e){return uf(e)}const ff=re([cf,df]);function yf(e){const t=vf(e.template);if(function(e){return ff(e)}(t))return Object.assign(Object.assign({},e),{template:t,styles:e.styles?Dp(e.styles):void 0});throw up("CatalogStackedCollection",`Invalid schema: ${JSON.stringify(e)}`)}function mf(e){const t=e.children.map((e=>vf(e)));if(tf(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Dp(e.styles):void 0});throw up("ToggleButtonStateTrigger",`Invalid schema: ${JSON.stringify(e)}`)}function hf(e){const t=e.transition?{inTransition:e.transition.in,outTransition:e.transition.out}:void 0;return Object.assign(Object.assign({},e),{children:e.children.map((e=>vf(e))),transition:t})}function vf(e){switch(e.type){case"Row":return{type:e.type,node:(v=e.node,Object.assign(Object.assign({},v),{children:v.children.map((e=>vf(e))),styles:v.styles?Dp(v.styles):void 0}))};case"When":return{type:e.type,node:hf(e.node)};case"FlowRow":return{type:e.type,node:(h=e.node,Object.assign(Object.assign({},h),{styles:h.styles?Dp(h.styles):void 0,children:h.children.map((e=>vf(e)))}))};case"Column":return{type:e.type,node:(m=e.node,Object.assign(Object.assign({},m),{children:m.children.map((e=>vf(e))),styles:m.styles?Dp(m.styles):void 0}))};case"ZStack":return{type:e.type,node:(y=e.node,Object.assign(Object.assign({},y),{styles:y.styles?Dp(y.styles):void 0,children:y.children.map((e=>vf(e)))}))};case"Overlay":return{type:e.type,node:Yp(e.node)};case"ProgressControl":return{type:e.type,node:Qp(e.node)};case"CarouselDistribution":return{type:"CarouselDistribution",node:(f=e.node,Object.assign(Object.assign({},Te(["settings"],f)),{viewableItems:f.settings.viewableItems,peekThroughSize:f.settings.peekThroughSize,styles:f.styles?Dp(f.styles):void 0}))};case"CloseButton":return{type:"CloseButton",node:Jp(e.node)};case"CreativeResponse":return{type:"CreativeResponse",node:Zp(e.node)};case"GroupedDistribution":return{type:"GroupedDistribution",node:(p=e.node,Object.assign(Object.assign({},Te(["settings"],p)),{viewableItems:p.settings.viewableItems,transition:p.settings.transition,styles:p.styles?Dp(p.styles):void 0}))};case"OneByOneDistribution":return{type:"OneByOneDistribution",node:(u=e.node,Object.assign(Object.assign({},u),{styles:u.styles?Dp(u.styles):void 0}))};case"ProgressIndicator":return{type:"ProgressIndicator",node:(c=e.node,Object.assign(Object.assign({},Te(["settings"],c)),{startPosition:null===(d=c.settings)||void 0===d?void 0:d.startPosition,styles:c.styles?Xp(c.styles):void 0}))};case"SlideStateTrigger":return{type:"SlideStateTrigger",node:(l=e.node,Object.assign(Object.assign({},l),{styles:l.styles?Dp(l.styles):void 0}))};case"StackedDistribution":return{type:"StackedDistribution",node:(s=e.node,Object.assign(Object.assign({viewableItems:[]},s),{styles:s.styles?Dp(s.styles):void 0}))};case"StaticLink":return{type:"StaticLink",node:sf(e.node)};case"ToggleButtonStateTrigger":return{type:"ToggleButtonStateTrigger",node:mf(e.node)};case"CatalogResponseButton":return{type:"CatalogResponseButton",node:lf(e.node)};case"CatalogStackedCollection":return{type:"CatalogStackedCollection",node:yf(e.node)};case"RichText":return{type:"RichText",node:(r=e.node,Object.assign(Object.assign({},r),{styles:r.styles?_p(r.styles):void 0}))};case"DataImage":return{type:"DataImage",node:(o=e.node,Object.assign(Object.assign({},o),{styles:o.styles?_p(o.styles):void 0}))};case"StaticImage":return{type:"StaticImage",node:(a=e.node,Object.assign(Object.assign({},a),{styles:a.styles?_p(a.styles):void 0}))};case"DataIcon":return{type:"DataIcon",node:(i=e.node,Object.assign(Object.assign({},i),{styles:i.styles?_p(i.styles):void 0}))};case"StaticIcon":return{type:"StaticIcon",node:(n=e.node,Object.assign(Object.assign({},n),{styles:n.styles?_p(n.styles):void 0}))};case"BasicText":return{type:"BasicText",node:(t=e.node,Object.assign(Object.assign({},t),{styles:t.styles?_p(t.styles):void 0}))};default:return e}var t,n,i,a,o,r,s,l,c,d,u,p,f,y,m,h,v}function gf(e){const t=e.split("."),n=Number(t[0]),i=Number(t[1]);if(t.length<2||Number.isNaN(n)||Number.isNaN(i))throw Error(`Fail to convert version ${e} to a valid version.`);return{major:n,minor:i}}function bf(e,t){return e.major===t.major&&e.minor===t.minor}const If=(e,t,n)=>E([Ce(e),$e(t)])(n);function Ef(e,t){return bf(t,{major:0,minor:0})?Ef(Su(e),{major:0,minor:1}):function(e,t){return 0===t.major&&If(1,23,t.minor)}(0,t)?Ef(dp(e),{major:1,minor:0}):e}function Sf(e,t){return bf(t,{major:0,minor:0})?Sf(function(e){return Object.assign(Object.assign({},e),{layout:Su(e.layout)})}(e),{major:0,minor:1}):function(e,t){return 0===t.major&&If(1,23,t.minor)}(0,t)?Sf(function(e){return Object.assign(Object.assign({},e),{layout:dp(e.layout)})}(e),{major:1,minor:0}):e}function Cf(e,t,n,i){const a=gf(n);if(i){const s=gf(i);if(r=a,(o=s).major<r.major||o.major===r.major&&o.minor<r.minor||bf(s,a))return t(e,s);throw Error(`Could not migrate received layout config, config schema version ${i} is higher than the supported version ${n}.`)}return t(e,gf("0.0"));var o,r}function wf(e){var t;try{return Object.assign(Object.assign({},je(e)),{offer:Object.assign(Object.assign({},je(e.offer)),{creative:cu(e.offer.creative)}),layoutVariant:Object.assign(Object.assign({},je(e.layoutVariant)),{layoutVariantSchema:"string"==typeof e.layoutVariant.layoutVariantSchema?uu(e.layoutVariant.layoutVariantSchema,"LayoutSlotLayoutVariant",e.instanceGuid):e.layoutVariant.layoutVariantSchema,childLayouts:F(Tf,null!==(t=e.layoutVariant.childLayouts)&&void 0!==t?t:[])})})}catch(t){throw t.message?t:lu("Slot",e.instanceGuid)}}function Tf(e){return Object.assign(Object.assign({},je(e)),{childLayoutSchema:"string"==typeof e.childLayoutSchema?uu(e.childLayoutSchema,"ChildLayoutRootSchema",e.childLayoutId):e.childLayoutSchema})}function xf(e){if(e){const t=function(e){try{return Object.assign(Object.assign({},je(e)),{outerLayoutSchema:"string"==typeof e.outerLayoutSchema?uu(e.outerLayoutSchema,"LayoutRootLayoutSchema",e.instanceGuid):e.outerLayoutSchema,slots:F(wf,e.slots)})}catch(t){throw t.message?t:lu("LayoutConfig",e.instanceGuid)}}(e);return function(e,t){const{layoutSchemaVersion:n}=e,i=ye(["outerLayoutSchema"]),a=ye(["slots"]),o=ye(["layoutVariant","layoutVariantSchema"]);return X(fe(a,F(fe(o,(e=>Cf(e,Ef,t,n))))),fe(i,(e=>Cf(e,Sf,t,n))))(e)}(t,qs.DCUI_SCHEMA_VERSION)}}const Of=T([[Y({signalType:j("SignalSecondaryResponse")}),function*(e,t){return yield qe({type:Ss,payload:{level:Hs,code:nl,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}],[Y({isPositive:j(!0)}),function*(e,t,n,i){var a,o;if("url"in e&&e.url){const r=e.instanceGuid;"SignalProductItemResponse"===e.signalType&&(Xt(o=i.payload)&&"catalogItemId"in o&&"productSku"in o&&"catalogId"in o&&"accountID"in o&&"string"==typeof o.catalogItemId&&"string"==typeof o.productSku&&"string"==typeof o.catalogId&&"string"==typeof o.accountID)?yield qe({type:an,payload:{name:"SignalProductItemResponse",parentGuid:r,objectData:{catalogItemId:i.payload.catalogItemId,productSku:i.payload.productSku,catalogId:i.payload.catalogId,accountId:i.payload.accountID}}}):yield qe({type:an,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:r,responseActionPayload:{name:"Url",transformedTrafficURL:e.url,creativeInstanceGuid:e.creativeInstanceGuid}}});const s=t.getOverrideLinkNavigation()?"overrideLinkNavigation":null!==(a=e.urlBehavior)&&void 0!==a?a:"newTab",l=yield*function*(e,t,n){try{const i=yield ze(Ml,t),a=zl(i)?i.ref:void 0;return yield ze(e.addAdvertiserWindowRef,a,n),zl(i)||"newTab"!==t.urlBehavior?"SUCCESS":(yield qe({type:Ss,payload:{level:Hs,code:il,message:`Did not receive a window reference opening link ${t.url}`}}),"UNSPECIFIED")}catch(e){return yield qe({type:Ss,payload:{level:Hs,code:il,message:`Errored attempting to open link ${t.url}: ${e.message}`,stack:e.stack}}),"ERROR"}}(t,{url:e.url,urlBehavior:s,external:{partner:n}},r);return"self"===s?"END":l}return yield qe({type:Ss,payload:{level:Hs,code:nl,message:"URL response doesn't have a valid url",additionalInformation:{instanceGuid:e.instanceGuid}}}),"ERROR"}],[O,function*(){return"EXPLICIT_DISMISSAL"}]]);function*Af(e){return yield qe({type:Ss,payload:{level:Hs,code:nl,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}function*Nf(e,t){let n="IMPLICIT_DISMISSAL";const i=t.payload.offerPositionIndex,a=Xt(t.payload)||en(t.payload)||Qt(t.payload)?t.payload:t.payload.responseOption;switch(a.action){case"Url":yield qe({type:sn,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:Cs,payload:{code:"CREATIVE_RESPONSE",message:"creative positive response",data:{type:a.action,isPositive:a.isPositive,responseInstanceGuid:a.instanceGuid}}}),yield qe({type:sn,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Af(a):yield*Of(a,e.context,e.partner,t);break;case"CaptureOnly":yield qe({type:sn,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:sn,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Af(a):yield*function*(e){return yield qe({type:an,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:"CaptureOnly",creativeInstanceGuid:e.creativeInstanceGuid}}}),e.isPositive?"SUCCESS":"EXPLICIT_DISMISSAL"}(a);break;case"Fulfillment":yield qe({type:Ss,payload:{level:Hs,code:"INCORRECTLY_HANDLE_FULFILLMENT_ACTION",message:`Fulfillment action is incorrectly handled by the orchestrator instead of a module with the option ID: ${a.instanceGuid}`}}),n="ERROR";break;case"ExternalPaymentTrigger":yield qe({type:Ss,payload:{level:Hs,code:"INCORRECTLY_HANDLE_EXTERNAL_ACTION",message:`External action was dispatched as an engagement erroneously. Instance GUID: ${a.instanceGuid}`}}),n="ERROR"}tn(t.payload)||(yield qe(function(e,t){switch(e){case"SUCCESS":return{type:Pd,payload:{event:"Completed",completionReason:"Success",offerPositionIndex:t}};case"UNSPECIFIED":return{type:Pd,payload:{event:"Completed",completionReason:"Unspecified",offerPositionIndex:t}};case"ERROR":return{type:Pd,payload:{event:"Completed",completionReason:"Error",offerPositionIndex:t}};case"EXPLICIT_DISMISSAL":return{type:Pd,payload:{event:"Dismissed",dismissalReason:"Explicit",offerPositionIndex:t}};case"IMPLICIT_DISMISSAL":return{type:Pd,payload:{event:"Dismissed",dismissalReason:"Implicit",offerPositionIndex:t}};default:return{type:_d,payload:{offerProcessStatus:"END"}}}}(n,i)))}function Lf(e,t,n,i){return st((a=>(i().then((e=>Promise.all([t.getRoktPageInstanceGuid(),(t.getUId||t.getPluginInstanceId)()]).then((([t,n])=>Object.assign(Object.assign({},e),{pageInstanceGuid:t,pluginInstanceId:n}))).catch((()=>e)))).then((({moduleConnectorBuilder:t,pageInstanceGuid:i,pluginInstanceId:o})=>{const r=`rokt-${n}-${o}`.toLowerCase();if(!customElements.get(r)){const o=t.withGatewayFactory(e).withLogger((e=>{a({type:Ss,payload:{level:e.level,code:e.code,message:e.message,additionalInformation:Object.assign(Object.assign({},e.additionalInformation),{moduleName:n,layoutType:"LayoutVariant",pageInstanceGuid:null!=i?i:"N/A"})}})})).build();customElements.define(r,o)}})).catch((e=>{const t=e&&"object"==typeof e&&"message"in e?e.message:void 0,i=e&&"object"==typeof e&&"stack"in e?e.stack:void 0;a({type:Ss,payload:{level:Pt,code:"FAILED_TO_LOAD_MODULE",message:t,additionalInformation:{stack:i,reason:t?void 0:e,moduleName:n}}}),a(lt)})),()=>{})))}const Rf={"standard-marketing":()=>Promise.resolve().then((function(){return rm})),"add-to-cart":()=>Promise.resolve().then((function(){return vh})),"instant-purchase":()=>Promise.resolve().then((function(){return Hv})),"layouts-xp-sandbox":()=>Promise.resolve().then((function(){return Cg}))};function*_f(e,t,n){let i=yield Ye((e=>e.module.loadedModules));for(const a of n.payload.modules)i&&!(null==i?void 0:i.includes(a))&&(i=[...i,a],yield Qe(Df,e,t,a))}function*Df(e,t,n){if(n in Rf){yield qe({type:xd,payload:n});const i=yield ze(Lf,e,t,n,Rf[n]);yield ze(el,i)}else yield qe({type:Ss,payload:{level:Vs,code:"INVALID_MODULE_NAME",message:`Could not load unknown module ${n}`}})}function*kf(e){const t=yield Ye((e=>gu.getDistributionViewableItems(e.layout?gu.getDistribution(e.layout.layoutSchema):void 0))),n=yield Ye((n=>{var i;const a=El(e.payload.activeBreakpoint)(n);return a>=0&&t?null!==(i=t[Math.min(t.length-1,a)])&&void 0!==i?i:1:void 0}));if("number"==typeof n){const e={type:Rd,payload:{groupSize:n}};yield qe(e)}}const Pf=T([[(e,t,n,i)=>"END"===e.offerProcessStatus,z({type:fs})],[(e,t,n,i)=>t.isLastOffer&&n,z({type:fs})],[(e,t,n,i)=>1===i&&!t.isLastOffer,z({type:Nd})],[O,z(void 0)]]);function*$f(e){const t=yield Ye((e=>({exists:null!==e.progression,isLastOffer:qd(e)}))),n=yield Ye((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.groupSize}));var i;null!=(i=t)&&i instanceof Object&&"exists"in i&&"isLastOffer"in i&&t.exists&&(yield*function*(e,t,n){const i=yield Ye((e=>e.settings.closeOnComplete)),a=Pf(e,t,"boolean"==typeof i&&i,n);a&&(a.type===fs&&(yield qe({type:sn,payload:{name:"PLACEMENT_COMPLETED"}})),yield qe(a))}(e.payload,t,n))}function jf(e){return e.type===Pd&&"Interactive"===e.payload.event}function Ff(e){return e.type===Pd&&"Interactive"!==e.payload.event}function*Gf(e){switch(e.payload.event){case"Dismissed":yield qe({type:_d,payload:{offerProcessStatus:"CONTINUE"}});break;case"Completed":yield qe({type:$d,payload:{key:"offerComplete",value:T([[j("Error"),z(-1)],[j("Success"),z(1)],[O,z(2)]])(e.payload.completionReason),offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:_d,payload:{offerProcessStatus:"CONTINUE"}});break;case"Interactive":yield qe({type:Yt,payload:{name:"Interactive",offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:sn,payload:{name:"PLACEMENT_INTERACTIVE"}})}}function*Mf(e,t){var n;try{const n=yield Ye((e=>{var t,n,i;return null!==(i=null===(n=null===(t=e.layout)||void 0===t?void 0:t.settings)||void 0===n?void 0:n.enablePartnerValidation)&&void 0!==i&&i}));n&&(yield ze(e.partner.send,kl.PartnerValidationEvent.SET_PARTNER_VALIDATION_STATUS,{errors:t.payload.errors}))}catch(i){const a=yield Ye((({slots:e})=>{var n,i;return"number"==typeof t.payload.offerPositionIndex?null!==(i=null===(n=e.at(t.payload.offerPositionIndex))||void 0===n?void 0:n.layoutVariant.moduleName)&&void 0!==i?i:"Unknown":"orchestrator"})),o=null!==(n=yield ze(e.context.getRoktPageInstanceGuid))&&void 0!==n?n:"N/A",r={type:Ss,payload:{level:$t,code:"PARTNER_VALIDATION_UPDATE_FAILED",message:"Failed to update the partner with error status",additionalInformation:{moduleName:a,layoutType:"number"==typeof t.payload.offerPositionIndex?"LayoutVariant":"OuterLayout",pageInstanceGuid:o}}};yield qe(r)}}function*Bf(e){const t=yield Ye((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:Gd.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:fs}),t?(yield qe({type:an,payload:{name:"SignalInstantPurchaseDismissal",parentGuid:t}}),yield qe({type:an,payload:{name:"SignalDismissal",parentGuid:t}})):yield qe({type:Ss,payload:{level:zs,code:al,message:"ParentGuid does not exist"}})}function*Uf(e){yield Xe(zf,e),yield Ze(yn,Vf)}function*Vf(e){const t=e.payload;yield qe({type:sn,payload:{name:"INITIATE_CART_ITEM_EVENT",body:t}})}function*zf(e){const t=function(e){return st((t=>{const n=e.onEvent("CART_SERVICE_RESPONSE").subscribe((e=>{t(e)}));return()=>{n.unsubscribe()}}))}(e);try{for(;;){const e=yield We(t);yield qe({type:mn,payload:e})}}catch(e){const t=Ul(e,"Error in cart service response listener","CART_SERVICE_RESPONSE_ERROR");yield qe(t)}finally{(yield Ke())&&t.close()}}function*Hf(e,t){yield Je([Ze(Ss,tl.bind(null,e.errorService.raise)),et(ps,Iu.bind(null,{display:e.displayService,partner:e.partnerInteractionService})),Ze(Od,_f.bind(null,t,e.contextService)),et(jd,Nf.bind(null,{partner:e.partnerInteractionService,context:e.contextService})),Ze(_d,$f),et(hn,Uf.bind(null,e.partnerInteractionService)),Ze(Ff,Gf),Xs(jf,Gf),et(cs,Al.bind(null,e.displayService)),et(fs,Jl.bind(null,e.contextService)),et(kd,Bf),et(Es,Sc),Ze(an,ic),Ze(cn,ac),Qs(Yt,Ic.bind(null,e.metricsService)),Qs(Is,oc.bind(null,e.rdnService)),Ze(Cs,nc.bind(null,e.errorService.raise)),et(ss,kf),Ze(rn,bc),Ze(dn,Ec.bind(null,{createChildPlugin:e.childPlugin.create,partner:e.partnerInteractionService,context:e.contextService})),et(un,Mf.bind(null,{partner:e.partnerInteractionService,context:e.contextService}))])}var Wf,qf,Kf,Yf,Jf,Zf=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},Qf=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};const Xf={[vn.SET_CUSTOM_STATE]:Gd.SET_CUSTOM_STATE,[vn.SET_DOMAIN_STATE]:Gd.SET_DOMAIN_STATE,[vn.SET_GLOBAL_OFFER_DATA_CART]:Gd.SET_GLOBAL_OFFER_DATA_CART,[vn.OFFER_LIFECYCLE]:Md.OFFER_LIFECYCLE,[vn.OFFER_ENGAGEMENT]:Md.OFFER_ENGAGEMENT,[vn.SET_PARTNER_VALIDATION_STATUS]:Md.SET_PARTNER_VALIDATION_STATUS};class ey{constructor(e){Wf.add(this),qf.set(this,void 0),Zf(this,qf,e,"f")}getState(e){const t=Qf(this,qf,"f").getState();return{breakpoint:t.breakpoint,progression:Kd(t),customStates:Cl(t,e.offerPositionIndex),domainStates:Yd(t,e.offerPositionIndex)}}dispatch(e,t){Qf(this,qf,"f").dispatch(Qf(this,Wf,"m",Jf).call(this,e,t))}subscribe(e,t){return t(this.getState(e)),Qf(this,qf,"f").subscribe((()=>{t(this.getState(e))}))}}function ty(e,t){const n=ot(),i={},a=it({reducer:Hd,devTools:{name:"Orchestrator"},preloadedState:Object.assign(Object.assign({},Wd()),t),middleware:e=>{return e({thunk:!1,serializableCheck:!1}).concat((t=i,e=>e=>n=>{if("object"==typeof n&&null!==n&&"type"in n){const i=n.type,a=t[`${i}`];return e(a?a(n):n)}return e(n)}),n);var t}}),o=(r=function(e){return new ey(e)}(a),s=e.childPlugin.create,l=e.partnerInteractionService.onEvent,(e,t)=>new Ca(r,s,e,t,l));var r,s,l;n.run(Hf,e,o),n.run(ec,e,xf);const c={};return Object.assign(Object.assign({},a),{extend:({reducer:e,interceptors:t,sagas:o})=>{e&&(Object.assign(c,e),a.replaceReducer(at(Object.assign(Object.assign({},Hd),c)))),t&&Object.assign(i,t),o&&n.run(o)}})}qf=new WeakMap,Wf=new WeakSet,Kf=function(e,t,n){return{type:e,payload:Object.assign(Object.assign({},t),{offerPositionIndex:n.offerPositionIndex,creativeInstanceGuid:n.creativeInstanceGuid})}},Yf=function(e,t){return t.type===cn?t.payload.signal.parentGuid||(t.payload.signal.parentGuid=e.creativeInstanceGuid):(t.payload.creativeInstanceGuid=e.creativeInstanceGuid,t.payload.parentGuid||(t.payload.parentGuid=e.creativeInstanceGuid)),t},Jf=function(e,t){return function(e){return e.type in Xf}(t)?Qf(this,Wf,"m",Kf).call(this,Xf[t.type],t.payload,e):t.type===an||t.type===cn?Qf(this,Wf,"m",Yf).call(this,e,t):t};var ny=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const iy={ctx:new Map([[vd.name,vd],[pd.name,pd],[Kc.name,Kc],[id.name,id],[yd.name,yd],[Td.name,Td]]),cache:[]};function ay(n,i){return ny(this,void 0,void 0,(function*(){const{pluginId:o,pageInstanceGuid:r}=yield function(e){return Promise.allSettled([(e.contextService.getUId||e.contextService.getPluginInstanceId)(),e.contextService.getRoktPageInstanceGuid()]).then((([e,t])=>({pluginId:"fulfilled"===e.status?e.value:_t.pluginId,pageInstanceGuid:"fulfilled"===t.status?t.value:_t.pageInstanceGuid}))).catch((()=>_t))}(i),s=f(n),l=ty(i);s.render(t(a.StrictMode,{children:[e(es,{}),e(io,{children:e(v,{store:l,children:t(Xa.Provider,{value:o,children:[e(ml,{}),e($i.Provider,{value:n,children:e(xr,{extensions:iy,extendStore:l.extend.bind(l),children:e(hu,{pageInstanceGuid:r})})})]})})})]}))}))}class oy{constructor(){this._subscribers=[]}add(e){this._subscribers.push(e)}unsubscribe(){this._subscribers.forEach((e=>e.unsubscribe()))}}const ry=()=>{},sy=(e=ry,t=ry,n=ry)=>"function"!=typeof e?e:{next:e,error:t,complete:n};class ly{constructor(e){this._setupFn=e}subscribe(e,t,n){const i=sy(e,t,n);let a,o=!0;const r={next:e=>{o&&i.next(e)},complete:()=>{o&&(a&&a(),i.complete(),o=!1)},error:e=>{o&&(i.error(e),o=!1)}};a=this._setupFn(r),o||a&&a();const s=new oy;return s.add({unsubscribe:()=>{a&&a(),o=!1}}),s}}class cy extends ly{constructor(){super((e=>(this._isComplete&&e.complete(),this._observers.push(e),()=>this._observers=this._observers.filter((t=>t!==e))))),this._observers=[],this._isComplete=!1}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){this._isComplete=!0;for(const e of this._observers)e.complete()}asObservable(){return new ly((e=>{const t=this.subscribe(e);return()=>t.unsubscribe()}))}}class dy extends cy{constructor(e){super(),this._lastValue=e}subscribe(e,t,n){const i=sy(e,t,n);return i.next(this._lastValue),super.subscribe(i)}next(e){return this._lastValue=e,super.next(e)}getValue(){return this._lastValue}}class uy extends cy{constructor(e=-1){super(),this._buffer=[],this._error=null,this._bufferLength=e}subscribe(e,t,n){const i=sy(e,t,n);let a=!0;return this._buffer.filter((e=>(e===this._error&&(a=!1),a))).forEach((e=>i.next(e))),this._error&&i.error(this._error),i.error=e=>{this._error=e,t(e)},super.subscribe(i)}next(e){this._error||this._addToBuffer(e),super.next(e)}error(e){this._error=e,this._addToBuffer(e),super.error(e)}_addToBuffer(e){-1!==this._bufferLength&&this._buffer.length===this._bufferLength?(this._buffer.shift(),this._buffer.push(e)):this._buffer.push(e)}}const py={CompletedBeforeEmit:"CompletedBeforeEmit"},fy=(e,t)=>{let n;const i="object"==typeof t;return new Promise(((a,o)=>{n=e.subscribe(a,o,(()=>{i?a(t.defaultValue):o(new Error(py.CompletedBeforeEmit))}))})).then((e=>(n.unsubscribe(),e))).catch((e=>{throw n.unsubscribe(),e}))},yy=(e,t)=>new Promise(((n,i)=>{let a;"object"==typeof t&&(a=t.defaultValue),e.subscribe((e=>a=e),(e=>i(e)),(()=>n(a)))})),my=(e,t)=>new ly((n=>{const i=e=>n.next(e);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)}));function hy(e){return new ly((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>t.error(e)))}))}const vy=(...e)=>new ly((t=>{const n=new oy;let i=0;for(const a of e)n.add(a.subscribe((e=>t.next(e)),(e=>t.error(e)),(()=>{i+=1,i>=e.length&&t.complete()})));return()=>n.unsubscribe()})),gy=(...e)=>new ly((t=>{for(const n of e)t.next(n)})),by=(...e)=>new ly((t=>{if(!e.length)return t.complete(),ry;const n=new oy,i=new Array(e.length),a=new Array(e.length),o=e=>!i.includes(void 0)&&t.next(e);for(let t=0;t<e.length;t++){const r=e[t].subscribe((e=>{a[t]=e,i[t]=!0,o(a)}));n.add(r)}return()=>n.unsubscribe()}));var Iy=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};function Ey(e,t){return new Sy(e,t)}class Sy{constructor(e,t){this._target=e,this._handler=t}subscribe(e,t,n){const i=e.next?e.next.bind(e):e,a={next:(...e)=>Iy(this,void 0,void 0,(function*(){try{yield i(...e)}catch(e){this._handler(e)}})),error:e.error?e.error.bind(e):t,complete:e.complete?e.complete.bind(e):n};return this._target.subscribe(a)}}class Cy{constructor(e){this.value=e,this.complete=!1,this.skip=!1}}var wy=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const Ty=e=>(...t)=>new ly((n=>{const i=e.subscribe((e=>wy(void 0,void 0,void 0,(function*(){try{let i=new Cy(e);for(const e of t){const t=e(i);if(i=t.then?yield t:t,!0===i.skip||!0===i.complete)break}if(i.skip)return;n.next(i.value),!0===i.complete&&n.complete()}catch(e){n.error(e)}}))),(e=>n.error(e)),(()=>n.complete()));return()=>i.unsubscribe()})),xy=e=>t=>(!1===e(t.value)&&(t.skip=!0),t),Oy=e=>t=>(e?!0===e(t.value)?t.complete=!0:t.skip=!0:t.complete=!0,t),Ay=e=>t=>{const n=e(t.value);return new Cy(n)},Ny=e=>t=>(e(t.value),t),Ly={FULLSCREEN:"DisplayPreset.FULLSCREEN",EMBEDDED:"DisplayPreset.EMBEDDED",ATTACHED:"DisplayPreset.ATTACHED"},Ry={ERROR:"ERROR",INFO:"INFO",WARNING:"WARNING"},_y={getBreakpointCSSClass:qt},Dy="CHILD_LAYOUTS/ADD_LAUNCHED",ky="DYNAMIC_DATA/ADD";function Py(e={launched:{}},t){if(t.type===Dy){const n=t.payload;return n.childLayoutId?b(["launched",n.childLayoutId],n.shouldRelaunch,e):e}return e}function $y(e=null,t){return e}function jy(e=null,t){if(t.type===ky){const n=t.payload;return e?n?Fe(e,n):e:n}return e}function Fy(e,t){var n;return null===(n=e.childLayouts.launched[t])||void 0===n||n}function Gy(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer}function My(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.schemaVersion}const By=Object.freeze({});function Uy(e){var t;return(null===(t=e.dynamicData)||void 0===t?void 0:t.text)?e.dynamicData.text:By}const Vy="FAILED_TO_LAUNCH_CHILD_LAYOUT";function*zy(e,t,n){var i;if(yield null===(i=Ye(Fy,n.payload.childLayoutId))||void 0===i||i){const i=yield Ye(My),o=yield Ye(Gy),r=yield Ye(Uy);try{const s=(a=function(e,t,n,i){return{instanceGuid:e.instanceGuid,childLayoutId:e.childLayoutId,childLayoutSchema:e.childLayoutSchema,offer:t,layoutSchemaVersion:n,content:{text:i}}}(n.payload,o,i,r),JSON.parse(JSON.stringify(a)));try{yield ze(e.createChildPlugin,{name:"dcui-child",config:s,targetElementSelector:n.payload.targetElementSelector})}catch(e){yield ze(t,{level:$t,code:Vy,message:"Could not launch child layout, failed creating plugin."})}}catch(e){yield ze(t,{level:$t,code:Vy,message:"Could not launch child layout, failed to make the child layout config serializable."})}yield qe({type:Dy,payload:{childLayoutId:n.payload.childLayoutId,shouldRelaunch:!1}})}var a}const Hy={cursor:"pointer",paddingInline:0,paddingBlock:0};function Wy(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function qy(t){var n;const i=Ni(),a=ki(),o=t.schema.response_key||"positive",r=Qa(),s=Mi(),l=Ma(),{tabIndex:c,styles:d,isDisabled:u}=St(l),p=null===(n=r.responseOptionsMap)||void 0===n?void 0:n[o];return p&&e(Uo,{styles:t.schema.styles,children:({classnames:n})=>e("button",{type:"button",tabIndex:c,"aria-disabled":u,disabled:u,style:Object.assign(Object.assign({},Hy),d),"data-testid":t.testId,"data-e2e":"CatalogItemResponse-standard-marketing",onClick:e=>{e.preventDefault();const t=function(e,t,n){var i,a;return Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId,catalogItemId:n.catalogItemId,productSku:n.productSku||(null===(i=n.copy)||void 0===i?void 0:i["provider.productSku"])||"",catalogId:n.catalogId||(null===(a=n.copy)||void 0===a?void 0:a["provider.catalogId"])||""})}(s,p,r);i({type:Jt,payload:t})},className:null==n?void 0:n.own,children:Wy(t.schema.children,a,t.testId)})})}const Ky={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(qy,{schema:t.node,testId:n})}};function Yy(){const t=Fa(),n=m(Uy),i=sa(),a=ki(),o=i({state:n},"textContent");return e(ra,{value:o,children:e(Pi,{value:a,overrides:Ky,children:e(Di,{children:e=>e(t)})})})}const Jy={staticData:$y,dynamicData:jy,childLayouts:Py};function Zy(e={}){return Object.assign({staticData:null,dynamicData:null,childLayouts:{launched:{}}},e)}function Qy(e){let t,n,i;return st((a=>(Promise.race([e.onClose().then((()=>"CLOSED")),new Promise((n=>{t=e.onEvent("PLUGIN_TRANSITION_OFFER_SUCCESS").subscribe((()=>{n("SUCCESS")}))})),new Promise((t=>{n=e.onEvent("PLUGIN_TRANSITION_OFFER_CLOSE").subscribe((()=>{t("UNSPECIFIED")}))})),new Promise((e=>{i=e}))]).then((e=>{"END"!==e&&(a(e),a(lt))})),()=>{null==t||t.unsubscribe(),null==n||n.unsubscribe(),i("END")})))}function Xy(e){return"object"==typeof e&&null!==e&&Object.entries(e).every((([e,t])=>"string"==typeof e&&("string"==typeof t||Xy(t))))}function*em(e,t,n,i,a){for(;;){switch(yield We(e)){case"CLOSED":t({type:on,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":if((n||i)&&a){yield ze(a);break}t({type:on,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:on,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*tm(e,t,n){if(Zt(n)){const{responseOption:i,fulfillment:a}=n,o=tn(n),r=nn(n);yield qe({type:an,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const s=yield ze(e.createChildPlugin.bind(e),a);if("object"==typeof s&&"onClose"in s&&"close"in s){const i=yield ze(Qy,s);if("object"==typeof i&&"take"in i){const a=function(e,t,n,i){if(n.responseOption.rclid)return function*(){yield qe({type:sn,payload:{name:"REALTIME_OFFER_FULFILLMENT_CONVERSION",body:{rclid:n.responseOption.rclid,accountID:n.accountID,referralCreativeID:n.referralCreativeID}}}),yield ze(nm,e,t,i)}}(e,t,n,s);return void(yield ze(em,i,e.globalDispatch.bind(e),o,r,a))}}yield ze(t,{level:Pt,code:"UNEXPECTED_NEXT_VALUE_IN_SAGA",message:'Received an unexpected input at a step in the saga "handleFullfillmentResponse" and could not continue.'})}else yield ze(t,{level:Pt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}function*nm(e,t,n){const i=function(e){return st((t=>{const n=e.onEvent({name:$l,source:"partner",callback:e=>{Xy(e)&&t({eventName:$l,data:e})}},{name:jl,source:"partner",callback:e=>{Xy(e)&&t({eventName:jl,data:e})}});return()=>{n()}}))}(e);try{for(;;){const a=yield We(i);switch(a.eventName){case $l:yield qe({type:sn,payload:{name:$l,body:a.data}}),yield qe({type:ky,payload:{text:a.data}}),e.globalDispatch({type:on,payload:{event:"Completed",completionReason:"Success"}}),n&&(yield ze(n.close.bind(n)));break;case jl:e.globalDispatch({type:on,payload:{event:"Completed",completionReason:"Error"}}),n&&(yield ze(n.close.bind(n)));break;default:t({level:Pt,code:"UNKNOWN_REALTIME_OFFER_FULFILLMENT_EVENT",message:`Unknown event: ${a.eventName}`})}}}catch(e){const n=e;t({level:$t,code:"FAILED_TO_PROCESS_REALTIME_OFFER_FULFILLMENT_EVENT",message:null==n?void 0:n.message})}finally{(yield Ke())&&i.close()}}function*im(e,t,n){const i=Xt(n.payload)||en(n.payload)||Qt(n.payload)?n.payload:n.payload.responseOption;switch(yield qe({type:ln,payload:{key:"offerEngaged",value:1}}),i.action){case"Url":yield ze(e.globalDispatch.bind(e),n),(tn(n.payload)||nn(n.payload))&&(yield qe({type:sn,payload:{name:"REALTIME_OFFER_FULFILLMENT_REFERRAL",body:{rclid:i.rclid,accountID:i.accountID,referralCreativeID:i.referralCreativeID,referralOnly:nn(n.payload)}}}),tn(n.payload)&&(yield ze(nm,e,t)));break;case"CaptureOnly":yield ze(e.globalDispatch.bind(e),n);break;case"Fulfillment":yield qe({type:sn,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield qe({type:sn,payload:{name:"POSITIVE_ENGAGEMENT"}})),nn(n.payload)&&(yield qe({type:sn,payload:{name:"REALTIME_OFFER_FULFILLMENT_REFERRAL",body:{rclid:i.rclid,accountID:n.payload.accountID,referralCreativeID:n.payload.referralCreativeID,referralOnly:!0}}})),yield*tm(e,t,n.payload)}}function*am(e,t){yield Je([et(Jt,im.bind(null,e,t)),Ze(fn,zy.bind(null,e,t)),Ze("*",Ks.bind(null,[Jt,fn],e))])}Object.assign({},vn);const om=(new Da).withAppFactory((function(n){var i;if(n.rootElement){const o=f(n.rootElement),r=Zy({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n=Zy()){const i=ot(),a=it({reducer:Jy,devTools:{name:"Standard Marketing"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(am,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Ya,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(es,{}),e(v,{store:s,children:e(Qr,{settings:n,dispatch:s.dispatch,children:e(Yy,{})})})]})}))}}));var rm=Object.freeze({__proto__:null,moduleConnectorBuilder:om});const sm="CART/UPDATE",lm="CATALOG_ITEM/RESPONSE",cm="USER_CREATIVE_RESPONSE_HISTORY/ADD",dm=T([[(e,t)=>0!==t,j],[(e,t)=>!Number.isNaN(e)&&0===t,j],[(e,t)=>Number.isNaN(e)&&0===t,Me]]);function um({isChecked:t,isDisabled:n,outerClassname:i,outerCheckedClassname:a,innerClassname:o,innerCheckedClassname:r}){return e("span",{style:{display:"flex"},children:e("span",{className:`${i} ${t?a:""}`,tabIndex:n?-1:1,style:{display:"flex",boxSizing:"border-box"},children:e("span",{className:`${o} ${t?r:""}`,style:{flex:1}})})})}const pm="catalogRadioGroup__label",fm=["Enter","Space"],ym={elements:{own:[],optionContainer:[],radioButtonInner:[{default:{border:{borderRadius:11},background:{backgroundColor:{light:"#FFF"}}}}],radioButtonInnerChecked:[{default:{background:{backgroundColor:{light:"#529ff4"}}}}],radioButtonOuter:[{default:{border:{borderRadius:16,borderColor:{light:"#999"},borderStyle:"solid",borderWidth:"1"},dimension:{width:{type:"fixed",value:16},height:{type:"fixed",value:16}},spacing:{padding:"4"}}}],radioButtonOuterChecked:[]}};function mm(e,t,n){return e.map(T([[P(j("Required"),H("","type")),({value:e})=>Number.isNaN(n)&&t>0?e.message:""],[O,z("")]])).filter(Ge)}function hm({schema:n,testId:i}){var r;const s=y(),l=Qa(),c=null!==(r=m((e=>{var t,n;return l.cartItemId in e.cart?null!==(n=null===(t=e.cart[l.cartItemId])||void 0===t?void 0:t.quantity)&&void 0!==n?n:0:void 0})))&&void 0!==r?r:NaN,u=d((()=>mm(n.validations,n.options.length,c)),[n.validations,n.options.length,c]),p=Ma(),{tabIndex:f,styles:h,isDisabled:v}=St(p);o((()=>{v||s(vm(u))}),[]);const g=n.options.filter((({quantity:e})=>{var t,n;return e>=(null!==(t=l.minItemCount)&&void 0!==t?t:-1/0)&&e<=(null!==(n=l.maxItemCount)&&void 0!==n?n:1/0)}));function b(e){s({type:lm,payload:{catalogItem:l,quantity:e}});const t=mm(n.validations,n.options.length,e);s(vm(t))}return g.length>0?e(Uo,{styles:n.styles?Wt(ym,n.styles):ym,children:({classnames:n,mapperRef:o})=>e("div",{className:null==n?void 0:n.own,style:Object.assign({display:"flex",flexDirection:"column"},h),children:e(ca,{value:o(pm),children:a.Children.toArray(g.map(((a,o)=>{var r;const s=dm(c,a.quantity),d=e=>i?`${i}-option${o}${e}`:void 0;return t("label",{tabIndex:f,"aria-disabled":v,style:{display:"flex"},className:`${pm} ${null!==(r=null==n?void 0:n.optionContainer)&&void 0!==r?r:""}`,onKeyDown:e=>{s||!fm.includes(e.code)||v||b(a.quantity)},"data-e2e":"CatalogRadioGroup-Option","data-e2e-quantity":`${a.quantity}`,"data-testid":d("Label"),children:[e("input",{type:"radio",style:{display:"none"},tabIndex:-1,name:l.instanceGuid,value:a.quantity,checked:s,onChange:()=>b(a.quantity),"aria-disabled":v,disabled:v}),e(um,{isChecked:s,isDisabled:v,innerClassname:null==n?void 0:n.radioButtonInner,innerCheckedClassname:null==n?void 0:n.radioButtonInnerChecked,outerClassname:null==n?void 0:n.radioButtonOuter,outerCheckedClassname:null==n?void 0:n.radioButtonOuterChecked}),e(as,{schema:a,testId:d("Content")})]})})))})})}):null}function vm(e){return{type:un,payload:{errors:e}}}function gm(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function bm(t){const n=y(),i=ki(),a=Qa(),o=Ma(),{tabIndex:r,styles:s,isDisabled:l}=St(o);return e(Uo,{styles:t.schema.styles,children:({classnames:o})=>e("button",{type:"button",tabIndex:r,"aria-disabled":l,disabled:l,style:Object.assign({cursor:"pointer"},s),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:lm,payload:{catalogItem:a,quantity:1}})},className:null==o?void 0:o.own,children:gm(t.schema.children,i,t.testId)})})}const Im={allowedTags:["em","strong","a","br","u","p","li","ul","ol","span"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[]},allowedSchemes:["http","https"]},Em=new Map([["&","_;^;_"]]),Sm=new RegExp(`<a *(?=${Im.allowedAttributes.a.join("|")}|>)`,"g"),Cm=new RegExp(`<a *(?:(?:${Im.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),wm=new RegExp("(<br *?>)|(<br *?/>)","g"),Tm=new RegExp(`<ul *(?=${Im.allowedAttributes.ul.join("|")}|>)`,"g"),xm=new RegExp(`<ol *(?=${Im.allowedAttributes.ol.join("|")}|>)`,"g"),Om=new RegExp("<li *(?=>|\\s[^>]*>)","g"),Am="<br/>";function Nm(t){const n=sa(),i=Ma(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Cm,((e,t)=>{const n=t.replaceAll("&",Em.get("&"));return e.replace(t,n)})).replaceAll(wm,Am)}(e);return t===vt(t,Im)}(e))throw new jt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=St(i);return a?e(Uo,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class="${null==n?void 0:n.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0)),l=((null==n?void 0:n.list)?`class="${n.list}"`:"")+' style="list-style-type: none; padding-inline-start: 0px; display: flex; flex-direction: column;"',c=((null==n?void 0:n.listItem)?`class="${n.listItem}"`:"")+' style="display: flex; align-items: flex-start; flex-shrink: 0; flex-grow: 1;"',d=`class="rokt-icon${(null==n?void 0:n.span)?" "+n.span:""}" style="display: inline-block; pointer-events: none; user-select: none;" aria-disabled="true"`,u=a.replace(Sm,`<a ${i.join(" ")}`).replace(Tm,`<ul ${l}`).replace(xm,`<ol ${l}`).replace(Om,`<li ${c}><span ${d}>Check</span`);return p=a,new RegExp("</(p|ul|ol)>").test(p)?e("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:u}}):e("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:u}});var p}}):null}const Lm={internally:"_top",externally:"_blank"};function Rm(t,n,i,a,o){return e(ca,{value:i(n),children:_m(t,a,o)})}function _m(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Dm(t){var n,i;const a=Lm[t.schema.open],o=ki(),r=Qa(),s=Ma(),l=y(),c=null!==(n=r.url)&&void 0!==n?n:"",{tabIndex:d,styles:u,isDisabled:p}=St(s);return Boolean(c)&&(null===(i=t.schema.children)||void 0===i?void 0:i.length)>0?e(Uo,{styles:t.schema.styles,children:({classnames:n,mapperRef:i})=>{var s;return e("a",{href:c,onClick:()=>{var e;l({type:an,payload:{name:"SignalResponse",parentGuid:null!==(e=r.instanceGuid)&&void 0!==e?e:"",responseActionPayload:{name:"Url",transformedTrafficURL:c}}})},"data-testid":t.testId,"data-e2e":"CatalogUrlLink",target:null!=a?a:"_blank",tabIndex:d,"aria-disabled":p,"aria-label":null!==(s=t.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:"block"},u),className:null==n?void 0:n.own,children:(null==n?void 0:n.own)?Rm(t.schema.children,null==n?void 0:n.own,i,o,t.testId):_m(t.schema.children,o,t.testId)})}}):null}function km(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Pm(t){const n=ki(),i=Qa(),a=Ma(),{tabIndex:o,styles:r,isDisabled:s}=St(a),l=Ys(i,1),c=Ni();return e(Uo,{styles:t.schema.styles,children:({classnames:a})=>e("button",{type:"button",tabIndex:o,"aria-disabled":s,disabled:s,style:Object.assign({cursor:"pointer"},r),"data-testid":t.testId,"data-e2e":"CatalogPartnerEventButton",onClick:()=>{s||(c({type:an,payload:{name:"SignalCartItemQuantitySelected",parentGuid:i.instanceGuid,objectData:{quantity:1,preselected:!1}}}),c({type:sn,payload:{name:"V2_CART_ITEM_UPDATED",body:{oldCartItem:null,cartItem:l}}}))},className:null==a?void 0:a.own,children:km(t.schema.children,n,t.testId)})})}function $m(e,t){const n=e.cart[t];return n||null}function jm(e){var t,n;const i=null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[],a=function(e){return Object.values(e.cart).filter((e=>null!==e))}(e);return a.filter((e=>i.find((t=>t.catalogItemId===e.catalogItemId))))}function Fm(e,t){var n,i,a,o;const r=null===(n=e.staticData)||void 0===n?void 0:n.offer;if(r){const n=function(e){return jm(e).reduce(((e,t)=>e+t.quantity),0)}(e),s=$m(e,t.cartItemId),l=(null!==(i=null==r?void 0:r.maxTotalItemsQtyInOffer)&&void 0!==i?i:1/0)-n,c=(null!==(a=t.maxItemCount)&&void 0!==a?a:1/0)-(null!==(o=null==s?void 0:s.quantity)&&void 0!==o?o:0);return Math.min(l,c)}return 0}const Gm={is:j,"is-not":P(J,j),"is-below":be,"is-above":ge};function Mm({schema:t,testId:n}){const{children:i,predicates:o}=t,r=sa()(t.cartItemId),s=m((e=>{var t;return(null===(t=$m(e,r))||void 0===t?void 0:t.quantity)||0}));return(()=>{const e=o.map((e=>(0,Gm[e.condition])(s,e.value)));return le(j(!0),e)})()?e(Di,{children:e=>a.Children.toArray(i.map(((t,i)=>e(t,void 0,n?`${n}-child-${i}`:`when-catalog-quantity-child-${i}`))))}):null}function Bm({schema:n,testId:i}){const a=sa(),o=Ma(),{tabIndex:r,styles:s,isDisabled:l}=St(o),{text:c,highlightedText:d,target:p}=n,f=a(c),y=a(d),m=u((()=>{if(l)return;const e=document.querySelector(`[${p.key}="${p.value}"]`);e&&e.scrollIntoView({behavior:"smooth"})}),[p.key,p.value,l]),h=u((e=>{e.preventDefault(),e.stopPropagation(),m()}),[m]),v=f.indexOf(y);if(-1===v)return e(Uo,{styles:n.styles,children:({classnames:t})=>e("span",{"data-testid":i,"data-e2e":"ScrollToTarget",className:null==t?void 0:t.own,style:s,"aria-hidden":l,children:e("span",{className:null==t?void 0:t.text,children:f})})});const g=f.slice(0,v),b=f.slice(v+y.length);return e(Uo,{styles:n.styles,children:({classnames:a})=>{var o;return t("span",{"data-testid":i,"data-e2e":"ScrollToTarget",className:null==a?void 0:a.own,"aria-label":null!==(o=n.a11yLabel)&&void 0!==o?o:void 0,children:[g&&e("span",{className:null==a?void 0:a.text,style:s,"aria-hidden":l,children:g}),e("span",{onClick:h,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m())},className:null==a?void 0:a.highlighted,style:Object.assign({cursor:l?"default":"pointer"},s),role:"button",tabIndex:l?-1:r,"aria-disabled":l,"aria-label":`Click to scroll to element with ${p.key}="${p.value}"`,children:y}),b&&e("span",{className:null==a?void 0:a.text,style:s,"aria-hidden":l,children:b})]})}})}function Um(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-content${i}`:void 0))))}function Vm({schema:n,testId:i}){const a=ki(),[o,r]=c(!1),{children:s,anchor:l,background:d}=n;return e(Uo,{styles:n.styles,children:({classnames:c})=>{var u;return t("div",{"data-testid":i,"data-e2e":"Tooltip",style:{position:"relative",display:"inline-block",cursor:"pointer"},onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onClick:()=>r(!o),"aria-label":null!==(u=n.a11yLabel)&&void 0!==u?u:void 0,children:[a(l,void 0,i?`${i}-anchor`:void 0),o&&t("div",{className:null==c?void 0:c.own,style:{position:"absolute",zIndex:1,bottom:"150%",left:"50%",transform:"translateX(-50%)"},role:"tooltip",children:[Um(s,a,i),d&&e("div",{style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",margin:0,padding:0,lineHeight:0},children:a(d,void 0,i?`${i}-arrow`:void 0)})]})]})}})}function zm(e){var t,n;const i=null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[];return i.length>0?i:null}function Hm(e,t){var n,i;return null!==(i=null===(n=zm(e))||void 0===n?void 0:n.find((e=>e.catalogItemId===t)))&&void 0!==i?i:null}function Wm(e){var t;const n=null===(t=zm(e))||void 0===t?void 0:t.filter((e=>e.preSelectedQuantity&&e.preSelectedQuantity>0));return n&&n.length>0?n:null}function qm(e){var t,n;return null!==(n=null===(t=Wm(e))||void 0===t?void 0:t.reduce(((e,t)=>{var n;return e+(null!==(n=t.preSelectedQuantity)&&void 0!==n?n:0)}),0))&&void 0!==n?n:0}const Km=P((e=>e.filter((e=>!pe(e[1]))).map((([e,t])=>({cartItemId:t.cartItemId,quantity:t.quantity})))),M,U("cart"));function Ym(n){var i,a,o,r;const s=Ma(),{tabIndex:l,styles:c,isDisabled:d}=St(s),u=Ni(),p=sa()(n.schema.preButtonText),f=m((e=>function(e){var t,n;return null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.creative)&&void 0!==n?n:null}(e)));if(!f)return null;const y=null!==(i=f.copy["provider.offerId"])&&void 0!==i?i:"",h=null!==(a=n.schema.title)&&void 0!==a?a:"",v=null!==(r=null!==(o=f.copy["provider.offer.longDescription.copy"])&&void 0!==o?o:f.copy["creative.copy"])&&void 0!==r?r:"";return t("span",{style:{display:"inline"},children:[n.schema.preButtonText&&e("span",{style:{marginRight:"4px",color:"#646464",fontSize:16,fontFamily:"Averta",fontWeight:"400",letterSpacing:.32,lineHeight:"24px",margin:"8px 0 0 0"},children:p}),e(Uo,{styles:n.schema.styles,children:({classnames:t})=>e("button",{type:"button",tabIndex:l,"aria-disabled":d,disabled:d,style:Object.assign({cursor:"pointer",display:"inline",color:"#024DDF",fontSize:16,fontFamily:"Averta",fontWeight:"400",textDecoration:"underline",background:"none",border:"none",padding:0},c),"data-testid":n.testId,"data-e2e":"CatalogUpsellCreativeButton",onClick:()=>{d||u({type:sn,payload:{name:"UPSELL_CREATIVE_SENT",body:{offerId:y,title:h,description:v}}})},className:null==t?void 0:t.own,children:"Read More"})})]})}function Jm(t,n,i,a,o){return e(ca,{value:i(n),children:a(t,void 0,o)})}function Zm(e,t,n){return t(e,void 0,n)}function Qm(i){var a;const{schema:o,testId:r}=i,{a11yInputLabel:s,styles:l,showInputField:c,buttons:d,forcedUpsellText:u}=o,{increment:p,decrement:f,a11yIncrementLabel:h,a11yDecrementLabel:v}=d||{},g=y(),b=Qa(),I=ki(),E=sa(),S=Ma(),{tabIndex:C,styles:w,isDisabled:T}=St(S),x=m((e=>function(e,t){var n,i,a;const o=Hm(e,t);return Boolean(o&&(null!==(n=o.preSelectedQuantity)&&void 0!==n?n:0)>0&&o.preSelectedQuantity===(null!==(i=o.minItemCount)&&void 0!==i?i:0)&&o.preSelectedQuantity===(null!==(a=o.maxItemCount)&&void 0!==a?a:0))}(e,b.catalogItemId))),O=m((e=>$m(e,b.cartItemId))),A=m((e=>Fm(e,b))),N=(null==O?void 0:O.quantity)||0,L=St(T||N<=(null!==(a=b.minItemCount)&&void 0!==a?a:0)?"DISABLED":S),R=St(T||A<=0?"DISABLED":S),_=St(T||x?"DISABLED":S),D=e=>{var t;const n=e.target.value;if(0===n.length)k(null!==(t=b.minItemCount)&&void 0!==t?t:0);else{const e=Number(n);!Number.isNaN(e)&&e>=0&&k(e)}},k=e=>{T||g({type:lm,payload:{catalogItem:b,quantity:e}})};return e(Uo,{styles:l,children:({classnames:i,mapperRef:a})=>e("div",{className:null==i?void 0:i.own,style:Object.assign({display:"flex",flexDirection:"row"},w),children:x&&u?e(Qo,{schema:u,isInline:!1,testId:r?`${r}-forced-upsell-text`:void 0}):t(n,{children:[f?e("button",{className:null==i?void 0:i.decrementButton,style:Object.assign(Object.assign({},L.styles),{cursor:L.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(N-1)},tabIndex:L.tabIndex,"aria-label":v||void 0,disabled:L.isDisabled,"data-testid":r?`${r}-decrement-button`:void 0,children:e(ra,{value:E,children:(null==i?void 0:i.decrementButton)?Jm(f,i.decrementButton,a,I,r):Zm(f,I,r)})}):null,c?e("input",{type:"text",className:null==i?void 0:i.input,style:Object.assign(Object.assign({},_),{cursor:_.isDisabled?"not-allowed":"auto",caretColor:_.isDisabled?"transparent":"auto",pointerEvents:"auto",outline:"none"}),value:N,onChange:D,"aria-label":s||void 0,tabIndex:C,disabled:T,"data-testid":r?`${r}-input`:void 0}):e("p",{className:null==i?void 0:i.input,style:w,"data-testid":r?`${r}-quantity-text`:void 0,children:N}),p?e("button",{className:null==i?void 0:i.incrementButton,style:Object.assign(Object.assign({},R.styles),{cursor:R.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(N+1)},tabIndex:R.tabIndex,"aria-label":h||void 0,disabled:R.isDisabled,"data-testid":r?`${r}-increment-button`:void 0,children:e(ra,{value:E,children:(null==i?void 0:i.incrementButton)?Jm(p,i.incrementButton,a,I,r):Zm(p,I,r)})}):null]})})})}const Xm={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(bm,{schema:t.node,testId:n})},EscapeHatch:function(t,n){if("EscapeHatch"===t.type&&t.node.data){const i=JSON.parse(t.node.data);switch(null==i?void 0:i.type){case"InsuranceRichText":return e(Nm,{schema:i.node});case"CatalogUrlLink":return e(Dm,{schema:i.node});case"CatalogPartnerEventButton":return e(Pm,{schema:i.node});case"ReadMoreText":return e(Ym,{schema:i.node});case"WhenCatalogQuantity":return e(Mm,{schema:i.node,testId:n});case"ScrollToTarget":return e(Bm,{schema:i.node,testId:n});case"Tooltip":return e(Vm,{schema:i.node,testId:n});default:return}}},CatalogRadioGroup:function(t){if("CatalogRadioGroup"===t.type)return e(hm,{schema:t.node})},CatalogQuantityCounter:function(t){if("CatalogQuantityCounter"===t.type)return e(Qm,{schema:t.node})}};function eh(){const t=Fa(),n=ki();return e(Pi,{value:n,overrides:Xm,children:e(Di,{children:e=>e(t)})})}function th(e){return e.reduce(((e,t)=>(e[t.cartItemId]=function(e={}){return Object.assign({cartItemId:"cartItemId",catalogItemId:"catalogItemId",name:"Catalog Title",description:"This is a catalog item",unitPrice:10,totalPrice:10,quantity:1,currency:"USD",linkedProductId:void 0,quantityMustBeSynchronized:void 0,providerData:""},e)}({cartItemId:t.cartItemId,quantity:t.quantity}),e)),{})}const nh={cart:function(e=th([]),t){if(t.type===sm){const{catalogItem:n,quantity:i}=t.payload,a=n.cartItemId,o=Ys(n,i);return Object.assign(Object.assign({},e),{[a]:o})}return e},userCreativeResponseHistory:function(e=[],t){return t.type===cm?e.concat(t.payload.responseId):e},staticData:$y,childLayouts:Py};const ih="INVALID_PARTNER_MESSAGE",ah="MISCONFIGURED_CATALOG_ITEM",oh="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function*rh(e){var t,n;const i=yield Ye(Wm),a=yield Ye(qm),o=yield Ye((e=>{var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer.maxTotalItemsQtyInOffer}));if(uh(a)&&uh(o)&&a>o)yield ze(e,{level:$t,code:ah,message:`Catalog items preselected quantities (${a}) exceeds the maximum allowed quantity (${o}) for this offer`});else if(i&&Array.isArray(i))for(const a of i){const i=null!==(t=a.preSelectedQuantity)&&void 0!==t?t:0,o=null!==(n=a.maxItemCount)&&void 0!==n?n:1/0;i>o?yield ze(e,{level:$t,code:ah,message:`Preselected quantity (${i}) is greater than maxItemCount (${o}) for catalog item (${a.instanceGuid})`}):yield*dh(a,i,!0)}}function*sh(e,t,n){const{catalogItem:i,quantity:a}=n.payload;if(yield*dh(i,a,!1)){const n=yield Ye((e=>{var t,n,i;const a=null===(t=e.staticData)||void 0===t?void 0:t.offer.creative.responseOptionsMap.positive,o=e.userCreativeResponseHistory.at(-1),r=null===(n=e.staticData)||void 0===n?void 0:n.offer.creative.responseOptionsMap.negative;if(a&&o&&a.id===o&&"SignalGatedResponse"===(null==r?void 0:r.signalType))return function(e,t){var n;switch(e.action){case"Fulfillment":{const i=null==t?void 0:t.creative.fulfillment;return Tt(i)?{type:Jt,payload:{fulfillment:i,responseOption:e,accountID:null!==(n=null==t?void 0:t.accountId)&&void 0!==n?n:""}}:`Could not get fulfillment for response (instanceGuid: ${e.instanceGuid})`}case"Url":return(null==t?void 0:t.accountId)?{type:Jt,payload:Object.assign(Object.assign({},e),{accountID:t.accountId})}:`Could not get accountId for response (instanceGuid: ${e.instanceGuid})`;default:return{type:Jt,payload:e}}}(r,null===(i=e.staticData)||void 0===i?void 0:i.offer)}));null!=(o=n)&&"object"==typeof o&&"type"in o&&"payload"in o&&"object"==typeof o.payload?yield ze(e.globalDispatch,n):function(e){return"string"==typeof e}(n)&&(yield ze(t,{level:$t,code:"INVALID_RESPONSE_OBJECT",message:n}))}var o}function*lh(e,t){const n=function(e,t){return st((n=>{const i=e.onEvent({name:_l.V2.PartnerMessage.UpdateCartItem,source:"partner",callback:e=>{!function(e){return null!==e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&!("unitPrice"in e)}(e)?t({level:$t,code:ih,message:`Invalid UpdateCartItemPartnerMessageBody: ${JSON.stringify(e)}`}):n(e)}});return()=>{i()}}))}(e,t);try{for(;;){const e=yield We(n);yield ze(ch,e,t)}}catch(e){const n=e;t({level:$t,code:oh,message:null==n?void 0:n.message})}finally{(yield Ke())&&n.close()}}function*ch(e,t){const{cartItemId:n,quantity:i}=e,a=yield Ye($m,n);if(ph(a)){const e=yield Ye(Hm,a.catalogItemId);null!==(o=e)&&"object"==typeof o&&"catalogItemId"in o&&"price"in o?yield*dh(e,i,!1):yield ze(t,{level:$t,code:oh,message:`Catalog item not found for cart item id (${n})`})}else yield ze(t,{level:$t,code:oh,message:`Cart item not found for cart item id (${n})`});var o}function*dh(e,t,n){var i;const a=yield Ye($m,e.cartItemId),o=yield Ye(Fm,e),r=uh(o)?o:0,s=ph(a)?a.quantity:0;if(t!==s&&t>=(null!==(i=e.minItemCount)&&void 0!==i?i:0)&&t-s<=r){yield qe({type:sm,payload:{catalogItem:e,quantity:t}});const i=yield Ye($m,e.cartItemId),o=yield Ye(Km);return yield qe({type:pn,payload:{cart:o}}),yield qe({type:an,payload:{name:"SignalCartItemQuantitySelected",parentGuid:e.instanceGuid,objectData:{quantity:t,preselected:n}}}),yield qe({type:sn,payload:{name:"V2_CART_ITEM_UPDATED",body:{oldCartItem:a,cartItem:i}}}),!0}return!1}function uh(e){return"number"==typeof e}function ph(e){return null!=e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&"unitPrice"in e}function*fh(e,t){var n;yield qe({type:cm,payload:{responseId:(n=t.payload,Zt(n)?n.responseOption.id:n.id)}}),yield ze(e.globalDispatch.bind(e),t)}function*yh(e,t){yield Je([Xe(rh.bind(null,t)),Xe(lh.bind(null,e,t)),et(lm,sh.bind(null,e,t)),et(Jt,fh.bind(null,e)),Ze(fn,zy.bind(null,e,t)),Ze("*",Ks.bind(null,[Jt,fn],e))])}function mh(e){return"object"==typeof e&&null!==e&&"cartItemId"in e&&"quantity"in e}Object.assign(Object.assign({},vn),{CATALOG_ITEM_RESPONSE:lm});const hh=(new Da).withAppFactory((function(n){var i;if(n.rootElement){const o=f(n.rootElement),r=function(e){return"object"==typeof e&&null!==e&&"cart"in e&&Array.isArray(e.cart)&&e.cart.every(mh)}(n.offerState)?n.offerState:{cart:[]},s=function(e={}){return Object.assign({cart:th([]),userCreativeResponseHistory:[],staticData:null,childLayouts:{launched:{}}},e)}({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion},cart:th(r.cart)}),l=function(e,t,n){const i=ot(),a=it({reducer:nh,devTools:{name:"Add To Cart"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(yh,e,t),a}(n.gateway,n.logger,s);o.render(e(a.StrictMode,{children:t(Ya,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(es,{}),e(v,{store:l,children:e(Qr,{settings:n,dispatch:l.dispatch,children:e(eh,{})})})]})}))}}));var vh=Object.freeze({__proto__:null,moduleConnectorBuilder:hh});const gh="CATALOG/TRIGGER_SELECT_ITEM",bh="CATALOG/SET_SELECTED_ITEM",Ih="CHECKOUT_LIFECYCLE",Eh="INSTANT_PURCHASE/INITIATE",Sh="INSTANT_PURCHASE/PARTNER_RESPONSE",Ch="INSTANT_PURCHASE/WSDK_RESPONSE",wh="INSTANT_PURCHASE/SET_OFFER_LIFECYCLE_EVENT",Th=s(null);function xh(t){const[n,i]=c({});return e(Th.Provider,{value:{registerValidators:function(e,t){i((n=>Object.assign(Object.assign({},n),{[e]:{validators:t,isValid:!0}})))},validateFieldKeys:function(e){const t={};let a=!0;for(const i of e){const e=n[i];if(e){const n=Object.assign({},e),o=e.validators.every((e=>e()));o!==n.isValid&&(t[i]=Object.assign(Object.assign({},n),{isValid:o})),a&&(a=o)}else a=!1}return Object.values(t).length>0&&i((e=>Object.assign(Object.assign({},e),t))),a},getFieldKeyValidity:function(e){var t;return(null===(t=n[e])||void 0===t?void 0:t.isValid)||!1}},children:t.children})}function Oh(){const e=l(Th);if(!e)throw new Error("useValidator must be used within a ValidatorProvider");return e}function Ah(e,t){const n=Oh();o((()=>{e&&n.registerValidators(e,t)}),[])}function Nh(e,t){return t?t.validators.map((t=>e[t])).filter((e=>void 0!==e)):[]}function Lh(t,n,i,a,o){return e(ca,{value:i(n),children:Rh(t,a,o)})}function Rh(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function _h(t){const n=t.schema.validatorTriggerConfig,i=y(),a=ki(),o=Ma(),{tabIndex:r,styles:s,isDisabled:l}=St(o),c=Qa(),d=na(c,"catalogItem"),u=Oh();return e(Uo,{styles:t.schema.styles,children:({classnames:o,mapperRef:p})=>e("button",{type:"button",tabIndex:r,"aria-disabled":l,disabled:l,style:Object.assign({cursor:"pointer"},s),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault(),function(){let e=!0;n&&(e=u.validateFieldKeys(n.validatorFieldKeys)),i(e?{type:Eh,payload:{catalogItem:c,quantity:1,useInstantPurchaseExtension:!0}}:{type:an,payload:{name:"SignalUserInteraction",action:"ValidationTriggerFailed",context:"CatalogResponseButton",parentGuid:c.instanceGuid}})}()},className:null==o?void 0:o.own,children:e(ra,{value:d,children:(null==o?void 0:o.own)?Lh(t.schema.children,o.own,p,a,t.testId):Rh(t.schema.children,a,t.testId)})})})}const Dh=["ArrowDown","ArrowUp","Enter","Escape","Tab"];function kh(n){const i=n.schema.validatorFieldConfig,a=n.schema.disableProgrammaticFocus||!1,s=Mi(),l=ki(),u=sa(),p=e=>u({data:e},"catalogItem"),f=d((()=>s.catalogItems||[]),[s]),h=Ma(),{styles:v,isDisabled:g}=St(h),b=r(null),I=r([]),[E,S]=c(!1),[C,w]=c(-1),T=y(),x=Oh(),O=m((e=>e.selectedItem)),A=r(O);function N(){return!!A.current}const L=d((()=>Nh({required:N},i)),[i]);function R(t,i,a,o){return t?function(t,n,i,a,o){return e(ca,{value:i(n),children:a(t,void 0,o)})}(i,t,a,l,o||n.testId):function(e,t,n){return t(e,void 0,n)}(i,l,o||n.testId)}function _(){return!i||x.getFieldKeyValidity(i.validationFieldKey)}function D(){g||(E?P():k())}function k(){g||S(!0)}function P(){g||S(!1)}function $(e){var t;w(f.indexOf(e)),P(),T({type:gh,payload:{catalogItem:e}}),T({type:an,payload:{name:"SignalUserInteraction",action:"DropDownItemSelected",context:"CatalogDropDown",parentGuid:e.instanceGuid}}),A.current=e,i&&i.validateOnChange&&x.validateFieldKeys([i.validationFieldKey]),null===(t=b.current)||void 0===t||t.focus()}function j(e){const t=[null==e?void 0:e.dropDownSelectedElement];return _()||t.push((null==e?void 0:e.dropDownContainerErrorStyles)||""),t.join(" ")}Ah(null==i?void 0:i.validationFieldKey,L),o((()=>{var e;if(!a)if(E)if(-1===C)null===(e=b.current)||void 0===e||e.focus();else{const e=I.current[C];e&&e.focus()}else O||w(-1)}),[E,C,O,a]);const F={elements:{own:[{default:{background:{backgroundColor:{light:"#ffffff"}},dimension:{width:{type:"percentage",value:100}}}}]}};function G(e){var t;if(!g&&Dh.includes(e.key))switch(e.key){case"ArrowDown":{e.preventDefault();const t=C+1;t<f.length&&w(t);break}case"ArrowUp":{e.preventDefault();const t=C-1;t>=0&&w(t);break}case"Enter":if(e.preventDefault(),E){const e=f[C];e&&$(e)}else k();break;case"Tab":if(E&&O){P();const e=f.indexOf(O);-1!==e&&w(e)}break;case"Escape":e.preventDefault(),E&&(P(),null===(t=b.current)||void 0===t||t.focus())}}return f.length>1?e(Uo,{styles:n.schema.styles?Wt(F,n.schema.styles):F,children:({classnames:i,mapperRef:a})=>t("div",{className:null==i?void 0:i.dropDownContainer,children:[t("div",{ref:b,className:null==i?void 0:i.own,onKeyDown:G,onClick:D,onBlur:e=>{var t;(null===(t=b.current)||void 0===t?void 0:t.contains(e.relatedTarget))||E&&P()},"data-e2e":"DropDown","data-testid":n.testId?`${n.testId}-drop-down-container`:void 0,"aria-disabled":g,style:Object.assign({position:"relative"},v),tabIndex:0,children:[e("div",{className:j(i),"aria-disabled":g,"data-testid":n.testId?`${n.testId}-drop-down-selected-element`:void 0,style:Object.assign({cursor:"pointer"},v),children:O?e(ra,{value:p(O),children:R(null==i?void 0:i.dropDownSelectedElement,n.schema.closedTemplate,a)}):R(null==i?void 0:i.dropDownSelectedElement,n.schema.closedDefaultTemplate,a)}),E&&e("ul",{className:null==i?void 0:i.dropDownListContainer,onClick:e=>e.stopPropagation(),"data-testid":n.testId?`${n.testId}-drop-down-list-container`:void 0,tabIndex:-1,style:Object.assign({listStyle:"none",padding:0,zIndex:9999,position:"absolute",top:"100%",left:0,right:0,backgroundColor:"#FFF",overflowX:"hidden",overflowY:"auto"},v),children:f.map(((t,o)=>e("li",{ref:e=>function(e,t){I.current[t]=e}(e,o),className:null==i?void 0:i.dropDownListElement,onClick:e=>{e.stopPropagation(),g||$(t)},tabIndex:-1,"data-e2e":"DropDownItem","data-testid":n.testId?`${n.testId}-drop-down-item-${o}`:void 0,style:Object.assign({cursor:"pointer",display:"flex"},v),children:e(ra,{value:p(t),children:R(null==i?void 0:i.dropDownSelectedElement,n.schema.openTemplate,a)})},t.catalogItemId)))})]}),!_()&&n.schema.requiredSelectionErrorTemplate?R(null==i?void 0:i.errorContentContainerStyles,n.schema.requiredSelectionErrorTemplate,a,"dropdown-required-selection-error"):null]})}):null}function Ph(t){const n=t.schema.styles,i=y(),o=m((e=>e.staticData)),r=Ma(),{tabIndex:s,styles:l,isDisabled:c}=St(r),d=()=>{var e;i({type:Ih,payload:{event:"Checkout",targetStep:t.schema.targetStep,offerPositionIndex:null!==(e=null==o?void 0:o.position)&&void 0!==e?e:0,data:t.schema.data}})};return e(Uo,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:t.schema.targetStep,className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"CheckoutStateButtonTrigger",disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:t.schema.targetStep,tabIndex:s,style:Object.assign({cursor:"pointer"},l),children:e(Di,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,Kt(i,t.testId)))))})})}})}const $h=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/;function jh(t){const n=sa(),i=Ma(),{schema:a,testId:o}=t,r=n(a.value),{tabIndex:s,styles:l,isDisabled:c}=St(i);return"string"==typeof(d=r)&&$h.test(d)?e(Uo,{styles:a.styles,children:({classnames:t})=>e("div",{"aria-hidden":c,className:null==t?void 0:t.own,"data-e2e":"ColorSwatch","data-testid":o,style:Object.assign({backgroundColor:r},l),tabIndex:s})}):null;var d}function Fh(e){return{name:e,styles:{elements:{own:[{default:{text:{fontSize:28},border:{borderColor:{light:"#131317"},borderRadius:50,borderStyle:"solid",borderWidth:"2"},spacing:{padding:"4"}}}]}}}}const Gh=Fh("ChevronLeft"),Mh=Fh("ChevronRight");function Bh(i){const{schema:s,testId:l}=i,u=s.scrollGradientLength||36,p=Qa(),f=Object.values(p.images||{}),m=f.length>1?1:0,h=d((()=>m?[f.at(-1),...f,f.at(0)].filter((e=>void 0!==e)):f),[f,m]),[v,g]=c({left:u,right:u}),[b,I]=c(m),[E,S]=c(0),C=r(b),w=r(E),[T,x]=c(!1),[O,A]=c(0),[N,L]=c(!1),[R,_]=c(!1),D=Ma(),{styles:k,isDisabled:P,tabIndex:$}=St(D),j=r(null),F=r(null),G=r([]),M=r([]),B=r(null),U=y();function V(e,t,n="smooth",i=!1){if(!e||!t)return;if(i){const n=e.getBoundingClientRect(),i=t.getBoundingClientRect();if(n.left>=i.left&&n.right<=i.right)return}const a=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=t.scrollLeft+(a.left-o.left);t.scrollTo({left:r,behavior:n})}function z(){const e=j.current;e&&x(e.scrollWidth>e.clientWidth)}function H(e){const{scrollLeft:t,scrollWidth:n,clientWidth:i}=e,a=n-i-t;g({left:t<u?t:u,right:a<u?a:u})}!function(){const e=r(null);o((()=>{const t=F.current;if(!t)return;let n=0,i=t.scrollLeft;const a=()=>{const o=t.scrollLeft;o===i?n++:(n=0,i=o),n>=5?(null!==e.current&&(cancelAnimationFrame(e.current),e.current=null),B.current&&B.current()):e.current=requestAnimationFrame(a)};return a(),()=>{null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)}}),[B.current])}(),o((()=>{Y(m),J(0),V(M.current[0]||null,j.current,"instant"),V(G.current[m]||null,F.current,"instant"),z()}),[p.catalogItemId,m]),o((()=>{const e=j.current;if(!e)return;function t(e){const t=j.current;t&&0!==e.deltaY&&(e.preventDefault(),t.scrollLeft+=e.deltaY)}const n=new ResizeObserver((()=>{z(),H(e),e.clientWidth!==O&&(V(G.current[C.current]||null,F.current,"instant"),V(M.current[w.current]||null,e,"instant"),A(e.clientWidth))}));return n.observe(e),e.addEventListener("wheel",t,{passive:!1}),()=>{n.disconnect(),e&&e.removeEventListener("wheel",t)}}),[]);const W={display:"flex",position:"absolute",top:"50%",transform:"translateY(-50%)",backgroundColor:"transparent",cursor:P?"not-allowed":"pointer"};function q(e){U({type:an,payload:{name:"SignalUserInteraction",action:e,context:"CatalogImageGallery",parentGuid:p.instanceGuid}})}function K(e,t){if(N)return;q(t);const n=b+e;let i=n,a=E+e;0===n?(i=h.length-2,a=f.length-1):a===f.length&&(i=1,a=0),L(!0),V(G.current[n]||null,F.current,"smooth"),V(M.current[a]||null,j.current,"smooth",!0),J(a),Y(i),B.current=n===i?()=>{L(!1)}:()=>{V(G.current[i]||null,F.current,"instant"),L(!1)}}function Y(e){I(e),C.current=e}function J(e){S(e),w.current=e}return f.length>0?e(Uo,{styles:s.styles,children:({classnames:i})=>t("div",{className:null==i?void 0:i.own,children:[t("div",{onMouseOver:()=>_(!0),onMouseOut:()=>_(!1),style:{position:"relative"},"data-testid":`${l}-main-image-container`,children:[R&&1===m&&t(n,{children:[e("button",{style:Object.assign(Object.assign({},W),{left:"2.5%"}),className:null==i?void 0:i.scrollIconButton,onClick:()=>K(-1,"MainImageScrollIconLeftClick"),"data-testid":"main-image-scroll-left-button",children:e(or,{schema:s.leftScrollIconTemplate||Gh})}),e("button",{style:Object.assign(Object.assign({},W),{right:"2.5%"}),className:null==i?void 0:i.scrollIconButton,onClick:()=>K(1,"MainImageScrollIconRightClick"),"data-testid":"main-image-scroll-right-button",children:e(or,{schema:s.rightScrollIconTemplate||Mh})})]}),e("div",{ref:F,style:{display:"-webkit-box",aspectRatio:"1 / 1",overflow:"hidden",scrollBehavior:"smooth"},children:a.Children.toArray(h.map(((t,n)=>e("div",{ref:e=>function(e,t){G.current[t]=e}(e,n),style:{aspectRatio:"1 / 1",marginRight:"2px"},children:e("img",{src:t.light,alt:t.alt,title:t.title,className:null==i?void 0:i.mainImage,loading:"lazy",style:Object.assign(Object.assign({},k),{height:"100%",width:"100%"}),"data-testid":`${l}-main-image-${n}`,"data-e2e":"CatalogImageGallery-mainImage"})},`${t.light}-${n}`))))})]}),e("div",{ref:j,onScroll:e=>H(e.currentTarget),className:null==i?void 0:i.thumbnailList,style:Object.assign(Object.assign({},k),{display:"flex",overflow:"auto",justifyContent:T?"flex-start":"center",scrollbarWidth:"none",scrollBehavior:"smooth",maskImage:`linear-gradient(to right, transparent 0, black ${v.left}px, black calc(100% - ${v.right}px), transparent 100%)`}),children:a.Children.toArray(f.map(((t,n)=>e("div",{style:{flexShrink:0,aspectRatio:"1 / 1",overflow:"hidden"},children:e("img",{ref:e=>function(e,t){M.current[t]=e}(e,n),src:t.light,alt:t.alt,title:t.title,className:n===E?null==i?void 0:i.selectedThumbnailImage:null==i?void 0:i.thumbnailImage,loading:"lazy",style:Object.assign(Object.assign({},k),{cursor:P?"not-allowed":"pointer",pointerEvents:"auto",aspectRatio:"1 / 1"}),"data-testid":`${l}-thumbnail-${n}`,"data-e2e":"CatalogImageGallery-thumbnail",tabIndex:$,onClick:()=>function(e){if(N)return;q("ThumbnailClick"),L(!0);const t=m?e+1:e;J(e),Y(t),V(G.current[t]||null,F.current,"smooth"),V(M.current[e]||null,j.current,"smooth",!0),B.current=()=>{L(!1)}}(n)})}))))})]})}):null}const Uh={size:48,radius:18,stroke:4,duration:.6,primaryColor:"#5F5F5F",secondaryColor:"#CFCFCF",primaryRotation:-50,secondaryRotation:45,arcFraction:1/3.5,mode:"segmented"},Vh={elements:{own:[{default:{container:{justifyContent:"center",alignItems:"center"},dimension:{width:{type:"percentage",value:100}}}}],spinner:[{default:{container:{justifyContent:"center",alignItems:"center"}}}]}};function zh(i){const{config:a}=i.schema,o=Object.assign(Object.assign({},Uh),a),r=o.radius,s=o.size/2,l="segmented"!==o.mode?(()=>{var e;const t=2*Math.PI*r,n=t*(null!==(e=o.arcFraction)&&void 0!==e?e:1/3.5);return{arc:n,gap:t-n}})():null,c={container:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%"},spinner:{display:"block",animation:"segmented"===o.mode?`spinner-rotate ${o.duration}s linear infinite`:`spin ${o.duration}s ease-in-out infinite`,transformOrigin:"segmented"===o.mode?`${s}px ${s}px`:"center center"}};return e(Uo,{styles:i.schema.styles?Wt(Vh,i.schema.styles):Vh,children:({classnames:a})=>t("div",{className:null==a?void 0:a.own,"data-testid":i.testId,"data-e2e":"LoadingSpinner",style:c.container,children:[e("svg",{width:o.size,height:o.size,viewBox:`0 0 ${o.size} ${o.size}`,role:"img","aria-label":"Loading","data-testid":`${i.testId}-loading-spinner-svg`,children:"segmented"===o.mode?t("g",{className:null==a?void 0:a.spinner,style:c.spinner,"data-testid":`${i.testId}-segmented-svg-group`,children:[e("path",{d:`M ${s} ${s-r} A ${r} ${r} 0 0 1 ${s+r} ${s}`,fill:"none",stroke:o.primaryColor,strokeWidth:o.stroke,strokeLinecap:"butt"}),e("path",{d:`M ${s+r} ${s} A ${r} ${r} 0 0 1 ${s} ${s+r}`,fill:"none",stroke:o.primaryColor,strokeWidth:o.stroke,strokeLinecap:"butt"}),o.secondaryColor&&t(n,{children:[e("path",{d:`M ${s} ${s+r} A ${r} ${r} 0 0 1 ${s-r} ${s}`,fill:"none",stroke:o.secondaryColor,strokeWidth:o.stroke,strokeLinecap:"butt"}),e("path",{d:`M ${s-r} ${s} A ${r} ${r} 0 0 1 ${s} ${s-r}`,fill:"none",stroke:o.secondaryColor,strokeWidth:o.stroke,strokeLinecap:"butt"})]})]}):t("g",{className:null==a?void 0:a.spinner,style:c.spinner,"data-testid":`${i.testId}-dashed-svg-group`,children:[e("circle",{cx:s,cy:s,r:r,fill:"none",stroke:o.primaryColor,strokeWidth:o.stroke,strokeDasharray:`${null==l?void 0:l.arc} ${null==l?void 0:l.gap}`,strokeDashoffset:"0",strokeLinecap:"butt",transform:`rotate(${o.primaryRotation} ${s} ${s})`}),o.secondaryColor&&e("circle",{cx:s,cy:s,r:r,fill:"none",stroke:o.secondaryColor,strokeWidth:o.stroke,strokeDasharray:`${null==l?void 0:l.arc} ${null==l?void 0:l.gap}`,strokeDashoffset:"0",strokeLinecap:"butt",transform:`rotate(${o.secondaryRotation} ${s} ${s})`})]})}),e("style",{children:"\n /* Animation for dashed circle mode */\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n \n /* Animation for segmented mode (default) */\n @keyframes spinner-rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n "})]})})}const Hh=new Map;function Wh(t){const n=1e3*t.schema.durationInSeconds,i=t.schema.format||"M:SS",a=t.schema.key,s=t.testId,l=y(),[d,u]=c(n),p=r(null),f=r(null),h=m((e=>e.staticData));function v(){const e=Math.ceil(d/1e3);if("S"===i)return e;{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${String(n).padStart(2,"0")}`}}return o((()=>(f.current=requestAnimationFrame((function e(t){p.current||(p.current=function(e,t){const n=Hh.get(e);return void 0!==n?n:(Hh.set(e,t),t)}(a,t));const i=t-p.current,o=Math.max(n-i,0);u(o),o>0?f.current=requestAnimationFrame(e):(h&&l({type:an,payload:{name:"SignalDismissal",parentGuid:h.offer.creative.instanceGuid,dismissalMethod:"OfferLifecycleTimer"}}),l({type:on,payload:{event:"Dismissed",dismissalReason:"Implicit"}}))})),()=>{f.current&&cancelAnimationFrame(f.current)})),[n,l,h,a]),e(Uo,{styles:t.schema.styles,children:({classnames:n})=>t.isInline?e("span",{className:null==n?void 0:n.own,"data-testid":s||"","data-e2e":"OfferLifecycleTimer",children:v()}):e("p",{className:null==n?void 0:n.own,"data-testid":s||"","data-e2e":"OfferLifecycleTimer",children:v()})})}const qh={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s","span","h1","h2","h3","h4","h5","h6","div","b"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[],h3:[],div:[],b:[]},allowedSchemes:["http","https"]},Kh=new Map([["&","_;^;_"]]),Yh=new RegExp(`<a *(?=${qh.allowedAttributes.a.join("|")}|>)`,"g"),Jh=new RegExp('<a [^>]*href="([^"]+)"',"g"),Zh=new RegExp("(<br *?>)|(<br *?/>)","g"),Qh="<br/>";function Xh(t){const n=sa(),i=Ma(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Jh,((e,t)=>{const n=t.replaceAll("&",Kh.get("&"));return e.replace(t,n)})).replaceAll(Zh,Qh)}(e);return t===vt(t,qh)}(e))throw new jt("FAILED_SANITISING_HTML","Invalid HTML tags");return e.trim()?e:""}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=St(i);return a?e(Uo,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class = "${null==n?void 0:n.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0));return l=a,new RegExp("</(p|ul|ol)>").test(l)?e("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Yh,`<a ${i.join(" ")}`)}}):t.isInline?e("span",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Yh,`<a ${i.join(" ")}`)}}):e("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Yh,`<a ${i.join(" ")}`)}});var l}}):null}function ev(n){var i;const{schema:a}=n,[s,l]=c(!1),[d,u]=c(!1),[p,f]=c(!1),[m,h]=c(!1),[v,g]=c(0),b=Ma(),I=y(),{tabIndex:E,isDisabled:S}=St(b),C=sa(),w=r(null),T=r(null),x=a.lineHeight*a.lineLimit,O=x-a.lineHeight,A=Qa();function N(){const e=a.linearGradientConfig;return e?{background:`linear-gradient(to bottom, ${e.linearColorStart} ${O}px, ${e.linearColorStop||"transparent"})`,backgroundClip:"text",color:"transparent"}:{}}function L(){const e={overflow:"hidden",textOverflow:"clip"};return m?Object.assign(Object.assign(Object.assign({},e),s?{}:N()),{transition:"height 0.3s ease",height:s?`${v}px`:`${x}px`}):!s&&p?Object.assign(Object.assign(Object.assign(Object.assign({},e),a.linearGradientConfig?{}:{display:"-webkit-box",WebkitLineClamp:a.lineLimit,lineClamp:a.lineLimit,WebkitBoxOrient:"vertical"}),N()),a.linearGradientConfig?{height:`${x}px`}:{}):e}return o((()=>{const e=w.current;if(!e)return;const t=()=>{f(e.scrollHeight>x),g(e.scrollHeight)};l(!1),u(!1),h(!1),f(!1),t();const n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect(),T.current&&cancelAnimationFrame(T.current)}}),[null===(i=w.current)||void 0===i?void 0:i.innerText,x]),e(Uo,{styles:n.schema.styles,children:({classnames:i})=>t("div",{"aria-hidden":S,"data-testid":n.testId,"data-e2e":"ReadMoreTextContainer",className:null==i?void 0:i.own,children:[e("div",{ref:w,"data-testid":`${n.testId}-content-container`,className:null==i?void 0:i.contentContainer,style:L(),onTransitionEnd:()=>{T.current=requestAnimationFrame((()=>{h(!1),T.current=null})),u((e=>!e))},children:e(Xh,{schema:{value:a.value}})}),p&&e("button",{onClick:()=>{I({type:an,payload:{name:"SignalUserInteraction",action:s?"CollapseReadMoreText":"ExpandReadMoreText",context:"ReadMoreTextContainer",parentGuid:A.instanceGuid}}),h(!0),T.current=requestAnimationFrame((()=>{l((e=>!e)),T.current=null}))},tabIndex:E,className:null==i?void 0:i.expansionButton,style:{background:"none",cursor:"pointer"},children:C(d?a.collapseLabel:a.expandLabel)})]})})}function tv(t){const n=y(),i=t.schema,o=i.validatorTriggerConfig,r=t.schema.styles,s=Ma(),{styles:l,isDisabled:c}=St(s),d=Oh(),u=Qa();function p(){let e=!0;o&&(e=d.validateFieldKeys(o.validatorFieldKeys)),e?(n({type:an,payload:{name:"SignalUserInteraction",action:"OfferProgression",context:"CustomStateValidationTriggerButton",parentGuid:u.instanceGuid}}),n({type:rn,payload:{key:i.customStateKey,value:i.customStateValue}})):n({type:an,payload:{name:"SignalUserInteraction",action:"ValidationTriggerFailed",context:"CustomStateValidationTriggerButton",parentGuid:u.instanceGuid}})}return e(Uo,{styles:r,children:({classnames:n})=>{var i;return e("button",{className:null==n?void 0:n.own,onClick:p,"data-testid":t.testId,"data-e2e":"CustomStateValidationTriggerButton",disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:"",style:Object.assign({cursor:"pointer"},l),children:e(Di,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,Kt(i,t.testId)))))})})}})}function nv(t){const n=t.schema.emitInstantPurchaseDismissalRdnEvent,i=y(),o=m((e=>e.staticData)),r=m((e=>e.offerLifecycleEvent)),s=Ma(),{tabIndex:l,styles:c,isDisabled:d}=St(s);function u(){n?(i({type:an,payload:{name:"SignalInstantPurchaseDismissal",parentGuid:(null==o?void 0:o.offer.creative.instanceGuid)||""}}),i({type:on,payload:{event:"Dismissed",dismissalReason:"Explicit"}})):i({type:on,payload:r})}return e(Uo,{styles:t.schema.styles,children:({classnames:n})=>e("button",{className:null==n?void 0:n.own,onClick:u,"data-testid":t.testId,"data-e2e":"DismissInstantPurchaseButton",disabled:d,"aria-disabled":d,"aria-label":t.schema.a11yLabel||"",tabIndex:l,style:Object.assign({cursor:"pointer"},c),children:e(Di,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,Kt(i,t.testId)))))})})})}function iv(n){var i,o;const{validatorFieldConfig:s,checkboxColor:l}=n.schema,u=null!==(i=n.schema.checkboxScale)&&void 0!==i?i:1,[p,f]=c(null!==(o=n.schema.value)&&void 0!==o&&o),m=r(p),h=Oh(),v=y(),g=Qa();function b(){return m.current}const I=d((()=>Nh({required:b},s)),[s]);function E(){return!s||h.getFieldKeyValidity(s.validationFieldKey)}function S(e,t){const n=[e];return E()||n.push(t),n.join(" ")}function C(e){return S(null==e?void 0:e.checkbox,null==e?void 0:e.checkboxError)}function w(e){return S(null==e?void 0:e.label,null==e?void 0:e.labelError)}function T(t,i){return e(Di,{children:e=>a.Children.toArray(t.map(((t,a)=>e(t,void 0,Kt(a,`${n.testId}-${i}`)))))})}return Ah(null==s?void 0:s.validationFieldKey,I),e(Uo,{styles:n.schema.styles,children:({classnames:i})=>{return t("div",{style:{display:"flex",flexDirection:"column"},children:[t("div",{className:(a=i,S(null==a?void 0:a.own,null==a?void 0:a.checkboxContainerError)),style:{display:"flex",gap:"8px",flexDirection:"row"},children:[e("input",{"data-testid":n.testId,className:C(i),type:"checkbox",checked:p,onChange:e=>{return t=e.target.checked,m.current=t,s&&s.validateOnChange&&h.validateFieldKeys([s.validationFieldKey]),v({type:an,payload:{name:"SignalUserInteraction",action:t?"CheckboxChecked":"CheckboxUnchecked",context:"Checkbox",parentGuid:g.instanceGuid}}),void f(t);var t},style:Object.assign(Object.assign({},l?{accentColor:l}:{}),{transform:`scale(${u})`})}),n.schema.labelTemplate&&e("div",{className:w(i),children:T(n.schema.labelTemplate,"label")})]}),!E()&&n.schema.errorContentTemplate&&e("div",{className:null==i?void 0:i.errorContent,children:T(n.schema.errorContentTemplate,"error-content")})]});var a}})}function av(n){const{discountThreshold:i,styles:o,children:r}=n.schema,s=Qa(),l=function(){if(0===s.originalPrice)return 0;const e=100*(1-s.price/s.originalPrice);return Math.abs(e-Math.round(e))<1e-9?Math.round(e):Math.floor(e)}(),c=sa(),d=(u={label:String(l)},c({data:u},"discountLabel"));var u;return e(Uo,{styles:o,children:({classnames:o})=>t("div",{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",justifyContent:"flex-start"},children:[s.price<s.originalPrice&&e("span",{className:null==o?void 0:o.originalPrice,children:s.originalPriceFormatted}),l>=i&&e(ra,{value:d,children:e(Di,{children:e=>a.Children.toArray(r.map(((t,i)=>e(t,void 0,Kt(i,n.testId)))))})})]})})}function ov(t){const{discountThreshold:n,children:i,styles:o}=t.schema,r=Qa(),s=function(){if(0===r.originalPrice)return 0;const e=100*(1-r.price/r.originalPrice);return Math.abs(e-Math.round(e))<1e-9?Math.round(e):Math.floor(e)}(),l=sa(),c=(d={label:String(s)},l({data:d},"discountLabel"));var d;return e(Uo,{styles:o,children:({classnames:o})=>e("div",{className:null==o?void 0:o.own,children:s>=n&&e(ra,{value:c,children:e(Di,{children:e=>a.Children.toArray(i.map(((n,i)=>e(n,void 0,Kt(i,t.testId)))))})})})})}function rv(t,n){if("EscapeHatch"===t.type&&t.node.data){const i=JSON.parse(t.node.data);switch(null==i?void 0:i.type){case"TempCatalogDiscountCalloutTag":return e(av,{schema:i.node});case"CatalogDiscountCalloutTag":return e(ov,{schema:i.node});case"CatalogDropDown":return e(kh,{schema:i.node});case"Checkbox":return e(iv,{schema:i.node});case"CheckoutStateButtonTrigger":return e(Ph,{schema:i.node});case"ColorSwatch":return e(jh,{schema:i.node});case"CatalogImageGallery":return e(Bh,{schema:i.node});case"CustomStateValidationTriggerButton":return e(tv,{schema:i.node});case"DismissInstantPurchaseButton":return e(nv,{schema:i.node});case"LoadingSpinner":return e(zh,{schema:i.node});case"OfferLifecycleTimer":return e(Wh,{schema:i.node,isInline:null!=n&&n});case"ReadMoreTextContainer":return e(ev,{schema:i.node});default:return}}}function sv(t){const n=ki(),i=qa(),r=sa(),s=Ni(),l=Mi().catalogItems||[],c=m((e=>e.selectedItem))||l[0];return o((()=>{c&&s({type:an,payload:{name:"SignalImpression",parentGuid:null==c?void 0:c.instanceGuid}})}),[c,s]),c?e(Uo,{styles:t.schema.styles,children:({classnames:o})=>{return e("div",{"data-testid":t.testId,"data-e2e":"CatalogCombinedCollection",className:null==o?void 0:o.own,style:{display:"flex",flexDirection:"column"},children:a.Children.toArray(e(xh,{children:e(Za,{context:c,children:e(Ha,{value:i(c),children:e(ra,{value:(s=c,r({data:s},"catalogItem")),children:n(t.schema.template,void 0,t.testId?`${t.testId}-child`:"")})})})}))});var s}}):null}function lv(t,n,i){if("RichText"===t.type)return e(Xh,{schema:t.node,testId:n,isInline:null!=i&&i})}const cv={BasicText:(e,t)=>Xo(e,t,!0),RichText:(e,t)=>lv(e,t,!0),StaticLink:(e,t)=>ur(e,t,!0),EscapeHatch:e=>rv(e,!0)};function dv(t){const n=ki();return e(Pi,{value:n,overrides:cv,children:e(Di,{children:n=>e(Uo,{styles:t.schema.styles,children:({classnames:i})=>{var o;return e("div",{className:null==i?void 0:i.own,"data-testid":t.testId,"aria-label":null!==(o=t.schema.a11yLabel)&&void 0!==o?o:void 0,children:a.Children.toArray(t.schema.children.map(((e,i)=>n(e,void 0,Kt(i,t.testId)))))})}})})})}const uv={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(_h,{schema:t.node,testId:n})},CatalogCombinedCollection:function(t,n){if("CatalogCombinedCollection"===t.type)return e(sv,{schema:t.node,testId:n})},EscapeHatch:rv,RichText:lv,InlineContainer:function(t,n){if("InlineContainer"===t.type)return e(dv,{schema:t.node,testId:n})}};function pv(){const t=Fa(),n=ki(),i=m(Uy),a=sa()({state:i},"textContent");return e(Pi,{value:n,overrides:uv,children:e(ra,{value:a,children:e(Di,{children:e=>e(t)})})})}function fv(e){if(!e.copy)return null;const t=t=>e.copy[`ppu.${t}`]||"";return{shippingAttributes:{address1:t("shippingAddress1"),address2:t("shippingAddress2"),city:t("shippingCity"),state:t("shippingState"),country:t("shippingCountry"),postalCode:t("shippingZipcode")}}}const yv={staticData:$y,selectedItem:(e=null,t)=>t.type===bh?t.payload:e,dynamicData:jy,childLayouts:Py,fulfillmentDetails:(e=null,t)=>"INSTANT_PURCHASE/SET_FULFILLMENT_DETAILS"===t.type?t.payload:e,offerLifecycleEvent:(e=null,t)=>t.type===wh?t.payload:e};function mv(e={}){return Object.assign({staticData:null,selectedItem:null,dynamicData:null,childLayouts:{launched:{}},fulfillmentDetails:null,offerLifecycleEvent:null},e)}const hv="INVALID_RESPONSE_OBJECT",vv="MISSING_APP_STATE_IN_INSTANT_PURCHASE_MODULE",gv="MISSING_PAYMENT_REF_IN_INSTANT_PURCHASE_MODULE",bv="MISSING_STATIC_DATA_IN_INSTANT_PURCHASE_MODULE";function Iv(e,t){return st((n=>e.onEvent({name:Dl.PartnerMessage.CartItemInstantPurchaseResponse,source:"partner",callback:e=>{var i;"object"==typeof(i=e)&&null!==i&&"upsellItems"in i&&Array.isArray(i.upsellItems)&&i.upsellItems.every((e=>"object"==typeof e))&&"totalUpsellPrice"in i&&"number"==typeof i.totalUpsellPrice&&"currency"in i&&"string"==typeof i.currency&&"paid"in i&&"boolean"==typeof i.paid&&"success"in i&&"boolean"==typeof i.success?n(e):t({level:$t,code:"MALFORMED_INSTANT_PURCHASE_PARTNER_DATA",message:`Malformed data received from partner\n ${e}`})}})))}function*Ev(e,t){var n;try{for(;;){const t=yield We(e);t&&(yield qe({type:Sh,payload:t}))}}catch(e){yield ze(t,{level:$t,code:"INSTANT_PURCHASE_PARTNER_CHANNEL_ERROR",message:null!==(n=e.message)&&void 0!==n?n:"Unknown error in instant-purchase partner channel"})}finally{e.close()}}function*Sv(e,t){var n;try{for(;;){const t=yield We(e);if(t){yield qe({type:Ch,payload:t});break}}}catch(e){yield ze(t,{level:$t,code:"INSTANT_PURCHASE_WSDK_CHANNEL_ERROR",message:null!==(n=e.message)&&void 0!==n?n:"Unknown error in instant-purchase WSDK channel"})}finally{e.close()}}const Cv="Unknown failure reason",wv=6e4;function*Tv(){var e,t;const n=yield Ye((e=>e)),i=null!==(t=null===(e=null==n?void 0:n.staticData)||void 0===e?void 0:e.offer.catalogItems)&&void 0!==t?t:[];1===i.length&&i[0]&&(yield*_v(i[0]))}function*xv(e){const{catalogItem:t}=e.payload;yield*_v(t)}function*Ov(e,t,n){const{catalogItem:i,quantity:a}=n.payload,o=Ys(i,a);o?(yield qe({type:an,payload:{name:"SignalCartItemInstantPurchaseInitiated",parentGuid:i.instanceGuid,objectData:{catalogItemId:i.catalogItemId,quantity:a}}}),yield*$v("ProcessingState",1),n.payload.useInstantPurchaseExtension?yield*function*(e,t,n){const i=yield Ye((e=>e));if(!i)return yield ze(n,{level:$t,code:vv,message:"App state is not set within Redux store."}),void(yield*jv());if(!i.staticData)return yield ze(n,{level:$t,code:bv,message:"App state is not configured with static data."}),void(yield*jv());const a=i.staticData.offer.creative.copy["ppu.partnerPaymentReference"];if(!a)return yield ze(n,{level:$t,code:gv,message:"Partner payment reference is not set within creative copy."}),void(yield*jv());const o={upsellItems:[{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,quantity:e.quantity,unitPrice:e.unitPrice,totalPrice:e.totalPrice,currency:e.currency}],totalUpsellPrice:e.totalPrice,currency:e.currency,paymentDetails:{partnerPaymentReference:a}};i.fulfillmentDetails&&(o.fulfillmentDetails=i.fulfillmentDetails);yield Qe(Rv,t,n),yield qe({type:sn,payload:{name:"INITIATE_INSTANT_PURCHASE_EVENT",body:o}})}(o,e,t):yield*function*(e,t,n){yield Qe(Lv,t,n),yield qe({type:sn,payload:{name:"CART_ITEM_INSTANT_PURCHASE",body:{upsellItems:[e],totalUpsellPrice:e.totalPrice||0,currency:e.currency}}})}(o,e,t)):(yield ze(t,{level:$t,code:hv,message:`Unable to translate catalog item with ID ${i.catalogItemId} to cart item for instant purchase transaction.`}),n.payload.useInstantPurchaseExtension?yield*jv():(yield*$v("ProcessingState",0),yield qe({type:ln,payload:{key:"offerComplete",value:2}})))}function*Av(e,t){const n=yield Ye((e=>e.staticData));if(!n)return yield ze(e,{level:$t,code:bv,message:"App state is not configured with static data."}),void(yield*Pv("Error"));if(!n.offer.catalogItems)return yield ze(e,{level:$t,code:"MISSING_CATALOG_ITEMS",message:"No catalog items found within offer data."}),void(yield*Pv("Error"));const i={accountId:n.offer.accountId,catalogItems:n.offer.catalogItems};let a,o;t.payload.success?(a=Dv,o="Success"):(a=(e,n)=>function(e,t,n,i){return{name:"SignalCartItemInstantPurchaseFailure",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,failureReason:i.reason||Cv,providerId:n.accountId.toString()}}}(e,n,i,t.payload),o="Unspecified"),yield*function*(e,t,n,i){const a=[];for(const i of e.upsellItems){const e=kv(i,t.catalogItems);void 0===e?a.push(i):yield qe({type:an,payload:n(e,i.quantity)})}a.length>0&&(yield*function*(e,t){const n=JSON.stringify(e,null,"\t").replaceAll('"',"");yield ze(t,{level:$t,code:hv,message:`Unable to map cart items to catalog items in the instant purchase partner response: ${n}.`})}(a,i))}(t.payload,i,a,e),yield*Pv(o)}function*Nv(e){e.payload.response&&e.payload.response.success?yield*Fv(1,{event:"Completed",completionReason:"Success"}):yield*jv()}function*Lv(e,t){const n=Iv(e,t),{timeout:i}=yield tt({channel:ze(Ev,n,t),timeout:nt(wv)});i&&(yield ze(t,{level:$t,code:"INSTANT_PURCHASE_PARTNER_RESPONSE_TIMEOUT",message:"Instant-purchase partner response timed out after 60000ms"}),n.close(),yield*function*(e){yield*$v("ProcessingState",0),yield qe({type:on,payload:{event:"Dismissed",dismissalReason:e}})}("Implicit"))}function*Rv(e,t){const n=function(e,t){return st((n=>e.onEvent(...["INSTANT_PURCHASE_SUCCESS","INSTANT_PURCHASE_FAILURE"].map((e=>({name:e,source:"partner",callback:e=>{var i;"object"==typeof(i=e)&&null!==i&&"timestamp"in i&&"string"==typeof i.timestamp&&"sessionId"in i&&"string"==typeof i.sessionId?n(e):t({level:$t,code:"MALFORMED_INSTANT_PURCHASE_WSDK_DATA",message:`Malformed data received from wsdk\n ${e}`})}}))))))}(e,t),{timeout:i}=yield tt({channel:ze(Sv,n,t),timeout:nt(wv)});i&&(yield ze(t,{level:$t,code:"INSTANT_PURCHASE_WSDK_RESPONSE_TIMEOUT",message:"Instant-purchase wsdk response timed out after 60000ms"}),n.close(),yield*Fv(2,{event:"Completed",completionReason:"Unspecified"}))}function*_v(e){var t,n,i;yield qe({type:bh,payload:e});const a={title:null!==(t=e.title)&&void 0!==t?t:"",description:null!==(n=e.description)&&void 0!==n?n:"",price:null!==(i=e.priceFormatted)&&void 0!==i?i:""};e.copy&&Object.entries(e.copy).forEach((([e,t])=>{a[`copy.${e}`]=t})),yield qe({type:ky,payload:{text:a}})}function Dv(e,t){return{name:"SignalCartItemInstantPurchase",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,initiatedBy:Dt.DCUI}}}function kv(e,t){return t.find((t=>t.catalogItemId===e.catalogItemId))}function*Pv(e){yield*$v("ProcessingState",0),yield qe({type:on,payload:{event:"Completed",completionReason:e}})}function*$v(e,t){yield qe({type:rn,payload:{key:e,value:t}})}function*jv(){yield*Fv(2,{event:"Completed",completionReason:"Error"})}function*Fv(e,t){yield qe({type:wh,payload:t}),yield*$v("ProcessingState",0),yield qe({type:ln,payload:{key:"offerComplete",value:e}})}const Gv=["Success","Unspecified","Error"],Mv=["Implicit","Explicit"];function*Bv(e,t){if("Checkout"!==t.payload.event)return;yield qe({type:ln,payload:{key:"checkout",value:Uv(t.payload),offerPositionIndex:t.payload.offerPositionIndex}});const n=t.payload.data;if(n){const i="Completed"===n.event;if("Completed"===n.event||"Dismissed"===n.event){(i?Gv.includes(n.reason):Mv.includes(n.reason))?yield qe({type:on,payload:Object.assign(Object.assign({event:n.event},i?{completionReason:n.reason}:{dismissalReason:n.reason}),{offerPositionIndex:t.payload.offerPositionIndex})}):yield ze(e,{level:$t,code:"CHECKOUT_BUTTON_INVALID_OFFERLIFECYCLE",message:`Misconfigured offer lifecycle payload in handleCheckoutLifecycle: ${n}.`})}else yield ze(e,{level:$t,code:"CHECKOUT_BUTTON_UNKNOWN_EVENT",message:`Unknown event type in checkout lifecycle: ${JSON.stringify(n)}`})}}function Uv(e){var t;return null!==(t={ViewOffer:0,ViewTransactionDetails:1,EditPayment:2,EditShipping:3,EditPaymentAndShipping:4,CostBreakdown:5,Confirmation:6,CloseOffer:7}[e.targetStep])&&void 0!==t?t:0}function*Vv(e,t){yield Je([Xe(Tv),Ze(Ih,Bv.bind(null,t)),Ze(gh,xv),et(Eh,Ov.bind(null,e,t)),et(Sh,Av.bind(null,t)),et(Ch,Nv.bind(null)),Ze(fn,zy.bind(null,e,t)),Ze("*",Ks.bind(null,[Jt,fn],e))])}Object.assign(Object.assign({},vn),{INITIATE_INSTANT_PURCHASE:Eh,INSTANT_PURCHASE_PARTNER_RESPONSE:Sh,INSTANT_PURCHASE_WSDK_RESPONSE:Ch});const zv=(new Da).withAppFactory((function(n){var i;if(n.rootElement){const o=f(n.rootElement),r=mv({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion},fulfillmentDetails:fv(n.offerData.creative)}),s=function(e,t,n=mv()){const i=ot(),a=it({reducer:yv,devTools:{name:"Instant Purchase"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Vv,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Ya,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(es,{}),e(v,{store:s,children:e(Qr,{settings:n,dispatch:s.dispatch,children:e(pv,{})})})]})}))}}));var Hv=Object.freeze({__proto__:null,moduleConnectorBuilder:zv});const Wv=s(null),qv=({children:t})=>{var n;const[i,a]=c([]),[r,s]=c(0),[l,d]=c(0),u=sa();return o((()=>{let e=0;const t=i.length,n=setInterval((()=>{e=e+1>=t?0:e+1,s(e)}),l);return()=>clearInterval(n)}),[l,i]),e(Wv.Provider,{value:{images:i,activeIndex:r,duration:l,setImages:a,setActiveIndex:s,setDuration:d},children:e(ra,{value:u({data:{"image.title":null===(n=i[r])||void 0===n?void 0:n.title}},"creativeCopy"),children:t})})};function Kv({active:t,duration:n,containerStyles:i,indicatorStyles:a}){const s=r(null);return o((()=>{t&&s.current&&function(e,t){const n="animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype,i=[{width:0},{width:"100%"}];if(n){const n=e.animate(i,{duration:t,iterations:1});return()=>{n.finish()}}}(s.current,n)}),[t]),e("div",{style:Object.assign({position:"relative",height:"2px",width:"100%",backgroundColor:"#FFFFFF66"},i),children:e("span",{ref:s,style:Object.assign({animationIterationCount:"infinite",animationFillMode:"forwards",animationTimingFunction:"linear",position:"absolute",top:0,left:0,height:"100%",backgroundColor:"#FFF",width:t?"100%":0},a)})})}function Yv(e){const t=l(za),n=[];return e.forEach((e=>{const i=t(`${e}.src`,"copy"),a=t(`${e}.title`,"copy");if(void 0===i)return;const o=function(e={}){return Object.assign({light:"https://plus.unsplash.com/premium_photo-1675826774817-fe983ceb0475?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80",dark:"https://images.unsplash.com/photo-1679941734238-56628f5991f7?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80"},e)}({light:i,title:a});n.push(o)})),n}function Jv({schema:n,testId:i}){const r=JSON.parse(n.data),{styles:s,duration:c,imageKeys:d}=r,u=l(Wv),p=Yv(d);return o((()=>{null==u||u.setImages(p),null==u||u.setDuration(c)}),[]),t("div",{"data-testid":i,style:Object.assign({position:"relative",flexShrink:1,flexGrow:0,width:"100%"},s.elements.own),children:[a.Children.toArray(p.map(((t,n)=>e("img",{src:t.light,alt:t.title,style:Object.assign({opacity:n===(null==u?void 0:u.activeIndex)?1:0,position:0===n?"relative":"absolute",display:0===n?"block":"",top:0,width:"100%",height:"100%",maxHeight:"100%",maxWidth:"100%",transition:"opacity 300ms ease-in-out",objectFit:"contain"},s.elements.image)})))),e("div",{style:Object.assign({display:"flex",gap:"2px",width:"70%",position:"absolute",margin:"0 15%",bottom:"8px",zIndex:20,justifyContent:"center"},s.elements.indicatorWrapper),children:a.Children.toArray(p.map(((t,n)=>e(Kv,{duration:c,active:n===(null==u?void 0:u.activeIndex),containerStyles:s.elements.indicatorContainer,indicatorStyles:s.elements.indicator}))))})]})}const Zv={allowedTags:["em","strong","a","br","u","p","li","ul","ol","span"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[]},allowedSchemes:["http","https"]},Qv=new Map([["&","_;^;_"]]),Xv=new RegExp(`<a *(?=${Zv.allowedAttributes.a.join("|")}|>)`,"g"),eg=new RegExp("<span*>","g"),tg=new RegExp(`<a *(?:(?:${Zv.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),ng=new RegExp("(<br *?>)|(<br *?/>)","g"),ig="<br/>";function ag(t){const n=sa(),i=Ma(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(tg,((e,t)=>{const n=t.replaceAll("&",Qv.get("&"));return e.replace(t,n)})).replaceAll(ng,ig)}(e);return t===vt(t,Zv)}(e))throw new jt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=St(i);return a?e(Uo,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class = "${null==n?void 0:n.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0));return l=a,new RegExp("</(p|ul|ol)>").test(l)?e("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Xv,`<a ${i.join(" ")}`).replace(eg,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}}):e("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Xv,`<a ${i.join(" ")}`).replace(eg,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}});var l}}):null}function og({schema:t}){const n=ki(),i=Ci(eo(),fa()),o=JSON.parse(t.data),[r]=ht({loop:!1,align:"start",slidesToScroll:2,containScroll:"trimSnaps"}),{styles:s,body:{tierItems:l}}=o;if(!l||!l.length)return;const c=l.length>2;return e("div",{className:i`
|
|
136
|
+
`},a.Children.toArray(u.map((e=>l(e))))))))}const pd={name:"loading-extension",componentFactory:e=>a.createElement(ud,{data:e}),interceptors:{}};function fd({linearGradient:e,color1:t,color2:n,color3:i,duration:s,additionalStyles:l,gradientAngle:c}){const u=o(null);r((()=>{const e=()=>{var e;if(null===(e=u.current)||void 0===e?void 0:e.parentElement){const e=u.current.parentElement;requestAnimationFrame((()=>{const t=Array.from(e.children).filter((e=>!e.classList.contains("background-shimmer")));if(t.length>0){const n=t.reduce(((e,t)=>Math.max(e,t.offsetHeight)),0),i=parseInt(e.style.height||"0");n>0&&n!==i&&(e.style.height=`${n}px`)}}))}};let t;const n=()=>{clearTimeout(t),t=setTimeout(e,100)};return window.addEventListener("resize",n),setTimeout(e,100),()=>{window.removeEventListener("resize",n),clearTimeout(t)}}),[]);const p=d((()=>`\n @keyframes slideGradient {\n 0% {\n left: -90%;\n opacity: 0;\n }\n 8% {\n left: -90%;\n opacity: 1;\n }\n 22% {\n left: 90%;\n opacity: 1;\n }\n 28% {\n left: 100%;\n opacity: 0;\n }\n 100% {\n left: 100%;\n opacity: 0;\n }\n }\n .background-shimmer {\n position: absolute !important;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n pointer-events: none;\n z-index: 0;\n }\n \n .background-shimmer::after {\n content: '';\n position: absolute;\n top: 0;\n left: -100%;\n right: 0;\n bottom: 0;\n width: 50%;\n background: ${e||`linear-gradient(\n ${c||"to right"},\n transparent 0%,\n ${t||"rgba(217, 217, 217, 0.30)"} 20%,\n ${n||"rgba(217, 217, 217, 0.50)"} 50%,\n ${i||"rgba(217, 217, 217, 0.30)"} 80%,\n transparent 100%\n )`};\n animation: slideGradient ${s||"3.94s"} linear infinite forwards;\n pointer-events: none;\n z-index: 0;\n }\n ${l}\n`),[e,t,n,i,s,l,c]);return a.createElement(ra,null,(e=>a.createElement(Br,{styles:{}},(e=>{var t;const n=e.classnames;return a.createElement(a.Fragment,null,a.createElement("style",null,p),a.createElement("div",{ref:u,className:`${null!==(t=null==n?void 0:n.own)&&void 0!==t?t:""} background-shimmer`}))}))))}const yd={name:"shimmer-background-extension",componentFactory:e=>e?a.createElement(fd,{linearGradient:e.linearGradient,color1:e.color1,color2:e.color2,color3:e.color3,duration:e.duration,additionalStyles:e.additionalStyles}):a.createElement("div",null,"Could not render Shimmer Background"),interceptors:{}},md=1e3;function hd(e){const t=e.data,{minutes:n,seconds:i,timeRemaining:s,restartTimer:l}=function(e){const[t,n]=c(e),i=(new Date).getTime()/md,a=o(null),s=()=>{const t=(new Date).getTime()/md;n(Math.max(Math.floor(e-(t-i)),0))};return r((()=>(a.current=setInterval(s,md),()=>{a.current&&"number"==typeof a.current&&clearInterval(a.current)})),[]),{minutes:Math.floor(t/60).toString(),seconds:Math.floor(Math.min(t%60,59)).toLocaleString("en-US",{minimumIntegerDigits:2,maximumFractionDigits:0,useGrouping:!1}),timeRemaining:t,restartTimer:function(){a.current&&"number"==typeof a.current&&clearInterval(a.current),n(e),a.current=setInterval(s,md)}}}((null==t?void 0:t.duration)||300),d=m((e=>{const t=g(["progression","currentGroupIndex"],e);return"number"==typeof t?t:0})),u=y();r((()=>{l()}),[d]),r((()=>{0===s&&(u({type:an,payload:{name:"SignalUserInteraction",action:"TimerExpired",context:"TimerProgression"}}),u({type:"PROGRESSION/PROCESS",payload:{offerProcessStatus:"CONTINUE"}}))}),[n,i]);const p=Ma(),{tabIndex:f,styles:h,isDisabled:v}=St(p);return a.createElement("p",{tabIndex:f,style:Object.assign(Object.assign({},null==t?void 0:t.styles),h),"aria-hidden":v,"data-e2e":"Timer"},`${n}:${i}`)}const vd={name:"timer-progression-extension",componentFactory:e=>a.createElement(hd,{data:e}),interceptors:{}};function gd(e){var t,n,i,r,o;const s=!1===e.isValid&&!!e.error;return a.createElement("div",{"data-testid":e.testId},a.createElement("label",{className:null===(t=e.classnames)||void 0===t?void 0:t.label},e.schema.label),a.createElement("input",{className:s?`${null===(n=e.classnames)||void 0===n?void 0:n.error}`:`${null===(i=e.classnames)||void 0===i?void 0:i.field}`,type:"text",value:e.value||"",placeholder:e.schema.placeholder,required:"Required"===e.schema.validator,onChange:t=>{var n;let i=t.target.value;e.schema.inputFilter&&(i=function(e,t){if(!t)return e;if("object"==typeof t&&t.pattern){const n=new RegExp(t.pattern,"g");return e.replace(n,"")}return"numeric"===t?e.replace(/[^0-9]/g,""):e}(i,e.schema.inputFilter)),null===(n=e.onChange)||void 0===n||n.call(e,i)},"aria-invalid":!!s,"aria-describedby":s?`${e.testId}-error`:void 0}),s&&a.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"row"}},a.createElement("img",{src:e.errorIcon,className:null===(r=e.classnames)||void 0===r?void 0:r.errorIcon,alt:"Error"}),a.createElement("div",{className:null===(o=e.classnames)||void 0===o?void 0:o.errorText},e.error)))}function bd(e){const{schema:t,disabled:n,onClick:i,testId:r,classnames:o}=e,s=[null==o?void 0:o.button,n?"disabled":""].filter(Boolean).join(" ");return a.createElement("button",{type:"button",className:s,onClick:e=>{e.preventDefault(),e.stopPropagation(),i&&i()},disabled:n,"data-testid":r,"data-e2e":"FormButton","aria-label":t.ariaLabel||t.label,style:{cursor:n?"not-allowed":"pointer",pointerEvents:"auto",flexWrap:"wrap",minWidth:"max-content"}},a.createElement("span",{className:null==o?void 0:o.text},t.label))}const Id="FORMS/UPDATE",Ed=(e,t,n)=>{if(!t)return{isValid:!0};switch(t){case"Required":return e.trim()?{isValid:!0}:{isValid:!1,error:(null==n?void 0:n.missingLabel)||"This field is required"};case"PhoneNumber":if(!e.trim())return{isValid:!1,error:(null==n?void 0:n.missingLabel)||"Phone number is required"};return/^[+]?[1-9][\d]{0,15}$/.test(e.replace(/\s/g,""))?{isValid:!0}:{isValid:!1,error:(null==n?void 0:n.errorLabel)||"Invalid phone number"};case"Contains":{if(!e.trim())return{isValid:!1,error:(null==n?void 0:n.missingLabel)||"This field is required"};const t=(null==n?void 0:n.allowedValues)||[];return t.includes(e.trim())?{isValid:!0}:{isValid:!1,error:(null==n?void 0:n.errorLabel)||`Invalid value. Allowed values: ${t.join(", ")}`}}case"ZipCode":if(!e.trim())return{isValid:!1,error:(null==n?void 0:n.missingLabel)||"Postal code is required"};return/^\d{5}(-\d{4})?$/.test(e)?{isValid:!0}:{isValid:!1,error:(null==n?void 0:n.errorLabel)||"Invalid ZIP code"};default:return{isValid:!0}}};function Sd(e,t){const n={};return Object.keys(t).forEach((e=>{n[e]={value:"",isValid:!0,error:void 0}})),e&&"object"==typeof e&&Object.keys(t).forEach((t=>{const i=e[t],a=n[t];"string"==typeof i&&a&&(a.value=i)})),n}function Cd(e){var t,n,i,r;const o=y(),s=e.schema.noGroupBreakpoints||[],l=Ri(!0,(e=>{var t;return 0===s.length||!s.includes(null===(t=null==e?void 0:e.breakpoint)||void 0===t?void 0:t.activeBreakpoint)})),d=m((t=>{var n;return null===(n=t.forms)||void 0===n?void 0:n[e.schema.formId]})),p=m((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||0})),f=m((e=>e.slots||[])),h=f.length>0&&(null===(r=null===(i=null===(n=null===(t=f[0])||void 0===t?void 0:t.offer)||void 0===n?void 0:n.catalogItems)||void 0===i?void 0:i[0])||void 0===r?void 0:r.cartItemId);if(!h)return;const v=m((e=>{const t=e.globalOfferDataState||{},n=[];return Object.values(t).forEach((e=>{e.cart&&n.push(...e.cart)})),n})),g=e=>{null==e||e.forEach((e=>{"CUSTOM_EVENT"===e.type?o({type:on,payload:e.payload}):"SLOT_EVENT"===e.type&&Array.from({length:p},((e,t)=>t)).forEach((t=>{o({type:"CUSTOM_STATES/SET",payload:Object.assign(Object.assign({},e.payload),{offerPositionIndex:t})})}))}))},b=Ma(),{tabIndex:I,isDisabled:E,styles:S}=St(b),{fields:C,fieldGroups:w,controls:T}=e.schema,[x,O]=c((()=>Sd(d,C))),[A,N]=c(!1),L=u((()=>Object.entries(x).reduce(((e,[t,n])=>(e[t]=n.value,e)),{})),[x]),R=()=>{var t;N(!0);const n=Object.assign({},x);let i=!0;if(Object.keys(C).forEach((e=>{var t;const a=C[e],r=(null===(t=x[e])||void 0===t?void 0:t.value)||"",o=Ed(r,null==a?void 0:a.validator,a);n[e]={value:r,isValid:o.isValid,error:o.error},o.isValid||(i=!1)})),O(n),i){const n=L();o({type:Id,payload:{formId:e.schema.formId,formData:n}});const i={firstName:n.firstName||"",lastName:n.lastName||"",address1:n.addressLine1||"",address2:n.addressLine2||"",city:n.city||"",state:n.state||"",postalCode:n.zip||"",phoneNumber:n.phone||""};o({type:yn,payload:{cartItemId:h,shipping:i,lineItems:v}}),g((null===(t=null==T?void 0:T.saveButton)||void 0===t?void 0:t.eventModels)||[])}},_=()=>{var e;O(Sd(d,C)),N(!1),g((null===(e=null==T?void 0:T.cancelButton)||void 0===e?void 0:e.eventModels)||[])};return a.createElement(Br,{styles:e.schema.styles},(({classnames:t})=>a.createElement("div",{"data-testid":e.testId,"data-e2e":"Form",className:null==t?void 0:t.own,"aria-hidden":E,tabIndex:I,style:Object.assign({display:"flex",flexDirection:"column"},S)},A&&Object.values(x).some((e=>!e.isValid))&&a.createElement("div",{className:null==t?void 0:t.formError,style:{display:"flex",alignItems:"center",flexDirection:"row"}},a.createElement("img",{className:null==t?void 0:t.formErrorIcon,alt:"Error",src:e.schema.error.url.light}),a.createElement("span",{className:null==t?void 0:t.formErrorText},e.schema.error.text)),w.map(((n,i)=>{const r=l&&1!==n.fields.length?"row":"column";return a.createElement("div",{key:i,style:{display:"flex",flexDirection:r},className:"row"===r?null==t?void 0:t.groupRowWrapper:""},n.fields.map((n=>{const i=C[n],r=x[n]||{value:"",isValid:!0,error:void 0};return i?a.createElement("div",{key:n,style:{flex:"1"}},a.createElement(gd,{schema:i,value:r.value,error:r.error,errorIcon:e.schema.error.url.light,isValid:r.isValid,onChange:e=>((e,t)=>{const n=C[e];let i,a=!0;if((null==n?void 0:n.validateOnChange)&&n.validator){const e=Ed(t,n.validator,n);a=e.isValid,i=e.error}O((n=>Object.assign(Object.assign({},n),{[e]:{value:t,isValid:a,error:i}})))})(n,e),testId:`${e.testId}-${n}`,classnames:{label:null==t?void 0:t.fieldLabel,field:null==t?void 0:t.fieldInput,error:null==t?void 0:t.fieldError,errorText:null==t?void 0:t.fieldErrorText,errorIcon:null==t?void 0:t.fieldErrorIcon}})):null})))})),((null==T?void 0:T.saveButton)||(null==T?void 0:T.cancelButton))&&a.createElement("div",{className:null==t?void 0:t.buttonGroup,style:{display:"flex",flexDirection:l?"row":"column",justifyContent:"flex-end",gap:"12px",marginTop:"24px",pointerEvents:"auto"}},(null==T?void 0:T.cancelButton)&&a.createElement(bd,{schema:T.cancelButton,onClick:_,testId:`${e.testId}-cancel`,disabled:!1,classnames:{button:null==t?void 0:t.cancelButton}}),(null==T?void 0:T.saveButton)&&a.createElement(bd,{schema:T.saveButton,onClick:R,disabled:!1,testId:`${e.testId}-save`,classnames:{button:null==t?void 0:t.saveButton}})))))}function wd(e){const t=ki(),n=na(m((t=>{var n;return null===(n=t.forms)||void 0===n?void 0:n[e.schema.formId]}))||{},e.schema.formId);return a.createElement(oa,{value:n},t(e.schema.node,void 0,e.testId))}const Td={name:"address-form-extension",reducer:{forms:(e,t)=>{if(void 0===e)return{};if(t.type===Id){const n=t.payload,{formId:i,formData:a}=n;return Object.assign(Object.assign({},e),{[i]:a})}return e}},componentFactory:e=>{if(!e||"object"!=typeof e)return a.createElement("div",null,"Could not render Form - invalid data");if((e=>{if("object"!=typeof e||null===e)return!1;const t=e;return"type"in t&&"edit"===t.type&&"formId"in t&&"string"==typeof t.formId&&""!==t.formId.trim()&&"fields"in t&&"object"==typeof t.fields&&"node"in t&&"object"==typeof t.node&&null!==t.node})(e)){const t={formId:e.formId,fields:e.fields||{},node:e.node};return a.createElement(wd,{schema:t,testId:"edit-form-extension"})}if((e=>{if("object"!=typeof e||null===e)return!1;const t=e;return"type"in t&&"view"===t.type&&"formId"in t&&"string"==typeof t.formId&&""!==t.formId.trim()&&"fields"in t&&"object"==typeof t.fields&&null!==t.fields&&"fieldGroups"in t&&Array.isArray(t.fieldGroups)&&"error"in t&&"object"==typeof t.error&&null!==t.error})(e)){const t={formId:e.formId||"default-form",fields:e.fields,fieldGroups:e.fieldGroups||[],controls:e.controls,error:e.error||{url:{light:""},text:"Error occurred"},styles:e.styles,noGroupBreakpoints:e.noGroupBreakpoints||[]};return a.createElement(Cd,{schema:t,testId:"form-extension"})}return a.createElement("div",null,"Could not render Form - invalid type.")},interceptors:{}},xd="MODULE/ADD_LOADED",Od="MODULE/LOAD",Ad="PROGRESSION/INITIALISE",Nd="PROGRESSION/NEXT",Ld="PROGRESSION/PREV",Rd="PROGRESSION/UPDATE_GROUP_SIZE",_d="PROGRESSION/PROCESS",Dd="SLOTS/SET",kd="INSTANT_PURCHASE/DISMISS",Pd="OFFER_LIFECYCLE",$d="DOMAIN_STATES/SET",jd="OFFER_ENGAGEMENT",Fd="GLOBAL_OFFER_DATA_STATE/SET_CART",Gd=Object.assign(Object.assign({},Ts),{NEXT_IN_PROGRESSION:Nd,PREV_IN_PROGRESSION:Ld,INITIALISE_PROGRESSION:Ad,UPDATE_GROUP_SIZE:Rd,SET_SLOTS:Dd,ADD_LOADED_MODULE:xd,SET_DOMAIN_STATE:$d,SET_GLOBAL_OFFER_DATA_CART:Fd}),Md=Object.assign(Object.assign({},xs),{LOAD_MODULES:Od,DISMISS_INSTANT_PURCHASE:kd,PROCESS_PROGRESSION:_d,OFFER_LIFECYCLE:Pd,OFFER_ENGAGEMENT:jd,SET_PARTNER_VALIDATION_STATUS:un});function Bd(e,t){return t<=0||e<=0||t>e?0:Math.ceil(e/t)}function Ud(e,t){const n=[];if(t<=0||e<=0||t>e)throw Error(`Could not generate the progression groups with groupSize: ${t} and totalCount: ${e}`);for(let i=0;i<Bd(e,t);i++){const a=[];for(let n=0;n<t;n++)a.push(Math.min(i*t+n,e-1));n.push([...new Set(a)])}return n}const Vd=Symbol("root");function zd(){return{[Vd]:{}}}const Hd=Object.assign({progression:function(e=null,t){switch(t.type){case Ad:if(function(e){const{totalCount:t,currentGroupIndex:n,groupSize:i}=e;return t>=0&&i>=0&&n>=0&&i<=t&&n<Bd(t,i)}(t.payload)){const{totalCount:e,_:n,groupSize:i}=t.payload;return Object.assign(Object.assign({},t.payload),{indexGroups:Ud(e,i)})}return null;case Rd:{const{groupSize:n}=t.payload,i=null==e?void 0:e.totalCount;return i&&n<=i&&n>0?Object.assign(Object.assign({},e),{groupSize:n,indexGroups:Ud(i,n),currentGroupIndex:0}):null}case Nd:{if(!e)return null;const{totalCount:t,groupSize:n,currentGroupIndex:i}=e;return t>0&&n>0&&i>=0?Object.assign(Object.assign({},e),{currentGroupIndex:Math.min(i+1,Bd(t,n)-1)}):null}case Ld:{if(!e)return null;const{totalCount:t,groupSize:n,currentGroupIndex:i}=e;return t>0&&n>0&&i>=0?Object.assign(Object.assign({},e),{currentGroupIndex:Math.max(i-1,0)}):null}default:return e}},slots:function(e=[],t){return t.type===Dd?t.payload:e},module:function(e={loadedModules:[]},t){return t.type===xd?Object.assign(Object.assign({},e),{loadedModules:[...e.loadedModules,t.payload]}):e},domainStates:function(e=zd(),t){if(t.type===$d){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:Vd;return n===Vd?e:Object.assign(Object.assign({},b([n,t.payload.key],Number(t.payload.value),e)),{[Vd]:{}})}return e}return e},globalOfferDataState:function(e={},t){if(t.type===Fd){if(t.payload.cart){const n=`module${t.payload.offerPositionIndex}`;return Object.assign(Object.assign({},e),{[n]:{cart:t.payload.cart}})}return e}return e}},Ol);function Wd(e={}){return Object.assign(Object.assign(Object.assign({},function(e={}){return Object.assign({layout:hl(),breakpoint:{breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},active:vl(),fonts:[],signal:{queue:[],processed:[]},serializableCache:xl(),settings:{closeOnComplete:!0},customStates:{root:{}}},e)}(e)),{progression:null,slots:[],module:{loadedModules:[]},domainStates:zd(),globalOfferDataState:{}}),e)}function qd(e){var t;return!!e.progression&&(1===e.progression.groupSize&&e.progression.currentGroupIndex===(null===(t=e.progression)||void 0===t?void 0:t.totalCount)-1)}function Kd(e){return e.progression?{activeGroupIndex:e.progression.currentGroupIndex,totalOffers:e.progression.totalCount,totalGroups:Bd(e.progression.totalCount,e.progression.groupSize),isLast:qd(e)}:null}function Yd(e,t){return e.domainStates[`module${t}`]||{offerComplete:0,checkout:0}}function Jd(e){return Object.values(e.globalOfferDataState).reduce(((e,t)=>{if(t&&"object"==typeof t&&"cart"in t){const n=t.cart;if(Array.isArray(n))return e+n.reduce(((e,t)=>e+("number"==typeof t.quantity?t.quantity:0)),0)}return e}),0)}function Zd(i){var a;const{config:r,position:o,visible:s,container:c,testId:d}=i,u=er(),p=Ma(),f=m(gl),y=m((e=>function(e,t){return e.globalOfferDataState[`module${t}`]}(e,o))),h=l(tr),v=l(nr),g=`rokt-${r.layoutVariant.moduleName}-${u}`;return t(n,{children:[!s&&e("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},"aria-hidden":"true"}),e(g,{style:{display:"flex",flexDirection:"column"===c?"column":"row",width:"100%"},slotInstanceGuid:r.instanceGuid,layoutSchema:JSON.stringify(r.layoutVariant.layoutVariantSchema),schemaVersion:h,childLayouts:JSON.stringify(null!==(a=r.layoutVariant.childLayouts)&&void 0!==a?a:[]),offerData:JSON.stringify(r.offer),offerPositionIndex:o,visible:s,container:c,interactivity:p,"data-testid":d,"data-e2e":`OfferSlot-${o}`,inert:(null==v?void 0:v.inert)&&!s?"":void 0,"aria-hidden":(null==v?void 0:v.inert)?void 0:!s,"module-component":!0,"plugin-id":u,"active-breakpoint":qt(f),offerState:JSON.stringify(y)})]})}function Qd({schema:t,testId:n}){const i=t.styles,r=m((e=>e.slots)),s=o(null),l=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),c=Ma(),{tabIndex:d,isDisabled:u,styles:p}=St(c);return r.length&&r[l]?e(Br,{styles:i,children:({classnames:i})=>e("div",{ref:s,"data-testid":n,"data-e2e":"OneByOneDistribution",className:null==i?void 0:i.own,tabIndex:d,"aria-hidden":u,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},p),children:a.Children.toArray(r.map(((n,i)=>e(is,{effect:t.transition,visible:i===l,parentElement:s.current,children:e(Zd,{config:n,position:i,visible:i===l,container:"column"})}))))})}):null}const Xd=h((function(e,{schema:t}){var n,i,a;const r=t.startPosition||1;if((null===(n=e.progression)||void 0===n?void 0:n.totalCount)&&(null===(i=e.progression)||void 0===i?void 0:i.groupSize)){const t=Bd(e.progression.totalCount,e.progression.groupSize);let n;n=r>0?r-1:t+r>-1?t+r:0;return{numOfIndicators:t-n>-1?t-n:0,activeIndex:null!==(a=e.progression.currentGroupIndex)&&void 0!==a?a:0,startIndex:n}}return{numOfIndicators:0,activeIndex:0,startIndex:0}}))((function({activeIndex:t,startIndex:n,numOfIndicators:a,schema:r}){const o=Ma(),{tabIndex:s,styles:l,isDisabled:c}=St(o),d=Array(a).fill(r.indicator);return a>1&&(p=a+n-1,(u=t)>=n&&u<=p)?e(ra,{children:a=>e(Br,{styles:r.styles,children:r=>{var o;const u=r.classnames,p=e=>{var n,i;return e===t?`${null==u?void 0:u.indicator} ${(null==u?void 0:u.activeIndicator)?u.activeIndicator:null!==(n=null==u?void 0:u.seenIndicator)&&void 0!==n?n:""}`:e<t?`${null==u?void 0:u.indicator} ${null!==(i=null==u?void 0:u.seenIndicator)&&void 0!==i?i:""}`:null==u?void 0:u.indicator};return e("div",{className:null!==(o=null==u?void 0:u.own)&&void 0!==o?o:"",style:Object.assign({display:"flex",flexDirection:"row"},l),"data-e2e":"ProgressIndicator",tabIndex:s,"aria-hidden":c,children:i.Children.toArray(d.map(((t,i)=>e("span",{className:p(i+n),style:{display:"flex"},children:a({state:{indicatorPosition:String(i+1+n)}})(t)}))))})}})}):null;var u,p}));const eu="partnerValidationUI",tu="stackedViewableItems";function nu(t){var n;const i=y(),o=m((e=>e.slots)),s=null!==(n=t.schema.viewableItems)&&void 0!==n?n:[],l=Rr(s.reduce(((e,t,n)=>Object.assign(Object.assign({},e),{[n]:t.when})),{})),c=P((e=>{var t;return e&&(null===(t=s[e[0]])||void 0===t?void 0:t.value)||o.length}),De((([e,t])=>t)),M)(l);r((()=>{i({type:hs,payload:{key:tu,value:String(c)}})}),[c]);const d=o.slice(0,c),u=Ma(),{tabIndex:p,isDisabled:f,styles:h}=St(u);return(null==d?void 0:d.length)>0?e(Br,{styles:t.schema.styles,children:({classnames:n})=>e("div",{"data-testid":t.testId,"data-e2e":"StackedDistribution",className:null==n?void 0:n.own,"aria-hidden":f,tabIndex:p,style:Object.assign({display:"flex",flexDirection:"column"},h),children:a.Children.toArray(d.map(((t,n)=>e(Zd,{config:t,position:n,visible:!0,container:"column"}))))})}):null}function iu(t){const n=t.schema.styles,i=y(),r=Ma(),o="Backward"===t.schema.direction?"Previous":"Next",{tabIndex:s,styles:l,isDisabled:c}=St(r),d=()=>{i({type:"Backward"===t.schema.direction?Gd.PREV_IN_PROGRESSION:Gd.NEXT_IN_PROGRESSION})};return e(Br,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:o,className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"ProgressControl","data-e2e-direction":`${t.schema.direction}`,disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:o,tabIndex:s,style:Object.assign({cursor:"pointer"},l),children:e(Di,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}function au({schema:t,testId:n}){var i,o,s,l,c,d,u,p,f;const h=m((e=>e.progression)),v=null==h?void 0:h.indexGroups[null==h?void 0:h.currentGroupIndex],g=null!==(i=null==h?void 0:h.currentGroupIndex)&&void 0!==i?i:0,b=m((e=>e.slots)),I=m(Sl),E=t.viewableItems.length-1,[S,C]=ht({slidesToScroll:null!==(o=t.viewableItems[Math.min(I,E)])&&void 0!==o?o:"auto",containScroll:"trimSnaps"}),w=y(),T=Ma(),{tabIndex:x,isDisabled:O,styles:A}=St(T),N=`${null!==(p=null===(u=null===(d=null===(c=null===(l=null===(s=t.styles)||void 0===s?void 0:s.elements)||void 0===l?void 0:l.own[I])||void 0===c?void 0:c.default)||void 0===d?void 0:d.container)||void 0===u?void 0:u.gap)&&void 0!==p?p:"0"}px`;r((()=>{function e(e){var t,n;const i=null!==(t=null==e?void 0:e.selectedScrollSnap())&&void 0!==t?t:0,a=null!==(n=null==e?void 0:e.previousScrollSnap())&&void 0!==n?n:0;i!==g&&(i>a?w({type:Gd.NEXT_IN_PROGRESSION}):i<a&&w({type:Gd.PREV_IN_PROGRESSION}))}return null!=g&&(null==C||C.on("select",e),null==C||C.scrollTo(g)),()=>{null==C||C.off("select",e)}}),[C,g,w]);const L={overflow:"hidden"},R={backfaceVisibility:"hidden",display:"flex",touchAction:"pan-y",gap:N,alignItems:"stretch"},_=e=>{var t;return null!==(t=null==v?void 0:v.includes(e))&&void 0!==t&&t},D=t.peekThroughSize[Math.min(I,t.peekThroughSize.length-1)],k=D?"Fixed"===(P=D).type?`${P.value}px`:`${P.value}%`:"0px";var P;const $=null!==(f=t.viewableItems[Math.min(E,I)])&&void 0!==f?f:1,j={flex:`0 0 calc(${(e=>"0px"!==e&&"0%"!==e)(k)?`(100% - 2 * ${k} - (${$} + 1) * ${N})/${$}`:`(100% - (${$} - 1) * ${N})/${$}`})`,position:"relative",display:"flex",overflow:"auto"};return(null==b?void 0:b.length)>0?e(Br,{styles:t.styles,children:({classnames:t})=>e("div",{ref:S,style:Object.assign(Object.assign({},L),A),"aria-disabled":O,tabIndex:x,className:null==t?void 0:t.own,"data-e2e":"CarouselDistribution","data-testid":n&&`${n}`,children:e("div",{style:R,"data-testid":n&&`${n}-container`,"data-e2e":"CarouselDistribution-Container",children:a.Children.toArray(b.map(((t,i)=>e("div",{style:j,"data-testid":n&&`${n}-slide-${i}`,"data-e2e":`CarouselDistribution-Slide-${i}`,children:e(Zd,{config:t,position:i,container:"row",visible:_(i)})}))))})})}):null}const ru=Object.freeze([]);function ou({schema:t,testId:n}){const i=er(),r=d((()=>Ci(i)([{display:"flex",flexDirection:"column"}])),[i]),s=m((e=>{var t;return(null===(t=e.progression)||void 0===t?void 0:t.groupSize)||0})),l=m((e=>{var t;return(null===(t=e.progression)||void 0===t?void 0:t.indexGroups)||ru})),c=m((e=>e.slots||ru)),u=d((()=>l.map((e=>e.map((e=>c[e])).filter((e=>null!=e))))),[l,c]),p=o(null),f=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),y=Ma(),{tabIndex:h,isDisabled:v,styles:g}=St(y);return u.length?e(Br,{styles:t.styles,children:({classnames:i})=>e("div",{ref:p,"data-testid":n,"data-e2e":"GroupedDistribution","aria-disabled":v,tabIndex:h,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},g),children:a.Children.toArray(u.map(((o,l)=>e(is,{effect:t.transition,visible:l===f,parentElement:p.current,containerClassName:[r,null==i?void 0:i.own].filter(Boolean).join(" ")||void 0,children:a.Children.toArray(o.map(((t,i)=>{const a=s*l+i;return e(Zd,{config:t,position:a,visible:l===f,container:"column",testId:n?`${n}-child${a}`:void 0})})))}))))})}):null}const su={action:{CaptureOnly:"CaptureOnly",Url:"Url",Fulfillment:"Fulfillment",ExternalPaymentTrigger:"ExternalPaymentTrigger"},urlBehavior:{newTab:"newTab",roktWebViewSDK:"roktWebViewSDK",self:"self"},signalType:{SignalResponse:"SignalResponse",SignalGatedResponse:"SignalGatedResponse",SignalSecondaryResponse:"SignalSecondaryResponse"},conversionType:{Default:"Default",RealTime:"RealTime",RealTimeReferral:"RealTimeReferral"}};function lu(e,t,n=!1){return Error(`Could not translate ${e} with guid: ${t}${n?" for child layout":""}`)}function cu(e,t=!1){var n;try{if(e.responseOptionsMap||t)return Object.assign(Object.assign({},e),{responseOptionsMap:K(du,null!==(n=e.responseOptionsMap)&&void 0!==n?n:{})});{const t=`Creative: ${e.instanceGuid}, did not receive a valid response options map.`;throw new jt("NO_CREATIVE_RESPONSE_OPTIONS_MAP",t)}}catch(n){throw n.message?n:lu("Creative",e.instanceGuid,t)}}function du(e){try{let t,n;if(e.urlBehavior&&(t=su.urlBehavior[e.urlBehavior]),e.conversionType&&(n=su.conversionType[e.conversionType]),"External"===e.action){const t=`Creative response with instanceGuid '${e.instanceGuid}' uses legacy action type 'External'. This should be 'ExternalPaymentTrigger'.`;throw new jt("LEGACY_EXTERNAL_ACTION_TYPE",t)}return Object.assign(Object.assign({},e),{urlBehavior:t,action:su.action[e.action],signalType:su.signalType[e.signalType],conversionType:n})}catch(t){throw t.message?t:lu("CreativeResponse",e.instanceGuid)}}function uu(e,t,n){try{return JSON.parse(e)}catch(e){throw Error(`Parse JSON failed, invalid JSON file for ${t} with guid ${n}.`)}}function pu(){r((()=>{const e=new ResizeObserver(function(e=100){let t;return()=>{t&&clearTimeout(t),t=setTimeout((()=>{var e,n;null===(n=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===n||n.resize(),t=void 0}),e)}}());return e.observe(document.body),()=>{e.disconnect()}}),[])}const fu={OneByOneDistribution:function(t){if("OneByOneDistribution"===t.type)return e(Qd,{schema:t.node})},StackedDistribution:function(t){if("StackedDistribution"===t.type)return e(nu,{schema:t.node})},ProgressIndicator:function(t){if("ProgressIndicator"===t.type)return e(Xd,{schema:t.node})},ProgressControl:function(t){if("ProgressControl"===t.type)return e(iu,{schema:t.node})},Overlay:function(t){if("Overlay"===t.type)return e(Ps,{schema:t.node})},CloseButton:function(t){if("CloseButton"===t.type)return e(Ns,{schema:t.node})},EscapeHatch:(yu=[function(t,n){if(Ct("CloseButton",t)){const n=JSON.parse(t.node.data);return e(Ns,{schema:n.node,action:n.action})}},No],e=>yu.reduce(((t,n)=>void 0===t?n(e):t),void 0)),CarouselDistribution:function(t){if("CarouselDistribution"===t.type)return e(au,{schema:t.node})},GroupedDistribution:function(t){if("GroupedDistribution"===t.type)return e(ou,{schema:t.node})},BottomSheet:function(t){if("BottomSheet"===t.type)return e(Gs,{schema:t.node})}};var yu;function mu(e,t){e({type:an,payload:{name:"SignalActivation",parentGuid:t}})}function hu({pageInstanceGuid:t}){var n,i,a,o,s,l;const c=m((e=>e.layout),j),d=y(),u=m((e=>({breakpoint:e.breakpoint,progression:Kd(e),customStates:e.customStates.root,domainStates:e.domainStates[Vd]})),j),p=m((e=>e.slots.length)),f=m((e=>{var t;const n=Number(null!==(t=e.serializableCache.get(tu))&&void 0!==t?t:"");return p-n})),h=m(Jd);In(ji(),d),r((()=>(c&&document.body.addEventListener("click",mu.bind(null,d,c.instanceGuid),{once:!0}),()=>{c&&document.body.removeEventListener("click",mu.bind(null,d,c.instanceGuid))})),[null==c?void 0:c.instanceGuid]),pu(),r((()=>{if(c){const e={type:an,payload:{name:"SignalImpression",parentGuid:c.instanceGuid}},t={type:Cs,payload:{code:"LAYOUT_IMPRESSED"}};d(e),d(t)}}),[c]);const v=e=>{d({type:Md.REPORT_ERROR,payload:e})},g=m((e=>e.breakpoint.initialised));if(c&&g){const r=na({})({state:{progression:(null!==(i=null===(n=u.progression)||void 0===n?void 0:n.activeGroupIndex)&&void 0!==i?i:0)+1,maxProgression:null!==(o=null===(a=u.progression)||void 0===a?void 0:a.totalGroups)&&void 0!==o?o:1,availableOffersCount:null!==(l=null===(s=u.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:p,selectedCatalogItemQuantity:h,hiddenItemCount:f}}),y=Yo(v);return e(Ya,{info:{layoutType:"OuterLayout",pageInstanceGuid:t},children:e(oa,{value:r,children:e(Pi,{value:y,overrides:fu,children:e(Li.Provider,{value:u,children:e(Ai.Provider,{value:d,children:e(da.Provider,{value:"OUTER",children:e(tr.Provider,{value:c.layoutSchemaVersion,children:e(Di,{children:e=>e(c.layoutSchema)})})})})})})})})}return null}var vu=Object.freeze({__proto__:null,getDistribution:function e(t){var n;switch(t.type){case"OneByOneDistribution":case"StackedDistribution":case"CarouselDistribution":case"GroupedDistribution":return t;case"Row":case"Column":case"When":case"ZStack":case"FlowRow":case"InlineContainer":case"ScrollableRow":case"ScrollableColumn":case"BottomSheet":case"Overlay":for(const n of t.node.children){const t=e(n);if(t)return t}break;case"EscapeHatch":try{const{name:i,body:a}=JSON.parse(t.node.data);if(("loading-extension"===i||"minimized-bottomsheet-extension"===i)&&(null===(n=null==a?void 0:a.children)||void 0===n?void 0:n.length))for(const t of a.children){const n=e(t);if(n)return n}break}catch(e){break}case"StaticImage":case"DataImage":case"DataImageCarousel":case"RichText":case"BasicText":case"ProgressIndicator":case"CreativeResponse":case"StaticLink":case"CloseButton":case"ProgressControl":case"StaticIcon":case"DataIcon":case"SlideStateTrigger":case"ToggleButtonStateTrigger":case"TimerStateTrigger":case"CatalogStackedCollection":case"CatalogCarouselCollection":case"CatalogResponseButton":case"CatalogQuantityOption":case"CatalogRadioGroup":case"CatalogQuantityCounter":case"PartnerEventButtonTrigger":case"CopyToClipboardButton":case"ButtonStateTrigger":case"CatalogCombinedCollection":case"IconGroup":break;default:!function(e){throw Error(`Could not handle layout: ${JSON.stringify(e)}`)}(t)}},getDistributionViewableItems:function(e){switch(null==e?void 0:e.type){case"CarouselDistribution":case"GroupedDistribution":return e.node.viewableItems;default:return}}}),gu=Object.assign({},vu);function*bu(e,t){const n=gu.getDistribution(t),i=null==n?void 0:n.type,a=yield Ye(Sl),r=function(e=0,t){var n;switch(null==t?void 0:t.type){case"CarouselDistribution":case"GroupedDistribution":{const i=Math.min(t.node.viewableItems.length,e);return null!==(n=t.node.viewableItems[i])&&void 0!==n?n:1}default:return 1}}("number"==typeof a?a:0,n);"OneByOneDistribution"!==i&&"CarouselDistribution"!==i&&"GroupedDistribution"!==i||(yield ft({type:Gd.INITIALISE_PROGRESSION,payload:{currentGroupIndex:0,totalCount:e,groupSize:r}}))}function*Iu(e,t){var n;const{instanceGuid:i,layoutSchemaVersion:a,outerLayoutSchema:r,slots:o}=t.payload;i?yield ft({type:an,payload:{name:"SignalLoadComplete",parentGuid:i}}):yield ft({type:Ss,payload:{level:zs,code:al,message:"Layout instance guid does not exist"}}),yield ft({type:Od,payload:{modules:o.map((e=>e.layoutVariant.moduleName))}}),yield ft({type:cs,payload:r.breakpoints}),yield ft({type:Gd.LAYOUT_UPDATE,payload:{instanceGuid:i,layoutSchemaVersion:a,layoutSchema:r.layout,settings:r.settings}}),yield ft({type:Gd.SET_SLOTS,payload:o}),pe(r.settings)||(yield ft({type:Gd.SET_SETTINGS,payload:r.settings})),yield*bu(o.length,r.layout);const s=o.some((e=>{var t;return(null===(t=e.offer)||void 0===t?void 0:t.catalogItems)&&e.offer.catalogItems.length>0}));s&&(yield ft({type:hn}));const l=yield*function*(e,t,n){const i=null==t?void 0:t.enablePartnerValidation,a=["add-to-cart"],r=n.some((e=>a.some((t=>t===e.layoutVariant.moduleName))));if(i&&r)try{yield pt(e.send,kl.PartnerValidationEvent.OPT_IN_TO_PARTNER_VALIDATION),yield dt(Eu,e,kl.PartnerValidationEvent.SHOW_PARTNER_VALIDATION_STATUS,(()=>({type:"ACTIVE/ADD",payload:{id:eu}})))}catch(e){return yield ft({type:Ss,payload:{level:Vs,code:ol,message:"Failed to establish partner validation."}}),"FAILURE"}return"OK"}(e.partner,r.settings,o);"OK"===l&&(yield pt(tc,e.display,r.display,null===(n=r.settings)||void 0===n?void 0:n.frameControls))}function*Eu(e,t,n){const i=st((i=>{const a=e.onEvent(t).subscribe((e=>{i(n(e))}));return()=>{a.unsubscribe()}}));for(;;){const e=yield yt(i);yield ft(e)}}function Su(e){return cp(e)}function Cu(e,t){return Error(`Migration process from v0_0 to v0_1 failed: could not transform ${e} node. For more details: ${t}`)}const wu=le(oe([function(e){return"Row"===e.type&&Au(e.node.children)},function(e){return"Column"===e.type&&Au(e.node.children)},_u,Du])),Tu=le(oe([function(e){return"Row"===e.type&&Nu(e.node.children)},function(e){return"Column"===e.type&&Nu(e.node.children)},Du,_u,function(e){return"DataImage"===e.type},function(e){return"When"===e.type&&Nu(e.node.children)}])),xu=le(oe([function(e){return"Row"===e.type&&Lu(e.node.children)},function(e){return"Column"===e.type&&Lu(e.node.children)},Du,_u])),Ou=le(oe([function(e){return"Row"===e.type&&Ru(e.node.children)},function(e){return"Column"===e.type&&Ru(e.node.children)},_u,function(e){return"RichText"===e.type},Du,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&Ru(e.node.children)},function(e){return"StaticLink"===e.type&&Ru(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CloseButton"===e.type&&Ru(e.node.children)}]));function Au(e){return wu(e)}function Nu(e){return Tu(e)}function Lu(e){return xu(e)}function Ru(e){return Ou(e)}function _u(e){return"StaticImage"===e.type}function Du(e){return"BasicText"===e.type}const ku=ye(["styles","elements","link"]),Pu=ye(["styles","elements","activeIndicator"]),$u=ye(["styles","elements","indicator"]),ju=ye(["styles","elements","seenIndicator"]),Fu=ye(["focussed"]),Gu=ye(["hovered"]),Mu=ye(["default"]),Bu=ye(["pressed"]),Uu=e=>{var t;return{text:null!==(t=null==e?void 0:e.text)&&void 0!==t?t:{}}},Vu=I(S(["styles","elements","link"]),X(fe(ku,F((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default})))),fe(ku,F(I(ke("focussed"),fe(Fu,Uu)))),fe(ku,F(I(ke("hovered"),fe(Gu,Uu)))),fe(ku,F(I(ke("default"),fe(Mu,Uu)))),fe(ku,F(I(ke("pressed"),fe(Bu,Uu)))))),zu=X(I(S(["styles","elements","activeIndicator"]),fe(Pu,F((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","indicator"]),fe($u,F((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","seenIndicator"]),fe(ju,F((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))));function Hu(e,t){return e?{elements:{own:e.elements.own.map(t)}}:void 0}const Wu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),qu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),Ku=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),Yu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),Ju=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Zu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Qu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Xu=e=>{switch(e){case"is":return"is";case"is not":return"is-not";case"is below":return"is-below";case"is above":return"is-above";default:throw Cu("When",`Invalid condition: ${e}`)}},ep=e=>{switch(e){case"breakpoint":return"Breakpoint";case"progression":return"Progression";case"position":return"Position";default:throw Cu("When",`Invalid target: ${e}`)}},tp=e=>{const{target:t,condition:n,value:i}=e;return{type:ep(t),predicate:{condition:Xu(n),value:i}}};function np(e){return{predicates:e.predicates.map(tp),children:e.children.map((e=>cp(e)))}}function ip(e){const t={type:"FadeInOut",settings:{duration:e.transition.settings.duration}};return{styles:e.style,transition:t}}function ap(e){const t=e.children.map((e=>cp(e)));if(Au(t))return Object.assign(Object.assign({},e),{children:t,styles:Hu(e.styles,Ju)});throw Cu("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function rp(e){const t=e.children.map((e=>cp(e)));if(Nu(t))return Object.assign(Object.assign({},e),{children:t,styles:Hu(e.styles,Zu)});throw Cu("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function op(e){const t=e.children.map((e=>cp(e)));if(Lu(t))return Object.assign(Object.assign({},e),{children:t,styles:Hu(e.styles,Qu)});throw Cu("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}const sp=e=>({own:e.overlayContainer,wrapper:e.overlayWrapper});function lp(e){var t,n;const i=(null===(t=e.styles)||void 0===t?void 0:t.elements)?{elements:sp(null===(n=e.styles)||void 0===n?void 0:n.elements)}:void 0,a=e.children.map((e=>cp(e)));if(Ru(a))return Object.assign(Object.assign({},e),{styles:i,children:a});throw Cu("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function cp(e){switch(e.type){case"When":return{type:"When",node:np(e.node)};case"OneByOneDistribution":return{type:e.type,node:ip(e.node)};case"Overlay":return{type:e.type,node:lp(e.node)};case"Column":return{type:e.type,node:(o=e.node,{styles:Hu(o.styles,Wu),children:o.children.map((e=>cp(e)))})};case"Row":return{type:e.type,node:(r=e.node,{styles:Hu(r.styles,qu),children:r.children.map((e=>cp(e)))})};case"RichText":return{type:e.type,node:(a=e.node,Vu(a))};case"CloseButton":return{type:e.type,node:ap(e.node)};case"CreativeResponse":return{type:e.type,node:rp(e.node)};case"StaticLink":return{type:e.type,node:op(e.node)};case"StaticImage":return{type:e.type,node:(i=e.node,Object.assign(Object.assign({},i),{styles:Hu(i.styles,Ku)}))};case"DataImage":return{type:e.type,node:(n=e.node,Object.assign(Object.assign({},n),{styles:Hu(n.styles,Yu)}))};case"ProgressIndicator":return{type:e.type,node:(t=e.node,zu(t))};default:return e}var t,n,i,a,r,o}function dp(e){return vf(e)}function up(e,t){return Error(`Migration process from v0_23 to v1_0 failed: could not transform ${e} node. For more details: ${t}`)}const pp=e=>"scroll"===e||"auto"===e?"visible":e,fp=ye(["elements","own"]),yp=ye(["transitions","transition","value","own"]),mp=ye(["elements","wrapper"]),hp=ye(["transitions","transition","value","wrapper"]),vp=ye(["elements","indicator"]),gp=ye(["transitions","transition","value","indicator"]),bp=ye(["elements","activeIndicator"]),Ip=ye(["transitions","transition","value","activeIndicator"]),Ep=ye(["elements","seenIndicator"]),Sp=ye(["transitions","transition","value","seenIndicator"]),Cp=ye(["default","container","overflow"]),wp=ye(["pressed","container","overflow"]),Tp=ye(["hovered","container","overflow"]),xp=ye(["focussed","container","overflow"]),Op=ye(["disabled","container","overflow"]),Ap=ye(["container","overflow"]),Np=X(I(S(["default","container","overflow"]),fe(Cp,pp)),I(S(["pressed","container","overflow"]),fe(wp,pp)),I(S(["hovered","container","overflow"]),fe(Tp,pp)),I(S(["focussed","container","overflow"]),fe(xp,pp)),I(S(["disabled","container","overflow"]),fe(Op,pp))),Lp=I(S(["container","overflow"]),fe(Ap,pp)),Rp=X(I(S(["elements","own"]),fe(fp,F(Np))),I(S(["transitions","transition","value","own"]),fe(yp,Lp))),_p=I(ke("transitions"),(e=>{var t;return P(Te(["transitions"]),Pe("conditionalTransitions",null===(t=e.transitions)||void 0===t?void 0:t.transition))(e)})),Dp=X(Rp,_p),kp=X(I(S(["elements","wrapper"]),fe(mp,F(Np))),I(S(["transitions","transition","value","wrapper"]),fe(hp,Lp))),Pp=X(I(S(["elements","indicator"]),fe(vp,F(Np))),I(S(["transitions","transition","value","indicator"]),fe(gp,Lp))),$p=X(I(S(["elements","activeIndicator"]),fe(bp,F(Np))),I(S(["transitions","transition","value","activeIndicator"]),fe(Ip,Lp))),jp=X(I(S(["elements","seenIndicator"]),fe(Ep,F(Np))),I(S(["transitions","transition","value","seenIndicator"]),fe(Sp,Lp)));function Fp(e){return"StaticImage"===e.type}function Gp(e){return"StaticIcon"===e.type}function Mp(e){return"BasicText"===e.type}function Bp(e){return"DataImage"===e.type}function Up(e){return"DataIcon"===e.type}function Vp(e){return"RichText"===e.type}function zp(e){return"SlideStateTrigger"===e.type}function Hp(e){return"ToggleButtonStateTrigger"===e.type}const Wp=le(oe([function(e){return"Row"===e.type&&qp(e.node.children)},function(e){return"Column"===e.type&&qp(e.node.children)},Fp,Gp,Vp,Mp,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&qp(e.node.children)},function(e){return"StaticLink"===e.type&&qp(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CarouselDistribution"===e.type},function(e){return"GroupedDistribution"===e.type},function(e){return"CloseButton"===e.type&&qp(e.node.children)},function(e){return"ProgressControl"===e.type&&af(e.node.children)},function(e){return"ZStack"===e.type&&qp(e.node.children)},function(e){return"FlowRow"===e.type&&qp(e.node.children)},zp,Hp]));function qp(e){return Wp(e)}const Kp=X(Rp,kp,_p);function Yp(e){const t=e.children.map((e=>vf(e)));if(qp(t))return Object.assign(Object.assign({},Te(["settings"],e)),{children:t,allowBackdropToClose:e.settings.allowBackdropToClose,styles:e.styles?Kp(e.styles):void 0});throw up("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function Jp(e){const t=e.children.map((e=>vf(e)));if(af(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Dp(e.styles):void 0});throw up("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function Zp(e){const t=e.children.map((e=>vf(e)));if(of(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Dp(e.styles):void 0});throw up("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function Qp(e){const t=e.children.map((e=>vf(e)));if(af(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Dp(e.styles):void 0});throw up("ProgressControl",`Invalid schema: ${JSON.stringify(e)}`)}const Xp=X(Rp,Pp,$p,jp,_p);const ef=le(oe([Mp,Fp,Gp,Bp,Up,function(e){return"Row"===e.type&&tf(e.node.children)},function(e){return"FlowRow"===e.type&&tf(e.node.children)},function(e){return"Column"===e.type&&tf(e.node.children)},function(e){return"ZStack"===e.type&&tf(e.node.children)},function(e){return"When"===e.type&&tf(e.node.children)}]));function tf(e){return ef(e)}const nf=le(oe([Mp,Fp,Gp,function(e){return"Row"===e.type&&af(e.node.children)},function(e){return"FlowRow"===e.type&&af(e.node.children)},function(e){return"Column"===e.type&&af(e.node.children)},function(e){return"ZStack"===e.type&&af(e.node.children)},function(e){return"When"===e.type&&af(e.node.children)}]));function af(e){return nf(e)}const rf=le(oe([Mp,Fp,Gp,Bp,Up,function(e){return"Row"===e.type&&of(e.node.children)},function(e){return"FlowRow"===e.type&&of(e.node.children)},function(e){return"Column"===e.type&&of(e.node.children)},function(e){return"ZStack"===e.type&&of(e.node.children)},function(e){return"When"===e.type&&of(e.node.children)}]));function of(e){return rf(e)}function sf(e){const t=e.children.map((e=>vf(e)));if(tf(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Dp(e.styles):void 0});throw up("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}function lf(e){const t=e.children.map((e=>vf(e)));if(of(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Dp(e.styles):void 0});throw up("CatalogResponseButton",`Invalid schema: ${JSON.stringify(e)}`)}function cf(e){return"Row"===e.type&&pf(e.node.children)}function df(e){return"Column"===e.type&&pf(e.node.children)}const uf=le(oe([Mp,Fp,Gp,Bp,Up,Vp,function(e){return"StaticLink"===e.type},zp,Hp,function(e){return"CatalogResponseButton"===e.type},cf,function(e){return"FlowRow"===e.type&&pf(e.node.children)},df,function(e){return"ZStack"===e.type&&pf(e.node.children)},function(e){return"When"===e.type&&pf(e.node.children)}]));function pf(e){return uf(e)}const ff=oe([cf,df]);function yf(e){const t=vf(e.template);if(function(e){return ff(e)}(t))return Object.assign(Object.assign({},e),{template:t,styles:e.styles?Dp(e.styles):void 0});throw up("CatalogStackedCollection",`Invalid schema: ${JSON.stringify(e)}`)}function mf(e){const t=e.children.map((e=>vf(e)));if(tf(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Dp(e.styles):void 0});throw up("ToggleButtonStateTrigger",`Invalid schema: ${JSON.stringify(e)}`)}function hf(e){const t=e.transition?{inTransition:e.transition.in,outTransition:e.transition.out}:void 0;return Object.assign(Object.assign({},e),{children:e.children.map((e=>vf(e))),transition:t})}function vf(e){switch(e.type){case"Row":return{type:e.type,node:(v=e.node,Object.assign(Object.assign({},v),{children:v.children.map((e=>vf(e))),styles:v.styles?Dp(v.styles):void 0}))};case"When":return{type:e.type,node:hf(e.node)};case"FlowRow":return{type:e.type,node:(h=e.node,Object.assign(Object.assign({},h),{styles:h.styles?Dp(h.styles):void 0,children:h.children.map((e=>vf(e)))}))};case"Column":return{type:e.type,node:(m=e.node,Object.assign(Object.assign({},m),{children:m.children.map((e=>vf(e))),styles:m.styles?Dp(m.styles):void 0}))};case"ZStack":return{type:e.type,node:(y=e.node,Object.assign(Object.assign({},y),{styles:y.styles?Dp(y.styles):void 0,children:y.children.map((e=>vf(e)))}))};case"Overlay":return{type:e.type,node:Yp(e.node)};case"ProgressControl":return{type:e.type,node:Qp(e.node)};case"CarouselDistribution":return{type:"CarouselDistribution",node:(f=e.node,Object.assign(Object.assign({},Te(["settings"],f)),{viewableItems:f.settings.viewableItems,peekThroughSize:f.settings.peekThroughSize,styles:f.styles?Dp(f.styles):void 0}))};case"CloseButton":return{type:"CloseButton",node:Jp(e.node)};case"CreativeResponse":return{type:"CreativeResponse",node:Zp(e.node)};case"GroupedDistribution":return{type:"GroupedDistribution",node:(p=e.node,Object.assign(Object.assign({},Te(["settings"],p)),{viewableItems:p.settings.viewableItems,transition:p.settings.transition,styles:p.styles?Dp(p.styles):void 0}))};case"OneByOneDistribution":return{type:"OneByOneDistribution",node:(u=e.node,Object.assign(Object.assign({},u),{styles:u.styles?Dp(u.styles):void 0}))};case"ProgressIndicator":return{type:"ProgressIndicator",node:(c=e.node,Object.assign(Object.assign({},Te(["settings"],c)),{startPosition:null===(d=c.settings)||void 0===d?void 0:d.startPosition,styles:c.styles?Xp(c.styles):void 0}))};case"SlideStateTrigger":return{type:"SlideStateTrigger",node:(l=e.node,Object.assign(Object.assign({},l),{styles:l.styles?Dp(l.styles):void 0}))};case"StackedDistribution":return{type:"StackedDistribution",node:(s=e.node,Object.assign(Object.assign({viewableItems:[]},s),{styles:s.styles?Dp(s.styles):void 0}))};case"StaticLink":return{type:"StaticLink",node:sf(e.node)};case"ToggleButtonStateTrigger":return{type:"ToggleButtonStateTrigger",node:mf(e.node)};case"CatalogResponseButton":return{type:"CatalogResponseButton",node:lf(e.node)};case"CatalogStackedCollection":return{type:"CatalogStackedCollection",node:yf(e.node)};case"RichText":return{type:"RichText",node:(o=e.node,Object.assign(Object.assign({},o),{styles:o.styles?_p(o.styles):void 0}))};case"DataImage":return{type:"DataImage",node:(r=e.node,Object.assign(Object.assign({},r),{styles:r.styles?_p(r.styles):void 0}))};case"StaticImage":return{type:"StaticImage",node:(a=e.node,Object.assign(Object.assign({},a),{styles:a.styles?_p(a.styles):void 0}))};case"DataIcon":return{type:"DataIcon",node:(i=e.node,Object.assign(Object.assign({},i),{styles:i.styles?_p(i.styles):void 0}))};case"StaticIcon":return{type:"StaticIcon",node:(n=e.node,Object.assign(Object.assign({},n),{styles:n.styles?_p(n.styles):void 0}))};case"BasicText":return{type:"BasicText",node:(t=e.node,Object.assign(Object.assign({},t),{styles:t.styles?_p(t.styles):void 0}))};default:return e}var t,n,i,a,r,o,s,l,c,d,u,p,f,y,m,h,v}function gf(e){const t=e.split("."),n=Number(t[0]),i=Number(t[1]);if(t.length<2||Number.isNaN(n)||Number.isNaN(i))throw Error(`Fail to convert version ${e} to a valid version.`);return{major:n,minor:i}}function bf(e,t){return e.major===t.major&&e.minor===t.minor}const If=(e,t,n)=>E([Ce(e),$e(t)])(n);function Ef(e,t){return bf(t,{major:0,minor:0})?Ef(Su(e),{major:0,minor:1}):function(e,t){return 0===t.major&&If(1,23,t.minor)}(0,t)?Ef(dp(e),{major:1,minor:0}):e}function Sf(e,t){return bf(t,{major:0,minor:0})?Sf(function(e){return Object.assign(Object.assign({},e),{layout:Su(e.layout)})}(e),{major:0,minor:1}):function(e,t){return 0===t.major&&If(1,23,t.minor)}(0,t)?Sf(function(e){return Object.assign(Object.assign({},e),{layout:dp(e.layout)})}(e),{major:1,minor:0}):e}function Cf(e,t,n,i){const a=gf(n);if(i){const s=gf(i);if(o=a,(r=s).major<o.major||r.major===o.major&&r.minor<o.minor||bf(s,a))return t(e,s);throw Error(`Could not migrate received layout config, config schema version ${i} is higher than the supported version ${n}.`)}return t(e,gf("0.0"));var r,o}function wf(e){var t;try{return Object.assign(Object.assign({},je(e)),{offer:Object.assign(Object.assign({},je(e.offer)),{creative:cu(e.offer.creative)}),layoutVariant:Object.assign(Object.assign({},je(e.layoutVariant)),{layoutVariantSchema:"string"==typeof e.layoutVariant.layoutVariantSchema?uu(e.layoutVariant.layoutVariantSchema,"LayoutSlotLayoutVariant",e.instanceGuid):e.layoutVariant.layoutVariantSchema,childLayouts:F(Tf,null!==(t=e.layoutVariant.childLayouts)&&void 0!==t?t:[])})})}catch(t){throw t.message?t:lu("Slot",e.instanceGuid)}}function Tf(e){return Object.assign(Object.assign({},je(e)),{childLayoutSchema:"string"==typeof e.childLayoutSchema?uu(e.childLayoutSchema,"ChildLayoutRootSchema",e.childLayoutId):e.childLayoutSchema})}function xf(e){if(e){const t=function(e){try{return Object.assign(Object.assign({},je(e)),{outerLayoutSchema:"string"==typeof e.outerLayoutSchema?uu(e.outerLayoutSchema,"LayoutRootLayoutSchema",e.instanceGuid):e.outerLayoutSchema,slots:F(wf,e.slots)})}catch(t){throw t.message?t:lu("LayoutConfig",e.instanceGuid)}}(e);return function(e,t){const{layoutSchemaVersion:n}=e,i=ye(["outerLayoutSchema"]),a=ye(["slots"]),r=ye(["layoutVariant","layoutVariantSchema"]);return X(fe(a,F(fe(r,(e=>Cf(e,Ef,t,n))))),fe(i,(e=>Cf(e,Sf,t,n))))(e)}(t,qs.DCUI_SCHEMA_VERSION)}}const Of=T([[Y({signalType:j("SignalSecondaryResponse")}),function*(e,t){return yield qe({type:Ss,payload:{level:Hs,code:nl,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}],[Y({isPositive:j(!0)}),function*(e,t,n,i){var a,r;if("url"in e&&e.url){const o=e.instanceGuid;"SignalProductItemResponse"===e.signalType&&(Xt(r=i.payload)&&"catalogItemId"in r&&"productSku"in r&&"catalogId"in r&&"accountID"in r&&"string"==typeof r.catalogItemId&&"string"==typeof r.productSku&&"string"==typeof r.catalogId&&"string"==typeof r.accountID)?yield qe({type:an,payload:{name:"SignalProductItemResponse",parentGuid:o,objectData:{catalogItemId:i.payload.catalogItemId,productSku:i.payload.productSku,catalogId:i.payload.catalogId,accountId:i.payload.accountID}}}):yield qe({type:an,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:o,responseActionPayload:{name:"Url",transformedTrafficURL:e.url,creativeInstanceGuid:e.creativeInstanceGuid}}});const s=t.getOverrideLinkNavigation()?"overrideLinkNavigation":null!==(a=e.urlBehavior)&&void 0!==a?a:"newTab",l=yield*function*(e,t,n){try{const i=yield ze(Ml,t),a=zl(i)?i.ref:void 0;return yield ze(e.addAdvertiserWindowRef,a,n),zl(i)||"newTab"!==t.urlBehavior?"SUCCESS":(yield qe({type:Ss,payload:{level:Hs,code:il,message:`Did not receive a window reference opening link ${t.url}`}}),"UNSPECIFIED")}catch(e){return yield qe({type:Ss,payload:{level:Hs,code:il,message:`Errored attempting to open link ${t.url}: ${e.message}`,stack:e.stack}}),"ERROR"}}(t,{url:e.url,urlBehavior:s,external:{partner:n}},o);return"self"===s?"END":l}return yield qe({type:Ss,payload:{level:Hs,code:nl,message:"URL response doesn't have a valid url",additionalInformation:{instanceGuid:e.instanceGuid}}}),"ERROR"}],[O,function*(){return"EXPLICIT_DISMISSAL"}]]);function*Af(e){return yield qe({type:Ss,payload:{level:Hs,code:nl,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}function*Nf(e,t){let n="IMPLICIT_DISMISSAL";const i=t.payload.offerPositionIndex,a=Xt(t.payload)||en(t.payload)||Qt(t.payload)?t.payload:t.payload.responseOption;switch(a.action){case"Url":yield qe({type:sn,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:Cs,payload:{code:"CREATIVE_RESPONSE",message:"creative positive response",data:{type:a.action,isPositive:a.isPositive,responseInstanceGuid:a.instanceGuid}}}),yield qe({type:sn,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Af(a):yield*Of(a,e.context,e.partner,t);break;case"CaptureOnly":yield qe({type:sn,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:sn,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Af(a):yield*function*(e){return yield qe({type:an,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:"CaptureOnly",creativeInstanceGuid:e.creativeInstanceGuid}}}),e.isPositive?"SUCCESS":"EXPLICIT_DISMISSAL"}(a);break;case"Fulfillment":yield qe({type:Ss,payload:{level:Hs,code:"INCORRECTLY_HANDLE_FULFILLMENT_ACTION",message:`Fulfillment action is incorrectly handled by the orchestrator instead of a module with the option ID: ${a.instanceGuid}`}}),n="ERROR";break;case"ExternalPaymentTrigger":yield qe({type:Ss,payload:{level:Hs,code:"INCORRECTLY_HANDLE_EXTERNAL_ACTION",message:`External action was dispatched as an engagement erroneously. Instance GUID: ${a.instanceGuid}`}}),n="ERROR"}tn(t.payload)||(yield qe(function(e,t){switch(e){case"SUCCESS":return{type:Pd,payload:{event:"Completed",completionReason:"Success",offerPositionIndex:t}};case"UNSPECIFIED":return{type:Pd,payload:{event:"Completed",completionReason:"Unspecified",offerPositionIndex:t}};case"ERROR":return{type:Pd,payload:{event:"Completed",completionReason:"Error",offerPositionIndex:t}};case"EXPLICIT_DISMISSAL":return{type:Pd,payload:{event:"Dismissed",dismissalReason:"Explicit",offerPositionIndex:t}};case"IMPLICIT_DISMISSAL":return{type:Pd,payload:{event:"Dismissed",dismissalReason:"Implicit",offerPositionIndex:t}};default:return{type:_d,payload:{offerProcessStatus:"END"}}}}(n,i)))}function Lf(e,t,n,i){return st((a=>(i().then((e=>Promise.all([t.getRoktPageInstanceGuid(),(t.getUId||t.getPluginInstanceId)()]).then((([t,n])=>Object.assign(Object.assign({},e),{pageInstanceGuid:t,pluginInstanceId:n}))).catch((()=>e)))).then((({moduleConnectorBuilder:t,pageInstanceGuid:i,pluginInstanceId:r})=>{const o=`rokt-${n}-${r}`.toLowerCase();if(!customElements.get(o)){const r=t.withGatewayFactory(e).withLogger((e=>{a({type:Ss,payload:{level:e.level,code:e.code,message:e.message,additionalInformation:Object.assign(Object.assign({},e.additionalInformation),{moduleName:n,layoutType:"LayoutVariant",pageInstanceGuid:null!=i?i:"N/A"})}})})).build();customElements.define(o,r)}})).catch((e=>{const t=e&&"object"==typeof e&&"message"in e?e.message:void 0,i=e&&"object"==typeof e&&"stack"in e?e.stack:void 0;a({type:Ss,payload:{level:Pt,code:"FAILED_TO_LOAD_MODULE",message:t,additionalInformation:{stack:i,reason:t?void 0:e,moduleName:n}}}),a(lt)})),()=>{})))}const Rf={"standard-marketing":()=>Promise.resolve().then((function(){return om})),"add-to-cart":()=>Promise.resolve().then((function(){return vh})),"instant-purchase":()=>Promise.resolve().then((function(){return Hv})),"layouts-xp-sandbox":()=>Promise.resolve().then((function(){return Cg}))};function*_f(e,t,n){let i=yield Ye((e=>e.module.loadedModules));for(const a of n.payload.modules)i&&!(null==i?void 0:i.includes(a))&&(i=[...i,a],yield Qe(Df,e,t,a))}function*Df(e,t,n){if(n in Rf){yield qe({type:xd,payload:n});const i=yield ze(Lf,e,t,n,Rf[n]);yield ze(el,i)}else yield qe({type:Ss,payload:{level:Vs,code:"INVALID_MODULE_NAME",message:`Could not load unknown module ${n}`}})}function*kf(e){const t=yield Ye((e=>gu.getDistributionViewableItems(e.layout?gu.getDistribution(e.layout.layoutSchema):void 0))),n=yield Ye((n=>{var i;const a=El(e.payload.activeBreakpoint)(n);return a>=0&&t?null!==(i=t[Math.min(t.length-1,a)])&&void 0!==i?i:1:void 0}));if("number"==typeof n){const e={type:Rd,payload:{groupSize:n}};yield qe(e)}}const Pf=T([[(e,t,n,i)=>"END"===e.offerProcessStatus,z({type:fs})],[(e,t,n,i)=>t.isLastOffer&&n,z({type:fs})],[(e,t,n,i)=>1===i&&!t.isLastOffer,z({type:Nd})],[O,z(void 0)]]);function*$f(e){const t=yield Ye((e=>({exists:null!==e.progression,isLastOffer:qd(e)}))),n=yield Ye((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.groupSize}));var i;null!=(i=t)&&i instanceof Object&&"exists"in i&&"isLastOffer"in i&&t.exists&&(yield*function*(e,t,n){const i=yield Ye((e=>e.settings.closeOnComplete)),a=Pf(e,t,"boolean"==typeof i&&i,n);a&&(a.type===fs&&(yield qe({type:sn,payload:{name:"PLACEMENT_COMPLETED"}})),yield qe(a))}(e.payload,t,n))}function jf(e){return e.type===Pd&&"Interactive"===e.payload.event}function Ff(e){return e.type===Pd&&"Interactive"!==e.payload.event}function*Gf(e){switch(e.payload.event){case"Dismissed":yield qe({type:_d,payload:{offerProcessStatus:"CONTINUE"}});break;case"Completed":yield qe({type:$d,payload:{key:"offerComplete",value:T([[j("Error"),z(-1)],[j("Success"),z(1)],[O,z(2)]])(e.payload.completionReason),offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:_d,payload:{offerProcessStatus:"CONTINUE"}});break;case"Interactive":yield qe({type:Yt,payload:{name:"Interactive",offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:sn,payload:{name:"PLACEMENT_INTERACTIVE"}})}}function*Mf(e,t){var n;try{const n=yield Ye((e=>{var t,n,i;return null!==(i=null===(n=null===(t=e.layout)||void 0===t?void 0:t.settings)||void 0===n?void 0:n.enablePartnerValidation)&&void 0!==i&&i}));n&&(yield ze(e.partner.send,kl.PartnerValidationEvent.SET_PARTNER_VALIDATION_STATUS,{errors:t.payload.errors}))}catch(i){const a=yield Ye((({slots:e})=>{var n,i;return"number"==typeof t.payload.offerPositionIndex?null!==(i=null===(n=e.at(t.payload.offerPositionIndex))||void 0===n?void 0:n.layoutVariant.moduleName)&&void 0!==i?i:"Unknown":"orchestrator"})),r=null!==(n=yield ze(e.context.getRoktPageInstanceGuid))&&void 0!==n?n:"N/A",o={type:Ss,payload:{level:$t,code:"PARTNER_VALIDATION_UPDATE_FAILED",message:"Failed to update the partner with error status",additionalInformation:{moduleName:a,layoutType:"number"==typeof t.payload.offerPositionIndex?"LayoutVariant":"OuterLayout",pageInstanceGuid:r}}};yield qe(o)}}function*Bf(e){const t=yield Ye((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:Gd.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:fs}),t?(yield qe({type:an,payload:{name:"SignalInstantPurchaseDismissal",parentGuid:t}}),yield qe({type:an,payload:{name:"SignalDismissal",parentGuid:t}})):yield qe({type:Ss,payload:{level:zs,code:al,message:"ParentGuid does not exist"}})}function*Uf(e){yield Xe(zf,e),yield Ze(yn,Vf)}function*Vf(e){const t=e.payload;yield qe({type:sn,payload:{name:"INITIATE_CART_ITEM_EVENT",body:t}})}function*zf(e){const t=function(e){return st((t=>{const n=e.onEvent("CART_SERVICE_RESPONSE").subscribe((e=>{t(e)}));return()=>{n.unsubscribe()}}))}(e);try{for(;;){const e=yield We(t);yield qe({type:mn,payload:e})}}catch(e){const t=Ul(e,"Error in cart service response listener","CART_SERVICE_RESPONSE_ERROR");yield qe(t)}finally{(yield Ke())&&t.close()}}function*Hf(e,t){yield Je([Ze(Ss,tl.bind(null,e.errorService.raise)),et(ps,Iu.bind(null,{display:e.displayService,partner:e.partnerInteractionService})),Ze(Od,_f.bind(null,t,e.contextService)),et(jd,Nf.bind(null,{partner:e.partnerInteractionService,context:e.contextService})),Ze(_d,$f),et(hn,Uf.bind(null,e.partnerInteractionService)),Ze(Ff,Gf),Xs(jf,Gf),et(cs,Al.bind(null,e.displayService)),et(fs,Jl.bind(null,e.contextService)),et(kd,Bf),et(Es,Sc),Ze(an,ic),Ze(cn,ac),Qs(Yt,Ic.bind(null,e.metricsService)),Qs(Is,rc.bind(null,e.rdnService)),Ze(Cs,nc.bind(null,e.errorService.raise)),et(ss,kf),Ze(on,bc),Ze(dn,Ec.bind(null,{createChildPlugin:e.childPlugin.create,partner:e.partnerInteractionService,context:e.contextService})),et(un,Mf.bind(null,{partner:e.partnerInteractionService,context:e.contextService}))])}var Wf,qf,Kf,Yf,Jf,Zf=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},Qf=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};const Xf={[vn.SET_CUSTOM_STATE]:Gd.SET_CUSTOM_STATE,[vn.SET_DOMAIN_STATE]:Gd.SET_DOMAIN_STATE,[vn.SET_GLOBAL_OFFER_DATA_CART]:Gd.SET_GLOBAL_OFFER_DATA_CART,[vn.OFFER_LIFECYCLE]:Md.OFFER_LIFECYCLE,[vn.OFFER_ENGAGEMENT]:Md.OFFER_ENGAGEMENT,[vn.SET_PARTNER_VALIDATION_STATUS]:Md.SET_PARTNER_VALIDATION_STATUS};class ey{constructor(e){Wf.add(this),qf.set(this,void 0),Zf(this,qf,e,"f")}getState(e){const t=Qf(this,qf,"f").getState();return{breakpoint:t.breakpoint,progression:Kd(t),customStates:Cl(t,e.offerPositionIndex),domainStates:Yd(t,e.offerPositionIndex)}}dispatch(e,t){Qf(this,qf,"f").dispatch(Qf(this,Wf,"m",Jf).call(this,e,t))}subscribe(e,t){return t(this.getState(e)),Qf(this,qf,"f").subscribe((()=>{t(this.getState(e))}))}}function ty(e,t){const n=rt(),i={},a=it({reducer:Hd,devTools:{name:"Orchestrator"},preloadedState:Object.assign(Object.assign({},Wd()),t),middleware:e=>{return e({thunk:!1,serializableCheck:!1}).concat((t=i,e=>e=>n=>{if("object"==typeof n&&null!==n&&"type"in n){const i=n.type,a=t[`${i}`];return e(a?a(n):n)}return e(n)}),n);var t}}),r=(o=function(e){return new ey(e)}(a),s=e.childPlugin.create,l=e.partnerInteractionService.onEvent,(e,t)=>new Ca(o,s,e,t,l));var o,s,l;n.run(Hf,e,r),n.run(ec,e,xf);const c={};return Object.assign(Object.assign({},a),{extend:({reducer:e,interceptors:t,sagas:r})=>{e&&(Object.assign(c,e),a.replaceReducer(at(Object.assign(Object.assign({},Hd),c)))),t&&Object.assign(i,t),r&&n.run(r)}})}qf=new WeakMap,Wf=new WeakSet,Kf=function(e,t,n){return{type:e,payload:Object.assign(Object.assign({},t),{offerPositionIndex:n.offerPositionIndex,creativeInstanceGuid:n.creativeInstanceGuid})}},Yf=function(e,t){return t.type===cn?t.payload.signal.parentGuid||(t.payload.signal.parentGuid=e.creativeInstanceGuid):(t.payload.creativeInstanceGuid=e.creativeInstanceGuid,t.payload.parentGuid||(t.payload.parentGuid=e.creativeInstanceGuid)),t},Jf=function(e,t){return function(e){return e.type in Xf}(t)?Qf(this,Wf,"m",Kf).call(this,Xf[t.type],t.payload,e):t.type===an||t.type===cn?Qf(this,Wf,"m",Yf).call(this,e,t):t};var ny=function(e,t,n,i){return new(n||(n=Promise))((function(a,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((i=i.apply(e,t||[])).next())}))};const iy={ctx:new Map([[vd.name,vd],[pd.name,pd],[Kc.name,Kc],[id.name,id],[yd.name,yd],[Td.name,Td]]),cache:[]};function ay(n,i){return ny(this,void 0,void 0,(function*(){const{pluginId:r,pageInstanceGuid:o}=yield function(e){return Promise.allSettled([(e.contextService.getUId||e.contextService.getPluginInstanceId)(),e.contextService.getRoktPageInstanceGuid()]).then((([e,t])=>({pluginId:"fulfilled"===e.status?e.value:_t.pluginId,pageInstanceGuid:"fulfilled"===t.status?t.value:_t.pageInstanceGuid}))).catch((()=>_t))}(i),s=f(n),l=ty(i);s.render(t(a.StrictMode,{children:[e(es,{}),e(ir,{children:e(v,{store:l,children:t(Xa.Provider,{value:r,children:[e(ml,{}),e($i.Provider,{value:n,children:e(xo,{extensions:iy,extendStore:l.extend.bind(l),children:e(hu,{pageInstanceGuid:o})})})]})})})]}))}))}class ry{constructor(){this._subscribers=[]}add(e){this._subscribers.push(e)}unsubscribe(){this._subscribers.forEach((e=>e.unsubscribe()))}}const oy=()=>{},sy=(e=oy,t=oy,n=oy)=>"function"!=typeof e?e:{next:e,error:t,complete:n};class ly{constructor(e){this._setupFn=e}subscribe(e,t,n){const i=sy(e,t,n);let a,r=!0;const o={next:e=>{r&&i.next(e)},complete:()=>{r&&(a&&a(),i.complete(),r=!1)},error:e=>{r&&(i.error(e),r=!1)}};a=this._setupFn(o),r||a&&a();const s=new ry;return s.add({unsubscribe:()=>{a&&a(),r=!1}}),s}}class cy extends ly{constructor(){super((e=>(this._isComplete&&e.complete(),this._observers.push(e),()=>this._observers=this._observers.filter((t=>t!==e))))),this._observers=[],this._isComplete=!1}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){this._isComplete=!0;for(const e of this._observers)e.complete()}asObservable(){return new ly((e=>{const t=this.subscribe(e);return()=>t.unsubscribe()}))}}class dy extends cy{constructor(e){super(),this._lastValue=e}subscribe(e,t,n){const i=sy(e,t,n);return i.next(this._lastValue),super.subscribe(i)}next(e){return this._lastValue=e,super.next(e)}getValue(){return this._lastValue}}class uy extends cy{constructor(e=-1){super(),this._buffer=[],this._error=null,this._bufferLength=e}subscribe(e,t,n){const i=sy(e,t,n);let a=!0;return this._buffer.filter((e=>(e===this._error&&(a=!1),a))).forEach((e=>i.next(e))),this._error&&i.error(this._error),i.error=e=>{this._error=e,t(e)},super.subscribe(i)}next(e){this._error||this._addToBuffer(e),super.next(e)}error(e){this._error=e,this._addToBuffer(e),super.error(e)}_addToBuffer(e){-1!==this._bufferLength&&this._buffer.length===this._bufferLength?(this._buffer.shift(),this._buffer.push(e)):this._buffer.push(e)}}const py={CompletedBeforeEmit:"CompletedBeforeEmit"},fy=(e,t)=>{let n;const i="object"==typeof t;return new Promise(((a,r)=>{n=e.subscribe(a,r,(()=>{i?a(t.defaultValue):r(new Error(py.CompletedBeforeEmit))}))})).then((e=>(n.unsubscribe(),e))).catch((e=>{throw n.unsubscribe(),e}))},yy=(e,t)=>new Promise(((n,i)=>{let a;"object"==typeof t&&(a=t.defaultValue),e.subscribe((e=>a=e),(e=>i(e)),(()=>n(a)))})),my=(e,t)=>new ly((n=>{const i=e=>n.next(e);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)}));function hy(e){return new ly((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>t.error(e)))}))}const vy=(...e)=>new ly((t=>{const n=new ry;let i=0;for(const a of e)n.add(a.subscribe((e=>t.next(e)),(e=>t.error(e)),(()=>{i+=1,i>=e.length&&t.complete()})));return()=>n.unsubscribe()})),gy=(...e)=>new ly((t=>{for(const n of e)t.next(n)})),by=(...e)=>new ly((t=>{if(!e.length)return t.complete(),oy;const n=new ry,i=new Array(e.length),a=new Array(e.length),r=e=>!i.includes(void 0)&&t.next(e);for(let t=0;t<e.length;t++){const o=e[t].subscribe((e=>{a[t]=e,i[t]=!0,r(a)}));n.add(o)}return()=>n.unsubscribe()}));var Iy=function(e,t,n,i){return new(n||(n=Promise))((function(a,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((i=i.apply(e,t||[])).next())}))};function Ey(e,t){return new Sy(e,t)}class Sy{constructor(e,t){this._target=e,this._handler=t}subscribe(e,t,n){const i=e.next?e.next.bind(e):e,a={next:(...e)=>Iy(this,void 0,void 0,(function*(){try{yield i(...e)}catch(e){this._handler(e)}})),error:e.error?e.error.bind(e):t,complete:e.complete?e.complete.bind(e):n};return this._target.subscribe(a)}}class Cy{constructor(e){this.value=e,this.complete=!1,this.skip=!1}}var wy=function(e,t,n,i){return new(n||(n=Promise))((function(a,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((i=i.apply(e,t||[])).next())}))};const Ty=e=>(...t)=>new ly((n=>{const i=e.subscribe((e=>wy(void 0,void 0,void 0,(function*(){try{let i=new Cy(e);for(const e of t){const t=e(i);if(i=t.then?yield t:t,!0===i.skip||!0===i.complete)break}if(i.skip)return;n.next(i.value),!0===i.complete&&n.complete()}catch(e){n.error(e)}}))),(e=>n.error(e)),(()=>n.complete()));return()=>i.unsubscribe()})),xy=e=>t=>(!1===e(t.value)&&(t.skip=!0),t),Oy=e=>t=>(e?!0===e(t.value)?t.complete=!0:t.skip=!0:t.complete=!0,t),Ay=e=>t=>{const n=e(t.value);return new Cy(n)},Ny=e=>t=>(e(t.value),t),Ly={FULLSCREEN:"DisplayPreset.FULLSCREEN",EMBEDDED:"DisplayPreset.EMBEDDED",ATTACHED:"DisplayPreset.ATTACHED"},Ry={ERROR:"ERROR",INFO:"INFO",WARNING:"WARNING"},_y={getBreakpointCSSClass:qt},Dy="CHILD_LAYOUTS/ADD_LAUNCHED",ky="DYNAMIC_DATA/ADD";function Py(e={launched:{}},t){if(t.type===Dy){const n=t.payload;return n.childLayoutId?b(["launched",n.childLayoutId],n.shouldRelaunch,e):e}return e}function $y(e=null,t){return e}function jy(e=null,t){if(t.type===ky){const n=t.payload;return e?n?Fe(e,n):e:n}return e}function Fy(e,t){var n;return null===(n=e.childLayouts.launched[t])||void 0===n||n}function Gy(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer}function My(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.schemaVersion}const By=Object.freeze({});function Uy(e){var t;return(null===(t=e.dynamicData)||void 0===t?void 0:t.text)?e.dynamicData.text:By}const Vy="FAILED_TO_LAUNCH_CHILD_LAYOUT";function*zy(e,t,n){var i;if(yield null===(i=Ye(Fy,n.payload.childLayoutId))||void 0===i||i){const i=yield Ye(My),r=yield Ye(Gy),o=yield Ye(Uy);try{const s=(a=function(e,t,n,i){return{instanceGuid:e.instanceGuid,childLayoutId:e.childLayoutId,childLayoutSchema:e.childLayoutSchema,offer:t,layoutSchemaVersion:n,content:{text:i}}}(n.payload,r,i,o),JSON.parse(JSON.stringify(a)));try{yield ze(e.createChildPlugin,{name:"dcui-child",config:s,targetElementSelector:n.payload.targetElementSelector})}catch(e){yield ze(t,{level:$t,code:Vy,message:"Could not launch child layout, failed creating plugin."})}}catch(e){yield ze(t,{level:$t,code:Vy,message:"Could not launch child layout, failed to make the child layout config serializable."})}yield qe({type:Dy,payload:{childLayoutId:n.payload.childLayoutId,shouldRelaunch:!1}})}var a}const Hy={cursor:"pointer",paddingInline:0,paddingBlock:0};function Wy(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function qy(t){var n;const i=Ni(),a=ki(),r=t.schema.response_key||"positive",o=Qa(),s=Mi(),l=Ma(),{tabIndex:c,styles:d,isDisabled:u}=St(l),p=null===(n=o.responseOptionsMap)||void 0===n?void 0:n[r];return p&&e(Br,{styles:t.schema.styles,children:({classnames:n})=>e("button",{type:"button",tabIndex:c,"aria-disabled":u,disabled:u,style:Object.assign(Object.assign({},Hy),d),"data-testid":t.testId,"data-e2e":"CatalogItemResponse-standard-marketing",onClick:e=>{e.preventDefault();const t=function(e,t,n){var i,a;return Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId,catalogItemId:n.catalogItemId,productSku:n.productSku||(null===(i=n.copy)||void 0===i?void 0:i["provider.productSku"])||"",catalogId:n.catalogId||(null===(a=n.copy)||void 0===a?void 0:a["provider.catalogId"])||""})}(s,p,o);i({type:Jt,payload:t})},className:null==n?void 0:n.own,children:Wy(t.schema.children,a,t.testId)})})}const Ky={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(qy,{schema:t.node,testId:n})}};function Yy(){const t=Fa(),n=m(Uy),i=sa(),a=ki(),r=i({state:n},"textContent");return e(oa,{value:r,children:e(Pi,{value:a,overrides:Ky,children:e(Di,{children:e=>e(t)})})})}const Jy={staticData:$y,dynamicData:jy,childLayouts:Py};function Zy(e={}){return Object.assign({staticData:null,dynamicData:null,childLayouts:{launched:{}}},e)}function Qy(e){let t,n,i;return st((a=>(Promise.race([e.onClose().then((()=>"CLOSED")),new Promise((n=>{t=e.onEvent("PLUGIN_TRANSITION_OFFER_SUCCESS").subscribe((()=>{n("SUCCESS")}))})),new Promise((t=>{n=e.onEvent("PLUGIN_TRANSITION_OFFER_CLOSE").subscribe((()=>{t("UNSPECIFIED")}))})),new Promise((e=>{i=e}))]).then((e=>{"END"!==e&&(a(e),a(lt))})),()=>{null==t||t.unsubscribe(),null==n||n.unsubscribe(),i("END")})))}function Xy(e){return"object"==typeof e&&null!==e&&Object.entries(e).every((([e,t])=>"string"==typeof e&&("string"==typeof t||Xy(t))))}function*em(e,t,n,i,a){for(;;){switch(yield We(e)){case"CLOSED":t({type:rn,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":if((n||i)&&a){yield ze(a);break}t({type:rn,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:rn,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*tm(e,t,n){if(Zt(n)){const{responseOption:i,fulfillment:a}=n,r=tn(n),o=nn(n);yield qe({type:an,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const s=yield ze(e.createChildPlugin.bind(e),a);if("object"==typeof s&&"onClose"in s&&"close"in s){const i=yield ze(Qy,s);if("object"==typeof i&&"take"in i){const a=function(e,t,n,i){if(n.responseOption.rclid)return function*(){yield qe({type:sn,payload:{name:"REALTIME_OFFER_FULFILLMENT_CONVERSION",body:{rclid:n.responseOption.rclid,accountID:n.accountID,referralCreativeID:n.referralCreativeID}}}),yield ze(nm,e,t,i)}}(e,t,n,s);return void(yield ze(em,i,e.globalDispatch.bind(e),r,o,a))}}yield ze(t,{level:Pt,code:"UNEXPECTED_NEXT_VALUE_IN_SAGA",message:'Received an unexpected input at a step in the saga "handleFullfillmentResponse" and could not continue.'})}else yield ze(t,{level:Pt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}function*nm(e,t,n){const i=function(e){return st((t=>{const n=e.onEvent({name:$l,source:"partner",callback:e=>{Xy(e)&&t({eventName:$l,data:e})}},{name:jl,source:"partner",callback:e=>{Xy(e)&&t({eventName:jl,data:e})}});return()=>{n()}}))}(e);try{for(;;){const a=yield We(i);switch(a.eventName){case $l:yield qe({type:sn,payload:{name:$l,body:a.data}}),yield qe({type:ky,payload:{text:a.data}}),e.globalDispatch({type:rn,payload:{event:"Completed",completionReason:"Success"}}),n&&(yield ze(n.close.bind(n)));break;case jl:e.globalDispatch({type:rn,payload:{event:"Completed",completionReason:"Error"}}),n&&(yield ze(n.close.bind(n)));break;default:t({level:Pt,code:"UNKNOWN_REALTIME_OFFER_FULFILLMENT_EVENT",message:`Unknown event: ${a.eventName}`})}}}catch(e){const n=e;t({level:$t,code:"FAILED_TO_PROCESS_REALTIME_OFFER_FULFILLMENT_EVENT",message:null==n?void 0:n.message})}finally{(yield Ke())&&i.close()}}function*im(e,t,n){const i=Xt(n.payload)||en(n.payload)||Qt(n.payload)?n.payload:n.payload.responseOption;switch(yield qe({type:ln,payload:{key:"offerEngaged",value:1}}),i.action){case"Url":yield ze(e.globalDispatch.bind(e),n),(tn(n.payload)||nn(n.payload))&&(yield qe({type:sn,payload:{name:"REALTIME_OFFER_FULFILLMENT_REFERRAL",body:{rclid:i.rclid,accountID:i.accountID,referralCreativeID:i.referralCreativeID,referralOnly:nn(n.payload)}}}),tn(n.payload)&&(yield ze(nm,e,t)));break;case"CaptureOnly":yield ze(e.globalDispatch.bind(e),n);break;case"Fulfillment":yield qe({type:sn,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield qe({type:sn,payload:{name:"POSITIVE_ENGAGEMENT"}})),nn(n.payload)&&(yield qe({type:sn,payload:{name:"REALTIME_OFFER_FULFILLMENT_REFERRAL",body:{rclid:i.rclid,accountID:n.payload.accountID,referralCreativeID:n.payload.referralCreativeID,referralOnly:!0}}})),yield*tm(e,t,n.payload)}}function*am(e,t){yield Je([et(Jt,im.bind(null,e,t)),Ze(fn,zy.bind(null,e,t)),Ze("*",Ks.bind(null,[Jt,fn],e))])}Object.assign({},vn);const rm=(new Da).withAppFactory((function(n){var i;if(n.rootElement){const r=f(n.rootElement),o=Zy({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n=Zy()){const i=rt(),a=it({reducer:Jy,devTools:{name:"Standard Marketing"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(am,e,t),a}(n.gateway,n.logger,o);r.render(e(a.StrictMode,{children:t(Ya,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(es,{}),e(v,{store:s,children:e(Qo,{settings:n,dispatch:s.dispatch,children:e(Yy,{})})})]})}))}}));var om=Object.freeze({__proto__:null,moduleConnectorBuilder:rm});const sm="CART/UPDATE",lm="CATALOG_ITEM/RESPONSE",cm="USER_CREATIVE_RESPONSE_HISTORY/ADD",dm=T([[(e,t)=>0!==t,j],[(e,t)=>!Number.isNaN(e)&&0===t,j],[(e,t)=>Number.isNaN(e)&&0===t,Me]]);function um({isChecked:t,isDisabled:n,outerClassname:i,outerCheckedClassname:a,innerClassname:r,innerCheckedClassname:o}){return e("span",{style:{display:"flex"},children:e("span",{className:`${i} ${t?a:""}`,tabIndex:n?-1:1,style:{display:"flex",boxSizing:"border-box"},children:e("span",{className:`${r} ${t?o:""}`,style:{flex:1}})})})}const pm="catalogRadioGroup__label",fm=["Enter","Space"],ym={elements:{own:[],optionContainer:[],radioButtonInner:[{default:{border:{borderRadius:11},background:{backgroundColor:{light:"#FFF"}}}}],radioButtonInnerChecked:[{default:{background:{backgroundColor:{light:"#529ff4"}}}}],radioButtonOuter:[{default:{border:{borderRadius:16,borderColor:{light:"#999"},borderStyle:"solid",borderWidth:"1"},dimension:{width:{type:"fixed",value:16},height:{type:"fixed",value:16}},spacing:{padding:"4"}}}],radioButtonOuterChecked:[]}};function mm(e,t,n){return e.map(T([[P(j("Required"),H("","type")),({value:e})=>Number.isNaN(n)&&t>0?e.message:""],[O,z("")]])).filter(Ge)}function hm({schema:n,testId:i}){var o;const s=y(),l=Qa(),c=null!==(o=m((e=>{var t,n;return l.cartItemId in e.cart?null!==(n=null===(t=e.cart[l.cartItemId])||void 0===t?void 0:t.quantity)&&void 0!==n?n:0:void 0})))&&void 0!==o?o:NaN,u=d((()=>mm(n.validations,n.options.length,c)),[n.validations,n.options.length,c]),p=Ma(),{tabIndex:f,styles:h,isDisabled:v}=St(p);r((()=>{v||s(vm(u))}),[]);const g=n.options.filter((({quantity:e})=>{var t,n;return e>=(null!==(t=l.minItemCount)&&void 0!==t?t:-1/0)&&e<=(null!==(n=l.maxItemCount)&&void 0!==n?n:1/0)}));function b(e){s({type:lm,payload:{catalogItem:l,quantity:e}});const t=mm(n.validations,n.options.length,e);s(vm(t))}return g.length>0?e(Br,{styles:n.styles?Wt(ym,n.styles):ym,children:({classnames:n,mapperRef:r})=>e("div",{className:null==n?void 0:n.own,style:Object.assign({display:"flex",flexDirection:"column"},h),children:e(ca,{value:r(pm),children:a.Children.toArray(g.map(((a,r)=>{var o;const s=dm(c,a.quantity),d=e=>i?`${i}-option${r}${e}`:void 0;return t("label",{tabIndex:f,"aria-disabled":v,style:{display:"flex"},className:`${pm} ${null!==(o=null==n?void 0:n.optionContainer)&&void 0!==o?o:""}`,onKeyDown:e=>{s||!fm.includes(e.code)||v||b(a.quantity)},"data-e2e":"CatalogRadioGroup-Option","data-e2e-quantity":`${a.quantity}`,"data-testid":d("Label"),children:[e("input",{type:"radio",style:{display:"none"},tabIndex:-1,name:l.instanceGuid,value:a.quantity,checked:s,onChange:()=>b(a.quantity),"aria-disabled":v,disabled:v}),e(um,{isChecked:s,isDisabled:v,innerClassname:null==n?void 0:n.radioButtonInner,innerCheckedClassname:null==n?void 0:n.radioButtonInnerChecked,outerClassname:null==n?void 0:n.radioButtonOuter,outerCheckedClassname:null==n?void 0:n.radioButtonOuterChecked}),e(as,{schema:a,testId:d("Content")})]})})))})})}):null}function vm(e){return{type:un,payload:{errors:e}}}function gm(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function bm(t){const n=y(),i=ki(),a=Qa(),r=Ma(),{tabIndex:o,styles:s,isDisabled:l}=St(r);return e(Br,{styles:t.schema.styles,children:({classnames:r})=>e("button",{type:"button",tabIndex:o,"aria-disabled":l,disabled:l,style:Object.assign({cursor:"pointer"},s),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:lm,payload:{catalogItem:a,quantity:1}})},className:null==r?void 0:r.own,children:gm(t.schema.children,i,t.testId)})})}const Im={allowedTags:["em","strong","a","br","u","p","li","ul","ol","span"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[]},allowedSchemes:["http","https"]},Em=new Map([["&","_;^;_"]]),Sm=new RegExp(`<a *(?=${Im.allowedAttributes.a.join("|")}|>)`,"g"),Cm=new RegExp(`<a *(?:(?:${Im.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),wm=new RegExp("(<br *?>)|(<br *?/>)","g"),Tm=new RegExp(`<ul *(?=${Im.allowedAttributes.ul.join("|")}|>)`,"g"),xm=new RegExp(`<ol *(?=${Im.allowedAttributes.ol.join("|")}|>)`,"g"),Om=new RegExp("<li *(?=>|\\s[^>]*>)","g"),Am="<br/>";function Nm(t){const n=sa(),i=Ma(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Cm,((e,t)=>{const n=t.replaceAll("&",Em.get("&"));return e.replace(t,n)})).replaceAll(wm,Am)}(e);return t===vt(t,Im)}(e))throw new jt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:r,styles:o,isDisabled:s}=St(i);return a?e(Br,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class="${null==n?void 0:n.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0)),l=((null==n?void 0:n.list)?`class="${n.list}"`:"")+' style="list-style-type: none; padding-inline-start: 0px; display: flex; flex-direction: column;"',c=((null==n?void 0:n.listItem)?`class="${n.listItem}"`:"")+' style="display: flex; align-items: flex-start; flex-shrink: 0; flex-grow: 1;"',d=`class="rokt-icon${(null==n?void 0:n.span)?" "+n.span:""}" style="display: inline-block; pointer-events: none; user-select: none;" aria-disabled="true"`,u=a.replace(Sm,`<a ${i.join(" ")}`).replace(Tm,`<ul ${l}`).replace(xm,`<ol ${l}`).replace(Om,`<li ${c}><span ${d}>Check</span`);return p=a,new RegExp("</(p|ul|ol)>").test(p)?e("div",{tabIndex:r,style:o,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:u}}):e("p",{tabIndex:r,style:o,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:u}});var p}}):null}const Lm={internally:"_top",externally:"_blank"};function Rm(t,n,i,a,r){return e(ca,{value:i(n),children:_m(t,a,r)})}function _m(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Dm(t){var n,i;const a=Lm[t.schema.open],r=ki(),o=Qa(),s=Ma(),l=y(),c=null!==(n=o.url)&&void 0!==n?n:"",{tabIndex:d,styles:u,isDisabled:p}=St(s);return Boolean(c)&&(null===(i=t.schema.children)||void 0===i?void 0:i.length)>0?e(Br,{styles:t.schema.styles,children:({classnames:n,mapperRef:i})=>{var s;return e("a",{href:c,onClick:()=>{var e;l({type:an,payload:{name:"SignalResponse",parentGuid:null!==(e=o.instanceGuid)&&void 0!==e?e:"",responseActionPayload:{name:"Url",transformedTrafficURL:c}}})},"data-testid":t.testId,"data-e2e":"CatalogUrlLink",target:null!=a?a:"_blank",tabIndex:d,"aria-disabled":p,"aria-label":null!==(s=t.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:"block"},u),className:null==n?void 0:n.own,children:(null==n?void 0:n.own)?Rm(t.schema.children,null==n?void 0:n.own,i,r,t.testId):_m(t.schema.children,r,t.testId)})}}):null}function km(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Pm(t){const n=ki(),i=Qa(),a=Ma(),{tabIndex:r,styles:o,isDisabled:s}=St(a),l=Ys(i,1),c=Ni();return e(Br,{styles:t.schema.styles,children:({classnames:a})=>e("button",{type:"button",tabIndex:r,"aria-disabled":s,disabled:s,style:Object.assign({cursor:"pointer"},o),"data-testid":t.testId,"data-e2e":"CatalogPartnerEventButton",onClick:()=>{s||(c({type:an,payload:{name:"SignalCartItemQuantitySelected",parentGuid:i.instanceGuid,objectData:{quantity:1,preselected:!1}}}),c({type:sn,payload:{name:"V2_CART_ITEM_UPDATED",body:{oldCartItem:null,cartItem:l}}}))},className:null==a?void 0:a.own,children:km(t.schema.children,n,t.testId)})})}function $m(e,t){const n=e.cart[t];return n||null}function jm(e){var t,n;const i=null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[],a=function(e){return Object.values(e.cart).filter((e=>null!==e))}(e);return a.filter((e=>i.find((t=>t.catalogItemId===e.catalogItemId))))}function Fm(e,t){var n,i,a,r;const o=null===(n=e.staticData)||void 0===n?void 0:n.offer;if(o){const n=function(e){return jm(e).reduce(((e,t)=>e+t.quantity),0)}(e),s=$m(e,t.cartItemId),l=(null!==(i=null==o?void 0:o.maxTotalItemsQtyInOffer)&&void 0!==i?i:1/0)-n,c=(null!==(a=t.maxItemCount)&&void 0!==a?a:1/0)-(null!==(r=null==s?void 0:s.quantity)&&void 0!==r?r:0);return Math.min(l,c)}return 0}const Gm={is:j,"is-not":P(J,j),"is-below":be,"is-above":ge};function Mm({schema:t,testId:n}){const{children:i,predicates:r}=t,o=sa()(t.cartItemId),s=m((e=>{var t;return(null===(t=$m(e,o))||void 0===t?void 0:t.quantity)||0}));return(()=>{const e=r.map((e=>(0,Gm[e.condition])(s,e.value)));return le(j(!0),e)})()?e(Di,{children:e=>a.Children.toArray(i.map(((t,i)=>e(t,void 0,n?`${n}-child-${i}`:`when-catalog-quantity-child-${i}`))))}):null}function Bm({schema:n,testId:i}){const a=sa(),r=Ma(),{tabIndex:o,styles:s,isDisabled:l}=St(r),{text:c,highlightedText:d,target:p}=n,f=a(c),y=a(d),m=u((()=>{if(l)return;const e=document.querySelector(`[${p.key}="${p.value}"]`);e&&e.scrollIntoView({behavior:"smooth"})}),[p.key,p.value,l]),h=u((e=>{e.preventDefault(),e.stopPropagation(),m()}),[m]),v=f.indexOf(y);if(-1===v)return e(Br,{styles:n.styles,children:({classnames:t})=>e("span",{"data-testid":i,"data-e2e":"ScrollToTarget",className:null==t?void 0:t.own,style:s,"aria-hidden":l,children:e("span",{className:null==t?void 0:t.text,children:f})})});const g=f.slice(0,v),b=f.slice(v+y.length);return e(Br,{styles:n.styles,children:({classnames:a})=>{var r;return t("span",{"data-testid":i,"data-e2e":"ScrollToTarget",className:null==a?void 0:a.own,"aria-label":null!==(r=n.a11yLabel)&&void 0!==r?r:void 0,children:[g&&e("span",{className:null==a?void 0:a.text,style:s,"aria-hidden":l,children:g}),e("span",{onClick:h,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m())},className:null==a?void 0:a.highlighted,style:Object.assign({cursor:l?"default":"pointer"},s),role:"button",tabIndex:l?-1:o,"aria-disabled":l,"aria-label":`Click to scroll to element with ${p.key}="${p.value}"`,children:y}),b&&e("span",{className:null==a?void 0:a.text,style:s,"aria-hidden":l,children:b})]})}})}function Um(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-content${i}`:void 0))))}function Vm({schema:n,testId:i}){const a=ki(),[r,o]=c(!1),{children:s,anchor:l,background:d}=n;return e(Br,{styles:n.styles,children:({classnames:c})=>{var u;return t("div",{"data-testid":i,"data-e2e":"Tooltip",style:{position:"relative",display:"inline-block",cursor:"pointer"},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:()=>o(!r),"aria-label":null!==(u=n.a11yLabel)&&void 0!==u?u:void 0,children:[a(l,void 0,i?`${i}-anchor`:void 0),r&&t("div",{className:null==c?void 0:c.own,style:{position:"absolute",zIndex:1,bottom:"150%",left:"50%",transform:"translateX(-50%)"},role:"tooltip",children:[Um(s,a,i),d&&e("div",{style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",margin:0,padding:0,lineHeight:0},children:a(d,void 0,i?`${i}-arrow`:void 0)})]})]})}})}function zm(e){var t,n;const i=null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[];return i.length>0?i:null}function Hm(e,t){var n,i;return null!==(i=null===(n=zm(e))||void 0===n?void 0:n.find((e=>e.catalogItemId===t)))&&void 0!==i?i:null}function Wm(e){var t;const n=null===(t=zm(e))||void 0===t?void 0:t.filter((e=>e.preSelectedQuantity&&e.preSelectedQuantity>0));return n&&n.length>0?n:null}function qm(e){var t,n;return null!==(n=null===(t=Wm(e))||void 0===t?void 0:t.reduce(((e,t)=>{var n;return e+(null!==(n=t.preSelectedQuantity)&&void 0!==n?n:0)}),0))&&void 0!==n?n:0}const Km=P((e=>e.filter((e=>!pe(e[1]))).map((([e,t])=>({cartItemId:t.cartItemId,quantity:t.quantity})))),M,U("cart"));function Ym(n){var i,a,r,o;const s=Ma(),{tabIndex:l,styles:c,isDisabled:d}=St(s),u=Ni(),p=sa()(n.schema.preButtonText),f=m((e=>function(e){var t,n;return null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.creative)&&void 0!==n?n:null}(e)));if(!f)return null;const y=null!==(i=f.copy["provider.offerId"])&&void 0!==i?i:"",h=null!==(a=n.schema.title)&&void 0!==a?a:"",v=null!==(o=null!==(r=f.copy["provider.offer.longDescription.copy"])&&void 0!==r?r:f.copy["creative.copy"])&&void 0!==o?o:"";return t("span",{style:{display:"inline"},children:[n.schema.preButtonText&&e("span",{style:{marginRight:"4px",color:"#646464",fontSize:16,fontFamily:"Averta",fontWeight:"400",letterSpacing:.32,lineHeight:"24px",margin:"8px 0 0 0"},children:p}),e(Br,{styles:n.schema.styles,children:({classnames:t})=>e("button",{type:"button",tabIndex:l,"aria-disabled":d,disabled:d,style:Object.assign({cursor:"pointer",display:"inline",color:"#024DDF",fontSize:16,fontFamily:"Averta",fontWeight:"400",textDecoration:"underline",background:"none",border:"none",padding:0},c),"data-testid":n.testId,"data-e2e":"CatalogUpsellCreativeButton",onClick:()=>{d||u({type:sn,payload:{name:"UPSELL_CREATIVE_SENT",body:{offerId:y,title:h,description:v}}})},className:null==t?void 0:t.own,children:"Read More"})})]})}function Jm(t,n,i,a,r){return e(ca,{value:i(n),children:a(t,void 0,r)})}function Zm(e,t,n){return t(e,void 0,n)}function Qm(i){var a;const{schema:r,testId:o}=i,{a11yInputLabel:s,styles:l,showInputField:c,buttons:d,forcedUpsellText:u}=r,{increment:p,decrement:f,a11yIncrementLabel:h,a11yDecrementLabel:v}=d||{},g=y(),b=Qa(),I=ki(),E=sa(),S=Ma(),{tabIndex:C,styles:w,isDisabled:T}=St(S),x=m((e=>function(e,t){var n,i,a;const r=Hm(e,t);return Boolean(r&&(null!==(n=r.preSelectedQuantity)&&void 0!==n?n:0)>0&&r.preSelectedQuantity===(null!==(i=r.minItemCount)&&void 0!==i?i:0)&&r.preSelectedQuantity===(null!==(a=r.maxItemCount)&&void 0!==a?a:0))}(e,b.catalogItemId))),O=m((e=>$m(e,b.cartItemId))),A=m((e=>Fm(e,b))),N=(null==O?void 0:O.quantity)||0,L=St(T||N<=(null!==(a=b.minItemCount)&&void 0!==a?a:0)?"DISABLED":S),R=St(T||A<=0?"DISABLED":S),_=St(T||x?"DISABLED":S),D=e=>{var t;const n=e.target.value;if(0===n.length)k(null!==(t=b.minItemCount)&&void 0!==t?t:0);else{const e=Number(n);!Number.isNaN(e)&&e>=0&&k(e)}},k=e=>{T||g({type:lm,payload:{catalogItem:b,quantity:e}})};return e(Br,{styles:l,children:({classnames:i,mapperRef:a})=>e("div",{className:null==i?void 0:i.own,style:Object.assign({display:"flex",flexDirection:"row"},w),children:x&&u?e(Zr,{schema:u,isInline:!1,testId:o?`${o}-forced-upsell-text`:void 0}):t(n,{children:[f?e("button",{className:null==i?void 0:i.decrementButton,style:Object.assign(Object.assign({},L.styles),{cursor:L.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(N-1)},tabIndex:L.tabIndex,"aria-label":v||void 0,disabled:L.isDisabled,"data-testid":o?`${o}-decrement-button`:void 0,children:e(oa,{value:E,children:(null==i?void 0:i.decrementButton)?Jm(f,i.decrementButton,a,I,o):Zm(f,I,o)})}):null,c?e("input",{type:"text",className:null==i?void 0:i.input,style:Object.assign(Object.assign({},_),{cursor:_.isDisabled?"not-allowed":"auto",caretColor:_.isDisabled?"transparent":"auto",pointerEvents:"auto",outline:"none"}),value:N,onChange:D,"aria-label":s||void 0,tabIndex:C,disabled:T,"data-testid":o?`${o}-input`:void 0}):e("p",{className:null==i?void 0:i.input,style:w,"data-testid":o?`${o}-quantity-text`:void 0,children:N}),p?e("button",{className:null==i?void 0:i.incrementButton,style:Object.assign(Object.assign({},R.styles),{cursor:R.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(N+1)},tabIndex:R.tabIndex,"aria-label":h||void 0,disabled:R.isDisabled,"data-testid":o?`${o}-increment-button`:void 0,children:e(oa,{value:E,children:(null==i?void 0:i.incrementButton)?Jm(p,i.incrementButton,a,I,o):Zm(p,I,o)})}):null]})})})}const Xm={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(bm,{schema:t.node,testId:n})},EscapeHatch:function(t,n){if("EscapeHatch"===t.type&&t.node.data){const i=JSON.parse(t.node.data);switch(null==i?void 0:i.type){case"InsuranceRichText":return e(Nm,{schema:i.node});case"CatalogUrlLink":return e(Dm,{schema:i.node});case"CatalogPartnerEventButton":return e(Pm,{schema:i.node});case"ReadMoreText":return e(Ym,{schema:i.node});case"WhenCatalogQuantity":return e(Mm,{schema:i.node,testId:n});case"ScrollToTarget":return e(Bm,{schema:i.node,testId:n});case"Tooltip":return e(Vm,{schema:i.node,testId:n});default:return}}},CatalogRadioGroup:function(t){if("CatalogRadioGroup"===t.type)return e(hm,{schema:t.node})},CatalogQuantityCounter:function(t){if("CatalogQuantityCounter"===t.type)return e(Qm,{schema:t.node})}};function eh(){const t=Fa(),n=ki();return e(Pi,{value:n,overrides:Xm,children:e(Di,{children:e=>e(t)})})}function th(e){return e.reduce(((e,t)=>(e[t.cartItemId]=function(e={}){return Object.assign({cartItemId:"cartItemId",catalogItemId:"catalogItemId",name:"Catalog Title",description:"This is a catalog item",unitPrice:10,totalPrice:10,quantity:1,currency:"USD",linkedProductId:void 0,quantityMustBeSynchronized:void 0,providerData:""},e)}({cartItemId:t.cartItemId,quantity:t.quantity}),e)),{})}const nh={cart:function(e=th([]),t){if(t.type===sm){const{catalogItem:n,quantity:i}=t.payload,a=n.cartItemId,r=Ys(n,i);return Object.assign(Object.assign({},e),{[a]:r})}return e},userCreativeResponseHistory:function(e=[],t){return t.type===cm?e.concat(t.payload.responseId):e},staticData:$y,childLayouts:Py};const ih="INVALID_PARTNER_MESSAGE",ah="MISCONFIGURED_CATALOG_ITEM",rh="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function*oh(e){var t,n;const i=yield Ye(Wm),a=yield Ye(qm),r=yield Ye((e=>{var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer.maxTotalItemsQtyInOffer}));if(uh(a)&&uh(r)&&a>r)yield ze(e,{level:$t,code:ah,message:`Catalog items preselected quantities (${a}) exceeds the maximum allowed quantity (${r}) for this offer`});else if(i&&Array.isArray(i))for(const a of i){const i=null!==(t=a.preSelectedQuantity)&&void 0!==t?t:0,r=null!==(n=a.maxItemCount)&&void 0!==n?n:1/0;i>r?yield ze(e,{level:$t,code:ah,message:`Preselected quantity (${i}) is greater than maxItemCount (${r}) for catalog item (${a.instanceGuid})`}):yield*dh(a,i,!0)}}function*sh(e,t,n){const{catalogItem:i,quantity:a}=n.payload;if(yield*dh(i,a,!1)){const n=yield Ye((e=>{var t,n,i;const a=null===(t=e.staticData)||void 0===t?void 0:t.offer.creative.responseOptionsMap.positive,r=e.userCreativeResponseHistory.at(-1),o=null===(n=e.staticData)||void 0===n?void 0:n.offer.creative.responseOptionsMap.negative;if(a&&r&&a.id===r&&"SignalGatedResponse"===(null==o?void 0:o.signalType))return function(e,t){var n;switch(e.action){case"Fulfillment":{const i=null==t?void 0:t.creative.fulfillment;return Tt(i)?{type:Jt,payload:{fulfillment:i,responseOption:e,accountID:null!==(n=null==t?void 0:t.accountId)&&void 0!==n?n:""}}:`Could not get fulfillment for response (instanceGuid: ${e.instanceGuid})`}case"Url":return(null==t?void 0:t.accountId)?{type:Jt,payload:Object.assign(Object.assign({},e),{accountID:t.accountId})}:`Could not get accountId for response (instanceGuid: ${e.instanceGuid})`;default:return{type:Jt,payload:e}}}(o,null===(i=e.staticData)||void 0===i?void 0:i.offer)}));null!=(r=n)&&"object"==typeof r&&"type"in r&&"payload"in r&&"object"==typeof r.payload?yield ze(e.globalDispatch,n):function(e){return"string"==typeof e}(n)&&(yield ze(t,{level:$t,code:"INVALID_RESPONSE_OBJECT",message:n}))}var r}function*lh(e,t){const n=function(e,t){return st((n=>{const i=e.onEvent({name:_l.V2.PartnerMessage.UpdateCartItem,source:"partner",callback:e=>{!function(e){return null!==e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&!("unitPrice"in e)}(e)?t({level:$t,code:ih,message:`Invalid UpdateCartItemPartnerMessageBody: ${JSON.stringify(e)}`}):n(e)}});return()=>{i()}}))}(e,t);try{for(;;){const e=yield We(n);yield ze(ch,e,t)}}catch(e){const n=e;t({level:$t,code:rh,message:null==n?void 0:n.message})}finally{(yield Ke())&&n.close()}}function*ch(e,t){const{cartItemId:n,quantity:i}=e,a=yield Ye($m,n);if(ph(a)){const e=yield Ye(Hm,a.catalogItemId);null!==(r=e)&&"object"==typeof r&&"catalogItemId"in r&&"price"in r?yield*dh(e,i,!1):yield ze(t,{level:$t,code:rh,message:`Catalog item not found for cart item id (${n})`})}else yield ze(t,{level:$t,code:rh,message:`Cart item not found for cart item id (${n})`});var r}function*dh(e,t,n){var i;const a=yield Ye($m,e.cartItemId),r=yield Ye(Fm,e),o=uh(r)?r:0,s=ph(a)?a.quantity:0;if(t!==s&&t>=(null!==(i=e.minItemCount)&&void 0!==i?i:0)&&t-s<=o){yield qe({type:sm,payload:{catalogItem:e,quantity:t}});const i=yield Ye($m,e.cartItemId),r=yield Ye(Km);return yield qe({type:pn,payload:{cart:r}}),yield qe({type:an,payload:{name:"SignalCartItemQuantitySelected",parentGuid:e.instanceGuid,objectData:{quantity:t,preselected:n}}}),yield qe({type:sn,payload:{name:"V2_CART_ITEM_UPDATED",body:{oldCartItem:a,cartItem:i}}}),!0}return!1}function uh(e){return"number"==typeof e}function ph(e){return null!=e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&"unitPrice"in e}function*fh(e,t){var n;yield qe({type:cm,payload:{responseId:(n=t.payload,Zt(n)?n.responseOption.id:n.id)}}),yield ze(e.globalDispatch.bind(e),t)}function*yh(e,t){yield Je([Xe(oh.bind(null,t)),Xe(lh.bind(null,e,t)),et(lm,sh.bind(null,e,t)),et(Jt,fh.bind(null,e)),Ze(fn,zy.bind(null,e,t)),Ze("*",Ks.bind(null,[Jt,fn],e))])}function mh(e){return"object"==typeof e&&null!==e&&"cartItemId"in e&&"quantity"in e}Object.assign(Object.assign({},vn),{CATALOG_ITEM_RESPONSE:lm});const hh=(new Da).withAppFactory((function(n){var i;if(n.rootElement){const r=f(n.rootElement),o=function(e){return"object"==typeof e&&null!==e&&"cart"in e&&Array.isArray(e.cart)&&e.cart.every(mh)}(n.offerState)?n.offerState:{cart:[]},s=function(e={}){return Object.assign({cart:th([]),userCreativeResponseHistory:[],staticData:null,childLayouts:{launched:{}}},e)}({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion},cart:th(o.cart)}),l=function(e,t,n){const i=rt(),a=it({reducer:nh,devTools:{name:"Add To Cart"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(yh,e,t),a}(n.gateway,n.logger,s);r.render(e(a.StrictMode,{children:t(Ya,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(es,{}),e(v,{store:l,children:e(Qo,{settings:n,dispatch:l.dispatch,children:e(eh,{})})})]})}))}}));var vh=Object.freeze({__proto__:null,moduleConnectorBuilder:hh});const gh="CATALOG/TRIGGER_SELECT_ITEM",bh="CATALOG/SET_SELECTED_ITEM",Ih="CHECKOUT_LIFECYCLE",Eh="INSTANT_PURCHASE/INITIATE",Sh="INSTANT_PURCHASE/PARTNER_RESPONSE",Ch="INSTANT_PURCHASE/WSDK_RESPONSE",wh="INSTANT_PURCHASE/SET_OFFER_LIFECYCLE_EVENT",Th=s(null);function xh(t){const[n,i]=c({});return e(Th.Provider,{value:{registerValidators:function(e,t){i((n=>Object.assign(Object.assign({},n),{[e]:{validators:t,isValid:!0}})))},validateFieldKeys:function(e){const t={};let a=!0;for(const i of e){const e=n[i];if(e){const n=Object.assign({},e),r=e.validators.every((e=>e()));r!==n.isValid&&(t[i]=Object.assign(Object.assign({},n),{isValid:r})),a&&(a=r)}else a=!1}return Object.values(t).length>0&&i((e=>Object.assign(Object.assign({},e),t))),a},getFieldKeyValidity:function(e){var t;return(null===(t=n[e])||void 0===t?void 0:t.isValid)||!1}},children:t.children})}function Oh(){const e=l(Th);if(!e)throw new Error("useValidator must be used within a ValidatorProvider");return e}function Ah(e,t){const n=Oh();r((()=>{e&&n.registerValidators(e,t)}),[])}function Nh(e,t){return t?t.validators.map((t=>e[t])).filter((e=>void 0!==e)):[]}function Lh(t,n,i,a,r){return e(ca,{value:i(n),children:Rh(t,a,r)})}function Rh(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function _h(t){const n=t.schema.validatorTriggerConfig,i=y(),a=ki(),r=Ma(),{tabIndex:o,styles:s,isDisabled:l}=St(r),c=Qa(),d=na(c,"catalogItem"),u=Oh();return e(Br,{styles:t.schema.styles,children:({classnames:r,mapperRef:p})=>e("button",{type:"button",tabIndex:o,"aria-disabled":l,disabled:l,style:Object.assign({cursor:"pointer"},s),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault(),function(){let e=!0;n&&(e=u.validateFieldKeys(n.validatorFieldKeys)),i(e?{type:Eh,payload:{catalogItem:c,quantity:1,useInstantPurchaseExtension:!0}}:{type:an,payload:{name:"SignalUserInteraction",action:"ValidationTriggerFailed",context:"CatalogResponseButton",parentGuid:c.instanceGuid}})}()},className:null==r?void 0:r.own,children:e(oa,{value:d,children:(null==r?void 0:r.own)?Lh(t.schema.children,r.own,p,a,t.testId):Rh(t.schema.children,a,t.testId)})})})}const Dh=["ArrowDown","ArrowUp","Enter","Escape","Tab"];function kh(n){const i=n.schema.validatorFieldConfig,a=n.schema.disableProgrammaticFocus||!1,s=Mi(),l=ki(),u=d((()=>s.catalogItems||[]),[s]),p=Ma(),{styles:f,isDisabled:h}=St(p),v=o(null),g=o([]),[b,I]=c(!1),[E,S]=c(-1),C=y(),w=Oh(),T=m((e=>e.selectedItem)),x=o(T),[O,A]=c(T?u.indexOf(T):-1);function N(){return!!x.current}const L=d((()=>Nh({required:N},i)),[i]);function R(t,i,a,r){return t?function(t,n,i,a,r){return e(ca,{value:i(n),children:a(t,void 0,r)})}(i,t,a,l,r||n.testId):function(e,t,n){return t(e,void 0,n)}(i,l,r||n.testId)}function _(){return!i||w.getFieldKeyValidity(i.validationFieldKey)}function D(){h||(b?P():k())}function k(){h||I(!0)}function P(){h||I(!1)}function $(e,t){var n;S(u.indexOf(e)),P(),C({type:gh,payload:{catalogItem:e}}),C({type:an,payload:{name:"SignalUserInteraction",action:"DropDownItemSelected",context:"CatalogDropDown",parentGuid:e.instanceGuid}}),x.current=e,i&&i.validateOnChange&&w.validateFieldKeys([i.validationFieldKey]),A(t),null===(n=v.current)||void 0===n||n.focus()}function j(e){const t=[null==e?void 0:e.dropDownSelectedElement];return _()||t.push((null==e?void 0:e.dropDownContainerErrorStyles)||""),t.join(" ")}Ah(null==i?void 0:i.validationFieldKey,L),r((()=>{var e;if(!a)if(b)if(-1===O)null===(e=v.current)||void 0===e||e.focus();else{const e=g.current[O];e&&e.focus()}else S(O)}),[b,a,O]),r((()=>{var e;null===(e=g.current[E])||void 0===e||e.focus()}),[E]);const F={elements:{own:[{default:{background:{backgroundColor:{light:"#ffffff"}},dimension:{width:{type:"percentage",value:100}}}}]}};function G(e){var t;if(!h&&Dh.includes(e.key))switch(e.key){case"ArrowDown":{e.preventDefault();const t=E+1;t<u.length&&S(t);break}case"ArrowUp":{e.preventDefault();const t=E-1;t>=0&&S(t);break}case"Enter":if(e.preventDefault(),b){const e=u[E];if(void 0===e)return;$(e,E)}else k();break;case"Tab":b&&P();break;case"Escape":e.preventDefault(),b&&(P(),null===(t=v.current)||void 0===t||t.focus())}}let M=null;return T&&(M=na(T,"catalogItem")),u.length>1?e(Br,{styles:n.schema.styles?Wt(F,n.schema.styles):F,children:({classnames:i,mapperRef:a})=>t("div",{className:null==i?void 0:i.dropDownContainer,children:[t("div",{ref:v,className:null==i?void 0:i.own,onKeyDown:G,onClick:D,onBlur:e=>{var t;(null===(t=v.current)||void 0===t?void 0:t.contains(e.relatedTarget))||b&&P()},"data-e2e":"DropDown","data-testid":n.testId?`${n.testId}-drop-down-container`:void 0,"aria-disabled":h,style:Object.assign({position:"relative"},f),tabIndex:0,children:[e("div",{className:j(i),"aria-disabled":h,"data-testid":n.testId?`${n.testId}-drop-down-selected-element`:void 0,style:Object.assign({cursor:"pointer"},f),title:M?M(n.schema.closedTemplateTitle||""):"",children:T&&M?e(oa,{value:M,children:R(null==i?void 0:i.dropDownSelectedElement,n.schema.closedTemplate,a)}):R(null==i?void 0:i.dropDownSelectedElement,n.schema.closedDefaultTemplate,a)}),b&&e("ul",{className:null==i?void 0:i.dropDownListContainer,onClick:e=>e.stopPropagation(),"data-testid":n.testId?`${n.testId}-drop-down-list-container`:void 0,tabIndex:-1,style:Object.assign({listStyle:"none",padding:0,zIndex:9999,position:"absolute",top:"100%",left:0,right:0,overflowX:"hidden",overflowY:"auto"},f),children:u.map(((t,r)=>{const o=na(Object.assign(Object.assign({},t),{isSelected:r===O}),"catalogItem");return e("li",{ref:e=>function(e,t){g.current[t]=e}(e,r),className:null==i?void 0:i.dropDownListElement,onClick:e=>{e.stopPropagation(),h||$(t,r)},tabIndex:-1,"data-e2e":"DropDownItem","data-testid":n.testId?`${n.testId}-drop-down-item-${r}`:void 0,style:Object.assign({cursor:"pointer",display:"flex"},f),title:o(n.schema.openTemplateTitle||""),children:e(oa,{value:o,children:R(null==i?void 0:i.dropDownSelectedElement,n.schema.openTemplate,a)})},t.catalogItemId)}))})]}),!_()&&n.schema.requiredSelectionErrorTemplate?R(null==i?void 0:i.errorContentContainerStyles,n.schema.requiredSelectionErrorTemplate,a,"dropdown-required-selection-error"):null]})}):null}function Ph(t){const n=t.schema.styles,i=y(),r=m((e=>e.staticData)),o=Ma(),{tabIndex:s,styles:l,isDisabled:c}=St(o),d=()=>{var e;i({type:Ih,payload:{event:"Checkout",targetStep:t.schema.targetStep,offerPositionIndex:null!==(e=null==r?void 0:r.position)&&void 0!==e?e:0,data:t.schema.data}})};return e(Br,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:t.schema.targetStep,className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"CheckoutStateButtonTrigger",disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:t.schema.targetStep,tabIndex:s,style:Object.assign({cursor:"pointer"},l),children:e(Di,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,Kt(i,t.testId)))))})})}})}const $h=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/;function jh(t){const n=sa(),i=Ma(),{schema:a,testId:r}=t,o=n(a.value),{tabIndex:s,styles:l,isDisabled:c}=St(i);return"string"==typeof(d=o)&&$h.test(d)?e(Br,{styles:a.styles,children:({classnames:t})=>e("div",{"aria-hidden":c,className:null==t?void 0:t.own,"data-e2e":"ColorSwatch","data-testid":r,style:Object.assign({backgroundColor:o},l),tabIndex:s})}):null;var d}function Fh(e){return{name:e,styles:{elements:{own:[{default:{text:{fontSize:28},border:{borderColor:{light:"#131317"},borderRadius:50,borderStyle:"solid",borderWidth:"2"},spacing:{padding:"4"}}}]}}}}const Gh=Fh("ChevronLeft"),Mh=Fh("ChevronRight");function Bh(i){const{schema:s,testId:l}=i,p=s.scrollGradientLength||36,f=Qa(),m=Object.values(f.images||{}),h=m.length>1?1:0,v=d((()=>h?[m.at(-1),...m,m.at(0)].filter((e=>void 0!==e)):m),[m,h]),[g,b]=c({left:p,right:p}),[I,E]=c(h),[S,C]=c(0),w=o(I),T=o(S),[x,O]=c(!1),[A,N]=c(0),[L,R]=c(!1),[_,D]=c(!1),k=Ma(),{styles:P,isDisabled:$,tabIndex:j}=St(k),F=o(null),G=o(null),M=o([]),B=o([]),U=o(null),V=y(),z=u((e=>{if(null===e)return;const{scrollLeft:t,scrollWidth:n,clientWidth:i}=e,a=n-i-t;b({left:t<p?t:p,right:a<p?a:p})}),[p]);function H(e,t,n="smooth",i=!1){if(!e||!t)return;if(i){const n=e.getBoundingClientRect(),i=t.getBoundingClientRect();if(n.left>=i.left&&n.right<=i.right)return}const a=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.scrollLeft+(a.left-r.left);t.scrollTo({left:o,behavior:n})}function W(){const e=F.current;e&&O(e.scrollWidth>e.clientWidth)}!function(){const e=o(null);r((()=>{const t=G.current;if(!t)return;let n=0,i=t.scrollLeft;const a=()=>{const r=t.scrollLeft;r===i?n++:(n=0,i=r),n>=5?(null!==e.current&&(cancelAnimationFrame(e.current),e.current=null),U.current&&U.current()):e.current=requestAnimationFrame(a)};return a(),()=>{null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)}}),[U.current])}(),r((()=>{J(h),Z(0),H(B.current[0]||null,F.current,"instant"),H(M.current[h]||null,G.current,"instant"),z(F.current),W()}),[f.catalogItemId,h,z]),r((()=>{const e=F.current;if(!e)return;function t(e){const t=F.current;t&&0!==e.deltaY&&(e.preventDefault(),t.scrollLeft+=e.deltaY)}const n=new ResizeObserver((()=>{W(),z(e),e.clientWidth!==A&&(H(M.current[w.current]||null,G.current,"instant"),H(B.current[T.current]||null,e,"instant"),N(e.clientWidth))}));return n.observe(e),e.addEventListener("wheel",t,{passive:!1}),()=>{n.disconnect(),e&&e.removeEventListener("wheel",t)}}),[]);const q={display:"flex",position:"absolute",top:"50%",transform:"translateY(-50%)",backgroundColor:"transparent",cursor:$?"not-allowed":"pointer"};function K(e){V({type:an,payload:{name:"SignalUserInteraction",action:e,context:"CatalogImageGallery",parentGuid:f.instanceGuid}})}function Y(e,t){if(L)return;K(t);const n=I+e;let i=n,a=S+e;0===n?(i=v.length-2,a=m.length-1):a===m.length&&(i=1,a=0),R(!0),H(M.current[n]||null,G.current,"smooth"),H(B.current[a]||null,F.current,"smooth",!0),Z(a),J(i),U.current=n===i?()=>{R(!1)}:()=>{H(M.current[i]||null,G.current,"instant"),R(!1)}}function J(e){E(e),w.current=e}function Z(e){C(e),T.current=e}return m.length>0?e(Br,{styles:s.styles,children:({classnames:i})=>t("div",{className:null==i?void 0:i.own,children:[t("div",{onMouseOver:()=>D(!0),onMouseOut:()=>D(!1),style:{position:"relative"},"data-testid":`${l}-main-image-container`,children:[_&&1===h&&t(n,{children:[e("button",{style:Object.assign(Object.assign({},q),{left:"2.5%"}),className:null==i?void 0:i.scrollIconButton,onClick:()=>Y(-1,"MainImageScrollIconLeftClick"),"data-testid":"main-image-scroll-left-button",children:e(ao,{schema:s.leftScrollIconTemplate||Gh})}),e("button",{style:Object.assign(Object.assign({},q),{right:"2.5%"}),className:null==i?void 0:i.scrollIconButton,onClick:()=>Y(1,"MainImageScrollIconRightClick"),"data-testid":"main-image-scroll-right-button",children:e(ao,{schema:s.rightScrollIconTemplate||Mh})})]}),e("div",{ref:G,style:{display:"-webkit-box",aspectRatio:"1 / 1",overflow:"hidden",scrollBehavior:"smooth"},children:a.Children.toArray(v.map(((t,n)=>e("div",{ref:e=>function(e,t){M.current[t]=e}(e,n),style:{aspectRatio:"1 / 1",marginRight:"2px"},children:e("img",{src:t.light,alt:t.alt,title:t.title,className:null==i?void 0:i.mainImage,loading:"lazy",style:Object.assign(Object.assign({},P),{height:"100%",width:"100%"}),"data-testid":`${l}-main-image-${n}`,"data-e2e":"CatalogImageGallery-mainImage"})},`${t.light}-${n}`))))})]}),e("div",{ref:F,onScroll:e=>z(e.currentTarget),className:null==i?void 0:i.thumbnailList,style:Object.assign(Object.assign({},P),{display:"flex",overflow:"auto",justifyContent:x?"flex-start":"center",scrollbarWidth:"none",scrollBehavior:"smooth",maskImage:`linear-gradient(to right, transparent 0, black ${g.left}px, black calc(100% - ${g.right}px), transparent 100%)`}),children:a.Children.toArray(m.map(((t,n)=>e("div",{style:{flexShrink:0,aspectRatio:"1 / 1",overflow:"hidden"},children:e("img",{ref:e=>function(e,t){B.current[t]=e}(e,n),src:t.light,alt:t.alt,title:t.title,className:n===S?null==i?void 0:i.selectedThumbnailImage:null==i?void 0:i.thumbnailImage,loading:"lazy",style:Object.assign(Object.assign({},P),{cursor:$?"not-allowed":"pointer",pointerEvents:"auto",aspectRatio:"1 / 1"}),"data-testid":`${l}-thumbnail-${n}`,"data-e2e":"CatalogImageGallery-thumbnail",tabIndex:j,onClick:()=>function(e){if(L)return;K("ThumbnailClick"),R(!0);const t=h?e+1:e;Z(e),J(t),H(M.current[t]||null,G.current,"smooth"),H(B.current[e]||null,F.current,"smooth",!0),U.current=()=>{R(!1)}}(n)})}))))})]})}):null}const Uh={size:48,radius:18,stroke:4,duration:.6,primaryColor:"#5F5F5F",secondaryColor:"#CFCFCF",primaryRotation:-50,secondaryRotation:45,arcFraction:1/3.5,mode:"segmented"},Vh={elements:{own:[{default:{container:{justifyContent:"center",alignItems:"center"},dimension:{width:{type:"percentage",value:100}}}}],spinner:[{default:{container:{justifyContent:"center",alignItems:"center"}}}]}};function zh(i){const{config:a}=i.schema,r=Object.assign(Object.assign({},Uh),a),o=r.radius,s=r.size/2,l="segmented"!==r.mode?(()=>{var e;const t=2*Math.PI*o,n=t*(null!==(e=r.arcFraction)&&void 0!==e?e:1/3.5);return{arc:n,gap:t-n}})():null,c={container:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%"},spinner:{display:"block",animation:"segmented"===r.mode?`spinner-rotate ${r.duration}s linear infinite`:`spin ${r.duration}s ease-in-out infinite`,transformOrigin:"segmented"===r.mode?`${s}px ${s}px`:"center center"}};return e(Br,{styles:i.schema.styles?Wt(Vh,i.schema.styles):Vh,children:({classnames:a})=>t("div",{className:null==a?void 0:a.own,"data-testid":i.testId,"data-e2e":"LoadingSpinner",style:c.container,children:[e("svg",{width:r.size,height:r.size,viewBox:`0 0 ${r.size} ${r.size}`,role:"img","aria-label":"Loading","data-testid":`${i.testId}-loading-spinner-svg`,children:"segmented"===r.mode?t("g",{className:null==a?void 0:a.spinner,style:c.spinner,"data-testid":`${i.testId}-segmented-svg-group`,children:[e("path",{d:`M ${s} ${s-o} A ${o} ${o} 0 0 1 ${s+o} ${s}`,fill:"none",stroke:r.primaryColor,strokeWidth:r.stroke,strokeLinecap:"butt"}),e("path",{d:`M ${s+o} ${s} A ${o} ${o} 0 0 1 ${s} ${s+o}`,fill:"none",stroke:r.primaryColor,strokeWidth:r.stroke,strokeLinecap:"butt"}),r.secondaryColor&&t(n,{children:[e("path",{d:`M ${s} ${s+o} A ${o} ${o} 0 0 1 ${s-o} ${s}`,fill:"none",stroke:r.secondaryColor,strokeWidth:r.stroke,strokeLinecap:"butt"}),e("path",{d:`M ${s-o} ${s} A ${o} ${o} 0 0 1 ${s} ${s-o}`,fill:"none",stroke:r.secondaryColor,strokeWidth:r.stroke,strokeLinecap:"butt"})]})]}):t("g",{className:null==a?void 0:a.spinner,style:c.spinner,"data-testid":`${i.testId}-dashed-svg-group`,children:[e("circle",{cx:s,cy:s,r:o,fill:"none",stroke:r.primaryColor,strokeWidth:r.stroke,strokeDasharray:`${null==l?void 0:l.arc} ${null==l?void 0:l.gap}`,strokeDashoffset:"0",strokeLinecap:"butt",transform:`rotate(${r.primaryRotation} ${s} ${s})`}),r.secondaryColor&&e("circle",{cx:s,cy:s,r:o,fill:"none",stroke:r.secondaryColor,strokeWidth:r.stroke,strokeDasharray:`${null==l?void 0:l.arc} ${null==l?void 0:l.gap}`,strokeDashoffset:"0",strokeLinecap:"butt",transform:`rotate(${r.secondaryRotation} ${s} ${s})`})]})}),e("style",{children:"\n /* Animation for dashed circle mode */\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n \n /* Animation for segmented mode (default) */\n @keyframes spinner-rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n "})]})})}const Hh=new Map;function Wh(t){const n=1e3*t.schema.durationInSeconds,i=t.schema.format||"M:SS",a=t.schema.key,s=t.testId,l=y(),[d,u]=c(n),p=o(null),f=o(null),h=m((e=>e.staticData));function v(){const e=Math.ceil(d/1e3);if("S"===i)return e;{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${String(n).padStart(2,"0")}`}}return r((()=>(f.current=requestAnimationFrame((function e(t){p.current||(p.current=function(e,t){const n=Hh.get(e);return void 0!==n?n:(Hh.set(e,t),t)}(a,t));const i=t-p.current,r=Math.max(n-i,0);u(r),r>0?f.current=requestAnimationFrame(e):(h&&l({type:an,payload:{name:"SignalDismissal",parentGuid:h.offer.creative.instanceGuid,dismissalMethod:"OfferLifecycleTimer"}}),l({type:rn,payload:{event:"Dismissed",dismissalReason:"Implicit"}}))})),()=>{f.current&&cancelAnimationFrame(f.current)})),[n,l,h,a]),e(Br,{styles:t.schema.styles,children:({classnames:n})=>t.isInline?e("span",{className:null==n?void 0:n.own,"data-testid":s||"","data-e2e":"OfferLifecycleTimer",children:v()}):e("p",{className:null==n?void 0:n.own,"data-testid":s||"","data-e2e":"OfferLifecycleTimer",children:v()})})}const qh={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s","span","h1","h2","h3","h4","h5","h6","div","b"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[],h3:[],div:[],b:[]},allowedSchemes:["http","https"]},Kh=new Map([["&","_;^;_"]]),Yh=new RegExp(`<a *(?=${qh.allowedAttributes.a.join("|")}|>)`,"g"),Jh=new RegExp('<a [^>]*href="([^"]+)"',"g"),Zh=new RegExp("(<br *?>)|(<br *?/>)","g"),Qh="<br/>";function Xh(t){const n=sa(),i=Ma(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Jh,((e,t)=>{const n=t.replaceAll("&",Kh.get("&"));return e.replace(t,n)})).replaceAll(Zh,Qh)}(e);return t===vt(t,qh)}(e))throw new jt("FAILED_SANITISING_HTML","Invalid HTML tags");return e.trim()?e:""}),[t.schema.value,n]),{tabIndex:r,styles:o,isDisabled:s}=St(i);return a?e(Br,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class = "${null==n?void 0:n.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0));return l=a,new RegExp("</(p|ul|ol)>").test(l)?e("div",{tabIndex:r,style:o,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Yh,`<a ${i.join(" ")}`)}}):t.isInline?e("span",{tabIndex:r,style:o,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Yh,`<a ${i.join(" ")}`)}}):e("p",{tabIndex:r,style:o,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Yh,`<a ${i.join(" ")}`)}});var l}}):null}function ev(n){var i,a;const{schema:s}=n,[l,d]=c(!1),[u,p]=c(!1),[f,m]=c(!1),[h,v]=c(!1),[g,b]=c(0),I=Ma(),E=y(),{tabIndex:S,isDisabled:C}=St(I),w=sa(),T=o(null),x=o(null),O=s.lineHeight*s.lineLimit,A=(null===(i=s.linearGradientConfig)||void 0===i?void 0:i.linearGradientHeight)||O-s.lineHeight,N=Qa();function L(){const e=s.linearGradientConfig;return e?{background:`linear-gradient(to bottom, ${e.linearColorStart} ${A}px, ${e.linearColorStop||"transparent"})`,backgroundClip:"text",color:"transparent"}:{}}function R(){const e={overflow:"hidden",textOverflow:"clip"};return h?Object.assign(Object.assign(Object.assign({},e),l?{}:L()),{transition:"height 0.3s ease",height:l?`${g}px`:`${O}px`}):!l&&f?Object.assign(Object.assign(Object.assign(Object.assign({},e),s.linearGradientConfig?{}:{display:"-webkit-box",WebkitLineClamp:s.lineLimit,lineClamp:s.lineLimit,WebkitBoxOrient:"vertical"}),L()),s.linearGradientConfig?{height:`${O}px`}:{}):e}return r((()=>{const e=T.current;if(!e)return;const t=()=>{m(e.scrollHeight>O),b(e.scrollHeight)};d(!1),p(!1),v(!1),m(!1),t();const n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect(),x.current&&cancelAnimationFrame(x.current)}}),[null===(a=T.current)||void 0===a?void 0:a.innerText,O]),e(Br,{styles:n.schema.styles,children:({classnames:i})=>t("div",{"aria-hidden":C,"data-testid":n.testId,"data-e2e":"ReadMoreTextContainer",className:null==i?void 0:i.own,children:[e("div",{ref:T,"data-testid":`${n.testId}-content-container`,className:null==i?void 0:i.contentContainer,style:R(),onTransitionEnd:()=>{x.current=requestAnimationFrame((()=>{v(!1),x.current=null})),p((e=>!e))},children:e(Xh,{schema:{value:s.value}})}),f&&e("button",{onClick:()=>{E({type:an,payload:{name:"SignalUserInteraction",action:l?"CollapseReadMoreText":"ExpandReadMoreText",context:"ReadMoreTextContainer",parentGuid:N.instanceGuid}}),v(!0),x.current=requestAnimationFrame((()=>{d((e=>!e)),x.current=null}))},tabIndex:S,className:null==i?void 0:i.expansionButton,style:{background:"none",cursor:"pointer"},children:w(u?s.collapseLabel:s.expandLabel)})]})})}function tv(t){const n=y(),i=t.schema,r=i.validatorTriggerConfig,o=t.schema.styles,s=Ma(),{styles:l,isDisabled:c}=St(s),d=Oh(),u=Qa();function p(){let e=!0;r&&(e=d.validateFieldKeys(r.validatorFieldKeys)),e?(n({type:an,payload:{name:"SignalUserInteraction",action:"OfferProgression",context:"CustomStateValidationTriggerButton",parentGuid:u.instanceGuid}}),n({type:on,payload:{key:i.customStateKey,value:i.customStateValue}})):n({type:an,payload:{name:"SignalUserInteraction",action:"ValidationTriggerFailed",context:"CustomStateValidationTriggerButton",parentGuid:u.instanceGuid}})}return e(Br,{styles:o,children:({classnames:n})=>{var i;return e("button",{className:null==n?void 0:n.own,onClick:p,"data-testid":t.testId,"data-e2e":"CustomStateValidationTriggerButton",disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:"",style:Object.assign({cursor:"pointer"},l),children:e(Di,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,Kt(i,t.testId)))))})})}})}function nv(t){const n=t.schema.emitInstantPurchaseDismissalRdnEvent,i=y(),r=m((e=>e.staticData)),o=m((e=>e.offerLifecycleEvent)),s=Ma(),{tabIndex:l,styles:c,isDisabled:d}=St(s);function u(){n?(i({type:an,payload:{name:"SignalInstantPurchaseDismissal",parentGuid:(null==r?void 0:r.offer.creative.instanceGuid)||""}}),i({type:rn,payload:{event:"Dismissed",dismissalReason:"Explicit"}})):i({type:rn,payload:o})}return e(Br,{styles:t.schema.styles,children:({classnames:n})=>e("button",{className:null==n?void 0:n.own,onClick:u,"data-testid":t.testId,"data-e2e":"DismissInstantPurchaseButton",disabled:d,"aria-disabled":d,"aria-label":t.schema.a11yLabel||"",tabIndex:l,style:Object.assign({cursor:"pointer"},c),children:e(Di,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,Kt(i,t.testId)))))})})})}function iv(n){var i,r;const{validatorFieldConfig:s,checkboxColor:l}=n.schema,u=null!==(i=n.schema.checkboxScale)&&void 0!==i?i:1,[p,f]=c(null!==(r=n.schema.value)&&void 0!==r&&r),m=o(p),h=Oh(),v=y(),g=Qa();function b(){return m.current}const I=d((()=>Nh({required:b},s)),[s]);function E(){return!s||h.getFieldKeyValidity(s.validationFieldKey)}function S(e,t){const n=[e];return E()||n.push(t),n.join(" ")}function C(e){return S(null==e?void 0:e.checkbox,null==e?void 0:e.checkboxError)}function w(e){return S(null==e?void 0:e.label,null==e?void 0:e.labelError)}function T(t,i){return e(Di,{children:e=>a.Children.toArray(t.map(((t,a)=>e(t,void 0,Kt(a,`${n.testId}-${i}`)))))})}return Ah(null==s?void 0:s.validationFieldKey,I),e(Br,{styles:n.schema.styles,children:({classnames:i})=>{return t("div",{style:{display:"flex",flexDirection:"column"},children:[t("div",{className:(a=i,S(null==a?void 0:a.own,null==a?void 0:a.checkboxContainerError)),style:{display:"flex",gap:"8px",flexDirection:"row"},children:[e("input",{"data-testid":n.testId,className:C(i),type:"checkbox",checked:p,onChange:e=>{return t=e.target.checked,m.current=t,s&&s.validateOnChange&&h.validateFieldKeys([s.validationFieldKey]),v({type:an,payload:{name:"SignalUserInteraction",action:t?"CheckboxChecked":"CheckboxUnchecked",context:"Checkbox",parentGuid:g.instanceGuid}}),void f(t);var t},style:Object.assign(Object.assign({},l?{accentColor:l}:{}),{transform:`scale(${u})`})}),n.schema.labelTemplate&&e("div",{className:w(i),children:T(n.schema.labelTemplate,"label")})]}),!E()&&n.schema.errorContentTemplate&&e("div",{className:null==i?void 0:i.errorContent,children:T(n.schema.errorContentTemplate,"error-content")})]});var a}})}function av(n){const{discountThreshold:i,styles:r,children:o}=n.schema,s=Qa(),l=function(){if(0===s.originalPrice)return 0;const e=100*(1-s.price/s.originalPrice);return Math.abs(e-Math.round(e))<1e-9?Math.round(e):Math.floor(e)}(),c=sa(),d=(u={label:String(l)},c({data:u},"discountLabel"));var u;return e(Br,{styles:r,children:({classnames:r})=>t("div",{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",justifyContent:"flex-start"},children:[s.price<s.originalPrice&&e("span",{className:null==r?void 0:r.originalPrice,children:s.originalPriceFormatted}),l>=i&&e(oa,{value:d,children:e(Di,{children:e=>a.Children.toArray(o.map(((t,i)=>e(t,void 0,Kt(i,n.testId)))))})})]})})}function rv(t){const{discountThreshold:n,children:i,styles:r}=t.schema,o=Qa(),s=function(){if(0===o.originalPrice)return 0;const e=100*(1-o.price/o.originalPrice);return Math.abs(e-Math.round(e))<1e-9?Math.round(e):Math.floor(e)}(),l=sa(),c=(d={label:String(s)},l({data:d},"discountLabel"));var d;return e(Br,{styles:r,children:({classnames:r})=>e("div",{className:null==r?void 0:r.own,children:s>=n&&e(oa,{value:c,children:e(Di,{children:e=>a.Children.toArray(i.map(((n,i)=>e(n,void 0,Kt(i,t.testId)))))})})})})}function ov(t,n){if("EscapeHatch"===t.type&&t.node.data){const i=JSON.parse(t.node.data);switch(null==i?void 0:i.type){case"TempCatalogDiscountCalloutTag":return e(av,{schema:i.node});case"CatalogDiscountCalloutTag":return e(rv,{schema:i.node});case"CatalogDropDown":return e(kh,{schema:i.node});case"Checkbox":return e(iv,{schema:i.node});case"CheckoutStateButtonTrigger":return e(Ph,{schema:i.node});case"ColorSwatch":return e(jh,{schema:i.node});case"CatalogImageGallery":return e(Bh,{schema:i.node});case"CustomStateValidationTriggerButton":return e(tv,{schema:i.node});case"DismissInstantPurchaseButton":return e(nv,{schema:i.node});case"LoadingSpinner":return e(zh,{schema:i.node});case"OfferLifecycleTimer":return e(Wh,{schema:i.node,isInline:null!=n&&n});case"ReadMoreTextContainer":return e(ev,{schema:i.node});default:return}}}function sv(t){const n=ki(),i=qa(),o=sa(),s=Ni(),l=Mi().catalogItems||[],c=m((e=>e.selectedItem))||l[0];return r((()=>{c&&s({type:an,payload:{name:"SignalImpression",parentGuid:null==c?void 0:c.instanceGuid}})}),[c,s]),c?e(Br,{styles:t.schema.styles,children:({classnames:r})=>{return e("div",{"data-testid":t.testId,"data-e2e":"CatalogCombinedCollection",className:null==r?void 0:r.own,style:{display:"flex",flexDirection:"column"},children:a.Children.toArray(e(xh,{children:e(Za,{context:c,children:e(Ha,{value:i(c),children:e(oa,{value:(s=c,o({data:s},"catalogItem")),children:n(t.schema.template,void 0,t.testId?`${t.testId}-child`:"")})})})}))});var s}}):null}function lv(t,n,i){if("RichText"===t.type)return e(Xh,{schema:t.node,testId:n,isInline:null!=i&&i})}const cv={BasicText:(e,t)=>Qr(e,t,!0),RichText:(e,t)=>lv(e,t,!0),StaticLink:(e,t)=>uo(e,t,!0),EscapeHatch:e=>ov(e,!0)};function dv(t){const n=ki();return e(Pi,{value:n,overrides:cv,children:e(Di,{children:n=>e(Br,{styles:t.schema.styles,children:({classnames:i})=>{var r;return e("div",{className:null==i?void 0:i.own,"data-testid":t.testId,"aria-label":null!==(r=t.schema.a11yLabel)&&void 0!==r?r:void 0,children:a.Children.toArray(t.schema.children.map(((e,i)=>n(e,void 0,Kt(i,t.testId)))))})}})})})}const uv={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(_h,{schema:t.node,testId:n})},CatalogCombinedCollection:function(t,n){if("CatalogCombinedCollection"===t.type)return e(sv,{schema:t.node,testId:n})},EscapeHatch:ov,RichText:lv,InlineContainer:function(t,n){if("InlineContainer"===t.type)return e(dv,{schema:t.node,testId:n})}};function pv(){const t=Fa(),n=ki(),i=m(Uy),a=sa()({state:i},"textContent");return e(Pi,{value:n,overrides:uv,children:e(oa,{value:a,children:e(Di,{children:e=>e(t)})})})}function fv(e){if(!e.copy)return null;const t=t=>e.copy[`ppu.${t}`]||"";return{shippingAttributes:{address1:t("shippingAddress1"),address2:t("shippingAddress2"),city:t("shippingCity"),state:t("shippingState"),country:t("shippingCountry"),postalCode:t("shippingZipcode")}}}const yv={staticData:$y,selectedItem:(e=null,t)=>t.type===bh?t.payload:e,dynamicData:jy,childLayouts:Py,fulfillmentDetails:(e=null,t)=>"INSTANT_PURCHASE/SET_FULFILLMENT_DETAILS"===t.type?t.payload:e,offerLifecycleEvent:(e=null,t)=>t.type===wh?t.payload:e};function mv(e={}){return Object.assign({staticData:null,selectedItem:null,dynamicData:null,childLayouts:{launched:{}},fulfillmentDetails:null,offerLifecycleEvent:null},e)}const hv="INVALID_RESPONSE_OBJECT",vv="MISSING_APP_STATE_IN_INSTANT_PURCHASE_MODULE",gv="MISSING_PAYMENT_REF_IN_INSTANT_PURCHASE_MODULE",bv="MISSING_STATIC_DATA_IN_INSTANT_PURCHASE_MODULE";function Iv(e,t){return st((n=>e.onEvent({name:Dl.PartnerMessage.CartItemInstantPurchaseResponse,source:"partner",callback:e=>{var i;"object"==typeof(i=e)&&null!==i&&"upsellItems"in i&&Array.isArray(i.upsellItems)&&i.upsellItems.every((e=>"object"==typeof e))&&"totalUpsellPrice"in i&&"number"==typeof i.totalUpsellPrice&&"currency"in i&&"string"==typeof i.currency&&"paid"in i&&"boolean"==typeof i.paid&&"success"in i&&"boolean"==typeof i.success?n(e):t({level:$t,code:"MALFORMED_INSTANT_PURCHASE_PARTNER_DATA",message:`Malformed data received from partner\n ${e}`})}})))}function*Ev(e,t){var n;try{for(;;){const t=yield We(e);t&&(yield qe({type:Sh,payload:t}))}}catch(e){yield ze(t,{level:$t,code:"INSTANT_PURCHASE_PARTNER_CHANNEL_ERROR",message:null!==(n=e.message)&&void 0!==n?n:"Unknown error in instant-purchase partner channel"})}finally{e.close()}}function*Sv(e,t){var n;try{for(;;){const t=yield We(e);if(t){yield qe({type:Ch,payload:t});break}}}catch(e){yield ze(t,{level:$t,code:"INSTANT_PURCHASE_WSDK_CHANNEL_ERROR",message:null!==(n=e.message)&&void 0!==n?n:"Unknown error in instant-purchase WSDK channel"})}finally{e.close()}}const Cv="Unknown failure reason",wv=6e4;function*Tv(){var e,t;const n=yield Ye((e=>e)),i=null!==(t=null===(e=null==n?void 0:n.staticData)||void 0===e?void 0:e.offer.catalogItems)&&void 0!==t?t:[];1===i.length&&i[0]&&(yield*_v(i[0]))}function*xv(e){const{catalogItem:t}=e.payload;yield*_v(t)}function*Ov(e,t,n){const{catalogItem:i,quantity:a}=n.payload,r=Ys(i,a);r?(yield qe({type:an,payload:{name:"SignalCartItemInstantPurchaseInitiated",parentGuid:i.instanceGuid,objectData:{catalogItemId:i.catalogItemId,quantity:a}}}),yield*$v("ProcessingState",1),n.payload.useInstantPurchaseExtension?yield*function*(e,t,n){const i=yield Ye((e=>e));if(!i)return yield ze(n,{level:$t,code:vv,message:"App state is not set within Redux store."}),void(yield*jv());if(!i.staticData)return yield ze(n,{level:$t,code:bv,message:"App state is not configured with static data."}),void(yield*jv());const a=i.staticData.offer.creative.copy["ppu.partnerPaymentReference"];if(!a)return yield ze(n,{level:$t,code:gv,message:"Partner payment reference is not set within creative copy."}),void(yield*jv());const r={upsellItems:[{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,quantity:e.quantity,unitPrice:e.unitPrice,totalPrice:e.totalPrice,currency:e.currency}],totalUpsellPrice:e.totalPrice,currency:e.currency,paymentDetails:{partnerPaymentReference:a}};i.fulfillmentDetails&&(r.fulfillmentDetails=i.fulfillmentDetails);yield Qe(Rv,t,n),yield qe({type:sn,payload:{name:"INITIATE_INSTANT_PURCHASE_EVENT",body:r}})}(r,e,t):yield*function*(e,t,n){yield Qe(Lv,t,n),yield qe({type:sn,payload:{name:"CART_ITEM_INSTANT_PURCHASE",body:{upsellItems:[e],totalUpsellPrice:e.totalPrice||0,currency:e.currency}}})}(r,e,t)):(yield ze(t,{level:$t,code:hv,message:`Unable to translate catalog item with ID ${i.catalogItemId} to cart item for instant purchase transaction.`}),n.payload.useInstantPurchaseExtension?yield*jv():(yield*$v("ProcessingState",0),yield qe({type:ln,payload:{key:"offerComplete",value:2}})))}function*Av(e,t){const n=yield Ye((e=>e.staticData));if(!n)return yield ze(e,{level:$t,code:bv,message:"App state is not configured with static data."}),void(yield*Pv("Error"));if(!n.offer.catalogItems)return yield ze(e,{level:$t,code:"MISSING_CATALOG_ITEMS",message:"No catalog items found within offer data."}),void(yield*Pv("Error"));const i={accountId:n.offer.accountId,catalogItems:n.offer.catalogItems};let a,r;t.payload.success?(a=Dv,r="Success"):(a=(e,n)=>function(e,t,n,i){return{name:"SignalCartItemInstantPurchaseFailure",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,failureReason:i.reason||Cv,providerId:n.accountId.toString()}}}(e,n,i,t.payload),r="Unspecified"),yield*function*(e,t,n,i){const a=[];for(const i of e.upsellItems){const e=kv(i,t.catalogItems);void 0===e?a.push(i):yield qe({type:an,payload:n(e,i.quantity)})}a.length>0&&(yield*function*(e,t){const n=JSON.stringify(e,null,"\t").replaceAll('"',"");yield ze(t,{level:$t,code:hv,message:`Unable to map cart items to catalog items in the instant purchase partner response: ${n}.`})}(a,i))}(t.payload,i,a,e),yield*Pv(r)}function*Nv(e){e.payload.response&&e.payload.response.success?yield*Fv(1,{event:"Completed",completionReason:"Success"}):yield*jv()}function*Lv(e,t){const n=Iv(e,t),{timeout:i}=yield tt({channel:ze(Ev,n,t),timeout:nt(wv)});i&&(yield ze(t,{level:$t,code:"INSTANT_PURCHASE_PARTNER_RESPONSE_TIMEOUT",message:"Instant-purchase partner response timed out after 60000ms"}),n.close(),yield*function*(e){yield*$v("ProcessingState",0),yield qe({type:rn,payload:{event:"Dismissed",dismissalReason:e}})}("Implicit"))}function*Rv(e,t){const n=function(e,t){return st((n=>e.onEvent(...["INSTANT_PURCHASE_SUCCESS","INSTANT_PURCHASE_FAILURE"].map((e=>({name:e,source:"partner",callback:e=>{var i;"object"==typeof(i=e)&&null!==i&&"timestamp"in i&&"string"==typeof i.timestamp&&"sessionId"in i&&"string"==typeof i.sessionId?n(e):t({level:$t,code:"MALFORMED_INSTANT_PURCHASE_WSDK_DATA",message:`Malformed data received from wsdk\n ${e}`})}}))))))}(e,t),{timeout:i}=yield tt({channel:ze(Sv,n,t),timeout:nt(wv)});i&&(yield ze(t,{level:$t,code:"INSTANT_PURCHASE_WSDK_RESPONSE_TIMEOUT",message:"Instant-purchase wsdk response timed out after 60000ms"}),n.close(),yield*Fv(2,{event:"Completed",completionReason:"Unspecified"}))}function*_v(e){var t,n,i;yield qe({type:bh,payload:e});const a={title:null!==(t=e.title)&&void 0!==t?t:"",description:null!==(n=e.description)&&void 0!==n?n:"",price:null!==(i=e.priceFormatted)&&void 0!==i?i:""};e.copy&&Object.entries(e.copy).forEach((([e,t])=>{a[`copy.${e}`]=t})),yield qe({type:ky,payload:{text:a}})}function Dv(e,t){return{name:"SignalCartItemInstantPurchase",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,initiatedBy:Dt.DCUI}}}function kv(e,t){return t.find((t=>t.catalogItemId===e.catalogItemId))}function*Pv(e){yield*$v("ProcessingState",0),yield qe({type:rn,payload:{event:"Completed",completionReason:e}})}function*$v(e,t){yield qe({type:on,payload:{key:e,value:t}})}function*jv(){yield*Fv(2,{event:"Completed",completionReason:"Error"})}function*Fv(e,t){yield qe({type:wh,payload:t}),yield*$v("ProcessingState",0),yield qe({type:ln,payload:{key:"offerComplete",value:e}})}const Gv=["Success","Unspecified","Error"],Mv=["Implicit","Explicit"];function*Bv(e,t){if("Checkout"!==t.payload.event)return;yield qe({type:ln,payload:{key:"checkout",value:Uv(t.payload),offerPositionIndex:t.payload.offerPositionIndex}});const n=t.payload.data;if(n){const i="Completed"===n.event;if("Completed"===n.event||"Dismissed"===n.event){(i?Gv.includes(n.reason):Mv.includes(n.reason))?yield qe({type:rn,payload:Object.assign(Object.assign({event:n.event},i?{completionReason:n.reason}:{dismissalReason:n.reason}),{offerPositionIndex:t.payload.offerPositionIndex})}):yield ze(e,{level:$t,code:"CHECKOUT_BUTTON_INVALID_OFFERLIFECYCLE",message:`Misconfigured offer lifecycle payload in handleCheckoutLifecycle: ${n}.`})}else yield ze(e,{level:$t,code:"CHECKOUT_BUTTON_UNKNOWN_EVENT",message:`Unknown event type in checkout lifecycle: ${JSON.stringify(n)}`})}}function Uv(e){var t;return null!==(t={ViewOffer:0,ViewTransactionDetails:1,EditPayment:2,EditShipping:3,EditPaymentAndShipping:4,CostBreakdown:5,Confirmation:6,CloseOffer:7}[e.targetStep])&&void 0!==t?t:0}function*Vv(e,t){yield Je([Xe(Tv),Ze(Ih,Bv.bind(null,t)),Ze(gh,xv),et(Eh,Ov.bind(null,e,t)),et(Sh,Av.bind(null,t)),et(Ch,Nv.bind(null)),Ze(fn,zy.bind(null,e,t)),Ze("*",Ks.bind(null,[Jt,fn],e))])}Object.assign(Object.assign({},vn),{INITIATE_INSTANT_PURCHASE:Eh,INSTANT_PURCHASE_PARTNER_RESPONSE:Sh,INSTANT_PURCHASE_WSDK_RESPONSE:Ch});const zv=(new Da).withAppFactory((function(n){var i;if(n.rootElement){const r=f(n.rootElement),o=mv({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion},fulfillmentDetails:fv(n.offerData.creative)}),s=function(e,t,n=mv()){const i=rt(),a=it({reducer:yv,devTools:{name:"Instant Purchase"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Vv,e,t),a}(n.gateway,n.logger,o);r.render(e(a.StrictMode,{children:t(Ya,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(es,{}),e(v,{store:s,children:e(Qo,{settings:n,dispatch:s.dispatch,children:e(pv,{})})})]})}))}}));var Hv=Object.freeze({__proto__:null,moduleConnectorBuilder:zv});const Wv=s(null),qv=({children:t})=>{var n;const[i,a]=c([]),[o,s]=c(0),[l,d]=c(0),u=sa();return r((()=>{let e=0;const t=i.length,n=setInterval((()=>{e=e+1>=t?0:e+1,s(e)}),l);return()=>clearInterval(n)}),[l,i]),e(Wv.Provider,{value:{images:i,activeIndex:o,duration:l,setImages:a,setActiveIndex:s,setDuration:d},children:e(oa,{value:u({data:{"image.title":null===(n=i[o])||void 0===n?void 0:n.title}},"creativeCopy"),children:t})})};function Kv({active:t,duration:n,containerStyles:i,indicatorStyles:a}){const s=o(null);return r((()=>{t&&s.current&&function(e,t){const n="animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype,i=[{width:0},{width:"100%"}];if(n){const n=e.animate(i,{duration:t,iterations:1});return()=>{n.finish()}}}(s.current,n)}),[t]),e("div",{style:Object.assign({position:"relative",height:"2px",width:"100%",backgroundColor:"#FFFFFF66"},i),children:e("span",{ref:s,style:Object.assign({animationIterationCount:"infinite",animationFillMode:"forwards",animationTimingFunction:"linear",position:"absolute",top:0,left:0,height:"100%",backgroundColor:"#FFF",width:t?"100%":0},a)})})}function Yv(e){const t=l(za),n=[];return e.forEach((e=>{const i=t(`${e}.src`,"copy"),a=t(`${e}.title`,"copy");if(void 0===i)return;const r=function(e={}){return Object.assign({light:"https://plus.unsplash.com/premium_photo-1675826774817-fe983ceb0475?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80",dark:"https://images.unsplash.com/photo-1679941734238-56628f5991f7?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80"},e)}({light:i,title:a});n.push(r)})),n}function Jv({schema:n,testId:i}){const o=JSON.parse(n.data),{styles:s,duration:c,imageKeys:d}=o,u=l(Wv),p=Yv(d);return r((()=>{null==u||u.setImages(p),null==u||u.setDuration(c)}),[]),t("div",{"data-testid":i,style:Object.assign({position:"relative",flexShrink:1,flexGrow:0,width:"100%"},s.elements.own),children:[a.Children.toArray(p.map(((t,n)=>e("img",{src:t.light,alt:t.title,style:Object.assign({opacity:n===(null==u?void 0:u.activeIndex)?1:0,position:0===n?"relative":"absolute",display:0===n?"block":"",top:0,width:"100%",height:"100%",maxHeight:"100%",maxWidth:"100%",transition:"opacity 300ms ease-in-out",objectFit:"contain"},s.elements.image)})))),e("div",{style:Object.assign({display:"flex",gap:"2px",width:"70%",position:"absolute",margin:"0 15%",bottom:"8px",zIndex:20,justifyContent:"center"},s.elements.indicatorWrapper),children:a.Children.toArray(p.map(((t,n)=>e(Kv,{duration:c,active:n===(null==u?void 0:u.activeIndex),containerStyles:s.elements.indicatorContainer,indicatorStyles:s.elements.indicator}))))})]})}const Zv={allowedTags:["em","strong","a","br","u","p","li","ul","ol","span"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[]},allowedSchemes:["http","https"]},Qv=new Map([["&","_;^;_"]]),Xv=new RegExp(`<a *(?=${Zv.allowedAttributes.a.join("|")}|>)`,"g"),eg=new RegExp("<span*>","g"),tg=new RegExp(`<a *(?:(?:${Zv.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),ng=new RegExp("(<br *?>)|(<br *?/>)","g"),ig="<br/>";function ag(t){const n=sa(),i=Ma(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(tg,((e,t)=>{const n=t.replaceAll("&",Qv.get("&"));return e.replace(t,n)})).replaceAll(ng,ig)}(e);return t===vt(t,Zv)}(e))throw new jt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:r,styles:o,isDisabled:s}=St(i);return a?e(Br,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class = "${null==n?void 0:n.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0));return l=a,new RegExp("</(p|ul|ol)>").test(l)?e("div",{tabIndex:r,style:o,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Xv,`<a ${i.join(" ")}`).replace(eg,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}}):e("p",{tabIndex:r,style:o,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Xv,`<a ${i.join(" ")}`).replace(eg,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}});var l}}):null}function rg({schema:t}){const n=ki(),i=Ci(er(),fa()),r=JSON.parse(t.data),[o]=ht({loop:!1,align:"start",slidesToScroll:2,containScroll:"trimSnaps"}),{styles:s,body:{tierItems:l}}=r;if(!l||!l.length)return;const c=l.length>2;return e("div",{className:i`
|
|
137
137
|
position: relative;
|
|
138
|
-
`,"data-testid":"ProductTierCarousel",children:e("div",Object.assign({},c&&{ref:
|
|
138
|
+
`,"data-testid":"ProductTierCarousel",children:e("div",Object.assign({},c&&{ref:o},{className:i`
|
|
139
139
|
width: 100%;
|
|
140
140
|
`,children:e("div",{className:i`
|
|
141
141
|
display: flex;
|
|
142
142
|
gap: 16px;
|
|
143
143
|
margin: 0 16px;
|
|
144
|
-
`,children:a.Children.toArray(l.map((t=>{var o,
|
|
144
|
+
`,children:a.Children.toArray(l.map((t=>{var r,o,l,d;return e("div",{className:i`
|
|
145
145
|
background-color: #f9fafb;
|
|
146
146
|
padding: 16px;
|
|
147
147
|
border-radius: 8px;
|
|
@@ -155,7 +155,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
155
155
|
${c?"flex: 0 0 40%":""};
|
|
156
156
|
|
|
157
157
|
&:first-of-type {
|
|
158
|
-
border-color: ${(null===(
|
|
158
|
+
border-color: ${(null===(r=null==s?void 0:s.primaryColor)||void 0===r?void 0:r.light)||"#eaecf0"};
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
div > p:first-of-type {
|
|
@@ -164,7 +164,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
164
164
|
|
|
165
165
|
&:not(:first-of-type) button {
|
|
166
166
|
background-color: #f9fafb;
|
|
167
|
-
color: ${(null===(
|
|
167
|
+
color: ${(null===(o=null==s?void 0:s.primaryColor)||void 0===o?void 0:o.light)||"#000"};
|
|
168
168
|
border-color: ${(null===(l=null==s?void 0:s.primaryColor)||void 0===l?void 0:l.light)||"#eaecf0"};
|
|
169
169
|
}
|
|
170
170
|
|
|
@@ -172,11 +172,11 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
172
172
|
background-color: ${(null===(d=null==s?void 0:s.primaryColor)||void 0===d?void 0:d.light)||"#F9FAFB"};
|
|
173
173
|
color: #f9fafb;
|
|
174
174
|
}
|
|
175
|
-
`,children:a.Children.toArray(t.map((e=>n(e))))})})))})}))})}const
|
|
176
|
-
${
|
|
177
|
-
`,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M14.2951 18L15.7051 16.59L11.1251 12L15.7051 7.41L14.2951 6L8.29508 12L14.2951 18Z",fill:"#ffffff"})})})}function lg({disabled:t,onClick:n}){const i=Ci(
|
|
178
|
-
${
|
|
179
|
-
`,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z",fill:"#ffffff"})})})}function cg(e){const t=l(za);return e.map((e=>({src:t(`${e}.link.src`,"copy"),open:t(`${e}.link.open`,"copy")})))}function dg(e){return{type:"StaticImage",node:{url:e,styles:{elements:{own:[{default:{border:{borderRadius:5,borderWidth:"0"},dimension:{width:{type:"percentage",value:100}}}}]}}}}}function ug(e,t){return{type:"CreativeResponse",node:{responseKey:"positive",styles:{elements:{own:[{default:{spacing:{padding:"0"},background:{backgroundColor:{light:"#F9FAFB"}},border:{borderWidth:"0"}}}]}},children:t?[dg(t)]:[]}}}function pg({schema:n}){var i,
|
|
175
|
+
`,children:a.Children.toArray(t.map((e=>n(e))))})})))})}))})}const og=(e,t)=>`\n position: absolute;\n top: 0;\n ${t?"right: 0;":"left: 0;"}\n bottom: 0;\n opacity: 0;\n z-index: 10;\n padding: 0 16px;\n transition: opacity 200ms ease-in-out;\n pointer-events: ${e?"none":"auto"};\n background: linear-gradient(${t?"":"-"}90deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.70) 100%);\n &:hover {\n opacity: ${e?0:1};\n }\n`;function sg({disabled:t,onClick:n}){const i=Ci(er(),fa());return e("button",{onClick:n,disabled:t,className:i`
|
|
176
|
+
${og(t)}
|
|
177
|
+
`,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M14.2951 18L15.7051 16.59L11.1251 12L15.7051 7.41L14.2951 6L8.29508 12L14.2951 18Z",fill:"#ffffff"})})})}function lg({disabled:t,onClick:n}){const i=Ci(er(),fa());return e("button",{onClick:n,disabled:t,className:i`
|
|
178
|
+
${og(t,!0)}
|
|
179
|
+
`,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z",fill:"#ffffff"})})})}function cg(e){const t=l(za);return e.map((e=>({src:t(`${e}.link.src`,"copy"),open:t(`${e}.link.open`,"copy")})))}function dg(e){return{type:"StaticImage",node:{url:e,styles:{elements:{own:[{default:{border:{borderRadius:5,borderWidth:"0"},dimension:{width:{type:"percentage",value:100}}}}]}}}}}function ug(e,t){return{type:"CreativeResponse",node:{responseKey:"positive",styles:{elements:{own:[{default:{spacing:{padding:"0"},background:{backgroundColor:{light:"#F9FAFB"}},border:{borderWidth:"0"}}}]}},children:t?[dg(t)]:[]}}}function pg({schema:n}){var i,o;const s=ki(),l=Ci(er(),fa()),d=function(e){try{return JSON.parse(e.data)}catch(e){return null}}(n),[u,p]=[Yv((null===(i=null==d?void 0:d.body)||void 0===i?void 0:i.imageKeys)||[]),cg((null===(o=null==d?void 0:d.body)||void 0===o?void 0:o.imageKeys)||[])],f=Mi(),y=f.creative.responseOptionsMap.positive,{carousel:m,styles:h}=(null==d?void 0:d.body)||{},v=(null==m?void 0:m.slidesToScroll)||3,g=(null==m?void 0:m.aspectRatio)||"1/1",b=!(null==m?void 0:m.disabled)&&Array.isArray(u)&&u.length>2,I=b?u:null==u?void 0:u.slice(0,v),[E,S]=ht({loop:!1,align:"start",slidesToScroll:v,containScroll:"trimSnaps"}),{prevBtnDisabled:C,nextBtnDisabled:w,onPrevButtonClick:T,onNextButtonClick:x}=function(e){const[t,n]=c(!0),[i,a]=c(!0);return r((()=>{if(!e)return;const t=()=>{n(!e.canScrollPrev()),a(!e.canScrollNext())};t(),e.on("reInit",t).on("select",t)}),[e]),{prevBtnDisabled:t,nextBtnDisabled:i,onPrevButtonClick:e?e.scrollPrev:void 0,onNextButtonClick:e?e.scrollNext:void 0}}(S);return d&&I&&I.length&&y?t("div",{"data-testid":"product-catalog-carousel",className:l`
|
|
180
180
|
position: relative;
|
|
181
181
|
margin: 8px 0;
|
|
182
182
|
${h||""}
|
|
@@ -187,9 +187,9 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
187
187
|
`,children:e("div",{className:l`
|
|
188
188
|
display: flex;
|
|
189
189
|
gap: 16px;
|
|
190
|
-
`,children:a.Children.toArray(I.map(((t,n)=>{var i,a;const
|
|
190
|
+
`,children:a.Children.toArray(I.map(((t,n)=>{var i,a;const r=Object.assign(Object.assign({},y),{url:null===(i=null==p?void 0:p[n])||void 0===i?void 0:i.src}),o=Object.assign(Object.assign({},f),{creative:Object.assign(Object.assign({},f.creative),{responseOptionsMap:Object.assign(Object.assign({},f.creative.responseOptionsMap),{positive:r})})});return e(Gi,{context:o,children:e("div",{"data-testid":"carousel-item",className:l`
|
|
191
191
|
min-width: 0;
|
|
192
192
|
overflow: hidden;
|
|
193
193
|
aspect-ratio: ${g};
|
|
194
194
|
${b?"flex: 0 0 33%;":`width: ${100/v}%;`}
|
|
195
|
-
`,children:s((null===(a=null==p?void 0:p[n])||void 0===a?void 0:a.src)?ug(p[n],t):dg(t))})})})))})})),b?e(lg,{onClick:x,disabled:w}):null]}):null}function fg({schema:i}){const a=JSON.parse(i.data),{styles:
|
|
195
|
+
`,children:s((null===(a=null==p?void 0:p[n])||void 0===a?void 0:a.src)?ug(p[n],t):dg(t))})})})))})})),b?e(lg,{onClick:x,disabled:w}):null]}):null}function fg({schema:i}){const a=JSON.parse(i.data),{styles:r,content:o,smallFontSize:s,largeFontSize:l}=a,c=sa();return t(n,{children:[e("style",{children:`\n @keyframes textAnimation {\n 0% { transform: scale(1); }\n 42% { transform: scale(1.2); } /* 800ms out of 1900ms cycle */\n 60% { transform: scale(1.2); }\n 100% { transform: scale(1); }\n }\n\n .animated-text {\n font-size: ${s}px;\n animation: textAnimation 1.9s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;\n }\n `}),e("p",{style:Object.assign({},r),className:"animated-text",children:c(o)})]})}const yg={EscapeHatch:function(t){if("EscapeHatch"===t.type&&t.node.data){const n=JSON.parse(t.node.data);switch(null==n?void 0:n.type){case"ImageCarousel":return e(Jv,{schema:t.node});case"RichText":return e(ag,{schema:n.node});case"ProductTierCarousel":return e(rg,{schema:t.node});case"ProductCatalogCarousel":return e(pg,{schema:t.node});case"TextAnimate":return e(fg,{schema:t.node});default:return}}}};function mg(){const t=Fa(),n=ki();return e(qv,{children:e(Pi,{value:n,overrides:yg,children:e(Di,{children:e=>e(t)})})})}const hg={staticData:$y,childLayouts:Py};function vg(e={}){return Object.assign({staticData:null,childLayouts:{launched:{}}},e)}function gg(e){let t,n,i;return st((a=>(Promise.race([e.onClose().then((()=>"CLOSED")),new Promise((n=>{t=e.onEvent("PLUGIN_TRANSITION_OFFER_SUCCESS").subscribe((()=>{n("SUCCESS")}))})),new Promise((t=>{n=e.onEvent("PLUGIN_TRANSITION_OFFER_CLOSE").subscribe((()=>{t("UNSPECIFIED")}))})),new Promise((e=>{i=e}))]).then((e=>{"END"!==e&&(a(e),a(lt))})),()=>{null==t||t.unsubscribe(),null==n||n.unsubscribe(),i("END")})))}function*bg(e,t){for(;;){switch(yield We(e)){case"CLOSED":t({type:rn,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":t({type:rn,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:rn,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*Ig(e,t,n){const i=Xt(n.payload)||en(n.payload)||Qt(n.payload)?n.payload:n.payload.responseOption;switch(i.action){case"Url":case"CaptureOnly":yield ze(e.globalDispatch.bind(e),n);break;case"Fulfillment":yield qe({type:sn,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield qe({type:sn,payload:{name:"POSITIVE_ENGAGEMENT"}})),yield*function*(e,t,n){if(Zt(n)){const{responseOption:i,fulfillment:a}=n;yield qe({type:an,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const r=yield ze(e.createChildPlugin.bind(e),a);if("object"==typeof r&&"onClose"in r){const t=yield ze(gg,r);if("object"==typeof t&&"take"in t)return void(yield ze(bg,t,e.globalDispatch.bind(e)))}yield ze(t,{level:Pt,code:"UNEXPECTED_NEXT_VALUE_IN_SAGA",message:'Received an unexpected input at a step in the saga "handleFullfillmentResponse" and could not continue.'})}else yield ze(t,{level:Pt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}(e,t,n.payload)}}function*Eg(e,t){yield Je([et(Jt,Ig.bind(null,e,t)),Ze(fn,zy.bind(null,e,t)),Ze("*",Ks.bind(null,[Jt,fn],e))])}Object.assign({},vn);const Sg=(new Da).withAppFactory((function(n){if(n.rootElement){const i=f(n.rootElement),r=vg({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),o=function(e,t,n=vg()){const i=rt(),a=it({reducer:hg,devTools:{name:"layouts-xp-sandbox"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Eg,e,t),a}(n.gateway,n.logger,r);i.render(e(a.StrictMode,{children:t(Ya,{info:{layoutType:"LayoutVariant",referralCreativeId:String(n.offerData.creative.referralCreativeId)||"N/A"},children:[e(es,{}),e(v,{store:o,children:e(Qo,{settings:n,dispatch:o.dispatch,children:e(mg,{})})})]})}))}}));var Cg=Object.freeze({__proto__:null,moduleConnectorBuilder:Sg});export{dy as BehaviorSubject,Sy as CatchSubscriber,Ly as DisplayPreset,Ry as ErrorLevel,py as FirstValueFromError,ly as Observable,uy as ReplaySubject,cy as Subject,ry as Subscription,Ey as addCatchToSubscriber,by as combineLatest,_y as dcuiUtils,xy as filter,Oy as first,fy as firstValueFrom,my as fromEvent,hy as fromPromise,ay as init,yy as lastValueFrom,Ay as map,vy as merge,oy as noop,sy as normaliseToObserver,gy as of,Ty as pipe,Ny as tap};
|