@rokt/dcui-orchestrator 0.0.2-rc.4 → 0.0.2-rc.6
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/extensions/minimized-bottomsheet/src/hooks/useScrollTrap.d.ts +2 -0
- package/dist/index.cjs +40 -30
- package/dist/index.js +43 -33
- package/dist/libraries/dcui-components/src/components/child-layout-handler/child-layout-handler.d.ts +5 -0
- package/dist/libraries/dcui-components/src/components/child-layout-handler/index.d.ts +1 -0
- package/dist/libraries/dcui-components/src/components/index.d.ts +1 -0
- package/dist/libraries/dcui-components/src/components/partner-event-button-trigger/factory.d.ts +2 -0
- package/dist/libraries/dcui-components/src/components/partner-event-button-trigger/index.d.ts +2 -0
- package/dist/libraries/dcui-components/src/components/partner-event-button-trigger/partner-event-button-trigger.d.ts +6 -0
- package/dist/libraries/dcui-components/src/contexts/index.d.ts +1 -1
- package/dist/libraries/dcui-components/src/contexts/schema-version-context.d.ts +2 -0
- package/dist/libraries/domain/src/behaviors/child-layout.d.ts +6 -0
- package/dist/libraries/domain/src/behaviors/global-actions.d.ts +3 -1
- package/dist/libraries/domain/src/behaviors/index.d.ts +1 -0
- package/dist/libraries/domain/src/behaviors/offer-engagement.d.ts +1 -0
- package/dist/libraries/domain/src/behaviors/send-partner.d.ts +14 -2
- package/dist/libraries/domain/src/models/layout/index.d.ts +1 -0
- package/dist/libraries/domain/src/models/layout/layout-child-config.d.ts +4 -0
- package/dist/libraries/domain/src/models/layout/layout-child-layout.d.ts +8 -0
- package/dist/libraries/domain/src/models/layout/layout-variant.d.ts +3 -1
- package/dist/libraries/domain/src/models/partner-event.d.ts +1 -1
- package/dist/libraries/domain/src/models/plugin/index.d.ts +1 -0
- package/dist/libraries/domain/src/models/plugin/plugin-child-layout-model.d.ts +6 -2
- package/dist/libraries/domain/src/models/plugin/plugin-creative-response-option.d.ts +4 -0
- package/dist/libraries/domain/src/models/plugin/plugin-layout-child.d.ts +9 -0
- package/dist/libraries/domain/src/models/plugin/plugin-layout-variant.d.ts +2 -0
- package/dist/libraries/domain/src/models/plugin/plugin-offer.d.ts +3 -0
- package/dist/libraries/domain/src/models/signals.d.ts +7 -1
- package/dist/libraries/layout-renderer-utils/src/actions/custom-states.d.ts +1 -0
- package/dist/libraries/module-connector/src/main.d.ts +3 -3
- package/dist/libraries/module-connector/src/models/module-attributes.d.ts +3 -1
- package/dist/libraries/module-connector/src/models/module-connector-builder.d.ts +5 -3
- package/dist/libraries/module-connector/src/models/module.d.ts +1 -1
- package/dist/libraries/orchestrator/src/actions/domain-states.d.ts +1 -0
- package/dist/libraries/orchestrator/src/actions/index.d.ts +2 -2
- package/dist/libraries/orchestrator/src/actions/offer-lifecycle.d.ts +1 -0
- package/dist/modules/add-to-cart/src/models/state/index.d.ts +0 -1
- package/dist/modules/add-to-cart/src/reducers/index.d.ts +5 -3
- package/dist/modules/add-to-cart/src/sagas/index.d.ts +1 -0
- package/dist/modules/instant-purchase/src/channels/channel.d.ts +3 -3
- package/dist/modules/instant-purchase/src/components/drop-down/drop-down.d.ts +7 -6
- package/dist/modules/instant-purchase/src/components/image-gallery/image-gallery.d.ts +28 -0
- package/dist/modules/instant-purchase/src/hooks/index.d.ts +1 -0
- package/dist/modules/instant-purchase/src/hooks/use-image-mapper.d.ts +2 -0
- package/dist/modules/instant-purchase/src/reducers/index.d.ts +4 -3
- package/dist/modules/instant-purchase/src/sagas/error-codes.d.ts +2 -0
- package/dist/modules/instant-purchase/src/sagas/index.d.ts +1 -0
- package/dist/modules/instant-purchase/src/sagas/instant-purchase/sagas.d.ts +8 -3
- package/dist/modules/layouts-xp-sandbox/src/reducers/index.d.ts +6 -4
- package/dist/modules/layouts-xp-sandbox/src/sagas/index.d.ts +1 -0
- package/dist/modules/standard-marketing/src/reducers/index.d.ts +8 -4
- package/dist/modules/standard-marketing/src/sagas/error-codes.d.ts +2 -0
- package/dist/modules/standard-marketing/src/sagas/index.d.ts +1 -0
- package/dist/modules/standard-marketing/src/sagas/offer-engagement/channels.d.ts +8 -1
- package/dist/modules/standard-marketing/src/sagas/offer-engagement/sagas.d.ts +4 -3
- package/node_modules/@rokt/plugin/interface/child-plugin-factory.d.ts +1 -0
- package/node_modules/@rokt/plugin/interface/rdn.d.ts +1 -0
- package/node_modules/@rokt/plugin/package.json +1 -1
- package/package.json +2 -2
- package/dist/libraries/dcui-components/src/contexts/when-visibility-context.d.ts +0 -6
- package/dist/modules/add-to-cart/src/models/state/static-data.d.ts +0 -5
- package/dist/modules/add-to-cart/src/reducers/static-data/index.d.ts +0 -1
- package/dist/modules/add-to-cart/src/reducers/static-data/reducer.d.ts +0 -4
- package/dist/modules/instant-purchase/src/models/index.d.ts +0 -1
- package/dist/modules/instant-purchase/src/models/state/index.d.ts +0 -1
- package/dist/modules/instant-purchase/src/models/state/static-data.d.ts +0 -5
- package/dist/modules/instant-purchase/src/reducers/static-data/index.d.ts +0 -1
- package/dist/modules/instant-purchase/src/reducers/static-data/reducer.d.ts +0 -4
- package/dist/modules/layouts-xp-sandbox/src/reducers/mock/index.d.ts +0 -1
- package/dist/modules/layouts-xp-sandbox/src/reducers/mock/reducer.d.ts +0 -9
- package/dist/modules/standard-marketing/src/reducers/mock/index.d.ts +0 -1
- package/dist/modules/standard-marketing/src/reducers/mock/reducer.d.ts +0 -9
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 O,pathEq as w,cond as A,type as C,mergeDeepWith as T,T as x,flip as N,unary as _,identity as R,zipWith as D,concat as L,slice as k,is as P,equals as j,always as $,compose as G,__ as F,prop as M,propOr as B,memoizeWith as U,not as V,isEmpty as z,where as H,mapObjIndexed as W,forEachObjIndexed as q,pipe as J,split as K,replace as Y,reduce as Z,reduced as Q,partial as X,anyPass as ee,all as te,flatten as ne,map as ie,values as ae,ifElse as oe,isNil as re,curry as se,toPairs as le,keys as ce,lt as de,gt as ue,either as pe,lensPath as fe,over as ye,view as me,add as he,lte as ve,pathOr as ge,zip as be,evolve as Ie,append as Ee,mergeWith as Se,mergeAll as Oe,mergeRight as we,lensProp as Ae,defaultTo as Ce,sortBy as Te,findIndex as xe,reject as Ne,whereEq as _e,uniqBy as Re,find as De,has as Le,omit as ke,assoc as Pe,gte as je,clone as $e,F as Ge,isNotEmpty as Fe}from"ramda";import{css as Me,keyframes as Be,cx as Ue}from"@emotion/css";import{call as Ve,actionChannel as ze,take as He,put as We,cancelled as qe,select as Je,all as Ke,takeEvery as Ye,fork as Ze,takeLatest as Qe,spawn as Xe,cancel 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";function bt(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),O(S(a)),w("fixed",n)]),(e=>b(a,g(i,e),e)))),e):e}function It(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function Et(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function St(){return"ontouchstart"in document.documentElement}function Ot(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function wt(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function At(e){return wt(e)&&"External"===e.action}const Ct={pluginId:"shared",pageInstanceGuid:"N/A"};var Tt;!function(e){e.DCUI="DCUI",e.Partner="partner"}(Tt||(Tt={}));const xt=["SignalCartItemQuantitySelected"],Nt="ERROR",_t="WARNING";class Rt extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const Dt=["V2_CART_ITEM_UPDATED","CART_ITEM_INSTANT_PURCHASE","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];const Lt=(e,t)=>L(e,k(e.length,t.length,t)),kt=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?Lt(t,e):t,i=t.length>e.length?Lt(e,t):e;return D(Ft,i,n)}return t},Pt=e=>null==e,jt=e=>!Pt(e),$t=(e,t)=>Pt(t)?e:t,Gt=(e,t)=>{throw new Rt("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function Ft(e,t){return A([[(e,t)=>C(e)!==C(t)&&jt(e)&&jt(t),Gt],[(e,t)=>Pt(e)||Pt(t),$t],[(e,t)=>"Object"===C(e),T(Ft)],[(e,t)=>"Array"===C(e),kt],[x,N(_(R))]])(e,t)}function Mt(e,t){return Ft(e,t)}function Bt(e=0){return`breakpoint-${e}px`}function Ut(e,t){return t?`${t}-child${e}`:void 0}const Vt="GLOBAL/RAISE_METRIC",zt="GLOBAL/OFFER_ENGAGEMENT";function Ht(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&function(e){return wt(e)&&"Fulfillment"===e.action}(e.responseOption)&&"fulfillment"in e&&Ot(e.fulfillment)}function Wt(e){return At(e)}function qt(e){return function(e){return wt(e)&&"Url"===e.action}(e)}function Jt(e){return function(e){return wt(e)&&"CaptureOnly"===e.action}(e)}const Kt="GLOBAL/RAISE_SIGNAL",Yt="GLOBAL/OFFER_LIFECYCLE",Zt="GLOBAL/SET_CUSTOM_STATE",Qt="GLOBAL/SEND_PARTNER",Xt="GLOBAL/PREPARE_SIGNAL",en="GLOBAL/OPEN_LINK",tn="GLOBAL/SET_PARTNER_VALIDATION_STATUS",nn="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",an={RAISE_METRIC:Vt,PREPARE_SIGNAL:Xt,OFFER_ENGAGEMENT:zt,RAISE_SIGNAL:Kt,OFFER_LIFECYCLE:Yt,SEND_PARTNER:Qt,SET_CUSTOM_STATE:Zt,SET_DOMAIN_STATE:"GLOBAL/SET_DOMAIN_STATE",OPEN_LINK:en,SET_PARTNER_VALIDATION_STATUS:tn,SET_GLOBAL_OFFER_DATA_CART:nn},on="data-open-in-app",rn="data-click-signal-context";function sn(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(rn);if(a&&t({type:Kt,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),n){e.preventDefault();let a="newTab";i.hasAttribute(on)&&(a="inApp"),t({type:en,payload:{url:n,urlBehaviour:a}})}}}o((()=>null!==e?(e.addEventListener("click",n),()=>{e.removeEventListener("click",n)}):()=>{}),[e])}function ln(){const e=r(null);return o((()=>{const t=t=>{"Tab"===t.key&&cn(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const cn=(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()},dn="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function un(e,t){return t?"false"!==dn.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${Bt(e)} ${t.trim()}`:`#app-container.${Bt(e)} & {${t}}`:"";var n}const pn={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"};function fn(e){return function(e){return Object.keys(pn).indexOf(e)>-1}(e)?pn[e]:""}const yn={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 mn(e,t){if(!yn[e]||!yn[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return yn[e][t]}function hn(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function vn(...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 gn(e,t){return`${e}:${t};`}function bn(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class In extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function En(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 In(n,JSON.stringify(t));return!0}function Sn(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function On(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 wn(e){if(null==e||""===e)return"value must not be omitted"}function An(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 Cn(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 Tn(e){if(null!=e&&""!==e)return"value must not be specified"}function xn(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 Nn(...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||Sn(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function _n(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 Rn(e){if("string"!=typeof e)return"value must be a string"}const Dn=P(Object);function Ln(e){const t=Object.entries(e);return n=>Dn(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function kn(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function Pn(e,t,n){return En(Sn,n)?gn(mn(e,t),`${n}`):""}function jn(e){return(t,n,i)=>En(On(Object.keys(e)),i)?gn(mn(t,n),`${e[i]}`):""}function $n(e){return En(wn,e)?hn({light:t(Cn,!1),dark:t(_n(Tn,Cn),!0)},vn("\n "))(e):"";function t(e,t){return n=>{if(En(e,n)&&n){const e=gn("background-image",`url("${n}")`);return t?bn(e):e}return""}}}function Gn(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),En(_n(Tn,On(Object.keys(t))),e)&&e?gn("background-size",t[e]):""}const Fn=A([[j("top-left"),$("top left")],[j("top-right"),$("top right")],[j("bottom-left"),$("bottom left")],[j("bottom-right"),$("bottom right")],[x,R]]);function Mn(e){const t="string"==typeof e?e.toLowerCase():e;return En(_n(Tn,On(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?gn("background-position",Fn(t)):""}function Bn(e,t,n){return En(_n(Sn,Nn(2,3,4)),n)?gn(mn(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function Un(e){return(t,n,i)=>En(xn({fit:On(e),percentage:Sn,fixed:Sn}),i)?gn(mn(t,n),function(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]}}(i)):""}const Vn=Ln({light:An,dark:_n(Tn,An)});function zn(e,t,n){return i=>{if(i){const a=gn(mn(e,t),Wn(String(i)));return n?bn(a):a}return""}}function Hn(e,t,n){return En(Vn,n)?hn({light:zn(e,t,!1),dark:zn(e,t,!0)},vn("\n "))(n):""}function Wn(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 qn=Ln({offsetX:_n(Tn,Sn),offsetY:_n(Tn,Sn),blurRadius:_n(Tn,Sn),spreadRadius:_n(Tn,Sn),color:Vn}),Jn=e=>t=>null!=t?String(t):e,Kn=G(L(F,"px"),Jn("0")),Yn=e=>t=>"string"==typeof t?e(t):t,Zn=G(Yn(L(F,"px")),Jn(void 0)),Qn=G(Yn(Wn),M("dark"));function Xn(e,t,n){return gn(e,hn({offsetX:Kn,offsetY:Kn,blurRadius:t.spreadRadius?Kn:Zn,spreadRadius:Zn,color:n},vn(" "))(t))}const ei={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},ti={container:{justifyContent:jn(ei),alignItems:jn(ei),shadow:function(e,t,n){var i;if(En(qn,n)){const a=mn(e,t);return vn("\n")(Xn(a,n,G(Wn,B("#80000000","light"))),(null===(i=n.color)||void 0===i?void 0:i.dark)?bn(Xn(a,n,Qn)):"")}return""},gap:Bn,overflow:jn({hidden:"hidden",visible:"visible"}),blur:function(e,t,n){return En(kn,n)?gn(mn(e,t),`blur(${n.toString()}px)`):""},opacity:Pn},text:{textColor:Hn,fontSize:Bn,fontFamily:function(e,t,n){return En(Rn,n)?gn(mn(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:jn({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:jn({normal:"normal",italic:"italic"}),lineHeight:Bn,lineLimit:function(e,t,n){return En(Sn,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:Bn,baselineTextAlign:jn({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:jn({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:jn({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:jn({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:Hn,backgroundImage:function(e,t,n){return En(wn,n)?hn({url:$n,position:Mn,scale:Gn},vn)(n):""}},dimension:{width:Un(["wrap-content","fit-width"]),maxWidth:Bn,minWidth:Bn,height:Un(["wrap-content","fit-height"]),maxHeight:Bn,minHeight:Bn,rotateZ:(ni="Z",(e,t,n)=>{const i=`rotate${ni}`;return En(Sn,n)?gn(mn(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:jn(ei),weight:Pn,order:Pn},spacing:{margin:Bn,padding:Bn,offset:function(e,t,n){return En(Nn(2),n)?`transform:translate(${n.split(" ").join("px, ")}px)`:""}},border:{borderColor:Hn,borderRadius:Bn,borderWidth:Bn,borderStyle:jn({solid:"solid",dashed:"dashed"})}};var ni;function ii(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!ti[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=ti[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 ai="FAILED_TEMPLATING_DATA",oi=new Map;function ri(e){return String.fromCharCode(97+e)}function si(e,t,n){const i=`${e||Ct.pluginId}-${void 0!==t?String(t):"outer"}`,a=oi.get(i);if(a&&a.sheet.container.isConnected)return a.css;const o=function(e,t){const n={key:void 0!==e?`inner-css-${ri(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),gt(n)}(t,n);return oi.set(i,o),o.css}const li="%%%OWN_CLASS_REF%%%",ci=U(((e,t,n,i)=>`${String(e)}-${t}-${n}`),di);function di(e,t,n,i){const a=si(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]:ui(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(li,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 ui(e,t,n,i,a){return e.map(function(e,t,n){return i=>Object.entries(i).map((([i,a])=>{const o=a?ii(a):"";switch(!0){case"default"===i:return o?`\n${o}\n`:"";case Boolean(e):return`\n .${e}${fn(i)} & {\n${o}\n}\n`;case t&&"own"!==n:return`\n .${li}${fn(i)} & {\n${o}\n}\n`;default:return`\n &${fn(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:`${un(i,t)}\n`):e}),"")}const pi=s($(void 0)),fi=()=>l(pi),yi=s(null);function mi(e,t){var n;const i=l(yi);return i&&null!==(n=t(i))&&void 0!==n?n:e}const hi=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")})),vi=hi.Consumer,gi=()=>l(hi),bi=e=>a.createElement(hi.Provider,{value:(t,n,i)=>e.value(t,null!=n?n:e.overrides,i)},e.children),Ii=s(null),Ei=()=>l(Ii),Si=s({get(){throw Error("Offer context has not been set")}}),Oi=e=>a.createElement(Si.Provider,{value:{get:()=>e.context}},e.children),wi=()=>l(Si).get(),Ai=()=>{try{return l(Si).get().creative.copy}catch(e){return}},Ci=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Ti=G(V,z),xi=H({url:Ti,title:Ti});function Ni(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(Ri(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){_i(t,e,"openLinks",1,2);const i=Di(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=Li(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(Ci,((e,t)=>`<a ${on} ${a?`${rn}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){_i(t,e,"sliceText",2,2);const i=Di(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=Di(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.*>).*(?=</a>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,t))):e.slice(0,t)}(n,a);throw Error(Ri(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);default:throw new Error(Ri(e,`Unknown Meta Attribute '${t}'.`))}}(e,i,o,t)}),n)}function _i(e,t,n,i,a){const o=new Error(Ri(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 Ri(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function Di(e,t,n,i,a){const o=Li(e,n,i);if(null!==o)return o;throw Error(Ri(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function Li(e,t,n){return n(e[t])}const ki="DATA",Pi="STATE",ji=new RegExp(`^(${ki}|${Pi})`),$i=new RegExp(`^${Pi}`),Gi=new RegExp(`%\\^(?:${ki}|${Pi})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*(?:\\:[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,]*\\])*(?:\\|.*?)?\\^%`,"g"),Fi=Symbol("invalid");function Mi(e,t="creativeCopy"){const n=Bi({data:e},t);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Bi(t,n,this.dataMap)});let i=!1;const a=t,o=J(k(2,-2),K("|"),(e=>{const t=Z(((e,t)=>{let n;if(ji.test(t)){if(!this.dataMap.has(t)&&$i.test(t))throw new Rt(ai,`Invalid use of STATE template key in a context it does not exist: ${t}`);const i=K(":",t);if(i[0]){if(n=this.dataMap.get(i[0]),n&&n===Fi)throw new Rt(ai,`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=Ni(i[0],i.slice(1),n)}catch(e){throw new Rt(ai,`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?Q({provided:!0,value:n}):e}return Q({provided:!0,value:t})}),{provided:!1,value:""},e);return t.provided||(i=!0),t.value})),r=Y(Gi,o,a);return!1===i?r:""}.bind({dataMap:n})}function Bi(e,t,n){const i=new Map(n);return"data"in e&&a(e.data,`${ki}${t?"."+t:""}`),"state"in e&&a(e.state,`${Pi}${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,Fi),e&&"object"==typeof e&&q(((e,n)=>a(e,`${t}.${n}`)),e)}}const Ui=s(Mi({})),Vi=Ui.Consumer,zi=Ui.Provider,Hi=()=>l(Ui),Wi=s(null),qi=Wi.Provider,Ji=s("OUTER"),Ki=()=>"VARIANT"===l(Ji),Yi=s(void 0),Zi=()=>l(Yi);var Qi,Xi,ea,ta,na,ia,aa=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())}))},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},ra=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 sa{constructor(e,t,n,i,a){Qi.set(this,void 0),Xi.set(this,void 0),ea.set(this,new Set),ta.set(this,void 0),na.set(this,void 0),ia.set(this,void 0),oa(this,Qi,X(e.subscribe.bind(e),[n]),"f"),oa(this,Xi,X(e.dispatch.bind(e),[n]),"f"),oa(this,ta,t,"f"),oa(this,na,i,"f"),oa(this,ia,a,"f")}onGlobalStateChange(e){const t=ra(this,Qi,"f").call(this,e),n=()=>{t(),ra(this,ea,"f").delete(n)};return ra(this,ea,"f").add(n),n}onInteractivityChange(e){return ra(this,na,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=ra(this,ia,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),ra(this,ea,"f").delete(n)};return ra(this,ea,"f").add(n),n}globalDispatch(e){ra(this,Xi,"f").call(this,e)}dispose(){ra(this,ea,"f").forEach((e=>e())),oa(this,ea,new Set,"f"),ra(this,na,"f").clear()}createChildPlugin(e){return ra(this,ta,"f").call(this,e)}}Qi=new WeakMap,Xi=new WeakMap,ea=new WeakMap,ta=new WeakMap,na=new WeakMap,ia=new WeakMap;class la{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>aa(this,void 0,void 0,(function*(){})),onClose:()=>aa(this,void 0,void 0,(function*(){})),putConfig:()=>aa(this,void 0,void 0,(function*(){})),send:()=>aa(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var ca,da,ua=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},pa=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 fa{constructor(e){ca.set(this,void 0),da.set(this,new Set),ua(this,ca,e,"f")}subscribe(e){return pa(this,da,"f").add(e),!0===e(pa(this,ca,"f"))&&pa(this,da,"f").delete(e),()=>{pa(this,da,"f").delete(e)}}publish(e){ua(this,ca,e,"f"),pa(this,da,"f").forEach((e=>{!0===e(pa(this,ca,"f"))&&pa(this,da,"f").delete(e)}))}clear(){pa(this,da,"f").clear()}}ca=new WeakMap,da=new WeakMap;var ya=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)},ma=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 ha="breakpoint-0px";class va{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;const s=this.appFactory,l=this.logger,c=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new la;return r=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint"]}attributeChangedCallback(e,a,r){if(r!==a)switch(e){case"visible":ya(this,n,"f").call(this,"true"===r);break;case"interactivity":"ENABLED"!==r&&"DISABLED"!==r||ya(this,i,"f").call(this,r);break;case"active-breakpoint":ya(this,t,"m",o).call(this,r,a)}}makeInteractivityUpdateHandler(e){ma(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,t,i){const a="true"===this.getAttribute("visible"),o=this.getAttribute("slotInstanceGuid");ma(this,n,(a=>{a&&(ma(this,n,(()=>null),"f"),0===e&&i.globalDispatch({type:Yt,payload:{event:"Interactive"}}),t&&i.globalDispatch({type:Kt,payload:{name:"SignalImpression",parentGuid:t}}),o&&i.globalDispatch({type:Kt,payload:{name:"SignalImpression",parentGuid:o}}))}),"f"),ya(this,n,"f").call(this,a)}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&d(`Offer position attribute (${e}) is invalid`),t}getJSONAttr(e){const t=this.getAttribute(e);try{return JSON.parse(null!=t?t:"{}")}catch(n){d(`Invalid JSON attribute ${e}: ${t}`)}}constructor(){super(),t.add(this),n.set(this,(()=>null)),i.set(this,(()=>null)),a.set(this,void 0);const e=this.attachShadow({mode:"open"});ma(this,a,document.createElement("div"),"f"),ya(this,a,"f").id="app-container",ya(this,a,"f").classList.add("default"),e.appendChild(ya(this,a,"f"))}connectedCallback(){var e,t;const n=this.getAttribute("container"),i=this.getAttribute("plugin-id");ya(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===n?"column":"row"));const o=this.getOfferPositionAttr(),r=this.getJSONAttr("layoutSchema"),u=this.getJSONAttr("offerData"),p=new fa("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED");s||d("Cannot create app without factory. Please build the connector withAppFactory.");const f=c({offerPositionIndex:o,creativeInstanceGuid:null===(e=null==u?void 0:u.creative)||void 0===e?void 0:e.instanceGuid},p);this.makeInteractivityUpdateHandler(p),s({rootElement:ya(this,a,"f"),gateway:f,logger:l,offerPositionIndex:o,offerData:u,layoutSchema:r,pluginId:i||Ct.pluginId}),this.makeVisbilityUpdateHandler(o,null===(t=null==u?void 0:u.creative)||void 0===t?void 0:t.instanceGuid,f)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,t=new WeakSet,o=function(e,t){ya(this,a,"f").classList.remove(t||ha),ya(this,a,"f").classList.add(e||ha)},r;function d(e){throw l({level:Nt,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const ga=s({get:()=>new la}),ba=e=>a.createElement(ga.Provider,{value:{get:()=>e.context}},e.children);const Ia=s({get(){throw Error("Layout Schema context has not been set")}}),Ea=e=>a.createElement(Ia.Provider,{value:{get:()=>e.context}},e.children),Sa=()=>l(Ia).get(),Oa=s("ENABLED"),wa=()=>l(Oa);function Aa(e){const t=Ta(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Ta(t,this.dataMap)});if(!n)throw new Rt("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");return g([n,t],this.dataMap)}.bind({dataMap:t})}const Ca={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function Ta(e,t=Ca){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 xa=s(Aa({}));xa.Consumer;const Na=xa.Provider,_a=()=>l(xa),Ra=s({});function Da({info:e,children:t}){const n=l(Ra);return a.createElement(Ra.Provider,{value:Object.assign(Object.assign({},n),e)},t)}const La=s({get(){throw Error("Catalog Item context has not been set")}}),ka=e=>a.createElement(La.Provider,{value:{get:()=>e.context}},e.children),Pa=()=>l(La).get(),ja=s(""),$a=()=>l(ja),Ga=s("VISIBLE"),Fa=()=>l(Ga);function Ma(){return"VISIBLE"===Fa()?void 0:{display:"none"}}const Ba=G(ee([z,te(z)]),ne,ie(ae),ie(oe(re,$({}),R)),ae,B({},"value")),Ua=G(z,M("predicates"));function Va(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const za=se(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(ii(i)),transitionBaseClassname:e(Va(t,(a=i,le(a).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?ce(n).map((e=>mn(t,e))):[]})))))};var a})),Ha=ee([Ba,Ua]);const Wa={is:j,"is-not":G(V,j),"is-below":de,"is-above":ue};function qa(e,t){return e.includes(t)}const Ja={is:j,"is-not":G(V,j),exists:qa,"not-exists":G(V,qa)},Ka={exists:G(V,pe(re,z)),"not-exists":pe(re,z)},Ya={"is-true":j(!0),"is-false":j(!1)},Za={is:j,"is-not":G(V,j)};function Qa(e){return(t,n)=>n[e]}const Xa=A([[(e,t)=>j("Breakpoint",e),Qa("activeBreakpoint")],[(e,t)=>j("Progression",e),Qa("progressionIndex")],[(e,t)=>j("Position",e),Qa("positionIndex")]]);function eo(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const to=A([[j("Breakpoint"),(e,t,n)=>{const i=fe(["breakpoints",t]);return J(ye(i,Number),me(i))(n)}],[j("Progression"),(e,t,n)=>A([[ue(0),he(n.totalGroups)],[ve(0),R]])(Number(t))],[j("Position"),(e,t,n)=>A([[ue(0),he(n.totalOffers)],[ve(0),R]])(Number(t))]]),no=G(V,isNaN);function io(e,t){return e.map((e=>{var n,i,a;switch(e.type){case"StaticString":return(0,Za[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,Ka[e.predicate.condition])(eo(t,e.predicate.value));case"StaticBoolean":return(0,Ya[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,Wa[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,Wa[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,Ja[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,Wa[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,Wa[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=Wa[e.predicate.condition],i=null!==(a=Xa(e.type,t))&&void 0!==a?a:NaN,o=to(e.type,e.predicate.value,t);return!!no(i)&&n(i,o)}}}))}function ao(e){return ge(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const oo={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{}};function ro(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:${eo(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:${Xa(e.type,t)}:${t.totalGroups}`}}(e,t),o=n.current.get(a);return Ie(so(o)?{cached:Ee(o)}:{uncached:Ee({key:a,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),s=io(r.map((({predicate:e})=>e)),n);return be(r,s).forEach((([{key:t},n])=>{e.current.set(t,n)})),o.concat(s)}const so=P(Boolean);const lo=se(((e,t,n)=>{var i,a,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:ao(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}})),co=fe(["predicate","content","input"]),uo=fe(["predicate","content","value"]);function po(e,t){const n=ye(co,(t=>t?e(t):"")),i=ye(uo,(t=>"string"==typeof t?e(t):t)),a=G(n,i);return t.map((e=>"Placeholder"===e.type?"TextValue"===e.predicate.type?a(e):n(e):e))}const fo=te(j(!0));function yo(e){const t=Ki(),n=Zi(),i=r(new Map),a=Ai(),o=mi(oo,lo(n,a)),s=Hi();return d((()=>W((e=>{const n=po(s,e);return fo(ro(i,n,o,t))}),e)),[i,e,o,t,s])}function mo(e){e&&(e.style.display="")}function ho(e){e&&(e.style.display="none")}function vo(e){return e.settings.duration}const go=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],bo=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function Io(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?go:bo,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?mo(e):ho(e)},a.oncancel=()=>{t?mo(e):ho(e)},()=>{a.finish()}}return t?mo(e):ho(e),()=>{}}function Eo({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)Io(e,t,n)}(l.current,n,vo(e),e.type)})):!n&&t?t.forEach((e=>{l.current&&function(e,t,n,i){if("FadeOut"===i)Io(e,t,n)}(l.current,n,vo(e),e.type)})):()=>{}),[n]),a.createElement("div",{ref:l,style:{display:"none"},className:s},i)}function So(e){const t=gi(),n=function(e){const t=Ki(),n=Zi(),i=r(new Map),a=Ai(),o=mi(oo,lo(n,a)),s=po(Hi(),e);return d((()=>fo(ro(i,s,o,t))),[i,s,o,t])}(e.schema.predicates),i=Fa(),o=a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))),[s,l]=c(!1),u="VISIBLE"===i&&n?"VISIBLE":"HIDDEN";return e.schema.transition?(!s&&l(!0),a.createElement(Ga.Provider,{value:u},a.createElement(Eo,{inTransitions:e.schema.transition.inTransition,outTransitions:e.schema.transition.outTransition,visible:n},o))):"functionally"===e.schema.hide?(!s&&l(!0),a.createElement(Oa.Provider,{value:n?"ENABLED":"DISABLED"},o)):n||s?(!s&&l(!0),a.createElement(Ga.Provider,{value:u},o)):null}const Oo=Se(((e,t)=>`${e||""} ${t||""}`.trim())),wo=e=>{var t;const n=l(Wi),i=Zi(),a=Ei()||document.head,o=$a(),r=si(o,i,a),s=u(ci,[]),c=mi([],(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=za(e);return W((e=>Ha(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=yo(f?W(B([],"predicates"),f):{}),m=W(((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?W(M("transitionBaseClassname"),f):{},v=e.styles?(g=h,Oo(Oo(p,m),g)):void 0;var g;return e.children({classnames:v,mapperRef:d})};function Ao(e){const t=gi(),n=Ma();return a.createElement(wo,{styles:e.schema.styles},(({classnames:i})=>{var o;return a.createElement("div",{className:i?i.own:void 0,"data-testid":e.testId,style:Object.assign({display:"flex",flexDirection:"column"},n),"aria-label":null!==(o=e.schema.a11yLabel)&&void 0!==o?o:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Ut(i,e.testId))))))}))}function Co(e){const t=gi(),n=Ma();return a.createElement(wo,{styles:e.schema.styles},(({classnames:i})=>{var o;return a.createElement("div",{className:i?i.own:void 0,"data-testid":e.testId,style:Object.assign({display:"flex",flexDirection:"row"},n),"aria-label":null!==(o=e.schema.a11yLabel)&&void 0!==o?o:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Ut(i,e.testId))))))}))}const To={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",on,rn],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},xo=new Map([["&","_;^;_"]]),No=new RegExp(`<a *(?=${To.allowedAttributes.a.join("|")}|>)`,"g"),_o=new RegExp('<a [^>]*href="([^"]+)"',"g"),Ro=new RegExp("(<br *?>)|(<br *?/>)","g"),Do="<br/>";function Lo(e){const t=Hi(),n=wa(),i=Ma(),o=d((()=>{const n=t(e.schema.value);if(!function(e){const t=function(e){return e.replaceAll(_o,((e,t)=>{const n=t.replaceAll("&",xo.get("&"));return e.replace(t,n)})).replaceAll(Ro,Do)}(e);return t===vt(t,To)}(n))throw new Rt("FAILED_SANITISING_HTML","Invalid HTML tags");return n}),[e.schema.value,t]),{tabIndex:r,styles:s,isDisabled:l}=It(n),c=Object.assign(Object.assign({},s),i),u=z(c)?void 0:c;return o?a.createElement(wo,{styles:e.schema.styles},(({classnames:t})=>{const n=[(null==t?void 0:t.link)?`class = "${null==t?void 0:t.link}"`:"",l?'tabindex="-1"':"",l?"style=\"pointer-events: 'none'; user-select: none;\"":"",l?'aria-disabled="true"':""].filter((e=>e.length>0)),i={__html:o.replace(No,`<a ${n.join(" ")}`)};return s=o,new RegExp("</(p|ul|ol)>").test(s)?a.createElement("div",{tabIndex:r,style:u,"aria-hidden":l,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:i}):a.createElement("p",{tabIndex:r,style:u,"aria-hidden":l,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:i});var s})):null}function ko(e){const t=Hi()(e.schema.value),n=wa(),i=Ma(),{tabIndex:o,styles:r,isDisabled:s}=It(n),l=Oe([r,i]);return t?a.createElement(wo,{styles:e.schema.styles},(({classnames:n})=>{const i={tabIndex:o,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"BasicText",style:z(l)?void 0:l};return e.isInline?a.createElement("span",Object.assign({},i),t):a.createElement("p",Object.assign({},i),t)})):null}function Po(e,t,n){if("BasicText"===e.type)return a.createElement(ko,{schema:e.node,testId:t,isInline:null!=n&&n})}function jo(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Ut(i,n)))))}function $o(e){const t=fi(),n=gi(),i=wi(),r=Hi(),s=Zi(),l=wa(),c=Ma(),d=i.creative.responseOptionsMap[e.schema.responseKey],u=At(d);o((()=>{u&&t(function(e){if(e.externalKey)return{type:Xt,payload:{criteria:{key:e.externalKey},signal:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:e.externalKey}}}};throw new Error(`Invalid External Response: No 'externalKey' found for external response option with instanceGuid: ${e.instanceGuid}`)}(d))}),[d,t,u]);const p=d?r({data:d},"creativeResponse"):r,{tabIndex:f,styles:y,isDisabled:m}=It(l);return wt(d)&&!u&&void 0!==s?a.createElement(wo,{styles:e.schema.styles},(({classnames:o,mapperRef:r})=>{var s;return a.createElement("button",{type:"button",tabIndex:f,"aria-disabled":m,"aria-label":null!==(s=e.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign(Object.assign({cursor:"pointer"},y),c),"data-testid":e.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":e.schema.responseKey,onClick:e=>{e.preventDefault();const n=function(e,t){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(Ot(n))return{fulfillment:n,responseOption:t};throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign({},t),{accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId});default:return t}}(i,d);t({type:zt,payload:n})},className:null==o?void 0:o.own,disabled:m},a.createElement(zi,{value:p},(null==o?void 0:o.own)?function(e,t,n,i,o){return a.createElement(qi,{value:n(t)},jo(e,i,o))}(e.schema.children,o.own,r,n,e.testId):jo(e.schema.children,n,e.testId)))})):null}function Go(e){const t=wa(),n=Ma(),{styles:i,isDisabled:o}=It(t);return e.schema.url.light?a.createElement(wo,{styles:bt(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":o,style:Object.assign(Object.assign(Object.assign({},i),{display:"inline-block"}),n),alt:o?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 Fo(e){const t=wa(),n=Ma(),{styles:i,isDisabled:o}=It(t),r=(s=e.schema.imageKey,l(xa)(s,"images"));var s,c;return null!=(c=r)&&"object"==typeof c&&"light"in c&&"string"==typeof c.light?a.createElement(wo,{styles:bt(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":o,style:Object.assign(Object.assign(Object.assign({},i),{display:"inline-block"}),n),alt:r.alt,title:r.title,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"DataImage",src:r.light}))):null}const Mo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Bo(e){const t=e.schema.name,n=e.schema.description,i=e.schema.styles?Mt(Mo,e.schema.styles):Mo,o=wa(),{styles:r,isDisabled:s}=It(o),l=Ma();return t?a.createElement(wo,{styles:i},(({classnames:i})=>a.createElement("span",Object.assign({style:Object.assign(Object.assign(Object.assign({},r),{display:"inline-block"}),l),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 Uo={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Vo 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"===dn.REPORT_RENDER_ERRORS&&this.props.reporter({level:Nt,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"===dn.DISPLAY_ERRORS?a.createElement("pre",{style:Uo},a.createElement("strong",null,"Error:")," [",a.createElement("em",null,this.props.schema.type),"]"," ",this.state.errorMessage):void 0:this.props.children}}Vo.contextType=Ra;const zo={internally:"_top",externally:"_blank"};function Ho(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Wo(e){var t;const n=zo[e.schema.open],i=gi(),o=wa(),r=Ma(),{tabIndex:s,styles:l,isDisabled:c}=It(o);return(null===(t=e.schema.children)||void 0===t?void 0:t.length)>0?a.createElement(wo,{styles:e.schema.styles},(({classnames:t,mapperRef:o})=>{var d;return a.createElement("a",{href:e.schema.src,"data-testid":e.testId,"data-e2e":"StaticLink",target:null!=n?n:"_blank",tabIndex:s,"aria-disabled":c,"aria-label":null!==(d=e.schema.a11yLabel)&&void 0!==d?d:void 0,style:Object.assign(Object.assign({cursor:"pointer",textDecoration:"none",display:e.isInline?"inline":"block"},l),r),className:null==t?void 0:t.own},(null==t?void 0:t.own)?function(e,t,n,i,o){return a.createElement(qi,{value:n(t)},Ho(e,i,o))}(e.schema.children,null==t?void 0:t.own,o,i,e.testId):Ho(e.schema.children,i,e.testId))})):null}function qo(e,t,n){if("StaticLink"===e.type)return a.createElement(Wo,{schema:e.node,testId:t,isInline:null!=n&&n})}const Jo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Ko(e){const t=(n=e.schema.iconKey,l(xa)(n,"icons"));var n;const i=null==t?void 0:t.name,o=e.schema.styles?Mt(Jo,e.schema.styles):Jo,r=wa(),s=Ma(),{styles:c}=It(r);return i?a.createElement(wo,{styles:o},(({classnames:t})=>a.createElement("span",{style:Object.assign(Object.assign(Object.assign({},c),{display:"inline-block"}),s),"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=Me`
|
|
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 y}from"react-dom/client";import{useDispatch as f,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 w,pathEq as C,cond as O,type as x,mergeDeepWith as A,T,flip as N,unary as L,identity as _,zipWith as R,concat as D,slice as k,is as P,equals as $,always as j,compose as G,__ as F,prop as M,propOr as B,memoizeWith as U,not as V,isEmpty as z,where as H,mapObjIndexed as W,forEachObjIndexed as q,pipe as J,split as Y,replace as K,reduce as Z,reduced as Q,partial as X,anyPass as ee,all as te,flatten as ne,map as ie,values as ae,ifElse as oe,isNil as re,curry as se,toPairs as le,keys as ce,lt as de,gt as ue,either as pe,lensPath as ye,over as fe,view as me,add as he,lte as ve,pathOr as ge,zip as be,evolve as Ie,append as Ee,mergeWith as Se,indexBy as we,mergeRight as Ce,lensProp as Oe,defaultTo as xe,sortBy as Ae,findIndex as Te,reject as Ne,whereEq as Le,uniqBy as _e,find as Re,has as De,omit as ke,assoc as Pe,gte as $e,clone as je,mergeDeepRight as Ge,F as Fe,isNotEmpty as Me}from"ramda";import{css as Be,keyframes as Ue,cx as Ve}from"@emotion/css";import{call as ze,actionChannel as He,take as We,put as qe,cancelled as Je,select as Ye,all as Ke,takeEvery as Ze,fork as Qe,takeLatest as Xe,spawn 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 yt,take as ft,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";function bt(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),w(S(a)),C("fixed",n)]),(e=>b(a,g(i,e),e)))),e):e}function It(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function Et(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function St(){return"ontouchstart"in document.documentElement}function wt(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function Ct(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function Ot(e){return Ct(e)&&"External"===e.action}function xt(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)}const At={pluginId:"shared",pageInstanceGuid:"N/A"};var Tt;!function(e){e.DCUI="DCUI",e.Partner="partner"}(Tt||(Tt={}));const Nt=["SignalCartItemQuantitySelected"],Lt="ERROR",_t="WARNING";class Rt extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const Dt=["V2_CART_ITEM_UPDATED","CART_ITEM_INSTANT_PURCHASE","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_SUCCESS","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];const kt=(e,t)=>D(e,k(e.length,t.length,t)),Pt=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?kt(t,e):t,i=t.length>e.length?kt(e,t):e;return R(Mt,i,n)}return t},$t=e=>null==e,jt=e=>!$t(e),Gt=(e,t)=>$t(t)?e:t,Ft=(e,t)=>{throw new Rt("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function Mt(e,t){return O([[(e,t)=>x(e)!==x(t)&&jt(e)&&jt(t),Ft],[(e,t)=>$t(e)||$t(t),Gt],[(e,t)=>"Object"===x(e),A(Mt)],[(e,t)=>"Array"===x(e),Pt],[T,N(L(_))]])(e,t)}function Bt(e,t){return Mt(e,t)}function Ut(e=0){return`breakpoint-${e}px`}function Vt(e,t){return t?`${t}-child${e}`:void 0}const zt="GLOBAL/RAISE_METRIC",Ht="GLOBAL/OFFER_ENGAGEMENT";function Wt(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&function(e){return Ct(e)&&"Fulfillment"===e.action}(e.responseOption)&&"fulfillment"in e&&wt(e.fulfillment)}function qt(e){return Ot(e)}function Jt(e){return function(e){return Ct(e)&&"Url"===e.action}(e)}function Yt(e){return function(e){return Ct(e)&&"CaptureOnly"===e.action}(e)}const Kt="GLOBAL/RAISE_SIGNAL",Zt="GLOBAL/OFFER_LIFECYCLE",Qt="GLOBAL/SET_CUSTOM_STATE",Xt="GLOBAL/SEND_PARTNER",en="GLOBAL/PREPARE_SIGNAL",tn="GLOBAL/OPEN_LINK",nn="GLOBAL/SET_PARTNER_VALIDATION_STATUS",an="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",on="GLOBAL/LAUNCH_CHILD_LAYOUT",rn={RAISE_METRIC:zt,PREPARE_SIGNAL:en,OFFER_ENGAGEMENT:Ht,RAISE_SIGNAL:Kt,OFFER_LIFECYCLE:Zt,SEND_PARTNER:Xt,SET_CUSTOM_STATE:Qt,SET_DOMAIN_STATE:"GLOBAL/SET_DOMAIN_STATE",OPEN_LINK:tn,SET_PARTNER_VALIDATION_STATUS:nn,SET_GLOBAL_OFFER_DATA_CART:an,LAUNCH_CHILD_LAYOUT:on},sn="data-open-in-app",ln="data-click-signal-context";function cn(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(ln);if(a&&t({type:Kt,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),n){e.preventDefault();let a="newTab";i.hasAttribute(sn)&&(a="inApp"),t({type:tn,payload:{url:n,urlBehaviour:a}})}}}o((()=>null!==e?(e.addEventListener("click",n),()=>{e.removeEventListener("click",n)}):()=>{}),[e])}function dn(){const e=r(null);return o((()=>{const t=t=>{"Tab"===t.key&&un(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const un=(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()},pn="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function yn(e,t){return t?"false"!==pn.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${Ut(e)} ${t.trim()}`:`#app-container.${Ut(e)} & {${t}}`:"";var n}const fn={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"};function mn(e){return function(e){return Object.keys(fn).indexOf(e)>-1}(e)?fn[e]:""}const hn={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 vn(e,t){if(!hn[e]||!hn[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return hn[e][t]}function gn(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function bn(...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 In(e,t){return`${e}:${t};`}function En(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class Sn extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function wn(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 Sn(n,JSON.stringify(t));return!0}function Cn(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function On(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 xn(e){if(null==e||""===e)return"value must not be omitted"}function An(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 Tn(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 Nn(e){if(null!=e&&""!==e)return"value must not be specified"}function Ln(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 _n(...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||Cn(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function Rn(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 Dn(e){if("string"!=typeof e)return"value must be a string"}const kn=P(Object);function Pn(e){const t=Object.entries(e);return n=>kn(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function $n(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 wn(Cn,n)?In(vn(e,t),`${n}`):""}function Gn(e){return(t,n,i)=>wn(On(Object.keys(e)),i)?In(vn(t,n),`${e[i]}`):""}function Fn(e){return wn(xn,e)?gn({light:t(Tn,!1),dark:t(Rn(Nn,Tn),!0)},bn("\n "))(e):"";function t(e,t){return n=>{if(wn(e,n)&&n){const e=In("background-image",`url("${n}")`);return t?En(e):e}return""}}}function Mn(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),wn(Rn(Nn,On(Object.keys(t))),e)&&e?In("background-size",t[e]):""}const Bn=O([[$("top-left"),j("top left")],[$("top-right"),j("top right")],[$("bottom-left"),j("bottom left")],[$("bottom-right"),j("bottom right")],[T,_]]);function Un(e){const t="string"==typeof e?e.toLowerCase():e;return wn(Rn(Nn,On(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?In("background-position",Bn(t)):""}function Vn(e,t,n){return wn(Rn(Cn,_n(2,3,4)),n)?In(vn(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function zn(e){return(t,n,i)=>wn(Ln({fit:On(e),percentage:Cn,fixed:Cn}),i)?In(vn(t,n),function(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]}}(i)):""}const Hn=Pn({light:An,dark:Rn(Nn,An)});function Wn(e,t,n){return i=>{if(i){const a=In(vn(e,t),Jn(String(i)));return n?En(a):a}return""}}function qn(e,t,n){return wn(Hn,n)?gn({light:Wn(e,t,!1),dark:Wn(e,t,!0)},bn("\n "))(n):""}function Jn(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 Yn=Pn({offsetX:Rn(Nn,Cn),offsetY:Rn(Nn,Cn),blurRadius:Rn(Nn,Cn),spreadRadius:Rn(Nn,Cn),color:Hn}),Kn=e=>t=>null!=t?String(t):e,Zn=G(D(F,"px"),Kn("0")),Qn=e=>t=>"string"==typeof t?e(t):t,Xn=G(Qn(D(F,"px")),Kn(void 0)),ei=G(Qn(Jn),M("dark"));function ti(e,t,n){return In(e,gn({offsetX:Zn,offsetY:Zn,blurRadius:t.spreadRadius?Zn:Xn,spreadRadius:Xn,color:n},bn(" "))(t))}const ni={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},ii={container:{justifyContent:Gn(ni),alignItems:Gn(ni),shadow:function(e,t,n){var i;if(wn(Yn,n)){const a=vn(e,t);return bn("\n")(ti(a,n,G(Jn,B("#80000000","light"))),(null===(i=n.color)||void 0===i?void 0:i.dark)?En(ti(a,n,ei)):"")}return""},gap:Vn,overflow:Gn({hidden:"hidden",visible:"visible"}),blur:function(e,t,n){return wn($n,n)?In(vn(e,t),`blur(${n.toString()}px)`):""},opacity:jn},text:{textColor:qn,fontSize:Vn,fontFamily:function(e,t,n){return wn(Dn,n)?In(vn(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:Gn({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:Gn({normal:"normal",italic:"italic"}),lineHeight:Vn,lineLimit:function(e,t,n){return wn(Cn,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:Vn,baselineTextAlign:Gn({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:Gn({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:Gn({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:Gn({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:qn,backgroundImage:function(e,t,n){return wn(xn,n)?gn({url:Fn,position:Un,scale:Mn},bn)(n):""}},dimension:{width:zn(["wrap-content","fit-width"]),maxWidth:Vn,minWidth:Vn,height:zn(["wrap-content","fit-height"]),maxHeight:Vn,minHeight:Vn,rotateZ:(ai="Z",(e,t,n)=>{const i=`rotate${ai}`;return wn(Cn,n)?In(vn(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:Gn(ni),weight:jn,order:jn},spacing:{margin:Vn,padding:Vn,offset:function(e,t,n){return wn(_n(2),n)?`transform:translate(${n.split(" ").join("px, ")}px)`:""}},border:{borderColor:qn,borderRadius:Vn,borderWidth:Vn,borderStyle:Gn({solid:"solid",dashed:"dashed"})}};var ai;function oi(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!ii[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=ii[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 ri="FAILED_TEMPLATING_DATA",si=new Map;function li(e){return String.fromCharCode(97+e)}function ci(e,t,n){const i=`${e||At.pluginId}-${void 0!==t?String(t):"outer"}`,a=si.get(i);if(a&&a.sheet.container.isConnected)return a.css;const o=function(e,t){const n={key:void 0!==e?`inner-css-${li(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),gt(n)}(t,n);return si.set(i,o),o.css}const di="%%%OWN_CLASS_REF%%%",ui=U(((e,t,n,i)=>`${String(e)}-${t}-${n}`),pi);function pi(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]:yi(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(di,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 yi(e,t,n,i,a){return e.map(function(e,t,n){return i=>Object.entries(i).map((([i,a])=>{const o=a?oi(a):"";switch(!0){case"default"===i:return o?`\n${o}\n`:"";case Boolean(e):return`\n .${e}${mn(i)} & {\n${o}\n}\n`;case t&&"own"!==n:return`\n .${di}${mn(i)} & {\n${o}\n}\n`;default:return`\n &${mn(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:`${yn(i,t)}\n`):e}),"")}const fi=s(j(void 0)),mi=()=>l(fi),hi=s(null);function vi(e,t){var n;const i=l(hi);return i&&null!==(n=t(i))&&void 0!==n?n:e}const gi=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")})),bi=gi.Consumer,Ii=()=>l(gi),Ei=e=>a.createElement(gi.Provider,{value:(t,n,i)=>e.value(t,null!=n?n:e.overrides,i)},e.children),Si=s(null),wi=()=>l(Si),Ci=s({get(){throw Error("Offer context has not been set")}}),Oi=e=>a.createElement(Ci.Provider,{value:{get:()=>e.context}},e.children),xi=()=>l(Ci).get(),Ai=()=>{try{return l(Ci).get().creative.copy}catch(e){return}},Ti=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Ni=G(V,z),Li=H({url:Ni,title:Ni});function _i(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(Di(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){Ri(t,e,"openLinks",1,2);const i=ki(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=Pi(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(Ti,((e,t)=>`<a ${sn} ${a?`${ln}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){Ri(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.*>).*(?=</a>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,t))):e.slice(0,t)}(n,a);throw Error(Di(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);default:throw new Error(Di(e,`Unknown Meta Attribute '${t}'.`))}}(e,i,o,t)}),n)}function Ri(e,t,n,i,a){const o=new Error(Di(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 Di(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function ki(e,t,n,i,a){const o=Pi(e,n,i);if(null!==o)return o;throw Error(Di(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function Pi(e,t,n){return n(e[t])}const $i="DATA",ji="STATE",Gi=new RegExp(`^(${$i}|${ji})`),Fi=new RegExp(`^${ji}`),Mi=new RegExp(`%\\^(?:${$i}|${ji})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*(?:\\:[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,]*\\])*(?:\\|.*?)?\\^%`,"g"),Bi=Symbol("invalid");function Ui(e,t="creativeCopy"){const n=Vi({data:e},t);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Vi(t,n,this.dataMap)});let i=!1;const a=t,o=J(k(2,-2),Y("|"),(e=>{const t=Z(((e,t)=>{let n;if(Gi.test(t)){if(!this.dataMap.has(t)&&Fi.test(t))throw new Rt(ri,`Invalid use of STATE template key in a context it does not exist: ${t}`);const i=Y(":",t);if(i[0]){if(n=this.dataMap.get(i[0]),n&&n===Bi)throw new Rt(ri,`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=_i(i[0],i.slice(1),n)}catch(e){throw new Rt(ri,`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?Q({provided:!0,value:n}):e}return Q({provided:!0,value:t})}),{provided:!1,value:""},e);return t.provided||(i=!0),t.value})),r=K(Mi,o,a);return!1===i?r:""}.bind({dataMap:n})}function Vi(e,t,n){const i=new Map(n);return"data"in e&&a(e.data,`${$i}${t?"."+t:""}`),"state"in e&&a(e.state,`${ji}${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,Bi),e&&"object"==typeof e&&q(((e,n)=>a(e,`${t}.${n}`)),e)}}const zi=s(Ui({})),Hi=zi.Consumer,Wi=zi.Provider,qi=()=>l(zi),Ji=s(null),Yi=Ji.Provider,Ki=s("OUTER"),Zi=()=>"VARIANT"===l(Ki),Qi=s(void 0),Xi=()=>l(Qi);var ea,ta,na,ia,aa,oa,ra=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())}))},sa=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},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)};class ca{constructor(e,t,n,i,a){ea.set(this,void 0),ta.set(this,void 0),na.set(this,new Set),ia.set(this,void 0),aa.set(this,void 0),oa.set(this,void 0),sa(this,ea,X(e.subscribe.bind(e),[n]),"f"),sa(this,ta,X(e.dispatch.bind(e),[n]),"f"),sa(this,ia,t,"f"),sa(this,aa,i,"f"),sa(this,oa,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=la(this,ea,"f").call(this,e),n=()=>{t(),la(this,na,"f").delete(n)};return la(this,na,"f").add(n),n}onInteractivityChange(e){return la(this,aa,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=la(this,oa,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),la(this,na,"f").delete(n)};return la(this,na,"f").add(n),n}globalDispatch(e){la(this,ta,"f").call(this,e)}dispose(){la(this,na,"f").forEach((e=>e())),sa(this,na,new Set,"f"),la(this,aa,"f").clear()}createChildPlugin(e){return la(this,ia,"f").call(this,e)}}ea=new WeakMap,ta=new WeakMap,na=new WeakMap,ia=new WeakMap,aa=new WeakMap,oa=new WeakMap;class da{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>ra(this,void 0,void 0,(function*(){})),onClose:()=>ra(this,void 0,void 0,(function*(){})),putConfig:()=>ra(this,void 0,void 0,(function*(){})),send:()=>ra(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var ua,pa,ya=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},fa=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 ma{constructor(e){ua.set(this,void 0),pa.set(this,new Set),ya(this,ua,e,"f")}subscribe(e){return fa(this,pa,"f").add(e),!0===e(fa(this,ua,"f"))&&fa(this,pa,"f").delete(e),()=>{fa(this,pa,"f").delete(e)}}publish(e){ya(this,ua,e,"f"),fa(this,pa,"f").forEach((e=>{!0===e(fa(this,ua,"f"))&&fa(this,pa,"f").delete(e)}))}clear(){fa(this,pa,"f").clear()}}ua=new WeakMap,pa=new WeakMap;var ha=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)},va=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 ga="breakpoint-0px";class ba{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;const s=this.appFactory,l=this.logger,c=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new da;return r=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint"]}attributeChangedCallback(e,a,r){if(r!==a)switch(e){case"visible":ha(this,n,"f").call(this,"true"===r);break;case"interactivity":"ENABLED"!==r&&"DISABLED"!==r||ha(this,i,"f").call(this,r);break;case"active-breakpoint":ha(this,t,"m",o).call(this,r,a)}}makeInteractivityUpdateHandler(e){va(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,t,i){const a="true"===this.getAttribute("visible"),o=this.getAttribute("slotInstanceGuid");va(this,n,(a=>{a&&(va(this,n,(()=>null),"f"),0===e&&i.globalDispatch({type:Zt,payload:{event:"Interactive"}}),t&&i.globalDispatch({type:Kt,payload:{name:"SignalImpression",parentGuid:t}}),o&&i.globalDispatch({type:Kt,payload:{name:"SignalImpression",parentGuid:o}}))}),"f"),ha(this,n,"f").call(this,a)}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&d(`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){d(`Invalid JSON attribute ${e}: ${n}`)}}constructor(){super(),t.add(this),n.set(this,(()=>null)),i.set(this,(()=>null)),a.set(this,void 0);const e=this.attachShadow({mode:"open"});va(this,a,document.createElement("div"),"f"),ha(this,a,"f").id="app-container",ha(this,a,"f").classList.add("default"),e.appendChild(ha(this,a,"f"))}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),o=this.getAttribute("plugin-id");ha(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const r=this.getOfferPositionAttr(),u=this.getJSONAttr("layoutSchema"),p=this.getJSONAttr("childLayouts","[]"),y=this.getJSONAttr("offerData"),f=new ma("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),m=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"";s||d("Cannot create app without factory. Please build the connector withAppFactory.");const h=c({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==y?void 0:y.creative)||void 0===t?void 0:t.instanceGuid},f);this.makeInteractivityUpdateHandler(f),s({rootElement:ha(this,a,"f"),gateway:h,logger:l,offerPositionIndex:r,offerData:y,layoutSchema:u,childLayouts:p,schemaVersion:m,pluginId:o||At.pluginId}),this.makeVisbilityUpdateHandler(r,null===(n=null==y?void 0:y.creative)||void 0===n?void 0:n.instanceGuid,h)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,t=new WeakSet,o=function(e,t){ha(this,a,"f").classList.remove(t||ga),ha(this,a,"f").classList.add(e||ga)},r;function d(e){throw l({level:Lt,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const Ia=s({get:()=>new da}),Ea=e=>a.createElement(Ia.Provider,{value:{get:()=>e.context}},e.children);const Sa=s({get(){throw Error("Layout Schema context has not been set")}}),wa=e=>a.createElement(Sa.Provider,{value:{get:()=>e.context}},e.children),Ca=()=>l(Sa).get(),Oa=s("ENABLED"),xa=()=>l(Oa);function Aa(e){const t=Na(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Na(t,this.dataMap)});if(!n)throw new Rt("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");return g([n,t],this.dataMap)}.bind({dataMap:t})}const Ta={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function Na(e,t=Ta){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 La=s(Aa({}));La.Consumer;const _a=La.Provider,Ra=()=>l(La),Da=s({});function ka({info:e,children:t}){const n=l(Da);return a.createElement(Da.Provider,{value:Object.assign(Object.assign({},n),e)},t)}const Pa=s({get(){throw Error("Catalog Item context has not been set")}}),$a=e=>a.createElement(Pa.Provider,{value:{get:()=>e.context}},e.children),ja=()=>l(Pa).get(),Ga=s(""),Fa=()=>l(Ga),Ma=s(""),Ba=G(ee([z,te(z)]),ne,ie(ae),ie(oe(re,j({}),_)),ae,B({},"value")),Ua=G(z,M("predicates"));function Va(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const za=se(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(oi(i)),transitionBaseClassname:e(Va(t,(a=i,le(a).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?ce(n).map((e=>vn(t,e))):[]})))))};var a})),Ha=ee([Ba,Ua]);const Wa={is:$,"is-not":G(V,$),"is-below":de,"is-above":ue};function qa(e,t){return e.includes(t)}const Ja={is:$,"is-not":G(V,$),exists:qa,"not-exists":G(V,qa)},Ya={exists:G(V,pe(re,z)),"not-exists":pe(re,z)},Ka={"is-true":$(!0),"is-false":$(!1)},Za={is:$,"is-not":G(V,$)};function Qa(e){return(t,n)=>n[e]}const Xa=O([[(e,t)=>$("Breakpoint",e),Qa("activeBreakpoint")],[(e,t)=>$("Progression",e),Qa("progressionIndex")],[(e,t)=>$("Position",e),Qa("positionIndex")]]);function eo(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const to=O([[$("Breakpoint"),(e,t,n)=>{const i=ye(["breakpoints",t]);return J(fe(i,Number),me(i))(n)}],[$("Progression"),(e,t,n)=>O([[ue(0),he(n.totalGroups)],[ve(0),_]])(Number(t))],[$("Position"),(e,t,n)=>O([[ue(0),he(n.totalOffers)],[ve(0),_]])(Number(t))]]),no=G(V,isNaN);function io(e,t){return e.map((e=>{var n,i,a;switch(e.type){case"StaticString":return(0,Za[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,Ya[e.predicate.condition])(eo(t,e.predicate.value));case"StaticBoolean":return(0,Ka[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,Wa[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,Wa[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,Ja[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,Wa[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,Wa[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=Wa[e.predicate.condition],i=null!==(a=Xa(e.type,t))&&void 0!==a?a:NaN,o=to(e.type,e.predicate.value,t);return!!no(i)&&n(i,o)}}}))}function ao(e){return ge(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const oo={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{}};function ro(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:${eo(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:${Xa(e.type,t)}:${t.totalGroups}`}}(e,t),o=n.current.get(a);return Ie(so(o)?{cached:Ee(o)}:{uncached:Ee({key:a,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),s=io(r.map((({predicate:e})=>e)),n);return be(r,s).forEach((([{key:t},n])=>{e.current.set(t,n)})),o.concat(s)}const so=P(Boolean);const lo=se(((e,t,n)=>{var i,a,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:ao(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}})),co=ye(["predicate","content","input"]),uo=ye(["predicate","content","value"]);function po(e,t){const n=fe(co,(t=>t?e(t):"")),i=fe(uo,(t=>"string"==typeof t?e(t):t)),a=G(n,i);return t.map((e=>"Placeholder"===e.type?"TextValue"===e.predicate.type?a(e):n(e):e))}const yo=te($(!0));function fo(e){const t=Zi(),n=Xi(),i=r(new Map),a=Ai(),o=vi(oo,lo(n,a)),s=qi();return d((()=>W((e=>{const n=po(s,e);return yo(ro(i,n,o,t))}),e)),[i,e,o,t,s])}function mo(e){e&&(e.style.display="")}function ho(e){e&&(e.style.display="none")}function vo(e){return e.settings.duration}const go=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],bo=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function Io(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?go:bo,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?mo(e):ho(e)},a.oncancel=()=>{t?mo(e):ho(e)},()=>{a.finish()}}return t?mo(e):ho(e),()=>{}}function Eo({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)Io(e,t,n)}(l.current,n,vo(e),e.type)})):!n&&t?t.forEach((e=>{l.current&&function(e,t,n,i){if("FadeOut"===i)Io(e,t,n)}(l.current,n,vo(e),e.type)})):()=>{}),[n]),a.createElement("div",{ref:l,style:{display:"none"},className:s},i)}function So(e){const t=Ii(),n=function(e){const t=Zi(),n=Xi(),i=r(new Map),a=Ai(),o=vi(oo,lo(n,a)),s=po(qi(),e);return d((()=>yo(ro(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(Eo,{inTransitions:e.schema.transition.inTransition,outTransitions:e.schema.transition.outTransition,visible:n},i):"functionally"===e.schema.hide?a.createElement(Oa.Provider,{value:n?"ENABLED":"DISABLED"},i):n?a.createElement(a.Fragment,null,i):null}const wo=Se(((e,t)=>`${e||""} ${t||""}`.trim())),Co=e=>{var t;const n=l(Ji),i=Xi(),a=wi()||document.head,o=Fa(),r=ci(o,i,a),s=u(ui,[]),c=vi([],(e=>Object.values(e.breakpoint.breakpoints))),d=n||s(c,o,i,a),p=e.styles?d(e.styles):{},y=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=za(e);return W((e=>Ha(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,f=fo(y?W(B([],"predicates"),y):{}),m=W(((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}(y,t):void 0),f),h=y?W(M("transitionBaseClassname"),y):{},v=e.styles?(g=h,wo(wo(p,m),g)):void 0;var g;return e.children({classnames:v,mapperRef:d})};function Oo(e){const t=Ii();return a.createElement(Co,{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,Vt(i,e.testId))))))}))}function xo(e){const t=Ii();return a.createElement(Co,{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,Vt(i,e.testId))))))}))}const Ao={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",sn,ln],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},To=new Map([["&","_;^;_"]]),No=new RegExp(`<a *(?=${Ao.allowedAttributes.a.join("|")}|>)`,"g"),Lo=new RegExp('<a [^>]*href="([^"]+)"',"g"),_o=new RegExp("(<br *?>)|(<br *?/>)","g"),Ro="<br/>";function Do(e){const t=qi(),n=xa(),i=d((()=>{const n=t(e.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Lo,((e,t)=>{const n=t.replaceAll("&",To.get("&"));return e.replace(t,n)})).replaceAll(_o,Ro)}(e);return t===vt(t,Ao)}(n))throw new Rt("FAILED_SANITISING_HTML","Invalid HTML tags");return n}),[e.schema.value,t]),{tabIndex:o,styles:r,isDisabled:s}=It(n);return i?a.createElement(Co,{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(No,`<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(No,`<a ${n.join(" ")}`)}});var l})):null}function ko(e){const t=qi()(e.schema.value),n=xa(),{tabIndex:i,styles:o,isDisabled:r}=It(n);return t?a.createElement(Co,{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 Po(e,t,n){if("BasicText"===e.type)return a.createElement(ko,{schema:e.node,testId:t,isInline:null!=n&&n})}function $o(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Vt(i,n)))))}function jo(e){const t=mi(),n=Ii(),i=xi(),r=qi(),s=Xi(),l=xa(),c=i.creative.responseOptionsMap[e.schema.responseKey],d=Ot(c);o((()=>{d&&t(function(e){if(e.externalKey)return{type:en,payload:{criteria:{key:e.externalKey},signal:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:e.externalKey}}}};throw new Error(`Invalid External Response: No 'externalKey' found for external response option with instanceGuid: ${e.instanceGuid}`)}(c))}),[c,t,d]);const u=c?r({data:c},"creativeResponse"):r,{tabIndex:p,styles:y,isDisabled:f}=It(l);return Ct(c)&&!d&&void 0!==s?a.createElement(Co,{styles:e.schema.styles},(({classnames:o,mapperRef:r})=>{var s;return a.createElement("button",{type:"button",tabIndex:p,"aria-disabled":f,"aria-label":null!==(s=e.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer"},y),"data-testid":e.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":e.schema.responseKey,onClick:e=>{e.preventDefault();const n=function(e,t){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(wt(n))return{fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid};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});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}(i,c);t({type:Ht,payload:n})},className:null==o?void 0:o.own,disabled:f},a.createElement(Wi,{value:u},(null==o?void 0:o.own)?function(e,t,n,i,o){return a.createElement(Yi,{value:n(t)},$o(e,i,o))}(e.schema.children,o.own,r,n,e.testId):$o(e.schema.children,n,e.testId)))})):null}function Go(e){const t=xa(),{styles:n,isDisabled:i}=It(t);return e.schema.url.light?a.createElement(Co,{styles:bt(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 Fo(e){const t=xa(),{styles:n,isDisabled:i}=It(t),o=(r=e.schema.imageKey,l(La)(r,"images"));var r,s;return null!=(s=o)&&"object"==typeof s&&"light"in s&&"string"==typeof s.light?a.createElement(Co,{styles:bt(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}const Mo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Bo(e){const t=e.schema.name,n=e.schema.description,i=e.schema.styles?Bt(Mo,e.schema.styles):Mo,o=xa(),{styles:r,isDisabled:s}=It(o);return t?a.createElement(Co,{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 Uo={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Vo 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"===pn.REPORT_RENDER_ERRORS&&this.props.reporter({level:Lt,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"===pn.DISPLAY_ERRORS?a.createElement("pre",{style:Uo},a.createElement("strong",null,"Error:")," [",a.createElement("em",null,this.props.schema.type),"]"," ",this.state.errorMessage):void 0:this.props.children}}Vo.contextType=Da;const zo={internally:"_top",externally:"_blank"};function Ho(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Wo(e){var t;const n=zo[e.schema.open],i=Ii(),o=xa(),{tabIndex:r,styles:s,isDisabled:l}=It(o);return(null===(t=e.schema.children)||void 0===t?void 0:t.length)>0?a.createElement(Co,{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(Yi,{value:n(t)},Ho(e,i,o))}(e.schema.children,null==t?void 0:t.own,o,i,e.testId):Ho(e.schema.children,i,e.testId))})):null}function qo(e,t,n){if("StaticLink"===e.type)return a.createElement(Wo,{schema:e.node,testId:t,isInline:null!=n&&n})}const Jo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Yo(e){const t=(n=e.schema.iconKey,l(La)(n,"icons"));var n;const i=null==t?void 0:t.name,o=e.schema.styles?Bt(Jo,e.schema.styles):Jo,r=xa(),{styles:s}=It(r);return i?a.createElement(Co,{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 Ko=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 Zo(e){const t=
|
|
9
|
+
`;function Zo(e){const t=Ii(),n=r(null);return o((()=>{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(Co,{styles:e.schema.styles},(({classnames:i})=>{var o;return a.createElement("div",{ref:n,className:[Ko,null==i?void 0:i.own].filter(Boolean).join(" ")||void 0,"aria-label":null!==(o=e.schema.a11yLabel)&&void 0!==o?o:void 0,"data-testid":e.testId,"data-e2e":"ZStack"},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Vt(i,e.testId))))))}))}const Qo={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 Xo(e){const[t,n]=c(!1),[i,s]=c(!1),l=Fa(),d=xa(),u=Xi(),p=mi(),{customStateKey:y,customStateValue:f,label:m,a11yLabel:h,thumb:v}=e.schema,{containerClass:g,trackClass:b,fillClass:I,thumbClass:E,labelClass:S,buttonClass:w}=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,p);if(!y)throw new Error("No custom state key provided for state trigger node.");const A={type:Zt,payload:{key:y,value:null!=m?m:1}},C={type:Kt,payload:{name:"SignalUserInteraction",action:"Swipe",context:"SlideStateTrigger"}},T=e.schema.styles?Mt(Qo,e.schema.styles):Qo,x=r(null),N=r(null),_=r(null),R=r(!1),D=r(void 0),{isDisabled:L}=It(d);o((()=>{if(t)return St()?(document.addEventListener("touchmove",j),document.addEventListener("touchend",k)):(document.addEventListener("mousemove",j),document.addEventListener("mouseup",k)),B}),[t]);const k=()=>{B(),D.current=void 0,n(!1),i||(M(!0),R.current?(F(G()),$()):F(0))},P=e=>{t||i||L||(D.current=tr(e),M(!1),n(!0))},j=e=>{var t,n;if(er(_)){const i=Math.min(Math.max(0,(null!==(t=tr(e))&&void 0!==t?t:0)-(null!==(n=D.current)&&void 0!==n?n:0)),G());F(i),i/G()*100>=75?R.current=!0:R.current=!1}},$=()=>{var e,t;s(!0),f(A),f(C),null===(t=null===(e=er(x).parentElement)||void 0===e?void 0:e.parentElement)||void 0===t||t.focus()},G=()=>er(x).getBoundingClientRect().width-er(_).getBoundingClientRect().width,F=e=>{var t;er(_).style.transform=`translateX(${e}px)`,er(N).style.transform=`translateX(${e+(null===(t=er(_))||void 0===t?void 0:t.getBoundingClientRect().width)/2}px)`},M=e=>{e?(er(_).style.transition="transform .2s",er(N).style.transition="transform .2s"):(er(_).style.transition="",er(N).style.transition="")},B=()=>{document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",j),document.removeEventListener("touchend",k)};return a.createElement(wo,{styles:T},(({classnames:t})=>{var n,o,r,s,l,c;return a.createElement("div",{className:`${b}`,"data-testid":e.testId,style:u,"data-e2e":"SlideStateTrigger"},a.createElement("div",{className:`${I} ${null!==(n=null==t?void 0:t.own)&&void 0!==n?n:""}`,ref:x,"aria-hidden":!0,"data-testid":e.testId&&`${e.testId}-track`},(null==h?void 0:h.value)?a.createElement("div",{className:`${O} ${null!==(o=null==t?void 0:t.label)&&void 0!==o?o:""}`,"data-testid":e.testId&&`${e.testId}-label`},h.value):null,a.createElement("div",{className:`${E} ${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:`${S} ${null!==(s=null==t?void 0:t.thumb)&&void 0!==s?s:""}`,ref:_,"data-testid":e.testId&&`${e.testId}-thumb`,"data-e2e":"SlideStateTrigger-thumb",onMouseDown:P,onTouchStart:P},null!==(l=null==g?void 0:g.icon)&&void 0!==l?l:"ArrowForward")),a.createElement("button",{className:w,"aria-label":null!=v?v:void 0,onClick:$,disabled:i||L,"data-testid":e.testId&&`${e.testId}-button`},null!==(c=null==h?void 0:h.value)&&void 0!==c?c:"Unlock Offers"))}))}function er(e){if(!e.current)throw new Error("Unexpected missing reference to required SlideStateTrigger Element");return e.current}function tr(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX}function nr(e){const t=gi(),n=Ma();return a.createElement(wo,{styles:e.schema.styles},(({classnames:i})=>{var o;return a.createElement("div",{className:i?i.own:void 0,"data-testid":e.testId,style:Object.assign({display:"flex",flexDirection:"row",flexWrap:"wrap"},n),"aria-label":null!==(o=e.schema.a11yLabel)&&void 0!==o?o:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Ut(i,e.testId))))))}))}function ir(e){const t=wa(),n=Ma(),i=fi(),o=e.schema.customStateKey,r=mi(0,(e=>e.customStates[o])),{tabIndex:s,styles:l,isDisabled:c}=It(t),d=()=>{i({type:Zt,payload:{key:o,value:r?0:1}})};return a.createElement(wo,{styles:e.schema.styles},(({classnames:t})=>{var i;return a.createElement("button",{className:null==t?void 0:t.own,onClick:d,"data-testid":e.testId,"data-e2e":"ToggleButtonStateTrigger",disabled:c,"aria-disabled":c,"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0,tabIndex:s,style:Object.assign(Object.assign({cursor:"pointer"},l),n)},a.createElement(vi,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function ar(e){const t=gi(),n=Ma();return a.createElement(wo,{styles:e.schema.styles},(({classnames:i})=>{var o;return a.createElement("div",{className:i?i.own:void 0,"data-testid":e.testId,style:Object.assign({display:"flex",flexDirection:"row",overflowX:"auto"},n),"aria-label":null!==(o=e.schema.a11yLabel)&&void 0!==o?o:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Ut(i,e.testId))))))}))}function or(e){const t=gi(),n=Ma();return a.createElement(wo,{styles:e.schema.styles},(({classnames:i})=>{var o;return a.createElement("div",{className:i?i.own:void 0,"data-testid":e.testId,style:Object.assign({display:"flex",flexDirection:"column",overflowY:"auto"},n),"aria-label":null!==(o=e.schema.a11yLabel)&&void 0!==o?o:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Ut(i,e.testId))))))}))}const rr=s({extensions:{ctx:new Map,cache:[]}}),sr=()=>l(rr).extensions;function lr({extensions:e,extendStore:t,children:n}){const i=sr(),o=new Map([...i.ctx,...e.ctx]),r=i.cache.concat(e.cache);return a.createElement(rr.Provider,{value:{extensions:{ctx:o,cache:r},extendStore:t}},n)}function cr(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 dr({data:e}){const t=cr(sr(),e);var n;if((e=>{const{extendStore:t,extensions:n}=l(rr);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 ur(e,t){if(Et("Extension",e))return a.createElement(dr,{data:e.node.data})}function pr(e){const t=_a(),n=wi(),i=Hi(),r=gi(),s=fi(),l=n.catalogItems||[],c=e=>i({data:e},"catalogItem"),d=Ma();return o((()=>{for(const e of l)s({type:Kt,payload:{name:"SignalImpression",parentGuid:e.instanceGuid}})}),[l,s]),l.length>0?a.createElement(wo,{styles:e.schema.styles},(({classnames:n})=>a.createElement("div",{"data-testid":e.testId,"data-e2e":"CatalogStackedCollection",className:null==n?void 0:n.own,style:Object.assign({display:"flex",flexDirection:"column"},d)},a.Children.toArray(l.map(((n,i)=>a.createElement(ka,{context:n},a.createElement(Na,{value:t(n)},a.createElement(zi,{value:c(n)},r(e.schema.template,void 0,Ut(i,e.testId))))))))))):null}const fr={BasicText:(e,t)=>Po(e,t,!0),StaticLink:(e,t)=>qo(e,t,!0)};function yr(e){const t=gi(),n=Ma();return a.createElement(bi,{value:t,overrides:fr},a.createElement(vi,null,(t=>a.createElement(wo,{styles:e.schema.styles},(({classnames:i})=>{var o;return a.createElement("div",{className:null==i?void 0:i.own,"data-testid":e.testId,"aria-label":null!==(o=e.schema.a11yLabel)&&void 0!==o?o:void 0,style:n},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Ut(i,e.testId))))))})))))}function mr(e){const t=fi(),n=e.schema.delay?e.schema.delay:1,i=e.schema.customStateKey,a=mi(0,(e=>e.customStates[i]));return function({delay:e,callback:t}){const n=r(null);o((()=>{n.current=setTimeout(t,e)}),[])}({delay:n,callback:()=>{t({type:Zt,payload:{key:i,value:a?0:1}})}}),null}function hr(e){return()=>{throw new Rt("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 vr={Column:function(e,t){if("Column"===e.type)return a.createElement(Ao,{schema:e.node,testId:t})},Row:function(e,t){if("Row"===e.type)return a.createElement(Co,{schema:e.node,testId:t})},StaticImage:function(e,t){if("StaticImage"===e.type)return a.createElement(Go,{schema:e.node,testId:t})},DataImage:function(e,t){if("DataImage"===e.type)return a.createElement(Fo,{schema:e.node,testId:t})},CreativeResponse:function(e,t){if("CreativeResponse"===e.type)return a.createElement($o,{schema:e.node,testId:t})},OneByOneDistribution:hr("OneByOneDistribution"),StackedDistribution:hr("StackedDistribution"),CarouselDistribution:hr("CarouselDistribution"),GroupedDistribution:hr("GroupedDistribution"),ProgressIndicator:hr("ProgressIndicator"),ProgressControl:hr("ProgressControl"),When:function(e,t){if("When"===e.type)return a.createElement(So,{schema:e.node,testId:t})},Overlay:hr("Overlay"),CloseButton:hr("CloseButton"),RichText:function(e,t){if("RichText"===e.type)return a.createElement(Lo,{schema:e.node,testId:t})},BasicText:Po,StaticLink:qo,DataIcon:function(e,t){if("DataIcon"===e.type)return a.createElement(Ko,{schema:e.node,testId:t})},StaticIcon:function(e,t){if("StaticIcon"===e.type)return a.createElement(Bo,{schema:e.node,testId:t})},ZStack:function(e,t){if("ZStack"===e.type)return a.createElement(Zo,{schema:e.node,testId:t})},FlowRow:function(e,t){if("FlowRow"===e.type)return a.createElement(nr,{schema:e.node,testId:t})},SlideStateTrigger:function(e,t){if("SlideStateTrigger"===e.type)return a.createElement(Xo,{schema:e.node,testId:t})},ToggleButtonStateTrigger:function(e,t){if("ToggleButtonStateTrigger"===e.type)return a.createElement(ir,{schema:e.node,testId:t})},TimerStateTrigger:function(e,t){if("TimerStateTrigger"===e.type)return a.createElement(mr,{schema:e.node})},CatalogStackedCollection:function(e,t){if("CatalogStackedCollection"===e.type)return a.createElement(pr,{schema:e.node,testId:t})},CatalogResponseButton:hr("CatalogResponseButton"),ScrollableRow:function(e,t){if("ScrollableRow"===e.type)return a.createElement(ar,{schema:e.node,testId:t})},ScrollableColumn:function(e,t){if("ScrollableColumn"===e.type)return a.createElement(or,{schema:e.node,testId:t})},EscapeHatch:ur,BottomSheet:hr("BottomSheet"),CatalogQuantityOption:hr("CatalogQuantityOption"),CatalogRadioGroup:hr("CatalogRadioGroup"),CatalogQuantityCounter:hr("CatalogQuantityCounter"),InlineContainer:function(e,t){if("InlineContainer"===e.type)return a.createElement(yr,{schema:e.node,testId:t})}};function gr(e){return function(t,n,i){const o=n&&n[t.type],r=null!=o?o:vr[t.type];return a.createElement(Vo,{schema:t,reporter:e},r&&r(t,i)||function(e){throw new Rt("FAILED_CREATING_LAYOUT_NODE",`Failed to create layout node ${JSON.stringify(e)}`)}(t))}}const br={transformLinksToAnchorText:function(e={}){return{data:W((e=>xi(e)?`<a target="_blank" href="${e.url}">${e.title}</a>`:""),e)}}};function Ir(e){const{settings:t,dispatch:n,children:i}=e,r=Mi(t.offerData.creative.copy||{})(br.transformLinksToAnchorText(t.offerData.creative.links),"creativeLink"),s=gr(t.logger),[l,d]=c("ENABLED");return o((()=>t.gateway.onInteractivityChange(d)),[t]),sn(t.rootElement,n),a.createElement(Ji.Provider,{value:"VARIANT"},a.createElement(Ii.Provider,{value:t.rootElement},a.createElement(ja.Provider,{value:t.pluginId},a.createElement(ba,{context:t.gateway},a.createElement(Ea,{context:t.layoutSchema},a.createElement(Oi,{context:t.offerData},a.createElement(Na,{value:Aa(t.offerData.creative)},a.createElement(Oa.Provider,{value:l},a.createElement(bi,{value:s},a.createElement(Yi.Provider,{value:t.offerPositionIndex},a.createElement(pi.Provider,{value:n},a.createElement(zi,{value:r},a.createElement(Er,null,i)))))))))))))}function Er(e){var t;const{children:n}=e,i=$a(),r=function(){const[e,t]=c(null),n=l(ga).get();return o((()=>n.onGlobalStateChange((n=>{j(n,e)||t(n)}))),[n]),e}(),s=l(Ii)||void 0,d=Zi(),p=u((e=>di(e,i,d,s)),[s]);return r?a.createElement(qi,{value:p(Object.values(null!==(t=null==r?void 0:r.breakpoint.breakpoints)&&void 0!==t?t:{}))},a.createElement(yi.Provider,{value:r},n)):null}function Sr(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 Or(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?mo(e):ho(e),o.current.isRunning=!1},r.oncancel=()=>{"in"===t?mo(e):ho(e),o.current.isRunning=!1},()=>{r.finish()}}return"in"===t?mo(e):ho(e),()=>{}}const wr={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 Ar({visible:e,effect:t,children:n,parentElement:i,containerClassName:s}){const[l,d]=c(e),u=r(null),p=r({isRunning:!1}),f=vo(t);return o((()=>{const t=new ResizeObserver((function(t){i&&e&&!p.current.isRunning&&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&&(mo(u.current),t.observe(u.current)),()=>{t.disconnect()}}),[e,i]),o((()=>e&&!l&&u.current&&i?(d(!0),Or(u.current,"in",wr[t.type].in,f,i,p)):!e&&l&&u.current&&i?(d(!1),Or(u.current,"out",wr[t.type].out,f/2,i,p)):()=>{}),[e,i,f]),a.createElement("div",{ref:u,style:{display:"none"},className:s},n)}function Cr(e){const t=gi(),n=Ma();return a.createElement(wo,{styles:e.schema.styles},(({classnames:i})=>{var o;return a.createElement("div",{className:null==i?void 0:i.own,"data-testid":e.testId,style:Object.assign({display:"flex",flexDirection:"column"},n),"aria-label":null!==(o=e.schema.a11yLabel)&&void 0!==o?o:void 0},t(e.schema.template))}))}const Tr="ACTIVE/ADD",xr="ACTIVE/DELETE",Nr="BREAKPOINT/UPDATE_ACTIVE",_r="BREAKPOINT/INITIALISE",Rr="BREAKPOINT/SET_BREAKPOINTS",Dr="FONTS/SET",Lr="LAYOUT/UPDATE",kr="CONFIG/HANDLE",Pr="PLUGIN/CLOSE_PLUGIN",jr="SETTINGS/SET",$r="CACHE/ADD_SERIALIZED_VALUE",Gr="CACHE/UPDATE_SERIALIZED_VALUE",Fr="CACHE/CLEAR_SERIALIZED_VALUE",Mr="SIGNAL/QUEUE",Br="SIGNAL/PROCESSED",Ur="SIGNAL/PROCESS",Vr="OVERLAY/DISMISS_OVERLAY",zr="ERROR/REPORT",Hr="LOG",Wr="CUSTOM_STATES/SET",qr={LAYOUT_UPDATE:Lr,UPDATE_ACTIVE_BREAKPOINT:Nr,INITIALISE_BREAKPOINT:_r,ACTIVE_ADD:Tr,ACTIVE_DELETE:xr,SET_FONTS:Dr,QUEUE_SIGNAL:Mr,SIGNAL_PROCESSED:Br,CACHE_SERIALIZED_VALUE:$r,UPDATE_CACHED_SERIALIZED_VALUE:Gr,CLEAR_SERIALIZED_VALUE_FROM_CACHE:Fr,SET_SETTINGS:jr,SET_CUSTOM_STATE:Wr},Jr={HANDLE_CONFIG:kr,SET_BREAKPOINTS:Rr,CLOSE_PLUGIN:Pr,RAISE_METRIC:Vt,PREPARE_SIGNAL:Xt,DISMISS_OVERLAY:Vr,REPORT_ERROR:zr,LOG:Hr,OPEN_LINK:en},Kr="plugin-overlay",Yr="plugin";function Zr(t){var n;const i=t.schema.styles,o=y(),r={type:(null===(n=t.action)||void 0===n?void 0:n.type)||Vr,payload:{id:Kr,dismissalMethod:t.schema.dismissalMethod}},s=()=>{o(r)},l=wa(),c=Ma(),{tabIndex:d,styles:u,isDisabled:p}=It(l);return e(wo,{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:p,tabIndex:d,"aria-disabled":p,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:void 0,style:Object.assign(Object.assign({cursor:"pointer"},u),c),children:e(vi,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}const Qr={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var Xr;function es({isOpen:n,schema:i,testId:r,children:s}){const l=ln(),c=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),d=m((e=>e.active.has(Yr))),u=y(),p=()=>{u({type:Jr.DISMISS_OVERLAY,payload:{id:Kr,dismissalMethod:"rokt_backdrop"}})};o((()=>{c&&u({type:Kt,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=wa(),{tabIndex:h,isDisabled:v,styles:g}=It(f),b=Ma(),I=i.styles?we(Qr,i.styles):Qr;if(!n)return null;const E=e(vi,{children:e=>a.Children.toArray(i.children.map(((t,n)=>e(t,void 0,r?`${r}-child${n}`:void 0))))});return e(wo,{styles:I,children:({classnames:n})=>{var a;return t("div",{className:null==n?void 0:n.wrapper,style:Object.assign(Object.assign({position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto"},g),b),"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(E,l)]})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(Xr||(Xr={}));const ts={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const ns=p((function({schema:t,testId:n,children:i},a){const o=t.styles?we(ts,t.styles):ts;return e(wo,{styles:o,children:({classnames:o})=>{var r;return e("div",{className:null==o?void 0:o.own,style:{position:"relative",zIndex:"3",outline:"none"},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 is=h((function(e){return{isOpen:e.active.has(Kr)}}))((function(t){return e(es,Object.assign({},t,{children:(n,i)=>e(ns,Object.assign({},t,{ref:i,children:n}))}))}));const as=h((function(e){return{isOpen:e.active.has(Kr)}})),os={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const rs=p((function({schema:t,testId:n,children:i},a){const s=r(null),l=t.styles?we(os,t.styles):os;return o((()=>{if(s.current)return function(e){const t=requestAnimationFrame((()=>{e&&e.style.setProperty("max-height","100%")}));return()=>{cancelAnimationFrame(t)}}(s.current)}),[]),e(wo,{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 ss=as((function(t){return e(es,Object.assign({},t,{children:(n,i)=>e(rs,Object.assign({},t,{ref:i,children:n}))}))}));const ls="DisplayPreset.FULLSCREEN",cs="DisplayPreset.EMBEDDED",ds="DisplayPreset.ATTACHED",us="ERROR",ps="INFO",fs="WARNING";var ys;!function(e){e.PAYPAL="Paypal"}(ys||(ys={}));const ms="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DCUI_SCHEMA_VERSION:"",ROKT_DOMAIN:""};function*hs(e,t,n){(function(e){return"object"==typeof e&&null!==e&&"type"in e&&Object.values(an).includes(e.type)})(n)&&!e.includes(n.type)&&(yield Ve(t.globalDispatch.bind(t),n))}function vs(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 gs(e){switch(typeof e){case"undefined":return"";case"object":return null===e?"":JSON.stringify(e);case"string":return e;default:return String(e)}}function bs(e){return ie(gs,e)}function*Is(e,t){const n=yield ze(e,rt.expanding(10));for(;n;){const e=yield He(n);yield Ve(t,e)}}function*Es(e,t){const n=yield He(e);yield Ve(t,n)}function Ss(e){return!!qt(e)&&(e.rclid&&"RealTime"===e.conversionType&&e.accountID&&e.referralCreativeID)}function*Os(e){for(;;){const t=yield He(e);yield We(t)}}function*ws(e,t){const n=ye(Ae("moduleName"),Ce("orchestrator"),t.payload.additionalInformation||{}),i=Object.assign(Object.assign({},t.payload),{additionalInformation:n?bs(n):{}});try{yield Ve(e,i)}catch(e){}t.payload.level===us&&(yield We({type:Qt,payload:{name:"PLACEMENT_FAILURE"}}),yield We({type:Jr.CLOSE_PLUGIN}))}const As="INVALID_RESPONSE_OBJECT",Cs="FAILED_TO_OPEN_LINK",Ts="NO_PARENT_GUID",xs="FAILED_TO_NOTIFY_INTERACTIVE",Ns="FAILED_TO_ESTABLISH_PARTNER_VALIDATION";var _s=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 Rs(e,t){return n=>n&&n.replace(e,t)}const Ds=Rs(/['""();{}@:[\]!/=]/g,""),Ls=/^(normal|italic|oblique( \d+deg)*)$/i,ks=(e="")=>Ls.test(e)?e:void 0,Ps=Rs(/[;{}@[\]!]/g,"");function js(e){const{fontFamily:t,sources:n}=e,i=_s(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 $s(e=[]){const t=Array.from(document.fonts.values());return Promise.all(e.map((e=>{const n=function(e){return{fontFamily:Ds(e.fontFamily)||"",style:ks(e.style),weight:Ds(e.weight),sources:e.sources.map((e=>Ps(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():js(n).then((()=>{})).catch((e=>`${e}`.includes("SyntaxError")?(n.fontFamily='"'+n.fontFamily+'"',js(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 Gs(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=ms.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((()=>{$s(JSON.parse(n)).catch((e=>{const n={type:zr,payload:{level:ps,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 Fs(e){return null!=e?e:null}function Ms(){return new Set([Kr])}function Bs(e){return e.breakpoint.breakpoints[e.breakpoint.activeBreakpoint]||0}const Us=Te(M(1)),Vs=ie(M(0)),zs=e=>G(xe(j(e)),Vs,Us,le,ge({},["breakpoint","breakpoints"]));function Hs(e){return zs(e.breakpoint.activeBreakpoint)(e)}function Ws(e,t){return e.customStates[`module${t}`]||{}}function qs(e){return`${e.name}:${e.parentGuid}`}function Js(e,t){return!e.processed.includes(qs(t))||(n=t.name,void 0!==xt.find((e=>e===n)));var n}function Ks(){return new Map}const Ys={layout:function(e=Fs(),t){return t.type===Lr?t.payload:e},breakpoint:function(e={breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},t){var n;switch(t.type){case Nr:return Object.prototype.hasOwnProperty.call(e.breakpoints,t.payload.activeBreakpoint)?Object.assign(Object.assign({},e),{activeBreakpoint:t.payload.activeBreakpoint}):e;case _r: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=Ms(),t){var n,i;switch(t.type){case Tr:{const i=new Set(e);return i.add(null===(n=t.payload)||void 0===n?void 0:n.id),i}case xr:{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===Dr?t.payload:e},signal:function(e={queue:[],processed:[]},t){switch(t.type){case Mr:return Ie({queue:n=>Js(e,t.payload.signal)?Re(J(M("signal"),qs),n.concat(t.payload)):n},e);case Br:return Ie({queue:e=>Ne(J(M("signal"),_e({name:t.payload.name,parentGuid:t.payload.parentGuid})))(e),processed:Ee(qs(t.payload))},e);default:return e}},serializableCache:function(e=Ks(),t){switch(t.type){case $r:case Gr:if(t.payload.key&&t.payload.value){return new Map([...e]).set(t.payload.key,t.payload.value)}return e;case Fr:{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===jr?T(((e,t)=>re(t)?e:t),e,t.payload):e},customStates:function(e={root:{}},t){if(t.type===Wr){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*Zs(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 He(a);for(yield We({type:qr.INITIALISE_BREAKPOINT,payload:{activeBreakpoint:e,breakpoints:t.payload}});;)e=yield He(a),yield We({type:qr.UPDATE_ACTIVE_BREAKPOINT,payload:{activeBreakpoint:e}})}catch(e){const n=e;yield We({type:zr,payload:{level:fs,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 qe())&&a.close()}}catch(e){const n=e;yield We({type:zr,payload:{level:us,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 Qs(e,t,n){return st((i=>{const a=e.subscribe((e=>{const t=n(e);t&&i({type:kr,payload:t})}),(e=>{i(e)})),o=t.fonts.subscribe((e=>{i({type:Dr,payload:e})}),(e=>{i(e)}));return()=>{a.unsubscribe(),o.unsubscribe()}}),rt.sliding(2))}var Xs=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"}}),el=Object.freeze({__proto__:null,PartnerMessage:{UpdateCartItem:"V2_UPDATE_CART_ITEM"},PlacementMessage:{CartItemUpdated:"V2_CART_ITEM_UPDATED"}}),tl=Object.freeze({__proto__:null,V1:Xs,V2:el}),nl=Object.freeze({__proto__:null,PartnerMessage:{CartItemInstantPurchaseResponse:"CART_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{CartItemInstantPurchase:"CART_ITEM_INSTANT_PURCHASE"}}),il=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 al="LINK_NAVIGATION_REQUEST";var ol=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 rl={newTab:"_blank",self:"_top",roktWebViewSDK:"roktWebViewSDK",inApp:"inApp",overrideLinkNavigation:"overrideLinkNavigation"};function sl({url:e,urlBehavior:t,external:n},i=window){return ol(this,void 0,void 0,(function*(){if(!e)return null;if("overrideLinkNavigation"===t)return n.partner.send(al,{url:e}).then((()=>null));const a=rl[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 ll=Object.freeze({__proto__:null,openLink:sl});function cl(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:zr,payload:{level:fs,code:a?"COMMUNICATION_FAILURE_WITH_WSDK":n,message:t,additionalInformation:Object.assign(Object.assign({},o),i)}}}var dl=Object.freeze({__proto__:null,makePluginWarningAction:cl});function ul(e){return null!=e&&"object"==typeof e&&"ref"in e&&"object"==typeof e.ref&&!Array.isArray(e.ref)&&null!=e.ref}var pl=Object.freeze({__proto__:null,isWindow:ul}),fl=Object.assign(Object.assign(Object.assign({},ll),dl),pl);function*yl(e=10){(yield Je((e=>e.signal.queue.length>0)))&&(yield mt(30),e>=1&&(yield*yl(e-1)))}function*ml(e){try{yield*yl(10),yield pt(e.close)}catch(e){const t=fl.makePluginWarningAction(e,"Failed to close the plugin","FAILED_TO_CLOSE_PLUGIN");yield ft(t)}}function*hl(e,{payload:t}){var n;if("string"==typeof(n=t.name)&&Dt.includes(n))switch(t.name){case"V2_CART_ITEM_UPDATED":case"CART_ITEM_INSTANT_PURCHASE":case"REALTIME_OFFER_FULFILLMENT_REFERRAL":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 vl=B("FAILED_TO_PARSE_CONFIG","code");function*gl(e,t){var n;const i=yield pt(Qs,e.configService,e.themeService,t);for(;;)try{const e=yield yt(i);yield ft(e)}catch(e){const t=e;yield ft({type:zr,payload:{level:us,code:vl(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*bl(e,t){yield ct([dt(gl,e,t),ut(Qt,hl,e.partnerInteractionService)])}function Il(e){switch(e){case"ATTACHED":return ds;case"EMBEDDED":return cs;default:return ls}}function*El(e,t){const n={preset:Il(t)};yield pt(e.setDisplaySettings,n),yield ft({type:qr.ACTIVE_ADD,payload:{id:Yr}})}function*Sl(e,t){var n;const i=null!==(n=t.payload.data)&&void 0!==n?n:{};try{yield Ve(e,{code:t.payload.code,level:ps,message:t.payload.message||"Plugin Generic Log",additionalInformation:bs(i)})}catch(e){}}function*Ol(e){yield We({type:qr.QUEUE_SIGNAL,payload:{signal:e.payload}}),yield We({type:Ur})}function*wl(e){yield We({type:qr.QUEUE_SIGNAL,payload:e.payload}),yield We({type:Ur})}function*Al(e,t){const n=yield Je((e=>e.signal.queue.filter((t=>Js(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*Cl(e.signal,i(t));break;case"SignalDismissal":yield*Tl(e.signal,i(t));break;case"SignalInstantPurchaseDismissal":yield*xl(e.signal,i(t));break;case"SignalLoadStart":yield*Nl(e.signal,i(t));break;case"SignalGatedResponse":case"SignalResponse":yield*_l(e.signal,i(t,!0));break;case"SignalUserInteraction":yield*Rl(e.signal,i(t));break;case"SignalCartItemQuantitySelected":yield*Dl(e.signal,i(t));break;case"SignalCartItemInstantPurchaseInitiated":yield*Ll(e.signal,i(t));break;case"SignalCartItemInstantPurchase":yield*kl(e.signal,i(t));break;case"SignalCartItemInstantPurchaseFailure":yield*Pl(e.signal,i(t))}yield We({type:qr.SIGNAL_PROCESSED,payload:e.signal})}function i(t,n=!1){return function(i,a,o){return t?Ve(e.prepareExternalSignal,t.key,i,a,o):Ve(n?e.issueSignalSync:e.issueSignal,i,a,o)}}}function*Cl(e,t){try{yield t(e.name,e.parentGuid)}catch(t){yield jl(e,t)}}function*Tl(e,t){try{yield t(e.name,e.parentGuid,e.dismissalMethod?{objectData:{dismissalMethod:e.dismissalMethod}}:void 0)}catch(t){yield jl(e,t)}}function*xl(e,t){try{yield t(e.name,e.parentGuid,void 0)}catch(t){yield jl(e,t)}}function*Nl(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 jl(e,t)}}function*_l(e,t){try{yield t(e.name,e.parentGuid,function(e){if("Url"===e.responseActionPayload.name)return{transformedTrafficURL:e.responseActionPayload.transformedTrafficURL}}(e))}catch(t){yield jl(e,t)}}function*Rl(e,t){const n=e.parentGuid?e.parentGuid:yield Je((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 jl(e,t)}}function*Dl(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 jl(e,t)}}function*Ll(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 jl(e,t)}}function*kl(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 jl(e,t)}}function*Pl(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 jl(e,t)}}function jl(e,t){const n=fl.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 We(n)}function*$l(e){yield We({type:Wr,payload:e.payload})}function*Gl(e,t){if("Interactive"===t.payload.name)try{yield*function*(e){const t="METRIC";(yield Je((e=>e.serializableCache.has(t))))||(yield Ve(e.notifyInteractive),yield We({type:$r,payload:{key:t,value:"Interactive"}}))}(e)}catch(e){const t=e;yield*function*(e){var t;yield We({type:zr,payload:{level:ps,code:xs,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*Fl(e,t){const n=e.context.getOverrideLinkNavigation()?"overrideLinkNavigation":t.payload.urlBehaviour;try{"inApp"===n?yield Ve(e.createChildPlugin,{name:"url-modal",config:{url:t.payload.url,method:"GET"}}):yield Ve(sl,{url:t.payload.url,urlBehavior:n,external:e})}catch(e){yield We(cl(e,"Failed to open link",Cs,{url:t.payload.url,urlBehaviour:n}))}}function*Ml(e){const t=yield Je((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield We({type:qr.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield We({type:Pr}),t?yield We({type:Kt,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}):yield We({type:zr,payload:{level:ps,code:Ts,message:"ParentGuid does not exist"}})}const Bl=h((function(e){return{isOpen:e.active.has(Kr)}})),Ul="Minimized",Vl=()=>{const e=r(null),t=r(null),n=r(null),i=r(null),a=r(null),s=mi(0,(e=>e.customStates[Ul])),l=fi(),c=wa(),d=r(0),p=r(!1),f=r(0),y=r([]),m=r(void 0),{isDisabled:h}=It(c),v=u((()=>{k(),m.current=void 0,p.current=!1,R(!0);g()?S():_(0)}),[]),g=()=>{const e=N();return s?e<=-.2:e>=.2};o((()=>{s?(w(),l(Hl(!0))):(A(),l(Hl(!1)))}),[s,l]),o((()=>{requestAnimationFrame((()=>{L(!s,n),L(!!s,i),D()}))}),[]);const b=u((e=>{if(t.current){e.preventDefault();const t=E(e);_(t)}}),[t]),I=u((e=>{Date.now()-f.current<200||(f.current=Date.now(),s?O(!1):p.current||h||(p.current=!0,x(),m.current=zl(e),R(!1),P()))}),[s,h]);o((()=>{const e=t.current;return e&&(e.addEventListener("mousedown",I),e.addEventListener("touchstart",I)),()=>{null==e||e.removeEventListener("mousedown",I),null==e||e.removeEventListener("touchstart",I)}}),[t,I]);const E=e=>{var t,n;return(null!==(t=zl(e))&&void 0!==t?t:0)-(null!==(n=m.current)&&void 0!==n?n:0)},S=()=>{O(!s)},O=e=>{const t=(e=>({type:Zt,payload:{key:Ul,value:e?1:0}}))(e);l(t)},w=()=>{var e,t,a,o;const r=null!==(t=null===(e=n.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,s=(null!==(o=null===(a=i.current)||void 0===a?void 0:a.clientHeight)&&void 0!==o?o:0)-r;R(!0),D(!0,!0),_(s),L(!1,n),L(!0,i),j()},A=()=>{R(!0),D(!0,!1),_(0),m.current=void 0,L(!0,n),L(!1,i),$()},C=u((()=>{p.current&&(T(),requestAnimationFrame(C))}),[]),T=()=>{y.current.push({yPosition:d.current,timestamp:Date.now()}),y.current.length>20&&y.current.shift()},x=u((()=>{y.current=[],C()}),[C]),N=()=>{const e=y.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},_=e=>{const n=Math.round(e);d.current=n,t.current&&(t.current.style.transform=`translateY(${n}px)`)},R=e=>{e?t.current&&(t.current.style.transition="transform .2s"):t.current&&(t.current.style.transition="")},D=(e,t=!1)=>{const a=t?i:n,o=t?n:i;o.current&&(o.current.style.transition="opacity .5s"),a.current&&(a.current.style.transition="opacity .2s")},L=(e,t)=>{const n=t.current;if(n){const t=e?0:1;n.style.opacity=`${t}`,n.style.pointerEvents=e?"none":"auto"}},k=u((()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",b),document.removeEventListener("touchend",v)}),[b,v]),P=u((()=>{St()?(document.addEventListener("touchmove",b,{passive:!1}),document.addEventListener("touchend",v)):(document.addEventListener("mousemove",b,{passive:!1}),document.addEventListener("mouseup",v))}),[b,v]),j=()=>{const t=e.current;t&&(a.current=setTimeout((()=>{var e;const i=((null===(e=n.current)||void 0===e?void 0:e.clientHeight)||0)+1;t.style.height=i+"px"}),200))},$=()=>{a.current&&clearTimeout(a.current),e.current&&(e.current.style.height="100000px")};return{wrapperRef:e,containerRef:t,minimizedChildRef:n,maximizedChildRef:i}};function zl(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}const Hl=e=>({type:Kt,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}}),Wl={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var ql;function Jl({schema:t,testId:n}){const i=ln(),a=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),s=m((e=>e.active.has(Yr))),l=r(null),c=y(),d=()=>{c({type:Jr.DISMISS_OVERLAY,payload:{id:Kr,dismissalMethod:"rokt_backdrop"}})},u=mi(0,(e=>e.customStates[Ul]));o((()=>{p(!!u)}),[u]);const p=e=>{const t=l.current;t&&(e?t.style.opacity="0":(t.style.display="flex",t.style.opacity="1"))};o((()=>{a&&c({type:Kt,payload:{name:"SignalActivation",parentGuid:a}})}),[a]),o((()=>{s&&requestAnimationFrame((()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.focus()}))}),[s]);const f=wa(),{tabIndex:h,isDisabled:v,styles:g}=It(f),b=t.styles?we(Wl,t.styles):Wl;return e(wo,{styles:b,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:"1",transition:"opacity 0.2s ease-in-out"},g),"aria-label":null!==(a=t.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":v,role:"dialog","aria-modal":!0,tabIndex:h,"data-testid":n,"data-e2e":"Overlay-Wrapper",ref:l,children:e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:t.allowBackdropToClose?d:void 0,"data-testid":n&&`${n}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function Kl(){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"}(ql||(ql={}));const Yl={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};function Zl(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(Ql,Object.assign({},t,{slots:n,currentIndex:i}))}function Ql(n){const{wrapperRef:i,containerRef:a,minimizedChildRef:o,maximizedChildRef:r}=Vl();return n.isOpen?t("div",{ref:i,style:{height:"100000px"},children:[e(Jl,Object.assign({},n)),e(ec,Object.assign({},n,{containerRef:a,minimizedChildRef:o,maximizedChildRef:r}))]}):null}const Xl=Me`
|
|
57
|
+
`}}(l,u);if(!y)throw new Error("No custom state key provided for state trigger node.");const C={type:Qt,payload:{key:y,value:null!=f?f:1}},O={type:Kt,payload:{name:"SignalUserInteraction",action:"Swipe",context:"SlideStateTrigger"}},x=e.schema.styles?Bt(Qo,e.schema.styles):Qo,A=r(null),T=r(null),N=r(null),L=r(!1),_=r(void 0),{isDisabled:R}=It(d);o((()=>{if(t)return St()?(document.addEventListener("touchmove",P),document.addEventListener("touchend",D)):(document.addEventListener("mousemove",P),document.addEventListener("mouseup",D)),M}),[t]);const D=()=>{M(),_.current=void 0,n(!1),i||(F(!0),L.current?(G(j()),$()):G(0))},k=e=>{t||i||R||(_.current=tr(e),F(!1),n(!0))},P=e=>{var t,n;if(er(N)){const i=Math.min(Math.max(0,(null!==(t=tr(e))&&void 0!==t?t:0)-(null!==(n=_.current)&&void 0!==n?n:0)),j());G(i),i/j()*100>=75?L.current=!0:L.current=!1}},$=()=>{var e,t;s(!0),p(C),p(O),null===(t=null===(e=er(A).parentElement)||void 0===e?void 0:e.parentElement)||void 0===t||t.focus()},j=()=>er(A).getBoundingClientRect().width-er(N).getBoundingClientRect().width,G=e=>{var t;er(N).style.transform=`translateX(${e}px)`,er(T).style.transform=`translateX(${e+(null===(t=er(N))||void 0===t?void 0:t.getBoundingClientRect().width)/2}px)`},F=e=>{e?(er(N).style.transition="transform .2s",er(T).style.transition="transform .2s"):(er(N).style.transition="",er(T).style.transition="")},M=()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",D),document.removeEventListener("touchmove",P),document.removeEventListener("touchend",D)};return a.createElement(Co,{styles:x},(({classnames:t})=>{var n,o,r,s,l,c;return a.createElement("div",{className:`${g}`,"data-testid":e.testId,"data-e2e":"SlideStateTrigger"},a.createElement("div",{className:`${b} ${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==m?void 0:m.value)?a.createElement("div",{className:`${S} ${null!==(o=null==t?void 0:t.label)&&void 0!==o?o:""}`,"data-testid":e.testId&&`${e.testId}-label`},m.value):null,a.createElement("div",{className:`${I} ${null!==(r=null==t?void 0:t.fill)&&void 0!==r?r:""}`,ref:T,"data-testid":e.testId&&`${e.testId}-fill`}),a.createElement("div",{className:`${E} ${null!==(s=null==t?void 0:t.thumb)&&void 0!==s?s:""}`,ref:N,"data-testid":e.testId&&`${e.testId}-thumb`,"data-e2e":"SlideStateTrigger-thumb",onMouseDown:k,onTouchStart:k},null!==(l=null==v?void 0:v.icon)&&void 0!==l?l:"ArrowForward")),a.createElement("button",{className:w,"aria-label":null!=h?h:void 0,onClick:$,disabled:i||R,"data-testid":e.testId&&`${e.testId}-button`},null!==(c=null==m?void 0:m.value)&&void 0!==c?c:"Unlock Offers"))}))}function er(e){if(!e.current)throw new Error("Unexpected missing reference to required SlideStateTrigger Element");return e.current}function tr(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX}function nr(e){const t=Ii();return a.createElement(Co,{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,Vt(i,e.testId))))))}))}function ir(e){const t=xa(),n=mi(),i=e.schema.customStateKey,o=vi(0,(e=>e.customStates[i])),{tabIndex:r,styles:s,isDisabled:l}=It(t),c=()=>{n({type:Qt,payload:{key:i,value:o?0:1}})};return a.createElement(Co,{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(bi,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function ar(e){const t=Ii();return a.createElement(Co,{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,Vt(i,e.testId))))))}))}function or(e){const t=Ii();return a.createElement(Co,{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,Vt(i,e.testId))))))}))}const rr=s({extensions:{ctx:new Map,cache:[]}}),sr=()=>l(rr).extensions;function lr({extensions:e,extendStore:t,children:n}){const i=sr(),o=new Map([...i.ctx,...e.ctx]),r=i.cache.concat(e.cache);return a.createElement(rr.Provider,{value:{extensions:{ctx:o,cache:r},extendStore:t}},n)}function cr(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 dr({data:e}){const t=cr(sr(),e);var n;if((e=>{const{extendStore:t,extensions:n}=l(rr);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 ur(e,t){if(Et("Extension",e))return a.createElement(dr,{data:e.node.data})}function pr(e){const t=Ra(),n=xi(),i=qi(),r=Ii(),s=mi(),l=d((()=>n.catalogItems||[]),[n]),c=e=>i({data:e},"catalogItem");return o((()=>{for(const e of l)s({type:Kt,payload:{name:"SignalImpression",parentGuid:e.instanceGuid}})}),[l,s]),l.length>0?a.createElement(Co,{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($a,{context:n},a.createElement(_a,{value:t(n)},a.createElement(Wi,{value:c(n)},r(e.schema.template,void 0,Vt(i,e.testId))))))))))):null}const yr={BasicText:(e,t)=>Po(e,t,!0),StaticLink:(e,t)=>qo(e,t,!0)};function fr(e){const t=Ii();return a.createElement(Ei,{value:t,overrides:yr},a.createElement(bi,null,(t=>a.createElement(Co,{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,Vt(i,e.testId))))))})))))}function mr(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Vt(i,n)))))}function hr(e){const t=xa(),n=mi(),i=Ii(),o=qi(),{event:r}=e.schema,{tabIndex:s,styles:l,isDisabled:c}=It(t),d=W((e=>o(e)),r.data||{}),u=()=>{n({type:Xt,payload:{name:r.type,body:{offerId:d.providerOfferId,title:d.title,description:d.description}}})};return a.createElement(Co,{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(Wi,{value:o},(null==t?void 0:t.own)?function(e,t,n,i,o){return a.createElement(Yi,{value:n(t)},mr(e,i,o))}(e.schema.children,t.own,n,i,e.testId):mr(e.schema.children,i,e.testId)))}))}function vr(e){const t=mi(),n=e.schema.delay?e.schema.delay:1,i=e.schema.customStateKey,a=vi(0,(e=>e.customStates[i]));return function({delay:e,callback:t}){const n=r(null);o((()=>{n.current=setTimeout(t,e)}),[])}({delay:n,callback:()=>{t({type:Qt,payload:{key:i,value:a?0:1}})}}),null}function gr(e){return()=>{throw new Rt("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 br={Column:function(e,t){if("Column"===e.type)return a.createElement(Oo,{schema:e.node,testId:t})},Row:function(e,t){if("Row"===e.type)return a.createElement(xo,{schema:e.node,testId:t})},StaticImage:function(e,t){if("StaticImage"===e.type)return a.createElement(Go,{schema:e.node,testId:t})},DataImage:function(e,t){if("DataImage"===e.type)return a.createElement(Fo,{schema:e.node,testId:t})},CreativeResponse:function(e,t){if("CreativeResponse"===e.type)return a.createElement(jo,{schema:e.node,testId:t})},OneByOneDistribution:gr("OneByOneDistribution"),StackedDistribution:gr("StackedDistribution"),CarouselDistribution:gr("CarouselDistribution"),GroupedDistribution:gr("GroupedDistribution"),ProgressIndicator:gr("ProgressIndicator"),ProgressControl:gr("ProgressControl"),When:function(e,t){if("When"===e.type)return a.createElement(So,{schema:e.node,testId:t})},Overlay:gr("Overlay"),CloseButton:gr("CloseButton"),RichText:function(e,t){if("RichText"===e.type)return a.createElement(Do,{schema:e.node,testId:t})},BasicText:Po,StaticLink:qo,DataIcon:function(e,t){if("DataIcon"===e.type)return a.createElement(Yo,{schema:e.node,testId:t})},StaticIcon:function(e,t){if("StaticIcon"===e.type)return a.createElement(Bo,{schema:e.node,testId:t})},ZStack:function(e,t){if("ZStack"===e.type)return a.createElement(Zo,{schema:e.node,testId:t})},FlowRow:function(e,t){if("FlowRow"===e.type)return a.createElement(nr,{schema:e.node,testId:t})},SlideStateTrigger:function(e,t){if("SlideStateTrigger"===e.type)return a.createElement(Xo,{schema:e.node,testId:t})},ToggleButtonStateTrigger:function(e,t){if("ToggleButtonStateTrigger"===e.type)return a.createElement(ir,{schema:e.node,testId:t})},PartnerEventButtonTrigger:function(e,t){if("PartnerEventButtonTrigger"===e.type)return a.createElement(hr,{schema:e.node,testId:t})},TimerStateTrigger:function(e,t){if("TimerStateTrigger"===e.type)return a.createElement(vr,{schema:e.node})},CatalogStackedCollection:function(e,t){if("CatalogStackedCollection"===e.type)return a.createElement(pr,{schema:e.node,testId:t})},CatalogResponseButton:gr("CatalogResponseButton"),ScrollableRow:function(e,t){if("ScrollableRow"===e.type)return a.createElement(ar,{schema:e.node,testId:t})},ScrollableColumn:function(e,t){if("ScrollableColumn"===e.type)return a.createElement(or,{schema:e.node,testId:t})},EscapeHatch:ur,BottomSheet:gr("BottomSheet"),CatalogQuantityOption:gr("CatalogQuantityOption"),CatalogRadioGroup:gr("CatalogRadioGroup"),CatalogQuantityCounter:gr("CatalogQuantityCounter"),InlineContainer:function(e,t){if("InlineContainer"===e.type)return a.createElement(fr,{schema:e.node,testId:t})}};function Ir(e){return function(t,n,i){const o=n&&n[t.type],r=null!=o?o:br[t.type];return a.createElement(Vo,{schema:t,reporter:e},r&&r(t,i)||function(e){throw new Rt("FAILED_CREATING_LAYOUT_NODE",`Failed to create layout node ${JSON.stringify(e)}`)}(t))}}const Er={transformLinksToAnchorText:function(e={}){return{data:W((e=>Li(e)?`<a target="_blank" href="${e.url}">${e.title}</a>`:""),e)}}};function Sr(e){const{childLayouts:t}=e,n=mi(),[i,a]=d((()=>{const e=we(M("childLayoutId"),t);return[e,W((e=>e.childLayoutSchema.predicates),e)]}),[t]),r=fo(a);o((()=>{Object.entries(r).forEach((([e,t])=>{const a=i[e];t&&a&&n({type:on,payload:a})}))}),[r,i,n])}function wr(e){const{settings:t,dispatch:n,children:i}=e,r=Ui(t.offerData.creative.copy||{})(Er.transformLinksToAnchorText(t.offerData.creative.links),"creativeLink"),s=Ir(t.logger),[l,d]=c("ENABLED");return o((()=>t.gateway.onInteractivityChange(d)),[t]),cn(t.rootElement,n),a.createElement(Ki.Provider,{value:"VARIANT"},a.createElement(Si.Provider,{value:t.rootElement},a.createElement(Ga.Provider,{value:t.pluginId},a.createElement(Ea,{context:t.gateway},a.createElement(wa,{context:t.layoutSchema},a.createElement(Ma.Provider,{value:t.schemaVersion},a.createElement(Oi,{context:t.offerData},a.createElement(_a,{value:Aa(t.offerData.creative)},a.createElement(Oa.Provider,{value:l},a.createElement(Ei,{value:s},a.createElement(Qi.Provider,{value:t.offerPositionIndex},a.createElement(fi.Provider,{value:n},a.createElement(Wi,{value:r},a.createElement(Cr,null,a.createElement(Sr,{childLayouts:t.childLayouts}),i))))))))))))))}function Cr(e){var t;const{children:n}=e,i=Fa(),r=function(){const[e,t]=c(null),n=l(Ia).get();return o((()=>n.onGlobalStateChange((n=>{$(n,e)||t(n)}))),[n]),e}(),s=l(Si)||void 0,d=Xi(),p=u((e=>pi(e,i,d,s)),[s]);return r?a.createElement(Yi,{value:p(Object.values(null!==(t=null==r?void 0:r.breakpoint.breakpoints)&&void 0!==t?t:{}))},a.createElement(hi.Provider,{value:r},n)):null}function Or(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 xr(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?mo(e):ho(e),o.current.isRunning=!1},r.oncancel=()=>{"in"===t?mo(e):ho(e),o.current.isRunning=!1},()=>{r.finish()}}return"in"===t?mo(e):ho(e),()=>{}}const Ar={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 Tr({visible:e,effect:t,children:n,parentElement:i,containerClassName:s}){const[l,d]=c(e),u=r(null),p=r({isRunning:!1}),y=vo(t);return o((()=>{const t=new ResizeObserver((function(t){i&&e&&!p.current.isRunning&&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&&(mo(u.current),t.observe(u.current)),()=>{t.disconnect()}}),[e,i]),o((()=>e&&!l&&u.current&&i?(d(!0),xr(u.current,"in",Ar[t.type].in,y,i,p)):!e&&l&&u.current&&i?(d(!1),xr(u.current,"out",Ar[t.type].out,y/2,i,p)):()=>{}),[e,i,y]),a.createElement("div",{ref:u,style:{display:"none"},className:s},n)}function Nr(e){const t=Ii();return a.createElement(Co,{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 Lr="ACTIVE/ADD",_r="ACTIVE/DELETE",Rr="BREAKPOINT/UPDATE_ACTIVE",Dr="BREAKPOINT/INITIALISE",kr="BREAKPOINT/SET_BREAKPOINTS",Pr="FONTS/SET",$r="LAYOUT/UPDATE",jr="CONFIG/HANDLE",Gr="PLUGIN/CLOSE_PLUGIN",Fr="SETTINGS/SET",Mr="CACHE/ADD_SERIALIZED_VALUE",Br="CACHE/UPDATE_SERIALIZED_VALUE",Ur="CACHE/CLEAR_SERIALIZED_VALUE",Vr="SIGNAL/QUEUE",zr="SIGNAL/PROCESSED",Hr="SIGNAL/PROCESS",Wr="OVERLAY/DISMISS_OVERLAY",qr="ERROR/REPORT",Jr="LOG",Yr="CUSTOM_STATES/SET",Kr={LAYOUT_UPDATE:$r,UPDATE_ACTIVE_BREAKPOINT:Rr,INITIALISE_BREAKPOINT:Dr,ACTIVE_ADD:Lr,ACTIVE_DELETE:_r,SET_FONTS:Pr,QUEUE_SIGNAL:Vr,SIGNAL_PROCESSED:zr,CACHE_SERIALIZED_VALUE:Mr,UPDATE_CACHED_SERIALIZED_VALUE:Br,CLEAR_SERIALIZED_VALUE_FROM_CACHE:Ur,SET_SETTINGS:Fr,SET_CUSTOM_STATE:Yr},Zr={HANDLE_CONFIG:jr,SET_BREAKPOINTS:kr,CLOSE_PLUGIN:Gr,RAISE_METRIC:zt,PREPARE_SIGNAL:en,DISMISS_OVERLAY:Wr,REPORT_ERROR:qr,LOG:Jr,OPEN_LINK:tn},Qr="plugin-overlay",Xr="plugin";function es(t){var n;const i=t.schema.styles,o=f(),r={type:(null===(n=t.action)||void 0===n?void 0:n.type)||Wr,payload:{id:Qr,dismissalMethod:t.schema.dismissalMethod}},s=()=>{o(r)},l=xa(),{tabIndex:c,styles:d,isDisabled:u}=It(l);return e(Co,{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(bi,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}const ts={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var ns;function is({isOpen:n,schema:i,testId:r,children:s}){const l=dn(),c=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),d=m((e=>e.active.has(Xr))),u=f(),p=()=>{u({type:Zr.DISMISS_OVERLAY,payload:{id:Qr,dismissalMethod:"rokt_backdrop"}})};o((()=>{c&&u({type:Kt,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 y=xa(),{tabIndex:h,isDisabled:v,styles:g}=It(y),b=i.styles?Ce(ts,i.styles):ts;if(!n)return null;const I=e(bi,{children:e=>a.Children.toArray(i.children.map(((t,n)=>e(t,void 0,r?`${r}-child${n}`:void 0))))});return e(Co,{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"}(ns||(ns={}));const as={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const os=p((function({schema:t,testId:n,children:i},a){const o=t.styles?Ce(as,t.styles):as;return e(Co,{styles:o,children:({classnames:o})=>{var r;return e("div",{className:null==o?void 0:o.own,style:{position:"relative",zIndex:"3",outline:"none"},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 rs=h((function(e){return{isOpen:e.active.has(Qr)}}))((function(t){return e(is,Object.assign({},t,{children:(n,i)=>e(os,Object.assign({},t,{ref:i,children:n}))}))}));const ss=h((function(e){return{isOpen:e.active.has(Qr)}})),ls={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const cs=p((function({schema:t,testId:n,children:i},a){const s=r(null),l=t.styles?Ce(ls,t.styles):ls;return o((()=>{if(s.current)return function(e){const t=requestAnimationFrame((()=>{e&&e.style.setProperty("max-height","100%")}));return()=>{cancelAnimationFrame(t)}}(s.current)}),[]),e(Co,{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 ds=ss((function(t){return e(is,Object.assign({},t,{children:(n,i)=>e(cs,Object.assign({},t,{ref:i,children:n}))}))}));const us="DisplayPreset.FULLSCREEN",ps="DisplayPreset.EMBEDDED",ys="DisplayPreset.ATTACHED",fs="ERROR",ms="INFO",hs="WARNING";var vs;!function(e){e.PAYPAL="Paypal"}(vs||(vs={}));const gs="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DCUI_SCHEMA_VERSION:"",ROKT_DOMAIN:""};function*bs(e,t,n){(function(e){return"object"==typeof e&&null!==e&&"type"in e&&Object.values(rn).includes(e.type)})(n)&&!e.includes(n.type)&&(yield ze(t.globalDispatch.bind(t),n))}function Is(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 Es(e){switch(typeof e){case"undefined":return"";case"object":return null===e?"":JSON.stringify(e);case"string":return e;default:return String(e)}}function Ss(e){return ie(Es,e)}function*ws(e,t){const n=yield He(e,rt.expanding(10));for(;n;){const e=yield We(n);yield ze(t,e)}}function*Cs(e,t){const n=yield We(e);yield ze(t,n)}function Os(e){return!!Jt(e)&&(e.rclid&&"RealTime"===e.conversionType&&e.accountID&&e.referralCreativeID)}function*xs(e){for(;;){const t=yield We(e);yield qe(t)}}function*As(e,t){const n=fe(Oe("moduleName"),xe("orchestrator"),t.payload.additionalInformation||{}),i=Object.assign(Object.assign({},t.payload),{additionalInformation:n?Ss(n):{}});try{yield ze(e,i)}catch(e){}t.payload.level===fs&&(yield qe({type:Xt,payload:{name:"PLACEMENT_FAILURE"}}),yield qe({type:Zr.CLOSE_PLUGIN}))}const Ts="INVALID_RESPONSE_OBJECT",Ns="FAILED_TO_OPEN_LINK",Ls="NO_PARENT_GUID",_s="FAILED_TO_NOTIFY_INTERACTIVE",Rs="FAILED_TO_ESTABLISH_PARTNER_VALIDATION";var Ds=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 ks(e,t){return n=>n&&n.replace(e,t)}const Ps=ks(/['""();{}@:[\]!/=]/g,""),$s=/^(normal|italic|oblique( \d+deg)*)$/i,js=(e="")=>$s.test(e)?e:void 0,Gs=ks(/[;{}@[\]!]/g,"");function Fs(e){const{fontFamily:t,sources:n}=e,i=Ds(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 Ms(e=[]){const t=Array.from(document.fonts.values());return Promise.all(e.map((e=>{const n=function(e){return{fontFamily:Ps(e.fontFamily)||"",style:js(e.style),weight:Ps(e.weight),sources:e.sources.map((e=>Gs(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():Fs(n).then((()=>{})).catch((e=>`${e}`.includes("SyntaxError")?(n.fontFamily='"'+n.fontFamily+'"',Fs(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 Bs(e){const t=f(),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=gs.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((()=>{Ms(JSON.parse(n)).catch((e=>{const n={type:qr,payload:{level:ms,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 Us(e){return null!=e?e:null}function Vs(){return new Set([Qr])}function zs(e){return e.breakpoint.breakpoints[e.breakpoint.activeBreakpoint]||0}const Hs=Ae(M(1)),Ws=ie(M(0)),qs=e=>G(Te($(e)),Ws,Hs,le,ge({},["breakpoint","breakpoints"]));function Js(e){return qs(e.breakpoint.activeBreakpoint)(e)}function Ys(e,t){return e.customStates[`module${t}`]||{}}function Ks(e){return`${e.name}:${e.parentGuid}`}function Zs(e,t){return!e.processed.includes(Ks(t))||(n=t.name,void 0!==Nt.find((e=>e===n)));var n}function Qs(){return new Map}const Xs={layout:function(e=Us(),t){return t.type===$r?t.payload:e},breakpoint:function(e={breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},t){var n;switch(t.type){case Rr:return Object.prototype.hasOwnProperty.call(e.breakpoints,t.payload.activeBreakpoint)?Object.assign(Object.assign({},e),{activeBreakpoint:t.payload.activeBreakpoint}):e;case Dr: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=Vs(),t){var n,i;switch(t.type){case Lr:{const i=new Set(e);return i.add(null===(n=t.payload)||void 0===n?void 0:n.id),i}case _r:{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===Pr?t.payload:e},signal:function(e={queue:[],processed:[]},t){switch(t.type){case Vr:return Ie({queue:n=>Zs(e,t.payload.signal)?_e(J(M("signal"),Ks),n.concat(t.payload)):n},e);case zr:return Ie({queue:e=>Ne(J(M("signal"),Le({name:t.payload.name,parentGuid:t.payload.parentGuid})))(e),processed:Ee(Ks(t.payload))},e);default:return e}},serializableCache:function(e=Qs(),t){switch(t.type){case Mr:case Br:if(t.payload.key&&t.payload.value){return new Map([...e]).set(t.payload.key,t.payload.value)}return e;case Ur:{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===Fr?A(((e,t)=>re(t)?e:t),e,t.payload):e},customStates:function(e={root:{}},t){if(t.type===Yr){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*el(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:Kr.INITIALISE_BREAKPOINT,payload:{activeBreakpoint:e,breakpoints:t.payload}});;)e=yield We(a),yield qe({type:Kr.UPDATE_ACTIVE_BREAKPOINT,payload:{activeBreakpoint:e}})}catch(e){const n=e;yield qe({type:qr,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 Je())&&a.close()}}catch(e){const n=e;yield qe({type:qr,payload:{level:fs,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 tl(e,t,n){return st((i=>{const a=e.subscribe((e=>{const t=n(e);t&&i({type:jr,payload:t})}),(e=>{i(e)})),o=t.fonts.subscribe((e=>{i({type:Pr,payload:e})}),(e=>{i(e)}));return()=>{a.unsubscribe(),o.unsubscribe()}}),rt.sliding(2))}var nl=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"}}),il=Object.freeze({__proto__:null,PartnerMessage:{UpdateCartItem:"V2_UPDATE_CART_ITEM"},PlacementMessage:{CartItemUpdated:"V2_CART_ITEM_UPDATED"}}),al=Object.freeze({__proto__:null,V1:nl,V2:il}),ol=Object.freeze({__proto__:null,PartnerMessage:{CartItemInstantPurchaseResponse:"CART_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{CartItemInstantPurchase:"CART_ITEM_INSTANT_PURCHASE"}}),rl=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 sl="LINK_NAVIGATION_REQUEST",ll="REALTIME_OFFER_FULFILLMENT_SUCCESS",cl="REALTIME_OFFER_FULFILLMENT_FAILURE";var dl=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 ul={newTab:"_blank",self:"_top",roktWebViewSDK:"roktWebViewSDK",inApp:"inApp",overrideLinkNavigation:"overrideLinkNavigation"};function pl({url:e,urlBehavior:t,external:n},i=window){return dl(this,void 0,void 0,(function*(){if(!e)return null;if("overrideLinkNavigation"===t)return n.partner.send(sl,{url:e}).then((()=>null));const a=ul[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 yl=Object.freeze({__proto__:null,openLink:pl});function fl(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:qr,payload:{level:hs,code:a?"COMMUNICATION_FAILURE_WITH_WSDK":n,message:t,additionalInformation:Object.assign(Object.assign({},o),i)}}}var ml=Object.freeze({__proto__:null,makePluginWarningAction:fl});function hl(e){return null!=e&&"object"==typeof e&&"ref"in e&&"object"==typeof e.ref&&!Array.isArray(e.ref)&&null!=e.ref}var vl=Object.freeze({__proto__:null,isWindow:hl}),gl=Object.assign(Object.assign(Object.assign({},yl),ml),vl);function*bl(e=10){(yield Ye((e=>e.signal.queue.length>0)))&&(yield mt(30),e>=1&&(yield*bl(e-1)))}function*Il(e){try{yield*bl(10),yield pt(e.close)}catch(e){const t=gl.makePluginWarningAction(e,"Failed to close the plugin","FAILED_TO_CLOSE_PLUGIN");yield yt(t)}}function*El(e,{payload:t}){var n;if("string"==typeof(n=t.name)&&Dt.includes(n))switch(t.name){case"V2_CART_ITEM_UPDATED":case"CART_ITEM_INSTANT_PURCHASE":case"UPSELL_CREATIVE_SENT":case"REALTIME_OFFER_FULFILLMENT_REFERRAL":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 Sl=B("FAILED_TO_PARSE_CONFIG","code");function*wl(e,t){var n;const i=yield pt(tl,e.configService,e.themeService,t);for(;;)try{const e=yield ft(i);yield yt(e)}catch(e){const t=e;yield yt({type:qr,payload:{level:fs,code:Sl(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*Cl(e,t){yield ct([dt(wl,e,t),ut(Xt,El,e.partnerInteractionService)])}function Ol(e){switch(e){case"ATTACHED":return ys;case"EMBEDDED":return ps;default:return us}}function*xl(e,t){const n={preset:Ol(t)};yield pt(e.setDisplaySettings,n),yield yt({type:Kr.ACTIVE_ADD,payload:{id:Xr}})}function*Al(e,t){var n;const i=null!==(n=t.payload.data)&&void 0!==n?n:{};try{yield ze(e,{code:t.payload.code,level:ms,message:t.payload.message||"Plugin Generic Log",additionalInformation:Ss(i)})}catch(e){}}function*Tl(e){yield qe({type:Kr.QUEUE_SIGNAL,payload:{signal:e.payload}}),yield qe({type:Hr})}function*Nl(e){yield qe({type:Kr.QUEUE_SIGNAL,payload:e.payload}),yield qe({type:Hr})}function*Ll(e,t){const n=yield Ye((e=>e.signal.queue.filter((t=>Zs(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*_l(e.signal,i(t));break;case"SignalDismissal":yield*Rl(e.signal,i(t));break;case"SignalInstantPurchaseDismissal":yield*Dl(e.signal,i(t));break;case"SignalLoadStart":yield*kl(e.signal,i(t));break;case"SignalGatedResponse":case"SignalResponse":yield*Pl(e.signal,i(t,!0));break;case"SignalUserInteraction":yield*$l(e.signal,i(t));break;case"SignalCartItemQuantitySelected":yield*jl(e.signal,i(t));break;case"SignalCartItemInstantPurchaseInitiated":yield*Gl(e.signal,i(t));break;case"SignalCartItemInstantPurchase":yield*Fl(e.signal,i(t));break;case"SignalCartItemInstantPurchaseFailure":yield*Ml(e.signal,i(t))}yield qe({type:Kr.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*_l(e,t){let n;e.creativeInstanceGuid&&(n={},n.creativeInstanceGuid=e.creativeInstanceGuid);try{yield t(e.name,e.parentGuid,n)}catch(t){yield Bl(e,t)}}function*Rl(e,t){try{yield t(e.name,e.parentGuid,e.dismissalMethod?{objectData:{dismissalMethod:e.dismissalMethod}}:void 0)}catch(t){yield Bl(e,t)}}function*Dl(e,t){try{yield t(e.name,e.parentGuid,void 0)}catch(t){yield Bl(e,t)}}function*kl(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 Bl(e,t)}}function*Pl(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 Bl(e,t)}}function*$l(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 Bl(e,t)}}function*jl(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 Bl(e,t)}}function*Gl(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 Bl(e,t)}}function*Fl(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 Bl(e,t)}}function*Ml(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 Bl(e,t)}}function Bl(e,t){const n=gl.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*Ul(e){yield qe({type:Yr,payload:e.payload})}function*Vl(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:Mr,payload:{key:t,value:"Interactive"}}))}(e)}catch(e){const t=e;yield*function*(e){var t;yield qe({type:qr,payload:{level:ms,code:_s,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*zl(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(pl,{url:t.payload.url,urlBehavior:n,external:e})}catch(e){yield qe(fl(e,"Failed to open link",Ns,{url:t.payload.url,urlBehaviour:n}))}}function*Hl(e){const t=yield Ye((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:Kr.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:Gr}),t?yield qe({type:Kt,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}):yield qe({type:qr,payload:{level:ms,code:Ls,message:"ParentGuid does not exist"}})}const Wl=h((function(e){return{isOpen:e.active.has(Qr)}})),ql="undefined"!=typeof window;function Jl(e,t){o((()=>{if(!ql||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 Yl="Minimized",Kl=()=>{const e=r(null),t=r(null),n=r(null),i=r(null),a=r(null),s=vi(0,(e=>e.customStates[Yl])),l=mi(),c=xa(),d=r(0),p=r(!1),y=r(0),f=r([]),m=r(void 0),{isDisabled:h}=It(c);Jl(e,!!s);const v=u((()=>{k(),m.current=void 0,p.current=!1,_(!0);g()?S():L(0)}),[]),g=()=>{const e=N();return s?e<=-.2:e>=.2};o((()=>{s?(C(),l(Ql(!0))):(O(),l(Ql(!1)))}),[s,l]),o((()=>{requestAnimationFrame((()=>{D(!s,n),D(!!s,i),R()}))}),[]);const b=u((e=>{if(t.current){e.preventDefault();const t=E(e);L(t)}}),[t]),I=u((e=>{Date.now()-y.current<200||(y.current=Date.now(),s?w(!1):p.current||h||(p.current=!0,T(),m.current=Zl(e),_(!1),P()))}),[s,h]);o((()=>{const e=t.current;return e&&(e.addEventListener("mousedown",I),e.addEventListener("touchstart",I)),()=>{null==e||e.removeEventListener("mousedown",I),null==e||e.removeEventListener("touchstart",I)}}),[t,I]);const E=e=>{var t,n;return(null!==(t=Zl(e))&&void 0!==t?t:0)-(null!==(n=m.current)&&void 0!==n?n:0)},S=()=>{w(!s)},w=e=>{const t=(e=>({type:Qt,payload:{key:Yl,value:e?1:0}}))(e);l(t)},C=()=>{var e,t,a,o;const r=null!==(t=null===(e=n.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,s=(null!==(o=null===(a=i.current)||void 0===a?void 0:a.clientHeight)&&void 0!==o?o:0)-r;_(!0),R(!0,!0),L(s),D(!1,n),D(!0,i),$()},O=()=>{_(!0),R(!0,!1),L(0),m.current=void 0,D(!0,n),D(!1,i),j()},x=u((()=>{p.current&&(A(),requestAnimationFrame(x))}),[]),A=()=>{f.current.push({yPosition:d.current,timestamp:Date.now()}),f.current.length>20&&f.current.shift()},T=u((()=>{f.current=[],x()}),[x]),N=()=>{const e=f.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},L=e=>{const n=Math.round(e);d.current=n,t.current&&(t.current.style.transform=`translateY(${n}px)`)},_=e=>{e?t.current&&(t.current.style.transition="transform .2s"):t.current&&(t.current.style.transition="")},R=(e,t=!1)=>{const a=t?i:n,o=t?n:i;o.current&&(o.current.style.transition="opacity .5s"),a.current&&(a.current.style.transition="opacity .2s")},D=(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)},k=u((()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",b),document.removeEventListener("touchend",v)}),[b,v]),P=u((()=>{St()?(document.addEventListener("touchmove",b,{passive:!1}),document.addEventListener("touchend",v)):(document.addEventListener("mousemove",b,{passive:!1}),document.addEventListener("mouseup",v))}),[b,v]),$=()=>{const t=e.current;t&&(a.current=setTimeout((()=>{var e;const i=((null===(e=n.current)||void 0===e?void 0:e.clientHeight)||0)+1;t.style.height=i+"px"}),200))},j=()=>{a.current&&clearTimeout(a.current),e.current&&(e.current.style.height="100000px")};return{wrapperRef:e,containerRef:t,minimizedChildRef:n,maximizedChildRef:i}};function Zl(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}const Ql=e=>({type:Kt,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}}),Xl={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var ec;function tc({schema:t,testId:n}){const i=dn(),a=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),s=m((e=>e.active.has(Xr))),l=r(null),c=f(),d=()=>{c({type:Zr.DISMISS_OVERLAY,payload:{id:Qr,dismissalMethod:"rokt_backdrop"}})},u=vi(0,(e=>e.customStates[Yl]));o((()=>{p(!!u)}),[u]),Jl(l,!!u);const p=e=>{const t=l.current;t&&(e?t.style.opacity="0":(t.style.display="flex",t.style.opacity="1"))};o((()=>{a&&c({type:Kt,payload:{name:"SignalActivation",parentGuid:a}})}),[a]),o((()=>{s&&requestAnimationFrame((()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.focus()}))}),[s]);const y=xa(),{tabIndex:h,isDisabled:v,styles:g}=It(y),b=t.styles?Ce(Xl,t.styles):Xl;return e(Co,{styles:b,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:"1",transition:"opacity 0.2s ease-in-out"},g),"aria-label":null!==(a=t.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":v,role:"dialog","aria-modal":!0,tabIndex:h,"data-testid":n,"data-e2e":"Overlay-Wrapper",ref:l,children:e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:t.allowBackdropToClose?d:void 0,"data-testid":n&&`${n}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function nc(){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"}(ec||(ec={}));const ic={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};function ac(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(oc,Object.assign({},t,{slots:n,currentIndex:i}))}function oc(n){const{wrapperRef:i,containerRef:a,minimizedChildRef:o,maximizedChildRef:r}=Kl();return n.isOpen?t("div",{ref:i,style:{height:"100000px"},children:[e(tc,Object.assign({},n)),e(sc,Object.assign({},n,{containerRef:a,minimizedChildRef:o,maximizedChildRef:r}))]}):null}const rc=Be`
|
|
58
58
|
display: flex;
|
|
59
59
|
position: relative;
|
|
60
60
|
overflow: hidden;
|
|
@@ -62,54 +62,64 @@ 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
|
-
`,ec=p((function({schema:n,testId:i,slots:s,currentIndex:l,minimizedChildRef:c,containerRef:d,maximizedChildRef:u}){var p,f;const y=r(null),m=r(null),h=r(!0),v=n.styles?we(Yl,n.styles):Yl,g=gi(),b=()=>{const e=m.current;if(!e)return 0;return Array.from(e.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0)};o((()=>{const e=new ResizeObserver((()=>{(()=>{const e=m.current;if(!e)return;const t=b();e.style.height=`${t}px`})(),h.current&&(()=>{const e=b(),t=y.current;t&&(h.current=!1,t.style.setProperty("transform",`translateY(${e}px)`),requestAnimationFrame((()=>{t.style.transition="transform 0.8s",t.style.setProperty("transform","translateY(0px)")})))})()}));return m.current&&Array.from(m.current.children).forEach((t=>{e.observe(t)})),()=>{e.disconnect()}}),[]);const I=null===(f=null===(p=s[l])||void 0===p?void 0:p.offer)||void 0===f?void 0:f.creative,E=null==I?void 0:I.copy,S=Mi(E||{})(br.transformLinksToAnchorText(null==I?void 0:I.links),"creativeLink");return e(wo,{styles:v,children:({classnames:o})=>{var r;return t("div",{style:{width:"100%",position:"absolute",bottom:"-1000px",zIndex:"9999"},ref:d,children:[e("div",{style:{zIndex:"3",width:"100%",maxHeight:"0%",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)"},ref:y,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"},ref:d,tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:[e(Kl,{}),e("div",{ref:m,className:Xl,"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,Ut(0,i))},"0"),e(zi,{value:S,children:e(Na,{value:Aa(I),children:e("div",{ref:c,style:{width:"100%"},children:E&&e("div",{children:g(n.children[1],void 0,Ut(1,i))})},"1")})})])})]})}),e("div",{style:{width:"100%",height:"1000px",backgroundColor:"white"}})]})}})}));function*tc(){(yield Je((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex})))===(yield Je((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||1})))-1&&(yield We({type:Zt,payload:{key:"Minimized",value:1}}))}Bl(Zl);const nc={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var ic;function ac({isOpen:t,schema:n,testId:i,children:r}){const s=ln(),l=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),c=m((e=>e.active.has(Yr))),d=y();o((()=>{l&&d({type:Kt,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=wa(),{tabIndex:p,isDisabled:f,styles:h}=It(u),v=n.styles?we(nc,n.styles):nc;if(!t)return null;const g=e(vi,{children:e=>a.Children.toArray(n.children.map(((t,n)=>e(t,void 0,i?`${i}-child${n}`:void 0))))});return e(wo,{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"}(ic||(ic={}));const oc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const rc=p((function({schema:t,testId:n,children:i},a){const o=t.styles?we(oc,t.styles):oc;return e(wo,{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 sc=h((function(e){return{isOpen:e.active.has(Kr)}}))((function(t){return e(ac,Object.assign({},t,{children:(n,i)=>e(rc,Object.assign({},t,{ref:i,children:n}))}))})),lc=Bl(Zl),cc={name:"minimized-bottomsheet-extension",sagas:function*(){yield Ke([Ye("OFFER_LIFECYCLE",tc)])},componentFactory:t=>"Overlay"===t.type?e(sc,{schema:t}):function(e){const t=e.children instanceof Array;return t}(t)?e(lc,{schema:t}):e("div",{children:"Could not Render Bottom Sheet"})};const dc=Me`
|
|
65
|
+
`,sc=p((function({schema:n,testId:i,slots:s,currentIndex:l,minimizedChildRef:c,containerRef:d,maximizedChildRef:u}){var p,y;const f=r(null),m=r(null),h=r(!0),v=n.styles?Ce(ic,n.styles):ic,g=Ii(),b=()=>{const e=m.current;if(!e)return 0;return Array.from(e.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0)};o((()=>{const e=new ResizeObserver((()=>{(()=>{const e=m.current;if(!e)return;const t=b();e.style.height=`${t}px`})(),h.current&&(()=>{const e=b(),t=f.current;t&&(h.current=!1,t.style.setProperty("transform",`translateY(${e}px)`),requestAnimationFrame((()=>{t.style.transition="transform 0.8s",t.style.setProperty("transform","translateY(0px)")})))})()}));return m.current&&Array.from(m.current.children).forEach((t=>{e.observe(t)})),()=>{e.disconnect()}}),[]);const I=null===(y=null===(p=s[l])||void 0===p?void 0:p.offer)||void 0===y?void 0:y.creative,E=null==I?void 0:I.copy,S=Ui(E||{})(Er.transformLinksToAnchorText(null==I?void 0:I.links),"creativeLink");return e(Co,{styles:v,children:({classnames:o})=>{var r;return t("div",{style:{width:"100%",position:"absolute",bottom:"-1000px",zIndex:"9999"},ref:d,children:[e("div",{style:{zIndex:"3",width:"100%",maxHeight:"0%",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)"},ref:f,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"},ref:d,tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:[e(nc,{}),e("div",{ref:m,className:rc,"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,Vt(0,i))},"0"),e(Wi,{value:S,children:e(_a,{value:Aa(I),children:e("div",{ref:c,style:{width:"100%"},children:E&&e("div",{children:g(n.children[1],void 0,Vt(1,i))})},"1")})})])})]})}),e("div",{style:{width:"100%",height:"1000px",backgroundColor:"white"}})]})}})}));function*lc(){(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:Qt,payload:{key:"Minimized",value:1}}))}Wl(ac);const cc={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var dc;function uc({isOpen:t,schema:n,testId:i,children:r}){const s=dn(),l=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),c=m((e=>e.active.has(Xr))),d=f();o((()=>{l&&d({type:Kt,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=xa(),{tabIndex:p,isDisabled:y,styles:h}=It(u),v=n.styles?Ce(cc,n.styles):cc;if(!t)return null;const g=e(bi,{children:e=>a.Children.toArray(n.children.map(((t,n)=>e(t,void 0,i?`${i}-child${n}`:void 0))))});return e(Co,{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":y,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"}(dc||(dc={}));const pc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const yc=p((function({schema:t,testId:n,children:i},a){const o=t.styles?Ce(pc,t.styles):pc;return e(Co,{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 fc=h((function(e){return{isOpen:e.active.has(Qr)}}))((function(t){return e(uc,Object.assign({},t,{children:(n,i)=>e(yc,Object.assign({},t,{ref:i,children:n}))}))})),mc=Wl(ac),hc={name:"minimized-bottomsheet-extension",sagas:function*(){yield Ke([Ze("OFFER_LIFECYCLE",lc)])},componentFactory:t=>"Overlay"===t.type?e(fc,{schema:t}):function(e){const t=e.children instanceof Array;return t}(t)?e(mc,{schema:t}):e("div",{children:"Could not Render Bottom Sheet"})};const vc=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}})),gc=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"})),bc="FunFactMode";function Ic({activeIndex:e,startIndex:t,numOfIndicators:n,schema:i,slots:r}){var s,l,d;const p=xa(),y=f(),{tabIndex:m,styles:h,isDisabled:v}=It(p),g=Array(n+1).fill(i.indicator),[b,I]=c(new Set([t])),[E,S]=c(!1),w=vi(0,(e=>e.customStates[bc])),C=u((e=>b.has(e)||b.has(e-1)),[b]);o((()=>{I((t=>new Set([...t,e])))}),[e,w]),o((()=>{w&&S(!0)}),[w]);const O=()=>{y({type:Qt,payload:{key:bc,value:1}})},x=null===(l=null===(s=r[e])||void 0===s?void 0:s.offer)||void 0===l?void 0:l.creative,A=null===(d=null==x?void 0:x.images.creativeImage)||void 0===d?void 0:d.light;return n>0&&(N=n+t+1,(T=e)>=t&&T<=N)?a.createElement(Hi,null,(o=>a.createElement(Co,{styles:i.styles},(i=>{var r;const s=i.classnames,l=t=>{var i,a,o,r;return t===n&&w?`${null==s?void 0:s.indicator} ${null!==(i=null==s?void 0:s.activeIndicator)&&void 0!==i?i:""}`:t!==e||w?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?O:void 0,className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",fill:w?"#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"},gc)):r!==e||w?a.createElement("button",{onClick:(s=r,()=>{C(s)&&(y({type:"PROGRESSION/INITIALISE",payload:{totalCount:n,currentGroupIndex:s,groupSize:1}}),w&&y({type:Qt,payload:{key:bc,value:0}}))}),className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:C(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:C(r)?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(""),A?a.createElement("img",{src:A,style:{marginTop:"3px"}}):a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${r+1}`));var s}))))})))):null;var T,N}const Ec=vc(((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(Ic,Object.assign({},e,{slots:n,currentIndex:i,partnerColor:t}))})),Sc=({children:e,partnerColor:t,schema:n})=>{var i;const o=Ii(),r=d((()=>Math.random()),[]),s=Ui((null!==(i=wc[Math.floor(r*wc.length)])&&void 0!==i?i:{text:"",header:""})||{},"funfact"),l=Be`
|
|
66
|
+
display: inline;
|
|
67
|
+
margin: 8px 16px;
|
|
68
|
+
p {
|
|
69
|
+
display: inline !important;
|
|
70
|
+
}
|
|
71
|
+
`,c=Be`
|
|
72
|
+
font-size: 24px;
|
|
73
|
+
font-weight: 600;
|
|
74
|
+
color: ${t};
|
|
75
|
+
`;return a.createElement(Wi,{value:s},a.createElement(Co,{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}`},o(e))):a.createElement("span",{className:`${null==n?void 0:n.own}`},o(e)))))))})))},wc=[{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*Cc(){(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:Qt,payload:{key:"FunFactMode",value:1}}))}const Oc={name:"logo-clickable-progression-extension",sagas:function*(){yield Ke([Ze("OFFER_LIFECYCLE",Cc)])},componentFactory:e=>e?"fun-fact"===e.variant?a.createElement(Sc,{partnerColor:e.partnerColor,schema:e},e.children):a.createElement(Ec,{schema:Object.assign(Object.assign({},e),{indicator:""}),partnerColor:e.partnerColor}):a.createElement("div",null,"Could not render Logo Clickable Progression"),interceptors:{}};const xc=Be`
|
|
66
76
|
height: 20px;
|
|
67
77
|
border-radius: 4px;
|
|
68
78
|
width: 100%;
|
|
69
79
|
background-color: #e0e0e0;
|
|
70
80
|
background: linear-gradient(270deg, #f4f4f4 0%, #dedede 48%, #f4f4f4 93%);
|
|
71
81
|
background-size: 200% 100%;
|
|
72
|
-
animation: 1.5s ${
|
|
82
|
+
animation: 1.5s ${Ue`to { background-position-x: -200%; }`} linear
|
|
73
83
|
infinite;
|
|
74
|
-
`,
|
|
84
|
+
`,Ac=Be`
|
|
75
85
|
width: 75%;
|
|
76
|
-
`,
|
|
86
|
+
`,Tc=Be`
|
|
77
87
|
height: 40px;
|
|
78
88
|
width: 200px;
|
|
79
|
-
`,
|
|
89
|
+
`,Nc=Be`
|
|
80
90
|
width: 150px;
|
|
81
|
-
`;function
|
|
91
|
+
`;function Lc({hasLoaded:e,animationSpeedMS:t,styles:n}){const[i,r]=c(!0);return o((()=>{if(e){const e=setTimeout((()=>{r(!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`
|
|
82
92
|
padding: 30px 24px;
|
|
83
93
|
display: flex;
|
|
84
94
|
flex-direction: column;
|
|
85
95
|
gap: 16px;
|
|
86
96
|
height: inherit;
|
|
87
97
|
justify-content: center;
|
|
88
|
-
`},a.createElement("div",{className:
|
|
98
|
+
`},a.createElement("div",{className:xc}),a.createElement("div",{className:xc}),a.createElement("div",{className:xc}),a.createElement("div",{className:Ve(xc,Ac)}),a.createElement("div",{className:Be`
|
|
89
99
|
display: flex;
|
|
90
100
|
gap: 16px;
|
|
91
101
|
align-items: center;
|
|
92
|
-
`},a.createElement("div",{className:
|
|
102
|
+
`},a.createElement("div",{className:Ve(xc,Tc)}),a.createElement("div",{className:Ve(xc,Nc)})))):null}function _c({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[r,s]=c(!0);return o((()=>{if(t){const e=setTimeout((()=>{s(!1)}),i);return()=>clearTimeout(e)}return()=>null}),[t]),r?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`
|
|
93
103
|
font-weight: 600;
|
|
94
104
|
font-size: 14px;
|
|
95
105
|
line-height: 21px;
|
|
96
106
|
padding: 0 16px;
|
|
97
|
-
`},e)))):null):null}const
|
|
107
|
+
`},e)))):null):null}const Rc=Ue`
|
|
98
108
|
0% { width: 0; }
|
|
99
109
|
100% { width: 100%; }
|
|
100
|
-
}`;function
|
|
110
|
+
}`;function Dc(e){const[t,n]=c(!1),[i,r]=c(!1),s=f(),l=Ii(),{type:d,children:u,durationMS:p,styles:y,partnerText:m,animationSpeedMS:h}=e.data;let v=null;switch(d){case"skeleton":v=a.createElement(Lc,{hasLoaded:t,animationSpeedMS:h,styles:y});break;case"partnerText":v=a.createElement(_c,{partnerText:m,hasLoaded:t,animationSpeedMS:h,styles:y})}return o((()=>{let e=null;const t=setTimeout((()=>{n(!0),e=setTimeout((()=>{r(!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`
|
|
101
111
|
position: relative;
|
|
102
|
-
`},a.createElement("div",{className:
|
|
112
|
+
`},a.createElement("div",{className:Be`
|
|
103
113
|
height: 4px;
|
|
104
|
-
background-color: ${(null==
|
|
114
|
+
background-color: ${(null==y?void 0:y.primaryColor)||"#7F56D9"};
|
|
105
115
|
position: absolute;
|
|
106
116
|
top: 0;
|
|
107
|
-
animation: ${
|
|
117
|
+
animation: ${Rc} ${p}ms linear forwards;
|
|
108
118
|
transition: opacity ${h}ms ease-in-out;
|
|
109
119
|
opacity: ${t?0:1};
|
|
110
|
-
`}),a.createElement("div",{className:
|
|
120
|
+
`}),a.createElement("div",{className:Be`
|
|
111
121
|
position: relative;
|
|
112
|
-
`},a.createElement("div",{className:
|
|
122
|
+
`},a.createElement("div",{className:Be`
|
|
113
123
|
position: absolute;
|
|
114
124
|
top: 0;
|
|
115
125
|
left: 0;
|
|
@@ -118,12 +128,12 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
118
128
|
z-index: 20;
|
|
119
129
|
border-width: 2px;
|
|
120
130
|
transition: border-color ${h}ms ease-in-out;
|
|
121
|
-
${i?"\n border-color: transparent;\n user-select: none;\n pointer-events: none;\n ":`\n border-color: ${t?(null==
|
|
122
|
-
`},v),a.createElement("div",{"data-testid":"slots",className:
|
|
131
|
+
${i?"\n border-color: transparent;\n user-select: none;\n pointer-events: none;\n ":`\n border-color: ${t?(null==y?void 0:y.primaryColor)||"#7F56D9":"transparent"};\n `}
|
|
132
|
+
`},v),a.createElement("div",{"data-testid":"slots",className:Be`
|
|
123
133
|
z-index: 10;
|
|
124
134
|
transition: opacity ${h}ms ease-in-out;
|
|
125
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 "}
|
|
126
|
-
`},a.Children.toArray(u.map((e=>l(e))))))))}const gc={name:"loading-extension",componentFactory:e=>a.createElement(vc,{data:e}),interceptors:{}},bc=1e3;function Ic(e){const t=e.data,{minutes:n,seconds:i,timeRemaining:s,restartTimer:l}=function(e){const[t,n]=c(e),i=(new Date).getTime()/bc,a=r(null),s=()=>{const t=(new Date).getTime()/bc;n(Math.max(Math.floor(e-(t-i)),0))};return o((()=>(a.current=setInterval(s,bc),()=>{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,bc)}}}((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:Kt,payload:{name:"SignalUserInteraction",action:"TimerExpired",context:"TimerProgression"}}),u({type:"PROGRESSION/PROCESS",payload:{offerProcessStatus:"CONTINUE"}}))}),[n,i]);const p=wa(),{tabIndex:f,styles:h,isDisabled:v}=It(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 Ec={name:"timer-progression-extension",componentFactory:e=>a.createElement(Ic,{data:e}),interceptors:{}},Sc="MODULE/ADD_LOADED",Oc="MODULE/LOAD",wc="PROGRESSION/INITIALISE",Ac="PROGRESSION/NEXT",Cc="PROGRESSION/PREV",Tc="PROGRESSION/UPDATE_GROUP_SIZE",xc="PROGRESSION/PROCESS",Nc="SLOTS/SET",_c="INSTANT_PURCHASE/DISMISS",Rc="OFFER_LIFECYCLE",Dc="DOMAIN_STATES/SET",Lc="OFFER_ENGAGEMENT",kc="GLOBAL_OFFER_DATA_STATE/SET_CART",Pc=Object.assign(Object.assign({},qr),{NEXT_IN_PROGRESSION:Ac,PREV_IN_PROGRESSION:Cc,INITIALISE_PROGRESSION:wc,UPDATE_GROUP_SIZE:Tc,SET_SLOTS:Nc,ADD_LOADED_MODULE:Sc,SET_DOMAIN_STATE:Dc,SET_GLOBAL_OFFER_DATA_CART:kc}),jc=Object.assign(Object.assign({},Jr),{LOAD_MODULES:Oc,DISMISS_INSTANT_PURCHASE:_c,PROCESS_PROGRESSION:xc,OFFER_LIFECYCLE:Rc,OFFER_ENGAGEMENT:Lc,SET_PARTNER_VALIDATION_STATUS:tn});function $c(e,t){return t<=0||e<=0||t>e?0:Math.ceil(e/t)}function Gc(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<$c(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 Fc=Symbol("root");function Mc(){return{[Fc]:{}}}const Bc=Object.assign({progression:function(e=null,t){switch(t.type){case wc:if(function(e){const{totalCount:t,currentGroupIndex:n,groupSize:i}=e;return t>=0&&i>=0&&n>=0&&i<=t&&n<$c(t,i)}(t.payload)){const{totalCount:e,_:n,groupSize:i}=t.payload;return Object.assign(Object.assign({},t.payload),{indexGroups:Gc(e,i)})}return null;case Tc:{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:Gc(i,n),currentGroupIndex:0}):null}case Ac:{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,$c(t,n)-1)}):null}case Cc:{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===Nc?t.payload:e},module:function(e={loadedModules:[]},t){return t.type===Sc?Object.assign(Object.assign({},e),{loadedModules:[...e.loadedModules,t.payload]}):e},domainStates:function(e=Mc(),t){if(t.type===Dc){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:Fc;return n===Fc?e:Object.assign(Object.assign({},b([n,t.payload.key],Number(t.payload.value),e)),{[Fc]:{}})}return e}return e},globalOfferDataState:function(e={},t){if(t.type===kc){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}},Ys);function Uc(e={}){return Object.assign(Object.assign(Object.assign({},function(e={}){return Object.assign({layout:Fs(),breakpoint:{breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},active:Ms(),fonts:[],signal:{queue:[],processed:[]},serializableCache:Ks(),settings:{closeOnComplete:!0},customStates:{root:{}}},e)}(e)),{progression:null,slots:[],module:{loadedModules:[]},domainStates:Mc(),globalOfferDataState:{}}),e)}function Vc(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 zc(e){return e.progression?{activeGroupIndex:e.progression.currentGroupIndex,totalOffers:e.progression.totalCount,totalGroups:$c(e.progression.totalCount,e.progression.groupSize),isLast:Vc(e)}:null}function Hc(e,t){return e.domainStates[`module${t}`]||{offerComplete:0}}function Wc(e){return Object.values(e.globalOfferDataState).reduce(((e,t)=>t.cart?e+t.cart.reduce(((e,t)=>e+t.quantity),0):e),0)}function qc(i){const{config:a,position:o,visible:r,container:s,testId:l}=i,c=$a(),d=wa(),u=m(Bs),p=`rokt-${a.layoutVariant.moduleName}-${c}`;return t(n,{children:[!r&&e("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},"aria-hidden":"true"}),e(p,{style:{display:"flex",flexDirection:"column"===s?"column":"row",width:"100%"},slotInstanceGuid:a.instanceGuid,layoutSchema:JSON.stringify(a.layoutVariant.layoutVariantSchema),offerData:JSON.stringify(a.offer),offerPositionIndex:o,visible:r,container:s,interactivity:d,"data-testid":l,"data-e2e":`OfferSlot-${o}`,"aria-hidden":!r,"module-component":!0,"plugin-id":c,"active-breakpoint":Bt(u)})]})}function Jc({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=wa(),d=Ma(),{tabIndex:u,isDisabled:p,styles:f}=It(c);return o.length&&o[l]?e(wo,{styles:i,children:({classnames:i})=>e("div",{ref:s,"data-testid":n,"data-e2e":"OneByOneDistribution",className:null==i?void 0:i.own,tabIndex:u,"aria-hidden":p,style:Object.assign(Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},f),d),children:a.Children.toArray(o.map(((n,i)=>e(Ar,{effect:t.transition,visible:i===l,parentElement:s.current,children:e(qc,{config:n,position:i,visible:i===l,container:"column"})}))))})}):null}const Kc=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=$c(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=wa(),s=Ma(),{tabIndex:l,styles:c,isDisabled:d}=It(r),u=Array(a).fill(o.indicator);return a>0&&(f=a+n-1,(p=t)>=n&&p<=f)?e(Vi,{children:a=>e(wo,{styles:o.styles,children:o=>{var r;const p=o.classnames,f=e=>{var n,i;return e===t?`${null==p?void 0:p.indicator} ${(null==p?void 0:p.activeIndicator)?p.activeIndicator:null!==(n=null==p?void 0:p.seenIndicator)&&void 0!==n?n:""}`:e<t?`${null==p?void 0:p.indicator} ${null!==(i=null==p?void 0:p.seenIndicator)&&void 0!==i?i:""}`:null==p?void 0:p.indicator};return e("div",{className:null!==(r=null==p?void 0:p.own)&&void 0!==r?r:"",style:Object.assign(Object.assign({display:"flex",flexDirection:"row"},c),s),"data-e2e":"ProgressIndicator",tabIndex:l,"aria-hidden":d,children:i.Children.toArray(u.map(((t,i)=>e("span",{className:f(i+n),style:{display:"flex"},children:a({state:{indicatorPosition:String(i+1+n)}})(t)}))))})}})}):null;var p,f}));const Yc="partnerValidationUI",Zc="stackedViewableItems";function Qc(t){var n;const i=y(),r=m((e=>e.slots)),s=null!==(n=t.schema.viewableItems)&&void 0!==n?n:[],l=yo(s.reduce(((e,t,n)=>Object.assign(Object.assign({},e),{[n]:t.when})),{})),c=G((e=>{var t;return e&&(null===(t=s[e[0]])||void 0===t?void 0:t.value)||r.length}),De((([e,t])=>t)),le)(l);o((()=>{i({type:Gr,payload:{key:Zc,value:String(c)}})}),[c]);const d=r.slice(0,c),u=wa(),p=Ma(),{tabIndex:f,isDisabled:h,styles:v}=It(u);return(null==d?void 0:d.length)>0?e(wo,{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":h,tabIndex:f,style:Object.assign(Object.assign({display:"flex",flexDirection:"column"},v),p),children:a.Children.toArray(d.map(((t,n)=>e(qc,{config:t,position:n,visible:!0,container:"column"}))))})}):null}function Xc(t){const n=t.schema.styles,i=y(),o=wa(),r=Ma(),s="Backward"===t.schema.direction?"Previous":"Next",{tabIndex:l,styles:c,isDisabled:d}=It(o),u=()=>{i({type:"Backward"===t.schema.direction?Pc.PREV_IN_PROGRESSION:Pc.NEXT_IN_PROGRESSION})};return e(wo,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:s,className:null==n?void 0:n.own,onClick:u,"data-testid":t.testId,"data-e2e":"ProgressControl","data-e2e-direction":`${t.schema.direction}`,disabled:d,"aria-disabled":d,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:s,tabIndex:l,style:Object.assign(Object.assign({cursor:"pointer"},c),r),children:e(vi,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}function ed({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(Hs),E=t.viewableItems.length-1,[S,O]=ht({slidesToScroll:null!==(r=t.viewableItems[Math.min(I,E)])&&void 0!==r?r:"auto",containScroll:"trimSnaps"}),w=y(),A=wa(),C=Ma(),{tabIndex:T,isDisabled:x,styles:N}=It(A),_=`${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:Pc.NEXT_IN_PROGRESSION}):i<a&&w({type:Pc.PREV_IN_PROGRESSION}))}return null!=g&&(null==O||O.on("select",e),null==O||O.scrollTo(g)),()=>{null==O||O.off("select",e)}}),[O,g,w]);const R={overflow:"hidden"},D={backfaceVisibility:"hidden",display:"flex",touchAction:"pan-y",gap:_,alignItems:"stretch"},L=e=>{var t;return null!==(t=null==v?void 0:v.includes(e))&&void 0!==t&&t},k=t.peekThroughSize[Math.min(I,t.peekThroughSize.length-1)],P=k?"Fixed"===(j=k).type?`${j.value}px`:`${j.value}%`:"0px";var j;const $=null!==(f=t.viewableItems[Math.min(E,I)])&&void 0!==f?f:1,G={flex:`0 0 calc(${(e=>"0px"!==e&&"0%"!==e)(P)?`(100% - 2 * ${P} - (${$} + 1) * ${_})/${$}`:`(100% - (${$} - 1) * ${_})/${$}`})`,position:"relative",display:"flex",overflow:"auto"};return(null==b?void 0:b.length)>0?e(wo,{styles:t.styles,children:({classnames:t})=>e("div",{ref:S,style:Object.assign(Object.assign(Object.assign({},R),N),C),"aria-disabled":x,tabIndex:T,className:null==t?void 0:t.own,"data-e2e":"CarouselDistribution","data-testid":n&&`${n}`,children:e("div",{style:D,"data-testid":n&&`${n}-container`,"data-e2e":"CarouselDistribution-Container",children:a.Children.toArray(b.map(((t,i)=>e("div",{style:G,"data-testid":n&&`${n}-slide-${i}`,"data-e2e":`CarouselDistribution-Slide-${i}`,children:e(qc,{config:t,position:i,container:"row",visible:L(i)})}))))})})}):null}function td({schema:t,testId:n}){const i=$a(),o=d((()=>si(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)||[]).map((t=>t.map((t=>e.slots[t])).filter((e=>null!=e))))})),c=r(null),u=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),p=wa(),f=Ma(),{tabIndex:y,isDisabled:h,styles:v}=It(p);return l.length?e(wo,{styles:t.styles,children:({classnames:i})=>e("div",{ref:c,"data-testid":n,"data-e2e":"GroupedDistribution","aria-disabled":h,tabIndex:y,style:Object.assign(Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},v),f),children:a.Children.toArray(l.map(((r,l)=>e(Ar,{effect:t.transition,visible:l===u,parentElement:c.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(qc,{config:t,position:a,visible:l===u,container:"column",testId:n?`${n}-child${a}`:void 0})})))}))))})}):null}const nd={action:{CaptureOnly:"CaptureOnly",Url:"Url",Fulfillment:"Fulfillment",External:"External"},urlBehavior:{newTab:"newTab",roktWebViewSDK:"roktWebViewSDK",self:"self"},signalType:{SignalResponse:"SignalResponse",SignalGatedResponse:"SignalGatedResponse",SignalSecondaryResponse:"SignalSecondaryResponse"}};function id(e,t,n=!1){return Error(`Could not translate ${e} with guid: ${t}${n?" for child layout":""}`)}function ad(e,t=!1){var n;try{if(e.responseOptionsMap||t)return Object.assign(Object.assign({},e),{responseOptionsMap:W(od,null!==(n=e.responseOptionsMap)&&void 0!==n?n:{})});{const t=`Creative: ${e.instanceGuid}, did not receive a valid response options map.`;throw new Rt("NO_CREATIVE_RESPONSE_OPTIONS_MAP",t)}}catch(n){throw n.message?n:id("Creative",e.instanceGuid,t)}}function od(e){try{let t;e.urlBehavior&&(t=nd.urlBehavior[e.urlBehavior]);return Object.assign(Object.assign({},e),{urlBehavior:t,action:nd.action[e.action],signalType:nd.signalType[e.signalType]})}catch(t){throw t.message?t:id("CreativeResponse",e.instanceGuid)}}function rd(e,t,n){try{return JSON.parse(e)}catch(e){throw Error(`Parse JSON failed, invalid JSON file for ${t} with guid ${n}.`)}}function sd(){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 ld={OneByOneDistribution:function(t){if("OneByOneDistribution"===t.type)return e(Jc,{schema:t.node})},StackedDistribution:function(t){if("StackedDistribution"===t.type)return e(Qc,{schema:t.node})},ProgressIndicator:function(t){if("ProgressIndicator"===t.type)return e(Kc,{schema:t.node})},ProgressControl:function(t){if("ProgressControl"===t.type)return e(Xc,{schema:t.node})},Overlay:function(t){if("Overlay"===t.type)return e(is,{schema:t.node})},CloseButton:function(t){if("CloseButton"===t.type)return e(Zr,{schema:t.node})},EscapeHatch:(cd=[function(t,n){if(Et("CloseButton",t)){const n=JSON.parse(t.node.data);return e(Zr,{schema:n.node,action:n.action})}},ur],e=>cd.reduce(((t,n)=>void 0===t?n(e):t),void 0)),CarouselDistribution:function(t){if("CarouselDistribution"===t.type)return e(ed,{schema:t.node})},GroupedDistribution:function(t){if("GroupedDistribution"===t.type)return e(td,{schema:t.node})},BottomSheet:function(t){if("BottomSheet"===t.type)return e(ss,{schema:t.node})}};var cd;function dd(e,t){e({type:Kt,payload:{name:"SignalActivation",parentGuid:t}})}function ud({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:zc(e),customStates:e.customStates.root,domainStates:e.domainStates[Fc]})),j),p=m((e=>e.slots.length)),f=m((e=>{var t;const n=Number(null!==(t=e.serializableCache.get(Zc))&&void 0!==t?t:"");return p-n})),h=m(Wc);sn(Ei(),d),o((()=>(c&&document.body.addEventListener("click",dd.bind(null,d,c.instanceGuid),{once:!0}),()=>{c&&document.body.removeEventListener("click",dd.bind(null,d,c.instanceGuid))})),[null==c?void 0:c.instanceGuid]),sd(),o((()=>{if(c){const e={type:Kt,payload:{name:"SignalImpression",parentGuid:c.instanceGuid}},t={type:Hr,payload:{code:"LAYOUT_IMPRESSED"}};d(e),d(t)}}),[c]);const v=e=>{d({type:jc.REPORT_ERROR,payload:e})},g=m((e=>e.breakpoint.initialised));if(c&&g){const o=Mi({})({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=gr(v);return e(Da,{info:{layoutType:"OuterLayout",pageInstanceGuid:t},children:e(zi,{value:o,children:e(bi,{value:y,overrides:ld,children:e(yi.Provider,{value:u,children:e(pi.Provider,{value:d,children:e(Ji.Provider,{value:"OUTER",children:e(vi,{children:e=>e(c.layoutSchema)})})})})})})})}return null}var pd=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"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"CatalogResponseButton":case"CatalogQuantityOption":case"CatalogRadioGroup":case"CatalogQuantityCounter":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}}}),fd=Object.assign({},pd);function*yd(e,t){const n=fd.getDistribution(t),i=null==n?void 0:n.type,a=yield Je(Hs),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:Pc.INITIALISE_PROGRESSION,payload:{currentGroupIndex:0,totalCount:e,groupSize:o}}))}function*md(e,t){const{instanceGuid:n,layoutSchemaVersion:i,outerLayoutSchema:a,slots:o}=t.payload;n?yield ft({type:Kt,payload:{name:"SignalLoadComplete",parentGuid:n}}):yield ft({type:zr,payload:{level:ps,code:Ts,message:"Layout instance guid does not exist"}}),yield ft({type:Oc,payload:{modules:o.map((e=>e.layoutVariant.moduleName))}}),yield ft({type:Rr,payload:a.breakpoints}),yield ft({type:Pc.LAYOUT_UPDATE,payload:{instanceGuid:n,layoutSchemaVersion:i,layoutSchema:a.layout,settings:a.settings}}),yield ft({type:Pc.SET_SLOTS,payload:o}),re(a.settings)||(yield ft({type:Pc.SET_SETTINGS,payload:a.settings})),yield*yd(o.length,a.layout);const r=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,il.PartnerValidationEvent.OPT_IN_TO_PARTNER_VALIDATION),yield dt(hd,e,il.PartnerValidationEvent.SHOW_PARTNER_VALIDATION_STATUS,(()=>({type:"ACTIVE/ADD",payload:{id:Yc}})))}catch(e){return yield ft({type:zr,payload:{level:us,code:Ns,message:"Failed to establish partner validation."}}),"FAILURE"}return"OK"}(e.partner,a.settings,o);"OK"===r&&(yield pt(El,e.display,a.display))}function*hd(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 vd(e){return au(e)}function gd(e,t){return Error(`Migration process from v0_0 to v0_1 failed: could not transform ${e} node. For more details: ${t}`)}const bd=te(ee([function(e){return"Row"===e.type&&Od(e.node.children)},function(e){return"Column"===e.type&&Od(e.node.children)},Td,xd])),Id=te(ee([function(e){return"Row"===e.type&&wd(e.node.children)},function(e){return"Column"===e.type&&wd(e.node.children)},xd,Td,function(e){return"DataImage"===e.type},function(e){return"When"===e.type&&wd(e.node.children)}])),Ed=te(ee([function(e){return"Row"===e.type&&Ad(e.node.children)},function(e){return"Column"===e.type&&Ad(e.node.children)},xd,Td])),Sd=te(ee([function(e){return"Row"===e.type&&Cd(e.node.children)},function(e){return"Column"===e.type&&Cd(e.node.children)},Td,function(e){return"RichText"===e.type},xd,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&Cd(e.node.children)},function(e){return"StaticLink"===e.type&&Cd(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CloseButton"===e.type&&Cd(e.node.children)}]));function Od(e){return bd(e)}function wd(e){return Id(e)}function Ad(e){return Ed(e)}function Cd(e){return Sd(e)}function Td(e){return"StaticImage"===e.type}function xd(e){return"BasicText"===e.type}const Nd=fe(["styles","elements","link"]),_d=fe(["styles","elements","activeIndicator"]),Rd=fe(["styles","elements","indicator"]),Dd=fe(["styles","elements","seenIndicator"]),Ld=fe(["focussed"]),kd=fe(["hovered"]),Pd=fe(["default"]),jd=fe(["pressed"]),$d=e=>{var t;return{text:null!==(t=null==e?void 0:e.text)&&void 0!==t?t:{}}},Gd=I(S(["styles","elements","link"]),J(ye(Nd,ie((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default})))),ye(Nd,ie(I(Le("focussed"),ye(Ld,$d)))),ye(Nd,ie(I(Le("hovered"),ye(kd,$d)))),ye(Nd,ie(I(Le("default"),ye(Pd,$d)))),ye(Nd,ie(I(Le("pressed"),ye(jd,$d)))))),Fd=J(I(S(["styles","elements","activeIndicator"]),ye(_d,ie((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","indicator"]),ye(Rd,ie((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","seenIndicator"]),ye(Dd,ie((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))));function Md(e,t){return e?{elements:{own:e.elements.own.map(t)}}:void 0}const Bd=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),Ud=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),Vd=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),zd=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),Hd=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Wd=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),qd=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Jd=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 gd("When",`Invalid condition: ${e}`)}},Kd=e=>{switch(e){case"breakpoint":return"Breakpoint";case"progression":return"Progression";case"position":return"Position";default:throw gd("When",`Invalid target: ${e}`)}},Yd=e=>{const{target:t,condition:n,value:i}=e;return{type:Kd(t),predicate:{condition:Jd(n),value:i}}};function Zd(e){return{predicates:e.predicates.map(Yd),children:e.children.map((e=>au(e)))}}function Qd(e){const t={type:"FadeInOut",settings:{duration:e.transition.settings.duration}};return{styles:e.style,transition:t}}function Xd(e){const t=e.children.map((e=>au(e)));if(Od(t))return Object.assign(Object.assign({},e),{children:t,styles:Md(e.styles,Hd)});throw gd("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function eu(e){const t=e.children.map((e=>au(e)));if(wd(t))return Object.assign(Object.assign({},e),{children:t,styles:Md(e.styles,Wd)});throw gd("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function tu(e){const t=e.children.map((e=>au(e)));if(Ad(t))return Object.assign(Object.assign({},e),{children:t,styles:Md(e.styles,qd)});throw gd("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}const nu=e=>({own:e.overlayContainer,wrapper:e.overlayWrapper});function iu(e){var t,n;const i=(null===(t=e.styles)||void 0===t?void 0:t.elements)?{elements:nu(null===(n=e.styles)||void 0===n?void 0:n.elements)}:void 0,a=e.children.map((e=>au(e)));if(Cd(a))return Object.assign(Object.assign({},e),{styles:i,children:a});throw gd("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function au(e){switch(e.type){case"When":return{type:"When",node:Zd(e.node)};case"OneByOneDistribution":return{type:e.type,node:Qd(e.node)};case"Overlay":return{type:e.type,node:iu(e.node)};case"Column":return{type:e.type,node:(r=e.node,{styles:Md(r.styles,Bd),children:r.children.map((e=>au(e)))})};case"Row":return{type:e.type,node:(o=e.node,{styles:Md(o.styles,Ud),children:o.children.map((e=>au(e)))})};case"RichText":return{type:e.type,node:(a=e.node,Gd(a))};case"CloseButton":return{type:e.type,node:Xd(e.node)};case"CreativeResponse":return{type:e.type,node:eu(e.node)};case"StaticLink":return{type:e.type,node:tu(e.node)};case"StaticImage":return{type:e.type,node:(i=e.node,Object.assign(Object.assign({},i),{styles:Md(i.styles,Vd)}))};case"DataImage":return{type:e.type,node:(n=e.node,Object.assign(Object.assign({},n),{styles:Md(n.styles,zd)}))};case"ProgressIndicator":return{type:e.type,node:(t=e.node,Fd(t))};default:return e}var t,n,i,a,o,r}function ou(e){return up(e)}function ru(e,t){return Error(`Migration process from v0_23 to v1_0 failed: could not transform ${e} node. For more details: ${t}`)}const su=e=>"scroll"===e||"auto"===e?"visible":e,lu=fe(["elements","own"]),cu=fe(["transitions","transition","value","own"]),du=fe(["elements","wrapper"]),uu=fe(["transitions","transition","value","wrapper"]),pu=fe(["elements","indicator"]),fu=fe(["transitions","transition","value","indicator"]),yu=fe(["elements","activeIndicator"]),mu=fe(["transitions","transition","value","activeIndicator"]),hu=fe(["elements","seenIndicator"]),vu=fe(["transitions","transition","value","seenIndicator"]),gu=fe(["default","container","overflow"]),bu=fe(["pressed","container","overflow"]),Iu=fe(["hovered","container","overflow"]),Eu=fe(["focussed","container","overflow"]),Su=fe(["disabled","container","overflow"]),Ou=fe(["container","overflow"]),wu=J(I(S(["default","container","overflow"]),ye(gu,su)),I(S(["pressed","container","overflow"]),ye(bu,su)),I(S(["hovered","container","overflow"]),ye(Iu,su)),I(S(["focussed","container","overflow"]),ye(Eu,su)),I(S(["disabled","container","overflow"]),ye(Su,su))),Au=I(S(["container","overflow"]),ye(Ou,su)),Cu=J(I(S(["elements","own"]),ye(lu,ie(wu))),I(S(["transitions","transition","value","own"]),ye(cu,Au))),Tu=I(Le("transitions"),(e=>{var t;return G(ke(["transitions"]),Pe("conditionalTransitions",null===(t=e.transitions)||void 0===t?void 0:t.transition))(e)})),xu=J(Cu,Tu),Nu=J(I(S(["elements","wrapper"]),ye(du,ie(wu))),I(S(["transitions","transition","value","wrapper"]),ye(uu,Au))),_u=J(I(S(["elements","indicator"]),ye(pu,ie(wu))),I(S(["transitions","transition","value","indicator"]),ye(fu,Au))),Ru=J(I(S(["elements","activeIndicator"]),ye(yu,ie(wu))),I(S(["transitions","transition","value","activeIndicator"]),ye(mu,Au))),Du=J(I(S(["elements","seenIndicator"]),ye(hu,ie(wu))),I(S(["transitions","transition","value","seenIndicator"]),ye(vu,Au)));function Lu(e){return"StaticImage"===e.type}function ku(e){return"StaticIcon"===e.type}function Pu(e){return"BasicText"===e.type}function ju(e){return"DataImage"===e.type}function $u(e){return"DataIcon"===e.type}function Gu(e){return"RichText"===e.type}function Fu(e){return"SlideStateTrigger"===e.type}function Mu(e){return"ToggleButtonStateTrigger"===e.type}const Bu=te(ee([function(e){return"Row"===e.type&&Uu(e.node.children)},function(e){return"Column"===e.type&&Uu(e.node.children)},Lu,ku,Gu,Pu,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&Uu(e.node.children)},function(e){return"StaticLink"===e.type&&Uu(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&&Uu(e.node.children)},function(e){return"ProgressControl"===e.type&&Qu(e.node.children)},function(e){return"ZStack"===e.type&&Uu(e.node.children)},function(e){return"FlowRow"===e.type&&Uu(e.node.children)},Fu,Mu]));function Uu(e){return Bu(e)}const Vu=J(Cu,Nu,Tu);function zu(e){const t=e.children.map((e=>up(e)));if(Uu(t))return Object.assign(Object.assign({},ke(["settings"],e)),{children:t,allowBackdropToClose:e.settings.allowBackdropToClose,styles:e.styles?Vu(e.styles):void 0});throw ru("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function Hu(e){const t=e.children.map((e=>up(e)));if(Qu(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?xu(e.styles):void 0});throw ru("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function Wu(e){const t=e.children.map((e=>up(e)));if(ep(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?xu(e.styles):void 0});throw ru("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function qu(e){const t=e.children.map((e=>up(e)));if(Qu(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?xu(e.styles):void 0});throw ru("ProgressControl",`Invalid schema: ${JSON.stringify(e)}`)}const Ju=J(Cu,_u,Ru,Du,Tu);const Ku=te(ee([Pu,Lu,ku,ju,$u,function(e){return"Row"===e.type&&Yu(e.node.children)},function(e){return"FlowRow"===e.type&&Yu(e.node.children)},function(e){return"Column"===e.type&&Yu(e.node.children)},function(e){return"ZStack"===e.type&&Yu(e.node.children)},function(e){return"When"===e.type&&Yu(e.node.children)}]));function Yu(e){return Ku(e)}const Zu=te(ee([Pu,Lu,ku,function(e){return"Row"===e.type&&Qu(e.node.children)},function(e){return"FlowRow"===e.type&&Qu(e.node.children)},function(e){return"Column"===e.type&&Qu(e.node.children)},function(e){return"ZStack"===e.type&&Qu(e.node.children)},function(e){return"When"===e.type&&Qu(e.node.children)}]));function Qu(e){return Zu(e)}const Xu=te(ee([Pu,Lu,ku,ju,$u,function(e){return"Row"===e.type&&ep(e.node.children)},function(e){return"FlowRow"===e.type&&ep(e.node.children)},function(e){return"Column"===e.type&&ep(e.node.children)},function(e){return"ZStack"===e.type&&ep(e.node.children)},function(e){return"When"===e.type&&ep(e.node.children)}]));function ep(e){return Xu(e)}function tp(e){const t=e.children.map((e=>up(e)));if(Yu(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?xu(e.styles):void 0});throw ru("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}function np(e){const t=e.children.map((e=>up(e)));if(ep(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?xu(e.styles):void 0});throw ru("CatalogResponseButton",`Invalid schema: ${JSON.stringify(e)}`)}function ip(e){return"Row"===e.type&&rp(e.node.children)}function ap(e){return"Column"===e.type&&rp(e.node.children)}const op=te(ee([Pu,Lu,ku,ju,$u,Gu,function(e){return"StaticLink"===e.type},Fu,Mu,function(e){return"CatalogResponseButton"===e.type},ip,function(e){return"FlowRow"===e.type&&rp(e.node.children)},ap,function(e){return"ZStack"===e.type&&rp(e.node.children)},function(e){return"When"===e.type&&rp(e.node.children)}]));function rp(e){return op(e)}const sp=ee([ip,ap]);function lp(e){const t=up(e.template);if(function(e){return sp(e)}(t))return Object.assign(Object.assign({},e),{template:t,styles:e.styles?xu(e.styles):void 0});throw ru("CatalogStackedCollection",`Invalid schema: ${JSON.stringify(e)}`)}function cp(e){const t=e.children.map((e=>up(e)));if(Yu(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?xu(e.styles):void 0});throw ru("ToggleButtonStateTrigger",`Invalid schema: ${JSON.stringify(e)}`)}function dp(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=>up(e))),transition:t})}function up(e){switch(e.type){case"Row":return{type:e.type,node:(v=e.node,Object.assign(Object.assign({},v),{children:v.children.map((e=>up(e))),styles:v.styles?xu(v.styles):void 0}))};case"When":return{type:e.type,node:dp(e.node)};case"FlowRow":return{type:e.type,node:(h=e.node,Object.assign(Object.assign({},h),{styles:h.styles?xu(h.styles):void 0,children:h.children.map((e=>up(e)))}))};case"Column":return{type:e.type,node:(m=e.node,Object.assign(Object.assign({},m),{children:m.children.map((e=>up(e))),styles:m.styles?xu(m.styles):void 0}))};case"ZStack":return{type:e.type,node:(y=e.node,Object.assign(Object.assign({},y),{styles:y.styles?xu(y.styles):void 0,children:y.children.map((e=>up(e)))}))};case"Overlay":return{type:e.type,node:zu(e.node)};case"ProgressControl":return{type:e.type,node:qu(e.node)};case"CarouselDistribution":return{type:"CarouselDistribution",node:(f=e.node,Object.assign(Object.assign({},ke(["settings"],f)),{viewableItems:f.settings.viewableItems,peekThroughSize:f.settings.peekThroughSize,styles:f.styles?xu(f.styles):void 0}))};case"CloseButton":return{type:"CloseButton",node:Hu(e.node)};case"CreativeResponse":return{type:"CreativeResponse",node:Wu(e.node)};case"GroupedDistribution":return{type:"GroupedDistribution",node:(p=e.node,Object.assign(Object.assign({},ke(["settings"],p)),{viewableItems:p.settings.viewableItems,transition:p.settings.transition,styles:p.styles?xu(p.styles):void 0}))};case"OneByOneDistribution":return{type:"OneByOneDistribution",node:(u=e.node,Object.assign(Object.assign({},u),{styles:u.styles?xu(u.styles):void 0}))};case"ProgressIndicator":return{type:"ProgressIndicator",node:(c=e.node,Object.assign(Object.assign({},ke(["settings"],c)),{startPosition:null===(d=c.settings)||void 0===d?void 0:d.startPosition,styles:c.styles?Ju(c.styles):void 0}))};case"SlideStateTrigger":return{type:"SlideStateTrigger",node:(l=e.node,Object.assign(Object.assign({},l),{styles:l.styles?xu(l.styles):void 0}))};case"StackedDistribution":return{type:"StackedDistribution",node:(s=e.node,Object.assign(Object.assign({viewableItems:[]},s),{styles:s.styles?xu(s.styles):void 0}))};case"StaticLink":return{type:"StaticLink",node:tp(e.node)};case"ToggleButtonStateTrigger":return{type:"ToggleButtonStateTrigger",node:cp(e.node)};case"CatalogResponseButton":return{type:"CatalogResponseButton",node:np(e.node)};case"CatalogStackedCollection":return{type:"CatalogStackedCollection",node:lp(e.node)};case"RichText":return{type:"RichText",node:(r=e.node,Object.assign(Object.assign({},r),{styles:r.styles?Tu(r.styles):void 0}))};case"DataImage":return{type:"DataImage",node:(o=e.node,Object.assign(Object.assign({},o),{styles:o.styles?Tu(o.styles):void 0}))};case"StaticImage":return{type:"StaticImage",node:(a=e.node,Object.assign(Object.assign({},a),{styles:a.styles?Tu(a.styles):void 0}))};case"DataIcon":return{type:"DataIcon",node:(i=e.node,Object.assign(Object.assign({},i),{styles:i.styles?Tu(i.styles):void 0}))};case"StaticIcon":return{type:"StaticIcon",node:(n=e.node,Object.assign(Object.assign({},n),{styles:n.styles?Tu(n.styles):void 0}))};case"BasicText":return{type:"BasicText",node:(t=e.node,Object.assign(Object.assign({},t),{styles:t.styles?Tu(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 pp(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 fp(e,t){return e.major===t.major&&e.minor===t.minor}const yp=(e,t,n)=>E([ve(e),je(t)])(n);function mp(e,t){return fp(t,{major:0,minor:0})?mp(vd(e),{major:0,minor:1}):function(e,t){return 0===t.major&&yp(1,23,t.minor)}(0,t)?mp(ou(e),{major:1,minor:0}):e}function hp(e,t){return fp(t,{major:0,minor:0})?hp(function(e){return Object.assign(Object.assign({},e),{layout:vd(e.layout)})}(e),{major:0,minor:1}):function(e,t){return 0===t.major&&yp(1,23,t.minor)}(0,t)?hp(function(e){return Object.assign(Object.assign({},e),{layout:ou(e.layout)})}(e),{major:1,minor:0}):e}function vp(e,t,n,i){const a=pp(n);if(i){const s=pp(i);if(r=a,(o=s).major<r.major||o.major===r.major&&o.minor<r.minor||fp(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,pp("0.0"));var o,r}function gp(e){try{return Object.assign(Object.assign({},$e(e)),{offer:Object.assign(Object.assign({},$e(e.offer)),{creative:ad(e.offer.creative)}),layoutVariant:Object.assign(Object.assign({},$e(e.layoutVariant)),{layoutVariantSchema:"string"==typeof e.layoutVariant.layoutVariantSchema?rd(e.layoutVariant.layoutVariantSchema,"LayoutSlotLayoutVariant",e.instanceGuid):e.layoutVariant.layoutVariantSchema})})}catch(t){throw t.message?t:id("Slot",e.instanceGuid)}}function bp(e){if(e){const t=function(e){try{return Object.assign(Object.assign({},$e(e)),{outerLayoutSchema:"string"==typeof e.outerLayoutSchema?rd(e.outerLayoutSchema,"LayoutRootLayoutSchema",e.instanceGuid):e.outerLayoutSchema,slots:ie(gp,e.slots)})}catch(t){throw t.message?t:id("LayoutConfig",e.instanceGuid)}}(e);return function(e,t){const{layoutSchemaVersion:n}=e,i=fe(["outerLayoutSchema"]),a=fe(["slots"]),o=fe(["layoutVariant","layoutVariantSchema"]);return J(ye(a,ie(ye(o,(e=>vp(e,mp,t,n))))),ye(i,(e=>vp(e,hp,t,n))))(e)}(t,ms.DCUI_SCHEMA_VERSION)}}const Ip=A([[H({signalType:j("SignalSecondaryResponse")}),function*(e,t){return yield We({type:zr,payload:{level:fs,code:As,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}],[H({isPositive:j(!0)}),function*(e,t,n){var i;if("url"in e&&e.url){const a=e.instanceGuid;yield We({type:Kt,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:a,responseActionPayload:{name:"Url",transformedTrafficURL:e.url}}});const o=t.getOverrideLinkNavigation()?"overrideLinkNavigation":null!==(i=e.urlBehavior)&&void 0!==i?i:"newTab",r=yield*function*(e,t,n){try{const i=yield Ve(sl,t),a=ul(i)?i.ref:void 0;return yield Ve(e.addAdvertiserWindowRef,a,n),ul(i)||"newTab"!==t.urlBehavior?"SUCCESS":(yield We({type:zr,payload:{level:fs,code:Cs,message:`Did not receive a window reference opening link ${t.url}`}}),"UNSPECIFIED")}catch(e){return yield We({type:zr,payload:{level:fs,code:Cs,message:`Errored attempting to open link ${t.url}: ${e.message}`,stack:e.stack}}),"ERROR"}}(t,{url:e.url,urlBehavior:o,external:{partner:n}},a);return"self"===o?"END":r}return yield We({type:zr,payload:{level:fs,code:As,message:"URL response doesn't have a valid url",additionalInformation:{instanceGuid:e.instanceGuid}}}),"ERROR"}],[x,function*(){return"EXPLICIT_DISMISSAL"}]]);function*Ep(e){return yield We({type:zr,payload:{level:fs,code:As,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}function*Sp(e,t){let n="IMPLICIT_DISMISSAL";const i=t.payload.offerPositionIndex,a=qt(t.payload)||Jt(t.payload)||Wt(t.payload)?t.payload:t.payload.responseOption;switch(a.action){case"Url":yield We({type:Qt,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield We({type:Hr,payload:{code:"CREATIVE_RESPONSE",message:"creative positive response",data:{type:a.action,isPositive:a.isPositive,responseInstanceGuid:a.instanceGuid}}}),yield We({type:Qt,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Ep(a):yield*Ip(a,e.context,e.partner);break;case"CaptureOnly":yield We({type:Qt,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield We({type:Qt,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Ep(a):yield*function*(e){return yield We({type:Kt,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:"CaptureOnly"}}}),e.isPositive?"SUCCESS":"EXPLICIT_DISMISSAL"}(a);break;case"Fulfillment":yield We({type:zr,payload:{level:fs,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"External":yield We({type:zr,payload:{level:fs,code:"INCORRECTLY_HANDLE_EXTERNAL_ACTION",message:`External action was dispatched as an engagement erroneously. Instance GUID: ${a.instanceGuid}`}}),n="ERROR"}Ss(t.payload)||(yield We(function(e,t){switch(e){case"SUCCESS":return{type:Rc,payload:{event:"Completed",completionReason:"Success",offerPositionIndex:t}};case"UNSPECIFIED":return{type:Rc,payload:{event:"Completed",completionReason:"Unspecified",offerPositionIndex:t}};case"ERROR":return{type:Rc,payload:{event:"Completed",completionReason:"Error",offerPositionIndex:t}};case"EXPLICIT_DISMISSAL":return{type:Rc,payload:{event:"Dismissed",dismissalReason:"Explicit",offerPositionIndex:t}};case"IMPLICIT_DISMISSAL":return{type:Rc,payload:{event:"Dismissed",dismissalReason:"Implicit",offerPositionIndex:t}};default:return{type:xc,payload:{offerProcessStatus:"END"}}}}(n,i)))}function Op(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:zr,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:zr,payload:{level:Nt,code:"FAILED_TO_LOAD_MODULE",message:t,additionalInformation:{stack:i,reason:t?void 0:e,moduleName:n}}}),a(lt)})),()=>{})))}const wp={"standard-marketing":()=>Promise.resolve().then((function(){return Df})),"add-to-cart":()=>Promise.resolve().then((function(){return Ly})),"instant-purchase":()=>Promise.resolve().then((function(){return rm})),"layouts-xp-sandbox":()=>Promise.resolve().then((function(){return Gm}))};function*Ap(e,t,n){let i=yield Je((e=>e.module.loadedModules));for(const a of n.payload.modules)i&&!(null==i?void 0:i.includes(a))&&(i=[...i,a],yield Ze(Cp,e,t,a))}function*Cp(e,t,n){if(n in wp){yield We({type:Sc,payload:n});const i=yield Ve(Op,e,t,n,wp[n]);yield Ve(Os,i)}else yield We({type:zr,payload:{level:us,code:"INVALID_MODULE_NAME",message:`Could not load unknown module ${n}`}})}function*Tp(e){const t=yield Je((e=>fd.getDistributionViewableItems(e.layout?fd.getDistribution(e.layout.layoutSchema):void 0))),n=yield Je((n=>{var i;const a=zs(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:Tc,payload:{groupSize:n}};yield We(e)}}const xp=A([[(e,t,n,i)=>"END"===e.offerProcessStatus,$({type:Pr})],[(e,t,n,i)=>t.isLastOffer&&n,$({type:Pr})],[(e,t,n,i)=>1===i&&!t.isLastOffer,$({type:Ac})],[x,$(void 0)]]);function*Np(e){const t=yield Je((e=>({exists:null!==e.progression,isLastOffer:Vc(e)}))),n=yield Je((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 Je((e=>e.settings.closeOnComplete)),a=xp(e,t,"boolean"==typeof i&&i,n);a&&(a.type===Pr&&(yield We({type:Qt,payload:{name:"PLACEMENT_COMPLETED"}})),yield We(a))}(e.payload,t,n))}function _p(e){return e.type===Rc&&"Interactive"===e.payload.event}function Rp(e){return e.type===Rc&&"Interactive"!==e.payload.event}function*Dp(e){switch(e.payload.event){case"Dismissed":yield We({type:xc,payload:{offerProcessStatus:"CONTINUE"}});break;case"Completed":yield We({type:Dc,payload:{key:"offerCompleted",value:A([[j("Error"),$(-1)],[j("Success"),$(1)],[x,$(2)]])(e.payload.completionReason),offerPositionIndex:e.payload.offerPositionIndex}}),yield We({type:xc,payload:{offerProcessStatus:"CONTINUE"}});break;case"Interactive":yield We({type:Vt,payload:{name:"Interactive",offerPositionIndex:e.payload.offerPositionIndex}}),yield We({type:Qt,payload:{name:"PLACEMENT_INTERACTIVE"}})}}function*Lp(e,t){var n;try{const n=yield Je((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 Ve(e.partner.send,il.PartnerValidationEvent.SET_PARTNER_VALIDATION_STATUS,{errors:t.payload.errors}))}catch(i){const a=yield Je((({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 Ve(e.context.getRoktPageInstanceGuid))&&void 0!==n?n:"N/A",r={type:zr,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 We(r)}}function*kp(e){const t=yield Je((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield We({type:Pc.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield We({type:Pr}),t?(yield We({type:Kt,payload:{name:"SignalInstantPurchaseDismissal",parentGuid:t}}),yield We({type:Kt,payload:{name:"SignalDismissal",parentGuid:t}})):yield We({type:zr,payload:{level:ps,code:Ts,message:"ParentGuid does not exist"}})}function*Pp(e,t){yield Ke([Ye(zr,ws.bind(null,e.errorService.raise)),Qe(kr,md.bind(null,{display:e.displayService,partner:e.partnerInteractionService})),Ye(Oc,Ap.bind(null,t,e.contextService)),Qe(Lc,Sp.bind(null,{partner:e.partnerInteractionService,context:e.contextService})),Ye(xc,Np),Ye(Rp,Dp),Es(_p,Dp),Qe(Rr,Zs.bind(null,e.displayService)),Qe(Pr,ml.bind(null,e.contextService)),Qe(_c,kp),Qe(Vr,Ml),Ye(Kt,Ol),Ye(Xt,wl),Is(Vt,Gl.bind(null,e.metricsService)),Is(Ur,Al.bind(null,e.rdnService)),Ye(Hr,Sl.bind(null,e.errorService.raise)),Qe(Nr,Tp),Ye(Zt,$l),Ye(en,Fl.bind(null,{createChildPlugin:e.childPlugin.create,partner:e.partnerInteractionService,context:e.contextService})),Qe(tn,Lp.bind(null,{partner:e.partnerInteractionService,context:e.contextService}))])}var jp,$p,Gp,Fp,Mp,Bp=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},Up=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 Vp={[an.SET_CUSTOM_STATE]:Pc.SET_CUSTOM_STATE,[an.SET_DOMAIN_STATE]:Pc.SET_DOMAIN_STATE,[an.SET_GLOBAL_OFFER_DATA_CART]:Pc.SET_GLOBAL_OFFER_DATA_CART,[an.OFFER_LIFECYCLE]:jc.OFFER_LIFECYCLE,[an.OFFER_ENGAGEMENT]:jc.OFFER_ENGAGEMENT,[an.SET_PARTNER_VALIDATION_STATUS]:jc.SET_PARTNER_VALIDATION_STATUS};class zp{constructor(e){jp.add(this),$p.set(this,void 0),Bp(this,$p,e,"f")}getState(e){const t=Up(this,$p,"f").getState();return{breakpoint:t.breakpoint,progression:zc(t),customStates:Ws(t,e.offerPositionIndex),domainStates:Hc(t,e.offerPositionIndex)}}dispatch(e,t){Up(this,$p,"f").dispatch(Up(this,jp,"m",Mp).call(this,e,t))}subscribe(e,t){return t(this.getState(e)),Up(this,$p,"f").subscribe((()=>{t(this.getState(e))}))}}function Hp(e,t){const n=ot(),i={},a=it({reducer:Bc,devTools:{name:"Orchestrator"},preloadedState:Object.assign(Object.assign({},Uc()),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 zp(e)}(a),s=e.childPlugin.create,l=e.partnerInteractionService.onEvent,(e,t)=>new sa(r,s,e,t,l));var r,s,l;n.run(Pp,e,o),n.run(bl,e,bp);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({},Bc),c)))),t&&Object.assign(i,t),o&&n.run(o)}})}$p=new WeakMap,jp=new WeakSet,Gp=function(e,t,n){return{type:e,payload:Object.assign(Object.assign({},t),{offerPositionIndex:n})}},Fp=function(e,t){return t.type===Xt?t.payload.signal.parentGuid||(t.payload.signal.parentGuid=e.creativeInstanceGuid):t.payload.parentGuid||(t.payload.parentGuid=e.creativeInstanceGuid),t},Mp=function(e,t){return function(e){return e.type in Vp}(t)?Up(this,jp,"m",Gp).call(this,Vp[t.type],t.payload,e.offerPositionIndex):t.type===Kt||t.type===Xt?Up(this,jp,"m",Fp).call(this,e,t):t};var Wp=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 qp={ctx:new Map([[Ec.name,Ec],[gc.name,gc],[cc.name,cc]]),cache:[]};function Jp(n,i){return Wp(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:Ct.pluginId,pageInstanceGuid:"fulfilled"===t.status?t.value:Ct.pageInstanceGuid}))).catch((()=>Ct))}(i),s=f(n),l=Hp(i);s.render(t(a.StrictMode,{children:[e(Sr,{}),e(v,{store:l,children:t(ja.Provider,{value:o,children:[e(Gs,{}),e(Ii.Provider,{value:n,children:e(lr,{extensions:qp,extendStore:l.extend.bind(l),children:e(ud,{pageInstanceGuid:r})})})]})})]}))}))}class Kp{constructor(){this._subscribers=[]}add(e){this._subscribers.push(e)}unsubscribe(){this._subscribers.forEach((e=>e.unsubscribe()))}}const Yp=()=>{},Zp=(e=Yp,t=Yp,n=Yp)=>"function"!=typeof e?e:{next:e,error:t,complete:n};class Qp{constructor(e){this._setupFn=e}subscribe(e,t,n){const i=Zp(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 Kp;return s.add({unsubscribe:()=>{a&&a(),o=!1}}),s}}class Xp extends Qp{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 Qp((e=>{const t=this.subscribe(e);return()=>t.unsubscribe()}))}}class ef extends Xp{constructor(e){super(),this._lastValue=e}subscribe(e,t,n){const i=Zp(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 tf extends Xp{constructor(e=-1){super(),this._buffer=[],this._error=null,this._bufferLength=e}subscribe(e,t,n){const i=Zp(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 nf={CompletedBeforeEmit:"CompletedBeforeEmit"},af=(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(nf.CompletedBeforeEmit))}))})).finally((()=>n.unsubscribe()))},of=(e,t)=>new Promise(((n,i)=>{let a;"object"==typeof t&&(a=t.defaultValue),e.subscribe((e=>a=e),(e=>i(e)),(()=>n(a)))})),rf=(e,t)=>new Qp((n=>{const i=e=>n.next(e);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)}));function sf(e){return new Qp((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>t.error(e)))}))}const lf=(...e)=>new Qp((t=>{const n=new Kp;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()})),cf=(...e)=>new Qp((t=>{for(const n of e)t.next(n)})),df=(...e)=>new Qp((t=>{if(!e.length)return t.complete(),Yp;const n=new Kp,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 uf=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 pf(e,t){return new ff(e,t)}class ff{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)=>uf(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 yf{constructor(e){this.value=e,this.complete=!1,this.skip=!1}}var mf=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 hf=e=>(...t)=>new Qp((n=>{const i=e.subscribe((e=>mf(void 0,void 0,void 0,(function*(){try{let i=new yf(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()})),vf=e=>t=>(!1===e(t.value)&&(t.skip=!0),t),gf=e=>t=>(e?!0===e(t.value)?t.complete=!0:t.skip=!0:t.complete=!0,t),bf=e=>t=>{const n=e(t.value);return new yf(n)},If=e=>t=>(e(t.value),t),Ef={FULLSCREEN:"DisplayPreset.FULLSCREEN",EMBEDDED:"DisplayPreset.EMBEDDED",ATTACHED:"DisplayPreset.ATTACHED"},Sf={ERROR:"ERROR",INFO:"INFO",WARNING:"WARNING"},Of={getBreakpointCSSClass:Bt};function wf(){const t=Sa();return e(vi,{children:e=>e(t)})}const Af={mock:function(e=null,t){return t.type,e}};function Cf(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*Tf(e,t){for(;;){switch(yield He(e)){case"CLOSED":t({type:Yt,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":t({type:Yt,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:Yt,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*xf(e,t,n){const i=qt(n.payload)||Jt(n.payload)||Wt(n.payload)?n.payload:n.payload.responseOption;switch(i.action){case"Url":Ss(n.payload)&&(yield We({type:Qt,payload:{name:"REALTIME_OFFER_FULFILLMENT_REFERRAL",body:{rclid:i.rclid,accountID:i.accountID,referralCreativeID:i.referralCreativeID}}})),yield Ve(e.globalDispatch.bind(e),n);break;case"CaptureOnly":yield Ve(e.globalDispatch.bind(e),n);break;case"Fulfillment":yield We({type:Qt,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield We({type:Qt,payload:{name:"POSITIVE_ENGAGEMENT"}})),yield*function*(e,t,n){if(Ht(n)){const{responseOption:i,fulfillment:a}=n;yield We({type:Kt,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const o=yield Ve(e.createChildPlugin.bind(e),a);if("object"==typeof o&&"onClose"in o){const t=yield Ve(Cf,o);if("object"==typeof t&&"take"in t)return void(yield Ve(Tf,t,e.globalDispatch.bind(e)))}yield Ve(t,{level:Nt,code:"UNEXPECTED_NEXT_VALUE_IN_SAGA",message:'Received an unexpected input at a step in the saga "handleFullfillmentResponse" and could not continue.'})}else yield Ve(t,{level:Nt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}(e,t,n.payload)}}function*Nf(e,t){yield Ke([Qe(zt,xf.bind(null,e,t)),Ye("*",hs.bind(null,[zt],e))])}function _f(e,t,n=function(e={}){return Object.assign({mock:null},e)}()){const i=ot(),a=it({reducer:Af,devTools:{name:"Standard Marketing"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Nf,e,t),a}Object.assign({},an);const Rf=(new va).withAppFactory((function(n){var i;if(n.rootElement){const o=f(n.rootElement),r=_f(n.gateway,n.logger);o.render(e(a.StrictMode,{children:t(Da,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(Sr,{}),e(v,{store:r,children:e(Ir,{settings:n,dispatch:r.dispatch,children:e(wf,{})})})]})}))}}));var Df=Object.freeze({__proto__:null,moduleConnectorBuilder:Rf});const Lf="CART/UPDATE",kf="CATALOG_ITEM/RESPONSE",Pf="USER_CREATIVE_RESPONSE_HISTORY/ADD",jf=A([[(e,t)=>0!==t,j],[(e,t)=>!Number.isNaN(e)&&0===t,j],[(e,t)=>Number.isNaN(e)&&0===t,Ge]]);function $f({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 Gf="catalogRadioGroup__label",Ff=["Enter","Space"],Mf={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 Bf(e,t,n){return e.map(A([[G(j("Required"),B("","type")),({value:e})=>Number.isNaN(n)&&t>0?e.message:""],[x,$("")]])).filter(Fe)}function Uf({schema:n,testId:i}){const r=y(),s=Pa(),[l,c]=m((e=>{var t,i;const a=s.cartItemId in e.cart?null!==(i=null===(t=e.cart[s.cartItemId])||void 0===t?void 0:t.quantity)&&void 0!==i?i:0:NaN;return[a,Bf(n.validations,n.options.length,a)]})),d=wa(),u=Ma(),{tabIndex:p,styles:f,isDisabled:h}=It(d);o((()=>{h||r(Vf(c))}),[]);const v=n.options.filter((({quantity:e})=>{var t,n;return e>=(null!==(t=s.minItemCount)&&void 0!==t?t:-1/0)&&e<=(null!==(n=s.maxItemCount)&&void 0!==n?n:1/0)}));function g(e){r({type:kf,payload:{catalogItem:s,quantity:e}});const t=Bf(n.validations,n.options.length,e);r(Vf(t))}return v.length>0?e(wo,{styles:n.styles?Mt(Mf,n.styles):Mf,children:({classnames:n,mapperRef:o})=>e("div",{className:null==n?void 0:n.own,style:Object.assign(Object.assign({display:"flex",flexDirection:"column"},f),u),children:e(qi,{value:o(Gf),children:a.Children.toArray(v.map(((a,o)=>{var r;const c=jf(l,a.quantity),d=e=>i?`${i}-option${o}${e}`:void 0;return t("label",{tabIndex:p,"aria-disabled":h,style:{display:"flex"},className:`${Gf} ${null!==(r=null==n?void 0:n.optionContainer)&&void 0!==r?r:""}`,onKeyDown:e=>{c||!Ff.includes(e.code)||h||g(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:s.instanceGuid,value:a.quantity,checked:c,onChange:()=>g(a.quantity),"aria-disabled":h,disabled:h}),e($f,{isChecked:c,isDisabled:h,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(Cr,{schema:a,testId:d("Content")})]})})))})})}):null}function Vf(e){return{type:tn,payload:{errors:e}}}function zf(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Hf(t){const n=y(),i=gi(),a=Pa(),o=wa(),r=Ma(),{tabIndex:s,styles:l,isDisabled:c}=It(o);return e(wo,{styles:t.schema.styles,children:({classnames:o})=>e("button",{type:"button",tabIndex:s,"aria-disabled":c,disabled:c,style:Object.assign(Object.assign({cursor:"pointer"},l),r),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:kf,payload:{catalogItem:a,quantity:1}})},className:null==o?void 0:o.own,children:zf(t.schema.children,i,t.testId)})})}const Wf={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"]},qf=new Map([["&","_;^;_"]]),Jf=new RegExp(`<a *(?=${Wf.allowedAttributes.a.join("|")}|>)`,"g"),Kf=new RegExp(`<a *(?:(?:${Wf.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),Yf=new RegExp("(<br *?>)|(<br *?/>)","g"),Zf=new RegExp(`<ul *(?=${Wf.allowedAttributes.ul.join("|")}|>)`,"g"),Qf=new RegExp(`<ol *(?=${Wf.allowedAttributes.ol.join("|")}|>)`,"g"),Xf=new RegExp("<li *(?=>|\\s[^>]*>)","g"),ey="<br/>";function ty(t){const n=Hi(),i=wa(),a=Ma(),o=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Kf,((e,t)=>{const n=t.replaceAll("&",qf.get("&"));return e.replace(t,n)})).replaceAll(Yf,ey)}(e);return t===vt(t,Wf)}(e))throw new Rt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:r,styles:s,isDisabled:l}=It(i),c=Object.assign(Object.assign({},s),a),u=z(c)?void 0:c;return o?e(wo,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class="${null==n?void 0:n.link}"`:"",l?'tabindex="-1"':"",l?"style=\"pointer-events: 'none'; user-select: none;\"":"",l?'aria-disabled="true"':""].filter((e=>e.length>0)),a=((null==n?void 0:n.list)?`class="${n.list}"`:"")+' style="list-style-type: none; padding-inline-start: 0px; display: flex; flex-direction: column;"',s=((null==n?void 0:n.listItem)?`class="${n.listItem}"`:"")+' style="display: flex; align-items: flex-start; flex-shrink: 0; flex-grow: 1;"',c=`class="rokt-icon${(null==n?void 0:n.span)?" "+n.span:""}" style="display: inline-block; pointer-events: none; user-select: none;" aria-disabled="true"`,d=o.replace(Jf,`<a ${i.join(" ")}`).replace(Zf,`<ul ${a}`).replace(Qf,`<ol ${a}`).replace(Xf,`<li ${s}><span ${c}>Check</span`);return p=o,new RegExp("</(p|ul|ol)>").test(p)?e("div",{tabIndex:r,style:u,"aria-hidden":l,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:d}}):e("p",{tabIndex:r,style:u,"aria-hidden":l,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:d}});var p}}):null}const ny={internally:"_top",externally:"_blank"};function iy(t,n,i,a,o){return e(qi,{value:i(n),children:ay(t,a,o)})}function ay(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function oy(t){var n,i;const a=ny[t.schema.open],o=gi(),r=Pa(),s=wa(),l=y(),c=null!==(n=r.url)&&void 0!==n?n:"",{tabIndex:d,styles:u,isDisabled:p}=It(s);return Boolean(c)&&(null===(i=t.schema.children)||void 0===i?void 0:i.length)>0?e(wo,{styles:t.schema.styles,children:({classnames:n,mapperRef:i})=>{var s;return e("a",{href:c,onClick:()=>{var e;l({type:Kt,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)?iy(t.schema.children,null==n?void 0:n.own,i,o,t.testId):ay(t.schema.children,o,t.testId)})}}):null}function ry(e,t){const n=e.cart[t];return n||null}function sy(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 ly(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 sy(e).reduce(((e,t)=>e+t.quantity),0)}(e),s=ry(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}function cy(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 dy(e,t){var n,i;return null!==(i=null===(n=cy(e))||void 0===n?void 0:n.find((e=>e.catalogItemId===t)))&&void 0!==i?i:null}function uy(e){var t;const n=null===(t=cy(e))||void 0===t?void 0:t.filter((e=>e.preSelectedQuantity&&e.preSelectedQuantity>0));return n&&n.length>0?n:null}function py(e){var t,n;return null!==(n=null===(t=uy(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 fy=G((e=>e.filter((e=>!re(e[1]))).map((([e,t])=>({cartItemId:t.cartItemId,quantity:t.quantity})))),le,M("cart"));function yy(t,n,i,a,o){return e(qi,{value:i(n),children:a(t,void 0,o)})}function my(e,t,n){return t(e,void 0,n)}function hy(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=Pa(),I=gi(),E=Hi(),S=wa(),O=Ma(),{tabIndex:w,styles:A,isDisabled:C}=It(S),T=m((e=>function(e,t){var n,i,a;const o=dy(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))),x=m((e=>ry(e,b.cartItemId))),N=m((e=>ly(e,b))),_=(null==x?void 0:x.quantity)||0,R=It(C||_<=(null!==(a=b.minItemCount)&&void 0!==a?a:0)?"DISABLED":S),D=It(C||N<=0?"DISABLED":S),L=It(C||T?"DISABLED":S),k=e=>{var t;const n=e.target.value;if(0===n.length)P(null!==(t=b.minItemCount)&&void 0!==t?t:0);else{const e=Number(n);!Number.isNaN(e)&&e>=0&&P(e)}},P=e=>{C||g({type:kf,payload:{catalogItem:b,quantity:e}})};return e(wo,{styles:l,children:({classnames:i,mapperRef:a})=>e("div",{className:null==i?void 0:i.own,style:Object.assign(Object.assign({display:"flex",flexDirection:"row"},A),O),children:T&&u?e(ko,{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({},R.styles),{cursor:R.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),P(_-1)},tabIndex:R.tabIndex,"aria-label":v||void 0,disabled:R.isDisabled,"data-testid":r?`${r}-decrement-button`:void 0,children:e(zi,{value:E,children:(null==i?void 0:i.decrementButton)?yy(f,i.decrementButton,a,I,r):my(f,I,r)})}):null,c?e("input",{type:"text",className:null==i?void 0:i.input,style:Object.assign(Object.assign({},L),{cursor:L.isDisabled?"not-allowed":"auto",caretColor:L.isDisabled?"transparent":"auto",pointerEvents:"auto",outline:"none"}),value:_,onChange:k,"aria-label":s||void 0,tabIndex:w,disabled:C,"data-testid":r?`${r}-input`:void 0}):e("p",{className:null==i?void 0:i.input,style:A,"data-testid":r?`${r}-quantity-text`:void 0,children:_}),p?e("button",{className:null==i?void 0:i.incrementButton,style:Object.assign(Object.assign({},D.styles),{cursor:D.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),P(_+1)},tabIndex:D.tabIndex,"aria-label":h||void 0,disabled:D.isDisabled,"data-testid":r?`${r}-increment-button`:void 0,children:e(zi,{value:E,children:(null==i?void 0:i.incrementButton)?yy(p,i.incrementButton,a,I,r):my(p,I,r)})}):null]})})})}const vy={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(Hf,{schema:t.node,testId:n})},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"InsuranceRichText":return e(ty,{schema:n.node});case"CatalogUrlLink":return e(oy,{schema:n.node});default:return}}},CatalogRadioGroup:function(t){if("CatalogRadioGroup"===t.type)return e(Uf,{schema:t.node})},CatalogQuantityCounter:function(t){if("CatalogQuantityCounter"===t.type)return e(hy,{schema:t.node})}};function gy(){const t=Sa(),n=gi();return e(bi,{value:n,overrides:vy,children:e(vi,{children:e=>e(t)})})}const by={cart:function(e={},t){if(t.type===Lf){const{catalogItem:n,quantity:i}=t.payload,a=n.cartItemId,o=vs(n,i);return Object.assign(Object.assign({},e),{[a]:o})}return e},userCreativeResponseHistory:function(e=[],t){return t.type===Pf?e.concat(t.payload.responseId):e},staticData:function(e=null,t){return e}};const Iy="INVALID_PARTNER_MESSAGE",Ey="MISCONFIGURED_CATALOG_ITEM",Sy="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function*Oy(e){var t,n;const i=yield Je(uy),a=yield Je(py),o=yield Je((e=>{var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer.maxTotalItemsQtyInOffer}));if(xy(a)&&xy(o)&&a>o)yield Ve(e,{level:_t,code:Ey,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 Ve(e,{level:_t,code:Ey,message:`Preselected quantity (${i}) is greater than maxItemCount (${o}) for catalog item (${a.instanceGuid})`}):yield*Ty(a,i,!0)}}function*wy(e,t,n){const{catalogItem:i,quantity:a}=n.payload;if(yield*Ty(i,a,!1)){const n=yield Je((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){switch(e.action){case"Fulfillment":{const n=null==t?void 0:t.creative.fulfillment;return Ot(n)?{type:zt,payload:{fulfillment:n,responseOption:e}}:`Could not get fulfillment for response (instanceGuid: ${e.instanceGuid})`}case"Url":return(null==t?void 0:t.accountId)?{type:zt,payload:Object.assign(Object.assign({},e),{accountID:null==t?void 0:t.accountId})}:`Could not get accountId for response (instanceGuid: ${e.instanceGuid})`;default:return{type:zt,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 Ve(e.globalDispatch,n):function(e){return"string"==typeof e}(n)&&(yield Ve(t,{level:_t,code:"INVALID_RESPONSE_OBJECT",message:n}))}var o}function*Ay(e,t){const n=function(e,t){return st((n=>{const i=e.onEvent({name:tl.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:Iy,message:`Invalid UpdateCartItemPartnerMessageBody: ${JSON.stringify(e)}`}):n(e)}});return()=>{i()}}))}(e,t);try{for(;;){const e=yield He(n);yield Ve(Cy,e,t)}}catch(e){const n=e;t({level:_t,code:Sy,message:null==n?void 0:n.message})}finally{(yield qe())&&n.close()}}function*Cy(e,t){const{cartItemId:n,quantity:i}=e,a=yield Je(ry,n);if(Ny(a)){const e=yield Je(dy,a.catalogItemId);null!==(o=e)&&"object"==typeof o&&"catalogItemId"in o&&"price"in o?yield*Ty(e,i,!1):yield Ve(t,{level:_t,code:Sy,message:`Catalog item not found for cart item id (${n})`})}else yield Ve(t,{level:_t,code:Sy,message:`Cart item not found for cart item id (${n})`});var o}function*Ty(e,t,n){var i;const a=yield Je(ry,e.cartItemId),o=yield Je(ly,e),r=xy(o)?o:0,s=Ny(a)?a.quantity:0;if(t!==s&&t>=(null!==(i=e.minItemCount)&&void 0!==i?i:0)&&t-s<=r){yield We({type:Lf,payload:{catalogItem:e,quantity:t}});const i=yield Je(ry,e.cartItemId),o=yield Je(fy);return yield We({type:nn,payload:{cart:o}}),yield We({type:Kt,payload:{name:"SignalCartItemQuantitySelected",parentGuid:e.instanceGuid,objectData:{quantity:t,preselected:n}}}),yield We({type:Qt,payload:{name:"V2_CART_ITEM_UPDATED",body:{oldCartItem:a,cartItem:i}}}),!0}return!1}function xy(e){return"number"==typeof e}function Ny(e){return null!=e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&"unitPrice"in e}function*_y(e,t){var n;yield We({type:Pf,payload:{responseId:(n=t.payload,Ht(n)?n.responseOption.id:n.id)}}),yield Ve(e.globalDispatch.bind(e),t)}function*Ry(e,t){yield Ke([Xe(Oy.bind(null,t)),Xe(Ay.bind(null,e,t)),Qe(kf,wy.bind(null,e,t)),Qe(zt,_y.bind(null,e)),Ye("*",hs.bind(null,[zt],e))])}Object.assign(Object.assign({},an),{CATALOG_ITEM_RESPONSE:kf});const Dy=(new va).withAppFactory((function(n){var i;if(n.rootElement){const o=f(n.rootElement),r=function(e={}){return Object.assign({cart:{},userCreativeResponseHistory:[],staticData:null},e)}({staticData:{offer:n.offerData,position:n.offerPositionIndex}}),s=function(e,t,n){const i=ot(),a=it({reducer:by,devTools:{name:"Add To Cart"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Ry,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Da,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(Sr,{}),e(v,{store:s,children:e(Ir,{settings:n,dispatch:s.dispatch,children:e(gy,{})})})]})}))}}));var Ly=Object.freeze({__proto__:null,moduleConnectorBuilder:Dy});const ky="CATALOG/SET_SELECTED_ITEM",Py="INSTANT_PURCHASE/INITIATE",jy="INSTANT_PURCHASE/PARTNER_RESPONSE";function $y(t,n,i,a,o){return e(qi,{value:i(n),children:Gy(t,a,o)})}function Gy(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Fy(t){const n=y(),i=gi(),a=wa(),o=Ma(),{tabIndex:r,styles:s,isDisabled:l}=It(a),c=Pa(),d=Mi(c,"catalogItem");return e(wo,{styles:t.schema.styles,children:({classnames:a,mapperRef:u})=>e("button",{type:"button",tabIndex:r,"aria-disabled":l,disabled:l,style:Object.assign(Object.assign({cursor:"pointer"},s),o),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:Py,payload:{catalogItem:c,quantity:1}})},className:null==a?void 0:a.own,children:e(zi,{value:d,children:(null==a?void 0:a.own)?$y(t.schema.children,a.own,u,i,t.testId):Gy(t.schema.children,i,t.testId)})})})}const My=["ArrowDown","ArrowUp","Enter","Escape"];function By(n){const i="Select an option",a=wi().catalogItems||[],s=wa(),l=Ma(),{styles:d,isDisabled:u}=It(s),p=y(),f=m((e=>e.selectedItem)),h=a.map(((e,t)=>({label:e.title,value:e.catalogItemId,index:t}))),[v,g]=c(!1),[b,I]=c(f?{label:f.title,value:f.catalogItemId,index:a.findIndex((e=>e.catalogItemId===f.catalogItemId))}:null),[E,S]=c(b?b.index:null);function O(){u||(v?A():w())}function w(){u||g(!0)}function A(){u||(g(!1),S(null))}function C(e){I(e),A(),p({type:ky,payload:a[e.index]})}o((()=>{v&&R(b?b.index:0)}),[v,b]);const T=r(null),x=r([]),N={elements:{own:[{default:{background:{backgroundColor:{light:"#ffffff"}},border:{borderColor:{light:"#D0D5DD"},borderRadius:4,borderStyle:"solid",borderWidth:"1"},dimension:{width:{type:"percentage",value:100}},spacing:{padding:"10"}}}]}};function _(e){if(!u)if(v){if(My.includes(e.key))switch(e.preventDefault(),e.key){case"ArrowDown":null!==E&&E!==h.length-1&&R(E+1);break;case"ArrowUp":null!==E&&0!==E&&R(E-1);break;case"Enter":if(null!==E){const e=h[E];e&&(C(e),D())}break;case"Escape":A(),D()}}else"Enter"===e.key&&w()}function R(e){const t=x.current[e];null!=t&&(S(e),t.focus())}function D(e){e&&e.preventDefault(),T.current&&T.current.focus()}return e(wo,{styles:n.schema.styles?Mt(N,n.schema.styles):N,children:({classnames:a})=>{var o;return t("div",{ref:T,className:null==a?void 0:a.own,onKeyDown:_,onMouseDown:D,onClick:O,onBlur:e=>{var t;(null===(t=T.current)||void 0===t?void 0:t.contains(e.relatedTarget))||v&&A()},"aria-disabled":u,"aria-label":null!==(o=n.schema.a11yLabel)&&void 0!==o?o:i,style:Object.assign(Object.assign({position:"relative"},d),l),tabIndex:0,children:[e("div",{className:null==a?void 0:a.dropDownSelectedElement,"aria-disabled":u,style:d,children:b?b.label:i}),v&&e("ul",{className:null==a?void 0:a.dropDownListContainer,onClick:e=>e.stopPropagation(),style:Object.assign({listStyle:"none",margin:0,padding:0,zIndex:9999,position:"absolute",top:"100%",left:0,right:0,backgroundColor:"white",boxShadow:"0 2px 5px rgba(0,0,0,0.2)"},d),children:h.map(((t,n)=>e("li",{ref:e=>function(e,t){x.current[t]=e}(e,n),className:null==a?void 0:a.dropDownListElement,onClick:e=>{e.stopPropagation(),u||C(t)},tabIndex:-1,"aria-label":t.label,style:Object.assign({cursor:"pointer"},d),children:e("span",{children:t.label})},t.value)))})]})}})}function Uy(t){const n=gi(),i=_a(),r=Hi(),s=fi(),l=Ma(),c=wi().catalogItems||[],d=m((e=>e.selectedItem))||c[0];return o((()=>{d&&s({type:Kt,payload:{name:"SignalImpression",parentGuid:null==d?void 0:d.instanceGuid}})}),[d,s]),d?e(wo,{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:Object.assign({display:"flex",flexDirection:"column"},l),children:a.Children.toArray(e(ka,{context:d,children:e(Na,{value:i(d),children:e(zi,{value:(s=d,r({data:s},"catalogItem")),children:n(t.schema.template,void 0,t.testId?`${t.testId}-child`:"")})})}))});var s}}):null}const Vy={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(Fy,{schema:t.node,testId:n})},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"DropDown":return e(By,{schema:n.node});case"CatalogCombinedCollection":return e(Uy,{schema:n.node});default:return}}}};function zy(){const t=Sa(),n=gi();return e(bi,{value:n,overrides:Vy,children:e(vi,{children:e=>e(t)})})}const Hy={staticData:function(e=null,t){return e},selectedItem:(e=null,t)=>t.type===ky?t.payload:e};function Wy(e={}){return Object.assign({staticData:null,selectedItem:null},e)}const qy="INVALID_RESPONSE_OBJECT";function Jy(e,t){return st((n=>e.onEvent({name:nl.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_PARTNER_DATA",message:`Malformed data received from partner\n ${e}`})}})))}function*Ky(e){for(;;){const t=yield He(e);t&&(yield We({type:jy,payload:t}))}}function*Yy(e,t){const n=yield Ve(Jy,e,t),i=yield Ze(Ky,n);return function*(){n.close(),yield et(i)}}const Zy="Unknown failure reason";function*Qy(e,t,n){const{catalogItem:i,quantity:a}=n.payload,o=vs(i,a);o?(yield We({type:Kt,payload:{name:"SignalCartItemInstantPurchaseInitiated",parentGuid:i.instanceGuid,objectData:{catalogItemId:i.catalogItemId,quantity:a}}}),yield Ze(em,e,t),yield We({type:Qt,payload:{name:"CART_ITEM_INSTANT_PURCHASE",body:{upsellItems:[o],totalUpsellPrice:o.totalPrice||0,currency:o.currency}}})):yield Ve(t,{level:_t,code:qy,message:`Unable to translate catalog item with ID ${i.catalogItemId} to cart item for instant purchase transaction.`})}function*Xy(e,t){const n=yield Je((e=>e.staticData));if(!n)return void(yield Ve(e,{level:_t,code:"MISSING_STATIC_DATA_IN_INSTANT_PURCHASE_MODULE",message:"App state is not configured with static data."}));if(!n.offer.catalogItems)return void(yield Ve(e,{level:_t,code:"MISSING_CATALOG_ITEMS",message:"No catalog items found within offer data."}));const i={accountId:n.offer.accountId,catalogItems:n.offer.catalogItems};t.payload.success?yield*tm(t.payload,i,nm,e):yield*tm(t.payload,i,((e,n)=>function(e,t,n,i){return{name:"SignalCartItemInstantPurchaseFailure",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,failureReason:i.reason||Zy,providerId:n.accountId.toString()}}}(e,n,i,t.payload)),e)}function*em(e,t){const{unsubscriber:n,timeout:i}=yield tt({unsubscriber:Ve(Yy,e,t),timeout:nt(6e4)});i&&n()}function*tm(e,t,n,i){const a=[];for(const i of e.upsellItems){const e=im(i,t.catalogItems);void 0===e?a.push(i):yield We({type:Kt,payload:n(e,i.quantity)})}a.length>0&&(yield*function*(e,t){const n=JSON.stringify(e,null,"\t").replaceAll('"',"");yield Ve(t,{level:_t,code:qy,message:`Unable to map cart items to catalog items in the instant purchase partner response: ${n}.`})}(a,i))}function nm(e,t){return{name:"SignalCartItemInstantPurchase",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,initiatedBy:Tt.DCUI}}}function im(e,t){return t.find((t=>t.catalogItemId===e.catalogItemId))}function*am(e,t){yield Ke([Qe(Py,Qy.bind(null,e,t)),Qe(jy,Xy.bind(null,t)),Ye("*",hs.bind(null,[zt],e))])}Object.assign(Object.assign({},an),{INITIATE_INSTANT_PURCHASE:Py,INSTANT_PURCHASE_PARTNER_RESPONSE:jy});const om=(new va).withAppFactory((function(n){var i;if(n.rootElement){const o=f(n.rootElement),r=Wy({staticData:{offer:n.offerData,position:n.offerPositionIndex}}),s=function(e,t,n=Wy()){const i=ot(),a=it({reducer:Hy,devTools:{name:"Instant Purchase"},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(Da,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(Sr,{}),e(v,{store:s,children:e(Ir,{settings:n,dispatch:s.dispatch,children:e(zy,{})})})]})}))}}));var rm=Object.freeze({__proto__:null,moduleConnectorBuilder:om});const sm=s(null),lm=({children:t})=>{var n;const[i,a]=c([]),[r,s]=c(0),[l,d]=c(0),u=Hi();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(sm.Provider,{value:{images:i,activeIndex:r,duration:l,setImages:a,setActiveIndex:s,setDuration:d},children:e(zi,{value:u({data:{"image.title":null===(n=i[r])||void 0===n?void 0:n.title}},"creativeCopy"),children:t})})};function cm({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 dm(e){const t=l(xa),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 um({schema:n,testId:i}){const r=JSON.parse(n.data),{styles:s,duration:c,imageKeys:d}=r,u=l(sm),p=Ma(),f=dm(d);return o((()=>{null==u||u.setImages(f),null==u||u.setDuration(c)}),[]),t("div",{"data-testid":i,style:Object.assign(Object.assign({position:"relative",flexShrink:1,flexGrow:0,width:"100%"},s.elements.own),p),children:[a.Children.toArray(f.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(f.map(((t,n)=>e(cm,{duration:c,active:n===(null==u?void 0:u.activeIndex),containerStyles:s.elements.indicatorContainer,indicatorStyles:s.elements.indicator}))))})]})}const pm={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"]},fm=new Map([["&","_;^;_"]]),ym=new RegExp(`<a *(?=${pm.allowedAttributes.a.join("|")}|>)`,"g"),mm=new RegExp("<span*>","g"),hm=new RegExp(`<a *(?:(?:${pm.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),vm=new RegExp("(<br *?>)|(<br *?/>)","g"),gm="<br/>";function bm(t){const n=Hi(),i=wa(),a=Ma(),o=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(hm,((e,t)=>{const n=t.replaceAll("&",fm.get("&"));return e.replace(t,n)})).replaceAll(vm,gm)}(e);return t===vt(t,pm)}(e))throw new Rt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:r,styles:s,isDisabled:l}=It(i),c=Object.assign(Object.assign({},s),a),u=z(c)?void 0:c;return o?e(wo,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class = "${null==n?void 0:n.link}"`:"",l?'tabindex="-1"':"",l?"style=\"pointer-events: 'none'; user-select: none;\"":"",l?'aria-disabled="true"':""].filter((e=>e.length>0));return a=o,new RegExp("</(p|ul|ol)>").test(a)?e("div",{tabIndex:r,style:u,"aria-hidden":l,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:o.replace(ym,`<a ${i.join(" ")}`).replace(mm,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}}):e("p",{tabIndex:r,style:u,"aria-hidden":l,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:o.replace(ym,`<a ${i.join(" ")}`).replace(mm,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}});var a}}):null}function Im({schema:t}){const n=gi(),i=si($a(),Zi()),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 kc={name:"loading-extension",componentFactory:e=>a.createElement(Dc,{data:e}),interceptors:{}},Pc=1e3;function $c(e){const t=e.data,{minutes:n,seconds:i,timeRemaining:s,restartTimer:l}=function(e){const[t,n]=c(e),i=(new Date).getTime()/Pc,a=r(null),s=()=>{const t=(new Date).getTime()/Pc;n(Math.max(Math.floor(e-(t-i)),0))};return o((()=>(a.current=setInterval(s,Pc),()=>{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,Pc)}}}((null==t?void 0:t.duration)||300),d=m((e=>{const t=g(["progression","currentGroupIndex"],e);return"number"==typeof t?t:0})),u=f();o((()=>{l()}),[d]),o((()=>{0===s&&(u({type:Kt,payload:{name:"SignalUserInteraction",action:"TimerExpired",context:"TimerProgression"}}),u({type:"PROGRESSION/PROCESS",payload:{offerProcessStatus:"CONTINUE"}}))}),[n,i]);const p=xa(),{tabIndex:y,styles:h,isDisabled:v}=It(p);return a.createElement("p",{tabIndex:y,style:Object.assign(Object.assign({},null==t?void 0:t.styles),h),"aria-hidden":v,"data-e2e":"Timer"},`${n}:${i}`)}const jc={name:"timer-progression-extension",componentFactory:e=>a.createElement($c,{data:e}),interceptors:{}},Gc="MODULE/ADD_LOADED",Fc="MODULE/LOAD",Mc="PROGRESSION/INITIALISE",Bc="PROGRESSION/NEXT",Uc="PROGRESSION/PREV",Vc="PROGRESSION/UPDATE_GROUP_SIZE",zc="PROGRESSION/PROCESS",Hc="SLOTS/SET",Wc="INSTANT_PURCHASE/DISMISS",qc="OFFER_LIFECYCLE",Jc="DOMAIN_STATES/SET",Yc="OFFER_ENGAGEMENT",Kc="GLOBAL_OFFER_DATA_STATE/SET_CART",Zc=Object.assign(Object.assign({},Kr),{NEXT_IN_PROGRESSION:Bc,PREV_IN_PROGRESSION:Uc,INITIALISE_PROGRESSION:Mc,UPDATE_GROUP_SIZE:Vc,SET_SLOTS:Hc,ADD_LOADED_MODULE:Gc,SET_DOMAIN_STATE:Jc,SET_GLOBAL_OFFER_DATA_CART:Kc}),Qc=Object.assign(Object.assign({},Zr),{LOAD_MODULES:Fc,DISMISS_INSTANT_PURCHASE:Wc,PROCESS_PROGRESSION:zc,OFFER_LIFECYCLE:qc,OFFER_ENGAGEMENT:Yc,SET_PARTNER_VALIDATION_STATUS:nn});function Xc(e,t){return t<=0||e<=0||t>e?0:Math.ceil(e/t)}function ed(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<Xc(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 td=Symbol("root");function nd(){return{[td]:{}}}const id=Object.assign({progression:function(e=null,t){switch(t.type){case Mc:if(function(e){const{totalCount:t,currentGroupIndex:n,groupSize:i}=e;return t>=0&&i>=0&&n>=0&&i<=t&&n<Xc(t,i)}(t.payload)){const{totalCount:e,_:n,groupSize:i}=t.payload;return Object.assign(Object.assign({},t.payload),{indexGroups:ed(e,i)})}return null;case Vc:{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:ed(i,n),currentGroupIndex:0}):null}case Bc:{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,Xc(t,n)-1)}):null}case Uc:{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===Hc?t.payload:e},module:function(e={loadedModules:[]},t){return t.type===Gc?Object.assign(Object.assign({},e),{loadedModules:[...e.loadedModules,t.payload]}):e},domainStates:function(e=nd(),t){if(t.type===Jc){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:td;return n===td?e:Object.assign(Object.assign({},b([n,t.payload.key],Number(t.payload.value),e)),{[td]:{}})}return e}return e},globalOfferDataState:function(e={},t){if(t.type===Kc){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}},Xs);function ad(e={}){return Object.assign(Object.assign(Object.assign({},function(e={}){return Object.assign({layout:Us(),breakpoint:{breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},active:Vs(),fonts:[],signal:{queue:[],processed:[]},serializableCache:Qs(),settings:{closeOnComplete:!0},customStates:{root:{}}},e)}(e)),{progression:null,slots:[],module:{loadedModules:[]},domainStates:nd(),globalOfferDataState:{}}),e)}function od(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 rd(e){return e.progression?{activeGroupIndex:e.progression.currentGroupIndex,totalOffers:e.progression.totalCount,totalGroups:Xc(e.progression.totalCount,e.progression.groupSize),isLast:od(e)}:null}function sd(e,t){return e.domainStates[`module${t}`]||{offerComplete:0}}function ld(e){return Object.values(e.globalOfferDataState).reduce(((e,t)=>t.cart?e+t.cart.reduce(((e,t)=>e+t.quantity),0):e),0)}function cd(i){var a;const{config:o,position:r,visible:s,container:c,testId:d}=i,u=Fa(),p=xa(),y=m(zs),f=l(Ma),h=`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(h,{style:{display:"flex",flexDirection:"column"===c?"column":"row",width:"100%"},slotInstanceGuid:o.instanceGuid,layoutSchema:JSON.stringify(o.layoutVariant.layoutVariantSchema),schemaVersion:f,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}`,"aria-hidden":!s,"module-component":!0,"plugin-id":u,"active-breakpoint":Ut(y)})]})}function dd({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=xa(),{tabIndex:d,isDisabled:u,styles:p}=It(c);return o.length&&o[l]?e(Co,{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(Tr,{effect:t.transition,visible:i===l,parentElement:s.current,children:e(cd,{config:n,position:i,visible:i===l,container:"column"})}))))})}):null}const ud=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=Xc(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=xa(),{tabIndex:s,styles:l,isDisabled:c}=It(r),d=Array(a).fill(o.indicator);return a>0&&(p=a+n-1,(u=t)>=n&&u<=p)?e(Hi,{children:a=>e(Co,{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 pd="partnerValidationUI",yd="stackedViewableItems";function fd(t){var n;const i=f(),r=m((e=>e.slots)),s=null!==(n=t.schema.viewableItems)&&void 0!==n?n:[],l=fo(s.reduce(((e,t,n)=>Object.assign(Object.assign({},e),{[n]:t.when})),{})),c=G((e=>{var t;return e&&(null===(t=s[e[0]])||void 0===t?void 0:t.value)||r.length}),Re((([e,t])=>t)),le)(l);o((()=>{i({type:Br,payload:{key:yd,value:String(c)}})}),[c]);const d=r.slice(0,c),u=xa(),{tabIndex:p,isDisabled:y,styles:h}=It(u);return(null==d?void 0:d.length)>0?e(Co,{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":y,tabIndex:p,style:Object.assign({display:"flex",flexDirection:"column"},h),children:a.Children.toArray(d.map(((t,n)=>e(cd,{config:t,position:n,visible:!0,container:"column"}))))})}):null}function md(t){const n=t.schema.styles,i=f(),o=xa(),r="Backward"===t.schema.direction?"Previous":"Next",{tabIndex:s,styles:l,isDisabled:c}=It(o),d=()=>{i({type:"Backward"===t.schema.direction?Zc.PREV_IN_PROGRESSION:Zc.NEXT_IN_PROGRESSION})};return e(Co,{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(bi,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}function hd({schema:t,testId:n}){var i,r,s,l,c,d,u,p,y;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(Js),E=t.viewableItems.length-1,[S,w]=ht({slidesToScroll:null!==(r=t.viewableItems[Math.min(I,E)])&&void 0!==r?r:"auto",containScroll:"trimSnaps"}),C=f(),O=xa(),{tabIndex:x,isDisabled:A,styles:T}=It(O),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?C({type:Zc.NEXT_IN_PROGRESSION}):i<a&&C({type:Zc.PREV_IN_PROGRESSION}))}return null!=g&&(null==w||w.on("select",e),null==w||w.scrollTo(g)),()=>{null==w||w.off("select",e)}}),[w,g,C]);const L={overflow:"hidden"},_={backfaceVisibility:"hidden",display:"flex",touchAction:"pan-y",gap:N,alignItems:"stretch"},R=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!==(y=t.viewableItems[Math.min(E,I)])&&void 0!==y?y: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(Co,{styles:t.styles,children:({classnames:t})=>e("div",{ref:S,style:Object.assign(Object.assign({},L),T),"aria-disabled":A,tabIndex:x,className:null==t?void 0:t.own,"data-e2e":"CarouselDistribution","data-testid":n&&`${n}`,children:e("div",{style:_,"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(cd,{config:t,position:i,container:"row",visible:R(i)})}))))})})}):null}function vd({schema:t,testId:n}){const i=Fa(),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)||[]).map((t=>t.map((t=>e.slots[t])).filter((e=>null!=e))))})),c=r(null),u=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),p=xa(),{tabIndex:y,isDisabled:f,styles:h}=It(p);return l.length?e(Co,{styles:t.styles,children:({classnames:i})=>e("div",{ref:c,"data-testid":n,"data-e2e":"GroupedDistribution","aria-disabled":f,tabIndex:y,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},h),children:a.Children.toArray(l.map(((r,l)=>e(Tr,{effect:t.transition,visible:l===u,parentElement:c.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(cd,{config:t,position:a,visible:l===u,container:"column",testId:n?`${n}-child${a}`:void 0})})))}))))})}):null}const gd={action:{CaptureOnly:"CaptureOnly",Url:"Url",Fulfillment:"Fulfillment",External:"External"},urlBehavior:{newTab:"newTab",roktWebViewSDK:"roktWebViewSDK",self:"self"},signalType:{SignalResponse:"SignalResponse",SignalGatedResponse:"SignalGatedResponse",SignalSecondaryResponse:"SignalSecondaryResponse"}};function bd(e,t,n=!1){return Error(`Could not translate ${e} with guid: ${t}${n?" for child layout":""}`)}function Id(e,t=!1){var n;try{if(e.responseOptionsMap||t)return Object.assign(Object.assign({},e),{responseOptionsMap:W(Ed,null!==(n=e.responseOptionsMap)&&void 0!==n?n:{})});{const t=`Creative: ${e.instanceGuid}, did not receive a valid response options map.`;throw new Rt("NO_CREATIVE_RESPONSE_OPTIONS_MAP",t)}}catch(n){throw n.message?n:bd("Creative",e.instanceGuid,t)}}function Ed(e){try{let t;e.urlBehavior&&(t=gd.urlBehavior[e.urlBehavior]);return Object.assign(Object.assign({},e),{urlBehavior:t,action:gd.action[e.action],signalType:gd.signalType[e.signalType]})}catch(t){throw t.message?t:bd("CreativeResponse",e.instanceGuid)}}function Sd(e,t,n){try{return JSON.parse(e)}catch(e){throw Error(`Parse JSON failed, invalid JSON file for ${t} with guid ${n}.`)}}function wd(){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 Cd={OneByOneDistribution:function(t){if("OneByOneDistribution"===t.type)return e(dd,{schema:t.node})},StackedDistribution:function(t){if("StackedDistribution"===t.type)return e(fd,{schema:t.node})},ProgressIndicator:function(t){if("ProgressIndicator"===t.type)return e(ud,{schema:t.node})},ProgressControl:function(t){if("ProgressControl"===t.type)return e(md,{schema:t.node})},Overlay:function(t){if("Overlay"===t.type)return e(rs,{schema:t.node})},CloseButton:function(t){if("CloseButton"===t.type)return e(es,{schema:t.node})},EscapeHatch:(Od=[function(t,n){if(Et("CloseButton",t)){const n=JSON.parse(t.node.data);return e(es,{schema:n.node,action:n.action})}},ur],e=>Od.reduce(((t,n)=>void 0===t?n(e):t),void 0)),CarouselDistribution:function(t){if("CarouselDistribution"===t.type)return e(hd,{schema:t.node})},GroupedDistribution:function(t){if("GroupedDistribution"===t.type)return e(vd,{schema:t.node})},BottomSheet:function(t){if("BottomSheet"===t.type)return e(ds,{schema:t.node})}};var Od;function xd(e,t){e({type:Kt,payload:{name:"SignalActivation",parentGuid:t}})}function Ad({pageInstanceGuid:t}){var n,i,a,r,s,l;const c=m((e=>e.layout),$),d=f(),u=m((e=>({breakpoint:e.breakpoint,progression:rd(e),customStates:e.customStates.root,domainStates:e.domainStates[td]})),$),p=m((e=>e.slots.length)),y=m((e=>{var t;const n=Number(null!==(t=e.serializableCache.get(yd))&&void 0!==t?t:"");return p-n})),h=m(ld);cn(wi(),d),o((()=>(c&&document.body.addEventListener("click",xd.bind(null,d,c.instanceGuid),{once:!0}),()=>{c&&document.body.removeEventListener("click",xd.bind(null,d,c.instanceGuid))})),[null==c?void 0:c.instanceGuid]),wd(),o((()=>{if(c){const e={type:Kt,payload:{name:"SignalImpression",parentGuid:c.instanceGuid}},t={type:Jr,payload:{code:"LAYOUT_IMPRESSED"}};d(e),d(t)}}),[c]);const v=e=>{d({type:Qc.REPORT_ERROR,payload:e})},g=m((e=>e.breakpoint.initialised));if(c&&g){const o=Ui({})({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:y}}),f=Ir(v);return e(ka,{info:{layoutType:"OuterLayout",pageInstanceGuid:t},children:e(Wi,{value:o,children:e(Ei,{value:f,overrides:Cd,children:e(hi.Provider,{value:u,children:e(fi.Provider,{value:d,children:e(Ki.Provider,{value:"OUTER",children:e(Ma.Provider,{value:c.layoutSchemaVersion,children:e(bi,{children:e=>e(c.layoutSchema)})})})})})})})})}return null}var Td=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"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"CatalogResponseButton":case"CatalogQuantityOption":case"CatalogRadioGroup":case"CatalogQuantityCounter":case"PartnerEventButtonTrigger":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}}}),Nd=Object.assign({},Td);function*Ld(e,t){const n=Nd.getDistribution(t),i=null==n?void 0:n.type,a=yield Ye(Js),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 yt({type:Zc.INITIALISE_PROGRESSION,payload:{currentGroupIndex:0,totalCount:e,groupSize:o}}))}function*_d(e,t){const{instanceGuid:n,layoutSchemaVersion:i,outerLayoutSchema:a,slots:o}=t.payload;n?yield yt({type:Kt,payload:{name:"SignalLoadComplete",parentGuid:n}}):yield yt({type:qr,payload:{level:ms,code:Ls,message:"Layout instance guid does not exist"}}),yield yt({type:Fc,payload:{modules:o.map((e=>e.layoutVariant.moduleName))}}),yield yt({type:kr,payload:a.breakpoints}),yield yt({type:Zc.LAYOUT_UPDATE,payload:{instanceGuid:n,layoutSchemaVersion:i,layoutSchema:a.layout,settings:a.settings}}),yield yt({type:Zc.SET_SLOTS,payload:o}),re(a.settings)||(yield yt({type:Zc.SET_SETTINGS,payload:a.settings})),yield*Ld(o.length,a.layout);const r=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,rl.PartnerValidationEvent.OPT_IN_TO_PARTNER_VALIDATION),yield dt(Rd,e,rl.PartnerValidationEvent.SHOW_PARTNER_VALIDATION_STATUS,(()=>({type:"ACTIVE/ADD",payload:{id:pd}})))}catch(e){return yield yt({type:qr,payload:{level:fs,code:Rs,message:"Failed to establish partner validation."}}),"FAILURE"}return"OK"}(e.partner,a.settings,o);"OK"===r&&(yield pt(xl,e.display,a.display))}function*Rd(e,t,n){const i=st((i=>{const a=e.onEvent(t).subscribe((e=>{i(n(e))}));return()=>{a.unsubscribe()}}));for(;;){const e=yield ft(i);yield yt(e)}}function Dd(e){return Iu(e)}function kd(e,t){return Error(`Migration process from v0_0 to v0_1 failed: could not transform ${e} node. For more details: ${t}`)}const Pd=te(ee([function(e){return"Row"===e.type&&Fd(e.node.children)},function(e){return"Column"===e.type&&Fd(e.node.children)},Vd,zd])),$d=te(ee([function(e){return"Row"===e.type&&Md(e.node.children)},function(e){return"Column"===e.type&&Md(e.node.children)},zd,Vd,function(e){return"DataImage"===e.type},function(e){return"When"===e.type&&Md(e.node.children)}])),jd=te(ee([function(e){return"Row"===e.type&&Bd(e.node.children)},function(e){return"Column"===e.type&&Bd(e.node.children)},zd,Vd])),Gd=te(ee([function(e){return"Row"===e.type&&Ud(e.node.children)},function(e){return"Column"===e.type&&Ud(e.node.children)},Vd,function(e){return"RichText"===e.type},zd,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&Ud(e.node.children)},function(e){return"StaticLink"===e.type&&Ud(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CloseButton"===e.type&&Ud(e.node.children)}]));function Fd(e){return Pd(e)}function Md(e){return $d(e)}function Bd(e){return jd(e)}function Ud(e){return Gd(e)}function Vd(e){return"StaticImage"===e.type}function zd(e){return"BasicText"===e.type}const Hd=ye(["styles","elements","link"]),Wd=ye(["styles","elements","activeIndicator"]),qd=ye(["styles","elements","indicator"]),Jd=ye(["styles","elements","seenIndicator"]),Yd=ye(["focussed"]),Kd=ye(["hovered"]),Zd=ye(["default"]),Qd=ye(["pressed"]),Xd=e=>{var t;return{text:null!==(t=null==e?void 0:e.text)&&void 0!==t?t:{}}},eu=I(S(["styles","elements","link"]),J(fe(Hd,ie((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default})))),fe(Hd,ie(I(De("focussed"),fe(Yd,Xd)))),fe(Hd,ie(I(De("hovered"),fe(Kd,Xd)))),fe(Hd,ie(I(De("default"),fe(Zd,Xd)))),fe(Hd,ie(I(De("pressed"),fe(Qd,Xd)))))),tu=J(I(S(["styles","elements","activeIndicator"]),fe(Wd,ie((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","indicator"]),fe(qd,ie((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","seenIndicator"]),fe(Jd,ie((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))));function nu(e,t){return e?{elements:{own:e.elements.own.map(t)}}:void 0}const iu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),au=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),ou=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),ru=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),su=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),lu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),cu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),du=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 kd("When",`Invalid condition: ${e}`)}},uu=e=>{switch(e){case"breakpoint":return"Breakpoint";case"progression":return"Progression";case"position":return"Position";default:throw kd("When",`Invalid target: ${e}`)}},pu=e=>{const{target:t,condition:n,value:i}=e;return{type:uu(t),predicate:{condition:du(n),value:i}}};function yu(e){return{predicates:e.predicates.map(pu),children:e.children.map((e=>Iu(e)))}}function fu(e){const t={type:"FadeInOut",settings:{duration:e.transition.settings.duration}};return{styles:e.style,transition:t}}function mu(e){const t=e.children.map((e=>Iu(e)));if(Fd(t))return Object.assign(Object.assign({},e),{children:t,styles:nu(e.styles,su)});throw kd("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function hu(e){const t=e.children.map((e=>Iu(e)));if(Md(t))return Object.assign(Object.assign({},e),{children:t,styles:nu(e.styles,lu)});throw kd("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function vu(e){const t=e.children.map((e=>Iu(e)));if(Bd(t))return Object.assign(Object.assign({},e),{children:t,styles:nu(e.styles,cu)});throw kd("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}const gu=e=>({own:e.overlayContainer,wrapper:e.overlayWrapper});function bu(e){var t,n;const i=(null===(t=e.styles)||void 0===t?void 0:t.elements)?{elements:gu(null===(n=e.styles)||void 0===n?void 0:n.elements)}:void 0,a=e.children.map((e=>Iu(e)));if(Ud(a))return Object.assign(Object.assign({},e),{styles:i,children:a});throw kd("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function Iu(e){switch(e.type){case"When":return{type:"When",node:yu(e.node)};case"OneByOneDistribution":return{type:e.type,node:fu(e.node)};case"Overlay":return{type:e.type,node:bu(e.node)};case"Column":return{type:e.type,node:(r=e.node,{styles:nu(r.styles,iu),children:r.children.map((e=>Iu(e)))})};case"Row":return{type:e.type,node:(o=e.node,{styles:nu(o.styles,au),children:o.children.map((e=>Iu(e)))})};case"RichText":return{type:e.type,node:(a=e.node,eu(a))};case"CloseButton":return{type:e.type,node:mu(e.node)};case"CreativeResponse":return{type:e.type,node:hu(e.node)};case"StaticLink":return{type:e.type,node:vu(e.node)};case"StaticImage":return{type:e.type,node:(i=e.node,Object.assign(Object.assign({},i),{styles:nu(i.styles,ou)}))};case"DataImage":return{type:e.type,node:(n=e.node,Object.assign(Object.assign({},n),{styles:nu(n.styles,ru)}))};case"ProgressIndicator":return{type:e.type,node:(t=e.node,tu(t))};default:return e}var t,n,i,a,o,r}function Eu(e){return Ap(e)}function Su(e,t){return Error(`Migration process from v0_23 to v1_0 failed: could not transform ${e} node. For more details: ${t}`)}const wu=e=>"scroll"===e||"auto"===e?"visible":e,Cu=ye(["elements","own"]),Ou=ye(["transitions","transition","value","own"]),xu=ye(["elements","wrapper"]),Au=ye(["transitions","transition","value","wrapper"]),Tu=ye(["elements","indicator"]),Nu=ye(["transitions","transition","value","indicator"]),Lu=ye(["elements","activeIndicator"]),_u=ye(["transitions","transition","value","activeIndicator"]),Ru=ye(["elements","seenIndicator"]),Du=ye(["transitions","transition","value","seenIndicator"]),ku=ye(["default","container","overflow"]),Pu=ye(["pressed","container","overflow"]),$u=ye(["hovered","container","overflow"]),ju=ye(["focussed","container","overflow"]),Gu=ye(["disabled","container","overflow"]),Fu=ye(["container","overflow"]),Mu=J(I(S(["default","container","overflow"]),fe(ku,wu)),I(S(["pressed","container","overflow"]),fe(Pu,wu)),I(S(["hovered","container","overflow"]),fe($u,wu)),I(S(["focussed","container","overflow"]),fe(ju,wu)),I(S(["disabled","container","overflow"]),fe(Gu,wu))),Bu=I(S(["container","overflow"]),fe(Fu,wu)),Uu=J(I(S(["elements","own"]),fe(Cu,ie(Mu))),I(S(["transitions","transition","value","own"]),fe(Ou,Bu))),Vu=I(De("transitions"),(e=>{var t;return G(ke(["transitions"]),Pe("conditionalTransitions",null===(t=e.transitions)||void 0===t?void 0:t.transition))(e)})),zu=J(Uu,Vu),Hu=J(I(S(["elements","wrapper"]),fe(xu,ie(Mu))),I(S(["transitions","transition","value","wrapper"]),fe(Au,Bu))),Wu=J(I(S(["elements","indicator"]),fe(Tu,ie(Mu))),I(S(["transitions","transition","value","indicator"]),fe(Nu,Bu))),qu=J(I(S(["elements","activeIndicator"]),fe(Lu,ie(Mu))),I(S(["transitions","transition","value","activeIndicator"]),fe(_u,Bu))),Ju=J(I(S(["elements","seenIndicator"]),fe(Ru,ie(Mu))),I(S(["transitions","transition","value","seenIndicator"]),fe(Du,Bu)));function Yu(e){return"StaticImage"===e.type}function Ku(e){return"StaticIcon"===e.type}function Zu(e){return"BasicText"===e.type}function Qu(e){return"DataImage"===e.type}function Xu(e){return"DataIcon"===e.type}function ep(e){return"RichText"===e.type}function tp(e){return"SlideStateTrigger"===e.type}function np(e){return"ToggleButtonStateTrigger"===e.type}const ip=te(ee([function(e){return"Row"===e.type&&ap(e.node.children)},function(e){return"Column"===e.type&&ap(e.node.children)},Yu,Ku,ep,Zu,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&ap(e.node.children)},function(e){return"StaticLink"===e.type&&ap(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&&ap(e.node.children)},function(e){return"ProgressControl"===e.type&&fp(e.node.children)},function(e){return"ZStack"===e.type&&ap(e.node.children)},function(e){return"FlowRow"===e.type&&ap(e.node.children)},tp,np]));function ap(e){return ip(e)}const op=J(Uu,Hu,Vu);function rp(e){const t=e.children.map((e=>Ap(e)));if(ap(t))return Object.assign(Object.assign({},ke(["settings"],e)),{children:t,allowBackdropToClose:e.settings.allowBackdropToClose,styles:e.styles?op(e.styles):void 0});throw Su("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function sp(e){const t=e.children.map((e=>Ap(e)));if(fp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?zu(e.styles):void 0});throw Su("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function lp(e){const t=e.children.map((e=>Ap(e)));if(hp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?zu(e.styles):void 0});throw Su("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function cp(e){const t=e.children.map((e=>Ap(e)));if(fp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?zu(e.styles):void 0});throw Su("ProgressControl",`Invalid schema: ${JSON.stringify(e)}`)}const dp=J(Uu,Wu,qu,Ju,Vu);const up=te(ee([Zu,Yu,Ku,Qu,Xu,function(e){return"Row"===e.type&&pp(e.node.children)},function(e){return"FlowRow"===e.type&&pp(e.node.children)},function(e){return"Column"===e.type&&pp(e.node.children)},function(e){return"ZStack"===e.type&&pp(e.node.children)},function(e){return"When"===e.type&&pp(e.node.children)}]));function pp(e){return up(e)}const yp=te(ee([Zu,Yu,Ku,function(e){return"Row"===e.type&&fp(e.node.children)},function(e){return"FlowRow"===e.type&&fp(e.node.children)},function(e){return"Column"===e.type&&fp(e.node.children)},function(e){return"ZStack"===e.type&&fp(e.node.children)},function(e){return"When"===e.type&&fp(e.node.children)}]));function fp(e){return yp(e)}const mp=te(ee([Zu,Yu,Ku,Qu,Xu,function(e){return"Row"===e.type&&hp(e.node.children)},function(e){return"FlowRow"===e.type&&hp(e.node.children)},function(e){return"Column"===e.type&&hp(e.node.children)},function(e){return"ZStack"===e.type&&hp(e.node.children)},function(e){return"When"===e.type&&hp(e.node.children)}]));function hp(e){return mp(e)}function vp(e){const t=e.children.map((e=>Ap(e)));if(pp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?zu(e.styles):void 0});throw Su("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}function gp(e){const t=e.children.map((e=>Ap(e)));if(hp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?zu(e.styles):void 0});throw Su("CatalogResponseButton",`Invalid schema: ${JSON.stringify(e)}`)}function bp(e){return"Row"===e.type&&Sp(e.node.children)}function Ip(e){return"Column"===e.type&&Sp(e.node.children)}const Ep=te(ee([Zu,Yu,Ku,Qu,Xu,ep,function(e){return"StaticLink"===e.type},tp,np,function(e){return"CatalogResponseButton"===e.type},bp,function(e){return"FlowRow"===e.type&&Sp(e.node.children)},Ip,function(e){return"ZStack"===e.type&&Sp(e.node.children)},function(e){return"When"===e.type&&Sp(e.node.children)}]));function Sp(e){return Ep(e)}const wp=ee([bp,Ip]);function Cp(e){const t=Ap(e.template);if(function(e){return wp(e)}(t))return Object.assign(Object.assign({},e),{template:t,styles:e.styles?zu(e.styles):void 0});throw Su("CatalogStackedCollection",`Invalid schema: ${JSON.stringify(e)}`)}function Op(e){const t=e.children.map((e=>Ap(e)));if(pp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?zu(e.styles):void 0});throw Su("ToggleButtonStateTrigger",`Invalid schema: ${JSON.stringify(e)}`)}function xp(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=>Ap(e))),transition:t})}function Ap(e){switch(e.type){case"Row":return{type:e.type,node:(v=e.node,Object.assign(Object.assign({},v),{children:v.children.map((e=>Ap(e))),styles:v.styles?zu(v.styles):void 0}))};case"When":return{type:e.type,node:xp(e.node)};case"FlowRow":return{type:e.type,node:(h=e.node,Object.assign(Object.assign({},h),{styles:h.styles?zu(h.styles):void 0,children:h.children.map((e=>Ap(e)))}))};case"Column":return{type:e.type,node:(m=e.node,Object.assign(Object.assign({},m),{children:m.children.map((e=>Ap(e))),styles:m.styles?zu(m.styles):void 0}))};case"ZStack":return{type:e.type,node:(f=e.node,Object.assign(Object.assign({},f),{styles:f.styles?zu(f.styles):void 0,children:f.children.map((e=>Ap(e)))}))};case"Overlay":return{type:e.type,node:rp(e.node)};case"ProgressControl":return{type:e.type,node:cp(e.node)};case"CarouselDistribution":return{type:"CarouselDistribution",node:(y=e.node,Object.assign(Object.assign({},ke(["settings"],y)),{viewableItems:y.settings.viewableItems,peekThroughSize:y.settings.peekThroughSize,styles:y.styles?zu(y.styles):void 0}))};case"CloseButton":return{type:"CloseButton",node:sp(e.node)};case"CreativeResponse":return{type:"CreativeResponse",node:lp(e.node)};case"GroupedDistribution":return{type:"GroupedDistribution",node:(p=e.node,Object.assign(Object.assign({},ke(["settings"],p)),{viewableItems:p.settings.viewableItems,transition:p.settings.transition,styles:p.styles?zu(p.styles):void 0}))};case"OneByOneDistribution":return{type:"OneByOneDistribution",node:(u=e.node,Object.assign(Object.assign({},u),{styles:u.styles?zu(u.styles):void 0}))};case"ProgressIndicator":return{type:"ProgressIndicator",node:(c=e.node,Object.assign(Object.assign({},ke(["settings"],c)),{startPosition:null===(d=c.settings)||void 0===d?void 0:d.startPosition,styles:c.styles?dp(c.styles):void 0}))};case"SlideStateTrigger":return{type:"SlideStateTrigger",node:(l=e.node,Object.assign(Object.assign({},l),{styles:l.styles?zu(l.styles):void 0}))};case"StackedDistribution":return{type:"StackedDistribution",node:(s=e.node,Object.assign(Object.assign({viewableItems:[]},s),{styles:s.styles?zu(s.styles):void 0}))};case"StaticLink":return{type:"StaticLink",node:vp(e.node)};case"ToggleButtonStateTrigger":return{type:"ToggleButtonStateTrigger",node:Op(e.node)};case"CatalogResponseButton":return{type:"CatalogResponseButton",node:gp(e.node)};case"CatalogStackedCollection":return{type:"CatalogStackedCollection",node:Cp(e.node)};case"RichText":return{type:"RichText",node:(r=e.node,Object.assign(Object.assign({},r),{styles:r.styles?Vu(r.styles):void 0}))};case"DataImage":return{type:"DataImage",node:(o=e.node,Object.assign(Object.assign({},o),{styles:o.styles?Vu(o.styles):void 0}))};case"StaticImage":return{type:"StaticImage",node:(a=e.node,Object.assign(Object.assign({},a),{styles:a.styles?Vu(a.styles):void 0}))};case"DataIcon":return{type:"DataIcon",node:(i=e.node,Object.assign(Object.assign({},i),{styles:i.styles?Vu(i.styles):void 0}))};case"StaticIcon":return{type:"StaticIcon",node:(n=e.node,Object.assign(Object.assign({},n),{styles:n.styles?Vu(n.styles):void 0}))};case"BasicText":return{type:"BasicText",node:(t=e.node,Object.assign(Object.assign({},t),{styles:t.styles?Vu(t.styles):void 0}))};default:return e}var t,n,i,a,o,r,s,l,c,d,u,p,y,f,m,h,v}function Tp(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 Np(e,t){return e.major===t.major&&e.minor===t.minor}const Lp=(e,t,n)=>E([ve(e),$e(t)])(n);function _p(e,t){return Np(t,{major:0,minor:0})?_p(Dd(e),{major:0,minor:1}):function(e,t){return 0===t.major&&Lp(1,23,t.minor)}(0,t)?_p(Eu(e),{major:1,minor:0}):e}function Rp(e,t){return Np(t,{major:0,minor:0})?Rp(function(e){return Object.assign(Object.assign({},e),{layout:Dd(e.layout)})}(e),{major:0,minor:1}):function(e,t){return 0===t.major&&Lp(1,23,t.minor)}(0,t)?Rp(function(e){return Object.assign(Object.assign({},e),{layout:Eu(e.layout)})}(e),{major:1,minor:0}):e}function Dp(e,t,n,i){const a=Tp(n);if(i){const s=Tp(i);if(r=a,(o=s).major<r.major||o.major===r.major&&o.minor<r.minor||Np(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,Tp("0.0"));var o,r}function kp(e){var t;try{return Object.assign(Object.assign({},je(e)),{offer:Object.assign(Object.assign({},je(e.offer)),{creative:Id(e.offer.creative)}),layoutVariant:Object.assign(Object.assign({},je(e.layoutVariant)),{layoutVariantSchema:"string"==typeof e.layoutVariant.layoutVariantSchema?Sd(e.layoutVariant.layoutVariantSchema,"LayoutSlotLayoutVariant",e.instanceGuid):e.layoutVariant.layoutVariantSchema,childLayouts:ie(Pp,null!==(t=e.layoutVariant.childLayouts)&&void 0!==t?t:[])})})}catch(t){throw t.message?t:bd("Slot",e.instanceGuid)}}function Pp(e){return Object.assign(Object.assign({},je(e)),{childLayoutSchema:"string"==typeof e.childLayoutSchema?Sd(e.childLayoutSchema,"ChildLayoutRootSchema",e.childLayoutId):e.childLayoutSchema})}function $p(e){if(e){const t=function(e){try{return Object.assign(Object.assign({},je(e)),{outerLayoutSchema:"string"==typeof e.outerLayoutSchema?Sd(e.outerLayoutSchema,"LayoutRootLayoutSchema",e.instanceGuid):e.outerLayoutSchema,slots:ie(kp,e.slots)})}catch(t){throw t.message?t:bd("LayoutConfig",e.instanceGuid)}}(e);return function(e,t){const{layoutSchemaVersion:n}=e,i=ye(["outerLayoutSchema"]),a=ye(["slots"]),o=ye(["layoutVariant","layoutVariantSchema"]);return J(fe(a,ie(fe(o,(e=>Dp(e,_p,t,n))))),fe(i,(e=>Dp(e,Rp,t,n))))(e)}(t,gs.DCUI_SCHEMA_VERSION)}}const jp=O([[H({signalType:$("SignalSecondaryResponse")}),function*(e,t){return yield qe({type:qr,payload:{level:hs,code:Ts,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}],[H({isPositive:$(!0)}),function*(e,t,n){var i;if("url"in e&&e.url){const a=e.instanceGuid;yield qe({type:Kt,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:a,responseActionPayload:{name:"Url",transformedTrafficURL:e.url,creativeInstanceGuid:e.creativeInstanceGuid}}});const o=t.getOverrideLinkNavigation()?"overrideLinkNavigation":null!==(i=e.urlBehavior)&&void 0!==i?i:"newTab",r=yield*function*(e,t,n){try{const i=yield ze(pl,t),a=hl(i)?i.ref:void 0;return yield ze(e.addAdvertiserWindowRef,a,n),hl(i)||"newTab"!==t.urlBehavior?"SUCCESS":(yield qe({type:qr,payload:{level:hs,code:Ns,message:`Did not receive a window reference opening link ${t.url}`}}),"UNSPECIFIED")}catch(e){return yield qe({type:qr,payload:{level:hs,code:Ns,message:`Errored attempting to open link ${t.url}: ${e.message}`,stack:e.stack}}),"ERROR"}}(t,{url:e.url,urlBehavior:o,external:{partner:n}},a);return"self"===o?"END":r}return yield qe({type:qr,payload:{level:hs,code:Ts,message:"URL response doesn't have a valid url",additionalInformation:{instanceGuid:e.instanceGuid}}}),"ERROR"}],[T,function*(){return"EXPLICIT_DISMISSAL"}]]);function*Gp(e){return yield qe({type:qr,payload:{level:hs,code:Ts,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}function*Fp(e,t){let n="IMPLICIT_DISMISSAL";const i=t.payload.offerPositionIndex,a=Jt(t.payload)||Yt(t.payload)||qt(t.payload)?t.payload:t.payload.responseOption;switch(a.action){case"Url":yield qe({type:Xt,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:Jr,payload:{code:"CREATIVE_RESPONSE",message:"creative positive response",data:{type:a.action,isPositive:a.isPositive,responseInstanceGuid:a.instanceGuid}}}),yield qe({type:Xt,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Gp(a):yield*jp(a,e.context,e.partner);break;case"CaptureOnly":yield qe({type:Xt,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:Xt,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Gp(a):yield*function*(e){return yield qe({type:Kt,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:qr,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"External":yield qe({type:qr,payload:{level:hs,code:"INCORRECTLY_HANDLE_EXTERNAL_ACTION",message:`External action was dispatched as an engagement erroneously. Instance GUID: ${a.instanceGuid}`}}),n="ERROR"}Os(t.payload)||(yield qe(function(e,t){switch(e){case"SUCCESS":return{type:qc,payload:{event:"Completed",completionReason:"Success",offerPositionIndex:t}};case"UNSPECIFIED":return{type:qc,payload:{event:"Completed",completionReason:"Unspecified",offerPositionIndex:t}};case"ERROR":return{type:qc,payload:{event:"Completed",completionReason:"Error",offerPositionIndex:t}};case"EXPLICIT_DISMISSAL":return{type:qc,payload:{event:"Dismissed",dismissalReason:"Explicit",offerPositionIndex:t}};case"IMPLICIT_DISMISSAL":return{type:qc,payload:{event:"Dismissed",dismissalReason:"Implicit",offerPositionIndex:t}};default:return{type:zc,payload:{offerProcessStatus:"END"}}}}(n,i)))}function Mp(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:qr,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:qr,payload:{level:Lt,code:"FAILED_TO_LOAD_MODULE",message:t,additionalInformation:{stack:i,reason:t?void 0:e,moduleName:n}}}),a(lt)})),()=>{})))}const Bp={"standard-marketing":()=>Promise.resolve().then((function(){return sf})),"add-to-cart":()=>Promise.resolve().then((function(){return lm})),"instant-purchase":()=>Promise.resolve().then((function(){return Pm})),"layouts-xp-sandbox":()=>Promise.resolve().then((function(){return yh}))};function*Up(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(Vp,e,t,a))}function*Vp(e,t,n){if(n in Bp){yield qe({type:Gc,payload:n});const i=yield ze(Mp,e,t,n,Bp[n]);yield ze(xs,i)}else yield qe({type:qr,payload:{level:fs,code:"INVALID_MODULE_NAME",message:`Could not load unknown module ${n}`}})}function*zp(e){const t=yield Ye((e=>Nd.getDistributionViewableItems(e.layout?Nd.getDistribution(e.layout.layoutSchema):void 0))),n=yield Ye((n=>{var i;const a=qs(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:Vc,payload:{groupSize:n}};yield qe(e)}}const Hp=O([[(e,t,n,i)=>"END"===e.offerProcessStatus,j({type:Gr})],[(e,t,n,i)=>t.isLastOffer&&n,j({type:Gr})],[(e,t,n,i)=>1===i&&!t.isLastOffer,j({type:Bc})],[T,j(void 0)]]);function*Wp(e){const t=yield Ye((e=>({exists:null!==e.progression,isLastOffer:od(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=Hp(e,t,"boolean"==typeof i&&i,n);a&&(a.type===Gr&&(yield qe({type:Xt,payload:{name:"PLACEMENT_COMPLETED"}})),yield qe(a))}(e.payload,t,n))}function qp(e){return e.type===qc&&"Interactive"===e.payload.event}function Jp(e){return e.type===qc&&"Interactive"!==e.payload.event}function*Yp(e){switch(e.payload.event){case"Dismissed":yield qe({type:zc,payload:{offerProcessStatus:"CONTINUE"}});break;case"Completed":yield qe({type:Jc,payload:{key:"offerComplete",value:O([[$("Error"),j(-1)],[$("Success"),j(1)],[T,j(2)]])(e.payload.completionReason),offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:zc,payload:{offerProcessStatus:"CONTINUE"}});break;case"Interactive":yield qe({type:zt,payload:{name:"Interactive",offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:Xt,payload:{name:"PLACEMENT_INTERACTIVE"}})}}function*Kp(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,rl.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:qr,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*Zp(e){const t=yield Ye((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:Zc.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:Gr}),t?(yield qe({type:Kt,payload:{name:"SignalInstantPurchaseDismissal",parentGuid:t}}),yield qe({type:Kt,payload:{name:"SignalDismissal",parentGuid:t}})):yield qe({type:qr,payload:{level:ms,code:Ls,message:"ParentGuid does not exist"}})}function*Qp(e,t){yield Ke([Ze(qr,As.bind(null,e.errorService.raise)),Xe(jr,_d.bind(null,{display:e.displayService,partner:e.partnerInteractionService})),Ze(Fc,Up.bind(null,t,e.contextService)),Xe(Yc,Fp.bind(null,{partner:e.partnerInteractionService,context:e.contextService})),Ze(zc,Wp),Ze(Jp,Yp),Cs(qp,Yp),Xe(kr,el.bind(null,e.displayService)),Xe(Gr,Il.bind(null,e.contextService)),Xe(Wc,Zp),Xe(Wr,Hl),Ze(Kt,Tl),Ze(en,Nl),ws(zt,Vl.bind(null,e.metricsService)),ws(Hr,Ll.bind(null,e.rdnService)),Ze(Jr,Al.bind(null,e.errorService.raise)),Xe(Rr,zp),Ze(Qt,Ul),Ze(tn,zl.bind(null,{createChildPlugin:e.childPlugin.create,partner:e.partnerInteractionService,context:e.contextService})),Xe(nn,Kp.bind(null,{partner:e.partnerInteractionService,context:e.contextService}))])}var Xp,ey,ty,ny,iy,ay=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},oy=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 ry={[rn.SET_CUSTOM_STATE]:Zc.SET_CUSTOM_STATE,[rn.SET_DOMAIN_STATE]:Zc.SET_DOMAIN_STATE,[rn.SET_GLOBAL_OFFER_DATA_CART]:Zc.SET_GLOBAL_OFFER_DATA_CART,[rn.OFFER_LIFECYCLE]:Qc.OFFER_LIFECYCLE,[rn.OFFER_ENGAGEMENT]:Qc.OFFER_ENGAGEMENT,[rn.SET_PARTNER_VALIDATION_STATUS]:Qc.SET_PARTNER_VALIDATION_STATUS};class sy{constructor(e){Xp.add(this),ey.set(this,void 0),ay(this,ey,e,"f")}getState(e){const t=oy(this,ey,"f").getState();return{breakpoint:t.breakpoint,progression:rd(t),customStates:Ys(t,e.offerPositionIndex),domainStates:sd(t,e.offerPositionIndex)}}dispatch(e,t){oy(this,ey,"f").dispatch(oy(this,Xp,"m",iy).call(this,e,t))}subscribe(e,t){return t(this.getState(e)),oy(this,ey,"f").subscribe((()=>{t(this.getState(e))}))}}function ly(e,t){const n=ot(),i={},a=it({reducer:id,devTools:{name:"Orchestrator"},preloadedState:Object.assign(Object.assign({},ad()),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 sy(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(Qp,e,o),n.run(Cl,e,$p);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({},id),c)))),t&&Object.assign(i,t),o&&n.run(o)}})}ey=new WeakMap,Xp=new WeakSet,ty=function(e,t,n){return{type:e,payload:Object.assign(Object.assign({},t),{offerPositionIndex:n.offerPositionIndex,creativeInstanceGuid:n.creativeInstanceGuid})}},ny=function(e,t){return t.type===en?t.payload.signal.parentGuid||(t.payload.signal.parentGuid=e.creativeInstanceGuid):(t.payload.creativeInstanceGuid=e.creativeInstanceGuid,t.payload.parentGuid||(t.payload.parentGuid=e.creativeInstanceGuid)),t},iy=function(e,t){return function(e){return e.type in ry}(t)?oy(this,Xp,"m",ty).call(this,ry[t.type],t.payload,e):t.type===Kt||t.type===en?oy(this,Xp,"m",ny).call(this,e,t):t};var cy=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 dy={ctx:new Map([[jc.name,jc],[kc.name,kc],[hc.name,hc],[Oc.name,Oc]]),cache:[]};function uy(n,i){return cy(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:At.pluginId,pageInstanceGuid:"fulfilled"===t.status?t.value:At.pageInstanceGuid}))).catch((()=>At))}(i),s=y(n),l=ly(i);s.render(t(a.StrictMode,{children:[e(Or,{}),e(v,{store:l,children:t(Ga.Provider,{value:o,children:[e(Bs,{}),e(Si.Provider,{value:n,children:e(lr,{extensions:dy,extendStore:l.extend.bind(l),children:e(Ad,{pageInstanceGuid:r})})})]})})]}))}))}class py{constructor(){this._subscribers=[]}add(e){this._subscribers.push(e)}unsubscribe(){this._subscribers.forEach((e=>e.unsubscribe()))}}const yy=()=>{},fy=(e=yy,t=yy,n=yy)=>"function"!=typeof e?e:{next:e,error:t,complete:n};class my{constructor(e){this._setupFn=e}subscribe(e,t,n){const i=fy(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 py;return s.add({unsubscribe:()=>{a&&a(),o=!1}}),s}}class hy extends my{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 my((e=>{const t=this.subscribe(e);return()=>t.unsubscribe()}))}}class vy extends hy{constructor(e){super(),this._lastValue=e}subscribe(e,t,n){const i=fy(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 gy extends hy{constructor(e=-1){super(),this._buffer=[],this._error=null,this._bufferLength=e}subscribe(e,t,n){const i=fy(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 by={CompletedBeforeEmit:"CompletedBeforeEmit"},Iy=(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(by.CompletedBeforeEmit))}))})).finally((()=>n.unsubscribe()))},Ey=(e,t)=>new Promise(((n,i)=>{let a;"object"==typeof t&&(a=t.defaultValue),e.subscribe((e=>a=e),(e=>i(e)),(()=>n(a)))})),Sy=(e,t)=>new my((n=>{const i=e=>n.next(e);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)}));function wy(e){return new my((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>t.error(e)))}))}const Cy=(...e)=>new my((t=>{const n=new py;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()})),Oy=(...e)=>new my((t=>{for(const n of e)t.next(n)})),xy=(...e)=>new my((t=>{if(!e.length)return t.complete(),yy;const n=new py,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 Ay=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 Ty(e,t){return new Ny(e,t)}class Ny{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)=>Ay(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 Ly{constructor(e){this.value=e,this.complete=!1,this.skip=!1}}var _y=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 Ry=e=>(...t)=>new my((n=>{const i=e.subscribe((e=>_y(void 0,void 0,void 0,(function*(){try{let i=new Ly(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()})),Dy=e=>t=>(!1===e(t.value)&&(t.skip=!0),t),ky=e=>t=>(e?!0===e(t.value)?t.complete=!0:t.skip=!0:t.complete=!0,t),Py=e=>t=>{const n=e(t.value);return new Ly(n)},$y=e=>t=>(e(t.value),t),jy={FULLSCREEN:"DisplayPreset.FULLSCREEN",EMBEDDED:"DisplayPreset.EMBEDDED",ATTACHED:"DisplayPreset.ATTACHED"},Gy={ERROR:"ERROR",INFO:"INFO",WARNING:"WARNING"},Fy={getBreakpointCSSClass:Ut},My="CHILD_LAYOUTS/ADD_LAUNCHED",By="DYNAMIC_DATA/ADD";function Uy(e={launched:{}},t){if(t.type===My){const n=t.payload;return n.childLayoutId?b(["launched",n.childLayoutId],n.shouldRelaunch,e):e}return e}function Vy(e=null,t){return e}function zy(e,t){var n;return null===(n=e.childLayouts.launched[t])||void 0===n||n}function Hy(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer}function Wy(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.schemaVersion}function qy(e){var t,n;return null!==(n=null===(t=e.dynamicData)||void 0===t?void 0:t.text)&&void 0!==n?n:{}}const Jy="FAILED_TO_LAUNCH_CHILD_LAYOUT";function*Yy(e,t,n){var i;if(yield null===(i=Ye(zy,n.payload.childLayoutId))||void 0===i||i){const i=yield Ye(Wy),o=yield Ye(Hy),r=yield Ye(qy);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:Jy,message:"Could not launch child layout, failed creating plugin."})}}catch(e){yield ze(t,{level:_t,code:Jy,message:"Could not launch child layout, failed to make the child layout config serializable."})}yield qe({type:My,payload:{childLayoutId:n.payload.childLayoutId,shouldRelaunch:!1}})}var a}function Ky(){const t=Ca(),n=m(qy),i=qi()({state:n},"textContent");return e(Wi,{value:i,children:e(bi,{children:e=>e(t)})})}const Zy={staticData:Vy,dynamicData:function(e=null,t){if(t.type===By){const n=t.payload;return e?n?Ge(e,n):e:n}return e},childLayouts:Uy};function Qy(e={}){return Object.assign({staticData:null,dynamicData:null,childLayouts:{launched:{}}},e)}function Xy(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 ef(e){return"object"==typeof e&&null!==e&&Object.entries(e).every((([e,t])=>"string"==typeof e&&"string"==typeof t))}function*tf(e,t){for(;;){switch(yield We(e)){case"CLOSED":t({type:Zt,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":t({type:Zt,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:Zt,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*nf(e,t){const n=function(e){return st((t=>{const n=e.onEvent({name:ll,source:"partner",callback:e=>{ef(e)&&t({eventName:ll,data:e})}},{name:cl,source:"partner",callback:e=>{ef(e)&&t({eventName:cl,data:e})}});return()=>{n()}}))}(e);try{for(;;){const i=yield We(n);switch(i.eventName){case ll:yield qe({type:Xt,payload:{name:ll,body:i.data}}),yield qe({type:By,payload:{text:i.data}}),e.globalDispatch({type:Zt,payload:{event:"Completed",completionReason:"Success"}});break;case cl:e.globalDispatch({type:Zt,payload:{event:"Completed",completionReason:"Error"}});break;default:t({level:Lt,code:"UNKNOWN_REALTIME_OFFER_FULFILLMENT_EVENT",message:`Unknown event: ${i.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 Je())&&n.close()}}function*af(e,t,n){const i=Jt(n.payload)||Yt(n.payload)||qt(n.payload)?n.payload:n.payload.responseOption;switch(i.action){case"Url":yield ze(e.globalDispatch.bind(e),n),Os(n.payload)&&(yield qe({type:Xt,payload:{name:"REALTIME_OFFER_FULFILLMENT_REFERRAL",body:{rclid:i.rclid,accountID:i.accountID,referralCreativeID:i.referralCreativeID}}}),yield ze(nf,e,t));break;case"CaptureOnly":yield ze(e.globalDispatch.bind(e),n);break;case"Fulfillment":yield qe({type:Xt,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield qe({type:Xt,payload:{name:"POSITIVE_ENGAGEMENT"}})),yield*function*(e,t,n){if(Wt(n)){const{responseOption:i,fulfillment:a}=n;yield qe({type:Kt,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const o=yield ze(e.createChildPlugin.bind(e),a);if("object"==typeof o&&"onClose"in o){const t=yield ze(Xy,o);if("object"==typeof t&&"take"in t)return void(yield ze(tf,t,e.globalDispatch.bind(e)))}yield ze(t,{level:Lt,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:Lt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}(e,t,n.payload)}}function*of(e,t){yield Ke([Xe(Ht,af.bind(null,e,t)),Ze(on,Yy.bind(null,e,t)),Ze("*",bs.bind(null,[Ht,on],e))])}Object.assign({},rn);const rf=(new ba).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=Qy({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n=Qy()){const i=ot(),a=it({reducer:Zy,devTools:{name:"Standard Marketing"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(of,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(ka,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(Or,{}),e(v,{store:s,children:e(wr,{settings:n,dispatch:s.dispatch,children:e(Ky,{})})})]})}))}}));var sf=Object.freeze({__proto__:null,moduleConnectorBuilder:rf});const lf="CART/UPDATE",cf="CATALOG_ITEM/RESPONSE",df="USER_CREATIVE_RESPONSE_HISTORY/ADD",uf=O([[(e,t)=>0!==t,$],[(e,t)=>!Number.isNaN(e)&&0===t,$],[(e,t)=>Number.isNaN(e)&&0===t,Fe]]);function pf({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 yf="catalogRadioGroup__label",ff=["Enter","Space"],mf={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 hf(e,t,n){return e.map(O([[G($("Required"),B("","type")),({value:e})=>Number.isNaN(n)&&t>0?e.message:""],[T,j("")]])).filter(Me)}function vf({schema:n,testId:i}){const r=f(),s=ja(),[l,c]=m((e=>{var t,i;const a=s.cartItemId in e.cart?null!==(i=null===(t=e.cart[s.cartItemId])||void 0===t?void 0:t.quantity)&&void 0!==i?i:0:NaN;return[a,hf(n.validations,n.options.length,a)]})),d=xa(),{tabIndex:u,styles:p,isDisabled:y}=It(d);o((()=>{y||r(gf(c))}),[]);const h=n.options.filter((({quantity:e})=>{var t,n;return e>=(null!==(t=s.minItemCount)&&void 0!==t?t:-1/0)&&e<=(null!==(n=s.maxItemCount)&&void 0!==n?n:1/0)}));function v(e){r({type:cf,payload:{catalogItem:s,quantity:e}});const t=hf(n.validations,n.options.length,e);r(gf(t))}return h.length>0?e(Co,{styles:n.styles?Bt(mf,n.styles):mf,children:({classnames:n,mapperRef:o})=>e("div",{className:null==n?void 0:n.own,style:Object.assign({display:"flex",flexDirection:"column"},p),children:e(Yi,{value:o(yf),children:a.Children.toArray(h.map(((a,o)=>{var r;const c=uf(l,a.quantity),d=e=>i?`${i}-option${o}${e}`:void 0;return t("label",{tabIndex:u,"aria-disabled":y,style:{display:"flex"},className:`${yf} ${null!==(r=null==n?void 0:n.optionContainer)&&void 0!==r?r:""}`,onKeyDown:e=>{c||!ff.includes(e.code)||y||v(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:s.instanceGuid,value:a.quantity,checked:c,onChange:()=>v(a.quantity),"aria-disabled":y,disabled:y}),e(pf,{isChecked:c,isDisabled:y,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(Nr,{schema:a,testId:d("Content")})]})})))})})}):null}function gf(e){return{type:nn,payload:{errors:e}}}function bf(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function If(t){const n=f(),i=Ii(),a=ja(),o=xa(),{tabIndex:r,styles:s,isDisabled:l}=It(o);return e(Co,{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:cf,payload:{catalogItem:a,quantity:1}})},className:null==o?void 0:o.own,children:bf(t.schema.children,i,t.testId)})})}const Ef={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"]},Sf=new Map([["&","_;^;_"]]),wf=new RegExp(`<a *(?=${Ef.allowedAttributes.a.join("|")}|>)`,"g"),Cf=new RegExp(`<a *(?:(?:${Ef.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),Of=new RegExp("(<br *?>)|(<br *?/>)","g"),xf=new RegExp(`<ul *(?=${Ef.allowedAttributes.ul.join("|")}|>)`,"g"),Af=new RegExp(`<ol *(?=${Ef.allowedAttributes.ol.join("|")}|>)`,"g"),Tf=new RegExp("<li *(?=>|\\s[^>]*>)","g"),Nf="<br/>";function Lf(t){const n=qi(),i=xa(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Cf,((e,t)=>{const n=t.replaceAll("&",Sf.get("&"));return e.replace(t,n)})).replaceAll(Of,Nf)}(e);return t===vt(t,Ef)}(e))throw new Rt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=It(i);return a?e(Co,{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(wf,`<a ${i.join(" ")}`).replace(xf,`<ul ${l}`).replace(Af,`<ol ${l}`).replace(Tf,`<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 _f={internally:"_top",externally:"_blank"};function Rf(t,n,i,a,o){return e(Yi,{value:i(n),children:Df(t,a,o)})}function Df(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function kf(t){var n,i;const a=_f[t.schema.open],o=Ii(),r=ja(),s=xa(),l=f(),c=null!==(n=r.url)&&void 0!==n?n:"",{tabIndex:d,styles:u,isDisabled:p}=It(s);return Boolean(c)&&(null===(i=t.schema.children)||void 0===i?void 0:i.length)>0?e(Co,{styles:t.schema.styles,children:({classnames:n,mapperRef:i})=>{var s;return e("a",{href:c,onClick:()=>{var e;l({type:Kt,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)?Rf(t.schema.children,null==n?void 0:n.own,i,o,t.testId):Df(t.schema.children,o,t.testId)})}}):null}function Pf(e,t){const n=e.cart[t];return n||null}function $f(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 jf(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 $f(e).reduce(((e,t)=>e+t.quantity),0)}(e),s=Pf(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}function Gf(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 Ff(e,t){var n,i;return null!==(i=null===(n=Gf(e))||void 0===n?void 0:n.find((e=>e.catalogItemId===t)))&&void 0!==i?i:null}function Mf(e){var t;const n=null===(t=Gf(e))||void 0===t?void 0:t.filter((e=>e.preSelectedQuantity&&e.preSelectedQuantity>0));return n&&n.length>0?n:null}function Bf(e){var t,n;return null!==(n=null===(t=Mf(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 Uf=G((e=>e.filter((e=>!re(e[1]))).map((([e,t])=>({cartItemId:t.cartItemId,quantity:t.quantity})))),le,M("cart"));function Vf(t,n,i,a,o){return e(Yi,{value:i(n),children:a(t,void 0,o)})}function zf(e,t,n){return t(e,void 0,n)}function Hf(i){var a;const{schema:o,testId:r}=i,{a11yInputLabel:s,styles:l,showInputField:c,buttons:d,forcedUpsellText:u}=o,{increment:p,decrement:y,a11yIncrementLabel:h,a11yDecrementLabel:v}=d||{},g=f(),b=ja(),I=Ii(),E=qi(),S=xa(),{tabIndex:w,styles:C,isDisabled:O}=It(S),x=m((e=>function(e,t){var n,i,a;const o=Ff(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))),A=m((e=>Pf(e,b.cartItemId))),T=m((e=>jf(e,b))),N=(null==A?void 0:A.quantity)||0,L=It(O||N<=(null!==(a=b.minItemCount)&&void 0!==a?a:0)?"DISABLED":S),_=It(O||T<=0?"DISABLED":S),R=It(O||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=>{O||g({type:cf,payload:{catalogItem:b,quantity:e}})};return e(Co,{styles:l,children:({classnames:i,mapperRef:a})=>e("div",{className:null==i?void 0:i.own,style:Object.assign({display:"flex",flexDirection:"row"},C),children:x&&u?e(ko,{schema:u,isInline:!1,testId:r?`${r}-forced-upsell-text`:void 0}):t(n,{children:[y?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(Wi,{value:E,children:(null==i?void 0:i.decrementButton)?Vf(y,i.decrementButton,a,I,r):zf(y,I,r)})}):null,c?e("input",{type:"text",className:null==i?void 0:i.input,style:Object.assign(Object.assign({},R),{cursor:R.isDisabled?"not-allowed":"auto",caretColor:R.isDisabled?"transparent":"auto",pointerEvents:"auto",outline:"none"}),value:N,onChange:D,"aria-label":s||void 0,tabIndex:w,disabled:O,"data-testid":r?`${r}-input`:void 0}):e("p",{className:null==i?void 0:i.input,style:C,"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({},_.styles),{cursor:_.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(N+1)},tabIndex:_.tabIndex,"aria-label":h||void 0,disabled:_.isDisabled,"data-testid":r?`${r}-increment-button`:void 0,children:e(Wi,{value:E,children:(null==i?void 0:i.incrementButton)?Vf(p,i.incrementButton,a,I,r):zf(p,I,r)})}):null]})})})}const Wf={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(If,{schema:t.node,testId:n})},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"InsuranceRichText":return e(Lf,{schema:n.node});case"CatalogUrlLink":return e(kf,{schema:n.node});default:return}}},CatalogRadioGroup:function(t){if("CatalogRadioGroup"===t.type)return e(vf,{schema:t.node})},CatalogQuantityCounter:function(t){if("CatalogQuantityCounter"===t.type)return e(Hf,{schema:t.node})}};function qf(){const t=Ca(),n=Ii();return e(Ei,{value:n,overrides:Wf,children:e(bi,{children:e=>e(t)})})}const Jf={cart:function(e={},t){if(t.type===lf){const{catalogItem:n,quantity:i}=t.payload,a=n.cartItemId,o=Is(n,i);return Object.assign(Object.assign({},e),{[a]:o})}return e},userCreativeResponseHistory:function(e=[],t){return t.type===df?e.concat(t.payload.responseId):e},staticData:Vy,childLayouts:Uy};const Yf="INVALID_PARTNER_MESSAGE",Kf="MISCONFIGURED_CATALOG_ITEM",Zf="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function*Qf(e){var t,n;const i=yield Ye(Mf),a=yield Ye(Bf),o=yield Ye((e=>{var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer.maxTotalItemsQtyInOffer}));if(im(a)&&im(o)&&a>o)yield ze(e,{level:_t,code:Kf,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:Kf,message:`Preselected quantity (${i}) is greater than maxItemCount (${o}) for catalog item (${a.instanceGuid})`}):yield*nm(a,i,!0)}}function*Xf(e,t,n){const{catalogItem:i,quantity:a}=n.payload;if(yield*nm(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){switch(e.action){case"Fulfillment":{const n=null==t?void 0:t.creative.fulfillment;return wt(n)?{type:Ht,payload:{fulfillment:n,responseOption:e}}:`Could not get fulfillment for response (instanceGuid: ${e.instanceGuid})`}case"Url":return(null==t?void 0:t.accountId)?{type:Ht,payload:Object.assign(Object.assign({},e),{accountID:null==t?void 0:t.accountId})}:`Could not get accountId for response (instanceGuid: ${e.instanceGuid})`;default:return{type:Ht,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*em(e,t){const n=function(e,t){return st((n=>{const i=e.onEvent({name:al.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:Yf,message:`Invalid UpdateCartItemPartnerMessageBody: ${JSON.stringify(e)}`}):n(e)}});return()=>{i()}}))}(e,t);try{for(;;){const e=yield We(n);yield ze(tm,e,t)}}catch(e){const n=e;t({level:_t,code:Zf,message:null==n?void 0:n.message})}finally{(yield Je())&&n.close()}}function*tm(e,t){const{cartItemId:n,quantity:i}=e,a=yield Ye(Pf,n);if(am(a)){const e=yield Ye(Ff,a.catalogItemId);null!==(o=e)&&"object"==typeof o&&"catalogItemId"in o&&"price"in o?yield*nm(e,i,!1):yield ze(t,{level:_t,code:Zf,message:`Catalog item not found for cart item id (${n})`})}else yield ze(t,{level:_t,code:Zf,message:`Cart item not found for cart item id (${n})`});var o}function*nm(e,t,n){var i;const a=yield Ye(Pf,e.cartItemId),o=yield Ye(jf,e),r=im(o)?o:0,s=am(a)?a.quantity:0;if(t!==s&&t>=(null!==(i=e.minItemCount)&&void 0!==i?i:0)&&t-s<=r){yield qe({type:lf,payload:{catalogItem:e,quantity:t}});const i=yield Ye(Pf,e.cartItemId),o=yield Ye(Uf);return yield qe({type:an,payload:{cart:o}}),yield qe({type:Kt,payload:{name:"SignalCartItemQuantitySelected",parentGuid:e.instanceGuid,objectData:{quantity:t,preselected:n}}}),yield qe({type:Xt,payload:{name:"V2_CART_ITEM_UPDATED",body:{oldCartItem:a,cartItem:i}}}),!0}return!1}function im(e){return"number"==typeof e}function am(e){return null!=e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&"unitPrice"in e}function*om(e,t){var n;yield qe({type:df,payload:{responseId:(n=t.payload,Wt(n)?n.responseOption.id:n.id)}}),yield ze(e.globalDispatch.bind(e),t)}function*rm(e,t){yield Ke([et(Qf.bind(null,t)),et(em.bind(null,e,t)),Xe(cf,Xf.bind(null,e,t)),Xe(Ht,om.bind(null,e)),Ze(on,Yy.bind(null,e,t)),Ze("*",bs.bind(null,[Ht,on],e))])}Object.assign(Object.assign({},rn),{CATALOG_ITEM_RESPONSE:cf});const sm=(new ba).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=function(e={}){return Object.assign({cart:{},userCreativeResponseHistory:[],staticData:null,childLayouts:{launched:{}}},e)}({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n){const i=ot(),a=it({reducer:Jf,devTools:{name:"Add To Cart"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(rm,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(ka,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(Or,{}),e(v,{store:s,children:e(wr,{settings:n,dispatch:s.dispatch,children:e(qf,{})})})]})}))}}));var lm=Object.freeze({__proto__:null,moduleConnectorBuilder:sm});const cm="CATALOG/SET_SELECTED_ITEM",dm="INSTANT_PURCHASE/INITIATE",um="INSTANT_PURCHASE/PARTNER_RESPONSE";function pm(t,n,i,a,o){return e(Yi,{value:i(n),children:ym(t,a,o)})}function ym(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function fm(t){const n=f(),i=Ii(),a=xa(),{tabIndex:o,styles:r,isDisabled:s}=It(a),l=ja(),c=Ui(l,"catalogItem");return e(Co,{styles:t.schema.styles,children:({classnames:a,mapperRef:d})=>e("button",{type:"button",tabIndex:o,"aria-disabled":s,disabled:s,style:Object.assign({cursor:"pointer"},r),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:dm,payload:{catalogItem:l,quantity:1}})},className:null==a?void 0:a.own,children:e(Wi,{value:c,children:(null==a?void 0:a.own)?pm(t.schema.children,a.own,d,i,t.testId):ym(t.schema.children,i,t.testId)})})})}const mm=["ArrowDown","ArrowUp","Enter","Escape"];function hm(n){const i=xi(),a=Ra(),s=Ii(),l=qi(),d=i.catalogItems||[],u=xa(),{styles:p,isDisabled:y}=It(u),h=f(),v=m((e=>e.selectedItem)),g=d.map(((e,t)=>({catalogItem:e,index:t}))),b=r(null),I=r([]),[E,S]=c(!1),[w,C]=c(v?{catalogItem:v,index:d.findIndex((e=>e.catalogItemId===v.catalogItemId))}:null),[O,x]=c(w?w.index:null);function A(){y||(E?N():T())}function T(){y||S(!0)}function N(){y||(S(!1),x(null))}function L(e){C(e),N(),h({type:cm,payload:e.catalogItem})}o((()=>{E&&D(w?w.index:0)}),[E,w]);const _={elements:{own:[{default:{background:{backgroundColor:{light:"#ffffff"}},border:{borderColor:{light:"#D0D5DD"},borderRadius:4,borderStyle:"solid",borderWidth:"1"},dimension:{width:{type:"percentage",value:100}},spacing:{padding:"10"}}}]}};function R(e){if(!y)if(E){if(mm.includes(e.key))switch(e.preventDefault(),e.key){case"ArrowDown":null!==O&&O!==g.length-1&&D(O+1);break;case"ArrowUp":null!==O&&0!==O&&D(O-1);break;case"Enter":if(null!==O){const e=g[O];e&&(L(e),k())}break;case"Escape":N(),k()}}else"Enter"===e.key&&T()}function D(e){const t=I.current[e];null!=t&&(x(e),t.focus())}function k(e){e&&e.preventDefault(),b.current&&b.current.focus()}function P(t){return e($a,{context:t.catalogItem,children:e(_a,{value:a(t.catalogItem),children:e(Wi,{value:(n=t.catalogItem,l({data:n},"catalogItem")),children:s(t.schema,void 0,t.testId)})})});var n}function $(){const t=n.testId?`${n.testId}-child-label`:"closed-drop-down-child-label";return v?P({catalogItem:v,schema:n.schema.closedTemplate,testId:t}):e(Ei,{value:s,children:e(bi,{children:e=>e(n.schema.closedDefaultTemplate,void 0,t)})})}return e(Co,{styles:n.schema.styles?Bt(_,n.schema.styles):_,children:({classnames:i})=>t("div",{ref:b,className:null==i?void 0:i.own,onKeyDown:R,onMouseDown:k,onClick:A,onBlur:e=>{var t;(null===(t=b.current)||void 0===t?void 0:t.contains(e.relatedTarget))||E&&N()},"data-e2e":"DropDown","aria-disabled":y,style:Object.assign({position:"relative"},p),tabIndex:0,children:[e("div",{className:null==i?void 0:i.dropDownSelectedElement,"aria-disabled":y,style:p,children:$()}),E&&e("ul",{className:null==i?void 0:i.dropDownListContainer,onClick:e=>e.stopPropagation(),style:Object.assign({listStyle:"none",margin:0,padding:0,zIndex:9999,position:"absolute",top:"100%",left:0,right:0,backgroundColor:"white",boxShadow:"0 2px 5px rgba(0,0,0,0.2)"},p),children:g.map(((t,a)=>e("li",{ref:e=>function(e,t){I.current[t]=e}(e,a),className:null==i?void 0:i.dropDownListElement,onClick:e=>{e.stopPropagation(),y||L(t)},tabIndex:-1,"data-e2e":"DropDownItem",style:Object.assign({cursor:"pointer"},p),children:P({catalogItem:t.catalogItem,schema:n.schema.openTemplate,testId:n.testId?`${n.testId}-child-${a}`:`opened-drop-down-child-${a}`})},t.catalogItem.catalogItemId)))})]})})}function vm(t){const n=Ii(),i=Ra(),r=qi(),s=mi(),l=xi().catalogItems||[],c=m((e=>e.selectedItem))||l[0];return o((()=>{c&&s({type:Kt,payload:{name:"SignalImpression",parentGuid:null==c?void 0:c.instanceGuid}})}),[c,s]),c?e(Co,{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($a,{context:c,children:e(_a,{value:i(c),children:e(Wi,{value:(s=c,r({data:s},"catalogItem")),children:n(t.schema.template,void 0,t.testId?`${t.testId}-child`:"")})})}))});var s}}):null}function gm(n){const{schema:{imageKeys:i,styles:o},testId:r}=n,[s,d]=c(0),u=xa(),p=function(e){const t=l(La);return e.reduce(((e,n)=>{const i=t(`${n}.src`,"copy"),a=t(`${n}.title`,"copy");return void 0===i?e:[...e,xt({light:i,title:a})]}),[])}(i),{styles:y,isDisabled:f,tabIndex:m}=It(u),h=p[s]||p[0];return p.length>0&&h?e(Co,{styles:o,children:({classnames:n})=>t("div",{className:null==n?void 0:n.own,children:[e("img",{"aria-hidden":f,src:h.light,alt:h.alt,title:h.title,className:null==n?void 0:n.mainImage,style:y,"data-testid":`${r}-main-image`,"data-e2e":"ImageGallery-mainImage"}),e("div",{className:null==n?void 0:n.thumbnailList,style:Object.assign(Object.assign({},y),{display:"flex"}),children:a.Children.toArray(p.map(((t,i)=>e("img",{src:t.light,alt:t.alt,title:t.title,className:null==n?void 0:n.thumbnailImage,style:Object.assign(Object.assign({},y),{cursor:f?"not-allowed":"pointer",pointerEvents:"auto"}),"data-testid":`${r}-thumbnail-${i}`,"data-e2e":"ImageGallery-thumbnail",tabIndex:m,onClick:()=>d(i)}))))})]})}):null}const bm={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(fm,{schema:t.node,testId:n})},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"DropDown":return e(hm,{schema:n.node});case"CatalogCombinedCollection":return e(vm,{schema:n.node});case"ImageGallery":return e(gm,{schema:n.node});default:return}}}};function Im(){const t=Ca(),n=Ii();return e(Ei,{value:n,overrides:bm,children:e(bi,{children:e=>e(t)})})}const Em={staticData:Vy,selectedItem:(e=null,t)=>t.type===cm?t.payload:e,childLayouts:Uy};function Sm(e={}){return Object.assign({staticData:null,selectedItem:null,childLayouts:{launched:{}}},e)}const wm="INVALID_RESPONSE_OBJECT";function Cm(e,t){return st((n=>e.onEvent({name:ol.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_PARTNER_DATA",message:`Malformed data received from partner\n ${e}`})}})))}function*Om(e,t){var n;try{for(;;){const t=yield We(e);t&&(yield qe({type:um,payload:t}))}}catch(e){yield ze(t,{level:_t,code:"INSTANT_PURCHASE_CHANNEL_ERROR",message:null!==(n=e.message)&&void 0!==n?n:"Unknown error in instant-purchase channel"})}finally{e.close()}}const xm="Unknown failure reason";function*Am(e,t,n){const{catalogItem:i,quantity:a}=n.payload,o=Is(i,a);o?(yield qe({type:Kt,payload:{name:"SignalCartItemInstantPurchaseInitiated",parentGuid:i.instanceGuid,objectData:{catalogItemId:i.catalogItemId,quantity:a}}}),yield Qe(Nm,e,t),yield qe({type:Xt,payload:{name:"CART_ITEM_INSTANT_PURCHASE",body:{upsellItems:[o],totalUpsellPrice:o.totalPrice||0,currency:o.currency}}})):yield ze(t,{level:_t,code:wm,message:`Unable to translate catalog item with ID ${i.catalogItemId} to cart item for instant purchase transaction.`})}function*Tm(e,t){const n=yield Ye((e=>e.staticData));if(!n)return yield ze(e,{level:_t,code:"MISSING_STATIC_DATA_IN_INSTANT_PURCHASE_MODULE",message:"App state is not configured with static data."}),void(yield*Rm("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*Rm("Error"));const i={accountId:n.offer.accountId,catalogItems:n.offer.catalogItems};let a,o;t.payload.success?(a=Lm,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||xm,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=_m(i,t.catalogItems);void 0===e?a.push(i):yield qe({type:Kt,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:wm,message:`Unable to map cart items to catalog items in the instant purchase partner response: ${n}.`})}(a,i))}(t.payload,i,a,e),yield*Rm(o)}function*Nm(e,t){const n=Cm(e,t),{timeout:i}=yield tt({channelListener:ze(Om,n,t),timeout:nt(6e4)});i&&(yield ze(t,{level:_t,code:"INSTANT_PURCHASE_RESPONSE_TIMEOUT",message:"Instant-purchase response timed out after 60000ms"}),n.close(),yield qe({type:Zt,payload:{event:"Dismissed",dismissalReason:"Implicit"}}))}function Lm(e,t){return{name:"SignalCartItemInstantPurchase",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,initiatedBy:Tt.DCUI}}}function _m(e,t){return t.find((t=>t.catalogItemId===e.catalogItemId))}function*Rm(e){yield qe({type:Zt,payload:{event:"Completed",completionReason:e}})}function*Dm(e,t){yield Ke([Xe(dm,Am.bind(null,e,t)),Xe(um,Tm.bind(null,t)),Ze(on,Yy.bind(null,e,t)),Ze("*",bs.bind(null,[Ht,on],e))])}Object.assign(Object.assign({},rn),{INITIATE_INSTANT_PURCHASE:dm,INSTANT_PURCHASE_PARTNER_RESPONSE:um});const km=(new ba).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=Sm({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n=Sm()){const i=ot(),a=it({reducer:Em,devTools:{name:"Instant Purchase"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Dm,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(ka,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(Or,{}),e(v,{store:s,children:e(wr,{settings:n,dispatch:s.dispatch,children:e(Im,{})})})]})}))}}));var Pm=Object.freeze({__proto__:null,moduleConnectorBuilder:km});const $m=s(null),jm=({children:t})=>{var n;const[i,a]=c([]),[r,s]=c(0),[l,d]=c(0),u=qi();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($m.Provider,{value:{images:i,activeIndex:r,duration:l,setImages:a,setActiveIndex:s,setDuration:d},children:e(Wi,{value:u({data:{"image.title":null===(n=i[r])||void 0===n?void 0:n.title}},"creativeCopy"),children:t})})};function Gm({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 Fm(e){const t=l(La),n=[];return e.forEach((e=>{const i=t(`${e}.src`,"copy"),a=t(`${e}.title`,"copy");if(void 0===i)return;const o=xt({light:i,title:a});n.push(o)})),n}function Mm({schema:n,testId:i}){const r=JSON.parse(n.data),{styles:s,duration:c,imageKeys:d}=r,u=l($m),p=Fm(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(Gm,{duration:c,active:n===(null==u?void 0:u.activeIndex),containerStyles:s.elements.indicatorContainer,indicatorStyles:s.elements.indicator}))))})]})}const Bm={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"]},Um=new Map([["&","_;^;_"]]),Vm=new RegExp(`<a *(?=${Bm.allowedAttributes.a.join("|")}|>)`,"g"),zm=new RegExp("<span*>","g"),Hm=new RegExp(`<a *(?:(?:${Bm.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),Wm=new RegExp("(<br *?>)|(<br *?/>)","g"),qm="<br/>";function Jm(t){const n=qi(),i=xa(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Hm,((e,t)=>{const n=t.replaceAll("&",Um.get("&"));return e.replace(t,n)})).replaceAll(Wm,qm)}(e);return t===vt(t,Bm)}(e))throw new Rt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=It(i);return a?e(Co,{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(Vm,`<a ${i.join(" ")}`).replace(zm,`<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(Vm,`<a ${i.join(" ")}`).replace(zm,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}});var l}}):null}function Ym({schema:t}){const n=Ii(),i=ci(Fa(),Xi()),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`
|
|
127
137
|
position: relative;
|
|
128
138
|
`,"data-testid":"ProductTierCarousel",children:e("div",Object.assign({},c&&{ref:r},{className:i`
|
|
129
139
|
width: 100%;
|
|
@@ -162,24 +172,24 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
162
172
|
background-color: ${(null===(d=null==s?void 0:s.primaryColor)||void 0===d?void 0:d.light)||"#F9FAFB"};
|
|
163
173
|
color: #f9fafb;
|
|
164
174
|
}
|
|
165
|
-
`,children:a.Children.toArray(t.map((e=>n(e))))})})))})}))})}const
|
|
166
|
-
${
|
|
167
|
-
`,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
|
|
168
|
-
${
|
|
169
|
-
`,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
|
|
175
|
+
`,children:a.Children.toArray(t.map((e=>n(e))))})})))})}))})}const Km=(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 Zm({disabled:t,onClick:n}){const i=ci(Fa(),Xi());return e("button",{onClick:n,disabled:t,className:i`
|
|
176
|
+
${Km(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 Qm({disabled:t,onClick:n}){const i=ci(Fa(),Xi());return e("button",{onClick:n,disabled:t,className:i`
|
|
178
|
+
${Km(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 Xm(e){const t=l(La);return e.map((e=>({src:t(`${e}.link.src`,"copy"),open:t(`${e}.link.open`,"copy")})))}function eh(e){return{type:"StaticImage",node:{url:e,styles:{elements:{own:[{default:{border:{borderRadius:5,borderWidth:"0"},dimension:{width:{type:"percentage",value:100}}}}]}}}}}function th(e,t){return{type:"CreativeResponse",node:{responseKey:"positive",styles:{elements:{own:[{default:{spacing:{padding:"0"},background:{backgroundColor:{light:"#F9FAFB"}},border:{borderWidth:"0"}}}]}},children:t?[eh(t)]:[]}}}function nh({schema:n}){var i,r;const s=Ii(),l=ci(Fa(),Xi()),d=function(e){try{return JSON.parse(e.data)}catch(e){return null}}(n),[u,p]=[Fm((null===(i=null==d?void 0:d.body)||void 0===i?void 0:i.imageKeys)||[]),Xm((null===(r=null==d?void 0:d.body)||void 0===r?void 0:r.imageKeys)||[])],y=xi(),f=y.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:w,nextBtnDisabled:C,onPrevButtonClick:O,onNextButtonClick:x}=function(e){const[t,n]=c(!0),[i,a]=c(!0);return o((()=>{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&&f?t("div",{"data-testid":"product-catalog-carousel",className:l`
|
|
170
180
|
position: relative;
|
|
171
181
|
margin: 8px 0;
|
|
172
|
-
${
|
|
173
|
-
`,
|
|
182
|
+
${h||""}
|
|
183
|
+
`,children:[b?e(Zm,{onClick:O,disabled:w}):null,e("div",Object.assign({},b&&{ref:E},{className:l`
|
|
174
184
|
width: 100%;
|
|
175
185
|
margin: auto;
|
|
176
186
|
overflow: hidden;
|
|
177
|
-
`,children:e("div",{className:
|
|
187
|
+
`,children:e("div",{className:l`
|
|
178
188
|
display: flex;
|
|
179
189
|
gap: 16px;
|
|
180
|
-
`,children:a.Children.toArray(
|
|
190
|
+
`,children:a.Children.toArray(I.map(((t,n)=>{var i,a;const o=Object.assign(Object.assign({},f),{url:null===(i=null==p?void 0:p[n])||void 0===i?void 0:i.src}),r=Object.assign(Object.assign({},y),{creative:Object.assign(Object.assign({},y.creative),{responseOptionsMap:Object.assign(Object.assign({},y.creative.responseOptionsMap),{positive:o})})});return e(Oi,{context:r,children:e("div",{"data-testid":"carousel-item",className:l`
|
|
181
191
|
min-width: 0;
|
|
182
192
|
overflow: hidden;
|
|
183
|
-
aspect-ratio: ${
|
|
184
|
-
${
|
|
185
|
-
`,children:s((null===(a=null==
|
|
193
|
+
aspect-ratio: ${g};
|
|
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)?th(p[n],t):eh(t))})})})))})})),b?e(Qm,{onClick:x,disabled:C}):null]}):null}function ih({schema:i}){const a=JSON.parse(i.data),{styles:o,content:r,smallFontSize:s,largeFontSize:l}=a,c=qi();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({},o),className:"animated-text",children:c(r)})]})}const ah={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(Mm,{schema:t.node});case"RichText":return e(Jm,{schema:n.node});case"ProductTierCarousel":return e(Ym,{schema:t.node});case"ProductCatalogCarousel":return e(nh,{schema:t.node});case"TextAnimate":return e(ih,{schema:t.node});default:return}}}};function oh(){const t=Ca(),n=Ii();return e(jm,{children:e(Ei,{value:n,overrides:ah,children:e(bi,{children:e=>e(t)})})})}const rh={staticData:Vy,childLayouts:Uy};function sh(e={}){return Object.assign({staticData:null,childLayouts:{launched:{}}},e)}function lh(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*ch(e,t){for(;;){switch(yield We(e)){case"CLOSED":t({type:Zt,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":t({type:Zt,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:Zt,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*dh(e,t,n){const i=Jt(n.payload)||Yt(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:Xt,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield qe({type:Xt,payload:{name:"POSITIVE_ENGAGEMENT"}})),yield*function*(e,t,n){if(Wt(n)){const{responseOption:i,fulfillment:a}=n;yield qe({type:Kt,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const o=yield ze(e.createChildPlugin.bind(e),a);if("object"==typeof o&&"onClose"in o){const t=yield ze(lh,o);if("object"==typeof t&&"take"in t)return void(yield ze(ch,t,e.globalDispatch.bind(e)))}yield ze(t,{level:Lt,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:Lt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}(e,t,n.payload)}}function*uh(e,t){yield Ke([Xe(Ht,dh.bind(null,e,t)),Ze(on,Yy.bind(null,e,t)),Ze("*",bs.bind(null,[Ht,on],e))])}Object.assign({},rn);const ph=(new ba).withAppFactory((function(n){if(n.rootElement){const i=y(n.rootElement),o=sh({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),r=function(e,t,n=sh()){const i=ot(),a=it({reducer:rh,devTools:{name:"layouts-xp-sandbox"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(uh,e,t),a}(n.gateway,n.logger,o);i.render(e(a.StrictMode,{children:t(ka,{info:{layoutType:"LayoutVariant",referralCreativeId:String(n.offerData.creative.referralCreativeId)||"N/A"},children:[e(Or,{}),e(v,{store:r,children:e(wr,{settings:n,dispatch:r.dispatch,children:e(oh,{})})})]})}))}}));var yh=Object.freeze({__proto__:null,moduleConnectorBuilder:ph});export{vy as BehaviorSubject,Ny as CatchSubscriber,jy as DisplayPreset,Gy as ErrorLevel,by as FirstValueFromError,my as Observable,gy as ReplaySubject,hy as Subject,py as Subscription,Ty as addCatchToSubscriber,xy as combineLatest,Fy as dcuiUtils,Dy as filter,ky as first,Iy as firstValueFrom,Sy as fromEvent,wy as fromPromise,uy as init,Ey as lastValueFrom,Py as map,Cy as merge,yy as noop,fy as normaliseToObserver,Oy as of,Ry as pipe,$y as tap};
|