Test Form SF

// Bundle time – 2026-02-26T12:46:40Z – SalesforceInteractions // SDK – npm/@salesforce/interactions/2.0/target/dist/scripts/interactions-bundle.min.js [2.0.9] /* regenerator-runtime — Copyright (c) 2014-present, Facebook, Inc. — license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE js-cookie v3.0.5 | MIT */ ‘use strict’;var SalesforceInteractions=function(e){function ma(b,a){(null==a||a>b.length)&&(a=b.length);for(var c=0,d=Array(a);c=b.length?{done:!0}:{done:!1,value:b[d++]}},e:function(a){throw a;},f:a}}throw new TypeError(«Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.»);}var f,h=!0,l=!1;return{s:function(){c=c.call(b)},n:function(){var a=c.next();return h=a.done,a},e:function(a){l=!0;f=a},f:function(){try{h||null==c.return||c.return()}finally{if(l)throw f; }}}}function X(b,a,c){return(a=cb(a))in b?Object.defineProperty(b,a,{value:c,enumerable:!0,configurable:!0,writable:!0}):b[a]=c,b}function pa(){return pa=»undefined»!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(b,a,c){var d;for(d=b;!{}.hasOwnProperty.call(d,a)&&null!==(d=K(d)););if(d)return d=Object.getOwnPropertyDescriptor(d,a),d.get?d.get.call(3>arguments.length?b:c):d.value},pa.apply(null,arguments)}function K(b){return K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__|| Object.getPrototypeOf(a)},K(b)}function mc(b,a){if(«function»!=typeof a&&null!==a)throw new TypeError(«Super expression must either be null or a function»);b.prototype=Object.create(a&&a.prototype,{constructor:{value:b,writable:!0,configurable:!0}});Object.defineProperty(b,»prototype»,{writable:!1});a&&qa(b,a)}function ab(){try{var b=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(ab=function(){return!!b})()}function db(b,a){var c=Object.keys(b);if(Object.getOwnPropertySymbols){var d= Object.getOwnPropertySymbols(b);a&&(d=d.filter(function(a){return Object.getOwnPropertyDescriptor(b,a).enumerable}));c.push.apply(c,d)}return c}function q(b){for(var a=1;a>2]|=e.charCodeAt(p)<<8*~p--;for(a=p=0;ap;c=[c[4]+(f[p]=16>p?~~l[a+p]:2*e|0>e)+1518500249+[d&g|~d&k,e=341275144+(d^g^k),882459459+(d&g|d&k|g&k),e+1535694389][p++/5>>2]+((e=c[0])<<5|e>>>27),e,d<<30|d>>>2,g,k]){e=f[p-3]^f[p-8]^f[p-14]^f[p-16];d=c[1];var g=c[2];var k=c[3]}for(p=5;p;)h[–p]+= c[p]}for(e=»»;40>p;)e+=(h[p>>3]>>4*(7-p++)&15).toString(16);return e}function Z(b){for(var a=1;ab.indexOf(a)})}function wc(b, a,c,d,f){f.guid=f.guid||k.guid++;var h=b.___ce=b.___ce||{};h[a]=h[a]||[];h[a].push([c,d,f]);b.addEventListener(a,f)}function Ba(b){b=b.split(«.»);return[b[0],b.slice(1).sort()]}function da(b,a,c,d,f){var h=b.___ce=b.___ce||{};if(a)h[a]&&(h[a]=h[a].filter(function(l){var h=Y(l,3);l=h[0];var e=h[1];h=h[2];if(f&&h.guid!==f.guid||!qb(l,c)||d&&d!==e)return!0;b.removeEventListener(a,h)}));else for(a in h)da(b,a,c,d,f)}function rb(b){return b.multiple&&b.options?B(xa.call(b.options,function(a){return a.selected&& !a.disabled&&!a.parentNode.disabled}),»value»):b.value||»»}function sb(b){if(!u(b))return[];if(xc.test(b))return[J(RegExp.$1)];var a=yc.test(b)&&RegExp.$1;a=tb[a]||tb[«*»];a.innerHTML=b;return k(a.childNodes).detach().get()}function zc(b,a){b=k(b);b.filter(«script»).add(b.find(«script»)).each(function(b,d){if(Ac.test(d.type)&&Ca.contains(d)){var c=J(«script»);c.text=d.textContent.replace(Bc,»»);t(Cc,function(a,b){d[b]&&(c[b]=d[b])});a.head.insertBefore(c,null);a.head.removeChild(c)}})}function E(b, a,c,d,f,h,l,e){t(b,function(b,h){t(k(h),function(b,h){t(k(a),function(a,b){var l=c?b:h;b=c?h:b;a=a?l.cloneNode(!0):l;f?b.insertBefore(a,d?b.firstElementChild:null):b.parentNode.insertBefore(a,d?b:b.nextElementSibling);zc(a,b.ownerDocument)},e)},l)},h);return a}function Dc(b){var a=b.pageTypeDefault;b=0/,pc=/^\w+$/,ba=function(){function b(a){var c=1a?0:1;carguments.length?this[0]&&this[0][b]:this.each(function(c,f){f[b]=a});for(var c in b)this.prop(c,b[c]);return this}};g.get=function(b){return void 0===b?Ib.call(this):this[0>b?b+this.length:b]};g.eq=function(b){return k(this.get(b))};g.first=function(){return this.eq(0)};g.last=function(){return this.eq(-1)};g.filter=function(b){var a=wa(b);return k(xa.call(this,function(b,d){return a.call(b,d,b)}))};var rc=/\S+/g;g.hasClass=function(b){return!!b&&Aa.call(this,function(a){return a.classList.contains(b)})}; g.removeAttr=function(b){var a=ca(b);return this.each(function(b,d){t(a,function(a,b){d.removeAttribute(b)})})};g.attr=function(b,a){if(b){if(u(b)){if(2>arguments.length){if(!this[0])return;var c=this[0].getAttribute(b);return null===c?void 0:c}return void 0===a?this:null===a?this.removeAttr(b):this.each(function(c,f){f.setAttribute(b,a)})}for(c in b)this.attr(c,b[c]);return this}};g.toggleClass=function(b,a){var c=ca(b),d=void 0!==a;return this.each(function(b,h){t(c,function(b,c){d?a?h.classList.add(c): h.classList.remove(c):h.classList.toggle(c)})})};g.addClass=function(b){return this.toggleClass(b,!0)};g.removeClass=function(b){return arguments.length?this.toggleClass(b,!1):this.attr(«class»,»»)};k.unique=A;g.add=function(b,a){return k(A(this.get().concat(k(b,a).get())))};var ya=/^–/,za={},uc=Gb.style,tc=[«webkit»,»moz»,»ms»];k.prefixedProp=mb;var vc={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0}; g.css=function(b,a){if(u(b)){var c=ya.test(b);b=mb(b,c);if(2>arguments.length)return this[0]&&I(this[0],b,c);if(!b)return this;a=nb(b,a,c);return this.each(function(d,h){h&&1===h.nodeType&&(c?h.style.setProperty(b,a):h.style[b]=a)})}for(var d in b)this.css(d,b[d]);return this};g.data=function(b,a){if(!b){if(!this[0])return;var c={},d;for(d in this[0].dataset)c[d]=ob(this[0],d);return c}if(u(b))return 2>arguments.length?this[0]&&ob(this[0],b):this.each(function(c,d){c=a;try{c=JSON.stringify(c)}catch(l){}d.dataset[S(b)]= c});for(c in b)this.data(c,b[c]);return this};t([!0,!1],function(b,a){t([«Width»,»Height»],function(b,d){var c=»».concat(a?»outer»:»inner»).concat(d);g[c]=function(f){if(this[0])return va(this[0])?T[c]:this[0][«».concat(a?»offset»:»client»).concat(d)]+(f&&a?O(this[0],»margin».concat(b?»Top»:»Left»))+O(this[0],»margin».concat(b?»Bottom»:»Right»)):0)}})});t([«width»,»height»],function(b,a){g[a]=function(c){if(!this[0])return void 0===c?void 0:this;if(!arguments.length)return va(this[0])?this[0][S(«outer-«.concat(a))]: this[0].getBoundingClientRect()[a]-pb(this[0],!b);var d=parseInt(c,10);return this.each(function(c,h){h&&1===h.nodeType&&(c=I(h,»boxSizing»),h.style[a]=nb(a,d+(«border-box»===c?pb(h,!b):0)))})}});var Na={};g.toggle=function(b){return this.each(function(a,c){if(void 0===b?»none»===I(c,»display»):b){if(c.style.display=c.___cd||»»,»none»===I(c,»display»)){a=c.style;c=c.tagName;if(Na[c])c=Na[c];else{var d=J(c);z.body.insertBefore(d,null);var f=I(d,»display»);z.body.removeChild(d);c=Na[c]=»none»!==f?f: «block»}a.display=c}}else c.___cd=I(c,»display»),c.style.display=»none»})};g.hide=function(){return this.toggle(!1)};g.show=function(){return this.toggle(!0)};var Oa={focus:»focusin»,blur:»focusout»},Jb={mouseenter:»mouseover»,mouseleave:»mouseout»},Nc=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;g.off=function(b,a,c){var d=this;if(void 0===b)this.each(function(a,b){da(b)});else if(u(b))H(a)&&(c=a,a=»»),t(ca(b),function(b,f){b=Ba(Jb[f]||Oa[f]||f);b=Y(b,2);var l=b[0],h=b[1];d.each(function(b, d){da(d,l,h,a,c)})});else for(var f in b)this.off(f,b[f]);return this};g.on=function(b,a,c,d){var f=this;if(!u(b)){for(var h in b)this.on(h,a,b[h]);return this}H(a)&&(c=a,a=»»);t(ca(b),function(b,h){b=Ba(Jb[h]||Oa[h]||h);b=Y(b,2);var l=b[0],e=b[1];f.each(function(b,f){var h=function(b){if(!b.namespace||qb(e,b.namespace.split(«.»))){var g=f;if(a){for(var k=b.target;!ua(k,a);){if(k===f)return;k=k.parentNode;if(!k)return}g=k;b.___cd=!0}b.___cd&&Object.defineProperty(b,»currentTarget»,{configurable:!0, get:function(){return g}});k=c.call(g,b,b.data);d&&da(f,l,e,a,h);!1===k&&(b.preventDefault(),b.stopPropagation())}};h.guid=c.guid=c.guid||k.guid++;wc(f,l,e,a,h)})});return this};g.one=function(b,a,c){return this.on(b,a,c,!0)};g.ready=function(b){«loading»!==z.readyState?b(k):z.addEventListener(«DOMContentLoaded»,function(){b(k)});return this};g.trigger=function(b,a){if(u(b)){var c=Ba(b),d=Y(c,2);c=d[0];d=d[1];var f=Nc.test(c)?»MouseEvents»:»HTMLEvents»;b=z.createEvent(f);b.initEvent(c,!0,!0);b.namespace= d.join(«.»)}b.data=a;var h=b.type in Oa;return this.each(function(a,c){if(h&&H(c[b.type]))c[b.type]();else c.dispatchEvent(b)})};var Oc=/%20/g,Pc=/file|reset|submit|button|image/i,Qc=/radio|checkbox/i;g.serialize=function(){var b=»»;this.each(function(a,c){t(c.elements||[c],function(a,c){c.disabled||!c.name||»FIELDSET»===c.tagName||Pc.test(c.type)||Qc.test(c.type)&&!c.checked||(a=rb(c),void 0!==a&&(a=Ma(a)?a:[a],t(a,function(a,d){a=b;d=»&».concat(encodeURIComponent(c.name),»=»).concat(encodeURIComponent(d).replace(Oc, «+»));b=a+d})))})});return b.slice(1)};g.val=function(b){return void 0===b?this[0]&&rb(this[0]):this.each(function(a,c){if(«SELECT»===c.tagName){var d=Ma(b)?b:null===b?[]:[b];t(c.options,function(a,b){b.selected=0<=d.indexOf(b.value)})}else c.value=null===b?"":b})};g.clone=function(){return this.map(function(b,a){return a.cloneNode(!0)})};g.detach=function(){return this.each(function(b,a){a.parentNode&&a.parentNode.removeChild(a)})};var yc=/^\s*<(\w+)[^>]*>/,xc=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/, tb={«*»:Gb,tr:Ic,td:Hb,th:Hb,thead:La,tbody:La,tfoot:La};k.parseHTML=sb;g.empty=function(){return this.each(function(b,a){for(;a.firstChild;)a.removeChild(a.firstChild)})};g.html=function(b){return void 0===b?this[0]&&this[0].innerHTML:this.each(function(a,c){c.innerHTML=b})};g.remove=function(){return this.detach().off()};g.text=function(b){return void 0===b?this[0]?this[0].textContent:»»:this.each(function(a,c){c.textContent=b})};g.unwrap=function(){this.parent().each(function(b,a){b=k(a);b.replaceWith(b.children())}); return this};g.offset=function(){var b=this[0];if(b)return b=b.getBoundingClientRect(),{top:b.top+T.pageYOffset-Ca.clientTop,left:b.left+T.pageXOffset-Ca.clientLeft}};g.offsetParent=function(){return k(this[0]&&this[0].offsetParent)};g.position=function(){var b=this[0];if(b)return{left:b.offsetLeft,top:b.offsetTop}};g.children=function(b){return N(k(A(B(this,function(a){return a.children}))),b)};g.contents=function(){return k(A(B(this,function(b){return»IFRAME»===b.tagName?[b.contentDocument]:b.childNodes})))}; g.find=function(b){return k(A(B(this,function(a){return ta(b,a)})))};var Bc=/^\s*\s*$/g,Ac=/^$|^module$|\/(java|ecma)script/i,Cc=[«type»,»src»,»nonce»,»noModule»];g.after=function(){return E(arguments,this,!1,!1,!1,!0,!0)};g.append=function(){return E(arguments,this,!1,!1,!0)};g.appendTo=function(b){return E(arguments,this,!0,!1,!0)};g.before=function(){return E(arguments,this,!1,!0)};g.insertAfter=function(b){return E(arguments,this,!0,!1,!1,!1,!1,!0)};g.insertBefore= function(b){return E(arguments,this,!0,!0)};g.prepend=function(){return E(arguments,this,!1,!0,!0,!0,!0)};g.prependTo=function(b){return E(arguments,this,!0,!0,!0,!1,!1,!0)};g.replaceWith=function(b){return this.before(b).remove()};g.replaceAll=function(b){k(b).replaceWith(this);return this};g.wrapAll=function(b){b=k(b);for(var a=b[0];a.children.length;)a=a.firstElementChild;this.first().before(b);return this.appendTo(a)};g.wrap=function(b){return this.each(function(a,c){var d=k(b)[0];k(c).wrapAll(a? d.cloneNode(!0):d)})};g.wrapInner=function(b){return this.each(function(a,c){a=k(c);c=a.contents();c.length?c.wrapAll(b):a.append(b)})};g.has=function(b){var a=u(b)?function(a,d){return ta(b,d).length}:function(a,d){return d.contains(b)};return this.filter(a)};g.is=function(b){var a=wa(b);return Aa.call(this,function(b,d){return a.call(b,d,b)})};g.next=function(b,a){return N(k(A(B(this,»nextElementSibling»,a))),b)};g.nextAll=function(b){return this.next(b,!0)};g.not=function(b){var a=wa(b);return this.filter(function(b, d){return!a.call(d,b,d)})};g.parent=function(b){return N(k(A(B(this,»parentNode»))),b)};g.index=function(b){var a=b?k(b)[0]:this[0];b=b?this:k(a).parent().children();return lb.call(b,a)};g.closest=function(b){var a=this.filter(b);if(a.length)return a;var c=this.parent();return c.length?c.closest(b):a};g.parents=function(b){return N(k(A(B(this,»parentElement»,!0))),b)};g.prev=function(b,a){return N(k(A(B(this,»previousElementSibling»,a))),b)};g.prevAll=function(b){return this.prev(b,!0)};g.siblings= function(b){return N(k(A(B(this,function(a){return k(a).parent().children().not(a)}))),b)};var ja=function(){function b(){L(this,b);this.listeners=[]}return M(b,[{key:»on»,value:function(a){var b=this;(this.listeners=this.listeners||[]).push(a);return function(){b.listeners=b.listeners.filter(function(b){return b!==a})}}},{key:»once»,value:function(a){var b=this;return this.on(function(){b.unbindAll();try{for(var c=arguments.length,f=Array(c),h=0;h=new Date(a.lastSentTime)}).map(function(a){return a.consent});Vc(a.consents)};document.addEventListener(e.CustomEvents.OnConsentGrant,function(a){a.detail&&a.detail.grantedConsent&&Vb(a.detail.grantedConsent)});document.addEventListener(e.CustomEvents.OnConsentRevoke,function(a){a.detail&&a.detail.revokedConsent&&Vb(a.detail.revokedConsent)});var Ua=function(a){return Wb(a,Tb).catch(function(c){r.error(c.message); n.onFireException.emit(c,»Site-wide JavaScript»);return a})},Vb=function(a){Wb({interaction:{name:e.MetadataUpdateInteractionName.MetadataUpdate},consents:[a.consent]},function(){return!0}).then(function(){return r.debug(«Consent event: «.concat(a.consent.status))},function(a){return n.onFireException.emit(a,»Site-wide JavaScript»)})},Wb=function(a,c){a:{var d=a,f=m.result.matchedConfig;try{d=f&&f.onActionEvent?f.onActionEvent(d):d;if(«object»===x(d)){a=d;break a}n.onFireException.emit(Error(«onActionEvent failed for the «.concat(m.result.matchedConfig.name, » page config. Must return an object or null.»)),»Site-wide Javascript»)}catch(h){n.onFireException.emit(Error(«onActionEvent failed for the «.concat(m.result.matchedConfig.name,» page config. «).concat(h.message,».»)),»Site-wide Javascript»)}a=void 0}a:{d=a;f=m.config;try{d=f.global&&f.global.onActionEvent?f.global.onActionEvent(d):d;if(«object»===x(d)){a=d;break a}n.onFireException.emit(Error(«onActionEvent failed for the global page config. Must return an object or null.»),»Site-wide Javascript»)}catch(h){n.onFireException.emit(Error(«onActionEvent failed for the global page config. «.concat(h.message, «.»)),»Site-wide Javascript»)}a=void 0}Ub(a);c&&!c()&&r.debug(«No opt-in consents provided. Event will still be dispatched.»);r.debug(«Sent event: «,a);n.onEventSend.emit(a);return Promise.resolve(a)},$c=function(a){return new Promise(function(c,d){n.onInitSitemap.once(function(){return d(«sitemap_reinit»)});var f={name:null},h=[];Object.keys(a.interaction).forEach(function(c){var d=Xb(a.interaction[c],c).then(function(a){f[c]=a});h.push(d)});Promise.all(h).then(function(){c(f)}).catch(function(a){n.onFireException.emit(Error(«Catalog object interaction config was rejected»), «Site-wide Javascript»)})})},Xb=function(a,c){try{return v=c,»object»===x(a)&&!Array.isArray(a)&&0=d&&(W(c),e(!1))}catch(eb){W(c),l(eb)}},f);G[c]=function(){clearInterval(g)}})},unbind:W,getBindings:function(){return G},clearBindings:function(){for(var a in G)G.hasOwnProperty(a)&&»function»===typeof G[a]&&W(a)}}},bc=function(a){a.global=a.global||{};»object»!=x(a.global)&&n.onFireException.emit(Error(«The global config has a type of «.concat(x(a.global),», but it must be an object»)),»Sitewide Javascript»);Object.assign(m.config,q({}, a));n.onInitSitemap.emit(m.config)},Wa=function(a){bd(a);return!0},ec=function(a){Ra(a.pageTypes).then(cc).then(dc).catch(function(a){«sitemap_reinit»!==a&&n.onFireException.emit(Error(«Unhandled exception: «.concat(a)),»Site-wide Javascript»)})},dc=function(a){m.result.matchedConfig=q(q({},a),{},{listeners:cd(a)});m.result.currentPage=q(q({},m.result.currentPage||{}),{},{source:{pageType:a.name,locale:dd(a)},user:{anonymousId:null},interaction:null,pageView:!0});return a.interaction?$c(a).then(function(a){m.result.currentPage.interaction= a}):Promise.resolve()},cd=function(a){return(a.listeners||[]).map(function(a){return Va(a)})},dd=function(a){return»function»===typeof a.locale?a.locale():a.locale},fc=function(){for(var a=arguments.length,c=Array(a),d=0;d«+f,e);d[c]=function(){m&&m.disconnect()}})},pageElementVisible:function(f,g){var l=g||0;if(«string»!==typeof f||»»===f||»number»!==typeof l||0>l||1«+ f,e);d[c]=function(){m.disconnect()}})},pageExit:function(f){f=f||0;if(«number»!==typeof f||0>f)throw Error(«[pageExit] Invalid arguments»);return new Promise(function(g){function l(a){clearTimeout(n);10>=a.pageY-window.pageYOffset&&(n=0«,e);d[c]=function(){m.off(«mousemove»,l)}})},pageInactive:function(f){function g(a,d){var e= new Promise(function(e){function f(a){a=a||new Event(«pageInactive»);c&&!d.isSubscribe?h.unbind(c):l.off(«mousemove click scroll keyup keydown»,g);e(a)}function g(c){clearTimeout(k);k=setTimeout(f.bind(this,c),a)}var l=y(document),k;g();l.on(«mousemove click scroll keyup keydown»,g)});e.subscribe=function(f){delete e.subscribe;d.isSubscribe=!0;e.then(function(e){e.disconnect=function(){c?h.unbind(c):d.isDisconnected=!0};f(e);!d.isDisconnected&&g(a,d).subscribe(f)});return e};return e}if(«number»!== typeof f||0>=f)throw Error(«[pageInactive] Invalid arguments»);var l={isDisconnected:!1,isSubscribe:!1};c=a(c,»«,e);d[c]=function(){l.isDisconnected=!0};return g(f,l)},pageScroll:function(f){if(«number»!==typeof f||0>f||1=f&&(g(a),c?h.unbind(c):k.off(«scroll»,l))}var k=y(document);k.on(«scroll»,l);c=a(c,»«, e);d[c]=function(){k.off(«scroll»,l)}})}}}var d={},e=c(null,!0),h=function(){return{bind:function(a){a&&d[a]&&(d[a](),delete d[a]);return c(a)},unbind:function(a){if(!a||»string»!==typeof a||»function»!==typeof d[a])return null;d[a]();delete d[a]},getBindings:function(){return d},clearBindings:function(){for(var a in d)d.hasOwnProperty(a)&&(d[a](),delete d[a])}}}();return Object.assign(e,h)}(),jc=function(){function a(c){var d=this;L(this,a);this.clearRateLimiter=function(){d.sentEvents=[]};this.eventWithinLimitTimeRange= function(a,c,d){return d-c.time f)?(r.info(«Event rate limit exceeded. More than «.concat(f,» events «)+»sent in «.concat(e,»ms.»)),!0):!1};this.checkLimits=function(a,c){return d.checkGlobalLimits(a,c.time)};this.sentEvents=[];this.eventRateLimiterConfig=c}return M(a,[{key:»resetCounters»,value:function(){this.globalCounter=0}},{key:»isTriggerLimitExceeded»,value:function(a){var c=Date.now();a=q(q({},a),{},{time:c});this.sentEvents.push(a);this.removeOldEvents(c);this.resetCounters();for(c=this.sentEvents.length-1;0<=c;c--)if(this.checkLimits(c, a))return!0;return!1}}])}(),gd=function(a){function c(a){L(this,c);var d=lc(this,c,[a]);d.getTimeRangeMax=function(){return d.eventRateLimiterConfig.perInteractionTimeRange?Math.max(d.eventRateLimiterConfig.globalTimeRange,d.eventRateLimiterConfig.perInteractionTimeRange):d.eventRateLimiterConfig.globalTimeRange};d.checkInteractionLimits=function(a,c,e){return d.eventRateLimiterConfig.perInteractionLimit&&d.eventRateLimiterConfig.perInteractionTimeRange&&d.eventWithinLimitTimeRange(d.eventRateLimiterConfig.perInteractionTimeRange, d.sentEvents[a],c)&&d.sentEvents[a].name===e&&(d.perEventCounter++,d.perEventCounter>d.eventRateLimiterConfig.perInteractionLimit)?(r.info(«Event rate limit exceeded. More than «.concat(d.eventRateLimiterConfig.perInteractionLimit,» events «)+»with interaction name of «.concat(e,» sent in «).concat(d.eventRateLimiterConfig.perInteractionTimeRange,»ms.»)),!0):!1};d.checkLimits=function(a,c){return d.checkGlobalLimits(a,c.time)||d.checkInteractionLimits(a,c.time,c.name)};return d}mc(c,a);return M(c, [{key:»resetCounters»,value:function(){fb(c,»resetCounters»,this,3)([]);this.perEventCounter=0}},{key:»isTriggerLimitExceeded»,value:function(a){return fb(c,»isTriggerLimitExceeded»,this,3)([a])}}])}(jc),Da,Ea,Fa,Ga,$a=function(){var a=0{if(null==e||!1===Object.prototype.hasOwnProperty.call(e,t)||null==e[t])throw new Error(`missing required option «${String(t)}»`)})}function n(e,t){const n=new CustomEvent(e,{detail:t});document.dispatchEvent(n)}async function i(e){return await new Promise((t,n)=>{const i=new XMLHttpRequest;i.onload=()=>t(i),i.onerror=()=>t(i),i.abort=()=>n(new Error(«Request aborted»)),e(i)})}async function o(e){await new Promise(t=>{setTimeout(t,e)})}function a(e){return 200===(null==e?void 0:e.status)||204===(null==e?void 0:e.status)}function s(){return window.SalesforceInteractions}function r(){const e=s().getAnonymousId();if(null==e||»»===e)throw new Error(«sessionId is missing»);return e}function c(e){var t;return null!==(t=e.deviceId)&&void 0!==t?t:r()}function l(e){var t,n;const s=e.tenantSpecificEndpoint+»/web/v2/authentication»,r=null!==(t=e.authenticator.maxAttempts)&&void 0!==t?t:5,l=null!==(n=e.authenticator.retryDelay)&&void 0!==n?n:5;let u=!1,d=!1;return async()=>{if(u)return!0;if(d)return!1;const t=async()=>{const t=await i(t=>{const n=btoa(JSON.stringify({appSourceId:e.authenticator.appSourceId,deviceId:c(e)}));t.open(«POST»,s),t.setRequestHeader(«Content-Type»,»application/x-www-form-urlencoded»),t.send(`auth=${n}`)});if(401===t.status)throw d=!0,new Error(«Unauthorized»);return a(t)};for(let e=r;e>0;e–)try{if(u=await t(),u)return!0}finally{!(u||d)&&e>1&&await o(l)}throw d=!0,new Error(«No more authentication retries»)}}function u(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>{const n=t.toString();return String.fromCharCode(parseInt(`0x${n}`,16))}))}var d;let m;!function(e){e.OnBeforeEventSend=»dataCloud:onBeforeEventSend»,e.OnEventSend=»dataCloud:onEventSend»}(d||(d={})),null!=window.SalesforceInteractions&&(window.SalesforceInteractions.DataCloud={CustomEvents:d,profileHasChanged:!1});const h=new Uint8Array(16);function g(){if(!m&&(m=»undefined»!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!m))throw new Error(«crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported»);return m(h)}const v=[];for(let e=0;e<256;++e)v.push((e+256).toString(16).slice(1));var p={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function f(e,t,n){if(p.randomUUID&&!e)return p.randomUUID();const i=(e=e||{}).random||(e.rng||g)();return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e,t=0){return v[e[t+0]]+v[e[t+1]]+v[e[t+2]]+v[e[t+3]]+"-"+v[e[t+4]]+v[e[t+5]]+"-"+v[e[t+6]]+v[e[t+7]]+"-"+v[e[t+8]]+v[e[t+9]]+"-"+v[e[t+10]]+v[e[t+11]]+v[e[t+12]]+v[e[t+13]]+v[e[t+14]]+v[e[t+15]]}(i)}function T(e){return("number"==typeof(null==e?void 0:e.time)?new Date(e.time):new Date).toISOString()}function y(e,t){return{eventId:f(),dateTime:T(e),sessionId:r(),deviceId:c(t)}}function b(t,n){var i;const o=null!==(i=t.consents)&&void 0!==i?i:[];if(0===o.length)return[];const a=[];return o.forEach(i=>{const o=function(t,n,i){try{let o;if(t.status===e.ConsentStatus.OptIn)o=»opt-in»;else{if(t.status!==e.ConsentStatus.OptOut)return s().log.error(`Consent value should be either «${e.ConsentStatus.OptIn}» or «${e.ConsentStatus.OptOut}»`,n),null;o=»opt-out»}return Object.assign(Object.assign({},y(n,i)),{eventType:»consentLog»,category:»Engagement»,purpose:t.purpose,provider:t.provider,status:o})}catch(e){const t=e instanceof Error?e.message:»Unknown error occurred during consent extraction»;return s().log.error(t),null}}(i,t,n);null!=o&&a.push(o)}),a}function w(e){var t,n,i,o,a,s;return{interactionName:null===(t=null==e?void 0:e.interaction)||void 0===t?void 0:t.name,pageView:null==e?void 0:e.pageView,sourceUrl:null===(n=null==e?void 0:e.source)||void 0===n?void 0:n.url,sourceUrlReferrer:null===(i=null==e?void 0:e.source)||void 0===i?void 0:i.urlReferrer,sourceChannel:null===(o=null==e?void 0:e.source)||void 0===o?void 0:o.channel,sourceLocale:null===(a=null==e?void 0:e.source)||void 0===a?void 0:a.locale,sourcePageType:null===(s=null==e?void 0:e.source)||void 0===s?void 0:s.pageType}}const E=/^[a-zA-Z](?!.*__)(?!.*_$)\w{0,79}$/;function I(e){return»string»==typeof e&&E.test(e)?e:(s().log.warn(`[Invalid eventType: «${e}»] Must begin with a letter (a-zA-Z) and can only contain alphanumeric characters and underscores (no spaces.) Also cannot end with or have consecutive underscores. Max 80 characters.`),null)}function O(e){return{eventId:f(),category:e.category,dateTime:e.dateTime,deviceId:e.deviceId,sessionId:e.sessionId,eventType:»»,interactionName:e.interactionName}}function x(e){return null!=(null==e?void 0:e.catalogObjectId)&&null!=(null==e?void 0:e.catalogObjectType)&&null!=(null==e?void 0:e.quantity)}function S(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,»default»)?e.default:e}var C,j={exports:{}};var L=function(){if(C)return j.exports;C=1;const e=/[\p{Lu}]/u,t=/[\p{Ll}]/u,n=/^[\p{Lu}](?![\p{Lu}])/gu,i=/([\p{Alpha}\p{N}_]|$)/u,o=/[_.\- ]+/,a=new RegExp(«^»+o.source),s=new RegExp(o.source+i.source,»gu»),r=new RegExp(«\\d+»+i.source,»gu»),c=(i,o)=>{if(«string»!=typeof i&&!Array.isArray(i))throw new TypeError(«Expected the input to be `string | string[]`»);if(o={pascalCase:!1,preserveConsecutiveUppercase:!1,…o},0===(i=Array.isArray(i)?i.map(e=>e.trim()).filter(e=>e.length).join(«-«):i.trim()).length)return»»;const c=!1===o.locale?e=>e.toLowerCase():e=>e.toLocaleLowerCase(o.locale),l=!1===o.locale?e=>e.toUpperCase():e=>e.toLocaleUpperCase(o.locale);if(1===i.length)return o.pascalCase?l(i):c(i);return i!==c(i)&&(i=((n,i,o)=>{let a=!1,s=!1,r=!1;for(let c=0;c(n.lastIndex=0,e.replace(n,e=>t(e))))(i,c):c(i),o.pascalCase&&(i=l(i.charAt(0))+i.slice(1)),((e,t)=>(s.lastIndex=0,r.lastIndex=0,e.replace(s,(e,n)=>t(n)).replace(r,e=>t(e))))(i,l)};return j.exports=c,j.exports.default=c,j.exports}(),A=S(L);function R(e,t,n={}){return null==e||(«object»==typeof e?Object.keys(e).forEach(i=>R(e[i],A(null!=t?t+».»+i:i),n)):null!=t&&(n[t]=e)),n}function k(e){return t(e,»catalogObjectType»,»catalogObjectId»,»quantity»),Object.assign({catalogObjectType:e.catalogObjectType,catalogObjectId:e.catalogObjectId,price:e.price,quantity:e.quantity,currency:e.currency},R(e.attributes,»attribute»))}function P(e,t,n){const i=function(e,t){return Object.assign(Object.assign(Object.assign({},y(e,t)),w(e)),{category:»Engagement»,eventType:»cart»})}(e,n);return[i,…D(i,t)]}function D(n,i){const o=[];if(function(t){return t.name===e.CartInteractionName.AddToCart}(i)||function(t){return t.name===e.CartInteractionName.RemoveFromCart}(i)){t(i,»lineItem»);const e=M(n,i.lineItem);null!=e&&o.push(e)}else!function(t){return t.name===e.CartInteractionName.ReplaceCart}(i)?new Set(i.lineItems).add(i.lineItem).forEach(e=>{if(x(e)){const t=M(n,e);null!=t&&o.push(t)}}):(t(i,»lineItems»),i.lineItems.forEach(e=>{const t=M(n,e);null!=t&&o.push(t)}));return o}function M(e,t){try{return Object.assign(Object.assign(Object.assign({},O(e)),k(t)),{eventType:»cartItem»,cartEventId:e.eventId})}catch(e){const t=e instanceof Error?e.message:»Unknown error occurred during cart event extraction»;return s().log.error(t),null}}function N(e,n,i){t(n,»catalogObject»);return[$(e,n.catalogObject,i)]}function $(e,n,i){return t(n,»id»,»type»),Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},y(e,i)),w(e)),R(n.attributes,»attribute»)),R(n.relatedCatalogObjects,»relatedCatalogObject»)),{category:»Engagement»,eventType:»catalog»,id:n.id,type:n.type})}function U(e,n,i){t(n,»order»);const o=n.order,a=function(e,n,i){return t(n,»id»),Object.assign(Object.assign(Object.assign(Object.assign({},y(e,i)),w(e)),R(n.attributes,»attribute»)),{category:»Engagement»,eventType:»order»,orderId:n.id,orderCurrency:n.currency,orderTotalValue:n.totalValue})}(e,o,i);return[a,…F(a,o)]}function F(e,t){if(null==t.lineItems)return[];const n=[];return t.lineItems.forEach(t=>{const i=function(e,t){try{return Object.assign(Object.assign(Object.assign({},O(e)),k(t)),{eventType:»orderItem»,orderEventId:e.eventId})}catch(e){const t=e instanceof Error?e.message:»Unknown error occurred during order event extraction»;return s().log.error(t),null}}(e,t);null!=i&&n.push(i)}),n}const H=»timeTracking»,q=[«pageViewId»,»pingSequence»,»pageStartTime»,»lastActivityTime»,»activeTime»,»totalActiveTime»,»threshold»];function B(e){if(!(«eventType»in e)||!(«name»in e))return!1;const t=e.eventType,n=e.name;return»string»==typeof t&&(t===H||t.endsWith(«Time»))&&(«timeOnPage»===n||»pageExit»===n)}function V(e,t,n){var i;const o=I(null!==(i=t.eventType)&&void 0!==i?i:t.name);if(null==o)return[];const a=Object.keys(e.interaction).reduce((e,n)=>(«name»!==n&&(e[n]=t[n]),e),{});return[Object.assign(Object.assign(Object.assign(Object.assign({},R(a)),y(e,n)),w(e)),{eventType:o,category:»Engagement»})]}function W(e,t,n){return null==(null==t?void 0:t.eventType)?[…_(e,t,n),…z(e,t,n),…J(e,t,n)]:[]}function _(e,t,n){return function(e){return t=null==e?void 0:e.order,null!=(null==t?void 0:t.id);var t}(t)?U(e,t,n):[]}function z(e,t,n){return function(e){return t=null==e?void 0:e.catalogObject,null!=(null==t?void 0:t.id)&&null!=(null==t?void 0:t.type);var t}(t)?N(e,t,n):[]}function J(e,t,n){return function(e){var t;return x(null==e?void 0:e.lineItem)||(null===(t=null==e?void 0:e.lineItems)||void 0===t?void 0:t.some(x))}(t)?P(e,t,n):[]}function K(n,i){const o=null==n?void 0:n.interaction;return null==o?[]:(t(n.interaction,»name»),function(t){return e.OrderInteractionName.Return===t.name||e.OrderInteractionName.Ship===t.name||e.OrderInteractionName.Preorder===t.name||e.OrderInteractionName.Cancel===t.name||e.OrderInteractionName.Exchange===t.name||e.OrderInteractionName.Purchase===t.name||e.OrderInteractionName.Deliver===t.name}(o)?U(n,o,i):function(t){return e.CatalogObjectInteractionName.ViewCatalogObject===t.name||e.CatalogObjectInteractionName.CommentCatalogObject===t.name||e.CatalogObjectInteractionName.FavoriteCatalogObject===t.name||e.CatalogObjectInteractionName.ReviewCatalogObject===t.name||e.CatalogObjectInteractionName.ShareCatalogObject===t.name||e.CatalogObjectInteractionName.QuickViewCatalogObject===t.name||e.CatalogObjectInteractionName.ViewCatalogObjectDetail===t.name}(o)?N(n,o,i):function(t){return e.CartInteractionName.ReplaceCart===t.name||e.CartInteractionName.AddToCart===t.name||e.CartInteractionName.RemoveFromCart===t.name}(o)?P(n,o,i):B(o)?function(e,t,n){if(!B(t))return[];const i=t,o=I(i.eventType);if(null==o)return[];const a=q.reduce((e,t)=>{const n=i[t];return void 0!==n&&(e[t]=n),e},{}),s={};for(const[e,t]of Object.entries(i))void 0!==t&&»name»!==e&&»eventType»!==e&&(q.includes(e)||(s[e]=t));const r=Object.assign(Object.assign({},a),s);return[Object.assign(Object.assign(Object.assign(Object.assign({},R(r)),y(e,n)),w(e)),{eventType:o,category:»Engagement»})]}(n,o,i):function(e,t,n){return[…W(e,t,n),…V(e,t,n)]}(n,o,i))}function Z(e,t){var n,i;const o=b(e,t);if(function(e){return e.length>0&&e.every(e=>»opt-out»===e.status)}(o))return o;const a=function(e,t){var n;const i=null===(n=null==e?void 0:e.user)||void 0===n?void 0:n.attributes;if(«object»!=typeof i)return[];const o=I(null==i?void 0:i.eventType);if(null==o)throw new Error(`Missing or invalid required «user.attributes.eventType» string in action: ${JSON.stringify(e,null,»\t»)}`);return[Object.assign(Object.assign(Object.assign(Object.assign({},y(e,t)),w(e)),i),{eventType:o,category:»Profile»})]}(e,t);return(null===(i=null===(n=s())||void 0===n?void 0:n.DataCloud)||void 0===i?void 0:i.profileHasChanged)&&(0===a.length&&(a.push(Object.assign(Object.assign({},y(e,t)),{category:»Profile»,eventType:»identity»,isAnonymous:1})),s().log.debug(`Attaching new anonymous identity: ${c(t)}`)),s().DataCloud.profileHasChanged=!1),[…o,…a,…K(e,t)]}function G(e,t){return»boolean»==typeof t?t?1:0:t}const Q=»application/json, text/javascript, */*; q=0.01″,X=»Rate Limit Telemetry»,Y=»rateLimitTelemetry»,ee=»blocked»;async function te(e,t,o){const r=function(e,t,n,i){if(!i||0===Object.keys(i).length)return n;const o={time:Date.now(),source:e.source,interaction:{name:X,eventType:Y,[ee]:i}},a=Z(o,t);if(0===a.length)return n;return n.concat(a)}(e,t,Z(e,t),o),c={actionEvent:e,events:r};(null==e?void 0:e.suppressDataCloudSend)&&(c.suppressDataCloudSend=!0);const l=!document.dispatchEvent(new CustomEvent(d.OnBeforeEventSend,{detail:c,cancelable:!0}));if(s().getLoggingLevel()>=4&&s().log.debug(`Events translated for Data Cloud: ${JSON.stringify(r,G,»\t»)}`),!c.suppressDataCloudSend&&!(null==e?void 0:e.suppressDataCloudSend)&&r.length>0&&!l){const e=t.tenantSpecificEndpoint+»/web/events/»+t.authenticator.appSourceId,o={events:r},s=JSON.stringify(o,G);n(d.OnEventSend,JSON.parse(s)),await async function(e,t){!function(){if(«function»!=typeof window.fetch)return!1;try{return!!new Request(«_»,{keepalive:!0}).keepalive}catch(e){return!1}}()?await async function(e,t){const n=await i(n=>{const i=encodeURIComponent(u(t));n.open(«POST»,e,!0),n.setRequestHeader(«Accept»,Q),n.setRequestHeader(«Content-Type»,»application/x-www-form-urlencoded»),n.send(`event=${i}`)});if(!a(n)){const e=new Error(`Response was not OK: ${n.responseText}`);throw Object.assign(e,{status:n.status,statusText:n.statusText}),e}}(e,t):await async function(e,t){const n=encodeURIComponent(u(t)),i=new Headers;i.append(«Accept»,Q),i.append(«Content-Type»,»application/x-www-form-urlencoded»);const o={method:»POST»,headers:i,body:`event=${n}`,credentials:»omit»,keepalive:!0},a=await fetch(e,o);if(await a.text(),!a.ok){const e=new Error(`Response was not OK. Type: ${a.type}, status: ${a.status} (${a.statusText})`);throw Object.assign(e,{status:a.status,statusText:a.statusText,type:a.type}),e}}(e,t)}(e,s)}}const ne=1e4,ie=1e3,oe=36e5,ae={enabled:!0,enableBlockedEventTelemetry:!0,globalLimit:200,globalTimeRange:6e4,perInteractionLimit:60,perInteractionTimeRange:6e4};function se(t,n){var i;const o=null!=n?n:l(t);let a=null;const r=null!==(i=t.rateLimiting)&&void 0!==i?i:ae,c=r.enabled,u=r.enableBlockedEventTelemetry;let d={};if(c){const t={globalLimit:r.globalLimit,globalTimeRange:r.globalTimeRange,perInteractionLimit:r.perInteractionLimit,perInteractionTimeRange:r.perInteractionTimeRange};a=new e.InteractionEventRateLimiter(t)}else s().log.info(«Rate limiting is disabled. All events will be sent.»);return async e=>{const n=e.interaction,i=(null==n?void 0:n.eventType)||(null==n?void 0:n.name)||»unknown»;if(a&&a.isTriggerLimitExceeded({name:i})){if(u){const e=i,t=!(e in d);if(d[e]=(d[e]||0)+1,t){const e=Object.keys(d);if(e.length>100){const t=e[0];delete d[t]}}}return void s().log.warn(`Event rate limit exceeded for interaction «${i}». Event dropped.`)}if(await o()){let n;u&&Object.keys(d).length>0&&(n=Object.assign({},d),d={}),await te(e,t,n)}}}function re(){return s().getConsents().findIndex(t=>t.consent.status===e.ConsentStatus.OptIn)>=0}const ce={enabled:!1,activityTimeoutMillis:5e3,minimumActivityTimeToRegister:300,maxSessionDurationMillis:36e5,eventTypes:[«catalog»],thresholds:[{label:»LOW_INTEREST»,threshold:3e4},{label:»HIGH_INTEREST»,threshold:6e4}],sendPageExitWithoutThreshold:!1,maxEventsPerSession:20};class le{getEffectiveConfig(){return this.config}getTotalActiveTime(){return this.snapshot.totalActiveTime}constructor(e){this.intervalId=null,this.lastFlushedTotalActiveTime=0,this.pageHidden=!1,this.pingSequence=0,this.capturedContextEvent=null,this.capturedEventType=null,this.activityListeners=[],this.nextThresholdIndex=0,this.hasSentInitialThreshold=!1,this.onPageHideHandler=null,this.options=e,this.config=this.withDefaults(e.timeTracking);const t=Date.now();this.snapshot={pageStartTime:t,lastActivityTime:t,totalActiveTime:0},this.pageViewId=f()}start(){this.config.enabled&&(this.bindActivityListeners(),this.bindUnloadListeners(),this.intervalId=window.setInterval(()=>this.onTick(),1e3),this.trace(«TimeTracking: started»,{intervalMs:1e3,activityTimeout:this.config.activityTimeoutMillis}))}stop(){null!=this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null),this.unbindActivityListeners(),this.handlePageExit(),this.unbindUnloadListeners(),this.trace(«TimeTracking: stopped»)}observeOutgoingAction(e,t=[]){try{const n=null==e?void 0:e.interaction;if(this.isTimeTrackingEvent(n))return;if(this.capturedContextEvent)return;for(const e of this.config.eventTypes){const n=t.find(t=>t.eventType===e);if(n)return void this.captureContextEvent(n)}}catch(e){this.trace(«TimeTracking: error observing action»,e)}}isTimeTrackingEvent(e){const t=null==e?void 0:e.eventType,n=null==e?void 0:e.name;return»string»==typeof t&&t.trim().length>0&&(t===H||t.endsWith(«Time»))&&(«timeOnPage»===n||»pageExit»===n)}captureContextEvent(e){const t=Object.assign({},e);this.capturedEventType=e.eventType;if([«category»,»dateTime»,»deviceId»,»eventId»,»eventType»,»sessionId»,»interactionName»,»pageView»,»sourceChannel»,»sourceLocale»,»sourcePageType»,»sourceUrl»,»sourceUrlReferrer»].forEach(e=>{delete t[e]}),e.eventType&&e.eventId){const n=`${e.eventType}EventId`;t[n]=e.eventId}this.capturedContextEvent=t,this.trace(«TimeTracking: captured context»,this.capturedContextEvent)}onTick(){const e=Date.now();if(e-this.snapshot.pageStartTime>this.config.maxSessionDurationMillis)return void this.resetSession(e,»max duration exceeded»);const t=e-this.snapshot.lastActivityTime,n=t<=this.config.activityTimeoutMillis;if(this.trace("TimeTracking: tick",{sinceLast:t,isActive:n,totalActiveTime:this.snapshot.totalActiveTime}),n)for(this.addActiveTime(e);this.nextThresholdIndex=this.config.thresholds[this.nextThresholdIndex].threshold;){const e=this.config.thresholds[this.nextThresholdIndex];this.trace(«TimeTracking: threshold reached»,e),this.sendTimeTrackingEvent(«timeOnPage»,e.label),this.nextThresholdIndex++}else this.snapshot.activeSince=void 0}resetSession(e,t){const n=e-this.snapshot.pageStartTime;this.flushActiveTime(),this.sendTimeTrackingEvent(«timeOnPage»,»pageExit»),this.snapshot.pageStartTime=e,this.snapshot.totalActiveTime=0,this.lastFlushedTotalActiveTime=0,this.pageViewId=f(),this.pingSequence=0,this.nextThresholdIndex=0,this.hasSentInitialThreshold=!1,this.capturedContextEvent=null,this.capturedEventType=null,this.trace(`TimeTracking: session reset (${t})`,{sessionDuration:n,maxDuration:this.config.maxSessionDurationMillis})}bindActivityListeners(){const e=()=>{const e=Date.now();null==this.snapshot.activeSince&&(this.snapshot.activeSince=e,this.trace(«TimeTracking: activity resumed»)),this.snapshot.lastActivityTime=e};[{element:document,event:»mousemove»,handler:e,options:{passive:!0}},{element:document,event:»click»,handler:e,options:{passive:!0}},{element:document,event:»scroll»,handler:e,options:{passive:!0}},{element:document,event:»wheel»,handler:e,options:{passive:!0}},{element:document,event:»mousedown»,handler:e,options:{passive:!0}},{element:document,event:»keydown»,handler:e,options:{passive:!0}},{element:document,event:»touchstart»,handler:e,options:{passive:!0}},{element:document,event:»touchmove»,handler:e,options:{passive:!0}},{element:window,event:»focus»,handler:e,options:{passive:!0}},{element:window,event:»blur»,handler:()=>{this.trace(«TimeTracking: blur -> flush»),this.flushActiveTime(),this.markFlushPoint()},options:{passive:!0}},{element:document,event:»visibilitychange»,handler:()=>{if(«hidden»===document.visibilityState)this.trace(«TimeTracking: visibility hidden -> flush»),this.flushActiveTime(),this.markFlushPoint();else if(«visible»===document.visibilityState){const e=Date.now();this.snapshot.activeSince=e,this.snapshot.lastActivityTime=e,this.trace(«TimeTracking: visibility visible -> resume»)}},options:{passive:!0}},{element:document,event:d.OnBeforeEventSend,handler:e=>{const t=e,{actionEvent:n,events:i}=t.detail||{};n&&this.observeOutgoingAction(n,i)}}].forEach(({element:e,event:t,handler:n,options:i})=>{void 0!==i?e.addEventListener(t,n,i):e.addEventListener(t,n),this.activityListeners.push({element:e,event:t,handler:n})})}unbindActivityListeners(){this.activityListeners.forEach(({element:e,event:t,handler:n})=>{e.removeEventListener(t,n)}),this.activityListeners=[]}bindUnloadListeners(){this.onPageHideHandler=()=>this.handlePageExit(),window.addEventListener(«pagehide»,this.onPageHideHandler)}unbindUnloadListeners(){this.onPageHideHandler&&(window.removeEventListener(«pagehide»,this.onPageHideHandler),this.onPageHideHandler=null)}handlePageExit(){this.pageHidden||(this.pageHidden=!0,this.capturedContextEvent?this.hasSentInitialThreshold||this.config.sendPageExitWithoutThreshold?(this.flushActiveTime(),this.trace(«TimeTracking: pageExit»,{totalActiveTime:this.snapshot.totalActiveTime}),this.sendTimeTrackingEvent(«pageExit»,»pageExit»)):this.trace(«TimeTracking: pageExit skipped (no threshold sent and sendPageExitWithoutThreshold is false)»):this.trace(«TimeTracking: pageExit skipped (no context)»))}flushActiveTime(){const e=Date.now();this.addActiveTime(e),this.snapshot.activeSince=void 0,this.trace(«TimeTracking: flushed»,{totalActiveTime:this.snapshot.totalActiveTime})}markFlushPoint(){this.lastFlushedTotalActiveTime=this.snapshot.totalActiveTime}addActiveTime(e){var t;if(null==this.snapshot.activeSince)return;const n=e-this.snapshot.activeSince,i=Math.max(3e5,this.config.activityTimeoutMillis);if(n<0||n>i)return s().log.debug(«TimeTracking: rejected delta»,{delta:n,reason:n<0?"negative":"excessive",maxActivityDelta:i}),void(this.snapshot.activeSince=e);n>=(null!==(t=this.config.minimumActivityTimeToRegister)&&void 0!==t?t:0)&&(this.snapshot.totalActiveTime+=n,this.snapshot.activeSince=e)}buildTimeTrackingInteraction(e,t,n,i){const o={name:e,eventType:`${this.capturedEventType}Time`,pageViewId:this.pageViewId,pingSequence:++this.pingSequence,pageStartTime:new Date(this.snapshot.pageStartTime).toISOString(),lastActivityTime:new Date(this.snapshot.lastActivityTime).toISOString(),activeTime:t,totalActiveTime:n,threshold:i};if(this.capturedContextEvent)for(const e in this.capturedContextEvent)Object.prototype.hasOwnProperty.call(this.capturedContextEvent,e)&&(Object.prototype.hasOwnProperty.call(o,e)?s().log.warn(`TimeTracking: context field collision ‘${e}’ – ignoring context value`):o[e]=this.capturedContextEvent[e]);return o}sendTimeTrackingEvent(t,i){var o;if(!this.capturedContextEvent)return;if(this.pingSequence>=this.config.maxEventsPerSession)return void s().log.warn(«TimeTracking: max events limit reached, skipping send»,{limit:this.config.maxEventsPerSession,sent:this.pingSequence});»timeOnPage»===t&&(this.hasSentInitialThreshold=!0);const a=Date.now(),r=this.snapshot.totalActiveTime,c=Math.max(0,r-this.lastFlushedTotalActiveTime);if(«timeOnPage»===t&&c<=0)return void this.trace("TimeTracking: suppress timeOnPage (no new active time)",{deltaSinceFlush:c,totalActiveTime:r});const l=this.buildTimeTrackingInteraction(t,c,r,i),d={time:a,source:{url:null===(o=window.location)||void 0===o?void 0:o.href,urlReferrer:document.referrer},interaction:l};if("pageExit"===t&&"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon)try{if(!re())return void this.trace("TimeTracking: pageExit beacon skipped (no consent)");const t=Z(d,this.options);if(t.length>0){const i=JSON.stringify({events:t},G),o=function(e,t){try{if(«undefined»==typeof navigator||»function»!=typeof navigator.sendBeacon)return!1;const n=e.tenantSpecificEndpoint+»/web/events/»+e.authenticator.appSourceId,i=encodeURIComponent(u(t)),o=new Blob([`event=${i}`],{type:»application/x-www-form-urlencoded»});return o.size>65536&&s().log.warn(`navigator.sendBeacon payload too large (${o.size} bytes). Limit is 64KB. Beacon will likely fail.`),navigator.sendBeacon(n,o)}catch(e){return s().log.warn(«Beacon send failed:»,e),!1}}(this.options,i);if(this.trace(«TimeTracking: pageExit beacon attempt»,{events:t.length,queued:o}),o){this.markFlushPoint();return d.suppressDataCloudSend=!0,void n(e.CustomEvents.OnEventSend,{actionEvent:d})}}}catch(e){}n(e.CustomEvents.OnEventSend,{actionEvent:d}),this.markFlushPoint()}withDefaults(e){var t,n,i,o,a,s,r,c;if(void 0===e)return ce;const l=e,u=[…null!==(t=l.thresholds)&&void 0!==t?t:ce.thresholds].sort((e,t)=>e.threshold-t.threshold),d=null!==(n=l.maxEventsPerSession)&&void 0!==n?n:ce.maxEventsPerSession;return this.validateConfiguration(u,d),{enabled:null!==(i=l.enabled)&&void 0!==i?i:ce.enabled,activityTimeoutMillis:Math.max(1e3,null!==(o=l.activityTimeoutMillis)&&void 0!==o?o:ce.activityTimeoutMillis),minimumActivityTimeToRegister:null!==(a=l.minimumActivityTimeToRegister)&&void 0!==a?a:ce.minimumActivityTimeToRegister,maxSessionDurationMillis:null!==(s=l.maxSessionDurationMillis)&&void 0!==s?s:ce.maxSessionDurationMillis,eventTypes:null!==(r=l.eventTypes)&&void 0!==r?r:ce.eventTypes,thresholds:u,sendPageExitWithoutThreshold:null!==(c=l.sendPageExitWithoutThreshold)&&void 0!==c?c:ce.sendPageExitWithoutThreshold,maxEventsPerSession:d}}validateConfiguration(e,t){try{const n=e.length+1;ts(),window.getSalesforceInteractionsName=()=>»SalesforceInteractions»,function(i){t(i,»tenantSpecificEndpoint»,»authenticator»),t(i.authenticator,»appSourceId»),i.tenantSpecificEndpoint=function(e,t=»»){const n=»https://»;try{if(e=e.trim(),/^.+:\/\/.*/.test(e)||(e=n+e),!(e=n+new URL(e).hostname).endsWith(«.salesforce.com»))throw new TypeError(«Invalid URL: «+e)}catch(n){if(e=»»,»»!==t)throw new Error(t)}return e}(i.tenantSpecificEndpoint,»tenantSpecificEndpoint is invalid»);let o=Object.assign(Object.assign(Object.assign({},i),void 0===i.timeTracking&&{timeTracking:ce}),void 0===i.rateLimiting&&{rateLimiting:ae});const a=l(o);let r=se(o,a),c=null;try{c=new le(o),c.start(),window.addEventListener(«pagehide»,()=>{try{null==c||c.stop()}catch(e){}}),ue(e.CustomEvents.OnShutDown,async()=>{try{null==c||c.stop()}catch(e){}c=null}),s().DataCloud.stopTimeTracking=()=>{try{null==c||c.stop()}catch(e){s().log.error(«Error stopping time tracking service via global method»,e)}}}catch(e){s().log.error(«Failed to initialize time tracking service»,e)}function u(e,t){const n=function(e){if(!e)return;const t=s().log,n=e,i=[],o={};if(«enabled»in n&&(«boolean»!=typeof n.enabled?i.push(‘»enabled» must be a boolean, got ‘+typeof n.enabled):o.enabled=n.enabled),»activityTimeoutMillis»in n&&(«number»!=typeof n.activityTimeoutMillis||!Number.isFinite(n.activityTimeoutMillis)||n.activityTimeoutMillis<0?i.push('"activityTimeoutMillis" must be a non-negative number, got '+typeof n.activityTimeoutMillis):o.activityTimeoutMillis=Math.max(1e3,n.activityTimeoutMillis)),"minimumActivityTimeToRegister"in n&&("number"!=typeof n.minimumActivityTimeToRegister||!Number.isFinite(n.minimumActivityTimeToRegister)||n.minimumActivityTimeToRegister<0?i.push('"minimumActivityTimeToRegister" must be a non-negative number, got '+typeof n.minimumActivityTimeToRegister):o.minimumActivityTimeToRegister=n.minimumActivityTimeToRegister),"maxSessionDurationMillis"in n&&("number"!=typeof n.maxSessionDurationMillis||!Number.isFinite(n.maxSessionDurationMillis)||n.maxSessionDurationMillis<0?i.push('"maxSessionDurationMillis" must be a non-negative number, got '+typeof n.maxSessionDurationMillis):o.maxSessionDurationMillis=n.maxSessionDurationMillis),"eventTypes"in n)if(Array.isArray(n.eventTypes)){const e=[],t=[];for(const i of n.eventTypes)if("string"!=typeof i)e.push(String(i));else{const n=I(i);null===n?e.push(i):t.push(n)}e.length>0?i.push(`»eventTypes» contains invalid entries: ${e.join(«, «)}`):o.eventTypes=t}else i.push(‘»eventTypes» must be an array of strings, got ‘+typeof n.eventTypes);if(«thresholds»in n)if(Array.isArray(n.thresholds)){const e=[],t=[],a=new Set,s=new Set;for(let i=0;i 0)`);continue}const l=r.trim();a.has(l)?e.push(`entry at index ${i} (duplicate label «${l}»)`):s.has(c)?e.push(`entry at index ${i} (duplicate threshold ${c})`):(a.add(l),s.add(c),t.push({label:l,threshold:c}))}e.length>0?i.push(`»thresholds» contains invalid entries: ${e.join(«; «)}`):t.length>0&&(t.sort((e,t)=>e.threshold-t.threshold),o.thresholds=t)}else i.push(‘»thresholds» must be an array, got ‘+typeof n.thresholds);if(«sendPageExitWithoutThreshold»in n&&(«boolean»!=typeof n.sendPageExitWithoutThreshold?i.push(‘»sendPageExitWithoutThreshold» must be a boolean, got ‘+typeof n.sendPageExitWithoutThreshold):o.sendPageExitWithoutThreshold=n.sendPageExitWithoutThreshold),»maxEventsPerSession»in n&&(«number»!=typeof n.maxEventsPerSession||!Number.isFinite(n.maxEventsPerSession)||n.maxEventsPerSession<0?i.push('"maxEventsPerSession" must be a non-negative number, got '+typeof n.maxEventsPerSession):o.maxEventsPerSession=n.maxEventsPerSession),!(i.length>0))return o;t.error(«TimeTracking: Invalid configuration provided. All values must have correct types. Keeping existing configuration.»,{errors:i,providedConfig:n})}(t);return void 0===n?e:Object.assign(Object.assign({},e),n)}function d(e,t){const n=function(e){if(!e)return;const t=s().log,n=[],i={};if(void 0!==e.enabled&&(«boolean»!=typeof e.enabled?n.push(‘»enabled» must be a boolean, got ‘+typeof e.enabled):i.enabled=e.enabled),void 0!==e.enableBlockedEventTelemetry&&(«boolean»!=typeof e.enableBlockedEventTelemetry?n.push(‘»enableBlockedEventTelemetry» must be a boolean, got ‘+typeof e.enableBlockedEventTelemetry):i.enableBlockedEventTelemetry=e.enableBlockedEventTelemetry),void 0!==e.globalLimit&&(«number»!=typeof e.globalLimit||!Number.isFinite(e.globalLimit)||e.globalLimit<1||e.globalLimit>ne?n.push(‘»globalLimit» must be a number between 1 and 10000, got ‘+typeof e.globalLimit):i.globalLimit=Math.floor(e.globalLimit)),void 0!==e.globalTimeRange&&(«number»!=typeof e.globalTimeRange||!Number.isFinite(e.globalTimeRange)||e.globalTimeRangeoe?n.push(‘»globalTimeRange» must be a number between 1000 and 3600000, got ‘+typeof e.globalTimeRange):i.globalTimeRange=Math.floor(e.globalTimeRange)),void 0!==e.perInteractionLimit&&(«number»!=typeof e.perInteractionLimit||!Number.isFinite(e.perInteractionLimit)||e.perInteractionLimit<1||e.perInteractionLimit>ne?n.push(‘»perInteractionLimit» must be a number between 1 and 10000, got ‘+typeof e.perInteractionLimit):i.perInteractionLimit=Math.floor(e.perInteractionLimit)),void 0!==e.perInteractionTimeRange&&(«number»!=typeof e.perInteractionTimeRange||!Number.isFinite(e.perInteractionTimeRange)||e.perInteractionTimeRangeoe?n.push(‘»perInteractionTimeRange» must be a number between 1000 and 3600000, got ‘+typeof e.perInteractionTimeRange):i.perInteractionTimeRange=Math.floor(e.perInteractionTimeRange)),!(n.length>0))return void 0!==i.perInteractionLimit&&void 0!==i.globalLimit&&i.perInteractionLimit>i.globalLimit&&t.warn(`RateLimiting: perInteractionLimit (${i.perInteractionLimit}) exceeds globalLimit (${i.globalLimit}). This may not behave as expected.`,{perInteractionLimit:i.perInteractionLimit,globalLimit:i.globalLimit}),void 0!==i.perInteractionTimeRange&&void 0!==i.globalTimeRange&&i.perInteractionTimeRange>i.globalTimeRange&&t.warn(`RateLimiting: perInteractionTimeRange (${i.perInteractionTimeRange}ms) exceeds globalTimeRange (${i.globalTimeRange}ms). This may not behave as expected.`,{perInteractionTimeRange:i.perInteractionTimeRange,globalTimeRange:i.globalTimeRange}),i;t.error(«RateLimiting: Invalid configuration provided. All values must have correct types and be within bounds. Keeping existing configuration.»,{errors:n,providedConfig:e})}(t);return void 0===n?e:Object.assign(Object.assign({},e),n)}function m(e){var t,n;const i=null==e?void 0:e.dataCloud;let l,m;if(void 0!==(null==i?void 0:i.timeTracking)){l=u(null!==(t=o.timeTracking)&&void 0!==t?t:ce,i.timeTracking)}if(void 0!==(null==i?void 0:i.rateLimiting)){m=d(null!==(n=o.rateLimiting)&&void 0!==n?n:ae,i.rateLimiting)}void 0===l&&void 0===m||(o=Object.assign(Object.assign(Object.assign({},o),void 0!==l&&{timeTracking:l}),void 0!==m&&{rateLimiting:m})),e.dataCloud=Object.assign(Object.assign(Object.assign({},o),void 0!==l&&{timeTracking:l}),void 0!==m&&{rateLimiting:m}),void 0!==l&&function(){const e=c;try{null==c||c.stop(),c=new le(o),c.start()}catch(t){c=e,s().log.error(«Failed to reconfigure time tracking service»,t)}}(),void 0!==m&&function(){try{r=se(o,a)}catch(e){s().log.error(«Failed to reconfigure rate limiting»,e)}}()}ue(e.CustomEvents.OnBeforeInit,async e=>{void 0!==(null==e?void 0:e.detail.sdkConfig)&&m(e.detail.sdkConfig)}),ue(e.CustomEvents.OnSetAnonymousId,async e=>{const{newAnonymousId:t,previousAnonymousId:n}=e.detail;»previousAnonymousId»in e.detail&&»newAnonymousId»in e.detail&&t!==n&&(s().DataCloud.profileHasChanged=!0,s().log.debug(`deviceId has changed from «${String(n)}» to «${String(t)}»`))}),ue(e.CustomEvents.OnEventSend,async t=>{try{const n=t.detail.actionEvent;re()||function(t){var n;return(null===(n=null==t?void 0:t.interaction)||void 0===n?void 0:n.name)===e.MetadataUpdateInteractionName.MetadataUpdate&&Array.isArray(t.consents)&&t.consents.some(t=>t.status===e.ConsentStatus.OptOut)}(n)?await r(n):s().log.debug(«event not sent to CDP because consent was not given»)}catch(t){const i=t instanceof Error?t.message:»Unknown error occurred during event send»;s().log.error(i),n(e.CustomEvents.OnException,{error:t})}})}}(SalesforceInteractions); try { cdpEventReceiver({ tenantSpecificEndpoint: «https://mjqtsnrsgvsd9mrtgfqwmnbrmm.c360a.salesforce.com», authenticator: { appSourceId: «87b5c25f-e596-4e96-aca8-023312deb024» } }); } catch (e) { console.error(«[Salesforce Data Cloud] Error initializing Web SDK:», e); } })(); (function () { // —– module personalization – npm/@salesforce/interactions-personalization/1.0/build/dist/index.min.js [1.0.15] try { (function(y){«use strict»;function gl(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!==»default»){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var P=gl(y),ml=Object.defineProperty,$i=Object.getOwnPropertySymbols,vl=Object.prototype.hasOwnProperty,El=Object.prototype.propertyIsEnumerable,Yi=(e,t,n)=>t in e?ml(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yl=(e,t)=>{for(var n in t||(t={}))vl.call(t,n)&&Yi(e,n,t[n]);if($i)for(var n of $i(t))El.call(t,n)&&Yi(e,n,t[n]);return e},_l=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{l(n.next(a))}catch(u){i(u)}},s=a=>{try{l(n.throw(a))}catch(u){i(u)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,s);l((n=n.apply(e,t)).next())});function Zi(e,t=(n=>(n=window==null?void 0:window.location)==null?void 0:n.search)()){if(b(e)&&b(t)){const n=new URLSearchParams(t);return Array.from(n.keys()).find(r=>r.toLowerCase()===e.toLowerCase())!==void 0}return!1}function Tl(e,t=(n=>(n=window==null?void 0:window.location)==null?void 0:n.search)()){if(b(e)&&b(t)){const n=new URLSearchParams(t),r=Array.from(n.keys()).find(i=>i.toLowerCase()===e.toLowerCase());if(b(r))return n.get(r)}return null}function bl(e,t=(n=>(n=window==null?void 0:window.location)==null?void 0:n.search)()){if(H(e)&&b(t)){const n=new URLSearchParams(t),r=e.map(o=>o.toLowerCase()),i=Array.from(n.keys()).filter(o=>r.includes(o.toLowerCase()));if(i.length>0){let o={};return i.forEach(s=>{var l;o=yl({[s]:(l=n.get(s))!=null?l:»»},o)}),o}}return null}function wl(e,t=(n=>(n=window==null?void 0:window.location)==null?void 0:n.href)()){const n=new URL(t);if(b(e)){const r=n.searchParams,i=Array.from(r.keys()).find(o=>o.toLowerCase()===e.toLowerCase());b(i)&&n.searchParams.delete(i)}return n}function b(e,t=!1,n=!0){return typeof e!=»string»?!1:t?!0:(n?e.trim():e)!==»»}function D(e){return typeof e==»undefined»||e===null}function H(e,t=!1){return Array.isArray(e)?t?!0:e.length!==0:!1}function Sl(e,t=!1){return e instanceof Map?t?!0:e.size!==0:!1}function Il(e,t=!1){return e instanceof Set?t?!0:e.size!==0:!1}function N(e,t=!0){if(typeof e!=»object»||e===null||Array.isArray(e))return!1;if(!t){for(const n in e)return!0;return!1}return!0}function J(e,t){return N(e)&&!!Object.prototype.hasOwnProperty.call(e,t)}function Ht(e,t=!0){return typeof e==»number»&&(t?Number.isFinite(e):!0)}function et(e){return typeof e==»boolean»}function gn(e){return e!==null&&!isNaN(e)&&e instanceof Date}function tr(e){return typeof e==»function»}function nr(e,t){return!b(e)||!b(t)?e===t:e.toLowerCase()===t.toLowerCase()}function rr(e){return e+»:»+y.generateUuid()}function Ki(e){return`[${e}]`}const Al=function(){return{pageElementVisible:function(e){return _l(this,null,function*(){return yield new Promise(function(t){const n=(i,o)=>{for(let s=0;s{r.disconnect()}),r.observe(e)})})}}}();class Cl{constructor(t,n=50,r=!0){this.name=t,this.maxEntries=n,this.entries=new Map,r&&document.addEventListener(y.CustomEvents.OnShutDown,()=>{this.clear()})}get(t){return this.entries.get(t)}set(t,n){y.log.debug(`Cache «${this.name}»: adding ${t}`,n),this.entries.set(t,n),this.trimIfNecessary()}clear(){y.log.info(`Cache «${this.name}»: clearing all ${this.entries.size} entries`),this.entries.clear()}delete(t){y.log.debug(`Cache «${this.name}»: deleting ${t}`),this.entries.delete(t)}trimIfNecessary(){let t=this.entries.size-this.maxEntries;if(!(Ht(t)||t<=0)){y.log.info(`Cache "${this.name}": removing oldest ${String(t)} entries`);for(const[n,r]of this.entries)if(y.log.info(`Cache "${this.name}": removing value:`,r),this.entries.delete(n),--t<=0)break}}}function Ft(e,t){let n=null;try{b(t)?n=new Date(t):Ht(t)?n=new Date(t):gn(t)&&(n=t)}catch(r){}if(gn(n))return n;throw new Error(`${e} is not a valid date`)}function Xi(e,t){return e.endsWith("Date")?Ft(e,t):t}function Qi(e){let t=0;switch(e){case"ERROR":t=1;break;case"WARN":t=2;break;case"INFO":t=3;break;case"DEBUG":t=4;break;case"TRACE":t=5;break}return y.log.shouldLog(t)}class k{constructor(t,n=new Date){this.detail=t,this.timestamp=n}}class ir{constructor(t){this.updates=[],D(t)?this.setFinished(Promise.reject(new Error("Never updated")),!1):this.setFinished(t)}get finished(){return this._finished}update(t,n){this.updates.push(t),this.setFinished(n)}setFinished(t,n=!0){D(t)||(this._finished=t,this._finished.catch(r=>{if(!n)return;let i;if(r instanceof Error)i=r;else{let o;b(r)?o=r:b(r.message)?o=r.message:o=String(r),i=new Error(o)}this.updates.push(new k(i))}))}}class mn{constructor(t){this.pec=t,this.status=new ir}get revertStatus(){return this._revertStatus}revert(){return D(this._revertStatus)?(D(this.initiateRevert)?this._revertStatus=new ir(Promise.resolve()):this._revertStatus=this.initiateRevert(),this._revertStatus.update(new k(«Requested»)),this._revertStatus):this._revertStatus}static updateForAll(t,n,r){t.forEach(i=>{i.status.update(n,r)})}}class se extends Error{constructor(t,n,r){var i;super(),this.name=t,this.message=n,this.level=(i=r==null?void 0:r.level)!=null?i:»error»,this.cause=r==null?void 0:r.cause,this.context=r==null?void 0:r.context}isContextWithConfigName(t){return N(t)&&»configName»in t&&typeof t.configName==»string»}getConfigName(){return this.isContextWithConfigName(this.context)?this.context.configName:»»}getMessageWithContext(){return this.context!==void 0?`${this.message} Context: ${JSON.stringify(this.context)}`:this.message}}var ce=(e=>(e.AnchorDmoNameRequired=»ANCHOR_DMO_NAME_REQUIRED»,e.AnchorIdNullOrNotEmpty=»ANCHOR_ID_NULL_OR_NOT_EMPTY»,e.AnchorIdRequiredWithDmoName=»ANCHOR_ID_REQUIRED_WITH_DMO_NAME»,e.ConsentOptInRequired=»CONSENT_OPT_IN_REQUIRED»,e.ContextIsNotAnObject=»CONTEXT_IS_NOT_AN_OBJECT»,e.InitRequiresAppSource=»INIT_REQUIRES_APP_SOURCE»,e.InitRequiresTSE=»INIT_REQUIRES_TSE»,e.PersonalizationPointIsNotDefined=»PERSONALIZATION_POINT_IS_NOT_DEFINED»,e.PersonalizationPointNameIsNotAString=»PERSONALIZATION_POINT_NAME_IS_NOT_A_STRING»,e.PersonalizationPointDecisionIdIsNotAString=»PERSONALIZATION_POINT_DECISION_ID_IS_NOT_A_STRING»,e.PersonalizationPointDecisionIdProvidedNonPreview=»PERSONALIZATION_POINT_DECISION_ID_PROVIDED_NON_PREVIEW»,e.PersonalizationPointsIsNotAnArray=»PERSONALIZATION_POINTS_IS_NOT_AN_ARRAY»,e.DecisionIdNotValid=»DECISION_ID_NOT_VALID»,e.EndpointOverrideNotValid=»ENDPOINT_OVERRIDE_NOT_VALID»,e.IndividualIdNotValid=»INDIVIDUAL_ID_NOT_VALID»,e))(ce||{});class he extends se{}var Ji=(e=>(e.PersonalizationFetchFailed=»PERSONALIZATION_FETCH_FAILED»,e))(Ji||{});class eo extends se{}var vt=(e=>(e.InvalidJsonObject=»INVALID_JSON_OBJECT»,e.MissingPersonalizationId=»MISSING_PERSONALIZATION_ID»,e.MissingPersonalizationPointName=»MISSING_PERSONALIZATION_POINT_NAME»,e.MissingPersonalizationContent=»MISSING_PERSONALIZATION_CONTENT»,e.MissingPersonalizationsArray=»MISSING_PERSONALIZATIONS_ARRAY»,e))(vt||{});class zt extends se{}var fe=(e=>(e.MissingPersonalization=»MISSING_PERSONALIZATION»,e.ElementsNotFound=»ELEMENTS_NOT_FOUND»,e.FoundNonElement=»FOUND_NON_ELEMENT»,e.AlreadyPersonalized=»ALREADY_PERSONALIZED»,e.NotSupported=»NOT_SUPPORTED»,e.MissingSubstitutions=»MISSING_SUBSTITUTIONS»,e.MissingPersonalizationDataAttributes=»MISSING_PERSONALIZATION_DATA_ATTRIBUTES»,e.FlickerDefenseRedisplayElapsed=»FLICKER_DEFENSE_REDISPLAY_ELAPSED»,e))(fe||{});class oe extends se{}var j=(e=>(e.DuplicateTransformer=»DUPLICATE_TRANSFORMER»,e.InvalidHandlebarsHelperName=»INVALID_HANDLEBARS_HELPER_NAME»,e.InvalidHandlebarsHelperFunction=»INVALID_HANDLEBARS_HELPER_FUNCTION»,e.InvalidLastModifiedDate=»INVALID_LAST_MODIFIED_DATE»,e.InvalidPublishedDate=»INVALID_PUBLISHED_DATE»,e.InvalidSubstitutionConfigType=»INVALID_SUBSTITUTION_CONFIG_TYPE»,e.InvalidSubstitutionDefinitionConfigDataType=»INVALID_SUBSTITUTION_DEFINITION_CONFIG_DATA_TYPE»,e.InvalidSubstitutionDefinitionConfigType=»INVALID_SUBSTITUTION_DEFINITION_CONFIG_TYPE»,e.InvalidSubstitutionDefinitionDescription=»INVALID_SUBSTITUTION_DEFINITION_DESCRIPTION»,e.InvalidSubstitutionDefinitionLabel=»INVALID_SUBSTITUTION_DEFINITION_LABEL»,e.InvalidSubstitutionDefinitions=»INVALID_SUBSTITUTION_DEFINITIONS»,e.InvalidSubstitutionDefinitionValue=»INVALID_SUBSTITUTION_DEFINITION_VALUE»,e.InvalidTransformerCategory=»INVALID_TRANSFORMER_CATEGORY»,e.InvalidTransformerDescription=»INVALID_TRANSFORMER_DESCRIPTION»,e.InvalidTransformerLabel=»INVALID_TRANSFORMER_LABEL»,e.InvalidTransformerSchemaReference=»INVALID_TRANSFORMER_SCHEMA_REFERENCE»,e.InvalidTransformerType=»INVALID_TRANSFORMER_TYPE»,e.InvalidTransformerTypeDetails=»INVALID_TRANSFORMER_TYPE_DETAILS»,e.InvalidTransformerTypeDetailsType=»INVALID_TRANSFORMER_TYPE_DETAILS_TYPE»,e.InvalidTransformerTypeForCategory=»INVALID_TRANSFORMER_TYPE_FOR_CATEGORY»,e.MissingImplementation=»MISSING_IMPLEMENTATION»,e.MissingTransformer=»MISSING_TRANSFORMER»,e.MissingTransformerName=»MISSING_TRANSFORMER_NAME»,e.MissingTransformerSubstitutionDefinition=»MISSING_TRANSFORMER_SUBSTITUTION_DEFINITION»,e.MissingTransformerSubstitutionDefinitionKey=»MISSING_TRANSFORMER_SUBSTITUTION_DEFINITION_KEY»,e.MissingTransformerTypeDetails=»MISSING_TRANSFORMER_TYPE_DETAILS»,e.MissingTransformerTypeDetailsHtml=»MISSING_TRANSFORMER_TYPE_DETAILS_HTML»,e))(j||{});class B extends se{}var R=(e=>(e.ContentZonesNotAvailable=»CONTENT_ZONES_NOT_AVAILABLE»,e.DisabledTransformer=»TRANSFORMER_IS_DISABLED»,e.DuplicatePersonalizationExperienceConfig=»DUPLICATE_PERSONALIZATION_EXPERIENCE_CONFIG»,e.EngagementDestinationsNotAvailable=»ENGAGEMENT_DESTINATIONS_NOT_AVAILABLE»,e.InvalidDataProviderDataSpaceReferenceType=»INVALID_DATA_PROVIDER_DATA_SPACE_REFERENCE_TYPE»,e.InvalidDataProviderGroupByReferenceType=»INVALID_DATA_PROVIDER_GROUP_BY_REFERENCE_TYPE»,e.InvalidDataProviderGroupByType=»INVALID_DATA_PROVIDER_GROUP_BY_TYPE»,e.InvalidDataProviderReferenceType=»INVALID_DATA_PROVIDER_REFERENCE_TYPE»,e.InvalidDataProviderType=»INVALID_DATA_PROVIDER_TYPE»,e.InvalidDescription=»INVALID_DESCRIPTION»,e.InvalidLabel=»INVALID_LABEL»,e.InvalidLastModifiedDate=»INVALID_LAST_MODIFIED_DATE»,e.InvalidPublishedDate=»INVALID_PUBLISHED_DATE»,e.InvalidRenderIfEmpty=»INVALID_RENDER_IF_EMPTY»,e.InvalidSourceMatchers=»INVALID_SOURCE_MATCHERS»,e.InvalidSourceMatcherType=»INVALID_SOURCE_MATCHER_TYPE»,e.InvalidSourceMatcherValueOnlyStar=»INVALID_SOURCE_MATCHER_ONLY_STAR»,e.InvalidSourceMatcherValueRepeatedStars=»INVALID_SOURCE_MATCHER_REPEATED_STARS»,e.InvalidSourceMatcherValueSpaceWithStars=»INVALID_SOURCE_MATCHER_SPACE_WITH_STARS»,e.InvalidTransformationConfigEngagementDestination=»INVALID_TRANSFORMATION_CONFIG_ENGAGEMENT_DESTINATION»,e.InvalidTransformationConfigEngagementDestinationName=»INVALID_TRANSFORMATION_CONFIG_ENGAGEMENT_DESTINATION_NAME»,e.InvalidTransformationConfigMethod=»INVALID_TRANSFORMATION_CONFIG_METHOD»,e.InvalidTransformationConfigWhen=»INVALID_TRANSFORMATION_CONFIG_WHEN»,e.InvalidTransformationConfigWhenTypes=»INVALID_TRANSFORMATION_CONFIG_WHEN_TYPES»,e.InvalidTransformationContentZone=»INVALID_TRANSFORMATION_CONTENT_ZONE»,e.InvalidTransformations=»INVALID_TRANSFORMATIONS»,e.InvalidTransformationSubstitutionValue=»INVALID_TRANSFORMATION_SUBSTITUTION_VALUE»,e.InvalidTransformationSubstitutionValues=»INVALID_TRANSFORMATION_SUBSTITUTION_VALUES»,e.InvalidTransformationSubstitutionValueType=»INVALID_TRANSFORMATION_SUBSTITUTION_VALUE_TYPE»,e.InvalidTransformationType=»INVALID_TRANSFORMATION_TYPE»,e.InvalidTransformerName=»INVALID_TRANSFORMER_NAME»,e.InvalidWhenValueDelay=»INVALID_WHEN_VALUE_DELAY»,e.InvalidWhenValuePath=»INVALID_WHEN_VALUE_PATH»,e.InvalidWhenValuePercent=»INVALID_WHEN_VALUE_PERCENT»,e.InvalidWhenValueTag=»INVALID_WHEN_VALUE_TAG»,e.MethodRequiresSpecificTransformations=»METHOD_REQUIRES_SPECIFIC_TRANSFORMATIONS»,e.MissingConfig=»MISSING_CONFIG»,e.MissingDataGroupByValue=»MISSING_DATA_PROVIDER_GROUP_BY_VALUE»,e.MissingDataProvider=»MISSING_DATA_PROVIDER»,e.MissingDataProviderValue=»MISSING_DATA_PROVIDER_VALUE»,e.MissingDataSpaceValue=»MISSING_DATA_SPACE_VALUE»,e.MissingEngagementConfig=» MISSING_ENGAGEMENT_CONFIG»,e.MissingEngagementConfigDefaults=» MISSING_ENGAGEMENT_CONFIG_DEFAULTS»,e.MissingEngagementConfigGlobalDefault=» MISSING_ENGAGEMENT_CONFIG_GLOBAL_DEFAULT»,e.MissingName=»MISSING_NAME»,e.MissingSourceMatchers=»MISSING_SOURCE_MATCHERS»,e.MissingSourceMatcherValue=»MISSING_SOURCE_MATCHER_VALUE»,e.MissingSubstitutionDefinitionDefaultValue=»MISSING_SUBSTITUTION_DEFINITION_DEFAULT_VALUE»,e.MissingTransformation=»MISSING_TRANSFORMATION»,e.MissingTransformationConfig=»MISSING_TRANSFORMATION_CONFIG»,e.MissingTransformationConfigMethod=»MISSING_TRANSFORMATION_CONFIG_METHOD»,e.MissingTransformationName=»MISSING_TRANSFORMATION_NAME»,e.MissingTransformationPath=»MISSING_TRANSFORMATION_PATH»,e.MissingTransformationSubstitutionValues=»MISSING_TRANSFORMATION_SUBSTITUTION_VALUES»,e.MissingTransformationTag=»MISSING_TRANSFORMATION_TAG»,e.MissingTransformerName=»MISSING_TRANSFORMER_NAME»,e.PaddedSourceMatcherValue=»PADDED_SOURCE_MATCHER_VALUE»,e.SubstitutionDefinitionKeyNotSupported=»SUBSTITUTION_DEFINITION_KEY_NOT_SUPPORTED»,e.TransformerDoesNotSupportSubstitutionValues=»TRANSFORMER_DOES_NOT_SUPPORT_SUBSTITUTION_VALUES»,e.TransformationConfigMethodNotSupported=»TRANSFORMATION_CONFIG_METHOD_NOT_SUPPORTED»,e.TransformationNameNotSupported=»TRANSFORMATION_NAME_NOT_SUPPORTED»,e.TransformationPathNotSupported=»TRANSFORMATION_PATH_NOT_SUPPORTED»,e.TransformationTagNotSupported=»TRANSFORMATION_TAG_NOT_SUPPORTED»,e.TransformersNotAvailable=»TRANSFORMATIONS_NOT_AVAILABLE»,e.UnexpectedError=»UNEXPECTED_ERROR»,e.WhenValuesNotSupported=»WHEN_VALUES_NOT_SUPPORTED»,e.WhenValuesValidationLogicNotImplemented=»WHEN_VALUES_VALIDATION_LOGIC_NOT_IMPLEMENTED»,e.WhenTypeRequiresSpecificMethodType=»WHEN_TYPE_REQUIRES_SPECIFIC_METHOD_TYPE»,e))(R||{});class M extends se{}var Et=(e=>(e.MissingPersonalizationExperienceConfig=»MISSING_PERSONALIZATION_EXPERIENCE_CONFIG»,e.DuplicatePersonalizationExperienceConfigs=»DUPLICATE_PERSONALIZATION_EXPERIENCE_CONFIGS»,e.PointOptionsNotValid=»POINT_OPTIONS_NOT_VALID»,e.PointOptionKeyInvalid=»POINT_OPTION_KEY_INVALID»,e))(Et||{});class Vt extends se{}var to=(e=>(e.OnlySupportConfiguredDataSpace=»ONLY_SUPPORT_CONFIGURED_DATA_SPACE»,e.OnlySupportDataProviderApiName=»ONLY_SUPPORT_DATA_PROVIDER_API_NAME»,e.OnlySupportDataSpaceApiName=»ONLY_SUPPORT_DATA_SPACE_API_NAME»,e.OnlySupportPersonalizationPoint=»ONLY_SUPPORT_PERSONALIZATION_POINT»,e))(to||{});class Pl extends se{}var De=(e=>(e.AddingClickListenerError=»ADDING_CLICK_LISTENER_ERROR»,e.DisplayUtilsPageExitError=»DISPLAY_UTILS_PAGE_EXIT_ERROR»,e.DisplayUtilsPageScrollError=»DISPLAY_UTILS_PAGE_SCROLL_ERROR»,e.NotWaitingForElementClick=»NOT_WAITING_FOR_ELEMENT_CLICK»,e.NotWaitingForElementPath=»NOT_WAITING_FOR_ELEMENT_PATH»,e.NotWaitingForPageExit=»NOT_WAITING_FOR_PAGE_EXIT»,e.NotWaitingForPageScroll=»NOT_WAITING_FOR_PAGE_SCROLL»,e))(De||{});class Ge extends se{}var pe=(e=>(e.InvalidAllowedElements=»INVALID_ALLOWED_ELEMENTS»,e.InvalidAllowedElementKey=»INVALID_ALLOWED_ELEMENT_KEY»,e.InvalidAllowedProperties=»INVALID_ALLOWED_PROPERTIES»,e.InvalidAllowedTargetMethodTypeMethod=»INVALID_ALLOWED_TARGET_METHOD_TYPE_METHOD»,e.InvalidAllowedTargetMethodTypes=»INVALID_ALLOWED_TARGET_METHOD_TYPES»,e.InvalidAllowedTransformers=»INVALID_ALLOWED_TRANSFORMERS»,e.InvalidConfig=»INVALID_CONFIG»,e.InvalidConfigOptions=»INVALID_CONFIG_OPTIONS»,e))(pe||{});class ye extends se{}var lt=(e=>(e.ConfigIsRequired=»CONFIG_IS_REQUIRED»,e.TransformersAreRequired=»TRANSFORMERS_ARE_REQUIRED»,e.WpmConfigIsRequired=»WPM_CONFIG_IS_REQUIRED»,e))(lt||{});class yt extends se{}var Ie=(e=>(e.MethodIsRequired=»METHOD_IS_REQUIRED»,e.MethodNotAllowed=»METHOD_NOT_ALLOWED»,e.OnlyElementsSupported=»ONLY_TARGET_ELEMENTS_ARE_SUPPORTED»,e.OneSourceMatcherSupported=»ONE_SOURCE_MATCHER_IS_SUPPORTED»,e.OneTransformerSupported=»ONE_TRANSFORMER_IS_SUPPORTED»,e.PropertyNotAllowed=»PROPERTY_NOT_ALLOWED»,e.SubstitutionValuesNotAllowed=»SUBSTITUTION_VALUES_NOT_ALLOWED»,e.TagsNotAllowed=»TAGS_NOT_ALLOWED»,e.TransformersAreDisabled=»TRANSFORMERS_ARE_DISABLED»,e))(Ie||{});class Me extends se{}var q=(e=>(e.DestinationEventModifiersAreRequired=»DESTINATION_EVENT_MODIFIERS_ARE_REQUIRED»,e.EngagementDestinationsAreRequired=»ENGAGEMENT_DESTINATIONS_ARE_REQUIRED»,e.EngagementDestinationDefaultsAreRequired=»ENGAGEMENT_DESTINATION_DEFAULTS_ARE_REQUIRED»,e.InvalidConfig=»INVALID_CONFIG»,e.InvalidDestinationEventModifier=»INVALID_DESTINATION_EVENT_MODIFIER»,e.InvalidEngagementDestinationDefaultByName=»INVALID_ENGAGEMENT_DESTINATION_DEFAULT_BY_NAME»,e.InvalidEngagementDestinationDefaultByNameValue=»INVALID_ENGAGEMENT_DESTINATION_DEFAULT_BY_NAME_VALUE»,e.InvalidEngagementDestinationDefaultByType=»INVALID_ENGAGEMENT_DESTINATION_DEFAULT_BY_TYPE»,e.InvalidEngagementDestinationDefaultByTypeValue=»INVALID_ENGAGEMENT_DESTINATION_DEFAULT_BY_TYPE_VALUE»,e.InvalidEngagementDestinationDefaultGlobal=»INVALID_ENGAGEMENT_DESTINATION_DEFAULT_GLOBAL»,e.InvalidEngagementDestinationDescription=»INVALID_ENGAGEMENT_DESTINATION_DESCRIPTION»,e.InvalidEngagementDestinationAttributeDescription=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTE_DESCRIPTION»,e.InvalidEngagementDestinationAttributeEngagements=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTE_ENGAGEMENTS»,e.InvalidEngagementDestinationAttributeEngagementHandle=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTE_ENGAGEMENT_HANDLE»,e.InvalidEngagementDestinationAttributeEngagementObserve=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTE_ENGAGEMENT_OBSERVE»,e.InvalidEngagementDestinationAttributeEngagementQualify=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTE_ENGAGEMENT_QUALIFY»,e.InvalidEngagementDestinationAttributeEngagementValue=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTE_ENGAGEMENT_VALUE»,e.InvalidEngagementDestinationAttributeEventModifierModifyEvent=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTE_EVENT_MODIFIER_MODIFY_EVENT»,e.InvalidEngagementDestinationAttributeEventModifiers=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTE_EVENT_MODIFIERS»,e.InvalidEngagementDestinationAttributeEventModifiersValue=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTE_EVENT_MODIFIERS_VALUE»,e.InvalidEngagementDestinationAttributeEventModifierValueDefault=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTE_EVENT_MODIFIER_VALUE_DEFAULT»,e.InvalidEngagementDestinationAttributeEventModifierValueType=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTE_EVENT_MODIFIER_VALUE_TYPE»,e.InvalidEngagementDestinationAttributes=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTES»,e.InvalidEngagementDestinationAttributeScope=»INVALID_ENGAGEMENT_DESTINATION_ATTRIBUTE_SCOPE»,e.MissingEngagementDestinationAttributeEngagementHandle=»MISSING_ENGAGEMENT_DESTINATION_ATTRIBUTE_ENGAGEMENT_HANDLE»,e.MissingEngagementDestinationAttributeEngagementObserve=»MISSING_ENGAGEMENT_DESTINATION_ATTRIBUTE_ENGAGEMENT_OBSERVE»,e.MissingEngagementDestinationAttributeEngagementQualify=»MISSING_ENGAGEMENT_DESTINATION_ATTRIBUTE_ENGAGEMENT_QUALIFY»,e.MissingEngagementDestinationAttributeEventModifierModifyEvent=»MISSING_ENGAGEMENT_DESTINATION_ATTRIBUTE_EVENT_MODIFIER_MODIFY_EVENT»,e))(q||{});class Y extends se{}var je=(e=>(e.InvalidContentZoneHandlerName=»INVALID_CONTENT_ZONE_HANDLER_NAME»,e.InvalidContentZoneHandlerProperties=»INVALID_CONTENT_ZONE_HANDLER_PROPERTIES»,e.InvalidContentZoneHandlerProperty=»INVALID_CONTENT_ZONE_HANDLER_PROPERTY»,e))(je||{});class tt extends se{}class or extends Error{constructor(t){super(t),this.name=this.constructor.name}}function Nl(e){return N(e)&&»message»in e&&typeof e.message==»string»}function K(e){if(e instanceof se)return{message:e.getMessageWithContext()};if(Nl(e))return e;if(b(e))return{message:e};try{return new Error(JSON.stringify(e))}catch(t){return new Error(String(e))}}const Ol=»personalization/decisions»;var Dl=Object.defineProperty,no=Object.getOwnPropertySymbols,Ml=Object.prototype.hasOwnProperty,Rl=Object.prototype.propertyIsEnumerable,ro=(e,t,n)=>t in e?Dl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,io=(e,t)=>{for(var n in t||(t={}))Ml.call(t,n)&&ro(e,n,t[n]);if(no)for(var n of no(t))Rl.call(t,n)&&ro(e,n,t[n]);return e};let vn,ar,oo=»»,_t={};function sr(){return vn!=null?vn:»»}function Ll(){return ar!=null?ar:»»}function xl(){return _t}function lr(){var e;return(e=_t==null?void 0:_t.dataspace)!=null?e:»»}function En(){return oo}function kl(){document.addEventListener(P.CustomEvents.OnBeforeInit,e=>{var t;const n=e==null?void 0:e.detail.sdkConfig;n!==void 0&&(_t=io(io({},_t),(t=n.personalization)!=null?t:{}),e.detail.sdkConfig.personalization=_t)})}function Ul(){document.addEventListener(P.CustomEvents.OnInit,e=>{var t,n,r;const i=(n=(t=e==null?void 0:e.detail)==null?void 0:t.sdkConfig)==null?void 0:n.dataCloud;if(D(i)){P.log.warn(«OnInit did not include Data Cloud config»);return}if(!b(i.tenantSpecificEndpoint))P.log.warn(«Tenant Specific Endpoint URL was not provided in Data Cloud config»);else try{vn=new URL(Ol,i.tenantSpecificEndpoint).toString()}catch(o){P.log.warn(`Tenant Specific Endpoint URL is not valid: ${i.tenantSpecificEndpoint}`)}!N(i.authenticator)||!b(i.authenticator.appSourceId)?P.log.warn(«App Source Id was not provided in Data Cloud config»):ar=i.authenticator.appSourceId,N(document.currentScript)&&(oo=(r=document.currentScript.nonce)!=null?r:»»)})}function ao(e){if(e===void 0){if(!b(vn))throw new he(ce.InitRequiresTSE,»Tenant Specific Endpoint URL must be set by calling SalesforceInteractions.init.»)}else if(!b(e))throw new he(ce.EndpointOverrideNotValid,»Endpoint URL must be a valid string if provided.»)}function nt(){return!b(sr())}var rt=(e=>(e.EmbeddedContent=»EmbeddedContent»,e.Agent=»Agent»,e))(rt||{}),ge=(e=>(e.HtmlElementModifier=»HTMLElementModifier»,e.Handlebars=»Handlebars»,e.AgentScript=»AgentScript»,e))(ge||{});const Hl={EmbeddedContent:{supportedTypes:[«HTMLElementModifier»,»Handlebars»]},Agent:{supportedTypes:[«AgentScript»]}};var yn=(e=>(e.String=»String»,e))(yn||{}),Re=(e=>(e.SchemaPath=»SchemaPath»,e.Static=»Static»,e))(Re||{}),ur=(e=>(e.PersonalizationPoint=»PersonalizationPoint»,e))(ur||{}),so=(e=>(e.ApiName=»ApiName»,e))(so||{}),lo=(e=>(e.DataGraph=»DataGraph»,e))(lo||{}),Ae=(e=>(e.Immediately=»Immediately»,e.ExitIntent=»ExitIntent»,e.ElementClick=»ElementClick»,e.ScrollPercent=»ScrollPercent»,e))(Ae||{}),$=(e=>(e.ReplaceContentZoneContent=»ReplaceContentZoneContent»,e.ReplaceElementContent=»ReplaceElementContent»,e.AddAfterElement=»AddAfterElement»,e.AddBeforeElement=»AddBeforeElement»,e.AddOverlay=»AddOverlay»,e.ContentZoneHandler=»ContentZoneHandler»,e))($||{});function Tt(e){return e!==void 0&&e===»AddOverlay»}function it(e){return(e==null?void 0:e.tag)!==void 0}function Bt(e){return(e==null?void 0:e.name)!==void 0}function _n(e,t){return Bt(e)&&t!==void 0&&t===»ReplaceContentZoneContent»}function cr(e,t){return Bt(e)&&t!==void 0&&t===»ContentZoneHandler»}function uo(e){return e===ge.AgentScript}function co(e){return(e==null?void 0:e.path)!==void 0}function fo(e){return(e==null?void 0:e.percent)!==void 0}function ho(e){return(e==null?void 0:e.delay)!==void 0}function Tn(e){return D(e)||e===»PersonalizationPoint»}const Fl=»_unknown_»;/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:po,setPrototypeOf:go,isFrozen:zl,getPrototypeOf:Vl,getOwnPropertyDescriptor:Bl}=Object;let{freeze:me,seal:be,create:fr}=Object,{apply:dr,construct:hr}=typeof Reflect!=»undefined»&&Reflect;me||(me=function(t){return t}),be||(be=function(t){return t}),dr||(dr=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o1?n-1:0),i=1;i1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:wn;go&&go(e,null);let r=t.length;for(;r–;){let i=t[r];if(typeof i==»string»){const o=n(i);o!==i&&(zl(t)||(t[r]=o),i=o)}e[i]=!0}return e}function Yl(e){for(let t=0;t/gm),Jl=be(/\$\{[\w\W]*/gm),eu=be(/^data-[\-\w.\u00B7-\uFFFF]+$/),tu=be(/^aria-[\-\w]+$/),To=be(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nu=be(/^(?:\w+script|data):/i),ru=be(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bo=be(/^html$/i),iu=be(/^[a-z][.\w]*(-[.\w]+)+$/i);var wo=Object.freeze({__proto__:null,ARIA_ATTR:tu,ATTR_WHITESPACE:ru,CUSTOM_ELEMENT:iu,DATA_ATTR:eu,DOCTYPE_NAME:bo,ERB_EXPR:Ql,IS_ALLOWED_URI:To,IS_SCRIPT_OR_DATA:nu,MUSTACHE_EXPR:Xl,TMPLIT_EXPR:Jl});const $t={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ou=function(){return typeof window==»undefined»?null:window},au=function(t,n){if(typeof t!=»object»||typeof t.createPolicy!=»function»)return null;let r=null;const i=»data-tt-policy-suffix»;n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o=»dompurify»+(r?»#»+r:»»);try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch(s){return console.warn(«TrustedTypes policy «+o+» could not be created.»),null}},So=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Io(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ou();const t=x=>Io(x);if(t.version=»3.3.1″,t.removed=[],!e||!e.document||e.document.nodeType!==$t.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:l,Element:a,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:c,trustedTypes:h}=e,d=a.prototype,g=qt(d,»cloneNode»),E=qt(d,»remove»),w=qt(d,»nextSibling»),_=qt(d,»childNodes»),I=qt(d,»parentNode»);if(typeof s==»function»){const x=n.createElement(«template»);x.content&&x.content.ownerDocument&&(n=x.content.ownerDocument)}let m,T=»»;const{implementation:O,createNodeIterator:A,createDocumentFragment:U,getElementsByTagName:Q}=n,{importNode:W}=r;let V=So();t.isSupported=typeof po==»function»&&typeof I==»function»&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Fe,ERB_EXPR:ze,TMPLIT_EXPR:Li,DATA_ATTR:fg,ARIA_ATTR:dg,IS_SCRIPT_OR_DATA:hg,ATTR_WHITESPACE:Ws,CUSTOM_ELEMENT:pg}=wo;let{IS_ALLOWED_URI:qs}=wo,ae=null;const $s=F({},[…vo,…mr,…vr,…Er,…Eo]);let le=null;const Ys=F({},[…yo,…yr,…_o,…Sn]);let ne=Object.seal(fr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),dn=null,xi=null;const Dt=Object.seal(fr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Zs=!0,ki=!0,Ks=!1,Xs=!0,Mt=!1,$n=!0,gt=!1,Ui=!1,Hi=!1,Rt=!1,Yn=!1,Zn=!1,Qs=!0,Js=!1;const gg=»user-content-«;let Fi=!0,hn=!1,Lt={},Ve=null;const zi=F({},[«annotation-xml»,»audio»,»colgroup»,»desc»,»foreignobject»,»head»,»iframe»,»math»,»mi»,»mn»,»mo»,»ms»,»mtext»,»noembed»,»noframes»,»noscript»,»plaintext»,»script»,»style»,»svg»,»template»,»thead»,»title»,»video»,»xmp»]);let el=null;const tl=F({},[«audio»,»video»,»img»,»source»,»image»,»track»]);let Vi=null;const nl=F({},[«alt»,»class»,»for»,»id»,»label»,»name»,»pattern»,»placeholder»,»role»,»summary»,»title»,»value»,»style»,»xmlns»]),Kn=»http://www.w3.org/1998/Math/MathML»,Xn=»http://www.w3.org/2000/svg»,Xe=»http://www.w3.org/1999/xhtml»;let xt=Xe,Bi=!1,Gi=null;const mg=F({},[Kn,Xn,Xe],pr);let Qn=F({},[«mi»,»mo»,»mn»,»ms»,»mtext»]),Jn=F({},[«annotation-xml»]);const vg=F({},[«title»,»style»,»font»,»a»,»script»]);let pn=null;const Eg=[«application/xhtml+xml»,»text/html»],yg=»text/html»;let ie=null,kt=null;const _g=n.createElement(«form»),rl=function(v){return v instanceof RegExp||v instanceof Function},ji=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(kt&&kt===v)){if((!v||typeof v!=»object»)&&(v={}),v=Le(v),pn=Eg.indexOf(v.PARSER_MEDIA_TYPE)===-1?yg:v.PARSER_MEDIA_TYPE,ie=pn===»application/xhtml+xml»?pr:wn,ae=Ce(v,»ALLOWED_TAGS»)?F({},v.ALLOWED_TAGS,ie):$s,le=Ce(v,»ALLOWED_ATTR»)?F({},v.ALLOWED_ATTR,ie):Ys,Gi=Ce(v,»ALLOWED_NAMESPACES»)?F({},v.ALLOWED_NAMESPACES,pr):mg,Vi=Ce(v,»ADD_URI_SAFE_ATTR»)?F(Le(nl),v.ADD_URI_SAFE_ATTR,ie):nl,el=Ce(v,»ADD_DATA_URI_TAGS»)?F(Le(tl),v.ADD_DATA_URI_TAGS,ie):tl,Ve=Ce(v,»FORBID_CONTENTS»)?F({},v.FORBID_CONTENTS,ie):zi,dn=Ce(v,»FORBID_TAGS»)?F({},v.FORBID_TAGS,ie):Le({}),xi=Ce(v,»FORBID_ATTR»)?F({},v.FORBID_ATTR,ie):Le({}),Lt=Ce(v,»USE_PROFILES»)?v.USE_PROFILES:!1,Zs=v.ALLOW_ARIA_ATTR!==!1,ki=v.ALLOW_DATA_ATTR!==!1,Ks=v.ALLOW_UNKNOWN_PROTOCOLS||!1,Xs=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Mt=v.SAFE_FOR_TEMPLATES||!1,$n=v.SAFE_FOR_XML!==!1,gt=v.WHOLE_DOCUMENT||!1,Rt=v.RETURN_DOM||!1,Yn=v.RETURN_DOM_FRAGMENT||!1,Zn=v.RETURN_TRUSTED_TYPE||!1,Hi=v.FORCE_BODY||!1,Qs=v.SANITIZE_DOM!==!1,Js=v.SANITIZE_NAMED_PROPS||!1,Fi=v.KEEP_CONTENT!==!1,hn=v.IN_PLACE||!1,qs=v.ALLOWED_URI_REGEXP||To,xt=v.NAMESPACE||Xe,Qn=v.MATHML_TEXT_INTEGRATION_POINTS||Qn,Jn=v.HTML_INTEGRATION_POINTS||Jn,ne=v.CUSTOM_ELEMENT_HANDLING||{},v.CUSTOM_ELEMENT_HANDLING&&rl(v.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ne.tagNameCheck=v.CUSTOM_ELEMENT_HANDLING.tagNameCheck),v.CUSTOM_ELEMENT_HANDLING&&rl(v.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ne.attributeNameCheck=v.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),v.CUSTOM_ELEMENT_HANDLING&&typeof v.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==»boolean»&&(ne.allowCustomizedBuiltInElements=v.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Mt&&(ki=!1),Yn&&(Rt=!0),Lt&&(ae=F({},Eo),le=[],Lt.html===!0&&(F(ae,vo),F(le,yo)),Lt.svg===!0&&(F(ae,mr),F(le,yr),F(le,Sn)),Lt.svgFilters===!0&&(F(ae,vr),F(le,yr),F(le,Sn)),Lt.mathMl===!0&&(F(ae,Er),F(le,_o),F(le,Sn))),v.ADD_TAGS&&(typeof v.ADD_TAGS==»function»?Dt.tagCheck=v.ADD_TAGS:(ae===$s&&(ae=Le(ae)),F(ae,v.ADD_TAGS,ie))),v.ADD_ATTR&&(typeof v.ADD_ATTR==»function»?Dt.attributeCheck=v.ADD_ATTR:(le===Ys&&(le=Le(le)),F(le,v.ADD_ATTR,ie))),v.ADD_URI_SAFE_ATTR&&F(Vi,v.ADD_URI_SAFE_ATTR,ie),v.FORBID_CONTENTS&&(Ve===zi&&(Ve=Le(Ve)),F(Ve,v.FORBID_CONTENTS,ie)),v.ADD_FORBID_CONTENTS&&(Ve===zi&&(Ve=Le(Ve)),F(Ve,v.ADD_FORBID_CONTENTS,ie)),Fi&&(ae[«#text»]=!0),gt&&F(ae,[«html»,»head»,»body»]),ae.table&&(F(ae,[«tbody»]),delete dn.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!=»function»)throw Wt(‘TRUSTED_TYPES_POLICY configuration option must provide a «createHTML» hook.’);if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!=»function»)throw Wt(‘TRUSTED_TYPES_POLICY configuration option must provide a «createScriptURL» hook.’);m=v.TRUSTED_TYPES_POLICY,T=m.createHTML(«»)}else m===void 0&&(m=au(h,i)),m!==null&&typeof T==»string»&&(T=m.createHTML(«»));me&&me(v),kt=v}},il=F({},[…mr,…vr,…Zl]),ol=F({},[…Er,…Kl]),Tg=function(v){let C=I(v);(!C||!C.tagName)&&(C={namespaceURI:xt,tagName:»template»});const L=wn(v.tagName),ee=wn(C.tagName);return Gi[v.namespaceURI]?v.namespaceURI===Xn?C.namespaceURI===Xe?L===»svg»:C.namespaceURI===Kn?L===»svg»&&(ee===»annotation-xml»||Qn[ee]):!!il[L]:v.namespaceURI===Kn?C.namespaceURI===Xe?L===»math»:C.namespaceURI===Xn?L===»math»&&Jn[ee]:!!ol[L]:v.namespaceURI===Xe?C.namespaceURI===Xn&&!Jn[ee]||C.namespaceURI===Kn&&!Qn[ee]?!1:!ol[L]&&(vg[L]||!il[L]):!!(pn===»application/xhtml+xml»&&Gi[v.namespaceURI]):!1},Be=function(v){Gt(t.removed,{element:v});try{I(v).removeChild(v)}catch(C){E(v)}},mt=function(v,C){try{Gt(t.removed,{attribute:C.getAttributeNode(v),from:C})}catch(L){Gt(t.removed,{attribute:null,from:C})}if(C.removeAttribute(v),v===»is»)if(Rt||Yn)try{Be(C)}catch(L){}else try{C.setAttribute(v,»»)}catch(L){}},al=function(v){let C=null,L=null;if(Hi)v=»«+v;else{const re=gr(v,/^[\r\n\t ]+/);L=re&&re[0]}pn===»application/xhtml+xml»&&xt===Xe&&(v=’‘+v+»«);const ee=m?m.createHTML(v):v;if(xt===Xe)try{C=new c().parseFromString(ee,pn)}catch(re){}if(!C||!C.documentElement){C=O.createDocument(xt,»template»,null);try{C.documentElement.innerHTML=Bi?T:ee}catch(re){}}const de=C.body||C.documentElement;return v&&L&&de.insertBefore(n.createTextNode(L),de.childNodes[0]||null),xt===Xe?Q.call(C,gt?»html»:»body»)[0]:gt?C.documentElement:de},sl=function(v){return A.call(v.ownerDocument||v,v,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Wi=function(v){return v instanceof p&&(typeof v.nodeName!=»string»||typeof v.textContent!=»string»||typeof v.removeChild!=»function»||!(v.attributes instanceof f)||typeof v.removeAttribute!=»function»||typeof v.setAttribute!=»function»||typeof v.namespaceURI!=»string»||typeof v.insertBefore!=»function»||typeof v.hasChildNodes!=»function»)},ll=function(v){return typeof l==»function»&&v instanceof l};function Qe(x,v,C){bn(x,L=>{L.call(t,v,C,kt)})}const ul=function(v){let C=null;if(Qe(V.beforeSanitizeElements,v,null),Wi(v))return Be(v),!0;const L=ie(v.nodeName);if(Qe(V.uponSanitizeElement,v,{tagName:L,allowedTags:ae}),$n&&v.hasChildNodes()&&!ll(v.firstElementChild)&&ve(/<[/\w!]/g,v.innerHTML)&&ve(/<[/\w!]/g,v.textContent)||v.nodeType===$t.progressingInstruction||$n&&v.nodeType===$t.comment&&ve(/<[/\w]/g,v.data))return Be(v),!0;if(!(Dt.tagCheck instanceof Function&&Dt.tagCheck(L))&&(!ae[L]||dn[L])){if(!dn[L]&&fl(L)&&(ne.tagNameCheck instanceof RegExp&&ve(ne.tagNameCheck,L)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(L)))return!1;if(Fi&&!Ve[L]){const ee=I(v)||v.parentNode,de=_(v)||v.childNodes;if(de&&ee){const re=de.length;for(let _e=re-1;_e>=0;–_e){const Je=g(de[_e],!0);Je.__removalCount=(v.__removalCount||0)+1,ee.insertBefore(Je,w(v))}}}return Be(v),!0}return v instanceof a&&!Tg(v)||(L===»noscript»||L===»noembed»||L===»noframes»)&&ve(/<\/no(script|embed|frames)/i,v.innerHTML)?(Be(v),!0):(Mt&&v.nodeType===$t.text&&(C=v.textContent,bn([Fe,ze,Li],ee=>{C=jt(C,ee,» «)}),v.textContent!==C&&(Gt(t.removed,{element:v.cloneNode()}),v.textContent=C)),Qe(V.afterSanitizeElements,v,null),!1)},cl=function(v,C,L){if(Qs&&(C===»id»||C===»name»)&&(L in n||L in _g))return!1;if(!(ki&&!xi[C]&&ve(fg,C))){if(!(Zs&&ve(dg,C))){if(!(Dt.attributeCheck instanceof Function&&Dt.attributeCheck(C,v))){if(!le[C]||xi[C]){if(!(fl(v)&&(ne.tagNameCheck instanceof RegExp&&ve(ne.tagNameCheck,v)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(v))&&(ne.attributeNameCheck instanceof RegExp&&ve(ne.attributeNameCheck,C)||ne.attributeNameCheck instanceof Function&&ne.attributeNameCheck(C,v))||C===»is»&&ne.allowCustomizedBuiltInElements&&(ne.tagNameCheck instanceof RegExp&&ve(ne.tagNameCheck,L)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(L))))return!1}else if(!Vi[C]){if(!ve(qs,jt(L,Ws,»»))){if(!((C===»src»||C===»xlink:href»||C===»href»)&&v!==»script»&&Wl(L,»data:»)===0&&el[v])){if(!(Ks&&!ve(hg,jt(L,Ws,»»)))){if(L)return!1}}}}}}}return!0},fl=function(v){return v!==»annotation-xml»&&gr(v,pg)},dl=function(v){Qe(V.beforeSanitizeAttributes,v,null);const{attributes:C}=v;if(!C||Wi(v))return;const L={attrName:»»,attrValue:»»,keepAttr:!0,allowedAttributes:le,forceKeepAttr:void 0};let ee=C.length;for(;ee–;){const de=C[ee],{name:re,namespaceURI:_e,value:Je}=de,Ut=ie(re),qi=Je;let ue=re===»value»?qi:ql(qi);if(L.attrName=Ut,L.attrValue=ue,L.keepAttr=!0,L.forceKeepAttr=void 0,Qe(V.uponSanitizeAttribute,v,L),ue=L.attrValue,Js&&(Ut===»id»||Ut===»name»)&&(mt(re,v),ue=gg+ue),$n&&ve(/((–!?|])>)|<\/(style|title|textarea)/i,ue)){mt(re,v);continue}if(Ut==="attributename"&&gr(ue,"href")){mt(re,v);continue}if(L.forceKeepAttr)continue;if(!L.keepAttr){mt(re,v);continue}if(!Xs&&ve(/\/>/i,ue)){mt(re,v);continue}Mt&&bn([Fe,ze,Li],pl=>{ue=jt(ue,pl,» «)});const hl=ie(v.nodeName);if(!cl(hl,Ut,ue)){mt(re,v);continue}if(m&&typeof h==»object»&&typeof h.getAttributeType==»function»&&!_e)switch(h.getAttributeType(hl,Ut)){case»TrustedHTML»:{ue=m.createHTML(ue);break}case»TrustedScriptURL»:{ue=m.createScriptURL(ue);break}}if(ue!==qi)try{_e?v.setAttributeNS(_e,re,ue):v.setAttribute(re,ue),Wi(v)?Be(v):mo(t.removed)}catch(pl){mt(re,v)}}Qe(V.afterSanitizeAttributes,v,null)},bg=function x(v){let C=null;const L=sl(v);for(Qe(V.beforeSanitizeShadowDOM,v,null);C=L.nextNode();)Qe(V.uponSanitizeShadowNode,C,null),ul(C),dl(C),C.content instanceof o&&x(C.content);Qe(V.afterSanitizeShadowDOM,v,null)};return t.sanitize=function(x){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=null,L=null,ee=null,de=null;if(Bi=!x,Bi&&(x=»«),typeof x!=»string»&&!ll(x))if(typeof x.toString==»function»){if(x=x.toString(),typeof x!=»string»)throw Wt(«dirty is not a string, aborting»)}else throw Wt(«toString is not a function»);if(!t.isSupported)return x;if(Ui||ji(v),t.removed=[],typeof x==»string»&&(hn=!1),hn){if(x.nodeName){const Je=ie(x.nodeName);if(!ae[Je]||dn[Je])throw Wt(«root node is forbidden and cannot be sanitized in-place»)}}else if(x instanceof l)C=al(««),L=C.ownerDocument.importNode(x,!0),L.nodeType===$t.element&&L.nodeName===»BODY»||L.nodeName===»HTML»?C=L:C.appendChild(L);else{if(!Rt&&!Mt&&!gt&&x.indexOf(«<")===-1)return m&&Zn?m.createHTML(x):x;if(C=al(x),!C)return Rt?null:Zn?T:""}C&&Hi&&Be(C.firstChild);const re=sl(hn?x:C);for(;ee=re.nextNode();)ul(ee),dl(ee),ee.content instanceof o&&bg(ee.content);if(hn)return x;if(Rt){if(Yn)for(de=U.call(C.ownerDocument);C.firstChild;)de.appendChild(C.firstChild);else de=C;return(le.shadowroot||le.shadowrootmode)&&(de=W.call(r,de,!0)),de}let _e=gt?C.outerHTML:C.innerHTML;return gt&&ae["!doctype"]&&C.ownerDocument&&C.ownerDocument.doctype&&C.ownerDocument.doctype.name&&ve(bo,C.ownerDocument.doctype.name)&&(_e=" `+_e),Mt&&bn([Fe,ze,Li],Je=>{_e=jt(_e,Je,» «)}),m&&Zn?m.createHTML(_e):_e},t.setConfig=function(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ji(x),Ui=!0},t.clearConfig=function(){kt=null,Ui=!1},t.isValidAttribute=function(x,v,C){kt||ji({});const L=ie(x),ee=ie(v);return cl(L,ee,C)},t.addHook=function(x,v){typeof v==»function»&&Gt(V[x],v)},t.removeHook=function(x,v){if(v!==void 0){const C=Gl(V[x],v);return C===-1?void 0:jl(V[x],C,1)[0]}return mo(V[x])},t.removeHooks=function(x){V[x]=[]},t.removeAllHooks=function(){V=So()},t}var su=Io();class lu{sanitizeString(t){if(!b(t))return»»;try{return su.sanitize(t)}catch(n){return y.log.error(«could not verify that content was safe»,n),»»}}sanitizeObject(t){const n=H(t);if(!N(t)&&!n)if(b(t))try{return this.sanitizeString(String(t))}catch(r){return y.log.error(«could not verify that content was safe»,r),»»}else return t;if(n)return this.sanitizeArray(t);for(const r in t)N(t[r])?t[r]=this.sanitizeObject(t[r]):H(t[r])?t[r]=this.sanitizeArray(t[r]):J(t,r)&&(t[r]=this.sanitizeObject(t[r]));return t}sanitizeArray(t){if(!H(t))return[];for(let n=0;n(e.TransformerConfig=»TransformerConfig»,e.Element=»Element»,e.Any=»Any»,e))(ct||{}),Cn=(e=>(e.SchemaPath=»SchemaPath»,e))(Cn||{});class fu{add(t,n,r){if(typeof arguments[0]!=»string»)for(let i in arguments[0])this.add(i,arguments[0][i],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(i){this[i]=this[i]||[],n&&this[i][r?»unshift»:»push»](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(r){r.call(n&&n.context?n.context:n,n)})}}class du{constructor(t){this.jsep=t,this.registered={}}register(){for(var t=arguments.length,n=new Array(t),r=0;r{if(typeof i!=»object»||!i.name||!i.init)throw new Error(«Invalid JSEP plugin format»);this.registered[i.name]||(i.init(this.jsep),this.registered[i.name]=i)})}}class S{static get version(){return»1.4.0″}static toString(){return»JavaScript Expression Parser (JSEP) v»+S.version}static addUnaryOp(t){return S.max_unop_len=Math.max(t.length,S.max_unop_len),S.unary_ops[t]=1,S}static addBinaryOp(t,n,r){return S.max_binop_len=Math.max(t.length,S.max_binop_len),S.binary_ops[t]=n,r?S.right_associative.add(t):S.right_associative.delete(t),S}static addIdentifierChar(t){return S.additional_identifier_chars.add(t),S}static addLiteral(t,n){return S.literals[t]=n,S}static removeUnaryOp(t){return delete S.unary_ops[t],t.length===S.max_unop_len&&(S.max_unop_len=S.getMaxKeyLen(S.unary_ops)),S}static removeAllUnaryOps(){return S.unary_ops={},S.max_unop_len=0,S}static removeIdentifierChar(t){return S.additional_identifier_chars.delete(t),S}static removeBinaryOp(t){return delete S.binary_ops[t],t.length===S.max_binop_len&&(S.max_binop_len=S.getMaxKeyLen(S.binary_ops)),S.right_associative.delete(t),S}static removeAllBinaryOps(){return S.binary_ops={},S.max_binop_len=0,S}static removeLiteral(t){return delete S.literals[t],S}static removeAllLiterals(){return S.literals={},S}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new S(t).parse()}static getMaxKeyLen(t){return Math.max(0,…Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return S.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!S.binary_ops[String.fromCharCode(t)]||S.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return S.isIdentifierStart(t)||S.isDecimalDigit(t)}throwError(t){const n=new Error(t+» at character «+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(S.hooks[t]){const r={context:this,node:n};return S.hooks.run(t,r),r.node}return n}searchHook(t){if(S.hooks[t]){const n={context:this};return S.hooks[t].find(function(r){return r.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===S.SPACE_CODE||t===S.TAB_CODE||t===S.LF_CODE||t===S.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook(«gobble-spaces»)}parse(){this.runHook(«before-all»);const t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:S.COMPOUND,body:t};return this.runHook(«after-all»,n)}gobbleExpressions(t){let n=[],r,i;for(;this.index0;){if(S.binary_ops.hasOwnProperty(t)&&(!S.isIdentifierStart(this.code)||this.index+t.lengtho.right_a&&p.right_a?r>p.prec:r<=p.prec;for(;i.length>2&&f(i[i.length-2]);)l=i.pop(),n=i.pop().value,s=i.pop(),t={type:S.BINARY_EXP,operator:n,left:s,right:l},i.push(t);t=this.gobbleToken(),t||this.throwError(«Expected expression after «+u),i.push(o,t)}for(a=i.length-1,t=i[a];a>1;)t={type:S.BINARY_EXP,operator:i[a-1].value,left:i[a-2],right:t},a-=2;return t}gobbleToken(){let t,n,r,i;if(this.gobbleSpaces(),i=this.searchHook(«gobble-token»),i)return this.runHook(«after-token»,i);if(t=this.code,S.isDecimalDigit(t)||t===S.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===S.SQUOTE_CODE||t===S.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(t===S.OBRACK_CODE)i=this.gobbleArray();else{for(n=this.expr.substr(this.index,S.max_unop_len),r=n.length;r>0;){if(S.unary_ops.hasOwnProperty(n)&&(!S.isIdentifierStart(this.code)||this.index+n.length=n.length&&this.throwError(«Unexpected token «+String.fromCharCode(t));break}else if(o===S.COMMA_CODE){if(this.index++,i++,i!==n.length){if(t===S.CPAREN_CODE)this.throwError(«Unexpected token ,»);else if(t===S.CBRACK_CODE)for(let s=n.length;s«:7,»<=":7,">=»:7,»<<":8,">>»:8,»>>>»:8,»+»:9,»-«:9,»*»:10,»/»:10,»%»:10,»**»:11},right_associative:new Set([«**»]),additional_identifier_chars:new Set([«$»,»_»]),literals:{true:!0,false:!1,null:null},this_str:»this»}),S.max_unop_len=S.getMaxKeyLen(S.unary_ops),S.max_binop_len=S.getMaxKeyLen(S.binary_ops);const We=e=>new S(e).parse(),pu=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(S).filter(e=>!pu.includes(e)&&We[e]===void 0).forEach(e=>{We[e]=S[e]}),We.Jsep=S;const gu=»ConditionalExpression»;var mu={name:»ternary»,init(e){e.hooks.add(«after-expression»,function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;const r=n.node,i=this.gobbleExpression();if(i||this.throwError(«Expected expression»),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const o=this.gobbleExpression();if(o||this.throwError(«Expected expression»),n.node={type:gu,test:r,consequent:i,alternate:o},r.operator&&e.binary_ops[r.operator]<=.9){let s=r;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=r}}else this.throwError("Expected :")}})}};We.plugins.register(mu);const No=47,vu=92;var Eu={name:"regex",init(e){e.hooks.add("gobble-token",function(n){if(this.code===No){const r=++this.index;let i=!1;for(;this.index=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57)s+=this.char;else break}let l;try{l=new RegExp(o,s)}catch(a){this.throwError(a.message)}return n.node={type:e.LITERAL,value:l,raw:this.expr.slice(r-1,this.index)},n.node=this.gobbleTokenProperty(n.node),n.node}this.code===e.OBRACK_CODE?i=!0:i&&this.code===e.CBRACK_CODE&&(i=!1),this.index+=this.code===vu?2:1}this.throwError("Unclosed Regex")}})}};const Tr=43,Pt={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=»,»>>>=»,»&=»,»^=»,»|=»,»||=»,»&&=»,»??=»]),updateOperators:[Tr,45],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];Pt.assignmentOperators.forEach(r=>e.addBinaryOp(r,Pt.assignmentPrecedence,!0)),e.hooks.add(«gobble-token»,function(i){const o=this.code;Pt.updateOperators.some(s=>s===o&&s===this.expr.charCodeAt(this.index+1))&&(this.index+=2,i.node={type:»UpdateExpression»,operator:o===Tr?»++»:»–«,argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!i.node.argument||!t.includes(i.node.argument.type))&&this.throwError(`Unexpected ${i.node.operator}`))}),e.hooks.add(«after-token»,function(i){if(i.node){const o=this.code;Pt.updateOperators.some(s=>s===o&&s===this.expr.charCodeAt(this.index+1))&&(t.includes(i.node.type)||this.throwError(`Unexpected ${i.node.operator}`),this.index+=2,i.node={type:»UpdateExpression»,operator:o===Tr?»++»:»–«,argument:i.node,prefix:!1})}}),e.hooks.add(«after-expression»,function(i){i.node&&n(i.node)});function n(r){Pt.assignmentOperators.has(r.operator)?(r.type=»AssignmentExpression»,n(r.left),n(r.right)):r.operator||Object.values(r).forEach(i=>{i&&typeof i==»object»&&n(i)})}}};We.plugins.register(Eu,Pt),We.addUnaryOp(«typeof»),We.addLiteral(«null»,null),We.addLiteral(«undefined»,void 0);const yu=new Set([«constructor»,»__proto__»,»__defineGetter__»,»__defineSetter__»]),Z={evalAst(e,t){switch(e.type){case»BinaryExpression»:case»LogicalExpression»:return Z.evalBinaryExpression(e,t);case»Compound»:return Z.evalCompound(e,t);case»ConditionalExpression»:return Z.evalConditionalExpression(e,t);case»Identifier»:return Z.evalIdentifier(e,t);case»Literal»:return Z.evalLiteral(e,t);case»MemberExpression»:return Z.evalMemberExpression(e,t);case»UnaryExpression»:return Z.evalUnaryExpression(e,t);case»ArrayExpression»:return Z.evalArrayExpression(e,t);case»CallExpression»:return Z.evalCallExpression(e,t);case»AssignmentExpression»:return Z.evalAssignmentExpression(e,t);default:throw SyntaxError(«Unexpected expression»,e)}},evalBinaryExpression(e,t){return{«||»:(r,i)=>r||i(),»&&»:(r,i)=>r&&i(),»|»:(r,i)=>r|i(),»^»:(r,i)=>r^i(),»&»:(r,i)=>r&i(),»==»:(r,i)=>r==i(),»!=»:(r,i)=>r!=i(),»===»:(r,i)=>r===i(),»!==»:(r,i)=>r!==i(),»<":(r,i)=>r«:(r,i)=>r>i(),»<=":(r,i)=>r<=i(),">=»:(r,i)=>r>=i(),»<<":(r,i)=>r<>»:(r,i)=>r>>i(),»>>>»:(r,i)=>r>>>i(),»+»:(r,i)=>r+i(),»-«:(r,i)=>r-i(),»*»:(r,i)=>r*i(),»/»:(r,i)=>r/i(),»%»:(r,i)=>r%i()}[e.operator](Z.evalAst(e.left,t),()=>Z.evalAst(e.right,t))},evalCompound(e,t){let n;for(let r=0;r-Z.evalAst(r,t),»!»:r=>!Z.evalAst(r,t),»~»:r=>~Z.evalAst(r,t),»+»:r=>+Z.evalAst(r,t),typeof:r=>typeof Z.evalAst(r,t)}[e.operator](e.argument)},evalArrayExpression(e,t){return e.elements.map(n=>Z.evalAst(n,t))},evalCallExpression(e,t){const n=e.arguments.map(i=>Z.evalAst(i,t));return Z.evalAst(e.callee,t)(…n)},evalAssignmentExpression(e,t){if(e.left.type!==»Identifier»)throw SyntaxError(«Invalid left-hand side in assignment»);const n=e.left.name,r=Z.evalAst(e.right,t);return t[n]=r,t[n]}};class _u{constructor(t){this.code=t,this.ast=We(this.code)}runInNewContext(t){const n=Object.assign(Object.create(null),t);return Z.evalAst(this.ast,n)}}function ot(e,t){return e=e.slice(),e.push(t),e}function br(e,t){return t=t.slice(),t.unshift(e),t}class Tu extends Error{constructor(t){super(‘JSONPath should not be called with «new» (it prevents return of (unwrapped) scalar values)’),this.avoidNew=!0,this.value=t,this.name=»NewError»}}function G(e,t,n,r,i){if(!(this instanceof G))try{return new G(e,t,n,r,i)}catch(s){if(!s.avoidNew)throw s;return s.value}typeof e==»string»&&(i=r,r=n,n=t,t=e,e=null);const o=e&&typeof e==»object»;if(e=e||{},this.json=e.json||n,this.path=e.path||t,this.resultType=e.resultType||»value»,this.flatten=e.flatten||!1,this.wrap=Object.hasOwn(e,»wrap»)?e.wrap:!0,this.sandbox=e.sandbox||{},this.eval=e.eval===void 0?»safe»:e.eval,this.ignoreEvalErrors=typeof e.ignoreEvalErrors==»undefined»?!1:e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||r||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError(«You must supply an otherTypeCallback callback option with the @other() operator.»)},e.autostart!==!1){const s={path:o?e.path:t};o?»json»in e&&(s.json=e.json):s.json=n;const l=this.evaluate(s);if(!l||typeof l!=»object»)throw new Tu(l);return l}}G.prototype.evaluate=function(e,t,n,r){let i=this.parent,o=this.parentProperty,{flatten:s,wrap:l}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,n=n||this.callback,this.currOtherTypeCallback=r||this.otherTypeCallback,t=t||this.json,e=e||this.path,e&&typeof e==»object»&&!Array.isArray(e)){if(!e.path&&e.path!==»»)throw new TypeError(‘You must supply a «path» property when providing an object argument to JSONPath.evaluate().’);if(!Object.hasOwn(e,»json»))throw new TypeError(‘You must supply a «json» property when providing an object argument to JSONPath.evaluate().’);({json:t}=e),s=Object.hasOwn(e,»flatten»)?e.flatten:s,this.currResultType=Object.hasOwn(e,»resultType»)?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,»sandbox»)?e.sandbox:this.currSandbox,l=Object.hasOwn(e,»wrap»)?e.wrap:l,this.currEval=Object.hasOwn(e,»eval»)?e.eval:this.currEval,n=Object.hasOwn(e,»callback»)?e.callback:n,this.currOtherTypeCallback=Object.hasOwn(e,»otherTypeCallback»)?e.otherTypeCallback:this.currOtherTypeCallback,i=Object.hasOwn(e,»parent»)?e.parent:i,o=Object.hasOwn(e,»parentProperty»)?e.parentProperty:o,e=e.path}if(i=i||null,o=o||null,Array.isArray(e)&&(e=G.toPathString(e)),!e&&e!==»»||!t)return;const a=G.toPathArray(e);a[0]===»$»&&a.length>1&&a.shift(),this._hasParentSelector=null;const u=this._trace(a,t,[«$»],i,o,n).filter(function(f){return f&&!f.isParentSelector});return u.length?!l&&u.length===1&&!u[0].hasArrExpr?this._getPreferredOutput(u[0]):u.reduce((f,p)=>{const c=this._getPreferredOutput(p);return s&&Array.isArray(c)?f=f.concat(c):f.push(c),f},[]):l?[]:void 0},G.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case»all»:{const n=Array.isArray(e.path)?e.path:G.toPathArray(e.path);return e.pointer=G.toPointer(n),e.path=typeof e.path==»string»?e.path:G.toPathString(e.path),e}case»value»:case»parent»:case»parentProperty»:return e[t];case»path»:return G.toPathString(e[t]);case»pointer»:return G.toPointer(e.path);default:throw new TypeError(«Unknown result type»)}},G.prototype._handleCallback=function(e,t,n){if(t){const r=this._getPreferredOutput(e);e.path=typeof e.path==»string»?e.path:G.toPathString(e.path),t(r,n,e)}},G.prototype._trace=function(e,t,n,r,i,o,s,l){let a;if(!e.length)return a={path:n,value:t,parent:r,parentProperty:i,hasArrExpr:s},this._handleCallback(a,o,»value»),a;const u=e[0],f=e.slice(1),p=[];function c(h){Array.isArray(h)?h.forEach(d=>{p.push(d)}):p.push(h)}if((typeof u!=»string»||l)&&t&&Object.hasOwn(t,u))c(this._trace(f,t[u],ot(n,u),t,u,o,s));else if(u===»*»)this._walk(t,h=>{c(this._trace(f,t[h],ot(n,h),t,h,o,!0,!0))});else if(u===»..»)c(this._trace(f,t,n,r,i,o,s)),this._walk(t,h=>{typeof t[h]==»object»&&c(this._trace(e.slice(),t[h],ot(n,h),t,h,o,!0))});else{if(u===»^»)return this._hasParentSelector=!0,{path:n.slice(0,-1),expr:f,isParentSelector:!0};if(u===»~»)return a={path:ot(n,u),value:i,parent:r,parentProperty:null},this._handleCallback(a,o,»property»),a;if(u===»$»)c(this._trace(f,t,n,null,null,o,s));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(u))c(this._slice(u,f,t,n,r,i,o));else if(u.indexOf(«?(«)===0){if(this.currEval===!1)throw new Error(«Eval [?(expr)] prevented in JSONPath expression.»);const h=u.replace(/^\?\((.*?)\)$/u,»$1″),d=/@.?([^?]*)[[‘](\??\(.*?\))(?!.\)\])[\]’]/gu.exec(h);d?this._walk(t,g=>{const E=[d[2]],w=d[1]?t[g][d[1]]:t[g];this._trace(E,w,n,r,i,o,!0).length>0&&c(this._trace(f,t[g],ot(n,g),t,g,o,!0))}):this._walk(t,g=>{this._eval(h,t[g],g,n,r,i)&&c(this._trace(f,t[g],ot(n,g),t,g,o,!0))})}else if(u[0]===»(«){if(this.currEval===!1)throw new Error(«Eval [(expr)] prevented in JSONPath expression.»);c(this._trace(br(this._eval(u,t,n.at(-1),n.slice(0,-1),r,i),f),t,n,r,i,o,s))}else if(u[0]===»@»){let h=!1;const d=u.slice(1,-2);switch(d){case»scalar»:(!t||![«object»,»function»].includes(typeof t))&&(h=!0);break;case»boolean»:case»string»:case»undefined»:case»function»:typeof t===d&&(h=!0);break;case»integer»:Number.isFinite(t)&&!(t%1)&&(h=!0);break;case»number»:Number.isFinite(t)&&(h=!0);break;case»nonFinite»:typeof t==»number»&&!Number.isFinite(t)&&(h=!0);break;case»object»:t&&typeof t===d&&(h=!0);break;case»array»:Array.isArray(t)&&(h=!0);break;case»other»:h=this.currOtherTypeCallback(t,n,r,i);break;case»null»:t===null&&(h=!0);break;default:throw new TypeError(«Unknown value type «+d)}if(h)return a={path:n,value:t,parent:r,parentProperty:i},this._handleCallback(a,o,»value»),a}else if(u[0]===»`»&&t&&Object.hasOwn(t,u.slice(1))){const h=u.slice(1);c(this._trace(f,t[h],ot(n,h),t,h,o,s,!0))}else if(u.includes(«,»)){const h=u.split(«,»);for(const d of h)c(this._trace(br(d,f),t,n,r,i,o,!0))}else!l&&t&&Object.hasOwn(t,u)&&c(this._trace(f,t[u],ot(n,u),t,u,o,s,!0))}if(this._hasParentSelector)for(let h=0;h{t(n)})},G.prototype._slice=function(e,t,n,r,i,o,s){if(!Array.isArray(n))return;const l=n.length,a=e.split(«:»),u=a[2]&&Number.parseInt(a[2])||1;let f=a[0]&&Number.parseInt(a[0])||0,p=a[1]&&Number.parseInt(a[1])||l;f=f<0?Math.max(0,f+l):Math.min(l,f),p=p<0?Math.max(0,p+l):Math.min(l,p);const c=[];for(let h=f;h{c.push(g)});return c},G.prototype._eval=function(e,t,n,r,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=n,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const s=e.includes(«@path»);s&&(this.currSandbox._$_path=G.toPathString(r.concat([n])));const l=this.currEval+»Script:»+e;if(!G.cache[l]){let a=e.replaceAll(«@parentProperty»,»_$_parentProperty»).replaceAll(«@parent»,»_$_parent»).replaceAll(«@property»,»_$_property»).replaceAll(«@root»,»_$_root»).replaceAll(/@([.\s)[])/gu,»_$_v$1″);if(s&&(a=a.replaceAll(«@path»,»_$_path»)),this.currEval===»safe»||this.currEval===!0||this.currEval===void 0)G.cache[l]=new this.safeVm.Script(a);else if(this.currEval===»native»)G.cache[l]=new this.vm.Script(a);else if(typeof this.currEval==»function»&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,»runInNewContext»)){const u=this.currEval;G.cache[l]=new u(a)}else if(typeof this.currEval==»function»)G.cache[l]={runInNewContext:u=>this.currEval(a,u)};else throw new TypeError(`Unknown «eval» property «${this.currEval}»`)}try{return G.cache[l].runInNewContext(this.currSandbox)}catch(a){if(this.ignoreEvalErrors)return!1;throw new Error(«jsonPath: «+a.message+»: «+e)}},G.cache={},G.toPathString=function(e){const t=e,n=t.length;let r=»$»;for(let i=1;itypeof t[u]==»function»);const o=r.map(u=>t[u]);n=i.reduce((u,f)=>{let p=t[f].toString();return/function/u.test(p)||(p=»function «+p),»var «+f+»=»+p+»;»+u},»»)+n,!/([‘»])use strict\1/u.test(n)&&!r.includes(«arguments»)&&(n=»var arguments = undefined;»+n),n=n.replace(/;\s*$/u,»»);const l=n.lastIndexOf(«;»),a=l!==-1?n.slice(0,l+1)+» return «+n.slice(l+1):» return «+n;return new Function(…r,a)(…o)}}G.prototype.vm={Script:wu};class Su{constructor(t){this._highlight=!1,D(t)||this.setProperties(t)}setProperties(t){this.validateProperties(t),this.path=t.path,this.label=t.label,this._onRevert=t.onRevert,this._onReady=t.onReady,!D(this._onReady)&&!D(this._content)&&!D(this._metadata)&&this._onReady(this._content,this._metadata),this._onHighlight=t.onHighlight,!D(this._onHighlight)&&this._highlight&&D(this.path)&&(D(this._metadata)?this._onHighlight(this._highlight):this._onHighlight(this._highlight,this._metadata))}validateProperties(t){if(D(t.onReady))throw new tt(je.InvalidContentZoneHandlerProperty,»onReady property must defined»);if(J(t,»onReady»)&&!tr(t.onReady))throw new tt(je.InvalidContentZoneHandlerProperty,»onReady property must be a function»);if(J(t,»onRevert»)&&!tr(t.onRevert))throw new tt(je.InvalidContentZoneHandlerProperty,»onRevert property must be a function»);if(J(t,»onHighlight»)&&!tr(t.onHighlight))throw new tt(je.InvalidContentZoneHandlerProperty,»onHighlight property must be a function»);if(J(t,»path»)&&!b(t.path))throw new tt(je.InvalidContentZoneHandlerProperty,»Path property must be a non-empty string»);if(J(t,»label»)&&!b(t.label))throw new tt(je.InvalidContentZoneHandlerProperty,»Label property must be a non-empty string»)}triggerReady(t,n){if(D(t)||D(n)){y.log.warn(«Handling a call to ready for a content zone handler transformation, but the content or the metadata parameter is not defined. The ready handler will not be called.»);return}this._content=t,this._metadata=n,D(this._onReady)||this._onReady(t,n)}triggerRevert(){this._content=null;const t=this._metadata;if(this._metadata=null,D(t)){y.log.warn(«Handling a call to revert for a content zone handler transformation, but the content zone handler metadata is not defined. The revert handler will not be called.»);return}D(this._onRevert)||this._onRevert(t)}triggerHighlight(t){if(!et(t)){y.log.warn(«Handling a call to highlight for a content zone handler transformation, but the highlight parameter is not a boolean. The highlight handler will not be called.»);return}this._highlight=t,!D(this._onHighlight)&&D(this.path)&&(D(this._metadata)?this._onHighlight(this._highlight):this._onHighlight(this._highlight,this._metadata))}}let Yt={};function Iu(){Yt={}}function Au(e,t){try{if(!N(t,!1))throw new tt(je.InvalidContentZoneHandlerProperties,»Content Zone Handler Properties must be a non-empty object»);const n=wr(e);D(n)?Oo(e,t):n.setProperties(t)}catch(n){y.log.error(`Content Zone Handler could not be set due to: ${K(n).message}`)}}function Cu(e){const t=wr(e);if(D(t))return t;const{label:n,path:r}=t;return{label:n,path:r}}function wr(e){if(!b(e))throw new tt(je.InvalidContentZoneHandlerName,»Name must be a non-empty string»);return Yt[e]}function Oo(e,t){return Yt[e]=new Su(t),Yt[e]}function Pu(){return Yt}var Nu=Object.defineProperty,Ou=Object.defineProperties,Du=Object.getOwnPropertyDescriptors,Do=Object.getOwnPropertySymbols,Mu=Object.prototype.hasOwnProperty,Ru=Object.prototype.propertyIsEnumerable,Mo=(e,t,n)=>t in e?Nu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lu=(e,t)=>{for(var n in t||(t={}))Mu.call(t,n)&&Mo(e,n,t[n]);if(Do)for(var n of Do(t))Ru.call(t,n)&&Mo(e,n,t[n]);return e},xu=(e,t)=>Ou(e,Du(t));let Ro=null;function ku(e){var t;if(N(e)&&(J(e,»anchorId»)||J(e,»anchorDmoName»))){const n=xu(Lu({},J(e,»anchorDmoName»)&&{anchorDmoName:e.anchorDmoName}),{anchorId:(t=e.anchorId)!=null?t:»»});return Uu(n),n.anchorId===null?null:n}else return Ro}function Uu(e){if(J(e,»anchorDmoName»)&&(!b(e.anchorDmoName)||!b(e.anchorId)))throw b(e.anchorId)?new he(ce.AnchorDmoNameRequired,»Anchor Dmo Name must be a non-empty string when provided.»):new he(ce.AnchorIdRequiredWithDmoName,»Anchor Id cannot be null if Anchor Dmo Name is provided.»);if(e.anchorId!==null&&!b(e.anchorId))throw new he(ce.AnchorIdNullOrNotEmpty,»Anchor Id must be null or a non-empty string.»)}document.addEventListener(P.CustomEvents.OnEventSend,e=>{var t,n,r;if(((r=(n=(t=e==null?void 0:e.detail)==null?void 0:t.actionEvent)==null?void 0:n.interaction)==null?void 0:r.name)===P.CatalogObjectInteractionName.ViewCatalogObject){const i=e.detail.actionEvent.interaction.catalogObject;N(i)&&b(i.id)&&b(i.type)&&Lo({anchorId:i.id})}}),document.addEventListener(P.CustomEvents.OnInit,()=>{Lo(null)});function Lo(e){Ro=e}var xo=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{l(n.next(a))}catch(u){i(u)}},s=a=>{try{l(n.throw(a))}catch(u){i(u)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,s);l((n=n.apply(e,t)).next())});const ko=»TestMode»,Uo=»Web»;class Hu{constructor(t,n){this.statuses=t,this.finished=Promise.allSettled(Object.values(t).map(r=>xo(this,null,function*(){return yield r.finished}))).then(r=>{const i=r.filter(o=>o.status===»rejected»).map(o=>K(o.reason).message);if(i.length>0)throw new Error(`Issue(s) with preview (see ‘statuses’ for more detail): ${JSON.stringify(i)}`)}),this.finished.catch(()=>{}),this.revert=()=>(D(this._revertResponse)&&(this._revertResponse=n()),this._revertResponse)}}class Fu{constructor(t){this.statuses=t,this.finished=Promise.allSettled(Object.values(t).map(n=>xo(this,null,function*(){return yield n.finished}))).then(n=>{const r=n.filter(i=>i.status===»rejected»).map(i=>K(i.reason).message);if(r.length>0)throw new Error(`Issue(s) with revert (see ‘statuses’ for more detail): ${JSON.stringify(r)}`)}),this.finished.catch(()=>{})}}let qe=null;function zu(e){const t={};let n=!1;return b(e==null?void 0:e.pageType)?(t.pageType=e.pageType,n=!0):b(qe==null?void 0:qe.pageType)&&(t.pageType=qe==null?void 0:qe.pageType,n=!0),b(e==null?void 0:e.interaction)?(t.interaction=e.interaction,n=!0):b(qe==null?void 0:qe.interaction)&&(t.interaction=qe==null?void 0:qe.interaction,n=!0),n?t:null}function Sr(e){qe=e}function Vu(){document.addEventListener(y.CustomEvents.OnShutDown,()=>Sr(null)),document.addEventListener(y.CustomEvents.OnInit,()=>Sr(null)),document.addEventListener(y.CustomEvents.OnSettledSitemap,e=>{var t,n;((t=e==null?void 0:e.detail)==null?void 0:t.result)!==void 0&&Bu((n=e==null?void 0:e.detail)==null?void 0:n.result)})}function Bu(e){var t,n,r,i,o,s,l,a,u,f,p,c;const h={};let d=!1;const g=(i=(t=e==null?void 0:e.matchedConfig)==null?void 0:t.name)!=null?i:(r=(n=e==null?void 0:e.currentPage)==null?void 0:n.source)==null?void 0:r.pageType;b(g)&&(h.pageType=g,d=!0),b((s=(o=e==null?void 0:e.matchedConfig)==null?void 0:o.interaction)==null?void 0:s.name)?(h.interaction=(a=(l=e==null?void 0:e.matchedConfig)==null?void 0:l.interaction)==null?void 0:a.name,d=!0):b((f=(u=e==null?void 0:e.currentPage)==null?void 0:u.interaction)==null?void 0:f.name)&&(h.interaction=(c=(p=e==null?void 0:e.currentPage)==null?void 0:p.interaction)==null?void 0:c.name,d=!0),Sr(d?h:null)}var Ir=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{l(n.next(a))}catch(u){i(u)}},s=a=>{try{l(n.throw(a))}catch(u){i(u)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,s);l((n=n.apply(e,t)).next())});function Gu(e){return Ir(this,null,function*(){var t,n;const r=y.getSitemapResult(),i=y.getSitemapConfig();return(r==null?void 0:r.matchedConfig)!=null?(y.log.trace(`Evaluating context attributes from matched page type [${r==null?void 0:r.matchedConfig.name}] for dataspace [${(t=e==null?void 0:e.dataspace)!=null?t:»»}].`),yield Ar(r.matchedConfig,e)):(i==null?void 0:i.global)!=null?(y.log.trace(`Evaluating context attributes from global page type for dataspace [${(n=e==null?void 0:e.dataspace)!=null?n:»»}].`),yield Ar(i.global,e)):{}})}function Ar(e,t){return Ir(this,null,function*(){if((e==null?void 0:e.contextualAttributes)==null)return{};const n=e.contextualAttributes,r=Object.keys(n),i={},o={};return r.forEach(s=>{i[s]=ju(s,n[s],t)}),yield Promise.all(Object.values(i)).then(s=>(s.forEach((l,a)=>{if(l!==void 0){const u=r[a];o[u]=l}}),o))})}function ju(e,t,n){return Ir(this,null,function*(){try{return N(n)&&J(n,e)?n[e]:yield Promise.resolve(t).then(r=>typeof r==»function»?r():r)}catch(r){y.log.error(`Error when evaluating contextual attribute [${e}]: ${K(r).message}`,r)}})}function Ho(){return P.getConsents().findIndex(e=>e.consent.status===y.ConsentStatus.OptIn)>=0}var Wu=Object.defineProperty,qu=Object.defineProperties,$u=Object.getOwnPropertyDescriptors,Fo=Object.getOwnPropertySymbols,Yu=Object.prototype.hasOwnProperty,Zu=Object.prototype.propertyIsEnumerable,zo=(e,t,n)=>t in e?Wu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ue=(e,t)=>{for(var n in t||(t={}))Yu.call(t,n)&&zo(e,n,t[n]);if(Fo)for(var n of Fo(t))Zu.call(t,n)&&zo(e,n,t[n]);return e},Ku=(e,t)=>qu(e,$u(t)),Pn=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{l(n.next(a))}catch(u){i(u)}},s=a=>{try{l(n.throw(a))}catch(u){i(u)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,s);l((n=n.apply(e,t)).next())});const Zt=new Cl(«PreviewMeta»);function Vo(e,t){return Pn(this,null,function*(){let n=sr();const r=yield e;if(ao(t==null?void 0:t.endpoint),D(t==null?void 0:t.endpoint)||(n=t.endpoint,P.log.debug(`Using specified endpoint of ${n} as endpoint for fetching personalization.`)),!Ho()&&!Cr(r))throw new he(ce.ConsentOptInRequired,»Consent opt-in is required to fetch personalization.»,{level:»warning»});const i={method:»POST»,cache:»no-store»,headers:{«Content-Type»:»application/json»,Accept:»application/json, text/javascript, */*; q=0.01″},body:JSON.stringify(r)};return Cr(r)&&(i.credentials=»include»,i.mode=»cors»),yield window.fetch(n,i).then(o=>Pn(this,null,function*(){if(!o.ok){const s=yield o.text();throw new eo(Ji.PersonalizationFetchFailed,»Personalization fetch failed.»,{context:{status:o.status,message:s}})}return yield o.json().then(s=>(ac(s),Cr(r)&&s.personalizations.forEach(l=>{jo({personalizationId:l.personalizationId,personalizationPointName:l.personalizationPointName})}),s))})).catch(o=>Pn(this,null,function*(){return o instanceof eo||P.log.error(«Unexpected error with browser fetch.»),yield Promise.reject(o)}))})}function Xu(e,t){if(!H(e))throw new he(ce.PersonalizationPointsIsNotAnArray,»The Personalization Points parameter must be an array of length >= 1.»);e.forEach(n=>{if(D(n))throw new he(ce.PersonalizationPointIsNotDefined,»The Personalization Point must be an object containing a name value.»,{context:{value:n}});if(!b(n.name))throw new he(ce.PersonalizationPointNameIsNotAString,»The Personalization Point name parameter must be a non empty string.»,{context:{value:n.name}});if(J(n,»decisionId»)){if(t!==!0)throw new he(ce.PersonalizationPointDecisionIdProvidedNonPreview,»The Personalization Point decisionId parameter can only be provided during previews.»,{context:{value:n.decisionId}});if(!b(n.decisionId))throw new he(ce.PersonalizationPointDecisionIdIsNotAString,»The Personalization Point decisionId parameter must be a non empty string if provided.»,{context:{value:n.decisionId}})}})}function Qu(e){if(!N(e))throw new he(ce.ContextIsNotAnObject,»The Context parameter must be an object.»)}function Bo(e,t,n){return Pn(this,null,function*(){Xu(e,n),t!==void 0&&Qu(t);const r=et(n)&&n;t=Ue(Ue({},yield Gu(t)),t);const i={personalizationPoints:e,context:Ue(Ue(Ku(Ue(Ue(Ue(Ue(Ue(Ue({},t),ku(t)),tc(t)),nc(t)),zu(t)),rc(t)),{individualId:ic(r,t)}),Ju(t)),ec())};return r&&(i.executionFlags=[ko]),i})}function Ju(e){const t={};if(b(e==null?void 0:e.dataspace))t.dataspace=e==null?void 0:e.dataspace;else{const n=lr();b(n)&&(t.dataspace=n)}return t}function ec(){var e;const t=(e=window==null?void 0:window.location)==null?void 0:e.hostname;return t===void 0?(P.log.warn(«Channel context (window.location.hostname) is undefined \u2014 not sending channelContext»),{channel:Uo}):{channel:Uo,channelContext:t}}function tc(e){var t;const n={};if(b(e==null?void 0:e.requestUrl))n.requestUrl=e==null?void 0:e.requestUrl;else{const r=(t=window==null?void 0:window.location)==null?void 0:t.href;b(r)&&(n.requestUrl=r)}return n}function nc(e){const t={};if(b(e==null?void 0:e.p13n_sys_requestTimeZone))t.p13n_sys_requestTimeZone=e.p13n_sys_requestTimeZone;else try{const n=window.Intl.DateTimeFormat().resolvedOptions().timeZone;b(n)&&(t.p13n_sys_requestTimeZone=n)}catch(n){P.log.error(«Error getting request time zone from browser. The contextual attribute p13n_sys_requestTimeZone will not be set.»,n)}return t}function rc(e){const t={};if([Kt(e==null?void 0:e.utm_source,n=>{t.utm_source=n}),Kt(e==null?void 0:e.utm_campaign,n=>{t.utm_campaign=n}),Kt(e==null?void 0:e.utm_medium,n=>{t.utm_medium=n}),Kt(e==null?void 0:e.utm_content,n=>{t.utm_content=n}),Kt(e==null?void 0:e.utm_term,n=>{t.utm_term=n})].every(n=>!n)){const n=bl([«utm_source»,»utm_campaign»,»utm_medium»,»utm_content»,»utm_term»]);Xt(«utm_source»,n,r=>{t.utm_source=r}),Xt(«utm_campaign»,n,r=>{t.utm_campaign=r}),Xt(«utm_medium»,n,r=>{t.utm_medium=r}),Xt(«utm_content»,n,r=>{t.utm_content=r}),Xt(«utm_term»,n,r=>{t.utm_term=r})}return t}function Kt(e,t){return b(e)?(t(e),!0):!1}function Xt(e,t,n){const r=t!==null?t[e]:null;b(r)&&n(r)}function ic(e,t){if(e&&N(t)&&J(t,»individualId»)){const n=t.individualId;if(b(n))return n}return P.getAnonymousId()}function Cr(e){var t,n;return(n=(t=e==null?void 0:e.executionFlags)==null?void 0:t.includes(ko))!=null?n:!1}function Pr(e,t){return b(e)&&Go(e)||b(t)&&oc(t)}function Go(e){return!D(Zt.get(e))}function oc(e){return!D(Zt.get(e))}function jo(e){J(e,»personalizationId»)?Zt.set(e.personalizationId,e):J(e,»personalizationExperienceConfigName»)&&Zt.set(e.personalizationExperienceConfigName,e)}function Nr(e){Zt.delete(e)}function Wo(e){return H(e.data)||N(e.attributes,!1)}function ac(e){let t=!0;if(!N(e))throw new zt(vt.InvalidJsonObject,»Personalization response invalid: Expected a JSON object.»);if(!H(e.personalizations,!0))throw new zt(vt.MissingPersonalizationsArray,’Personalization response invalid: Expected «personalizations» array.’);if(e.personalizations.length===0&&(t=!1),e.personalizations.forEach(n=>{if(!b(n.personalizationId))throw new zt(vt.MissingPersonalizationId,’Personalization response invalid: Expected each «personalization» to include «personalizationId».’);if(!b(n.personalizationPointName))throw new zt(vt.MissingPersonalizationPointName,’Personalization response invalid: Expected each «personalization» to include «personalizationPointName».’);if(!Wo(n))if(!b(n.decisionId))P.log.debug(`User did not qualify for a decision. Id ${n.personalizationId}, Name ${n.personalizationPointName}`);else{P.log.error(`User qualified for a decision but there is no «data» nor «attributes». Id ${n.personalizationId}, Name ${n.personalizationPointName}, Decision Id ${n.decisionId}`);return}t=!1}),t)throw new zt(vt.MissingPersonalizationContent,’Personalization response invalid. Expected each «personalization» to include either «data» or «attributes».’)}function sc(e){var t;return(t=e==null?void 0:e.contentZones)!=null?t:[]}function qo(e,t=!0){return sc(e).reduce((n,r)=>{const[i,o]=lc(r,t);return b(i==null?void 0:i.name)&&o&&n.push(r),n},[])}function lc(e,t=!0){const n=N(e)?e:{name:»»,selector:»»},r=b(n==null?void 0:n.selector);b(n==null?void 0:n.name)&&!r&&y.log.debug(`Content Zone ${n.name} has no Selector configured`);const i=r&&(!t||uc(n==null?void 0:n.selector));return[e,i]}const uc=e=>y.cashDom(e).length>0;function $o(e){if(!b(e))return null;const t=y.getSitemapResult().matchedConfig;if(t.contentZones!==void 0){const n=t.contentZones;if(!H(n))return null;const r=n.find(i=>i.name===e);return b(r==null?void 0:r.selector)?r.selector:null}return null}function Or(e,t=!0){return qo(e,t).map(n=>n.name)}function cc(e,t=!0){return Dr([e],void 0,void 0,!0,t)}function fc(e,t=!0){return Dr(e,void 0,void 0,!0,t)}function dc(e){return N(e)?Dr(e.pageTypes,e.global,e.pageTypeDefault,!0,!1):[]}function Dr(e,t,n,r=!0,i=!0){const o=[];if(N(t)&&o.push(…Or(t,i)),H(e)&&e.forEach(s=>{o.push(…Or(s,i))}),N(n)&&o.push(…Or(n,i)),r){const s=hc(o);if(s.length>0)return y.log.warn(`The following content zones are duplicated which are not supported by personalization: ${pc(s).join(«, «)}`),gc(o,s)}return o}function hc(e){return e.filter((t,n)=>e.indexOf(t)!==n)}function pc(e){return e.filter((t,n)=>e.indexOf(t)===n)}function gc(e,t){return e.filter(n=>!t.includes(n))}const mc={redisplayTimeoutMilliseconds:2e3,renderPersonalizationAfterTimeoutElapsed:!1};var Te=(e=>(e.PageType=»PageType»,e.PageUrlMatcher=»PageUrlMatcher»,e))(Te||{}),vc=Object.defineProperty,Yo=Object.getOwnPropertySymbols,Ec=Object.prototype.hasOwnProperty,yc=Object.prototype.propertyIsEnumerable,Zo=(e,t,n)=>t in e?vc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ko=(e,t)=>{for(var n in t||(t={}))Ec.call(t,n)&&Zo(e,n,t[n]);if(Yo)for(var n of Yo(t))yc.call(t,n)&&Zo(e,n,t[n]);return e};let Nn=mc,Xo=!1;const _c=»head > style.personalizationFlickerDefense»,ft={PageUrlMatcher:[],PageType:[]};function On(){return Nn!=null?Nn:{}}function Tc(e){Nn=Ko(Ko({},Nn),e)}function bc(e){if(!N(e))throw new or(«flicker defense config is required»);if(J(e,»redisplayTimeoutMilliseconds»)&&(!Ht(e.redisplayTimeoutMilliseconds)||e.redisplayTimeoutMilliseconds<0))throw new or("redisplayTimeoutMilliseconds must be a number greater than or equal to 0");if(J(e,"renderPersonalizationAfterTimeoutElapsed")&&!et(e.renderPersonalizationAfterTimeoutElapsed))throw new or("renderPersonalizationAfterTimeoutElapsed must be a boolean")}function Qo(e){Xo=e}function wc(){return Xo}function Sc(e){try{return document.querySelector(e),!0}catch(t){return P.log.warn(`Invalid path ${e} detected while trying to prevent flicker.`),!1}}function Ic(){const e=Ac();return Object.values(ft).flat().map(t=>{var n;if(Bt(t)){const r=(n=e.find(i=>t.name===i.name))==null?void 0:n.selector;if(b(r))return r}else if(it(t))return t.path;return»»}).filter(Sc).join(«,»)}function Ac(){const{pageTypes:e,global:t,pageTypeDefault:n}=P.getSitemapConfig();return[…e,…N(t)?[t]:[],…N(n)?[n]:[]].flatMap(r=>qo(r,!1))}function Cc(e){return e.transformationConfig.transformations.filter(it).length>0}function Jo(e){if(et(e.isEnabled)&&!e.isEnabled)return!1;const t=e.transformationConfig.method;return t===$.ReplaceContentZoneContent||t===$.ReplaceElementContent||D(t)&&Cc(e)}function ea(e){return e.filter(Jo).flatMap(t=>t.transformationConfig.transformations)}function Pc(){const e=P.cashDom(««),t=En();return b(t)&&e.attr(«nonce»,t),e.attr({type:»text/css»,class:»personalizationFlickerDefense»}).appendTo(document.head)}function Mr(){const e=()=>{let t=P.cashDom(_c);t.length===0&&(t=Pc());const n=Ic();b(n)?(P.log.debug(`flicker defense style tag updated to ${n}`),t.text(`${n} { visibility: hidden !important; }`)):(P.log.debug(«flicker defense style tag removed»),t.remove())};window.requestAnimationFrame(e)}function Rr(e){const t=ea(e);for(const n of t)Dn(n)}function Dn(e){for(const t of Object.values(Te))ft[t]=ft[t].filter(n=>(n===e&&P.log.debug(`flicker defense reshowing hidden transformation with source matcher type of ${t}: ${JSON.stringify(e)}`),n!==e));Mr()}function ta(e,t,n){if(!Pr(e,t.pec.name)&&Jo(t.pec)&&!On().renderPersonalizationAfterTimeoutElapsed&&wc()){const r=`Blocking transform and render of following transformation for config ${t.pec.name} due to flicker defense: ${JSON.stringify(n)}`;throw t.status.update(new k(r)),Dn(n),new oe(fe.FlickerDefenseRedisplayElapsed,`Blocking transform and render of following transformation for config ${t.pec.name} due to flicker defense`)}}function na(e){if(nt()){if(!N(e,!1)){P.log.error(«A config is required when setting Flicker Defense Config.»);return}try{bc(e),Tc(e),P.log.info(«Set Flicker Defense Config to the following: «,e)}catch(t){P.log.error(`Flicker Defense Config could not be set due to: ${K(t).message}`)}}else P.log.error(«Flicker Defense Config can only be set before SalesforceInteractions.init is called.»)}var Nc=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{l(n.next(a))}catch(u){i(u)}},s=a=>{try{l(n.throw(a))}catch(u){i(u)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,s);l((n=n.apply(e,t)).next())});const ra=class er{validateTransformerDetails(t){}validateMethod(t){}validateSubstitutionValues(t){}supportsEngagementSelection(){return!0}setContent(t,n,r,i,o,s,l=$.ReplaceElementContent){const a=`pec ${o.pec.name}, transformation ${r.transformerName}`+(s!==void 0?`, personalizationId ${s}`:»»);o.status.update(new k(`Awaiting element/conditions ${a}`));const u=t.then(f=>{if(!(f instanceof Element))throw new oe(fe.FoundNonElement,»Found non-Element»);if(s!==void 0&&ta(s,o,r),!D(o.revertStatus)){const p=`Aborting ${a}, revert has been called`;return y.log.info(p),o.status.update(new k(p)),c=>{c.update(new k(`Nothing to revert, since revert was requested before transformation, ${a}`))}}if(o.status.update(new k(`About to transform/render, element/conditions ready ${a}`)),uo(i)){const p=document.head;if(D(p))throw new oe(fe.ElementsNotFound,»Could not add agent script, head not found»);const c=document.createElement(«script»);return c.type=»text/javascript»,c.textContent=n(),c.nonce=En(),this.insertAdjacentHtmlUnlessAlreadyPersonalized(p,»beforeend»,()=>c,a)}else{if(cr(r,l))return this.triggerReadyHandlerWithHtml(r.name,o,s,n,a);if(Tt(l)){const p=f.closest(«body»);if(D(p))throw new oe(fe.ElementsNotFound,»Could not add overlay, body not found»);return this.insertAdjacentHtmlUnlessAlreadyPersonalized(p,»beforeend»,n,a)}else{if(_n(r,l))return this.setInnerHtmlUnlessAlreadyPersonalized(f,n,a);if(it(r)){const p=l!=null?l:$.ReplaceElementContent;switch(p){case $.ReplaceElementContent:return this.setInnerHtmlUnlessAlreadyPersonalized(f,n,a);case $.AddAfterElement:return this.insertAdjacentHtmlUnlessAlreadyPersonalized(f,»afterend»,n,a);case $.AddBeforeElement:return this.insertAdjacentHtmlUnlessAlreadyPersonalized(f,»beforebegin»,n,a);default:throw new oe(fe.NotSupported,`method «${p}» is not supported for Element transformations`)}}else throw new oe(fe.NotSupported,»transformation is not of a known type»)}}});return u.catch(f=>{const p=new Error(`Could not set content for ${a}: ${K(f).message}`);o.status.update(new k(p)),y.log.error(p.message)}),{promise:u.then(),revert:f=>Nc(this,null,function*(){f.update(new k(«Awaiting transformPromise»));const p=u.then(c=>{c(f)},c=>{if(c instanceof oe){f.update(new k(`Nothing to revert, no transformation attempt, ${a}`));return}throw c});p.catch(c=>{const h=new Error(`Issue reverting ${a}: `+K(c).message);y.log.error(h),f.update(new k(h))}),yield p})}}setInnerHtmlUnlessAlreadyPersonalized(t,n,r){if(t.children.length>0&&this.isElementAlreadyPersonalized(t.children[0]))throw new oe(fe.AlreadyPersonalized,`Aborting setting innerHTML, element ${t.localName} already personalized`);const i=n();y.log.trace(`Setting element ${t.localName}’s innerHTML to ${i}, ${r}`,t);const o=t.innerHTML;return t.innerHTML=i,s=>{let l=`Reverting, ${r}`;s.update(new k(l)),y.log.debug(l),t.innerHTML=o,l=`Reverted, ${r}`,s.update(new k(l)),y.log.debug(l)}}insertAdjacentHtmlUnlessAlreadyPersonalized(t,n,r,i){let o;switch(n){case»beforebegin»:o=t.previousSibling;break;case»afterbegin»:o=t.firstChild;break;case»beforeend»:o=t.lastChild;break;case»afterend»:o=t.nextSibling;break;default:throw new Error(`Unsupported insertAdjacentHTML position: ${String(n)}`)}if(o instanceof Element&&this.isElementAlreadyPersonalized(t))throw new oe(fe.AlreadyPersonalized,`Aborting inserting adjacent HTML, adjacent element ${o.localName} ${n} from ${t.localName} is already personalized`);const s=r();y.log.trace(`Inserting adjacent HTML ${n} element ${t.localName}’s with ${b(s)?s:s.outerHTML}, ${i}`,t);const l=b(s)?this.getHTMLElements(s):[s];return this.insertAdjacentElements(t,n,l),a=>{let u=`Reverting, ${i}`;a.update(new k(u)),y.log.debug(u),l.forEach(f=>f.remove()),u=`Reverted, ${i}`,a.update(new k(u)),y.log.debug(u)}}triggerReadyHandlerWithHtml(t,n,r,i,o){var s;const l=i(),a=(s=wr(t))!=null?s:Oo(t);return a.triggerReady(l,{personalizationExperienceConfig:n.pec,isPreview:Pr(r,n.pec.name)}),u=>{let f=`Reverting, ${o}`;u.update(new k(f)),y.log.debug(f),a.triggerRevert(),f=`Reverted, ${o}`,u.update(new k(f)),y.log.debug(f)}}isElementAlreadyPersonalized(t){return t.getAttributeNames().some(n=>n.startsWith(bt))}autoInjectDefaultRootAttributes(t,n,r,i=!0){const o=[];t.hasAttribute(xe)?y.log.debug(`Element already has root attribute «${xe}»`,t):(y.log.debug(`Adding root attribute «${xe}»=»${n}» to element`,t),t.setAttribute(xe,n),o.push(()=>{t.removeAttribute(xe)}));const s={};b(r)&&(s[It]=r);const l=JSON.stringify(s);return i&&(t.hasAttribute(wt)?y.log.debug(`Element already has root attribute «${wt}»`,t):(y.log.debug(`Adding root attribute «${wt}»=»${l}» to element`,t),t.setAttribute(wt,l),o.push(()=>{t.removeAttribute(wt)}))),t.hasAttribute(St)?y.log.debug(`Element already has attribute «${St}»`,t):(y.log.debug(`Adding attribute «${St}»=»${l}» to element`,t),t.setAttribute(St,l),o.push(()=>{t.removeAttribute(St)})),a=>{o.forEach(u=>u==null?void 0:u(a))}}autoInjectDefaultItemAttributes(t,n,r,i=!0){const o=[];D(n)||(t.setAttribute(xe,n),o.push(()=>{t.removeAttribute(xe)}));const s=JSON.stringify(r);if(i){const a=this.assignMaybeOverrideAttribute(t,wt,s);o.push(a)}const l=this.assignMaybeOverrideAttribute(t,St,s);return o.push(l),a=>{o.forEach(u=>u==null?void 0:u(a))}}assignMaybeOverrideAttribute(t,n,r){return t.hasAttribute(n)?y.log.debug(`Overwriting item attribute «${n}»=»${r}» on element`,t):y.log.debug(`Adding item attribute «${n}»=»${r}» to element`,t),t.setAttribute(n,r),()=>{t.removeAttribute(n)}}static findValueDefaultForContentId(t){var n,r,i;return(i=(r=(n=t.attributes)==null?void 0:n.eventModifiers)==null?void 0:r[Ct])==null?void 0:i.valueDefault}static findValueDefaultForObjectId(t){var n,r,i;return(i=(r=(n=t.attributes)==null?void 0:n.eventModifiers)==null?void 0:r[At])==null?void 0:i.valueDefault}buildModifiersIfItemRelated(t,n,r){if(!N(t))return;const i={},o=er.findValueDefaultForContentId(r);if(b(o)){const l=this.getSanitizedContentString(o,t);b(l)&&(i[Ct]=l)}const s=er.findValueDefaultForObjectId(r);if(b(s)){const l=this.getSanitizedContentString(s,t);b(l)&&(i[At]=l)}if(Object.keys(i).length!==0)return b(n)&&(i[It]=n),i}getHTMLElements(t){const n=document.createElement(«div»);return n.innerHTML=t,Array.from(n.children)}getPathParentObject(t,n){if(!b(t))return;const r=G({path:`$.${t}`,json:n,wrap:!1,resultType:»parent»});return N(r)?r:void 0}getSanitizedContentString(t,n){const r=G({path:`$${t}`,json:n,wrap:!1});if(D(r))return;const i=String(r),o=er.sanitizer.sanitizeString(i);return y.log.debug(`sanitized data for dataPath ${t}: ${o}`),o}insertAdjacentElement(t,n,r){if(r===»beforeend»)t.appendChild(n);else{if(t.parentNode===null)throw new Error(«Unable to find parent element»);r===»beforebegin»?t.parentNode.insertBefore(n,t):r===»afterbegin»?t.parentNode.insertBefore(n,t.firstChild):r===»afterend»&&t.parentNode.insertBefore(n,t.nextSibling)}}insertAdjacentElements(t,n,r){const i=[];if(n===»beforeend»||n===»afterend»?r.forEach(o=>{try{this.insertAdjacentElement(t,o,n)}catch(s){i.push(K(s).message)}}):(n===»beforebegin»||n===»afterbegin»)&&r.reverse().forEach(o=>{try{this.insertAdjacentElement(t,o,n)}catch(s){i.push(K(s).message)}}),i.length>0)throw new Error(`Issues with insertAdjacentElements: ${JSON.stringify(i)}`)}};ra.sanitizer=new lu;let Lr=ra;function Mn(e,t,n){var r,i;if(!b(e,!0))throw new M(R.MissingTransformerName,»Transformer Name is required.»);if(!N(n))throw new M(R.MissingEngagementConfig,»Engagement Configuration or Destinations are not defined.»);const o=n.destinationDefaults;if(o===void 0)throw new M(R.MissingEngagementConfigDefaults,»Engagement Configuration Defaults are not defined.»);let s=e!==»»?(r=o.byName)==null?void 0:r[e]:void 0;if(b(s)||(s=(i=o.byType)==null?void 0:i[t],b(s)))return s;if(!b(o.global))throw new M(R.MissingEngagementConfigGlobalDefault,»Engagement Configuration Global Default is not defined.»);return o.global}function ia(e,t,n,r){if(b(e))return e;try{return Mn(t,n,r)}catch(i){return}}const Oc={destinations:{[Ao]:{label:»Product Engagement»,description:»Engagement events (e.g. view/click) on this personalization are intended for the stock Product Browse Engagement DMO»,disableSendingNonItemEngagementEvents:!0,eventModifiers:{[An]:»catalog»,[In]:e=>{switch(e.name){case ut:return»catalog-object-view-start»;case ke:return»catalog-object-click»;default:return}},[_r]:»Product»}},[Co]:{label:»Website Engagement»,description:»Engagement events (e.g. view/click) on this personalization are intended for the stock Website Engagement DMO»,eventModifiers:{[An]:»userEngagement»,[In]:e=>{switch(e.name){case ut:return»personalization-view»;case ke:return»personalization-click»;default:return}}}}},destinationDefaults:{byType:{HTMLElementModifier:»Other»,Handlebars:»Product»,AgentScript:»Other»},global:»Other»},attributes:{engagements:{[ut]:{description:’Apply to specific items/recs, and to the entire personalization (to generate an «overall» view/impression, especially relevant for a banner not using recs).’,scope:ct.Any,qualify:()=>da(ut),observe:(e,t)=>xc(e,t),handle:e=>ha(ut,e)},[ke]:{description:»Apply to an element in the personalization, to listen for click events (including bubbled ones), for engagement/attribution.»,scope:ct.Element,qualify:()=>da(ke),observe:(e,t)=>kc(e,t),handle:e=>ha(ke,e)}},eventModifiers:{[Ct]:{description:»Apply to an Engagement attribute, to specify the personalization content id (which rec in the decision) in the resulting engagement event.»,scope:ct.Element,valueType:Cn.SchemaPath,valueDefault:»[personalizationContentId]»,modifyEvent:(e,t,n)=>{D(n.personalization)&&(n.personalization={}),n.personalization.contentId=e}},[At]:{description:»Apply to an Engagement attribute, to specify the object id (e.g. product id) in the resulting engagement event.»,scope:ct.Element,valueType:Cn.SchemaPath,valueDefault:»[ssot__Id__c]»,modifyEvent:(e,t,n)=>{if(t.eventModifiers===void 0)return;const r=t.eventModifiers[It];switch(r){case»Product»:n.interaction.id=e;return;case»Other»:n.interaction.catalogObjectId=e;return;default:P.log.warn(`Unknown Engagement Destination «${r!=null?r:»»}»`)}}},[It]:{description:’Chosen entry from «engagementDestinations», which will modify the resulting engagement event accordingly.’,scope:ct.Any,modifyEvent:(e,t,n)=>{const r=ca(e);if(r===void 0){P.log.warn(`Destination name «${e}» not found, cannot be applied to the event.`);return}for(const i in r.eventModifiers){const o=xr(i);if(o===void 0){P.log.warn(`Modifier name «${i}» unknown, cannot be applied to the event.`);continue}const s=r.eventModifiers[i];let l;if(b(s)?l=s:l=s(t),l===void 0){P.log.warn(`Modifier Name «${i}» resulted in no value and as such is not applied to the event.`);continue}o.modifyEvent(l,t,n)}}},[In]:{description:’Defined by chosen entry in «engagementDestinations», for the «interaction name» in the resulting engagement event.’,modifyEvent:(e,t,n)=>{D(n.interaction)?n.interaction={name:e}:n.interaction.name=e}},[An]:{description:’Defined by chosen entry in «engagementDestinations», for the «event type» in the resulting engagement event.’,modifyEvent:(e,t,n)=>{D(n.interaction)&&(n.interaction={name:»»}),n.interaction.eventType=e}},[_r]:{description:’Defined by chosen entry in «engagementDestinations», for the «type» in the resulting engagement event.’,modifyEvent:(e,t,n)=>{D(n.interaction)&&(n.interaction={name:»»}),n.interaction.type=e}}}}},oa={destinations:{},destinationDefaults:{global:»»}};let Qt=Oc,aa=!0;function He(){return Qt!=null?Qt:oa}function Dc(e){e===void 0?Qt=oa:Qt=e,aa=Mc(Qt)}function Mc(e){var t,n;return!(!N((t=e==null?void 0:e.attributes)==null?void 0:t.engagements)||uu.some(r=>{var i;return D((i=e.attributes)==null?void 0:i.engagements[r])})||!N((n=e==null?void 0:e.attributes)==null?void 0:n.eventModifiers)||cu.some(r=>{var i;return D((i=e.attributes)==null?void 0:i.eventModifiers[r])})||!N(e==null?void 0:e.destinations,!1)||Po.some(r=>D(e.destinations[r]))||!N(e==null?void 0:e.destinationDefaults)||!Po.includes(e.destinationDefaults.global))}function sa(){return aa}function la(){const e=He();if(e===void 0||e.destinations===void 0||Object.keys(e.destinations).length===0){P.log.warn(«Engagement Configuration does not have any Config for Destinations»);return}return e}function ua(){const e=la();return e===void 0?[]:Object.keys(e.destinations)}function ca(e){if(!b(e)){P.log.warn(«A valid destination string must be provided in order to find its Engagement Destination configuration»);return}const t=la();if(t!==void 0){if(!(e in t.destinations)){P.log.warn(`Engagement Configuration does not Config for Destination «${e}»`);return}return t.destinations[e]}}function fa(e){if(!b(e)){P.log.warn(«A valid attribute name string must be provided in order to find its Engagement Attribute configuration»);return}const t=He();if(t===void 0||t.attributes===void 0){P.log.warn(«Engagement Configuration does not have any Config for Attributes»);return}if(!(e in t.attributes.engagements)){P.log.warn(`Engagement Configuration does not Config for Attribute «${e}»`);return}return t.attributes.engagements[e]}function xr(e){if(!b(e)){P.log.warn(«A valid modifier name string must be provided in order to find its Engagement Modifier configuration»);return}const t=He();if(t===void 0||t.attributes===void 0){P.log.warn(«Engagement Configuration does not have any Config for Attributes»);return}if(!(e in t.attributes.eventModifiers)){P.log.warn(`Engagement Configuration does not have Config for Event Modifier «${e}»`);return}return t.attributes.eventModifiers[e]}function da(e){const t=fa(e);if(t===void 0)return;const n=`${bt}${e}`,r=Ki(n),i=Array.of(…document.querySelectorAll(r));for(const s of i)t.observe(s,t);const o=new MutationObserver(s=>{if(document===void 0){o.disconnect();return}s.forEach(l=>{switch(l.type){case»attributes»:Rc(l,n,t);break;case»childList»:Lc(l,n,t);break;default:P.log.error(`Unsupported mutation type: ${l.type}`)}})});o.observe(document,{attributes:!0,attributeFilter:[n],attributeOldValue:!1,childList:!0,subtree:!0}),document.addEventListener(P.CustomEvents.OnShutDown,()=>{o.disconnect()})}function Rc(e,t,n){if(!(e.target instanceof Element)||t!==e.attributeName)return;const r=e.target.getAttribute(t);b(r)&&n.observe(e.target,n)}function Lc(e,t,n){if(!(e.target instanceof Element))return;const r=Array.from(e.addedNodes).filter(o=>o instanceof Element);if(r.length===0)return;const i=Ki(t);r.forEach(o=>{o.hasAttribute(t)&&n.observe(o,n),o.querySelectorAll(i).forEach(s=>{n.observe(s,n)})})}let Nt=new WeakMap;function xc(e,t){if(Nt.has(e)){P.log.debug(«Already observing element for visibility»,e);return}P.log.debug(«Observing element for visibility»,e);const n=Al.pageElementVisible(e);Nt.set(e,n),n.then(r=>{if(Nt.get(r)!==n){P.log.debug(«Element now visible, but aborting, no longer current observer»,r);return}P.log.debug(«Element now visible, calling handle»,r),t.handle(r)}).catch(r=>{P.log.warn(«Failed to observe element for visibility»,e,r)}).finally(()=>{if(Nt.get(e)!==n){P.log.debug(«Observing element for visibility completed, was no longer current observer»,e);return}P.log.debug(«Observing element for visibility completed»,e),Nt.delete(e)})}let Rn=new WeakMap;function kc(e,t){if(Rn.has(e)){P.log.debug(«Already observing element for click»,e);return}P.log.debug(«Observing element for click»,e);const n=r=>{r.target instanceof Element?e.contains(r.target)?Rn.get(e)!==n?(P.log.debug(«Click within element, but aborting, no longer current observer»,r.target,e),e.removeEventListener(ke,n)):(P.log.debug(«Click within element, calling handle»,r.target,e),t.handle(e)):P.log.warn(«Click event target is not contained by expected element»,r.target,e):P.log.warn(«Click event target is not an element»,r.target,e)};Rn.set(e,n),e.addEventListener(ke,n),document.addEventListener(P.CustomEvents.OnShutDown,()=>{e.removeEventListener(ke,n)})}function Uc(){Nt=new WeakMap,Rn=new WeakMap}function ha(e,t){const n=Hc(e,t);if(D(n))return;const r=Fc(n);D(r)||P.sendEvent(r).catch(i=>{P.log.error(`Failed to send personalization engagement event ${JSON.stringify(r)}`,i)})}function Hc(e,t){var n,r;const i=(n=t.closest(`[${xe}]`))==null?void 0:n.getAttribute(xe);if(!b(i))return P.log.warn(`${xe} not found in DOM hierarchy for element`,t),null;if(fa(e)===void 0)return P.log.warn(`No engagement attribute definition found for ${e}`),null;const o=`${bt}${e}`;if(!t.hasAttribute(o))return P.log.warn(`Engagement attribute ${e} not found on element`,t),null;const s={},l=o.substring(5),a=(r=P.cashDom(t).attr(o))!=null?r:»»,u=P.cashDom(t).data(l);P.log.debug(`Found ${e} with modifiers ${a}`,t),N(u,!1)?Object.keys(u).forEach(p=>{if(!b(p)){P.log.warn(`Ignoring empty/non-string modifier key within: ${a}`);return}const c=xr(p);if(D(c)){P.log.warn(`Ignoring unknown modifier: ${p}`);return}const h=u[p];if(!b(h)){P.log.warn(`The value for event modifier «${p}» for engagement attribute of «${e}» is not a string and thus can’t be used`);return}s[p]=h}):a.trim().length>0&&P.log.warn(`The value for engagement attribute ${e} was not valid JSON, so cannot process modifiers.`);const f={name:e,element:t,eventModifiers:s,personalizationId:i};return Go(i)&&(f.isPreview=!0),f}function Fc(e){var t,n,r;if(D(e))return null;const i={interaction:{name:»»},personalization:{id:e.personalizationId}};et(e.isPreview)&&e.isPreview&&(i.personalization.isTesting=!0);for(const l in e.eventModifiers){const a=xr(l);if(D(a)){P.log.warn(`Ignoring unknown modifier: ${l}`);break}const u=e.eventModifiers[l];if(!b(u)){P.log.warn(`The value for event modifier «${l}» for engagement attribute of «${e.name}» is not a string and thus can’t be used`);break}try{a.modifyEvent(u,e,i)}catch(f){P.log.error(`Could not set the value for event modifier «${l}» for engagement attribute of «${e.name}»`,f)}}b((t=i.interaction)==null?void 0:t.name)||P.log.warn(«Resulting engagement event has no/empty interaction.name, is likely misconfigured, and will likely be suppressed from sending»);const o=(n=e.eventModifiers)==null?void 0:n[It],s=b(o)?ca(o):void 0;return(s==null?void 0:s.disableSendingNonItemEngagementEvents)===!0&&!b((r=i.personalization)==null?void 0:r.contentId)?(P.log.debug(`Not sending event due to disableSendingNonItemEngagementEvents and no contentId string: ${JSON.stringify(i)}`),null):i}function zc(e){if(!N(e))throw new Y(q.DestinationEventModifiersAreRequired,»Engagement destination event modifiers are required.»);Object.entries(e).forEach(([t,n])=>{if(!b(n)&&typeof n!=»function»)throw new Y(q.InvalidDestinationEventModifier,»Engagement destinations event modifier must be a function or a valid string.»)})}function Vc(e){if(!N(e)||Object.keys(e).length===0)throw new Y(q.EngagementDestinationsAreRequired,»Engagement destinations are required.»);Object.entries(e).forEach(([t,n])=>{if(n.description!==void 0&&!b(n.description))throw new Y(q.InvalidEngagementDestinationDescription,»Engagement destination description must be a string if provided.»);zc(n.eventModifiers)})}function Bc(e){if(!N(e))throw new Y(q.EngagementDestinationDefaultsAreRequired,»Engagement destination defaults are required.»);if(e.byName!==void 0){if(!N(e.byName))throw new Y(q.InvalidEngagementDestinationDefaultByName,»Engagement destination defaults by name must be an object if provided.»);Object.entries(e.byName).forEach(([,t])=>{if(!b(t))throw new Y(q.InvalidEngagementDestinationDefaultByNameValue,»Engagement destination by name must have a valid string value.»)})}if(e.byType!==void 0){if(!N(e.byType))throw new Y(q.InvalidEngagementDestinationDefaultByType,»Engagement destination defaults by type must be an object if provided.»);Object.entries(e.byType).forEach(([,t])=>{if(!b(t))throw new Y(q.InvalidEngagementDestinationDefaultByTypeValue,»Engagement destination by type must have a valid string value.»)})}if(!b(e.global))throw new Y(q.InvalidEngagementDestinationDefaultGlobal,»Engagement destination global default must be valid string value.»)}function pa(e,t){var n;if(e.description!==void 0&&!b(e.description))throw new Y(q.InvalidEngagementDestinationAttributeDescription,»Engagement destination attribute description must be a valid string if provided.»,{context:{type:t}});if(e.scope!==void 0&&!((n=Object.values(ct))!=null&&n.includes(e.scope)))throw new Y(q.InvalidEngagementDestinationAttributeScope,»Engagement destination attribute scope should be a valid Engagement Attribute Scope if provided.»,{context:{type:t,scope:e.scope}})}function Gc(e){if(!N(e))throw new Y(q.InvalidEngagementDestinationAttributeEngagements,»Engagement destination attribute engagements must be a valid object.»);Object.entries(e).forEach(([,t])=>{if(!N(t))throw new Y(q.InvalidEngagementDestinationAttributeEngagementValue,»Engagement destination attribute engagements value must be a valid object.»);if(pa(t,»engagements»),t.qualify===void 0)throw new Y(q.MissingEngagementDestinationAttributeEngagementQualify,»Engagement destination attribute engagements must define a qualify function.»);if(typeof t.qualify!=»function»)throw new Y(q.InvalidEngagementDestinationAttributeEngagementQualify,»Engagement destination attribute engagements qualify must be a function.»);if(t.observe===void 0)throw new Y(q.MissingEngagementDestinationAttributeEngagementObserve,»Engagement destination attribute engagements must define an observe function.»);if(typeof t.observe!=»function»)throw new Y(q.InvalidEngagementDestinationAttributeEngagementObserve,»Engagement destination attribute engagements observe must be a function.»);if(t.handle===void 0)throw new Y(q.MissingEngagementDestinationAttributeEngagementHandle,»Engagement destination attribute engagements must define a handle function.»);if(typeof t.handle!=»function»)throw new Y(q.InvalidEngagementDestinationAttributeEngagementHandle,»Engagement destination attribute engagements handle must be a function.»)})}function jc(e){if(!N(e))throw new Y(q.InvalidEngagementDestinationAttributeEventModifiers,»Engagement destination attribute event modifiers must be a valid object.»);Object.entries(e).forEach(([,t])=>{var n;if(!N(t))throw new Y(q.InvalidEngagementDestinationAttributeEventModifiersValue,»Engagement destination attribute event modifiers value must be a valid object.»);if(pa(t,»eventModifiers»),t.modifyEvent===void 0)throw new Y(q.MissingEngagementDestinationAttributeEventModifierModifyEvent,»Engagement destination attribute event modifiers must define a modifyEvent function.»);if(typeof t.modifyEvent!=»function»)throw new Y(q.InvalidEngagementDestinationAttributeEventModifierModifyEvent,»Engagement destination attribute event modifiers modifyEvent must be a function.»);if(t.valueType!==void 0&&!((n=Object.values(Cn))!=null&&n.includes(t.valueType)))throw new Y(q.InvalidEngagementDestinationAttributeEventModifierValueType,»Engagement destination attribute event modifiers value type should be a valid Engagement Attribute Value Type if provided.»,{context:{valueType:t.valueType}});if(t.valueDefault!==void 0&&!b(t.valueDefault,!1,!0))throw new Y(q.InvalidEngagementDestinationAttributeEventModifierValueDefault,»Engagement destination attribute event modifiers value default should be a valid non-empty string if provided.»)})}function Wc(e){if(!N(e))throw new Y(q.InvalidEngagementDestinationAttributes,»Engagement destination attributes must be a valid object if provided.»);Gc(e.engagements),jc(e.eventModifiers)}function ga(e){if(!N(e))throw new Y(q.InvalidConfig,»Config is required.»);Vc(e.destinations),Bc(e.destinationDefaults),e.attributes!==void 0&&Wc(e.attributes)}function ma(e){if(nt()){if(!N(e,!1)){P.log.error(«A config is required when setting Engagement Config.»);return}try{ga(e),Dc(e),P.log.info(«Set Engagement Config to the following: «,e)}catch(t){P.log.error(`Engagement Config could not be set due to: ${K(t).message}`)}}else P.log.error(«Engagement Config can only be set before SalesforceInteractions.init is called.»)}var kr=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{l(n.next(a))}catch(u){i(u)}},s=a=>{try{l(n.throw(a))}catch(u){i(u)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,s);l((n=n.apply(e,t)).next())});class qc extends Lr{validateMethod(t){if(t!==void 0&&t!==$.ReplaceElementContent)throw new M(R.TransformationConfigMethodNotSupported,»Transformation Config method not supported for the specific type of transformer.»,{context:{transformerType:ge.HtmlElementModifier,provided:t,required:$.ReplaceElementContent}})}validateSubstitutionValues(t){if(t===void 0||Object.entries(t).length===0)throw new M(R.MissingTransformationSubstitutionValues,»Transformation substitution values are required for the specific type of transformer.»,{context:{transformerType:ge.HtmlElementModifier}})}transform(t,n,r,i,o){const s=o.pec.name,l=i.personalizationId,a=n.transformerName,u=`pec ${s} transformer ${a} for personalization ${l}`;if(n.substitutionValues===void 0){const p=new oe(fe.MissingSubstitutions,`missing substitutionValues for transformation so cannot get the data from Personalization response, ${u}`);return y.log.warn(p.message),o.status.update(new k(p)),{promise:Promise.reject(p),revert:c=>kr(this,null,function*(){c.update(new k(`Nothing to revert, no transformation attempt, ${p.message}`)),yield Promise.resolve()})}}if(Object.entries(n.substitutionValues).length===0){const p=new oe(fe.MissingSubstitutions,»missing an entry in substitutionValues for transformation so cannot get the data from Personalization response»);return y.log.warn(p.message),o.status.update(new k(p)),{promise:Promise.reject(p),revert:c=>kr(this,null,function*(){c.update(new k(`Nothing to revert, no transformation attempt, ${p.message}`)),yield Promise.resolve()})}}o.status.update(new k(`Awaiting element/conditions ${u}`));const f=r.then(p=>{if(this.isElementAlreadyPersonalized(p)){y.log.error(«Aborting personalization, element is already personalized»,p);const I=new oe(fe.AlreadyPersonalized,`Aborting ${u}, element is already personalized`);throw o.status.update(new k(I)),I}if(ta(l,o,n),!D(o.revertStatus)){const I=`Aborting ${u}, revert has been called`;return y.log.info(I),o.status.update(new k(I)),m=>{m.update(new k(`Nothing to revert, since revert was requested before transformation, ${u}`))}}o.status.update(new k(`About to transform/render, element/conditions ready ${u}`));const c=p.outerHTML;let h,d;const g=He(),E=ia(o.pec.transformationConfig.engagementDestination,t.name,t.transformerType,g),w=sa();for(const I in n.substitutionValues){const m=n.substitutionValues[I];if(!b(m)){const O=`substitutionValues is missing a value for property «${I}» for transformation so cannot get the data from Personalization response`;y.log.warn(O),o.status.update(new k(O));continue}if(y.log.debug(`using dataPath ${m} to get data from personalization response`),w){const O=this.getPathParentObject(m,i),A=this.buildModifiersIfItemRelated(O,E,g);D(A)||(D(d)?(y.log.debug(`Using item-related modifiers ${JSON.stringify(A)} found adjacent to path «${m}»`),h=m,d=A):(A[Ct]!==d[Ct]||A[At]!==d[At])&&y.log.warn(`Ignoring different item-related modifiers ${JSON.stringify(A)} found adjacent to path «${m}», already using modifiers from path «${h}»`))}const T=this.isAttributeAssignment(I);if(T!==void 0)try{const O=this.getSanitizedContentString(m,i);if(b(O))if(T){this.setAttributeContent(p,I,O);const A=`Set attribute ${I} to ${O}, ${u}`;y.log.trace(A+», element:»,p),o.status.update(new k(A))}else{this.setProperty(p,I,O);const A=`Set property ${I} to ${O}, ${u}`;y.log.trace(A+», element:»,p),o.status.update(new k(A))}else{const A=`Could not set property ${I}, nothing found at path ${m}`;y.log.debug(A+», element:»,p),o.status.update(new k(A))}}catch(O){const A=`Could not set content for ${u}, subVal «${I}»`;y.log.error(A,O);const U=new Error(A+»: «+K(O).message);o.status.update(new k(U))}}let _;return w?(D(d)?(this.autoInjectDefaultRootAttributes(p,l,E,!0),_=»Auto-injected engagement attributes without item ids»):(this.autoInjectDefaultItemAttributes(p,l,d,!0),_=»Auto-injected engagement attributes with item ids»),y.log.trace(_+`, ${u}`)):(_=»Engagement Config does not support auto-injection of default engagement attributes»,y.log.trace(_)),o.status.update(new k(_)),I=>{let m=`Reverting ${u}`;y.log.debug(m,p),I.update(new k(m)),p.insertAdjacentHTML(«beforebegin»,c),p.remove(),m=`Reverted ${u}`,y.log.debug(m,p),I.update(new k(m))}});return{promise:f.then(),revert:p=>kr(this,null,function*(){p.update(new k(«Awaiting transformPromise»));const c=f.then(h=>{h(p)},h=>{if(h instanceof oe){p.update(new k(`Nothing to revert, no transformation attempt, ${u}`));return}throw h});c.catch(h=>{const d=new Error(`Issue reverting ${u}: `+K(h).message);y.log.error(d),p.update(new k(d))}),yield c})}}isAttributeAssignment(t){const n=t.split(«.»);if(n[0].toLowerCase()===»attributes»){if(n.length===2)return!0;y.log.warn(`multiple objects for ‘attributes’ with propertyName ‘${t}’ is not supported`);return}return!1}getAttributeContent(t,n){const r=n.split(«.»);return t.getAttribute(r[1])}removeAttribute(t,n){const r=n.split(«.»);t.removeAttribute(r[1])}setAttributeContent(t,n,r){const i=n.split(«.»);t.setAttribute(i[1],r)}setProperty(t,n,r){r=this.handleSpecialValues(n,r);const i=n.split(«.»);i.length>1?this.setProperty(t[i[0]],i[1],r):Object.assign(t,{[n]:r})}getProperty(t,n){const r=n.split(«.»);return r.length>1?this.getProperty(t[r[0]],r[1]):t[n]}handleSpecialValues(t,n){if(t.toLowerCase()===»style.backgroundimage»&&b(n))try{return`url(${encodeURI(n)})`}catch(r){y.log.warn(`Could not set style.backgroundImage to a URL «${n}» due to: `,r)}return n}}function $c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,»default»)?e.default:e}var Ur={exports:{}},Hr={exports:{}},we={},X={};X.__esModule=!0,X.extend=va,X.indexOf=Qc,X.escapeExpression=Jc,X.isEmpty=ef,X.createFrame=tf,X.blockParams=nf,X.appendContextPath=rf;var Yc={«&»:»&»,»<":"<",">«:»>»,'»‘:»"»,»‘»:»'»,»`»:»`»,»=»:»=»},Zc=/[&<>«‘`=]/g,Kc=/[&<>«‘`=]/;function Xc(e){return Yc[e]}function va(e){for(var t=1;t0?(o.ids&&(o.ids=[o.name]),r.helpers.each(i,o)):s(this);if(o.data&&o.ids){var a=n.createFrame(o.data);a.contextPath=n.appendContextPath(o.data.contextPath,o.name),o={data:a}}return l(i,o)})},e.exports=t.default})(Br,Br.exports);var of=Br.exports,Gr={exports:{}};(function(e,t){t.__esModule=!0;function n(s){return s&&s.__esModule?s:{default:s}}var r=X,i=Pe,o=n(i);t.default=function(s){s.registerHelper(«each»,function(l,a){if(!a)throw new o.default(«Must pass iterator to #each»);var u=a.fn,f=a.inverse,p=0,c=»»,h=void 0,d=void 0;a.data&&a.ids&&(d=r.appendContextPath(a.data.contextPath,a.ids[0])+».»),r.isFunction(l)&&(l=l.call(this)),a.data&&(h=r.createFrame(a.data));function g(m,T,O){h&&(h.key=m,h.index=T,h.first=T===0,h.last=!!O,d&&(h.contextPath=d+m)),c=c+u(l[m],{data:h,blockParams:r.blockParams([l[m],m],[d+m,null])})}if(l&&typeof l==»object»)if(r.isArray(l))for(var E=l.length;p=0?o=s:o=parseInt(o,10)}return o},log:function(o){if(o=r.lookupLevel(o),typeof console!=»undefined»&&r.lookupLevel(r.level)<=o){var s=r.methodMap[o];console[s]||(s="log");for(var l=arguments.length,a=Array(l>1?l-1:0),u=1;u= 2.0.0-beta.1″,7:»>= 4.0.0 <4.3.0",8:">= 4.3.0″};we.REVISION_CHANGES=Kf;var ei=»[object Object]»;function ti(e,t,n){this.helpers=e||{},this.partials=t||{},this.decorators=n||{},Gf.registerDefaultHelpers(this),jf.registerDefaultDecorators(this)}ti.prototype={constructor:ti,logger:xn.default,log:xn.default.log,registerHelper:function(t,n){if(ht.toString.call(t)===ei){if(n)throw new Jr.default(«Arg not supported with multiple helpers»);ht.extend(this.helpers,t)}else this.helpers[t]=n},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,n){if(ht.toString.call(t)===ei)ht.extend(this.partials,t);else{if(typeof n==»undefined»)throw new Jr.default(‘Attempting to register a partial called «‘+t+'» as undefined’);this.partials[t]=n}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,n){if(ht.toString.call(t)===ei){if(n)throw new Jr.default(«Arg not supported with multiple decorators»);ht.extend(this.decorators,t)}else this.decorators[t]=n},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){qf.resetLoggedProperties()}};var Xf=xn.default.log;we.log=Xf,we.createFrame=ht.createFrame,we.logger=xn.default;var ni={exports:{}};(function(e,t){t.__esModule=!0;function n(r){this.string=r}n.prototype.toString=n.prototype.toHTML=function(){return»»+this.string},t.default=n,e.exports=t.default})(ni,ni.exports);var Qf=ni.exports,at={},ri={};ri.__esModule=!0,ri.wrapHelper=Jf;function Jf(e,t){if(typeof e!=»function»)return e;var n=function(){var i=arguments[arguments.length-1];return arguments[arguments.length-1]=t(i),e.apply(this,arguments)};return n}at.__esModule=!0,at.checkRevision=od,at.template=ad,at.wrapProgram=kn,at.resolvePartial=sd,at.invokePartial=ld,at.noop=Ia;function ed(e){return e&&e.__esModule?e:{default:e}}function td(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var nd=X,$e=td(nd),rd=Pe,Ye=ed(rd),Ze=we,wa=Jt,id=ri,Sa=Ot;function od(e){var t=e&&e[0]||1,n=Ze.COMPILER_REVISION;if(!(t>=Ze.LAST_COMPATIBLE_COMPILER_REVISION&&t<=Ze.COMPILER_REVISION))if(t2&&V.push(«‘»+this.terminals_[U]+»‘»);this.lexer.showPosition?Fe=»Parse error on line «+(d+1)+`: `+this.lexer.showPosition()+` Expecting `+V.join(«, «)+», got ‘»+(this.terminals_[I]||I)+»‘»:Fe=»Parse error on line «+(d+1)+»: Unexpected «+(I==1?»end of input»:»‘»+(this.terminals_[I]||I)+»‘»),this.parseError(Fe,{text:this.lexer.match,token:this.terminals_[I]||I,line:this.lexer.yylineno,loc:E,expected:V})}}if(T[0]instanceof Array&&T.length>1)throw new Error(«Parse Error: multiple actions possible at state: «+m+», token: «+I);switch(T[0]){case 1:u.push(I),f.push(this.lexer.yytext),p.push(this.lexer.yylloc),u.push(T[1]),I=null,g=this.lexer.yyleng,h=this.lexer.yytext,d=this.lexer.yylineno,E=this.lexer.yylloc;break;case 2:if(Q=this.productions_[T[1]][1],A.$=f[f.length-Q],A._$={first_line:p[p.length-(Q||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(Q||1)].first_column,last_column:p[p.length-1].last_column},w&&(A._$.range=[p[p.length-(Q||1)].range[0],p[p.length-1].range[1]]),O=this.performAction.call(A,h,g,d,this.yy,T[1],f,p),typeof O!=»undefined»)return O;Q&&(u=u.slice(0,-1*Q*2),f=f.slice(0,-1*Q),p=p.slice(0,-1*Q)),u.push(this.productions_[T[1]][0]),f.push(A.$),p.push(A._$),W=c[u[u.length-2]][u[u.length-1]],u.push(W);break;case 3:return!0}}return!0}},i=function(){var s={EOF:1,parseError:function(a,u){if(this.yy.parser)this.yy.parser.parseError(a,u);else throw new Error(a)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=»»,this.conditionStack=[«INITIAL»],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var u=a.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var u=a.length,f=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u-1),this.offset-=u;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1&&(this.yylineno-=f.length-1);var c=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===p.length?this.yylloc.first_column:0)+p[p.length-f.length].length-f[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[c[0],c[0]+this.yyleng-u]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?»…»:»»)+a.substr(-20).replace(/\n/g,»»)},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?»…»:»»)).replace(/\n/g,»»)},showPosition:function(){var a=this.pastInput(),u=new Array(a.length+1).join(«-«);return a+this.upcomingInput()+` `+u+»^»},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,u,f,p,c;this._more||(this.yytext=»»,this.match=»»);for(var h=this._currentRules(),d=0;du[0].length)&&(u=f,p=d,!this.options.flex)));d++);return u?(c=u[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],a=this.performAction.call(this,this.yy,this,h[p],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a||void 0):this._input===»»?this.EOF:this.parseError(«Lexical error on line «+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:»»,token:null,line:this.yylineno})},lex:function(){var a=this.next();return typeof a!=»undefined»?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return s.options={},s.performAction=function(a,u,f,p){function c(h,d){return u.yytext=u.yytext.substring(h,u.yyleng-d+h)}switch(f){case 0:if(u.yytext.slice(-2)===»\\\\»?(c(0,1),this.begin(«mu»)):u.yytext.slice(-1)===»\\»?(c(0,1),this.begin(«emu»)):this.begin(«mu»),u.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin(«raw»),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]===»raw»?15:(c(5,9),»END_RAW_BLOCK»);case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin(«raw»),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(u.yytext),this.popState(),this.begin(«com»);break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return u.yytext=c(1,2).replace(/\\»/g,'»‘),80;case 32:return u.yytext=c(1,2).replace(/\\’/g,»‘»),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return u.yytext=u.yytext.replace(/\\([\\\]])/g,»$1″),72;case 43:return»INVALID»;case 44:return 5}},s.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!»#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?–(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!–)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:»(\\[«]|[^»])*»)/,/^(?:'(\\[‘]|[^’])*’)/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!»#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],s.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},s}();r.lexer=i;function o(){this.yy={}}return o.prototype=r,r.Parser=o,new o}();t.default=n,e.exports=t.default})(ai,ai.exports);var hd=ai.exports,si={exports:{}},li={exports:{}};(function(e,t){t.__esModule=!0;function n(u){return u&&u.__esModule?u:{default:u}}var r=Pe,i=n(r);function o(){this.parents=[]}o.prototype={constructor:o,mutating:!1,acceptKey:function(f,p){var c=this.accept(f[p]);if(this.mutating){if(c&&!o.prototype[c.type])throw new i.default(‘Unexpected node type «‘+c.type+'» found when accepting ‘+p+» on «+f.type);f[p]=c}},acceptRequired:function(f,p){if(this.acceptKey(f,p),!f[p])throw new i.default(f.type+» requires «+p)},acceptArray:function(f){for(var p=0,c=f.length;p0)throw new ui.default(«Invalid path: «+r,{loc:n});a===»..»&&o++}else i.push(a)}return{type:»PathExpression»,data:e,depth:o,parts:i,original:r,loc:n}}function bd(e,t,n,r,i,o){var s=r.charAt(3)||r.charAt(2),l=s!==»{«&&s!==»&»,a=/\*/.test(r);return{type:a?»Decorator»:»MustacheStatement»,path:e,params:t,hash:n,escaped:l,strip:i,loc:this.locInfo(o)}}function wd(e,t,n,r){ci(e,n),r=this.locInfo(r);var i={type:»Program»,body:t,strip:{},loc:r};return{type:»BlockStatement»,path:e.path,params:e.params,hash:e.hash,program:i,openStrip:{},inverseStrip:{},closeStrip:{},loc:r}}function Sd(e,t,n,r,i,o){r&&r.path&&ci(e,r);var s=/\*/.test(e.open);t.blockParams=e.blockParams;var l=void 0,a=void 0;if(n){if(s)throw new ui.default(«Unexpected inverse block on decorator»,n);n.chain&&(n.program.body[0].closeStrip=r.strip),a=n.strip,l=n.program}return i&&(i=l,l=t,t=i),{type:s?»DecoratorBlock»:»BlockStatement»,path:e.path,params:e.params,hash:e.hash,program:t,inverse:l,openStrip:e.strip,inverseStrip:a,closeStrip:r&&r.strip,loc:this.locInfo(o)}}function Id(e,t){if(!t&&e.length){var n=e[0].loc,r=e[e.length-1].loc;n&&r&&(t={source:n.source,start:{line:n.start.line,column:n.start.column},end:{line:r.end.line,column:r.end.column}})}return{type:»Program»,body:e,strip:{},loc:t}}function Ad(e,t,n,r){return ci(e,n),{type:»PartialBlockStatement»,name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:n&&n.strip,loc:this.locInfo(r)}}en.__esModule=!0,en.parseWithoutProcessing=Da,en.parse=Ld;function Cd(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function Oa(e){return e&&e.__esModule?e:{default:e}}var Pd=hd,fi=Oa(Pd),Nd=pd,Od=Oa(Nd),Dd=Se,Md=Cd(Dd),Rd=X;en.parser=fi.default;var Un={};Rd.extend(Un,Md);function Da(e,t){if(e.type===»Program»)return e;fi.default.yy=Un,Un.locInfo=function(r){return new Un.SourceLocation(t&&t.srcName,r)};var n=fi.default.parse(e);return n}function Ld(e,t){var n=Da(e,t),r=new Od.default(t);return r.accept(n)}var tn={};tn.__esModule=!0,tn.Compiler=di,tn.precompile=Hd,tn.compile=Fd;function Ma(e){return e&&e.__esModule?e:{default:e}}var xd=Pe,nn=Ma(xd),rn=X,kd=Pa,on=Ma(kd),Ud=[].slice;function di(){}di.prototype={compiler:di,equals:function(t){var n=this.opcodes.length;if(t.opcodes.length!==n)return!1;for(var r=0;r1)throw new nn.default(«Unsupported number of partial arguments: «+r.length,t);r.length||(this.options.explicitPartialContext?this.opcode(«pushLiteral»,»undefined»):r.push({type:»PathExpression»,parts:[],depth:0}));var i=t.name.original,o=t.name.type===»SubExpression»;o&&this.accept(t.name),this.setupFullMustacheParams(t,n,void 0,!0);var s=t.indent||»»;this.options.preventIndent&&s&&(this.opcode(«appendContent»,s),s=»»),this.opcode(«invokePartial»,o,i,s),this.opcode(«append»)},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode(«appendEscaped»):this.opcode(«append»)},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode(«appendContent»,t.value)},CommentStatement:function(){},SubExpression:function(t){La(t);var n=this.classifySexpr(t);n===»simple»?this.simpleSexpr(t):n===»helper»?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,n,r){var i=t.path,o=i.parts[0],s=n!=null||r!=null;this.opcode(«getContext»,i.depth),this.opcode(«pushProgram»,n),this.opcode(«pushProgram»,r),i.strict=!0,this.accept(i),this.opcode(«invokeAmbiguous»,o,s)},simpleSexpr:function(t){var n=t.path;n.strict=!0,this.accept(n),this.opcode(«resolvePossibleLambda»)},helperSexpr:function(t,n,r){var i=this.setupFullMustacheParams(t,n,r),o=t.path,s=o.parts[0];if(this.options.knownHelpers[s])this.opcode(«invokeKnownHelper»,i.length,s);else{if(this.options.knownHelpersOnly)throw new nn.default(«You specified knownHelpersOnly, but used the unknown helper «+s,t);o.strict=!0,o.falsy=!0,this.accept(o),this.opcode(«invokeHelper»,i.length,o.original,on.default.helpers.simpleId(o))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode(«getContext»,t.depth);var n=t.parts[0],r=on.default.helpers.scopedId(t),i=!t.depth&&!r&&this.blockParamIndex(n);i?this.opcode(«lookupBlockParam»,i,t.parts):n?t.data?(this.options.data=!0,this.opcode(«lookupData»,t.depth,t.parts,t.strict)):this.opcode(«lookupOnContext»,t.parts,t.falsy,t.strict,r):this.opcode(«pushContext»)},StringLiteral:function(t){this.opcode(«pushString»,t.value)},NumberLiteral:function(t){this.opcode(«pushLiteral»,t.value)},BooleanLiteral:function(t){this.opcode(«pushLiteral»,t.value)},UndefinedLiteral:function(){this.opcode(«pushLiteral»,»undefined»)},NullLiteral:function(){this.opcode(«pushLiteral»,»null»)},Hash:function(t){var n=t.pairs,r=0,i=n.length;for(this.opcode(«pushHash»);r=0)return[n,o]}}};function Hd(e,t,n){if(e==null||typeof e!=»string»&&e.type!==»Program»)throw new nn.default(«You must pass a string or Handlebars AST to Handlebars.precompile. You passed «+e);t=t||{},»data»in t||(t.data=!0),t.compat&&(t.useDepths=!0);var r=n.parse(e,t),i=new n.Compiler().compile(r,t);return new n.JavaScriptCompiler().compile(i,t)}function Fd(e,t,n){if(t===void 0&&(t={}),e==null||typeof e!=»string»&&e.type!==»Program»)throw new nn.default(«You must pass a string or Handlebars AST to Handlebars.compile. You passed «+e);t=rn.extend({},t),»data»in t||(t.data=!0),t.compat&&(t.useDepths=!0);var r=void 0;function i(){var s=n.parse(e,t),l=new n.Compiler().compile(s,t),a=new n.JavaScriptCompiler().compile(l,t,void 0,!0);return n.template(a)}function o(s,l){return r||(r=i()),r.call(this,s,l)}return o._setup=function(s){return r||(r=i()),r._setup(s)},o._child=function(s,l,a,u){return r||(r=i()),r._child(s,l,a,u)},o}function Ra(e,t){if(e===t)return!0;if(rn.isArray(e)&&rn.isArray(t)&&e.length===t.length){for(var n=0;n>1;return a?-u:u}return Hn.encode=function(a){var u=»»,f,p=o(a);do f=p&r,p>>>=t,p>0&&(f|=i),u+=e.encode(f);while(p>0);return u},Hn.decode=function(a,u,f){var p=a.length,c=0,h=0,d,g;do{if(u>=p)throw new Error(«Expected more digits in base 64 VLQ value.»);if(g=e.decode(a.charCodeAt(u++)),g===-1)throw new Error(«Invalid base64 digit: «+a.charAt(u-1));d=!!(g&i),g&=r,c=c+(g<=0;V–)Q=U[V],Q===».»?U.splice(V,1):Q===»..»?W++:W>0&&(Q===»»?(U.splice(V+1,W),W=0):(U.splice(V,2),W–));return T=U.join(«/»),T===»»&&(T=A?»/»:».»),O?(O.path=T,o(O)):T}e.normalize=s;function l(m,T){m===»»&&(m=».»),T===»»&&(T=».»);var O=i(T),A=i(m);if(A&&(m=A.path||»/»),O&&!O.scheme)return A&&(O.scheme=A.scheme),o(O);if(O||T.match(r))return T;if(A&&!A.host&&!A.path)return A.host=T,o(A);var U=T.charAt(0)===»/»?T:s(m.replace(/\/+$/,»»)+»/»+T);return A?(A.path=U,o(A)):U}e.join=l,e.isAbsolute=function(m){return m.charAt(0)===»/»||n.test(m)};function a(m,T){m===»»&&(m=».»),m=m.replace(/\/$/,»»);for(var O=0;T.indexOf(m+»/»)!==0;){var A=m.lastIndexOf(«/»);if(A<0||(m=m.slice(0,A),m.match(/^([^\/]+:\/)?\/*$/)))return T;++O}return Array(O+1).join("../")+T.substr(m.length+1)}e.relative=a;var u=function(){var m=Object.create(null);return!("__proto__"in m)}();function f(m){return m}function p(m){return h(m)?"$"+m:m}e.toSetString=u?f:p;function c(m){return h(m)?m.slice(1):m}e.fromSetString=u?f:c;function h(m){if(!m)return!1;var T=m.length;if(T<9||m.charCodeAt(T-1)!==95||m.charCodeAt(T-2)!==95||m.charCodeAt(T-3)!==111||m.charCodeAt(T-4)!==116||m.charCodeAt(T-5)!==111||m.charCodeAt(T-6)!==114||m.charCodeAt(T-7)!==112||m.charCodeAt(T-8)!==95||m.charCodeAt(T-9)!==95)return!1;for(var O=T-10;O>=0;O–)if(m.charCodeAt(O)!==36)return!1;return!0}function d(m,T,O){var A=E(m.source,T.source);return A!==0||(A=m.originalLine-T.originalLine,A!==0)||(A=m.originalColumn-T.originalColumn,A!==0||O)||(A=m.generatedColumn-T.generatedColumn,A!==0)||(A=m.generatedLine-T.generatedLine,A!==0)?A:E(m.name,T.name)}e.compareByOriginalPositions=d;function g(m,T,O){var A=m.generatedLine-T.generatedLine;return A!==0||(A=m.generatedColumn-T.generatedColumn,A!==0||O)||(A=E(m.source,T.source),A!==0)||(A=m.originalLine-T.originalLine,A!==0)||(A=m.originalColumn-T.originalColumn,A!==0)?A:E(m.name,T.name)}e.compareByGeneratedPositionsDeflated=g;function E(m,T){return m===T?0:m===null?1:T===null?-1:m>T?1:-1}function w(m,T){var O=m.generatedLine-T.generatedLine;return O!==0||(O=m.generatedColumn-T.generatedColumn,O!==0)||(O=E(m.source,T.source),O!==0)||(O=m.originalLine-T.originalLine,O!==0)||(O=m.originalColumn-T.originalColumn,O!==0)?O:E(m.name,T.name)}e.compareByGeneratedPositionsInflated=w;function _(m){return JSON.parse(m.replace(/^\)]}'[^\n]*\n/,»»))}e.parseSourceMapInput=_;function I(m,T,O){if(T=T||»»,m&&(m[m.length-1]!==»/»&&T[0]!==»/»&&(m+=»/»),T=m+T),O){var A=i(O);if(!A)throw new Error(«sourceMapURL could not be parsed»);if(A.path){var U=A.path.lastIndexOf(«/»);U>=0&&(A.path=A.path.substring(0,U+1))}T=l(o(A),T)}return s(T)}e.computeSourceURL=I}(mi)),mi}var vi={},Fa;function za(){if(Fa)return vi;Fa=1;var e=sn(),t=Object.prototype.hasOwnProperty,n=typeof Map!=»undefined»;function r(){this._array=[],this._set=n?new Map:Object.create(null)}return r.fromArray=function(o,s){for(var l=new r,a=0,u=o.length;a=0)return s}else{var l=e.toSetString(o);if(t.call(this._set,l))return this._set[l]}throw new Error(‘»‘+o+'» is not in the set.’)},r.prototype.at=function(o){if(o>=0&&oo||s==o&&a>=l||e.compareByGeneratedPositionsInflated(r,i)<=0}function n(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}return n.prototype.unsortedForEach=function(i,o){this._array.forEach(i,o)},n.prototype.add=function(i){t(this._last,i)?(this._last=i,this._array.push(i)):(this._sorted=!1,this._array.push(i))},n.prototype.toArray=function(){return this._sorted||(this._array.sort(e.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},Ei.MappingList=n,Ei}var Ba;function Ga(){if(Ba)return gi;Ba=1;var e=Ua(),t=sn(),n=za().ArraySet,r=Vd().MappingList;function i(o){o||(o={}),this._file=t.getArg(o,"file",null),this._sourceRoot=t.getArg(o,"sourceRoot",null),this._skipValidation=t.getArg(o,"skipValidation",!1),this._sources=new n,this._names=new n,this._mappings=new r,this._sourcesContents=null}return i.prototype._version=3,i.fromSourceMap=function(s){var l=s.sourceRoot,a=new i({file:s.file,sourceRoot:l});return s.eachMapping(function(u){var f={generated:{line:u.generatedLine,column:u.generatedColumn}};u.source!=null&&(f.source=u.source,l!=null&&(f.source=t.relative(l,f.source)),f.original={line:u.originalLine,column:u.originalColumn},u.name!=null&&(f.name=u.name)),a.addMapping(f)}),s.sources.forEach(function(u){var f=u;l!==null&&(f=t.relative(l,u)),a._sources.has(f)||a._sources.add(f);var p=s.sourceContentFor(u);p!=null&&a.setSourceContent(u,p)}),a},i.prototype.addMapping=function(s){var l=t.getArg(s,"generated"),a=t.getArg(s,"original",null),u=t.getArg(s,"source",null),f=t.getArg(s,"name",null);this._skipValidation||this._validateMapping(l,a,u,f),u!=null&&(u=String(u),this._sources.has(u)||this._sources.add(u)),f!=null&&(f=String(f),this._names.has(f)||this._names.add(f)),this._mappings.add({generatedLine:l.line,generatedColumn:l.column,originalLine:a!=null&&a.line,originalColumn:a!=null&&a.column,source:u,name:f})},i.prototype.setSourceContent=function(s,l){var a=s;this._sourceRoot!=null&&(a=t.relative(this._sourceRoot,a)),l!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[t.toSetString(a)]=l):this._sourcesContents&&(delete this._sourcesContents[t.toSetString(a)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},i.prototype.applySourceMap=function(s,l,a){var u=l;if(l==null){if(s.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);u=s.file}var f=this._sourceRoot;f!=null&&(u=t.relative(f,u));var p=new n,c=new n;this._mappings.unsortedForEach(function(h){if(h.source===u&&h.originalLine!=null){var d=s.originalPositionFor({line:h.originalLine,column:h.originalColumn});d.source!=null&&(h.source=d.source,a!=null&&(h.source=t.join(a,h.source)),f!=null&&(h.source=t.relative(f,h.source)),h.originalLine=d.line,h.originalColumn=d.column,d.name!=null&&(h.name=d.name))}var g=h.source;g!=null&&!p.has(g)&&p.add(g);var E=h.name;E!=null&&!c.has(E)&&c.add(E)},this),this._sources=p,this._names=c,s.sources.forEach(function(h){var d=s.sourceContentFor(h);d!=null&&(a!=null&&(h=t.join(a,h)),f!=null&&(h=t.relative(f,h)),this.setSourceContent(h,d))},this)},i.prototype._validateMapping=function(s,l,a,u){if(l&&typeof l.line!="number"&&typeof l.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(s&&"line"in s&&"column"in s&&s.line>0&&s.column>=0&&!l&&!a&&!u)){if(s&&»line»in s&&»column»in s&&l&&»line»in l&&»column»in l&&s.line>0&&s.column>=0&&l.line>0&&l.column>=0&&a)return;throw new Error(«Invalid mapping: «+JSON.stringify({generated:s,source:a,original:l,name:u}))}},i.prototype._serializeMappings=function(){for(var s=0,l=1,a=0,u=0,f=0,p=0,c=»»,h,d,g,E,w=this._mappings.toArray(),_=0,I=w.length;_0){if(!t.compareByGeneratedPositionsInflated(d,w[_-1]))continue;h+=»,»}h+=e.encode(d.generatedColumn-s),s=d.generatedColumn,d.source!=null&&(E=this._sources.indexOf(d.source),h+=e.encode(E-p),p=E,h+=e.encode(d.originalLine-1-u),u=d.originalLine-1,h+=e.encode(d.originalColumn-a),a=d.originalColumn,d.name!=null&&(g=this._names.indexOf(d.name),h+=e.encode(g-f),f=g)),c+=h}return c},i.prototype._generateSourcesContent=function(s,l){return s.map(function(a){if(!this._sourcesContents)return null;l!=null&&(a=t.relative(l,a));var u=t.toSetString(a);return Object.prototype.hasOwnProperty.call(this._sourcesContents,u)?this._sourcesContents[u]:null},this)},i.prototype.toJSON=function(){var s={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(s.file=this._file),this._sourceRoot!=null&&(s.sourceRoot=this._sourceRoot),this._sourcesContents&&(s.sourcesContent=this._generateSourcesContent(s.sources,s.sourceRoot)),s},i.prototype.toString=function(){return JSON.stringify(this.toJSON())},gi.SourceMapGenerator=i,gi}var ln={},yi={},ja;function Bd(){return ja||(ja=1,function(e){e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2;function t(n,r,i,o,s,l){var a=Math.floor((r-n)/2)+n,u=s(i,o[a],!0);return u===0?a:u>0?r-a>1?t(a,r,i,o,s,l):l==e.LEAST_UPPER_BOUND?r1?t(n,a,i,o,s,l):l==e.LEAST_UPPER_BOUND?a:n<0?-1:n}e.search=function(r,i,o,s){if(i.length===0)return-1;var l=t(-1,i.length,r,i,o,s||e.GREATEST_LOWER_BOUND);if(l<0)return-1;for(;l-1>=0&&o(i[l],i[l-1],!0)===0;)–l;return l}}(yi)),yi}var _i={},Wa;function Gd(){if(Wa)return _i;Wa=1;function e(r,i,o){var s=r[i];r[i]=r[o],r[o]=s}function t(r,i){return Math.round(r+Math.random()*(i-r))}function n(r,i,o,s){if(o=0){var g=this._originalMappings[d];if(f.column===void 0)for(var E=g.originalLine;g&&g.originalLine===E;)h.push({line:e.getArg(g,»generatedLine»,null),column:e.getArg(g,»generatedColumn»,null),lastColumn:e.getArg(g,»lastGeneratedColumn»,null)}),g=this._originalMappings[++d];else for(var w=g.originalColumn;g&&g.originalLine===p&&g.originalColumn==w;)h.push({line:e.getArg(g,»generatedLine»,null),column:e.getArg(g,»generatedColumn»,null),lastColumn:e.getArg(g,»lastGeneratedColumn»,null)}),g=this._originalMappings[++d]}return h},ln.SourceMapConsumer=o;function s(u,f){var p=u;typeof u==»string»&&(p=e.parseSourceMapInput(u));var c=e.getArg(p,»version»),h=e.getArg(p,»sources»),d=e.getArg(p,»names»,[]),g=e.getArg(p,»sourceRoot»,null),E=e.getArg(p,»sourcesContent»,null),w=e.getArg(p,»mappings»),_=e.getArg(p,»file»,null);if(c!=this._version)throw new Error(«Unsupported version: «+c);g&&(g=e.normalize(g)),h=h.map(String).map(e.normalize).map(function(I){return g&&e.isAbsolute(g)&&e.isAbsolute(I)?e.relative(g,I):I}),this._names=n.fromArray(d.map(String),!0),this._sources=n.fromArray(h,!0),this._absoluteSources=this._sources.toArray().map(function(I){return e.computeSourceURL(g,I,f)}),this.sourceRoot=g,this.sourcesContent=E,this._mappings=w,this._sourceMapURL=f,this.file=_}s.prototype=Object.create(o.prototype),s.prototype.consumer=o,s.prototype._findSourceIndex=function(u){var f=u;if(this.sourceRoot!=null&&(f=e.relative(this.sourceRoot,f)),this._sources.has(f))return this._sources.indexOf(f);var p;for(p=0;p1&&(U.source=E+W[1],E+=W[1],U.originalLine=d+W[2],d=U.originalLine,U.originalLine+=1,U.originalColumn=g+W[3],g=U.originalColumn,W.length>4&&(U.name=w+W[4],w+=W[4])),A.push(U),typeof U.originalLine==»number»&&O.push(U)}i(A,e.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,i(O,e.compareByOriginalPositions),this.__originalMappings=O},s.prototype._findMapping=function(f,p,c,h,d,g){if(f[c]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+f[c]);if(f[h]<0)throw new TypeError("Column must be greater than or equal to 0, got "+f[h]);return t.search(f,p,d,g)},s.prototype.computeColumnSpans=function(){for(var f=0;f=0){var h=this._generatedMappings[c];if(h.generatedLine===p.generatedLine){var d=e.getArg(h,»source»,null);d!==null&&(d=this._sources.at(d),d=e.computeSourceURL(this.sourceRoot,d,this._sourceMapURL));var g=e.getArg(h,»name»,null);return g!==null&&(g=this._names.at(g)),{source:d,line:e.getArg(h,»originalLine»,null),column:e.getArg(h,»originalColumn»,null),name:g}}}return{source:null,line:null,column:null,name:null}},s.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(f){return f==null}):!1},s.prototype.sourceContentFor=function(f,p){if(!this.sourcesContent)return null;var c=this._findSourceIndex(f);if(c>=0)return this.sourcesContent[c];var h=f;this.sourceRoot!=null&&(h=e.relative(this.sourceRoot,h));var d;if(this.sourceRoot!=null&&(d=e.urlParse(this.sourceRoot))){var g=h.replace(/^file:\/\//,»»);if(d.scheme==»file»&&this._sources.has(g))return this.sourcesContent[this._sources.indexOf(g)];if((!d.path||d.path==»/»)&&this._sources.has(«/»+h))return this.sourcesContent[this._sources.indexOf(«/»+h)]}if(p)return null;throw new Error(‘»‘+h+'» is not in the SourceMap.’)},s.prototype.generatedPositionFor=function(f){var p=e.getArg(f,»source»);if(p=this._findSourceIndex(p),p<0)return{line:null,column:null,lastColumn:null};var c={source:p,originalLine:e.getArg(f,"line"),originalColumn:e.getArg(f,"column")},h=this._findMapping(c,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,e.getArg(f,"bias",o.GREATEST_LOWER_BOUND));if(h>=0){var d=this._originalMappings[h];if(d.source===c.source)return{line:e.getArg(d,»generatedLine»,null),column:e.getArg(d,»generatedColumn»,null),lastColumn:e.getArg(d,»lastGeneratedColumn»,null)}}return{line:null,column:null,lastColumn:null}},ln.BasicSourceMapConsumer=s;function a(u,f){var p=u;typeof u==»string»&&(p=e.parseSourceMapInput(u));var c=e.getArg(p,»version»),h=e.getArg(p,»sections»);if(c!=this._version)throw new Error(«Unsupported version: «+c);this._sources=new n,this._names=new n;var d={line:-1,column:0};this._sections=h.map(function(g){if(g.url)throw new Error(«Support for url field in sections not implemented.»);var E=e.getArg(g,»offset»),w=e.getArg(E,»line»),_=e.getArg(E,»column»);if(w=0;a–)this.prepend(l[a]);else if(l[i]||typeof l==»string»)this.children.unshift(l);else throw new TypeError(«Expected a SourceNode, string, or an array of SourceNodes and strings. Got «+l);return this},o.prototype.walk=function(l){for(var a,u=0,f=this.children.length;u0){for(a=[],u=0;u0&&(g+=», «+E.join(«, «));var w=0;Object.keys(this.aliases).forEach(function(m){var T=d.aliases[m];T.children&&T.referenceCount>1&&(g+=», alias»+ ++w+»=»+m,T.children[0]=»alias»+w)}),this.lookupPropertyFunctionIsUsed&&(g+=», «+this.lookupPropertyFunctionVarDeclaration());var _=[«container»,»depth0″,»helpers»,»partials»,»data»];(this.useBlockParams||this.useDepths)&&_.push(«blockParams»),this.useDepths&&_.push(«depths»);var I=this.mergeSource(g);return h?(_.push(I),Function.apply(this,_)):this.source.wrap([«function(«,_.join(«,»),`) { `,I,»}»])},mergeSource:function(h){var d=this.environment.isSimple,g=!this.forceBuffer,E=void 0,w=void 0,_=void 0,I=void 0;return this.source.each(function(m){m.appendToBuffer?(_?m.prepend(» + «):_=m,I=m):(_&&(w?_.prepend(«buffer += «):E=!0,I.add(«;»),_=I=void 0),w=!0,d||(g=!1))}),g?_?(_.prepend(«return «),I.add(«;»)):w||this.source.push(‘return «»;’):(h+=», buffer = «+(E?»»:this.initializeBuffer()),_?(_.prepend(«return buffer + «),I.add(«;»)):this.source.push(«return buffer;»)),h&&this.source.prepend(«var «+h.substring(2)+(E?»»:`; `)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return` lookupProperty = container.lookupProperty || function(parent, propertyName) { if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { return parent[propertyName]; } return undefined } `.trim()},blockValue:function(h){var d=this.aliasable(«container.hooks.blockHelperMissing»),g=[this.contextName(0)];this.setupHelperArgs(h,0,g);var E=this.popStack();g.splice(1,0,E),this.push(this.source.functionCall(d,»call»,g))},ambiguousBlockValue:function(){var h=this.aliasable(«container.hooks.blockHelperMissing»),d=[this.contextName(0)];this.setupHelperArgs(«»,0,d,!0),this.flushInline();var g=this.topStack();d.splice(1,0,g),this.pushSource([«if (!»,this.lastHelper,») { «,g,» = «,this.source.functionCall(h,»call»,d),»}»])},appendContent:function(h){this.pendingContent?h=this.pendingContent+h:this.pendingLocation=this.source.currentLocation,this.pendingContent=h},append:function(){if(this.isInline())this.replaceStack(function(d){return[» != null ? «,d,’ : «»‘]}),this.pushSource(this.appendToBuffer(this.popStack()));else{var h=this.popStack();this.pushSource([«if («,h,» != null) { «,this.appendToBuffer(h,void 0,!0),» }»]),this.environment.isSimple&&this.pushSource([«else { «,this.appendToBuffer(«»»,void 0,!0),» }»])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable(«container.escapeExpression»),»(«,this.popStack(),»)»]))},getContext:function(h){this.lastContext=h},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(h,d,g,E){var w=0;!E&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(h[w++])):this.pushContext(),this.resolvePath(«context»,h,w,d,g)},lookupBlockParam:function(h,d){this.useBlockParams=!0,this.push([«blockParams[«,h[0],»][«,h[1],»]»]),this.resolvePath(«context»,d,1)},lookupData:function(h,d,g){h?this.pushStackLiteral(«container.data(data, «+h+»)»):this.pushStackLiteral(«data»),this.resolvePath(«data»,d,0,!0,g)},resolvePath:function(h,d,g,E,w){var _=this;if(this.options.strict||this.options.assumeObjects){this.push(p(this.options.strict&&w,this,d,g,h));return}for(var I=d.length;gthis.stackVars.length&&this.stackVars.push(«stack»+this.stackSlot),this.topStackName()},topStackName:function(){return»stack»+this.stackSlot},flushInline:function(){var h=this.inlineStack;this.inlineStack=[];for(var d=0,g=h.length;dt in e?Kd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xa=(e,t)=>{for(var n in t||(t={}))Xd.call(t,n)&&Ka(e,n,t[n]);if(Za)for(var n of Za(t))Qd.call(t,n)&&Ka(e,n,t[n]);return e};class un extends Lr{constructor(){super();const t=un.getBuiltInHandlebarsHelpers();for(const[n,r]of Object.entries(t))st.registerHelper(n,r)}static getBuiltInHandlebarsHelpers(){return{subVar:uh,each:dh,isPreview:fh}}getContent(t,n,r,i){var o,s;let l=`transformation ${n.transformerName}`;r!==void 0&&(l=`personalization ${r.personalizationId}, `+l);const a=this,u=this.getHandlebarsTemplate(t),f=Xa({},(o=n.substitutionValues)!=null?o:{}),p=(s=t.substitutionDefinitions)!=null?s:{},c={},h=Pr(r==null?void 0:r.personalizationId,i.pec.name);Qi(«DEBUG»)&&y.log.debug(`For ${l}, rendering of template: \r ${u} \r SubstitutionValues: \r ${JSON.stringify(f)} \r Preview: ${String(h)}`),Object.entries(p).forEach(([T,O])=>{var A;c[T]=(A=O.configType)!=null?A:Re.SchemaPath,(!(T in f)||T in f&&(D(f[T])||f[T]===»»))&&(f[T]=O.defaultValue)});const d=He(),g=ia(i.pec.transformationConfig.engagementDestination,t.name,t.transformerType,d),E=sa(),w=this.transformerSupportsAutoInjection(t),_={data:{_sf_personalization:{subVar:f,subConfigTypes:c,destinationName:g,engagementConfig:d,ecSupportsAutoInjection:E,transformerSupportsAutoInjection:w,transformerInstance:a,isPreview:h}}};let I=a.compileTransformerDetails(u,r,_,i.status);E&&w&&r!==void 0?I=nh(a,I,r.personalizationId,g):(y.log.trace(`${E?»Transformer»:»Engagement Config»} does not support auto-injection of default engagement attributes`),i.status.update(new k(«No auto-injection of default engagement attributes»)));const m=En();return b(m)&&(I=th(I,m)),y.log.trace(`Rendered Content: ${I}`),i.status.update(new k(«Rendered Content»)),String(I)}compileTransformerDetails(t,n,r,i){const o=document.createElement(«script»);i.update(new k(«Precompiling template»));const s=st.precompile(t);if(!b(s))throw new Error(«Error while compiling handlebars template, precompilation did not result in a string»);o.textContent=»window.SalesforceInteractions.Personalization.precompiledTemplate = «+s;const l=En();b(l)&&(y.log.debug(«Adding nonce to inline script for handlebars precompile»),o.nonce=l),document.head.appendChild(o);const a=window.SalesforceInteractions.Personalization.precompiledTemplate;let u;try{if(!N(a))throw new Error(«Error while compiling handlebars template, compiled template is undefined. This is likely due to a Content Security Policy (CSP) violation.»);i.update(new k(«Forming template»)),u=st.template(a)}finally{delete window.SalesforceInteractions.Personalization.precompiledTemplate,document.head.removeChild(o)}const f=n!==void 0?Lr.sanitizer.sanitizeObject(n):{};return i.update(new k(«Using template»)),u(f,r)}}function Jd(e,t){if(!b(e))throw new B(j.InvalidHandlebarsHelperName,»Handlebars helper name is undefined»);if(D(t))throw new B(j.InvalidHandlebarsHelperFunction,»Handlebars helper function is undefined»);if(Object.keys(un.getBuiltInHandlebarsHelpers()).includes(e))throw new B(j.InvalidHandlebarsHelperName,`Handlebars helper ${e} is a reserved name. Please use a different name.`)}function eh(e,t){if(y.log.debug(`Adding the following custom handlebars helper: ${e}`),!nt()){y.log.error(«Handlebars helpers can only be added before SalesforceInteractions.init is called.»);return}try{Jd(e,t),st.registerHelper(e,(…n)=>{y.log.debug(`Custom handlebars helper ${e} called with following parameters:`,n);const r=t(…n);return y.log.debug(`Custom handlebars helper ${e} returned:`,r),r})}catch(n){y.log.error(`Custom handlebars helper ${e} could not be added due to: ${K(n).message}`)}}function th(e,t){return bi(e,n=>{for(const r of n)r instanceof HTMLStyleElement&&(y.log.debug(«Adding nonce to inline style»,r),r.nonce=t)})}function nh(e,t,n,r){return bi(t,i=>{for(let o=0;o{if(!i&&!(t&&o===»root»)){const s=parseInt(o);!isNaN(s)&&H(e)?(e=e[s],r=!0):o in e?(e=e[o],r=!0):(i=!0,r=!1,e=void 0)}}),[e,r]}function oh(e){let t;return b(e,!0)?t=e:D(e)?(y.log.debug(«Null/undefined substitution value provided to handlebars»),t=»»):(y.log.debug(«Coercing ${} substitution value provided to handlebars»),t=String(e)),t}function ah(e,t,n,r){const i=oh(t);try{let o;return n===Re.Static?o=lh(i):o=sh(e,i,r),y.log.trace(«Handlebars helper subVar returned:»,o),o}catch(o){y.log.warn(`Could not parse the substitution value path ${i} due to an error`,o)}return null}function sh(e,t,n){const r=st.parseWithoutProcessing(`{{${t}}}`);if((r==null?void 0:r.body)===void 0||r.body.length===0||r.body[0].type!==»MustacheStatement»)return y.log.warn(`Could not parse the substitution value path ${t} via handlebars`),null;const i=r.body[0];if(i.path===void 0)return y.log.warn(`Could not parse the substitution value path ${t} via handlebars treating it as a Mustache Statement`),null;const o=i.path;if(o.type!==»PathExpression»)return y.log.warn(`Could not parse the substitution value path ${t} via handlebars expecting it to be a Path Expression`),null;const s=o,[l,a]=rh(e,t,s,n),[u,f]=ih(l,a,s);return f?u:null}function lh(e){const t=st.parseWithoutProcessing(`${e}`);return(t==null?void 0:t.body)===void 0||t.body.length===0||t.body[0].type!==»ContentStatement»?(y.log.warn(`Could not parse the substitution value ${e} via handlebars`),null):e}function uh(e,t){var n,r,i;if(y.log.trace(«Handlebars helper subVar called with following parameters:»,e),!b(e)||((r=(n=t==null?void 0:t.data)==null?void 0:n._sf_personalization)==null?void 0:r.subVar)===void 0||!(e in t.data._sf_personalization.subVar))return null;const o=t.data._sf_personalization.subVar[e],s=(i=t.data._sf_personalization.subConfigTypes[e])!=null?i:Re.SchemaPath;return ah(this,o,s,t)}function ch(e,t,n){let r=n;if(e._sf_personalization.ecSupportsAutoInjection&&e._sf_personalization.transformerSupportsAutoInjection){const i=e._sf_personalization.transformerInstance.buildModifiersIfItemRelated(t,e._sf_personalization.destinationName,e._sf_personalization.engagementConfig);!D(i)&&b(n)&&(r=bi(n,o=>{for(let s=0,l=o.length;s{s!==void 0&&(s.key=a,s.index=f,s.first=f===0,s.last=!!p);const c=n(u,{data:s,blockParams:[e[a],a]}),h=ch(s,u,c);o=o+h};if(!D(e)&&typeof e==»object»){const a=e;if(H(e,!0))for(let u=e.length;i{u!==void 0&&l(u,a[u],i-1,!1),u=f,i++}),u!==void 0&&l(u,a[u],i-1,!0)}}return i===0&&(o=r(this)),y.log.trace(«Handlebars helper each returned:»,o),o}class hh extends un{validateTransformerDetails(t){if(!this.isHandlebarsTransformerDetails(t))throw new B(j.InvalidTransformerTypeDetails,»Transformer Type Details is not the correct type.»,{context:{expectedType:»HandlebarsTransformerDetails»}});this.validateHandlebarsTransformerDetails(t)}isHandlebarsTransformerDetails(t){return(t==null?void 0:t.html)!==void 0}validateHandlebarsTransformerDetails(t){if(!N(t))throw new B(j.InvalidTransformerTypeDetailsType,»Transformer Type Details is not a valid object.»);if(!b(t.html))throw new B(j.MissingTransformerTypeDetailsHtml,»Transformer Type Details html is required for the specific Transformer Type Details.»,{context:{type:»HandlebarsTransformerDetails»}})}validateMethod(t){if(t===void 0)throw new M(R.MissingTransformationConfigMethod,»Transformation Config method is required for specific transformer type.»,{context:{transformerType:ge.Handlebars}})}transform(t,n,r,i,o){const s=()=>this.getContent(t,n,i,o);return this.setContent(r,s,n,t.transformerType,o,i==null?void 0:i.personalizationId,o.pec.transformationConfig.method)}getHandlebarsTemplate(t){return t.transformerTypeDetails.html}transformerSupportsAutoInjection(t){var n;return!((n=t.transformerTypeDetails.disableAutoInjectionOfEngagementAttributes)!=null&&n)}}class ph extends un{validateTransformerDetails(t){if(!this.isAgentTransformerDetails(t))throw new B(j.InvalidTransformerTypeDetails,»Transformer Type Details is not the correct type.»,{context:{expectedType:»AgentScriptTransformerDetails»}});this.validateAgentTransformerDetails(t)}isAgentTransformerDetails(t){return(t==null?void 0:t.script)!==void 0}validateAgentTransformerDetails(t){if(!N(t))throw new B(j.InvalidTransformerTypeDetailsType,»Transformer Type Details is not a valid object.»);if(!b(t.script))throw new B(j.MissingTransformerTypeDetailsHtml,»Transformer Type Details script is required for the specific Transformer Type Details.»,{context:{expectedType:»AgentScriptTransformerDetails»}})}validateMethod(t){if(t!==void 0)throw new M(R.InvalidTransformationConfigMethod,»Transformation Config method is not allowed for specific transformer type.»,{context:{transformerType:ge.AgentScript}})}transform(t,n,r,i,o){const s=()=>this.getContent(t,n,i,o);return this.setContent(r,s,n,t.transformerType,o,i==null?void 0:i.personalizationId,o.pec.transformationConfig.method)}getHandlebarsTemplate(t){return t.transformerTypeDetails.script}transformerSupportsAutoInjection(){return!1}supportsEngagementSelection(){return!1}}function Qa(e){switch(e){case ge.HtmlElementModifier:return new qc;case ge.Handlebars:return new hh;case ge.AgentScript:return new ph;default:return}}function wi(e){const t=Qa(e);if(t===void 0)throw new B(j.MissingImplementation,»Transformer does not have an implementation»,{context:{transformerType:e}});return t}var gh={name:»HTMLElementModifier»,transformerType:ge.HtmlElementModifier,transformerCategory:rt.EmbeddedContent,transformerTypeDetails:{}};let Ke=Object.assign([],[gh]);function Vn(){return Ke!=null?Ke:[]}function Ja(e,t=!1){function n(r){if(nt()){if(!H(r,!0)){y.log.error(«A list of transformers is required when adding to Transformers.»);return}Ke===void 0&&(Ke=[]);let i=r;if(t){const o=Ke.map(s=>s.name);i=[],r.forEach(s=>{!b(s.name)||!o.includes(s.name)?i.push(s):y.log.debug(`Not adding Transformer «${s.name}» because it already exists`)})}i.forEach(o=>{try{if(_h(o),Ke.find(s=>o.name===s.name)!==void 0)throw new B(j.DuplicateTransformer,»Transformer already exists.»,{context:{transformerName:o.name}});y.log.info(«Adding the following Transformer: «,o),Ke.push(o)}catch(s){y.log.error(`Transformers could not be added due to: ${K(s).message}`,o)}})}else y.log.error(«The list of Transformers can only be modified before SalesforceInteractions.init is called.»)}if(b(e))try{const r=JSON.parse(e,Xi);n(r)}catch(r){y.log.error(«JSON Transformers list could not be added due to: «,r)}else n(e)}function es(e){Ja(e)}function mh(e){Ja(e,!0)}function ts(e=Re.SchemaPath){switch(e){case Re.SchemaPath:case Re.Static:return yn.String;default:throw new B(j.InvalidSubstitutionConfigType,»Substitution Definition config type is not supported.»,{context:{configType:e}})}}function vh(e,t=rt.EmbeddedContent){if(!Hl[t].supportedTypes.includes(e))throw new B(j.InvalidTransformerTypeForCategory,»Transformer Type is not allowed for Transformer Category.»,{context:{category:t,type:e}})}function ns(e=yn.String,t){switch(e){case yn.String:if(!b(t))throw new B(j.InvalidSubstitutionDefinitionValue,»Substitution Definition value is incorrect type.»,{context:{expectedType:e,value:t}});break;default:throw new B(j.InvalidSubstitutionDefinitionConfigDataType,»»,{context:{configDataType:e}})}}function Eh(e){var t;if(!N(e))throw new B(j.MissingTransformerSubstitutionDefinition,»Transformer substitution definition object is required.»);if(e.label!==void 0&&!b(e.label))throw new B(j.InvalidSubstitutionDefinitionLabel,»Transformer substitution definition label is required to be a string if provided.»);if(e.description!==void 0&&!b(e.description))throw new B(j.InvalidSubstitutionDefinitionDescription,»Transformer substitution definition description is required to be a string if provided.»);if(e.configType!==void 0&&!((t=Object.values(Re))!=null&&t.includes(e.configType)))throw new B(j.InvalidSubstitutionDefinitionConfigType,»Transformer substitution definition config type should be a valid Substitution Definition Config Type if provided.»,{context:{configType:e.configType}});e.defaultValue!==void 0&&ns(ts(e.configType),e.defaultValue)}function yh(e){if(!N(e))throw new B(j.InvalidSubstitutionDefinitions,»Transformer substitution definitions is not a record.»);Object.entries(e).forEach(([t,n])=>{if(!b(t))throw new B(j.MissingTransformerSubstitutionDefinitionKey,»Transformer substitution definition key is required.»);Eh(n)})}function _h(e){var t,n;if(!N(e))throw new B(j.MissingTransformer,»Transformer is required.»);if(!b(e.name))throw new B(j.MissingTransformerName,»Transformer name is required.»);if(e.label!==void 0&&!b(e.label))throw new B(j.InvalidTransformerLabel,»Transformer label is required to be a string if provided.»);if(e.description!==void 0&&!b(e.description))throw new B(j.InvalidTransformerDescription,»Transformer description is required to be a string if provided.»);if(e.schemaReference!==void 0&&!b(e.schemaReference))throw new B(j.InvalidTransformerSchemaReference,»Transformer schema reference is required to be a string if provided.»);if(!((t=Object.values(ge))!=null&&t.includes(e.transformerType)))throw new B(j.InvalidTransformerType,»Transformer type is not a valid Transformer Type.»,{context:{transformerType:e.transformerType}});if(e.transformerCategory!==void 0&&!((n=Object.values(rt))!=null&&n.includes(e.transformerCategory)))throw new B(j.InvalidTransformerCategory,»Transformer category is not a valid Transformer Category.»,{context:{transformerCategory:e.transformerCategory}});if(vh(e.transformerType,e.transformerCategory),e.substitutionDefinitions!==void 0&&yh(e.substitutionDefinitions),!N(e.transformerTypeDetails))throw new B(j.MissingTransformerTypeDetails,»Transformer transformer type details are required.»);if(e.publishedDate!==void 0)try{e.publishedDate=Ft(«publishedDate»,e.publishedDate)}catch(r){throw new B(j.InvalidPublishedDate,»Transformer published date should be a number or date if provided.»)}if(e.lastModifiedDate!==void 0)try{e.lastModifiedDate=Ft(«lastModifiedDate»,e.lastModifiedDate)}catch(r){throw new B(j.InvalidLastModifiedDate,»Transformer last modified date should be a number or date if provided.»)}wi(e.transformerType).validateTransformerDetails(e.transformerTypeDetails)}function rs(e){return H(Ke)?Ke.filter(t=>{var n;return((n=t.transformerCategory)!=null?n:rt.EmbeddedContent)===e}):[]}function Th(e){return wi(e.transformerType).supportsEngagementSelection()}const is=/\*\s*\*/;function bh(e){var t;if(!N(e))throw new M(R.InvalidSourceMatchers,»Source Matchers is not a valid array.»);if(!((t=Object.values(Te))!=null&&t.includes(e.type)))throw new M(R.InvalidSourceMatcherType,»Source Matcher type is not a valid Source Matcher Type.»,{context:{sourceMatcherType:e.type}});if(!b(e.value))throw new M(R.MissingSourceMatcherValue,»Source Matcher value is required.»);if(e.value!==e.value.trim())throw new M(R.PaddedSourceMatcherValue,»Source Matcher value has leading or trailing spaces.»,{context:{sourceMatcherValue:e.value}});if(e.type===Te.PageUrlMatcher){if(e.value===»*»)throw new M(R.InvalidSourceMatcherValueOnlyStar,»Source Matcher value cannot be only * char.»);if(e.value.includes(«**»))throw new M(R.InvalidSourceMatcherValueRepeatedStars,»Source Matcher value cannot have repeated * chars.»);if(is.lastIndex=0,is.test(e.value))throw new M(R.InvalidSourceMatcherValueSpaceWithStars,»Source Matcher value cannot have * followed by a space followed by a *.»)}}function wh(e){if(!H(e))throw new M(R.MissingSourceMatchers,»Source Matchers are required.»);e.forEach(t=>bh(t))}function os(e,t,n){switch(e.type){case Te.PageType:return Ch(e,t);case Te.PageUrlMatcher:return Ah(e,n);default:return y.log.warn(`Support missing for SourceMatcherType: ${e.type}`),!1}}function Sh(e){if(e.type!==Te.PageUrlMatcher){y.log.warn(«Ignoring SourceMatcher, since type is not PageUrlMatcher»);return}let t=encodeURIComponent(e.value.trim());return t=t.replace(/[.()!’]/g,»\\$&»),t=t.replace(/\*/g,».*»),new RegExp(t,»i»)}function Ih(e){if(b(e))return encodeURIComponent(e)}function Ah(e,t){const n=Ih(t);if(!b(n))return y.log.debug(«Ignoring match, url is not a non-empty string»),!1;const r=Sh(e);return D(r)?!1:r.test(n)}function Ch(e,t){return b(t)?t===e.value.trim():(y.log.debug(«Ignoring match, pageType is not a non-empty string»),!1)}var Ph=Object.defineProperty,Nh=Object.defineProperties,Oh=Object.getOwnPropertyDescriptors,as=Object.getOwnPropertySymbols,Dh=Object.prototype.hasOwnProperty,Mh=Object.prototype.propertyIsEnumerable,ss=(e,t,n)=>t in e?Ph(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rh=(e,t)=>{for(var n in t||(t={}))Dh.call(t,n)&&ss(e,n,t[n]);if(as)for(var n of as(t))Mh.call(t,n)&&ss(e,n,t[n]);return e},Lh=(e,t)=>Nh(e,Oh(t)),Si=(e=>(e.DataCloudModuleConfig=»DATA_CLOUD_MODULE_CONFIG»,e.Other=»OTHER»,e))(Si||{});let cn=[];const Bn={DATA_CLOUD_MODULE_CONFIG:null,OTHER:[]};function Ne(){return cn!=null?cn:[]}function xh(e){cn=[…e]}function kh(e,t){const n=H(t,!0)?t:Ne();if(!(!H(n)||!b(e)))return n.find(r=>nr(r.name,e))}function ls(e,t){return b(e)?(H(t,!0)?t:Ne()).filter(n=>n.sourceMatchers.some(r=>r.type===Te.PageUrlMatcher&&os(r,»»,e))):[]}function us(e,t){return b(e)?(H(t,!0)?t:Ne()).filter(n=>n.sourceMatchers.some(r=>r.type===Te.PageType&&os(r,e,»»))):[]}function Uh(e,t){return Object.values(Te).includes(e)?(H(t,!0)?t:Ne()).filter(n=>n.sourceMatchers.some(r=>r.type===e)):[]}function Hh(e){var t,n;if(!N(e))throw new M(R.MissingDataProvider,»DataProvider is required.»);if(e.type!==void 0&&!((t=Object.values(ur))!=null&&t.includes(e.type)))throw new M(R.InvalidDataProviderType,»Data Provider type should be a valid Data Provider Type if provided.»,{context:{type:e.type}});if(!b(e.value))throw new M(R.MissingDataProviderValue,»Data Provider value is required.»);if(e.groupByType!==void 0&&!Object.values(lo).includes(e.groupByType))throw new M(R.InvalidDataProviderGroupByType,»Data Provider group by type should be a valid Data Provider Group By Type if provided.»,{context:{groupByType:e.groupByType}});if(e.groupByReferenceType!==void 0&&!((n=Object.values(so))!=null&&n.includes(e.groupByReferenceType)))throw new M(R.InvalidDataProviderGroupByReferenceType,»Data Provider group by reference type should be a valid Reference Type if provided.»,{context:{referenceType:e.groupByReferenceType}});if(!b(e.groupByValue)&&(e.groupByType!==void 0||e.groupByReferenceType!==void 0))throw new M(R.MissingDataGroupByValue,»Data Provider group by value is required if Data Provider group by type or reference type is set.»)}function Fh(e){if(J(e,»name»))throw new M(R.TransformationNameNotSupported,»Transformation Name is not supported for method type.»,{context:{methodType:$.AddOverlay}});if(J(e,»tag»))throw new M(R.TransformationTagNotSupported,»Transformation Tag is not supported for method type.»,{context:{methodType:$.AddOverlay}});if(J(e,»path»))throw new M(R.TransformationPathNotSupported,»Transformation Path is not supported for method type.»,{context:{methodType:$.AddOverlay}})}function zh(e){if(!b(e.name))throw new M(R.MissingTransformationName,»Transformation Name is required.»,{context:{transformationType:»ContentZone»}})}function Vh(e){if(!b(e.tag))throw new M(R.MissingTransformationTag,»Transformation Tag is required.»,{context:{transformationType:»Element»}});if(!b(e.path))throw new M(R.MissingTransformationPath,»Transformation Path is required.»,{context:{transformationType:»Element»}})}function Bh(e){return Object.keys(e).some(t=>![«transformerName»,»substitutionValues»].includes(t))}function Gh(e){return jh(e,Vn())}function jh(e,t){if(!b(e))throw new M(R.MissingTransformerName,»Transformer Name is required.»);if(t.length===0)throw new M(R.TransformersNotAvailable,»There are no transformers available.»);const n=t.find(r=>r.name===e);if(n===void 0)throw new M(R.InvalidTransformerName,»Transformation Transformer Name is not a valid transformer.»,{context:{transformerName:e}});return n}function cs(e,t,n){Object.entries(t).forEach(([r,i])=>{var o;if(r in e)y.log.debug(`using substitution value for Substitution Definition of ${r} for Transformer ${n}`);else{if(i.defaultValue===void 0&&((o=i.required)==null||o))throw new M(R.MissingSubstitutionDefinitionDefaultValue,»Substitution Definition value is required and there is no default value specified.»,{context:{key:r}});y.log.debug(`using default value for Substitution Definition of ${r} for Transformer ${n}`)}})}function Wh(e,t,n){var r;if(!((r=t.overrideable)!=null&&r)&&n!==void 0)throw new M(R.InvalidTransformationSubstitutionValue,»Substitution Value is not allowed when Substitution Definition is not overridable.»,{context:{key:e}})}function qh(e,t){if(e.substitutionDefinitions!==void 0&&Object.values(e.substitutionDefinitions).find(n=>{var r;return((r=n.configType)!=null?r:Re.SchemaPath)===Re.SchemaPath})!==void 0&&(!N(t)||!Tn(t==null?void 0:t.type)))throw new M(R.InvalidTransformationSubstitutionValueType,»Personalization Point Data Provider is required when using Schema Path Substitution Definitions»)}function $h(e,t,n){var r;if(qh(t,n),e===void 0){t.substitutionDefinitions!==void 0&&cs({},t.substitutionDefinitions,t.name);return}if(!N(e))throw new M(R.InvalidTransformationSubstitutionValues,»Substitution Values is not a valid object.»);if(t.substitutionDefinitions!==void 0){const i=(r=t.substitutionDefinitions)!=null?r:{};Object.entries(e).forEach(([o,s])=>{if(o in i){const l=i[o];Wh(o,l,s),ns(ts(l.configType),s)}else throw new M(R.SubstitutionDefinitionKeyNotSupported,»Transformer does not support Substitution Definition Key.»,{context:{key:o}})}),cs(e,t.substitutionDefinitions,t.name)}else if(t.transformerType!==ge.HtmlElementModifier)if(Object.entries(e).length===0)y.log.warn(`transformer «${t.name}» does not accept substitutionValues`);else throw new M(R.TransformerDoesNotSupportSubstitutionValues,»Substitution Values are provided when transformer does not support Substitution Definitions.»)}function fs(e,t,n){var r;const i=Gh(e.transformerName);if(!((r=i.isEnabled)==null||r))throw new M(R.DisabledTransformer,»Transformer is disabled.»,{context:{transformer:i.name}});$h(e.substitutionValues,i,n);const o=wi(i.transformerType);o.validateMethod(t),o.validateSubstitutionValues(e.substitutionValues)}function Yh(e,t,n){if(!N(e))throw new M(R.MissingTransformation,»Transformation is required.»);if(!b(e.transformerName))throw new M(R.MissingTransformerName,»Transformer Name is required.»);if(e.substitutionValues!==void 0&&!N(e.substitutionValues))throw new M(R.InvalidTransformationSubstitutionValues,»Substitution Values is not a valid object.»);if(Tt(t))Fh(e);else if(Bh(e))if(Bt(e))zh(e);else if(it(e))Vh(e);else throw new M(R.InvalidTransformationType,»Transformation is not one of the supported types.»);nt()||fs(e,t,n)}function Zh(e,t,n){if(!H(e))throw new M(R.InvalidTransformations,»Transformations is required to be an array.»);if(e.forEach(r=>Yh(r,t,n)),t!==void 0&&t!==$.AddOverlay){if(t===$.ReplaceContentZoneContent&&!e.every(r=>_n(r,t)))throw new M(R.MethodRequiresSpecificTransformations,»Method requires specific transformation type(s).»,{context:{transformationType:»ContentZone»,methods:[$.ReplaceContentZoneContent]}});if(t===$.ContentZoneHandler&&!e.every(r=>cr(r,t)))throw new M(R.MethodRequiresSpecificTransformations,»Method requires specific transformation type(s).»,{context:{transformationType:»ContentZone»,methods:[$.ContentZoneHandler]}});if(t!==$.ReplaceContentZoneContent&&t!==$.ContentZoneHandler&&!e.every(r=>it(r)))throw new M(R.MethodRequiresSpecificTransformations,»Method requires specific transformation type(s).»,{context:{transformationType:»Element»,methods:[$.ReplaceElementContent,$.AddAfterElement,$.AddBeforeElement]}})}}function Kh(e,t){var n,r;if(!N(e))throw new M(R.MissingTransformationConfig,»Transformation Config is required.»);if(e.renderIfEmpty!==void 0&&!et(e.renderIfEmpty))throw new M(R.InvalidRenderIfEmpty,»Transformation Config Render If Empty should be a boolean if provided.»);if(!((n=Object.values(Ae))!=null&&n.includes(e.when)))throw new M(R.InvalidTransformationConfigWhen,»Transformation Config has an invalid Transformation Config When Type.»,{context:{whenType:e.when}});if(e.method!==void 0&&!((r=Object.values($))!=null&&r.includes(e.method)))throw new M(R.InvalidTransformationConfigMethod,»Transformation Config has an invalid Target Method Type.»,{context:{methodType:e.method}});switch(e.when){case Ae.Immediately:if(e.whenValues!==void 0)throw new M(R.WhenValuesNotSupported,»Transformation Config does not support when values for the specific Transformation Config When Type.»,{context:{whenType:e.when}});break;case Ae.ExitIntent:if(!Tt(e.method))throw new M(R.WhenTypeRequiresSpecificMethodType,»Transformation Config when type requires specific method type.»,{context:{whenType:e.when,methodType:$.AddOverlay}});if(!ho(e.whenValues))throw new M(R.InvalidTransformationConfigWhenTypes,»Transformation Config when values is invalid for the specific Transformation Config When Type.»,{context:{whenType:e.when}});if(!Ht(e.whenValues.delay)||e.whenValues.delay<0)throw new M(R.InvalidWhenValueDelay,"Transformation Config requires a numeric when values delay of 0 or greater for the specific Transformation Config When Type.",{context:{whenType:e.when}});break;case Ae.ElementClick:if(!Tt(e.method))throw new M(R.WhenTypeRequiresSpecificMethodType,"Transformation Config when type requires specific method type.",{context:{whenType:e.when,methodType:$.AddOverlay}});if(!co(e.whenValues))throw new M(R.InvalidTransformationConfigWhenTypes,"Transformation Config when values is invalid for the specific Transformation Config When Type.",{context:{whenType:e.when}});if(!b(e.whenValues.path))throw new M(R.InvalidWhenValuePath,"Transformation Config requires a string when values path for the specific Transformation Config When Type.",{context:{whenType:e.when}});if(e.whenValues.tag!==void 0&&!b(e.whenValues.tag))throw new M(R.InvalidWhenValueTag,"Transformation Config requires a string when values tag, if provided, for the specific Transformation Config When Type.",{context:{whenType:e.when}});break;case Ae.ScrollPercent:if(!Tt(e.method))throw new M(R.WhenTypeRequiresSpecificMethodType,"Transformation Config when type requires specific method type.",{context:{whenType:e.when,methodType:$.AddOverlay}});if(!fo(e.whenValues))throw new M(R.InvalidTransformationConfigWhenTypes,"Transformation Config when values is invalid for the specific Transformation Config When Type.",{context:{whenType:e.when}});if(!Ht(e.whenValues.percent)||e.whenValues.percent<0||e.whenValues.percent>1)throw new M(R.InvalidWhenValuePercent,»Transformation Config requires a numeric when values percent between 0 and 1 for the specific Transformation Config When Type.»,{context:{whenType:e.when}});break;default:throw new M(R.WhenValuesValidationLogicNotImplemented,»Transformation Config when values validation logic has not been implemented for the specific Transformation Config When Type.»,{context:{whenType:e.when}})}if(e.engagementDestination!==void 0&&!b(e.engagementDestination))throw new M(R.InvalidTransformationConfigEngagementDestination,»Transformation Config engagement destination should be a valid string if provided.»);Zh(e.transformations,e.method,t)}function Ii(e,t,n,r){if(!N(e))throw new M(R.MissingConfig,»Config is required.»);if(!b(e.name))throw new M(R.MissingName,»Name is required.»);if(e.label!==void 0&&!b(e.label))throw new M(R.InvalidLabel,»Label is required to be a string if provided.»);if(e.description!==void 0&&!b(e.description))throw new M(R.InvalidDescription,»Description is required to be a string if provided.»);if(e.dataProvider!==void 0&&Hh(e.dataProvider),wh(e.sourceMatchers),Kh(e.transformationConfig,e.dataProvider),e.publishedDate!==void 0&&!gn(e.publishedDate))try{e.publishedDate=Ft(«publishedDate»,e.publishedDate)}catch(i){throw new M(R.InvalidPublishedDate,»Published date should be a number or date if provided.»)}if(e.lastModifiedDate!==void 0&&!gn(e.lastModifiedDate))try{e.lastModifiedDate=Ft(«lastModifiedDate»,e.lastModifiedDate)}catch(i){throw new M(R.InvalidLastModifiedDate,»Last modified date should be a number or date if provided.»)}if(t!=null&&t&&n!==void 0){const i=[];if(ds(e,n,[],i),i.length>0)throw i[0]}if(r!=null&&r){const i=[];if(hs(e,[],i),i.length>0)throw i[0]}}function Ai(e){var t,n;if(((t=e==null?void 0:e.dataProvider)==null?void 0:t.type)!==void 0&&((n=e==null?void 0:e.dataProvider)==null?void 0:n.type)!==ur.PersonalizationPoint)throw new Pl(to.OnlySupportPersonalizationPoint,»Personalization Experience Config has Data Provider Type that is not Personalization Point, which is not currently supported.»,{context:{configName:e.name}})}function Ci(e,t=»OTHER»){function n(r){if(nt()){if(!H(r,!0)){y.log.error(«A list of personalization experience configs is required.»);return}t===»OTHER»&&Bn.OTHER.push(…r);const i=[];r.forEach(o=>{!b(o.name)||cn.findIndex(s=>nr(s.name,o.name))<0&&i.findIndex(s=>nr(s.name,o.name))<0?i.push(o):y.log.error(`Not adding Personalization Experience Config "${o.name}" because it already exists`)}),i.forEach(o=>{try{Ii(o),Ai(o),y.log.info(«Adding the following Personalization Experience Config: «,o),cn.push(o)}catch(s){y.log.error(`Personalization Experience Configs could not be added due to: ${K(s).message}`,o)}})}else y.log.error(«The list of Personalization Experience Configs can only be modified before SalesforceInteractions.init is called.»)}if(b(e))try{const r=JSON.parse(e,Xi);n(r)}catch(r){y.log.error(`JSON Personalization Experience Config list could not be initialized due to: ${K(r).message}`,r)}else n(e)}function Xh(e){Ci(e)}function Qh(){document.addEventListener(y.CustomEvents.OnInit,()=>{ap(),rp()}),document.addEventListener(y.CustomEvents.OnInitSitemap,e=>{tp(e.detail.sitemapConfig)})}function Jh(e){if(!H(e))return y.log.debug(«Ignoring non/empty array of personalizationExperienceConfigs»),{};const t={};return e.forEach(n=>{var r,i,o;if(!Tn((r=n.dataProvider)==null?void 0:r.type))y.log.warn(`Ignoring config: ${n.name} with unsupported dataProvider.type: ${String((i=n.dataProvider)==null?void 0:i.type)}`);else{const s=(o=n.dataProvider.groupByValue)!=null?o:Fl;let l=t[s];D(l)&&(l={},t[s]=l);const a=n.dataProvider.value;let u=l[a];D(u)&&(u={point:{name:a},pecNames:[]},l[a]=u),u.pecNames.includes(n.name)||u.pecNames.push(n.name)}}),t}function Pi(e){const t=e.filter(n=>b(n.getConfigName()));if(t.length>0){t.forEach(r=>{const i=r.getConfigName(),o=Ne().find(s=>s.name===i);o===void 0?y.log.error(`Could not find Personalization Experience Config with name ${i}`):y.log.error(`Personalization Experience Config with name ${i} is invalid due to: ${r.getMessageWithContext()} Config: `,o)});const n=t.map(r=>r.getConfigName());xh(Ne().filter(r=>!n.includes(r.name)))}}function ds(e,t,n,r){e.transformationConfig.transformations.forEach(i=>{_n(i,e.transformationConfig.method)&&(n.length===0&&dc(t).forEach(o=>n.push(o)),n.length===0?r.push(new M(R.ContentZonesNotAvailable,»There are no content zones configured in the sitemap or content zone is defined more than once.»,{context:{configName:e.name}})):n.find(o=>o===i.name)===void 0&&r.push(new M(R.InvalidTransformationContentZone,»Content zone is not defined in the sitemap or content zone is defined more than once.»,{context:{configName:e.name,contentZone:i.name}})))})}function ep(e){const t=[],n=[];return Ne().forEach(r=>{ds(r,e,t,n)}),n}function tp(e){const t=ep(e);Pi(t)}function hs(e,t,n){b(e.transformationConfig.engagementDestination)&&(t.length===0&&ua().forEach(r=>t.push(r)),t.length===0?n.push(new M(R.EngagementDestinationsNotAvailable,»There are no engagement destinations configured.»,{context:{configName:e.name}})):t.find(r=>r===e.transformationConfig.engagementDestination)===void 0&&n.push(new M(R.InvalidTransformationConfigEngagementDestinationName,»Engagement destination is not defined.»,{context:{configName:e.name,engagementDestination:e.transformationConfig.engagementDestination}})))}function np(){const e=[],t=[];return Ne().forEach(n=>{hs(n,e,t)}),t}function rp(){const e=np();Pi(e)}function ps(){return Bn}function ip(e,t){e===»DATA_CLOUD_MODULE_CONFIG»&&»list»in t&&H(t.list,!0)?Bn.DATA_CLOUD_MODULE_CONFIG=t:e===»OTHER»&&H(t,!0)&&(Bn.OTHER=t)}function op(){const e=[];return Ne().forEach(t=>{var n;try{const r=t.transformationConfig.method;t.transformationConfig.transformations.forEach(i=>{fs(i,r,t.dataProvider)})}catch(r){if(r instanceof Error)if(r instanceof M||r instanceof B){const i={context:Lh(Rh({},r.context),{configName:t.name}),cause:(n=r.cause)!=null?n:r},o=r instanceof M?new M(r.name,r.message,i):new B(r.name,r.message,i);e.push(o)}else e.push(new M(R.UnexpectedError,r.message,{context:{configName:t.name}}))}}),e}function ap(){const e=op();Pi(e)}var z=(e=>(e.SingleElementHtmlTransformer=»SingleElementHtmlTransformer»,e.MultiElementModifier=»MultiElementModifier»,e.WhenElementClick=»WhenElementClick»,e.Agent=»Agent»,e))(z||{}),fn=(e=>(e.Prod=»prod»,e.Test=»test»,e.ProdSandbox=»prod_sandbox»,e.TestSandbox=»test_sandbox»,e))(fn||{});const sp={configOptions:{SingleElementHtmlTransformer:{allowedElements:{div:{},p:{},header:{},footer:{},section:{},article:{},nav:{},table:{}}},MultiElementModifier:{allowedElements:{h1:{allowedProperties:[«innerText»]},h2:{allowedProperties:[«innerText»]},h3:{allowedProperties:[«innerText»]},h4:{allowedProperties:[«innerText»]},h5:{allowedProperties:[«innerText»]},h6:{allowedProperties:[«innerText»]},p:{allowedProperties:[«innerText»]},div:{allowedProperties:[«innerText»,»style.backgroundImage»]},a:{allowedProperties:[«innerText»,»attributes.href»]},img:{allowedProperties:[«attributes.src»]}}},WhenElementClick:{allowedElements:{input:{},button:{},img:{}}}}};var gs=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{l(n.next(a))}catch(u){i(u)}},s=a=>{try{l(n.throw(a))}catch(u){i(u)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,s);l((n=n.apply(e,t)).next())});const te={pageUrl:{},pageType:{}};function ms(){return gs(this,null,function*(){return D(te.pageUrl.matchedPromise)?yield Promise.reject(new Error(«getPromiseUrlMatch called too soon»)):yield te.pageUrl.matchedPromise})}function vs(){return gs(this,null,function*(){return D(te.pageType.matchedPromise)?yield Promise.reject(new Error(«getPromisePageMatch called too soon»)):yield te.pageType.matchedPromise})}const Gn=»sf_personalization_wpm»;function lp(){Oi(!1);const e=wl(Gn);window.history.replaceState({},document==null?void 0:document.title,e.toString()),window.location.reload()}function Ni(){try{return window.localStorage.getItem(Gn)===»true»}catch(e){return!1}}function Oi(e){try{window.localStorage.setItem(Gn,e?»true»:»false»)}catch(t){throw y.log.error(«Error trying to save client side editor mode.»,t),t}}const Es=»sf_personalization_wpm_env»,ys=»2″,up=`https://cdn.c360a.salesforce.com/npm/@salesforce/interactions-website-personalization-manager/${ys}/build/dist/index.min.js`,cp=`https://cdn.pc-rnd.c360a.salesforce.com/npm/@salesforce/interactions-website-personalization-manager/${ys}/build/dist/index.min.js`,_s={configOptions:{}};let jn=sp;function Ts(){return jn!=null?jn:_s}function fp(e){e===void 0?jn=_s:jn=e}function dp(){Zi(Gn)&&Oi(!0),document.addEventListener(y.CustomEvents.OnInit,Ss)}function bs(){if(Zi(Es)){const e=Tl(Es);if(e!==null){const t=e.toLowerCase();if(Object.values(fn).includes(t))return t}}return fn.Prod}function hp(){const e=bs(),t=e===fn.Test||e===fn.TestSandbox?cp:up;return y.log.debug(`WPM (client side editor) CDN Script is set to ${t}`),t}function pp(e,t){return Mn(e,t,He())}function gp(){const e=Vn();if(e.length>0){const t=e.find(n=>n.transformerType===ge.HtmlElementModifier);if(t!==void 0)return Mn(t.name,t.transformerType,He())}return Mn(«»,ge.HtmlElementModifier,He())}function mp(){return rs(rt.EmbeddedContent)}function vp(){return rs(rt.Agent)}function ws(){var e;const t={closeEditorMode:lp,determineEditorOption:As,getConfig:Ts,getAppSourceId:Ll,getPspConfig:xl,isInEditorMode:Ni,isPECSupported:Pp,checkPECSupport:Ps,getPromiseUrlMatch:ms,getPromisePageMatch:vs,findContentZoneNamesForPageConfig:cc,findContentZoneNamesForPageConfigs:fc,getEngagementDestinationNames:ua,determineHtmlElementModifierTransformerEngagementDestination:gp,determineTransformerEngagementDestination:pp,findPersonalizationExperienceConfigsMatchingPageType:us,findPersonalizationExperienceConfigsMatchingPageUrl:ls,getContentZoneSelectorByName:$o,getPersonalizationExperienceConfigsByInitializationSource:ps,matchesDataCloudHostname:Np,determineWpmEnvironment:bs,getAllContentZoneHandlers:Pu,evaluateContextualAttributes:Ar,getAllEmbeddedContentTransformers:mp,isEngagementSelectionSupported:Th,getAllWebAgentTransformers:vp};(e=window.SalesforceInteractions.Wpm)==null||e.initialize(t)}function Ss(){var e;if(Ni())if(((e=window.SalesforceInteractions.Wpm)==null?void 0:e.initialize)!==void 0)ws();else{const t=document.createElement(«script»);t.src=hp(),t.type=»text/javascript»,t.onload=ws,t.onerror=n=>{y.log.error(«Error trying to initialize WPM (client side editor)»,n)},document.head.appendChild(t)}}function Ep(){Oi(!0),Ss()}function yp(e){if(!N(e))throw new ye(pe.InvalidConfig,»Config is invalid.»,{context:{configType:z.SingleElementHtmlTransformer}});if((e==null?void 0:e.allowedElements)!==void 0){const t=e==null?void 0:e.allowedElements;if(!N(t))throw new ye(pe.InvalidAllowedElements,»Allowed Elements is invalid.»,{context:{configType:z.SingleElementHtmlTransformer}});Object.entries(t).forEach(([n])=>{if(!N(t[n]))throw new ye(pe.InvalidAllowedElementKey,»Allowed Elements key is invalid.»,{context:{configType:z.SingleElementHtmlTransformer,key:n}})})}if((e==null?void 0:e.allowedTargetMethodTypes)!==void 0){if(!H(e==null?void 0:e.allowedTargetMethodTypes,!0))throw new ye(pe.InvalidAllowedTargetMethodTypes,»Allowed Target Method Types is invalid.»,{context:{configType:z.SingleElementHtmlTransformer}});e==null||e.allowedTargetMethodTypes.forEach(t=>{var n;if(!((n=Object.values($))!=null&&n.includes(t)))throw new ye(pe.InvalidAllowedTargetMethodTypeMethod,»Allowed Target Method Types method is not a valid Target Method Type.»,{context:{configType:z.SingleElementHtmlTransformer,method:t}})})}if((e==null?void 0:e.allowedTransformers)!==void 0&&!H(e==null?void 0:e.allowedTransformers,!0))throw new ye(pe.InvalidAllowedTransformers,»Allowed Transformers is invalid.»,{context:{configType:z.SingleElementHtmlTransformer}})}function _p(e){if(!N(e))throw new ye(pe.InvalidConfig,»Config is invalid.»,{context:{configType:z.MultiElementModifier}});if((e==null?void 0:e.allowedElements)!==void 0){const t=e==null?void 0:e.allowedElements;if(!N(t))throw new ye(pe.InvalidAllowedElements,»Allowed Elements is invalid.»,{context:{configType:z.MultiElementModifier}});Object.entries(t).forEach(([n])=>{var r,i;if(!N(t[n]))throw new ye(pe.InvalidAllowedElementKey,»Allowed Elements key is invalid.»,{context:{configType:z.MultiElementModifier,key:n}});if(((r=t[n])==null?void 0:r.allowedProperties)!==void 0&&!H((i=t[n])==null?void 0:i.allowedProperties,!0))throw new ye(pe.InvalidAllowedProperties,»Allowed Elements allowed properties is invalid.»,{context:{configType:z.MultiElementModifier,key:n}})})}}function Tp(e){if(!N(e))throw new ye(pe.InvalidConfig,»Config is invalid.»,{context:{configType:z.WhenElementClick}});if((e==null?void 0:e.allowedElements)!==void 0){const t=e==null?void 0:e.allowedElements;if(!N(t))throw new ye(pe.InvalidAllowedElements,»Allowed Elements is invalid.»,{context:{configType:z.WhenElementClick}});Object.entries(t).forEach(([n])=>{if(!N(t[n]))throw new ye(pe.InvalidAllowedElementKey,»Allowed Elements key is invalid.»,{context:{configType:z.WhenElementClick,key:n}})})}}function Is(e){if(!N(e))throw new yt(lt.WpmConfigIsRequired,»Wpm Config is required.»);if(!N(e.configOptions))throw new ye(pe.InvalidConfigOptions,»Config Options are required.»);z.SingleElementHtmlTransformer in e.configOptions?yp(e.configOptions[z.SingleElementHtmlTransformer]):y.log.info(«WPM Config does not contain any restrictions for SingleElementHtmlTransformer»),z.MultiElementModifier in e.configOptions?_p(e.configOptions[z.MultiElementModifier]):y.log.info(«WPM Config does not contain any restrictions for MultiElementModifier»),z.WhenElementClick in e.configOptions?Tp(e.configOptions[z.WhenElementClick]):y.log.info(«WPM Config does not contain any restrictions for WhenElementClick»)}function As(e,t){var n;if(!N(e))throw new yt(lt.ConfigIsRequired,»Config is required.»);if(!H(t))throw new yt(lt.TransformersAreRequired,»Transformers are required.»);const r=t.filter(i=>i.transformerType===ge.HtmlElementModifier).map(i=>i.name);return r.length>0&&e.transformationConfig.transformations.length>0&&(e.transformationConfig.method===void 0||e.transformationConfig.method===$.ReplaceElementContent)&&e.transformationConfig.transformations.every(i=>r.includes(i.transformerName))?z.MultiElementModifier:((n=t==null?void 0:t[0])==null?void 0:n.transformerCategory)===rt.Agent?z.Agent:z.SingleElementHtmlTransformer}function Cs(e,t,n){if(e===void 0)return;const r=t.filter(i=>it(i)).map(i=>i.tag).filter(i=>!Object.keys(e).includes(i.toLowerCase()));if(r.length>0)throw new Me(Ie.TagsNotAllowed,»Tags are not allowed.»,{context:{configType:n,disallowedTags:JSON.stringify(r)}})}function bp(e,t,n){e!==void 0&&t.filter(r=>it(r)).map(r=>r).forEach(r=>{const i=e[r.tag.toLowerCase()].allowedProperties;i!==void 0&&(r.substitutionValues!==void 0?Object.keys(r.substitutionValues):[]).forEach(o=>{if(!i.includes(o))throw new Me(Ie.PropertyNotAllowed,»Property is not allowed.»,{context:{configType:n,property:`${r.tag}.${o}`}})})})}function wp(e,t,n){if(e!==void 0&&t.method!==void 0&&!e.includes(t.method))throw new Me(Ie.MethodNotAllowed,»Method is not allowed.»,{context:{configType:n,method:t.method}})}function Sp(e,t,n){if(e!==void 0)if(e.length===0){const r=t.map(i=>i.transformerName);throw new Me(Ie.TransformersAreDisabled,»Transformers are disabled.»,{context:{configType:n,transformers:JSON.stringify(r)}})}else{const r=t.filter(i=>!e.includes(i.transformerName)).map(i=>i.transformerName);if(r.length>0)throw new Me(Ie.TransformersAreDisabled,»Transformers are disabled.»,{context:{configType:n,transformers:JSON.stringify(r)}})}}function Ip(e,t){t!==void 0&&(Cs(t.allowedElements,e.transformationConfig.transformations,»SingleElementHtmlTransformer»),wp(t.allowedTargetMethodTypes,e.transformationConfig,»SingleElementHtmlTransformer»),Sp(t.allowedTransformers,e.transformationConfig.transformations,»SingleElementHtmlTransformer»))}function Ap(e,t){t!==void 0&&(Cs(t.allowedElements,e.transformationConfig.transformations,»MultiElementModifier»),bp(t.allowedElements,e.transformationConfig.transformations,»MultiElementModifier»))}function Cp(e,t){var n,r;if(t!==void 0&&t.allowedElements!==void 0){const i=(r=(n=e.transformationConfig.whenValues)==null?void 0:n.tag)!=null?r:»»;if(!Object.keys(t.allowedElements).includes(i))throw new Me(Ie.TagsNotAllowed,»Tags are not allowed.»,{context:{configType:z.WhenElementClick,disallowedTags:i}})}}function Ps(e,t,n){if(!N(e))throw new yt(lt.ConfigIsRequired,»Config is required.»);if(!N(t))throw new yt(lt.WpmConfigIsRequired,»Wpm Config is required.»);if(!H(n))throw new yt(lt.TransformersAreRequired,»Transformers are required.»);if(e.sourceMatchers.length>1)throw new Me(Ie.OneSourceMatcherSupported,»Only one source matcher is allowed.»);switch(As(e,n)){case z.SingleElementHtmlTransformer:if(e.transformationConfig.transformations.length>1)throw new Me(Ie.OneTransformerSupported,»Only one transformation is allowed.»,{context:{configType:z.SingleElementHtmlTransformer}});if(e.transformationConfig.method===void 0)throw new Me(Ie.MethodIsRequired,»Method is required.»,{context:{configType:z.SingleElementHtmlTransformer}});z.SingleElementHtmlTransformer in t.configOptions&&Ip(e,t.configOptions[z.SingleElementHtmlTransformer]);break;case z.MultiElementModifier:if(e.transformationConfig.transformations.some(r=>Bt(r)))throw new Me(Ie.OnlyElementsSupported,»Can only target elements.»,{context:{configType:z.MultiElementModifier}});z.MultiElementModifier in t.configOptions&&Ap(e,t.configOptions[z.MultiElementModifier]);break}z.WhenElementClick in t.configOptions&&e.transformationConfig.when===Ae.ElementClick&&Cp(e,t.configOptions[z.WhenElementClick])}function Pp(e,t,n){try{return Ps(e,t,n),!0}catch(r){return!1}}function Ns(e){function t(n){if(nt()){if(!N(n,!1)){y.log.error(«A config is required when setting WPM Config.»);return}try{Is(n),fp(n),y.log.info(«Set WPMConfig to the following: «,n)}catch(r){y.log.error(`WPMConfig could not be set due to: ${K(r).message}`,r)}}else y.log.error(«WPMConfig can only be set before SalesforceInteractions.init is called.»)}if(b(e))try{const n=JSON.parse(e);t(n)}catch(n){y.log.error(«JSON WPM Config list could not be initialized due to: «,n)}else t(e)}function Np(e){const t=sr();if(b(t)){const n=new URL(e),r=new URL(t);return n.hostname===r.hostname}return!0}var Os=(e=>(e.Cart=»cart»,e.CartItem=»cartItem»,e.Catalog=»catalog»,e.Consent=»consentLog»,e.Order=»order»,e.OrderItem=»orderItem»,e))(Os||{}),Ds=(e=>(e.Engagement=»Engagement»,e.Profile=»Profile»,e))(Ds||{}),Di=(e=>(e.Category=»category»,e.DateTime=»dateTime»,e.DeviceId=»deviceId»,e.EventId=»eventId»,e.EventType=»eventType»,e.SessionId=»sessionId»,e))(Di||{}),Ms=(e=>(e.OnBeforeEventSend=»dataCloud:onBeforeEventSend»,e))(Ms||{}),pt=(e=>(e.Id=»personalizationId»,e.ContentId=»personalizationContentId»,e))(pt||{});function Op(){document.addEventListener(Ms.OnBeforeEventSend,e=>{const t=e.detail.actionEvent;if(!Dp(t))return;const n=t.personalization;if(N(n)){if((n==null?void 0:n.isTesting)===!0)Rs(e,Ls,»Cancelling event since we are in test mode and all events are engagement events»,»Not sending engagement event since we are in test mode»);else if((b(n.id)||b(n.contentId))&&!Rs(e,Mp,»Cancelling event since Personalization fields are already present in events with different values»,»Not sending event since Personalization fields are already present in event with different values»)){const r=e.detail.events;Rp(n,r)}}})}function Dp(e){return»personalization»in e}function Rs(e,t,n,r){let i=e.detail.events;const o=t(i,e.detail.actionEvent.personalization);if(o.length>0){if(o.length===i.length)return P.log.warn(n,JSON.stringify(i)),e.detail.events=[],e.preventDefault(),!0;o.forEach(s=>P.log.warn(r,JSON.stringify(s))),i=i.filter(s=>!o.includes(s)),e.detail.events=i}return!1}function Ls(e,t){return e.filter(n=>n[Di.Category]===Ds.Engagement.toString()&&n[Di.EventType]!==Os.Consent)}function Mp(e,t){return e.filter(n=>J(n,pt.Id)&&n[pt.Id]!==t.id||J(n,pt.ContentId)&&n[pt.ContentId]!==t.contentId)}function Rp(e,t){Ls(t).forEach(n=>{b(e.id)&&(n[pt.Id]=e.id),b(e.contentId)&&(n[pt.ContentId]=e.contentId)})}function Lp(){document.addEventListener(P.CustomEvents.OnInit,()=>{const e=He();if(e===void 0||e.attributes===void 0){P.log.warn(«Engagement Configuration does not have any Config for Attributes»);return}const t=e.attributes.engagements;Object.keys(t).forEach(n=>{t[n].qualify()})}),document.addEventListener(P.CustomEvents.OnShutDown,()=>{Uc()})}var Oe=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{l(n.next(a))}catch(u){i(u)}},s=a=>{try{l(n.throw(a))}catch(u){i(u)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,s);l((n=n.apply(e,t)).next())});function xs(e){const t=Vn().find(r=>r.name===e.transformerName);if(t===void 0){y.log.error(`transformer with name ${e.transformerName} could not be found`);return}const n=Qa(t.transformerType);if(n===void 0){y.log.error(`transformer ${t.transformerType} does not have an implementation`);return}return[n,t]}function ks(e,t,n,r){return e.map((i,o)=>{const s=n+`, transformer ${i.transformation.transformerName}, element index ${o}`,l=xs(i.transformation);if(D(l)){const c=new Error(`Cannot transform, handler not found for ${s}`);return y.log.error(c.message),t.status.update(new k(c)),Dn(i.transformation),null}const[a,u]=l,f=`Providing transformer with element promise etc, ${s}`;y.log.trace(f),t.status.update(new k(f));const p=a.transform(u,i.transformation,i.pageElementReady,r,t);return p.promise=p.promise.then(()=>{const c=`Finished transformation for ${s}`;y.log.trace(c),t.status.update(new k(c))}).catch(c=>{const h=new Error(`Issue handling transformation for ${s}`+K(c).message);throw y.log.error(h.message),t.status.update(new k(h)),c}).finally(()=>Dn(i.transformation)),p}).filter(i=>!D(i))}function xp(e,t=!1){const n=`PEC ${e.pec.name}`,r=zs(e.pec);if(!H(r)){const o=new oe(fe.MissingPersonalization,`Could not find any elements, PEC ${n}`);throw y.log.warn(o.message),o}t&&jo({personalizationExperienceConfigName:e.pec.name});const i=ks(r,e,n);Us(e,Promise.resolve({transformResponses:i}),n)}function Us(e,t,n,r){e.status.update(new k(`Awaiting response and processing for ${n}`),t.then(i=>Oe(this,null,function*(){yield Promise.allSettled(i.transformResponses.map(o=>Oe(this,null,function*(){return yield o.promise}))).then(o=>{const s=o.filter(l=>l.status===»rejected»).map(l=>K(l.reason).message);if(s.length>0)throw new Error(`Issue(s) with transformation(s) for ${n}: ${JSON.stringify(s)}`)})}))),e.initiateRevert=()=>{const i=new ir(t.then(o=>Oe(this,null,function*(){yield Promise.allSettled(o.transformResponses.map(s=>Oe(this,null,function*(){yield s.revert(i)}))).then(s=>{const l=s.filter(a=>a.status===»rejected»).map(a=>K(a.reason).message);if(l.length>0)throw new Error(`Issue(s) with revert (see ‘statuses’ for more detail): ${JSON.stringify(l)}`);i.update(new k(«Revert (as applicable) finished»)),!D(o.personalizationId)&&et(r)&&!r?Nr(o.personalizationId):D(o.personalizationId)&&Nr(e.pec.name)})}),o=>{if(o instanceof oe)i.update(new k(«Nothing to revert, no transformation attempt»));else throw o}));return i}}function kp(e,t,n){const r=e.pec.name;let i=`PEC ${r}`;const o=t.then(s=>{const l=s.personalizations.filter(p=>{var c;return Tn((c=e.pec.dataProvider)==null?void 0:c.type)&&e.pec.dataProvider.value===p.personalizationPointName});if(H(l)){if(l.length>1){const p=`Received multiple responses for [${i}] when only one is expected. Using the first response.`;y.log.warn(p),e.status.update(new k(p))}}else{const p=new oe(fe.MissingPersonalization,`Did not receive a personalization response for ${i}`);throw y.log.warn(p.message),p}const a=l[0],u=a.personalizationId;if(!Wo(a))if(b(a.decisionId)){const p=new oe(fe.MissingPersonalizationDataAttributes,’Personalization invalid. Expected to include either «data» or «attributes».’,{context:{configName:r,personalization:a}});throw y.log.warn(p.message),p}else{const p=`User did not qualify for a decision for the following personalization experience config: ${r}`;return y.log.debug(p),e.status.update(new k(p)),{personalizationId:u,transformResponses:[]}}e.status.update(new k(`Found response personalizationId ${u} ${i}`));const f=zs(e.pec);if(!H(f)){const p=new oe(fe.MissingPersonalization,`Could not find any elements, ${i}, personalization ${u}`);throw y.log.warn(p.message),n||Nr(u),p}return i=i+`, personalization ${u}`,{personalizationId:u,transformResponses:ks(f,e,i,a)}});Us(e,o,i,n)}function Up(e,t,n){if(!H(e)){y.log.warn(«ignoring empty personalization experience configs»);return}if(D(t)){const i=»null/undefined personalization response promise»;y.log.warn(`ignoring ${i}`);const o=new Error(i);mn.updateForAll(e,new k(o),Promise.reject(o)),Rr(e.map(s=>s.pec));return}const r=t.then(i=>{if(!N(i)){const o=D(i)?new Error(«null/undefined personalization response»):new Error(«unexpected personalization response type»);throw y.log.error(o.message),Rr(e.map(s=>s.pec)),o}return Qi(«DEBUG»)&&y.log.debug(`handling personalization response: ${JSON.stringify(i)}`),i},i=>{throw Rr(e.map(o=>o.pec)),i instanceof se&&i.level===»warning»?(y.log.warn(«Personalization response promise rejection: «,i.message),i):(y.log.error(«error handling personalization response»,i),new Error(«Personalization response promise rejection: «+K(i).message))});e.filter(i=>{var o;return Tn((o=i.pec.dataProvider)==null?void 0:o.type)}).forEach(i=>{const o=Object.values(n!=null?n:{}).flatMap(s=>Object.values(s)).filter(s=>{var l;return s.point.name===((l=i.pec.dataProvider)==null?void 0:l.value)}).flatMap(s=>s.pecNames).length>1;kp(i,r,o)})}function Hp(e){var t;const n=e.name;return(t=$o(n))!=null?t:»»}function Fp(e){return e.path}function Hs(e,t){var n;if(cr(e,t))return»html»;if(_n(e,t))return Hp(e);if(it(e))return Fp(e);if(Tt(t))return»body»;if(uo((n=xs(e))==null?void 0:n[1].transformerType))return»head»}function Fs(e){return Oe(this,null,function*(){return yield new Promise((t,n)=>{const r=rr(«findElementOnPage:»+e);document.addEventListener(y.CustomEvents.OnShutDown,()=>{y.DisplayUtils.unbind(r),n(new Ge(De.NotWaitingForElementPath,»No longer waiting for element at path.»,{context:{path:e}}))}),y.DisplayUtils.bind(r).pageElementLoaded(e).then(i=>{t(i)}).catch(i=>{y.log.warn(«error with DisplayUtils»,i),n(i)})})})}function Wn(e){const t=[];for(const n of e.transformations){const r=Hs(n,e.method),i=r!==void 0?t.find(o=>Hs(o.transformation,e.method)===r):void 0;i!==void 0?t.push({transformation:n,pageElementReady:i.pageElementReady}):r!==void 0?t.push({transformation:n,pageElementReady:Fs(r)}):y.log.warn(`could not get the element path for transformerConfig: ${JSON.stringify(e)}`)}return t}function zp(e){return Wn(e.transformationConfig)}function Vp(e){var t;const n=e.transformationConfig,r=fo(n.whenValues)&&(t=n.whenValues.percent)!=null?t:0,i=new Promise((s,l)=>{const a=rr(«pageElementsReadyOnPageScroll:»+e.name);document.addEventListener(y.CustomEvents.OnShutDown,()=>{y.DisplayUtils.unbind(a),l(new Ge(De.NotWaitingForPageScroll,»No longer waiting for page scroll.»,{context:{config:e.name}}))});const u=window.scrollY/(document.documentElement.scrollHeight-window.innerHeight);try{u>=r?s():y.DisplayUtils.bind(a).pageScroll(r).then(s).catch(f=>{l(new Ge(De.DisplayUtilsPageScrollError,»Error with DisplayUtils pageScroll method.»,{cause:f}))})}catch(f){l(new Ge(De.DisplayUtilsPageScrollError,»Error with DisplayUtils pageScroll method.»,{cause:f}))}}),o=s=>Oe(this,null,function*(){const[l]=yield Promise.all([s,i]);return l});return Wn(n).map(s=>(s.pageElementReady=o(s.pageElementReady),s))}function Bp(e){var t;const n=e.transformationConfig,r=ho(n.whenValues)&&(t=n.whenValues.delay)!=null?t:0,i=new Promise((s,l)=>{const a=rr(«pageElementsReadyOnExitIntent:»+e.name);document.addEventListener(y.CustomEvents.OnShutDown,()=>{y.DisplayUtils.unbind(a),l(new Ge(De.NotWaitingForPageExit,»No longer waiting for page exit.»,{context:{config:e.name}}))});try{y.DisplayUtils.bind(a).pageExit(r).then(s).catch(u=>{l(new Ge(De.DisplayUtilsPageExitError,»Error with DisplayUtils pageExit method.»,{cause:u}))})}catch(u){l(new Ge(De.DisplayUtilsPageExitError,»Error with DisplayUtils pageExit method.»,{cause:u}))}}),o=s=>Oe(this,null,function*(){const[l]=yield Promise.all([s,i]);return l});return Wn(n).map(s=>(s.pageElementReady=o(s.pageElementReady),s))}function Gp(e){const t=e.transformationConfig,n=co(t.whenValues)?t.whenValues.path:»»;if(!b(n))return[];function r(s){return Oe(this,null,function*(){return yield new Promise((l,a)=>{const u=()=>{y.log.debug(`Add Overlay Personalization Element ‘${s.id}’ was clicked`),l(s)};document.addEventListener(y.CustomEvents.OnShutDown,()=>{s.removeEventListener(«click»,u),a(new Ge(De.NotWaitingForElementClick,»No longer waiting for element click.»,{context:{element:s.id}}))});try{s.addEventListener(«click»,u)}catch(f){a(new Ge(De.AddingClickListenerError,»Error with adding click listener»,{cause:f}))}})})}function i(){return Oe(this,null,function*(){yield Fs(n).then(s=>Oe(this,null,function*(){return yield r(s)}))})}const o=s=>Oe(this,null,function*(){const[l]=yield Promise.all([s,i()]);return l});return Wn(t).map(s=>(s.pageElementReady=o(s.pageElementReady),s))}function zs(e){const t=e.transformationConfig.when;return t===Ae.Immediately?zp(e):t===Ae.ScrollPercent?Vp(e):t===Ae.ExitIntent?Bp(e):t===Ae.ElementClick?Gp(e):(y.log.warn(`whenType [${t}] not explicitly handled`),[])}var qn=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{l(n.next(a))}catch(u){i(u)}},s=a=>{try{l(n.throw(a))}catch(u){i(u)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,s);l((n=n.apply(e,t)).next())});function jp(){document.addEventListener(y.CustomEvents.OnShutDown,Vs),Vs()}function Vs(){Iu(),Wp(),qp(),Zp(),Kp()}function Wp(){const e=te.pageUrl.listener,t=te.pageUrl.reject,n=te.pageUrl={};D(e)||document.removeEventListener(y.CustomEvents.OnInitSitemap,e),D(t)||t(new Error(«shutdown/reinit»)),n.matchedPromise=new Promise((r,i)=>{n.reject=i,n.listener=()=>{const o=$p();n.matchedPECs=o,r(o)},document.addEventListener(y.CustomEvents.OnInitSitemap,n.listener)}),n.matchedPromise.catch(r=>{y.log.error(`Issue matching page URLs: ${K(r).message}`,r)})}function qp(){const e=te.pageType.listener,t=te.pageType.reject,n=te.pageType={};D(e)||document.removeEventListener(y.CustomEvents.OnSettledSitemap,e),D(t)||t(new Error(«shutdown/reinit»)),n.matchedPromise=new Promise((r,i)=>{n.reject=i,n.listener=o=>{const s=Yp(o.detail.result);n.matchedPECs=s,r(s)},document.addEventListener(y.CustomEvents.OnSettledSitemap,n.listener)}),n.matchedPromise.catch(r=>{y.log.error(`Issue matching page types: ${K(r).message}`,r)})}function $p(){var e;const t=(e=window==null?void 0:window.location)==null?void 0:e.href;return y.log.debug(`current page url: ${t}`),ls(t)}function Yp(e){var t,n;const r=(t=e==null?void 0:e.matchedConfig)==null?void 0:t.name,i=(n=window==null?void 0:window.location)==null?void 0:n.href;return y.log.debug(`sitemap result pageType: ${r} url: ${i}`),us(r)}function Zp(){if(te.pageUrl.processedPromise=void 0,D(te.pageUrl.matchedPromise)){y.log.error(«Unable to process page URL matches. Missing Promise.»);return}te.pageUrl.processedPromise=te.pageUrl.matchedPromise.then(e=>qn(this,null,function*(){yield js(e)})),te.pageUrl.processedPromise.catch(e=>{y.log.error(`Issue processing page URL matches: ${K(e).message}`,e)})}function Kp(){if(te.pageType.processedPromise=void 0,D(te.pageUrl.matchedPromise)||D(te.pageType.matchedPromise)){y.log.error(«Unable to process page type matches. Missing Promise(s).»);return}te.pageType.processedPromise=Promise.all([te.pageUrl.matchedPromise,te.pageType.matchedPromise]).then(e=>qn(this,null,function*(){if(e.length!==2)throw new Error(`Unable to process page type matches. Expected results for 2 promises (url matches, page-type matches), but found: ${e==null?void 0:e.length}`);const t=[],n=[];e[1].forEach(r=>{e[0].some(i=>i.name===r.name)?n.push(r.name):t.push(r)}),n.length>0&&y.log.debug(`Avoiding processing, already url-matched: ${JSON.stringify(n)}`),yield js(t)})),te.pageType.processedPromise.catch(e=>{y.log.error(`Issue processing page type matches: ${K(e).message}`,e)})}function Xp(e){if(!D(e)){if(!D(e.individualId)&&!b(e.individualId))throw new he(ce.IndividualIdNotValid,»Individual Id must be a valid string if provided.»,{context:{value:e.individualId}});if(D(e.endpoint)||ao(e.endpoint),!D(e.perPersonalizationPoint)){if(!N(e.perPersonalizationPoint))throw new Vt(Et.PointOptionsNotValid,»perPersonalizationPoint must be an object if provided.»,{context:{value:e.perPersonalizationPoint}});Object.entries(e.perPersonalizationPoint).forEach(([t,n])=>{if(!b(t))throw new Vt(Et.PointOptionKeyInvalid,»perPersonalizationPoint key must be a valid string.»,{context:{value:t}});if(!N(n))throw new Vt(Et.PointOptionsNotValid,»PreviewPersonalizationPointOptions must be an object.»,{context:{value:n}});if(!D(n.decisionId)&&!b(n.decisionId))throw new he(ce.DecisionIdNotValid,»PreviewPersonalizationPointOptions decisionId must be a valid string if provided.»,{context:{value:n.decisionId}})})}}}function Qp(e,t){if(!H(e))throw new Vt(Et.MissingPersonalizationExperienceConfig,»Valid PersonalizationExperienceConfig(s) expected to Preview.»);Jp(e),y.log.debug(`Previewing personalization experience config(s): ${JSON.stringify(e.map(s=>s==null?void 0:s.name))}`),e.forEach(s=>{Ii(s),Ai(s)}),Xp(t);const n={individualId:t==null?void 0:t.individualId,dataspaceApiName:lr(),isPreview:!0,endpoint:t==null?void 0:t.endpoint},r=e.map(s=>new mn(s));Bs(r,!0),Gs(r,n,t);const i=r.reduce((s,l)=>(s[l.pec.name]=l.status,s),{}),o=()=>{const s=r.reduce((l,a)=>(l[a.pec.name]=a.revert(),l),{});return new Fu(s)};return new Hu(i,o)}function Jp(e){const t=e.map(r=>r.name),n=eg(t);if(n.length>0)throw new Vt(Et.DuplicatePersonalizationExperienceConfigs,»»,{context:{value:n}})}function eg(e){const t=new Set,n=new Array;return e.forEach(r=>{const i=r.toLowerCase();t.has(i)?n.push(r):t.add(i)}),n}function tg(e){const t=new Set,n=new Set;return e.forEach(r=>{r.isEnabled===void 0||r.isEnabled?t.add(r):n.add(r.name)}),y.log.debug(`skipping matched disabled personalization experience config names: ${JSON.stringify(n)}`),[…t]}function Bs(e,t=!1){e.filter(n=>D(n.pec.dataProvider)).forEach(n=>{xp(n,t)})}function Gs(e,t,n){const r=e.filter(s=>!D(s.pec.dataProvider));if(y.log.debug(`matched enabled and with data providers personalization experience config names: ${JSON.stringify(r.map(s=>s.pec.name))}`),r.length<=0)return;const i=r.map(s=>s.pec),o=Jh(i);t=t!=null?t:{dataspaceApiName:lr()},et(t.isPreview)&&t.isPreview&&Object.values(o).forEach(s=>{Object.values(s).forEach(l=>{var a,u;const f=(u=(a=n==null?void 0:n.perPersonalizationPoint)==null?void 0:a[l.point.name])==null?void 0:u.decisionId;b(f)&&(l.point.decisionId=f)})}),ng(r,o,t)}function js(e){return qn(this,null,function*(){e=tg(e);const t=e.map(r=>r.name);if(y.log.debug(`matched enabled personalization experience config names: ${JSON.stringify(t)}`),e.length<=0)return;if(Ni()){y.log.info(`WPM (client side editor) active, suppressing live/non-preview fetch for PECs: ${JSON.stringify(t)}`);return}const n=e.map(r=>new mn(r));Bs(n),Gs(n),yield Promise.allSettled(n.map(r=>qn(this,null,function*(){return yield r.status.finished}))).then(r=>{const i=r.filter(l=>l.status===»rejected»),o=i.filter(l=>{var a;return((a=l.reason)==null?void 0:a.level)===»warning»}).map(l=>K(l.reason));o.length>0&&y.log.warn(`Warnings processing matched PECs: ${JSON.stringify(t)}: ${JSON.stringify(o.map(l=>l.message))}`);const s=i.filter(l=>{var a;return((a=l.reason)==null?void 0:a.level)!==»warning»}).map(l=>K(l.reason));if(s.length>0)throw new Error(`Issues processing matched PECs: ${JSON.stringify(t)} : ${JSON.stringify(s.map(l=>l.message))}`)})})}function ng(e,t,n){var r;const i=(r=n==null?void 0:n.dataspaceApiName)!=null?r:»»;if(y.log.debug(`fetching for dataspace [«${i}]» points: ${JSON.stringify(t)}`),Object.keys(t).length<1){const s=JSON.stringify(e.map(a=>a.pec.name)),l=new Error(`No personalization points across PECs ${s} using dataspace [${i}]`);mn.updateForAll(e,new k(l),Promise.reject(l));return}const o={};b(n==null?void 0:n.dataspaceApiName)&&(o.dataspace=n.dataspaceApiName),b(n==null?void 0:n.individualId)&&(o.individualId=n.individualId),Object.values(t).forEach(s=>{const l=Bo(Object.values(s).map(u=>u.point),o,n==null?void 0:n.isPreview),a=Vo(l,{endpoint:n==null?void 0:n.endpoint});Up(e,a,t)})}var Mi=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{l(n.next(a))}catch(u){i(u)}},s=a=>{try{l(n.throw(a))}catch(u){i(u)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,s);l((n=n.apply(e,t)).next())});function rg(){document.addEventListener(P.CustomEvents.OnInitSitemap,()=>{if(!Ho()){P.log.warn(«No consent opt-in exists, skipping flicker defense»);return}const e=Ne();for(const n of Object.values(Te))Ri(n,e);const t=ig();Promise.race([sg(),t]).then(n=>{n=n!=null?n:[],Ri(Te.PageUrlMatcher,n)}).catch(n=>{P.log.error(«Unexpected error updating paths for flicker defense while evaluating Personalization Experience Config URL matches.»,n)}),Promise.race([ag(),t]).then(n=>{n=n!=null?n:[],Ri(Te.PageType,n)}).catch(n=>{P.log.error(«Unexpected error updating paths for flicker defense while evaluating Personalization Experience Config page type matches.»,n)})})}function ig(){return Mi(this,null,function*(){yield new Promise(e=>{Qo(!1),setTimeout(()=>{P.log.debug(`flicker defense redisplay timeout of ${On().redisplayTimeoutMilliseconds}ms elapsed`),Qo(!0),og(),e()},On().redisplayTimeoutMilliseconds)})})}function og(){ft.PageUrlMatcher=[],ft.PageType=[],Mr()}function ag(){return Mi(this,null,function*(){return[…yield vs()]})}function sg(){return Mi(this,null,function*(){return[…yield ms()]})}function Ri(e,t){const n=Uh(e,t);ft[e]=ea(n),P.log.debug(`flicker defense currently hiding the following transformations for source matcher type ${e}: ${JSON.stringify(Object.values(ft[e]))}`),Mr()}function lg(e){if(!nt()){y.log.error(«The config can only be modified before SalesforceInteractions.init is called.»);return}if(!N(e)){y.log.error(«A config is required.»);return}if(e.customEngagementConfig!==void 0&&ma(e.customEngagementConfig),e.customWpmConfig!==void 0&&Ns(e.customWpmConfig),e.customFlickerDefenseConfig!==void 0&&na(e.customFlickerDefenseConfig),e.additionalTransformers!==void 0&&(J(e.additionalTransformers,»list»)&&H(e.additionalTransformers.list,!0)?es(e.additionalTransformers.list):H(e.additionalTransformers,!0)?es(e.additionalTransformers):y.log.error(«A list of transformers is required when adding to Transformers.»)),e.personalizationExperienceConfigs!==void 0)if(J(e.personalizationExperienceConfigs,»list»)&&H(e.personalizationExperienceConfigs.list,!0)){const t=ps().DATA_CLOUD_MODULE_CONFIG;if(N(t)){y.log.error(«Initializing personalization experience configs using this format can only be used once.»);return}ip(Si.DataCloudModuleConfig,e.personalizationExperienceConfigs),Ci(e.personalizationExperienceConfigs.list,Si.DataCloudModuleConfig)}else H(e.personalizationExperienceConfigs,!0)?Ci(e.personalizationExperienceConfigs):y.log.error(«A list of personalization experience configs is required.»);if(e.additionalHandlebarsHelpers!==void 0){if(!N(e.additionalHandlebarsHelpers)){y.log.error(«An object is required when adding custom handlebars helpers.»);return}for(const[t,n]of Object.entries(e.additionalHandlebarsHelpers))eh(t,n)}}var ug=(e,t,n)=>new Promise((r,i)=>{var o=a=>{try{l(n.next(a))}catch(u){i(u)}},s=a=>{try{l(n.throw(a))}catch(u){i(u)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,s);l((n=n.apply(e,t)).next())});function cg(e,t){return ug(this,null,function*(){try{if(!H(e))throw new he(ce.PersonalizationPointsIsNotAnArray,»The Personalization Points parameter must be an array of length >= 1.»,{context:{value:e}});const n=e.map(i=>({name:i})),r=Bo(n,t);return yield Vo(r)}catch(n){return n instanceof se&&n.level===»warning»?y.log.warn(n.message):y.log.error(n),yield Promise.reject(n)}})}kl(),Ul(),Op(),Lp(),jp(),Vu(),Qh(),dp(),rg(),window.SalesforceInteractions.Personalization={fetch:cg,Config:{initialize:lg,PersonalizationExperience:{findByName:kh,getAll:Ne,addNew:Xh,isSupported:Ai,validate:Ii,preview:Qp},Transformer:{getAll:Vn,addNew:mh},Engagement:{initializeCustom:ma,get:He,validate:ga},Wpm:{initializeCustom:Ns,get:Ts,validate:Is},FlickerDefense:{initializeCustom:na,get:On},ContentZoneHandler:{set:Au,get:Cu}},launchWpm:Ep}})(window.SalesforceInteractions); } catch (e) { console.error(«[Salesforce personalization] Error initializing module: personalization», e); } })(); (function () { // —– module custom_parameters try { const config = {«keys»:[«email»,»partyid»]}; } catch (e) { console.error(«[Salesforce custom_parameters] Error initializing module: custom_parameters», e); } })(); // SITEMAP AND INIT try { (function () { })() } catch (e) { console.error(«[Salesforce Data Cloud] Error loading sitemap:», e); }