@commversion/libs 0.18.7 → 0.18.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var lcChannelWidgets=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){"@babel/helpers - typeof";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function r(e){var r=n(e,`string`);return t(r)==`symbol`?r:r+``}function i(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?a(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var s={whatsapp:{label:`WhatsApp`,icon:`<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 509 511.514"><path fill="#fff" d="M434.762 74.334C387.553 26.81 323.245 0 256.236 0h-.768C115.795.001 2.121 113.696 2.121 253.456l.001.015a253.516 253.516 0 0033.942 126.671L0 511.514l134.373-35.269a253.416 253.416 0 00121.052 30.9h.003.053C395.472 507.145 509 393.616 509 253.626c0-67.225-26.742-131.727-74.252-179.237l.014-.055zM255.555 464.453c-37.753 0-74.861-10.22-107.293-29.479l-7.72-4.602-79.741 20.889 21.207-77.726-4.984-7.975c-21.147-33.606-32.415-72.584-32.415-112.308 0-116.371 94.372-210.743 210.741-210.743 56.011 0 109.758 22.307 149.277 61.98a210.93 210.93 0 0161.744 149.095c0 116.44-94.403 210.869-210.844 210.869h.028zm115.583-157.914c-6.363-3.202-37.474-18.472-43.243-20.593-5.769-2.121-10.01-3.202-14.315 3.203-4.305 6.404-16.373 20.593-20.063 24.855-3.69 4.263-7.401 4.815-13.679 1.612-6.278-3.202-26.786-9.883-50.899-31.472a192.748 192.748 0 01-35.411-43.867c-3.712-6.363-.404-9.777 2.82-12.873 3.224-3.096 6.363-7.381 9.48-11.092a41.58 41.58 0 006.357-10.597 11.678 11.678 0 00-.508-11.09c-1.718-3.18-14.444-34.357-19.534-47.06-5.09-12.703-10.37-10.603-14.272-10.901-3.902-.297-7.911-.19-12.089-.19a23.322 23.322 0 00-16.964 7.911c-5.707 6.298-22.1 21.673-22.1 52.849s22.671 61.249 25.852 65.532c3.182 4.284 44.663 68.227 108.288 95.649 15.099 6.489 26.891 10.392 36.053 13.403a87.504 87.504 0 0025.216 3.718c4.905 0 9.82-.416 14.65-1.237 12.174-1.782 37.453-15.291 42.776-30.073s5.303-27.57 3.711-30.093c-1.591-2.524-5.704-4.369-12.088-7.615l-.038.021z"/></svg>`,backgroundColor:`#25D366`,prefilledmessage:`Hi, I'd like to learn more.`,mobile:{enabled:!1,url:`https://wa.me/{number}[?text={prefilledmessage}]`},desktop:{enabled:!1,url:`https://web.whatsapp.com/send?phone={number}[&text={prefilledmessage}]`}},sms:{label:`SMS`,icon:`<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#fff"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 13H6v-2h2v2zm5 0h-2v-2h2v2zm5 0h-2v-2h2v2z"/></svg>`,backgroundColor:`#3478F6`,prefilledmessage:`Hi, I'd like to learn more.`,mobile:{enabled:!1,url:`sms:{number}[?body={prefilledmessage}]`},desktop:{enabled:!1,url:`sms:{number}[?body={prefilledmessage}]`},popover:{title:`Text us — we're available 24/7`,description:`US numbers only. Msg & carrier rates may apply. Reply STOP to opt out.`,buttonLabel:`Start Conversation`}}},c=new Set([`prefilledmessage`]),l=e=>typeof e==`string`&&/^https?:\/\//i.test(e),u=new Map,d=new Map,f=new Map,p=new Set,m=new Set;function h(e,t){let n=d.get(e);n||(n=new Set,d.set(e,n)),n.add(t)}function g(e){let t=d.get(e);if(t)for(let e of t)e.isConnected||t.delete(e)}function _(e,t,n){return t?e?`${e} (ref ${t})`:(m.has(n)||(m.add(n),console.warn(`[lc-channel-widgets] ${n}Config.defaultMessage is empty; emitting bare ref`)),`(ref ${t})`):e||``}function v(e,t){var n,r;let i=((n=window.commversion)==null?void 0:n[`${e}Config`])||void 0;if(i&&t&&i.buttonMessages){let e=i.buttonMessages[t];if(typeof e==`string`)return e}if(i&&typeof i.defaultMessage==`string`)return i.defaultMessage;let a=(r=s[e])==null?void 0:r.prefilledmessage;return typeof a==`string`?a:``}function y(e){var t;let n=e.__lcChannelType,r=f.get(n);if(!(r!=null&&r.urlTemplate)){e.href=`#`;return}let i=_((t=e.__lcBaseMessage)==null?``:t,u.get(n),n),a=o(o({},r.channelData),{},{prefilledmessage:i});e.href=te(r.urlTemplate,a)}function b(e){window.dispatchEvent(new CustomEvent(`commversion:channel-clicked`,{detail:{channel:e}}))}function x(){let e=Array.from(p);e.length!==0&&window.dispatchEvent(new CustomEvent(`commversion:channels-registered`,{detail:{channels:e}}))}function ee(e){var t;let n=((t=window.commversion)==null?void 0:t[`${e.type}Config`])||void 0;if(n!=null&&n.buttonMessages)for(let t of Object.keys(n.buttonMessages)){let n;try{n=document.querySelectorAll(t)}catch(e){console.warn(`[lc-channel-widgets] invalid buttonMessages selector "${t}":`,e);continue}n.forEach(n=>{if(!n.__lcChannelAttached){if(!(n instanceof HTMLAnchorElement)){console.warn(`[lc-channel-widgets] buttonMessages selector "${t}" matched non-<a> element; skipping`);return}n.__lcChannelAttached=e.type,S(n,e,t)}})}}function S(e,t,n){l(t.urlTemplate)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)),e.__lcChannelType=t.type,e.__lcBaseMessage=v(t.type,n),y(e),h(t.type,e),e.addEventListener(`click`,()=>b(t.type))}window.addEventListener(`commversion:attribution-ready`,()=>{x()}),window.addEventListener(`commversion:shortcode-resolved`,e=>{let{channel:t,shortCode:n}=e.detail||{};if(!t||typeof n!=`string`)return;u.set(t,n),g(t);let r=d.get(t);if(r)for(let e of r)y(e)}),window.addEventListener(`commversion:shortcode-failed`,()=>{});function te(e,t){return e.replace(/\[([^\]]*)\]/g,(e,n)=>{for(let[,e]of n.matchAll(/\{(\w+)\}/g)){let n=t[e];if(n==null||n===``)return``}return n}).replace(/\{(\w+)\}/g,(e,n)=>{let r=t[n];if(r==null)return``;let i=String(r);return c.has(n)?encodeURIComponent(i):i})}var C=e=>e&&typeof e.enabled==`boolean`?{enabled:e.enabled}:{},ne=e=>e===!0?!0:e&&typeof e==`object`?e.enabled===!0:!1,w={title:60,description:140,buttonLabel:24},re=(e,t)=>{if(!e||e===!0||typeof e!=`object`)return{};let n={};return Object.keys(w).forEach(r=>{if(typeof e[r]!=`string`)return;let i=w[r];if(i!=null&&e[r].length>i){console.warn(`[lc-channel-widgets] ${t} popover.${r} exceeds ${i} chars (got ${e[r].length}); using registry default`);return}n[r]=e[r]}),n};function ie(e,t){if(!e||typeof e.type!=`string`)return null;let n=s[e.type];if(!n)return null;let r=n[t]||{};return{type:e.type,label:n.label,icon:n.icon,backgroundColor:n.backgroundColor,mobile:o(o({},n.mobile),C(e.mobile)),desktop:o(o({},n.desktop),C(e.desktop)),popover:n.popover&&ne(e.popover)?o(o({},n.popover),re(e.popover,e.type)):void 0,urlTemplate:r.url||``,channelData:e}}var ae=`screen and (max-width: 992px) and (pointer: coarse)`,oe=()=>window.matchMedia(ae).matches?`mobile`:`desktop`,T=[];function E(){for(let e=T.length-1;e>=0;e--){let t=T[e];t!=null&&t.parentNode&&t.remove(),T.splice(e,1)}}var D=new Set;function O(e,t){D.has(e)||(D.add(e),document.addEventListener(e,t))}function se(){O(`click`,e=>{for(let t of T)t.__isOpen&&!t.contains(e.target)&&q(t,{restoreFocus:!1})})}function ce(){O(`keydown`,e=>{if(e.key===`Escape`){for(let e of T)if(e.__isOpen){q(e);return}}})}var le=0;function k(e,t){if(!e)return;let n=t?`true`:`false`;e.getAttribute(`aria-expanded`)!==n&&e.setAttribute(`aria-expanded`,n)}function ue(){if(window.__lcHistoryPatched)return;window.__lcHistoryPatched=!0,window.__lcLastUrl=window.__lcLastUrl||location.href;let e=e=>{let t=window.__lcLastUrl,n=location.href,r=t!==n;window.__lcLastUrl=n,!(!r&&e!==`popstate`)&&window.dispatchEvent(new Event(`lc:locationchange`))},t=history.pushState;typeof t==`function`&&(history.pushState=function(...n){let r=t.apply(this,n);return e(`pushState`),r});let n=history.replaceState;typeof n==`function`&&(history.replaceState=function(...t){let r=n.apply(this,t);return e(`replaceState`),r}),window.addEventListener(`popstate`,()=>e(`popstate`)),window.addEventListener(`hashchange`,()=>e(`hashchange`))}function A(e){var t;if(document.__lcVisibilityBound&&!e)return!0;if(typeof((t=window.LiveChatWidget)==null?void 0:t.on)!=`function`)return!1;let n=document.__lcVisibilityCb;if(n&&typeof window.LiveChatWidget.off==`function`)try{window.LiveChatWidget.off(`visibility_changed`,n)}catch(e){}let r=e=>{var t,n,r,i;let a=document.__lcStack;a!=null&&a.isConnected&&(e&&typeof e.visibility==`string`&&(a.__lcVisibility=e.visibility),(t=(n=document).__lcCurrentRebind)==null||t.call(n),(r=(i=document).__lcCurrentSync)==null||r.call(i))};return window.LiveChatWidget.on(`visibility_changed`,r),document.__lcVisibilityCb=r,document.__lcVisibilityBound=!0,!0}function j(e){if(A(e)||document.__lcVisibilityPolling)return;document.__lcVisibilityPolling=!0;let t=0,n=setInterval(()=>{(A(e)||++t>=200)&&(clearInterval(n),document.__lcVisibilityPolling=!1)},200)}function de(){document.__lcBodyMutationObs||typeof MutationObserver>`u`||(document.__lcBodyMutationObs=new MutationObserver(e=>{let t=document.__lcStack;if(t){for(let{removedNodes:r}of e)if(!(!r||r.length===0))for(let e of r){var n;if(e.nodeType===1&&(e===t||(n=e.contains)!=null&&n.call(e,t))){let e=document.__lcChannelWidgetsConfig;e&&P(e);return}}}}),document.__lcBodyMutationObs.observe(document.body,{childList:!0,subtree:!0}))}var M=null,N=null;function P(e){N=e,!M&&(M=setTimeout(()=>{M=null;let e=N;N=null,$(e)},100))}var F=`#chat-widget-minimized`,I=`#chat-overlay-container`,fe=`#chat-overlay-button`,pe=[F,I],L=15,R=100,z=150;function me(e){return{width:e.width,height:e.height,fromLeft:e.left,fromRight:window.innerWidth-e.right,fromTop:e.top,fromBottom:window.innerHeight-e.bottom}}function B(e){let t=e.fromLeft<=e.fromRight,n=e.fromTop<=e.fromBottom,r=t?e.fromLeft:window.innerWidth-e.fromRight-e.width,i=n?e.fromTop:window.innerHeight-e.fromBottom-e.height;return{left:r,top:i,right:r+e.width,bottom:i+e.height,width:e.width,height:e.height}}var V=60;function he(e){let t=window.innerWidth-e.right<=e.left,n=e.bottom,r=n-V,i=t?e.right:e.left+V;return{left:i-V,right:i,top:r,bottom:n,width:V,height:V}}var ge=200,_e=150;function H(e,t,{interval:n=ge,maxRetries:r=_e}={}){let i=0,a=setInterval(()=>{let n=document.querySelector(e);if(n){clearInterval(a),t(n);return}++i>=r&&clearInterval(a)},n)}function U(){if(document.getElementById(`lc-channel-widgets-style`))return;let e=document.createElement(`style`);e.id=`lc-channel-widgets-style`,e.textContent=`
|
|
1
|
+
var lcChannelWidgets=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){"@babel/helpers - typeof";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function r(e){var r=n(e,`string`);return t(r)==`symbol`?r:r+``}function i(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?a(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var s={whatsapp:{label:`WhatsApp`,icon:`<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 509 511.514"><path fill="#fff" d="M434.762 74.334C387.553 26.81 323.245 0 256.236 0h-.768C115.795.001 2.121 113.696 2.121 253.456l.001.015a253.516 253.516 0 0033.942 126.671L0 511.514l134.373-35.269a253.416 253.416 0 00121.052 30.9h.003.053C395.472 507.145 509 393.616 509 253.626c0-67.225-26.742-131.727-74.252-179.237l.014-.055zM255.555 464.453c-37.753 0-74.861-10.22-107.293-29.479l-7.72-4.602-79.741 20.889 21.207-77.726-4.984-7.975c-21.147-33.606-32.415-72.584-32.415-112.308 0-116.371 94.372-210.743 210.741-210.743 56.011 0 109.758 22.307 149.277 61.98a210.93 210.93 0 0161.744 149.095c0 116.44-94.403 210.869-210.844 210.869h.028zm115.583-157.914c-6.363-3.202-37.474-18.472-43.243-20.593-5.769-2.121-10.01-3.202-14.315 3.203-4.305 6.404-16.373 20.593-20.063 24.855-3.69 4.263-7.401 4.815-13.679 1.612-6.278-3.202-26.786-9.883-50.899-31.472a192.748 192.748 0 01-35.411-43.867c-3.712-6.363-.404-9.777 2.82-12.873 3.224-3.096 6.363-7.381 9.48-11.092a41.58 41.58 0 006.357-10.597 11.678 11.678 0 00-.508-11.09c-1.718-3.18-14.444-34.357-19.534-47.06-5.09-12.703-10.37-10.603-14.272-10.901-3.902-.297-7.911-.19-12.089-.19a23.322 23.322 0 00-16.964 7.911c-5.707 6.298-22.1 21.673-22.1 52.849s22.671 61.249 25.852 65.532c3.182 4.284 44.663 68.227 108.288 95.649 15.099 6.489 26.891 10.392 36.053 13.403a87.504 87.504 0 0025.216 3.718c4.905 0 9.82-.416 14.65-1.237 12.174-1.782 37.453-15.291 42.776-30.073s5.303-27.57 3.711-30.093c-1.591-2.524-5.704-4.369-12.088-7.615l-.038.021z"/></svg>`,backgroundColor:`#25D366`,prefilledmessage:`Hi, I'd like to learn more.`,mobile:{enabled:!1,url:`https://wa.me/{number}[?text={prefilledmessage}]`},desktop:{enabled:!1,url:`https://web.whatsapp.com/send?phone={number}[&text={prefilledmessage}]`}},sms:{label:`SMS`,icon:`<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#fff"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 13H6v-2h2v2zm5 0h-2v-2h2v2zm5 0h-2v-2h2v2z"/></svg>`,backgroundColor:`#3478F6`,prefilledmessage:`Hi, I'd like to learn more.`,mobile:{enabled:!1,url:`sms:{number}[?body={prefilledmessage}]`},desktop:{enabled:!1,url:`sms:{number}[?body={prefilledmessage}]`},popover:{title:`Text us — we're available 24/7`,description:`US numbers only. Msg & carrier rates may apply. Reply STOP to opt out.`,buttonLabel:`Start Conversation`}}},c=new Set([`prefilledmessage`]),l=e=>typeof e==`string`&&/^https?:\/\//i.test(e),u=new Map,d=new Map,f=new Map,p=new Set,m=new Set;function h(e,t){let n=d.get(e);n||(n=new Set,d.set(e,n)),n.add(t)}function g(e){let t=d.get(e);if(t)for(let e of t)e.isConnected||t.delete(e)}function _(e,t,n){return t?e?`${e} (ref ${t})`:(m.has(n)||(m.add(n),console.warn(`[lc-channel-widgets] ${n}Config.defaultMessage is empty; emitting bare ref`)),`(ref ${t})`):e||``}function v(e,t){var n,r,i;let a=((n=window.commversion)==null?void 0:n[`${e}Config`])||void 0;if(a&&t&&a.buttonMessages){let e=a.buttonMessages[t];if(typeof e==`string`)return e}if(a&&typeof a.defaultMessage==`string`)return a.defaultMessage;let o=(r=window.commversion)==null||(r=r.channelWidgetsConfig)==null?void 0:r.channels,c=o==null?void 0:o.find(t=>(t==null?void 0:t.type)===e);if(typeof(c==null?void 0:c.prefilledmessage)==`string`)return c.prefilledmessage;let l=(i=s[e])==null?void 0:i.prefilledmessage;return typeof l==`string`?l:``}function y(e){var t;let n=e.__lcChannelType,r=f.get(n);if(!(r!=null&&r.urlTemplate)){e.href=`#`;return}let i=_((t=e.__lcBaseMessage)==null?``:t,u.get(n),n),a=o(o({},r.channelData),{},{prefilledmessage:i});e.href=te(r.urlTemplate,a)}function b(e){window.dispatchEvent(new CustomEvent(`commversion:channel-clicked`,{detail:{channel:e}}))}function x(){let e=Array.from(p);e.length!==0&&window.dispatchEvent(new CustomEvent(`commversion:channels-registered`,{detail:{channels:e}}))}function ee(e){var t;let n=((t=window.commversion)==null?void 0:t[`${e.type}Config`])||void 0;if(n!=null&&n.buttonMessages)for(let t of Object.keys(n.buttonMessages)){let n;try{n=document.querySelectorAll(t)}catch(e){console.warn(`[lc-channel-widgets] invalid buttonMessages selector "${t}":`,e);continue}n.forEach(n=>{if(!n.__lcChannelAttached){if(!(n instanceof HTMLAnchorElement)){console.warn(`[lc-channel-widgets] buttonMessages selector "${t}" matched non-<a> element; skipping`);return}n.__lcChannelAttached=e.type,S(n,e,t)}})}}function S(e,t,n){l(t.urlTemplate)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)),e.__lcChannelType=t.type,e.__lcBaseMessage=v(t.type,n),y(e),h(t.type,e),e.addEventListener(`click`,()=>b(t.type))}window.addEventListener(`commversion:attribution-ready`,()=>{x()}),window.addEventListener(`commversion:shortcode-resolved`,e=>{let{channel:t,shortCode:n}=e.detail||{};if(!t||typeof n!=`string`)return;u.set(t,n),g(t);let r=d.get(t);if(r)for(let e of r)y(e)}),window.addEventListener(`commversion:shortcode-failed`,()=>{});function te(e,t){return e.replace(/\[([^\]]*)\]/g,(e,n)=>{for(let[,e]of n.matchAll(/\{(\w+)\}/g)){let n=t[e];if(n==null||n===``)return``}return n}).replace(/\{(\w+)\}/g,(e,n)=>{let r=t[n];if(r==null)return``;let i=String(r);return c.has(n)?encodeURIComponent(i):i})}var C=e=>e&&typeof e.enabled==`boolean`?{enabled:e.enabled}:{},ne=e=>e===!0?!0:e&&typeof e==`object`?e.enabled===!0:!1,w={title:60,description:140,buttonLabel:24},re=(e,t)=>{if(!e||e===!0||typeof e!=`object`)return{};let n={};return Object.keys(w).forEach(r=>{if(typeof e[r]!=`string`)return;let i=w[r];if(i!=null&&e[r].length>i){console.warn(`[lc-channel-widgets] ${t} popover.${r} exceeds ${i} chars (got ${e[r].length}); using registry default`);return}n[r]=e[r]}),n};function ie(e,t){if(!e||typeof e.type!=`string`)return null;let n=s[e.type];if(!n)return null;let r=n[t]||{};return{type:e.type,label:n.label,icon:n.icon,backgroundColor:n.backgroundColor,mobile:o(o({},n.mobile),C(e.mobile)),desktop:o(o({},n.desktop),C(e.desktop)),popover:n.popover&&ne(e.popover)?o(o({},n.popover),re(e.popover,e.type)):void 0,urlTemplate:r.url||``,channelData:e}}var ae=`screen and (max-width: 992px) and (pointer: coarse)`,oe=()=>window.matchMedia(ae).matches?`mobile`:`desktop`,T=[];function E(){for(let e=T.length-1;e>=0;e--){let t=T[e];t!=null&&t.parentNode&&t.remove(),T.splice(e,1)}}var D=new Set;function O(e,t){D.has(e)||(D.add(e),document.addEventListener(e,t))}function se(){O(`click`,e=>{for(let t of T)t.__isOpen&&!t.contains(e.target)&&q(t,{restoreFocus:!1})})}function ce(){O(`keydown`,e=>{if(e.key===`Escape`){for(let e of T)if(e.__isOpen){q(e);return}}})}var le=0;function k(e,t){if(!e)return;let n=t?`true`:`false`;e.getAttribute(`aria-expanded`)!==n&&e.setAttribute(`aria-expanded`,n)}function ue(){if(window.__lcHistoryPatched)return;window.__lcHistoryPatched=!0,window.__lcLastUrl=window.__lcLastUrl||location.href;let e=e=>{let t=window.__lcLastUrl,n=location.href,r=t!==n;window.__lcLastUrl=n,!(!r&&e!==`popstate`)&&window.dispatchEvent(new Event(`lc:locationchange`))},t=history.pushState;typeof t==`function`&&(history.pushState=function(...n){let r=t.apply(this,n);return e(`pushState`),r});let n=history.replaceState;typeof n==`function`&&(history.replaceState=function(...t){let r=n.apply(this,t);return e(`replaceState`),r}),window.addEventListener(`popstate`,()=>e(`popstate`)),window.addEventListener(`hashchange`,()=>e(`hashchange`))}function A(e){var t;if(document.__lcVisibilityBound&&!e)return!0;if(typeof((t=window.LiveChatWidget)==null?void 0:t.on)!=`function`)return!1;let n=document.__lcVisibilityCb;if(n&&typeof window.LiveChatWidget.off==`function`)try{window.LiveChatWidget.off(`visibility_changed`,n)}catch(e){}let r=e=>{var t,n,r,i;let a=document.__lcStack;a!=null&&a.isConnected&&(e&&typeof e.visibility==`string`&&(a.__lcVisibility=e.visibility),(t=(n=document).__lcCurrentRebind)==null||t.call(n),(r=(i=document).__lcCurrentSync)==null||r.call(i))};return window.LiveChatWidget.on(`visibility_changed`,r),document.__lcVisibilityCb=r,document.__lcVisibilityBound=!0,!0}function j(e){if(A(e)||document.__lcVisibilityPolling)return;document.__lcVisibilityPolling=!0;let t=0,n=setInterval(()=>{(A(e)||++t>=200)&&(clearInterval(n),document.__lcVisibilityPolling=!1)},200)}function de(){document.__lcBodyMutationObs||typeof MutationObserver>`u`||(document.__lcBodyMutationObs=new MutationObserver(e=>{let t=document.__lcStack;if(t){for(let{removedNodes:r}of e)if(!(!r||r.length===0))for(let e of r){var n;if(e.nodeType===1&&(e===t||(n=e.contains)!=null&&n.call(e,t))){let e=document.__lcChannelWidgetsConfig;e&&P(e);return}}}}),document.__lcBodyMutationObs.observe(document.body,{childList:!0,subtree:!0}))}var M=null,N=null;function P(e){N=e,!M&&(M=setTimeout(()=>{M=null;let e=N;N=null,$(e)},100))}var F=`#chat-widget-minimized`,I=`#chat-overlay-container`,fe=`#chat-overlay-button`,pe=[F,I],L=15,R=100,z=150;function me(e){return{width:e.width,height:e.height,fromLeft:e.left,fromRight:window.innerWidth-e.right,fromTop:e.top,fromBottom:window.innerHeight-e.bottom}}function B(e){let t=e.fromLeft<=e.fromRight,n=e.fromTop<=e.fromBottom,r=t?e.fromLeft:window.innerWidth-e.fromRight-e.width,i=n?e.fromTop:window.innerHeight-e.fromBottom-e.height;return{left:r,top:i,right:r+e.width,bottom:i+e.height,width:e.width,height:e.height}}var V=60;function he(e){let t=window.innerWidth-e.right<=e.left,n=e.bottom,r=n-V,i=t?e.right:e.left+V;return{left:i-V,right:i,top:r,bottom:n,width:V,height:V}}var ge=200,_e=150;function H(e,t,{interval:n=ge,maxRetries:r=_e}={}){let i=0,a=setInterval(()=>{let n=document.querySelector(e);if(n){clearInterval(a),t(n);return}++i>=r&&clearInterval(a)},n)}function U(){if(document.getElementById(`lc-channel-widgets-style`))return;let e=document.createElement(`style`);e.id=`lc-channel-widgets-style`,e.textContent=`
|
|
2
2
|
.lc-channel-stack {
|
|
3
3
|
position: fixed;
|
|
4
4
|
top: 0;
|