/*! For license information please see widget.js.LICENSE.txt */ (()=>{"use strict";var t={};function e(){try{if(window.ym){const t=document.cookie.match("(?:^|;)\\s*_ym_uid=([^;]*)");return t?decodeURIComponent(t[1]):void 0}}catch(t){return}}function i(){try{if(window.ga){return window.ga.getAll()[0].get("clientId")}}catch(t){return}}function n(){let t=!1;return function(e){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0)}(navigator.userAgent||navigator.vendor||window.opera),t}t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{var e;t.g.importScripts&&(e=t.g.location+"");var i=t.g.document;if(!e&&i&&(i.currentScript&&"SCRIPT"===i.currentScript.tagName.toUpperCase()&&(e=i.currentScript.src),!e)){var n=i.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t.p=e})();const r=Symbol("isLocationPatched");function o(){return n()?"mobile":"desktop"}const a=t=>t&&t[0].toUpperCase()+t.slice(1)||"",s=t=>t.replaceAll("\ufeff","").replaceAll("","");function l(t){return fetch(`https://widget.yourgood.app/api/settings/get-for-external?id=${t}`).then((t=>t.json())).then((t=>{let{data:e}=t;return e}))}function c(t,n){let{name:r,wazzupId:a,hid:s,integrations:l}=n;const c=o();/^\d{8}$/.test(a)&&(a="mobile"===c?"WM"+a:"WW"+a);const d={settingsId:t,wazzupId:a,hid:s,name:r,cookies:document.cookie,referrer:document.referrer,url:window.location.toString(),ymId:e(),gaId:i(),deviceType:c,coMagicId:window?.Comagic?.getSessionId(),callTouchId:window.call_value||null};return fetch("https://widget.yourgood.app/api/statistics",{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(d)}).then((t=>t.json())).then((t=>{let{data:e}=t;return e}))}function d(t){return fetch(`https://widget.yourgood.app/api/integrations/get-by-settings?id=${t}`).then((t=>(t.ok||console.warn("Can not get integrations. Http",t.status),t.json()))).then((t=>{let{data:e}=t;return e??[]})).catch((()=>[]))}function u(t){return fetch(`https://widget.yourgood.app/api/statistics/dialog-events?settingsId=${t}`).then((t=>t.json())).then((t=>{let{data:e}=t;return e??[]})).catch((()=>[]))}function p(t){return fetch(`https://widget.yourgood.app/api/subscriptions/external?widgetId=${t}`).then((t=>t.json())).then((t=>{let{data:e}=t;return e})).catch((()=>null))}function h(t){return fetch(`https://widget.yourgood.app/api/ab-tests/customers-tests?widgetId=${t}`).then((t=>t.json())).then((t=>{let{data:e}=t;return e})).catch((()=>null))}function f(t){const e={settingsId:t.settingsId,wazzupId:t.wazzupId,error:t.error,metric:t.metric,type:t.type};return fetch("https://widget.yourgood.app/api/statistics/send-dialog-event-info",{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(e)}).then((t=>t.json())).then((t=>{let{data:e}=t;return e}))}let g=t=>crypto.getRandomValues(new Uint8Array(t)),m=(t,e=21)=>((t,e,i)=>{let n=(2<{let a="";for(;;){let e=i(r),s=0|r;for(;s--;)if(a+=t[e[s]&n]||"",a.length===o)return a}}})(t,e,g);function v(t){for(var e=1;e{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new P(i,t,y)},F=C?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new P("string"==typeof t?t:t+"",void 0,y))(e)})(t):t;var $;const B=window,k=B.trustedTypes,_=k?k.emptyScript:"",E=B.reactiveElementPolyfillSupport,S={toAttribute(t,e){switch(e){case Boolean:t=t?_:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},I=(t,e)=>e!==t&&(e==e||t==t),A={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:I},z="finalized";class W extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=A){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const r=this[t];this[e]=n,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||A}static finalize(){if(this.hasOwnProperty(z))return!1;this[z]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(F(t))}else void 0!==t&&e.push(F(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{C?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),n=b.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=A){var n;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const o=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:S).toAttribute(e,i.type);this._$El=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,r=n._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=n.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:S;this._$El=r,this[r]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||I)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}var T;W[z]=!0,W.elementProperties=new Map,W.elementStyles=[],W.shadowRootOptions={mode:"open"},null==E||E({ReactiveElement:W}),(null!==($=B.reactiveElementVersions)&&void 0!==$?$:B.reactiveElementVersions=[]).push("1.6.3");const H=window,L=H.trustedTypes,O=L?L.createPolicy("lit-html",{createHTML:t=>t}):void 0,V="$lit$",j=`lit$${(Math.random()+"").slice(9)}$`,D="?"+j,U=`<${D}>`,R=document,Z=()=>R.createComment(""),N=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Q=Array.isArray,G=t=>Q(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),q="[ \t\n\f\r]",Y=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,J=/-->/g,K=/>/g,X=RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),tt=/'/g,et=/"/g,it=/^(?:script|style|textarea|title)$/i,nt=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),rt=nt(1),ot=(nt(2),Symbol.for("lit-noChange")),at=Symbol.for("lit-nothing"),st=new WeakMap,lt=R.createTreeWalker(R,129,null,!1);function ct(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==O?O.createHTML(e):e}const dt=(t,e)=>{const i=t.length-1,n=[];let r,o=2===e?"":"",a=Y;for(let e=0;e"===l[0]?(a=null!=r?r:Y,c=-1):void 0===l[1]?c=-2:(c=a.lastIndex-l[2].length,s=l[1],a=void 0===l[3]?X:'"'===l[3]?et:tt):a===et||a===tt?a=X:a===J||a===K?a=Y:(a=X,r=void 0);const u=a===X&&t[e+1].startsWith("/>")?" ":"";o+=a===Y?i+U:c>=0?(n.push(s),i.slice(0,c)+V+i.slice(c)+j+u):i+j+(-2===c?(n.push(void 0),e):u)}return[ct(t,o+(t[i]||"")+(2===e?"":"")),n]};class ut{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,o=0;const a=t.length-1,s=this.parts,[l,c]=dt(t,e);if(this.el=ut.createElement(l,i),lt.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=lt.nextNode())&&s.length0){n.textContent=L?L.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=at}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const r=this.strings;let o=!1;if(void 0===r)t=pt(this,t,e,0),o=!N(t)||t!==this._$AH&&t!==ot,o&&(this._$AH=t);else{const n=t;let a,s;for(t=r[0],a=0;a{var n,r;const o=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let a=o._$litPart$;if(void 0===a){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=a=new ft(e.insertBefore(Z(),t),t,void 0,null!=i?i:{})}return a._$AI(t),a};var Pt,Mt;class Ft extends W{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=xt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return ot}}Ft.finalized=!0,Ft._$litElement$=!0,null===(Pt=globalThis.litElementHydrateSupport)||void 0===Pt||Pt.call(globalThis,{LitElement:Ft});const $t=globalThis.litElementPolyfillSupport;null==$t||$t({LitElement:Ft});(null!==(Mt=globalThis.litElementVersions)&&void 0!==Mt?Mt:globalThis.litElementVersions=[]).push("3.3.3");const Bt=t.p+"images/widget-button-whatsapp-and-telegram.gif",kt=t.p+"images/widget-button-whatsapp-and-telegram-and-viber.gif",_t=t.p+"images/widget-button-whatsapp-and-viber.gif",Et=t.p+"images/widget-button-telegram-and-viber.gif";function St(t,e,i){return t?e():null==i?void 0:i()}const It=1,At=t=>(...e)=>({_$litDirective$:t,values:e});class zt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const Wt=At(class extends zt{constructor(t){var e;if(super(t),t.type!==It||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,n;if(void 0===this.it){this.it=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.nt)||void 0===i?void 0:i.has(t))&&this.it.add(t);return this.render(e)}const r=t.element.classList;this.it.forEach((t=>{t in e||(r.remove(t),this.it.delete(t))}));for(const t in e){const i=!!e[t];i===this.it.has(t)||(null===(n=this.nt)||void 0===n?void 0:n.has(t))||(i?(r.add(t),this.it.add(t)):(r.remove(t),this.it.delete(t)))}return ot}}),Tt="important",Ht=" !"+Tt,Lt=At(class extends zt{constructor(t){var e;if(super(t),t.type!==It||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const n=t[i];return null==n?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ht){this.ht=new Set;for(const t in e)this.ht.add(t);return this.render(e)}this.ht.forEach((t=>{null==e[t]&&(this.ht.delete(t),t.includes("-")?i.removeProperty(t):i[t]="")}));for(const t in e){const n=e[t];if(null!=n){this.ht.add(t);const e="string"==typeof n&&n.endsWith(Ht);t.includes("-")||e?i.setProperty(t,e?n.slice(0,-11):n,e?Tt:""):i[t]=n}}return ot}}),Ot=()=>`https://widget.yourgood.ru/?utm_source=${encodeURIComponent(window.location.host)}&utm_medium=cta_modal&utm_content=viral`,Vt=M` .PFMessage, .PFChat, .PFModal { --pf-primary: #212121; --pf-secondary: #757575; --pf-disabled: #9e9e9e; --pf-main-blue: #2962ff; --pf-main-blue-dark: #1d4ed6; --pf-main-blue-light: #5481ff; --pf-blue-shade-50: #94b0ff; --pf-blue-shade-8: #eef3ff; --pf-blue-shade-4: #f7f9ff; --pf-background: #f8f9fb; --pf-main-yellow: #ffa726; --pf-yellow-shade-12: #fff4e5; --pf-main-green: #4caf50; --pf-green-shade-8: #f3faf3; --pf-main-red: #d32f2f; --pf-red-shade-50: #e99797; --pf-red-shade-8: #fbeeee; --pf-red-shade-4: #fdf7f7; --pf-grey-900: #212121; --pf-grey-800: #424242; --pf-grey-700: #616161; --pf-grey-600: #757575; --pf-grey-500: #9e9e9e; --pf-grey-400: #bdbdbd; --pf-grey-300: #e0e0e0; --pf-grey-200: #eee; --pf-grey-100: #f5f5f5; --pf-white: #fff; --pf-modal-telegram-color: #2aabee; --pf-modal-whatsapp-color: #5ed169; --pf-modal-viber-color: #655cac; --pf-chat-whatsapp-background: #f6f6f6; } `,jt=M` .PFModalButtonWhatsapp .PFModalButtonIcon { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 20L5.27221 15.3802C4.48567 14.0242 4.07307 12.4886 4.07736 10.9187C4.07736 5.99952 8.10028 2 13.0387 2C15.437 2 17.6891 2.92823 19.3782 4.61359C21.0716 6.29895 22.0043 8.5404 22 10.923C22 15.8422 17.9771 19.8417 13.0344 19.8417H13.0301C11.5301 19.8417 10.0559 19.4653 8.74498 18.7552L4 20ZM8.97278 17.1426L9.24355 17.3051C10.3868 17.981 11.6977 18.336 13.0344 18.3403H13.0387C17.1433 18.3403 20.4871 15.0166 20.4871 10.9273C20.4871 8.94677 19.7135 7.08603 18.308 5.68298C16.9026 4.27994 15.0286 3.50998 13.0387 3.50998C8.93409 3.5057 5.59026 6.82937 5.59026 10.9187C5.59026 12.3175 5.98137 13.682 6.72922 14.8626L6.90544 15.145L6.15329 17.8783L8.97278 17.1426Z' fill='url(%23paint0_linear_1767_5881)'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10.7994 7.18869C10.6317 6.81654 10.4555 6.80799 10.2965 6.80371C10.1676 6.79943 10.0171 6.79943 9.86669 6.79943C9.71626 6.79943 9.47557 6.85504 9.26927 7.07747C9.06297 7.29991 8.48704 7.83888 8.48704 8.93821C8.48704 10.0333 9.29076 11.0941 9.40251 11.2438C9.51426 11.3935 10.9541 13.7163 13.2277 14.6103C15.1188 15.3546 15.5057 15.2048 15.914 15.1664C16.3223 15.1279 17.2377 14.6274 17.4269 14.1055C17.6117 13.5837 17.6117 13.1388 17.5558 13.0447C17.4999 12.9506 17.3495 12.895 17.126 12.7837C16.9025 12.6725 15.8022 12.1336 15.5959 12.0566C15.3896 11.9838 15.2392 11.9453 15.093 12.1678C14.9426 12.3902 14.5128 12.8907 14.3839 13.0404C14.2549 13.1901 14.1217 13.2072 13.8982 13.096C13.6747 12.9848 12.9526 12.7495 12.0973 11.9881C11.4312 11.3978 10.9799 10.6664 10.8509 10.4439C10.722 10.2215 10.838 10.1017 10.9498 9.9905C11.0486 9.89211 11.1733 9.72956 11.285 9.60124C11.3968 9.47291 11.4355 9.3788 11.5085 9.22909C11.5816 9.07937 11.5472 8.95105 11.4913 8.83983C11.4355 8.73289 10.9971 7.62928 10.7994 7.18869Z' fill='white'/%3E%3Cdefs%3E%3ClinearGradient id='paint0_linear_1767_5881' x1='13.0018' y1='19.9983' x2='13.0018' y2='2' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23F9F9F9'/%3E%3Cstop offset='1' stop-color='white'/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E"); } .PFModalButtonTelegram .PFModalButtonIcon { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.24138 11.8319C7.90571 9.79974 11.016 8.46001 12.5722 7.81272C17.0156 5.96457 17.9389 5.64353 18.5407 5.63293C18.673 5.63059 18.969 5.6634 19.1607 5.81895C19.3226 5.95029 19.3671 6.12772 19.3884 6.25225C19.4097 6.37677 19.4363 6.66045 19.4152 6.88211C19.1744 9.41209 18.1325 15.5517 17.6024 18.3853C17.3781 19.5843 16.9365 19.9863 16.509 20.0257C15.5798 20.1112 14.8743 19.4116 13.9743 18.8217C12.5661 17.8986 11.7706 17.324 10.4037 16.4232C8.82398 15.3822 9.84803 14.8101 10.7483 13.875C10.9839 13.6303 15.0778 9.90662 15.157 9.56882C15.1669 9.52657 15.1761 9.3691 15.0826 9.28594C14.989 9.20279 14.8509 9.23122 14.7513 9.25384C14.61 9.28589 12.3604 10.7728 8.00238 13.7146C7.36383 14.1531 6.78545 14.3667 6.26725 14.3555C5.69596 14.3432 4.59704 14.0325 3.78011 13.767C2.77811 13.4412 1.98174 13.269 2.05108 12.7159C2.0872 12.4278 2.48397 12.1331 3.24138 11.8319Z' fill='white'/%3E%3C/svg%3E"); } .PFModalButtonViber .PFModalButtonIcon { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M19.6455 8.13866L19.6408 8.11973C19.2578 6.57115 17.5308 4.9095 15.9449 4.56381L15.927 4.56011C13.3619 4.07078 10.7609 4.07078 8.19632 4.56011L8.17789 4.56381C6.59252 4.9095 4.86552 6.57126 4.48197 8.11973L4.47771 8.13866C4.00417 10.3012 4.00417 12.4944 4.47771 14.657L4.48197 14.6759C4.84922 16.1584 6.44753 17.7438 7.97428 18.1797V19.9083C7.97428 20.534 8.73672 20.8413 9.17028 20.3898L10.9217 18.5693C11.3016 18.5905 11.6817 18.6024 12.0616 18.6024C13.3528 18.6024 14.6447 18.4802 15.927 18.2356L15.9448 18.2319C17.5308 17.8862 19.2577 16.2245 19.6408 14.676L19.6455 14.6571C20.119 12.4944 20.119 10.3013 19.6455 8.13866ZM18.2594 14.3435C18.0037 15.3538 16.6925 16.6097 15.6507 16.8418C14.2868 17.1012 12.912 17.212 11.5387 17.174C11.5113 17.1732 11.4851 17.1839 11.4661 17.2035C11.2711 17.4035 10.1873 18.5162 10.1873 18.5162L8.82717 19.9122C8.72771 20.0159 8.55299 19.9453 8.55299 19.8022V16.9386C8.55299 16.8913 8.51922 16.8511 8.47274 16.8419C8.47246 16.8418 8.47223 16.8418 8.47195 16.8418C7.43012 16.6097 6.11937 15.3537 5.86317 14.3434C5.43695 12.3887 5.43695 10.407 5.86317 8.45226C6.11937 7.44196 7.43012 6.18598 8.47195 5.95391C10.854 5.50087 13.2692 5.50087 15.6507 5.95391C16.6931 6.18598 18.0037 7.44196 18.2595 8.45226C18.6862 10.4071 18.6862 12.3887 18.2594 14.3435Z' fill='white'/%3E%3Cpath d='M14.3275 15.6661C14.1673 15.6174 14.0147 15.5848 13.8729 15.526C12.4039 14.9166 11.0521 14.1303 9.98127 12.9251C9.37232 12.2398 8.8957 11.466 8.49284 10.6472C8.30176 10.2589 8.14076 9.85542 7.97662 9.45445C7.82699 9.08888 8.04741 8.71121 8.27947 8.43569C8.49726 8.17714 8.77754 7.97934 9.08106 7.83346C9.31795 7.71967 9.55158 7.7853 9.72462 7.98606C10.0986 8.42018 10.4422 8.87647 10.7203 9.37969C10.8914 9.68921 10.8445 10.0675 10.5344 10.2782C10.459 10.3293 10.3904 10.3895 10.3202 10.4473C10.2586 10.498 10.2007 10.5492 10.1585 10.6178C10.0813 10.7432 10.0777 10.8914 10.1273 11.0278C10.5096 12.0785 11.154 12.8955 12.2116 13.3356C12.3808 13.406 12.5507 13.4879 12.7457 13.4653C13.0722 13.4271 13.1779 13.069 13.4067 12.8819C13.6303 12.699 13.9162 12.6966 14.157 12.849C14.398 13.0016 14.6315 13.1652 14.8637 13.3307C15.0916 13.4931 15.3185 13.6519 15.5286 13.8371C15.7308 14.0151 15.8004 14.2486 15.6866 14.4901C15.4782 14.9326 15.175 15.3006 14.7377 15.5356C14.6142 15.6017 14.4667 15.6232 14.3275 15.6661C14.4667 15.6232 14.1673 15.6174 14.3275 15.6661Z' fill='white'/%3E%3Cpath d='M12.0655 7.32718C13.9868 7.38105 15.565 8.65612 15.9032 10.5557C15.9608 10.8793 15.9813 11.2102 16.0069 11.5388C16.0177 11.6769 15.9394 11.8082 15.7904 11.81C15.6364 11.8119 15.5671 11.683 15.557 11.5449C15.5372 11.2715 15.5235 10.9968 15.4858 10.7258C15.287 9.29448 14.1457 8.11034 12.721 7.85627C12.5066 7.81802 12.2873 7.808 12.0701 7.7852C11.9328 7.77081 11.7531 7.76252 11.7227 7.59183C11.6972 7.44875 11.8179 7.33485 11.9542 7.32751C11.9911 7.32533 12.0283 7.32706 12.0655 7.32718C13.9869 7.38105 12.0283 7.32706 12.0655 7.32718Z' fill='white'/%3E%3Cpath d='M14.9856 11.1117C14.9824 11.1357 14.9808 11.1921 14.9667 11.2452C14.9158 11.4381 14.6232 11.4622 14.5559 11.2676C14.536 11.2099 14.533 11.1441 14.5329 11.082C14.5322 10.6751 14.4438 10.2685 14.2385 9.91443C14.0276 9.55048 13.7052 9.24466 13.3273 9.05947C13.0987 8.94758 12.8516 8.87797 12.601 8.83659C12.4915 8.81844 12.3809 8.80752 12.2708 8.79218C12.1375 8.77364 12.0663 8.68869 12.0727 8.55731C12.0785 8.43422 12.1685 8.34557 12.3027 8.35325C12.7436 8.37822 13.1695 8.47365 13.5616 8.68118C14.3587 9.10337 14.8141 9.76967 14.9471 10.6595C14.953 10.6998 14.9627 10.7397 14.9658 10.7801C14.9733 10.8799 14.978 10.9799 14.9856 11.1117C14.9824 11.1356 14.978 10.9799 14.9856 11.1117Z' fill='white'/%3E%3Cpath d='M13.7897 11.0654C13.629 11.0683 13.543 10.9793 13.5263 10.832C13.5148 10.7293 13.5057 10.6251 13.4811 10.5251C13.4329 10.3282 13.3282 10.1457 13.1625 10.025C13.0844 9.96809 12.9957 9.9266 12.9029 9.89972C12.785 9.86561 12.6625 9.87502 12.545 9.84624C12.4172 9.81493 12.3466 9.71144 12.3667 9.59166C12.3849 9.48257 12.491 9.39745 12.6102 9.40613C13.3551 9.45989 13.8875 9.845 13.9635 10.722C13.969 10.7839 13.9752 10.8492 13.9615 10.9085C13.9379 11.0097 13.8628 11.0605 13.7897 11.0654C13.8628 11.0605 13.6289 11.0683 13.7897 11.0654Z' fill='white'/%3E%3Cpath d='M19.6445 8.13837L19.6398 8.11944C19.4251 7.25138 18.788 6.34786 17.9902 5.6604L16.9117 6.61622C17.553 7.12722 18.1025 7.83513 18.2586 8.45192C18.6853 10.4067 18.6853 12.3883 18.2586 14.3432C18.0028 15.3535 16.6916 16.6095 15.6498 16.8415C14.2859 17.1009 12.9112 17.2117 11.5378 17.1737C11.5105 17.1729 11.4842 17.1836 11.4652 17.2032C11.2703 17.4032 10.1864 18.5159 10.1864 18.5159L8.8263 19.9119C8.72685 20.0156 8.55213 19.9451 8.55213 19.8019V16.9383C8.55213 16.891 8.51836 16.8508 8.47188 16.8416C8.4716 16.8416 8.47137 16.8415 8.47109 16.8415C7.879 16.7096 7.20033 16.2469 6.67751 15.6867L5.61182 16.6311C6.27738 17.3551 7.13582 17.9404 7.97325 18.1795V19.9082C7.97325 20.5339 8.73569 20.8411 9.16925 20.3896L10.9207 18.5691C11.3006 18.5903 11.6805 18.6022 12.0606 18.6022C13.3518 18.6022 14.6436 18.48 15.9259 18.2354L15.9438 18.2318C17.5297 17.8861 19.2567 16.2245 19.6397 14.6759L19.6444 14.6569C20.118 12.4941 20.118 10.3011 19.6445 8.13837Z' fill='white'/%3E%3Cpath d='M15.5289 13.8359C15.3187 13.6509 15.0918 13.492 14.864 13.3296C14.6318 13.1641 14.3983 13.0005 14.1573 12.8479C13.9164 12.6955 13.6307 12.6979 13.407 12.8807C13.1782 13.0678 13.0725 13.426 12.746 13.4642C12.551 13.4868 12.3811 13.4048 12.2118 13.3345C11.5612 13.0638 11.0675 12.6499 10.6943 12.1272L9.90137 12.83C9.9283 12.8612 9.95401 12.8932 9.98139 12.924C11.0522 14.1292 12.4041 14.9155 13.873 15.5249C14.0147 15.5837 14.1674 15.6164 14.3276 15.665C14.1674 15.6163 14.4669 15.6221 14.3276 15.665C14.4669 15.6221 14.6143 15.6006 14.7379 15.5344C15.1753 15.2994 15.4785 14.9314 15.6868 14.489C15.8007 14.2475 15.7311 14.014 15.5289 13.8359Z' fill='white'/%3E%3Cpath d='M14.819 8.46826L14.481 8.76792C15.0122 9.28481 15.3786 9.96986 15.4833 10.7237C15.5209 10.9949 15.5348 11.2695 15.5545 11.5429C15.5646 11.681 15.6338 11.8099 15.7879 11.8081C15.937 11.8062 16.0153 11.675 16.0045 11.5368C15.9787 11.2083 15.9583 10.8773 15.9007 10.5537C15.7527 9.72223 15.367 9.0104 14.819 8.46826Z' fill='white'/%3E%3Cpath d='M14.9446 10.6577C14.8478 10.0093 14.5788 9.48024 14.132 9.07715L13.7949 9.37591C13.9693 9.53064 14.1201 9.71236 14.2362 9.91279C14.4414 10.2669 14.5299 10.6734 14.5305 11.0803C14.5307 11.1425 14.5336 11.2082 14.5536 11.2661C14.621 11.4608 14.9134 11.4367 14.9644 11.2437C14.9785 11.1905 14.9801 11.1341 14.9833 11.1102C14.9756 10.9784 14.9801 11.1342 14.9833 11.1102C14.9756 10.9784 14.9709 10.8784 14.9633 10.7785C14.9603 10.7379 14.9507 10.698 14.9446 10.6577Z' fill='white'/%3E%3Cpath d='M13.4501 9.68457L13.1069 9.98877C13.1259 10.0002 13.1444 10.0122 13.1624 10.0253C13.328 10.146 13.4327 10.3284 13.481 10.5254C13.5055 10.6254 13.5146 10.7294 13.5262 10.8322C13.542 10.973 13.6219 11.0595 13.769 11.0645C13.7797 11.0643 13.7902 11.064 13.7969 11.064C13.8676 11.0561 13.9386 11.0065 13.9613 10.9086C13.975 10.8494 13.9687 10.784 13.9633 10.7221C13.9206 10.2318 13.7353 9.89541 13.4501 9.68457Z' fill='white'/%3E%3C/svg%3E"); } `,Dt="https://widget.yourgood.app/",Ut="https://widget.profeat.team/",Rt=["#open","#whatsapp","#telegram","#viber"],Zt=["whatsapp","telegram","viber"],Nt=["White","Grass"],Qt={telegram:"telegram",tgApi:"tgapi",whatsapp:"whatsapp",wapi:"wapi"};function Gt(t){return t.background.theme.color}function qt(t){return t.background.theme.layoutColor}function Yt(t){return t.whatsappEnabled&&t.telegramEnabled&&!t.viberEnabled?"whatsapp-and-telegram":t.whatsappEnabled&&!t.telegramEnabled&&t.viberEnabled?"whatsapp-and-viber":!t.whatsappEnabled&&t.telegramEnabled&&t.viberEnabled?"telegram-and-viber":!t.whatsappEnabled||t.telegramEnabled||t.viberEnabled?t.whatsappEnabled||!t.telegramEnabled||t.viberEnabled?t.whatsappEnabled||t.telegramEnabled||!t.viberEnabled?t.whatsappEnabled&&t.telegramEnabled&&t.viberEnabled?"whatsapp-and-telegram-and-viber":"":"viber":"telegram":"whatsapp"}function Jt(t,e){if(n()){return Zt.includes(t)&&!e?t:void 0}}const Kt="::$wazzupIdPlaceholder";function Xt(t,e){const i=((t,e,i)=>{let n=i?.telegramGreetingMessage?i.telegramGreetingMessage:t.telegramGreetingMessage;return t.telegramAppendWazzupId&&(n.includes(` ${Kt} `)&&(n=n.replaceAll(Kt,`${e}`)),n=n.replaceAll(Kt,` ${e} `)),s(n)})(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null);return t.telegramUsername.startsWith("https://t.me/")?`${t.telegramUsername}?text=${i}`:t.telegramUsername.toLowerCase().endsWith("bot")?`https://t.me/${encodeURIComponent(t.telegramUsername.replaceAll("@",""))}?start=${e}`:`https://t.me/${encodeURIComponent(t.telegramUsername)}?text=${i}`}const te="::$wazzupIdPlaceholder";function ee(t,e){const i=((t,e,i)=>{let n=i?.whatsappGreetingMessage?i.whatsappGreetingMessage:t.whatsappGreetingMessage;return t.whatsappAppendWazzupId&&(n.includes(` ${te} `)&&(n=n.replaceAll(te,`${e}`)),n=n.replaceAll(te,` ${e} `)),s(n)})(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null);return`https://wa.me/${encodeURIComponent(t.whatsappNumber.replace("+",""))}?text=${encodeURIComponent(i)}`}function ie(t){return t.viberUsername.includes("viber://pa?chatURI=")?`${t.viberUsername}`:`viber://chat?number=${t.viberUsername}`}function ne(t,e,i,r,o,a){const s=n()?`WM${i}`:`WW${i}`;if(a)try{o.fireEvent("WP_click_widget"),c(t.id,{name:"click",wazzupId:s,hid:r}).then((i=>{i&&(o.fireEvent("WP_click_whatsapp"),c(t.id,{name:"whatsapp_click",wazzupId:s,hid:r}),setTimeout((()=>{window.open(ee(t,s,e),"_blank")}),1))}))}catch(t){console.error(t)}else c(t.id,{name:"whatsapp_click",wazzupId:s,hid:r}).then((i=>{i&&(o.fireEvent("WP_click_whatsapp"),setTimeout((()=>{window.open(ee(t,s,e),"_blank")}),1))}))}function re(t,e,i,r,o,a){const s=n()?`WM${i}`:`WW${i}`;if(a)try{o.fireEvent("WP_click_widget"),c(t.id,{name:"click",wazzupId:s,hid:r}).then((i=>{i&&(o.fireEvent("WP_click_telegram"),c(t.id,{name:"telegram_click",wazzupId:s,hid:r}),setTimeout((()=>{window.open(Xt(t,s,e),"_blank")}),1))}))}catch(t){console.error(t)}else c(t.id,{name:"telegram_click",wazzupId:s,hid:r}).then((i=>{i&&(o.fireEvent("WP_click_telegram"),setTimeout((()=>{window.open(Xt(t,s,e),"_blank")}),1))}))}function oe(t,e,i,r,o,a){const s=n()?`WM${i}`:`WW${i}`;if(a)try{o.fireEvent("WP_click_widget"),c(t.id,{name:"click",wazzupId:s,hid:r}).then((e=>{e&&(o.fireEvent("WP_click_viber"),c(t.id,{name:"viber_click",wazzupId:s,hid:r}),setTimeout((()=>{const e=ie(t);console.log("viberLink",e),window.open(e,"_blank")}),1))}))}catch(t){console.error(t)}else c(t.id,{name:"viber_click",wazzupId:s,hid:r}).then((e=>{e&&(o.fireEvent("WP_click_viber"),setTimeout((()=>{const e=ie(t);console.log("viberLink",e),window.open(e,"_blank")}),1))}))}function ae(t){if("White"===t)return rt` `;const e="White"===t||"Grass"===t?"black":"white";return rt` `}function se(t){let e="#2B3238";return t&&(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&(e="White"===t||"Grass"===t?"#2B3238":"#FFFFFF"),rt` `}class le extends Ft{timerIdForAnimation=null;actionBody={id:"default-uuid",widgetSettings:this.widget?.widgetSettings,backgroundImage:{url:null},logoImage:{url:null},isAppearance:!0};static properties=(()=>({_isOpen:{type:Boolean},widget:{type:Object},wazzupId:{type:String},integrationsService:{type:Object},isModal:{type:Boolean},subscription:{type:Object}}))();constructor(){super()}afterTransition(t){t.target.classList.contains("PFHidden")&&(t.target.style.display="none")}open(t){this._isOpen=!0,this.actionBody=t;const e=this.shadowRoot.getElementById("PFModalOverlay"),i=this.shadowRoot.getElementById("PFModal");clearTimeout(this.timerIdForAnimation),e.addEventListener("transitionend",this.afterTransition,!0),e.addEventListener("webkitTransitionEnd",this.afterTransition,!0),i.classList.remove("PFModalAnimateOut"),i.classList.add("PFModalAnimateIn","PFAnimated"),e.classList.remove("PFHidden"),e.style.display="flex",this.timerIdForAnimation=setTimeout((()=>{e.style.opacity=1,i.classList.remove("PFAnimated")}),100)}close(){this._isOpen=!1,this.integrationsService.fireEvent("WP_modal_close"),this.dispatchEvent(new CustomEvent("close"));const t=this.shadowRoot.getElementById("PFModalOverlay"),e=this.shadowRoot.getElementById("PFModal");e.classList.remove("PFModalAnimateIn"),e.classList.add("PFModalAnimateOut","PFAnimated"),t.classList.add("PFHidden"),this.timerIdForAnimation=setTimeout((()=>{t.style.opacity=0,e.classList.remove("PFAnimated")}),100)}QrCodeSection(t){const e="Black"===t,i=Yt(this.widget),n=navigator.language||navigator.userLanguage,r=/ru/i.test(n)?"Напишите с телефона":"Write from your phone",o=rt`
`,s=rt`
`,l=rt`
`,c=rt` `;let d=function(t,e){const i=new URL("https://widget.yourgood.app");return i.pathname="/api/qr/generate",i.searchParams.append("url",t),i.searchParams.append("type",e),i.toString()}((u=this.wazzupId,p=this.widget.id,`https://widget.yourgood.app/bridge?wid=${u}&sid=${p}`),i);var u,p;return rt`
${St(!0,(()=>rt`
${St("whatsapp-and-telegram"===i,(()=>[o,s]),(()=>St("whatsapp-and-viber"===i,(()=>[o,l]),(()=>St("telegram-and-viber"===i,(()=>[s,l]),(()=>St("whatsapp-and-telegram-and-viber"===i,(()=>[o,s,l]),(()=>c))))))))}
${St(e,(()=>rt`
${r}
`),(()=>rt`
${r}
`))}
`),(()=>at))}
`}cButtonClose(){return rt` `}BackgroundImageSection(){const{widgetSettings:{backgroundImageEnabled:t},backgroundImage:e}=this.widget;return t?rt`
`:""}logoFileSection(){const{widgetSettings:{logoEnabled:t},logoImage:e}=this.widget;return t?rt` `:""}defaultLogo(){return rt` `}cFooter(){const{widgetSettings:t}=this.widget;return rt` `}render(){const{backgroundImage:t,logoImage:e,widgetSettings:i,isAppearance:n}=this.widget,r=Nt.includes(i.background.theme.name),o=!1===i.branding,s=new DOMParser,l=i.textSettings.header,c=i.textSettings.text,d=s.parseFromString(l,"text/html"),u=s.parseFromString(c,"text/html");return rt`
${this.cButtonClose()} ${St(t&&i.backgroundImageEnabled,(()=>this.BackgroundImageSection()),(()=>at))}
${St(e&&i.logoEnabled,(()=>this.logoFileSection()),(()=>St(!e&&i.logoEnabled,(()=>this.defaultLogo()),(()=>at))))} ${St(!e&&!t,(()=>rt`
`),(()=>at))}
${St(r,(()=>rt`
${d.body}
${u.body}
`),(()=>rt`
${d.body}
${u.body}
`))}
${this.QrCodeSection(i.background.theme.name)}
${St(o,(()=>this.cFooter()),(()=>at))}
`}handleWhatsappOpenClick(){ne(this.widget,this.actionBody,this.wazzupId,this.hid,this.integrationsService)}handleTelegramOpenClick(){re(this.widget,this.actionBody,this.wazzupId,this.hid,this.integrationsService)}handleViberOpenClick(){oe(this.widget,this.actionBody,this.wazzupId,this.hid,this.integrationsService)}static styles=(()=>M` ${Vt} ${jt} .PFModalOverlay { --pf-modal-scale: 1; --common-black: #2b3238; --common-rain: #D0DBE4; --primary: #212121; --common-dark: #1B1B1B; all: unset; position: fixed; left: 0; box-sizing: border-box; z-index: 9999; top: 0; bottom: 0; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: center; background-color: rgba(0, 0, 0, 0.23); opacity: 0; transition: 0.6s cubic-bezier(0.175, 0.885, 0.32, 1) opacity; display: none; } .PFModal { all: unset; position: relative; display: flex; width: 100%; box-shadow: 0 10px 20px 1px rgba(33, 33, 33, 0.04); border-radius: calc(16px * var(--pf-modal-scale)); overflow: hidden; flex-direction: column; min-width: calc(480px * var(--pf-modal-scale)); max-width: calc(480px * var(--pf-modal-scale)); } .PFModal.PFModalBgLeft, .PFModal.PFModalBgRight { max-width: calc(708px * var(--pf-modal-scale)); } .PFModal.PFModalBgRight { flex-direction: row-reverse; } .PFModalBgLeft { flex-direction: row; } .PFModal.PFModalBgLeft .PFModalBackground, .PFModal.PFModalBgRight .PFModalBackground { width: calc(228px * var(--pf-modal-scale)); height: 100%; } .PFModal.PFModalBgTop .PFModalBackground { width: calc(480px * var(--pf-modal-scale)); height: calc(164px * var(--pf-modal-scale)); } .PFModal.PFModalBgTop .PFModalBackground .PFModalHeader { min-width: 302px; } .PFModal.PFModalBgTop { flex-direction: column; max-width: calc(480px * var(--pf-modal-scale)); } .PFModal.PFModalWithoutBg { max-width: calc(518px * var(--pf-modal-scale)) !important; height: auto !important; } .PFModal.PFModalWithoutBg .PFModalHeader{ padding-top: 24px; } .PFModal.PFModalWithoutBg .PFModalHeader:has(.PFModalHeaderLogo) { padding-top: 0px; } .PFModalButtonClose { --s: calc(36px * var(--pf-modal-scale)); all: unset; position: absolute; z-index: 2; display: flex; top: calc(10px * var(--pf-modal-scale)); right: calc(10px * var(--pf-modal-scale)); align-items: center; justify-content: center; width: var(--s); height: var(--s); border-radius: 50%; cursor: pointer; background-color: white } .PFModalButtonCloseIcon { --s: calc(20px * var(--pf-modal-scale)); all: unset; width: var(--s); height: var(--s); padding: calc(8px * var(--pf-modal-scale)); background-color: var(--white); border-radius: 100px; } .PFModalBody { all: unset; position: relative; box-sizing: border-box; padding: calc(24px * var(--pf-modal-scale)) calc(24px * var(--pf-modal-scale)) calc(16px * var(--pf-modal-scale)) calc(24px * var(--pf-modal-scale)); width: 100%; display: flex; flex-direction: column; justify-content: center; gap: calc(24px * var(--pf-modal-scale)); } .PFModalFooter { all: unset; align-items: center; // padding-bottom: calc(16px * var(--pf-modal-scale)); display: flex; justify-content: center; text-align: center; color: inherit; gap: calc(10px * var(--pf-modal-scale)); width: 100%; height: calc(24px * var(--pf-modal-scale)); & svg { width: calc(137px * var(--pf-modal-scale)); height: calc(24px * var(--pf-modal-scale)); } } .PFModalFooter a { color: inherit; cursor: pointer; text-decoration: none; } .PFModalHeader { all: unset; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; } .PFModalHeaderLogo { all: unset; box-sizing: border-box; display: flex; height: calc(56px * var(--pf-modal-scale)); width: calc(100 * var(--pf-modal-scale)); overflow: hidden; } .PFModalHeaderLogoImage { all: unset; object-fit: cover; width: 100%; height: 100%; } .PFModalHeaderLogoImageDefault { display: flex; max-height: 56px; padding: 0px 12px; justify-content: center; align-items: center; justify-content: center; align-items: center; border-radius: 8px; border: 1px dashed var(--common-rain); background: white; color: var(--common-dark); text-align: center; font-family: 'Inter', sans-serif; font-size: 12px; font-style: normal; font-weight: 600; line-height: 16px; } .PFModalHeaderTitle { text-align: center; word-wrap: anywhere !important; white-space: pre-line; font-family: 'Inter', sans-serif; font-size: calc(22px * var(--pf-modal-scale)); font-style: normal; width: 100%; font-weight: 600; line-height: calc(32px * var(--pf-modal-scale)); /* 145.455% */ letter-spacing: calc(-0.22px * var(--pf-modal-scale)); & p { color: inherit !important; background-color: transparent !important; & span, & strong, & em, & u { color: inherit !important; background-color: transparent !important; } } body { color: white; } } .PFModalHeaderTitleDark { text-align: center; word-wrap: anywhere !important; white-space: pre-line; font-family: 'Inter', sans-serif; font-size: calc(22px * var(--pf-modal-scale)); font-style: normal; width: 100%; font-weight: 600; line-height: calc(32px * var(--pf-modal-scale)); /* 145.455% */ letter-spacing: calc(-0.22px * var(--pf-modal-scale)); & p { color: inherit !important; background-color: transparent !important; & span, & strong, & em, & u { color: inherit !important; background-color: transparent !important; } } body { margin: 0; color: var(--common-black); } } .PFModalHeaderTextContent { display: flex; width: calc(384px * var(--pf-modal-scale)); flex-direction: column; gap: calc(12px * var(--pf-modal-scale)); align-items: center; padding-top: 4px; } .PFModalHeaderText { display: flex; flex-wrap: wrap; color: var(--primary); word-wrap: anywhere !important; text-align: center; font-family: 'Inter', sans-serif; font-size: calc(14px * var(--pf-modal-scale)); font-style: normal; font-weight: 400; justify-content: center; width: 100%; line-height: calc(20px * var(--pf-modal-scale)); body { margin: 0; color: white; } } .PFModalHeaderTextDark { display: flex; flex-wrap: wrap; color: var(--primary); word-wrap: anywhere !important; text-align: center; font-family: 'Inter', sans-serif; font-size: calc(14px * var(--pf-modal-scale)); font-style: normal; font-weight: 400; justify-content: center; width: 100%; line-height: calc(20px * var(--pf-modal-scale)); body { margin: 0; } color: var(--common-black) } .PFModalBackground { all: unset; display: flex; flex-shrink: 0; overflow: hidden; width: 100%; height: calc(240px * var(--pf-modal-scale)); } .PFModalBackgroundImage { all: unset; object-fit: cover; width: 100%; height: 100%; } .PFModalButton { all: unset; box-sizing: border-box; padding: calc(12px * var(--pf-modal-scale)) calc(16px * var(--pf-modal-scale)); display: flex; justify-content: center; align-items: center; gap: calc(8px * var(--pf-modal-scale)); width: 100%; cursor: pointer; background-color: var(--pf-grey-200); border-radius: calc(8px * var(--pf-modal-scale)); max-height: calc(48px * var(--pf-modal-scale)); color: var(--pf-white); user-select: none; font-family: 'Inter', sans-serif !important; font-style: normal; font-weight: 400; font-size: calc(14px * var(--pf-modal-scale)); line-height: calc(20px * var(--pf-modal-scale)); letter-spacing: calc(0.17px * var(--pf-modal-scale)); box-shadow: 0 1px 5px rgba(89, 104, 143, 0.06); text-align: center; width: 236px; white-space: nowrap; overflow: hidden; } .PFModalButton.PFModalButtonWhatsapp { background-color: var(--pf-modal-whatsapp-color); } .PFModalButton.PFModalButtonWhatsapp:hover { background-color: #52b85c; } .PFModalButton.PFModalButtonWhatsapp:active { background-color: #469c4e; } .PFModalButton.PFModalButtonTelegram { background-color: var(--pf-modal-telegram-color); } .PFModalButton.PFModalButtonTelegram:hover { background-color: #228cc6; } .PFModalButton.PFModalButtonTelegram:active { background-color: #1b719f; } .PFModalButton.PFModalButtonViber { background-color: var(--pf-modal-viber-color); } .PFModalButton.PFModalButtonViber:hover { background-color: #8074D6; } .PFModalButton.PFModalButtonViber:active { background-color: #655cac; } .PFModalButtonIcon { --s: calc(28px * var(--pf-modal-scale)); all: unset; box-sizing: border-box; width: var(--s); height: var(--s); mask: var(--icon); -webkit-mask: var(--icon); mask-size: 100% 100%; -webkit-mask-size: 100% 100%; background-color: currentColor; flex-shrink: 0; } .PFQrActionsContainer { width: auto; background: var(--background); display: flex; flex-direction: row; justify-content: center; align-items: center; border-radius: 16px; gap: calc(20px * var(--pf-modal-scale)); padding: calc(20px * var(--pf-modal-scale)); } .PFActionsContainerWithoutQr { display: block !important; } .PFQrActions { width: 100%; } .PFQrScan { display: flex; flex-direction: column; align-items: center; height: 100%; gap: calc(8px * var(--pf-modal-scale)); } .PFQrScanText { height: 42px; color: #212121; text-align: center; font-feature-settings: 'clig' off, 'liga' off; font-family: Roboto, sans-serif; font-size: 14px; font-style: normal; font-weight: 400; line-height: 143%; letter-spacing: 0.17px; margin: 0; margin-bottom: 12px; } .PFQrActionsContainer.dark .PFQrScanText{ color: #fff; } .PFQrScanImage { width: calc(136px * var(--pf-modal-scale)); height: calc(136px * var(--pf-modal-scale)); border-radius: calc(16px * var(--pf-modal-scale)); overflow: hidden; } .PFQrTextContainer { width: 100%; display: flex; flex-direction: row; grid-gap: calc(12px * var(--pf-modal-scale)); align-items: center; justify-content: center; } .PFQrText { color: var(--common-black); text-align: center; font-family: 'Inter', sans-serif; font-size: calc(10px * var(--pf-modal-scale)); font-style: normal; font-weight: 400; line-height: calc(14px * var(--pf-modal-scale)); } .PFQrTextDark { color: white; text-align: center; font-family: 'Inter', sans-serif; font-size: calc(10px * var(--pf-modal-scale)); font-style: normal; font-weight: 400; line-height: calc(14px * var(--pf-modal-scale)); } .PFQrActionsTitleContainer { height: 42px; display: flex; justify-content: center; align-items: center; margin-bottom: 12px; } .PFQrActionsTitleContainerWithoutQr { all: unset; display: block; margin-bottom: 18px; } .PFQrActionsTitle { width: 100%; margin: 0; text-align: center; color: #212121; font-feature-settings: 'clig' off, 'liga' off; font-family: Roboto, sans-serif; font-size: 14px; font-style: normal; font-weight: 400; line-height: 143%; letter-spacing: 0.17px; } .PFQrActionsContainer.dark .PFQrActionsTitle{ color: #fff; } .PFButtonsContainer { width: 100%; display: grid; grid-template-columns: 1fr; grid-gap: 16px; } .PFModalDualCardItem { all: unset; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: calc(24px * var(--pf-modal-scale)); background-color: transparent; border-width: 0; box-sizing: border-box; padding-top: calc(16px * var(--pf-modal-scale)); padding-left: calc(16px * var(--pf-modal-scale)); padding-right: calc(16px * var(--pf-modal-scale)); } .PFModalDualCardItemButtonFooter { all: unset; width: 100%; display: flex; box-sizing: border-box; } .PFModalDualCardItemButton { all: unset; width: 100%; display: flex; flex-direction: column; align-items: center; gap: calc(16px * var(--pf-modal-scale)); } .PFModalAnimateIn { transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1); transform: translate3d(0, 0, 0); } .PFModalAnimateIn.PFAnimated { transform: translate3d(0, 100%, 0); } .PFModalAnimateOut { transition: transform 0.27s cubic-bezier(0.175, 0.885, 0.32, 1); transform: translate3d(0, 100%, 0); } `)()}customElements.get("pf-modal")||customElements.define("pf-modal",le),customElements.get("pf-default")||customElements.define("pf-default",class extends le{});class ce extends Ft{constructor(){super()}afterTransition(t){t.target.classList.contains("PFHidden")&&(t.target.style.display="none")}open(t){this._isOpen=!0,this.actionBody=t;const e=this.shadowRoot.getElementById("PFModalOverlay"),i=this.shadowRoot.getElementById("PFModal");clearTimeout(this.timerIdForAnimation),e.addEventListener("transitionend",this.afterTransition,!0),e.addEventListener("webkitTransitionEnd",this.afterTransition,!0),i.classList.remove("PFModalAnimateOut"),i.classList.add("PFModalAnimateIn","PFAnimated"),e.classList.remove("PFHidden"),e.style.display="flex",this.timerIdForAnimation=setTimeout((()=>{e.style.opacity=1,i.classList.remove("PFAnimated")}),100)}close(){this._isOpen=!1,this.integrationsService.fireEvent("WP_modal_close"),this.dispatchEvent(new CustomEvent("close"));const t=this.shadowRoot.getElementById("PFModalOverlay"),e=this.shadowRoot.getElementById("PFModal");e.classList.remove("PFModalAnimateIn"),e.classList.add("PFModalAnimateOut","PFAnimated"),t.classList.add("PFHidden"),this.timerIdForAnimation=setTimeout((()=>{t.style.opacity=0,e.classList.remove("PFAnimated")}),100)}isSubscriptionExpired(){if(!this.subscription)return!0;if(!this.subscription.subscriptionPlan)return!0;return new Date(this.subscription.subscriptionPlan.dueDate).getTime() ${se(t,!0)} `}buttonsSection(){const t=Yt(this.widget),e=rt`
`,i=rt`
`,n=rt`
`,r=rt` `;return rt`
${St("whatsapp-and-telegram"===t,(()=>[e,i]),(()=>St("whatsapp-and-viber"===t,(()=>[e,n]),(()=>St("telegram-and-viber"===t,(()=>[i,n]),(()=>St("whatsapp-and-telegram-and-viber"===t,(()=>[e,i,n]),(()=>r))))))))}
`}cFooter(){const{widgetSettings:t}=this.widget;return rt` `}logoFileSection(){const{widgetSettings:{logoEnabled:t},logoImage:e}=this.widget;return t?rt` `:""}defaultLogo(){return rt` `}render(){const{logoImage:t,widgetSettings:e}=this.widget,i=e.background.theme.name,n=Nt.includes(i),r=!1===e.branding,o=new DOMParser,a=e.textSettings.header,s=e.textSettings.text,l=o.parseFromString(a,"text/html"),c=o.parseFromString(s,"text/html");return rt`
${this.cButtonClose(i)}
${St(t&&e.logoEnabled,(()=>this.logoFileSection()),(()=>St(!t&&e.logoEnabled,(()=>this.defaultLogo()),(()=>at))))}
${St(n,(()=>rt`
${l.body}
${c.body}
`),(()=>rt`
${l.body}
${c.body}
`))}
${this.buttonsSection()} ${St(r,(()=>this.cFooter()),(()=>at))}
`}static styles=(()=>M` ${Vt} ${jt} .PFModalOverlay { --pf-modal-scale: 1; --common-black: #2b3238; --common-rain: #D0DBE4; --primary: #212121; --common-dark: #1B1B1B; all: unset; position: fixed; left: 0; box-sizing: border-box; z-index: 21474836472; top: 0; bottom: 0; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: center; background-color: rgba(0, 0, 0, 0.23); opacity: 0; transition: 0.6s cubic-bezier(0.175, 0.885, 0.32, 1) opacity; display: none; } .PFModal { all: unset; position: relative; display: flex; justify-content: center; height: 100vh; width: inherit; flex-direction: column; } .PFModalButtonClose { --s: calc(36px * var(--pf-modal-scale)); all: unset; position: absolute; z-index: 2; display: flex; top: calc(10px * var(--pf-modal-scale)); right: calc(10px * var(--pf-modal-scale)); align-items: center; justify-content: center; width: var(--s); height: var(--s); border-radius: 50%; cursor: pointer; } .PFModalButtonCloseIcon { --s: calc(20px * var(--pf-modal-scale)); width: var(--s); height: var(--s); padding: calc(8px * var(--pf-modal-scale)); border-radius: 100px; } .PFModalBody { all: unset; position: relative; box-sizing: border-box; width: 328px; z-index: 9999; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(24px * var(--pf-modal-scale)); } .PFModalFooter { all: unset; position: fixed; display: flex; padding: 24px 0pc 32px 0px; flex-direction: column; justify-content: center; align-items: center; gap: 10px; align-self: stretch; bottom: 0; left: 50%; width: 100%; transform: translateX(-50%); & svg { width: calc(137px * var(--pf-modal-scale)); height: calc(24px * var(--pf-modal-scale)); } } .PFModalFooter a { color: inherit; cursor: pointer; text-decoration: none; } .PFModalHeader { all: unset; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; } .PFModalHeaderLogo { all: unset; box-sizing: border-box; display: flex; height: calc(56px * var(--pf-modal-scale)); width: calc(100px * var(--pf-modal-scale)); overflow: hidden; align-items: center; justify-content: center; padding: 3px; } .PFModalHeaderLogoImage { all: unset; object-fit: cover; width: 100%; height: 100%; } .PFModalHeaderLogoImageDefault { display: flex; height: 56px; padding: 0px 12px; justify-content: center; align-items: center; justify-content: center; align-items: center; border-radius: 8px; border: 1px dashed var(--common-rain); background: white; color: var(--common-dark); text-align: center; font-family: 'Inter', sans-serif; font-size: 12px; font-style: normal; font-weight: 600; line-height: 16px; } .PFModalHeaderTitle { text-align: center; word-wrap: anywhere !important; white-space: pre-line; font-family: 'Inter', sans-serif; font-size: calc(18px * var(--pf-modal-scale)); font-style: normal; width: 100%; font-weight: 600; line-height: 28px; letter-spacing: -0.18px; & p { color: inherit !important; background-color: transparent !important; & span, & strong, & em, & u { color: inherit !important; background-color: transparent !important; } } body { color: white; } } .PFModalHeaderTitleDark { text-align: center; word-wrap: anywhere !important; white-space: pre-line; font-family: 'Inter', sans-serif; font-size: calc(18px * var(--pf-modal-scale)); font-style: normal; width: 100%; font-weight: 600; line-height: 28px; letter-spacing: -0.18px; & p { color: inherit !important; background-color: transparent !important; & span, & strong, & em, & u { color: inherit !important; background-color: transparent !important; } } body { color: var(--common-black); } } .PFModalHeaderTextContent { display: flex; width: calc(328px * var(--pf-modal-scale)); flex-direction: column; gap: calc(12px * var(--pf-modal-scale)); align-items: center; padding-top: 4px; } .PFModalHeaderText { display: flex; flex-wrap: wrap; color: var(--primary); word-wrap: anywhere !important; text-align: center; font-family: 'Inter', sans-serif; font-size: calc(14px * var(--pf-modal-scale)); font-style: normal; font-weight: 400; justify-content: center; width: 100%; line-height: calc(20px * var(--pf-modal-scale)); body { margin: 0; color: white; } } .PFModalHeaderTextDark { display: flex; flex-wrap: wrap; color: var(--primary); word-wrap: anywhere !important; text-align: center; font-family: 'Inter', sans-serif; font-size: calc(14px * var(--pf-modal-scale)); font-style: normal; font-weight: 400; justify-content: center; width: 100%; line-height: calc(20px * var(--pf-modal-scale)); body { margin: 0; } color: var(--common-black) } .PFModalButton { all: unset; box-sizing: border-box; padding: calc(12px * var(--pf-modal-scale)) calc(16px * var(--pf-modal-scale)); display: flex; justify-content: center; align-items: center; gap: calc(8px * var(--pf-modal-scale)); width: 100%; cursor: pointer; background-color: var(--pf-grey-200); border-radius: calc(8px * var(--pf-modal-scale)); max-height: calc(48px * var(--pf-modal-scale)); color: var(--pf-white); user-select: none; font-family: 'Inter', sans-serif !important; font-style: normal; font-weight: 400; font-size: calc(14px * var(--pf-modal-scale)); line-height: calc(20px * var(--pf-modal-scale)); letter-spacing: calc(0.17px * var(--pf-modal-scale)); box-shadow: 0 1px 5px rgba(89, 104, 143, 0.06); text-align: center; width: 296px; white-space: nowrap; overflow: hidden; } .PFModalButton.PFModalButtonWhatsapp { background-color: var(--pf-modal-whatsapp-color); } .PFModalButton.PFModalButtonWhatsapp:hover { background-color: #52b85c; } .PFModalButton.PFModalButtonWhatsapp:active { background-color: #469c4e; } .PFModalButton.PFModalButtonTelegram { background-color: var(--pf-modal-telegram-color); } .PFModalButton.PFModalButtonTelegram:hover { background-color: #228cc6; } .PFModalButton.PFModalButtonTelegram:active { background-color: #1b719f; } .PFModalButton.PFModalButtonViber { background-color: var(--pf-modal-viber-color); } .PFModalButton.PFModalButtonViber:hover { background-color: #8074D6; } .PFModalButton.PFModalButtonViber:active { background-color: #655cac; } .PFModalButtonIcon { --s: calc(28px * var(--pf-modal-scale)); all: unset; box-sizing: border-box; width: var(--s); height: var(--s); mask: var(--icon); -webkit-mask: var(--icon); mask-size: 100% 100%; -webkit-mask-size: 100% 100%; background-color: currentColor; flex-shrink: 0; } .PFButtons { display: flex; flex-direction: row; justify-content: center; align-items: center; border-radius: 16px; max-width: 328px; padding: calc(16px * var(--pf-modal-scale)); } .PFButtonsContainer { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; } .PFModalDualCardItem { all: unset; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: calc(24px * var(--pf-modal-scale)); background-color: transparent; border-width: 0; box-sizing: border-box; padding-top: calc(16px * var(--pf-modal-scale)); padding-left: calc(16px * var(--pf-modal-scale)); padding-right: calc(16px * var(--pf-modal-scale)); } .PFModalDualCardItemButtonFooter { all: unset; width: 100%; display: flex; box-sizing: border-box; } .PFModalDualCardItemButton { all: unset; width: 100%; display: flex; flex-direction: column; align-items: center; gap: calc(16px * var(--pf-modal-scale)); } .PFModalAnimateIn { transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1); transform: translate3d(0, 0, 0); } .PFModalAnimateIn.PFAnimated { transform: translate3d(0, 100%, 0); } .PFModalAnimateOut { transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1); transform: translate3d(0, 100%, 0); } `)()}customElements.get("pf-modal-mobile")||customElements.define("pf-modal-mobile",ce);class de extends Ft{constructor(){super()}afterTransition(t){t.target.classList.contains("PFHidden")&&(t.target.style.display="none")}open(t){this._isOpen=!0,this.actionBody=t;const e=this.shadowRoot.getElementById("PFModalOverlay"),i=this.shadowRoot.getElementById("PFModal");clearTimeout(this.timerIdForAnimation),e.addEventListener("transitionend",this.afterTransition,!0),e.addEventListener("webkitTransitionEnd",this.afterTransition,!0),i.classList.remove("PFModalAnimateOut"),i.classList.add("PFModalAnimateIn","PFAnimated"),e.classList.remove("PFHidden"),e.style.display="flex",this.timerIdForAnimation=setTimeout((()=>{e.style.opacity=1,i.classList.remove("PFAnimated")}),100)}close(){this._isOpen=!1,this.integrationsService.fireEvent("WP_modal_close"),this.dispatchEvent(new CustomEvent("close"));const t=this.shadowRoot.getElementById("PFModalOverlay"),e=this.shadowRoot.getElementById("PFModal");e.classList.remove("PFModalAnimateIn"),e.classList.add("PFModalAnimateOut","PFAnimated"),t.classList.add("PFHidden"),this.timerIdForAnimation=setTimeout((()=>{t.style.opacity=0,e.classList.remove("PFAnimated")}),100)}isSubscriptionExpired(){if(!this.subscription)return!0;if(!this.subscription.subscriptionPlan)return!0;return new Date(this.subscription.subscriptionPlan.dueDate).getTime() ${se(t,!0)} `}buttonsSection(){const t=Yt(this.widget),e=rt`
`,i=rt`
`,n=rt`
`,r=rt` `;return rt`
${St("whatsapp-and-telegram"===t,(()=>[e,i]),(()=>St("whatsapp-and-viber"===t,(()=>[e,n]),(()=>St("telegram-and-viber"===t,(()=>[i,n]),(()=>St("whatsapp-and-telegram-and-viber"===t,(()=>[e,i,n]),(()=>r))))))))}
`}cFooter(){const{widgetSettings:t}=this.widget;return rt` `}logoFileSection(){const{widgetSettings:{logoEnabled:t},logoImage:e}=this.widget;return t?rt` `:""}defaultLogo(){return rt` `}render(){const{logoImage:t,widgetSettings:e}=this.widget,i=e.background.theme.name,n=Nt.includes(i),r=!1===e.branding,o=new DOMParser,a=e.textSettings.header,s=e.textSettings.text,l=o.parseFromString(a,"text/html"),c=o.parseFromString(s,"text/html");return rt`
${this.cButtonClose(i)}
${St(t&&e.logoEnabled,(()=>this.logoFileSection()),(()=>St(!t&&e.logoEnabled,(()=>this.defaultLogo()),(()=>at))))}
${St(n,(()=>rt`
${l.body}
${c.body}
`),(()=>rt`
${l.body}
${c.body}
`))}
${this.buttonsSection()}
${St(r,(()=>this.cFooter()),(()=>rt`
`))}
`}static styles=(()=>M` ${Vt} ${jt} .PFModalOverlay { --pf-modal-scale: 1; --common-black: #2b3238; --common-rain: #D0DBE4; --primary: #212121; --common-dark: #1B1B1B; all: unset; position: fixed; left: 0; box-sizing: border-box; z-index: 21474836461; top: 0; bottom: 0; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: flex-end; background-color: rgba(0, 0, 0, 0.23); opacity: 0; transition: 0.6s cubic-bezier(0.175, 0.885, 0.32, 1) opacity; display: none; } .PFModal { all: unset; position: relative; display: flex; justify-content: flex-end; height: auto; width: inherit; flex-direction: column; gap: 40px; border-radius: 16px 16px 0px 0px; } .PFModalButtonClose { --s: calc(20px * var(--pf-modal-scale)); all: unset; position: absolute; z-index: 2; display: flex; top: calc(16px * var(--pf-modal-scale)); right: calc(16px * var(--pf-modal-scale)); align-items: center; justify-content: center; width: var(--s); height: var(--s); border-radius: 50%; cursor: pointer; } .PFModalButtonCloseIcon { --s: calc(20px * var(--pf-modal-scale)); width: var(--s); height: var(--s); padding: calc(8px * var(--pf-modal-scale)); border-radius: 100px; } .PFModalBody { all: unset; position: relative; box-sizing: border-box; width: 328px; z-index: 9999; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(40px * var(--pf-modal-scale)); margin-top: 40px; } .PFModalFooter { all: unset; position: relative; display: flex; padding: 24px 0px 32px 0px; flex-direction: column; justify-content: center; align-items: center; gap: 10px; align-self: stretch; bottom: 0; left: 50%; width: 100%; transform: translateX(-50%); & svg { width: calc(137px * var(--pf-modal-scale)); height: calc(24px * var(--pf-modal-scale)); } } .PFModalFooter a { color: inherit; cursor: pointer; text-decoration: none; } .PFModalHeader { all: unset; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; margin-top: 40px; text-align: center; } .PFModalHeaderLogo { all: unset; box-sizing: border-box; display: flex; height: calc(56px * var(--pf-modal-scale)); width: calc(100px * var(--pf-modal-scale)); overflow: hidden; align-items: center; justify-content: center; padding: 3px; } .PFModalHeaderLogoImage { all: unset; object-fit: cover; width: 100%; height: 100%; } .PFModalHeaderLogoImageDefault { display: flex; height: 56px; padding: 0px 12px; justify-content: center; align-items: center; justify-content: center; align-items: center; border-radius: 8px; border: 1px dashed var(--common-rain); background: white; color: var(--common-dark); text-align: center; font-family: 'Inter', sans-serif; font-size: 12px; font-style: normal; font-weight: 600; line-height: 16px; } .PFModalHeaderTitle { text-align: center; word-wrap: anywhere !important; white-space: pre-line; font-family: 'Inter', sans-serif; font-size: calc(18px * var(--pf-modal-scale)); font-style: normal; width: 100%; font-weight: 600; line-height: 28px; letter-spacing: -0.18px; & p { color: inherit !important; background-color: transparent !important; & span, & strong, & em, & u { color: inherit !important; background-color: transparent !important; } } body { color: white; } } .PFModalHeaderTitleDark { text-align: center; word-wrap: anywhere !important; white-space: pre-line; font-family: 'Inter', sans-serif; font-size: calc(18px * var(--pf-modal-scale)); font-style: normal; width: 100%; font-weight: 600; line-height: 28px; letter-spacing: -0.18px; & p { color: inherit !important; background-color: transparent !important; & span, & strong, & em, & u { color: inherit !important; background-color: transparent !important; } } body { margin: 0; color: var(--common-black); } } .PFModalHeaderTextContent { display: flex; width: calc(328px * var(--pf-modal-scale)); flex-direction: column; gap: calc(12px * var(--pf-modal-scale)); align-items: center; } .PFModalHeaderText { display: flex; flex-wrap: wrap; color: var(--primary); word-wrap: anywhere !important; text-align: center; font-family: 'Inter', sans-serif; font-size: calc(14px * var(--pf-modal-scale)); font-style: normal; font-weight: 400; justify-content: center; width: 100%; line-height: calc(20px * var(--pf-modal-scale)); body { margin: 0; color: white; } } .PFModalHeaderTextDark { display: flex; flex-wrap: wrap; color: var(--primary); word-wrap: anywhere !important; text-align: center; font-family: 'Inter', sans-serif; font-size: calc(14px * var(--pf-modal-scale)); font-style: normal; font-weight: 400; justify-content: center; width: 100%; line-height: calc(20px * var(--pf-modal-scale)); body { margin: 0; } color: var(--common-black) } .PFModalButton { all: unset; box-sizing: border-box; padding: calc(12px * var(--pf-modal-scale)) calc(16px * var(--pf-modal-scale)); display: flex; justify-content: center; align-items: center; gap: calc(8px * var(--pf-modal-scale)); width: 100%; cursor: pointer; background-color: var(--pf-grey-200); border-radius: calc(8px * var(--pf-modal-scale)); max-height: calc(48px * var(--pf-modal-scale)); color: var(--pf-white); user-select: none; font-family: 'Inter', sans-serif !important; font-style: normal; font-weight: 400; font-size: calc(14px * var(--pf-modal-scale)); line-height: calc(20px * var(--pf-modal-scale)); letter-spacing: calc(0.17px * var(--pf-modal-scale)); box-shadow: 0 1px 5px rgba(89, 104, 143, 0.06); text-align: center; width: 296px; white-space: nowrap; overflow: hidden; } .PFModalButton.PFModalButtonWhatsapp { background-color: var(--pf-modal-whatsapp-color); } .PFModalButton.PFModalButtonWhatsapp:hover { background-color: #52b85c; } .PFModalButton.PFModalButtonWhatsapp:active { background-color: #469c4e; } .PFModalButton.PFModalButtonTelegram { background-color: var(--pf-modal-telegram-color); } .PFModalButton.PFModalButtonTelegram:hover { background-color: #228cc6; } .PFModalButton.PFModalButtonTelegram:active { background-color: #1b719f; } .PFModalButton.PFModalButtonViber { background-color: var(--pf-modal-viber-color); } .PFModalButton.PFModalButtonViber:hover { background-color: #8074D6; } .PFModalButton.PFModalButtonViber:active { background-color: #655cac; } .PFModalButtonIcon { --s: calc(28px * var(--pf-modal-scale)); all: unset; box-sizing: border-box; width: var(--s); height: var(--s); mask: var(--icon); -webkit-mask: var(--icon); mask-size: 100% 100%; -webkit-mask-size: 100% 100%; background-color: currentColor; flex-shrink: 0; } .PFButtons { display: flex; flex-direction: row; justify-content: center; align-items: center; border-radius: 16px; max-width: 328px; padding: calc(16px * var(--pf-modal-scale)); } .PFButtonsContainer { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; } .PFModalDualCardItem { all: unset; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: calc(24px * var(--pf-modal-scale)); background-color: transparent; border-width: 0; box-sizing: border-box; padding-top: calc(16px * var(--pf-modal-scale)); padding-left: calc(16px * var(--pf-modal-scale)); padding-right: calc(16px * var(--pf-modal-scale)); } .PFModalDualCardItemButtonFooter { all: unset; width: 100%; display: flex; box-sizing: border-box; } .PFModalDualCardItemButton { all: unset; width: 100%; display: flex; flex-direction: column; align-items: center; gap: calc(16px * var(--pf-modal-scale)); } .PFModalAnimateIn { transition: transform 0.3s ease-out; transform: translate3d(0, 0, 0); } .PFModalAnimateIn.PFAnimated { transform: translate3d(0, 100%, 0); } .PFModalAnimateOut { transition: transform 0.3s ease-out; transform: translate3d(0, 100%, 0); } `)()}customElements.get("pf-modal-mobile-action")||customElements.define("pf-modal-mobile-action",de);const ue=new Map;ue.set("default","pf-default"),ue.set("message","pf-message"),ue.set("chat","pf-chat"),ue.set("modal","pf-modal"),ue.set("mobile","pf-modal-mobile");class pe extends Ft{static properties=(()=>({widget:{type:Object},wazzupId:{type:String},hid:{type:String},integrationsService:{type:Object},subscription:{type:Object},anyActionPassed$:{type:Object},modalStateChange$:{type:Object},tests:{type:Object}}))();constructor(){super()}getBodyForDefaultModal(){const{widgetSettings:t}=this.widget,e=this.widget.whatsappGreetingMessage;return{redirect:Yt(this.widget),backgroundPosition:"left",text:t.textSettings.header,whatsappButtonText:t.whatsappBtn,telegramButtonText:t.telegramBtn,viberButtonText:t.viberBtn,background:t.background.theme.color,branding:t.branding,whatsappGreetingMessage:e,backgroundImage:this.widget.backgroundImage,logoImage:this.widget.logoImage,whatsappEnabled:this.widget.whatsappEnabled,telegramEnabled:this.widget.telegramEnabled,viberEnabled:this.widget.viberEnabled}}isSubscriptionExpired(){if(!this.subscription)return!0;if(!this.subscription.subscriptionPlan)return!0;return new Date(this.subscription.subscriptionPlan.dueDate).getTime()0&&void 0!==arguments[0]?arguments[0]:"pf-default",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=this.shadowRoot.querySelector(t),r=e||this.getBodyForDefaultModal();n&&(n.open(r),i&&this.integrationsService.fireEvent("WP_click_widget"))}closeModal(){this.shadowRoot.querySelector("pf-default").close()}menuClick(){const t=this.getBodyForDefaultModal(),e=Jt(t,this.isSubscriptionExpired());e?"whatsapp"===e?ne(this.widget,t,this.wazzupId,this.hid,this.integrationsService,e):"telegram"===e&&re(this.widget,t,this.wazzupId,this.hid,this.integrationsService,e):(c(this.widget.id,{name:"click",wazzupId:this.wazzupId,hid:this.hid}),this.open())}menuClickMobile(){const t=this.getBodyForDefaultModal(),e=Jt(t.redirect,this.isSubscriptionExpired());e?"whatsapp"===e?ne(this.widget,t,this.wazzupId,this.hid,this.integrationsService,e):"telegram"===e?re(this.widget,t,this.wazzupId,this.hid,this.integrationsService,e):"viber"===e&&oe(this.widget,0,this.wazzupId,this.hid,this.integrationsService,e):(c(this.widget.id,{name:"click",wazzupId:this.wazzupId,hid:this.hid}),this.open("pf-modal-mobile"))}telegramClick(){const t=this.getBodyForDefaultModal(),e=Jt(t,this.isSubscriptionExpired());re(this.widget,t,this.wazzupId,this.hid,this.integrationsService,e)}whatsappClick(){const t=this.getBodyForDefaultModal(),e=Jt(t,this.isSubscriptionExpired());ne(this.widget,t,this.wazzupId,this.hid,this.integrationsService,e)}viberClick(){const t=this.getBodyForDefaultModal(),e=Jt(t,this.isSubscriptionExpired());oe(this.widget,0,this.wazzupId,this.hid,this.integrationsService,e)}convertDataProfeatToHref(t){t.forEach((t=>{t.hasAttribute("href")&&(t.setAttribute("data-profeat",t.getAttribute("href")),t.removeAttribute("href"))}))}initMagicUrlListener(){const t=document.querySelectorAll("[data-profeat], [href]"),e=Array.from(t).filter((t=>{const e=t.getAttribute("data-profeat"),i=t.getAttribute("href"),n=e&&e?.includes(Dt)||i&&i?.includes(Dt),r=e&&e?.includes(Ut)||i&&i?.includes(Ut);return!(!n&&!r||null===n&&null===r)&&Rt.some((t=>{const n=i?.includes(t),r=e?.includes(t);return r||n}))}));this.convertDataProfeatToHref(e),e.forEach((t=>{const e=t.getAttribute("data-profeat"),i=t.getAttribute("href")||e;i&&null!==i&&t.addEventListener("click",(t=>{this.onMagicUrlElementClick(t,this,i)}))}))}onMagicUrlElementClick(t,e,i){t.preventDefault(),t.stopPropagation();const n=i?.split("#")[1],r=e.widget,o=r.whatsappEnabled,a=r.telegramEnabled,s=r.viberEnabled,l=this.isSubscriptionExpired();this.handleMessengerClickForMyButton(n,l,r,e,o,a,s)}handleMessengerClickForMyButton(t,e,i,r,o,a,s){switch(t){case"open":return n()?!o||a||s?o||!a||s?o||a||!s?r.open("pf-modal-mobile"):this.handleMessengerClickForMyButton("viber",e,i,r,o,a,s):this.handleMessengerClickForMyButton("telegram",e,i,r,o,a,s):this.handleMessengerClickForMyButton("whatsapp",e,i,r,o,a,s):r.open("pf-default",{...i});case"whatsapp":if(!o)break;if(n())return e?r.open("pf-modal-mobile"):r.whatsappClick();r.open("pf-default");break;case"telegram":if(!a)break;if(n())return e?r.open("pf-modal-mobile"):r.telegramClick();r.open("pf-default",{...i});break;case"viber":if(!s)break;if(n())return e?r.open("pf-modal-mobile"):r.viberClick();r.open("pf-default",{...i})}}setWidgetVisibility(t){const e=this.shadowRoot.getElementById("PWPreviewWidgetButtonWrapper");e&&(t?e.classList.add("PWPreviewWidgetButtonWrapperVisible"):e.classList.remove("PWPreviewWidgetButtonWrapperVisible"))}connectedCallback(){super.connectedCallback(),this.initMagicUrlListener();const t=this.widget.hidden;t&&document.addEventListener("hideWidgetComponent",(()=>{this.setWidgetVisibility(!1)})),setTimeout((()=>{t||this.setWidgetVisibility(!0),this.anyActionPassed$.subscribe((t=>{t&&(n()?this.open("pf-modal-mobile-action"):this.open())})),this.modalStateChange$.subscribe((t=>{t?this.open("pf-default"):(this._isOpen=!1,this.closeModal())}))}),0)}getTransformWidget(){let t=n()?16:32,e=n()?24:32;return t=`calc(100% - ${t}px - 64px)`,e=`${e}px`,{left:t,bottom:e}}cModalSlot(){return rt` `}cIconWidget(t){return rt` ${St("whatsapp"===t,(()=>rt` `),(()=>St("telegram"===t,(()=>rt` `),(()=>rt` `))))} `}gifMessengerButton(){const t=Yt(this.getBodyForDefaultModal());return rt` Mixed logo `}cWaveWidget(t){return rt`
`}render(){const{whatsappEnabled:t,telegramEnabled:e,viberEnabled:i}=this.widget,r=Yt(this.widget);let o=null;o=n()?"mobile":"menu";const a={whatsapp:this.whatsappClick,telegram:this.telegramClick,menu:this.menuClick,mobile:this.menuClickMobile},s=this.getTransformWidget(),l=a[o];if(r)return rt` ${this.cModalSlot()} ${rt`
`} `}static styles=(()=>M` .PWPreviewWidgetButtonWrapper { all: unset; position: fixed; display: none; aspect-ratio: 1 / 1; z-index: 2147483646; } .PWPreviewWidgetButtonWrapperVisible { display: flex; } .PWPreviewWidgetButton { all: unset; position: absolute; z-index: 3; width: 100%; border-radius: 50%; aspect-ratio: 1 / 1; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.5), opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1); transform: scale(1); color: white; user-select: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); -webkit-tap-highlight-color: transparent; } .PWPreviewWidgetButton:focus, .PWPreviewWidgetButton:active { outline: none; } .PWPreviewWidgetButtonIsHidden { opacity: 0 !important; } .PWPreviewWidgetButton:hover { transform: scale(1.15); } .PWPreviewWidgetButton:active { transform: scale(1.2); } .PWPreviewWidgetButtonTypeWhatsapp, .PWPreviewWidgetButtonTypeTelegram, .PWPreviewWidgetButtonTypeViber { border-radius: 50%; } .PWPreviewWidgetButtonTypeWhatsapp::before, .PWPreviewWidgetButtonTypeTelegram::before, .PWPreviewWidgetButtonTypeViber::before { content: ''; position: absolute; width: 100%; max-width: calc(100% - 6px); aspect-ratio: 1 / 1; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; } .PWPreviewWidgetButtonTypeWhatsapp { background: linear-gradient(0deg, #22BC3C 0%, #5CD767 100%); } .PWPreviewWidgetButtonTypeWhatsapp::before { background-color: #5CD767; } .PWPreviewWidgetButtonTypeTelegram { background: linear-gradient(180deg, #2AABEE 0%, #229ED9 99.26%); } .PWPreviewWidgetButtonTypeViber { background: linear-gradient(180deg, #8074D6 0%, #6F62CE 100%); } .PWPreviewWidgetButtonTypeViber::before { background: #6F62CE; } .PWPreviewWidgetButtonTypeTelegram::before { background-color: #229ED9; } .PWPreviewWidgetButtonGif { all: unset; display: block; max-width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; } .PWPreviewWidgetButtonIcon { all: unset; position: relative; z-index: 1; display: block; max-width: 68%; aspect-ratio: 1 / 1; } .PWPreviewWidgetButtonWaveColor { all: unset; display: block; position: absolute; z-index: 1; width: 100%; aspect-ratio: 1 / 1; color: white; } .PWPreviewWidgetButtonWaveColorWhatsapp { color: #26d367; } .PWPreviewWidgetButtonWaveColorTelegram { color: #229ED9; } .PWPreviewWidgetButtonWaveColorViber { color: #6F62CE; } @keyframes PWPreviewWidgetButtonWaveSonic { from { transform: scale(1); opacity: 0; } 60% { transform: scale(1); opacity: 0; } 70% { opacity: 0.4; } to { transform: scale(2); opacity: 0; } } .PWPreviewWidgetButtonWave { all: unset; display: block; position: absolute; z-index: 1; width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; background: radial-gradient(rgb(255, 255, 255, 0), currentColor); animation: PWPreviewWidgetButtonWaveSonic 4s ease infinite; } `)()}customElements.get("pf-widget")||customElements.define("pf-widget",pe);class he{integrations=[];constructor(t){this.integrations=t}insertIntegrations(){const t={ym:this.#t,ga:this.#e,callTouch:()=>{},coMagic:()=>{},uis:()=>{},callTracking:()=>{}};for(const e of this.integrations){const i=t[e?.type];i?i(e):console.error(`integrationMapItem is undefined for integration.type: ${e?.type}`)}}#e(t){if(!window.gtag){const e=document.createElement("script");function i(){dataLayer.push(arguments)}e.src=`https://www.googletagmanager.com/gtag/js?id=${t.ga.counter}`,e.async=!0,document.head.appendChild(e),window.dataLayer=window.dataLayer||[],i("js",new Date),window.gtag=i,window.gtag("config",t.ga.counter)}}#t(t){!function(t,e,i,n,r,o,a){t[r]=t[r]||function(){(t[r].a=t[r].a||[]).push(arguments)},t[r].l=1*new Date;for(var s=0;s{switch(i.type){case"ym":if(i.ym.isApi)t.includes("WP_dialog")||window.ym(i.ym.counter,"reachGoal",t);else{let n=!1;try{window.ym(i.ym.counter,"reachGoal",t)}catch(t){n=!0}t.includes("WP_dialog")&&e&&await f({settingsId:e?.settingsId,wazzupId:e?.wazzupId,error:n,type:e?.transport,metric:"yandex"})}break;case"ga":if(i.ga.isApi)t.includes("WP_dialog")||window.gtag("event",t,{send_to:i.ga.counter});else{let n=!1;try{window.gtag("event",t,{send_to:i.ga.counter})}catch(t){n=!0}t.includes("WP_dialog")&&e&&await f({settingsId:e?.settingsId,wazzupId:e?.wazzupId,error:n,type:e?.transport,metric:"google"})}break;case"uis":case"coMagic":window.Comagic&&window.Comagic.trackEvent("profeat",t)}}))}async handleDialogEvents(t){for(const e of t)[Qt.telegram,Qt.tgApi].includes(e.transport)?await this.fireEvent("WP_dialog_telegram",e):await this.fireEvent("WP_dialog_whatsapp",e)}}var fe=function(t,e){return fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},fe(t,e)};function ge(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}fe(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function me(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{l(n.next(t))}catch(t){o(t)}}function s(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}l((n=n.apply(t,e||[])).next())}))}function ve(t,e){var i,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function be(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,o=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}function Ce(t,e,i){if(i||2===arguments.length)for(var n,r=0,o=e.length;r1||s(t,e)}))},e&&(n[t]=e(n[t])))}function s(t,e){try{!function(t){t.value instanceof ye?Promise.resolve(t.value.v).then(l,c):d(o[0][2],t)}(r[t](e))}catch(t){d(o[0][3],t)}}function l(t){s("next",t)}function c(t){s("throw",t)}function d(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function Pe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,i=t[Symbol.asyncIterator];return i?i.call(t):(t=we(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(i){e[i]=t[i]&&function(e){return new Promise((function(n,r){(function(t,e,i,n){Promise.resolve(n).then((function(e){t({value:e,done:i})}),e)})(n,r,(e=t[i](e)).done,e.value)}))}}}Object.create;"function"==typeof SuppressedError&&SuppressedError;function Me(t){return"function"==typeof t}function Fe(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var $e=Fe((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function Be(t,e){if(t){var i=t.indexOf(e);0<=i&&t.splice(i,1)}}var ke=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,i,n,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=we(o),s=a.next();!s.done;s=a.next()){s.value.remove(this)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(Me(l))try{l()}catch(t){r=t instanceof $e?t.errors:[t]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var d=we(c),u=d.next();!u.done;u=d.next()){var p=u.value;try{Se(p)}catch(t){r=null!=r?r:[],t instanceof $e?r=Ce(Ce([],be(r)),be(t.errors)):r.push(t)}}}catch(t){i={error:t}}finally{try{u&&!u.done&&(n=d.return)&&n.call(d)}finally{if(i)throw i.error}}}if(r)throw new $e(r)}},t.prototype.add=function(e){var i;if(e&&e!==this)if(this.closed)Se(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(i=this._finalizers)&&void 0!==i?i:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Be(e,t)},t.prototype.remove=function(e){var i=this._finalizers;i&&Be(i,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),_e=ke.EMPTY;function Ee(t){return t instanceof ke||t&&"closed"in t&&Me(t.remove)&&Me(t.add)&&Me(t.unsubscribe)}function Se(t){Me(t)?t():t.unsubscribe()}var Ie={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ae={setTimeout:function(t,e){for(var i=[],n=2;nIi(t.active).pipe(Ai((e=>e?Vi(1e3*t.value).pipe(Mi((()=>!0)),Ri(!1)):Ii(!0)))),scroll:t=>Ii(t.active).pipe(Ai((e=>{return e?Gi(window,"scroll").pipe(Mi((()=>window.scrollY/(document.documentElement.scrollHeight-window.innerHeight)*100)),(i=e=>ee>=t.value)),Mi((()=>!0)),Ri(0)):Ii(!0);var i,n}))),device:t=>{if(!t.mobile&&!t.desktop)return Ii(!1);return Ii(t[o()])},leftSite:t=>Ii(t).pipe(Ai((t=>t?Gi(document,"mouseout").pipe(Mi((t=>{const e=t.clientY<=0,i="pf_widget_leave_modal";return!window.sessionStorage.getItem(i)&&(e&&setTimeout((()=>{window.sessionStorage.setItem(i,!0)}),250),e)})),Yi((t=>t)),Mi((()=>!0)),Ri(!1)):Ii(!1))))},Ki=t=>(t=>{const e=Object.entries(t);let i=!1;const n=e[3][1].active,r=e[1][1].active;return n||r||(i=!0),Ei(e.map((t=>{let[e,i]=t;return(0,Ji[e])(i)})).filter(Boolean)).pipe(Mi((e=>{const n=Object.keys(t).indexOf("leftSite"),r=e[n],o=e.filter(((t,e)=>e!==n)).every(Boolean);return i?o&&r:o||!0===r})))})(t);var Xi=Fe((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),tn=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return ge(e,t),e.prototype.lift=function(t){var e=new en(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new Xi},e.prototype.next=function(t){var e=this;Oe((function(){var i,n;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var r=we(e.currentObservers),o=r.next();!o.done;o=r.next()){o.value.next(t)}}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}}}))},e.prototype.error=function(t){var e=this;Oe((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var i=e.observers;i.length;)i.shift().error(t)}}))},e.prototype.complete=function(){var t=this;Oe((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,i=this,n=i.hasError,r=i.isStopped,o=i.observers;return n||r?_e:(this.currentObservers=null,o.push(t),new ke((function(){e.currentObservers=null,Be(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,i=e.hasError,n=e.thrownError,r=e.isStopped;i?t.error(n):r&&t.complete()},e.prototype.asObservable=function(){var t=new Je;return t.source=this,t},e.create=function(t,e){return new en(t,e)},e}(Je),en=function(t){function e(e,i){var n=t.call(this)||this;return n.destination=e,n.source=i,n}return ge(e,t),e.prototype.next=function(t){var e,i;null===(i=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===i||i.call(e,t)},e.prototype.error=function(t){var e,i;null===(i=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===i||i.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,i;return null!==(i=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==i?i:_e},e}(tn),nn=function(t){function e(e){var i=t.call(this)||this;return i._value=e,i}return ge(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var i=t.prototype._subscribe.call(this,e);return!i.closed&&e.next(this._value),i},e.prototype.getValue=function(){var t=this,e=t.hasError,i=t.thrownError,n=t._value;if(e)throw i;return this._throwIfClosed(),n},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(tn);const rn="0123456789abcdef";class on{constructor(t){this.bytes=t}static ofInner(t){if(16!==t.length)throw new TypeError("not 128-bit length");return new on(t)}static fromFieldsV7(t,e,i,n){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(n)||t<0||e<0||i<0||n<0||t>0xffffffffffff||e>4095||i>1073741823||n>4294967295)throw new RangeError("invalid field value");const r=new Uint8Array(16);return r[0]=t/2**40,r[1]=t/2**32,r[2]=t/2**24,r[3]=t/65536,r[4]=t/256,r[5]=t,r[6]=112|e>>>8,r[7]=e,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=n>>>24,r[13]=n>>>16,r[14]=n>>>8,r[15]=n,new on(r)}static parse(t){var e,i,n,r;let o;switch(t.length){case 32:o=null===(e=/^[0-9a-f]{32}$/i.exec(t))||void 0===e?void 0:e[0];break;case 36:o=null===(i=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t))||void 0===i?void 0:i.slice(1,6).join("");break;case 38:o=null===(n=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(t))||void 0===n?void 0:n.slice(1,6).join("");break;case 45:o=null===(r=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t))||void 0===r?void 0:r.slice(1,6).join("")}if(o){const t=new Uint8Array(16);for(let e=0;e<16;e+=4){const i=parseInt(o.substring(2*e,2*e+8),16);t[e+0]=i>>>24,t[e+1]=i>>>16,t[e+2]=i>>>8,t[e+3]=i}return new on(t)}throw new SyntaxError("could not parse UUID string")}toString(){let t="";for(let e=0;e>>4),t+=rn.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");return t}toHex(){let t="";for(let e=0;e>>4),t+=rn.charAt(15&this.bytes[e]);return t}toJSON(){return this.toString()}getVariant(){const t=this.bytes[8]>>>4;if(t<0)throw new Error("unreachable");if(t<=7)return this.bytes.every((t=>0===t))?"NIL":"VAR_0";if(t<=11)return"VAR_10";if(t<=13)return"VAR_110";if(t<=15)return this.bytes.every((t=>255===t))?"MAX":"VAR_RESERVED";throw new Error("unreachable")}getVersion(){return"VAR_10"===this.getVariant()?this.bytes[6]>>>4:void 0}clone(){return new on(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(let e=0;e<16;e++){const i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}}class an{constructor(t){this.timestamp=0,this.counter=0,this.random=null!=t?t:sn()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(t,e){let i=this.generateOrAbortCore(t,e);return void 0===i&&(this.timestamp=0,i=this.generateOrAbortCore(t,e)),i}generateOrAbortCore(t,e){if(!Number.isInteger(t)||t<1||t>0xffffffffffff)throw new RangeError("`unixTsMs` must be a 48-bit positive integer");if(e<0||e>0xffffffffffff)throw new RangeError("`rollbackAllowance` out of reasonable range");if(t>this.timestamp)this.timestamp=t,this.resetCounter();else{if(!(t+e>=this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return on.fromFieldsV7(this.timestamp,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}generateV4(){const t=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return t[6]=64|t[6]>>>4,t[8]=128|t[8]>>>2,on.ofInner(t)}}const sn=()=>{if("undefined"!=typeof crypto&&void 0!==crypto.getRandomValues)return new ln;if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");return{nextUint32:()=>65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random())}};class ln{constructor(){this.buffer=new Uint32Array(8),this.cursor=65535}nextUint32(){return this.cursor>=this.buffer.length&&(crypto.getRandomValues(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}let cn;const dn=()=>(cn||(cn=new an)).generate();function un(t){Promise.all([l(t),d(t),u(t),p(t),h(t),mn()]).then((e=>{let[i,n,r,o,a,s]=e;if(!i)return void console.error("Can not find widget with id",t);!function(){const t=document.createElement("link");t.rel="stylesheet",t.href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap",document.head.appendChild(t)}();const l=function(){const t=new nn(!1);return window.pfWidget={open:()=>t.next(!0),close:()=>t.next(!1)},{modalStateChange$:t.pipe((e=1,Yi((function(t,i){return e<=i}))))};var e}(),d=gn(),p=new he(n);p.insertIntegrations(),p.handleDialogEvents(r),setInterval((()=>{u(t).then((t=>p.handleDialogEvents(t)))}),9e4);const h=Ki(i.widgetSettings.actions);!function(t){let{widget:e,wazzupId:i,hid:n,integrationsService:r,subscription:o,anyActionPassed$:a,modalStateChange$:s,tests:l}=t;const c=rt` `;xt(c,document.body)}({widget:i,wazzupId:d,hid:s,integrationsService:p,subscription:o,anyActionPassed$:h,modalStateChange$:l.modalStateChange$,tests:a}),c(t,{name:"enter",wazzupId:d,hid:s,integrations:n})}))}const pn="__buttonly_id",hn="__hid",fn=730;function gn(){!function(){const t=w.get(pn);t&&t.includes("-")&&w.set(pn,t.replace("-",""),{expires:fn})}();let t=m("123456789",8)();return w.get(pn)||w.set(pn,t,{expires:fn}),w.get(pn)}function mn(){const t=w.get(hn);if(!t){const t=dn().toString();return w.set(hn,t,{expires:fn}),t}return t}!function(){const t=function(){if(window.ygWidgetId)return null;const t=document.head.querySelectorAll("[data-pf-id]"),e=t.length>1?t[0].dataset.pfId:document.currentScript.dataset.pfId;return window.ygWidgetId=e,e}();t?(!function(){if(!0===window[r])return;window[r]=!0;let t=history.pushState;history.pushState=function(){let e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};let e=history.replaceState;history.replaceState=function(){let t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t}}(),function(t){let{widgetId:e,referrer:i}=t;fetch("https://widget.yourgood.app/api/statistics-inner/create-setup-event",{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify({settingsId:e,referrer:i})}).then((t=>t.json())).catch((()=>{}))}({widgetId:t,referrer:window.location.href}),new Promise(((t,e)=>{t()})).then((()=>l(t))).then((e=>{var i;e.seoOptimization?(i=3e3,new Promise((t=>setTimeout(t,i)))).then((()=>un(t))):un(t)}))):console.error("You can only install 1 of widget")}()})();