web-push-notifications 3.62.11 → 3.62.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/npm.js +1 -1
- package/package.json +2 -2
- package/service-worker.js +1 -1
- package/widget-web-popups.js +1 -1
- package/widget-web-popups.js.map +1 -1
- package/widgets/WebPopups/constants.d.ts +2 -0
- package/widgets/WebPopups/renderer.d.ts +2 -1
- package/widgets/WebPopups/subscriptionFormApi.d.ts +13 -0
package/widget-web-popups.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,()=>(()=>{"use strict";const e={d:(t,n)=>{if(Array.isArray(n))for(var o=0;o<n.length;){var r=n[o++],i=n[o++];e.o(t,r)?0===i&&o++:0===i?Object.defineProperty(t,r,{enumerable:!0,value:n[o++]}):Object.defineProperty(t,r,{enumerable:!0,get:i})}else for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let t={};e.r(t),e.d(t,{WebPopupsWidget:()=>Yn});const n="pushwoosh-web-popups",o="https://cdn.pushwoosh.com/subscription-forms/widget.js",r="pushwoosh-subscribe-widget";var i,s,u,l,a,c,_,p,f,d,h,m,y,g,v,b={},w=[],k=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,C=Array.isArray;function S(e,t){for(var n in t)e[n]=t[n];return e}function x(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function E(e,t,n){var o,r,s,u={};for(s in t)"key"==s?o=t[s]:"ref"==s?r=t[s]:u[s]=t[s];if(arguments.length>2&&(u.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===u[s]&&(u[s]=e.defaultProps[s]);return P(e,u,o,r,null)}function P(e,t,n,o,r){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++u,__i:-1,__u:0};return null==r&&null!=s.vnode&&s.vnode(i),i}function F(e){return e.children}function R(e,t){this.props=e,this.context=t}function A(e,t){if(null==t)return e.__?A(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?A(e):null}function N(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],r=[],i=S({},t);i.__v=t.__v+1,s.vnode&&s.vnode(i),D(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??A(t),!!(32&t.__u),r),i.__v=t.__v,i.__.__k[i.__i]=i,q(o,i,r),t.__e=t.__=null,i.__e!=n&&I(i)}}function I(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),I(e)}function O(e){(!e.__d&&(e.__d=!0)&&l.push(e)&&!j.__r++||a!=s.debounceRendering)&&((a=s.debounceRendering)||c)(j)}function j(){try{for(var e,t=1;l.length;)l.length>t&&l.sort(_),e=l.shift(),t=l.length,N(e)}finally{l.length=j.__r=0}}function T(e,t,n,o,r,i,s,u,l,a,c){var _,p,f,d,h,m,y,g=o&&o.__k||w,v=t.length;for(l=$(n,t,g,l,v),_=0;_<v;_++)null!=(f=n.__k[_])&&(p=-1!=f.__i&&g[f.__i]||b,f.__i=_,m=D(e,f,p,r,i,s,u,l,a,c),d=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&K(p.ref,null,f),c.push(f.ref,f.__c||d,f)),null==h&&null!=d&&(h=d),(y=!!(4&f.__u))||p.__k===f.__k?(l=W(f,l,e,y),y&&p.__e&&(p.__e=null)):"function"==typeof f.type&&void 0!==m?l=m:d&&(l=d.nextSibling),f.__u&=-7);return n.__e=h,l}function $(e,t,n,o,r){var i,s,u,l,a,c=n.length,_=c,p=0;for(e.__k=new Array(r),i=0;i<r;i++)null!=(s=t[i])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[i]=P(null,s,null,null,null):C(s)?s=e.__k[i]=P(F,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[i]=P(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,l=i+p,s.__=e,s.__b=e.__b+1,u=null,-1!=(a=s.__i=H(s,n,l,_))&&(_--,(u=n[a])&&(u.__u|=2)),null==u||null==u.__v?(-1==a&&(r>c?p--:r<c&&p++),"function"!=typeof s.type&&(s.__u|=4)):a!=l&&(a==l-1?p--:a==l+1?p++:(a>l?p--:p++,s.__u|=4))):e.__k[i]=null;if(_)for(i=0;i<c;i++)null!=(u=n[i])&&!(2&u.__u)&&(u.__e==o&&(o=A(u)),Q(u,u));return o}function W(e,t,n,o){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=W(r[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=A(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function M(e,t){return t=t||[],null==e||"boolean"==typeof e||(C(e)?e.some(function(e){M(e,t)}):t.push(e)),t}function H(e,t,n,o){var r,i,s,u=e.key,l=e.type,a=t[n],c=null!=a&&!(2&a.__u);if(null===a&&null==u||c&&u==a.key&&l==a.type)return n;if(o>(c?1:0))for(r=n-1,i=n+1;r>=0||i<t.length;)if(null!=(a=t[s=r>=0?r--:i++])&&!(2&a.__u)&&u==a.key&&l==a.type)return s;return-1}function U(e,t,n){"-"==t[0]?e.setProperty(t,n??""):e[t]=null==n?"":"number"!=typeof n||k.test(t)?n:n+"px"}function B(e,t,n,o,r){var i,s;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||U(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||U(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(h,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[d]=o[d]:(n[d]=m,e.addEventListener(t,i?g:y,i)):e.removeEventListener(t,i?g:y,i);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=n??"";break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function L(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[f])t[f]=m++;else if(t[f]<n[d])return;return n(s.event?s.event(t):t)}}}function D(e,t,n,o,r,i,u,l,a,c){var _,p,f,d,h,m,y,g,v,b,k,E,P,A,N,I,O=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(a=!!(32&n.__u),i=[l=t.__e=n.__e]),(_=s.__b)&&_(t);e:if("function"==typeof O){p=u.length;try{if(v=t.props,b=O.prototype&&O.prototype.render,k=(_=O.contextType)&&o[_.__c],E=_?k?k.props.value:_.__:o,n.__c?g=(f=t.__c=n.__c).__=f.__E:(b?t.__c=f=new O(v,E):(t.__c=f=new R(v,E),f.constructor=O,f.render=G),k&&k.sub(f),f.state||(f.state={}),f.__n=o,d=f.__d=!0,f.__h=[],f._sb=[]),b&&null==f.__s&&(f.__s=f.state),b&&null!=O.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=S({},f.__s)),S(f.__s,O.getDerivedStateFromProps(v,f.__s))),h=f.props,m=f.state,f.__v=t,d)b&&null==O.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),b&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(b&&null==O.getDerivedStateFromProps&&v!==h&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(v,E),t.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(v,f.__s,E)){t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),w.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&u.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(v,f.__s,E),b&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(h,m,y)})}if(f.context=E,f.props=v,f.__P=e,f.__e=!1,P=s.__r,A=0,b)f.state=f.__s,f.__d=!1,P&&P(t),_=f.render(f.props,f.state,f.context),w.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,P&&P(t),_=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++A<25);f.state=f.__s,null!=f.getChildContext&&(o=S(S({},o),f.getChildContext())),b&&!d&&null!=f.getSnapshotBeforeUpdate&&(y=f.getSnapshotBeforeUpdate(h,m)),N=null!=_&&_.type===F&&null==_.key?V(_.props.children):_,l=T(e,C(N)?N:[N],t,n,o,r,i,u,l,a,c),f.base=t.__e,t.__u&=-161,f.__h.length&&u.push(f),g&&(f.__E=f.__=null)}catch(e){if(u.length=p,t.__v=null,a||null!=i){if(e.then){for(t.__u|=a?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;null!=i&&(i[i.indexOf(l)]=null),t.__e=l}else if(null!=i)for(I=i.length;I--;)x(i[I])}else t.__e=n.__e;null==t.__k&&(t.__k=n.__k||[]),e.then||z(t),s.__e(e,t,n)}}else null==i&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=Z(n.__e,t,n,o,r,i,u,a,c);return(_=s.diffed)&&_(t),128&t.__u?void 0:l}function z(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(z))}function q(e,t,n){for(var o=0;o<n.length;o++)K(n[o],n[++o],n[++o]);s.__c&&s.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){s.__e(e,t.__v)}})}function V(e){return"object"!=typeof e||null==e||e.__b>0?e:C(e)?e.map(V):void 0!==e.constructor?null:S({},e)}function Z(e,t,n,o,r,u,l,a,c){var _,p,f,d,h,m,y,g=n.props||b,v=t.props,w=t.type;if("svg"==w?r="http://www.w3.org/2000/svg":"math"==w?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=u)for(_=0;_<u.length;_++)if((h=u[_])&&"setAttribute"in h==!!w&&(w?h.localName==w:3==h.nodeType)){e=h,u[_]=null;break}if(null==e){if(null==w)return document.createTextNode(v);e=document.createElementNS(r,w,v.is&&v),a&&(s.__m&&s.__m(t,u),a=!1),u=null}if(null==w)g===v||a&&e.data==v||(e.data=v);else{if(u="textarea"==w&&null!=v.defaultValue?null:u&&i.call(e.childNodes),!a&&null!=u)for(g={},_=0;_<e.attributes.length;_++)g[(h=e.attributes[_]).name]=h.value;for(_ in g)h=g[_],"dangerouslySetInnerHTML"==_?f=h:"children"==_||_ in v||"value"==_&&"defaultValue"in v||"checked"==_&&"defaultChecked"in v||B(e,_,null,h,r);for(_ in v)h=v[_],"children"==_?d=h:"dangerouslySetInnerHTML"==_?p=h:"value"==_?m=h:"checked"==_?y=h:a&&"function"!=typeof h||g[_]===h||B(e,_,h,g[_],r);if(p)a||f&&(p.__html==f.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(f&&(e.innerHTML=""),T("template"==t.type?e.content:e,C(d)?d:[d],t,n,o,"foreignObject"==w?"http://www.w3.org/1999/xhtml":r,u,l,u?u[0]:n.__k&&A(n,0),a,c),null!=u)for(_=u.length;_--;)x(u[_]);a&&"textarea"!=w||(_="value","progress"==w&&null==m?e.removeAttribute("value"):null!=m&&(m!==e[_]||"progress"==w&&!m||"option"==w&&m!=g[_])&&B(e,_,m,g[_],r),_="checked",null!=y&&y!=e[_]&&B(e,_,y,g[_],r))}return e}function K(e,t,n){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==t||(e.__u=e(t))}else e.current=t}catch(e){s.__e(e,n)}}function Q(e,t,n){var o,r;if(s.unmount&&s.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||K(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){s.__e(e,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&Q(o[r],t,n||"function"!=typeof e.type);n||x(e.__e),e.__c=e.__=e.__e=void 0}function G(e,t,n){return this.constructor(e,n)}function J(e,t,n){var o,r,u,l;t==document&&(t=document.documentElement),s.__&&s.__(e,t),r=(o="function"==typeof n)?null:n&&n.__k||t.__k,u=[],l=[],D(t,e=(!o&&n||t).__k=E(F,null,[e]),r||b,b,t.namespaceURI,!o&&n?[n]:r?null:t.firstChild?i.call(t.childNodes):null,u,!o&&n?n:r?r.__e:t.firstChild,o,l),q(u,e,l),e.props.children=null}function Y(e,t){J(e,t,Y)}function X(e,t,n){var o,r,s,u,l=S({},e.props);for(s in e.type&&e.type.defaultProps&&(u=e.type.defaultProps),t)"key"==s?o=t[s]:"ref"==s?r=t[s]:l[s]=void 0===t[s]&&null!=u?u[s]:t[s];return arguments.length>2&&(l.children=arguments.length>3?i.call(arguments,2):n),P(e.type,l,o||e.key,r||e.ref,null)}i=w.slice,s={__e:function(e,t,n,o){for(var r,i,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},u=0,R.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=S({},this.state),"function"==typeof e&&(e=e(S({},n),this.props)),e&&S(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),O(this))},R.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),O(this))},R.prototype.render=F,l=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_=function(e,t){return e.__v.__b-t.__v.__b},j.__r=0,p=Math.random().toString(8),f="__d"+p,d="__a"+p,h=/(PointerCapture)$|Capture$/i,m=0,y=L(!1),g=L(!0),v=0;var ee=0;Array.isArray;function te(e,t,n,o,r,i){t||(t={});var u,l,a=t;if("ref"in a)for(l in a={},t)"ref"==l?u=t[l]:a[l]=t[l];var c={type:e,props:a,key:n,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ee,__i:-1,__u:0,__source:r,__self:i};if("function"==typeof e&&(u=e.defaultProps))for(l in u)void 0===a[l]&&(a[l]=u[l]);return s.vnode&&s.vnode(c),c}const ne=/^(https?:|mailto:|tel:)/i,oe="#FFFFFF",re="#2970FF",ie="#101828",se="#667085",ue="#FFFFFF",le={h1:{fontSize:24,fontWeight:600,lineHeight:1.25},h2:{fontSize:18,fontWeight:600,lineHeight:1.3},h3:{fontSize:16,fontWeight:600,lineHeight:1.35},body:{fontSize:14,fontWeight:"normal",lineHeight:1.5},caption:{fontSize:12,fontWeight:"normal",lineHeight:1.4},eyebrow:{fontSize:11,fontWeight:600,letterSpacing:"0.08em",lineHeight:1.4},icon:{fontSize:24,lineHeight:1.2}},ae={h1:1,h2:1,h3:1,icon:1,eyebrow:.8,body:.9,caption:.75};function ce(e,t,n){return n?function(e,t){if(t>=1)return e;const n=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.exec(e)?.[1];if(!n)return e;const o=3===n.length?n.split("").map(e=>e+e).join(""):n,[r,i,s]=[0,2,4].map(e=>parseInt(o.slice(e,e+2),16));return`rgba(${r}, ${i}, ${s}, ${t})`}(t.textInverse,ae[e]??1):"icon"!==e?"caption"===e||"eyebrow"===e?t.textSecondary:t.text:void 0}const _e="\n@keyframes pw-vpopup-fade { from { opacity: 0; } }\n@keyframes pw-vpopup-slide { from { opacity: 0; translate: 0 28px; } }\n@keyframes pw-vpopup-overlay { from { opacity: 0; } }\n@keyframes pw-vpopup-page { from { opacity: 0; } }\n",pe=["Vertical","Horizontal","Columns","Rows"],fe=["normal","reverse"],de=["start","center","end","stretch"],he=["start","center","end","space-between"],me=["left","center","right"],ye=["default","inverse"],ge=2e3,ve={px:ge,"%":100,em:125,rem:125},be=/^(\d{1,4}(?:\.\d+)?)(px|%|em|rem)$/,we={px:ge,"%":100,fr:100},ke=/^(\d{1,4}(?:\.\d+)?)(px|%|fr)$/,Ce=["auto","min-content","max-content"];function Se(e,t){return t.includes(e)?e:void 0}function xe(e){if("number"==typeof e&&Number.isFinite(e))return Math.min(Math.max(e,0),ge);if("string"!=typeof e)return;const t=be.exec(e.trim());if(!t)return;const[,n,o]=t;return`${Math.min(parseFloat(n),ve[o])}${o}`}const Ee=["top","right","bottom","left"];function Pe(e){if(Ce.includes(e))return e;const t=ke.exec(e);if(!t)return;const[,n,o]=t;return`${Math.min(parseFloat(n),we[o])}${o}`}function Fe(e){return"string"==typeof e&&e.length>0?e:void 0}function Re(e){const t={},n=xe(e.gap);void 0!==n&&(t.gap=n);const o=function(e){const t=xe(e);if(void 0!==t)return t;if("object"!=typeof e||null===e)return;const n={};for(const t of Ee){const o=xe(e[t]);void 0!==o&&(n[t]=o)}return Object.keys(n).length>0?n:void 0}(e.padding);void 0!==o&&(t.padding=o);const r=Se(e.alignItems,de);r&&(t.alignItems=r);const i=Se(e.justifyContent,he);i&&(t.justifyContent=i);const s=Se(e.alignContent,he);s&&(t.alignContent=s);const u=Fe(e.backgroundImage);u&&(t.backgroundImage=u);const l=function(e){if("number"==typeof e)return Number.isInteger(e)&&e>=1&&e<=12?e:void 0;if("string"!=typeof e)return;const t=e.trim().split(/\s+/);if(t.length<1||t.length>12)return;const n=t.map(Pe);return n.every(e=>void 0!==e)?n.join(" "):void 0}(e.sizes);return void 0!==l&&(t.sizes=l),t}function Ae(e,t,n){if(t>10||n.nodes<=0)return null;if("object"!=typeof e||null===e)return null;n.nodes-=1;const o=e,r="object"==typeof o.props&&null!==o.props?o.props:{};if("Content"===o.type){const e=Fe(r.content);if(!e)return null;const t={type:"Content",props:{content:e}},n=Se(r.align,me);n&&(t.props.align=n);const o=Se(r.tone,ye);return o&&"default"!==o&&(t.props.tone=o),t}if("Image"===o.type){const e=Fe(r.image);if(!e)return null;return{type:"Image",props:{image:e}}}if(!Array.isArray(o.children))return null;const i=Se(o.type,pe)??"Vertical",s=[];for(const e of o.children){const o=Ae(e,t+1,n);o&&s.push(o)}const u=Re(r);return"reverse"===Se(r.order,fe)&&(s.reverse(),"string"==typeof u.sizes&&(u.sizes=u.sizes.split(" ").reverse().join(" "))),{type:i,props:u,children:s}}function Ne(e){return Ae(e,0,{nodes:100})}const Ie=/^[a-zA-Z][a-zA-Z0-9-]*$/,Oe=/^\$([a-zA-Z][a-zA-Z0-9-]*)$/;function je(e,t){return e.includes("$")?e.split(/(\s+)/).map(e=>{const n=Oe.exec(e)?.[1];return void 0!==n&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:e}).join(""):e}function Te(e,t){return"object"!=typeof e||null===e||0===Object.keys(t).length?e:We(e,t,0)}const $e=new Set(["content","image","backgroundImage"]);function We(e,t,n){if(n>10||"object"!=typeof e||null===e)return e;const o=e,r={...o};if("object"==typeof o.props&&null!==o.props){const e={...o.props};for(const[n,o]of Object.entries(e))if(!$e.has(n))if("string"==typeof o)e[n]=je(o,t);else if("object"==typeof o&&null!==o&&!Array.isArray(o)){const r={...o};for(const[e,n]of Object.entries(r))"string"==typeof n&&(r[e]=je(n,t));e[n]=r}r.props=e}return Array.isArray(o.children)&&(r.children=o.children.map(e=>We(e,t,n+1))),r}function Me(e){return"number"==typeof e?`${e}px`:e}function He(e,t){if("string"==typeof e)return e;return`repeat(${"number"==typeof e?e:Math.max(t,1)}, 1fr)`}function Ue(e,t=0){const n=`url(${JSON.stringify(e)})`,o=t>0?`rgba(16, 24, 40, ${Math.min(t,1)})`:null;return{backgroundImage:o?`linear-gradient(${o}, ${o}), ${n}`:n,backgroundSize:"cover",backgroundPosition:"center"}}function Be(e,t,n=0){const o=e.props??{},r={display:"grid",minWidth:0};return"Horizontal"===e.type&&(r.gridAutoFlow="column"),"Columns"===e.type&&(r.gridTemplateColumns=He(o.sizes,e.children.length)),"Rows"===e.type&&(r.gridTemplateRows=He(o.sizes,e.children.length)),void 0!==o.gap&&(r.gap=Me(o.gap)),void 0!==o.padding&&(r.padding=function(e){if("number"==typeof e||"string"==typeof e)return Me(e);const t=e=>void 0===e?"0":Me(e);return`${t(e.top)} ${t(e.right)} ${t(e.bottom)} ${t(e.left)}`}(o.padding)),o.alignItems&&(r.alignItems=o.alignItems),o.justifyContent&&(r.justifyContent=o.justifyContent),o.alignContent&&(r.alignContent=o.alignContent),t&&Object.assign(r,Ue(t,n)),r}function Le(e){const t=(e||"").trim();if(t)return t.startsWith("#")||t.startsWith("/")||t.startsWith("?")||ne.test(t)?t:void 0}function De(e){return"_self"===e?{target:"_self"}:{target:"_blank",rel:"noreferrer"}}const ze=new Set(["STRONG","B","EM","I","U","BR","A"]);function qe(e,t,n){for(const o of Array.from(e.childNodes)){if(3===o.nodeType){t.appendChild(n.createTextNode(o.textContent??""));continue}if(1!==o.nodeType)continue;const e=o;if(!ze.has(e.tagName)){qe(e,t,n);continue}const r=n.createElement(e.tagName.toLowerCase());if("A"===e.tagName){const t=Le(e.getAttribute("href")??void 0);t&&r.setAttribute("href",t);const{target:n,rel:o}=De(e.getAttribute("target"));r.setAttribute("target",n),o&&r.setAttribute("rel",o)}t.appendChild(r),qe(e,r,n)}}function Ve(e){if(!e.includes("<"))return e;const t=(new DOMParser).parseFromString(e,"text/html"),n=t.createElement("div");return qe(t.body,n,t),n.innerHTML}function Ze(e){return"string"==typeof e&&e?e:void 0}function Ke(e){const t="object"==typeof e.colors&&null!==e.colors?e.colors:{};return{background:Ze(t.background)??Ze(e.background)??oe,accent:Ze(t.accent)??Ze(e.accent)??re,text:Ze(t.text)??ie,textSecondary:Ze(t.textSecondary)??se,textInverse:Ze(t.textInverse)??ue}}const Qe=["cover","contain"];function Ge(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(t.length>=20)break;"object"==typeof n&&null!==n&&("string"==typeof n.key&&n.key&&"string"==typeof n.src&&t.push({key:n.key,label:"string"==typeof n.label?n.label:"",src:n.src,...Qe.includes(n.fit)?{fit:n.fit}:{},..."number"==typeof n.blur&&Number.isFinite(n.blur)&&n.blur>0?{blur:Math.min(n.blur,100)}:{},..."number"==typeof n.dim&&Number.isFinite(n.dim)&&n.dim>0?{dim:Math.min(n.dim,1)}:{}}))}return t}const Je=["px","%","em","rem","fr"];function Ye(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}function Xe(e){if("object"!=typeof e||null===e)return;const t=e;if("text"===t.kind)return{kind:"text"};if("length"===t.kind||"percent"===t.kind){const e=Ye(t.min),n=Ye(t.max),o="length"===t.kind&&Array.isArray(t.units)?t.units.filter(e=>Je.includes(e)):[];return{kind:t.kind,...void 0!==e?{min:e}:{},...void 0!==n?{max:n}:{},...o.length>0?{units:o}:{}}}if("select"===t.kind&&Array.isArray(t.options)){const e=[];for(const n of t.options){if(e.length>=20)break;"object"==typeof n&&null!==n&&("string"!=typeof n.value||n.value.length>64||e.push({value:n.value,label:"string"==typeof n.label?n.label:n.value}))}if(e.length>0)return{kind:"select",options:e}}}function et(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(t.length>=20)break;if("object"!=typeof n||null===n)continue;if("string"!=typeof n.key||!Ie.test(n.key))continue;if("string"!=typeof n.value||n.value.length>64||n.value.includes("$"))continue;if(t.some(e=>e.key===n.key))continue;const e=Xe(n.control);t.push({key:n.key,label:"string"==typeof n.label?n.label:"",value:n.value,...e?{control:e}:{}})}return t}function tt(e){return Object.fromEntries(e.map(e=>[e.key,e.value]))}function nt(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(t.length>=20)break;"object"==typeof n&&null!==n&&("string"==typeof n.key&&n.key&&Array.isArray(n.slots)&&t.push({key:n.key,label:"string"==typeof n.label?n.label:"",slots:n.slots.slice(0,50)}))}return t}function ot(e){return"number"==typeof e&&Number.isFinite(e)&&e>0?Math.min(e,2e3):void 0}function rt(e,t,n){if(null===e)return;let o;return o="stretch"===e?"stretch":ot(e)??("stretch"===t?"stretch":ot(t)),"width"===n&&"stretch"===o?void 0:o}function it(e){const t=[];for(const n of e.pages){const o=et(n.values),r=Ne(Te(n.layout,tt(o)));if(!r)continue;const i=rt(n.width,e.width,"width"),s=rt(n.height,e.height,"height");t.push({key:n.key,layout:r,images:Ge(n.images),contents:nt(n.contents),...void 0!==i?{width:i}:{},...void 0!==s?{height:s}:{}})}return t}function st(e){return`calc(100% - ${2*e.offset}px)`}var ut,lt,at,ct,_t=0,pt=[],ft=s,dt=ft.__b,ht=ft.__r,mt=ft.diffed,yt=ft.__c,gt=ft.unmount,vt=ft.__;function bt(e,t){ft.__h&&ft.__h(lt,e,_t||t),_t=0;var n=lt.__H||(lt.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function wt(e){return _t=1,kt(Mt,e)}function kt(e,t,n){var o=bt(ut++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Mt(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=lt,!lt.__f)){var r=function(e,t,n){if(!o.__c.__H)return!0;var r=!1,s=o.__c.props!==e;if(o.__c.__H.__.some(function(e){if(e.__N){r=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}}),i){var u=i.call(this,e,t,n);return r?u||s:u}return!r||s};lt.__f=!0;var i=lt.shouldComponentUpdate,s=lt.componentWillUpdate;lt.componentWillUpdate=function(e,t,n){if(this.__e){var o=i;i=void 0,r(e,t,n),i=o}s&&s.call(this,e,t,n)},lt.shouldComponentUpdate=r}return o.__N||o.__}function Ct(e,t){var n=bt(ut++,3);!ft.__s&&Wt(n.__H,t)&&(n.__=e,n.u=t,lt.__H.__h.push(n))}function St(e,t){var n=bt(ut++,4);!ft.__s&&Wt(n.__H,t)&&(n.__=e,n.u=t,lt.__h.push(n))}function xt(e){return _t=5,Pt(function(){return{current:e}},[])}function Et(e,t,n){_t=6,St(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function Pt(e,t){var n=bt(ut++,7);return Wt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ft(e,t){return _t=8,Pt(function(){return e},t)}function Rt(e){var t=lt.context[e.__c],n=bt(ut++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(lt)),t.props.value):e.__}function At(e,t){ft.useDebugValue&&ft.useDebugValue(t?t(e):e)}function Nt(){var e=bt(ut++,11);if(!e.__){for(var t=lt.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function It(){for(var e;e=pt.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Tt),t.__h.some($t),t.__h=[]}catch(n){t.__h=[],ft.__e(n,e.__v)}}}ft.__b=function(e){lt=null,dt&&dt(e)},ft.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),vt&&vt(e,t)},ft.__r=function(e){ht&&ht(e),ut=0;var t=(lt=e.__c).__H;t&&(at===lt?(t.__h=[],lt.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Tt),t.__h.some($t),t.__h=[],ut=0)),at=lt},ft.diffed=function(e){mt&&mt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==pt.push(t)&&ct===ft.requestAnimationFrame||((ct=ft.requestAnimationFrame)||jt)(It)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),at=lt=null},ft.__c=function(e,t){t.some(function(e){try{e.__h.some(Tt),e.__h=e.__h.filter(function(e){return!e.__||$t(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],ft.__e(n,e.__v)}}),yt&&yt(e,t)},ft.unmount=function(e){gt&>(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Tt(e)}catch(e){t=e}}),n.__H=void 0,t&&ft.__e(t,n.__v))};var Ot="function"==typeof requestAnimationFrame;function jt(e){var t,n=function(){clearTimeout(o),Ot&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Ot&&(t=requestAnimationFrame(n))}function Tt(e){var t=lt,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),lt=t}function $t(e){var t=lt;e.__c=e.__(),lt=t}function Wt(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Mt(e,t){return"function"==typeof t?t(e):t}function Ht(e,t){for(var n in t)e[n]=t[n];return e}function Ut(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function Bt(e,t){var n=t(),o=wt({t:{__:n,u:t}}),r=o[0].t,i=o[1];return St(function(){r.__=n,r.u=t,Lt(r)&&i({t:r})},[e,n,t]),Ct(function(){return Lt(r)&&i({t:r}),e(function(){Lt(r)&&i({t:r})})},[e]),n}function Lt(e){try{return!((t=e.__)===(n=e.u())&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}var t,n}function Dt(e){e()}function zt(e){return e}function qt(){return[!1,Dt]}var Vt=St;function Zt(e,t){this.props=e,this.context=t}(Zt.prototype=new R).isPureReactComponent=!0,Zt.prototype.shouldComponentUpdate=function(e,t){return Ut(this.props,e)||Ut(this.state,t)};var Kt=s.__b;s.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Kt&&Kt(e)};var Qt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Gt=function(e,t){return null==e?null:M(M(e).map(t))},Jt={map:Gt,forEach:Gt,count:function(e){return e?M(e).length:0},only:function(e){var t=M(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:M},Yt=s.__e;s.__e=function(e,t,n,o){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k||[]),r.__c(e,t);Yt(e,t,n,o)};var Xt=s.unmount;function en(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=Ht({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return en(e,t,n)})),e}function tn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return tn(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function nn(){this.__u=0,this.o=null,this.__b=null}function on(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function rn(){this.i=null,this.l=null}s.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Xt&&Xt(e)},(nn.prototype=new R).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=on(o.__v),i=!1,s=function(){i||o.__z||(i=!0,n.__R=null,r?r(l):l())};n.__R=s;var u=n.__P;n.__P=null;var l=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=tn(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.o.pop();)t.__P=u,t.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(s,s)},nn.prototype.componentWillUnmount=function(){this.o=[]},nn.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=en(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&E(F,null,e.fallback);return r&&(r.__u&=-33),[E(F,null,t.__a?null:e.children),r]};var sn=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function un(e){return this.getChildContext=function(){return e.context},e.children}function ln(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){J(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var o=t.__v;null!==o&&!o.__m&&null!==o.__;)o=o.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}J(E(un,{context:t.context},e.__v),t.v)}(rn.prototype=new R).__a=function(e){var t=this,n=on(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),sn(t,e,o)):r()};n?n(i):i()}},rn.prototype.render=function(e){this.i=null,this.l=new Map;var t=M(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},rn.prototype.componentDidUpdate=rn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){sn(e,n,t)})};var an="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,cn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,_n=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,pn=/[A-Z0-9]/g,fn="undefined"!=typeof document,dn=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};R.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(R.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var hn=s.event;s.event=function(e){return hn&&(e=hn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var mn,yn={configurable:!0,get:function(){return this.class}},gn=s.vnode;s.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1==n.indexOf("-");for(var i in t){var s=t[i];if(!("value"===i&&"defaultValue"in t&&null==s||fn&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var u=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===s?s="":"translate"===u&&"no"===s?s=!1:"o"===u[0]&&"n"===u[1]?"ondoubleclick"===u?i="ondblclick":"onchange"!==u||"input"!==n&&"textarea"!==n||dn(t.type)?"onfocus"===u?i="onfocusin":"onblur"===u?i="onfocusout":_n.test(i)&&(i=u):u=i="oninput":r&&cn.test(i)?i=i.replace(pn,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===u&&o[i=u]&&(i="oninputCapture"),o[i]=s}}"select"==n&&(o.multiple&&Array.isArray(o.value)&&(o.value=M(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),null!=o.defaultValue&&(o.value=M(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",yn)):t.className&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=an,gn&&gn(e)};var vn=s.__r;s.__r=function(e){vn&&vn(e),mn=e.__c};var bn=s.diffed;s.diffed=function(e){bn&&bn(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),mn=null};var wn={ReactCurrentDispatcher:{current:{readContext:function(e){return mn.__n[e.__c].props.value},useCallback:Ft,useContext:Rt,useDebugValue:At,useDeferredValue:zt,useEffect:Ct,useId:Nt,useImperativeHandle:Et,useInsertionEffect:Vt,useLayoutEffect:St,useMemo:Pt,useReducer:kt,useRef:xt,useState:wt,useSyncExternalStore:Bt,useTransition:qt}}};function kn(e){return!!e&&e.$$typeof===an}var Cn={useState:wt,useId:Nt,useReducer:kt,useEffect:Ct,useLayoutEffect:St,useInsertionEffect:Vt,useTransition:qt,useDeferredValue:zt,useSyncExternalStore:Bt,startTransition:Dt,useRef:xt,useImperativeHandle:Et,useMemo:Pt,useCallback:Ft,useContext:Rt,useDebugValue:At,version:"18.3.1",Children:Jt,render:function(e,t,n){return null==t.__k&&(t.textContent=""),J(e,t),"function"==typeof n&&n(),e?e.__c:null},hydrate:function(e,t,n){return Y(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(J(null,e),!0)},createPortal:function(e,t){var n=E(ln,{__v:e,h:t});return n.containerInfo=t,n},createElement:E,createContext:function(e){function t(e){var n,o;return this.getChildContext||(n=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,O(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+v++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createFactory:function(e){return E.bind(null,e)},cloneElement:function(e){return kn(e)?X.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:F,isValidElement:kn,isElement:kn,isFragment:function(e){return kn(e)&&e.type===F},isMemo:function(e){return!!e&&"string"==typeof e.displayName&&0==e.displayName.indexOf("Memo(")},findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:R,PureComponent:Zt,memo:function(e,t){function n(e){var n=this.props.ref;return n!=e.ref&&n&&("function"==typeof n?n(null):n.current=null),t?!t(this.props,e)||n!=e.ref:Ut(this.props,e)}function o(t){return this.shouldComponentUpdate=n,E(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.__f=o.prototype.isReactComponent=!0,o.type=e,o},forwardRef:function(e){function t(t){var n=Ht({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Qt,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},flushSync:function(e,t){var n=s.debounceRendering;s.debounceRendering=function(e){return e()};var o=e(t);return s.debounceRendering=n,o},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:F,Suspense:nn,SuspenseList:rn,lazy:function(e){var t,n,o,r=null;function i(i){if(t||(t=e()).then(function(e){e&&(r=e.default||e),o=!0},function(e){n=e,o=!0}),n)throw n;if(!o)throw t;return r?E(r,i):null}return i.displayName="Lazy",i.__f=!0,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:wn};const Sn={none:void 0,fade:"pw-vpopup-fade 0.35s ease-out backwards",slide:"pw-vpopup-slide 0.35s ease-out backwards"};function xn({slot:e,align:t,inverse:n,colors:o}){const r={...le[e.variant],textAlign:e.align??t,padding:"4px 0"},i=ce(e.variant,o,n);return i&&(r.color=i),Cn.createElement("div",{style:r,dangerouslySetInnerHTML:{__html:Ve(e.html)}})}function En({slot:e,accent:t,onRequestClose:n,onPageChange:o}){const r={display:"block",boxSizing:"border-box",width:"100%",padding:"10px 25px",borderRadius:3,fontSize:14,fontWeight:600,fontFamily:"inherit",lineHeight:1.5,textAlign:"center",textDecoration:"none",cursor:"pointer",..."secondary"===e.variant?{backgroundColor:"#FFFFFF",color:t,border:`1px solid ${t}`}:{backgroundColor:t,color:"#FFFFFF",border:"none"}},i={padding:"8px 0 4px"};if("close"===e.action.type)return Cn.createElement("div",{style:i},Cn.createElement("button",{type:"button",style:r,onClick:n},e.label));if("page"===e.action.type){const t=e.action.page;return Cn.createElement("div",{style:i},Cn.createElement("button",{type:"button",style:r,onClick:()=>o(t)},e.label))}const s=Le(e.action.url);return s?Cn.createElement("div",{style:i},Cn.createElement("a",{href:s,...De(e.action.target),style:r},e.label)):Cn.createElement("div",{style:i},Cn.createElement("button",{type:"button",style:r},e.label))}function Pn({node:e,page:t,colors:n,leaf:o,onRequestClose:r,onPageChange:i}){const s=t.contents.find(t=>t.key===e.props.content);if(!s)return null;if(o?.renderZone)return Cn.createElement("div",{style:{minWidth:0}},o.renderZone(s,e));const u=e.props.align??"left",l="inverse"===e.props.tone;return Cn.createElement("div",{style:{minWidth:0}},s.slots.map(e=>"text"===e.type?Cn.createElement(xn,{key:e.key,slot:e,align:u,inverse:l,colors:n}):Cn.createElement(En,{key:e.key,slot:e,accent:n.accent,onRequestClose:r,onPageChange:i})))}function Fn({node:e,page:t,leaf:n}){const o=t.images.find(t=>t.key===e.props.image);if(!o)return null;if(n?.renderImage)return Cn.createElement(Cn.Fragment,null,n.renderImage(o,e));if(!o.src)return null;const r={display:"block",width:"100%",minWidth:0};return o.fit?(r.height="100%",r.objectFit=o.fit):r.height="auto",o.blur&&(r.filter=`blur(${o.blur}px)`),Cn.createElement("img",{src:o.src,alt:"",style:r})}function Rn({node:e,page:t,colors:n,leaf:o,onRequestClose:r,onPageChange:i}){if("Content"===e.type)return Cn.createElement(Pn,{node:e,page:t,colors:n,leaf:o,onRequestClose:r,onPageChange:i});if("Image"===e.type)return Cn.createElement(Fn,{node:e,page:t,leaf:o});const s=e.props?.backgroundImage,u=s?t.images.find(e=>e.key===s):void 0,l=u?.blur??0,a=u?.dim??0,c=Be(e,l>0?void 0:u?.src||void 0,a);s&&(c.backgroundColor="#1D2939");const _=e.children.map((e,s)=>Cn.createElement(Rn,{key:s,node:e,page:t,colors:n,leaf:o,onRequestClose:r,onPageChange:i}));if(l>0){const{backgroundColor:e,...t}=c;return Cn.createElement("div",{style:{display:"grid",minWidth:0,backgroundColor:e,...u?.src?Ue(u.src,a):{}}},Cn.createElement("div",{style:{...t,backdropFilter:`blur(${l}px)`,WebkitBackdropFilter:`blur(${l}px)`}},_))}return Cn.createElement("div",{style:c},_)}function An({page:e,params:t,leafRenderers:n,animatePage:o=!1,onRequestClose:r,onPageChange:i}){const s={position:"relative",boxSizing:"border-box",overflow:"hidden",backgroundColor:t.colors.background,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',color:t.colors.text,borderRadius:t.borderRadius>0?t.borderRadius:void 0,boxShadow:t.boxShadow&&"none"!==t.boxShadow?t.boxShadow:void 0,transition:"height 300ms ease"};e.height&&(s.height="stretch"===e.height?"100%":e.height,s.overflowY="auto");const u={...o?{animation:"pw-vpopup-page 300ms ease-out backwards"}:{},..."stretch"===e.height?{display:"grid",minHeight:"100%"}:{}};return Cn.createElement("div",{style:s},Cn.createElement("div",{key:e.key,style:u},Cn.createElement(Rn,{node:e.layout,page:e,colors:t.colors,leaf:n,onRequestClose:r,onPageChange:i??(()=>{})})))}function Nn({onRequestClose:e}){return Cn.createElement("button",{type:"button","aria-label":"Close",onClick:e,style:{position:"absolute",top:10,right:10,width:24,height:24,padding:0,border:"none",borderRadius:"50%",background:"rgba(255, 255, 255, 0.92)",boxShadow:"0 1px 3px rgba(16, 24, 40, 0.25)",color:"#667085",fontSize:13,lineHeight:1,cursor:"pointer"}},"✕")}function In(e,t,n){const{placement:o}=e,r={position:"fixed",boxSizing:"border-box",maxWidth:st(o),maxHeight:st(o),pointerEvents:"auto"};if(t){r.width=t;const e=o.h;"left"===e?r.left=o.offset:"right"===e?r.right=o.offset:r.left="50%"}else r.left=o.offset,r.right=o.offset;"stretch"===n?(r.top=o.offset,r.bottom=o.offset):"top"===o.v?r.top=o.offset:"bottom"===o.v?r.bottom=o.offset:r.top="50%";const i=t&&"center"===o.h?"-50%":"0",s="middle"===o.v&&"stretch"!==n?"-50%":"0";"0"===i&&"0"===s||(r.transform=`translate(${i}, ${s})`);const u=Sn[e.animation];return u&&(r.animation=u),r.transition="width 300ms ease",r}function On({params:e,mode:t="live",onRequestClose:n,leafRenderers:o}){const[r,i]=wt(null);Ct(()=>{it(e).forEach(e=>e.images.forEach(({src:e})=>{e&&((new Image).src=e)}))},[e]);const s=it(e);if(0===s.length)return null;const u=s.find(e=>e.key===r)??function(e,t){return t.find(t=>t.key===e.startPage)??t[0]}(e,s),l=null!==r;if("preview"===t)return Cn.createElement("div",{style:{position:"relative",width:u.width??"100%",transition:"width 300ms ease"}},Cn.createElement("style",null,_e),Cn.createElement(An,{page:u,params:e,leafRenderers:o,animatePage:l,onRequestClose:n,onPageChange:i}));const a=e.overlay;return Cn.createElement(Cn.Fragment,null,Cn.createElement("style",null,_e),a&&Cn.createElement("div",{style:{position:"fixed",inset:0,backgroundColor:a.color,opacity:a.opacity,animation:"pw-vpopup-overlay 0.2s ease-out backwards",pointerEvents:"auto"},onClick:n}),Cn.createElement("div",{style:In(e,u.width,u.height)},Cn.createElement(An,{page:u,params:e,leafRenderers:o,animatePage:l,onRequestClose:n,onPageChange:i}),Cn.createElement(Nn,{onRequestClose:n})))}const jn=e=>{const t=function(e){let t;try{t=JSON.parse(e)}catch{return null}if("object"!=typeof t||null===t)return null;const n=t;if(2!==n.version)return null;const o=n.params;return"object"!=typeof o||null===o?null:Array.isArray(o.pages)&&0!==o.pages.length?{version:2,params:{...o,colors:Ke(o)}}:null}(e);return t?0===it(t.params).length?null:t.params:null};let Tn=null;const $n="keyValue",Wn="messages",Mn="inboxMessages";function Hn(e,t){return function(n){n.objectStoreNames.contains(e)||t(n)}}const Un=[Hn($n,function(e){e.createObjectStore($n,{keyPath:"key"})}),Hn("log",function(e){const t=e.createObjectStore("log",{keyPath:"id",autoIncrement:!0});t.createIndex("environment","environment",{unique:!1}),t.createIndex("date","date",{unique:!1}),t.createIndex("type","type",{unique:!1})}),Hn(Wn,function(e){e.createObjectStore(Wn,{keyPath:"id",autoIncrement:!0}).createIndex("date","date",{unique:!1})}),Hn(Mn,function(e){const t="status",n=e.createObjectStore(Mn,{keyPath:"inbox_id",autoIncrement:!1});n.createIndex(t,t,{unique:!1,multiEntry:!0}),n.createIndex("rt","rt",{unique:!1,multiEntry:!0})})];class Bn{get all(){return Un}}class Ln{constructor(e,t=new Bn){this.db=e,this.migrationsBuilder=t}applyMigrations(){this.applyMigrationsPack(this.migrationsBuilder.all)}applyMigrationsPack(e){e.forEach(e=>{e(this.db)})}}function Dn(e,t){console.info("onversionchange",t),e.close()}let zn;function qn(e){return(zn||(zn=new Promise((e,t)=>{const n=indexedDB.open("PUSHWOOSH_SDK_STORE",7);n.onsuccess=n=>{const o=n.target.result;o.onversionchange=Dn.bind(null,o,t),e(o)},n.onerror=()=>t(n.error),n.onupgradeneeded=e=>{const n=e.target.result;n.onversionchange=Dn.bind(null,n,t),new Ln(n).applyMigrations()}})),zn).then(t=>new Promise((n,o)=>e(t,n,o)))}class Vn{_add(e){return qn((t,n,o)=>{const r=t.transaction([this.name],"readwrite").objectStore(this.name).add(e);r.onsuccess=()=>{n(e)},r.onerror=()=>{o(r.error)}}).then(e=>this.getAll().then(t=>{if(Array.isArray(t)){const n=t.map(e=>e.id).sort((e,t)=>e==t?0:e<t?1:-1);if(n.length>this.maxItems)return Promise.all(n.slice(this.maxItems).map(e=>this.delete(e))).then(()=>e)}return e}))}delete(e){return qn((t,n,o)=>{const r=t.transaction([this.name],"readwrite").objectStore(this.name).delete(e);r.onsuccess=()=>{n(r.result)},r.onerror=()=>{o(r.error)}})}getAll(){return qn((e,t,n)=>{const o=[],r=e.transaction(this.name).objectStore(this.name).openCursor();r.onsuccess=e=>{const n=e.target.result;n?(n.value&&o.push(n.value),n.continue()):t(o)},r.onerror=()=>{n(r.error)}})}}Zn=$n;var Zn;const Kn=new class extends Vn{constructor(){super(...arguments),this.name="log",this.maxItems=100,this.environment="undefined"!=typeof self&&self.registration?"worker":"browser"}add(e,t,n){const o={type:e,environment:this.environment,message:`${t}`,date:new Date};return t instanceof Error&&(o.stack=t.stack),n&&(o.additional=n),this._add(o)}},Qn=(new class extends Vn{constructor(){super(...arguments),this.name=Wn,this.maxItems=25}add(e){return this._add({...e,date:new Date})}},{error:1,info:2,debug:3});let Gn=3;const Jn={setLevel(e){Qn[e]||(e="error"),Gn=Qn[e]},write(e,t,n){return"error"===e?this.error(t):this.info(t),Kn.add(e,t,n)}};Object.keys(Qn).forEach(e=>{const t=Qn[e];Jn[e]=(...n)=>{t<=Gn&&(console.groupCollapsed(e),console.info("",...n),console.trace("trace"),console.groupEnd())}});class Yn{lockBodyScroll(){0===this.openPopupsCount&&(this.bodyOverflowBeforeLock=document.body.style.overflow,document.body.style.overflow="hidden"),this.openPopupsCount+=1}unlockBodyScroll(){this.openPopupsCount=Math.max(0,this.openPopupsCount-1),0===this.openPopupsCount&&null!==this.bodyOverflowBeforeLock&&(document.body.style.overflow=this.bodyOverflowBeforeLock,this.bodyOverflowBeforeLock=null)}constructor(e){this.isRecurringVisitor=!1,this.loadedPopups=new Map,this.pendingTimers=new Map,this.isNavigationSubscribed=!1,this.openPopupsCount=0,this.bodyOverflowBeforeLock=null,this.pw=e}async run(){const{pw:e}=this;await e.api.ensureDeviceRegistered(),this.isRecurringVisitor=await e.data.getIsRecurringVisitor();const t=await e.api.getPopupForms();(await Promise.allSettled(t.map(e=>this.loadWebPopup(e)))).forEach((e,n)=>{"rejected"===e.status&&Jn.error(e.reason,`Failed to load web popup "${t[n].code}"`)}),this.subscribeToNavigation(),this.renderForCurrentPage(),await e.data.setIsRecurringVisitor(!0)}async loadWebPopup(e){if(!await this.checkStrongCondition(e))return;if(e.subscription_form_code)return await(Tn||(customElements.get(r)?(Tn=Promise.resolve(),Tn):(Tn=new Promise((e,t)=>{let n=0;const i=e=>{window.clearTimeout(n),Tn=null,t(e)};n=window.setTimeout(()=>{i(new Error(`Subscription forms widget did not define <${r}> within 10000ms`))},1e4);const s=document.createElement("script");s.type="module",s.src=o,s.onerror=()=>{i(new Error(`Failed to load subscription forms widget script: ${o}`))},document.head.appendChild(s),customElements.whenDefined(r).then(()=>{window.clearTimeout(n),e()})}),Tn))),void this.loadedPopups.set(e.code,{popup:e,kind:"subscription-form",formCode:e.subscription_form_code});if(!e.popup_form_content_code)return void Jn.error(new Error("Web popup has no source"),`Web popup "${e.code}" has neither content nor subscription form; skipping`);const t=await this.pw.api.getPopupFormContent(e.popup_form_content_code),n=jn(t.json);n?this.loadedPopups.set(e.code,{popup:e,kind:"content",parsed:n}):Jn.error(new Error("Unsupported popup content format"),`Web popup "${e.code}" content is not a supported {version, params} popup; skipping`)}renderForCurrentPage(){this.cancelPendingForUnmatchedPages();const e=[];this.loadedPopups.forEach((t,n)=>{this.checkSoftCondition(t.popup)&&e.push([n,t])}),e.forEach(([e,t])=>{this.addToQueue(t),this.loadedPopups.delete(e)})}cancelPendingForUnmatchedPages(){this.pendingTimers.forEach(({timeoutId:e,loaded:t},n)=>{this.checkSoftCondition(t.popup)||(window.clearTimeout(e),this.pendingTimers.delete(n),this.loadedPopups.set(n,t))})}subscribeToNavigation(){if(this.isNavigationSubscribed)return;this.isNavigationSubscribed=!0;const e=()=>this.renderForCurrentPage(),t=window.navigation;if(t&&"function"==typeof t.addEventListener)return void t.addEventListener("currententrychange",e);window.addEventListener("popstate",e),window.addEventListener("hashchange",e);let n=window.location.href;window.setInterval(()=>{window.location.href!==n&&(n=window.location.href,e())},500)}async checkStrongCondition(e){return(await Promise.all([this.checkCanBeShownByDeviceTypeCondition(e),this.checkCanBeShownByFrequencyCondition(e),this.checkCanBeShownByVisitorsTypeCondition(e)])).every(e=>e)}checkSoftCondition(e){return this.checkCanBeShownByMatchingPagesCondition(e)}checkCanBeShownByDeviceTypeCondition(e){const{device_type:t}=e,n=this.pw.platformChecker.formFactor;return"ALL"===t||t===n}async checkCanBeShownByFrequencyCondition(e){const{frequency:t,code:n}=e;if("ONCE"===t){return!(await this.pw.data.getShownWebPopups()).includes(n)}return"ONCE_PER_SESSION"!==t||null===sessionStorage.getItem(this.getSessionStorageKey(n))}checkCanBeShownByMatchingPagesCondition(e){const{matching_pages:t,matching_page_rules:n,excluded_pages:o}=e,r=window.location.pathname;return n&&n.length>0?n.some(e=>this.matchPageRule(r,e)):t&&t.length>0?t.includes(r):!(o&&o.length>0)||!o.some(e=>this.matchPageRule(r,e))}matchPageRule(e,t){switch(t.operator){case"EQUALS":return e===t.path;case"STARTS_WITH":return e.startsWith(t.path);default:return!1}}checkCanBeShownByVisitorsTypeCondition(e){const{visitors_type:t}=e;return"NEW"===t?!this.isRecurringVisitor:"RECURRING"!==t||this.isRecurringVisitor}async markAsShown(e){this.pw.api.recordPopupFormEvent(e.code,2).catch(t=>{Jn.error(t,`Failed to record web popup shown event for "${e.code}"`)});const{frequency:t,code:n}=e;"ONCE"!==t?"ONCE_PER_SESSION"===t&&sessionStorage.setItem(this.getSessionStorageKey(n),"1"):await this.pw.data.addShownWebPopup(n)}getSessionStorageKey(e){return`${n}.shown.${e}`}addToQueue(e){const t=e.popup;this.pw.api.recordPopupFormEvent(t.code,1).catch(e=>{Jn.error(e,`Failed to record web popup queued event for "${t.code}"`)});const o=window.setTimeout(()=>{this.pendingTimers.delete(t.code);const o=document.createElement("div");o.id=`${n}-${t.code}`,o.style.position="fixed",o.style.inset="0",o.style.zIndex=String(2147483647),o.style.pointerEvents="none",document.body.appendChild(o);const r=o.attachShadow({mode:"open"}),i=document.createElement("div");r.appendChild(i);const s="subscription-form"===e.kind||!!e.parsed.overlay;s&&this.lockBodyScroll();const u=()=>{s&&this.unlockBodyScroll(),o.remove(),this.pw.dispatchEvent("hide-web-popup",{code:t.code})};"subscription-form"===e.kind?this.renderSubscriptionForm(i,e.formCode,u):((e,t,n)=>{J(te(On,{params:t,mode:"live",onRequestClose:n}),e)})(i,e.parsed,u),this.markAsShown(t).catch(e=>{Jn.error(e,`Failed to mark web popup "${t.code}" as shown`)}),this.pw.dispatchEvent("show-web-popup",{code:t.code})},1e3*t.delay);this.pendingTimers.set(t.code,{timeoutId:o,loaded:e})}renderSubscriptionForm(e,t,n){const o=document.createElement("div");o.style.position="absolute",o.style.inset="0",o.style.background="rgba(0, 0, 0, 0.5)",o.style.pointerEvents="auto",o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="center",o.style.padding="20px",o.style.boxSizing="border-box",o.addEventListener("click",e=>{e.target===o&&n()});const i=document.createElement(r);i.formCode=t,i.setAttribute("hosted-mode",""),i.addEventListener("esw-close",n),o.appendChild(i),e.appendChild(o)}}return t})());
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,()=>(()=>{"use strict";const e={d:(t,n)=>{if(Array.isArray(n))for(var o=0;o<n.length;){var r=n[o++],i=n[o++];e.o(t,r)?0===i&&o++:0===i?Object.defineProperty(t,r,{enumerable:!0,value:n[o++]}):Object.defineProperty(t,r,{enumerable:!0,get:i})}else for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let t={};e.r(t),e.d(t,{WebPopupsWidget:()=>ko});const n=/^(https?:|mailto:|tel:)/i,o="#101828",r="#FFFFFF",i="#2970FF",s=o,l="#667085",a="#FFFFFF",u={h1:{fontSize:24,fontWeight:600,lineHeight:1.25},h2:{fontSize:18,fontWeight:600,lineHeight:1.3},h3:{fontSize:16,fontWeight:600,lineHeight:1.35},body:{fontSize:14,fontWeight:"normal",lineHeight:1.5},caption:{fontSize:12,fontWeight:"normal",lineHeight:1.4},eyebrow:{fontSize:11,fontWeight:600,letterSpacing:"0.08em",lineHeight:1.4},icon:{fontSize:24,lineHeight:1.2}},c={h1:1,h2:1,h3:1,icon:1,eyebrow:.8,body:.9,caption:.75};function _(e,t,n){return n?function(e,t){if(t>=1)return e;const n=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.exec(e)?.[1];if(!n)return e;const o=3===n.length?n.split("").map(e=>e+e).join(""):n,[r,i,s]=[0,2,4].map(e=>parseInt(o.slice(e,e+2),16));return`rgba(${r}, ${i}, ${s}, ${t})`}(t.textInverse,c[e]??1):"icon"!==e?"caption"===e||"eyebrow"===e?t.textSecondary:t.text:void 0}const p="8px 0 4px",f="8px 0 4px";function d(e,t){return{display:"block",boxSizing:"border-box",width:"100%",padding:"10px 25px",borderRadius:3,fontSize:14,fontWeight:600,fontFamily:"inherit",lineHeight:1.5,textAlign:"center",textDecoration:"none",cursor:"pointer",..."secondary"===e?{backgroundColor:"#FFFFFF",color:t,border:`1px solid ${t}`}:{backgroundColor:t,color:"#FFFFFF",border:"none"}}}const h="#D92D20";function m(e="#D0D5DD"){return{display:"block",boxSizing:"border-box",width:"100%",padding:"10px 12px",borderRadius:3,fontSize:14,fontFamily:"inherit",lineHeight:1.5,backgroundColor:"#FFFFFF",color:o,border:`1px solid ${e}`,outline:"none"}}const y="Subscribe",g="Thanks for subscribing!",v="Please check your inbox and confirm your email.",b="\n@keyframes pw-vpopup-fade { from { opacity: 0; } }\n@keyframes pw-vpopup-slide { from { opacity: 0; translate: 0 28px; } }\n@keyframes pw-vpopup-overlay { from { opacity: 0; } }\n@keyframes pw-vpopup-page { from { opacity: 0; } }\n",k=["Vertical","Horizontal","Columns","Rows"],w=["normal","reverse"],S=["start","center","end","stretch"],C=["start","center","end","space-between"],x=["left","center","right"],E=["default","inverse"],P=2e3,F={px:P,"%":100,em:125,rem:125},R=/^(\d{1,4}(?:\.\d+)?)(px|%|em|rem)$/,$={px:P,"%":100,fr:100},A=/^(\d{1,4}(?:\.\d+)?)(px|%|fr)$/,I=["auto","min-content","max-content"];function N(e,t){return t.includes(e)?e:void 0}function j(e){if("number"==typeof e&&Number.isFinite(e))return Math.min(Math.max(e,0),P);if("string"!=typeof e)return;const t=R.exec(e.trim());if(!t)return;const[,n,o]=t;return`${Math.min(parseFloat(n),F[o])}${o}`}const O=["top","right","bottom","left"];function T(e){if(I.includes(e))return e;const t=A.exec(e);if(!t)return;const[,n,o]=t;return`${Math.min(parseFloat(n),$[o])}${o}`}function M(e){return"string"==typeof e&&e.length>0?e:void 0}function L(e){const t={},n=j(e.gap);void 0!==n&&(t.gap=n);const o=function(e){const t=j(e);if(void 0!==t)return t;if("object"!=typeof e||null===e)return;const n={};for(const t of O){const o=j(e[t]);void 0!==o&&(n[t]=o)}return Object.keys(n).length>0?n:void 0}(e.padding);void 0!==o&&(t.padding=o);const r=N(e.alignItems,S);r&&(t.alignItems=r);const i=N(e.justifyContent,C);i&&(t.justifyContent=i);const s=N(e.alignContent,C);s&&(t.alignContent=s);const l=M(e.backgroundImage);l&&(t.backgroundImage=l);const a=function(e){if("number"==typeof e)return Number.isInteger(e)&&e>=1&&e<=12?e:void 0;if("string"!=typeof e)return;const t=e.trim().split(/\s+/);if(t.length<1||t.length>12)return;const n=t.map(T);return n.every(e=>void 0!==e)?n.join(" "):void 0}(e.sizes);return void 0!==a&&(t.sizes=a),t}function U(e,t,n){if(t>10||n.nodes<=0)return null;if("object"!=typeof e||null===e)return null;n.nodes-=1;const o=e,r="object"==typeof o.props&&null!==o.props?o.props:{};if("Content"===o.type){const e=M(r.content);if(!e)return null;const t={type:"Content",props:{content:e}},n=N(r.align,x);n&&(t.props.align=n);const o=N(r.tone,E);return o&&"default"!==o&&(t.props.tone=o),t}if("Image"===o.type){const e=M(r.image);if(!e)return null;return{type:"Image",props:{image:e}}}if(!Array.isArray(o.children))return null;const i=N(o.type,k)??"Vertical",s=[];for(const e of o.children){const o=U(e,t+1,n);o&&s.push(o)}const l=L(r);return"reverse"===N(r.order,w)&&(s.reverse(),"string"==typeof l.sizes&&(l.sizes=l.sizes.split(" ").reverse().join(" "))),{type:i,props:l,children:s}}function H(e){return U(e,0,{nodes:100})}const W=/^[a-zA-Z][a-zA-Z0-9-]*$/,B=/^\$([a-zA-Z][a-zA-Z0-9-]*)$/;function D(e,t){return e.includes("$")?e.split(/(\s+)/).map(e=>{const n=B.exec(e)?.[1];return void 0!==n&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:e}).join(""):e}function z(e,t){return"object"!=typeof e||null===e||0===Object.keys(t).length?e:V(e,t,0)}const q=new Set(["content","image","backgroundImage"]);function V(e,t,n){if(n>10||"object"!=typeof e||null===e)return e;const o=e,r={...o};if("object"==typeof o.props&&null!==o.props){const e={...o.props};for(const[n,o]of Object.entries(e))if(!q.has(n))if("string"==typeof o)e[n]=D(o,t);else if("object"==typeof o&&null!==o&&!Array.isArray(o)){const r={...o};for(const[e,n]of Object.entries(r))"string"==typeof n&&(r[e]=D(n,t));e[n]=r}r.props=e}return Array.isArray(o.children)&&(r.children=o.children.map(e=>V(e,t,n+1))),r}function Z(e){return"number"==typeof e?`${e}px`:e}function J(e,t){if("string"==typeof e)return e;return`repeat(${"number"==typeof e?e:Math.max(t,1)}, 1fr)`}function K(e,t=0){const n=`url(${JSON.stringify(e)})`,o=t>0?`rgba(16, 24, 40, ${Math.min(t,1)})`:null;return{backgroundImage:o?`linear-gradient(${o}, ${o}), ${n}`:n,backgroundSize:"cover",backgroundPosition:"center"}}function Q(e,t,n=0){const o=e.props??{},r={display:"grid",minWidth:0};return"Horizontal"===e.type&&(r.gridAutoFlow="column"),"Columns"===e.type&&(r.gridTemplateColumns=J(o.sizes,e.children.length)),"Rows"===e.type&&(r.gridTemplateRows=J(o.sizes,e.children.length)),void 0!==o.gap&&(r.gap=Z(o.gap)),void 0!==o.padding&&(r.padding=function(e){if("number"==typeof e||"string"==typeof e)return Z(e);const t=e=>void 0===e?"0":Z(e);return`${t(e.top)} ${t(e.right)} ${t(e.bottom)} ${t(e.left)}`}(o.padding)),o.alignItems&&(r.alignItems=o.alignItems),o.justifyContent&&(r.justifyContent=o.justifyContent),o.alignContent&&(r.alignContent=o.alignContent),t&&Object.assign(r,K(t,n)),r}function Y(e){const t=(e||"").trim();if(t)return t.startsWith("#")||t.startsWith("/")||t.startsWith("?")||n.test(t)?t:void 0}function G(e){return"_self"===e?{target:"_self"}:{target:"_blank",rel:"noreferrer"}}const X=new Set(["STRONG","B","EM","I","U","BR","A"]);function ee(e,t,n){for(const o of Array.from(e.childNodes)){if(3===o.nodeType){t.appendChild(n.createTextNode(o.textContent??""));continue}if(1!==o.nodeType)continue;const e=o;if(!X.has(e.tagName)){ee(e,t,n);continue}const r=n.createElement(e.tagName.toLowerCase());if("A"===e.tagName){const t=Y(e.getAttribute("href")??void 0);t&&r.setAttribute("href",t);const{target:n,rel:o}=G(e.getAttribute("target"));r.setAttribute("target",n),o&&r.setAttribute("rel",o)}t.appendChild(r),ee(e,r,n)}}function te(e){if(!e.includes("<"))return e;const t=(new DOMParser).parseFromString(e,"text/html"),n=t.createElement("div");return ee(t.body,n,t),n.innerHTML}function ne(e){return"string"==typeof e&&e?e:void 0}function oe(e){const t="object"==typeof e.colors&&null!==e.colors?e.colors:{};return{background:ne(t.background)??ne(e.background)??r,accent:ne(t.accent)??ne(e.accent)??i,text:ne(t.text)??s,textSecondary:ne(t.textSecondary)??l,textInverse:ne(t.textInverse)??a}}const re=["cover","contain"];function ie(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(t.length>=20)break;"object"==typeof n&&null!==n&&("string"==typeof n.key&&n.key&&"string"==typeof n.src&&t.push({key:n.key,label:"string"==typeof n.label?n.label:"",src:n.src,..."string"==typeof n.mediaId&&n.mediaId?{mediaId:n.mediaId}:{},...re.includes(n.fit)?{fit:n.fit}:{},..."number"==typeof n.blur&&Number.isFinite(n.blur)&&n.blur>0?{blur:Math.min(n.blur,100)}:{},..."number"==typeof n.dim&&Number.isFinite(n.dim)&&n.dim>0?{dim:Math.min(n.dim,1)}:{}}))}return t}const se=["px","%","em","rem","fr"];function le(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}function ae(e){if("object"!=typeof e||null===e)return;const t=e;if("text"===t.kind)return{kind:"text"};if("length"===t.kind||"percent"===t.kind){const e=le(t.min),n=le(t.max),o="length"===t.kind&&Array.isArray(t.units)?t.units.filter(e=>se.includes(e)):[],r="length"===t.kind?function(e){if("object"!=typeof e||null===e)return;const t={};for(const n of se){const o=e[n];if("object"!=typeof o||null===o)continue;const r=le(o.min),i=le(o.max);void 0===r&&void 0===i||(t[n]={...void 0!==r?{min:r}:{},...void 0!==i?{max:i}:{}})}return Object.keys(t).length>0?t:void 0}(t.ranges):void 0;return{kind:t.kind,...void 0!==e?{min:e}:{},...void 0!==n?{max:n}:{},...o.length>0?{units:o}:{},...r?{ranges:r}:{}}}if("select"===t.kind&&Array.isArray(t.options)){const e=[];for(const n of t.options){if(e.length>=20)break;"object"==typeof n&&null!==n&&("string"!=typeof n.value||n.value.length>64||e.push({value:n.value,label:"string"==typeof n.label?n.label:n.value}))}if(e.length>0)return{kind:"select",options:e}}}function ue(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(t.length>=20)break;if("object"!=typeof n||null===n)continue;if("string"!=typeof n.key||!W.test(n.key))continue;if("string"!=typeof n.value||n.value.length>64||n.value.includes("$"))continue;if(t.some(e=>e.key===n.key))continue;const e=ae(n.control);t.push({key:n.key,label:"string"==typeof n.label?n.label:"",value:n.value,...e?{control:e}:{}})}return t}function ce(e){return Object.fromEntries(e.map(e=>[e.key,e.value]))}const _e=["email","firstName","lastName","phone","custom"],pe=["primary","secondary"];function fe(e){const t=[];if(Array.isArray(e))for(const n of e){if(t.length>=10)break;"object"==typeof n&&null!==n&&("string"==typeof n.key&&n.key&&_e.includes(n.kind)&&(t.some(e=>e.key===n.key)||t.push({key:n.key,kind:n.kind,label:"string"==typeof n.label?n.label:"",placeholder:"string"==typeof n.placeholder?n.placeholder:"",required:"email"===n.kind||!0===n.required,..."custom"===n.kind&&"string"==typeof n.tag&&n.tag?{tag:n.tag}:{}})))}if(!t.some(e=>"email"===e.kind)){let e="field-email";for(;t.some(t=>t.key===e);)e=`${e}-1`;t.unshift({key:e,kind:"email",label:"Email",placeholder:"",required:!0})}return t.slice(0,10)}function de(e){const t=[];for(const n of e){if(t.length>=50)break;"object"==typeof n&&null!==n&&("string"==typeof n.key&&n.key&&("text"!==n.type?"button"!==n.type?"email-subscription-form"===n.type&&t.push({type:"email-subscription-form",key:n.key,formCode:"string"==typeof n.formCode?n.formCode:"",fields:fe(n.fields),submitLabel:"string"==typeof n.submitLabel&&n.submitLabel?n.submitLabel:y,submitVariant:pe.includes(n.submitVariant)?n.submitVariant:"primary",..."object"==typeof n.privacy&&null!==n.privacy&&"string"==typeof n.privacy.checkboxLabel?{privacy:{checkboxLabel:n.privacy.checkboxLabel,url:"string"==typeof n.privacy.url?n.privacy.url:"",linkLabel:"string"==typeof n.privacy.linkLabel?n.privacy.linkLabel:""}}:{},successMessage:"string"==typeof n.successMessage&&n.successMessage?n.successMessage:g,confirmEmailMessage:"string"==typeof n.confirmEmailMessage&&n.confirmEmailMessage?n.confirmEmailMessage:v}):"object"==typeof n.action&&null!==n.action&&"string"==typeof n.action.type&&t.push(n):"string"==typeof n.html&&t.push(n)))}return t}function he(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(t.length>=20)break;"object"==typeof n&&null!==n&&("string"==typeof n.key&&n.key&&Array.isArray(n.slots)&&t.push({key:n.key,label:"string"==typeof n.label?n.label:"",slots:de(n.slots)}))}return t}function me(e){return"number"==typeof e&&Number.isFinite(e)&&e>0?Math.min(e,2e3):void 0}function ye(e,t,n){if(null===e)return;let o;return o="stretch"===e?"stretch":me(e)??("stretch"===t?"stretch":me(t)),"width"===n&&"stretch"===o?void 0:o}function ge(e){const t=[];for(const n of e.pages){const o=ue(n.values),r=H(z(n.layout,ce(o)));if(!r)continue;const i=ye(n.width,e.width,"width"),s=ye(n.height,e.height,"height");t.push({key:n.key,layout:r,images:ie(n.images),contents:he(n.contents),...void 0!==i?{width:i}:{},...void 0!==s?{height:s}:{}})}return t}function ve(e){return`calc(100% - ${2*e.offset}px)`}const be="pushwoosh-web-popups",ke="[WebPopups]",we="https://cdn.pushwoosh.com/subscription-forms/widget.js",Se="pushwoosh-subscribe-widget";var Ce,xe,Ee,Pe,Fe,Re,$e,Ae,Ie,Ne,je,Oe,Te,Me,Le,Ue={},He=[],We=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Be=Array.isArray;function De(e,t){for(var n in t)e[n]=t[n];return e}function ze(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function qe(e,t,n){var o,r,i,s={};for(i in t)"key"==i?o=t[i]:"ref"==i?r=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?Ce.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===s[i]&&(s[i]=e.defaultProps[i]);return Ve(e,s,o,r,null)}function Ve(e,t,n,o,r){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Ee,__i:-1,__u:0};return null==r&&null!=xe.vnode&&xe.vnode(i),i}function Ze(e){return e.children}function Je(e,t){this.props=e,this.context=t}function Ke(e,t){if(null==t)return e.__?Ke(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Ke(e):null}function Qe(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],r=[],i=De({},t);i.__v=t.__v+1,xe.vnode&&xe.vnode(i),at(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Ke(t),!!(32&t.__u),r),i.__v=t.__v,i.__.__k[i.__i]=i,ct(o,i,r),t.__e=t.__=null,i.__e!=n&&Ye(i)}}function Ye(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),Ye(e)}function Ge(e){(!e.__d&&(e.__d=!0)&&Pe.push(e)&&!Xe.__r++||Fe!=xe.debounceRendering)&&((Fe=xe.debounceRendering)||Re)(Xe)}function Xe(){try{for(var e,t=1;Pe.length;)Pe.length>t&&Pe.sort($e),e=Pe.shift(),t=Pe.length,Qe(e)}finally{Pe.length=Xe.__r=0}}function et(e,t,n,o,r,i,s,l,a,u,c){var _,p,f,d,h,m,y,g=o&&o.__k||He,v=t.length;for(a=tt(n,t,g,a,v),_=0;_<v;_++)null!=(f=n.__k[_])&&(p=-1!=f.__i&&g[f.__i]||Ue,f.__i=_,m=at(e,f,p,r,i,s,l,a,u,c),d=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&ft(p.ref,null,f),c.push(f.ref,f.__c||d,f)),null==h&&null!=d&&(h=d),(y=!!(4&f.__u))||p.__k===f.__k?(a=nt(f,a,e,y),y&&p.__e&&(p.__e=null)):"function"==typeof f.type&&void 0!==m?a=m:d&&(a=d.nextSibling),f.__u&=-7);return n.__e=h,a}function tt(e,t,n,o,r){var i,s,l,a,u,c=n.length,_=c,p=0;for(e.__k=new Array(r),i=0;i<r;i++)null!=(s=t[i])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[i]=Ve(null,s,null,null,null):Be(s)?s=e.__k[i]=Ve(Ze,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[i]=Ve(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,a=i+p,s.__=e,s.__b=e.__b+1,l=null,-1!=(u=s.__i=rt(s,n,a,_))&&(_--,(l=n[u])&&(l.__u|=2)),null==l||null==l.__v?(-1==u&&(r>c?p--:r<c&&p++),"function"!=typeof s.type&&(s.__u|=4)):u!=a&&(u==a-1?p--:u==a+1?p++:(u>a?p--:p++,s.__u|=4))):e.__k[i]=null;if(_)for(i=0;i<c;i++)null!=(l=n[i])&&!(2&l.__u)&&(l.__e==o&&(o=Ke(l)),dt(l,l));return o}function nt(e,t,n,o){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=nt(r[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Ke(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function ot(e,t){return t=t||[],null==e||"boolean"==typeof e||(Be(e)?e.some(function(e){ot(e,t)}):t.push(e)),t}function rt(e,t,n,o){var r,i,s,l=e.key,a=e.type,u=t[n],c=null!=u&&!(2&u.__u);if(null===u&&null==l||c&&l==u.key&&a==u.type)return n;if(o>(c?1:0))for(r=n-1,i=n+1;r>=0||i<t.length;)if(null!=(u=t[s=r>=0?r--:i++])&&!(2&u.__u)&&l==u.key&&a==u.type)return s;return-1}function it(e,t,n){"-"==t[0]?e.setProperty(t,n??""):e[t]=null==n?"":"number"!=typeof n||We.test(t)?n:n+"px"}function st(e,t,n,o,r){var i,s;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||it(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||it(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(je,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[Ne]=o[Ne]:(n[Ne]=Oe,e.addEventListener(t,i?Me:Te,i)):e.removeEventListener(t,i?Me:Te,i);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=n??"";break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function lt(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[Ie])t[Ie]=Oe++;else if(t[Ie]<n[Ne])return;return n(xe.event?xe.event(t):t)}}}function at(e,t,n,o,r,i,s,l,a,u){var c,_,p,f,d,h,m,y,g,v,b,k,w,S,C,x,E=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(a=!!(32&n.__u),i=[l=t.__e=n.__e]),(c=xe.__b)&&c(t);e:if("function"==typeof E){_=s.length;try{if(g=t.props,v=E.prototype&&E.prototype.render,b=(c=E.contextType)&&o[c.__c],k=c?b?b.props.value:c.__:o,n.__c?y=(p=t.__c=n.__c).__=p.__E:(v?t.__c=p=new E(g,k):(t.__c=p=new Je(g,k),p.constructor=E,p.render=ht),b&&b.sub(p),p.state||(p.state={}),p.__n=o,f=p.__d=!0,p.__h=[],p._sb=[]),v&&null==p.__s&&(p.__s=p.state),v&&null!=E.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=De({},p.__s)),De(p.__s,E.getDerivedStateFromProps(g,p.__s))),d=p.props,h=p.state,p.__v=t,f)v&&null==E.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),v&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(v&&null==E.getDerivedStateFromProps&&g!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(g,k),t.__v==n.__v||!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(g,p.__s,k)){t.__v!=n.__v&&(p.props=g,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),He.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(g,p.__s,k),v&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(d,h,m)})}if(p.context=k,p.props=g,p.__P=e,p.__e=!1,w=xe.__r,S=0,v)p.state=p.__s,p.__d=!1,w&&w(t),c=p.render(p.props,p.state,p.context),He.push.apply(p.__h,p._sb),p._sb=[];else do{p.__d=!1,w&&w(t),c=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++S<25);p.state=p.__s,null!=p.getChildContext&&(o=De(De({},o),p.getChildContext())),v&&!f&&null!=p.getSnapshotBeforeUpdate&&(m=p.getSnapshotBeforeUpdate(d,h)),C=null!=c&&c.type===Ze&&null==c.key?_t(c.props.children):c,l=et(e,Be(C)?C:[C],t,n,o,r,i,s,l,a,u),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),y&&(p.__E=p.__=null)}catch(e){if(s.length=_,t.__v=null,a||null!=i){if(e.then){for(t.__u|=a?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;null!=i&&(i[i.indexOf(l)]=null),t.__e=l}else if(null!=i)for(x=i.length;x--;)ze(i[x])}else t.__e=n.__e;null==t.__k&&(t.__k=n.__k||[]),e.then||ut(t),xe.__e(e,t,n)}}else null==i&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=pt(n.__e,t,n,o,r,i,s,a,u);return(c=xe.diffed)&&c(t),128&t.__u?void 0:l}function ut(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ut))}function ct(e,t,n){for(var o=0;o<n.length;o++)ft(n[o],n[++o],n[++o]);xe.__c&&xe.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){xe.__e(e,t.__v)}})}function _t(e){return"object"!=typeof e||null==e||e.__b>0?e:Be(e)?e.map(_t):void 0!==e.constructor?null:De({},e)}function pt(e,t,n,o,r,i,s,l,a){var u,c,_,p,f,d,h,m=n.props||Ue,y=t.props,g=t.type;if("svg"==g?r="http://www.w3.org/2000/svg":"math"==g?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=i)for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!g&&(g?f.localName==g:3==f.nodeType)){e=f,i[u]=null;break}if(null==e){if(null==g)return document.createTextNode(y);e=document.createElementNS(r,g,y.is&&y),l&&(xe.__m&&xe.__m(t,i),l=!1),i=null}if(null==g)m===y||l&&e.data==y||(e.data=y);else{if(i="textarea"==g&&null!=y.defaultValue?null:i&&Ce.call(e.childNodes),!l&&null!=i)for(m={},u=0;u<e.attributes.length;u++)m[(f=e.attributes[u]).name]=f.value;for(u in m)f=m[u],"dangerouslySetInnerHTML"==u?_=f:"children"==u||u in y||"value"==u&&"defaultValue"in y||"checked"==u&&"defaultChecked"in y||st(e,u,null,f,r);for(u in y)f=y[u],"children"==u?p=f:"dangerouslySetInnerHTML"==u?c=f:"value"==u?d=f:"checked"==u?h=f:l&&"function"!=typeof f||m[u]===f||st(e,u,f,m[u],r);if(c)l||_&&(c.__html==_.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(_&&(e.innerHTML=""),et("template"==t.type?e.content:e,Be(p)?p:[p],t,n,o,"foreignObject"==g?"http://www.w3.org/1999/xhtml":r,i,s,i?i[0]:n.__k&&Ke(n,0),l,a),null!=i)for(u=i.length;u--;)ze(i[u]);l&&"textarea"!=g||(u="value","progress"==g&&null==d?e.removeAttribute("value"):null!=d&&(d!==e[u]||"progress"==g&&!d||"option"==g&&d!=m[u])&&st(e,u,d,m[u],r),u="checked",null!=h&&h!=e[u]&&st(e,u,h,m[u],r))}return e}function ft(e,t,n){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==t||(e.__u=e(t))}else e.current=t}catch(e){xe.__e(e,n)}}function dt(e,t,n){var o,r;if(xe.unmount&&xe.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||ft(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){xe.__e(e,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&dt(o[r],t,n||"function"!=typeof e.type);n||ze(e.__e),e.__c=e.__=e.__e=void 0}function ht(e,t,n){return this.constructor(e,n)}function mt(e,t,n){var o,r,i,s;t==document&&(t=document.documentElement),xe.__&&xe.__(e,t),r=(o="function"==typeof n)?null:n&&n.__k||t.__k,i=[],s=[],at(t,e=(!o&&n||t).__k=qe(Ze,null,[e]),r||Ue,Ue,t.namespaceURI,!o&&n?[n]:r?null:t.firstChild?Ce.call(t.childNodes):null,i,!o&&n?n:r?r.__e:t.firstChild,o,s),ct(i,e,s),e.props.children=null}function yt(e,t){mt(e,t,yt)}function gt(e,t,n){var o,r,i,s,l=De({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==i?o=t[i]:"ref"==i?r=t[i]:l[i]=void 0===t[i]&&null!=s?s[i]:t[i];return arguments.length>2&&(l.children=arguments.length>3?Ce.call(arguments,2):n),Ve(e.type,l,o||e.key,r||e.ref,null)}Ce=He.slice,xe={__e:function(e,t,n,o){for(var r,i,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},Ee=0,Je.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=De({},this.state),"function"==typeof e&&(e=e(De({},n),this.props)),e&&De(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Ge(this))},Je.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ge(this))},Je.prototype.render=Ze,Pe=[],Re="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,$e=function(e,t){return e.__v.__b-t.__v.__b},Xe.__r=0,Ae=Math.random().toString(8),Ie="__d"+Ae,Ne="__a"+Ae,je=/(PointerCapture)$|Capture$/i,Oe=0,Te=lt(!1),Me=lt(!0),Le=0;var vt=0;Array.isArray;function bt(e,t,n,o,r,i){t||(t={});var s,l,a=t;if("ref"in a)for(l in a={},t)"ref"==l?s=t[l]:a[l]=t[l];var u={type:e,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--vt,__i:-1,__u:0,__source:r,__self:i};if("function"==typeof e&&(s=e.defaultProps))for(l in s)void 0===a[l]&&(a[l]=s[l]);return xe.vnode&&xe.vnode(u),u}var kt,wt,St,Ct,xt=0,Et=[],Pt=xe,Ft=Pt.__b,Rt=Pt.__r,$t=Pt.diffed,At=Pt.__c,It=Pt.unmount,Nt=Pt.__;function jt(e,t){Pt.__h&&Pt.__h(wt,e,xt||t),xt=0;var n=wt.__H||(wt.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Ot(e){return xt=1,Tt(Gt,e)}function Tt(e,t,n){var o=jt(kt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Gt(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=wt,!wt.__f)){var r=function(e,t,n){if(!o.__c.__H)return!0;var r=!1,s=o.__c.props!==e;if(o.__c.__H.__.some(function(e){if(e.__N){r=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}}),i){var l=i.call(this,e,t,n);return r?l||s:l}return!r||s};wt.__f=!0;var i=wt.shouldComponentUpdate,s=wt.componentWillUpdate;wt.componentWillUpdate=function(e,t,n){if(this.__e){var o=i;i=void 0,r(e,t,n),i=o}s&&s.call(this,e,t,n)},wt.shouldComponentUpdate=r}return o.__N||o.__}function Mt(e,t){var n=jt(kt++,3);!Pt.__s&&Yt(n.__H,t)&&(n.__=e,n.u=t,wt.__H.__h.push(n))}function Lt(e,t){var n=jt(kt++,4);!Pt.__s&&Yt(n.__H,t)&&(n.__=e,n.u=t,wt.__h.push(n))}function Ut(e){return xt=5,Wt(function(){return{current:e}},[])}function Ht(e,t,n){xt=6,Lt(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function Wt(e,t){var n=jt(kt++,7);return Yt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Bt(e,t){return xt=8,Wt(function(){return e},t)}function Dt(e){var t=wt.context[e.__c],n=jt(kt++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(wt)),t.props.value):e.__}function zt(e,t){Pt.useDebugValue&&Pt.useDebugValue(t?t(e):e)}function qt(){var e=jt(kt++,11);if(!e.__){for(var t=wt.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Vt(){for(var e;e=Et.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Kt),t.__h.some(Qt),t.__h=[]}catch(n){t.__h=[],Pt.__e(n,e.__v)}}}Pt.__b=function(e){wt=null,Ft&&Ft(e)},Pt.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Nt&&Nt(e,t)},Pt.__r=function(e){Rt&&Rt(e),kt=0;var t=(wt=e.__c).__H;t&&(St===wt?(t.__h=[],wt.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Kt),t.__h.some(Qt),t.__h=[],kt=0)),St=wt},Pt.diffed=function(e){$t&&$t(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Et.push(t)&&Ct===Pt.requestAnimationFrame||((Ct=Pt.requestAnimationFrame)||Jt)(Vt)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),St=wt=null},Pt.__c=function(e,t){t.some(function(e){try{e.__h.some(Kt),e.__h=e.__h.filter(function(e){return!e.__||Qt(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],Pt.__e(n,e.__v)}}),At&&At(e,t)},Pt.unmount=function(e){It&&It(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Kt(e)}catch(e){t=e}}),n.__H=void 0,t&&Pt.__e(t,n.__v))};var Zt="function"==typeof requestAnimationFrame;function Jt(e){var t,n=function(){clearTimeout(o),Zt&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Zt&&(t=requestAnimationFrame(n))}function Kt(e){var t=wt,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),wt=t}function Qt(e){var t=wt;e.__c=e.__(),wt=t}function Yt(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Gt(e,t){return"function"==typeof t?t(e):t}function Xt(e,t){for(var n in t)e[n]=t[n];return e}function en(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function tn(e,t){var n=t(),o=Ot({t:{__:n,u:t}}),r=o[0].t,i=o[1];return Lt(function(){r.__=n,r.u=t,nn(r)&&i({t:r})},[e,n,t]),Mt(function(){return nn(r)&&i({t:r}),e(function(){nn(r)&&i({t:r})})},[e]),n}function nn(e){try{return!((t=e.__)===(n=e.u())&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}var t,n}function on(e){e()}function rn(e){return e}function sn(){return[!1,on]}var ln=Lt;function an(e,t){this.props=e,this.context=t}(an.prototype=new Je).isPureReactComponent=!0,an.prototype.shouldComponentUpdate=function(e,t){return en(this.props,e)||en(this.state,t)};var un=xe.__b;xe.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),un&&un(e)};var cn="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var _n=function(e,t){return null==e?null:ot(ot(e).map(t))},pn={map:_n,forEach:_n,count:function(e){return e?ot(e).length:0},only:function(e){var t=ot(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:ot},fn=xe.__e;xe.__e=function(e,t,n,o){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k||[]),r.__c(e,t);fn(e,t,n,o)};var dn=xe.unmount;function hn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=Xt({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return hn(e,t,n)})),e}function mn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return mn(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function yn(){this.__u=0,this.o=null,this.__b=null}function gn(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function vn(){this.i=null,this.l=null}xe.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),dn&&dn(e)},(yn.prototype=new Je).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=gn(o.__v),i=!1,s=function(){i||o.__z||(i=!0,n.__R=null,r?r(a):a())};n.__R=s;var l=n.__P;n.__P=null;var a=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=mn(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.o.pop();)t.__P=l,t.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(s,s)},yn.prototype.componentWillUnmount=function(){this.o=[]},yn.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=hn(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&qe(Ze,null,e.fallback);return r&&(r.__u&=-33),[qe(Ze,null,t.__a?null:e.children),r]};var bn=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function kn(e){return this.getChildContext=function(){return e.context},e.children}function wn(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){mt(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var o=t.__v;null!==o&&!o.__m&&null!==o.__;)o=o.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}mt(qe(kn,{context:t.context},e.__v),t.v)}(vn.prototype=new Je).__a=function(e){var t=this,n=gn(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),bn(t,e,o)):r()};n?n(i):i()}},vn.prototype.render=function(e){this.i=null,this.l=new Map;var t=ot(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},vn.prototype.componentDidUpdate=vn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){bn(e,n,t)})};var Sn="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Cn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,xn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,En=/[A-Z0-9]/g,Pn="undefined"!=typeof document,Fn=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};Je.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Je.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Rn=xe.event;xe.event=function(e){return Rn&&(e=Rn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var $n,An={configurable:!0,get:function(){return this.class}},In=xe.vnode;xe.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1==n.indexOf("-");for(var i in t){var s=t[i];if(!("value"===i&&"defaultValue"in t&&null==s||Pn&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var l=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===s?s="":"translate"===l&&"no"===s?s=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==n&&"textarea"!==n||Fn(t.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":xn.test(i)&&(i=l):l=i="oninput":r&&Cn.test(i)?i=i.replace(En,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===l&&o[i=l]&&(i="oninputCapture"),o[i]=s}}"select"==n&&(o.multiple&&Array.isArray(o.value)&&(o.value=ot(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),null!=o.defaultValue&&(o.value=ot(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",An)):t.className&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=Sn,In&&In(e)};var Nn=xe.__r;xe.__r=function(e){Nn&&Nn(e),$n=e.__c};var jn=xe.diffed;xe.diffed=function(e){jn&&jn(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),$n=null};var On={ReactCurrentDispatcher:{current:{readContext:function(e){return $n.__n[e.__c].props.value},useCallback:Bt,useContext:Dt,useDebugValue:zt,useDeferredValue:rn,useEffect:Mt,useId:qt,useImperativeHandle:Ht,useInsertionEffect:ln,useLayoutEffect:Lt,useMemo:Wt,useReducer:Tt,useRef:Ut,useState:Ot,useSyncExternalStore:tn,useTransition:sn}}};function Tn(e){return!!e&&e.$$typeof===Sn}var Mn={useState:Ot,useId:qt,useReducer:Tt,useEffect:Mt,useLayoutEffect:Lt,useInsertionEffect:ln,useTransition:sn,useDeferredValue:rn,useSyncExternalStore:tn,startTransition:on,useRef:Ut,useImperativeHandle:Ht,useMemo:Wt,useCallback:Bt,useContext:Dt,useDebugValue:zt,version:"18.3.1",Children:pn,render:function(e,t,n){return null==t.__k&&(t.textContent=""),mt(e,t),"function"==typeof n&&n(),e?e.__c:null},hydrate:function(e,t,n){return yt(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(mt(null,e),!0)},createPortal:function(e,t){var n=qe(wn,{__v:e,h:t});return n.containerInfo=t,n},createElement:qe,createContext:function(e){function t(e){var n,o;return this.getChildContext||(n=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,Ge(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Le++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createFactory:function(e){return qe.bind(null,e)},cloneElement:function(e){return Tn(e)?gt.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:Ze,isValidElement:Tn,isElement:Tn,isFragment:function(e){return Tn(e)&&e.type===Ze},isMemo:function(e){return!!e&&"string"==typeof e.displayName&&0==e.displayName.indexOf("Memo(")},findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:Je,PureComponent:an,memo:function(e,t){function n(e){var n=this.props.ref;return n!=e.ref&&n&&("function"==typeof n?n(null):n.current=null),t?!t(this.props,e)||n!=e.ref:en(this.props,e)}function o(t){return this.shouldComponentUpdate=n,qe(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.__f=o.prototype.isReactComponent=!0,o.type=e,o},forwardRef:function(e){function t(t){var n=Xt({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=cn,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},flushSync:function(e,t){var n=xe.debounceRendering;xe.debounceRendering=function(e){return e()};var o=e(t);return xe.debounceRendering=n,o},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:Ze,Suspense:yn,SuspenseList:vn,lazy:function(e){var t,n,o,r=null;function i(i){if(t||(t=e()).then(function(e){e&&(r=e.default||e),o=!0},function(e){n=e,o=!0}),n)throw n;if(!o)throw t;return r?qe(r,i):null}return i.displayName="Lazy",i.__f=!0,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:On};const Ln={none:void 0,fade:"pw-vpopup-fade 0.35s ease-out backwards",slide:"pw-vpopup-slide 0.35s ease-out backwards"};function Un({slot:e,align:t,inverse:n,colors:o}){const r={...u[e.variant],textAlign:e.align??t,padding:"4px 0"},i=_(e.variant,o,n);return i&&(r.color=i),Mn.createElement("div",{style:r,dangerouslySetInnerHTML:{__html:te(e.html)}})}function Hn({slot:e,accent:t,onRequestClose:n,onPageChange:o}){const r=d(e.variant,t),i={padding:p};if("close"===e.action.type)return Mn.createElement("div",{style:i},Mn.createElement("button",{type:"button",style:r,onClick:n},e.label));if("page"===e.action.type){const t=e.action.page;return Mn.createElement("div",{style:i},Mn.createElement("button",{type:"button",style:r,onClick:()=>o(t)},e.label))}const s=Y(e.action.url);return s?Mn.createElement("div",{style:i},Mn.createElement("a",{href:s,...G(e.action.target),style:r},e.label)):Mn.createElement("div",{style:i},Mn.createElement("button",{type:"button",style:r},e.label))}const Wn=/^\S+@\S+\.\S+$/,Bn={email:"email",phone:"tel"},Dn={email:"email",firstName:"given-name",lastName:"family-name",phone:"tel"},zn="__privacy";function qn({slot:e,align:t,inverse:n,colors:o,onSubmitForm:r}){const[i,s]=Ot({}),[l,a]=Ot(!1),[c,y]=Ot(null),[g,v]=Ot({}),[b,k]=Ot("idle"),w=_("caption",o,n),S={...u.caption,...w?{color:w}:{}},C={fontSize:12,lineHeight:1.4,color:h,paddingTop:2};if("success"===b||"confirm"===b){const r={...u.body,textAlign:t,padding:"4px 0"},i=_("body",o,n);return i&&(r.color=i),Mn.createElement("div",{style:{padding:f}},Mn.createElement("div",{style:r},"confirm"===b?e.confirmEmailMessage:e.successMessage))}const x="submitting"===b,E=e.privacy?Y(e.privacy.url):void 0,P={...d(e.submitVariant,o.accent),...x?{opacity:.6,cursor:"default"}:{}};return Mn.createElement("form",{noValidate:!0,style:{padding:f,margin:0,textAlign:"left"},onSubmit:t=>{t.preventDefault(),(()=>{if(!r||!e.formCode||"submitting"===b)return;const t={};for(const n of e.fields){const e=(i[n.key]??"").trim();n.required&&!e?t[n.key]="Required":"email"===n.kind&&e&&!Wn.test(e)&&(t[n.key]="Enter a valid email")}if(e.privacy&&!l&&(t[zn]="Please accept the privacy policy"),v(t),Object.keys(t).length>0)return;const n={email:"",policyAccepted:!e.privacy||l},o={};for(const t of e.fields){const e=(i[t.key]??"").trim();e&&("email"===t.kind?n.email=n.email||e:"firstName"===t.kind?n.firstName=e:"lastName"===t.kind?n.lastName=e:"phone"===t.kind?n.phone=e:o[t.tag||t.key]=e)}Object.keys(o).length>0&&(n.customFields=o),k("submitting"),Promise.resolve().then(()=>r(e.formCode,n)).then(e=>k("confirm-email"===e?"confirm":"success"),()=>k("error"))})()}},e.fields.map(e=>{const t=g[e.key];let n;return t?n=h:c===e.key&&(n=o.accent),Mn.createElement("div",{key:e.key,style:{padding:"4px 0"}},e.label&&Mn.createElement("div",{style:{...S,paddingBottom:4}},e.label),Mn.createElement("input",{type:Bn[e.kind]??"text",autoComplete:Dn[e.kind],placeholder:e.placeholder||void 0,value:i[e.key]??"",disabled:x,style:m(n),onFocus:()=>y(e.key),onBlur:()=>y(t=>t===e.key?null:t),onChange:t=>{return n=e.key,o=t.currentTarget.value,s(e=>({...e,[n]:o})),void v(e=>e[n]?Object.fromEntries(Object.entries(e).filter(([e])=>e!==n)):e);var n,o}}),t&&Mn.createElement("div",{style:C},t))}),e.privacy&&Mn.createElement("div",{style:{padding:"4px 0"}},Mn.createElement("label",{style:{...S,display:"flex",alignItems:"flex-start",gap:8,cursor:"pointer"}},Mn.createElement("input",{type:"checkbox",checked:l,disabled:x,style:{margin:"2px 0 0",flexShrink:0},onChange:e=>{a(e.currentTarget.checked),v(e=>e[zn]?Object.fromEntries(Object.entries(e).filter(([e])=>e!==zn)):e)}}),Mn.createElement("span",null,e.privacy.checkboxLabel,E&&Mn.createElement(Mn.Fragment,null," ",Mn.createElement("a",{href:E,...G(void 0),style:{color:o.accent}},e.privacy.linkLabel||e.privacy.url)))),g[zn]&&Mn.createElement("div",{style:C},g[zn])),Mn.createElement("div",{style:{padding:p}},Mn.createElement("button",{type:"submit",disabled:x,style:P},e.submitLabel)),"error"===b&&Mn.createElement("div",{style:{...C,textAlign:t}},"Something went wrong. Please try again."))}function Vn({node:e,page:t,colors:n,leaf:o,onRequestClose:r,onPageChange:i,onSubmitForm:s}){const l=t.contents.find(t=>t.key===e.props.content);if(!l)return null;if(o?.renderZone)return Mn.createElement("div",{style:{minWidth:0}},o.renderZone(l,e));const a=e.props.align??"left",u="inverse"===e.props.tone;return Mn.createElement("div",{style:{minWidth:0}},l.slots.map(e=>"text"===e.type?Mn.createElement(Un,{key:e.key,slot:e,align:a,inverse:u,colors:n}):"button"===e.type?Mn.createElement(Hn,{key:e.key,slot:e,accent:n.accent,onRequestClose:r,onPageChange:i}):Mn.createElement(qn,{key:e.key,slot:e,align:a,inverse:u,colors:n,onSubmitForm:s})))}function Zn({node:e,page:t,leaf:n}){const o=t.images.find(t=>t.key===e.props.image);if(!o)return null;if(n?.renderImage)return Mn.createElement(Mn.Fragment,null,n.renderImage(o,e));if(!o.src)return null;const r={display:"block",width:"100%",minWidth:0};return o.fit?(r.height="100%",r.objectFit=o.fit):r.height="auto",o.blur&&(r.filter=`blur(${o.blur}px)`),Mn.createElement("img",{src:o.src,alt:"",style:r})}function Jn({node:e,page:t,colors:n,leaf:o,onRequestClose:r,onPageChange:i,onSubmitForm:s}){if("Content"===e.type)return Mn.createElement(Vn,{node:e,page:t,colors:n,leaf:o,onRequestClose:r,onPageChange:i,onSubmitForm:s});if("Image"===e.type)return Mn.createElement(Zn,{node:e,page:t,leaf:o});const l=e.props?.backgroundImage,a=l?t.images.find(e=>e.key===l):void 0,u=a?.blur??0,c=a?.dim??0,_=Q(e,u>0?void 0:a?.src||void 0,c);l&&(_.backgroundColor="#1D2939");const p=e.children.map((e,l)=>Mn.createElement(Jn,{key:l,node:e,page:t,colors:n,leaf:o,onRequestClose:r,onPageChange:i,onSubmitForm:s}));if(u>0){const{backgroundColor:e,...t}=_;return Mn.createElement("div",{style:{display:"grid",minWidth:0,backgroundColor:e,...a?.src?K(a.src,c):{}}},Mn.createElement("div",{style:{...t,backdropFilter:`blur(${u}px)`,WebkitBackdropFilter:`blur(${u}px)`}},p))}return Mn.createElement("div",{style:_},p)}function Kn({page:e,params:t,leafRenderers:n,animatePage:o=!1,onRequestClose:r,onPageChange:i,onSubmitForm:s}){const l={position:"relative",boxSizing:"border-box",overflow:"hidden",backgroundColor:t.colors.background,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',color:t.colors.text,borderRadius:t.borderRadius>0?t.borderRadius:void 0,boxShadow:t.boxShadow&&"none"!==t.boxShadow?t.boxShadow:void 0,transition:"height 300ms ease"};e.height&&(l.height="stretch"===e.height?"100%":e.height,l.overflowY="auto");const a={...o?{animation:"pw-vpopup-page 300ms ease-out backwards"}:{},..."stretch"===e.height?{display:"grid",minHeight:"100%"}:{}};return Mn.createElement("div",{style:l},Mn.createElement("div",{key:e.key,style:a},Mn.createElement(Jn,{node:e.layout,page:e,colors:t.colors,leaf:n,onRequestClose:r,onPageChange:i??(()=>{}),onSubmitForm:s})))}function Qn({onRequestClose:e}){return Mn.createElement("button",{type:"button","aria-label":"Close",onClick:e,style:{position:"absolute",top:10,right:10,width:24,height:24,padding:0,border:"none",borderRadius:"50%",background:"rgba(255, 255, 255, 0.92)",boxShadow:"0 1px 3px rgba(16, 24, 40, 0.25)",color:"#667085",fontSize:13,lineHeight:1,cursor:"pointer"}},"✕")}function Yn(e,t,n){const{placement:o}=e,r={position:"fixed",boxSizing:"border-box",maxWidth:ve(o),maxHeight:ve(o),pointerEvents:"auto"};if(t){r.width=t;const e=o.h;"left"===e?r.left=o.offset:"right"===e?r.right=o.offset:r.left="50%"}else r.left=o.offset,r.right=o.offset;"stretch"===n?(r.top=o.offset,r.bottom=o.offset):"top"===o.v?r.top=o.offset:"bottom"===o.v?r.bottom=o.offset:r.top="50%";const i=t&&"center"===o.h?"-50%":"0",s="middle"===o.v&&"stretch"!==n?"-50%":"0";"0"===i&&"0"===s||(r.transform=`translate(${i}, ${s})`);const l=Ln[e.animation];return l&&(r.animation=l),r.transition="width 300ms ease",r}function Gn({params:e,mode:t="live",onRequestClose:n,onSubmitForm:o,leafRenderers:r}){const[i,s]=Ot(null);Mt(()=>{ge(e).forEach(e=>e.images.forEach(({src:e})=>{e&&((new Image).src=e)}))},[e]);const l=ge(e);if(0===l.length)return null;const a=l.find(e=>e.key===i)??function(e,t){return t.find(t=>t.key===e.startPage)??t[0]}(e,l),u=null!==i;if("preview"===t)return Mn.createElement("div",{style:{position:"relative",width:a.width??"100%",transition:"width 300ms ease"}},Mn.createElement("style",null,b),Mn.createElement(Kn,{page:a,params:e,leafRenderers:r,animatePage:u,onRequestClose:n,onPageChange:s,onSubmitForm:o}));const c=e.overlay;return Mn.createElement(Mn.Fragment,null,Mn.createElement("style",null,b),c&&Mn.createElement("div",{style:{position:"fixed",inset:0,backgroundColor:c.color,opacity:c.opacity,animation:"pw-vpopup-overlay 0.2s ease-out backwards",pointerEvents:"auto"},onClick:n}),Mn.createElement("div",{style:Yn(e,a.width,a.height)},Mn.createElement(Kn,{page:a,params:e,leafRenderers:r,animatePage:u,onRequestClose:n,onPageChange:s,onSubmitForm:o}),Mn.createElement(Qn,{onRequestClose:n})))}const Xn="keyValue",eo="messages",to="inboxMessages";function no(e,t){return function(n){n.objectStoreNames.contains(e)||t(n)}}const oo=[no(Xn,function(e){e.createObjectStore(Xn,{keyPath:"key"})}),no("log",function(e){const t=e.createObjectStore("log",{keyPath:"id",autoIncrement:!0});t.createIndex("environment","environment",{unique:!1}),t.createIndex("date","date",{unique:!1}),t.createIndex("type","type",{unique:!1})}),no(eo,function(e){e.createObjectStore(eo,{keyPath:"id",autoIncrement:!0}).createIndex("date","date",{unique:!1})}),no(to,function(e){const t="status",n=e.createObjectStore(to,{keyPath:"inbox_id",autoIncrement:!1});n.createIndex(t,t,{unique:!1,multiEntry:!0}),n.createIndex("rt","rt",{unique:!1,multiEntry:!0})})];class ro{get all(){return oo}}class io{constructor(e,t=new ro){this.db=e,this.migrationsBuilder=t}applyMigrations(){this.applyMigrationsPack(this.migrationsBuilder.all)}applyMigrationsPack(e){e.forEach(e=>{e(this.db)})}}function so(e,t){console.info("onversionchange",t),e.close()}let lo;function ao(e){return(lo||(lo=new Promise((e,t)=>{const n=indexedDB.open("PUSHWOOSH_SDK_STORE",7);n.onsuccess=n=>{const o=n.target.result;o.onversionchange=so.bind(null,o,t),e(o)},n.onerror=()=>t(n.error),n.onupgradeneeded=e=>{const n=e.target.result;n.onversionchange=so.bind(null,n,t),new io(n).applyMigrations()}})),lo).then(t=>new Promise((n,o)=>e(t,n,o)))}class uo{_add(e){return ao((t,n,o)=>{const r=t.transaction([this.name],"readwrite").objectStore(this.name).add(e);r.onsuccess=()=>{n(e)},r.onerror=()=>{o(r.error)}}).then(e=>this.getAll().then(t=>{if(Array.isArray(t)){const n=t.map(e=>e.id).sort((e,t)=>e==t?0:e<t?1:-1);if(n.length>this.maxItems)return Promise.all(n.slice(this.maxItems).map(e=>this.delete(e))).then(()=>e)}return e}))}delete(e){return ao((t,n,o)=>{const r=t.transaction([this.name],"readwrite").objectStore(this.name).delete(e);r.onsuccess=()=>{n(r.result)},r.onerror=()=>{o(r.error)}})}getAll(){return ao((e,t,n)=>{const o=[],r=e.transaction(this.name).objectStore(this.name).openCursor();r.onsuccess=e=>{const n=e.target.result;n?(n.value&&o.push(n.value),n.continue()):t(o)},r.onerror=()=>{n(r.error)}})}}co=Xn;var co;const _o=new class extends uo{constructor(){super(...arguments),this.name="log",this.maxItems=100,this.environment="undefined"!=typeof self&&self.registration?"worker":"browser"}add(e,t,n){const o={type:e,environment:this.environment,message:`${t}`,date:new Date};return t instanceof Error&&(o.stack=t.stack),n&&(o.additional=n),this._add(o)}},po=(new class extends uo{constructor(){super(...arguments),this.name=eo,this.maxItems=25}add(e){return this._add({...e,date:new Date})}},{error:1,info:2,debug:3});let fo=3;const ho={setLevel(e){po[e]||(e="error"),fo=po[e]},write(e,t,n){return"error"===e?this.error(t):this.info(t),_o.add(e,t,n)}};Object.keys(po).forEach(e=>{const t=po[e];ho[e]=(...n)=>{t<=fo&&(console.groupCollapsed(e),console.info("",...n),console.trace("trace"),console.groupEnd())}});const mo={SUBMIT_FORM_RESULT_SUBSCRIBED:"subscribed",SUBMIT_FORM_RESULT_CONFIRM_EMAIL:"confirm-email",SUBMIT_FORM_RESULT_ALREADY_SUBSCRIBED:"already-subscribed"},yo=(e,t)=>`https://subscription-form.svc-nue.pushwoosh.com/api/v1/forms/code/${encodeURIComponent(e)}${t}`,go=async(e,t)=>{try{const n=await fetch(yo(e,"/submit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,userId:t.email})});if(!n.ok)throw new Error(`Subscription form submit failed: HTTP ${n.status}`);const o=await n.json(),r=mo[o.result??""];if(!r)throw new Error(`Subscription form submit failed: unexpected result "${o.result}"`);return r}catch(t){throw ho.error(t,`Failed to submit subscription form "${e}"`),t}},vo=e=>{const t=function(e){let t;try{t=JSON.parse(e)}catch{return null}if("object"!=typeof t||null===t)return null;const n=t;if(2!==n.version)return null;const o=n.params;return"object"!=typeof o||null===o?null:Array.isArray(o.pages)&&0!==o.pages.length?{version:2,params:{...o,colors:oe(o)}}:null}(e);return t?0===ge(t.params).length?null:t.params:null};let bo=null;class ko{lockBodyScroll(){0===this.openPopupsCount&&(this.bodyOverflowBeforeLock=document.body.style.overflow,document.body.style.overflow="hidden"),this.openPopupsCount+=1}unlockBodyScroll(){this.openPopupsCount=Math.max(0,this.openPopupsCount-1),0===this.openPopupsCount&&null!==this.bodyOverflowBeforeLock&&(document.body.style.overflow=this.bodyOverflowBeforeLock,this.bodyOverflowBeforeLock=null)}constructor(e){this.isRecurringVisitor=!1,this.loadedPopups=new Map,this.pendingTimers=new Map,this.isNavigationSubscribed=!1,this.openPopupsCount=0,this.bodyOverflowBeforeLock=null,this.pw=e}async run(){const{pw:e}=this;await e.api.ensureDeviceRegistered(),this.isRecurringVisitor=await e.data.getIsRecurringVisitor();const t=await e.api.getPopupForms();ho.debug(`${ke} Received ${t.length} popup(s) from server:`,t.map(e=>e.code));(await Promise.allSettled(t.map(e=>this.loadWebPopup(e)))).forEach((e,n)=>{"rejected"===e.status&&ho.error(e.reason,`${ke} Failed to load web popup "${t[n].code}"`)}),ho.debug(`${ke} ${this.loadedPopups.size} popup(s) passed strong conditions and loaded:`,Array.from(this.loadedPopups.keys())),this.subscribeToNavigation(),this.renderForCurrentPage(),await e.data.setIsRecurringVisitor(!0)}async loadWebPopup(e){if(!await this.checkStrongCondition(e))return;if(e.subscription_form_code)return await(bo||(customElements.get(Se)?(bo=Promise.resolve(),bo):(bo=new Promise((e,t)=>{let n=0;const o=e=>{window.clearTimeout(n),bo=null,t(e)};n=window.setTimeout(()=>{o(new Error(`Subscription forms widget did not define <${Se}> within 10000ms`))},1e4);const r=document.createElement("script");r.type="module",r.src=we,r.onerror=()=>{o(new Error(`Failed to load subscription forms widget script: ${we}`))},document.head.appendChild(r),customElements.whenDefined(Se).then(()=>{window.clearTimeout(n),e()})}),bo))),void this.loadedPopups.set(e.code,{popup:e,kind:"subscription-form",formCode:e.subscription_form_code});if(!e.popup_form_content_code)return void ho.error(new Error("Web popup has no source"),`${ke} Web popup "${e.code}" has neither content nor subscription form; skipping`);const t=await this.pw.api.getPopupFormContent(e.popup_form_content_code),n=vo(t.json);n?this.loadedPopups.set(e.code,{popup:e,kind:"content",parsed:n}):ho.error(new Error("Unsupported popup content format"),`${ke} Web popup "${e.code}" content is not a supported {version, params} popup; skipping`)}renderForCurrentPage(){this.cancelPendingForUnmatchedPages();const e=[];this.loadedPopups.forEach((t,n)=>{this.checkSoftCondition(t.popup)&&e.push([n,t])}),ho.debug(`${ke} ${e.length} popup(s) selected for display on "${window.location.pathname}":`,e.map(([e])=>e)),e.forEach(([e,t])=>{this.addToQueue(t),this.loadedPopups.delete(e)})}cancelPendingForUnmatchedPages(){this.pendingTimers.forEach(({timeoutId:e,loaded:t},n)=>{this.checkSoftCondition(t.popup)||(window.clearTimeout(e),this.pendingTimers.delete(n),this.loadedPopups.set(n,t))})}subscribeToNavigation(){if(this.isNavigationSubscribed)return;this.isNavigationSubscribed=!0;const e=()=>this.renderForCurrentPage(),t=window.navigation;if(t&&"function"==typeof t.addEventListener)return void t.addEventListener("currententrychange",e);window.addEventListener("popstate",e),window.addEventListener("hashchange",e);let n=window.location.href;window.setInterval(()=>{window.location.href!==n&&(n=window.location.href,e())},500)}async checkStrongCondition(e){return(await Promise.all([this.checkCanBeShownByDeviceTypeCondition(e),this.checkCanBeShownByFrequencyCondition(e),this.checkCanBeShownByVisitorsTypeCondition(e)])).every(e=>e)}checkSoftCondition(e){return this.checkCanBeShownByMatchingPagesCondition(e)}checkCanBeShownByDeviceTypeCondition(e){const{device_type:t}=e,n=this.pw.platformChecker.formFactor;return"ALL"===t||t===n}async checkCanBeShownByFrequencyCondition(e){const{frequency:t,code:n}=e;if("ONCE"===t){return!(await this.pw.data.getShownWebPopups()).includes(n)}return"ONCE_PER_SESSION"!==t||null===sessionStorage.getItem(this.getSessionStorageKey(n))}checkCanBeShownByMatchingPagesCondition(e){const{matching_pages:t,matching_page_rules:n,excluded_pages:o}=e,r=window.location.pathname;return n&&n.length>0?n.some(e=>this.matchPageRule(r,e)):t&&t.length>0?t.includes(r):!(o&&o.length>0)||!o.some(e=>this.matchPageRule(r,e))}matchPageRule(e,t){switch(t.operator){case"EQUALS":return e===t.path;case"STARTS_WITH":return e.startsWith(t.path);default:return!1}}checkCanBeShownByVisitorsTypeCondition(e){const{visitors_type:t}=e;return"NEW"===t?!this.isRecurringVisitor:"RECURRING"!==t||this.isRecurringVisitor}async markAsShown(e){this.pw.api.recordPopupFormEvent(e.code,2).catch(t=>{ho.error(t,`${ke} Failed to record web popup shown event for "${e.code}"`)});const{frequency:t,code:n}=e;"ONCE"!==t?"ONCE_PER_SESSION"===t&&sessionStorage.setItem(this.getSessionStorageKey(n),"1"):await this.pw.data.addShownWebPopup(n)}getSessionStorageKey(e){return`${be}.shown.${e}`}addToQueue(e){const t=e.popup;ho.debug(`${ke} Popup "${t.code}" queued for display in ${t.delay}s`),this.pw.api.recordPopupFormEvent(t.code,1).catch(e=>{ho.error(e,`${ke} Failed to record web popup queued event for "${t.code}"`)});const n=window.setTimeout(()=>{this.pendingTimers.delete(t.code);const n=document.createElement("div");n.id=`${be}-${t.code}`,n.style.position="fixed",n.style.inset="0",n.style.zIndex=String(2147483647),n.style.pointerEvents="none",document.body.appendChild(n);const o=n.attachShadow({mode:"open"}),r=document.createElement("div");o.appendChild(r);const i="subscription-form"===e.kind||!!e.parsed.overlay;i&&this.lockBodyScroll();const s=()=>{i&&this.unlockBodyScroll(),n.remove(),this.pw.dispatchEvent("hide-web-popup",{code:t.code})};if("subscription-form"===e.kind)this.renderSubscriptionForm(r,e.formCode,s);else{((e,t,n)=>{mt(bt(Gn,{params:t,mode:"live",onRequestClose:n,onSubmitForm:go}),e)})(r,e.parsed,s);const n=function(e){const t=new Set;for(const n of e.pages)if(Array.isArray(n?.contents))for(const e of n.contents)if(Array.isArray(e?.slots))for(const n of e.slots)"object"==typeof n&&null!==n&&"email-subscription-form"===n.type&&"string"==typeof n.formCode&&n.formCode&&t.add(n.formCode);return[...t]}(e.parsed);n.length>0&&this.pw.data.getHwid().then(e=>n.forEach(t=>((e,t)=>{fetch(yo(e,"/view"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,userId:t,hwid:t})}).catch(t=>{ho.error(t,`Failed to record subscription form view for "${e}"`)})})(t,e))).catch(e=>{ho.error(e,`${ke} Failed to record subscription form views for web popup "${t.code}"`)})}ho.debug(`${ke} Popup "${t.code}" shown (kind: ${e.kind})`),this.markAsShown(t).catch(e=>{ho.error(e,`${ke} Failed to mark web popup "${t.code}" as shown`)}),this.pw.dispatchEvent("show-web-popup",{code:t.code})},1e3*t.delay);this.pendingTimers.set(t.code,{timeoutId:n,loaded:e})}renderSubscriptionForm(e,t,n){const o=document.createElement("div");o.style.position="absolute",o.style.inset="0",o.style.background="rgba(0, 0, 0, 0.5)",o.style.pointerEvents="auto",o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="center",o.style.padding="20px",o.style.boxSizing="border-box",o.addEventListener("click",e=>{e.target===o&&n()});const r=document.createElement(Se);r.formCode=t,r.setAttribute("hosted-mode",""),r.addEventListener("esw-close",n),o.appendChild(r),e.appendChild(o)}}return t})());
|
|
2
2
|
//# sourceMappingURL=widget-web-popups.js.map
|