(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{FIRST_WP_VERSION_WITH_THUNK_SUPPORT:()=>g,QLWAPP_DEMO_URL:()=>d,QLWAPP_DEVELOPER:()=>f,QLWAPP_DOCUMENTATION_URL:()=>R,QLWAPP_GROUP_URL:()=>O,QLWAPP_MESSAGE_REPLACEMENTS:()=>U,QLWAPP_PLUGIN_DIR:()=>_,QLWAPP_PLUGIN_FILE:()=>L,QLWAPP_PLUGIN_NAME:()=>i,QLWAPP_PLUGIN_URL:()=>A,QLWAPP_PLUGIN_VERSION:()=>l,QLWAPP_PREMIUM_SELL_URL:()=>w,QLWAPP_REVIEW_URL:()=>p,QLWAPP_SUPPORT_URL:()=>E,QLWAPP_TIMEZONE_OPTIONS:()=>h,QLWAPP_WORDPRESS_URL:()=>u,WP_VERSION:()=>P,apiFetch:()=>N,applyThunkMiddleware:()=>v,buildParams:()=>y,capitalizeFirstLetter:()=>b,createNotice:()=>T,decodeEntities:()=>Q,decodeHTMLEntities:()=>V,deepMerge:()=>D,displayWithLineBreaks:()=>M,getPluginURL:()=>m,handleApiResponse:()=>j,handleBrowserParams:()=>S,isObjectsEqual:()=>I,isVersionLessThan:()=>G,onDocumentLoaded:()=>W});const n=window.wp.element,r=window.wp.i18n,o=window.wp.apiFetch;var a=e.n(o);const s=window.wp.notices,c=window.wp.data,{WP_VERSION:P,QLWAPP_PLUGIN_NAME:i,QLWAPP_PLUGIN_VERSION:l,QLWAPP_PLUGIN_FILE:L,QLWAPP_PLUGIN_DIR:_,QLWAPP_WORDPRESS_URL:u,QLWAPP_REVIEW_URL:p,QLWAPP_DEMO_URL:d,QLWAPP_SUPPORT_URL:E,QLWAPP_PREMIUM_SELL_URL:w,QLWAPP_DOCUMENTATION_URL:R,QLWAPP_GROUP_URL:O,QLWAPP_DEVELOPER:f,QLWAPP_PLUGIN_URL:A,QLWAPP_TIMEZONE_OPTIONS:h,QLWAPP_MESSAGE_REPLACEMENTS:U}=qlwappHelpers,g="6.0";function W(e){/comp|inter|loaded/.test(document.readyState)?e():document.addEventListener("DOMContentLoaded",e,!1)}const S=()=>{const e=document.location.href,t=new URLSearchParams(e),n=new URL(window.location);return{tabParam:t.get("tab"),setBrowserTabParam:e=>{n.searchParams.set("tab",e),window.history.pushState(null,"",n.toString()),window.dispatchEvent(new Event("popstate"))}}},y=e=>{const t=[];for(const n in e)e.hasOwnProperty(n)&&e[n]&&"all"!==e[n]&&t.push(`${n}=${e[n]}`);return t.length>0?`?${t.join("&")}`:""};async function N(e){return await a()(e).then((e=>{if(e.code)throw e;return e})).catch((t=>(console.log("error: ",t),console.log("args: ",e),{code:t?.code?t.code:"Unknown",message:t?.message?t.message:"Unknown"})))}function m(e){return A+e}function I(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;for(const r of n){const n=e[r],o=t[r];if("object"==typeof n&&null!==n&&"object"==typeof o&&null!==o){if(!I(n,o))return!1}else if(n!==o)return!1}return!0}function b(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Q(e){return(e=(e=(e=(e=(e=e.replace(/&quot;/g,'"')).replace(/&amp;/g,"&")).replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\u0022/g,'"')).replace(/\\\\"/g,'"')}function M(e){return e.split("\n").map(((e,t,r)=>t===r.length-1?e:(0,n.createElement)(n.Fragment,null,e,(0,n.createElement)("br",null))))}const T=e=>{(0,c.dispatch)(s.store).createSuccessNotice((0,r.sprintf)("%s",e),{type:"snackbar"})},j=e=>e?.code||0===e?.code?(T(`${e.code}: ${e.message}`),!1):e,G=(e,t)=>{const n=e.split(".").map(Number),r=t.split(".").map(Number);for(let e=0;e<r.length;e++){if(n[e]<r[e])return!0;if(n[e]>r[e])return!1}return!1},v=e=>{const t=e.instantiate;return e.instantiate=e=>{const n=t(e);if(!n.store||!n.store.dispatch)throw new Error(__("The created instance does not contain a valid store.","wp-whatsapp-chat"));const r=n.store.dispatch,o=((e,t)=>({registry:t,get dispatch(){return Object.assign((t=>e.store.dispatch(t)),e.getActions())},get select(){return Object.assign((t=>t(e.store.__unstableOriginalGetState())),e.getSelectors())},get resolveSelect(){return e.getResolveSelectors()}}))(n,e);return n.store.dispatch=((e,t)=>n=>"function"==typeof n?n(e):t(n))(o,r),n},e};function D(e,t){const n={};return new Set([...Object.keys(e),...Object.keys(t)]).forEach((r=>{e.hasOwnProperty(r)&&t.hasOwnProperty(r)?!function(e){const t=typeof e;return null!=e&&("object"==t||"function"==t)}(e[r])||Array.isArray(e[r])?n[r]=t[r]:n[r]=D(e[r],t[r]):e.hasOwnProperty(r)?n[r]=e[r]:t.hasOwnProperty(r)&&(n[r]=t[r])})),n}function V(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}(window.qlwapp=window.qlwapp||{}).helpers=t})();