web-push-notifications 3.62.0 → 3.62.2
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/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:()=>En});const n="pushwoosh-web-popups";var o,r,i,u,l,s,a,c,_,p,f,d,h,m,y,v={},g=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w=Array.isArray;function k(e,t){for(var n in t)e[n]=t[n];return e}function C(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function S(e,t,n){var r,i,u,l={};for(u in t)"key"==u?r=t[u]:"ref"==u?i=t[u]:l[u]=t[u];if(arguments.length>2&&(l.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(u in e.defaultProps)void 0===l[u]&&(l[u]=e.defaultProps[u]);return x(e,l,r,i,null)}function x(e,t,n,o,u){var l={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:u??++i,__i:-1,__u:0};return null==u&&null!=r.vnode&&r.vnode(l),l}function P(e){return e.children}function E(e,t){this.props=e,this.context=t}function F(e,t){if(null==t)return e.__?F(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?F(e):null}function R(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],i=[],u=k({},t);u.__v=t.__v+1,r.vnode&&r.vnode(u),B(e.__P,u,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??F(t),!!(32&t.__u),i),u.__v=t.__v,u.__.__k[u.__i]=u,L(o,u,i),t.__e=t.__=null,u.__e!=n&&N(u)}}function N(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}),N(e)}function I(e){(!e.__d&&(e.__d=!0)&&u.push(e)&&!O.__r++||l!=r.debounceRendering)&&((l=r.debounceRendering)||s)(O)}function O(){try{for(var e,t=1;u.length;)u.length>t&&u.sort(a),e=u.shift(),t=u.length,R(e)}finally{u.length=O.__r=0}}function T(e,t,n,o,r,i,u,l,s,a,c){var _,p,f,d,h,m,y,b=o&&o.__k||g,w=t.length;for(s=A(n,t,b,s,w),_=0;_<w;_++)null!=(f=n.__k[_])&&(p=-1!=f.__i&&b[f.__i]||v,f.__i=_,m=B(e,f,p,r,i,u,l,s,a,c),d=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&V(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?(s=H(f,s,e,y),y&&p.__e&&(p.__e=null)):"function"==typeof f.type&&void 0!==m?s=m:d&&(s=d.nextSibling),f.__u&=-7);return n.__e=h,s}function A(e,t,n,o,r){var i,u,l,s,a,c=n.length,_=c,p=0;for(e.__k=new Array(r),i=0;i<r;i++)null!=(u=t[i])&&"boolean"!=typeof u&&"function"!=typeof u?("string"==typeof u||"number"==typeof u||"bigint"==typeof u||u.constructor==String?u=e.__k[i]=x(null,u,null,null,null):w(u)?u=e.__k[i]=x(P,{children:u},null,null,null):void 0===u.constructor&&u.__b>0?u=e.__k[i]=x(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):e.__k[i]=u,s=i+p,u.__=e,u.__b=e.__b+1,l=null,-1!=(a=u.__i=W(u,n,s,_))&&(_--,(l=n[a])&&(l.__u|=2)),null==l||null==l.__v?(-1==a&&(r>c?p--:r<c&&p++),"function"!=typeof u.type&&(u.__u|=4)):a!=s&&(a==s-1?p--:a==s+1?p++:(a>s?p--:p++,u.__u|=4))):e.__k[i]=null;if(_)for(i=0;i<c;i++)null!=(l=n[i])&&!(2&l.__u)&&(l.__e==o&&(o=F(l)),K(l,l));return o}function H(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=H(r[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=F(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||(w(e)?e.some(function(e){M(e,t)}):t.push(e)),t}function W(e,t,n,o){var r,i,u,l=e.key,s=e.type,a=t[n],c=null!=a&&!(2&a.__u);if(null===a&&null==l||c&&l==a.key&&s==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[u=r>=0?r--:i++])&&!(2&a.__u)&&l==a.key&&s==a.type)return u;return-1}function U(e,t,n){"-"==t[0]?e.setProperty(t,n??""):e[t]=null==n?"":"number"!=typeof n||b.test(t)?n:n+"px"}function $(e,t,n,o,r){var i,u;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(f,"$1")),u=t.toLowerCase(),t=u in e||"onFocusOut"==t||"onFocusIn"==t?u.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[p]=o[p]:(n[p]=d,e.addEventListener(t,i?m:h,i)):e.removeEventListener(t,i?m:h,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 j(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[_])t[_]=d++;else if(t[_]<n[p])return;return n(r.event?r.event(t):t)}}}function B(e,t,n,o,i,u,l,s,a,c){var _,p,f,d,h,m,y,v,b,S,x,F,R,N,I,O,A=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(a=!!(32&n.__u),u=[s=t.__e=n.__e]),(_=r.__b)&&_(t);e:if("function"==typeof A){p=l.length;try{if(b=t.props,S=A.prototype&&A.prototype.render,x=(_=A.contextType)&&o[_.__c],F=_?x?x.props.value:_.__:o,n.__c?v=(f=t.__c=n.__c).__=f.__E:(S?t.__c=f=new A(b,F):(t.__c=f=new E(b,F),f.constructor=A,f.render=G),x&&x.sub(f),f.state||(f.state={}),f.__n=o,d=f.__d=!0,f.__h=[],f._sb=[]),S&&null==f.__s&&(f.__s=f.state),S&&null!=A.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=k({},f.__s)),k(f.__s,A.getDerivedStateFromProps(b,f.__s))),h=f.props,m=f.state,f.__v=t,d)S&&null==A.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),S&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(S&&null==A.getDerivedStateFromProps&&b!==h&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(b,F),t.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(b,f.__s,F)){t.__v!=n.__v&&(f.props=b,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&l.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(b,f.__s,F),S&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(h,m,y)})}if(f.context=F,f.props=b,f.__P=e,f.__e=!1,R=r.__r,N=0,S)f.state=f.__s,f.__d=!1,R&&R(t),_=f.render(f.props,f.state,f.context),g.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,R&&R(t),_=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++N<25);f.state=f.__s,null!=f.getChildContext&&(o=k(k({},o),f.getChildContext())),S&&!d&&null!=f.getSnapshotBeforeUpdate&&(y=f.getSnapshotBeforeUpdate(h,m)),I=null!=_&&_.type===P&&null==_.key?q(_.props.children):_,s=T(e,w(I)?I:[I],t,n,o,i,u,l,s,a,c),f.base=t.__e,t.__u&=-161,f.__h.length&&l.push(f),v&&(f.__E=f.__=null)}catch(e){if(l.length=p,t.__v=null,a||null!=u){if(e.then){for(t.__u|=a?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;null!=u&&(u[u.indexOf(s)]=null),t.__e=s}else if(null!=u)for(O=u.length;O--;)C(u[O])}else t.__e=n.__e;null==t.__k&&(t.__k=n.__k||[]),e.then||D(t),r.__e(e,t,n)}}else null==u&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=z(n.__e,t,n,o,i,u,l,a,c);return(_=r.diffed)&&_(t),128&t.__u?void 0:s}function D(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(D))}function L(e,t,n){for(var o=0;o<n.length;o++)V(n[o],n[++o],n[++o]);r.__c&&r.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){r.__e(e,t.__v)}})}function q(e){return"object"!=typeof e||null==e||e.__b>0?e:w(e)?e.map(q):void 0!==e.constructor?null:k({},e)}function z(e,t,n,i,u,l,s,a,c){var _,p,f,d,h,m,y,g=n.props||v,b=t.props,k=t.type;if("svg"==k?u="http://www.w3.org/2000/svg":"math"==k?u="http://www.w3.org/1998/Math/MathML":u||(u="http://www.w3.org/1999/xhtml"),null!=l)for(_=0;_<l.length;_++)if((h=l[_])&&"setAttribute"in h==!!k&&(k?h.localName==k:3==h.nodeType)){e=h,l[_]=null;break}if(null==e){if(null==k)return document.createTextNode(b);e=document.createElementNS(u,k,b.is&&b),a&&(r.__m&&r.__m(t,l),a=!1),l=null}if(null==k)g===b||a&&e.data==b||(e.data=b);else{if(l="textarea"==k&&null!=b.defaultValue?null:l&&o.call(e.childNodes),!a&&null!=l)for(g={},_=0;_<e.attributes.length;_++)g[(h=e.attributes[_]).name]=h.value;for(_ in g)h=g[_],"dangerouslySetInnerHTML"==_?f=h:"children"==_||_ in b||"value"==_&&"defaultValue"in b||"checked"==_&&"defaultChecked"in b||$(e,_,null,h,u);for(_ in b)h=b[_],"children"==_?d=h:"dangerouslySetInnerHTML"==_?p=h:"value"==_?m=h:"checked"==_?y=h:a&&"function"!=typeof h||g[_]===h||$(e,_,h,g[_],u);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,w(d)?d:[d],t,n,i,"foreignObject"==k?"http://www.w3.org/1999/xhtml":u,l,s,l?l[0]:n.__k&&F(n,0),a,c),null!=l)for(_=l.length;_--;)C(l[_]);a&&"textarea"!=k||(_="value","progress"==k&&null==m?e.removeAttribute("value"):null!=m&&(m!==e[_]||"progress"==k&&!m||"option"==k&&m!=g[_])&&$(e,_,m,g[_],u),_="checked",null!=y&&y!=e[_]&&$(e,_,y,g[_],u))}return e}function V(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){r.__e(e,n)}}function K(e,t,n){var o,i;if(r.unmount&&r.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||V(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){r.__e(e,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&K(o[i],t,n||"function"!=typeof e.type);n||C(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 i,u,l,s;t==document&&(t=document.documentElement),r.__&&r.__(e,t),u=(i="function"==typeof n)?null:n&&n.__k||t.__k,l=[],s=[],B(t,e=(!i&&n||t).__k=S(P,null,[e]),u||v,v,t.namespaceURI,!i&&n?[n]:u?null:t.firstChild?o.call(t.childNodes):null,l,!i&&n?n:u?u.__e:t.firstChild,i,s),L(l,e,s),e.props.children=null}function Q(e,t){J(e,t,Q)}function Y(e,t,n){var r,i,u,l,s=k({},e.props);for(u in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)"key"==u?r=t[u]:"ref"==u?i=t[u]:s[u]=void 0===t[u]&&null!=l?l[u]:t[u];return arguments.length>2&&(s.children=arguments.length>3?o.call(arguments,2):n),x(e.type,s,r||e.key,i||e.ref,null)}o=g.slice,r={__e:function(e,t,n,o){for(var r,i,u;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),u=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),u=r.__d),u)return r.__E=r}catch(t){e=t}throw e}},i=0,E.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=k({},this.state),"function"==typeof e&&(e=e(k({},n),this.props)),e&&k(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),I(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),I(this))},E.prototype.render=P,u=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,a=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,c=Math.random().toString(8),_="__d"+c,p="__a"+c,f=/(PointerCapture)$|Capture$/i,d=0,h=j(!1),m=j(!0),y=0;var Z=0;Array.isArray;function X(e,t,n,o,i,u){t||(t={});var l,s,a=t;if("ref"in a)for(s in a={},t)"ref"==s?l=t[s]:a[s]=t[s];var c={type:e,props:a,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Z,__i:-1,__u:0,__source:i,__self:u};if("function"==typeof e&&(l=e.defaultProps))for(s in l)void 0===a[s]&&(a[s]=l[s]);return r.vnode&&r.vnode(c),c}const ee=/^(https?:|mailto:|tel:)/i,te="#101828",ne="#667085",oe={h1:{fontSize:24,fontWeight:600,lineHeight:1.25,color:te},h2:{fontSize:18,fontWeight:600,lineHeight:1.3,color:te},h3:{fontSize:16,fontWeight:600,lineHeight:1.35,color:te},body:{fontSize:14,fontWeight:"normal",lineHeight:1.5,color:te},caption:{fontSize:12,fontWeight:"normal",lineHeight:1.4,color:ne},eyebrow:{fontSize:11,fontWeight:600,letterSpacing:"0.08em",lineHeight:1.4,color:ne},icon:{fontSize:24,lineHeight:1.2}},re={h1:"#FFFFFF",h2:"#FFFFFF",h3:"#FFFFFF",icon:"#FFFFFF",eyebrow:"rgba(255, 255, 255, 0.8)",body:"rgba(255, 255, 255, 0.9)",caption:"rgba(255, 255, 255, 0.75)"},ie=["Vertical","Horizontal","Columns","Rows"],ue=["start","center","end","stretch"],le=["start","center","end","space-between"],se=["left","center","right"],ae=["default","inverse"],ce=2e3,_e={px:ce,"%":100,em:125,rem:125},pe=/^(\d{1,4}(?:\.\d+)?)(px|%|em|rem)$/,fe={px:ce,"%":100,fr:100},de=/^(\d{1,4}(?:\.\d+)?)(px|%|fr)$/,he=["auto","min-content","max-content"];function me(e,t){return t.includes(e)?e:void 0}function ye(e){if("number"==typeof e&&Number.isFinite(e))return Math.min(Math.max(e,0),ce);if("string"!=typeof e)return;const t=pe.exec(e.trim());if(!t)return;const[,n,o]=t;return`${Math.min(parseFloat(n),_e[o])}${o}`}const ve=["top","right","bottom","left"];function ge(e){if(he.includes(e))return e;const t=de.exec(e);if(!t)return;const[,n,o]=t;return`${Math.min(parseFloat(n),fe[o])}${o}`}function be(e){return"string"==typeof e&&e.length>0?e:void 0}function we(e){const t={},n=ye(e.gap);void 0!==n&&(t.gap=n);const o=function(e){const t=ye(e);if(void 0!==t)return t;if("object"!=typeof e||null===e)return;const n={};for(const t of ve){const o=ye(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=me(e.alignItems,ue);r&&(t.alignItems=r);const i=me(e.justifyContent,le);i&&(t.justifyContent=i);const u=be(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(ge);return n.every(e=>void 0!==e)?n.join(" "):void 0}(e.sizes);return void 0!==l&&(t.sizes=l),t}function ke(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=be(r.content);if(!e)return null;const t={type:"Content",props:{content:e}},n=me(r.align,se);n&&(t.props.align=n);const o=me(r.tone,ae);return o&&"default"!==o&&(t.props.tone=o),t}if("Image"===o.type){const e=be(r.image);if(!e)return null;return{type:"Image",props:{image:e}}}if(!Array.isArray(o.children))return null;const i=me(o.type,ie)??"Vertical",u=[];for(const e of o.children){const o=ke(e,t+1,n);o&&u.push(o)}return{type:i,props:we(r),children:u}}function Ce(e){return ke(e,0,{nodes:100})}function Se(e){return"number"==typeof e?`${e}px`:e}function xe(e,t){if("string"==typeof e)return e;return`repeat(${"number"==typeof e?e:Math.max(t,1)}, 1fr)`}function Pe(e){return{backgroundImage:`url(${JSON.stringify(e)})`,backgroundSize:"cover",backgroundPosition:"center"}}function Ee(e,t){const n=e.props??{},o={display:"grid",minWidth:0};return"Horizontal"===e.type&&(o.gridAutoFlow="column"),"Columns"===e.type&&(o.gridTemplateColumns=xe(n.sizes,e.children.length)),"Rows"===e.type&&(o.gridTemplateRows=xe(n.sizes,e.children.length)),void 0!==n.gap&&(o.gap=Se(n.gap)),void 0!==n.padding&&(o.padding=function(e){if("number"==typeof e||"string"==typeof e)return Se(e);const t=e=>void 0===e?"0":Se(e);return`${t(e.top)} ${t(e.right)} ${t(e.bottom)} ${t(e.left)}`}(n.padding)),n.alignItems&&(o.alignItems=n.alignItems),n.justifyContent&&(o.justifyContent=n.justifyContent),t&&Object.assign(o,Pe(t)),o}function Fe(e){const t=(e||"").trim();if(t)return t.startsWith("#")||t.startsWith("/")||t.startsWith("?")||ee.test(t)?t:void 0}const Re=new Set(["STRONG","B","EM","I","U","BR","A"]);function Ne(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(!Re.has(e.tagName)){Ne(e,t,n);continue}const r=n.createElement(e.tagName.toLowerCase());if("A"===e.tagName){const t=Fe(e.getAttribute("href")??void 0);t&&r.setAttribute("href",t),r.setAttribute("target","_blank"),r.setAttribute("rel","noreferrer")}t.appendChild(r),Ne(e,r,n)}}function Ie(e){if(!e.includes("<"))return e;const t=(new DOMParser).parseFromString(e,"text/html"),n=t.createElement("div");return Ne(t.body,n,t),n.innerHTML}const Oe=["cover","contain"];function Te(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,...Oe.includes(n.fit)?{fit:n.fit}:{},..."number"==typeof n.blur&&Number.isFinite(n.blur)&&n.blur>0?{blur:Math.min(n.blur,100)}:{}}))}return t}function Ae(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 He(e){const t=[];for(const n of e.pages){const e=Ce(n.layout);e&&t.push({key:n.key,layout:e,images:Te(n.images),contents:Ae(n.contents)})}return t}function Me(e){return`calc(100% - ${2*e.offset}px)`}var We,Ue,$e,je,Be=0,De=[],Le=r,qe=Le.__b,ze=Le.__r,Ve=Le.diffed,Ke=Le.__c,Ge=Le.unmount,Je=Le.__;function Qe(e,t){Le.__h&&Le.__h(Ue,e,Be||t),Be=0;var n=Ue.__H||(Ue.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Ye(e){return Be=1,Ze(dt,e)}function Ze(e,t,n){var o=Qe(We++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):dt(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=Ue,!Ue.__f)){var r=function(e,t,n){if(!o.__c.__H)return!0;var r=!1,u=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]&&(u=!0)}}),i){var l=i.call(this,e,t,n);return r?l||u:l}return!r||u};Ue.__f=!0;var i=Ue.shouldComponentUpdate,u=Ue.componentWillUpdate;Ue.componentWillUpdate=function(e,t,n){if(this.__e){var o=i;i=void 0,r(e,t,n),i=o}u&&u.call(this,e,t,n)},Ue.shouldComponentUpdate=r}return o.__N||o.__}function Xe(e,t){var n=Qe(We++,3);!Le.__s&&ft(n.__H,t)&&(n.__=e,n.u=t,Ue.__H.__h.push(n))}function et(e,t){var n=Qe(We++,4);!Le.__s&&ft(n.__H,t)&&(n.__=e,n.u=t,Ue.__h.push(n))}function tt(e){return Be=5,ot(function(){return{current:e}},[])}function nt(e,t,n){Be=6,et(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 ot(e,t){var n=Qe(We++,7);return ft(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function rt(e,t){return Be=8,ot(function(){return e},t)}function it(e){var t=Ue.context[e.__c],n=Qe(We++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Ue)),t.props.value):e.__}function ut(e,t){Le.useDebugValue&&Le.useDebugValue(t?t(e):e)}function lt(){var e=Qe(We++,11);if(!e.__){for(var t=Ue.__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 st(){for(var e;e=De.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(_t),t.__h.some(pt),t.__h=[]}catch(n){t.__h=[],Le.__e(n,e.__v)}}}Le.__b=function(e){Ue=null,qe&&qe(e)},Le.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Je&&Je(e,t)},Le.__r=function(e){ze&&ze(e),We=0;var t=(Ue=e.__c).__H;t&&($e===Ue?(t.__h=[],Ue.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(_t),t.__h.some(pt),t.__h=[],We=0)),$e=Ue},Le.diffed=function(e){Ve&&Ve(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==De.push(t)&&je===Le.requestAnimationFrame||((je=Le.requestAnimationFrame)||ct)(st)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),$e=Ue=null},Le.__c=function(e,t){t.some(function(e){try{e.__h.some(_t),e.__h=e.__h.filter(function(e){return!e.__||pt(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],Le.__e(n,e.__v)}}),Ke&&Ke(e,t)},Le.unmount=function(e){Ge&&Ge(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{_t(e)}catch(e){t=e}}),n.__H=void 0,t&&Le.__e(t,n.__v))};var at="function"==typeof requestAnimationFrame;function ct(e){var t,n=function(){clearTimeout(o),at&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);at&&(t=requestAnimationFrame(n))}function _t(e){var t=Ue,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Ue=t}function pt(e){var t=Ue;e.__c=e.__(),Ue=t}function ft(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function dt(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 mt(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 yt(e,t){var n=t(),o=Ye({t:{__:n,u:t}}),r=o[0].t,i=o[1];return et(function(){r.__=n,r.u=t,vt(r)&&i({t:r})},[e,n,t]),Xe(function(){return vt(r)&&i({t:r}),e(function(){vt(r)&&i({t:r})})},[e]),n}function vt(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 gt(e){e()}function bt(e){return e}function wt(){return[!1,gt]}var kt=et;function Ct(e,t){this.props=e,this.context=t}(Ct.prototype=new E).isPureReactComponent=!0,Ct.prototype.shouldComponentUpdate=function(e,t){return mt(this.props,e)||mt(this.state,t)};var St=r.__b;r.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),St&&St(e)};var xt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Pt=function(e,t){return null==e?null:M(M(e).map(t))},Et={map:Pt,forEach:Pt,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},Ft=r.__e;r.__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);Ft(e,t,n,o)};var Rt=r.unmount;function Nt(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 Nt(e,t,n)})),e}function It(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return It(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 Ot(){this.__u=0,this.o=null,this.__b=null}function Tt(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function At(){this.i=null,this.l=null}r.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Rt&&Rt(e)},(Ot.prototype=new E).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=Tt(o.__v),i=!1,u=function(){i||o.__z||(i=!0,n.__R=null,r?r(s):s())};n.__R=u;var l=n.__P;n.__P=null;var s=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=It(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(u,u)},Ot.prototype.componentWillUnmount=function(){this.o=[]},Ot.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]=Nt(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&S(P,null,e.fallback);return r&&(r.__u&=-33),[S(P,null,t.__a?null:e.children),r]};var Ht=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 Mt(e){return this.getChildContext=function(){return e.context},e.children}function Wt(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(S(Mt,{context:t.context},e.__v),t.v)}(At.prototype=new E).__a=function(e){var t=this,n=Tt(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),Ht(t,e,o)):r()};n?n(i):i()}},At.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},At.prototype.componentDidUpdate=At.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Ht(e,n,t)})};var Ut="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,$t=/^(?: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]/,jt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Bt=/[A-Z0-9]/g,Dt="undefined"!=typeof document,Lt=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};E.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(E.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var qt=r.event;r.event=function(e){return qt&&(e=qt(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var zt,Vt={configurable:!0,get:function(){return this.class}},Kt=r.vnode;r.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 u=t[i];if(!("value"===i&&"defaultValue"in t&&null==u||Dt&&"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===u?u="":"translate"===l&&"no"===u?u=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==n&&"textarea"!==n||Lt(t.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":jt.test(i)&&(i=l):l=i="oninput":r&&$t.test(i)?i=i.replace(Bt,"-$&").toLowerCase():null===u&&(u=void 0),"oninput"===l&&o[i=l]&&(i="oninputCapture"),o[i]=u}}"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",Vt)):t.className&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=Ut,Kt&&Kt(e)};var Gt=r.__r;r.__r=function(e){Gt&&Gt(e),zt=e.__c};var Jt=r.diffed;r.diffed=function(e){Jt&&Jt(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),zt=null};var Qt={ReactCurrentDispatcher:{current:{readContext:function(e){return zt.__n[e.__c].props.value},useCallback:rt,useContext:it,useDebugValue:ut,useDeferredValue:bt,useEffect:Xe,useId:lt,useImperativeHandle:nt,useInsertionEffect:kt,useLayoutEffect:et,useMemo:ot,useReducer:Ze,useRef:tt,useState:Ye,useSyncExternalStore:yt,useTransition:wt}}};function Yt(e){return!!e&&e.$$typeof===Ut}var Zt={useState:Ye,useId:lt,useReducer:Ze,useEffect:Xe,useLayoutEffect:et,useInsertionEffect:kt,useTransition:wt,useDeferredValue:bt,useSyncExternalStore:yt,startTransition:gt,useRef:tt,useImperativeHandle:nt,useMemo:ot,useCallback:rt,useContext:it,useDebugValue:ut,version:"18.3.1",Children:Et,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 Q(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=S(Wt,{__v:e,h:t});return n.containerInfo=t,n},createElement:S,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,I(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"+y++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createFactory:function(e){return S.bind(null,e)},cloneElement:function(e){return Yt(e)?Y.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:P,isValidElement:Yt,isElement:Yt,isFragment:function(e){return Yt(e)&&e.type===P},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:E,PureComponent:Ct,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:mt(this.props,e)}function o(t){return this.shouldComponentUpdate=n,S(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=xt,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},flushSync:function(e,t){var n=r.debounceRendering;r.debounceRendering=function(e){return e()};var o=e(t);return r.debounceRendering=n,o},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:P,Suspense:Ot,SuspenseList:At,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?S(r,i):null}return i.displayName="Lazy",i.__f=!0,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Qt};const Xt={none:void 0,fade:"pw-vpopup-fade 0.35s ease-out backwards",slide:"pw-vpopup-slide 0.35s ease-out backwards"};function en({slot:e,align:t,inverse:n}){const o={...oe[e.variant],textAlign:e.align??t,padding:"4px 0"};return n&&(o.color=re[e.variant]??"#FFFFFF"),Zt.createElement("div",{style:o,dangerouslySetInnerHTML:{__html:Ie(e.html)}})}function tn({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 Zt.createElement("div",{style:i},Zt.createElement("button",{type:"button",style:r,onClick:n},e.label));if("page"===e.action.type){const t=e.action.page;return Zt.createElement("div",{style:i},Zt.createElement("button",{type:"button",style:r,onClick:()=>o(t)},e.label))}const u=Fe(e.action.url);return u?Zt.createElement("div",{style:i},Zt.createElement("a",{href:u,target:"_blank",rel:"noreferrer",style:r},e.label)):Zt.createElement("div",{style:i},Zt.createElement("button",{type:"button",style:r},e.label))}function nn({node:e,page:t,accent:n,onRequestClose:o,onPageChange:r}){const i=t.contents.find(t=>t.key===e.props.content);if(!i)return null;const u=e.props.align??"left",l="inverse"===e.props.tone;return Zt.createElement("div",{style:{minWidth:0}},i.slots.map(e=>"text"===e.type?Zt.createElement(en,{key:e.key,slot:e,align:u,inverse:l}):Zt.createElement(tn,{key:e.key,slot:e,accent:n,onRequestClose:o,onPageChange:r})))}function on({node:e,page:t}){const n=t.images.find(t=>t.key===e.props.image);if(!n?.src)return null;const o={display:"block",width:"100%",minWidth:0};return n.fit?(o.height="100%",o.objectFit=n.fit):o.height="auto",n.blur&&(o.filter=`blur(${n.blur}px)`),Zt.createElement("img",{src:n.src,alt:"",style:o})}function rn({node:e,page:t,accent:n,onRequestClose:o,onPageChange:r}){if("Content"===e.type)return Zt.createElement(nn,{node:e,page:t,accent:n,onRequestClose:o,onPageChange:r});if("Image"===e.type)return Zt.createElement(on,{node:e,page:t});const i=e.props?.backgroundImage,u=i?t.images.find(e=>e.key===i):void 0,l=u?.blur??0,s=Ee(e,l>0?void 0:u?.src||void 0);i&&(s.backgroundColor="#1D2939");const a=e.children.map((e,i)=>Zt.createElement(rn,{key:i,node:e,page:t,accent:n,onRequestClose:o,onPageChange:r}));if(l>0){const{backgroundColor:e,...t}=s;return Zt.createElement("div",{style:{minWidth:0,backgroundColor:e,...u?.src?Pe(u.src):{}}},Zt.createElement("div",{style:{...t,backdropFilter:`blur(${l}px)`,WebkitBackdropFilter:`blur(${l}px)`}},a))}return Zt.createElement("div",{style:s},a)}function un({page:e,params:t,onRequestClose:n,onPageChange:o}){const r={position:"relative",boxSizing:"border-box",overflow:"hidden",backgroundColor:t.background,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',color:te,borderRadius:t.borderRadius>0?t.borderRadius:void 0,boxShadow:t.boxShadow&&"none"!==t.boxShadow?t.boxShadow:void 0};return t.height&&(r.height=t.height,r.overflowY="auto"),Zt.createElement("div",{style:r},Zt.createElement(rn,{node:e.layout,page:e,accent:t.accent,onRequestClose:n,onPageChange:o}))}function ln({onRequestClose:e}){return Zt.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 sn(e){const{placement:t}=e,n={position:"fixed",boxSizing:"border-box",maxWidth:Me(t),maxHeight:Me(t),pointerEvents:"auto"};if(e.width){n.width=e.width;const o=t.h;"left"===o?n.left=t.offset:"right"===o?n.right=t.offset:n.left="50%"}else n.left=t.offset,n.right=t.offset;"top"===t.v?n.top=t.offset:"bottom"===t.v?n.bottom=t.offset:n.top="50%";const o=e.width&&"center"===t.h?"-50%":"0",r="middle"===t.v?"-50%":"0";"0"===o&&"0"===r||(n.transform=`translate(${o}, ${r})`);const i=Xt[e.animation];return i&&(n.animation=i),n}function an({params:e,mode:t="live",onRequestClose:n}){const[o,r]=Ye(null),i=He(e);if(0===i.length)return null;const u=i.find(e=>e.key===o)??function(e,t){return t.find(t=>t.key===e.startPage)??t[0]}(e,i);if("preview"===t)return Zt.createElement("div",{style:{position:"relative",width:e.width??"100%"}},Zt.createElement(un,{page:u,params:e,onRequestClose:n,onPageChange:r}));const l=e.overlay;return Zt.createElement(Zt.Fragment,null,Zt.createElement("style",null,"\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"),l&&Zt.createElement("div",{style:{position:"fixed",inset:0,backgroundColor:l.color,opacity:l.opacity,animation:"pw-vpopup-overlay 0.2s ease-out backwards",pointerEvents:"auto"},onClick:n}),Zt.createElement("div",{style:sn(e)},Zt.createElement(un,{page:u,params:e,onRequestClose:n,onPageChange:r}),Zt.createElement(ln,{onRequestClose:n})))}const cn=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}:null}(e);return t?0===He(t.params).length?null:t.params:null},_n="keyValue",pn="messages",fn="inboxMessages";function dn(e,t){return function(n){n.objectStoreNames.contains(e)||t(n)}}const hn=[dn(_n,function(e){e.createObjectStore(_n,{keyPath:"key"})}),dn("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})}),dn(pn,function(e){e.createObjectStore(pn,{keyPath:"id",autoIncrement:!0}).createIndex("date","date",{unique:!1})}),dn(fn,function(e){const t="status",n=e.createObjectStore(fn,{keyPath:"inbox_id",autoIncrement:!1});n.createIndex(t,t,{unique:!1,multiEntry:!0}),n.createIndex("rt","rt",{unique:!1,multiEntry:!0})})];class mn{get all(){return hn}}class yn{constructor(e,t=new mn){this.db=e,this.migrationsBuilder=t}applyMigrations(){this.applyMigrationsPack(this.migrationsBuilder.all)}applyMigrationsPack(e){e.forEach(e=>{e(this.db)})}}function vn(e,t){console.info("onversionchange",t),e.close()}let gn;function bn(e){return(gn||(gn=new Promise((e,t)=>{const n=indexedDB.open("PUSHWOOSH_SDK_STORE",7);n.onsuccess=n=>{const o=n.target.result;o.onversionchange=vn.bind(null,o,t),e(o)},n.onerror=()=>t(n.error),n.onupgradeneeded=e=>{const n=e.target.result;n.onversionchange=vn.bind(null,n,t),new yn(n).applyMigrations()}})),gn).then(t=>new Promise((n,o)=>e(t,n,o)))}class wn{_add(e){return bn((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 bn((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 bn((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)}})}}kn=_n;var kn;const Cn=new class extends wn{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)}},Sn=(new class extends wn{constructor(){super(...arguments),this.name=pn,this.maxItems=25}add(e){return this._add({...e,date:new Date})}},{error:1,info:2,debug:3});let xn=3;const Pn={setLevel(e){Sn[e]||(e="error"),xn=Sn[e]},write(e,t,n){return"error"===e?this.error(t):this.info(t),Cn.add(e,t,n)}};Object.keys(Sn).forEach(e=>{const t=Sn[e];Pn[e]=(...n)=>{t<=xn&&(console.groupCollapsed(e),console.info("",...n),console.trace("trace"),console.groupEnd())}});class En{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&&Pn.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;const t=await this.pw.api.getPopupFormContent(e.popup_form_content_code),n=cn(t.json);n?this.loadedPopups.set(e.code,{popup:e,parsed:n}):Pn.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,{popup:t,parsed:n}])=>{this.addToQueue(t,n),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}=e;return!t||(0===t.length||t.includes(window.location.pathname))}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=>{Pn.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,t){this.pw.api.recordPopupFormEvent(e.code,1).catch(t=>{Pn.error(t,`Failed to record web popup queued event for "${e.code}"`)});const o=window.setTimeout(()=>{this.pendingTimers.delete(e.code);const o=document.createElement("div");o.id=`${n}-${e.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 u=!!t.overlay;u&&this.lockBodyScroll();((e,t,n)=>{J(X(an,{params:t,mode:"live",onRequestClose:n}),e)})(i,t,()=>{u&&this.unlockBodyScroll(),o.remove(),this.pw.dispatchEvent("hide-web-popup",{code:e.code})}),this.markAsShown(e).catch(t=>{Pn.error(t,`Failed to mark web popup "${e.code}" as shown`)}),this.pw.dispatchEvent("show-web-popup",{code:e.code})},1e3*e.delay);this.pendingTimers.set(e.code,{timeoutId:o,loaded:{popup:e,parsed:t}})}}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:()=>An});const n="pushwoosh-web-popups";var o,r,i,u,l,s,a,c,_,p,f,d,h,m,y,v={},g=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,k=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function C(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function S(e,t,n){var r,i,u,l={};for(u in t)"key"==u?r=t[u]:"ref"==u?i=t[u]:l[u]=t[u];if(arguments.length>2&&(l.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(u in e.defaultProps)void 0===l[u]&&(l[u]=e.defaultProps[u]);return x(e,l,r,i,null)}function x(e,t,n,o,u){var l={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:u??++i,__i:-1,__u:0};return null==u&&null!=r.vnode&&r.vnode(l),l}function P(e){return e.children}function E(e,t){this.props=e,this.context=t}function F(e,t){if(null==t)return e.__?F(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?F(e):null}function R(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],i=[],u=w({},t);u.__v=t.__v+1,r.vnode&&r.vnode(u),B(e.__P,u,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??F(t),!!(32&t.__u),i),u.__v=t.__v,u.__.__k[u.__i]=u,L(o,u,i),t.__e=t.__=null,u.__e!=n&&N(u)}}function N(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}),N(e)}function I(e){(!e.__d&&(e.__d=!0)&&u.push(e)&&!O.__r++||l!=r.debounceRendering)&&((l=r.debounceRendering)||s)(O)}function O(){try{for(var e,t=1;u.length;)u.length>t&&u.sort(a),e=u.shift(),t=u.length,R(e)}finally{u.length=O.__r=0}}function A(e,t,n,o,r,i,u,l,s,a,c){var _,p,f,d,h,m,y,b=o&&o.__k||g,k=t.length;for(s=T(n,t,b,s,k),_=0;_<k;_++)null!=(f=n.__k[_])&&(p=-1!=f.__i&&b[f.__i]||v,f.__i=_,m=B(e,f,p,r,i,u,l,s,a,c),d=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&V(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?(s=$(f,s,e,y),y&&p.__e&&(p.__e=null)):"function"==typeof f.type&&void 0!==m?s=m:d&&(s=d.nextSibling),f.__u&=-7);return n.__e=h,s}function T(e,t,n,o,r){var i,u,l,s,a,c=n.length,_=c,p=0;for(e.__k=new Array(r),i=0;i<r;i++)null!=(u=t[i])&&"boolean"!=typeof u&&"function"!=typeof u?("string"==typeof u||"number"==typeof u||"bigint"==typeof u||u.constructor==String?u=e.__k[i]=x(null,u,null,null,null):k(u)?u=e.__k[i]=x(P,{children:u},null,null,null):void 0===u.constructor&&u.__b>0?u=e.__k[i]=x(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):e.__k[i]=u,s=i+p,u.__=e,u.__b=e.__b+1,l=null,-1!=(a=u.__i=H(u,n,s,_))&&(_--,(l=n[a])&&(l.__u|=2)),null==l||null==l.__v?(-1==a&&(r>c?p--:r<c&&p++),"function"!=typeof u.type&&(u.__u|=4)):a!=s&&(a==s-1?p--:a==s+1?p++:(a>s?p--:p++,u.__u|=4))):e.__k[i]=null;if(_)for(i=0;i<c;i++)null!=(l=n[i])&&!(2&l.__u)&&(l.__e==o&&(o=F(l)),K(l,l));return o}function $(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=$(r[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=F(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||(k(e)?e.some(function(e){M(e,t)}):t.push(e)),t}function H(e,t,n,o){var r,i,u,l=e.key,s=e.type,a=t[n],c=null!=a&&!(2&a.__u);if(null===a&&null==l||c&&l==a.key&&s==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[u=r>=0?r--:i++])&&!(2&a.__u)&&l==a.key&&s==a.type)return u;return-1}function W(e,t,n){"-"==t[0]?e.setProperty(t,n??""):e[t]=null==n?"":"number"!=typeof n||b.test(t)?n:n+"px"}function U(e,t,n,o,r){var i,u;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||W(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||W(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(f,"$1")),u=t.toLowerCase(),t=u in e||"onFocusOut"==t||"onFocusIn"==t?u.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[p]=o[p]:(n[p]=d,e.addEventListener(t,i?m:h,i)):e.removeEventListener(t,i?m:h,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 j(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[_])t[_]=d++;else if(t[_]<n[p])return;return n(r.event?r.event(t):t)}}}function B(e,t,n,o,i,u,l,s,a,c){var _,p,f,d,h,m,y,v,b,S,x,F,R,N,I,O,T=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(a=!!(32&n.__u),u=[s=t.__e=n.__e]),(_=r.__b)&&_(t);e:if("function"==typeof T){p=l.length;try{if(b=t.props,S=T.prototype&&T.prototype.render,x=(_=T.contextType)&&o[_.__c],F=_?x?x.props.value:_.__:o,n.__c?v=(f=t.__c=n.__c).__=f.__E:(S?t.__c=f=new T(b,F):(t.__c=f=new E(b,F),f.constructor=T,f.render=G),x&&x.sub(f),f.state||(f.state={}),f.__n=o,d=f.__d=!0,f.__h=[],f._sb=[]),S&&null==f.__s&&(f.__s=f.state),S&&null!=T.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=w({},f.__s)),w(f.__s,T.getDerivedStateFromProps(b,f.__s))),h=f.props,m=f.state,f.__v=t,d)S&&null==T.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),S&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(S&&null==T.getDerivedStateFromProps&&b!==h&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(b,F),t.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(b,f.__s,F)){t.__v!=n.__v&&(f.props=b,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&l.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(b,f.__s,F),S&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(h,m,y)})}if(f.context=F,f.props=b,f.__P=e,f.__e=!1,R=r.__r,N=0,S)f.state=f.__s,f.__d=!1,R&&R(t),_=f.render(f.props,f.state,f.context),g.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,R&&R(t),_=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++N<25);f.state=f.__s,null!=f.getChildContext&&(o=w(w({},o),f.getChildContext())),S&&!d&&null!=f.getSnapshotBeforeUpdate&&(y=f.getSnapshotBeforeUpdate(h,m)),I=null!=_&&_.type===P&&null==_.key?q(_.props.children):_,s=A(e,k(I)?I:[I],t,n,o,i,u,l,s,a,c),f.base=t.__e,t.__u&=-161,f.__h.length&&l.push(f),v&&(f.__E=f.__=null)}catch(e){if(l.length=p,t.__v=null,a||null!=u){if(e.then){for(t.__u|=a?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;null!=u&&(u[u.indexOf(s)]=null),t.__e=s}else if(null!=u)for(O=u.length;O--;)C(u[O])}else t.__e=n.__e;null==t.__k&&(t.__k=n.__k||[]),e.then||D(t),r.__e(e,t,n)}}else null==u&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=z(n.__e,t,n,o,i,u,l,a,c);return(_=r.diffed)&&_(t),128&t.__u?void 0:s}function D(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(D))}function L(e,t,n){for(var o=0;o<n.length;o++)V(n[o],n[++o],n[++o]);r.__c&&r.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){r.__e(e,t.__v)}})}function q(e){return"object"!=typeof e||null==e||e.__b>0?e:k(e)?e.map(q):void 0!==e.constructor?null:w({},e)}function z(e,t,n,i,u,l,s,a,c){var _,p,f,d,h,m,y,g=n.props||v,b=t.props,w=t.type;if("svg"==w?u="http://www.w3.org/2000/svg":"math"==w?u="http://www.w3.org/1998/Math/MathML":u||(u="http://www.w3.org/1999/xhtml"),null!=l)for(_=0;_<l.length;_++)if((h=l[_])&&"setAttribute"in h==!!w&&(w?h.localName==w:3==h.nodeType)){e=h,l[_]=null;break}if(null==e){if(null==w)return document.createTextNode(b);e=document.createElementNS(u,w,b.is&&b),a&&(r.__m&&r.__m(t,l),a=!1),l=null}if(null==w)g===b||a&&e.data==b||(e.data=b);else{if(l="textarea"==w&&null!=b.defaultValue?null:l&&o.call(e.childNodes),!a&&null!=l)for(g={},_=0;_<e.attributes.length;_++)g[(h=e.attributes[_]).name]=h.value;for(_ in g)h=g[_],"dangerouslySetInnerHTML"==_?f=h:"children"==_||_ in b||"value"==_&&"defaultValue"in b||"checked"==_&&"defaultChecked"in b||U(e,_,null,h,u);for(_ in b)h=b[_],"children"==_?d=h:"dangerouslySetInnerHTML"==_?p=h:"value"==_?m=h:"checked"==_?y=h:a&&"function"!=typeof h||g[_]===h||U(e,_,h,g[_],u);if(p)a||f&&(p.__html==f.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(f&&(e.innerHTML=""),A("template"==t.type?e.content:e,k(d)?d:[d],t,n,i,"foreignObject"==w?"http://www.w3.org/1999/xhtml":u,l,s,l?l[0]:n.__k&&F(n,0),a,c),null!=l)for(_=l.length;_--;)C(l[_]);a&&"textarea"!=w||(_="value","progress"==w&&null==m?e.removeAttribute("value"):null!=m&&(m!==e[_]||"progress"==w&&!m||"option"==w&&m!=g[_])&&U(e,_,m,g[_],u),_="checked",null!=y&&y!=e[_]&&U(e,_,y,g[_],u))}return e}function V(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){r.__e(e,n)}}function K(e,t,n){var o,i;if(r.unmount&&r.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||V(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){r.__e(e,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&K(o[i],t,n||"function"!=typeof e.type);n||C(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 i,u,l,s;t==document&&(t=document.documentElement),r.__&&r.__(e,t),u=(i="function"==typeof n)?null:n&&n.__k||t.__k,l=[],s=[],B(t,e=(!i&&n||t).__k=S(P,null,[e]),u||v,v,t.namespaceURI,!i&&n?[n]:u?null:t.firstChild?o.call(t.childNodes):null,l,!i&&n?n:u?u.__e:t.firstChild,i,s),L(l,e,s),e.props.children=null}function Q(e,t){J(e,t,Q)}function Y(e,t,n){var r,i,u,l,s=w({},e.props);for(u in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)"key"==u?r=t[u]:"ref"==u?i=t[u]:s[u]=void 0===t[u]&&null!=l?l[u]:t[u];return arguments.length>2&&(s.children=arguments.length>3?o.call(arguments,2):n),x(e.type,s,r||e.key,i||e.ref,null)}o=g.slice,r={__e:function(e,t,n,o){for(var r,i,u;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),u=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),u=r.__d),u)return r.__E=r}catch(t){e=t}throw e}},i=0,E.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=w({},this.state),"function"==typeof e&&(e=e(w({},n),this.props)),e&&w(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),I(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),I(this))},E.prototype.render=P,u=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,a=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,c=Math.random().toString(8),_="__d"+c,p="__a"+c,f=/(PointerCapture)$|Capture$/i,d=0,h=j(!1),m=j(!0),y=0;var Z=0;Array.isArray;function X(e,t,n,o,i,u){t||(t={});var l,s,a=t;if("ref"in a)for(s in a={},t)"ref"==s?l=t[s]:a[s]=t[s];var c={type:e,props:a,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Z,__i:-1,__u:0,__source:i,__self:u};if("function"==typeof e&&(l=e.defaultProps))for(s in l)void 0===a[s]&&(a[s]=l[s]);return r.vnode&&r.vnode(c),c}const ee=/^(https?:|mailto:|tel:)/i,te="#FFFFFF",ne="#2970FF",oe="#101828",re="#667085",ie="#FFFFFF",ue={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}},le={h1:1,h2:1,h3:1,icon:1,eyebrow:.8,body:.9,caption:.75};function se(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,u]=[0,2,4].map(e=>parseInt(o.slice(e,e+2),16));return`rgba(${r}, ${i}, ${u}, ${t})`}(t.textInverse,le[e]??1):"icon"!==e?"caption"===e||"eyebrow"===e?t.textSecondary:t.text:void 0}const ae=["Vertical","Horizontal","Columns","Rows"],ce=["start","center","end","stretch"],_e=["start","center","end","space-between"],pe=["left","center","right"],fe=["default","inverse"],de=2e3,he={px:de,"%":100,em:125,rem:125},me=/^(\d{1,4}(?:\.\d+)?)(px|%|em|rem)$/,ye={px:de,"%":100,fr:100},ve=/^(\d{1,4}(?:\.\d+)?)(px|%|fr)$/,ge=["auto","min-content","max-content"];function be(e,t){return t.includes(e)?e:void 0}function ke(e){if("number"==typeof e&&Number.isFinite(e))return Math.min(Math.max(e,0),de);if("string"!=typeof e)return;const t=me.exec(e.trim());if(!t)return;const[,n,o]=t;return`${Math.min(parseFloat(n),he[o])}${o}`}const we=["top","right","bottom","left"];function Ce(e){if(ge.includes(e))return e;const t=ve.exec(e);if(!t)return;const[,n,o]=t;return`${Math.min(parseFloat(n),ye[o])}${o}`}function Se(e){return"string"==typeof e&&e.length>0?e:void 0}function xe(e){const t={},n=ke(e.gap);void 0!==n&&(t.gap=n);const o=function(e){const t=ke(e);if(void 0!==t)return t;if("object"!=typeof e||null===e)return;const n={};for(const t of we){const o=ke(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=be(e.alignItems,ce);r&&(t.alignItems=r);const i=be(e.justifyContent,_e);i&&(t.justifyContent=i);const u=Se(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(Ce);return n.every(e=>void 0!==e)?n.join(" "):void 0}(e.sizes);return void 0!==l&&(t.sizes=l),t}function Pe(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=Se(r.content);if(!e)return null;const t={type:"Content",props:{content:e}},n=be(r.align,pe);n&&(t.props.align=n);const o=be(r.tone,fe);return o&&"default"!==o&&(t.props.tone=o),t}if("Image"===o.type){const e=Se(r.image);if(!e)return null;return{type:"Image",props:{image:e}}}if(!Array.isArray(o.children))return null;const i=be(o.type,ae)??"Vertical",u=[];for(const e of o.children){const o=Pe(e,t+1,n);o&&u.push(o)}return{type:i,props:xe(r),children:u}}function Ee(e){return Pe(e,0,{nodes:100})}function Fe(e){return"number"==typeof e?`${e}px`:e}function Re(e,t){if("string"==typeof e)return e;return`repeat(${"number"==typeof e?e:Math.max(t,1)}, 1fr)`}function Ne(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 Ie(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=Re(o.sizes,e.children.length)),"Rows"===e.type&&(r.gridTemplateRows=Re(o.sizes,e.children.length)),void 0!==o.gap&&(r.gap=Fe(o.gap)),void 0!==o.padding&&(r.padding=function(e){if("number"==typeof e||"string"==typeof e)return Fe(e);const t=e=>void 0===e?"0":Fe(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),t&&Object.assign(r,Ne(t,n)),r}function Oe(e){const t=(e||"").trim();if(t)return t.startsWith("#")||t.startsWith("/")||t.startsWith("?")||ee.test(t)?t:void 0}const Ae=new Set(["STRONG","B","EM","I","U","BR","A"]);function Te(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(!Ae.has(e.tagName)){Te(e,t,n);continue}const r=n.createElement(e.tagName.toLowerCase());if("A"===e.tagName){const t=Oe(e.getAttribute("href")??void 0);t&&r.setAttribute("href",t),r.setAttribute("target","_blank"),r.setAttribute("rel","noreferrer")}t.appendChild(r),Te(e,r,n)}}function $e(e){if(!e.includes("<"))return e;const t=(new DOMParser).parseFromString(e,"text/html"),n=t.createElement("div");return Te(t.body,n,t),n.innerHTML}function Me(e){return"string"==typeof e&&e?e:void 0}function He(e){const t="object"==typeof e.colors&&null!==e.colors?e.colors:{};return{background:Me(t.background)??Me(e.background)??te,accent:Me(t.accent)??Me(e.accent)??ne,text:Me(t.text)??oe,textSecondary:Me(t.textSecondary)??re,textInverse:Me(t.textInverse)??ie}}const We=["cover","contain"];function Ue(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,...We.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}function je(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 Be(e){const t=[];for(const n of e.pages){const e=Ee(n.layout);e&&t.push({key:n.key,layout:e,images:Ue(n.images),contents:je(n.contents)})}return t}function De(e){return`calc(100% - ${2*e.offset}px)`}var Le,qe,ze,Ve,Ke=0,Ge=[],Je=r,Qe=Je.__b,Ye=Je.__r,Ze=Je.diffed,Xe=Je.__c,et=Je.unmount,tt=Je.__;function nt(e,t){Je.__h&&Je.__h(qe,e,Ke||t),Ke=0;var n=qe.__H||(qe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ot(e){return Ke=1,rt(bt,e)}function rt(e,t,n){var o=nt(Le++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):bt(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=qe,!qe.__f)){var r=function(e,t,n){if(!o.__c.__H)return!0;var r=!1,u=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]&&(u=!0)}}),i){var l=i.call(this,e,t,n);return r?l||u:l}return!r||u};qe.__f=!0;var i=qe.shouldComponentUpdate,u=qe.componentWillUpdate;qe.componentWillUpdate=function(e,t,n){if(this.__e){var o=i;i=void 0,r(e,t,n),i=o}u&&u.call(this,e,t,n)},qe.shouldComponentUpdate=r}return o.__N||o.__}function it(e,t){var n=nt(Le++,3);!Je.__s&>(n.__H,t)&&(n.__=e,n.u=t,qe.__H.__h.push(n))}function ut(e,t){var n=nt(Le++,4);!Je.__s&>(n.__H,t)&&(n.__=e,n.u=t,qe.__h.push(n))}function lt(e){return Ke=5,at(function(){return{current:e}},[])}function st(e,t,n){Ke=6,ut(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 at(e,t){var n=nt(Le++,7);return gt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ct(e,t){return Ke=8,at(function(){return e},t)}function _t(e){var t=qe.context[e.__c],n=nt(Le++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(qe)),t.props.value):e.__}function pt(e,t){Je.useDebugValue&&Je.useDebugValue(t?t(e):e)}function ft(){var e=nt(Le++,11);if(!e.__){for(var t=qe.__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 dt(){for(var e;e=Ge.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(yt),t.__h.some(vt),t.__h=[]}catch(n){t.__h=[],Je.__e(n,e.__v)}}}Je.__b=function(e){qe=null,Qe&&Qe(e)},Je.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),tt&&tt(e,t)},Je.__r=function(e){Ye&&Ye(e),Le=0;var t=(qe=e.__c).__H;t&&(ze===qe?(t.__h=[],qe.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(yt),t.__h.some(vt),t.__h=[],Le=0)),ze=qe},Je.diffed=function(e){Ze&&Ze(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ge.push(t)&&Ve===Je.requestAnimationFrame||((Ve=Je.requestAnimationFrame)||mt)(dt)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),ze=qe=null},Je.__c=function(e,t){t.some(function(e){try{e.__h.some(yt),e.__h=e.__h.filter(function(e){return!e.__||vt(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],Je.__e(n,e.__v)}}),Xe&&Xe(e,t)},Je.unmount=function(e){et&&et(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{yt(e)}catch(e){t=e}}),n.__H=void 0,t&&Je.__e(t,n.__v))};var ht="function"==typeof requestAnimationFrame;function mt(e){var t,n=function(){clearTimeout(o),ht&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);ht&&(t=requestAnimationFrame(n))}function yt(e){var t=qe,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),qe=t}function vt(e){var t=qe;e.__c=e.__(),qe=t}function gt(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function bt(e,t){return"function"==typeof t?t(e):t}function kt(e,t){for(var n in t)e[n]=t[n];return e}function wt(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 Ct(e,t){var n=t(),o=ot({t:{__:n,u:t}}),r=o[0].t,i=o[1];return ut(function(){r.__=n,r.u=t,St(r)&&i({t:r})},[e,n,t]),it(function(){return St(r)&&i({t:r}),e(function(){St(r)&&i({t:r})})},[e]),n}function St(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 xt(e){e()}function Pt(e){return e}function Et(){return[!1,xt]}var Ft=ut;function Rt(e,t){this.props=e,this.context=t}(Rt.prototype=new E).isPureReactComponent=!0,Rt.prototype.shouldComponentUpdate=function(e,t){return wt(this.props,e)||wt(this.state,t)};var Nt=r.__b;r.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Nt&&Nt(e)};var It="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Ot=function(e,t){return null==e?null:M(M(e).map(t))},At={map:Ot,forEach:Ot,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},Tt=r.__e;r.__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);Tt(e,t,n,o)};var $t=r.unmount;function Mt(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=kt({},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 Mt(e,t,n)})),e}function Ht(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Ht(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 Wt(){this.__u=0,this.o=null,this.__b=null}function Ut(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function jt(){this.i=null,this.l=null}r.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),$t&&$t(e)},(Wt.prototype=new E).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=Ut(o.__v),i=!1,u=function(){i||o.__z||(i=!0,n.__R=null,r?r(s):s())};n.__R=u;var l=n.__P;n.__P=null;var s=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=Ht(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(u,u)},Wt.prototype.componentWillUnmount=function(){this.o=[]},Wt.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]=Mt(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&S(P,null,e.fallback);return r&&(r.__u&=-33),[S(P,null,t.__a?null:e.children),r]};var Bt=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 Dt(e){return this.getChildContext=function(){return e.context},e.children}function Lt(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(S(Dt,{context:t.context},e.__v),t.v)}(jt.prototype=new E).__a=function(e){var t=this,n=Ut(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),Bt(t,e,o)):r()};n?n(i):i()}},jt.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},jt.prototype.componentDidUpdate=jt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Bt(e,n,t)})};var qt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,zt=/^(?: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]/,Vt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Kt=/[A-Z0-9]/g,Gt="undefined"!=typeof document,Jt=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};E.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(E.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Qt=r.event;r.event=function(e){return Qt&&(e=Qt(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Yt,Zt={configurable:!0,get:function(){return this.class}},Xt=r.vnode;r.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 u=t[i];if(!("value"===i&&"defaultValue"in t&&null==u||Gt&&"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===u?u="":"translate"===l&&"no"===u?u=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==n&&"textarea"!==n||Jt(t.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":Vt.test(i)&&(i=l):l=i="oninput":r&&zt.test(i)?i=i.replace(Kt,"-$&").toLowerCase():null===u&&(u=void 0),"oninput"===l&&o[i=l]&&(i="oninputCapture"),o[i]=u}}"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",Zt)):t.className&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=qt,Xt&&Xt(e)};var en=r.__r;r.__r=function(e){en&&en(e),Yt=e.__c};var tn=r.diffed;r.diffed=function(e){tn&&tn(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),Yt=null};var nn={ReactCurrentDispatcher:{current:{readContext:function(e){return Yt.__n[e.__c].props.value},useCallback:ct,useContext:_t,useDebugValue:pt,useDeferredValue:Pt,useEffect:it,useId:ft,useImperativeHandle:st,useInsertionEffect:Ft,useLayoutEffect:ut,useMemo:at,useReducer:rt,useRef:lt,useState:ot,useSyncExternalStore:Ct,useTransition:Et}}};function on(e){return!!e&&e.$$typeof===qt}var rn={useState:ot,useId:ft,useReducer:rt,useEffect:it,useLayoutEffect:ut,useInsertionEffect:Ft,useTransition:Et,useDeferredValue:Pt,useSyncExternalStore:Ct,startTransition:xt,useRef:lt,useImperativeHandle:st,useMemo:at,useCallback:ct,useContext:_t,useDebugValue:pt,version:"18.3.1",Children:At,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 Q(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=S(Lt,{__v:e,h:t});return n.containerInfo=t,n},createElement:S,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,I(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"+y++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createFactory:function(e){return S.bind(null,e)},cloneElement:function(e){return on(e)?Y.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:P,isValidElement:on,isElement:on,isFragment:function(e){return on(e)&&e.type===P},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:E,PureComponent:Rt,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:wt(this.props,e)}function o(t){return this.shouldComponentUpdate=n,S(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=kt({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=It,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},flushSync:function(e,t){var n=r.debounceRendering;r.debounceRendering=function(e){return e()};var o=e(t);return r.debounceRendering=n,o},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:P,Suspense:Wt,SuspenseList:jt,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?S(r,i):null}return i.displayName="Lazy",i.__f=!0,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:nn};const un={none:void 0,fade:"pw-vpopup-fade 0.35s ease-out backwards",slide:"pw-vpopup-slide 0.35s ease-out backwards"};function ln({slot:e,align:t,inverse:n,colors:o}){const r={...ue[e.variant],textAlign:e.align??t,padding:"4px 0"},i=se(e.variant,o,n);return i&&(r.color=i),rn.createElement("div",{style:r,dangerouslySetInnerHTML:{__html:$e(e.html)}})}function sn({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 rn.createElement("div",{style:i},rn.createElement("button",{type:"button",style:r,onClick:n},e.label));if("page"===e.action.type){const t=e.action.page;return rn.createElement("div",{style:i},rn.createElement("button",{type:"button",style:r,onClick:()=>o(t)},e.label))}const u=Oe(e.action.url);return u?rn.createElement("div",{style:i},rn.createElement("a",{href:u,target:"_blank",rel:"noreferrer",style:r},e.label)):rn.createElement("div",{style:i},rn.createElement("button",{type:"button",style:r},e.label))}function an({node:e,page:t,colors:n,onRequestClose:o,onPageChange:r}){const i=t.contents.find(t=>t.key===e.props.content);if(!i)return null;const u=e.props.align??"left",l="inverse"===e.props.tone;return rn.createElement("div",{style:{minWidth:0}},i.slots.map(e=>"text"===e.type?rn.createElement(ln,{key:e.key,slot:e,align:u,inverse:l,colors:n}):rn.createElement(sn,{key:e.key,slot:e,accent:n.accent,onRequestClose:o,onPageChange:r})))}function cn({node:e,page:t}){const n=t.images.find(t=>t.key===e.props.image);if(!n?.src)return null;const o={display:"block",width:"100%",minWidth:0};return n.fit?(o.height="100%",o.objectFit=n.fit):o.height="auto",n.blur&&(o.filter=`blur(${n.blur}px)`),rn.createElement("img",{src:n.src,alt:"",style:o})}function _n({node:e,page:t,colors:n,onRequestClose:o,onPageChange:r}){if("Content"===e.type)return rn.createElement(an,{node:e,page:t,colors:n,onRequestClose:o,onPageChange:r});if("Image"===e.type)return rn.createElement(cn,{node:e,page:t});const i=e.props?.backgroundImage,u=i?t.images.find(e=>e.key===i):void 0,l=u?.blur??0,s=u?.dim??0,a=Ie(e,l>0?void 0:u?.src||void 0,s);i&&(a.backgroundColor="#1D2939");const c=e.children.map((e,i)=>rn.createElement(_n,{key:i,node:e,page:t,colors:n,onRequestClose:o,onPageChange:r}));if(l>0){const{backgroundColor:e,...t}=a;return rn.createElement("div",{style:{minWidth:0,backgroundColor:e,...u?.src?Ne(u.src,s):{}}},rn.createElement("div",{style:{...t,backdropFilter:`blur(${l}px)`,WebkitBackdropFilter:`blur(${l}px)`}},c))}return rn.createElement("div",{style:a},c)}function pn({page:e,params:t,onRequestClose:n,onPageChange:o}){const r={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};return t.height&&(r.height=t.height,r.overflowY="auto"),rn.createElement("div",{style:r},rn.createElement(_n,{node:e.layout,page:e,colors:t.colors,onRequestClose:n,onPageChange:o}))}function fn({onRequestClose:e}){return rn.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 dn(e){const{placement:t}=e,n={position:"fixed",boxSizing:"border-box",maxWidth:De(t),maxHeight:De(t),pointerEvents:"auto"};if(e.width){n.width=e.width;const o=t.h;"left"===o?n.left=t.offset:"right"===o?n.right=t.offset:n.left="50%"}else n.left=t.offset,n.right=t.offset;"top"===t.v?n.top=t.offset:"bottom"===t.v?n.bottom=t.offset:n.top="50%";const o=e.width&&"center"===t.h?"-50%":"0",r="middle"===t.v?"-50%":"0";"0"===o&&"0"===r||(n.transform=`translate(${o}, ${r})`);const i=un[e.animation];return i&&(n.animation=i),n}function hn({params:e,mode:t="live",onRequestClose:n}){const[o,r]=ot(null),i=Be(e);if(0===i.length)return null;const u=i.find(e=>e.key===o)??function(e,t){return t.find(t=>t.key===e.startPage)??t[0]}(e,i);if("preview"===t)return rn.createElement("div",{style:{position:"relative",width:e.width??"100%"}},rn.createElement(pn,{page:u,params:e,onRequestClose:n,onPageChange:r}));const l=e.overlay;return rn.createElement(rn.Fragment,null,rn.createElement("style",null,"\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"),l&&rn.createElement("div",{style:{position:"fixed",inset:0,backgroundColor:l.color,opacity:l.opacity,animation:"pw-vpopup-overlay 0.2s ease-out backwards",pointerEvents:"auto"},onClick:n}),rn.createElement("div",{style:dn(e)},rn.createElement(pn,{page:u,params:e,onRequestClose:n,onPageChange:r}),rn.createElement(fn,{onRequestClose:n})))}const mn=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:He(o)}}:null}(e);return t?0===Be(t.params).length?null:t.params:null},yn="keyValue",vn="messages",gn="inboxMessages";function bn(e,t){return function(n){n.objectStoreNames.contains(e)||t(n)}}const kn=[bn(yn,function(e){e.createObjectStore(yn,{keyPath:"key"})}),bn("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})}),bn(vn,function(e){e.createObjectStore(vn,{keyPath:"id",autoIncrement:!0}).createIndex("date","date",{unique:!1})}),bn(gn,function(e){const t="status",n=e.createObjectStore(gn,{keyPath:"inbox_id",autoIncrement:!1});n.createIndex(t,t,{unique:!1,multiEntry:!0}),n.createIndex("rt","rt",{unique:!1,multiEntry:!0})})];class wn{get all(){return kn}}class Cn{constructor(e,t=new wn){this.db=e,this.migrationsBuilder=t}applyMigrations(){this.applyMigrationsPack(this.migrationsBuilder.all)}applyMigrationsPack(e){e.forEach(e=>{e(this.db)})}}function Sn(e,t){console.info("onversionchange",t),e.close()}let xn;function Pn(e){return(xn||(xn=new Promise((e,t)=>{const n=indexedDB.open("PUSHWOOSH_SDK_STORE",7);n.onsuccess=n=>{const o=n.target.result;o.onversionchange=Sn.bind(null,o,t),e(o)},n.onerror=()=>t(n.error),n.onupgradeneeded=e=>{const n=e.target.result;n.onversionchange=Sn.bind(null,n,t),new Cn(n).applyMigrations()}})),xn).then(t=>new Promise((n,o)=>e(t,n,o)))}class En{_add(e){return Pn((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 Pn((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 Pn((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)}})}}Fn=yn;var Fn;const Rn=new class extends En{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)}},Nn=(new class extends En{constructor(){super(...arguments),this.name=vn,this.maxItems=25}add(e){return this._add({...e,date:new Date})}},{error:1,info:2,debug:3});let In=3;const On={setLevel(e){Nn[e]||(e="error"),In=Nn[e]},write(e,t,n){return"error"===e?this.error(t):this.info(t),Rn.add(e,t,n)}};Object.keys(Nn).forEach(e=>{const t=Nn[e];On[e]=(...n)=>{t<=In&&(console.groupCollapsed(e),console.info("",...n),console.trace("trace"),console.groupEnd())}});class An{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&&On.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;const t=await this.pw.api.getPopupFormContent(e.popup_form_content_code),n=mn(t.json);n?this.loadedPopups.set(e.code,{popup:e,parsed:n}):On.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,{popup:t,parsed:n}])=>{this.addToQueue(t,n),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}=e;return!t||(0===t.length||t.includes(window.location.pathname))}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=>{On.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,t){this.pw.api.recordPopupFormEvent(e.code,1).catch(t=>{On.error(t,`Failed to record web popup queued event for "${e.code}"`)});const o=window.setTimeout(()=>{this.pendingTimers.delete(e.code);const o=document.createElement("div");o.id=`${n}-${e.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 u=!!t.overlay;u&&this.lockBodyScroll();((e,t,n)=>{J(X(hn,{params:t,mode:"live",onRequestClose:n}),e)})(i,t,()=>{u&&this.unlockBodyScroll(),o.remove(),this.pw.dispatchEvent("hide-web-popup",{code:e.code})}),this.markAsShown(e).catch(t=>{On.error(t,`Failed to mark web popup "${e.code}" as shown`)}),this.pw.dispatchEvent("show-web-popup",{code:e.code})},1e3*e.delay);this.pendingTimers.set(e.code,{timeoutId:o,loaded:{popup:e,parsed:t}})}}return t})());
|
|
2
2
|
//# sourceMappingURL=widget-web-popups.js.map
|