@theymes/sdk 1.2.13 → 1.2.14
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.d.ts +43 -43
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.unity.js +1 -1
- package/dist/utils.d.ts +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;\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 white-space: nowrap; \n }\n\n .sdk-button-text {\n overflow: hidden;\n text-overflow: ellipsis;\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 calculateButtonSize() {\n const paddingX = 12;\n const scrollWidth = document.querySelector('.sdk-button-text').scrollWidth;\n const width = scrollWidth + (paddingX * 2);\n \n parent.postMessage({ action: 'theymes.sdkButtonSizeUpdated', width }, '*');\n }\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').innerHTML = e.data.text;\n calculateButtonSize();\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 calculateButtonSize();\n <\/script>\n</body>\n\n</html>",u="1.2.13",g="colors",p="locs",f="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,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(h);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,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!==(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=function(e){var t,n,o,i,r,a=q(null!==(t=A.language)&&void 0!==t?t:"en"),s=null===(n=A.locs[e.loc])||void 0===n?void 0:n[a];if(s)return s;var l=a.split("-")[0],c=l&&(null===(o=A.locs[e.loc])||void 0===o?void 0:o[l]);return c||(null!==(r=null===(i=A.locs[e.loc])||void 0===i?void 0:i.en)&&void 0!==r?r:null)},q=function(e){var t=e.split(/[-_]/),n=t[0],o=t[1];return n?o?"".concat(n.toLowerCase(),"-").concat(o.toUpperCase()):n.toLowerCase():"en"},W='<!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>',z=/(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 J(){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=z.test(t)&&!G.test(t)||!!e.tablet&&Y.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 K(e){var t=e.type,n=A.position,o=A.x,i=A.y;return J()&&"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 X(){return J()?{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 V(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 Z(){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:W}).replace(/NOTIFICATION_TEXT_PLACEHOLDER/g,i.text))}),setTimeout((function(){r.style.opacity="1",r.style.marginTop="0px",Q()}),500),n.closeAfterSeconds>0&&setTimeout((function(){$({notification:n})}),1e3*n.closeAfterSeconds)}}function Q(){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=K({type:"widget"}),s=X(),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 $(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,Z()}),1e3*C))}}var ee=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&&Z(),c.unansweredMessageCount!==A.unansweredMessageCount&&(A.unansweredMessageCount=c.unansweredMessageCount,s("unansweredMessageCountUpdate",[c.unansweredMessageCount])),c.unreadMessageCount!==A.unreadMessageCount&&(A.unreadMessageCount=c.unreadMessageCount,s("unreadMessageCountUpdate",[c.unreadMessageCount]),V({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}(),te={eventPoller:null},ne=function(){var e;null===(e=te.eventPoller)||void 0===e||e.onLogin()},oe=function(){var e;null===(e=te.eventPoller)||void 0===e||e.onLogout()},ie=function(){var e;null===(e=te.eventPoller)||void 0===e||e.onOpen()},re=function(){var e;null===(e=te.eventPoller)||void 0===e||e.onClose()},ae=function(){var e;null===(e=te.eventPoller)||void 0===e||e.onEnableNotifications()},se=function(){var e;null===(e=te.eventPoller)||void 0===e||e.onIsInForegroundChanged()},le=function(e){var t="/help-center";me({path:t,config:e}),fe({path:t,config:e})},ce=function(e){var t="/assistant";me({path:t,config:e}),fe({path:t,config:e})},de=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=we({animation:"start"}),setTimeout((function(){n()}),1e3*T)):n()}A.widgetButton&&be();s("close",[])}()},ue=function(){try{return CSS.supports("color","var(--color)")&&CSS.supports("color","rgb(255 255 255 / 0.5)")}catch(e){return!1}},ge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r.apply(void 0,e)};function pe(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,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:p,signedMetadataToken:f,player:m}}function fe(e){var t,n,o,i=pe({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=we({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",v),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);ue()||i.set("unsupported","true");var r=ve({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})})},ye(),s("open",[]),setTimeout((function(){a.style.opacity="1",a.style.transform=we({animation:"end"})}),100)}}function me(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,he())}function he(){var e=document.querySelector(y.sdkDialog);A.sdkIsOpen?A.forceUpdateSdkDialog=!0:null==e||e.remove()}function ve(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 ye(){var e=document.querySelector(y.sdkDialog),t=document.querySelector(y.sdkIframeWrapper);if(e&&t)if("widget"===A.mode){var n=K({type:"widget"}),o=X();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,J()?(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 be(){var e,t=null!==(e=document.querySelector(y.sdkButtonIframe))&&void 0!==e?e:document.createElement("iframe");if(t){var n,o=K({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.minWidth="".concat(S,"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,Oe()))})}}function we(e){return"start"===e.animation?"game"===A.mode?"translateY(20%)":"scale(0.8)":"game"===A.mode?"translateY(0)":"scale(1)"}function xe(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 Se(){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(ke(),A.retryRecordRetentionTimerId&&(clearTimeout(A.retryRecordRetentionTimerId),A.retryRecordRetentionTimerId=null),A.retentionRemainingSeconds=null,A.isRetentionRecordedForSession=!0,!(e=pe()))return[2];t="https://".concat(A.domain,"/api/sdk/retention"),o=ve({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,xe(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(Se,6e4),[3,6];case 6:return[2]}}))}))}function Ee(){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&&Te()}else Te();null!==A.retentionRemainingSeconds&&(A.recordRetentionTimerId=setTimeout(Se,1e3*A.retentionRemainingSeconds))}function Te(){A.sessionStartTime=new Date,A.retentionRemainingSeconds=A.recordRetentionAfterSecs,A.isRetentionRecordedForSession=!1,ke()}function ke(){A.recordRetentionTimerId&&(clearTimeout(A.recordRetentionTimerId),A.recordRetentionTimerId=null)}function Ce(){A.isRetentionRecordedForSession&&Se()}function Oe(){var e;return function(e){var t=e.split(" ");if(e.length<=16||t.length<=1)return e;for(var n=t.map((function(e){return e.length})),i=[],r=1;r<n.length;r++){var a=n.slice(0,r),s=n.slice(r),l=a.reduce((function(e,t){return e+t}),0),c=s.reduce((function(e,t){return e+t}),0),d=Math.abs(l-c);i.push(d)}var u=Math.min.apply(Math,i),g=i.indexOf(u);return o(o(o([],t.slice(0,g+1),!0),["<br>"],!1),t.slice(g+1),!0).join(" ")}(null!==(e=U({loc:"widgetButtonText"}))&&void 0!==e?e:"Support")}function Le(){var e=A.isInForeground,t="visible"===document.visibilityState&&document.hasFocus();A.isInForeground=t,e!==t&&se(),t&&"paused"===A.sessionStatus?Ee():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",ke()}()}function Ie(){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?ne():!n&&t&&oe()}try{document.addEventListener("visibilitychange",Le),window.addEventListener("focus",Le),window.addEventListener("blur",Le),window.addEventListener("resize",ye),window.addEventListener("resize",Q),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)de();else if("theymes.closeNotification"===e.data.action)$({notification:A.visibleNotification});else if("theymes.handleNotificationAction"===e.data.action)a={notification:A.visibleNotification},(null==(s=a.notification)?void 0:s.action)&&"OPEN_PAGE"===s.action.type&&(fe({path:s.action.path}),$({notification:s}));else if("theymes.sdkButtonClicked"===e.data.action)(r=document.querySelector(y.sdkButtonIframe))&&(r.style.opacity="0",r.style.transform="scale(0.8)",setTimeout((function(){r.remove()}),1e3*k)),"support"===A.widgetButtonAction?le():"assistant"===A.widgetButtonAction&&ce();else if("theymes.sdkButtonSizeUpdated"===e.data.action){var o=document.querySelector(y.sdkButtonIframe);o&&(o.style.width="".concat(e.data.width,"px"))}else if("theymes.openExternalPage"===e.data.action){var i=e.data.target;"_self"===i&&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,i)}var r,a,s}),!1),ge("open",(function(){A.sdkIsOpen=!0,ie()})),ge("close",(function(){A.sdkIsOpen=!1,re()}))}catch(e){console.error("Error adding event listeners to SDK",e)}var _e=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,te.eventPoller||(te.eventPoller=new ee),t="https://".concat(i,"/api/sdk/settings"),a=new URLSearchParams({token:A.token,platform:v,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,xe(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(),_(h,JSON.stringify(A.resetSessionAfterSecs))),Ee(),he(),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&&!J()?fe({path:c}):A.widgetButton&&be(),[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),Re=j("openSupport",le,void 0),Pe=j("openAssistant",ce,void 0),Ae=j("openResource",(function(e,t){var n="/resources/".concat(e);me({path:n,config:t}),fe({path:n,config:t})}),void 0),Ne=j("close",de,void 0),De=j("getLanguage",(function(){return A.language}),null),Be=j("setLanguage",(function(e){var t=A.language!==e;A.language=e,t&&(he(),V({action:"widgetButtonTextUpdate",text:Oe()}))}),void 0),Me=j("getSignedMetadataToken",(function(){return A.signedMetadataToken}),null),He=j("setSignedMetadataToken",(function(e){var t=A.signedMetadataToken!==e;A.signedMetadataToken=e,Ie(),t&&(he(),Ce())}),void 0),Fe=j("getPlayer",(function(){return A.player}),null),je=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,Ie(),n&&(he(),Ce())}),void 0),Ue=j("getTags",(function(){return Array.from(A.tags)}),[]),qe=j("setTags",(function(e){A.tags=new Set(e),he()}),void 0),We=j("addTag",(function(e){A.tags.add(e),he()}),void 0),ze=j("addTags",(function(e){e.forEach((function(e){return A.tags.add(e)})),he()}),void 0),Ge=j("removeTag",(function(e){A.tags.delete(e),he()}),void 0),Ye=j("removeTags",(function(e){e.forEach((function(e){return A.tags.delete(e)})),he()}),void 0),Je=j("removeAllTags",(function(){A.tags.clear(),he()}),void 0),Ke=j("getFields",(function(){return A.fields}),{}),Xe=j("setFields",(function(e){A.fields=e,he()}),void 0),Ve=j("addField",(function(e,t){A.fields[e]=t,he()}),void 0),Ze=j("addFields",(function(t){A.fields=e(e({},A.fields),t),he()}),void 0),Qe=j("removeField",(function(e){delete A.fields[e],he()}),void 0),$e=j("removeFields",(function(e){e.forEach((function(e){return delete A.fields[e]})),he()}),void 0),et=j("removeAllFields",(function(){A.fields={},he()}),void 0),tt=j("enableLogging",(function(){A.loggingEnabled=!0}),void 0),nt=j("disableLogging",(function(){A.loggingEnabled=!1}),void 0),ot=j("isYoungPlayer",(function(){return A.youngPlayer}),!1),it=j("setYoungPlayer",(function(e){A.youngPlayer=e,he()}),void 0),rt=j("isPrivacyMode",(function(){return A.privacyMode}),!1),at=j("setPrivacyMode",(function(e){A.privacyMode=e,he()}),void 0),st=j("isSupported",ue,!1),lt=j("requestNotificationPermission",(function(){}),void 0),ct=j("enableNotifications",(function(){A.notificationsPaused=!1,ae()}),void 0),dt=j("disableNotifications",(function(){A.notificationsPaused=!0}),void 0),ut=j("getUnreadMessageCount",(function(){return A.unreadMessageCount}),0),gt=j("getUnansweredMessageCount",(function(){return A.unansweredMessageCount}),0),pt=j("getSdkVersion",(function(){return u}),""),ft=j("reset",(function(){A.language=null,A.tags=new Set,A.fields={},A.signedMetadataToken=null,A.player=null,Ie(),he(),V({action:"widgetButtonTextUpdate",text:Oe()})}),void 0),mt=j("recordRetention",(function(){A.isRetentionRecordedForSession||Se()}),void 0),ht=j("addEventListener",ge,void 0),vt=j("removeEventListener",(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a.apply(void 0,e)}),void 0),yt=j("iosSetKeyboardHeight",(function(e){A.keyboardHeight=e,ye()}),void 0);exports.addEventListener=ht,exports.addField=Ve,exports.addFields=Ze,exports.addTag=We,exports.addTags=ze,exports.close=Ne,exports.disableLogging=nt,exports.disableNotifications=dt,exports.enableLogging=tt,exports.enableNotifications=ct,exports.getFields=Ke,exports.getLanguage=De,exports.getPlayer=Fe,exports.getSdkVersion=pt,exports.getSignedMetadataToken=Me,exports.getTags=Ue,exports.getUnansweredMessageCount=gt,exports.getUnreadMessageCount=ut,exports.initialize=_e,exports.iosSetKeyboardHeight=yt,exports.isPrivacyMode=rt,exports.isSupported=st,exports.isYoungPlayer=ot,exports.openAssistant=Pe,exports.openResource=Ae,exports.openSupport=Re,exports.recordRetention=mt,exports.removeAllFields=et,exports.removeAllTags=Je,exports.removeEventListener=vt,exports.removeField=Qe,exports.removeFields=$e,exports.removeTag=Ge,exports.removeTags=Ye,exports.requestNotificationPermission=lt,exports.reset=ft,exports.setFields=Xe,exports.setLanguage=Be,exports.setPlayer=je,exports.setPrivacyMode=at,exports.setSignedMetadataToken=He,exports.setTags=qe,exports.setYoungPlayer=it;
|
|
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 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>',c="1.2.14",d="colors",u="locs",g="fonts",p="recordRetentionAfterSecs",f="resetSessionAfterSecs",m="web",h={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"},v=.2,y="theymes_path_on_init",b=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}},w=function(e,t){try{null===localStorage||void 0===localStorage||localStorage.setItem(e,t)}catch(e){}},x={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}}},S=function(){var t=null,n=28800,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=E();try{t=function(){var e=b(p);if(e){var t=JSON.parse(e);if("number"==typeof t)return t}return null}(),n=function(){var e=b(f);if(e){var t=JSON.parse(e);if("number"==typeof t)return t}return T()}(),o=function(){var t=b(d);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=b(u);if(t){var n=JSON.parse(t);return e(e({},{widgetButtonText:{}}),n)}return{widgetButtonText:{}}}(),r=function(){var t=b(g);if(t){var n=JSON.parse(t);return e(e({},E()),n)}return E()}()}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 E(){return{body:void 0}}function T(){return 28800}var k=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 k(o,t[n])}))};function C(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 O(e){return"".concat(e.r,", ").concat(e.g,", ").concat(e.b)}function L(e){var t,n,o,i;return e.template.replace(/PLATFORM_PLACEHOLDER/g,m).replace(/INSET_TOP_PLACEHOLDER/g,S.disableInsets?"0px":"env(safe-area-inset-top, 0px)").replace(/INSET_BOTTOM_PLACEHOLDER/g,S.disableInsets?"0px":"env(safe-area-inset-bottom, 0px)").replace(/INSET_LEFT_PLACEHOLDER/g,S.disableInsets?"0px":"env(safe-area-inset-left, 0px)").replace(/INSET_RIGHT_PLACEHOLDER/g,S.disableInsets?"0px":"env(safe-area-inset-right, 0px)").replace(/CSS_TEXT_PLACEHOLDER/g,O(S.colors.text)).replace(/CSS_BORDER_PLACEHOLDER/g,O(S.colors.border)).replace(/CSS_BACKGROUND_PLACEHOLDER/g,O(S.colors.background)).replace(/CSS_TILE_PLACEHOLDER/g,O(S.colors.tile)).replace(/CSS_ACCENT_PLACEHOLDER/g,O(S.colors.accent)).replace(/CSS_NOTIFICATION_BACKGROUND_PLACEHOLDER/g,O(S.colors.notificationBackground)).replace(/CSS_NOTIFICATION_TEXT_PLACEHOLDER/g,O(S.colors.notificationText)).replace(/CSS_FONT_SIZE_PLACEHOLDER/g,"game"===S.mode?"16px":"14px").replace(/CSS_BODY_FONT_NORMAL_SRC_PLACEHOLDER/g,null!==(n=null===(t=S.fonts.body)||void 0===t?void 0:t.regular)&&void 0!==n?n:"url('https://fonts.gstatic.com/s/poppins/v22/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2') format('woff2')").replace(/CSS_BODY_FALLBACK_FONT_FAMILY_PLACEHOLDER/g,null!==(i=null===(o=S.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,S.nonce?'nonce="'.concat(S.nonce,'"'):"")}function I(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}}}var _=function(e){var t=e.split(/[-_]/),n=t[0],o=t[1];return n?o?"".concat(n.toLowerCase(),"-").concat(o.toUpperCase()):n.toLowerCase():"en"},R=/(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,P=/CrOS/,A=/android|ipad|playbook|silk/i;function N(){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=R.test(t)&&!P.test(t)||!!e.tablet&&A.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<500||window.innerHeight<500)}function D(e){var t=e.type,n=S.position,o=S.x,i=S.y;return N()&&"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 M(){return N()?{width:"100%",height:"100%",maxWidth:"none",maxHeight:"none"}:{width:"".concat(340,"px"),height:"".concat(680,"px"),maxWidth:"none",maxHeight:"calc(100vh - ".concat(2*S.y,"px)")}}function B(e){var t=document.querySelector(h.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 H(){var e,t,n=S.notifications[0];if(n&&!S.visibleNotification){S.visibleNotification=n;var o=null!==(e=document.querySelector(h.notificationDialog))&&void 0!==e?e:document.createElement("div");o.id=h.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(h.notificationIframe))&&void 0!==t?t:document.createElement("iframe");r.id=h.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(.2,"s ease-in-out, margin-top ").concat(.2,"s ease-in-out"),o.appendChild(r),C({iframe:r,content:(i={text:n.text},L({template:'<!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>'}).replace(/NOTIFICATION_TEXT_PLACEHOLDER/g,i.text))}),setTimeout(function(){r.style.opacity="1",r.style.marginTop="0px",F()},500),n.closeAfterSeconds>0&&setTimeout(function(){j({notification:n})},1e3*n.closeAfterSeconds)}}function F(){var e,t,n,o=document.querySelector(h.notificationDialog),i=document.querySelector(h.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"===S.mode){var a=D({type:"widget"}),s=M(),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(S.element){var c=S.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=S.disableInsets?"0px":"env(safe-area-inset-top, 0px)",o.style.left=S.disableInsets?"0px":"env(safe-area-inset-left, 0px)",o.style.right=S.disableInsets?"0px":"env(safe-area-inset-right, 0px)",o.style.bottom=S.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 j(e){if(e.notification&&S.visibleNotification===e.notification){var t=document.querySelector(h.notificationIframe),n=document.querySelector(h.notificationDialog);t&&(t.style.opacity="0",t.style.marginTop="-20px",setTimeout(function(){null==n||n.remove(),S.notifications=S.notifications.slice(1),S.visibleNotification=null,H()},200))}}var U=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(){S.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(){this.isRunning=!0;var e=new Date;if(this.nextPollDate||(this.nextPollDate=new Date(e.getTime()+1e3)),e>=this.nextPollDate)this.pollEventsRequest();else{var t=(this.nextPollDate.getTime()-e.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 S.isLoggedIn&&S.isInForeground&&S.hasNetworkConnectivity&&!S.sdkIsOpen}}),Object.defineProperty(i.prototype,"resumeIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e&&(this.nextPollDate=null),!this.shouldBeRunning()||this.isRunning&&!e||this.resume()}}),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(!S.token||!S.domain||!S.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=S.notificationsPaused||S.sdkIsOpen?"true":"false",a=new URLSearchParams(e(e({token:S.token,language:null!==(u=S.language)&&void 0!==u?u:"en",deviceId:S.deviceId,notificationsPaused:r,mode:S.mode},(null===(g=S.player)||void 0===g?void 0:g.id)?{unsignedPlayerId:S.player.id}:{}),S.signedMetadataToken?{signedMetadataToken:S.signedMetadataToken}:{})).toString(),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch("https://".concat(S.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),S.notifications=o(o([],S.notifications,!0),c.notifications,!0),S.notifications.length>0&&H(),c.unansweredMessageCount!==S.unansweredMessageCount&&(S.unansweredMessageCount=c.unansweredMessageCount,s("unansweredMessageCountUpdate",[c.unansweredMessageCount])),c.unreadMessageCount!==S.unreadMessageCount&&(S.unreadMessageCount=c.unreadMessageCount,s("unreadMessageCountUpdate",[c.unreadMessageCount]),B({action:"unreadMessageCountUpdate",count:c.unreadMessageCount})),[3,5];case 4:return d=n.sent(),console.error("Error fetching events:",d),this.scheduleNextPollEventsRequest(S.retryIntervalSecs),[3,5];case 5:return[2]}})})}}),i}(),q={eventPoller:null},W=function(){var e;null===(e=q.eventPoller)||void 0===e||e.onLogin()},z=function(){var e;null===(e=q.eventPoller)||void 0===e||e.onLogout()},G=function(){var e;null===(e=q.eventPoller)||void 0===e||e.onOpen()},Y=function(){var e;null===(e=q.eventPoller)||void 0===e||e.onClose()},J=function(){var e;null===(e=q.eventPoller)||void 0===e||e.onEnableNotifications()},K=function(){var e;null===(e=q.eventPoller)||void 0===e||e.onIsInForegroundChanged()},X=function(e){var t="/help-center";ne({path:t,config:e}),te({path:t,config:e})},V=function(e){var t="/assistant";ne({path:t,config:e}),te({path:t,config:e})},Z=function(){!function(){var e=document.querySelector(h.sdkDialog),t=document.querySelector(h.sdkIframeWrapper);if(e){var n=function(){"widget"!==S.mode||S.forceUpdateSdkDialog?e.remove():e.style.display="none",S.forceUpdateSdkDialog=!1};t?(t.style.opacity="0",t.style.transform=se({animation:"start"}),setTimeout(function(){n()},200)):n()}S.widgetButton&&ae();s("close",[])}()},Q=function(){try{return CSS.supports("color","var(--color)")&&CSS.supports("color","rgb(255 255 255 / 0.5)")}catch(e){return!1}},$=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r.apply(void 0,e)};function ee(t){var n,i,r,a,s,l,d=(null!=t?t:{}).config;if(!S.token||!S.domain||!S.deviceId)return null;var u=null!==(n=null==d?void 0:d.tags)&&void 0!==n?n:[],g=null!==(i=null==d?void 0:d.fields)&&void 0!==i?i:{},p=null!==(a=null!==(r=null==d?void 0:d.language)&&void 0!==r?r:S.language)&&void 0!==a?a:null,f=null!==(s=S.signedMetadataToken)&&void 0!==s?s:null,h=null!==(l=S.player)&&void 0!==l?l:null,v={_platform:m,_sdkVersion:c};S.youngPlayer&&(v._youngPlayer=!0),(S.privacyMode||S.youngPlayer)&&(v._privacyMode=!0);var y=o(o([],Array.from(S.tags),!0),u,!0),b=e(e(e({},S.fields),g),v);return{token:S.token,domain:S.domain,deviceId:S.deviceId,tags:y,fields:b,language:p,signedMetadataToken:f,player:h}}function te(e){var t,n,o,i=ee({config:e.config});if(i){var r=null!==(t=document.querySelector(h.sdkDialog))&&void 0!==t?t:document.createElement("div");r.id=h.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(h.sdkIframeWrapper))&&void 0!==n?n:document.createElement("div");a.id=h.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(O(S.colors.background),")"),a.style.transform=se({animation:"start"}),a.style.transition=(S.mode,"opacity ".concat(v,"s ease-in-out, transform ").concat(v,"s ease-in-out")),"widget"===S.mode&&(a.style.overflow="hidden");var c=null!==(o=a.querySelector(h.sdkLoaderIframe))&&void 0!==o?o:document.createElement("iframe");c.id=h.sdkLoaderIframe.replace("#",""),c.style.position="absolute",c.style.border="none",c.style.width="100%",c.style.height="100%",c.style.top="0",c.style.right="0",c.style.bottom="0",c.style.left="0",c.style.colorScheme="auto";var d=a.querySelector(h.sdkIframe),u=null!=d?d:document.createElement("iframe"),g=setInterval(function(){var e;"complete"===(null===(e=u.contentDocument)||void 0===e?void 0:e.readyState)&&(clearInterval(g),f())},500);u.id=h.sdkIframe.replace("#",""),u.style.position="absolute",u.style.border="none",u.style.top="0",u.style.right="0",u.style.bottom="0",u.style.left="0",u.style.colorScheme="auto",d&&!S.networkErrorTimerId||(u.src=function(e){var t=e.path,n=e.supportViewConfig,o="https://".concat(S.domain,"/sdk"),i=new URLSearchParams;i.set("platform",m),i.set("token",n.token),i.set("deviceId",n.deviceId),i.set("mode",S.mode),i.set("origin",window.location.origin),i.set("userLanguage",S.userLanguage),S.disableInsets&&i.set("disableInsets","true");n.language&&i.set("language",n.language);Q()||i.set("unsupported","true");var r=ie({supportViewConfig:n});return i.set("metadata",JSON.stringify(r)),"".concat(o).concat(t,"?").concat(i.toString())}({path:e.path,supportViewConfig:i}),u.style.width="0",u.style.height="0",r.appendChild(a),a.appendChild(c),a.appendChild(u),document.body.appendChild(r)),C({iframe:c,content:L({template:'<!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>'})});var p=!1,f=function(){p||(p=!0,S.networkErrorTimerId=setTimeout(function(){C({iframe:c,content:L({template:l})})},1e4))};u.onload=f,u.onerror=function(){C({iframe:c,content:L({template:l})})},re(),s("open",[]),setTimeout(function(){a.style.opacity="1",a.style.transform=se({animation:"end"})},100)}}function ne(e){var t=e.path,n=e.config,o=null!=n?n:null;S.previousPath===t&&k(S.previousConfig,o)||(S.previousPath=t,S.previousConfig=o,oe())}function oe(){var e=document.querySelector(h.sdkDialog);S.sdkIsOpen?S.forceUpdateSdkDialog=!0:null==e||e.remove()}function ie(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 re(){var e=document.querySelector(h.sdkDialog),t=document.querySelector(h.sdkIframeWrapper);if(e&&t)if("widget"===S.mode){var n=D({type:"widget"}),o=M();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,N()?(t.style.border="none",t.style.borderRadius="0"):(t.style.border="1px solid rgb(".concat(O(S.colors.border),")"),t.style.borderRadius="10px")}else if(t.style.border="none",t.style.borderRadius="0",S.element){var i=S.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=S.keyboardHeight>0?"calc(100% - ".concat(S.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 ae(){var e,t=null!==(e=document.querySelector(h.sdkButtonIframe))&&void 0!==e?e:document.createElement("iframe");if(t){var n,o=D({type:"button"});t.id=h.sdkButtonIframe.replace("#",""),t.style.position="fixed",t.style.border="none",t.style.width="".concat(120,"px"),t.style.height="".concat(48,"px"),t.style.minWidth="".concat(120,"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(.2,"s ease-in-out, transform ").concat(.2,"s ease-in-out"),setTimeout(function(){t.style.opacity="1",t.style.transform="scale(1)"},100),document.body.appendChild(t),C({iframe:t,content:(n={unreadMessageCount:S.unreadMessageCount},L({template:"<!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;\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 white-space: nowrap; \n }\n\n .sdk-button-text {\n overflow: hidden;\n text-overflow: ellipsis;\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 calculateButtonSize() {\n const paddingX = 12;\n const scrollWidth = document.querySelector('.sdk-button-text').scrollWidth;\n const width = scrollWidth + (paddingX * 2);\n \n parent.postMessage({ action: 'theymes.sdkButtonSizeUpdated', width }, '*');\n }\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').innerHTML = e.data.text;\n calculateButtonSize();\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 calculateButtonSize();\n <\/script>\n</body>\n\n</html>"}).replace(/UNREAD_MESSAGE_COUNT_PLACEHOLDER/g,"".concat(n.unreadMessageCount)).replace(/CSS_WIDGET_BUTTON_BACKGROUND_PLACEHOLDER/g,O(S.colors.widgetButtonBackground)).replace(/CSS_WIDGET_BUTTON_TEXT_PLACEHOLDER/g,O(S.colors.widgetButtonText)).replace(/CSS_WIDGET_BUTTON_ACTION_PENDING_PLACEHOLDER/g,O(S.colors.widgetButtonActionPending)).replace(/WIDGET_BUTTON_TEXT_PLACEHOLDER/g,fe()))})}}function se(e){return"start"===e.animation?"game"===S.mode?"translateY(20%)":"scale(0.8)":"game"===S.mode?"translateY(0)":"scale(1)"}function le(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 ce(){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(ge(),S.retryRecordRetentionTimerId&&(clearTimeout(S.retryRecordRetentionTimerId),S.retryRecordRetentionTimerId=null),S.retentionRemainingSeconds=null,S.isRetentionRecordedForSession=!0,!(e=ee()))return[2];t="https://".concat(S.domain,"/api/sdk/retention"),o=ie({supportViewConfig:e}),i={token:S.token,deviceId:S.deviceId,language:S.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,le(r)];case 3:throw n.sent();case 4:return[3,6];case 5:return a=n.sent(),console.error("Error tracking retention:",a),S.retryRecordRetentionTimerId=setTimeout(ce,6e4),[3,6];case 6:return[2]}})})}function de(){var e=new Date;if(S.sessionStatus="active",S.sessionResumeOrStartTime=e,S.sessionStartTime){var t=S.sessionStartTime.valueOf()/1e3+S.resetSessionAfterSecs;Date.now()/1e3>t&&ue()}else ue();null!==S.retentionRemainingSeconds&&(S.recordRetentionTimerId=setTimeout(ce,1e3*S.retentionRemainingSeconds))}function ue(){S.sessionStartTime=new Date,S.retentionRemainingSeconds=S.recordRetentionAfterSecs,S.isRetentionRecordedForSession=!1,ge()}function ge(){S.recordRetentionTimerId&&(clearTimeout(S.recordRetentionTimerId),S.recordRetentionTimerId=null)}function pe(){S.isRetentionRecordedForSession&&ce()}function fe(){var e;return function(e){var t=e.split(" ");if(e.length<=16||t.length<=1)return e;for(var n=t.map(function(e){return e.length}),i=[],r=1;r<n.length;r++){var a=n.slice(0,r),s=n.slice(r),l=a.reduce(function(e,t){return e+t},0),c=s.reduce(function(e,t){return e+t},0),d=Math.abs(l-c);i.push(d)}var u=Math.min.apply(Math,i),g=i.indexOf(u);return o(o(o([],t.slice(0,g+1),!0),["<br>"],!1),t.slice(g+1),!0).join(" ")}(null!==(e=function(e){var t,n,o,i,r,a=_(null!==(t=S.language)&&void 0!==t?t:"en"),s=null===(n=S.locs[e.loc])||void 0===n?void 0:n[a];if(s)return s;var l=a.split("-")[0];return l&&(null===(o=S.locs[e.loc])||void 0===o?void 0:o[l])||(null!==(r=null===(i=S.locs[e.loc])||void 0===i?void 0:i.en)&&void 0!==r?r:null)}({loc:"widgetButtonText"}))&&void 0!==e?e:"Support")}function me(){var e=S.isInForeground,t="visible"===document.visibilityState&&document.hasFocus();S.isInForeground=t,e!==t&&K(),t&&"paused"===S.sessionStatus?de():t||"active"!==S.sessionStatus||function(){if(S.sessionResumeOrStartTime&&S.retentionRemainingSeconds){var e=Math.floor((Date.now()-S.sessionResumeOrStartTime.valueOf())/1e3);S.retentionRemainingSeconds-=e}S.sessionStatus="paused",ge()}()}function he(){var e,t=S.isLoggedIn,n=Boolean(S.signedMetadataToken||(null===(e=S.player)||void 0===e?void 0:e.id));S.isLoggedIn=n,n&&!t?W():!n&&t&&z()}try{document.addEventListener("visibilitychange",me),window.addEventListener("focus",me),window.addEventListener("blur",me),window.addEventListener("resize",re),window.addEventListener("resize",F),window.addEventListener("message",function(e){if("theymes.ready"===e.data.action){var t=document.querySelector(h.sdkLoaderIframe),n=document.querySelector(h.sdkIframe);S.networkErrorTimerId&&(clearTimeout(S.networkErrorTimerId),S.networkErrorTimerId=null),n&&(n.style.width="100%",n.style.height="100%"),t&&t.remove()}else if("theymes.close"===e.data.action)Z();else if("theymes.closeNotification"===e.data.action)j({notification:S.visibleNotification});else if("theymes.handleNotificationAction"===e.data.action)d={notification:S.visibleNotification},(null==(u=d.notification)?void 0:u.action)&&"OPEN_PAGE"===u.action.type&&(te({path:u.action.path}),j({notification:u}));else if("theymes.sdkButtonClicked"===e.data.action)(c=document.querySelector(h.sdkButtonIframe))&&(c.style.opacity="0",c.style.transform="scale(0.8)",setTimeout(function(){c.remove()},200)),"support"===S.widgetButtonAction?X():"assistant"===S.widgetButtonAction&&V();else if("theymes.sdkButtonSizeUpdated"===e.data.action){var o=document.querySelector(h.sdkButtonIframe);o&&(o.style.width="".concat(e.data.width,"px"))}else if("theymes.openExternalPage"===e.data.action){var i=e.data.target;"_self"===i&&function(e){var t=e.key,n=e.value,o=e.ttlMs,i=e.storage,r=void 0===i?x:i,a={value:n,expiry:Date.now()+o};r.setItem(t,JSON.stringify(a))}({key:y,value:e.data.path,ttlMs:6e5}),window.open(e.data.url,i)}else if("theymes.messageCountsChanged"===e.data.action){var r=e.data,a=r.unreadMessageCount,l=r.unansweredMessageCount;if("number"!=typeof a||"number"!=typeof l)return;l!==S.unansweredMessageCount&&(S.unansweredMessageCount=l,s("unansweredMessageCountUpdate",[l])),a!==S.unreadMessageCount&&(S.unreadMessageCount=a,s("unreadMessageCountUpdate",[a]),B({action:"unreadMessageCountUpdate",count:a}))}var c,d,u},!1),$("open",function(){S.sdkIsOpen=!0,G()}),$("close",function(){S.sdkIsOpen=!1,Y()})}catch(e){console.error("Error adding event listeners to SDK",e)}var ve=I("initialize",function(o,i,r){return t(void 0,void 0,void 0,function(){var t,a,s,l,c,h,v,E,T,k,C,O,L,I;return n(this,function(n){switch(n.label){case 0:if(!o||!i||!r.mode)throw new Error("Token, domain, and mode are required");S.token=o,S.domain=i,S.mode=r.mode,S.element="element"in r&&void 0!==r.element?r.element:S.element,S.language=null!==(v=r.language)&&void 0!==v?v:S.language,S.nonce=null!==(E=r.nonce)&&void 0!==E?E:S.nonce,S.deviceId=function(){var e=b("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 w("deviceId",t),t;var n}(),S.widgetButton="button"in r&&void 0!==r.button&&null!==(T=r.button)&&void 0!==T?T:S.widgetButton,S.widgetButtonAction="buttonAction"in r&&void 0!==r.buttonAction&&null!==(k=r.buttonAction)&&void 0!==k?k:S.widgetButtonAction,S.position="position"in r&&void 0!==r.position&&null!==(C=r.position)&&void 0!==C?C:S.position,S.x="x"in r&&void 0!==r.x?r.x:S.x,S.y="y"in r&&void 0!==r.y?r.y:S.y,S.disableInsets="game"===S.mode&&null!==S.element,q.eventPoller||(q.eventPoller=new U),t="https://".concat(i,"/api/sdk/settings"),a=new URLSearchParams({token:S.token,platform:m,mode:S.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,le(s)];case 3:throw n.sent();case 4:return[4,s.json()];case 5:return l=n.sent(),(null===(O=null==l?void 0:l.branding)||void 0===O?void 0:O.colors)&&(D=l.branding.colors,S.colors=e(e({},S.colors),D),w(d,JSON.stringify(S.colors))),(null===(L=null==l?void 0:l.branding)||void 0===L?void 0:L.locs)&&(A=l.branding.locs,S.locs=e(e({},S.locs),A),w(u,JSON.stringify(S.locs))),(null===(I=null==l?void 0:l.branding)||void 0===I?void 0:I.fonts)&&(P=l.branding.fonts,S.fonts=e(e({},S.fonts),P),w(g,JSON.stringify(S.fonts))),"number"!=typeof(null==l?void 0:l.recordRetentionAfterSecs)&&null!==(null==l?void 0:l.recordRetentionAfterSecs)||(R=l.recordRetentionAfterSecs,S.recordRetentionAfterSecs=R,w(p,JSON.stringify(S.recordRetentionAfterSecs))),"number"!=typeof(null==l?void 0:l.resetSessionAfterSecs)&&null!==(null==l?void 0:l.resetSessionAfterSecs)||(_=l.resetSessionAfterSecs,S.resetSessionAfterSecs=null!=_?_:28800,w(f,JSON.stringify(S.resetSessionAfterSecs))),de(),oe(),c=function(e){var t=e.key,n=e.storage,o=void 0===n?x:n,i=o.getItem(t);if(!i)return null;var r=JSON.parse(i);return Date.now()>r.expiry?(o.removeItem(t),null):(o.removeItem(t),r.value)}({key:y}),c&&"widget"===S.mode&&!N()?te({path:c}):S.widgetButton&&ae(),[3,7];case 6:return h=n.sent(),console.error("Error initializing SDK:",h),[3,7];case 7:return[2]}var _,R,P,A,D})})},void 0),ye=I("openSupport",X,void 0),be=I("openAssistant",V,void 0),we=I("openResource",function(e,t){var n="/resources/".concat(e);ne({path:n,config:t}),te({path:n,config:t})},void 0),xe=I("close",Z,void 0),Se=I("getLanguage",function(){return S.language},null),Ee=I("setLanguage",function(e){var t=S.language!==e;S.language=e,t&&(oe(),B({action:"widgetButtonTextUpdate",text:fe()}))},void 0),Te=I("getSignedMetadataToken",function(){return S.signedMetadataToken},null),ke=I("setSignedMetadataToken",function(e){var t=S.signedMetadataToken!==e;S.signedMetadataToken=e,he(),t&&(oe(),pe())},void 0),Ce=I("getPlayer",function(){return S.player},null),Oe=I("setPlayer",function(e){var t,n=(null===(t=S.player)||void 0===t?void 0:t.id)!==(null==e?void 0:e.id);S.player=e,he(),n&&(oe(),pe())},void 0),Le=I("getTags",function(){return Array.from(S.tags)},[]),Ie=I("setTags",function(e){S.tags=new Set(e),oe()},void 0),_e=I("addTag",function(e){S.tags.add(e),oe()},void 0),Re=I("addTags",function(e){e.forEach(function(e){return S.tags.add(e)}),oe()},void 0),Pe=I("removeTag",function(e){S.tags.delete(e),oe()},void 0),Ae=I("removeTags",function(e){e.forEach(function(e){return S.tags.delete(e)}),oe()},void 0),Ne=I("removeAllTags",function(){S.tags.clear(),oe()},void 0),De=I("getFields",function(){return S.fields},{}),Me=I("setFields",function(e){S.fields=e,oe()},void 0),Be=I("addField",function(e,t){S.fields[e]=t,oe()},void 0),He=I("addFields",function(t){S.fields=e(e({},S.fields),t),oe()},void 0),Fe=I("removeField",function(e){delete S.fields[e],oe()},void 0),je=I("removeFields",function(e){e.forEach(function(e){return delete S.fields[e]}),oe()},void 0),Ue=I("removeAllFields",function(){S.fields={},oe()},void 0),qe=I("enableLogging",function(){S.loggingEnabled=!0},void 0),We=I("disableLogging",function(){S.loggingEnabled=!1},void 0),ze=I("isYoungPlayer",function(){return S.youngPlayer},!1),Ge=I("setYoungPlayer",function(e){S.youngPlayer=e,oe()},void 0),Ye=I("isPrivacyMode",function(){return S.privacyMode},!1),Je=I("setPrivacyMode",function(e){S.privacyMode=e,oe()},void 0),Ke=I("isSupported",Q,!1),Xe=I("requestNotificationPermission",function(){},void 0),Ve=I("enableNotifications",function(){S.notificationsPaused=!1,J()},void 0),Ze=I("disableNotifications",function(){S.notificationsPaused=!0},void 0),Qe=I("getUnreadMessageCount",function(){return S.unreadMessageCount},0),$e=I("getUnansweredMessageCount",function(){return S.unansweredMessageCount},0),et=I("getSdkVersion",function(){return c},""),tt=I("reset",function(){S.language=null,S.tags=new Set,S.fields={},S.signedMetadataToken=null,S.player=null,he(),oe(),B({action:"widgetButtonTextUpdate",text:fe()})},void 0),nt=I("recordRetention",function(){S.isRetentionRecordedForSession||ce()},void 0),ot=I("addEventListener",$,void 0),it=I("removeEventListener",function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a.apply(void 0,e)},void 0),rt=I("iosSetKeyboardHeight",function(e){S.keyboardHeight=e,re()},void 0);exports.addEventListener=ot,exports.addField=Be,exports.addFields=He,exports.addTag=_e,exports.addTags=Re,exports.close=xe,exports.disableLogging=We,exports.disableNotifications=Ze,exports.enableLogging=qe,exports.enableNotifications=Ve,exports.getFields=De,exports.getLanguage=Se,exports.getPlayer=Ce,exports.getSdkVersion=et,exports.getSignedMetadataToken=Te,exports.getTags=Le,exports.getUnansweredMessageCount=$e,exports.getUnreadMessageCount=Qe,exports.initialize=ve,exports.iosSetKeyboardHeight=rt,exports.isPrivacyMode=Ye,exports.isSupported=Ke,exports.isYoungPlayer=ze,exports.openAssistant=be,exports.openResource=we,exports.openSupport=ye,exports.recordRetention=nt,exports.removeAllFields=Ue,exports.removeAllTags=Ne,exports.removeEventListener=it,exports.removeField=Fe,exports.removeFields=je,exports.removeTag=Pe,exports.removeTags=Ae,exports.requestNotificationPermission=Xe,exports.reset=tt,exports.setFields=Me,exports.setLanguage=Ee,exports.setPlayer=Oe,exports.setPrivacyMode=Je,exports.setSignedMetadataToken=ke,exports.setTags=Ie,exports.setYoungPlayer=Ge;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import * as sdk from './sdk.js';
|
|
2
2
|
export type { InitializeGameOptions, InitializeWidgetOptions, InitializeOptions } from './sdk.js';
|
|
3
|
-
export declare const initialize:
|
|
4
|
-
export declare const openSupport:
|
|
5
|
-
export declare const openAssistant:
|
|
6
|
-
export declare const openResource:
|
|
7
|
-
export declare const close:
|
|
8
|
-
export declare const getLanguage:
|
|
9
|
-
export declare const setLanguage:
|
|
10
|
-
export declare const getSignedMetadataToken:
|
|
11
|
-
export declare const setSignedMetadataToken:
|
|
12
|
-
export declare const getPlayer:
|
|
13
|
-
export declare const setPlayer:
|
|
14
|
-
export declare const getTags:
|
|
15
|
-
export declare const setTags:
|
|
16
|
-
export declare const addTag:
|
|
17
|
-
export declare const addTags:
|
|
18
|
-
export declare const removeTag:
|
|
19
|
-
export declare const removeTags:
|
|
20
|
-
export declare const removeAllTags:
|
|
21
|
-
export declare const getFields:
|
|
22
|
-
export declare const setFields:
|
|
23
|
-
export declare const addField:
|
|
24
|
-
export declare const addFields:
|
|
25
|
-
export declare const removeField:
|
|
26
|
-
export declare const removeFields:
|
|
27
|
-
export declare const removeAllFields:
|
|
28
|
-
export declare const enableLogging:
|
|
29
|
-
export declare const disableLogging:
|
|
30
|
-
export declare const isYoungPlayer:
|
|
31
|
-
export declare const setYoungPlayer:
|
|
32
|
-
export declare const isPrivacyMode:
|
|
33
|
-
export declare const setPrivacyMode:
|
|
34
|
-
export declare const isSupported:
|
|
35
|
-
export declare const requestNotificationPermission:
|
|
36
|
-
export declare const enableNotifications:
|
|
37
|
-
export declare const disableNotifications:
|
|
38
|
-
export declare const getUnreadMessageCount:
|
|
39
|
-
export declare const getUnansweredMessageCount:
|
|
40
|
-
export declare const getSdkVersion:
|
|
41
|
-
export declare const reset:
|
|
42
|
-
export declare const recordRetention:
|
|
43
|
-
export declare const addEventListener:
|
|
44
|
-
export declare const removeEventListener:
|
|
45
|
-
export declare const iosSetKeyboardHeight: (
|
|
3
|
+
export declare const initialize: sdk.Initialize;
|
|
4
|
+
export declare const openSupport: sdk.OpenSupport;
|
|
5
|
+
export declare const openAssistant: sdk.OpenAssistant;
|
|
6
|
+
export declare const openResource: sdk.OpenResource;
|
|
7
|
+
export declare const close: sdk.Close;
|
|
8
|
+
export declare const getLanguage: sdk.GetLanguage;
|
|
9
|
+
export declare const setLanguage: sdk.SetLanguage;
|
|
10
|
+
export declare const getSignedMetadataToken: sdk.GetSignedMetadataToken;
|
|
11
|
+
export declare const setSignedMetadataToken: sdk.SetSignedMetadataToken;
|
|
12
|
+
export declare const getPlayer: sdk.GetPlayer;
|
|
13
|
+
export declare const setPlayer: sdk.SetPlayer;
|
|
14
|
+
export declare const getTags: sdk.GetTags;
|
|
15
|
+
export declare const setTags: sdk.SetTags;
|
|
16
|
+
export declare const addTag: sdk.AddTag;
|
|
17
|
+
export declare const addTags: sdk.AddTags;
|
|
18
|
+
export declare const removeTag: sdk.RemoveTag;
|
|
19
|
+
export declare const removeTags: sdk.RemoveTags;
|
|
20
|
+
export declare const removeAllTags: sdk.RemoveAllTags;
|
|
21
|
+
export declare const getFields: sdk.GetFields;
|
|
22
|
+
export declare const setFields: sdk.SetFields;
|
|
23
|
+
export declare const addField: sdk.AddField;
|
|
24
|
+
export declare const addFields: sdk.AddFields;
|
|
25
|
+
export declare const removeField: sdk.RemoveField;
|
|
26
|
+
export declare const removeFields: sdk.RemoveFields;
|
|
27
|
+
export declare const removeAllFields: sdk.RemoveAllFields;
|
|
28
|
+
export declare const enableLogging: sdk.EnableLogging;
|
|
29
|
+
export declare const disableLogging: sdk.DisableLogging;
|
|
30
|
+
export declare const isYoungPlayer: sdk.IsYoungPlayer;
|
|
31
|
+
export declare const setYoungPlayer: sdk.SetYoungPlayer;
|
|
32
|
+
export declare const isPrivacyMode: sdk.IsPrivacyMode;
|
|
33
|
+
export declare const setPrivacyMode: sdk.SetPrivacyMode;
|
|
34
|
+
export declare const isSupported: sdk.IsSupported;
|
|
35
|
+
export declare const requestNotificationPermission: sdk.RequestNotificationPermission;
|
|
36
|
+
export declare const enableNotifications: sdk.EnableNotifications;
|
|
37
|
+
export declare const disableNotifications: sdk.DisableNotifications;
|
|
38
|
+
export declare const getUnreadMessageCount: sdk.GetUnreadMessageCount;
|
|
39
|
+
export declare const getUnansweredMessageCount: sdk.GetUnansweredMessageCount;
|
|
40
|
+
export declare const getSdkVersion: sdk.GetSdkVersion;
|
|
41
|
+
export declare const reset: sdk.Reset;
|
|
42
|
+
export declare const recordRetention: sdk.RecordRetention;
|
|
43
|
+
export declare const addEventListener: import("./types.js").AddEventListener;
|
|
44
|
+
export declare const removeEventListener: import("./types.js").RemoveEventListener;
|
|
45
|
+
export declare const iosSetKeyboardHeight: import("./types.js").IosSetKeyboardHeight;
|