@theymes/sdk 1.2.9 → 1.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.unity.js +1 -1
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},e.apply(this,arguments)};function t(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))}function n(e,t){var n,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[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(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(n=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(6===s[0]&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e],o=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function o(e,t,n){if(n||2===arguments.length)for(var o,i=0,r=t.length;i<r;i++)!o&&i in t||(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var i={unreadMessageCountUpdate:new Set,unansweredMessageCountUpdate:new Set,open:new Set,close:new Set};function r(e,t){i[e].add(t)}function a(e,t){i[e].delete(t)}function s(e,t){i[e].forEach((function(e){return e.apply(void 0,t)}))}var l='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .loader-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .loader {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 2rem;\n height: 2rem;\n animation: spin 1s linear infinite;\n transform-origin: center;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="loader-wrapper">\n <svg class="loader" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" fill="none" data-test-name="oval"\n role="img">\n <g fill="none" fill-rule="evenodd">\n <g transform="translate(1 1)" stroke-width="2">\n <circle stroke-opacity="0.5" cx="18" cy="18" r="18" />\n <path d="M36 18c0-9.94-8.06-18-18-18" />\n </g>\n </g>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',c='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: sans-serif;\n font-size: CSS_FONT_SIZE_PLACEHOLDER;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n .error-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n padding: 12px;\n }\n\n h1 {\n font-size: 18px;\n font-weight: 400;\n color: rgb(CSS_TEXT_PLACEHOLDER);\n }\n\n svg.error-icon {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="error-wrapper">\n <svg class="error-icon" width="91" height="91" viewBox="0 0 91 91" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M45.1079 89.1321C50.7158 89.1321 55.2618 84.5859 55.2618 78.9783C55.2618 73.3707 50.7158 68.8245 45.1079 68.8245C39.5001 68.8245 34.9541 73.3707 34.9541 78.9783C34.9541 84.5859 39.5001 89.1321 45.1079 89.1321Z"\n stroke="#FFB547" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />\n <path d="M24.7637 58.6355C35.9988 47.4005 54.2144 47.4005 65.4492 58.6355" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M12.7988 46.6689C22.1436 37.3241 34.529 32.8731 46.7703 33.3159" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M1.1084 34.4283C11.6674 23.9971 25.012 18.0833 38.7295 16.6868" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M89.1082 1.13208L62.0312 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M62.0312 1.13208L89.1082 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n </svg>\n <div>\n <h1>Connection error</h1>\n </div>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',d="<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\"\n content=\"viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\" />\n <meta name=\"theme-color\" content=\"#000000\" />\n <meta name=\"robots\" content=\"noindex\" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: 'TheymesBody';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .sdk-button {\n display: flex;\n font-family: 'TheymesBody', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n background: rgb(CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: rgb(CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER);\n font-size: 14px;\n font-weight: 700;\n cursor: pointer;\n text-align: center;\n padding: 0 12px;\n border: none;\n outline: none;\n border-radius: 999px;\n box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);\n position: relative;\n }\n\n .sdk-button-badge {\n position: absolute;\n top: 0;\n right: 0;\n background: rgb(CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER);\n width: 12px;\n height: 12px;\n border-radius: 999px;\n display: none;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <button class=\"sdk-button\">\n <span class=\"sdk-button-text\">WIDGET_BUTTON_TEXT_PLACEHOLDER</span>\n <span class=\"sdk-button-badge\"></span>\n </button>\n <script NONCE_ATTR_PLACEHOLDER>\n let unreadMessageCount = UNREAD_MESSAGE_COUNT_PLACEHOLDER;\n\n function openWidget() {\n parent.postMessage({ action: 'theymes.sdkButtonClicked' }, '*');\n }\n\n function iframeSubscriber(e) {\n if (e.data.action === 'unreadMessageCountUpdate') {\n unreadMessageCount = e.data.count;\n updateUnreadMessageCount()\n } else if (e.data.action === 'widgetButtonTextUpdate') {\n document.querySelector('.sdk-button-text').textContent = e.data.text;\n }\n }\n\n function updateUnreadMessageCount() {\n if (unreadMessageCount > 0) {\n document.querySelector('.sdk-button-badge').style.display = 'block';\n } else {\n document.querySelector('.sdk-button-badge').style.display = 'none';\n }\n }\n\n document.querySelector('.sdk-button').addEventListener('click', openWidget);\n window.addEventListener('message', iframeSubscriber, false);\n\n updateUnreadMessageCount();\n <\/script>\n</body>\n\n</html>",u="1.2.9",g="colors",p="locs",f="fonts",m="recordRetentionAfterSecs",v="resetSessionAfterSecs",h="web",y={sdkDialog:"#theymes-sdk-dialog",sdkIframeWrapper:"#theymes-sdk-wrapper",sdkIframe:"#theymes-sdk",sdkLoaderIframe:"#theymes-sdk-loader",notificationDialog:"#theymes-sdk-notification-dialog",notificationIframe:"#theymes-sdk-notification",sdkButtonIframe:"#theymes-sdk-button",sdkStylesheet:"#theymes-sdk-stylesheet"},b=340,w=680,x=500,S=120,E=48,T=.2,k=.2,C=.2,O="theymes_path_on_init",L="url('https://fonts.gstatic.com/s/poppins/v22/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2') format('woff2')",I=function(e){var t;try{return null!==(t=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e))&&void 0!==t?t:null}catch(e){return null}},_=function(e,t){try{null===localStorage||void 0===localStorage||localStorage.setItem(e,t)}catch(e){}},R={length:0,getItem:function(e){var t;try{return null!==(t=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem(e))&&void 0!==t?t:null}catch(e){return null}},setItem:function(e,t){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.setItem(e,t)}catch(e){}},removeItem:function(e){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.removeItem(e)}catch(e){}},clear:function(){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.clear()}catch(e){}},key:function(e){var t;try{return null!==(t=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.key(e))&&void 0!==t?t:null}catch(e){return null}}},P=28800,A=function(){var t=null,n=P,o={text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}},i={widgetButtonText:{}},r=N();try{t=function(){var e=I(m);if(e){var t=JSON.parse(e);if("number"==typeof t)return t}return null}(),n=function(){var e=I(v);if(e){var t=JSON.parse(e);if("number"==typeof t)return t}return D()}(),o=function(){var t=I(g);if(t){var n=JSON.parse(t);return e(e({},{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}),n)}return{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}}(),i=function(){var t=I(p);if(t){var n=JSON.parse(t);return e(e({},{widgetButtonText:{}}),n)}return{widgetButtonText:{}}}(),r=function(){var t=I(f);if(t){var n=JSON.parse(t);return e(e({},N()),n)}return N()}()}catch(e){console.error("Error initializing internals",e)}return{token:null,domain:null,mode:"game",deviceId:null,position:"bottom-right",widgetButton:!1,widgetButtonAction:"support",x:20,y:20,loggingEnabled:!1,element:null,language:null,userLanguage:navigator.language,tags:new Set,fields:{},youngPlayer:!1,privacyMode:!1,signedMetadataToken:null,isLoggedIn:!1,isInForeground:!0,hasNetworkConnectivity:!0,player:null,sdkIsOpen:!1,forceUpdateSdkDialog:!1,recordRetentionAfterSecs:t,resetSessionAfterSecs:n,sessionStatus:"waiting",sessionStartTime:null,sessionResumeOrStartTime:null,retentionRemainingSeconds:null,isRetentionRecordedForSession:!1,recordRetentionTimerId:null,retryRecordRetentionTimerId:null,retryIntervalSecs:300,networkErrorTimerId:null,colors:o,locs:i,fonts:r,notificationsPaused:!0,notifications:[],visibleNotification:null,unreadMessageCount:0,unansweredMessageCount:0,previousPath:null,previousConfig:null,nonce:null,keyboardHeight:0,disableInsets:!1}}();function N(){return{body:void 0}}function D(){return P}var B=function(e,t){return e===t||Boolean(e&&t&&"object"==typeof e&&"object"==typeof t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((function(e){var n=e[0],o=e[1];return B(o,t[n])})))};function M(e){var t,n=e.iframe,o=e.content,i=null===(t=n.contentWindow)||void 0===t?void 0:t.document;i&&(i.open(),i.write(o),i.close())}function H(e){return"".concat(e.r,", ").concat(e.g,", ").concat(e.b)}function F(e){var t,n,o,i;return e.template.replace(/PLATFORM_PLACEHOLDER/g,h).replace(/INSET_TOP_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-top, 0px)").replace(/INSET_BOTTOM_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)").replace(/INSET_LEFT_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-left, 0px)").replace(/INSET_RIGHT_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-right, 0px)").replace(/CSS_TEXT_PLACEHOLDER/g,H(A.colors.text)).replace(/CSS_BORDER_PLACEHOLDER/g,H(A.colors.border)).replace(/CSS_BACKGROUND_PLACEHOLDER/g,H(A.colors.background)).replace(/CSS_TILE_PLACEHOLDER/g,H(A.colors.tile)).replace(/CSS_ACCENT_PLACEHOLDER/g,H(A.colors.accent)).replace(/CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER/g,H(A.colors.notificationBackground)).replace(/CSS_NOTIFICATION_TEXT_PLACEHOLDER/g,H(A.colors.notificationText)).replace(/CSS_FONT_SIZE_PLACEHOLDER/g,"game"===A.mode?"16px":"14px").replace(/CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER/g,null!==(n=null===(t=A.fonts.body)||void 0===t?void 0:t.regular)&&void 0!==n?n:L).replace(/CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER/g,null!==(i=null===(o=A.fonts.body)||void 0===o?void 0:o.fallback)&&void 0!==i?i:"ui-sans-serif, system-ui, sans-serif").replace(/NONCE_ATTR_PLACEHOLDER/g,A.nonce?'nonce="'.concat(A.nonce,'"'):"")}var j=function(e,t,n){return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];try{return t.apply(void 0,o)}catch(t){return console.error("Error in ".concat(e),t),n}}},U='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: \'TheymesBody\';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: \'TheymesBody\', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n }\n\n html,\n body {\n width: 100%;\n height: auto;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n width: 1.25rem;\n height: 1.25rem;\n }\n\n .notification {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background: rgb(CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: auto;\n margin: 0;\n padding: 12px;\n border-radius: 6px;\n color: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n }\n\n .notification-text {\n flex: 1 0 0%;\n font-size: 0.875rem;\n /* 14/16 */\n line-height: 1.2;\n display: -webkit-box;\n line-clamp: 2;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n\n .close-button {\n flex: 0 0 auto;\n padding-left: 10px;\n cursor: pointer;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="notification">\n <div class="notification-text">NOTIFICATION_TEXT_PLACEHOLDER</div>\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6 6 18"></path>\n <path d="m6 6 12 12"></path>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeNotification() {\n parent.postMessage({ action: \'theymes.closeNotification\' }, \'*\');\n }\n\n function notificationClicked() {\n parent.postMessage({ action: \'theymes.handleNotificationAction\' }, \'*\');\n }\n\n document.querySelector(\'.notification-text\').addEventListener(\'click\', notificationClicked);\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeNotification);\n <\/script>\n</body>\n\n</html>',q=/(android|bb\d+|meego).+mobile|armv7l|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|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,W=/CrOS/,G=/android|ipad|playbook|silk/i;function Y(){return!!function(e){e||(e={});var t=e.ua;if(t||"undefined"==typeof navigator||(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"!=typeof t)return!1;var n=q.test(t)&&!W.test(t)||!!e.tablet&&G.test(t);return!n&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==t.indexOf("Macintosh")&&-1!==t.indexOf("Safari")&&(n=!0),n}({tablet:!0})&&(window.innerWidth<x||window.innerHeight<x)}function z(e){var t=e.type,n=A.position,o=A.x,i=A.y;return Y()&&"widget"===t?{top:"0",left:"0",right:"0",bottom:"0"}:"top-left"===n?{top:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",bottom:"auto"}:"top-right"===n?{top:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",bottom:"auto"}:"bottom-left"===n?{bottom:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",top:"auto"}:{bottom:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",top:"auto"}}function J(){return Y()?{width:"100%",height:"100%",maxWidth:"none",maxHeight:"none"}:{width:"".concat(b,"px"),height:"".concat(w,"px"),maxWidth:"none",maxHeight:"calc(100vh - ".concat(2*A.y,"px)")}}function K(e){var t=document.querySelector(y.sdkButtonIframe);if(t)var n=setInterval((function(){var o,i;"complete"===(null===(o=t.contentDocument)||void 0===o?void 0:o.readyState)&&(clearInterval(n),null===(i=null==t?void 0:t.contentWindow)||void 0===i||i.postMessage(e,"*"))}),100)}function X(){var e,t,n=A.notifications[0];if(n&&!A.visibleNotification){A.visibleNotification=n;var o=null!==(e=document.querySelector(y.notificationDialog))&&void 0!==e?e:document.createElement("div");o.id=y.notificationDialog.replace("#",""),o.style.position="fixed",o.style.border="none",o.style.margin="0",o.style.padding="0",o.style.zIndex="9999",o.style.colorScheme="auto",o.style.backgroundColor="transparent",o.style.pointerEvents="none",o.style.overflow="hidden",document.body.appendChild(o);var i,r=null!==(t=o.querySelector(y.notificationIframe))&&void 0!==t?t:document.createElement("iframe");r.id=y.notificationIframe.replace("#",""),r.style.position="absolute",r.style.border="none",r.style.width="0",r.style.height="0",r.style.top="-20px",r.style.left="0",r.style.colorScheme="auto",r.style.pointerEvents="auto",r.style.marginTop="-20px",r.style.opacity="0",r.style.transition="opacity ".concat(C,"s ease-in-out, margin-top ").concat(C,"s ease-in-out"),o.appendChild(r),M({iframe:r,content:(i={text:n.text},F({template:U}).replace(/NOTIFICATION_TEXT_PLACEHOLDER/g,i.text))}),setTimeout((function(){r.style.opacity="1",r.style.marginTop="0px",V()}),500),n.closeAfterSeconds>0&&setTimeout((function(){Z({notification:n})}),1e3*n.closeAfterSeconds)}}function V(){var e,t,n,o=document.querySelector(y.notificationDialog),i=document.querySelector(y.notificationIframe);if(o&&i){var r=(null===(n=null===(t=null===(e=i.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.body)||void 0===n?void 0:n.scrollHeight)?"".concat(i.contentWindow.document.body.scrollHeight,"px"):"0";if("widget"===A.mode){var a=z({type:"widget"}),s=J(),l="calc(".concat(s.width," - 20px)");o.style.bottom=a.bottom,o.style.right=a.right,o.style.left=a.left,o.style.top=a.top,o.style.overflow="hidden",i.style.width=l}else if(A.element){var c=A.element.getBoundingClientRect();l="".concat(c.width-20,"px");o.style.top="".concat(c.top,"px"),o.style.left="".concat(c.left,"px"),o.style.right="".concat(c.right,"px"),o.style.bottom="".concat(c.bottom,"px"),o.style.overflow="hidden",i.style.width=l}else{l="calc(100% - 20px)";o.style.top=A.disableInsets?"0px":"env(safe-area-inset-top, 0px)",o.style.left=A.disableInsets?"0px":"env(safe-area-inset-left, 0px)",o.style.right=A.disableInsets?"0px":"env(safe-area-inset-right, 0px)",o.style.bottom=A.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)",o.style.overflow="visible",i.style.width=l}i.style.height=r,i.style.top="10px",i.style.left="10px"}}function Z(e){if(e.notification&&A.visibleNotification===e.notification){var t=document.querySelector(y.notificationIframe),n=document.querySelector(y.notificationDialog);t&&(t.style.opacity="0",t.style.marginTop="-20px",setTimeout((function(){null==n||n.remove(),A.notifications=A.notifications.slice(1),A.visibleNotification=null,X()}),1e3*C))}}var Q=function(){function i(){Object.defineProperty(this,"isRunning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pollWhenNotificationsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"lastPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nextPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.resumeIfNeeded(!1)}return Object.defineProperty(i.prototype,"onIsInForegroundChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){A.isInForeground?this.resumeIfNeeded(!1):this.pauseIfNeeded()}}),Object.defineProperty(i.prototype,"onHasNetworkConnectivityChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!1)}}),Object.defineProperty(i.prototype,"resume",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.isRunning=!0;var t=new Date;if(this.nextPollDate&&!e||(this.nextPollDate=new Date(t.getTime()+1e3)),t>=this.nextPollDate)this.pollEventsRequest();else{var n=(this.nextPollDate.getTime()-t.getTime())/1e3;this.scheduleNextPollEventsRequest(n)}}}),Object.defineProperty(i.prototype,"pause",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning=!1,this.timer&&(clearTimeout(this.timer),this.timer=null)}}),Object.defineProperty(i.prototype,"shouldBeRunning",{enumerable:!1,configurable:!0,writable:!0,value:function(){return A.isLoggedIn&&A.isInForeground&&A.hasNetworkConnectivity&&!A.sdkIsOpen}}),Object.defineProperty(i.prototype,"resumeIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(e){!this.shouldBeRunning()||this.isRunning&&!e||this.resume(e)}}),Object.defineProperty(i.prototype,"pauseIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&!this.shouldBeRunning()&&this.pause()}}),Object.defineProperty(i.prototype,"onEnableNotifications",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&this.pollWhenNotificationsEnabled&&this.scheduleNextPollEventsRequest(0)}}),Object.defineProperty(i.prototype,"onOpen",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(i.prototype,"onClose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(i.prototype,"onLogin",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(i.prototype,"onLogout",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(i.prototype,"scheduleNextPollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this.nextPollDate=new Date(Date.now()+1e3*e),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){t.timer=null,t.pollEventsRequest()}),1e3*e)}}),Object.defineProperty(i.prototype,"pollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(){return t(this,void 0,void 0,(function(){var t,i,r,a,l,c,d,u,g;return n(this,(function(n){switch(n.label){case 0:if(!A.token||!A.domain||!A.deviceId)return[2];if(!this.isRunning)return[2];if(this.lastPollDate&&(t=new Date(this.lastPollDate.getTime()+6e4),(i=(t.getTime()-Date.now())/1e3)>0))return this.scheduleNextPollEventsRequest(i),[2];this.lastPollDate=new Date,r=A.notificationsPaused||A.sdkIsOpen?"true":"false",a=new URLSearchParams(e(e({token:A.token,language:null!==(u=A.language)&&void 0!==u?u:"en",deviceId:A.deviceId,notificationsPaused:r,mode:A.mode},(null===(g=A.player)||void 0===g?void 0:g.id)?{unsignedPlayerId:A.player.id}:{}),A.signedMetadataToken?{signedMetadataToken:A.signedMetadataToken}:{})).toString(),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch("https://".concat(A.domain,"/api/sdk/events?").concat(a),{method:"GET"})];case 2:if(!(l=n.sent()).ok)throw new Error("HTTP error! status: ".concat(l.status));return[4,l.json()];case 3:return c=n.sent(),this.scheduleNextPollEventsRequest(c.nextPollSeconds),void 0!==c.pollWhenNotificationsEnabled&&(this.pollWhenNotificationsEnabled=c.pollWhenNotificationsEnabled),A.notifications=o(o([],A.notifications,!0),c.notifications,!0),A.notifications.length>0&&X(),c.unansweredMessageCount!==A.unansweredMessageCount&&(A.unansweredMessageCount=c.unansweredMessageCount,s("unansweredMessageCountUpdate",[c.unansweredMessageCount])),c.unreadMessageCount!==A.unreadMessageCount&&(A.unreadMessageCount=c.unreadMessageCount,s("unreadMessageCountUpdate",[c.unreadMessageCount]),K({action:"unreadMessageCountUpdate",count:c.unreadMessageCount})),[3,5];case 4:return d=n.sent(),console.error("Error fetching events:",d),this.scheduleNextPollEventsRequest(A.retryIntervalSecs),[3,5];case 5:return[2]}}))}))}}),i}(),$={eventPoller:null},ee=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onLogin()},te=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onLogout()},ne=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onOpen()},oe=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onClose()},ie=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onEnableNotifications()},re=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onIsInForegroundChanged()},ae=function(e){var t="/help-center";pe({path:t,config:e}),ge({path:t,config:e})},se=function(e){var t="/assistant";pe({path:t,config:e}),ge({path:t,config:e})},le=function(){!function(){var e=document.querySelector(y.sdkDialog),t=document.querySelector(y.sdkIframeWrapper);if(e){var n=function(){"widget"!==A.mode||A.forceUpdateSdkDialog?e.remove():e.style.display="none",A.forceUpdateSdkDialog=!1};t?(t.style.opacity="0",t.style.transform=ye({animation:"start"}),setTimeout((function(){n()}),1e3*T)):n()}A.widgetButton&&he();s("close",[])}()},ce=function(){try{return CSS.supports("color","var(--color)")&&CSS.supports("color","rgb(255 255 255 / 0.5)")}catch(e){return!1}},de=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r.apply(void 0,e)};function ue(t){var n,i,r,a,s,l,c=(null!=t?t:{}).config;if(!A.token||!A.domain||!A.deviceId)return null;var d=null!==(n=null==c?void 0:c.tags)&&void 0!==n?n:[],g=null!==(i=null==c?void 0:c.fields)&&void 0!==i?i:{},p=null!==(a=null!==(r=null==c?void 0:c.language)&&void 0!==r?r:A.language)&&void 0!==a?a:null,f=null!==(s=A.signedMetadataToken)&&void 0!==s?s:null,m=null!==(l=A.player)&&void 0!==l?l:null,v={_platform:h,_sdkVersion:u};A.youngPlayer&&(v._youngPlayer=!0),(A.privacyMode||A.youngPlayer)&&(v._privacyMode=!0);var y=o(o([],Array.from(A.tags),!0),d,!0),b=e(e(e({},A.fields),g),v);return{token:A.token,domain:A.domain,deviceId:A.deviceId,tags:y,fields:b,language:p,signedMetadataToken:f,player:m}}function ge(e){var t,n,o,i=ue({config:e.config});if(i){var r=null!==(t=document.querySelector(y.sdkDialog))&&void 0!==t?t:document.createElement("div");r.id=y.sdkDialog.replace("#",""),r.style.display="block",r.style.position="fixed",r.style.border="none",r.style.width="0",r.style.height="0",r.style.margin="0",r.style.padding="0",r.style.zIndex="9998",r.style.overflow="hidden",r.style.backgroundColor="transparent";var a=null!==(n=r.querySelector(y.sdkIframeWrapper))&&void 0!==n?n:document.createElement("div");a.id=y.sdkIframeWrapper.replace("#",""),a.style.position="relative",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.right="0",a.style.bottom="0",a.style.left="0",a.style.opacity="0",a.style.colorScheme="auto",a.style.border="none",a.style.backgroundColor="rgb(".concat(H(A.colors.background),")"),a.style.transform=ye({animation:"start"}),a.style.transition=(A.mode,"opacity ".concat(T,"s ease-in-out, transform ").concat(T,"s ease-in-out")),"widget"===A.mode&&(a.style.overflow="hidden");var d=null!==(o=a.querySelector(y.sdkLoaderIframe))&&void 0!==o?o:document.createElement("iframe");d.id=y.sdkLoaderIframe.replace("#",""),d.style.position="absolute",d.style.border="none",d.style.width="100%",d.style.height="100%",d.style.top="0",d.style.right="0",d.style.bottom="0",d.style.left="0",d.style.colorScheme="auto";var u=a.querySelector(y.sdkIframe),g=null!=u?u:document.createElement("iframe"),p=setInterval((function(){var e;"complete"===(null===(e=g.contentDocument)||void 0===e?void 0:e.readyState)&&(clearInterval(p),m())}),500);g.id=y.sdkIframe.replace("#",""),g.style.position="absolute",g.style.border="none",g.style.top="0",g.style.right="0",g.style.bottom="0",g.style.left="0",g.style.colorScheme="auto",u&&!A.networkErrorTimerId||(g.src=function(e){var t=e.path,n=e.supportViewConfig,o="https://".concat(A.domain,"/sdk"),i=new URLSearchParams;i.set("platform",h),i.set("token",n.token),i.set("deviceId",n.deviceId),i.set("mode",A.mode),i.set("origin",window.location.origin),i.set("userLanguage",A.userLanguage),A.disableInsets&&i.set("disableInsets","true");n.language&&i.set("language",n.language);ce()||i.set("unsupported","true");var r=me({supportViewConfig:n});return i.set("metadata",JSON.stringify(r)),"".concat(o).concat(t,"?").concat(i.toString())}({path:e.path,supportViewConfig:i}),g.style.width="0",g.style.height="0",r.appendChild(a),a.appendChild(d),a.appendChild(g),document.body.appendChild(r)),M({iframe:d,content:F({template:l})});var f=!1,m=function(){f||(f=!0,A.networkErrorTimerId=setTimeout((function(){M({iframe:d,content:F({template:c})})}),1e4))};g.onload=m,g.onerror=function(){M({iframe:d,content:F({template:c})})},ve(),s("open",[]),setTimeout((function(){a.style.opacity="1",a.style.transform=ye({animation:"end"})}),100)}}function pe(e){var t=e.path,n=e.config,o=null!=n?n:null;A.previousPath===t&&B(A.previousConfig,o)||(A.previousPath=t,A.previousConfig=o,fe())}function fe(){var e=document.querySelector(y.sdkDialog);A.sdkIsOpen?A.forceUpdateSdkDialog=!0:null==e||e.remove()}function me(e){var t=e.supportViewConfig,n={unsigned:{},signed:void 0};return t.player&&(n.unsigned.player=t.player),t.tags&&(n.unsigned.tags=t.tags),t.fields&&(n.unsigned.fields=t.fields),t.signedMetadataToken&&(n.signed=t.signedMetadataToken),n}function ve(){var e=document.querySelector(y.sdkDialog),t=document.querySelector(y.sdkIframeWrapper);if(e&&t)if("widget"===A.mode){var n=z({type:"widget"}),o=J();e.style.width=o.width,e.style.height=o.height,e.style.maxWidth=o.maxWidth,e.style.maxHeight=o.maxHeight,e.style.bottom=n.bottom,e.style.right=n.right,e.style.left=n.left,e.style.top=n.top,Y()?(t.style.border="none",t.style.borderRadius="0"):(t.style.border="1px solid rgb(".concat(H(A.colors.border),")"),t.style.borderRadius="10px")}else if(t.style.border="none",t.style.borderRadius="0",A.element){var i=A.element.getBoundingClientRect(),r=i.width,a=i.height,s=i.top,l=i.left,c=i.right,d=i.bottom;e.style.width="".concat(r,"px"),e.style.height="".concat(a,"px"),e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="".concat(s,"px"),e.style.left="".concat(l,"px"),e.style.right="".concat(c,"px"),e.style.bottom="".concat(d,"px")}else{a=A.keyboardHeight>0?"calc(100% - ".concat(A.keyboardHeight,"px + env(safe-area-inset-bottom) - 10px)"):"100%";e.style.width="100%",e.style.height=a,e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0"}}function he(){var e,t=null!==(e=document.querySelector(y.sdkButtonIframe))&&void 0!==e?e:document.createElement("iframe");if(t){var n,o=z({type:"button"});t.id=y.sdkButtonIframe.replace("#",""),t.style.position="fixed",t.style.border="none",t.style.width="".concat(S,"px"),t.style.height="".concat(E,"px"),t.style.maxWidth="95%",t.style.maxHeight="95%",t.style.bottom=o.bottom,t.style.right=o.right,t.style.left=o.left,t.style.top=o.top,t.style.margin="0",t.style.padding="0",t.style.zIndex="9997",t.style.backgroundColor="transparent",t.style.opacity="0",t.style.transform="scale(0.8)",t.style.transition="opacity ".concat(k,"s ease-in-out, transform ").concat(k,"s ease-in-out"),setTimeout((function(){t.style.opacity="1",t.style.transform="scale(1)"}),100),document.body.appendChild(t),M({iframe:t,content:(n={unreadMessageCount:A.unreadMessageCount},F({template:d}).replace(/UNREAD_MESSAGE_COUNT_PLACEHOLDER/g,"".concat(n.unreadMessageCount)).replace(/CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER/g,H(A.colors.widgetButtonBackground)).replace(/CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER/g,H(A.colors.widgetButtonText)).replace(/CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER/g,H(A.colors.widgetButtonActionPending)).replace(/WIDGET_BUTTON_TEXT_PLACEHOLDER/g,ke()))})}}function ye(e){return"start"===e.animation?"game"===A.mode?"translateY(20%)":"scale(0.8)":"game"===A.mode?"translateY(0)":"scale(1)"}function be(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,7]),[4,e.json()];case 1:return[2,t.sent()];case 2:t.sent(),t.label=3;case 3:return t.trys.push([3,5,,6]),[4,e.text()];case 4:return[2,t.sent()];case 5:return t.sent(),[2,void 0];case 6:return[3,7];case 7:return[2]}}))}))}function we(){return t(this,void 0,void 0,(function(){var e,t,o,i,r,a;return n(this,(function(n){switch(n.label){case 0:if(Ee(),A.retryRecordRetentionTimerId&&(clearTimeout(A.retryRecordRetentionTimerId),A.retryRecordRetentionTimerId=null),A.retentionRemainingSeconds=null,A.isRetentionRecordedForSession=!0,!(e=ue()))return[2];t="https://".concat(A.domain,"/api/sdk/retention"),o=me({supportViewConfig:e}),i={token:A.token,deviceId:A.deviceId,language:A.language,metadata:o},n.label=1;case 1:return n.trys.push([1,5,,6]),[4,fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})];case 2:return(r=n.sent()).ok?[3,4]:[4,be(r)];case 3:throw n.sent();case 4:return[3,6];case 5:return a=n.sent(),console.error("Error tracking retention:",a),A.retryRecordRetentionTimerId=setTimeout(we,6e4),[3,6];case 6:return[2]}}))}))}function xe(){var e=new Date;if(A.sessionStatus="active",A.sessionResumeOrStartTime=e,A.sessionStartTime){var t=A.sessionStartTime.valueOf()/1e3+A.resetSessionAfterSecs;Date.now()/1e3>t&&Se()}else Se();null!==A.retentionRemainingSeconds&&(A.recordRetentionTimerId=setTimeout(we,1e3*A.retentionRemainingSeconds))}function Se(){A.sessionStartTime=new Date,A.retentionRemainingSeconds=A.recordRetentionAfterSecs,A.isRetentionRecordedForSession=!1,Ee()}function Ee(){A.recordRetentionTimerId&&(clearTimeout(A.recordRetentionTimerId),A.recordRetentionTimerId=null)}function Te(){A.isRetentionRecordedForSession&&we()}function ke(){var e,t,n;return null!==(n=null===(e=A.locs.widgetButtonText)||void 0===e?void 0:e[null!==(t=A.language)&&void 0!==t?t:"en"])&&void 0!==n?n:"Support"}function Ce(){var e=A.isInForeground,t="visible"===document.visibilityState&&document.hasFocus();A.isInForeground=t,e!==t&&re(),t&&"paused"===A.sessionStatus?xe():t||"active"!==A.sessionStatus||function(){if(A.sessionResumeOrStartTime&&A.retentionRemainingSeconds){var e=Math.floor((Date.now()-A.sessionResumeOrStartTime.valueOf())/1e3);A.retentionRemainingSeconds-=e}A.sessionStatus="paused",Ee()}()}function Oe(){var e,t=A.isLoggedIn,n=Boolean(A.signedMetadataToken||(null===(e=A.player)||void 0===e?void 0:e.id));A.isLoggedIn=n,n&&!t?ee():!n&&t&&te()}try{document.addEventListener("visibilitychange",Ce),window.addEventListener("focus",Ce),window.addEventListener("blur",Ce),window.addEventListener("resize",ve),window.addEventListener("resize",V),window.addEventListener("message",(function(e){if("theymes.ready"===e.data.action){var t=document.querySelector(y.sdkLoaderIframe),n=document.querySelector(y.sdkIframe);A.networkErrorTimerId&&(clearTimeout(A.networkErrorTimerId),A.networkErrorTimerId=null),n&&(n.style.width="100%",n.style.height="100%"),t&&t.remove()}else if("theymes.close"===e.data.action)le();else if("theymes.closeNotification"===e.data.action)Z({notification:A.visibleNotification});else if("theymes.handleNotificationAction"===e.data.action)r={notification:A.visibleNotification},(null==(a=r.notification)?void 0:a.action)&&"OPEN_PAGE"===a.action.type&&(ge({path:a.action.path}),Z({notification:a}));else if("theymes.sdkButtonClicked"===e.data.action)(i=document.querySelector(y.sdkButtonIframe))&&(i.style.opacity="0",i.style.transform="scale(0.8)",setTimeout((function(){i.remove()}),1e3*k)),"support"===A.widgetButtonAction?ae():"assistant"===A.widgetButtonAction&&se();else if("theymes.openExternalPage"===e.data.action){var o=e.data.url.startsWith(window.location.origin);o&&function(e){var t=e.key,n=e.value,o=e.ttlMs,i=e.storage,r=void 0===i?R:i,a={value:n,expiry:Date.now()+o};r.setItem(t,JSON.stringify(a))}({key:O,value:e.data.path,ttlMs:1e4}),window.open(e.data.url,o?"_self":"_blank")}var i,r,a}),!1),de("open",(function(){A.sdkIsOpen=!0,ne()})),de("close",(function(){A.sdkIsOpen=!1,oe()}))}catch(e){console.error("Error adding event listeners to SDK",e)}var Le=j("initialize",(function(o,i,r){return t(void 0,void 0,void 0,(function(){var t,a,s,l,c,d,u,y,b,w,x,S,E,T;return n(this,(function(n){switch(n.label){case 0:if(!o||!i||!r.mode)throw new Error("Token, domain, and mode are required");A.token=o,A.domain=i,A.mode=r.mode,A.element="element"in r&&void 0!==r.element?r.element:A.element,A.language=null!==(u=r.language)&&void 0!==u?u:A.language,A.nonce=null!==(y=r.nonce)&&void 0!==y?y:A.nonce,A.deviceId=function(){var e=I("deviceId");if(e)return e;var t=(n=Date.now(),"undefined"!=typeof performance&&"function"==typeof performance.now&&(n+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"===e?t:3&t|8).toString(16)})));return _("deviceId",t),t;var n}(),A.widgetButton="button"in r&&void 0!==r.button&&null!==(b=r.button)&&void 0!==b?b:A.widgetButton,A.widgetButtonAction="buttonAction"in r&&void 0!==r.buttonAction&&null!==(w=r.buttonAction)&&void 0!==w?w:A.widgetButtonAction,A.position="position"in r&&void 0!==r.position&&null!==(x=r.position)&&void 0!==x?x:A.position,A.x="x"in r&&void 0!==r.x?r.x:A.x,A.y="y"in r&&void 0!==r.y?r.y:A.y,A.disableInsets="game"===A.mode&&null!==A.element,$.eventPoller||($.eventPoller=new Q),t="https://".concat(i,"/api/sdk/settings"),a=new URLSearchParams({token:A.token,platform:h,mode:A.mode}).toString(),n.label=1;case 1:return n.trys.push([1,6,,7]),[4,fetch("".concat(t,"?").concat(a),{method:"GET"})];case 2:return(s=n.sent()).ok?[3,4]:[4,be(s)];case 3:throw n.sent();case 4:return[4,s.json()];case 5:return l=n.sent(),(null===(S=null==l?void 0:l.branding)||void 0===S?void 0:S.colors)&&(N=l.branding.colors,A.colors=e(e({},A.colors),N),_(g,JSON.stringify(A.colors))),(null===(E=null==l?void 0:l.branding)||void 0===E?void 0:E.locs)&&(P=l.branding.locs,A.locs=e(e({},A.locs),P),_(p,JSON.stringify(A.locs))),(null===(T=null==l?void 0:l.branding)||void 0===T?void 0:T.fonts)&&(L=l.branding.fonts,A.fonts=e(e({},A.fonts),L),_(f,JSON.stringify(A.fonts))),"number"!=typeof(null==l?void 0:l.recordRetentionAfterSecs)&&null!==(null==l?void 0:l.recordRetentionAfterSecs)||(C=l.recordRetentionAfterSecs,A.recordRetentionAfterSecs=C,_(m,JSON.stringify(A.recordRetentionAfterSecs))),"number"!=typeof(null==l?void 0:l.resetSessionAfterSecs)&&null!==(null==l?void 0:l.resetSessionAfterSecs)||(k=l.resetSessionAfterSecs,A.resetSessionAfterSecs=null!=k?k:D(),_(v,JSON.stringify(A.resetSessionAfterSecs))),xe(),fe(),c=function(e){var t=e.key,n=e.storage,o=void 0===n?R:n,i=e.removeItem,r=void 0!==i&&i,a=o.getItem(t);if(!a)return null;var s=JSON.parse(a);return Date.now()>s.expiry?(o.removeItem(t),null):(r&&o.removeItem(t),s.value)}({key:O,removeItem:!0}),c&&"widget"===A.mode&&!Y()?ge({path:c}):A.widgetButton&&he(),[3,7];case 6:return d=n.sent(),console.error("Error initializing SDK:",d),[3,7];case 7:return[2]}var k,C,L,P,N}))}))}),void 0),Ie=j("openSupport",ae,void 0),_e=j("openAssistant",se,void 0),Re=j("openResource",(function(e,t){var n="/resources/".concat(e);pe({path:n,config:t}),ge({path:n,config:t})}),void 0),Pe=j("close",le,void 0),Ae=j("getLanguage",(function(){return A.language}),null),Ne=j("setLanguage",(function(e){var t=A.language!==e;A.language=e,t&&(fe(),K({action:"widgetButtonTextUpdate",text:ke()}))}),void 0),De=j("getSignedMetadataToken",(function(){return A.signedMetadataToken}),null),Be=j("setSignedMetadataToken",(function(e){var t=A.signedMetadataToken!==e;A.signedMetadataToken=e,Oe(),t&&(fe(),Te())}),void 0),Me=j("getPlayer",(function(){return A.player}),null),He=j("setPlayer",(function(e){var t,n=(null===(t=A.player)||void 0===t?void 0:t.id)!==(null==e?void 0:e.id);A.player=e,Oe(),n&&(fe(),Te())}),void 0),Fe=j("getTags",(function(){return Array.from(A.tags)}),[]),je=j("setTags",(function(e){A.tags=new Set(e),fe()}),void 0),Ue=j("addTag",(function(e){A.tags.add(e),fe()}),void 0),qe=j("addTags",(function(e){e.forEach((function(e){return A.tags.add(e)})),fe()}),void 0),We=j("removeTag",(function(e){A.tags.delete(e),fe()}),void 0),Ge=j("removeTags",(function(e){e.forEach((function(e){return A.tags.delete(e)})),fe()}),void 0),Ye=j("removeAllTags",(function(){A.tags.clear(),fe()}),void 0),ze=j("getFields",(function(){return A.fields}),{}),Je=j("setFields",(function(e){A.fields=e,fe()}),void 0),Ke=j("addField",(function(e,t){A.fields[e]=t,fe()}),void 0),Xe=j("addFields",(function(t){A.fields=e(e({},A.fields),t),fe()}),void 0),Ve=j("removeField",(function(e){delete A.fields[e],fe()}),void 0),Ze=j("removeFields",(function(e){e.forEach((function(e){return delete A.fields[e]})),fe()}),void 0),Qe=j("removeAllFields",(function(){A.fields={},fe()}),void 0),$e=j("enableLogging",(function(){A.loggingEnabled=!0}),void 0),et=j("disableLogging",(function(){A.loggingEnabled=!1}),void 0),tt=j("isYoungPlayer",(function(){return A.youngPlayer}),!1),nt=j("setYoungPlayer",(function(e){A.youngPlayer=e,fe()}),void 0),ot=j("isPrivacyMode",(function(){return A.privacyMode}),!1),it=j("setPrivacyMode",(function(e){A.privacyMode=e,fe()}),void 0),rt=j("isSupported",ce,!1),at=j("requestNotificationPermission",(function(){}),void 0),st=j("enableNotifications",(function(){A.notificationsPaused=!1,ie()}),void 0),lt=j("disableNotifications",(function(){A.notificationsPaused=!0}),void 0),ct=j("getUnreadMessageCount",(function(){return A.unreadMessageCount}),0),dt=j("getUnansweredMessageCount",(function(){return A.unansweredMessageCount}),0),ut=j("getSdkVersion",(function(){return u}),""),gt=j("reset",(function(){A.language=null,A.tags=new Set,A.fields={},A.signedMetadataToken=null,A.player=null,Oe(),fe(),K({action:"widgetButtonTextUpdate",text:ke()})}),void 0),pt=j("recordRetention",(function(){A.isRetentionRecordedForSession||we()}),void 0),ft=j("addEventListener",de,void 0),mt=j("removeEventListener",(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a.apply(void 0,e)}),void 0),vt=j("iosSetKeyboardHeight",(function(e){A.keyboardHeight=e,ve()}),void 0);exports.addEventListener=ft,exports.addField=Ke,exports.addFields=Xe,exports.addTag=Ue,exports.addTags=qe,exports.close=Pe,exports.disableLogging=et,exports.disableNotifications=lt,exports.enableLogging=$e,exports.enableNotifications=st,exports.getFields=ze,exports.getLanguage=Ae,exports.getPlayer=Me,exports.getSdkVersion=ut,exports.getSignedMetadataToken=De,exports.getTags=Fe,exports.getUnansweredMessageCount=dt,exports.getUnreadMessageCount=ct,exports.initialize=Le,exports.iosSetKeyboardHeight=vt,exports.isPrivacyMode=ot,exports.isSupported=rt,exports.isYoungPlayer=tt,exports.openAssistant=_e,exports.openResource=Re,exports.openSupport=Ie,exports.recordRetention=pt,exports.removeAllFields=Qe,exports.removeAllTags=Ye,exports.removeEventListener=mt,exports.removeField=Ve,exports.removeFields=Ze,exports.removeTag=We,exports.removeTags=Ge,exports.requestNotificationPermission=at,exports.reset=gt,exports.setFields=Je,exports.setLanguage=Ne,exports.setPlayer=He,exports.setPrivacyMode=it,exports.setSignedMetadataToken=Be,exports.setTags=je,exports.setYoungPlayer=nt;
|
|
1
|
+
"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},e.apply(this,arguments)};function t(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))}function n(e,t){var n,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[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(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(n=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(6===s[0]&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e],o=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function o(e,t,n){if(n||2===arguments.length)for(var o,i=0,r=t.length;i<r;i++)!o&&i in t||(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var i={unreadMessageCountUpdate:new Set,unansweredMessageCountUpdate:new Set,open:new Set,close:new Set};function r(e,t){i[e].add(t)}function a(e,t){i[e].delete(t)}function s(e,t){i[e].forEach((function(e){return e.apply(void 0,t)}))}var l='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .loader-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .loader {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 2rem;\n height: 2rem;\n animation: spin 1s linear infinite;\n transform-origin: center;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="loader-wrapper">\n <svg class="loader" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" fill="none" data-test-name="oval"\n role="img">\n <g fill="none" fill-rule="evenodd">\n <g transform="translate(1 1)" stroke-width="2">\n <circle stroke-opacity="0.5" cx="18" cy="18" r="18" />\n <path d="M36 18c0-9.94-8.06-18-18-18" />\n </g>\n </g>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',c='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: sans-serif;\n font-size: CSS_FONT_SIZE_PLACEHOLDER;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n .error-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n padding: 12px;\n }\n\n h1 {\n font-size: 18px;\n font-weight: 400;\n color: rgb(CSS_TEXT_PLACEHOLDER);\n }\n\n svg.error-icon {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="error-wrapper">\n <svg class="error-icon" width="91" height="91" viewBox="0 0 91 91" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M45.1079 89.1321C50.7158 89.1321 55.2618 84.5859 55.2618 78.9783C55.2618 73.3707 50.7158 68.8245 45.1079 68.8245C39.5001 68.8245 34.9541 73.3707 34.9541 78.9783C34.9541 84.5859 39.5001 89.1321 45.1079 89.1321Z"\n stroke="#FFB547" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />\n <path d="M24.7637 58.6355C35.9988 47.4005 54.2144 47.4005 65.4492 58.6355" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M12.7988 46.6689C22.1436 37.3241 34.529 32.8731 46.7703 33.3159" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M1.1084 34.4283C11.6674 23.9971 25.012 18.0833 38.7295 16.6868" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M89.1082 1.13208L62.0312 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M62.0312 1.13208L89.1082 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n </svg>\n <div>\n <h1>Connection error</h1>\n </div>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',d="<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\"\n content=\"viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\" />\n <meta name=\"theme-color\" content=\"#000000\" />\n <meta name=\"robots\" content=\"noindex\" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: 'TheymesBody';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .sdk-button {\n display: flex;\n font-family: 'TheymesBody', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n background: rgb(CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: rgb(CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER);\n font-size: 14px;\n font-weight: 700;\n cursor: pointer;\n text-align: center;\n padding: 0 12px;\n border: none;\n outline: none;\n border-radius: 999px;\n box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);\n position: relative;\n }\n\n .sdk-button-badge {\n position: absolute;\n top: 0;\n right: 0;\n background: rgb(CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER);\n width: 12px;\n height: 12px;\n border-radius: 999px;\n display: none;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <button class=\"sdk-button\">\n <span class=\"sdk-button-text\">WIDGET_BUTTON_TEXT_PLACEHOLDER</span>\n <span class=\"sdk-button-badge\"></span>\n </button>\n <script NONCE_ATTR_PLACEHOLDER>\n let unreadMessageCount = UNREAD_MESSAGE_COUNT_PLACEHOLDER;\n\n function openWidget() {\n parent.postMessage({ action: 'theymes.sdkButtonClicked' }, '*');\n }\n\n function iframeSubscriber(e) {\n if (e.data.action === 'unreadMessageCountUpdate') {\n unreadMessageCount = e.data.count;\n updateUnreadMessageCount()\n } else if (e.data.action === 'widgetButtonTextUpdate') {\n document.querySelector('.sdk-button-text').textContent = e.data.text;\n }\n }\n\n function updateUnreadMessageCount() {\n if (unreadMessageCount > 0) {\n document.querySelector('.sdk-button-badge').style.display = 'block';\n } else {\n document.querySelector('.sdk-button-badge').style.display = 'none';\n }\n }\n\n document.querySelector('.sdk-button').addEventListener('click', openWidget);\n window.addEventListener('message', iframeSubscriber, false);\n\n updateUnreadMessageCount();\n <\/script>\n</body>\n\n</html>",u="1.2.10",g="colors",p="locs",f="fonts",m="recordRetentionAfterSecs",v="resetSessionAfterSecs",h="web",y={sdkDialog:"#theymes-sdk-dialog",sdkIframeWrapper:"#theymes-sdk-wrapper",sdkIframe:"#theymes-sdk",sdkLoaderIframe:"#theymes-sdk-loader",notificationDialog:"#theymes-sdk-notification-dialog",notificationIframe:"#theymes-sdk-notification",sdkButtonIframe:"#theymes-sdk-button",sdkStylesheet:"#theymes-sdk-stylesheet"},b=340,w=680,x=500,S=120,E=48,T=.2,k=.2,C=.2,O="theymes_path_on_init",L="url('https://fonts.gstatic.com/s/poppins/v22/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2') format('woff2')",I=function(e){var t;try{return null!==(t=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e))&&void 0!==t?t:null}catch(e){return null}},_=function(e,t){try{null===localStorage||void 0===localStorage||localStorage.setItem(e,t)}catch(e){}},R={length:0,getItem:function(e){var t;try{return null!==(t=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem(e))&&void 0!==t?t:null}catch(e){return null}},setItem:function(e,t){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.setItem(e,t)}catch(e){}},removeItem:function(e){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.removeItem(e)}catch(e){}},clear:function(){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.clear()}catch(e){}},key:function(e){var t;try{return null!==(t=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.key(e))&&void 0!==t?t:null}catch(e){return null}}},P=28800,A=function(){var t=null,n=P,o={text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}},i={widgetButtonText:{}},r=N();try{t=function(){var e=I(m);if(e){var t=JSON.parse(e);if("number"==typeof t)return t}return null}(),n=function(){var e=I(v);if(e){var t=JSON.parse(e);if("number"==typeof t)return t}return D()}(),o=function(){var t=I(g);if(t){var n=JSON.parse(t);return e(e({},{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}),n)}return{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}}(),i=function(){var t=I(p);if(t){var n=JSON.parse(t);return e(e({},{widgetButtonText:{}}),n)}return{widgetButtonText:{}}}(),r=function(){var t=I(f);if(t){var n=JSON.parse(t);return e(e({},N()),n)}return N()}()}catch(e){console.error("Error initializing internals",e)}return{token:null,domain:null,mode:"game",deviceId:null,position:"bottom-right",widgetButton:!1,widgetButtonAction:"support",x:20,y:20,loggingEnabled:!1,element:null,language:null,userLanguage:navigator.language,tags:new Set,fields:{},youngPlayer:!1,privacyMode:!1,signedMetadataToken:null,isLoggedIn:!1,isInForeground:!0,hasNetworkConnectivity:!0,player:null,sdkIsOpen:!1,forceUpdateSdkDialog:!1,recordRetentionAfterSecs:t,resetSessionAfterSecs:n,sessionStatus:"waiting",sessionStartTime:null,sessionResumeOrStartTime:null,retentionRemainingSeconds:null,isRetentionRecordedForSession:!1,recordRetentionTimerId:null,retryRecordRetentionTimerId:null,retryIntervalSecs:300,networkErrorTimerId:null,colors:o,locs:i,fonts:r,notificationsPaused:!0,notifications:[],visibleNotification:null,unreadMessageCount:0,unansweredMessageCount:0,previousPath:null,previousConfig:null,nonce:null,keyboardHeight:0,disableInsets:!1}}();function N(){return{body:void 0}}function D(){return P}var B=function(e,t){return e===t||Boolean(e&&t&&"object"==typeof e&&"object"==typeof t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((function(e){var n=e[0],o=e[1];return B(o,t[n])})))};function M(e){var t,n=e.iframe,o=e.content,i=null===(t=n.contentWindow)||void 0===t?void 0:t.document;i&&(i.open(),i.write(o),i.close())}function H(e){return"".concat(e.r,", ").concat(e.g,", ").concat(e.b)}function F(e){var t,n,o,i;return e.template.replace(/PLATFORM_PLACEHOLDER/g,h).replace(/INSET_TOP_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-top, 0px)").replace(/INSET_BOTTOM_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)").replace(/INSET_LEFT_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-left, 0px)").replace(/INSET_RIGHT_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-right, 0px)").replace(/CSS_TEXT_PLACEHOLDER/g,H(A.colors.text)).replace(/CSS_BORDER_PLACEHOLDER/g,H(A.colors.border)).replace(/CSS_BACKGROUND_PLACEHOLDER/g,H(A.colors.background)).replace(/CSS_TILE_PLACEHOLDER/g,H(A.colors.tile)).replace(/CSS_ACCENT_PLACEHOLDER/g,H(A.colors.accent)).replace(/CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER/g,H(A.colors.notificationBackground)).replace(/CSS_NOTIFICATION_TEXT_PLACEHOLDER/g,H(A.colors.notificationText)).replace(/CSS_FONT_SIZE_PLACEHOLDER/g,"game"===A.mode?"16px":"14px").replace(/CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER/g,null!==(n=null===(t=A.fonts.body)||void 0===t?void 0:t.regular)&&void 0!==n?n:L).replace(/CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER/g,null!==(i=null===(o=A.fonts.body)||void 0===o?void 0:o.fallback)&&void 0!==i?i:"ui-sans-serif, system-ui, sans-serif").replace(/NONCE_ATTR_PLACEHOLDER/g,A.nonce?'nonce="'.concat(A.nonce,'"'):"")}var j=function(e,t,n){return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];try{return t.apply(void 0,o)}catch(t){return console.error("Error in ".concat(e),t),n}}},U='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: \'TheymesBody\';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: \'TheymesBody\', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n }\n\n html,\n body {\n width: 100%;\n height: auto;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n width: 1.25rem;\n height: 1.25rem;\n }\n\n .notification {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background: rgb(CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: auto;\n margin: 0;\n padding: 12px;\n border-radius: 6px;\n color: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n }\n\n .notification-text {\n flex: 1 0 0%;\n font-size: 0.875rem;\n /* 14/16 */\n line-height: 1.2;\n display: -webkit-box;\n line-clamp: 2;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n\n .close-button {\n flex: 0 0 auto;\n padding-left: 10px;\n cursor: pointer;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="notification">\n <div class="notification-text">NOTIFICATION_TEXT_PLACEHOLDER</div>\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6 6 18"></path>\n <path d="m6 6 12 12"></path>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeNotification() {\n parent.postMessage({ action: \'theymes.closeNotification\' }, \'*\');\n }\n\n function notificationClicked() {\n parent.postMessage({ action: \'theymes.handleNotificationAction\' }, \'*\');\n }\n\n document.querySelector(\'.notification-text\').addEventListener(\'click\', notificationClicked);\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeNotification);\n <\/script>\n</body>\n\n</html>',q=/(android|bb\d+|meego).+mobile|armv7l|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|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,W=/CrOS/,G=/android|ipad|playbook|silk/i;function Y(){return!!function(e){e||(e={});var t=e.ua;if(t||"undefined"==typeof navigator||(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"!=typeof t)return!1;var n=q.test(t)&&!W.test(t)||!!e.tablet&&G.test(t);return!n&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==t.indexOf("Macintosh")&&-1!==t.indexOf("Safari")&&(n=!0),n}({tablet:!0})&&(window.innerWidth<x||window.innerHeight<x)}function z(e){var t=e.type,n=A.position,o=A.x,i=A.y;return Y()&&"widget"===t?{top:"0",left:"0",right:"0",bottom:"0"}:"top-left"===n?{top:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",bottom:"auto"}:"top-right"===n?{top:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",bottom:"auto"}:"bottom-left"===n?{bottom:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",top:"auto"}:{bottom:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",top:"auto"}}function J(){return Y()?{width:"100%",height:"100%",maxWidth:"none",maxHeight:"none"}:{width:"".concat(b,"px"),height:"".concat(w,"px"),maxWidth:"none",maxHeight:"calc(100vh - ".concat(2*A.y,"px)")}}function K(e){var t=document.querySelector(y.sdkButtonIframe);if(t)var n=setInterval((function(){var o,i;"complete"===(null===(o=t.contentDocument)||void 0===o?void 0:o.readyState)&&(clearInterval(n),null===(i=null==t?void 0:t.contentWindow)||void 0===i||i.postMessage(e,"*"))}),100)}function X(){var e,t,n=A.notifications[0];if(n&&!A.visibleNotification){A.visibleNotification=n;var o=null!==(e=document.querySelector(y.notificationDialog))&&void 0!==e?e:document.createElement("div");o.id=y.notificationDialog.replace("#",""),o.style.position="fixed",o.style.border="none",o.style.margin="0",o.style.padding="0",o.style.zIndex="9999",o.style.colorScheme="auto",o.style.backgroundColor="transparent",o.style.pointerEvents="none",o.style.overflow="hidden",document.body.appendChild(o);var i,r=null!==(t=o.querySelector(y.notificationIframe))&&void 0!==t?t:document.createElement("iframe");r.id=y.notificationIframe.replace("#",""),r.style.position="absolute",r.style.border="none",r.style.width="0",r.style.height="0",r.style.top="-20px",r.style.left="0",r.style.colorScheme="auto",r.style.pointerEvents="auto",r.style.marginTop="-20px",r.style.opacity="0",r.style.transition="opacity ".concat(C,"s ease-in-out, margin-top ").concat(C,"s ease-in-out"),o.appendChild(r),M({iframe:r,content:(i={text:n.text},F({template:U}).replace(/NOTIFICATION_TEXT_PLACEHOLDER/g,i.text))}),setTimeout((function(){r.style.opacity="1",r.style.marginTop="0px",V()}),500),n.closeAfterSeconds>0&&setTimeout((function(){Z({notification:n})}),1e3*n.closeAfterSeconds)}}function V(){var e,t,n,o=document.querySelector(y.notificationDialog),i=document.querySelector(y.notificationIframe);if(o&&i){var r=(null===(n=null===(t=null===(e=i.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.body)||void 0===n?void 0:n.scrollHeight)?"".concat(i.contentWindow.document.body.scrollHeight,"px"):"0";if("widget"===A.mode){var a=z({type:"widget"}),s=J(),l="calc(".concat(s.width," - 20px)");o.style.bottom=a.bottom,o.style.right=a.right,o.style.left=a.left,o.style.top=a.top,o.style.overflow="hidden",i.style.width=l}else if(A.element){var c=A.element.getBoundingClientRect();l="".concat(c.width-20,"px");o.style.top="".concat(c.top,"px"),o.style.left="".concat(c.left,"px"),o.style.right="".concat(c.right,"px"),o.style.bottom="".concat(c.bottom,"px"),o.style.overflow="hidden",i.style.width=l}else{l="calc(100% - 20px)";o.style.top=A.disableInsets?"0px":"env(safe-area-inset-top, 0px)",o.style.left=A.disableInsets?"0px":"env(safe-area-inset-left, 0px)",o.style.right=A.disableInsets?"0px":"env(safe-area-inset-right, 0px)",o.style.bottom=A.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)",o.style.overflow="visible",i.style.width=l}i.style.height=r,i.style.top="10px",i.style.left="10px"}}function Z(e){if(e.notification&&A.visibleNotification===e.notification){var t=document.querySelector(y.notificationIframe),n=document.querySelector(y.notificationDialog);t&&(t.style.opacity="0",t.style.marginTop="-20px",setTimeout((function(){null==n||n.remove(),A.notifications=A.notifications.slice(1),A.visibleNotification=null,X()}),1e3*C))}}var Q=function(){function i(){Object.defineProperty(this,"isRunning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pollWhenNotificationsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"lastPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nextPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.resumeIfNeeded(!1)}return Object.defineProperty(i.prototype,"onIsInForegroundChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){A.isInForeground?this.resumeIfNeeded(!1):this.pauseIfNeeded()}}),Object.defineProperty(i.prototype,"onHasNetworkConnectivityChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!1)}}),Object.defineProperty(i.prototype,"resume",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.isRunning=!0;var t=new Date;if(this.nextPollDate&&!e||(this.nextPollDate=new Date(t.getTime()+1e3)),t>=this.nextPollDate)this.pollEventsRequest();else{var n=(this.nextPollDate.getTime()-t.getTime())/1e3;this.scheduleNextPollEventsRequest(n)}}}),Object.defineProperty(i.prototype,"pause",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning=!1,this.timer&&(clearTimeout(this.timer),this.timer=null)}}),Object.defineProperty(i.prototype,"shouldBeRunning",{enumerable:!1,configurable:!0,writable:!0,value:function(){return A.isLoggedIn&&A.isInForeground&&A.hasNetworkConnectivity&&!A.sdkIsOpen}}),Object.defineProperty(i.prototype,"resumeIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(e){!this.shouldBeRunning()||this.isRunning&&!e||this.resume(e)}}),Object.defineProperty(i.prototype,"pauseIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&!this.shouldBeRunning()&&this.pause()}}),Object.defineProperty(i.prototype,"onEnableNotifications",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&this.pollWhenNotificationsEnabled&&this.scheduleNextPollEventsRequest(0)}}),Object.defineProperty(i.prototype,"onOpen",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(i.prototype,"onClose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(i.prototype,"onLogin",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(i.prototype,"onLogout",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(i.prototype,"scheduleNextPollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this.nextPollDate=new Date(Date.now()+1e3*e),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){t.timer=null,t.pollEventsRequest()}),1e3*e)}}),Object.defineProperty(i.prototype,"pollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(){return t(this,void 0,void 0,(function(){var t,i,r,a,l,c,d,u,g;return n(this,(function(n){switch(n.label){case 0:if(!A.token||!A.domain||!A.deviceId)return[2];if(!this.isRunning)return[2];if(this.lastPollDate&&(t=new Date(this.lastPollDate.getTime()+6e4),(i=(t.getTime()-Date.now())/1e3)>0))return this.scheduleNextPollEventsRequest(i),[2];this.lastPollDate=new Date,r=A.notificationsPaused||A.sdkIsOpen?"true":"false",a=new URLSearchParams(e(e({token:A.token,language:null!==(u=A.language)&&void 0!==u?u:"en",deviceId:A.deviceId,notificationsPaused:r,mode:A.mode},(null===(g=A.player)||void 0===g?void 0:g.id)?{unsignedPlayerId:A.player.id}:{}),A.signedMetadataToken?{signedMetadataToken:A.signedMetadataToken}:{})).toString(),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch("https://".concat(A.domain,"/api/sdk/events?").concat(a),{method:"GET"})];case 2:if(!(l=n.sent()).ok)throw new Error("HTTP error! status: ".concat(l.status));return[4,l.json()];case 3:return c=n.sent(),this.scheduleNextPollEventsRequest(c.nextPollSeconds),void 0!==c.pollWhenNotificationsEnabled&&(this.pollWhenNotificationsEnabled=c.pollWhenNotificationsEnabled),A.notifications=o(o([],A.notifications,!0),c.notifications,!0),A.notifications.length>0&&X(),c.unansweredMessageCount!==A.unansweredMessageCount&&(A.unansweredMessageCount=c.unansweredMessageCount,s("unansweredMessageCountUpdate",[c.unansweredMessageCount])),c.unreadMessageCount!==A.unreadMessageCount&&(A.unreadMessageCount=c.unreadMessageCount,s("unreadMessageCountUpdate",[c.unreadMessageCount]),K({action:"unreadMessageCountUpdate",count:c.unreadMessageCount})),[3,5];case 4:return d=n.sent(),console.error("Error fetching events:",d),this.scheduleNextPollEventsRequest(A.retryIntervalSecs),[3,5];case 5:return[2]}}))}))}}),i}(),$={eventPoller:null},ee=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onLogin()},te=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onLogout()},ne=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onOpen()},oe=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onClose()},ie=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onEnableNotifications()},re=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onIsInForegroundChanged()},ae=function(e){var t="/help-center";pe({path:t,config:e}),ge({path:t,config:e})},se=function(e){var t="/assistant";pe({path:t,config:e}),ge({path:t,config:e})},le=function(){!function(){var e=document.querySelector(y.sdkDialog),t=document.querySelector(y.sdkIframeWrapper);if(e){var n=function(){"widget"!==A.mode||A.forceUpdateSdkDialog?e.remove():e.style.display="none",A.forceUpdateSdkDialog=!1};t?(t.style.opacity="0",t.style.transform=ye({animation:"start"}),setTimeout((function(){n()}),1e3*T)):n()}A.widgetButton&&he();s("close",[])}()},ce=function(){try{return CSS.supports("color","var(--color)")&&CSS.supports("color","rgb(255 255 255 / 0.5)")}catch(e){return!1}},de=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r.apply(void 0,e)};function ue(t){var n,i,r,a,s,l,c=(null!=t?t:{}).config;if(!A.token||!A.domain||!A.deviceId)return null;var d=null!==(n=null==c?void 0:c.tags)&&void 0!==n?n:[],g=null!==(i=null==c?void 0:c.fields)&&void 0!==i?i:{},p=null!==(a=null!==(r=null==c?void 0:c.language)&&void 0!==r?r:A.language)&&void 0!==a?a:null,f=null!==(s=A.signedMetadataToken)&&void 0!==s?s:null,m=null!==(l=A.player)&&void 0!==l?l:null,v={_platform:h,_sdkVersion:u};A.youngPlayer&&(v._youngPlayer=!0),(A.privacyMode||A.youngPlayer)&&(v._privacyMode=!0);var y=o(o([],Array.from(A.tags),!0),d,!0),b=e(e(e({},A.fields),g),v);return{token:A.token,domain:A.domain,deviceId:A.deviceId,tags:y,fields:b,language:p,signedMetadataToken:f,player:m}}function ge(e){var t,n,o,i=ue({config:e.config});if(i){var r=null!==(t=document.querySelector(y.sdkDialog))&&void 0!==t?t:document.createElement("div");r.id=y.sdkDialog.replace("#",""),r.style.display="block",r.style.position="fixed",r.style.border="none",r.style.width="0",r.style.height="0",r.style.margin="0",r.style.padding="0",r.style.zIndex="9998",r.style.overflow="hidden",r.style.backgroundColor="transparent";var a=null!==(n=r.querySelector(y.sdkIframeWrapper))&&void 0!==n?n:document.createElement("div");a.id=y.sdkIframeWrapper.replace("#",""),a.style.position="relative",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.right="0",a.style.bottom="0",a.style.left="0",a.style.opacity="0",a.style.colorScheme="auto",a.style.border="none",a.style.backgroundColor="rgb(".concat(H(A.colors.background),")"),a.style.transform=ye({animation:"start"}),a.style.transition=(A.mode,"opacity ".concat(T,"s ease-in-out, transform ").concat(T,"s ease-in-out")),"widget"===A.mode&&(a.style.overflow="hidden");var d=null!==(o=a.querySelector(y.sdkLoaderIframe))&&void 0!==o?o:document.createElement("iframe");d.id=y.sdkLoaderIframe.replace("#",""),d.style.position="absolute",d.style.border="none",d.style.width="100%",d.style.height="100%",d.style.top="0",d.style.right="0",d.style.bottom="0",d.style.left="0",d.style.colorScheme="auto";var u=a.querySelector(y.sdkIframe),g=null!=u?u:document.createElement("iframe"),p=setInterval((function(){var e;"complete"===(null===(e=g.contentDocument)||void 0===e?void 0:e.readyState)&&(clearInterval(p),m())}),500);g.id=y.sdkIframe.replace("#",""),g.style.position="absolute",g.style.border="none",g.style.top="0",g.style.right="0",g.style.bottom="0",g.style.left="0",g.style.colorScheme="auto",u&&!A.networkErrorTimerId||(g.src=function(e){var t=e.path,n=e.supportViewConfig,o="https://".concat(A.domain,"/sdk"),i=new URLSearchParams;i.set("platform",h),i.set("token",n.token),i.set("deviceId",n.deviceId),i.set("mode",A.mode),i.set("origin",window.location.origin),i.set("userLanguage",A.userLanguage),A.disableInsets&&i.set("disableInsets","true");n.language&&i.set("language",n.language);ce()||i.set("unsupported","true");var r=me({supportViewConfig:n});return i.set("metadata",JSON.stringify(r)),"".concat(o).concat(t,"?").concat(i.toString())}({path:e.path,supportViewConfig:i}),g.style.width="0",g.style.height="0",r.appendChild(a),a.appendChild(d),a.appendChild(g),document.body.appendChild(r)),M({iframe:d,content:F({template:l})});var f=!1,m=function(){f||(f=!0,A.networkErrorTimerId=setTimeout((function(){M({iframe:d,content:F({template:c})})}),1e4))};g.onload=m,g.onerror=function(){M({iframe:d,content:F({template:c})})},ve(),s("open",[]),setTimeout((function(){a.style.opacity="1",a.style.transform=ye({animation:"end"})}),100)}}function pe(e){var t=e.path,n=e.config,o=null!=n?n:null;A.previousPath===t&&B(A.previousConfig,o)||(A.previousPath=t,A.previousConfig=o,fe())}function fe(){var e=document.querySelector(y.sdkDialog);A.sdkIsOpen?A.forceUpdateSdkDialog=!0:null==e||e.remove()}function me(e){var t=e.supportViewConfig,n={unsigned:{},signed:void 0};return t.player&&(n.unsigned.player=t.player),t.tags&&(n.unsigned.tags=t.tags),t.fields&&(n.unsigned.fields=t.fields),t.signedMetadataToken&&(n.signed=t.signedMetadataToken),n}function ve(){var e=document.querySelector(y.sdkDialog),t=document.querySelector(y.sdkIframeWrapper);if(e&&t)if("widget"===A.mode){var n=z({type:"widget"}),o=J();e.style.width=o.width,e.style.height=o.height,e.style.maxWidth=o.maxWidth,e.style.maxHeight=o.maxHeight,e.style.bottom=n.bottom,e.style.right=n.right,e.style.left=n.left,e.style.top=n.top,Y()?(t.style.border="none",t.style.borderRadius="0"):(t.style.border="1px solid rgb(".concat(H(A.colors.border),")"),t.style.borderRadius="10px")}else if(t.style.border="none",t.style.borderRadius="0",A.element){var i=A.element.getBoundingClientRect(),r=i.width,a=i.height,s=i.top,l=i.left,c=i.right,d=i.bottom;e.style.width="".concat(r,"px"),e.style.height="".concat(a,"px"),e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="".concat(s,"px"),e.style.left="".concat(l,"px"),e.style.right="".concat(c,"px"),e.style.bottom="".concat(d,"px")}else{a=A.keyboardHeight>0?"calc(100% - ".concat(A.keyboardHeight,"px + env(safe-area-inset-bottom) - 10px)"):"100%";e.style.width="100%",e.style.height=a,e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0"}}function he(){var e,t=null!==(e=document.querySelector(y.sdkButtonIframe))&&void 0!==e?e:document.createElement("iframe");if(t){var n,o=z({type:"button"});t.id=y.sdkButtonIframe.replace("#",""),t.style.position="fixed",t.style.border="none",t.style.width="".concat(S,"px"),t.style.height="".concat(E,"px"),t.style.maxWidth="95%",t.style.maxHeight="95%",t.style.bottom=o.bottom,t.style.right=o.right,t.style.left=o.left,t.style.top=o.top,t.style.margin="0",t.style.padding="0",t.style.zIndex="9997",t.style.backgroundColor="transparent",t.style.opacity="0",t.style.transform="scale(0.8)",t.style.transition="opacity ".concat(k,"s ease-in-out, transform ").concat(k,"s ease-in-out"),setTimeout((function(){t.style.opacity="1",t.style.transform="scale(1)"}),100),document.body.appendChild(t),M({iframe:t,content:(n={unreadMessageCount:A.unreadMessageCount},F({template:d}).replace(/UNREAD_MESSAGE_COUNT_PLACEHOLDER/g,"".concat(n.unreadMessageCount)).replace(/CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER/g,H(A.colors.widgetButtonBackground)).replace(/CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER/g,H(A.colors.widgetButtonText)).replace(/CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER/g,H(A.colors.widgetButtonActionPending)).replace(/WIDGET_BUTTON_TEXT_PLACEHOLDER/g,ke()))})}}function ye(e){return"start"===e.animation?"game"===A.mode?"translateY(20%)":"scale(0.8)":"game"===A.mode?"translateY(0)":"scale(1)"}function be(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,7]),[4,e.json()];case 1:return[2,t.sent()];case 2:t.sent(),t.label=3;case 3:return t.trys.push([3,5,,6]),[4,e.text()];case 4:return[2,t.sent()];case 5:return t.sent(),[2,void 0];case 6:return[3,7];case 7:return[2]}}))}))}function we(){return t(this,void 0,void 0,(function(){var e,t,o,i,r,a;return n(this,(function(n){switch(n.label){case 0:if(Ee(),A.retryRecordRetentionTimerId&&(clearTimeout(A.retryRecordRetentionTimerId),A.retryRecordRetentionTimerId=null),A.retentionRemainingSeconds=null,A.isRetentionRecordedForSession=!0,!(e=ue()))return[2];t="https://".concat(A.domain,"/api/sdk/retention"),o=me({supportViewConfig:e}),i={token:A.token,deviceId:A.deviceId,language:A.language,metadata:o},n.label=1;case 1:return n.trys.push([1,5,,6]),[4,fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})];case 2:return(r=n.sent()).ok?[3,4]:[4,be(r)];case 3:throw n.sent();case 4:return[3,6];case 5:return a=n.sent(),console.error("Error tracking retention:",a),A.retryRecordRetentionTimerId=setTimeout(we,6e4),[3,6];case 6:return[2]}}))}))}function xe(){var e=new Date;if(A.sessionStatus="active",A.sessionResumeOrStartTime=e,A.sessionStartTime){var t=A.sessionStartTime.valueOf()/1e3+A.resetSessionAfterSecs;Date.now()/1e3>t&&Se()}else Se();null!==A.retentionRemainingSeconds&&(A.recordRetentionTimerId=setTimeout(we,1e3*A.retentionRemainingSeconds))}function Se(){A.sessionStartTime=new Date,A.retentionRemainingSeconds=A.recordRetentionAfterSecs,A.isRetentionRecordedForSession=!1,Ee()}function Ee(){A.recordRetentionTimerId&&(clearTimeout(A.recordRetentionTimerId),A.recordRetentionTimerId=null)}function Te(){A.isRetentionRecordedForSession&&we()}function ke(){var e,t,n;return null!==(n=null===(e=A.locs.widgetButtonText)||void 0===e?void 0:e[null!==(t=A.language)&&void 0!==t?t:"en"])&&void 0!==n?n:"Support"}function Ce(){var e=A.isInForeground,t="visible"===document.visibilityState&&document.hasFocus();A.isInForeground=t,e!==t&&re(),t&&"paused"===A.sessionStatus?xe():t||"active"!==A.sessionStatus||function(){if(A.sessionResumeOrStartTime&&A.retentionRemainingSeconds){var e=Math.floor((Date.now()-A.sessionResumeOrStartTime.valueOf())/1e3);A.retentionRemainingSeconds-=e}A.sessionStatus="paused",Ee()}()}function Oe(){var e,t=A.isLoggedIn,n=Boolean(A.signedMetadataToken||(null===(e=A.player)||void 0===e?void 0:e.id));A.isLoggedIn=n,n&&!t?ee():!n&&t&&te()}try{document.addEventListener("visibilitychange",Ce),window.addEventListener("focus",Ce),window.addEventListener("blur",Ce),window.addEventListener("resize",ve),window.addEventListener("resize",V),window.addEventListener("message",(function(e){if("theymes.ready"===e.data.action){var t=document.querySelector(y.sdkLoaderIframe),n=document.querySelector(y.sdkIframe);A.networkErrorTimerId&&(clearTimeout(A.networkErrorTimerId),A.networkErrorTimerId=null),n&&(n.style.width="100%",n.style.height="100%"),t&&t.remove()}else if("theymes.close"===e.data.action)le();else if("theymes.closeNotification"===e.data.action)Z({notification:A.visibleNotification});else if("theymes.handleNotificationAction"===e.data.action)r={notification:A.visibleNotification},(null==(a=r.notification)?void 0:a.action)&&"OPEN_PAGE"===a.action.type&&(ge({path:a.action.path}),Z({notification:a}));else if("theymes.sdkButtonClicked"===e.data.action)(i=document.querySelector(y.sdkButtonIframe))&&(i.style.opacity="0",i.style.transform="scale(0.8)",setTimeout((function(){i.remove()}),1e3*k)),"support"===A.widgetButtonAction?ae():"assistant"===A.widgetButtonAction&&se();else if("theymes.openExternalPage"===e.data.action){var o=e.data.target;"_self"===o&&function(e){var t=e.key,n=e.value,o=e.ttlMs,i=e.storage,r=void 0===i?R:i,a={value:n,expiry:Date.now()+o};r.setItem(t,JSON.stringify(a))}({key:O,value:e.data.path,ttlMs:6e5}),window.open(e.data.url,o)}var i,r,a}),!1),de("open",(function(){A.sdkIsOpen=!0,ne()})),de("close",(function(){A.sdkIsOpen=!1,oe()}))}catch(e){console.error("Error adding event listeners to SDK",e)}var Le=j("initialize",(function(o,i,r){return t(void 0,void 0,void 0,(function(){var t,a,s,l,c,d,u,y,b,w,x,S,E,T;return n(this,(function(n){switch(n.label){case 0:if(!o||!i||!r.mode)throw new Error("Token, domain, and mode are required");A.token=o,A.domain=i,A.mode=r.mode,A.element="element"in r&&void 0!==r.element?r.element:A.element,A.language=null!==(u=r.language)&&void 0!==u?u:A.language,A.nonce=null!==(y=r.nonce)&&void 0!==y?y:A.nonce,A.deviceId=function(){var e=I("deviceId");if(e)return e;var t=(n=Date.now(),"undefined"!=typeof performance&&"function"==typeof performance.now&&(n+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"===e?t:3&t|8).toString(16)})));return _("deviceId",t),t;var n}(),A.widgetButton="button"in r&&void 0!==r.button&&null!==(b=r.button)&&void 0!==b?b:A.widgetButton,A.widgetButtonAction="buttonAction"in r&&void 0!==r.buttonAction&&null!==(w=r.buttonAction)&&void 0!==w?w:A.widgetButtonAction,A.position="position"in r&&void 0!==r.position&&null!==(x=r.position)&&void 0!==x?x:A.position,A.x="x"in r&&void 0!==r.x?r.x:A.x,A.y="y"in r&&void 0!==r.y?r.y:A.y,A.disableInsets="game"===A.mode&&null!==A.element,$.eventPoller||($.eventPoller=new Q),t="https://".concat(i,"/api/sdk/settings"),a=new URLSearchParams({token:A.token,platform:h,mode:A.mode}).toString(),n.label=1;case 1:return n.trys.push([1,6,,7]),[4,fetch("".concat(t,"?").concat(a),{method:"GET"})];case 2:return(s=n.sent()).ok?[3,4]:[4,be(s)];case 3:throw n.sent();case 4:return[4,s.json()];case 5:return l=n.sent(),(null===(S=null==l?void 0:l.branding)||void 0===S?void 0:S.colors)&&(N=l.branding.colors,A.colors=e(e({},A.colors),N),_(g,JSON.stringify(A.colors))),(null===(E=null==l?void 0:l.branding)||void 0===E?void 0:E.locs)&&(P=l.branding.locs,A.locs=e(e({},A.locs),P),_(p,JSON.stringify(A.locs))),(null===(T=null==l?void 0:l.branding)||void 0===T?void 0:T.fonts)&&(L=l.branding.fonts,A.fonts=e(e({},A.fonts),L),_(f,JSON.stringify(A.fonts))),"number"!=typeof(null==l?void 0:l.recordRetentionAfterSecs)&&null!==(null==l?void 0:l.recordRetentionAfterSecs)||(C=l.recordRetentionAfterSecs,A.recordRetentionAfterSecs=C,_(m,JSON.stringify(A.recordRetentionAfterSecs))),"number"!=typeof(null==l?void 0:l.resetSessionAfterSecs)&&null!==(null==l?void 0:l.resetSessionAfterSecs)||(k=l.resetSessionAfterSecs,A.resetSessionAfterSecs=null!=k?k:D(),_(v,JSON.stringify(A.resetSessionAfterSecs))),xe(),fe(),c=function(e){var t=e.key,n=e.storage,o=void 0===n?R:n,i=e.removeItem,r=void 0!==i&&i,a=o.getItem(t);if(!a)return null;var s=JSON.parse(a);return Date.now()>s.expiry?(o.removeItem(t),null):(r&&o.removeItem(t),s.value)}({key:O,removeItem:!0}),c&&"widget"===A.mode&&!Y()?ge({path:c}):A.widgetButton&&he(),[3,7];case 6:return d=n.sent(),console.error("Error initializing SDK:",d),[3,7];case 7:return[2]}var k,C,L,P,N}))}))}),void 0),Ie=j("openSupport",ae,void 0),_e=j("openAssistant",se,void 0),Re=j("openResource",(function(e,t){var n="/resources/".concat(e);pe({path:n,config:t}),ge({path:n,config:t})}),void 0),Pe=j("close",le,void 0),Ae=j("getLanguage",(function(){return A.language}),null),Ne=j("setLanguage",(function(e){var t=A.language!==e;A.language=e,t&&(fe(),K({action:"widgetButtonTextUpdate",text:ke()}))}),void 0),De=j("getSignedMetadataToken",(function(){return A.signedMetadataToken}),null),Be=j("setSignedMetadataToken",(function(e){var t=A.signedMetadataToken!==e;A.signedMetadataToken=e,Oe(),t&&(fe(),Te())}),void 0),Me=j("getPlayer",(function(){return A.player}),null),He=j("setPlayer",(function(e){var t,n=(null===(t=A.player)||void 0===t?void 0:t.id)!==(null==e?void 0:e.id);A.player=e,Oe(),n&&(fe(),Te())}),void 0),Fe=j("getTags",(function(){return Array.from(A.tags)}),[]),je=j("setTags",(function(e){A.tags=new Set(e),fe()}),void 0),Ue=j("addTag",(function(e){A.tags.add(e),fe()}),void 0),qe=j("addTags",(function(e){e.forEach((function(e){return A.tags.add(e)})),fe()}),void 0),We=j("removeTag",(function(e){A.tags.delete(e),fe()}),void 0),Ge=j("removeTags",(function(e){e.forEach((function(e){return A.tags.delete(e)})),fe()}),void 0),Ye=j("removeAllTags",(function(){A.tags.clear(),fe()}),void 0),ze=j("getFields",(function(){return A.fields}),{}),Je=j("setFields",(function(e){A.fields=e,fe()}),void 0),Ke=j("addField",(function(e,t){A.fields[e]=t,fe()}),void 0),Xe=j("addFields",(function(t){A.fields=e(e({},A.fields),t),fe()}),void 0),Ve=j("removeField",(function(e){delete A.fields[e],fe()}),void 0),Ze=j("removeFields",(function(e){e.forEach((function(e){return delete A.fields[e]})),fe()}),void 0),Qe=j("removeAllFields",(function(){A.fields={},fe()}),void 0),$e=j("enableLogging",(function(){A.loggingEnabled=!0}),void 0),et=j("disableLogging",(function(){A.loggingEnabled=!1}),void 0),tt=j("isYoungPlayer",(function(){return A.youngPlayer}),!1),nt=j("setYoungPlayer",(function(e){A.youngPlayer=e,fe()}),void 0),ot=j("isPrivacyMode",(function(){return A.privacyMode}),!1),it=j("setPrivacyMode",(function(e){A.privacyMode=e,fe()}),void 0),rt=j("isSupported",ce,!1),at=j("requestNotificationPermission",(function(){}),void 0),st=j("enableNotifications",(function(){A.notificationsPaused=!1,ie()}),void 0),lt=j("disableNotifications",(function(){A.notificationsPaused=!0}),void 0),ct=j("getUnreadMessageCount",(function(){return A.unreadMessageCount}),0),dt=j("getUnansweredMessageCount",(function(){return A.unansweredMessageCount}),0),ut=j("getSdkVersion",(function(){return u}),""),gt=j("reset",(function(){A.language=null,A.tags=new Set,A.fields={},A.signedMetadataToken=null,A.player=null,Oe(),fe(),K({action:"widgetButtonTextUpdate",text:ke()})}),void 0),pt=j("recordRetention",(function(){A.isRetentionRecordedForSession||we()}),void 0),ft=j("addEventListener",de,void 0),mt=j("removeEventListener",(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a.apply(void 0,e)}),void 0),vt=j("iosSetKeyboardHeight",(function(e){A.keyboardHeight=e,ve()}),void 0);exports.addEventListener=ft,exports.addField=Ke,exports.addFields=Xe,exports.addTag=Ue,exports.addTags=qe,exports.close=Pe,exports.disableLogging=et,exports.disableNotifications=lt,exports.enableLogging=$e,exports.enableNotifications=st,exports.getFields=ze,exports.getLanguage=Ae,exports.getPlayer=Me,exports.getSdkVersion=ut,exports.getSignedMetadataToken=De,exports.getTags=Fe,exports.getUnansweredMessageCount=dt,exports.getUnreadMessageCount=ct,exports.initialize=Le,exports.iosSetKeyboardHeight=vt,exports.isPrivacyMode=ot,exports.isSupported=rt,exports.isYoungPlayer=tt,exports.openAssistant=_e,exports.openResource=Re,exports.openSupport=Ie,exports.recordRetention=pt,exports.removeAllFields=Qe,exports.removeAllTags=Ye,exports.removeEventListener=mt,exports.removeField=Ve,exports.removeFields=Ze,exports.removeTag=We,exports.removeTags=Ge,exports.requestNotificationPermission=at,exports.reset=gt,exports.setFields=Je,exports.setLanguage=Ne,exports.setPlayer=He,exports.setPrivacyMode=it,exports.setSignedMetadataToken=Be,exports.setTags=je,exports.setYoungPlayer=nt;
|
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=function(){return e=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},e.apply(this,arguments)};function n(e,n,t,o){return new(t||(t=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}l((o=o.apply(e,n||[])).next())}))}function t(e,n){var t,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[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(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(t=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(6===s[0]&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=n.call(e,r)}catch(e){s=[6,e],o=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function o(e,n,t){if(t||2===arguments.length)for(var o,i=0,r=n.length;i<r;i++)!o&&i in n||(o||(o=Array.prototype.slice.call(n,0,i)),o[i]=n[i]);return e.concat(o||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var i={unreadMessageCountUpdate:new Set,unansweredMessageCountUpdate:new Set,open:new Set,close:new Set};function r(e,n){i[e].add(n)}function a(e,n){i[e].delete(n)}function s(e,n){i[e].forEach((function(e){return e.apply(void 0,n)}))}var l='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .loader-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .loader {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 2rem;\n height: 2rem;\n animation: spin 1s linear infinite;\n transform-origin: center;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="loader-wrapper">\n <svg class="loader" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" fill="none" data-test-name="oval"\n role="img">\n <g fill="none" fill-rule="evenodd">\n <g transform="translate(1 1)" stroke-width="2">\n <circle stroke-opacity="0.5" cx="18" cy="18" r="18" />\n <path d="M36 18c0-9.94-8.06-18-18-18" />\n </g>\n </g>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',c='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: sans-serif;\n font-size: CSS_FONT_SIZE_PLACEHOLDER;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n .error-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n padding: 12px;\n }\n\n h1 {\n font-size: 18px;\n font-weight: 400;\n color: rgb(CSS_TEXT_PLACEHOLDER);\n }\n\n svg.error-icon {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="error-wrapper">\n <svg class="error-icon" width="91" height="91" viewBox="0 0 91 91" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M45.1079 89.1321C50.7158 89.1321 55.2618 84.5859 55.2618 78.9783C55.2618 73.3707 50.7158 68.8245 45.1079 68.8245C39.5001 68.8245 34.9541 73.3707 34.9541 78.9783C34.9541 84.5859 39.5001 89.1321 45.1079 89.1321Z"\n stroke="#FFB547" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />\n <path d="M24.7637 58.6355C35.9988 47.4005 54.2144 47.4005 65.4492 58.6355" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M12.7988 46.6689C22.1436 37.3241 34.529 32.8731 46.7703 33.3159" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M1.1084 34.4283C11.6674 23.9971 25.012 18.0833 38.7295 16.6868" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M89.1082 1.13208L62.0312 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M62.0312 1.13208L89.1082 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n </svg>\n <div>\n <h1>Connection error</h1>\n </div>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',d="<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\"\n content=\"viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\" />\n <meta name=\"theme-color\" content=\"#000000\" />\n <meta name=\"robots\" content=\"noindex\" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: 'TheymesBody';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .sdk-button {\n display: flex;\n font-family: 'TheymesBody', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n background: rgb(CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: rgb(CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER);\n font-size: 14px;\n font-weight: 700;\n cursor: pointer;\n text-align: center;\n padding: 0 12px;\n border: none;\n outline: none;\n border-radius: 999px;\n box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);\n position: relative;\n }\n\n .sdk-button-badge {\n position: absolute;\n top: 0;\n right: 0;\n background: rgb(CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER);\n width: 12px;\n height: 12px;\n border-radius: 999px;\n display: none;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <button class=\"sdk-button\">\n <span class=\"sdk-button-text\">WIDGET_BUTTON_TEXT_PLACEHOLDER</span>\n <span class=\"sdk-button-badge\"></span>\n </button>\n <script NONCE_ATTR_PLACEHOLDER>\n let unreadMessageCount = UNREAD_MESSAGE_COUNT_PLACEHOLDER;\n\n function openWidget() {\n parent.postMessage({ action: 'theymes.sdkButtonClicked' }, '*');\n }\n\n function iframeSubscriber(e) {\n if (e.data.action === 'unreadMessageCountUpdate') {\n unreadMessageCount = e.data.count;\n updateUnreadMessageCount()\n } else if (e.data.action === 'widgetButtonTextUpdate') {\n document.querySelector('.sdk-button-text').textContent = e.data.text;\n }\n }\n\n function updateUnreadMessageCount() {\n if (unreadMessageCount > 0) {\n document.querySelector('.sdk-button-badge').style.display = 'block';\n } else {\n document.querySelector('.sdk-button-badge').style.display = 'none';\n }\n }\n\n document.querySelector('.sdk-button').addEventListener('click', openWidget);\n window.addEventListener('message', iframeSubscriber, false);\n\n updateUnreadMessageCount();\n <\/script>\n</body>\n\n</html>",u="1.2.9",g="colors",f="locs",p="fonts",m="recordRetentionAfterSecs",h="resetSessionAfterSecs",v="web",y={sdkDialog:"#theymes-sdk-dialog",sdkIframeWrapper:"#theymes-sdk-wrapper",sdkIframe:"#theymes-sdk",sdkLoaderIframe:"#theymes-sdk-loader",notificationDialog:"#theymes-sdk-notification-dialog",notificationIframe:"#theymes-sdk-notification",sdkButtonIframe:"#theymes-sdk-button",sdkStylesheet:"#theymes-sdk-stylesheet"},b=340,w=680,S=500,E=120,x=48,k=.2,T=.2,C=.2,O="theymes_path_on_init",I="url('https://fonts.gstatic.com/s/poppins/v22/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2') format('woff2')",L=function(e){var n;try{return null!==(n=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e))&&void 0!==n?n:null}catch(e){return null}},_=function(e,n){try{null===localStorage||void 0===localStorage||localStorage.setItem(e,n)}catch(e){}},R={length:0,getItem:function(e){var n;try{return null!==(n=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem(e))&&void 0!==n?n:null}catch(e){return null}},setItem:function(e,n){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.removeItem(e)}catch(e){}},clear:function(){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.clear()}catch(e){}},key:function(e){var n;try{return null!==(n=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.key(e))&&void 0!==n?n:null}catch(e){return null}}},P=28800,A=function(){var n=null,t=P,o={text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}},i={widgetButtonText:{}},r=N();try{n=function(){var e=L(m);if(e){var n=JSON.parse(e);if("number"==typeof n)return n}return null}(),t=function(){var e=L(h);if(e){var n=JSON.parse(e);if("number"==typeof n)return n}return D()}(),o=function(){var n=L(g);if(n){var t=JSON.parse(n);return e(e({},{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}),t)}return{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}}(),i=function(){var n=L(f);if(n){var t=JSON.parse(n);return e(e({},{widgetButtonText:{}}),t)}return{widgetButtonText:{}}}(),r=function(){var n=L(p);if(n){var t=JSON.parse(n);return e(e({},N()),t)}return N()}()}catch(e){console.error("Error initializing internals",e)}return{token:null,domain:null,mode:"game",deviceId:null,position:"bottom-right",widgetButton:!1,widgetButtonAction:"support",x:20,y:20,loggingEnabled:!1,element:null,language:null,userLanguage:navigator.language,tags:new Set,fields:{},youngPlayer:!1,privacyMode:!1,signedMetadataToken:null,isLoggedIn:!1,isInForeground:!0,hasNetworkConnectivity:!0,player:null,sdkIsOpen:!1,forceUpdateSdkDialog:!1,recordRetentionAfterSecs:n,resetSessionAfterSecs:t,sessionStatus:"waiting",sessionStartTime:null,sessionResumeOrStartTime:null,retentionRemainingSeconds:null,isRetentionRecordedForSession:!1,recordRetentionTimerId:null,retryRecordRetentionTimerId:null,retryIntervalSecs:300,networkErrorTimerId:null,colors:o,locs:i,fonts:r,notificationsPaused:!0,notifications:[],visibleNotification:null,unreadMessageCount:0,unansweredMessageCount:0,previousPath:null,previousConfig:null,nonce:null,keyboardHeight:0,disableInsets:!1}}();function N(){return{body:void 0}}function D(){return P}var B=function(e,n){return e===n||Boolean(e&&n&&"object"==typeof e&&"object"==typeof n&&Object.keys(e).length===Object.keys(n).length&&Object.entries(e).every((function(e){var t=e[0],o=e[1];return B(o,n[t])})))};function M(e){var n,t=e.iframe,o=e.content,i=null===(n=t.contentWindow)||void 0===n?void 0:n.document;i&&(i.open(),i.write(o),i.close())}function H(e){return"".concat(e.r,", ").concat(e.g,", ").concat(e.b)}function F(e){var n,t,o,i;return e.template.replace(/PLATFORM_PLACEHOLDER/g,v).replace(/INSET_TOP_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-top, 0px)").replace(/INSET_BOTTOM_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)").replace(/INSET_LEFT_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-left, 0px)").replace(/INSET_RIGHT_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-right, 0px)").replace(/CSS_TEXT_PLACEHOLDER/g,H(A.colors.text)).replace(/CSS_BORDER_PLACEHOLDER/g,H(A.colors.border)).replace(/CSS_BACKGROUND_PLACEHOLDER/g,H(A.colors.background)).replace(/CSS_TILE_PLACEHOLDER/g,H(A.colors.tile)).replace(/CSS_ACCENT_PLACEHOLDER/g,H(A.colors.accent)).replace(/CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER/g,H(A.colors.notificationBackground)).replace(/CSS_NOTIFICATION_TEXT_PLACEHOLDER/g,H(A.colors.notificationText)).replace(/CSS_FONT_SIZE_PLACEHOLDER/g,"game"===A.mode?"16px":"14px").replace(/CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER/g,null!==(t=null===(n=A.fonts.body)||void 0===n?void 0:n.regular)&&void 0!==t?t:I).replace(/CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER/g,null!==(i=null===(o=A.fonts.body)||void 0===o?void 0:o.fallback)&&void 0!==i?i:"ui-sans-serif, system-ui, sans-serif").replace(/NONCE_ATTR_PLACEHOLDER/g,A.nonce?'nonce="'.concat(A.nonce,'"'):"")}var j=function(e,n,t){return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];try{return n.apply(void 0,o)}catch(n){return console.error("Error in ".concat(e),n),t}}},U='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: \'TheymesBody\';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: \'TheymesBody\', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n }\n\n html,\n body {\n width: 100%;\n height: auto;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n width: 1.25rem;\n height: 1.25rem;\n }\n\n .notification {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background: rgb(CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: auto;\n margin: 0;\n padding: 12px;\n border-radius: 6px;\n color: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n }\n\n .notification-text {\n flex: 1 0 0%;\n font-size: 0.875rem;\n /* 14/16 */\n line-height: 1.2;\n display: -webkit-box;\n line-clamp: 2;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n\n .close-button {\n flex: 0 0 auto;\n padding-left: 10px;\n cursor: pointer;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="notification">\n <div class="notification-text">NOTIFICATION_TEXT_PLACEHOLDER</div>\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6 6 18"></path>\n <path d="m6 6 12 12"></path>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeNotification() {\n parent.postMessage({ action: \'theymes.closeNotification\' }, \'*\');\n }\n\n function notificationClicked() {\n parent.postMessage({ action: \'theymes.handleNotificationAction\' }, \'*\');\n }\n\n document.querySelector(\'.notification-text\').addEventListener(\'click\', notificationClicked);\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeNotification);\n <\/script>\n</body>\n\n</html>',q=/(android|bb\d+|meego).+mobile|armv7l|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|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,W=/CrOS/,G=/android|ipad|playbook|silk/i;function z(){return!!function(e){e||(e={});var n=e.ua;if(n||"undefined"==typeof navigator||(n=navigator.userAgent),n&&n.headers&&"string"==typeof n.headers["user-agent"]&&(n=n.headers["user-agent"]),"string"!=typeof n)return!1;var t=q.test(n)&&!W.test(n)||!!e.tablet&&G.test(n);return!t&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==n.indexOf("Macintosh")&&-1!==n.indexOf("Safari")&&(t=!0),t}({tablet:!0})&&(window.innerWidth<S||window.innerHeight<S)}function J(e){var n=e.type,t=A.position,o=A.x,i=A.y;return z()&&"widget"===n?{top:"0",left:"0",right:"0",bottom:"0"}:"top-left"===t?{top:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",bottom:"auto"}:"top-right"===t?{top:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",bottom:"auto"}:"bottom-left"===t?{bottom:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",top:"auto"}:{bottom:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",top:"auto"}}function Y(){return z()?{width:"100%",height:"100%",maxWidth:"none",maxHeight:"none"}:{width:"".concat(b,"px"),height:"".concat(w,"px"),maxWidth:"none",maxHeight:"calc(100vh - ".concat(2*A.y,"px)")}}function K(e){var n=document.querySelector(y.sdkButtonIframe);if(n)var t=setInterval((function(){var o,i;"complete"===(null===(o=n.contentDocument)||void 0===o?void 0:o.readyState)&&(clearInterval(t),null===(i=null==n?void 0:n.contentWindow)||void 0===i||i.postMessage(e,"*"))}),100)}function X(){var e,n,t=A.notifications[0];if(t&&!A.visibleNotification){A.visibleNotification=t;var o=null!==(e=document.querySelector(y.notificationDialog))&&void 0!==e?e:document.createElement("div");o.id=y.notificationDialog.replace("#",""),o.style.position="fixed",o.style.border="none",o.style.margin="0",o.style.padding="0",o.style.zIndex="9999",o.style.colorScheme="auto",o.style.backgroundColor="transparent",o.style.pointerEvents="none",o.style.overflow="hidden",document.body.appendChild(o);var i,r=null!==(n=o.querySelector(y.notificationIframe))&&void 0!==n?n:document.createElement("iframe");r.id=y.notificationIframe.replace("#",""),r.style.position="absolute",r.style.border="none",r.style.width="0",r.style.height="0",r.style.top="-20px",r.style.left="0",r.style.colorScheme="auto",r.style.pointerEvents="auto",r.style.marginTop="-20px",r.style.opacity="0",r.style.transition="opacity ".concat(C,"s ease-in-out, margin-top ").concat(C,"s ease-in-out"),o.appendChild(r),M({iframe:r,content:(i={text:t.text},F({template:U}).replace(/NOTIFICATION_TEXT_PLACEHOLDER/g,i.text))}),setTimeout((function(){r.style.opacity="1",r.style.marginTop="0px",V()}),500),t.closeAfterSeconds>0&&setTimeout((function(){Z({notification:t})}),1e3*t.closeAfterSeconds)}}function V(){var e,n,t,o=document.querySelector(y.notificationDialog),i=document.querySelector(y.notificationIframe);if(o&&i){var r=(null===(t=null===(n=null===(e=i.contentWindow)||void 0===e?void 0:e.document)||void 0===n?void 0:n.body)||void 0===t?void 0:t.scrollHeight)?"".concat(i.contentWindow.document.body.scrollHeight,"px"):"0";if("widget"===A.mode){var a=J({type:"widget"}),s=Y(),l="calc(".concat(s.width," - 20px)");o.style.bottom=a.bottom,o.style.right=a.right,o.style.left=a.left,o.style.top=a.top,o.style.overflow="hidden",i.style.width=l}else if(A.element){var c=A.element.getBoundingClientRect();l="".concat(c.width-20,"px");o.style.top="".concat(c.top,"px"),o.style.left="".concat(c.left,"px"),o.style.right="".concat(c.right,"px"),o.style.bottom="".concat(c.bottom,"px"),o.style.overflow="hidden",i.style.width=l}else{l="calc(100% - 20px)";o.style.top=A.disableInsets?"0px":"env(safe-area-inset-top, 0px)",o.style.left=A.disableInsets?"0px":"env(safe-area-inset-left, 0px)",o.style.right=A.disableInsets?"0px":"env(safe-area-inset-right, 0px)",o.style.bottom=A.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)",o.style.overflow="visible",i.style.width=l}i.style.height=r,i.style.top="10px",i.style.left="10px"}}function Z(e){if(e.notification&&A.visibleNotification===e.notification){var n=document.querySelector(y.notificationIframe),t=document.querySelector(y.notificationDialog);n&&(n.style.opacity="0",n.style.marginTop="-20px",setTimeout((function(){null==t||t.remove(),A.notifications=A.notifications.slice(1),A.visibleNotification=null,X()}),1e3*C))}}var Q=function(){function i(){Object.defineProperty(this,"isRunning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pollWhenNotificationsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"lastPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nextPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.resumeIfNeeded(!1)}return Object.defineProperty(i.prototype,"onIsInForegroundChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){A.isInForeground?this.resumeIfNeeded(!1):this.pauseIfNeeded()}}),Object.defineProperty(i.prototype,"onHasNetworkConnectivityChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!1)}}),Object.defineProperty(i.prototype,"resume",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.isRunning=!0;var n=new Date;if(this.nextPollDate&&!e||(this.nextPollDate=new Date(n.getTime()+1e3)),n>=this.nextPollDate)this.pollEventsRequest();else{var t=(this.nextPollDate.getTime()-n.getTime())/1e3;this.scheduleNextPollEventsRequest(t)}}}),Object.defineProperty(i.prototype,"pause",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning=!1,this.timer&&(clearTimeout(this.timer),this.timer=null)}}),Object.defineProperty(i.prototype,"shouldBeRunning",{enumerable:!1,configurable:!0,writable:!0,value:function(){return A.isLoggedIn&&A.isInForeground&&A.hasNetworkConnectivity&&!A.sdkIsOpen}}),Object.defineProperty(i.prototype,"resumeIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(e){!this.shouldBeRunning()||this.isRunning&&!e||this.resume(e)}}),Object.defineProperty(i.prototype,"pauseIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&!this.shouldBeRunning()&&this.pause()}}),Object.defineProperty(i.prototype,"onEnableNotifications",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&this.pollWhenNotificationsEnabled&&this.scheduleNextPollEventsRequest(0)}}),Object.defineProperty(i.prototype,"onOpen",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(i.prototype,"onClose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(i.prototype,"onLogin",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(i.prototype,"onLogout",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(i.prototype,"scheduleNextPollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this;this.nextPollDate=new Date(Date.now()+1e3*e),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){n.timer=null,n.pollEventsRequest()}),1e3*e)}}),Object.defineProperty(i.prototype,"pollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(){return n(this,void 0,void 0,(function(){var n,i,r,a,l,c,d,u,g;return t(this,(function(t){switch(t.label){case 0:if(!A.token||!A.domain||!A.deviceId)return[2];if(!this.isRunning)return[2];if(this.lastPollDate&&(n=new Date(this.lastPollDate.getTime()+6e4),(i=(n.getTime()-Date.now())/1e3)>0))return this.scheduleNextPollEventsRequest(i),[2];this.lastPollDate=new Date,r=A.notificationsPaused||A.sdkIsOpen?"true":"false",a=new URLSearchParams(e(e({token:A.token,language:null!==(u=A.language)&&void 0!==u?u:"en",deviceId:A.deviceId,notificationsPaused:r,mode:A.mode},(null===(g=A.player)||void 0===g?void 0:g.id)?{unsignedPlayerId:A.player.id}:{}),A.signedMetadataToken?{signedMetadataToken:A.signedMetadataToken}:{})).toString(),t.label=1;case 1:return t.trys.push([1,4,,5]),[4,fetch("https://".concat(A.domain,"/api/sdk/events?").concat(a),{method:"GET"})];case 2:if(!(l=t.sent()).ok)throw new Error("HTTP error! status: ".concat(l.status));return[4,l.json()];case 3:return c=t.sent(),this.scheduleNextPollEventsRequest(c.nextPollSeconds),void 0!==c.pollWhenNotificationsEnabled&&(this.pollWhenNotificationsEnabled=c.pollWhenNotificationsEnabled),A.notifications=o(o([],A.notifications,!0),c.notifications,!0),A.notifications.length>0&&X(),c.unansweredMessageCount!==A.unansweredMessageCount&&(A.unansweredMessageCount=c.unansweredMessageCount,s("unansweredMessageCountUpdate",[c.unansweredMessageCount])),c.unreadMessageCount!==A.unreadMessageCount&&(A.unreadMessageCount=c.unreadMessageCount,s("unreadMessageCountUpdate",[c.unreadMessageCount]),K({action:"unreadMessageCountUpdate",count:c.unreadMessageCount})),[3,5];case 4:return d=t.sent(),console.error("Error fetching events:",d),this.scheduleNextPollEventsRequest(A.retryIntervalSecs),[3,5];case 5:return[2]}}))}))}}),i}(),$={eventPoller:null},ee=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onLogin()},ne=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onLogout()},te=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onOpen()},oe=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onClose()},ie=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onEnableNotifications()},re=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onIsInForegroundChanged()},ae=function(e){var n="/help-center";fe({path:n,config:e}),ge({path:n,config:e})},se=function(e){var n="/assistant";fe({path:n,config:e}),ge({path:n,config:e})},le=function(){!function(){var e=document.querySelector(y.sdkDialog),n=document.querySelector(y.sdkIframeWrapper);if(e){var t=function(){"widget"!==A.mode||A.forceUpdateSdkDialog?e.remove():e.style.display="none",A.forceUpdateSdkDialog=!1};n?(n.style.opacity="0",n.style.transform=ye({animation:"start"}),setTimeout((function(){t()}),1e3*k)):t()}A.widgetButton&&ve();s("close",[])}()},ce=function(){try{return CSS.supports("color","var(--color)")&&CSS.supports("color","rgb(255 255 255 / 0.5)")}catch(e){return!1}},de=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r.apply(void 0,e)};function ue(n){var t,i,r,a,s,l,c=(null!=n?n:{}).config;if(!A.token||!A.domain||!A.deviceId)return null;var d=null!==(t=null==c?void 0:c.tags)&&void 0!==t?t:[],g=null!==(i=null==c?void 0:c.fields)&&void 0!==i?i:{},f=null!==(a=null!==(r=null==c?void 0:c.language)&&void 0!==r?r:A.language)&&void 0!==a?a:null,p=null!==(s=A.signedMetadataToken)&&void 0!==s?s:null,m=null!==(l=A.player)&&void 0!==l?l:null,h={_platform:v,_sdkVersion:u};A.youngPlayer&&(h._youngPlayer=!0),(A.privacyMode||A.youngPlayer)&&(h._privacyMode=!0);var y=o(o([],Array.from(A.tags),!0),d,!0),b=e(e(e({},A.fields),g),h);return{token:A.token,domain:A.domain,deviceId:A.deviceId,tags:y,fields:b,language:f,signedMetadataToken:p,player:m}}function ge(e){var n,t,o,i=ue({config:e.config});if(i){var r=null!==(n=document.querySelector(y.sdkDialog))&&void 0!==n?n:document.createElement("div");r.id=y.sdkDialog.replace("#",""),r.style.display="block",r.style.position="fixed",r.style.border="none",r.style.width="0",r.style.height="0",r.style.margin="0",r.style.padding="0",r.style.zIndex="9998",r.style.overflow="hidden",r.style.backgroundColor="transparent";var a=null!==(t=r.querySelector(y.sdkIframeWrapper))&&void 0!==t?t:document.createElement("div");a.id=y.sdkIframeWrapper.replace("#",""),a.style.position="relative",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.right="0",a.style.bottom="0",a.style.left="0",a.style.opacity="0",a.style.colorScheme="auto",a.style.border="none",a.style.backgroundColor="rgb(".concat(H(A.colors.background),")"),a.style.transform=ye({animation:"start"}),a.style.transition=(A.mode,"opacity ".concat(k,"s ease-in-out, transform ").concat(k,"s ease-in-out")),"widget"===A.mode&&(a.style.overflow="hidden");var d=null!==(o=a.querySelector(y.sdkLoaderIframe))&&void 0!==o?o:document.createElement("iframe");d.id=y.sdkLoaderIframe.replace("#",""),d.style.position="absolute",d.style.border="none",d.style.width="100%",d.style.height="100%",d.style.top="0",d.style.right="0",d.style.bottom="0",d.style.left="0",d.style.colorScheme="auto";var u=a.querySelector(y.sdkIframe),g=null!=u?u:document.createElement("iframe"),f=setInterval((function(){var e;"complete"===(null===(e=g.contentDocument)||void 0===e?void 0:e.readyState)&&(clearInterval(f),m())}),500);g.id=y.sdkIframe.replace("#",""),g.style.position="absolute",g.style.border="none",g.style.top="0",g.style.right="0",g.style.bottom="0",g.style.left="0",g.style.colorScheme="auto",u&&!A.networkErrorTimerId||(g.src=function(e){var n=e.path,t=e.supportViewConfig,o="https://".concat(A.domain,"/sdk"),i=new URLSearchParams;i.set("platform",v),i.set("token",t.token),i.set("deviceId",t.deviceId),i.set("mode",A.mode),i.set("origin",window.location.origin),i.set("userLanguage",A.userLanguage),A.disableInsets&&i.set("disableInsets","true");t.language&&i.set("language",t.language);ce()||i.set("unsupported","true");var r=me({supportViewConfig:t});return i.set("metadata",JSON.stringify(r)),"".concat(o).concat(n,"?").concat(i.toString())}({path:e.path,supportViewConfig:i}),g.style.width="0",g.style.height="0",r.appendChild(a),a.appendChild(d),a.appendChild(g),document.body.appendChild(r)),M({iframe:d,content:F({template:l})});var p=!1,m=function(){p||(p=!0,A.networkErrorTimerId=setTimeout((function(){M({iframe:d,content:F({template:c})})}),1e4))};g.onload=m,g.onerror=function(){M({iframe:d,content:F({template:c})})},he(),s("open",[]),setTimeout((function(){a.style.opacity="1",a.style.transform=ye({animation:"end"})}),100)}}function fe(e){var n=e.path,t=e.config,o=null!=t?t:null;A.previousPath===n&&B(A.previousConfig,o)||(A.previousPath=n,A.previousConfig=o,pe())}function pe(){var e=document.querySelector(y.sdkDialog);A.sdkIsOpen?A.forceUpdateSdkDialog=!0:null==e||e.remove()}function me(e){var n=e.supportViewConfig,t={unsigned:{},signed:void 0};return n.player&&(t.unsigned.player=n.player),n.tags&&(t.unsigned.tags=n.tags),n.fields&&(t.unsigned.fields=n.fields),n.signedMetadataToken&&(t.signed=n.signedMetadataToken),t}function he(){var e=document.querySelector(y.sdkDialog),n=document.querySelector(y.sdkIframeWrapper);if(e&&n)if("widget"===A.mode){var t=J({type:"widget"}),o=Y();e.style.width=o.width,e.style.height=o.height,e.style.maxWidth=o.maxWidth,e.style.maxHeight=o.maxHeight,e.style.bottom=t.bottom,e.style.right=t.right,e.style.left=t.left,e.style.top=t.top,z()?(n.style.border="none",n.style.borderRadius="0"):(n.style.border="1px solid rgb(".concat(H(A.colors.border),")"),n.style.borderRadius="10px")}else if(n.style.border="none",n.style.borderRadius="0",A.element){var i=A.element.getBoundingClientRect(),r=i.width,a=i.height,s=i.top,l=i.left,c=i.right,d=i.bottom;e.style.width="".concat(r,"px"),e.style.height="".concat(a,"px"),e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="".concat(s,"px"),e.style.left="".concat(l,"px"),e.style.right="".concat(c,"px"),e.style.bottom="".concat(d,"px")}else{a=A.keyboardHeight>0?"calc(100% - ".concat(A.keyboardHeight,"px + env(safe-area-inset-bottom) - 10px)"):"100%";e.style.width="100%",e.style.height=a,e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0"}}function ve(){var e,n=null!==(e=document.querySelector(y.sdkButtonIframe))&&void 0!==e?e:document.createElement("iframe");if(n){var t,o=J({type:"button"});n.id=y.sdkButtonIframe.replace("#",""),n.style.position="fixed",n.style.border="none",n.style.width="".concat(E,"px"),n.style.height="".concat(x,"px"),n.style.maxWidth="95%",n.style.maxHeight="95%",n.style.bottom=o.bottom,n.style.right=o.right,n.style.left=o.left,n.style.top=o.top,n.style.margin="0",n.style.padding="0",n.style.zIndex="9997",n.style.backgroundColor="transparent",n.style.opacity="0",n.style.transform="scale(0.8)",n.style.transition="opacity ".concat(T,"s ease-in-out, transform ").concat(T,"s ease-in-out"),setTimeout((function(){n.style.opacity="1",n.style.transform="scale(1)"}),100),document.body.appendChild(n),M({iframe:n,content:(t={unreadMessageCount:A.unreadMessageCount},F({template:d}).replace(/UNREAD_MESSAGE_COUNT_PLACEHOLDER/g,"".concat(t.unreadMessageCount)).replace(/CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER/g,H(A.colors.widgetButtonBackground)).replace(/CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER/g,H(A.colors.widgetButtonText)).replace(/CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER/g,H(A.colors.widgetButtonActionPending)).replace(/WIDGET_BUTTON_TEXT_PLACEHOLDER/g,Te()))})}}function ye(e){return"start"===e.animation?"game"===A.mode?"translateY(20%)":"scale(0.8)":"game"===A.mode?"translateY(0)":"scale(1)"}function be(e){return n(this,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,7]),[4,e.json()];case 1:return[2,n.sent()];case 2:n.sent(),n.label=3;case 3:return n.trys.push([3,5,,6]),[4,e.text()];case 4:return[2,n.sent()];case 5:return n.sent(),[2,void 0];case 6:return[3,7];case 7:return[2]}}))}))}function we(){return n(this,void 0,void 0,(function(){var e,n,o,i,r,a;return t(this,(function(t){switch(t.label){case 0:if(xe(),A.retryRecordRetentionTimerId&&(clearTimeout(A.retryRecordRetentionTimerId),A.retryRecordRetentionTimerId=null),A.retentionRemainingSeconds=null,A.isRetentionRecordedForSession=!0,!(e=ue()))return[2];n="https://".concat(A.domain,"/api/sdk/retention"),o=me({supportViewConfig:e}),i={token:A.token,deviceId:A.deviceId,language:A.language,metadata:o},t.label=1;case 1:return t.trys.push([1,5,,6]),[4,fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})];case 2:return(r=t.sent()).ok?[3,4]:[4,be(r)];case 3:throw t.sent();case 4:return[3,6];case 5:return a=t.sent(),console.error("Error tracking retention:",a),A.retryRecordRetentionTimerId=setTimeout(we,6e4),[3,6];case 6:return[2]}}))}))}function Se(){var e=new Date;if(A.sessionStatus="active",A.sessionResumeOrStartTime=e,A.sessionStartTime){var n=A.sessionStartTime.valueOf()/1e3+A.resetSessionAfterSecs;Date.now()/1e3>n&&Ee()}else Ee();null!==A.retentionRemainingSeconds&&(A.recordRetentionTimerId=setTimeout(we,1e3*A.retentionRemainingSeconds))}function Ee(){A.sessionStartTime=new Date,A.retentionRemainingSeconds=A.recordRetentionAfterSecs,A.isRetentionRecordedForSession=!1,xe()}function xe(){A.recordRetentionTimerId&&(clearTimeout(A.recordRetentionTimerId),A.recordRetentionTimerId=null)}function ke(){A.isRetentionRecordedForSession&&we()}function Te(){var e,n,t;return null!==(t=null===(e=A.locs.widgetButtonText)||void 0===e?void 0:e[null!==(n=A.language)&&void 0!==n?n:"en"])&&void 0!==t?t:"Support"}function Ce(){var e=A.isInForeground,n="visible"===document.visibilityState&&document.hasFocus();A.isInForeground=n,e!==n&&re(),n&&"paused"===A.sessionStatus?Se():n||"active"!==A.sessionStatus||function(){if(A.sessionResumeOrStartTime&&A.retentionRemainingSeconds){var e=Math.floor((Date.now()-A.sessionResumeOrStartTime.valueOf())/1e3);A.retentionRemainingSeconds-=e}A.sessionStatus="paused",xe()}()}function Oe(){var e,n=A.isLoggedIn,t=Boolean(A.signedMetadataToken||(null===(e=A.player)||void 0===e?void 0:e.id));A.isLoggedIn=t,t&&!n?ee():!t&&n&&ne()}try{document.addEventListener("visibilitychange",Ce),window.addEventListener("focus",Ce),window.addEventListener("blur",Ce),window.addEventListener("resize",he),window.addEventListener("resize",V),window.addEventListener("message",(function(e){if("theymes.ready"===e.data.action){var n=document.querySelector(y.sdkLoaderIframe),t=document.querySelector(y.sdkIframe);A.networkErrorTimerId&&(clearTimeout(A.networkErrorTimerId),A.networkErrorTimerId=null),t&&(t.style.width="100%",t.style.height="100%"),n&&n.remove()}else if("theymes.close"===e.data.action)le();else if("theymes.closeNotification"===e.data.action)Z({notification:A.visibleNotification});else if("theymes.handleNotificationAction"===e.data.action)r={notification:A.visibleNotification},(null==(a=r.notification)?void 0:a.action)&&"OPEN_PAGE"===a.action.type&&(ge({path:a.action.path}),Z({notification:a}));else if("theymes.sdkButtonClicked"===e.data.action)(i=document.querySelector(y.sdkButtonIframe))&&(i.style.opacity="0",i.style.transform="scale(0.8)",setTimeout((function(){i.remove()}),1e3*T)),"support"===A.widgetButtonAction?ae():"assistant"===A.widgetButtonAction&&se();else if("theymes.openExternalPage"===e.data.action){var o=e.data.url.startsWith(window.location.origin);o&&function(e){var n=e.key,t=e.value,o=e.ttlMs,i=e.storage,r=void 0===i?R:i,a={value:t,expiry:Date.now()+o};r.setItem(n,JSON.stringify(a))}({key:O,value:e.data.path,ttlMs:1e4}),window.open(e.data.url,o?"_self":"_blank")}var i,r,a}),!1),de("open",(function(){A.sdkIsOpen=!0,te()})),de("close",(function(){A.sdkIsOpen=!1,oe()}))}catch(e){console.error("Error adding event listeners to SDK",e)}var Ie=j("initialize",(function(o,i,r){return n(void 0,void 0,void 0,(function(){var n,a,s,l,c,d,u,y,b,w,S,E,x,k;return t(this,(function(t){switch(t.label){case 0:if(!o||!i||!r.mode)throw new Error("Token, domain, and mode are required");A.token=o,A.domain=i,A.mode=r.mode,A.element="element"in r&&void 0!==r.element?r.element:A.element,A.language=null!==(u=r.language)&&void 0!==u?u:A.language,A.nonce=null!==(y=r.nonce)&&void 0!==y?y:A.nonce,A.deviceId=function(){var e=L("deviceId");if(e)return e;var n=(t=Date.now(),"undefined"!=typeof performance&&"function"==typeof performance.now&&(t+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})));return _("deviceId",n),n;var t}(),A.widgetButton="button"in r&&void 0!==r.button&&null!==(b=r.button)&&void 0!==b?b:A.widgetButton,A.widgetButtonAction="buttonAction"in r&&void 0!==r.buttonAction&&null!==(w=r.buttonAction)&&void 0!==w?w:A.widgetButtonAction,A.position="position"in r&&void 0!==r.position&&null!==(S=r.position)&&void 0!==S?S:A.position,A.x="x"in r&&void 0!==r.x?r.x:A.x,A.y="y"in r&&void 0!==r.y?r.y:A.y,A.disableInsets="game"===A.mode&&null!==A.element,$.eventPoller||($.eventPoller=new Q),n="https://".concat(i,"/api/sdk/settings"),a=new URLSearchParams({token:A.token,platform:v,mode:A.mode}).toString(),t.label=1;case 1:return t.trys.push([1,6,,7]),[4,fetch("".concat(n,"?").concat(a),{method:"GET"})];case 2:return(s=t.sent()).ok?[3,4]:[4,be(s)];case 3:throw t.sent();case 4:return[4,s.json()];case 5:return l=t.sent(),(null===(E=null==l?void 0:l.branding)||void 0===E?void 0:E.colors)&&(N=l.branding.colors,A.colors=e(e({},A.colors),N),_(g,JSON.stringify(A.colors))),(null===(x=null==l?void 0:l.branding)||void 0===x?void 0:x.locs)&&(P=l.branding.locs,A.locs=e(e({},A.locs),P),_(f,JSON.stringify(A.locs))),(null===(k=null==l?void 0:l.branding)||void 0===k?void 0:k.fonts)&&(I=l.branding.fonts,A.fonts=e(e({},A.fonts),I),_(p,JSON.stringify(A.fonts))),"number"!=typeof(null==l?void 0:l.recordRetentionAfterSecs)&&null!==(null==l?void 0:l.recordRetentionAfterSecs)||(C=l.recordRetentionAfterSecs,A.recordRetentionAfterSecs=C,_(m,JSON.stringify(A.recordRetentionAfterSecs))),"number"!=typeof(null==l?void 0:l.resetSessionAfterSecs)&&null!==(null==l?void 0:l.resetSessionAfterSecs)||(T=l.resetSessionAfterSecs,A.resetSessionAfterSecs=null!=T?T:D(),_(h,JSON.stringify(A.resetSessionAfterSecs))),Se(),pe(),c=function(e){var n=e.key,t=e.storage,o=void 0===t?R:t,i=e.removeItem,r=void 0!==i&&i,a=o.getItem(n);if(!a)return null;var s=JSON.parse(a);return Date.now()>s.expiry?(o.removeItem(n),null):(r&&o.removeItem(n),s.value)}({key:O,removeItem:!0}),c&&"widget"===A.mode&&!z()?ge({path:c}):A.widgetButton&&ve(),[3,7];case 6:return d=t.sent(),console.error("Error initializing SDK:",d),[3,7];case 7:return[2]}var T,C,I,P,N}))}))}),void 0),Le=j("openSupport",ae,void 0),_e=j("openAssistant",se,void 0),Re=j("openResource",(function(e,n){var t="/resources/".concat(e);fe({path:t,config:n}),ge({path:t,config:n})}),void 0),Pe=j("close",le,void 0),Ae=j("getLanguage",(function(){return A.language}),null),Ne=j("setLanguage",(function(e){var n=A.language!==e;A.language=e,n&&(pe(),K({action:"widgetButtonTextUpdate",text:Te()}))}),void 0),De=j("getSignedMetadataToken",(function(){return A.signedMetadataToken}),null),Be=j("setSignedMetadataToken",(function(e){var n=A.signedMetadataToken!==e;A.signedMetadataToken=e,Oe(),n&&(pe(),ke())}),void 0),Me=j("getPlayer",(function(){return A.player}),null),He=j("setPlayer",(function(e){var n,t=(null===(n=A.player)||void 0===n?void 0:n.id)!==(null==e?void 0:e.id);A.player=e,Oe(),t&&(pe(),ke())}),void 0),Fe=j("getTags",(function(){return Array.from(A.tags)}),[]),je=j("setTags",(function(e){A.tags=new Set(e),pe()}),void 0),Ue=j("addTag",(function(e){A.tags.add(e),pe()}),void 0),qe=j("addTags",(function(e){e.forEach((function(e){return A.tags.add(e)})),pe()}),void 0),We=j("removeTag",(function(e){A.tags.delete(e),pe()}),void 0),Ge=j("removeTags",(function(e){e.forEach((function(e){return A.tags.delete(e)})),pe()}),void 0),ze=j("removeAllTags",(function(){A.tags.clear(),pe()}),void 0),Je=j("getFields",(function(){return A.fields}),{}),Ye=j("setFields",(function(e){A.fields=e,pe()}),void 0),Ke=j("addField",(function(e,n){A.fields[e]=n,pe()}),void 0),Xe=j("addFields",(function(n){A.fields=e(e({},A.fields),n),pe()}),void 0),Ve=j("removeField",(function(e){delete A.fields[e],pe()}),void 0),Ze=j("removeFields",(function(e){e.forEach((function(e){return delete A.fields[e]})),pe()}),void 0),Qe=j("removeAllFields",(function(){A.fields={},pe()}),void 0),$e=j("enableLogging",(function(){A.loggingEnabled=!0}),void 0),en=j("disableLogging",(function(){A.loggingEnabled=!1}),void 0),nn=j("isYoungPlayer",(function(){return A.youngPlayer}),!1),tn=j("setYoungPlayer",(function(e){A.youngPlayer=e,pe()}),void 0),on=j("isPrivacyMode",(function(){return A.privacyMode}),!1),rn=j("setPrivacyMode",(function(e){A.privacyMode=e,pe()}),void 0),an=j("isSupported",ce,!1),sn=j("requestNotificationPermission",(function(){}),void 0),ln=j("enableNotifications",(function(){A.notificationsPaused=!1,ie()}),void 0),cn=j("disableNotifications",(function(){A.notificationsPaused=!0}),void 0),dn=j("getUnreadMessageCount",(function(){return A.unreadMessageCount}),0),un=j("getUnansweredMessageCount",(function(){return A.unansweredMessageCount}),0),gn=j("getSdkVersion",(function(){return u}),""),fn=j("reset",(function(){A.language=null,A.tags=new Set,A.fields={},A.signedMetadataToken=null,A.player=null,Oe(),pe(),K({action:"widgetButtonTextUpdate",text:Te()})}),void 0),pn=j("recordRetention",(function(){A.isRetentionRecordedForSession||we()}),void 0),mn=j("addEventListener",de,void 0),hn=j("removeEventListener",(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];a.apply(void 0,e)}),void 0),vn=j("iosSetKeyboardHeight",(function(e){A.keyboardHeight=e,he()}),void 0);export{mn as addEventListener,Ke as addField,Xe as addFields,Ue as addTag,qe as addTags,Pe as close,en as disableLogging,cn as disableNotifications,$e as enableLogging,ln as enableNotifications,Je as getFields,Ae as getLanguage,Me as getPlayer,gn as getSdkVersion,De as getSignedMetadataToken,Fe as getTags,un as getUnansweredMessageCount,dn as getUnreadMessageCount,Ie as initialize,vn as iosSetKeyboardHeight,on as isPrivacyMode,an as isSupported,nn as isYoungPlayer,_e as openAssistant,Re as openResource,Le as openSupport,pn as recordRetention,Qe as removeAllFields,ze as removeAllTags,hn as removeEventListener,Ve as removeField,Ze as removeFields,We as removeTag,Ge as removeTags,sn as requestNotificationPermission,fn as reset,Ye as setFields,Ne as setLanguage,He as setPlayer,rn as setPrivacyMode,Be as setSignedMetadataToken,je as setTags,tn as setYoungPlayer};
|
|
1
|
+
var e=function(){return e=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},e.apply(this,arguments)};function n(e,n,t,o){return new(t||(t=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}l((o=o.apply(e,n||[])).next())}))}function t(e,n){var t,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[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(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(t=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(6===s[0]&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=n.call(e,r)}catch(e){s=[6,e],o=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function o(e,n,t){if(t||2===arguments.length)for(var o,i=0,r=n.length;i<r;i++)!o&&i in n||(o||(o=Array.prototype.slice.call(n,0,i)),o[i]=n[i]);return e.concat(o||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var i={unreadMessageCountUpdate:new Set,unansweredMessageCountUpdate:new Set,open:new Set,close:new Set};function r(e,n){i[e].add(n)}function a(e,n){i[e].delete(n)}function s(e,n){i[e].forEach((function(e){return e.apply(void 0,n)}))}var l='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .loader-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .loader {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 2rem;\n height: 2rem;\n animation: spin 1s linear infinite;\n transform-origin: center;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="loader-wrapper">\n <svg class="loader" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" fill="none" data-test-name="oval"\n role="img">\n <g fill="none" fill-rule="evenodd">\n <g transform="translate(1 1)" stroke-width="2">\n <circle stroke-opacity="0.5" cx="18" cy="18" r="18" />\n <path d="M36 18c0-9.94-8.06-18-18-18" />\n </g>\n </g>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',c='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: sans-serif;\n font-size: CSS_FONT_SIZE_PLACEHOLDER;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n .error-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n padding: 12px;\n }\n\n h1 {\n font-size: 18px;\n font-weight: 400;\n color: rgb(CSS_TEXT_PLACEHOLDER);\n }\n\n svg.error-icon {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="error-wrapper">\n <svg class="error-icon" width="91" height="91" viewBox="0 0 91 91" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M45.1079 89.1321C50.7158 89.1321 55.2618 84.5859 55.2618 78.9783C55.2618 73.3707 50.7158 68.8245 45.1079 68.8245C39.5001 68.8245 34.9541 73.3707 34.9541 78.9783C34.9541 84.5859 39.5001 89.1321 45.1079 89.1321Z"\n stroke="#FFB547" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />\n <path d="M24.7637 58.6355C35.9988 47.4005 54.2144 47.4005 65.4492 58.6355" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M12.7988 46.6689C22.1436 37.3241 34.529 32.8731 46.7703 33.3159" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M1.1084 34.4283C11.6674 23.9971 25.012 18.0833 38.7295 16.6868" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M89.1082 1.13208L62.0312 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M62.0312 1.13208L89.1082 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n </svg>\n <div>\n <h1>Connection error</h1>\n </div>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',d="<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\"\n content=\"viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\" />\n <meta name=\"theme-color\" content=\"#000000\" />\n <meta name=\"robots\" content=\"noindex\" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: 'TheymesBody';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .sdk-button {\n display: flex;\n font-family: 'TheymesBody', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n background: rgb(CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: rgb(CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER);\n font-size: 14px;\n font-weight: 700;\n cursor: pointer;\n text-align: center;\n padding: 0 12px;\n border: none;\n outline: none;\n border-radius: 999px;\n box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);\n position: relative;\n }\n\n .sdk-button-badge {\n position: absolute;\n top: 0;\n right: 0;\n background: rgb(CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER);\n width: 12px;\n height: 12px;\n border-radius: 999px;\n display: none;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <button class=\"sdk-button\">\n <span class=\"sdk-button-text\">WIDGET_BUTTON_TEXT_PLACEHOLDER</span>\n <span class=\"sdk-button-badge\"></span>\n </button>\n <script NONCE_ATTR_PLACEHOLDER>\n let unreadMessageCount = UNREAD_MESSAGE_COUNT_PLACEHOLDER;\n\n function openWidget() {\n parent.postMessage({ action: 'theymes.sdkButtonClicked' }, '*');\n }\n\n function iframeSubscriber(e) {\n if (e.data.action === 'unreadMessageCountUpdate') {\n unreadMessageCount = e.data.count;\n updateUnreadMessageCount()\n } else if (e.data.action === 'widgetButtonTextUpdate') {\n document.querySelector('.sdk-button-text').textContent = e.data.text;\n }\n }\n\n function updateUnreadMessageCount() {\n if (unreadMessageCount > 0) {\n document.querySelector('.sdk-button-badge').style.display = 'block';\n } else {\n document.querySelector('.sdk-button-badge').style.display = 'none';\n }\n }\n\n document.querySelector('.sdk-button').addEventListener('click', openWidget);\n window.addEventListener('message', iframeSubscriber, false);\n\n updateUnreadMessageCount();\n <\/script>\n</body>\n\n</html>",u="1.2.10",g="colors",f="locs",p="fonts",m="recordRetentionAfterSecs",h="resetSessionAfterSecs",v="web",y={sdkDialog:"#theymes-sdk-dialog",sdkIframeWrapper:"#theymes-sdk-wrapper",sdkIframe:"#theymes-sdk",sdkLoaderIframe:"#theymes-sdk-loader",notificationDialog:"#theymes-sdk-notification-dialog",notificationIframe:"#theymes-sdk-notification",sdkButtonIframe:"#theymes-sdk-button",sdkStylesheet:"#theymes-sdk-stylesheet"},b=340,w=680,S=500,E=120,x=48,T=.2,k=.2,C=.2,O="theymes_path_on_init",I="url('https://fonts.gstatic.com/s/poppins/v22/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2') format('woff2')",L=function(e){var n;try{return null!==(n=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e))&&void 0!==n?n:null}catch(e){return null}},_=function(e,n){try{null===localStorage||void 0===localStorage||localStorage.setItem(e,n)}catch(e){}},R={length:0,getItem:function(e){var n;try{return null!==(n=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem(e))&&void 0!==n?n:null}catch(e){return null}},setItem:function(e,n){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.removeItem(e)}catch(e){}},clear:function(){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.clear()}catch(e){}},key:function(e){var n;try{return null!==(n=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.key(e))&&void 0!==n?n:null}catch(e){return null}}},P=28800,A=function(){var n=null,t=P,o={text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}},i={widgetButtonText:{}},r=N();try{n=function(){var e=L(m);if(e){var n=JSON.parse(e);if("number"==typeof n)return n}return null}(),t=function(){var e=L(h);if(e){var n=JSON.parse(e);if("number"==typeof n)return n}return D()}(),o=function(){var n=L(g);if(n){var t=JSON.parse(n);return e(e({},{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}),t)}return{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}}(),i=function(){var n=L(f);if(n){var t=JSON.parse(n);return e(e({},{widgetButtonText:{}}),t)}return{widgetButtonText:{}}}(),r=function(){var n=L(p);if(n){var t=JSON.parse(n);return e(e({},N()),t)}return N()}()}catch(e){console.error("Error initializing internals",e)}return{token:null,domain:null,mode:"game",deviceId:null,position:"bottom-right",widgetButton:!1,widgetButtonAction:"support",x:20,y:20,loggingEnabled:!1,element:null,language:null,userLanguage:navigator.language,tags:new Set,fields:{},youngPlayer:!1,privacyMode:!1,signedMetadataToken:null,isLoggedIn:!1,isInForeground:!0,hasNetworkConnectivity:!0,player:null,sdkIsOpen:!1,forceUpdateSdkDialog:!1,recordRetentionAfterSecs:n,resetSessionAfterSecs:t,sessionStatus:"waiting",sessionStartTime:null,sessionResumeOrStartTime:null,retentionRemainingSeconds:null,isRetentionRecordedForSession:!1,recordRetentionTimerId:null,retryRecordRetentionTimerId:null,retryIntervalSecs:300,networkErrorTimerId:null,colors:o,locs:i,fonts:r,notificationsPaused:!0,notifications:[],visibleNotification:null,unreadMessageCount:0,unansweredMessageCount:0,previousPath:null,previousConfig:null,nonce:null,keyboardHeight:0,disableInsets:!1}}();function N(){return{body:void 0}}function D(){return P}var B=function(e,n){return e===n||Boolean(e&&n&&"object"==typeof e&&"object"==typeof n&&Object.keys(e).length===Object.keys(n).length&&Object.entries(e).every((function(e){var t=e[0],o=e[1];return B(o,n[t])})))};function M(e){var n,t=e.iframe,o=e.content,i=null===(n=t.contentWindow)||void 0===n?void 0:n.document;i&&(i.open(),i.write(o),i.close())}function H(e){return"".concat(e.r,", ").concat(e.g,", ").concat(e.b)}function F(e){var n,t,o,i;return e.template.replace(/PLATFORM_PLACEHOLDER/g,v).replace(/INSET_TOP_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-top, 0px)").replace(/INSET_BOTTOM_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)").replace(/INSET_LEFT_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-left, 0px)").replace(/INSET_RIGHT_PLACEHOLDER/g,A.disableInsets?"0px":"env(safe-area-inset-right, 0px)").replace(/CSS_TEXT_PLACEHOLDER/g,H(A.colors.text)).replace(/CSS_BORDER_PLACEHOLDER/g,H(A.colors.border)).replace(/CSS_BACKGROUND_PLACEHOLDER/g,H(A.colors.background)).replace(/CSS_TILE_PLACEHOLDER/g,H(A.colors.tile)).replace(/CSS_ACCENT_PLACEHOLDER/g,H(A.colors.accent)).replace(/CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER/g,H(A.colors.notificationBackground)).replace(/CSS_NOTIFICATION_TEXT_PLACEHOLDER/g,H(A.colors.notificationText)).replace(/CSS_FONT_SIZE_PLACEHOLDER/g,"game"===A.mode?"16px":"14px").replace(/CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER/g,null!==(t=null===(n=A.fonts.body)||void 0===n?void 0:n.regular)&&void 0!==t?t:I).replace(/CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER/g,null!==(i=null===(o=A.fonts.body)||void 0===o?void 0:o.fallback)&&void 0!==i?i:"ui-sans-serif, system-ui, sans-serif").replace(/NONCE_ATTR_PLACEHOLDER/g,A.nonce?'nonce="'.concat(A.nonce,'"'):"")}var j=function(e,n,t){return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];try{return n.apply(void 0,o)}catch(n){return console.error("Error in ".concat(e),n),t}}},U='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: \'TheymesBody\';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: \'TheymesBody\', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n }\n\n html,\n body {\n width: 100%;\n height: auto;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n width: 1.25rem;\n height: 1.25rem;\n }\n\n .notification {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background: rgb(CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: auto;\n margin: 0;\n padding: 12px;\n border-radius: 6px;\n color: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n }\n\n .notification-text {\n flex: 1 0 0%;\n font-size: 0.875rem;\n /* 14/16 */\n line-height: 1.2;\n display: -webkit-box;\n line-clamp: 2;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n\n .close-button {\n flex: 0 0 auto;\n padding-left: 10px;\n cursor: pointer;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="notification">\n <div class="notification-text">NOTIFICATION_TEXT_PLACEHOLDER</div>\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6 6 18"></path>\n <path d="m6 6 12 12"></path>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeNotification() {\n parent.postMessage({ action: \'theymes.closeNotification\' }, \'*\');\n }\n\n function notificationClicked() {\n parent.postMessage({ action: \'theymes.handleNotificationAction\' }, \'*\');\n }\n\n document.querySelector(\'.notification-text\').addEventListener(\'click\', notificationClicked);\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeNotification);\n <\/script>\n</body>\n\n</html>',q=/(android|bb\d+|meego).+mobile|armv7l|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|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,W=/CrOS/,G=/android|ipad|playbook|silk/i;function z(){return!!function(e){e||(e={});var n=e.ua;if(n||"undefined"==typeof navigator||(n=navigator.userAgent),n&&n.headers&&"string"==typeof n.headers["user-agent"]&&(n=n.headers["user-agent"]),"string"!=typeof n)return!1;var t=q.test(n)&&!W.test(n)||!!e.tablet&&G.test(n);return!t&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==n.indexOf("Macintosh")&&-1!==n.indexOf("Safari")&&(t=!0),t}({tablet:!0})&&(window.innerWidth<S||window.innerHeight<S)}function J(e){var n=e.type,t=A.position,o=A.x,i=A.y;return z()&&"widget"===n?{top:"0",left:"0",right:"0",bottom:"0"}:"top-left"===t?{top:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",bottom:"auto"}:"top-right"===t?{top:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",bottom:"auto"}:"bottom-left"===t?{bottom:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",top:"auto"}:{bottom:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",top:"auto"}}function Y(){return z()?{width:"100%",height:"100%",maxWidth:"none",maxHeight:"none"}:{width:"".concat(b,"px"),height:"".concat(w,"px"),maxWidth:"none",maxHeight:"calc(100vh - ".concat(2*A.y,"px)")}}function K(e){var n=document.querySelector(y.sdkButtonIframe);if(n)var t=setInterval((function(){var o,i;"complete"===(null===(o=n.contentDocument)||void 0===o?void 0:o.readyState)&&(clearInterval(t),null===(i=null==n?void 0:n.contentWindow)||void 0===i||i.postMessage(e,"*"))}),100)}function X(){var e,n,t=A.notifications[0];if(t&&!A.visibleNotification){A.visibleNotification=t;var o=null!==(e=document.querySelector(y.notificationDialog))&&void 0!==e?e:document.createElement("div");o.id=y.notificationDialog.replace("#",""),o.style.position="fixed",o.style.border="none",o.style.margin="0",o.style.padding="0",o.style.zIndex="9999",o.style.colorScheme="auto",o.style.backgroundColor="transparent",o.style.pointerEvents="none",o.style.overflow="hidden",document.body.appendChild(o);var i,r=null!==(n=o.querySelector(y.notificationIframe))&&void 0!==n?n:document.createElement("iframe");r.id=y.notificationIframe.replace("#",""),r.style.position="absolute",r.style.border="none",r.style.width="0",r.style.height="0",r.style.top="-20px",r.style.left="0",r.style.colorScheme="auto",r.style.pointerEvents="auto",r.style.marginTop="-20px",r.style.opacity="0",r.style.transition="opacity ".concat(C,"s ease-in-out, margin-top ").concat(C,"s ease-in-out"),o.appendChild(r),M({iframe:r,content:(i={text:t.text},F({template:U}).replace(/NOTIFICATION_TEXT_PLACEHOLDER/g,i.text))}),setTimeout((function(){r.style.opacity="1",r.style.marginTop="0px",V()}),500),t.closeAfterSeconds>0&&setTimeout((function(){Z({notification:t})}),1e3*t.closeAfterSeconds)}}function V(){var e,n,t,o=document.querySelector(y.notificationDialog),i=document.querySelector(y.notificationIframe);if(o&&i){var r=(null===(t=null===(n=null===(e=i.contentWindow)||void 0===e?void 0:e.document)||void 0===n?void 0:n.body)||void 0===t?void 0:t.scrollHeight)?"".concat(i.contentWindow.document.body.scrollHeight,"px"):"0";if("widget"===A.mode){var a=J({type:"widget"}),s=Y(),l="calc(".concat(s.width," - 20px)");o.style.bottom=a.bottom,o.style.right=a.right,o.style.left=a.left,o.style.top=a.top,o.style.overflow="hidden",i.style.width=l}else if(A.element){var c=A.element.getBoundingClientRect();l="".concat(c.width-20,"px");o.style.top="".concat(c.top,"px"),o.style.left="".concat(c.left,"px"),o.style.right="".concat(c.right,"px"),o.style.bottom="".concat(c.bottom,"px"),o.style.overflow="hidden",i.style.width=l}else{l="calc(100% - 20px)";o.style.top=A.disableInsets?"0px":"env(safe-area-inset-top, 0px)",o.style.left=A.disableInsets?"0px":"env(safe-area-inset-left, 0px)",o.style.right=A.disableInsets?"0px":"env(safe-area-inset-right, 0px)",o.style.bottom=A.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)",o.style.overflow="visible",i.style.width=l}i.style.height=r,i.style.top="10px",i.style.left="10px"}}function Z(e){if(e.notification&&A.visibleNotification===e.notification){var n=document.querySelector(y.notificationIframe),t=document.querySelector(y.notificationDialog);n&&(n.style.opacity="0",n.style.marginTop="-20px",setTimeout((function(){null==t||t.remove(),A.notifications=A.notifications.slice(1),A.visibleNotification=null,X()}),1e3*C))}}var Q=function(){function i(){Object.defineProperty(this,"isRunning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pollWhenNotificationsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"lastPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nextPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.resumeIfNeeded(!1)}return Object.defineProperty(i.prototype,"onIsInForegroundChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){A.isInForeground?this.resumeIfNeeded(!1):this.pauseIfNeeded()}}),Object.defineProperty(i.prototype,"onHasNetworkConnectivityChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!1)}}),Object.defineProperty(i.prototype,"resume",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.isRunning=!0;var n=new Date;if(this.nextPollDate&&!e||(this.nextPollDate=new Date(n.getTime()+1e3)),n>=this.nextPollDate)this.pollEventsRequest();else{var t=(this.nextPollDate.getTime()-n.getTime())/1e3;this.scheduleNextPollEventsRequest(t)}}}),Object.defineProperty(i.prototype,"pause",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning=!1,this.timer&&(clearTimeout(this.timer),this.timer=null)}}),Object.defineProperty(i.prototype,"shouldBeRunning",{enumerable:!1,configurable:!0,writable:!0,value:function(){return A.isLoggedIn&&A.isInForeground&&A.hasNetworkConnectivity&&!A.sdkIsOpen}}),Object.defineProperty(i.prototype,"resumeIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(e){!this.shouldBeRunning()||this.isRunning&&!e||this.resume(e)}}),Object.defineProperty(i.prototype,"pauseIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&!this.shouldBeRunning()&&this.pause()}}),Object.defineProperty(i.prototype,"onEnableNotifications",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&this.pollWhenNotificationsEnabled&&this.scheduleNextPollEventsRequest(0)}}),Object.defineProperty(i.prototype,"onOpen",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(i.prototype,"onClose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(i.prototype,"onLogin",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(i.prototype,"onLogout",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(i.prototype,"scheduleNextPollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this;this.nextPollDate=new Date(Date.now()+1e3*e),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){n.timer=null,n.pollEventsRequest()}),1e3*e)}}),Object.defineProperty(i.prototype,"pollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(){return n(this,void 0,void 0,(function(){var n,i,r,a,l,c,d,u,g;return t(this,(function(t){switch(t.label){case 0:if(!A.token||!A.domain||!A.deviceId)return[2];if(!this.isRunning)return[2];if(this.lastPollDate&&(n=new Date(this.lastPollDate.getTime()+6e4),(i=(n.getTime()-Date.now())/1e3)>0))return this.scheduleNextPollEventsRequest(i),[2];this.lastPollDate=new Date,r=A.notificationsPaused||A.sdkIsOpen?"true":"false",a=new URLSearchParams(e(e({token:A.token,language:null!==(u=A.language)&&void 0!==u?u:"en",deviceId:A.deviceId,notificationsPaused:r,mode:A.mode},(null===(g=A.player)||void 0===g?void 0:g.id)?{unsignedPlayerId:A.player.id}:{}),A.signedMetadataToken?{signedMetadataToken:A.signedMetadataToken}:{})).toString(),t.label=1;case 1:return t.trys.push([1,4,,5]),[4,fetch("https://".concat(A.domain,"/api/sdk/events?").concat(a),{method:"GET"})];case 2:if(!(l=t.sent()).ok)throw new Error("HTTP error! status: ".concat(l.status));return[4,l.json()];case 3:return c=t.sent(),this.scheduleNextPollEventsRequest(c.nextPollSeconds),void 0!==c.pollWhenNotificationsEnabled&&(this.pollWhenNotificationsEnabled=c.pollWhenNotificationsEnabled),A.notifications=o(o([],A.notifications,!0),c.notifications,!0),A.notifications.length>0&&X(),c.unansweredMessageCount!==A.unansweredMessageCount&&(A.unansweredMessageCount=c.unansweredMessageCount,s("unansweredMessageCountUpdate",[c.unansweredMessageCount])),c.unreadMessageCount!==A.unreadMessageCount&&(A.unreadMessageCount=c.unreadMessageCount,s("unreadMessageCountUpdate",[c.unreadMessageCount]),K({action:"unreadMessageCountUpdate",count:c.unreadMessageCount})),[3,5];case 4:return d=t.sent(),console.error("Error fetching events:",d),this.scheduleNextPollEventsRequest(A.retryIntervalSecs),[3,5];case 5:return[2]}}))}))}}),i}(),$={eventPoller:null},ee=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onLogin()},ne=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onLogout()},te=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onOpen()},oe=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onClose()},ie=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onEnableNotifications()},re=function(){var e;null===(e=$.eventPoller)||void 0===e||e.onIsInForegroundChanged()},ae=function(e){var n="/help-center";fe({path:n,config:e}),ge({path:n,config:e})},se=function(e){var n="/assistant";fe({path:n,config:e}),ge({path:n,config:e})},le=function(){!function(){var e=document.querySelector(y.sdkDialog),n=document.querySelector(y.sdkIframeWrapper);if(e){var t=function(){"widget"!==A.mode||A.forceUpdateSdkDialog?e.remove():e.style.display="none",A.forceUpdateSdkDialog=!1};n?(n.style.opacity="0",n.style.transform=ye({animation:"start"}),setTimeout((function(){t()}),1e3*T)):t()}A.widgetButton&&ve();s("close",[])}()},ce=function(){try{return CSS.supports("color","var(--color)")&&CSS.supports("color","rgb(255 255 255 / 0.5)")}catch(e){return!1}},de=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r.apply(void 0,e)};function ue(n){var t,i,r,a,s,l,c=(null!=n?n:{}).config;if(!A.token||!A.domain||!A.deviceId)return null;var d=null!==(t=null==c?void 0:c.tags)&&void 0!==t?t:[],g=null!==(i=null==c?void 0:c.fields)&&void 0!==i?i:{},f=null!==(a=null!==(r=null==c?void 0:c.language)&&void 0!==r?r:A.language)&&void 0!==a?a:null,p=null!==(s=A.signedMetadataToken)&&void 0!==s?s:null,m=null!==(l=A.player)&&void 0!==l?l:null,h={_platform:v,_sdkVersion:u};A.youngPlayer&&(h._youngPlayer=!0),(A.privacyMode||A.youngPlayer)&&(h._privacyMode=!0);var y=o(o([],Array.from(A.tags),!0),d,!0),b=e(e(e({},A.fields),g),h);return{token:A.token,domain:A.domain,deviceId:A.deviceId,tags:y,fields:b,language:f,signedMetadataToken:p,player:m}}function ge(e){var n,t,o,i=ue({config:e.config});if(i){var r=null!==(n=document.querySelector(y.sdkDialog))&&void 0!==n?n:document.createElement("div");r.id=y.sdkDialog.replace("#",""),r.style.display="block",r.style.position="fixed",r.style.border="none",r.style.width="0",r.style.height="0",r.style.margin="0",r.style.padding="0",r.style.zIndex="9998",r.style.overflow="hidden",r.style.backgroundColor="transparent";var a=null!==(t=r.querySelector(y.sdkIframeWrapper))&&void 0!==t?t:document.createElement("div");a.id=y.sdkIframeWrapper.replace("#",""),a.style.position="relative",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.right="0",a.style.bottom="0",a.style.left="0",a.style.opacity="0",a.style.colorScheme="auto",a.style.border="none",a.style.backgroundColor="rgb(".concat(H(A.colors.background),")"),a.style.transform=ye({animation:"start"}),a.style.transition=(A.mode,"opacity ".concat(T,"s ease-in-out, transform ").concat(T,"s ease-in-out")),"widget"===A.mode&&(a.style.overflow="hidden");var d=null!==(o=a.querySelector(y.sdkLoaderIframe))&&void 0!==o?o:document.createElement("iframe");d.id=y.sdkLoaderIframe.replace("#",""),d.style.position="absolute",d.style.border="none",d.style.width="100%",d.style.height="100%",d.style.top="0",d.style.right="0",d.style.bottom="0",d.style.left="0",d.style.colorScheme="auto";var u=a.querySelector(y.sdkIframe),g=null!=u?u:document.createElement("iframe"),f=setInterval((function(){var e;"complete"===(null===(e=g.contentDocument)||void 0===e?void 0:e.readyState)&&(clearInterval(f),m())}),500);g.id=y.sdkIframe.replace("#",""),g.style.position="absolute",g.style.border="none",g.style.top="0",g.style.right="0",g.style.bottom="0",g.style.left="0",g.style.colorScheme="auto",u&&!A.networkErrorTimerId||(g.src=function(e){var n=e.path,t=e.supportViewConfig,o="https://".concat(A.domain,"/sdk"),i=new URLSearchParams;i.set("platform",v),i.set("token",t.token),i.set("deviceId",t.deviceId),i.set("mode",A.mode),i.set("origin",window.location.origin),i.set("userLanguage",A.userLanguage),A.disableInsets&&i.set("disableInsets","true");t.language&&i.set("language",t.language);ce()||i.set("unsupported","true");var r=me({supportViewConfig:t});return i.set("metadata",JSON.stringify(r)),"".concat(o).concat(n,"?").concat(i.toString())}({path:e.path,supportViewConfig:i}),g.style.width="0",g.style.height="0",r.appendChild(a),a.appendChild(d),a.appendChild(g),document.body.appendChild(r)),M({iframe:d,content:F({template:l})});var p=!1,m=function(){p||(p=!0,A.networkErrorTimerId=setTimeout((function(){M({iframe:d,content:F({template:c})})}),1e4))};g.onload=m,g.onerror=function(){M({iframe:d,content:F({template:c})})},he(),s("open",[]),setTimeout((function(){a.style.opacity="1",a.style.transform=ye({animation:"end"})}),100)}}function fe(e){var n=e.path,t=e.config,o=null!=t?t:null;A.previousPath===n&&B(A.previousConfig,o)||(A.previousPath=n,A.previousConfig=o,pe())}function pe(){var e=document.querySelector(y.sdkDialog);A.sdkIsOpen?A.forceUpdateSdkDialog=!0:null==e||e.remove()}function me(e){var n=e.supportViewConfig,t={unsigned:{},signed:void 0};return n.player&&(t.unsigned.player=n.player),n.tags&&(t.unsigned.tags=n.tags),n.fields&&(t.unsigned.fields=n.fields),n.signedMetadataToken&&(t.signed=n.signedMetadataToken),t}function he(){var e=document.querySelector(y.sdkDialog),n=document.querySelector(y.sdkIframeWrapper);if(e&&n)if("widget"===A.mode){var t=J({type:"widget"}),o=Y();e.style.width=o.width,e.style.height=o.height,e.style.maxWidth=o.maxWidth,e.style.maxHeight=o.maxHeight,e.style.bottom=t.bottom,e.style.right=t.right,e.style.left=t.left,e.style.top=t.top,z()?(n.style.border="none",n.style.borderRadius="0"):(n.style.border="1px solid rgb(".concat(H(A.colors.border),")"),n.style.borderRadius="10px")}else if(n.style.border="none",n.style.borderRadius="0",A.element){var i=A.element.getBoundingClientRect(),r=i.width,a=i.height,s=i.top,l=i.left,c=i.right,d=i.bottom;e.style.width="".concat(r,"px"),e.style.height="".concat(a,"px"),e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="".concat(s,"px"),e.style.left="".concat(l,"px"),e.style.right="".concat(c,"px"),e.style.bottom="".concat(d,"px")}else{a=A.keyboardHeight>0?"calc(100% - ".concat(A.keyboardHeight,"px + env(safe-area-inset-bottom) - 10px)"):"100%";e.style.width="100%",e.style.height=a,e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0"}}function ve(){var e,n=null!==(e=document.querySelector(y.sdkButtonIframe))&&void 0!==e?e:document.createElement("iframe");if(n){var t,o=J({type:"button"});n.id=y.sdkButtonIframe.replace("#",""),n.style.position="fixed",n.style.border="none",n.style.width="".concat(E,"px"),n.style.height="".concat(x,"px"),n.style.maxWidth="95%",n.style.maxHeight="95%",n.style.bottom=o.bottom,n.style.right=o.right,n.style.left=o.left,n.style.top=o.top,n.style.margin="0",n.style.padding="0",n.style.zIndex="9997",n.style.backgroundColor="transparent",n.style.opacity="0",n.style.transform="scale(0.8)",n.style.transition="opacity ".concat(k,"s ease-in-out, transform ").concat(k,"s ease-in-out"),setTimeout((function(){n.style.opacity="1",n.style.transform="scale(1)"}),100),document.body.appendChild(n),M({iframe:n,content:(t={unreadMessageCount:A.unreadMessageCount},F({template:d}).replace(/UNREAD_MESSAGE_COUNT_PLACEHOLDER/g,"".concat(t.unreadMessageCount)).replace(/CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER/g,H(A.colors.widgetButtonBackground)).replace(/CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER/g,H(A.colors.widgetButtonText)).replace(/CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER/g,H(A.colors.widgetButtonActionPending)).replace(/WIDGET_BUTTON_TEXT_PLACEHOLDER/g,ke()))})}}function ye(e){return"start"===e.animation?"game"===A.mode?"translateY(20%)":"scale(0.8)":"game"===A.mode?"translateY(0)":"scale(1)"}function be(e){return n(this,void 0,void 0,(function(){return t(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,7]),[4,e.json()];case 1:return[2,n.sent()];case 2:n.sent(),n.label=3;case 3:return n.trys.push([3,5,,6]),[4,e.text()];case 4:return[2,n.sent()];case 5:return n.sent(),[2,void 0];case 6:return[3,7];case 7:return[2]}}))}))}function we(){return n(this,void 0,void 0,(function(){var e,n,o,i,r,a;return t(this,(function(t){switch(t.label){case 0:if(xe(),A.retryRecordRetentionTimerId&&(clearTimeout(A.retryRecordRetentionTimerId),A.retryRecordRetentionTimerId=null),A.retentionRemainingSeconds=null,A.isRetentionRecordedForSession=!0,!(e=ue()))return[2];n="https://".concat(A.domain,"/api/sdk/retention"),o=me({supportViewConfig:e}),i={token:A.token,deviceId:A.deviceId,language:A.language,metadata:o},t.label=1;case 1:return t.trys.push([1,5,,6]),[4,fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})];case 2:return(r=t.sent()).ok?[3,4]:[4,be(r)];case 3:throw t.sent();case 4:return[3,6];case 5:return a=t.sent(),console.error("Error tracking retention:",a),A.retryRecordRetentionTimerId=setTimeout(we,6e4),[3,6];case 6:return[2]}}))}))}function Se(){var e=new Date;if(A.sessionStatus="active",A.sessionResumeOrStartTime=e,A.sessionStartTime){var n=A.sessionStartTime.valueOf()/1e3+A.resetSessionAfterSecs;Date.now()/1e3>n&&Ee()}else Ee();null!==A.retentionRemainingSeconds&&(A.recordRetentionTimerId=setTimeout(we,1e3*A.retentionRemainingSeconds))}function Ee(){A.sessionStartTime=new Date,A.retentionRemainingSeconds=A.recordRetentionAfterSecs,A.isRetentionRecordedForSession=!1,xe()}function xe(){A.recordRetentionTimerId&&(clearTimeout(A.recordRetentionTimerId),A.recordRetentionTimerId=null)}function Te(){A.isRetentionRecordedForSession&&we()}function ke(){var e,n,t;return null!==(t=null===(e=A.locs.widgetButtonText)||void 0===e?void 0:e[null!==(n=A.language)&&void 0!==n?n:"en"])&&void 0!==t?t:"Support"}function Ce(){var e=A.isInForeground,n="visible"===document.visibilityState&&document.hasFocus();A.isInForeground=n,e!==n&&re(),n&&"paused"===A.sessionStatus?Se():n||"active"!==A.sessionStatus||function(){if(A.sessionResumeOrStartTime&&A.retentionRemainingSeconds){var e=Math.floor((Date.now()-A.sessionResumeOrStartTime.valueOf())/1e3);A.retentionRemainingSeconds-=e}A.sessionStatus="paused",xe()}()}function Oe(){var e,n=A.isLoggedIn,t=Boolean(A.signedMetadataToken||(null===(e=A.player)||void 0===e?void 0:e.id));A.isLoggedIn=t,t&&!n?ee():!t&&n&&ne()}try{document.addEventListener("visibilitychange",Ce),window.addEventListener("focus",Ce),window.addEventListener("blur",Ce),window.addEventListener("resize",he),window.addEventListener("resize",V),window.addEventListener("message",(function(e){if("theymes.ready"===e.data.action){var n=document.querySelector(y.sdkLoaderIframe),t=document.querySelector(y.sdkIframe);A.networkErrorTimerId&&(clearTimeout(A.networkErrorTimerId),A.networkErrorTimerId=null),t&&(t.style.width="100%",t.style.height="100%"),n&&n.remove()}else if("theymes.close"===e.data.action)le();else if("theymes.closeNotification"===e.data.action)Z({notification:A.visibleNotification});else if("theymes.handleNotificationAction"===e.data.action)r={notification:A.visibleNotification},(null==(a=r.notification)?void 0:a.action)&&"OPEN_PAGE"===a.action.type&&(ge({path:a.action.path}),Z({notification:a}));else if("theymes.sdkButtonClicked"===e.data.action)(i=document.querySelector(y.sdkButtonIframe))&&(i.style.opacity="0",i.style.transform="scale(0.8)",setTimeout((function(){i.remove()}),1e3*k)),"support"===A.widgetButtonAction?ae():"assistant"===A.widgetButtonAction&&se();else if("theymes.openExternalPage"===e.data.action){var o=e.data.target;"_self"===o&&function(e){var n=e.key,t=e.value,o=e.ttlMs,i=e.storage,r=void 0===i?R:i,a={value:t,expiry:Date.now()+o};r.setItem(n,JSON.stringify(a))}({key:O,value:e.data.path,ttlMs:6e5}),window.open(e.data.url,o)}var i,r,a}),!1),de("open",(function(){A.sdkIsOpen=!0,te()})),de("close",(function(){A.sdkIsOpen=!1,oe()}))}catch(e){console.error("Error adding event listeners to SDK",e)}var Ie=j("initialize",(function(o,i,r){return n(void 0,void 0,void 0,(function(){var n,a,s,l,c,d,u,y,b,w,S,E,x,T;return t(this,(function(t){switch(t.label){case 0:if(!o||!i||!r.mode)throw new Error("Token, domain, and mode are required");A.token=o,A.domain=i,A.mode=r.mode,A.element="element"in r&&void 0!==r.element?r.element:A.element,A.language=null!==(u=r.language)&&void 0!==u?u:A.language,A.nonce=null!==(y=r.nonce)&&void 0!==y?y:A.nonce,A.deviceId=function(){var e=L("deviceId");if(e)return e;var n=(t=Date.now(),"undefined"!=typeof performance&&"function"==typeof performance.now&&(t+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})));return _("deviceId",n),n;var t}(),A.widgetButton="button"in r&&void 0!==r.button&&null!==(b=r.button)&&void 0!==b?b:A.widgetButton,A.widgetButtonAction="buttonAction"in r&&void 0!==r.buttonAction&&null!==(w=r.buttonAction)&&void 0!==w?w:A.widgetButtonAction,A.position="position"in r&&void 0!==r.position&&null!==(S=r.position)&&void 0!==S?S:A.position,A.x="x"in r&&void 0!==r.x?r.x:A.x,A.y="y"in r&&void 0!==r.y?r.y:A.y,A.disableInsets="game"===A.mode&&null!==A.element,$.eventPoller||($.eventPoller=new Q),n="https://".concat(i,"/api/sdk/settings"),a=new URLSearchParams({token:A.token,platform:v,mode:A.mode}).toString(),t.label=1;case 1:return t.trys.push([1,6,,7]),[4,fetch("".concat(n,"?").concat(a),{method:"GET"})];case 2:return(s=t.sent()).ok?[3,4]:[4,be(s)];case 3:throw t.sent();case 4:return[4,s.json()];case 5:return l=t.sent(),(null===(E=null==l?void 0:l.branding)||void 0===E?void 0:E.colors)&&(N=l.branding.colors,A.colors=e(e({},A.colors),N),_(g,JSON.stringify(A.colors))),(null===(x=null==l?void 0:l.branding)||void 0===x?void 0:x.locs)&&(P=l.branding.locs,A.locs=e(e({},A.locs),P),_(f,JSON.stringify(A.locs))),(null===(T=null==l?void 0:l.branding)||void 0===T?void 0:T.fonts)&&(I=l.branding.fonts,A.fonts=e(e({},A.fonts),I),_(p,JSON.stringify(A.fonts))),"number"!=typeof(null==l?void 0:l.recordRetentionAfterSecs)&&null!==(null==l?void 0:l.recordRetentionAfterSecs)||(C=l.recordRetentionAfterSecs,A.recordRetentionAfterSecs=C,_(m,JSON.stringify(A.recordRetentionAfterSecs))),"number"!=typeof(null==l?void 0:l.resetSessionAfterSecs)&&null!==(null==l?void 0:l.resetSessionAfterSecs)||(k=l.resetSessionAfterSecs,A.resetSessionAfterSecs=null!=k?k:D(),_(h,JSON.stringify(A.resetSessionAfterSecs))),Se(),pe(),c=function(e){var n=e.key,t=e.storage,o=void 0===t?R:t,i=e.removeItem,r=void 0!==i&&i,a=o.getItem(n);if(!a)return null;var s=JSON.parse(a);return Date.now()>s.expiry?(o.removeItem(n),null):(r&&o.removeItem(n),s.value)}({key:O,removeItem:!0}),c&&"widget"===A.mode&&!z()?ge({path:c}):A.widgetButton&&ve(),[3,7];case 6:return d=t.sent(),console.error("Error initializing SDK:",d),[3,7];case 7:return[2]}var k,C,I,P,N}))}))}),void 0),Le=j("openSupport",ae,void 0),_e=j("openAssistant",se,void 0),Re=j("openResource",(function(e,n){var t="/resources/".concat(e);fe({path:t,config:n}),ge({path:t,config:n})}),void 0),Pe=j("close",le,void 0),Ae=j("getLanguage",(function(){return A.language}),null),Ne=j("setLanguage",(function(e){var n=A.language!==e;A.language=e,n&&(pe(),K({action:"widgetButtonTextUpdate",text:ke()}))}),void 0),De=j("getSignedMetadataToken",(function(){return A.signedMetadataToken}),null),Be=j("setSignedMetadataToken",(function(e){var n=A.signedMetadataToken!==e;A.signedMetadataToken=e,Oe(),n&&(pe(),Te())}),void 0),Me=j("getPlayer",(function(){return A.player}),null),He=j("setPlayer",(function(e){var n,t=(null===(n=A.player)||void 0===n?void 0:n.id)!==(null==e?void 0:e.id);A.player=e,Oe(),t&&(pe(),Te())}),void 0),Fe=j("getTags",(function(){return Array.from(A.tags)}),[]),je=j("setTags",(function(e){A.tags=new Set(e),pe()}),void 0),Ue=j("addTag",(function(e){A.tags.add(e),pe()}),void 0),qe=j("addTags",(function(e){e.forEach((function(e){return A.tags.add(e)})),pe()}),void 0),We=j("removeTag",(function(e){A.tags.delete(e),pe()}),void 0),Ge=j("removeTags",(function(e){e.forEach((function(e){return A.tags.delete(e)})),pe()}),void 0),ze=j("removeAllTags",(function(){A.tags.clear(),pe()}),void 0),Je=j("getFields",(function(){return A.fields}),{}),Ye=j("setFields",(function(e){A.fields=e,pe()}),void 0),Ke=j("addField",(function(e,n){A.fields[e]=n,pe()}),void 0),Xe=j("addFields",(function(n){A.fields=e(e({},A.fields),n),pe()}),void 0),Ve=j("removeField",(function(e){delete A.fields[e],pe()}),void 0),Ze=j("removeFields",(function(e){e.forEach((function(e){return delete A.fields[e]})),pe()}),void 0),Qe=j("removeAllFields",(function(){A.fields={},pe()}),void 0),$e=j("enableLogging",(function(){A.loggingEnabled=!0}),void 0),en=j("disableLogging",(function(){A.loggingEnabled=!1}),void 0),nn=j("isYoungPlayer",(function(){return A.youngPlayer}),!1),tn=j("setYoungPlayer",(function(e){A.youngPlayer=e,pe()}),void 0),on=j("isPrivacyMode",(function(){return A.privacyMode}),!1),rn=j("setPrivacyMode",(function(e){A.privacyMode=e,pe()}),void 0),an=j("isSupported",ce,!1),sn=j("requestNotificationPermission",(function(){}),void 0),ln=j("enableNotifications",(function(){A.notificationsPaused=!1,ie()}),void 0),cn=j("disableNotifications",(function(){A.notificationsPaused=!0}),void 0),dn=j("getUnreadMessageCount",(function(){return A.unreadMessageCount}),0),un=j("getUnansweredMessageCount",(function(){return A.unansweredMessageCount}),0),gn=j("getSdkVersion",(function(){return u}),""),fn=j("reset",(function(){A.language=null,A.tags=new Set,A.fields={},A.signedMetadataToken=null,A.player=null,Oe(),pe(),K({action:"widgetButtonTextUpdate",text:ke()})}),void 0),pn=j("recordRetention",(function(){A.isRetentionRecordedForSession||we()}),void 0),mn=j("addEventListener",de,void 0),hn=j("removeEventListener",(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];a.apply(void 0,e)}),void 0),vn=j("iosSetKeyboardHeight",(function(e){A.keyboardHeight=e,he()}),void 0);export{mn as addEventListener,Ke as addField,Xe as addFields,Ue as addTag,qe as addTags,Pe as close,en as disableLogging,cn as disableNotifications,$e as enableLogging,ln as enableNotifications,Je as getFields,Ae as getLanguage,Me as getPlayer,gn as getSdkVersion,De as getSignedMetadataToken,Fe as getTags,un as getUnansweredMessageCount,dn as getUnreadMessageCount,Ie as initialize,vn as iosSetKeyboardHeight,on as isPrivacyMode,an as isSupported,nn as isYoungPlayer,_e as openAssistant,Re as openResource,Le as openSupport,pn as recordRetention,Qe as removeAllFields,ze as removeAllTags,hn as removeEventListener,Ve as removeField,Ze as removeFields,We as removeTag,Ge as removeTags,sn as requestNotificationPermission,fn as reset,Ye as setFields,Ne as setLanguage,He as setPlayer,rn as setPrivacyMode,Be as setSignedMetadataToken,je as setTags,tn as setYoungPlayer};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var theymes=function(e){"use strict";var n=function(){return n=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},n.apply(this,arguments)};function t(e,n,t,o){return new(t||(t=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}l((o=o.apply(e,n||[])).next())}))}function o(e,n){var t,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[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(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(t=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(6===s[0]&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=n.call(e,r)}catch(e){s=[6,e],o=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(e,n,t){if(t||2===arguments.length)for(var o,i=0,r=n.length;i<r;i++)!o&&i in n||(o||(o=Array.prototype.slice.call(n,0,i)),o[i]=n[i]);return e.concat(o||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var r={unreadMessageCountUpdate:new Set,unansweredMessageCountUpdate:new Set,open:new Set,close:new Set};function a(e,n){r[e].add(n)}function s(e,n){r[e].delete(n)}function l(e,n){r[e].forEach((function(e){return e.apply(void 0,n)}))}var c='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .loader-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .loader {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 2rem;\n height: 2rem;\n animation: spin 1s linear infinite;\n transform-origin: center;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="loader-wrapper">\n <svg class="loader" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" fill="none" data-test-name="oval"\n role="img">\n <g fill="none" fill-rule="evenodd">\n <g transform="translate(1 1)" stroke-width="2">\n <circle stroke-opacity="0.5" cx="18" cy="18" r="18" />\n <path d="M36 18c0-9.94-8.06-18-18-18" />\n </g>\n </g>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',d='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: sans-serif;\n font-size: CSS_FONT_SIZE_PLACEHOLDER;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n .error-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n padding: 12px;\n }\n\n h1 {\n font-size: 18px;\n font-weight: 400;\n color: rgb(CSS_TEXT_PLACEHOLDER);\n }\n\n svg.error-icon {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="error-wrapper">\n <svg class="error-icon" width="91" height="91" viewBox="0 0 91 91" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M45.1079 89.1321C50.7158 89.1321 55.2618 84.5859 55.2618 78.9783C55.2618 73.3707 50.7158 68.8245 45.1079 68.8245C39.5001 68.8245 34.9541 73.3707 34.9541 78.9783C34.9541 84.5859 39.5001 89.1321 45.1079 89.1321Z"\n stroke="#FFB547" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />\n <path d="M24.7637 58.6355C35.9988 47.4005 54.2144 47.4005 65.4492 58.6355" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M12.7988 46.6689C22.1436 37.3241 34.529 32.8731 46.7703 33.3159" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M1.1084 34.4283C11.6674 23.9971 25.012 18.0833 38.7295 16.6868" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M89.1082 1.13208L62.0312 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M62.0312 1.13208L89.1082 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n </svg>\n <div>\n <h1>Connection error</h1>\n </div>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',u="<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\"\n content=\"viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\" />\n <meta name=\"theme-color\" content=\"#000000\" />\n <meta name=\"robots\" content=\"noindex\" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: 'TheymesBody';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .sdk-button {\n display: flex;\n font-family: 'TheymesBody', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n background: rgb(CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: rgb(CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER);\n font-size: 14px;\n font-weight: 700;\n cursor: pointer;\n text-align: center;\n padding: 0 12px;\n border: none;\n outline: none;\n border-radius: 999px;\n box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);\n position: relative;\n }\n\n .sdk-button-badge {\n position: absolute;\n top: 0;\n right: 0;\n background: rgb(CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER);\n width: 12px;\n height: 12px;\n border-radius: 999px;\n display: none;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <button class=\"sdk-button\">\n <span class=\"sdk-button-text\">WIDGET_BUTTON_TEXT_PLACEHOLDER</span>\n <span class=\"sdk-button-badge\"></span>\n </button>\n <script NONCE_ATTR_PLACEHOLDER>\n let unreadMessageCount = UNREAD_MESSAGE_COUNT_PLACEHOLDER;\n\n function openWidget() {\n parent.postMessage({ action: 'theymes.sdkButtonClicked' }, '*');\n }\n\n function iframeSubscriber(e) {\n if (e.data.action === 'unreadMessageCountUpdate') {\n unreadMessageCount = e.data.count;\n updateUnreadMessageCount()\n } else if (e.data.action === 'widgetButtonTextUpdate') {\n document.querySelector('.sdk-button-text').textContent = e.data.text;\n }\n }\n\n function updateUnreadMessageCount() {\n if (unreadMessageCount > 0) {\n document.querySelector('.sdk-button-badge').style.display = 'block';\n } else {\n document.querySelector('.sdk-button-badge').style.display = 'none';\n }\n }\n\n document.querySelector('.sdk-button').addEventListener('click', openWidget);\n window.addEventListener('message', iframeSubscriber, false);\n\n updateUnreadMessageCount();\n <\/script>\n</body>\n\n</html>",g="1.2.9",f="colors",p="locs",m="fonts",v="recordRetentionAfterSecs",h="resetSessionAfterSecs",y="web",b={sdkDialog:"#theymes-sdk-dialog",sdkIframeWrapper:"#theymes-sdk-wrapper",sdkIframe:"#theymes-sdk",sdkLoaderIframe:"#theymes-sdk-loader",notificationDialog:"#theymes-sdk-notification-dialog",notificationIframe:"#theymes-sdk-notification",sdkButtonIframe:"#theymes-sdk-button",sdkStylesheet:"#theymes-sdk-stylesheet"},w=340,S=680,E=500,x=120,T=48,k=.2,C=.2,O=.2,L="theymes_path_on_init",I="url('https://fonts.gstatic.com/s/poppins/v22/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2') format('woff2')",_=function(e){var n;try{return null!==(n=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e))&&void 0!==n?n:null}catch(e){return null}},R=function(e,n){try{null===localStorage||void 0===localStorage||localStorage.setItem(e,n)}catch(e){}},P={length:0,getItem:function(e){var n;try{return null!==(n=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem(e))&&void 0!==n?n:null}catch(e){return null}},setItem:function(e,n){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.removeItem(e)}catch(e){}},clear:function(){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.clear()}catch(e){}},key:function(e){var n;try{return null!==(n=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.key(e))&&void 0!==n?n:null}catch(e){return null}}},A=28800,N=function(){var e=null,t=A,o={text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}},i={widgetButtonText:{}},r=D();try{e=function(){var e=_(v);if(e){var n=JSON.parse(e);if("number"==typeof n)return n}return null}(),t=function(){var e=_(h);if(e){var n=JSON.parse(e);if("number"==typeof n)return n}return B()}(),o=function(){var e=_(f);if(e){var t=JSON.parse(e);return n(n({},{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}),t)}return{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}}(),i=function(){var e=_(p);if(e){var t=JSON.parse(e);return n(n({},{widgetButtonText:{}}),t)}return{widgetButtonText:{}}}(),r=function(){var e=_(m);if(e){var t=JSON.parse(e);return n(n({},D()),t)}return D()}()}catch(e){console.error("Error initializing internals",e)}return{token:null,domain:null,mode:"game",deviceId:null,position:"bottom-right",widgetButton:!1,widgetButtonAction:"support",x:20,y:20,loggingEnabled:!1,element:null,language:null,userLanguage:navigator.language,tags:new Set,fields:{},youngPlayer:!1,privacyMode:!1,signedMetadataToken:null,isLoggedIn:!1,isInForeground:!0,hasNetworkConnectivity:!0,player:null,sdkIsOpen:!1,forceUpdateSdkDialog:!1,recordRetentionAfterSecs:e,resetSessionAfterSecs:t,sessionStatus:"waiting",sessionStartTime:null,sessionResumeOrStartTime:null,retentionRemainingSeconds:null,isRetentionRecordedForSession:!1,recordRetentionTimerId:null,retryRecordRetentionTimerId:null,retryIntervalSecs:300,networkErrorTimerId:null,colors:o,locs:i,fonts:r,notificationsPaused:!0,notifications:[],visibleNotification:null,unreadMessageCount:0,unansweredMessageCount:0,previousPath:null,previousConfig:null,nonce:null,keyboardHeight:0,disableInsets:!1}}();function D(){return{body:void 0}}function B(){return A}var M=function(e,n){return e===n||Boolean(e&&n&&"object"==typeof e&&"object"==typeof n&&Object.keys(e).length===Object.keys(n).length&&Object.entries(e).every((function(e){var t=e[0],o=e[1];return M(o,n[t])})))};function H(e){var n,t=e.iframe,o=e.content,i=null===(n=t.contentWindow)||void 0===n?void 0:n.document;i&&(i.open(),i.write(o),i.close())}function F(e){return"".concat(e.r,", ").concat(e.g,", ").concat(e.b)}function j(e){var n,t,o,i;return e.template.replace(/PLATFORM_PLACEHOLDER/g,y).replace(/INSET_TOP_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-top, 0px)").replace(/INSET_BOTTOM_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)").replace(/INSET_LEFT_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-left, 0px)").replace(/INSET_RIGHT_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-right, 0px)").replace(/CSS_TEXT_PLACEHOLDER/g,F(N.colors.text)).replace(/CSS_BORDER_PLACEHOLDER/g,F(N.colors.border)).replace(/CSS_BACKGROUND_PLACEHOLDER/g,F(N.colors.background)).replace(/CSS_TILE_PLACEHOLDER/g,F(N.colors.tile)).replace(/CSS_ACCENT_PLACEHOLDER/g,F(N.colors.accent)).replace(/CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER/g,F(N.colors.notificationBackground)).replace(/CSS_NOTIFICATION_TEXT_PLACEHOLDER/g,F(N.colors.notificationText)).replace(/CSS_FONT_SIZE_PLACEHOLDER/g,"game"===N.mode?"16px":"14px").replace(/CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER/g,null!==(t=null===(n=N.fonts.body)||void 0===n?void 0:n.regular)&&void 0!==t?t:I).replace(/CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER/g,null!==(i=null===(o=N.fonts.body)||void 0===o?void 0:o.fallback)&&void 0!==i?i:"ui-sans-serif, system-ui, sans-serif").replace(/NONCE_ATTR_PLACEHOLDER/g,N.nonce?'nonce="'.concat(N.nonce,'"'):"")}var U=function(e,n,t){return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];try{return n.apply(void 0,o)}catch(n){return console.error("Error in ".concat(e),n),t}}},q='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: \'TheymesBody\';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: \'TheymesBody\', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n }\n\n html,\n body {\n width: 100%;\n height: auto;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n width: 1.25rem;\n height: 1.25rem;\n }\n\n .notification {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background: rgb(CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: auto;\n margin: 0;\n padding: 12px;\n border-radius: 6px;\n color: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n }\n\n .notification-text {\n flex: 1 0 0%;\n font-size: 0.875rem;\n /* 14/16 */\n line-height: 1.2;\n display: -webkit-box;\n line-clamp: 2;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n\n .close-button {\n flex: 0 0 auto;\n padding-left: 10px;\n cursor: pointer;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="notification">\n <div class="notification-text">NOTIFICATION_TEXT_PLACEHOLDER</div>\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6 6 18"></path>\n <path d="m6 6 12 12"></path>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeNotification() {\n parent.postMessage({ action: \'theymes.closeNotification\' }, \'*\');\n }\n\n function notificationClicked() {\n parent.postMessage({ action: \'theymes.handleNotificationAction\' }, \'*\');\n }\n\n document.querySelector(\'.notification-text\').addEventListener(\'click\', notificationClicked);\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeNotification);\n <\/script>\n</body>\n\n</html>',W=/(android|bb\d+|meego).+mobile|armv7l|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|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,G=/CrOS/,Y=/android|ipad|playbook|silk/i;function z(){return!!function(e){e||(e={});var n=e.ua;if(n||"undefined"==typeof navigator||(n=navigator.userAgent),n&&n.headers&&"string"==typeof n.headers["user-agent"]&&(n=n.headers["user-agent"]),"string"!=typeof n)return!1;var t=W.test(n)&&!G.test(n)||!!e.tablet&&Y.test(n);return!t&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==n.indexOf("Macintosh")&&-1!==n.indexOf("Safari")&&(t=!0),t}({tablet:!0})&&(window.innerWidth<E||window.innerHeight<E)}function J(e){var n=e.type,t=N.position,o=N.x,i=N.y;return z()&&"widget"===n?{top:"0",left:"0",right:"0",bottom:"0"}:"top-left"===t?{top:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",bottom:"auto"}:"top-right"===t?{top:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",bottom:"auto"}:"bottom-left"===t?{bottom:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",top:"auto"}:{bottom:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",top:"auto"}}function K(){return z()?{width:"100%",height:"100%",maxWidth:"none",maxHeight:"none"}:{width:"".concat(w,"px"),height:"".concat(S,"px"),maxWidth:"none",maxHeight:"calc(100vh - ".concat(2*N.y,"px)")}}function X(e){var n=document.querySelector(b.sdkButtonIframe);if(n)var t=setInterval((function(){var o,i;"complete"===(null===(o=n.contentDocument)||void 0===o?void 0:o.readyState)&&(clearInterval(t),null===(i=null==n?void 0:n.contentWindow)||void 0===i||i.postMessage(e,"*"))}),100)}function V(){var e,n,t=N.notifications[0];if(t&&!N.visibleNotification){N.visibleNotification=t;var o=null!==(e=document.querySelector(b.notificationDialog))&&void 0!==e?e:document.createElement("div");o.id=b.notificationDialog.replace("#",""),o.style.position="fixed",o.style.border="none",o.style.margin="0",o.style.padding="0",o.style.zIndex="9999",o.style.colorScheme="auto",o.style.backgroundColor="transparent",o.style.pointerEvents="none",o.style.overflow="hidden",document.body.appendChild(o);var i,r=null!==(n=o.querySelector(b.notificationIframe))&&void 0!==n?n:document.createElement("iframe");r.id=b.notificationIframe.replace("#",""),r.style.position="absolute",r.style.border="none",r.style.width="0",r.style.height="0",r.style.top="-20px",r.style.left="0",r.style.colorScheme="auto",r.style.pointerEvents="auto",r.style.marginTop="-20px",r.style.opacity="0",r.style.transition="opacity ".concat(O,"s ease-in-out, margin-top ").concat(O,"s ease-in-out"),o.appendChild(r),H({iframe:r,content:(i={text:t.text},j({template:q}).replace(/NOTIFICATION_TEXT_PLACEHOLDER/g,i.text))}),setTimeout((function(){r.style.opacity="1",r.style.marginTop="0px",Z()}),500),t.closeAfterSeconds>0&&setTimeout((function(){Q({notification:t})}),1e3*t.closeAfterSeconds)}}function Z(){var e,n,t,o=document.querySelector(b.notificationDialog),i=document.querySelector(b.notificationIframe);if(o&&i){var r=(null===(t=null===(n=null===(e=i.contentWindow)||void 0===e?void 0:e.document)||void 0===n?void 0:n.body)||void 0===t?void 0:t.scrollHeight)?"".concat(i.contentWindow.document.body.scrollHeight,"px"):"0";if("widget"===N.mode){var a=J({type:"widget"}),s=K(),l="calc(".concat(s.width," - 20px)");o.style.bottom=a.bottom,o.style.right=a.right,o.style.left=a.left,o.style.top=a.top,o.style.overflow="hidden",i.style.width=l}else if(N.element){var c=N.element.getBoundingClientRect();l="".concat(c.width-20,"px");o.style.top="".concat(c.top,"px"),o.style.left="".concat(c.left,"px"),o.style.right="".concat(c.right,"px"),o.style.bottom="".concat(c.bottom,"px"),o.style.overflow="hidden",i.style.width=l}else{l="calc(100% - 20px)";o.style.top=N.disableInsets?"0px":"env(safe-area-inset-top, 0px)",o.style.left=N.disableInsets?"0px":"env(safe-area-inset-left, 0px)",o.style.right=N.disableInsets?"0px":"env(safe-area-inset-right, 0px)",o.style.bottom=N.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)",o.style.overflow="visible",i.style.width=l}i.style.height=r,i.style.top="10px",i.style.left="10px"}}function Q(e){if(e.notification&&N.visibleNotification===e.notification){var n=document.querySelector(b.notificationIframe),t=document.querySelector(b.notificationDialog);n&&(n.style.opacity="0",n.style.marginTop="-20px",setTimeout((function(){null==t||t.remove(),N.notifications=N.notifications.slice(1),N.visibleNotification=null,V()}),1e3*O))}}var $=function(){function e(){Object.defineProperty(this,"isRunning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pollWhenNotificationsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"lastPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nextPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.resumeIfNeeded(!1)}return Object.defineProperty(e.prototype,"onIsInForegroundChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){N.isInForeground?this.resumeIfNeeded(!1):this.pauseIfNeeded()}}),Object.defineProperty(e.prototype,"onHasNetworkConnectivityChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!1)}}),Object.defineProperty(e.prototype,"resume",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.isRunning=!0;var n=new Date;if(this.nextPollDate&&!e||(this.nextPollDate=new Date(n.getTime()+1e3)),n>=this.nextPollDate)this.pollEventsRequest();else{var t=(this.nextPollDate.getTime()-n.getTime())/1e3;this.scheduleNextPollEventsRequest(t)}}}),Object.defineProperty(e.prototype,"pause",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning=!1,this.timer&&(clearTimeout(this.timer),this.timer=null)}}),Object.defineProperty(e.prototype,"shouldBeRunning",{enumerable:!1,configurable:!0,writable:!0,value:function(){return N.isLoggedIn&&N.isInForeground&&N.hasNetworkConnectivity&&!N.sdkIsOpen}}),Object.defineProperty(e.prototype,"resumeIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(e){!this.shouldBeRunning()||this.isRunning&&!e||this.resume(e)}}),Object.defineProperty(e.prototype,"pauseIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&!this.shouldBeRunning()&&this.pause()}}),Object.defineProperty(e.prototype,"onEnableNotifications",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&this.pollWhenNotificationsEnabled&&this.scheduleNextPollEventsRequest(0)}}),Object.defineProperty(e.prototype,"onOpen",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(e.prototype,"onClose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(e.prototype,"onLogin",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(e.prototype,"onLogout",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(e.prototype,"scheduleNextPollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this;this.nextPollDate=new Date(Date.now()+1e3*e),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){n.timer=null,n.pollEventsRequest()}),1e3*e)}}),Object.defineProperty(e.prototype,"pollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(){return t(this,void 0,void 0,(function(){var e,t,r,a,s,c,d,u,g;return o(this,(function(o){switch(o.label){case 0:if(!N.token||!N.domain||!N.deviceId)return[2];if(!this.isRunning)return[2];if(this.lastPollDate&&(e=new Date(this.lastPollDate.getTime()+6e4),(t=(e.getTime()-Date.now())/1e3)>0))return this.scheduleNextPollEventsRequest(t),[2];this.lastPollDate=new Date,r=N.notificationsPaused||N.sdkIsOpen?"true":"false",a=new URLSearchParams(n(n({token:N.token,language:null!==(u=N.language)&&void 0!==u?u:"en",deviceId:N.deviceId,notificationsPaused:r,mode:N.mode},(null===(g=N.player)||void 0===g?void 0:g.id)?{unsignedPlayerId:N.player.id}:{}),N.signedMetadataToken?{signedMetadataToken:N.signedMetadataToken}:{})).toString(),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch("https://".concat(N.domain,"/api/sdk/events?").concat(a),{method:"GET"})];case 2:if(!(s=o.sent()).ok)throw new Error("HTTP error! status: ".concat(s.status));return[4,s.json()];case 3:return c=o.sent(),this.scheduleNextPollEventsRequest(c.nextPollSeconds),void 0!==c.pollWhenNotificationsEnabled&&(this.pollWhenNotificationsEnabled=c.pollWhenNotificationsEnabled),N.notifications=i(i([],N.notifications,!0),c.notifications,!0),N.notifications.length>0&&V(),c.unansweredMessageCount!==N.unansweredMessageCount&&(N.unansweredMessageCount=c.unansweredMessageCount,l("unansweredMessageCountUpdate",[c.unansweredMessageCount])),c.unreadMessageCount!==N.unreadMessageCount&&(N.unreadMessageCount=c.unreadMessageCount,l("unreadMessageCountUpdate",[c.unreadMessageCount]),X({action:"unreadMessageCountUpdate",count:c.unreadMessageCount})),[3,5];case 4:return d=o.sent(),console.error("Error fetching events:",d),this.scheduleNextPollEventsRequest(N.retryIntervalSecs),[3,5];case 5:return[2]}}))}))}}),e}(),ee={eventPoller:null},ne=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onLogin()},te=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onLogout()},oe=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onOpen()},ie=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onClose()},re=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onEnableNotifications()},ae=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onIsInForegroundChanged()},se=function(e){var n="/help-center";pe({path:n,config:e}),fe({path:n,config:e})},le=function(e){var n="/assistant";pe({path:n,config:e}),fe({path:n,config:e})},ce=function(){!function(){var e=document.querySelector(b.sdkDialog),n=document.querySelector(b.sdkIframeWrapper);if(e){var t=function(){"widget"!==N.mode||N.forceUpdateSdkDialog?e.remove():e.style.display="none",N.forceUpdateSdkDialog=!1};n?(n.style.opacity="0",n.style.transform=be({animation:"start"}),setTimeout((function(){t()}),1e3*k)):t()}N.widgetButton&&ye();l("close",[])}()},de=function(){try{return CSS.supports("color","var(--color)")&&CSS.supports("color","rgb(255 255 255 / 0.5)")}catch(e){return!1}},ue=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];a.apply(void 0,e)};function ge(e){var t,o,r,a,s,l,c=(null!=e?e:{}).config;if(!N.token||!N.domain||!N.deviceId)return null;var d=null!==(t=null==c?void 0:c.tags)&&void 0!==t?t:[],u=null!==(o=null==c?void 0:c.fields)&&void 0!==o?o:{},f=null!==(a=null!==(r=null==c?void 0:c.language)&&void 0!==r?r:N.language)&&void 0!==a?a:null,p=null!==(s=N.signedMetadataToken)&&void 0!==s?s:null,m=null!==(l=N.player)&&void 0!==l?l:null,v={_platform:y,_sdkVersion:g};N.youngPlayer&&(v._youngPlayer=!0),(N.privacyMode||N.youngPlayer)&&(v._privacyMode=!0);var h=i(i([],Array.from(N.tags),!0),d,!0),b=n(n(n({},N.fields),u),v);return{token:N.token,domain:N.domain,deviceId:N.deviceId,tags:h,fields:b,language:f,signedMetadataToken:p,player:m}}function fe(e){var n,t,o,i=ge({config:e.config});if(i){var r=null!==(n=document.querySelector(b.sdkDialog))&&void 0!==n?n:document.createElement("div");r.id=b.sdkDialog.replace("#",""),r.style.display="block",r.style.position="fixed",r.style.border="none",r.style.width="0",r.style.height="0",r.style.margin="0",r.style.padding="0",r.style.zIndex="9998",r.style.overflow="hidden",r.style.backgroundColor="transparent";var a=null!==(t=r.querySelector(b.sdkIframeWrapper))&&void 0!==t?t:document.createElement("div");a.id=b.sdkIframeWrapper.replace("#",""),a.style.position="relative",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.right="0",a.style.bottom="0",a.style.left="0",a.style.opacity="0",a.style.colorScheme="auto",a.style.border="none",a.style.backgroundColor="rgb(".concat(F(N.colors.background),")"),a.style.transform=be({animation:"start"}),a.style.transition=(N.mode,"opacity ".concat(k,"s ease-in-out, transform ").concat(k,"s ease-in-out")),"widget"===N.mode&&(a.style.overflow="hidden");var s=null!==(o=a.querySelector(b.sdkLoaderIframe))&&void 0!==o?o:document.createElement("iframe");s.id=b.sdkLoaderIframe.replace("#",""),s.style.position="absolute",s.style.border="none",s.style.width="100%",s.style.height="100%",s.style.top="0",s.style.right="0",s.style.bottom="0",s.style.left="0",s.style.colorScheme="auto";var u=a.querySelector(b.sdkIframe),g=null!=u?u:document.createElement("iframe"),f=setInterval((function(){var e;"complete"===(null===(e=g.contentDocument)||void 0===e?void 0:e.readyState)&&(clearInterval(f),m())}),500);g.id=b.sdkIframe.replace("#",""),g.style.position="absolute",g.style.border="none",g.style.top="0",g.style.right="0",g.style.bottom="0",g.style.left="0",g.style.colorScheme="auto",u&&!N.networkErrorTimerId||(g.src=function(e){var n=e.path,t=e.supportViewConfig,o="https://".concat(N.domain,"/sdk"),i=new URLSearchParams;i.set("platform",y),i.set("token",t.token),i.set("deviceId",t.deviceId),i.set("mode",N.mode),i.set("origin",window.location.origin),i.set("userLanguage",N.userLanguage),N.disableInsets&&i.set("disableInsets","true");t.language&&i.set("language",t.language);de()||i.set("unsupported","true");var r=ve({supportViewConfig:t});return i.set("metadata",JSON.stringify(r)),"".concat(o).concat(n,"?").concat(i.toString())}({path:e.path,supportViewConfig:i}),g.style.width="0",g.style.height="0",r.appendChild(a),a.appendChild(s),a.appendChild(g),document.body.appendChild(r)),H({iframe:s,content:j({template:c})});var p=!1,m=function(){p||(p=!0,N.networkErrorTimerId=setTimeout((function(){H({iframe:s,content:j({template:d})})}),1e4))};g.onload=m,g.onerror=function(){H({iframe:s,content:j({template:d})})},he(),l("open",[]),setTimeout((function(){a.style.opacity="1",a.style.transform=be({animation:"end"})}),100)}}function pe(e){var n=e.path,t=e.config,o=null!=t?t:null;N.previousPath===n&&M(N.previousConfig,o)||(N.previousPath=n,N.previousConfig=o,me())}function me(){var e=document.querySelector(b.sdkDialog);N.sdkIsOpen?N.forceUpdateSdkDialog=!0:null==e||e.remove()}function ve(e){var n=e.supportViewConfig,t={unsigned:{},signed:void 0};return n.player&&(t.unsigned.player=n.player),n.tags&&(t.unsigned.tags=n.tags),n.fields&&(t.unsigned.fields=n.fields),n.signedMetadataToken&&(t.signed=n.signedMetadataToken),t}function he(){var e=document.querySelector(b.sdkDialog),n=document.querySelector(b.sdkIframeWrapper);if(e&&n)if("widget"===N.mode){var t=J({type:"widget"}),o=K();e.style.width=o.width,e.style.height=o.height,e.style.maxWidth=o.maxWidth,e.style.maxHeight=o.maxHeight,e.style.bottom=t.bottom,e.style.right=t.right,e.style.left=t.left,e.style.top=t.top,z()?(n.style.border="none",n.style.borderRadius="0"):(n.style.border="1px solid rgb(".concat(F(N.colors.border),")"),n.style.borderRadius="10px")}else if(n.style.border="none",n.style.borderRadius="0",N.element){var i=N.element.getBoundingClientRect(),r=i.width,a=i.height,s=i.top,l=i.left,c=i.right,d=i.bottom;e.style.width="".concat(r,"px"),e.style.height="".concat(a,"px"),e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="".concat(s,"px"),e.style.left="".concat(l,"px"),e.style.right="".concat(c,"px"),e.style.bottom="".concat(d,"px")}else{a=N.keyboardHeight>0?"calc(100% - ".concat(N.keyboardHeight,"px + env(safe-area-inset-bottom) - 10px)"):"100%";e.style.width="100%",e.style.height=a,e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0"}}function ye(){var e,n=null!==(e=document.querySelector(b.sdkButtonIframe))&&void 0!==e?e:document.createElement("iframe");if(n){var t,o=J({type:"button"});n.id=b.sdkButtonIframe.replace("#",""),n.style.position="fixed",n.style.border="none",n.style.width="".concat(x,"px"),n.style.height="".concat(T,"px"),n.style.maxWidth="95%",n.style.maxHeight="95%",n.style.bottom=o.bottom,n.style.right=o.right,n.style.left=o.left,n.style.top=o.top,n.style.margin="0",n.style.padding="0",n.style.zIndex="9997",n.style.backgroundColor="transparent",n.style.opacity="0",n.style.transform="scale(0.8)",n.style.transition="opacity ".concat(C,"s ease-in-out, transform ").concat(C,"s ease-in-out"),setTimeout((function(){n.style.opacity="1",n.style.transform="scale(1)"}),100),document.body.appendChild(n),H({iframe:n,content:(t={unreadMessageCount:N.unreadMessageCount},j({template:u}).replace(/UNREAD_MESSAGE_COUNT_PLACEHOLDER/g,"".concat(t.unreadMessageCount)).replace(/CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER/g,F(N.colors.widgetButtonBackground)).replace(/CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER/g,F(N.colors.widgetButtonText)).replace(/CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER/g,F(N.colors.widgetButtonActionPending)).replace(/WIDGET_BUTTON_TEXT_PLACEHOLDER/g,Ce()))})}}function be(e){return"start"===e.animation?"game"===N.mode?"translateY(20%)":"scale(0.8)":"game"===N.mode?"translateY(0)":"scale(1)"}function we(e){return t(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,7]),[4,e.json()];case 1:return[2,n.sent()];case 2:n.sent(),n.label=3;case 3:return n.trys.push([3,5,,6]),[4,e.text()];case 4:return[2,n.sent()];case 5:return n.sent(),[2,void 0];case 6:return[3,7];case 7:return[2]}}))}))}function Se(){return t(this,void 0,void 0,(function(){var e,n,t,i,r,a;return o(this,(function(o){switch(o.label){case 0:if(Te(),N.retryRecordRetentionTimerId&&(clearTimeout(N.retryRecordRetentionTimerId),N.retryRecordRetentionTimerId=null),N.retentionRemainingSeconds=null,N.isRetentionRecordedForSession=!0,!(e=ge()))return[2];n="https://".concat(N.domain,"/api/sdk/retention"),t=ve({supportViewConfig:e}),i={token:N.token,deviceId:N.deviceId,language:N.language,metadata:t},o.label=1;case 1:return o.trys.push([1,5,,6]),[4,fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})];case 2:return(r=o.sent()).ok?[3,4]:[4,we(r)];case 3:throw o.sent();case 4:return[3,6];case 5:return a=o.sent(),console.error("Error tracking retention:",a),N.retryRecordRetentionTimerId=setTimeout(Se,6e4),[3,6];case 6:return[2]}}))}))}function Ee(){var e=new Date;if(N.sessionStatus="active",N.sessionResumeOrStartTime=e,N.sessionStartTime){var n=N.sessionStartTime.valueOf()/1e3+N.resetSessionAfterSecs;Date.now()/1e3>n&&xe()}else xe();null!==N.retentionRemainingSeconds&&(N.recordRetentionTimerId=setTimeout(Se,1e3*N.retentionRemainingSeconds))}function xe(){N.sessionStartTime=new Date,N.retentionRemainingSeconds=N.recordRetentionAfterSecs,N.isRetentionRecordedForSession=!1,Te()}function Te(){N.recordRetentionTimerId&&(clearTimeout(N.recordRetentionTimerId),N.recordRetentionTimerId=null)}function ke(){N.isRetentionRecordedForSession&&Se()}function Ce(){var e,n,t;return null!==(t=null===(e=N.locs.widgetButtonText)||void 0===e?void 0:e[null!==(n=N.language)&&void 0!==n?n:"en"])&&void 0!==t?t:"Support"}function Oe(){var e=N.isInForeground,n="visible"===document.visibilityState&&document.hasFocus();N.isInForeground=n,e!==n&&ae(),n&&"paused"===N.sessionStatus?Ee():n||"active"!==N.sessionStatus||function(){if(N.sessionResumeOrStartTime&&N.retentionRemainingSeconds){var e=Math.floor((Date.now()-N.sessionResumeOrStartTime.valueOf())/1e3);N.retentionRemainingSeconds-=e}N.sessionStatus="paused",Te()}()}function Le(){var e,n=N.isLoggedIn,t=Boolean(N.signedMetadataToken||(null===(e=N.player)||void 0===e?void 0:e.id));N.isLoggedIn=t,t&&!n?ne():!t&&n&&te()}try{document.addEventListener("visibilitychange",Oe),window.addEventListener("focus",Oe),window.addEventListener("blur",Oe),window.addEventListener("resize",he),window.addEventListener("resize",Z),window.addEventListener("message",(function(e){if("theymes.ready"===e.data.action){var n=document.querySelector(b.sdkLoaderIframe),t=document.querySelector(b.sdkIframe);N.networkErrorTimerId&&(clearTimeout(N.networkErrorTimerId),N.networkErrorTimerId=null),t&&(t.style.width="100%",t.style.height="100%"),n&&n.remove()}else if("theymes.close"===e.data.action)ce();else if("theymes.closeNotification"===e.data.action)Q({notification:N.visibleNotification});else if("theymes.handleNotificationAction"===e.data.action)r={notification:N.visibleNotification},(null==(a=r.notification)?void 0:a.action)&&"OPEN_PAGE"===a.action.type&&(fe({path:a.action.path}),Q({notification:a}));else if("theymes.sdkButtonClicked"===e.data.action)(i=document.querySelector(b.sdkButtonIframe))&&(i.style.opacity="0",i.style.transform="scale(0.8)",setTimeout((function(){i.remove()}),1e3*C)),"support"===N.widgetButtonAction?se():"assistant"===N.widgetButtonAction&&le();else if("theymes.openExternalPage"===e.data.action){var o=e.data.url.startsWith(window.location.origin);o&&function(e){var n=e.key,t=e.value,o=e.ttlMs,i=e.storage,r=void 0===i?P:i,a={value:t,expiry:Date.now()+o};r.setItem(n,JSON.stringify(a))}({key:L,value:e.data.path,ttlMs:1e4}),window.open(e.data.url,o?"_self":"_blank")}var i,r,a}),!1),ue("open",(function(){N.sdkIsOpen=!0,oe()})),ue("close",(function(){N.sdkIsOpen=!1,ie()}))}catch(e){console.error("Error adding event listeners to SDK",e)}var Ie=U("initialize",(function(e,i,r){return t(void 0,void 0,void 0,(function(){var t,a,s,l,c,d,u,g,b,w,S,E,x,T;return o(this,(function(o){switch(o.label){case 0:if(!e||!i||!r.mode)throw new Error("Token, domain, and mode are required");N.token=e,N.domain=i,N.mode=r.mode,N.element="element"in r&&void 0!==r.element?r.element:N.element,N.language=null!==(u=r.language)&&void 0!==u?u:N.language,N.nonce=null!==(g=r.nonce)&&void 0!==g?g:N.nonce,N.deviceId=function(){var e=_("deviceId");if(e)return e;var n=(t=Date.now(),"undefined"!=typeof performance&&"function"==typeof performance.now&&(t+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})));return R("deviceId",n),n;var t}(),N.widgetButton="button"in r&&void 0!==r.button&&null!==(b=r.button)&&void 0!==b?b:N.widgetButton,N.widgetButtonAction="buttonAction"in r&&void 0!==r.buttonAction&&null!==(w=r.buttonAction)&&void 0!==w?w:N.widgetButtonAction,N.position="position"in r&&void 0!==r.position&&null!==(S=r.position)&&void 0!==S?S:N.position,N.x="x"in r&&void 0!==r.x?r.x:N.x,N.y="y"in r&&void 0!==r.y?r.y:N.y,N.disableInsets="game"===N.mode&&null!==N.element,ee.eventPoller||(ee.eventPoller=new $),t="https://".concat(i,"/api/sdk/settings"),a=new URLSearchParams({token:N.token,platform:y,mode:N.mode}).toString(),o.label=1;case 1:return o.trys.push([1,6,,7]),[4,fetch("".concat(t,"?").concat(a),{method:"GET"})];case 2:return(s=o.sent()).ok?[3,4]:[4,we(s)];case 3:throw o.sent();case 4:return[4,s.json()];case 5:return l=o.sent(),(null===(E=null==l?void 0:l.branding)||void 0===E?void 0:E.colors)&&(A=l.branding.colors,N.colors=n(n({},N.colors),A),R(f,JSON.stringify(N.colors))),(null===(x=null==l?void 0:l.branding)||void 0===x?void 0:x.locs)&&(I=l.branding.locs,N.locs=n(n({},N.locs),I),R(p,JSON.stringify(N.locs))),(null===(T=null==l?void 0:l.branding)||void 0===T?void 0:T.fonts)&&(O=l.branding.fonts,N.fonts=n(n({},N.fonts),O),R(m,JSON.stringify(N.fonts))),"number"!=typeof(null==l?void 0:l.recordRetentionAfterSecs)&&null!==(null==l?void 0:l.recordRetentionAfterSecs)||(C=l.recordRetentionAfterSecs,N.recordRetentionAfterSecs=C,R(v,JSON.stringify(N.recordRetentionAfterSecs))),"number"!=typeof(null==l?void 0:l.resetSessionAfterSecs)&&null!==(null==l?void 0:l.resetSessionAfterSecs)||(k=l.resetSessionAfterSecs,N.resetSessionAfterSecs=null!=k?k:B(),R(h,JSON.stringify(N.resetSessionAfterSecs))),Ee(),me(),c=function(e){var n=e.key,t=e.storage,o=void 0===t?P:t,i=e.removeItem,r=void 0!==i&&i,a=o.getItem(n);if(!a)return null;var s=JSON.parse(a);return Date.now()>s.expiry?(o.removeItem(n),null):(r&&o.removeItem(n),s.value)}({key:L,removeItem:!0}),c&&"widget"===N.mode&&!z()?fe({path:c}):N.widgetButton&&ye(),[3,7];case 6:return d=o.sent(),console.error("Error initializing SDK:",d),[3,7];case 7:return[2]}var k,C,O,I,A}))}))}),void 0),_e=U("openSupport",se,void 0),Re=U("openAssistant",le,void 0),Pe=U("openResource",(function(e,n){var t="/resources/".concat(e);pe({path:t,config:n}),fe({path:t,config:n})}),void 0),Ae=U("close",ce,void 0),Ne=U("getLanguage",(function(){return N.language}),null),De=U("setLanguage",(function(e){var n=N.language!==e;N.language=e,n&&(me(),X({action:"widgetButtonTextUpdate",text:Ce()}))}),void 0),Be=U("getSignedMetadataToken",(function(){return N.signedMetadataToken}),null),Me=U("setSignedMetadataToken",(function(e){var n=N.signedMetadataToken!==e;N.signedMetadataToken=e,Le(),n&&(me(),ke())}),void 0),He=U("getPlayer",(function(){return N.player}),null),Fe=U("setPlayer",(function(e){var n,t=(null===(n=N.player)||void 0===n?void 0:n.id)!==(null==e?void 0:e.id);N.player=e,Le(),t&&(me(),ke())}),void 0),je=U("getTags",(function(){return Array.from(N.tags)}),[]),Ue=U("setTags",(function(e){N.tags=new Set(e),me()}),void 0),qe=U("addTag",(function(e){N.tags.add(e),me()}),void 0),We=U("addTags",(function(e){e.forEach((function(e){return N.tags.add(e)})),me()}),void 0),Ge=U("removeTag",(function(e){N.tags.delete(e),me()}),void 0),Ye=U("removeTags",(function(e){e.forEach((function(e){return N.tags.delete(e)})),me()}),void 0),ze=U("removeAllTags",(function(){N.tags.clear(),me()}),void 0),Je=U("getFields",(function(){return N.fields}),{}),Ke=U("setFields",(function(e){N.fields=e,me()}),void 0),Xe=U("addField",(function(e,n){N.fields[e]=n,me()}),void 0),Ve=U("addFields",(function(e){N.fields=n(n({},N.fields),e),me()}),void 0),Ze=U("removeField",(function(e){delete N.fields[e],me()}),void 0),Qe=U("removeFields",(function(e){e.forEach((function(e){return delete N.fields[e]})),me()}),void 0),$e=U("removeAllFields",(function(){N.fields={},me()}),void 0),en=U("enableLogging",(function(){N.loggingEnabled=!0}),void 0),nn=U("disableLogging",(function(){N.loggingEnabled=!1}),void 0),tn=U("isYoungPlayer",(function(){return N.youngPlayer}),!1),on=U("setYoungPlayer",(function(e){N.youngPlayer=e,me()}),void 0),rn=U("isPrivacyMode",(function(){return N.privacyMode}),!1),an=U("setPrivacyMode",(function(e){N.privacyMode=e,me()}),void 0),sn=U("isSupported",de,!1),ln=U("requestNotificationPermission",(function(){}),void 0),cn=U("enableNotifications",(function(){N.notificationsPaused=!1,re()}),void 0),dn=U("disableNotifications",(function(){N.notificationsPaused=!0}),void 0),un=U("getUnreadMessageCount",(function(){return N.unreadMessageCount}),0),gn=U("getUnansweredMessageCount",(function(){return N.unansweredMessageCount}),0),fn=U("getSdkVersion",(function(){return g}),""),pn=U("reset",(function(){N.language=null,N.tags=new Set,N.fields={},N.signedMetadataToken=null,N.player=null,Le(),me(),X({action:"widgetButtonTextUpdate",text:Ce()})}),void 0),mn=U("recordRetention",(function(){N.isRetentionRecordedForSession||Se()}),void 0),vn=U("addEventListener",ue,void 0),hn=U("removeEventListener",(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];s.apply(void 0,e)}),void 0),yn=U("iosSetKeyboardHeight",(function(e){N.keyboardHeight=e,he()}),void 0);return e.addEventListener=vn,e.addField=Xe,e.addFields=Ve,e.addTag=qe,e.addTags=We,e.close=Ae,e.disableLogging=nn,e.disableNotifications=dn,e.enableLogging=en,e.enableNotifications=cn,e.getFields=Je,e.getLanguage=Ne,e.getPlayer=He,e.getSdkVersion=fn,e.getSignedMetadataToken=Be,e.getTags=je,e.getUnansweredMessageCount=gn,e.getUnreadMessageCount=un,e.initialize=Ie,e.iosSetKeyboardHeight=yn,e.isPrivacyMode=rn,e.isSupported=sn,e.isYoungPlayer=tn,e.openAssistant=Re,e.openResource=Pe,e.openSupport=_e,e.recordRetention=mn,e.removeAllFields=$e,e.removeAllTags=ze,e.removeEventListener=hn,e.removeField=Ze,e.removeFields=Qe,e.removeTag=Ge,e.removeTags=Ye,e.requestNotificationPermission=ln,e.reset=pn,e.setFields=Ke,e.setLanguage=De,e.setPlayer=Fe,e.setPrivacyMode=an,e.setSignedMetadataToken=Me,e.setTags=Ue,e.setYoungPlayer=on,e}({});
|
|
1
|
+
var theymes=function(e){"use strict";var n=function(){return n=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},n.apply(this,arguments)};function t(e,n,t,o){return new(t||(t=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}l((o=o.apply(e,n||[])).next())}))}function o(e,n){var t,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[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(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(t=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(6===s[0]&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=n.call(e,r)}catch(e){s=[6,e],o=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(e,n,t){if(t||2===arguments.length)for(var o,i=0,r=n.length;i<r;i++)!o&&i in n||(o||(o=Array.prototype.slice.call(n,0,i)),o[i]=n[i]);return e.concat(o||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var r={unreadMessageCountUpdate:new Set,unansweredMessageCountUpdate:new Set,open:new Set,close:new Set};function a(e,n){r[e].add(n)}function s(e,n){r[e].delete(n)}function l(e,n){r[e].forEach((function(e){return e.apply(void 0,n)}))}var c='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .loader-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .loader {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 2rem;\n height: 2rem;\n animation: spin 1s linear infinite;\n transform-origin: center;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="loader-wrapper">\n <svg class="loader" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" fill="none" data-test-name="oval"\n role="img">\n <g fill="none" fill-rule="evenodd">\n <g transform="translate(1 1)" stroke-width="2">\n <circle stroke-opacity="0.5" cx="18" cy="18" r="18" />\n <path d="M36 18c0-9.94-8.06-18-18-18" />\n </g>\n </g>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',d='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: sans-serif;\n font-size: CSS_FONT_SIZE_PLACEHOLDER;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n .error-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n padding: 12px;\n }\n\n h1 {\n font-size: 18px;\n font-weight: 400;\n color: rgb(CSS_TEXT_PLACEHOLDER);\n }\n\n svg.error-icon {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="error-wrapper">\n <svg class="error-icon" width="91" height="91" viewBox="0 0 91 91" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M45.1079 89.1321C50.7158 89.1321 55.2618 84.5859 55.2618 78.9783C55.2618 73.3707 50.7158 68.8245 45.1079 68.8245C39.5001 68.8245 34.9541 73.3707 34.9541 78.9783C34.9541 84.5859 39.5001 89.1321 45.1079 89.1321Z"\n stroke="#FFB547" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />\n <path d="M24.7637 58.6355C35.9988 47.4005 54.2144 47.4005 65.4492 58.6355" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M12.7988 46.6689C22.1436 37.3241 34.529 32.8731 46.7703 33.3159" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M1.1084 34.4283C11.6674 23.9971 25.012 18.0833 38.7295 16.6868" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M89.1082 1.13208L62.0312 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M62.0312 1.13208L89.1082 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n </svg>\n <div>\n <h1>Connection error</h1>\n </div>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',u="<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\"\n content=\"viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\" />\n <meta name=\"theme-color\" content=\"#000000\" />\n <meta name=\"robots\" content=\"noindex\" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: 'TheymesBody';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .sdk-button {\n display: flex;\n font-family: 'TheymesBody', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n background: rgb(CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: rgb(CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER);\n font-size: 14px;\n font-weight: 700;\n cursor: pointer;\n text-align: center;\n padding: 0 12px;\n border: none;\n outline: none;\n border-radius: 999px;\n box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);\n position: relative;\n }\n\n .sdk-button-badge {\n position: absolute;\n top: 0;\n right: 0;\n background: rgb(CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER);\n width: 12px;\n height: 12px;\n border-radius: 999px;\n display: none;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <button class=\"sdk-button\">\n <span class=\"sdk-button-text\">WIDGET_BUTTON_TEXT_PLACEHOLDER</span>\n <span class=\"sdk-button-badge\"></span>\n </button>\n <script NONCE_ATTR_PLACEHOLDER>\n let unreadMessageCount = UNREAD_MESSAGE_COUNT_PLACEHOLDER;\n\n function openWidget() {\n parent.postMessage({ action: 'theymes.sdkButtonClicked' }, '*');\n }\n\n function iframeSubscriber(e) {\n if (e.data.action === 'unreadMessageCountUpdate') {\n unreadMessageCount = e.data.count;\n updateUnreadMessageCount()\n } else if (e.data.action === 'widgetButtonTextUpdate') {\n document.querySelector('.sdk-button-text').textContent = e.data.text;\n }\n }\n\n function updateUnreadMessageCount() {\n if (unreadMessageCount > 0) {\n document.querySelector('.sdk-button-badge').style.display = 'block';\n } else {\n document.querySelector('.sdk-button-badge').style.display = 'none';\n }\n }\n\n document.querySelector('.sdk-button').addEventListener('click', openWidget);\n window.addEventListener('message', iframeSubscriber, false);\n\n updateUnreadMessageCount();\n <\/script>\n</body>\n\n</html>",g="1.2.10",f="colors",p="locs",m="fonts",v="recordRetentionAfterSecs",h="resetSessionAfterSecs",y="web",b={sdkDialog:"#theymes-sdk-dialog",sdkIframeWrapper:"#theymes-sdk-wrapper",sdkIframe:"#theymes-sdk",sdkLoaderIframe:"#theymes-sdk-loader",notificationDialog:"#theymes-sdk-notification-dialog",notificationIframe:"#theymes-sdk-notification",sdkButtonIframe:"#theymes-sdk-button",sdkStylesheet:"#theymes-sdk-stylesheet"},w=340,S=680,E=500,x=120,T=48,k=.2,C=.2,O=.2,L="theymes_path_on_init",I="url('https://fonts.gstatic.com/s/poppins/v22/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2') format('woff2')",_=function(e){var n;try{return null!==(n=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e))&&void 0!==n?n:null}catch(e){return null}},R=function(e,n){try{null===localStorage||void 0===localStorage||localStorage.setItem(e,n)}catch(e){}},P={length:0,getItem:function(e){var n;try{return null!==(n=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem(e))&&void 0!==n?n:null}catch(e){return null}},setItem:function(e,n){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.removeItem(e)}catch(e){}},clear:function(){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.clear()}catch(e){}},key:function(e){var n;try{return null!==(n=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.key(e))&&void 0!==n?n:null}catch(e){return null}}},A=28800,N=function(){var e=null,t=A,o={text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}},i={widgetButtonText:{}},r=D();try{e=function(){var e=_(v);if(e){var n=JSON.parse(e);if("number"==typeof n)return n}return null}(),t=function(){var e=_(h);if(e){var n=JSON.parse(e);if("number"==typeof n)return n}return B()}(),o=function(){var e=_(f);if(e){var t=JSON.parse(e);return n(n({},{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}),t)}return{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}}(),i=function(){var e=_(p);if(e){var t=JSON.parse(e);return n(n({},{widgetButtonText:{}}),t)}return{widgetButtonText:{}}}(),r=function(){var e=_(m);if(e){var t=JSON.parse(e);return n(n({},D()),t)}return D()}()}catch(e){console.error("Error initializing internals",e)}return{token:null,domain:null,mode:"game",deviceId:null,position:"bottom-right",widgetButton:!1,widgetButtonAction:"support",x:20,y:20,loggingEnabled:!1,element:null,language:null,userLanguage:navigator.language,tags:new Set,fields:{},youngPlayer:!1,privacyMode:!1,signedMetadataToken:null,isLoggedIn:!1,isInForeground:!0,hasNetworkConnectivity:!0,player:null,sdkIsOpen:!1,forceUpdateSdkDialog:!1,recordRetentionAfterSecs:e,resetSessionAfterSecs:t,sessionStatus:"waiting",sessionStartTime:null,sessionResumeOrStartTime:null,retentionRemainingSeconds:null,isRetentionRecordedForSession:!1,recordRetentionTimerId:null,retryRecordRetentionTimerId:null,retryIntervalSecs:300,networkErrorTimerId:null,colors:o,locs:i,fonts:r,notificationsPaused:!0,notifications:[],visibleNotification:null,unreadMessageCount:0,unansweredMessageCount:0,previousPath:null,previousConfig:null,nonce:null,keyboardHeight:0,disableInsets:!1}}();function D(){return{body:void 0}}function B(){return A}var M=function(e,n){return e===n||Boolean(e&&n&&"object"==typeof e&&"object"==typeof n&&Object.keys(e).length===Object.keys(n).length&&Object.entries(e).every((function(e){var t=e[0],o=e[1];return M(o,n[t])})))};function H(e){var n,t=e.iframe,o=e.content,i=null===(n=t.contentWindow)||void 0===n?void 0:n.document;i&&(i.open(),i.write(o),i.close())}function F(e){return"".concat(e.r,", ").concat(e.g,", ").concat(e.b)}function j(e){var n,t,o,i;return e.template.replace(/PLATFORM_PLACEHOLDER/g,y).replace(/INSET_TOP_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-top, 0px)").replace(/INSET_BOTTOM_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)").replace(/INSET_LEFT_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-left, 0px)").replace(/INSET_RIGHT_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-right, 0px)").replace(/CSS_TEXT_PLACEHOLDER/g,F(N.colors.text)).replace(/CSS_BORDER_PLACEHOLDER/g,F(N.colors.border)).replace(/CSS_BACKGROUND_PLACEHOLDER/g,F(N.colors.background)).replace(/CSS_TILE_PLACEHOLDER/g,F(N.colors.tile)).replace(/CSS_ACCENT_PLACEHOLDER/g,F(N.colors.accent)).replace(/CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER/g,F(N.colors.notificationBackground)).replace(/CSS_NOTIFICATION_TEXT_PLACEHOLDER/g,F(N.colors.notificationText)).replace(/CSS_FONT_SIZE_PLACEHOLDER/g,"game"===N.mode?"16px":"14px").replace(/CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER/g,null!==(t=null===(n=N.fonts.body)||void 0===n?void 0:n.regular)&&void 0!==t?t:I).replace(/CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER/g,null!==(i=null===(o=N.fonts.body)||void 0===o?void 0:o.fallback)&&void 0!==i?i:"ui-sans-serif, system-ui, sans-serif").replace(/NONCE_ATTR_PLACEHOLDER/g,N.nonce?'nonce="'.concat(N.nonce,'"'):"")}var U=function(e,n,t){return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];try{return n.apply(void 0,o)}catch(n){return console.error("Error in ".concat(e),n),t}}},q='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: \'TheymesBody\';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: \'TheymesBody\', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n }\n\n html,\n body {\n width: 100%;\n height: auto;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n width: 1.25rem;\n height: 1.25rem;\n }\n\n .notification {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background: rgb(CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: auto;\n margin: 0;\n padding: 12px;\n border-radius: 6px;\n color: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n }\n\n .notification-text {\n flex: 1 0 0%;\n font-size: 0.875rem;\n /* 14/16 */\n line-height: 1.2;\n display: -webkit-box;\n line-clamp: 2;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n\n .close-button {\n flex: 0 0 auto;\n padding-left: 10px;\n cursor: pointer;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="notification">\n <div class="notification-text">NOTIFICATION_TEXT_PLACEHOLDER</div>\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6 6 18"></path>\n <path d="m6 6 12 12"></path>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeNotification() {\n parent.postMessage({ action: \'theymes.closeNotification\' }, \'*\');\n }\n\n function notificationClicked() {\n parent.postMessage({ action: \'theymes.handleNotificationAction\' }, \'*\');\n }\n\n document.querySelector(\'.notification-text\').addEventListener(\'click\', notificationClicked);\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeNotification);\n <\/script>\n</body>\n\n</html>',W=/(android|bb\d+|meego).+mobile|armv7l|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|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,G=/CrOS/,Y=/android|ipad|playbook|silk/i;function z(){return!!function(e){e||(e={});var n=e.ua;if(n||"undefined"==typeof navigator||(n=navigator.userAgent),n&&n.headers&&"string"==typeof n.headers["user-agent"]&&(n=n.headers["user-agent"]),"string"!=typeof n)return!1;var t=W.test(n)&&!G.test(n)||!!e.tablet&&Y.test(n);return!t&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==n.indexOf("Macintosh")&&-1!==n.indexOf("Safari")&&(t=!0),t}({tablet:!0})&&(window.innerWidth<E||window.innerHeight<E)}function J(e){var n=e.type,t=N.position,o=N.x,i=N.y;return z()&&"widget"===n?{top:"0",left:"0",right:"0",bottom:"0"}:"top-left"===t?{top:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",bottom:"auto"}:"top-right"===t?{top:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",bottom:"auto"}:"bottom-left"===t?{bottom:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",top:"auto"}:{bottom:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",top:"auto"}}function K(){return z()?{width:"100%",height:"100%",maxWidth:"none",maxHeight:"none"}:{width:"".concat(w,"px"),height:"".concat(S,"px"),maxWidth:"none",maxHeight:"calc(100vh - ".concat(2*N.y,"px)")}}function X(e){var n=document.querySelector(b.sdkButtonIframe);if(n)var t=setInterval((function(){var o,i;"complete"===(null===(o=n.contentDocument)||void 0===o?void 0:o.readyState)&&(clearInterval(t),null===(i=null==n?void 0:n.contentWindow)||void 0===i||i.postMessage(e,"*"))}),100)}function V(){var e,n,t=N.notifications[0];if(t&&!N.visibleNotification){N.visibleNotification=t;var o=null!==(e=document.querySelector(b.notificationDialog))&&void 0!==e?e:document.createElement("div");o.id=b.notificationDialog.replace("#",""),o.style.position="fixed",o.style.border="none",o.style.margin="0",o.style.padding="0",o.style.zIndex="9999",o.style.colorScheme="auto",o.style.backgroundColor="transparent",o.style.pointerEvents="none",o.style.overflow="hidden",document.body.appendChild(o);var i,r=null!==(n=o.querySelector(b.notificationIframe))&&void 0!==n?n:document.createElement("iframe");r.id=b.notificationIframe.replace("#",""),r.style.position="absolute",r.style.border="none",r.style.width="0",r.style.height="0",r.style.top="-20px",r.style.left="0",r.style.colorScheme="auto",r.style.pointerEvents="auto",r.style.marginTop="-20px",r.style.opacity="0",r.style.transition="opacity ".concat(O,"s ease-in-out, margin-top ").concat(O,"s ease-in-out"),o.appendChild(r),H({iframe:r,content:(i={text:t.text},j({template:q}).replace(/NOTIFICATION_TEXT_PLACEHOLDER/g,i.text))}),setTimeout((function(){r.style.opacity="1",r.style.marginTop="0px",Z()}),500),t.closeAfterSeconds>0&&setTimeout((function(){Q({notification:t})}),1e3*t.closeAfterSeconds)}}function Z(){var e,n,t,o=document.querySelector(b.notificationDialog),i=document.querySelector(b.notificationIframe);if(o&&i){var r=(null===(t=null===(n=null===(e=i.contentWindow)||void 0===e?void 0:e.document)||void 0===n?void 0:n.body)||void 0===t?void 0:t.scrollHeight)?"".concat(i.contentWindow.document.body.scrollHeight,"px"):"0";if("widget"===N.mode){var a=J({type:"widget"}),s=K(),l="calc(".concat(s.width," - 20px)");o.style.bottom=a.bottom,o.style.right=a.right,o.style.left=a.left,o.style.top=a.top,o.style.overflow="hidden",i.style.width=l}else if(N.element){var c=N.element.getBoundingClientRect();l="".concat(c.width-20,"px");o.style.top="".concat(c.top,"px"),o.style.left="".concat(c.left,"px"),o.style.right="".concat(c.right,"px"),o.style.bottom="".concat(c.bottom,"px"),o.style.overflow="hidden",i.style.width=l}else{l="calc(100% - 20px)";o.style.top=N.disableInsets?"0px":"env(safe-area-inset-top, 0px)",o.style.left=N.disableInsets?"0px":"env(safe-area-inset-left, 0px)",o.style.right=N.disableInsets?"0px":"env(safe-area-inset-right, 0px)",o.style.bottom=N.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)",o.style.overflow="visible",i.style.width=l}i.style.height=r,i.style.top="10px",i.style.left="10px"}}function Q(e){if(e.notification&&N.visibleNotification===e.notification){var n=document.querySelector(b.notificationIframe),t=document.querySelector(b.notificationDialog);n&&(n.style.opacity="0",n.style.marginTop="-20px",setTimeout((function(){null==t||t.remove(),N.notifications=N.notifications.slice(1),N.visibleNotification=null,V()}),1e3*O))}}var $=function(){function e(){Object.defineProperty(this,"isRunning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pollWhenNotificationsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"lastPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nextPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.resumeIfNeeded(!1)}return Object.defineProperty(e.prototype,"onIsInForegroundChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){N.isInForeground?this.resumeIfNeeded(!1):this.pauseIfNeeded()}}),Object.defineProperty(e.prototype,"onHasNetworkConnectivityChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!1)}}),Object.defineProperty(e.prototype,"resume",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.isRunning=!0;var n=new Date;if(this.nextPollDate&&!e||(this.nextPollDate=new Date(n.getTime()+1e3)),n>=this.nextPollDate)this.pollEventsRequest();else{var t=(this.nextPollDate.getTime()-n.getTime())/1e3;this.scheduleNextPollEventsRequest(t)}}}),Object.defineProperty(e.prototype,"pause",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning=!1,this.timer&&(clearTimeout(this.timer),this.timer=null)}}),Object.defineProperty(e.prototype,"shouldBeRunning",{enumerable:!1,configurable:!0,writable:!0,value:function(){return N.isLoggedIn&&N.isInForeground&&N.hasNetworkConnectivity&&!N.sdkIsOpen}}),Object.defineProperty(e.prototype,"resumeIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(e){!this.shouldBeRunning()||this.isRunning&&!e||this.resume(e)}}),Object.defineProperty(e.prototype,"pauseIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&!this.shouldBeRunning()&&this.pause()}}),Object.defineProperty(e.prototype,"onEnableNotifications",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&this.pollWhenNotificationsEnabled&&this.scheduleNextPollEventsRequest(0)}}),Object.defineProperty(e.prototype,"onOpen",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(e.prototype,"onClose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(e.prototype,"onLogin",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(e.prototype,"onLogout",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(e.prototype,"scheduleNextPollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this;this.nextPollDate=new Date(Date.now()+1e3*e),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){n.timer=null,n.pollEventsRequest()}),1e3*e)}}),Object.defineProperty(e.prototype,"pollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(){return t(this,void 0,void 0,(function(){var e,t,r,a,s,c,d,u,g;return o(this,(function(o){switch(o.label){case 0:if(!N.token||!N.domain||!N.deviceId)return[2];if(!this.isRunning)return[2];if(this.lastPollDate&&(e=new Date(this.lastPollDate.getTime()+6e4),(t=(e.getTime()-Date.now())/1e3)>0))return this.scheduleNextPollEventsRequest(t),[2];this.lastPollDate=new Date,r=N.notificationsPaused||N.sdkIsOpen?"true":"false",a=new URLSearchParams(n(n({token:N.token,language:null!==(u=N.language)&&void 0!==u?u:"en",deviceId:N.deviceId,notificationsPaused:r,mode:N.mode},(null===(g=N.player)||void 0===g?void 0:g.id)?{unsignedPlayerId:N.player.id}:{}),N.signedMetadataToken?{signedMetadataToken:N.signedMetadataToken}:{})).toString(),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch("https://".concat(N.domain,"/api/sdk/events?").concat(a),{method:"GET"})];case 2:if(!(s=o.sent()).ok)throw new Error("HTTP error! status: ".concat(s.status));return[4,s.json()];case 3:return c=o.sent(),this.scheduleNextPollEventsRequest(c.nextPollSeconds),void 0!==c.pollWhenNotificationsEnabled&&(this.pollWhenNotificationsEnabled=c.pollWhenNotificationsEnabled),N.notifications=i(i([],N.notifications,!0),c.notifications,!0),N.notifications.length>0&&V(),c.unansweredMessageCount!==N.unansweredMessageCount&&(N.unansweredMessageCount=c.unansweredMessageCount,l("unansweredMessageCountUpdate",[c.unansweredMessageCount])),c.unreadMessageCount!==N.unreadMessageCount&&(N.unreadMessageCount=c.unreadMessageCount,l("unreadMessageCountUpdate",[c.unreadMessageCount]),X({action:"unreadMessageCountUpdate",count:c.unreadMessageCount})),[3,5];case 4:return d=o.sent(),console.error("Error fetching events:",d),this.scheduleNextPollEventsRequest(N.retryIntervalSecs),[3,5];case 5:return[2]}}))}))}}),e}(),ee={eventPoller:null},ne=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onLogin()},te=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onLogout()},oe=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onOpen()},ie=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onClose()},re=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onEnableNotifications()},ae=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onIsInForegroundChanged()},se=function(e){var n="/help-center";pe({path:n,config:e}),fe({path:n,config:e})},le=function(e){var n="/assistant";pe({path:n,config:e}),fe({path:n,config:e})},ce=function(){!function(){var e=document.querySelector(b.sdkDialog),n=document.querySelector(b.sdkIframeWrapper);if(e){var t=function(){"widget"!==N.mode||N.forceUpdateSdkDialog?e.remove():e.style.display="none",N.forceUpdateSdkDialog=!1};n?(n.style.opacity="0",n.style.transform=be({animation:"start"}),setTimeout((function(){t()}),1e3*k)):t()}N.widgetButton&&ye();l("close",[])}()},de=function(){try{return CSS.supports("color","var(--color)")&&CSS.supports("color","rgb(255 255 255 / 0.5)")}catch(e){return!1}},ue=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];a.apply(void 0,e)};function ge(e){var t,o,r,a,s,l,c=(null!=e?e:{}).config;if(!N.token||!N.domain||!N.deviceId)return null;var d=null!==(t=null==c?void 0:c.tags)&&void 0!==t?t:[],u=null!==(o=null==c?void 0:c.fields)&&void 0!==o?o:{},f=null!==(a=null!==(r=null==c?void 0:c.language)&&void 0!==r?r:N.language)&&void 0!==a?a:null,p=null!==(s=N.signedMetadataToken)&&void 0!==s?s:null,m=null!==(l=N.player)&&void 0!==l?l:null,v={_platform:y,_sdkVersion:g};N.youngPlayer&&(v._youngPlayer=!0),(N.privacyMode||N.youngPlayer)&&(v._privacyMode=!0);var h=i(i([],Array.from(N.tags),!0),d,!0),b=n(n(n({},N.fields),u),v);return{token:N.token,domain:N.domain,deviceId:N.deviceId,tags:h,fields:b,language:f,signedMetadataToken:p,player:m}}function fe(e){var n,t,o,i=ge({config:e.config});if(i){var r=null!==(n=document.querySelector(b.sdkDialog))&&void 0!==n?n:document.createElement("div");r.id=b.sdkDialog.replace("#",""),r.style.display="block",r.style.position="fixed",r.style.border="none",r.style.width="0",r.style.height="0",r.style.margin="0",r.style.padding="0",r.style.zIndex="9998",r.style.overflow="hidden",r.style.backgroundColor="transparent";var a=null!==(t=r.querySelector(b.sdkIframeWrapper))&&void 0!==t?t:document.createElement("div");a.id=b.sdkIframeWrapper.replace("#",""),a.style.position="relative",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.right="0",a.style.bottom="0",a.style.left="0",a.style.opacity="0",a.style.colorScheme="auto",a.style.border="none",a.style.backgroundColor="rgb(".concat(F(N.colors.background),")"),a.style.transform=be({animation:"start"}),a.style.transition=(N.mode,"opacity ".concat(k,"s ease-in-out, transform ").concat(k,"s ease-in-out")),"widget"===N.mode&&(a.style.overflow="hidden");var s=null!==(o=a.querySelector(b.sdkLoaderIframe))&&void 0!==o?o:document.createElement("iframe");s.id=b.sdkLoaderIframe.replace("#",""),s.style.position="absolute",s.style.border="none",s.style.width="100%",s.style.height="100%",s.style.top="0",s.style.right="0",s.style.bottom="0",s.style.left="0",s.style.colorScheme="auto";var u=a.querySelector(b.sdkIframe),g=null!=u?u:document.createElement("iframe"),f=setInterval((function(){var e;"complete"===(null===(e=g.contentDocument)||void 0===e?void 0:e.readyState)&&(clearInterval(f),m())}),500);g.id=b.sdkIframe.replace("#",""),g.style.position="absolute",g.style.border="none",g.style.top="0",g.style.right="0",g.style.bottom="0",g.style.left="0",g.style.colorScheme="auto",u&&!N.networkErrorTimerId||(g.src=function(e){var n=e.path,t=e.supportViewConfig,o="https://".concat(N.domain,"/sdk"),i=new URLSearchParams;i.set("platform",y),i.set("token",t.token),i.set("deviceId",t.deviceId),i.set("mode",N.mode),i.set("origin",window.location.origin),i.set("userLanguage",N.userLanguage),N.disableInsets&&i.set("disableInsets","true");t.language&&i.set("language",t.language);de()||i.set("unsupported","true");var r=ve({supportViewConfig:t});return i.set("metadata",JSON.stringify(r)),"".concat(o).concat(n,"?").concat(i.toString())}({path:e.path,supportViewConfig:i}),g.style.width="0",g.style.height="0",r.appendChild(a),a.appendChild(s),a.appendChild(g),document.body.appendChild(r)),H({iframe:s,content:j({template:c})});var p=!1,m=function(){p||(p=!0,N.networkErrorTimerId=setTimeout((function(){H({iframe:s,content:j({template:d})})}),1e4))};g.onload=m,g.onerror=function(){H({iframe:s,content:j({template:d})})},he(),l("open",[]),setTimeout((function(){a.style.opacity="1",a.style.transform=be({animation:"end"})}),100)}}function pe(e){var n=e.path,t=e.config,o=null!=t?t:null;N.previousPath===n&&M(N.previousConfig,o)||(N.previousPath=n,N.previousConfig=o,me())}function me(){var e=document.querySelector(b.sdkDialog);N.sdkIsOpen?N.forceUpdateSdkDialog=!0:null==e||e.remove()}function ve(e){var n=e.supportViewConfig,t={unsigned:{},signed:void 0};return n.player&&(t.unsigned.player=n.player),n.tags&&(t.unsigned.tags=n.tags),n.fields&&(t.unsigned.fields=n.fields),n.signedMetadataToken&&(t.signed=n.signedMetadataToken),t}function he(){var e=document.querySelector(b.sdkDialog),n=document.querySelector(b.sdkIframeWrapper);if(e&&n)if("widget"===N.mode){var t=J({type:"widget"}),o=K();e.style.width=o.width,e.style.height=o.height,e.style.maxWidth=o.maxWidth,e.style.maxHeight=o.maxHeight,e.style.bottom=t.bottom,e.style.right=t.right,e.style.left=t.left,e.style.top=t.top,z()?(n.style.border="none",n.style.borderRadius="0"):(n.style.border="1px solid rgb(".concat(F(N.colors.border),")"),n.style.borderRadius="10px")}else if(n.style.border="none",n.style.borderRadius="0",N.element){var i=N.element.getBoundingClientRect(),r=i.width,a=i.height,s=i.top,l=i.left,c=i.right,d=i.bottom;e.style.width="".concat(r,"px"),e.style.height="".concat(a,"px"),e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="".concat(s,"px"),e.style.left="".concat(l,"px"),e.style.right="".concat(c,"px"),e.style.bottom="".concat(d,"px")}else{a=N.keyboardHeight>0?"calc(100% - ".concat(N.keyboardHeight,"px + env(safe-area-inset-bottom) - 10px)"):"100%";e.style.width="100%",e.style.height=a,e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0"}}function ye(){var e,n=null!==(e=document.querySelector(b.sdkButtonIframe))&&void 0!==e?e:document.createElement("iframe");if(n){var t,o=J({type:"button"});n.id=b.sdkButtonIframe.replace("#",""),n.style.position="fixed",n.style.border="none",n.style.width="".concat(x,"px"),n.style.height="".concat(T,"px"),n.style.maxWidth="95%",n.style.maxHeight="95%",n.style.bottom=o.bottom,n.style.right=o.right,n.style.left=o.left,n.style.top=o.top,n.style.margin="0",n.style.padding="0",n.style.zIndex="9997",n.style.backgroundColor="transparent",n.style.opacity="0",n.style.transform="scale(0.8)",n.style.transition="opacity ".concat(C,"s ease-in-out, transform ").concat(C,"s ease-in-out"),setTimeout((function(){n.style.opacity="1",n.style.transform="scale(1)"}),100),document.body.appendChild(n),H({iframe:n,content:(t={unreadMessageCount:N.unreadMessageCount},j({template:u}).replace(/UNREAD_MESSAGE_COUNT_PLACEHOLDER/g,"".concat(t.unreadMessageCount)).replace(/CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER/g,F(N.colors.widgetButtonBackground)).replace(/CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER/g,F(N.colors.widgetButtonText)).replace(/CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER/g,F(N.colors.widgetButtonActionPending)).replace(/WIDGET_BUTTON_TEXT_PLACEHOLDER/g,Ce()))})}}function be(e){return"start"===e.animation?"game"===N.mode?"translateY(20%)":"scale(0.8)":"game"===N.mode?"translateY(0)":"scale(1)"}function we(e){return t(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,7]),[4,e.json()];case 1:return[2,n.sent()];case 2:n.sent(),n.label=3;case 3:return n.trys.push([3,5,,6]),[4,e.text()];case 4:return[2,n.sent()];case 5:return n.sent(),[2,void 0];case 6:return[3,7];case 7:return[2]}}))}))}function Se(){return t(this,void 0,void 0,(function(){var e,n,t,i,r,a;return o(this,(function(o){switch(o.label){case 0:if(Te(),N.retryRecordRetentionTimerId&&(clearTimeout(N.retryRecordRetentionTimerId),N.retryRecordRetentionTimerId=null),N.retentionRemainingSeconds=null,N.isRetentionRecordedForSession=!0,!(e=ge()))return[2];n="https://".concat(N.domain,"/api/sdk/retention"),t=ve({supportViewConfig:e}),i={token:N.token,deviceId:N.deviceId,language:N.language,metadata:t},o.label=1;case 1:return o.trys.push([1,5,,6]),[4,fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})];case 2:return(r=o.sent()).ok?[3,4]:[4,we(r)];case 3:throw o.sent();case 4:return[3,6];case 5:return a=o.sent(),console.error("Error tracking retention:",a),N.retryRecordRetentionTimerId=setTimeout(Se,6e4),[3,6];case 6:return[2]}}))}))}function Ee(){var e=new Date;if(N.sessionStatus="active",N.sessionResumeOrStartTime=e,N.sessionStartTime){var n=N.sessionStartTime.valueOf()/1e3+N.resetSessionAfterSecs;Date.now()/1e3>n&&xe()}else xe();null!==N.retentionRemainingSeconds&&(N.recordRetentionTimerId=setTimeout(Se,1e3*N.retentionRemainingSeconds))}function xe(){N.sessionStartTime=new Date,N.retentionRemainingSeconds=N.recordRetentionAfterSecs,N.isRetentionRecordedForSession=!1,Te()}function Te(){N.recordRetentionTimerId&&(clearTimeout(N.recordRetentionTimerId),N.recordRetentionTimerId=null)}function ke(){N.isRetentionRecordedForSession&&Se()}function Ce(){var e,n,t;return null!==(t=null===(e=N.locs.widgetButtonText)||void 0===e?void 0:e[null!==(n=N.language)&&void 0!==n?n:"en"])&&void 0!==t?t:"Support"}function Oe(){var e=N.isInForeground,n="visible"===document.visibilityState&&document.hasFocus();N.isInForeground=n,e!==n&&ae(),n&&"paused"===N.sessionStatus?Ee():n||"active"!==N.sessionStatus||function(){if(N.sessionResumeOrStartTime&&N.retentionRemainingSeconds){var e=Math.floor((Date.now()-N.sessionResumeOrStartTime.valueOf())/1e3);N.retentionRemainingSeconds-=e}N.sessionStatus="paused",Te()}()}function Le(){var e,n=N.isLoggedIn,t=Boolean(N.signedMetadataToken||(null===(e=N.player)||void 0===e?void 0:e.id));N.isLoggedIn=t,t&&!n?ne():!t&&n&&te()}try{document.addEventListener("visibilitychange",Oe),window.addEventListener("focus",Oe),window.addEventListener("blur",Oe),window.addEventListener("resize",he),window.addEventListener("resize",Z),window.addEventListener("message",(function(e){if("theymes.ready"===e.data.action){var n=document.querySelector(b.sdkLoaderIframe),t=document.querySelector(b.sdkIframe);N.networkErrorTimerId&&(clearTimeout(N.networkErrorTimerId),N.networkErrorTimerId=null),t&&(t.style.width="100%",t.style.height="100%"),n&&n.remove()}else if("theymes.close"===e.data.action)ce();else if("theymes.closeNotification"===e.data.action)Q({notification:N.visibleNotification});else if("theymes.handleNotificationAction"===e.data.action)r={notification:N.visibleNotification},(null==(a=r.notification)?void 0:a.action)&&"OPEN_PAGE"===a.action.type&&(fe({path:a.action.path}),Q({notification:a}));else if("theymes.sdkButtonClicked"===e.data.action)(i=document.querySelector(b.sdkButtonIframe))&&(i.style.opacity="0",i.style.transform="scale(0.8)",setTimeout((function(){i.remove()}),1e3*C)),"support"===N.widgetButtonAction?se():"assistant"===N.widgetButtonAction&&le();else if("theymes.openExternalPage"===e.data.action){var o=e.data.target;"_self"===o&&function(e){var n=e.key,t=e.value,o=e.ttlMs,i=e.storage,r=void 0===i?P:i,a={value:t,expiry:Date.now()+o};r.setItem(n,JSON.stringify(a))}({key:L,value:e.data.path,ttlMs:6e5}),window.open(e.data.url,o)}var i,r,a}),!1),ue("open",(function(){N.sdkIsOpen=!0,oe()})),ue("close",(function(){N.sdkIsOpen=!1,ie()}))}catch(e){console.error("Error adding event listeners to SDK",e)}var Ie=U("initialize",(function(e,i,r){return t(void 0,void 0,void 0,(function(){var t,a,s,l,c,d,u,g,b,w,S,E,x,T;return o(this,(function(o){switch(o.label){case 0:if(!e||!i||!r.mode)throw new Error("Token, domain, and mode are required");N.token=e,N.domain=i,N.mode=r.mode,N.element="element"in r&&void 0!==r.element?r.element:N.element,N.language=null!==(u=r.language)&&void 0!==u?u:N.language,N.nonce=null!==(g=r.nonce)&&void 0!==g?g:N.nonce,N.deviceId=function(){var e=_("deviceId");if(e)return e;var n=(t=Date.now(),"undefined"!=typeof performance&&"function"==typeof performance.now&&(t+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})));return R("deviceId",n),n;var t}(),N.widgetButton="button"in r&&void 0!==r.button&&null!==(b=r.button)&&void 0!==b?b:N.widgetButton,N.widgetButtonAction="buttonAction"in r&&void 0!==r.buttonAction&&null!==(w=r.buttonAction)&&void 0!==w?w:N.widgetButtonAction,N.position="position"in r&&void 0!==r.position&&null!==(S=r.position)&&void 0!==S?S:N.position,N.x="x"in r&&void 0!==r.x?r.x:N.x,N.y="y"in r&&void 0!==r.y?r.y:N.y,N.disableInsets="game"===N.mode&&null!==N.element,ee.eventPoller||(ee.eventPoller=new $),t="https://".concat(i,"/api/sdk/settings"),a=new URLSearchParams({token:N.token,platform:y,mode:N.mode}).toString(),o.label=1;case 1:return o.trys.push([1,6,,7]),[4,fetch("".concat(t,"?").concat(a),{method:"GET"})];case 2:return(s=o.sent()).ok?[3,4]:[4,we(s)];case 3:throw o.sent();case 4:return[4,s.json()];case 5:return l=o.sent(),(null===(E=null==l?void 0:l.branding)||void 0===E?void 0:E.colors)&&(A=l.branding.colors,N.colors=n(n({},N.colors),A),R(f,JSON.stringify(N.colors))),(null===(x=null==l?void 0:l.branding)||void 0===x?void 0:x.locs)&&(I=l.branding.locs,N.locs=n(n({},N.locs),I),R(p,JSON.stringify(N.locs))),(null===(T=null==l?void 0:l.branding)||void 0===T?void 0:T.fonts)&&(O=l.branding.fonts,N.fonts=n(n({},N.fonts),O),R(m,JSON.stringify(N.fonts))),"number"!=typeof(null==l?void 0:l.recordRetentionAfterSecs)&&null!==(null==l?void 0:l.recordRetentionAfterSecs)||(C=l.recordRetentionAfterSecs,N.recordRetentionAfterSecs=C,R(v,JSON.stringify(N.recordRetentionAfterSecs))),"number"!=typeof(null==l?void 0:l.resetSessionAfterSecs)&&null!==(null==l?void 0:l.resetSessionAfterSecs)||(k=l.resetSessionAfterSecs,N.resetSessionAfterSecs=null!=k?k:B(),R(h,JSON.stringify(N.resetSessionAfterSecs))),Ee(),me(),c=function(e){var n=e.key,t=e.storage,o=void 0===t?P:t,i=e.removeItem,r=void 0!==i&&i,a=o.getItem(n);if(!a)return null;var s=JSON.parse(a);return Date.now()>s.expiry?(o.removeItem(n),null):(r&&o.removeItem(n),s.value)}({key:L,removeItem:!0}),c&&"widget"===N.mode&&!z()?fe({path:c}):N.widgetButton&&ye(),[3,7];case 6:return d=o.sent(),console.error("Error initializing SDK:",d),[3,7];case 7:return[2]}var k,C,O,I,A}))}))}),void 0),_e=U("openSupport",se,void 0),Re=U("openAssistant",le,void 0),Pe=U("openResource",(function(e,n){var t="/resources/".concat(e);pe({path:t,config:n}),fe({path:t,config:n})}),void 0),Ae=U("close",ce,void 0),Ne=U("getLanguage",(function(){return N.language}),null),De=U("setLanguage",(function(e){var n=N.language!==e;N.language=e,n&&(me(),X({action:"widgetButtonTextUpdate",text:Ce()}))}),void 0),Be=U("getSignedMetadataToken",(function(){return N.signedMetadataToken}),null),Me=U("setSignedMetadataToken",(function(e){var n=N.signedMetadataToken!==e;N.signedMetadataToken=e,Le(),n&&(me(),ke())}),void 0),He=U("getPlayer",(function(){return N.player}),null),Fe=U("setPlayer",(function(e){var n,t=(null===(n=N.player)||void 0===n?void 0:n.id)!==(null==e?void 0:e.id);N.player=e,Le(),t&&(me(),ke())}),void 0),je=U("getTags",(function(){return Array.from(N.tags)}),[]),Ue=U("setTags",(function(e){N.tags=new Set(e),me()}),void 0),qe=U("addTag",(function(e){N.tags.add(e),me()}),void 0),We=U("addTags",(function(e){e.forEach((function(e){return N.tags.add(e)})),me()}),void 0),Ge=U("removeTag",(function(e){N.tags.delete(e),me()}),void 0),Ye=U("removeTags",(function(e){e.forEach((function(e){return N.tags.delete(e)})),me()}),void 0),ze=U("removeAllTags",(function(){N.tags.clear(),me()}),void 0),Je=U("getFields",(function(){return N.fields}),{}),Ke=U("setFields",(function(e){N.fields=e,me()}),void 0),Xe=U("addField",(function(e,n){N.fields[e]=n,me()}),void 0),Ve=U("addFields",(function(e){N.fields=n(n({},N.fields),e),me()}),void 0),Ze=U("removeField",(function(e){delete N.fields[e],me()}),void 0),Qe=U("removeFields",(function(e){e.forEach((function(e){return delete N.fields[e]})),me()}),void 0),$e=U("removeAllFields",(function(){N.fields={},me()}),void 0),en=U("enableLogging",(function(){N.loggingEnabled=!0}),void 0),nn=U("disableLogging",(function(){N.loggingEnabled=!1}),void 0),tn=U("isYoungPlayer",(function(){return N.youngPlayer}),!1),on=U("setYoungPlayer",(function(e){N.youngPlayer=e,me()}),void 0),rn=U("isPrivacyMode",(function(){return N.privacyMode}),!1),an=U("setPrivacyMode",(function(e){N.privacyMode=e,me()}),void 0),sn=U("isSupported",de,!1),ln=U("requestNotificationPermission",(function(){}),void 0),cn=U("enableNotifications",(function(){N.notificationsPaused=!1,re()}),void 0),dn=U("disableNotifications",(function(){N.notificationsPaused=!0}),void 0),un=U("getUnreadMessageCount",(function(){return N.unreadMessageCount}),0),gn=U("getUnansweredMessageCount",(function(){return N.unansweredMessageCount}),0),fn=U("getSdkVersion",(function(){return g}),""),pn=U("reset",(function(){N.language=null,N.tags=new Set,N.fields={},N.signedMetadataToken=null,N.player=null,Le(),me(),X({action:"widgetButtonTextUpdate",text:Ce()})}),void 0),mn=U("recordRetention",(function(){N.isRetentionRecordedForSession||Se()}),void 0),vn=U("addEventListener",ue,void 0),hn=U("removeEventListener",(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];s.apply(void 0,e)}),void 0),yn=U("iosSetKeyboardHeight",(function(e){N.keyboardHeight=e,he()}),void 0);return e.addEventListener=vn,e.addField=Xe,e.addFields=Ve,e.addTag=qe,e.addTags=We,e.close=Ae,e.disableLogging=nn,e.disableNotifications=dn,e.enableLogging=en,e.enableNotifications=cn,e.getFields=Je,e.getLanguage=Ne,e.getPlayer=He,e.getSdkVersion=fn,e.getSignedMetadataToken=Be,e.getTags=je,e.getUnansweredMessageCount=gn,e.getUnreadMessageCount=un,e.initialize=Ie,e.iosSetKeyboardHeight=yn,e.isPrivacyMode=rn,e.isSupported=sn,e.isYoungPlayer=tn,e.openAssistant=Re,e.openResource=Pe,e.openSupport=_e,e.recordRetention=mn,e.removeAllFields=$e,e.removeAllTags=ze,e.removeEventListener=hn,e.removeField=Ze,e.removeFields=Qe,e.removeTag=Ge,e.removeTags=Ye,e.requestNotificationPermission=ln,e.reset=pn,e.setFields=Ke,e.setLanguage=De,e.setPlayer=Fe,e.setPrivacyMode=an,e.setSignedMetadataToken=Me,e.setTags=Ue,e.setYoungPlayer=on,e}({});
|
package/dist/index.unity.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e){"use strict";var n=function(){return n=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},n.apply(this,arguments)};function t(e,n,t,o){return new(t||(t=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}l((o=o.apply(e,n||[])).next())}))}function o(e,n){var t,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[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(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(t=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(6===s[0]&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=n.call(e,r)}catch(e){s=[6,e],o=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(e,n,t){if(t||2===arguments.length)for(var o,i=0,r=n.length;i<r;i++)!o&&i in n||(o||(o=Array.prototype.slice.call(n,0,i)),o[i]=n[i]);return e.concat(o||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var r={unreadMessageCountUpdate:new Set,unansweredMessageCountUpdate:new Set,open:new Set,close:new Set};function a(e,n){r[e].add(n)}function s(e,n){r[e].delete(n)}function l(e,n){r[e].forEach((function(e){return e.apply(void 0,n)}))}var c='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .loader-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .loader {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 2rem;\n height: 2rem;\n animation: spin 1s linear infinite;\n transform-origin: center;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="loader-wrapper">\n <svg class="loader" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" fill="none" data-test-name="oval"\n role="img">\n <g fill="none" fill-rule="evenodd">\n <g transform="translate(1 1)" stroke-width="2">\n <circle stroke-opacity="0.5" cx="18" cy="18" r="18" />\n <path d="M36 18c0-9.94-8.06-18-18-18" />\n </g>\n </g>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',d='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: sans-serif;\n font-size: CSS_FONT_SIZE_PLACEHOLDER;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n .error-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n padding: 12px;\n }\n\n h1 {\n font-size: 18px;\n font-weight: 400;\n color: rgb(CSS_TEXT_PLACEHOLDER);\n }\n\n svg.error-icon {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="error-wrapper">\n <svg class="error-icon" width="91" height="91" viewBox="0 0 91 91" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M45.1079 89.1321C50.7158 89.1321 55.2618 84.5859 55.2618 78.9783C55.2618 73.3707 50.7158 68.8245 45.1079 68.8245C39.5001 68.8245 34.9541 73.3707 34.9541 78.9783C34.9541 84.5859 39.5001 89.1321 45.1079 89.1321Z"\n stroke="#FFB547" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />\n <path d="M24.7637 58.6355C35.9988 47.4005 54.2144 47.4005 65.4492 58.6355" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M12.7988 46.6689C22.1436 37.3241 34.529 32.8731 46.7703 33.3159" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M1.1084 34.4283C11.6674 23.9971 25.012 18.0833 38.7295 16.6868" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M89.1082 1.13208L62.0312 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M62.0312 1.13208L89.1082 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n </svg>\n <div>\n <h1>Connection error</h1>\n </div>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',u="<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\"\n content=\"viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\" />\n <meta name=\"theme-color\" content=\"#000000\" />\n <meta name=\"robots\" content=\"noindex\" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: 'TheymesBody';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .sdk-button {\n display: flex;\n font-family: 'TheymesBody', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n background: rgb(CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: rgb(CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER);\n font-size: 14px;\n font-weight: 700;\n cursor: pointer;\n text-align: center;\n padding: 0 12px;\n border: none;\n outline: none;\n border-radius: 999px;\n box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);\n position: relative;\n }\n\n .sdk-button-badge {\n position: absolute;\n top: 0;\n right: 0;\n background: rgb(CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER);\n width: 12px;\n height: 12px;\n border-radius: 999px;\n display: none;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <button class=\"sdk-button\">\n <span class=\"sdk-button-text\">WIDGET_BUTTON_TEXT_PLACEHOLDER</span>\n <span class=\"sdk-button-badge\"></span>\n </button>\n <script NONCE_ATTR_PLACEHOLDER>\n let unreadMessageCount = UNREAD_MESSAGE_COUNT_PLACEHOLDER;\n\n function openWidget() {\n parent.postMessage({ action: 'theymes.sdkButtonClicked' }, '*');\n }\n\n function iframeSubscriber(e) {\n if (e.data.action === 'unreadMessageCountUpdate') {\n unreadMessageCount = e.data.count;\n updateUnreadMessageCount()\n } else if (e.data.action === 'widgetButtonTextUpdate') {\n document.querySelector('.sdk-button-text').textContent = e.data.text;\n }\n }\n\n function updateUnreadMessageCount() {\n if (unreadMessageCount > 0) {\n document.querySelector('.sdk-button-badge').style.display = 'block';\n } else {\n document.querySelector('.sdk-button-badge').style.display = 'none';\n }\n }\n\n document.querySelector('.sdk-button').addEventListener('click', openWidget);\n window.addEventListener('message', iframeSubscriber, false);\n\n updateUnreadMessageCount();\n <\/script>\n</body>\n\n</html>",g="1.2.9",f="colors",p="locs",m="fonts",h="recordRetentionAfterSecs",v="resetSessionAfterSecs",y="web",b={sdkDialog:"#theymes-sdk-dialog",sdkIframeWrapper:"#theymes-sdk-wrapper",sdkIframe:"#theymes-sdk",sdkLoaderIframe:"#theymes-sdk-loader",notificationDialog:"#theymes-sdk-notification-dialog",notificationIframe:"#theymes-sdk-notification",sdkButtonIframe:"#theymes-sdk-button",sdkStylesheet:"#theymes-sdk-stylesheet"},w=340,S=680,E=500,x=120,T=48,k=.2,C=.2,O=.2,L="theymes_path_on_init",I="url('https://fonts.gstatic.com/s/poppins/v22/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2') format('woff2')",_=function(e){var n;try{return null!==(n=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e))&&void 0!==n?n:null}catch(e){return null}},R=function(e,n){try{null===localStorage||void 0===localStorage||localStorage.setItem(e,n)}catch(e){}},P={length:0,getItem:function(e){var n;try{return null!==(n=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem(e))&&void 0!==n?n:null}catch(e){return null}},setItem:function(e,n){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.removeItem(e)}catch(e){}},clear:function(){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.clear()}catch(e){}},key:function(e){var n;try{return null!==(n=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.key(e))&&void 0!==n?n:null}catch(e){return null}}},A=28800,N=function(){var e=null,t=A,o={text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}},i={widgetButtonText:{}},r=D();try{e=function(){var e=_(h);if(e){var n=JSON.parse(e);if("number"==typeof n)return n}return null}(),t=function(){var e=_(v);if(e){var n=JSON.parse(e);if("number"==typeof n)return n}return B()}(),o=function(){var e=_(f);if(e){var t=JSON.parse(e);return n(n({},{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}),t)}return{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}}(),i=function(){var e=_(p);if(e){var t=JSON.parse(e);return n(n({},{widgetButtonText:{}}),t)}return{widgetButtonText:{}}}(),r=function(){var e=_(m);if(e){var t=JSON.parse(e);return n(n({},D()),t)}return D()}()}catch(e){console.error("Error initializing internals",e)}return{token:null,domain:null,mode:"game",deviceId:null,position:"bottom-right",widgetButton:!1,widgetButtonAction:"support",x:20,y:20,loggingEnabled:!1,element:null,language:null,userLanguage:navigator.language,tags:new Set,fields:{},youngPlayer:!1,privacyMode:!1,signedMetadataToken:null,isLoggedIn:!1,isInForeground:!0,hasNetworkConnectivity:!0,player:null,sdkIsOpen:!1,forceUpdateSdkDialog:!1,recordRetentionAfterSecs:e,resetSessionAfterSecs:t,sessionStatus:"waiting",sessionStartTime:null,sessionResumeOrStartTime:null,retentionRemainingSeconds:null,isRetentionRecordedForSession:!1,recordRetentionTimerId:null,retryRecordRetentionTimerId:null,retryIntervalSecs:300,networkErrorTimerId:null,colors:o,locs:i,fonts:r,notificationsPaused:!0,notifications:[],visibleNotification:null,unreadMessageCount:0,unansweredMessageCount:0,previousPath:null,previousConfig:null,nonce:null,keyboardHeight:0,disableInsets:!1}}();function D(){return{body:void 0}}function B(){return A}var M=function(e,n){return e===n||Boolean(e&&n&&"object"==typeof e&&"object"==typeof n&&Object.keys(e).length===Object.keys(n).length&&Object.entries(e).every((function(e){var t=e[0],o=e[1];return M(o,n[t])})))};function H(e){var n,t=e.iframe,o=e.content,i=null===(n=t.contentWindow)||void 0===n?void 0:n.document;i&&(i.open(),i.write(o),i.close())}function F(e){return"".concat(e.r,", ").concat(e.g,", ").concat(e.b)}function j(e){var n,t,o,i;return e.template.replace(/PLATFORM_PLACEHOLDER/g,y).replace(/INSET_TOP_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-top, 0px)").replace(/INSET_BOTTOM_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)").replace(/INSET_LEFT_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-left, 0px)").replace(/INSET_RIGHT_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-right, 0px)").replace(/CSS_TEXT_PLACEHOLDER/g,F(N.colors.text)).replace(/CSS_BORDER_PLACEHOLDER/g,F(N.colors.border)).replace(/CSS_BACKGROUND_PLACEHOLDER/g,F(N.colors.background)).replace(/CSS_TILE_PLACEHOLDER/g,F(N.colors.tile)).replace(/CSS_ACCENT_PLACEHOLDER/g,F(N.colors.accent)).replace(/CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER/g,F(N.colors.notificationBackground)).replace(/CSS_NOTIFICATION_TEXT_PLACEHOLDER/g,F(N.colors.notificationText)).replace(/CSS_FONT_SIZE_PLACEHOLDER/g,"game"===N.mode?"16px":"14px").replace(/CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER/g,null!==(t=null===(n=N.fonts.body)||void 0===n?void 0:n.regular)&&void 0!==t?t:I).replace(/CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER/g,null!==(i=null===(o=N.fonts.body)||void 0===o?void 0:o.fallback)&&void 0!==i?i:"ui-sans-serif, system-ui, sans-serif").replace(/NONCE_ATTR_PLACEHOLDER/g,N.nonce?'nonce="'.concat(N.nonce,'"'):"")}var U=function(e,n,t){return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];try{return n.apply(void 0,o)}catch(n){return console.error("Error in ".concat(e),n),t}}},q='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: \'TheymesBody\';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: \'TheymesBody\', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n }\n\n html,\n body {\n width: 100%;\n height: auto;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n width: 1.25rem;\n height: 1.25rem;\n }\n\n .notification {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background: rgb(CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: auto;\n margin: 0;\n padding: 12px;\n border-radius: 6px;\n color: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n }\n\n .notification-text {\n flex: 1 0 0%;\n font-size: 0.875rem;\n /* 14/16 */\n line-height: 1.2;\n display: -webkit-box;\n line-clamp: 2;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n\n .close-button {\n flex: 0 0 auto;\n padding-left: 10px;\n cursor: pointer;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="notification">\n <div class="notification-text">NOTIFICATION_TEXT_PLACEHOLDER</div>\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6 6 18"></path>\n <path d="m6 6 12 12"></path>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeNotification() {\n parent.postMessage({ action: \'theymes.closeNotification\' }, \'*\');\n }\n\n function notificationClicked() {\n parent.postMessage({ action: \'theymes.handleNotificationAction\' }, \'*\');\n }\n\n document.querySelector(\'.notification-text\').addEventListener(\'click\', notificationClicked);\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeNotification);\n <\/script>\n</body>\n\n</html>',W=/(android|bb\d+|meego).+mobile|armv7l|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|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,G=/CrOS/,Y=/android|ipad|playbook|silk/i;function z(){return!!function(e){e||(e={});var n=e.ua;if(n||"undefined"==typeof navigator||(n=navigator.userAgent),n&&n.headers&&"string"==typeof n.headers["user-agent"]&&(n=n.headers["user-agent"]),"string"!=typeof n)return!1;var t=W.test(n)&&!G.test(n)||!!e.tablet&&Y.test(n);return!t&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==n.indexOf("Macintosh")&&-1!==n.indexOf("Safari")&&(t=!0),t}({tablet:!0})&&(window.innerWidth<E||window.innerHeight<E)}function J(e){var n=e.type,t=N.position,o=N.x,i=N.y;return z()&&"widget"===n?{top:"0",left:"0",right:"0",bottom:"0"}:"top-left"===t?{top:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",bottom:"auto"}:"top-right"===t?{top:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",bottom:"auto"}:"bottom-left"===t?{bottom:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",top:"auto"}:{bottom:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",top:"auto"}}function K(){return z()?{width:"100%",height:"100%",maxWidth:"none",maxHeight:"none"}:{width:"".concat(w,"px"),height:"".concat(S,"px"),maxWidth:"none",maxHeight:"calc(100vh - ".concat(2*N.y,"px)")}}function X(e){var n=document.querySelector(b.sdkButtonIframe);if(n)var t=setInterval((function(){var o,i;"complete"===(null===(o=n.contentDocument)||void 0===o?void 0:o.readyState)&&(clearInterval(t),null===(i=null==n?void 0:n.contentWindow)||void 0===i||i.postMessage(e,"*"))}),100)}function V(){var e,n,t=N.notifications[0];if(t&&!N.visibleNotification){N.visibleNotification=t;var o=null!==(e=document.querySelector(b.notificationDialog))&&void 0!==e?e:document.createElement("div");o.id=b.notificationDialog.replace("#",""),o.style.position="fixed",o.style.border="none",o.style.margin="0",o.style.padding="0",o.style.zIndex="9999",o.style.colorScheme="auto",o.style.backgroundColor="transparent",o.style.pointerEvents="none",o.style.overflow="hidden",document.body.appendChild(o);var i,r=null!==(n=o.querySelector(b.notificationIframe))&&void 0!==n?n:document.createElement("iframe");r.id=b.notificationIframe.replace("#",""),r.style.position="absolute",r.style.border="none",r.style.width="0",r.style.height="0",r.style.top="-20px",r.style.left="0",r.style.colorScheme="auto",r.style.pointerEvents="auto",r.style.marginTop="-20px",r.style.opacity="0",r.style.transition="opacity ".concat(O,"s ease-in-out, margin-top ").concat(O,"s ease-in-out"),o.appendChild(r),H({iframe:r,content:(i={text:t.text},j({template:q}).replace(/NOTIFICATION_TEXT_PLACEHOLDER/g,i.text))}),setTimeout((function(){r.style.opacity="1",r.style.marginTop="0px",Z()}),500),t.closeAfterSeconds>0&&setTimeout((function(){Q({notification:t})}),1e3*t.closeAfterSeconds)}}function Z(){var e,n,t,o=document.querySelector(b.notificationDialog),i=document.querySelector(b.notificationIframe);if(o&&i){var r=(null===(t=null===(n=null===(e=i.contentWindow)||void 0===e?void 0:e.document)||void 0===n?void 0:n.body)||void 0===t?void 0:t.scrollHeight)?"".concat(i.contentWindow.document.body.scrollHeight,"px"):"0";if("widget"===N.mode){var a=J({type:"widget"}),s=K(),l="calc(".concat(s.width," - 20px)");o.style.bottom=a.bottom,o.style.right=a.right,o.style.left=a.left,o.style.top=a.top,o.style.overflow="hidden",i.style.width=l}else if(N.element){var c=N.element.getBoundingClientRect();l="".concat(c.width-20,"px");o.style.top="".concat(c.top,"px"),o.style.left="".concat(c.left,"px"),o.style.right="".concat(c.right,"px"),o.style.bottom="".concat(c.bottom,"px"),o.style.overflow="hidden",i.style.width=l}else{l="calc(100% - 20px)";o.style.top=N.disableInsets?"0px":"env(safe-area-inset-top, 0px)",o.style.left=N.disableInsets?"0px":"env(safe-area-inset-left, 0px)",o.style.right=N.disableInsets?"0px":"env(safe-area-inset-right, 0px)",o.style.bottom=N.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)",o.style.overflow="visible",i.style.width=l}i.style.height=r,i.style.top="10px",i.style.left="10px"}}function Q(e){if(e.notification&&N.visibleNotification===e.notification){var n=document.querySelector(b.notificationIframe),t=document.querySelector(b.notificationDialog);n&&(n.style.opacity="0",n.style.marginTop="-20px",setTimeout((function(){null==t||t.remove(),N.notifications=N.notifications.slice(1),N.visibleNotification=null,V()}),1e3*O))}}var $=function(){function e(){Object.defineProperty(this,"isRunning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pollWhenNotificationsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"lastPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nextPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.resumeIfNeeded(!1)}return Object.defineProperty(e.prototype,"onIsInForegroundChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){N.isInForeground?this.resumeIfNeeded(!1):this.pauseIfNeeded()}}),Object.defineProperty(e.prototype,"onHasNetworkConnectivityChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!1)}}),Object.defineProperty(e.prototype,"resume",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.isRunning=!0;var n=new Date;if(this.nextPollDate&&!e||(this.nextPollDate=new Date(n.getTime()+1e3)),n>=this.nextPollDate)this.pollEventsRequest();else{var t=(this.nextPollDate.getTime()-n.getTime())/1e3;this.scheduleNextPollEventsRequest(t)}}}),Object.defineProperty(e.prototype,"pause",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning=!1,this.timer&&(clearTimeout(this.timer),this.timer=null)}}),Object.defineProperty(e.prototype,"shouldBeRunning",{enumerable:!1,configurable:!0,writable:!0,value:function(){return N.isLoggedIn&&N.isInForeground&&N.hasNetworkConnectivity&&!N.sdkIsOpen}}),Object.defineProperty(e.prototype,"resumeIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(e){!this.shouldBeRunning()||this.isRunning&&!e||this.resume(e)}}),Object.defineProperty(e.prototype,"pauseIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&!this.shouldBeRunning()&&this.pause()}}),Object.defineProperty(e.prototype,"onEnableNotifications",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&this.pollWhenNotificationsEnabled&&this.scheduleNextPollEventsRequest(0)}}),Object.defineProperty(e.prototype,"onOpen",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(e.prototype,"onClose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(e.prototype,"onLogin",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(e.prototype,"onLogout",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(e.prototype,"scheduleNextPollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this;this.nextPollDate=new Date(Date.now()+1e3*e),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){n.timer=null,n.pollEventsRequest()}),1e3*e)}}),Object.defineProperty(e.prototype,"pollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(){return t(this,void 0,void 0,(function(){var e,t,r,a,s,c,d,u,g;return o(this,(function(o){switch(o.label){case 0:if(!N.token||!N.domain||!N.deviceId)return[2];if(!this.isRunning)return[2];if(this.lastPollDate&&(e=new Date(this.lastPollDate.getTime()+6e4),(t=(e.getTime()-Date.now())/1e3)>0))return this.scheduleNextPollEventsRequest(t),[2];this.lastPollDate=new Date,r=N.notificationsPaused||N.sdkIsOpen?"true":"false",a=new URLSearchParams(n(n({token:N.token,language:null!==(u=N.language)&&void 0!==u?u:"en",deviceId:N.deviceId,notificationsPaused:r,mode:N.mode},(null===(g=N.player)||void 0===g?void 0:g.id)?{unsignedPlayerId:N.player.id}:{}),N.signedMetadataToken?{signedMetadataToken:N.signedMetadataToken}:{})).toString(),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch("https://".concat(N.domain,"/api/sdk/events?").concat(a),{method:"GET"})];case 2:if(!(s=o.sent()).ok)throw new Error("HTTP error! status: ".concat(s.status));return[4,s.json()];case 3:return c=o.sent(),this.scheduleNextPollEventsRequest(c.nextPollSeconds),void 0!==c.pollWhenNotificationsEnabled&&(this.pollWhenNotificationsEnabled=c.pollWhenNotificationsEnabled),N.notifications=i(i([],N.notifications,!0),c.notifications,!0),N.notifications.length>0&&V(),c.unansweredMessageCount!==N.unansweredMessageCount&&(N.unansweredMessageCount=c.unansweredMessageCount,l("unansweredMessageCountUpdate",[c.unansweredMessageCount])),c.unreadMessageCount!==N.unreadMessageCount&&(N.unreadMessageCount=c.unreadMessageCount,l("unreadMessageCountUpdate",[c.unreadMessageCount]),X({action:"unreadMessageCountUpdate",count:c.unreadMessageCount})),[3,5];case 4:return d=o.sent(),console.error("Error fetching events:",d),this.scheduleNextPollEventsRequest(N.retryIntervalSecs),[3,5];case 5:return[2]}}))}))}}),e}(),ee={eventPoller:null},ne=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onLogin()},te=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onLogout()},oe=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onOpen()},ie=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onClose()},re=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onEnableNotifications()},ae=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onIsInForegroundChanged()},se=function(e){var n="/help-center";pe({path:n,config:e}),fe({path:n,config:e})},le=function(e){var n="/assistant";pe({path:n,config:e}),fe({path:n,config:e})},ce=function(){!function(){var e=document.querySelector(b.sdkDialog),n=document.querySelector(b.sdkIframeWrapper);if(e){var t=function(){"widget"!==N.mode||N.forceUpdateSdkDialog?e.remove():e.style.display="none",N.forceUpdateSdkDialog=!1};n?(n.style.opacity="0",n.style.transform=be({animation:"start"}),setTimeout((function(){t()}),1e3*k)):t()}N.widgetButton&&ye();l("close",[])}()},de=function(){try{return CSS.supports("color","var(--color)")&&CSS.supports("color","rgb(255 255 255 / 0.5)")}catch(e){return!1}},ue=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];a.apply(void 0,e)};function ge(e){var t,o,r,a,s,l,c=(null!=e?e:{}).config;if(!N.token||!N.domain||!N.deviceId)return null;var d=null!==(t=null==c?void 0:c.tags)&&void 0!==t?t:[],u=null!==(o=null==c?void 0:c.fields)&&void 0!==o?o:{},f=null!==(a=null!==(r=null==c?void 0:c.language)&&void 0!==r?r:N.language)&&void 0!==a?a:null,p=null!==(s=N.signedMetadataToken)&&void 0!==s?s:null,m=null!==(l=N.player)&&void 0!==l?l:null,h={_platform:y,_sdkVersion:g};N.youngPlayer&&(h._youngPlayer=!0),(N.privacyMode||N.youngPlayer)&&(h._privacyMode=!0);var v=i(i([],Array.from(N.tags),!0),d,!0),b=n(n(n({},N.fields),u),h);return{token:N.token,domain:N.domain,deviceId:N.deviceId,tags:v,fields:b,language:f,signedMetadataToken:p,player:m}}function fe(e){var n,t,o,i=ge({config:e.config});if(i){var r=null!==(n=document.querySelector(b.sdkDialog))&&void 0!==n?n:document.createElement("div");r.id=b.sdkDialog.replace("#",""),r.style.display="block",r.style.position="fixed",r.style.border="none",r.style.width="0",r.style.height="0",r.style.margin="0",r.style.padding="0",r.style.zIndex="9998",r.style.overflow="hidden",r.style.backgroundColor="transparent";var a=null!==(t=r.querySelector(b.sdkIframeWrapper))&&void 0!==t?t:document.createElement("div");a.id=b.sdkIframeWrapper.replace("#",""),a.style.position="relative",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.right="0",a.style.bottom="0",a.style.left="0",a.style.opacity="0",a.style.colorScheme="auto",a.style.border="none",a.style.backgroundColor="rgb(".concat(F(N.colors.background),")"),a.style.transform=be({animation:"start"}),a.style.transition=(N.mode,"opacity ".concat(k,"s ease-in-out, transform ").concat(k,"s ease-in-out")),"widget"===N.mode&&(a.style.overflow="hidden");var s=null!==(o=a.querySelector(b.sdkLoaderIframe))&&void 0!==o?o:document.createElement("iframe");s.id=b.sdkLoaderIframe.replace("#",""),s.style.position="absolute",s.style.border="none",s.style.width="100%",s.style.height="100%",s.style.top="0",s.style.right="0",s.style.bottom="0",s.style.left="0",s.style.colorScheme="auto";var u=a.querySelector(b.sdkIframe),g=null!=u?u:document.createElement("iframe"),f=setInterval((function(){var e;"complete"===(null===(e=g.contentDocument)||void 0===e?void 0:e.readyState)&&(clearInterval(f),m())}),500);g.id=b.sdkIframe.replace("#",""),g.style.position="absolute",g.style.border="none",g.style.top="0",g.style.right="0",g.style.bottom="0",g.style.left="0",g.style.colorScheme="auto",u&&!N.networkErrorTimerId||(g.src=function(e){var n=e.path,t=e.supportViewConfig,o="https://".concat(N.domain,"/sdk"),i=new URLSearchParams;i.set("platform",y),i.set("token",t.token),i.set("deviceId",t.deviceId),i.set("mode",N.mode),i.set("origin",window.location.origin),i.set("userLanguage",N.userLanguage),N.disableInsets&&i.set("disableInsets","true");t.language&&i.set("language",t.language);de()||i.set("unsupported","true");var r=he({supportViewConfig:t});return i.set("metadata",JSON.stringify(r)),"".concat(o).concat(n,"?").concat(i.toString())}({path:e.path,supportViewConfig:i}),g.style.width="0",g.style.height="0",r.appendChild(a),a.appendChild(s),a.appendChild(g),document.body.appendChild(r)),H({iframe:s,content:j({template:c})});var p=!1,m=function(){p||(p=!0,N.networkErrorTimerId=setTimeout((function(){H({iframe:s,content:j({template:d})})}),1e4))};g.onload=m,g.onerror=function(){H({iframe:s,content:j({template:d})})},ve(),l("open",[]),setTimeout((function(){a.style.opacity="1",a.style.transform=be({animation:"end"})}),100)}}function pe(e){var n=e.path,t=e.config,o=null!=t?t:null;N.previousPath===n&&M(N.previousConfig,o)||(N.previousPath=n,N.previousConfig=o,me())}function me(){var e=document.querySelector(b.sdkDialog);N.sdkIsOpen?N.forceUpdateSdkDialog=!0:null==e||e.remove()}function he(e){var n=e.supportViewConfig,t={unsigned:{},signed:void 0};return n.player&&(t.unsigned.player=n.player),n.tags&&(t.unsigned.tags=n.tags),n.fields&&(t.unsigned.fields=n.fields),n.signedMetadataToken&&(t.signed=n.signedMetadataToken),t}function ve(){var e=document.querySelector(b.sdkDialog),n=document.querySelector(b.sdkIframeWrapper);if(e&&n)if("widget"===N.mode){var t=J({type:"widget"}),o=K();e.style.width=o.width,e.style.height=o.height,e.style.maxWidth=o.maxWidth,e.style.maxHeight=o.maxHeight,e.style.bottom=t.bottom,e.style.right=t.right,e.style.left=t.left,e.style.top=t.top,z()?(n.style.border="none",n.style.borderRadius="0"):(n.style.border="1px solid rgb(".concat(F(N.colors.border),")"),n.style.borderRadius="10px")}else if(n.style.border="none",n.style.borderRadius="0",N.element){var i=N.element.getBoundingClientRect(),r=i.width,a=i.height,s=i.top,l=i.left,c=i.right,d=i.bottom;e.style.width="".concat(r,"px"),e.style.height="".concat(a,"px"),e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="".concat(s,"px"),e.style.left="".concat(l,"px"),e.style.right="".concat(c,"px"),e.style.bottom="".concat(d,"px")}else{a=N.keyboardHeight>0?"calc(100% - ".concat(N.keyboardHeight,"px + env(safe-area-inset-bottom) - 10px)"):"100%";e.style.width="100%",e.style.height=a,e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0"}}function ye(){var e,n=null!==(e=document.querySelector(b.sdkButtonIframe))&&void 0!==e?e:document.createElement("iframe");if(n){var t,o=J({type:"button"});n.id=b.sdkButtonIframe.replace("#",""),n.style.position="fixed",n.style.border="none",n.style.width="".concat(x,"px"),n.style.height="".concat(T,"px"),n.style.maxWidth="95%",n.style.maxHeight="95%",n.style.bottom=o.bottom,n.style.right=o.right,n.style.left=o.left,n.style.top=o.top,n.style.margin="0",n.style.padding="0",n.style.zIndex="9997",n.style.backgroundColor="transparent",n.style.opacity="0",n.style.transform="scale(0.8)",n.style.transition="opacity ".concat(C,"s ease-in-out, transform ").concat(C,"s ease-in-out"),setTimeout((function(){n.style.opacity="1",n.style.transform="scale(1)"}),100),document.body.appendChild(n),H({iframe:n,content:(t={unreadMessageCount:N.unreadMessageCount},j({template:u}).replace(/UNREAD_MESSAGE_COUNT_PLACEHOLDER/g,"".concat(t.unreadMessageCount)).replace(/CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER/g,F(N.colors.widgetButtonBackground)).replace(/CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER/g,F(N.colors.widgetButtonText)).replace(/CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER/g,F(N.colors.widgetButtonActionPending)).replace(/WIDGET_BUTTON_TEXT_PLACEHOLDER/g,Ce()))})}}function be(e){return"start"===e.animation?"game"===N.mode?"translateY(20%)":"scale(0.8)":"game"===N.mode?"translateY(0)":"scale(1)"}function we(e){return t(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,7]),[4,e.json()];case 1:return[2,n.sent()];case 2:n.sent(),n.label=3;case 3:return n.trys.push([3,5,,6]),[4,e.text()];case 4:return[2,n.sent()];case 5:return n.sent(),[2,void 0];case 6:return[3,7];case 7:return[2]}}))}))}function Se(){return t(this,void 0,void 0,(function(){var e,n,t,i,r,a;return o(this,(function(o){switch(o.label){case 0:if(Te(),N.retryRecordRetentionTimerId&&(clearTimeout(N.retryRecordRetentionTimerId),N.retryRecordRetentionTimerId=null),N.retentionRemainingSeconds=null,N.isRetentionRecordedForSession=!0,!(e=ge()))return[2];n="https://".concat(N.domain,"/api/sdk/retention"),t=he({supportViewConfig:e}),i={token:N.token,deviceId:N.deviceId,language:N.language,metadata:t},o.label=1;case 1:return o.trys.push([1,5,,6]),[4,fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})];case 2:return(r=o.sent()).ok?[3,4]:[4,we(r)];case 3:throw o.sent();case 4:return[3,6];case 5:return a=o.sent(),console.error("Error tracking retention:",a),N.retryRecordRetentionTimerId=setTimeout(Se,6e4),[3,6];case 6:return[2]}}))}))}function Ee(){var e=new Date;if(N.sessionStatus="active",N.sessionResumeOrStartTime=e,N.sessionStartTime){var n=N.sessionStartTime.valueOf()/1e3+N.resetSessionAfterSecs;Date.now()/1e3>n&&xe()}else xe();null!==N.retentionRemainingSeconds&&(N.recordRetentionTimerId=setTimeout(Se,1e3*N.retentionRemainingSeconds))}function xe(){N.sessionStartTime=new Date,N.retentionRemainingSeconds=N.recordRetentionAfterSecs,N.isRetentionRecordedForSession=!1,Te()}function Te(){N.recordRetentionTimerId&&(clearTimeout(N.recordRetentionTimerId),N.recordRetentionTimerId=null)}function ke(){N.isRetentionRecordedForSession&&Se()}function Ce(){var e,n,t;return null!==(t=null===(e=N.locs.widgetButtonText)||void 0===e?void 0:e[null!==(n=N.language)&&void 0!==n?n:"en"])&&void 0!==t?t:"Support"}function Oe(){var e=N.isInForeground,n="visible"===document.visibilityState&&document.hasFocus();N.isInForeground=n,e!==n&&ae(),n&&"paused"===N.sessionStatus?Ee():n||"active"!==N.sessionStatus||function(){if(N.sessionResumeOrStartTime&&N.retentionRemainingSeconds){var e=Math.floor((Date.now()-N.sessionResumeOrStartTime.valueOf())/1e3);N.retentionRemainingSeconds-=e}N.sessionStatus="paused",Te()}()}function Le(){var e,n=N.isLoggedIn,t=Boolean(N.signedMetadataToken||(null===(e=N.player)||void 0===e?void 0:e.id));N.isLoggedIn=t,t&&!n?ne():!t&&n&&te()}try{document.addEventListener("visibilitychange",Oe),window.addEventListener("focus",Oe),window.addEventListener("blur",Oe),window.addEventListener("resize",ve),window.addEventListener("resize",Z),window.addEventListener("message",(function(e){if("theymes.ready"===e.data.action){var n=document.querySelector(b.sdkLoaderIframe),t=document.querySelector(b.sdkIframe);N.networkErrorTimerId&&(clearTimeout(N.networkErrorTimerId),N.networkErrorTimerId=null),t&&(t.style.width="100%",t.style.height="100%"),n&&n.remove()}else if("theymes.close"===e.data.action)ce();else if("theymes.closeNotification"===e.data.action)Q({notification:N.visibleNotification});else if("theymes.handleNotificationAction"===e.data.action)r={notification:N.visibleNotification},(null==(a=r.notification)?void 0:a.action)&&"OPEN_PAGE"===a.action.type&&(fe({path:a.action.path}),Q({notification:a}));else if("theymes.sdkButtonClicked"===e.data.action)(i=document.querySelector(b.sdkButtonIframe))&&(i.style.opacity="0",i.style.transform="scale(0.8)",setTimeout((function(){i.remove()}),1e3*C)),"support"===N.widgetButtonAction?se():"assistant"===N.widgetButtonAction&&le();else if("theymes.openExternalPage"===e.data.action){var o=e.data.url.startsWith(window.location.origin);o&&function(e){var n=e.key,t=e.value,o=e.ttlMs,i=e.storage,r=void 0===i?P:i,a={value:t,expiry:Date.now()+o};r.setItem(n,JSON.stringify(a))}({key:L,value:e.data.path,ttlMs:1e4}),window.open(e.data.url,o?"_self":"_blank")}var i,r,a}),!1),ue("open",(function(){N.sdkIsOpen=!0,oe()})),ue("close",(function(){N.sdkIsOpen=!1,ie()}))}catch(e){console.error("Error adding event listeners to SDK",e)}var Ie=U("initialize",(function(e,i,r){return t(void 0,void 0,void 0,(function(){var t,a,s,l,c,d,u,g,b,w,S,E,x,T;return o(this,(function(o){switch(o.label){case 0:if(!e||!i||!r.mode)throw new Error("Token, domain, and mode are required");N.token=e,N.domain=i,N.mode=r.mode,N.element="element"in r&&void 0!==r.element?r.element:N.element,N.language=null!==(u=r.language)&&void 0!==u?u:N.language,N.nonce=null!==(g=r.nonce)&&void 0!==g?g:N.nonce,N.deviceId=function(){var e=_("deviceId");if(e)return e;var n=(t=Date.now(),"undefined"!=typeof performance&&"function"==typeof performance.now&&(t+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})));return R("deviceId",n),n;var t}(),N.widgetButton="button"in r&&void 0!==r.button&&null!==(b=r.button)&&void 0!==b?b:N.widgetButton,N.widgetButtonAction="buttonAction"in r&&void 0!==r.buttonAction&&null!==(w=r.buttonAction)&&void 0!==w?w:N.widgetButtonAction,N.position="position"in r&&void 0!==r.position&&null!==(S=r.position)&&void 0!==S?S:N.position,N.x="x"in r&&void 0!==r.x?r.x:N.x,N.y="y"in r&&void 0!==r.y?r.y:N.y,N.disableInsets="game"===N.mode&&null!==N.element,ee.eventPoller||(ee.eventPoller=new $),t="https://".concat(i,"/api/sdk/settings"),a=new URLSearchParams({token:N.token,platform:y,mode:N.mode}).toString(),o.label=1;case 1:return o.trys.push([1,6,,7]),[4,fetch("".concat(t,"?").concat(a),{method:"GET"})];case 2:return(s=o.sent()).ok?[3,4]:[4,we(s)];case 3:throw o.sent();case 4:return[4,s.json()];case 5:return l=o.sent(),(null===(E=null==l?void 0:l.branding)||void 0===E?void 0:E.colors)&&(A=l.branding.colors,N.colors=n(n({},N.colors),A),R(f,JSON.stringify(N.colors))),(null===(x=null==l?void 0:l.branding)||void 0===x?void 0:x.locs)&&(I=l.branding.locs,N.locs=n(n({},N.locs),I),R(p,JSON.stringify(N.locs))),(null===(T=null==l?void 0:l.branding)||void 0===T?void 0:T.fonts)&&(O=l.branding.fonts,N.fonts=n(n({},N.fonts),O),R(m,JSON.stringify(N.fonts))),"number"!=typeof(null==l?void 0:l.recordRetentionAfterSecs)&&null!==(null==l?void 0:l.recordRetentionAfterSecs)||(C=l.recordRetentionAfterSecs,N.recordRetentionAfterSecs=C,R(h,JSON.stringify(N.recordRetentionAfterSecs))),"number"!=typeof(null==l?void 0:l.resetSessionAfterSecs)&&null!==(null==l?void 0:l.resetSessionAfterSecs)||(k=l.resetSessionAfterSecs,N.resetSessionAfterSecs=null!=k?k:B(),R(v,JSON.stringify(N.resetSessionAfterSecs))),Ee(),me(),c=function(e){var n=e.key,t=e.storage,o=void 0===t?P:t,i=e.removeItem,r=void 0!==i&&i,a=o.getItem(n);if(!a)return null;var s=JSON.parse(a);return Date.now()>s.expiry?(o.removeItem(n),null):(r&&o.removeItem(n),s.value)}({key:L,removeItem:!0}),c&&"widget"===N.mode&&!z()?fe({path:c}):N.widgetButton&&ye(),[3,7];case 6:return d=o.sent(),console.error("Error initializing SDK:",d),[3,7];case 7:return[2]}var k,C,O,I,A}))}))}),void 0),_e=U("openSupport",se,void 0),Re=U("openAssistant",le,void 0),Pe=U("openResource",(function(e,n){var t="/resources/".concat(e);pe({path:t,config:n}),fe({path:t,config:n})}),void 0),Ae=U("close",ce,void 0),Ne=U("getLanguage",(function(){return N.language}),null),De=U("setLanguage",(function(e){var n=N.language!==e;N.language=e,n&&(me(),X({action:"widgetButtonTextUpdate",text:Ce()}))}),void 0),Be=U("getSignedMetadataToken",(function(){return N.signedMetadataToken}),null),Me=U("setSignedMetadataToken",(function(e){var n=N.signedMetadataToken!==e;N.signedMetadataToken=e,Le(),n&&(me(),ke())}),void 0),He=U("getPlayer",(function(){return N.player}),null),Fe=U("setPlayer",(function(e){var n,t=(null===(n=N.player)||void 0===n?void 0:n.id)!==(null==e?void 0:e.id);N.player=e,Le(),t&&(me(),ke())}),void 0),je=U("getTags",(function(){return Array.from(N.tags)}),[]),Ue=U("setTags",(function(e){N.tags=new Set(e),me()}),void 0),qe=U("addTag",(function(e){N.tags.add(e),me()}),void 0),We=U("addTags",(function(e){e.forEach((function(e){return N.tags.add(e)})),me()}),void 0),Ge=U("removeTag",(function(e){N.tags.delete(e),me()}),void 0),Ye=U("removeTags",(function(e){e.forEach((function(e){return N.tags.delete(e)})),me()}),void 0),ze=U("removeAllTags",(function(){N.tags.clear(),me()}),void 0),Je=U("getFields",(function(){return N.fields}),{}),Ke=U("setFields",(function(e){N.fields=e,me()}),void 0),Xe=U("addField",(function(e,n){N.fields[e]=n,me()}),void 0),Ve=U("addFields",(function(e){N.fields=n(n({},N.fields),e),me()}),void 0),Ze=U("removeField",(function(e){delete N.fields[e],me()}),void 0),Qe=U("removeFields",(function(e){e.forEach((function(e){return delete N.fields[e]})),me()}),void 0),$e=U("removeAllFields",(function(){N.fields={},me()}),void 0),en=U("enableLogging",(function(){N.loggingEnabled=!0}),void 0),nn=U("disableLogging",(function(){N.loggingEnabled=!1}),void 0),tn=U("isYoungPlayer",(function(){return N.youngPlayer}),!1),on=U("setYoungPlayer",(function(e){N.youngPlayer=e,me()}),void 0),rn=U("isPrivacyMode",(function(){return N.privacyMode}),!1),an=U("setPrivacyMode",(function(e){N.privacyMode=e,me()}),void 0),sn=U("isSupported",de,!1),ln=U("requestNotificationPermission",(function(){}),void 0),cn=U("enableNotifications",(function(){N.notificationsPaused=!1,re()}),void 0),dn=U("disableNotifications",(function(){N.notificationsPaused=!0}),void 0),un=U("getUnreadMessageCount",(function(){return N.unreadMessageCount}),0),gn=U("getUnansweredMessageCount",(function(){return N.unansweredMessageCount}),0),fn=U("getSdkVersion",(function(){return g}),""),pn=U("reset",(function(){N.language=null,N.tags=new Set,N.fields={},N.signedMetadataToken=null,N.player=null,Le(),me(),X({action:"widgetButtonTextUpdate",text:Ce()})}),void 0),mn=U("recordRetention",(function(){N.isRetentionRecordedForSession||Se()}),void 0),hn=U("addEventListener",ue,void 0),vn=U("removeEventListener",(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];s.apply(void 0,e)}),void 0),yn=U("iosSetKeyboardHeight",(function(e){N.keyboardHeight=e,ve()}),void 0);e.addEventListener=hn,e.addField=Xe,e.addFields=Ve,e.addTag=qe,e.addTags=We,e.close=Ae,e.disableLogging=nn,e.disableNotifications=dn,e.enableLogging=en,e.enableNotifications=cn,e.getFields=Je,e.getLanguage=Ne,e.getPlayer=He,e.getSdkVersion=fn,e.getSignedMetadataToken=Be,e.getTags=je,e.getUnansweredMessageCount=gn,e.getUnreadMessageCount=un,e.initialize=Ie,e.iosSetKeyboardHeight=yn,e.isPrivacyMode=rn,e.isSupported=sn,e.isYoungPlayer=tn,e.openAssistant=Re,e.openResource=Pe,e.openSupport=_e,e.recordRetention=mn,e.removeAllFields=$e,e.removeAllTags=ze,e.removeEventListener=vn,e.removeField=Ze,e.removeFields=Qe,e.removeTag=Ge,e.removeTags=Ye,e.requestNotificationPermission=ln,e.reset=pn,e.setFields=Ke,e.setLanguage=De,e.setPlayer=Fe,e.setPrivacyMode=an,e.setSignedMetadataToken=Me,e.setTags=Ue,e.setYoungPlayer=on}(this.theymes=this.theymes||{});
|
|
1
|
+
!function(e){"use strict";var n=function(){return n=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},n.apply(this,arguments)};function t(e,n,t,o){return new(t||(t=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}l((o=o.apply(e,n||[])).next())}))}function o(e,n){var t,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[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(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(t=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(6===s[0]&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=n.call(e,r)}catch(e){s=[6,e],o=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(e,n,t){if(t||2===arguments.length)for(var o,i=0,r=n.length;i<r;i++)!o&&i in n||(o||(o=Array.prototype.slice.call(n,0,i)),o[i]=n[i]);return e.concat(o||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var r={unreadMessageCountUpdate:new Set,unansweredMessageCountUpdate:new Set,open:new Set,close:new Set};function a(e,n){r[e].add(n)}function s(e,n){r[e].delete(n)}function l(e,n){r[e].forEach((function(e){return e.apply(void 0,n)}))}var c='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .loader-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .loader {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 2rem;\n height: 2rem;\n animation: spin 1s linear infinite;\n transform-origin: center;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="loader-wrapper">\n <svg class="loader" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" fill="none" data-test-name="oval"\n role="img">\n <g fill="none" fill-rule="evenodd">\n <g transform="translate(1 1)" stroke-width="2">\n <circle stroke-opacity="0.5" cx="18" cy="18" r="18" />\n <path d="M36 18c0-9.94-8.06-18-18-18" />\n </g>\n </g>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',d='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: sans-serif;\n font-size: CSS_FONT_SIZE_PLACEHOLDER;\n }\n\n html,\n body {\n background: rgb(CSS_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n padding-top: INSET_TOP_PLACEHOLDER;\n padding-bottom: INSET_BOTTOM_PLACEHOLDER;\n padding-left: INSET_LEFT_PLACEHOLDER;\n padding-right: INSET_RIGHT_PLACEHOLDER;\n }\n\n .top-bar {\n flex: 0 0 auto;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: flex-end;\n }\n\n .close-button {\n padding: 0.5rem 1rem;\n cursor: pointer;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n width: 1.75rem;\n height: 1.75rem;\n }\n\n .error-wrapper {\n flex: 1 0 0%;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n position: relative;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: 12px;\n padding: 12px;\n }\n\n h1 {\n font-size: 18px;\n font-weight: 400;\n color: rgb(CSS_TEXT_PLACEHOLDER);\n }\n\n svg.error-icon {\n stroke: rgb(CSS_ACCENT_PLACEHOLDER);\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="wrapper">\n <div class="top-bar">\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"\n stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"\n class="lucide lucide-x-icon lucide-x">\n <path d="M18 6 6 18" />\n <path d="m6 6 12 12" />\n </svg>\n </div>\n </div>\n <div class="error-wrapper">\n <svg class="error-icon" width="91" height="91" viewBox="0 0 91 91" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M45.1079 89.1321C50.7158 89.1321 55.2618 84.5859 55.2618 78.9783C55.2618 73.3707 50.7158 68.8245 45.1079 68.8245C39.5001 68.8245 34.9541 73.3707 34.9541 78.9783C34.9541 84.5859 39.5001 89.1321 45.1079 89.1321Z"\n stroke="#FFB547" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />\n <path d="M24.7637 58.6355C35.9988 47.4005 54.2144 47.4005 65.4492 58.6355" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M12.7988 46.6689C22.1436 37.3241 34.529 32.8731 46.7703 33.3159" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M1.1084 34.4283C11.6674 23.9971 25.012 18.0833 38.7295 16.6868" stroke="#FFB547" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n <path d="M89.1082 1.13208L62.0312 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M62.0312 1.13208L89.1082 28.209" stroke="#FFB547" stroke-width="2" stroke-linecap="round"\n stroke-linejoin="round" />\n </svg>\n <div>\n <h1>Connection error</h1>\n </div>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeTheymesSdk() {\n parent.postMessage({ action: \'theymes.close\' }, \'*\');\n }\n\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeTheymesSdk);\n <\/script>\n</body>\n\n</html>',u="<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\"\n content=\"viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\" />\n <meta name=\"theme-color\" content=\"#000000\" />\n <meta name=\"robots\" content=\"noindex\" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: 'TheymesBody';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .sdk-button {\n display: flex;\n font-family: 'TheymesBody', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n background: rgb(CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: rgb(CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER);\n font-size: 14px;\n font-weight: 700;\n cursor: pointer;\n text-align: center;\n padding: 0 12px;\n border: none;\n outline: none;\n border-radius: 999px;\n box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);\n position: relative;\n }\n\n .sdk-button-badge {\n position: absolute;\n top: 0;\n right: 0;\n background: rgb(CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER);\n width: 12px;\n height: 12px;\n border-radius: 999px;\n display: none;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <button class=\"sdk-button\">\n <span class=\"sdk-button-text\">WIDGET_BUTTON_TEXT_PLACEHOLDER</span>\n <span class=\"sdk-button-badge\"></span>\n </button>\n <script NONCE_ATTR_PLACEHOLDER>\n let unreadMessageCount = UNREAD_MESSAGE_COUNT_PLACEHOLDER;\n\n function openWidget() {\n parent.postMessage({ action: 'theymes.sdkButtonClicked' }, '*');\n }\n\n function iframeSubscriber(e) {\n if (e.data.action === 'unreadMessageCountUpdate') {\n unreadMessageCount = e.data.count;\n updateUnreadMessageCount()\n } else if (e.data.action === 'widgetButtonTextUpdate') {\n document.querySelector('.sdk-button-text').textContent = e.data.text;\n }\n }\n\n function updateUnreadMessageCount() {\n if (unreadMessageCount > 0) {\n document.querySelector('.sdk-button-badge').style.display = 'block';\n } else {\n document.querySelector('.sdk-button-badge').style.display = 'none';\n }\n }\n\n document.querySelector('.sdk-button').addEventListener('click', openWidget);\n window.addEventListener('message', iframeSubscriber, false);\n\n updateUnreadMessageCount();\n <\/script>\n</body>\n\n</html>",g="1.2.10",f="colors",p="locs",m="fonts",h="recordRetentionAfterSecs",v="resetSessionAfterSecs",y="web",b={sdkDialog:"#theymes-sdk-dialog",sdkIframeWrapper:"#theymes-sdk-wrapper",sdkIframe:"#theymes-sdk",sdkLoaderIframe:"#theymes-sdk-loader",notificationDialog:"#theymes-sdk-notification-dialog",notificationIframe:"#theymes-sdk-notification",sdkButtonIframe:"#theymes-sdk-button",sdkStylesheet:"#theymes-sdk-stylesheet"},w=340,S=680,E=500,x=120,T=48,k=.2,C=.2,O=.2,L="theymes_path_on_init",I="url('https://fonts.gstatic.com/s/poppins/v22/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2') format('woff2')",_=function(e){var n;try{return null!==(n=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e))&&void 0!==n?n:null}catch(e){return null}},R=function(e,n){try{null===localStorage||void 0===localStorage||localStorage.setItem(e,n)}catch(e){}},P={length:0,getItem:function(e){var n;try{return null!==(n=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem(e))&&void 0!==n?n:null}catch(e){return null}},setItem:function(e,n){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.removeItem(e)}catch(e){}},clear:function(){try{null===sessionStorage||void 0===sessionStorage||sessionStorage.clear()}catch(e){}},key:function(e){var n;try{return null!==(n=null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.key(e))&&void 0!==n?n:null}catch(e){return null}}},A=28800,N=function(){var e=null,t=A,o={text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}},i={widgetButtonText:{}},r=D();try{e=function(){var e=_(h);if(e){var n=JSON.parse(e);if("number"==typeof n)return n}return null}(),t=function(){var e=_(v);if(e){var n=JSON.parse(e);if("number"==typeof n)return n}return B()}(),o=function(){var e=_(f);if(e){var t=JSON.parse(e);return n(n({},{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}),t)}return{text:{r:255,g:255,b:255},border:{r:51,g:54,b:71},background:{r:12,g:15,b:20},tile:{r:20,g:23,b:29},accent:{r:255,g:181,b:71},notificationBackground:{r:20,g:23,b:29},notificationText:{r:255,g:255,b:255},widgetButtonBackground:{r:12,g:15,b:20},widgetButtonText:{r:12,g:15,b:20},widgetButtonActionPending:{r:255,g:65,b:65}}}(),i=function(){var e=_(p);if(e){var t=JSON.parse(e);return n(n({},{widgetButtonText:{}}),t)}return{widgetButtonText:{}}}(),r=function(){var e=_(m);if(e){var t=JSON.parse(e);return n(n({},D()),t)}return D()}()}catch(e){console.error("Error initializing internals",e)}return{token:null,domain:null,mode:"game",deviceId:null,position:"bottom-right",widgetButton:!1,widgetButtonAction:"support",x:20,y:20,loggingEnabled:!1,element:null,language:null,userLanguage:navigator.language,tags:new Set,fields:{},youngPlayer:!1,privacyMode:!1,signedMetadataToken:null,isLoggedIn:!1,isInForeground:!0,hasNetworkConnectivity:!0,player:null,sdkIsOpen:!1,forceUpdateSdkDialog:!1,recordRetentionAfterSecs:e,resetSessionAfterSecs:t,sessionStatus:"waiting",sessionStartTime:null,sessionResumeOrStartTime:null,retentionRemainingSeconds:null,isRetentionRecordedForSession:!1,recordRetentionTimerId:null,retryRecordRetentionTimerId:null,retryIntervalSecs:300,networkErrorTimerId:null,colors:o,locs:i,fonts:r,notificationsPaused:!0,notifications:[],visibleNotification:null,unreadMessageCount:0,unansweredMessageCount:0,previousPath:null,previousConfig:null,nonce:null,keyboardHeight:0,disableInsets:!1}}();function D(){return{body:void 0}}function B(){return A}var M=function(e,n){return e===n||Boolean(e&&n&&"object"==typeof e&&"object"==typeof n&&Object.keys(e).length===Object.keys(n).length&&Object.entries(e).every((function(e){var t=e[0],o=e[1];return M(o,n[t])})))};function H(e){var n,t=e.iframe,o=e.content,i=null===(n=t.contentWindow)||void 0===n?void 0:n.document;i&&(i.open(),i.write(o),i.close())}function F(e){return"".concat(e.r,", ").concat(e.g,", ").concat(e.b)}function j(e){var n,t,o,i;return e.template.replace(/PLATFORM_PLACEHOLDER/g,y).replace(/INSET_TOP_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-top, 0px)").replace(/INSET_BOTTOM_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)").replace(/INSET_LEFT_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-left, 0px)").replace(/INSET_RIGHT_PLACEHOLDER/g,N.disableInsets?"0px":"env(safe-area-inset-right, 0px)").replace(/CSS_TEXT_PLACEHOLDER/g,F(N.colors.text)).replace(/CSS_BORDER_PLACEHOLDER/g,F(N.colors.border)).replace(/CSS_BACKGROUND_PLACEHOLDER/g,F(N.colors.background)).replace(/CSS_TILE_PLACEHOLDER/g,F(N.colors.tile)).replace(/CSS_ACCENT_PLACEHOLDER/g,F(N.colors.accent)).replace(/CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER/g,F(N.colors.notificationBackground)).replace(/CSS_NOTIFICATION_TEXT_PLACEHOLDER/g,F(N.colors.notificationText)).replace(/CSS_FONT_SIZE_PLACEHOLDER/g,"game"===N.mode?"16px":"14px").replace(/CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER/g,null!==(t=null===(n=N.fonts.body)||void 0===n?void 0:n.regular)&&void 0!==t?t:I).replace(/CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER/g,null!==(i=null===(o=N.fonts.body)||void 0===o?void 0:o.fallback)&&void 0!==i?i:"ui-sans-serif, system-ui, sans-serif").replace(/NONCE_ATTR_PLACEHOLDER/g,N.nonce?'nonce="'.concat(N.nonce,'"'):"")}var U=function(e,n,t){return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];try{return n.apply(void 0,o)}catch(n){return console.error("Error in ".concat(e),n),t}}},q='<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="utf-8" />\n <meta name="viewport"\n content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n <meta name="theme-color" content="#000000" />\n <meta name="robots" content="noindex" />\n <title>Theymes</title>\n <style NONCE_ATTR_PLACEHOLDER>\n @font-face {\n font-family: \'TheymesBody\';\n src: CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER;\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n\n * {\n box-sizing: border-box;\n }\n\n html {\n font-family: \'TheymesBody\', CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER;\n }\n\n html,\n body {\n width: 100%;\n height: auto;\n margin: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n touch-action: none;\n }\n\n .close-button svg {\n display: block;\n stroke: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n width: 1.25rem;\n height: 1.25rem;\n }\n\n .notification {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background: rgb(CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER);\n width: 100%;\n height: auto;\n margin: 0;\n padding: 12px;\n border-radius: 6px;\n color: rgb(CSS_NOTIFICATION_TEXT_PLACEHOLDER);\n }\n\n .notification-text {\n flex: 1 0 0%;\n font-size: 0.875rem;\n /* 14/16 */\n line-height: 1.2;\n display: -webkit-box;\n line-clamp: 2;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n\n .close-button {\n flex: 0 0 auto;\n padding-left: 10px;\n cursor: pointer;\n }\n </style>\n</head>\n\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div class="notification">\n <div class="notification-text">NOTIFICATION_TEXT_PLACEHOLDER</div>\n <div class="close-button">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6 6 18"></path>\n <path d="m6 6 12 12"></path>\n </svg>\n </div>\n </div>\n <script NONCE_ATTR_PLACEHOLDER>\n function closeNotification() {\n parent.postMessage({ action: \'theymes.closeNotification\' }, \'*\');\n }\n\n function notificationClicked() {\n parent.postMessage({ action: \'theymes.handleNotificationAction\' }, \'*\');\n }\n\n document.querySelector(\'.notification-text\').addEventListener(\'click\', notificationClicked);\n document.querySelector(\'.close-button\').addEventListener(\'click\', closeNotification);\n <\/script>\n</body>\n\n</html>',W=/(android|bb\d+|meego).+mobile|armv7l|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|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,G=/CrOS/,Y=/android|ipad|playbook|silk/i;function z(){return!!function(e){e||(e={});var n=e.ua;if(n||"undefined"==typeof navigator||(n=navigator.userAgent),n&&n.headers&&"string"==typeof n.headers["user-agent"]&&(n=n.headers["user-agent"]),"string"!=typeof n)return!1;var t=W.test(n)&&!G.test(n)||!!e.tablet&&Y.test(n);return!t&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==n.indexOf("Macintosh")&&-1!==n.indexOf("Safari")&&(t=!0),t}({tablet:!0})&&(window.innerWidth<E||window.innerHeight<E)}function J(e){var n=e.type,t=N.position,o=N.x,i=N.y;return z()&&"widget"===n?{top:"0",left:"0",right:"0",bottom:"0"}:"top-left"===t?{top:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",bottom:"auto"}:"top-right"===t?{top:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",bottom:"auto"}:"bottom-left"===t?{bottom:"".concat(o,"px"),left:"".concat(i,"px"),right:"auto",top:"auto"}:{bottom:"".concat(o,"px"),right:"".concat(i,"px"),left:"auto",top:"auto"}}function K(){return z()?{width:"100%",height:"100%",maxWidth:"none",maxHeight:"none"}:{width:"".concat(w,"px"),height:"".concat(S,"px"),maxWidth:"none",maxHeight:"calc(100vh - ".concat(2*N.y,"px)")}}function X(e){var n=document.querySelector(b.sdkButtonIframe);if(n)var t=setInterval((function(){var o,i;"complete"===(null===(o=n.contentDocument)||void 0===o?void 0:o.readyState)&&(clearInterval(t),null===(i=null==n?void 0:n.contentWindow)||void 0===i||i.postMessage(e,"*"))}),100)}function V(){var e,n,t=N.notifications[0];if(t&&!N.visibleNotification){N.visibleNotification=t;var o=null!==(e=document.querySelector(b.notificationDialog))&&void 0!==e?e:document.createElement("div");o.id=b.notificationDialog.replace("#",""),o.style.position="fixed",o.style.border="none",o.style.margin="0",o.style.padding="0",o.style.zIndex="9999",o.style.colorScheme="auto",o.style.backgroundColor="transparent",o.style.pointerEvents="none",o.style.overflow="hidden",document.body.appendChild(o);var i,r=null!==(n=o.querySelector(b.notificationIframe))&&void 0!==n?n:document.createElement("iframe");r.id=b.notificationIframe.replace("#",""),r.style.position="absolute",r.style.border="none",r.style.width="0",r.style.height="0",r.style.top="-20px",r.style.left="0",r.style.colorScheme="auto",r.style.pointerEvents="auto",r.style.marginTop="-20px",r.style.opacity="0",r.style.transition="opacity ".concat(O,"s ease-in-out, margin-top ").concat(O,"s ease-in-out"),o.appendChild(r),H({iframe:r,content:(i={text:t.text},j({template:q}).replace(/NOTIFICATION_TEXT_PLACEHOLDER/g,i.text))}),setTimeout((function(){r.style.opacity="1",r.style.marginTop="0px",Z()}),500),t.closeAfterSeconds>0&&setTimeout((function(){Q({notification:t})}),1e3*t.closeAfterSeconds)}}function Z(){var e,n,t,o=document.querySelector(b.notificationDialog),i=document.querySelector(b.notificationIframe);if(o&&i){var r=(null===(t=null===(n=null===(e=i.contentWindow)||void 0===e?void 0:e.document)||void 0===n?void 0:n.body)||void 0===t?void 0:t.scrollHeight)?"".concat(i.contentWindow.document.body.scrollHeight,"px"):"0";if("widget"===N.mode){var a=J({type:"widget"}),s=K(),l="calc(".concat(s.width," - 20px)");o.style.bottom=a.bottom,o.style.right=a.right,o.style.left=a.left,o.style.top=a.top,o.style.overflow="hidden",i.style.width=l}else if(N.element){var c=N.element.getBoundingClientRect();l="".concat(c.width-20,"px");o.style.top="".concat(c.top,"px"),o.style.left="".concat(c.left,"px"),o.style.right="".concat(c.right,"px"),o.style.bottom="".concat(c.bottom,"px"),o.style.overflow="hidden",i.style.width=l}else{l="calc(100% - 20px)";o.style.top=N.disableInsets?"0px":"env(safe-area-inset-top, 0px)",o.style.left=N.disableInsets?"0px":"env(safe-area-inset-left, 0px)",o.style.right=N.disableInsets?"0px":"env(safe-area-inset-right, 0px)",o.style.bottom=N.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)",o.style.overflow="visible",i.style.width=l}i.style.height=r,i.style.top="10px",i.style.left="10px"}}function Q(e){if(e.notification&&N.visibleNotification===e.notification){var n=document.querySelector(b.notificationIframe),t=document.querySelector(b.notificationDialog);n&&(n.style.opacity="0",n.style.marginTop="-20px",setTimeout((function(){null==t||t.remove(),N.notifications=N.notifications.slice(1),N.visibleNotification=null,V()}),1e3*O))}}var $=function(){function e(){Object.defineProperty(this,"isRunning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pollWhenNotificationsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"lastPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nextPollDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.resumeIfNeeded(!1)}return Object.defineProperty(e.prototype,"onIsInForegroundChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){N.isInForeground?this.resumeIfNeeded(!1):this.pauseIfNeeded()}}),Object.defineProperty(e.prototype,"onHasNetworkConnectivityChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!1)}}),Object.defineProperty(e.prototype,"resume",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.isRunning=!0;var n=new Date;if(this.nextPollDate&&!e||(this.nextPollDate=new Date(n.getTime()+1e3)),n>=this.nextPollDate)this.pollEventsRequest();else{var t=(this.nextPollDate.getTime()-n.getTime())/1e3;this.scheduleNextPollEventsRequest(t)}}}),Object.defineProperty(e.prototype,"pause",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning=!1,this.timer&&(clearTimeout(this.timer),this.timer=null)}}),Object.defineProperty(e.prototype,"shouldBeRunning",{enumerable:!1,configurable:!0,writable:!0,value:function(){return N.isLoggedIn&&N.isInForeground&&N.hasNetworkConnectivity&&!N.sdkIsOpen}}),Object.defineProperty(e.prototype,"resumeIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(e){!this.shouldBeRunning()||this.isRunning&&!e||this.resume(e)}}),Object.defineProperty(e.prototype,"pauseIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&!this.shouldBeRunning()&&this.pause()}}),Object.defineProperty(e.prototype,"onEnableNotifications",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isRunning&&this.pollWhenNotificationsEnabled&&this.scheduleNextPollEventsRequest(0)}}),Object.defineProperty(e.prototype,"onOpen",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(e.prototype,"onClose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(e.prototype,"onLogin",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.resumeIfNeeded(!0)}}),Object.defineProperty(e.prototype,"onLogout",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.pauseIfNeeded()}}),Object.defineProperty(e.prototype,"scheduleNextPollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this;this.nextPollDate=new Date(Date.now()+1e3*e),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){n.timer=null,n.pollEventsRequest()}),1e3*e)}}),Object.defineProperty(e.prototype,"pollEventsRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(){return t(this,void 0,void 0,(function(){var e,t,r,a,s,c,d,u,g;return o(this,(function(o){switch(o.label){case 0:if(!N.token||!N.domain||!N.deviceId)return[2];if(!this.isRunning)return[2];if(this.lastPollDate&&(e=new Date(this.lastPollDate.getTime()+6e4),(t=(e.getTime()-Date.now())/1e3)>0))return this.scheduleNextPollEventsRequest(t),[2];this.lastPollDate=new Date,r=N.notificationsPaused||N.sdkIsOpen?"true":"false",a=new URLSearchParams(n(n({token:N.token,language:null!==(u=N.language)&&void 0!==u?u:"en",deviceId:N.deviceId,notificationsPaused:r,mode:N.mode},(null===(g=N.player)||void 0===g?void 0:g.id)?{unsignedPlayerId:N.player.id}:{}),N.signedMetadataToken?{signedMetadataToken:N.signedMetadataToken}:{})).toString(),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch("https://".concat(N.domain,"/api/sdk/events?").concat(a),{method:"GET"})];case 2:if(!(s=o.sent()).ok)throw new Error("HTTP error! status: ".concat(s.status));return[4,s.json()];case 3:return c=o.sent(),this.scheduleNextPollEventsRequest(c.nextPollSeconds),void 0!==c.pollWhenNotificationsEnabled&&(this.pollWhenNotificationsEnabled=c.pollWhenNotificationsEnabled),N.notifications=i(i([],N.notifications,!0),c.notifications,!0),N.notifications.length>0&&V(),c.unansweredMessageCount!==N.unansweredMessageCount&&(N.unansweredMessageCount=c.unansweredMessageCount,l("unansweredMessageCountUpdate",[c.unansweredMessageCount])),c.unreadMessageCount!==N.unreadMessageCount&&(N.unreadMessageCount=c.unreadMessageCount,l("unreadMessageCountUpdate",[c.unreadMessageCount]),X({action:"unreadMessageCountUpdate",count:c.unreadMessageCount})),[3,5];case 4:return d=o.sent(),console.error("Error fetching events:",d),this.scheduleNextPollEventsRequest(N.retryIntervalSecs),[3,5];case 5:return[2]}}))}))}}),e}(),ee={eventPoller:null},ne=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onLogin()},te=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onLogout()},oe=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onOpen()},ie=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onClose()},re=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onEnableNotifications()},ae=function(){var e;null===(e=ee.eventPoller)||void 0===e||e.onIsInForegroundChanged()},se=function(e){var n="/help-center";pe({path:n,config:e}),fe({path:n,config:e})},le=function(e){var n="/assistant";pe({path:n,config:e}),fe({path:n,config:e})},ce=function(){!function(){var e=document.querySelector(b.sdkDialog),n=document.querySelector(b.sdkIframeWrapper);if(e){var t=function(){"widget"!==N.mode||N.forceUpdateSdkDialog?e.remove():e.style.display="none",N.forceUpdateSdkDialog=!1};n?(n.style.opacity="0",n.style.transform=be({animation:"start"}),setTimeout((function(){t()}),1e3*k)):t()}N.widgetButton&&ye();l("close",[])}()},de=function(){try{return CSS.supports("color","var(--color)")&&CSS.supports("color","rgb(255 255 255 / 0.5)")}catch(e){return!1}},ue=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];a.apply(void 0,e)};function ge(e){var t,o,r,a,s,l,c=(null!=e?e:{}).config;if(!N.token||!N.domain||!N.deviceId)return null;var d=null!==(t=null==c?void 0:c.tags)&&void 0!==t?t:[],u=null!==(o=null==c?void 0:c.fields)&&void 0!==o?o:{},f=null!==(a=null!==(r=null==c?void 0:c.language)&&void 0!==r?r:N.language)&&void 0!==a?a:null,p=null!==(s=N.signedMetadataToken)&&void 0!==s?s:null,m=null!==(l=N.player)&&void 0!==l?l:null,h={_platform:y,_sdkVersion:g};N.youngPlayer&&(h._youngPlayer=!0),(N.privacyMode||N.youngPlayer)&&(h._privacyMode=!0);var v=i(i([],Array.from(N.tags),!0),d,!0),b=n(n(n({},N.fields),u),h);return{token:N.token,domain:N.domain,deviceId:N.deviceId,tags:v,fields:b,language:f,signedMetadataToken:p,player:m}}function fe(e){var n,t,o,i=ge({config:e.config});if(i){var r=null!==(n=document.querySelector(b.sdkDialog))&&void 0!==n?n:document.createElement("div");r.id=b.sdkDialog.replace("#",""),r.style.display="block",r.style.position="fixed",r.style.border="none",r.style.width="0",r.style.height="0",r.style.margin="0",r.style.padding="0",r.style.zIndex="9998",r.style.overflow="hidden",r.style.backgroundColor="transparent";var a=null!==(t=r.querySelector(b.sdkIframeWrapper))&&void 0!==t?t:document.createElement("div");a.id=b.sdkIframeWrapper.replace("#",""),a.style.position="relative",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.right="0",a.style.bottom="0",a.style.left="0",a.style.opacity="0",a.style.colorScheme="auto",a.style.border="none",a.style.backgroundColor="rgb(".concat(F(N.colors.background),")"),a.style.transform=be({animation:"start"}),a.style.transition=(N.mode,"opacity ".concat(k,"s ease-in-out, transform ").concat(k,"s ease-in-out")),"widget"===N.mode&&(a.style.overflow="hidden");var s=null!==(o=a.querySelector(b.sdkLoaderIframe))&&void 0!==o?o:document.createElement("iframe");s.id=b.sdkLoaderIframe.replace("#",""),s.style.position="absolute",s.style.border="none",s.style.width="100%",s.style.height="100%",s.style.top="0",s.style.right="0",s.style.bottom="0",s.style.left="0",s.style.colorScheme="auto";var u=a.querySelector(b.sdkIframe),g=null!=u?u:document.createElement("iframe"),f=setInterval((function(){var e;"complete"===(null===(e=g.contentDocument)||void 0===e?void 0:e.readyState)&&(clearInterval(f),m())}),500);g.id=b.sdkIframe.replace("#",""),g.style.position="absolute",g.style.border="none",g.style.top="0",g.style.right="0",g.style.bottom="0",g.style.left="0",g.style.colorScheme="auto",u&&!N.networkErrorTimerId||(g.src=function(e){var n=e.path,t=e.supportViewConfig,o="https://".concat(N.domain,"/sdk"),i=new URLSearchParams;i.set("platform",y),i.set("token",t.token),i.set("deviceId",t.deviceId),i.set("mode",N.mode),i.set("origin",window.location.origin),i.set("userLanguage",N.userLanguage),N.disableInsets&&i.set("disableInsets","true");t.language&&i.set("language",t.language);de()||i.set("unsupported","true");var r=he({supportViewConfig:t});return i.set("metadata",JSON.stringify(r)),"".concat(o).concat(n,"?").concat(i.toString())}({path:e.path,supportViewConfig:i}),g.style.width="0",g.style.height="0",r.appendChild(a),a.appendChild(s),a.appendChild(g),document.body.appendChild(r)),H({iframe:s,content:j({template:c})});var p=!1,m=function(){p||(p=!0,N.networkErrorTimerId=setTimeout((function(){H({iframe:s,content:j({template:d})})}),1e4))};g.onload=m,g.onerror=function(){H({iframe:s,content:j({template:d})})},ve(),l("open",[]),setTimeout((function(){a.style.opacity="1",a.style.transform=be({animation:"end"})}),100)}}function pe(e){var n=e.path,t=e.config,o=null!=t?t:null;N.previousPath===n&&M(N.previousConfig,o)||(N.previousPath=n,N.previousConfig=o,me())}function me(){var e=document.querySelector(b.sdkDialog);N.sdkIsOpen?N.forceUpdateSdkDialog=!0:null==e||e.remove()}function he(e){var n=e.supportViewConfig,t={unsigned:{},signed:void 0};return n.player&&(t.unsigned.player=n.player),n.tags&&(t.unsigned.tags=n.tags),n.fields&&(t.unsigned.fields=n.fields),n.signedMetadataToken&&(t.signed=n.signedMetadataToken),t}function ve(){var e=document.querySelector(b.sdkDialog),n=document.querySelector(b.sdkIframeWrapper);if(e&&n)if("widget"===N.mode){var t=J({type:"widget"}),o=K();e.style.width=o.width,e.style.height=o.height,e.style.maxWidth=o.maxWidth,e.style.maxHeight=o.maxHeight,e.style.bottom=t.bottom,e.style.right=t.right,e.style.left=t.left,e.style.top=t.top,z()?(n.style.border="none",n.style.borderRadius="0"):(n.style.border="1px solid rgb(".concat(F(N.colors.border),")"),n.style.borderRadius="10px")}else if(n.style.border="none",n.style.borderRadius="0",N.element){var i=N.element.getBoundingClientRect(),r=i.width,a=i.height,s=i.top,l=i.left,c=i.right,d=i.bottom;e.style.width="".concat(r,"px"),e.style.height="".concat(a,"px"),e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="".concat(s,"px"),e.style.left="".concat(l,"px"),e.style.right="".concat(c,"px"),e.style.bottom="".concat(d,"px")}else{a=N.keyboardHeight>0?"calc(100% - ".concat(N.keyboardHeight,"px + env(safe-area-inset-bottom) - 10px)"):"100%";e.style.width="100%",e.style.height=a,e.style.maxWidth="none",e.style.maxHeight="none",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0"}}function ye(){var e,n=null!==(e=document.querySelector(b.sdkButtonIframe))&&void 0!==e?e:document.createElement("iframe");if(n){var t,o=J({type:"button"});n.id=b.sdkButtonIframe.replace("#",""),n.style.position="fixed",n.style.border="none",n.style.width="".concat(x,"px"),n.style.height="".concat(T,"px"),n.style.maxWidth="95%",n.style.maxHeight="95%",n.style.bottom=o.bottom,n.style.right=o.right,n.style.left=o.left,n.style.top=o.top,n.style.margin="0",n.style.padding="0",n.style.zIndex="9997",n.style.backgroundColor="transparent",n.style.opacity="0",n.style.transform="scale(0.8)",n.style.transition="opacity ".concat(C,"s ease-in-out, transform ").concat(C,"s ease-in-out"),setTimeout((function(){n.style.opacity="1",n.style.transform="scale(1)"}),100),document.body.appendChild(n),H({iframe:n,content:(t={unreadMessageCount:N.unreadMessageCount},j({template:u}).replace(/UNREAD_MESSAGE_COUNT_PLACEHOLDER/g,"".concat(t.unreadMessageCount)).replace(/CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER/g,F(N.colors.widgetButtonBackground)).replace(/CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER/g,F(N.colors.widgetButtonText)).replace(/CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER/g,F(N.colors.widgetButtonActionPending)).replace(/WIDGET_BUTTON_TEXT_PLACEHOLDER/g,Ce()))})}}function be(e){return"start"===e.animation?"game"===N.mode?"translateY(20%)":"scale(0.8)":"game"===N.mode?"translateY(0)":"scale(1)"}function we(e){return t(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,7]),[4,e.json()];case 1:return[2,n.sent()];case 2:n.sent(),n.label=3;case 3:return n.trys.push([3,5,,6]),[4,e.text()];case 4:return[2,n.sent()];case 5:return n.sent(),[2,void 0];case 6:return[3,7];case 7:return[2]}}))}))}function Se(){return t(this,void 0,void 0,(function(){var e,n,t,i,r,a;return o(this,(function(o){switch(o.label){case 0:if(Te(),N.retryRecordRetentionTimerId&&(clearTimeout(N.retryRecordRetentionTimerId),N.retryRecordRetentionTimerId=null),N.retentionRemainingSeconds=null,N.isRetentionRecordedForSession=!0,!(e=ge()))return[2];n="https://".concat(N.domain,"/api/sdk/retention"),t=he({supportViewConfig:e}),i={token:N.token,deviceId:N.deviceId,language:N.language,metadata:t},o.label=1;case 1:return o.trys.push([1,5,,6]),[4,fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})];case 2:return(r=o.sent()).ok?[3,4]:[4,we(r)];case 3:throw o.sent();case 4:return[3,6];case 5:return a=o.sent(),console.error("Error tracking retention:",a),N.retryRecordRetentionTimerId=setTimeout(Se,6e4),[3,6];case 6:return[2]}}))}))}function Ee(){var e=new Date;if(N.sessionStatus="active",N.sessionResumeOrStartTime=e,N.sessionStartTime){var n=N.sessionStartTime.valueOf()/1e3+N.resetSessionAfterSecs;Date.now()/1e3>n&&xe()}else xe();null!==N.retentionRemainingSeconds&&(N.recordRetentionTimerId=setTimeout(Se,1e3*N.retentionRemainingSeconds))}function xe(){N.sessionStartTime=new Date,N.retentionRemainingSeconds=N.recordRetentionAfterSecs,N.isRetentionRecordedForSession=!1,Te()}function Te(){N.recordRetentionTimerId&&(clearTimeout(N.recordRetentionTimerId),N.recordRetentionTimerId=null)}function ke(){N.isRetentionRecordedForSession&&Se()}function Ce(){var e,n,t;return null!==(t=null===(e=N.locs.widgetButtonText)||void 0===e?void 0:e[null!==(n=N.language)&&void 0!==n?n:"en"])&&void 0!==t?t:"Support"}function Oe(){var e=N.isInForeground,n="visible"===document.visibilityState&&document.hasFocus();N.isInForeground=n,e!==n&&ae(),n&&"paused"===N.sessionStatus?Ee():n||"active"!==N.sessionStatus||function(){if(N.sessionResumeOrStartTime&&N.retentionRemainingSeconds){var e=Math.floor((Date.now()-N.sessionResumeOrStartTime.valueOf())/1e3);N.retentionRemainingSeconds-=e}N.sessionStatus="paused",Te()}()}function Le(){var e,n=N.isLoggedIn,t=Boolean(N.signedMetadataToken||(null===(e=N.player)||void 0===e?void 0:e.id));N.isLoggedIn=t,t&&!n?ne():!t&&n&&te()}try{document.addEventListener("visibilitychange",Oe),window.addEventListener("focus",Oe),window.addEventListener("blur",Oe),window.addEventListener("resize",ve),window.addEventListener("resize",Z),window.addEventListener("message",(function(e){if("theymes.ready"===e.data.action){var n=document.querySelector(b.sdkLoaderIframe),t=document.querySelector(b.sdkIframe);N.networkErrorTimerId&&(clearTimeout(N.networkErrorTimerId),N.networkErrorTimerId=null),t&&(t.style.width="100%",t.style.height="100%"),n&&n.remove()}else if("theymes.close"===e.data.action)ce();else if("theymes.closeNotification"===e.data.action)Q({notification:N.visibleNotification});else if("theymes.handleNotificationAction"===e.data.action)r={notification:N.visibleNotification},(null==(a=r.notification)?void 0:a.action)&&"OPEN_PAGE"===a.action.type&&(fe({path:a.action.path}),Q({notification:a}));else if("theymes.sdkButtonClicked"===e.data.action)(i=document.querySelector(b.sdkButtonIframe))&&(i.style.opacity="0",i.style.transform="scale(0.8)",setTimeout((function(){i.remove()}),1e3*C)),"support"===N.widgetButtonAction?se():"assistant"===N.widgetButtonAction&&le();else if("theymes.openExternalPage"===e.data.action){var o=e.data.target;"_self"===o&&function(e){var n=e.key,t=e.value,o=e.ttlMs,i=e.storage,r=void 0===i?P:i,a={value:t,expiry:Date.now()+o};r.setItem(n,JSON.stringify(a))}({key:L,value:e.data.path,ttlMs:6e5}),window.open(e.data.url,o)}var i,r,a}),!1),ue("open",(function(){N.sdkIsOpen=!0,oe()})),ue("close",(function(){N.sdkIsOpen=!1,ie()}))}catch(e){console.error("Error adding event listeners to SDK",e)}var Ie=U("initialize",(function(e,i,r){return t(void 0,void 0,void 0,(function(){var t,a,s,l,c,d,u,g,b,w,S,E,x,T;return o(this,(function(o){switch(o.label){case 0:if(!e||!i||!r.mode)throw new Error("Token, domain, and mode are required");N.token=e,N.domain=i,N.mode=r.mode,N.element="element"in r&&void 0!==r.element?r.element:N.element,N.language=null!==(u=r.language)&&void 0!==u?u:N.language,N.nonce=null!==(g=r.nonce)&&void 0!==g?g:N.nonce,N.deviceId=function(){var e=_("deviceId");if(e)return e;var n=(t=Date.now(),"undefined"!=typeof performance&&"function"==typeof performance.now&&(t+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})));return R("deviceId",n),n;var t}(),N.widgetButton="button"in r&&void 0!==r.button&&null!==(b=r.button)&&void 0!==b?b:N.widgetButton,N.widgetButtonAction="buttonAction"in r&&void 0!==r.buttonAction&&null!==(w=r.buttonAction)&&void 0!==w?w:N.widgetButtonAction,N.position="position"in r&&void 0!==r.position&&null!==(S=r.position)&&void 0!==S?S:N.position,N.x="x"in r&&void 0!==r.x?r.x:N.x,N.y="y"in r&&void 0!==r.y?r.y:N.y,N.disableInsets="game"===N.mode&&null!==N.element,ee.eventPoller||(ee.eventPoller=new $),t="https://".concat(i,"/api/sdk/settings"),a=new URLSearchParams({token:N.token,platform:y,mode:N.mode}).toString(),o.label=1;case 1:return o.trys.push([1,6,,7]),[4,fetch("".concat(t,"?").concat(a),{method:"GET"})];case 2:return(s=o.sent()).ok?[3,4]:[4,we(s)];case 3:throw o.sent();case 4:return[4,s.json()];case 5:return l=o.sent(),(null===(E=null==l?void 0:l.branding)||void 0===E?void 0:E.colors)&&(A=l.branding.colors,N.colors=n(n({},N.colors),A),R(f,JSON.stringify(N.colors))),(null===(x=null==l?void 0:l.branding)||void 0===x?void 0:x.locs)&&(I=l.branding.locs,N.locs=n(n({},N.locs),I),R(p,JSON.stringify(N.locs))),(null===(T=null==l?void 0:l.branding)||void 0===T?void 0:T.fonts)&&(O=l.branding.fonts,N.fonts=n(n({},N.fonts),O),R(m,JSON.stringify(N.fonts))),"number"!=typeof(null==l?void 0:l.recordRetentionAfterSecs)&&null!==(null==l?void 0:l.recordRetentionAfterSecs)||(C=l.recordRetentionAfterSecs,N.recordRetentionAfterSecs=C,R(h,JSON.stringify(N.recordRetentionAfterSecs))),"number"!=typeof(null==l?void 0:l.resetSessionAfterSecs)&&null!==(null==l?void 0:l.resetSessionAfterSecs)||(k=l.resetSessionAfterSecs,N.resetSessionAfterSecs=null!=k?k:B(),R(v,JSON.stringify(N.resetSessionAfterSecs))),Ee(),me(),c=function(e){var n=e.key,t=e.storage,o=void 0===t?P:t,i=e.removeItem,r=void 0!==i&&i,a=o.getItem(n);if(!a)return null;var s=JSON.parse(a);return Date.now()>s.expiry?(o.removeItem(n),null):(r&&o.removeItem(n),s.value)}({key:L,removeItem:!0}),c&&"widget"===N.mode&&!z()?fe({path:c}):N.widgetButton&&ye(),[3,7];case 6:return d=o.sent(),console.error("Error initializing SDK:",d),[3,7];case 7:return[2]}var k,C,O,I,A}))}))}),void 0),_e=U("openSupport",se,void 0),Re=U("openAssistant",le,void 0),Pe=U("openResource",(function(e,n){var t="/resources/".concat(e);pe({path:t,config:n}),fe({path:t,config:n})}),void 0),Ae=U("close",ce,void 0),Ne=U("getLanguage",(function(){return N.language}),null),De=U("setLanguage",(function(e){var n=N.language!==e;N.language=e,n&&(me(),X({action:"widgetButtonTextUpdate",text:Ce()}))}),void 0),Be=U("getSignedMetadataToken",(function(){return N.signedMetadataToken}),null),Me=U("setSignedMetadataToken",(function(e){var n=N.signedMetadataToken!==e;N.signedMetadataToken=e,Le(),n&&(me(),ke())}),void 0),He=U("getPlayer",(function(){return N.player}),null),Fe=U("setPlayer",(function(e){var n,t=(null===(n=N.player)||void 0===n?void 0:n.id)!==(null==e?void 0:e.id);N.player=e,Le(),t&&(me(),ke())}),void 0),je=U("getTags",(function(){return Array.from(N.tags)}),[]),Ue=U("setTags",(function(e){N.tags=new Set(e),me()}),void 0),qe=U("addTag",(function(e){N.tags.add(e),me()}),void 0),We=U("addTags",(function(e){e.forEach((function(e){return N.tags.add(e)})),me()}),void 0),Ge=U("removeTag",(function(e){N.tags.delete(e),me()}),void 0),Ye=U("removeTags",(function(e){e.forEach((function(e){return N.tags.delete(e)})),me()}),void 0),ze=U("removeAllTags",(function(){N.tags.clear(),me()}),void 0),Je=U("getFields",(function(){return N.fields}),{}),Ke=U("setFields",(function(e){N.fields=e,me()}),void 0),Xe=U("addField",(function(e,n){N.fields[e]=n,me()}),void 0),Ve=U("addFields",(function(e){N.fields=n(n({},N.fields),e),me()}),void 0),Ze=U("removeField",(function(e){delete N.fields[e],me()}),void 0),Qe=U("removeFields",(function(e){e.forEach((function(e){return delete N.fields[e]})),me()}),void 0),$e=U("removeAllFields",(function(){N.fields={},me()}),void 0),en=U("enableLogging",(function(){N.loggingEnabled=!0}),void 0),nn=U("disableLogging",(function(){N.loggingEnabled=!1}),void 0),tn=U("isYoungPlayer",(function(){return N.youngPlayer}),!1),on=U("setYoungPlayer",(function(e){N.youngPlayer=e,me()}),void 0),rn=U("isPrivacyMode",(function(){return N.privacyMode}),!1),an=U("setPrivacyMode",(function(e){N.privacyMode=e,me()}),void 0),sn=U("isSupported",de,!1),ln=U("requestNotificationPermission",(function(){}),void 0),cn=U("enableNotifications",(function(){N.notificationsPaused=!1,re()}),void 0),dn=U("disableNotifications",(function(){N.notificationsPaused=!0}),void 0),un=U("getUnreadMessageCount",(function(){return N.unreadMessageCount}),0),gn=U("getUnansweredMessageCount",(function(){return N.unansweredMessageCount}),0),fn=U("getSdkVersion",(function(){return g}),""),pn=U("reset",(function(){N.language=null,N.tags=new Set,N.fields={},N.signedMetadataToken=null,N.player=null,Le(),me(),X({action:"widgetButtonTextUpdate",text:Ce()})}),void 0),mn=U("recordRetention",(function(){N.isRetentionRecordedForSession||Se()}),void 0),hn=U("addEventListener",ue,void 0),vn=U("removeEventListener",(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];s.apply(void 0,e)}),void 0),yn=U("iosSetKeyboardHeight",(function(e){N.keyboardHeight=e,ve()}),void 0);e.addEventListener=hn,e.addField=Xe,e.addFields=Ve,e.addTag=qe,e.addTags=We,e.close=Ae,e.disableLogging=nn,e.disableNotifications=dn,e.enableLogging=en,e.enableNotifications=cn,e.getFields=Je,e.getLanguage=Ne,e.getPlayer=He,e.getSdkVersion=fn,e.getSignedMetadataToken=Be,e.getTags=je,e.getUnansweredMessageCount=gn,e.getUnreadMessageCount=un,e.initialize=Ie,e.iosSetKeyboardHeight=yn,e.isPrivacyMode=rn,e.isSupported=sn,e.isYoungPlayer=tn,e.openAssistant=Re,e.openResource=Pe,e.openSupport=_e,e.recordRetention=mn,e.removeAllFields=$e,e.removeAllTags=ze,e.removeEventListener=vn,e.removeField=Ze,e.removeFields=Qe,e.removeTag=Ge,e.removeTags=Ye,e.requestNotificationPermission=ln,e.reset=pn,e.setFields=Ke,e.setLanguage=De,e.setPlayer=Fe,e.setPrivacyMode=an,e.setSignedMetadataToken=Me,e.setTags=Ue,e.setYoungPlayer=on}(this.theymes=this.theymes||{});
|