From 9af8ea730bad3d52d3d6588cf49a9708d6b7c0f7 Mon Sep 17 00:00:00 2001 From: Lukas Boehler Date: Thu, 1 Oct 2026 17:07:57 -0400 Subject: [PATCH 1/2] perf: space tour popover buttons with flex gap instead of a sibling selector The injected `.gleap-tour-popover-navigation-btns button + button` rule has a bare `button` subject, so Chrome restyles sibling subtrees on DOM inserts anywhere in the host page. `gap: 4px` on the existing flex container gives the same spacing (and none when the Previous button is hidden). Fixes #164 Co-Authored-By: Claude Opus 5.5 --- src/UI.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/UI.js b/src/UI.js index ac0d761..4c5bee9 100644 --- a/src/UI.js +++ b/src/UI.js @@ -2806,10 +2806,7 @@ export const injectStyledCSS = ( display: flex; flex-grow: 1; justify-content: flex-end; - } - - .gleap-tour-popover-navigation-btns button + button { - margin-left: 4px; + gap: 4px; } .gleap-tour-popover-arrow { From 6bec8707b39b0e8c0d4aa2b9615a5d62a27338a0 Mon Sep 17 00:00:00 2001 From: Lukas Boehler Date: Thu, 1 Oct 2026 17:09:35 -0400 Subject: [PATCH 2/2] chore: version 19.0.1 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 3 +++ build/browser/index.js | 2 +- build/browser/index.js.map | 2 +- build/cjs/index.js | 2 +- build/cjs/index.js.map | 2 +- build/esm/index.mjs | 2 +- build/esm/index.mjs.map | 2 +- package-lock.json | 4 ++-- package.json | 2 +- published/19.0.1/index.js | 2 ++ published/19.0.1/index.js.map | 1 + published/latest/index.js | 2 +- published/latest/index.js.map | 2 +- 13 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 published/19.0.1/index.js create mode 100644 published/19.0.1/index.js.map diff --git a/CHANGELOG.md b/CHANGELOG.md index 24678cd..fa05889 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 19.0.1 +Fixed: the SDK's injected styles made the host page slower. The product tour rule `.gleap-tour-popover-navigation-btns button + button` ends in a bare `button`, so Chrome restyled sibling elements across the whole page whenever a node was inserted anywhere, not only inside Gleap's UI (on a page with ~19k nodes, ~2,000 extra elements per popover open or close). The tour buttons are now spaced with `gap` on their flex container, which looks the same; when the Previous button is hidden, the Next button no longer keeps a stray 4px margin. + ## 19.0.0 Added widget color schemes, so the widget can match the host app's dark/light mode. Turn it on in the dashboard (Widget → Look & feel → Adapt to dark / light mode, delivered as `colorScheme` in the flow config) or at runtime with `Gleap.setColorScheme("auto" | "light" | "dark", options?)`, which overrides the dashboard (until the first call, the dashboard setting applies): `"auto"` follows the host app and switches live when it changes. It looks at theme markers on ``/`` (classes like `dark`/`light`, attributes like `data-theme`, `data-bs-theme`, `data-color-scheme`, `data-mode`), then the page's CSS `color-scheme`, then the page background, and finally the OS `prefers-color-scheme`. diff --git a/build/browser/index.js b/build/browser/index.js index afe14b1..166b553 100644 --- a/build/browser/index.js +++ b/build/browser/index.js @@ -1,2 +1,2 @@ -(()=>{var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};(()=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(){r=function(){return t};var e,t={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new P(r||[]);return a(i,"_invoke",{value:L(e,n,s)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h="suspendedStart",g="suspendedYield",m="executing",v="completed",y={};function b(){}function w(){}function k(){}var x={};d(x,c,(function(){return this}));var S=Object.getPrototypeOf,C=S&&S(S(R([])));C&&C!==o&&i.call(C,c)&&(x=C);var I=k.prototype=b.prototype=Object.create(x);function E(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,a,s,c){var l=f(e[o],e,a);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==n(d)&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return r("throw",e,s,c)}))}c(l.arg)}var o;a(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}})}function L(t,n,r){var o=h;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=O(s,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var l=f(t,n,r);if("normal"===l.type){if(o=r.done?v:g,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;M(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nih});var s=function(e,t,n){var r,o,i,a,s,c,l;switch(e){case"meta":null===(r=n.onMeta)||void 0===r||r.call(n,t);break;case"token":null===(o=n.onToken)||void 0===o||o.call(n,t);break;case"tool_start":null===(i=n.onToolStart)||void 0===i||i.call(n,t);break;case"tool_end":null===(a=n.onToolEnd)||void 0===a||a.call(n,t);break;case"done":null===(s=n.onDone)||void 0===s||s.call(n,t);break;case"error":null===(c=n.onError)||void 0===c||c.call(n,t);break;case"handoff":null===(l=n.onHandoff)||void 0===l||l.call(n,t)}},c=function(){var e,t=(e=r().mark((function e(t,n){var i,a,c,l,u,d,p,f,h,g,m,v,y,b,w,k,x,S;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.body){e.next=3;break}return null===(i=n.onError)||void 0===i||i.call(n,{message:"No response body."}),e.abrupt("return");case 3:a=t.body.getReader(),c=new TextDecoder,l="",u="",d="",e.prev=8;case 9:return e.next=12,a.read();case 12:if(f=e.sent,h=f.done,g=f.value,!h){e.next=17;break}return e.abrupt("break",24);case 17:l+=c.decode(g,{stream:!0}),m=l.split("\n"),l=null!==(p=m.pop())&&void 0!==p?p:"",v=o(m);try{for(v.s();!(y=v.n()).done;)if(b=y.value,(w=b.replace(/\r$/,"")).startsWith("event: "))u=w.slice(7).trim();else if(w.startsWith("data: "))d+=(d?"\n":"")+w.slice(6);else if(""===w){if(u&&d)try{k=JSON.parse(d),s(u,k,n)}catch(r){}u="",d=""}}catch(C){v.e(C)}finally{v.f()}e.next=9;break;case 24:if(u&&d)try{x=JSON.parse(d),s(u,x,n)}catch(I){}e.next=30;break;case 27:e.prev=27,e.t0=e.catch(8),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)&&(null===(S=n.onError)||void 0===S||S.call(n,{message:"Stream interrupted."}));case 30:case"end":return e.stop()}}),e,null,[[8,27]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,c,"next",e)}function c(e){a(i,r,o,s,c,"throw",e)}s(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;M(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t=200&&i.status<300)try{r(i.responseText?JSON.parse(i.responseText):null)}catch(e){o({status:i.status,statusText:"JSON Parse Error",error:e})}else o({status:i.status,statusText:i.statusText,responseText:i.responseText})},i.onerror=function(){return o({status:0,statusText:"Network Error"})},i.send(n?JSON.stringify(n):null)}))}},{key:"streamAgent",value:(o=p().mark((function e(t,n,r,o){var i,a,s,l,u,d,f;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.executeInFlight.get(t)){e.next=2;break}return e.abrupt("return");case 2:if(this.executeInFlight.set(t,!0),i=this._getApiUrl()){e.next=8;break}return this.executeInFlight.delete(t),null===(a=r.onError)||void 0===a||a.call(r,{message:"Gleap API URL not configured."}),e.abrupt("return");case 8:return s="".concat(i,"/v3/shared/agents/").concat(t,"/stream"),l=h(h({},this._getHeaders()),{},{Accept:"text/event-stream"}),e.prev=10,e.next=13,fetch(s,{method:"POST",headers:l,body:JSON.stringify(n),signal:o});case 13:u=e.sent,e.next=23;break;case 16:if(e.prev=16,e.t0=e.catch(10),this.executeInFlight.delete(t),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)){e.next=21;break}return e.abrupt("return");case 21:return null===(d=r.onError)||void 0===d||d.call(r,{message:"Failed to connect to agent."}),e.abrupt("return");case 23:if(u.ok){e.next=27;break}return this.executeInFlight.delete(t),null===(f=r.onError)||void 0===f||f.call(r,{message:"Server error: ".concat(u.status)}),e.abrupt("return");case 27:return e.next=29,c(u,r);case 29:n.conversationId&&this._invalidateMessagesCache(n.conversationId),this.executeInFlight.delete(t);case 31:case"end":return e.stop()}}),e,this,[[10,16]])})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){g(i,n,r,a,s,"next",e)}function s(e){g(i,n,r,a,s,"throw",e)}a(void 0)}))},function(e,t,n,r){return i.apply(this,arguments)})},{key:"executeAgent",value:function(e,t){var n=this;if(this.executeInFlight.get(e))return Promise.reject(new Error("Agent execution already in progress."));var r=this._getApiUrl();if(!r)return Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."));this.executeInFlight.set(e,!0);var o="".concat(r,"/v3/shared/agents/").concat(e,"/execute");return this._makeRequest("POST",o,t).then((function(e){return t.conversationId&&n._invalidateMessagesCache(t.conversationId),null!=e&&e.conversationId&&n._invalidateMessagesCache(e.conversationId),e})).finally((function(){n.executeInFlight.delete(e)}))}},{key:"getConversationMessages",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("kai"===e)return Promise.resolve({messages:[]});var i="".concat(t,":").concat(r,":").concat(o),a=this.messagesCache.get(i);if(a)return a.status===b?Promise.resolve(JSON.parse(JSON.stringify(a.data))):Promise.reject(a.error);if(this.messagesRequests.has(i))return this.messagesRequests.get(i).then((function(e){return JSON.parse(JSON.stringify(e))}));var s=this._getApiUrl();if(!s)return Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."));var c="".concat(s,"/v3/shared/agents/").concat(e,"/conversations/").concat(t,"/messages?limit=").concat(r,"&skip=").concat(o),l=this._makeRequest("GET",c,null).then((function(e){return n.messagesCache.set(i,{status:b,data:e}),JSON.parse(JSON.stringify(e))})).catch((function(e){throw n.messagesCache.set(i,{status:w,error:e}),e})).finally((function(){n.messagesRequests.delete(i)}));return this.messagesRequests.set(i,l),l.then((function(e){return JSON.parse(JSON.stringify(e))}))}},{key:"getConversations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("kai"===e)return Promise.resolve({conversations:[]});var r=this._getApiUrl();return r?this._makeRequest("GET","".concat(r,"/v3/shared/agents/").concat(e,"/conversations?limit=").concat(t,"&skip=").concat(n),null):Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."))}},{key:"_invalidateMessagesCache",value:function(e){var t,n=u(this.messagesCache.keys());try{for(n.s();!(t=n.n()).done;){var r=t.value;r.startsWith(e+":")&&this.messagesCache.delete(r)}}catch(s){n.e(s)}finally{n.f()}var o,i=u(this.messagesRequests.keys());try{for(i.s();!(o=i.n()).done;){var a=o.value;a.startsWith(e+":")&&this.messagesRequests.delete(a)}}catch(s){i.e(s)}finally{i.f()}}}],r=[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}],n&&m(t.prototype,n),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();v(k,"instance",null);const x=k;function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function C(e,t){for(var n=0;n=200&&i.status<300)try{var e=i.responseText?JSON.parse(i.responseText):null;r(e)}catch(t){o({status:i.status,statusText:"JSON Parse Error",responseText:i.responseText,error:t})}else o({status:i.status,statusText:i.statusText,responseText:i.responseText})},i.onerror=function(){o({status:0,statusText:"Network Error",responseText:null})},i.send(n?JSON.stringify(n):null)}))}},{key:"_createCacheKey",value:function(e,t){return t?"".concat(e,"::").concat(t):e}},{key:"validateChecklist",value:function(e,t){var n=this,r=this._createCacheKey(e,t),o=this.validationCache.get(r);if(o)return o.status===T?Promise.resolve(o.internalId):Promise.reject(o.error);if(this.validationRequests.has(r))return this.validationRequests.get(r);var i=this._getApiUrl();if(!i){var a=new Error("ChecklistNetworkManager: Gleap API URL not configured.");return this.validationCache.set(r,{status:L,error:a}),Promise.reject(a)}var s="".concat(i,"/outbound/checklists?").concat(this._getQueryParams()),c=this._makeRequest("POST",s,{outboundId:e,sharedKey:t}).then((function(e){if(e&&e.id)return n.validationCache.set(r,{status:T,internalId:e.id}),e.id;var t=new Error("Validation response missing checklist ID.");throw n.validationCache.set(r,{status:L,error:e||t}),t})).catch((function(e){throw n.validationCache.set(r,{status:L,error:e}),e})).finally((function(){n.validationRequests.delete(r)}));return this.validationRequests.set(r,c),c}},{key:"fetchChecklist",value:function(e){var t=this,n=this.fetchCache.get(e);if(n)return n.status===T?Promise.resolve(JSON.parse(JSON.stringify(n.data))):Promise.reject(n.error);if(this.fetchRequests.has(e))return this.fetchRequests.get(e).then((function(e){return JSON.parse(JSON.stringify(e))}));var r=this._getApiUrl();if(!r){var o=new Error("ChecklistNetworkManager: Gleap API URL not configured.");return this.fetchCache.set(e,{status:L,error:o}),Promise.reject(o)}var i="".concat(r,"/outbound/checklists/").concat(e,"?convertTipTap=true&").concat(this._getQueryParams()),a=this._makeRequest("GET",i,null).then((function(n){if(n)return t.fetchCache.set(e,{status:T,data:n}),JSON.parse(JSON.stringify(n));var r=new Error("Empty response received for checklist fetch.");throw t.fetchCache.set(e,{status:L,error:n||r}),r})).catch((function(n){throw t.fetchCache.set(e,{status:L,error:n}),n})).finally((function(){t.fetchRequests.delete(e)}));return this.fetchRequests.set(e,a),a.then((function(e){return JSON.parse(JSON.stringify(e))}))}}])&&C(t.prototype,n),r&&C(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();I(O,"instance",null);const A=O;function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function P(e,t){for(var n=0;n0&&!zs.getInstance().isOpened()?(t.classList.remove(n),t.innerText=e):t.classList.add(n)}}},{key:"refresh",value:function(){document.querySelector(".bb-feedback-button")?(this.updateFeedbackButtonText(),this.updateFeedbackButtonState()):(this.injectedFeedbackButton=!1,this.feedbackButton=null,this.buttonHidden=null,this.lastButtonIcon=null,this.injectFeedbackButton())}},{key:"updateFeedbackButtonText",value:function(){var t=br.getInstance().getFlowConfig();if(t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC||t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_BOTTOM||t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_LEFT){var n=document.querySelector(".bb-feedback-button-classic");n&&(n.innerText=t.widgetButtonText)}}},{key:"updateFeedbackButtonState",value:function(){var t=this;if(Pn.getInstance().updateUIVisibility(),null!==this.feedbackButton){var n=br.getInstance().getFlowConfig(),r="";r=n.buttonLogo?''):fe("button","#fff");var o=["bb-feedback-button--pressed","bb-feedback-button--springing"].filter((function(e){return t.feedbackButton.classList.contains(e)}));this.feedbackButton.className="bb-feedback-button gleap-font rr-block",o.forEach((function(e){return t.feedbackButton.classList.add(e)})),this.feedbackButton.setAttribute("dir",Vf.getInstance().isRTLLayout?"rtl":"ltr"),n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC||n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_BOTTOM||n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_LEFT?(this.feedbackButton.classList.add("bb-feedback-button--classic-button-style"),this.feedbackButton.innerHTML='
').concat(n.widgetButtonText,"
")):r!==this.lastButtonIcon&&(this.feedbackButton.innerHTML='
'.concat(r).concat(fe("arrowdown","#fff"),'
')),this.lastButtonIcon=r;var i=!1;null===e.getInstance().buttonHidden?n.feedbackButtonPosition===e.FEEDBACK_BUTTON_NONE&&(i=!0):e.getInstance().buttonHidden&&(i=!0),i&&this.feedbackButton.classList.add("bb-feedback-button--disabled"),n.feedbackButtonPosition===e.FEEDBACK_BUTTON_BOTTOM_LEFT&&this.feedbackButton.classList.add("bb-feedback-button--bottomleft"),zs.getInstance().isOpened()&&this.feedbackButton.classList.add("bb-feedback-button--open");var a=zs.getInstance().appMode;"survey"!==a&&"survey_full"!==a&&"survey_web"!==a||this.feedbackButton.classList.add("bb-feedback-button--survey"),!0!==n.hideForGuests||vs.getInstance().isUser()||this.feedbackButton.classList.add("bb-feedback-button--hidden")}}}])&&P(t.prototype,n),r&&P(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e,t,n){return t=function(e){var t=function(e,t){if("object"!=F(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==F(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}R(_,"FEEDBACK_BUTTON_BOTTOM_RIGHT","BOTTOM_RIGHT"),R(_,"FEEDBACK_BUTTON_BOTTOM_LEFT","BOTTOM_LEFT"),R(_,"FEEDBACK_BUTTON_CLASSIC","BUTTON_CLASSIC"),R(_,"FEEDBACK_BUTTON_CLASSIC_LEFT","BUTTON_CLASSIC_LEFT"),R(_,"FEEDBACK_BUTTON_CLASSIC_BOTTOM","BUTTON_CLASSIC_BOTTOM"),R(_,"FEEDBACK_BUTTON_NONE","BUTTON_NONE"),R(_,"instance",void 0);var B=/^[A-Za-z0-9+/=_-]{1,256}$/,U=function(e){if("string"!=typeof e)return null;var t=e.trim();return B.test(t)?t:null},H=function(){try{if("undefined"==typeof document)return null;var e=document.currentScript;if(e){var t=U(e.nonce||e.getAttribute("nonce"));if(t)return t}var n=document.querySelector('script[src*="sdk.gleap.io"]');if(n)return U(n.nonce||n.getAttribute("nonce"))}catch(r){}return null}(),z=null,q=function(){return z||H},W=function(e){var t=q();if(!t||!e)return e;try{e.setAttribute("nonce",t),e.nonce=t}catch(n){}return e},G="https://docs.gleap.ai/documentation/javascript/content-security-policy",V=new Set,X="gleap-frame-route-failed",J=function(e){return"string"==typeof e&&(0===e.indexOf("script-src")||0===e.indexOf("style-src"))},K=function(e,t){if(e&&t){var n,r=!1,o=function(){if(!r){r=!0;try{e.src=t}catch(n){}}};if(!function(){try{var e,t=null===(e=window.location)||void 0===e?void 0:e.protocol;return"http:"===t||"https:"===t}catch(n){return!1}}())return o();try{if(!e.contentDocument)return o()}catch(a){return o()}try{var i=new URL(t);n=i.origin+"/"}catch(a){return o()}fetch(t,{mode:"cors",credentials:"omit"}).then((function(e){if(!e.ok)throw new Error("Bootstrap fetch failed: "+e.status);return e.text()})).then((function(r){var i=r.replace(/(\s(?:href|src)\s*=\s*["'])\/([^"'/][^"']*)/g,"$1"+n+"$2"),s=q(),c=function(e,t){return t?e.replace(/<(script|style)\b(?![^>]*\snonce\s*=)/gi,'<$1 nonce="'+t+'"'):e}(i,s),l=s?' nonce="'+s+'"':"",u="/",d="/";try{var p=new URL(t);u=(d=p.pathname)+p.search+p.hash}catch(a){}var f,h,g="try{history.replaceState(null,"",'+JSON.stringify(u)+");}catch(e){}try{if(location.pathname!=="+JSON.stringify(d)+"&&window.frameElement){window.frameElement.dispatchEvent(new Event("+JSON.stringify(X)+"));}}catch(e){}<\/script>";f=//i.test(c)?c.replace(/<\/head>/i,g+""):c;try{h=e.contentDocument}catch(a){return o()}if(!h)return o();try{e.addEventListener(X,o,{once:!0})}catch(a){}try{h.open(),function(e,t){var n=!1;try{e.addEventListener("securitypolicyviolation",(function(e){if(e&&"report"!==e.disposition){var r=e.blockedURI||"a resource",o=e.effectiveDirective||e.violatedDirective||"unknown directive",i=r+"|"+o;V.has(i)||(V.add(i),console.warn("Gleap: Your page's Content-Security-Policy blocked "+r+" ("+o+"). Gleap may not appear or work correctly until your policy allows it — see "+G)),t&&!n&&J(o)&&"string"==typeof r&&0===r.indexOf(t.baseHref)&&(n=!0,t.onBlocked())}}))}catch(a){}}(h,{baseHref:n,onBlocked:o}),h.write(f),h.close()}catch(a){o()}})).catch((function(e){V.has(t)||(V.add(t),console.warn("Gleap: Loading "+t+" failed ("+(e&&e.message?e.message:"network error")+") — falling back to loading the frame directly. If Gleap does not appear, your Content-Security-Policy may be blocking it (most often a missing connect-src entry) — see "+G)),o()}))}},$=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400;return new Promise((function(r,o){var i=0===e.indexOf("data:image/jpeg"),a=new Image;a.src=e,a.onerror=function(){o()},a.onload=function(){var e=document.createElement("canvas"),o=t,s=n;t>a.width/1.5&&(o=a.width/1.5),n>a.height/1.5&&(s=a.height/1.5);var c=a.width,l=a.height;c>l?c>o&&(l*=o/c,c=o):l>s&&(c*=s/l,l=s),e.width=c,e.height=l,e.getContext("2d").drawImage(a,0,0,c,l),r(i?e.toDataURL("image/jpeg",.7):e.toDataURL())}}))},Y=/(android|iphone|ipod|ipad|blackberry|iemobile|opera mini|webos)/i,Z=function(){return Q()?"mobile":"desktop"},Q=function(){if("undefined"==typeof window)return!1;try{var e="undefined"!=typeof navigator?navigator:void 0;if(null!=e&&e.userAgentData&&"boolean"==typeof e.userAgentData.mobile&&null!==e.userAgentData.mobile)return e.userAgentData.mobile;if(e&&Y.test(e.userAgent||e.vendor||""))return!0;if((null==e?void 0:e.maxTouchPoints)>1&&window.matchMedia){var t=window.matchMedia("(hover: none) and (pointer: coarse)");if(null!=t&&t.matches)return!0}}catch(n){}return!1},ee=function(e){if(!e)return{};if("string"==typeof e||e instanceof String)try{return JSON.parse(e)}catch(t){return{}}return e},te=function(e){if("string"==typeof e){var t=e.trim();return t.length>0?t:null}return"number"==typeof e?Number.isFinite(e)?String(e):null:"bigint"==typeof e?String(e):null},ne=function(e){try{if(!e||"object"!==F(e)||!("company"in e))return e;var t=e.company,n=function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=160?"#000000":"#ffffff"},fe=function(e,t){return"button"===e?'':"drag"===e?'\x3c!--!Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--\x3e':"unmute"===e?'':"mute"===e?'':"replay"===e?'\n \n ':"dismiss"===e?'':"blur"===e?'\n \n':"pen"===e?'\n \n \n \n \n \n \n \n \n \n \n \n \n':"rect"===e?'\n \n \n \n \n \n \n \n \n \n \n':"pointer"===e?'\n \n ':"clip"===e?'\n \n \n \n \n \n':"mic"===e?'\n \n \n \n \n ':"camera"===e?'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n':"recorderon"===e?'\n \n \n \n \n \n \n \n \n \n \n \n':"recorderoff"===e?'\n \n \n \n \n \n \n \n \n ':"arrowdown"===e?'\n \n '):"arrowleft"===e?'\n \n '):"close"===e?'\n \n '):"undo"===e?'\n \n \n \n \n \n \n \n \n \n ':"circle-dot"===e?''):"circle-question"===e?''):"circle-info"===e?''):"circle-exclamation"===e?''):"circle-up"===e?''):"circle-right"===e?''):""};function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function me(e,t){for(var n=0;n=a-i;++s)n[i]=t[s],Ce(e,t,n,s+1,o,i+1,a);else e.push(n.slice(0,i).join(""))}function Ie(e){return function(e){if(Array.isArray(e))return Ee(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ee(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:["id","class","length"];return Ie(e.attributes).reduce((function(e,n){return t.indexOf(n.nodeName)>-1||e.push("[".concat(n.nodeName,'="').concat(n.value,'"]')),e}),[])}(e,n)},Class:Se,ID:xe};return t.reduce((function(t,n){return t[n]=r[n](e),t}),{})}function _e(e,t){try{var n=e.parentNode.querySelectorAll(t);return 1===n.length&&n[0]===e}catch(r){return!1}}function je(e,t){return t.find(_e.bind(null,e))}function De(e,t,n){var r=function(e,t){for(var n=[],r=e.length,o=[],i=1;i<=t;++i)Ce(n,e,o,0,r-1,0,i);return n}(t,3),o=je(e,r);return Boolean(o)||Boolean(n)&&(o=je(e,r=r.map((function(e){return n+e}))),Boolean(o))?o:null}function Fe(e,t,n,r){var o,i=Ne(e,t,n);r&&r instanceof RegExp&&(i.ID=r.test(i.ID)?null:i.ID,i.Class=i.Class.filter((function(e){return!r.test(e)})));var a,s=Pe(t);try{for(s.s();!(a=s.n()).done;){var c=a.value,l=i.ID,u=i.Tag,d=i.Class,p=i.Attributes,f=i.NthChild;switch(c){case"ID":if(Boolean(l)&&_e(e,l))return l;break;case"Tag":if(Boolean(u)&&_e(e,u))return u;break;case"Class":if(Boolean(d)&&d.length&&(o=De(e,d,u)))return o;break;case"Attributes":if(Boolean(p)&&p.length&&(o=De(e,p,u)))return o;break;case"NthChild":if(Boolean(f))return f}}}catch(h){s.e(h)}finally{s.f()}return"*"}function Be(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.selectorTypes,o=void 0===r?["ID","Class","Tag","NthChild"]:r,i=n.attributesToIgnore,a=void 0===i?["id","class","length"]:i,s=n.excludeRegex,c=void 0===s?null:s,l=[],u=function(e){for(var t=[],n=e;Le(n);)t.push(n),n=n.parentNode;return t}(e),d=Pe(u);try{for(d.s();!(t=d.n()).done;){var p=Fe(t.value,o,a,c);Boolean(p)&&l.push(p)}}catch(y){d.e(y)}finally{d.f()}for(var f=[],h=0,g=l;h ");if(Me(e,v))return v}return null}var Ue=function(e){return'(?:[^"]*[^a-zA-Z0-9])?(?:'.concat(e.join("|"),")")},He=new RegExp(['^(?:#|\\[id=")'.concat(Ue(["v-\\d+",":r[0-9a-z]+:","(?:radix|headlessui|reach|floating-ui)-","mui-\\d+","(?:mat|cdk)-[a-z-]+-?\\d+","(?:downshift|react-select|tippy|uid|uuid)-\\d+","ember\\d+","BVID__\\d+","ext-gen\\d+","yui_\\d","[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"])),"^\\.".concat(Ue(["css-[a-z0-9]*\\d[a-z0-9]*","sc-(?=[a-zA-Z0-9]*[A-Z])[a-zA-Z0-9]{5,}","jsx-\\d+"])),"^\\.[^.]*".concat("__(?=[A-Za-z0-9]{4,}$)(?=[A-Za-z0-9]*[0-9])(?=[A-Za-z0-9]*[A-Z])[A-Za-z0-9]+$")].join("|")),ze=function(e,t){if(!e||"*"===e)return!1;try{var n=document.querySelectorAll(e);return 1===n.length&&n[0]===t}catch(r){return!1}},qe=/\d{2,}/,We=function(e){return e.replace(/\d+/g,"#")},Ge=function(e){return e.match(/(?:^\d|:)/)?'[id="'.concat(e,'"]'):"#".concat(e)},Ve=["data-testid","data-test-id","data-test","data-cy","data-qa","name"],Xe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Be,n=t(e),r=[];try{var o=function(){for(var e={},t=document.querySelectorAll("[id]"),n=0;n1?t.concat(e[n]):t}),[])}(),i="function"==typeof e.getAttribute?e.getAttribute("id"):null;i&&o.indexOf(i)<0&&!He.test(Ge(i))&&r.push(Ge(i)),r.push.apply(r,function(e){var t=(e.tagName||"").toLowerCase();return Ve.reduce((function(n,r){var o="function"==typeof e.getAttribute?e.getAttribute(r):null;if(!o||He.test("#".concat(o)))return n;var i=o.replace(/["\\]/g,"\\$&");return n.concat(["".concat(t,"[").concat(r,'="').concat(i,'"]'),"[".concat(r,'="').concat(i,'"]')])}),[])}(e));var a=o.map((function(e){return Ge(e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})),s=a.length?new RegExp("".concat(He.source,"|^(?:").concat(a.join("|"),")$")):He;r.push(t(e,{excludeRegex:s}))}catch(l){}for(var c=0;c0&&void 0!==arguments[0]&&arguments[0])||r(t.gleapCollapseUI,e)&&r(t.gleapFrameContainer,n))&&(t.gleapCollapseUI&&t.gleapCollapseUI.classList.toggle(e),t.gleapFrameContainer&&t.gleapFrameContainer.classList.toggle(n))})),it(this,"injectCollapseUI",(function(){if(!t.injectedCollapseUI){t.injectedCollapseUI=!0;var e=document.createElement("div");e.className="gleap-admin-collapse-ui",e.innerHTML='
\n '.concat(fe("arrowdown"),"\n
"),document.body.appendChild(e),t.gleapCollapseUI=e,e.addEventListener("click",(function(e){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t.toggleCollapseUI()}))}})),it(this,"injectFrame",(function(){var e;if(!t.injectedFrame){t.injectedFrame=!0;var n=document.createElement("div");n.className="gleap-admin-frame-container",n.innerHTML=''),document.body.appendChild(n),t.gleapFrameContainer=n,t.gleapFrame=document.querySelector(".gleap-admin-frame")}}))}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"logCurrentPage",value:function(){var e=window.location.href;e&&e!==this.lastUrl&&(this.lastUrl=e,this.sendMessageToTourBuilder({name:"page-changed",data:{page:e}}))}},{key:"startPageListener",value:function(){var e=this;setInterval((function(){e.logCurrentPage()}),1e3)}},{key:"initAdminHelper",value:function(){var e=this;this.initialized=!0,nu.getInstance().disable(),Wn.getInstance().disable(),gc.getInstance().disable(),oh.close(),oh.showFeedbackButton(!1),e.adminHelper=new et;try{e.adminHelper.onElementPicked=function(t){e.toggleCollapseUI(!0),e.sendMessageToTourBuilder({name:"element-picked",data:{selector:t}})}}catch(t){console.log(t)}e.injectFrame(),e.injectCollapseUI(),e.setFrameHeight("loading")}},{key:"setFrameHeight",value:function(e){if(this.gleapFrameContainer){var t="";t="picker"===e||"navigate"===e?"65px":"editor"===e?"100vh":"0px",this.gleapFrameContainer.style.height=t}}},{key:"start",value:function(){var e=this;if("undefined"!=typeof window&&!window.gleapAdminDisabled){var t=this;window.addEventListener("message",(function(n){if("https://app.gleap.io"===n.origin)try{var r=JSON.parse(n.data);if("admin"===r.type&&("load"===r.name&&(t.configData=r.data,t.initAdminHelper()),"smartlink-search-result"===r.name&&e.sendMessageToTourBuilder({name:"smartlink-search-result",data:r.data}),"translate-complete"===r.name&&e.sendMessageToTourBuilder({name:"translate-complete",data:r.data})),"tourbuilder"===r.type){var o;if("loaddata"===r.name&&e.sendMessageToTourBuilder({name:"data",data:rt(rt({},t.configData),{},{currentPage:window.location.href})}),"highlight-element"===r.name&&(document.querySelectorAll(".gleap-admin-highlight").forEach((function(e){e.classList.remove("gleap-admin-highlight")})),null!=r&&null!==(o=r.data)&&void 0!==o&&o.selector)){var i,a=document.querySelector(null==r||null===(i=r.data)||void 0===i?void 0:i.selector);a&&a.classList.add("gleap-admin-highlight")}if("smartlink-search"===r.name&&e.sendMessage({name:"smartlink-search",data:r.data}),"product-tour-started"===r.name&&e.sendMessage({name:"product-tour-started",data:r.data}),"translate"===r.name&&e.sendMessage({name:"translate",data:r.data}),"save"===r.name&&e.sendMessage({name:"save",data:r.data}),"update-steps"===r.name&&e.sendMessage({name:"update-steps",data:r.data}),"click"===r.name)try{document.querySelector(r.data.selector).click()}catch(s){console.log(s)}"status-changed"===r.name&&(t.status=r.data,e.setFrameHeight(t.status),t.adminHelper.stopPicker(),"picker"===t.status&&t.adminHelper.startPicker())}}catch(c){}})),this.sendMessage({name:"init"}),this.startPageListener()}}},{key:"sendMessage",value:function(e){try{window&&window.opener&&window.opener.postMessage(JSON.stringify(rt(rt({},e),{},{type:"admin"})),"*")}catch(t){}}},{key:"sendMessageToTourBuilder",value:function(e){try{this.gleapFrame&&this.gleapFrame.contentWindow&&this.gleapFrame.contentWindow.postMessage(JSON.stringify(rt(rt({},e),{},{type:"tourbuilder"})),"*")}catch(t){}}}])&&ot(t.prototype,n),r&&ot(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ct(e){return ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ct(e)}function lt(){lt=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(r||[]);return o(a,"_invoke",{value:E(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==ct(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(u).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function E(t,n,r){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=T(s,r);if(c){if(c===m)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=g,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dt(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._agentId=t.agentId||"kai",this._context=t.context||null,this._onChange=t.onChange||null,this._onError=t.onError||null,this._onReplyReceived=t.onReplyReceived||null,this._onConversationCreated=t.onConversationCreated||null,this._onToken=t.onToken||null,this._messages=[],this._conversationId=t.conversationId||null,this._isExecuting=!1,this._error=null,this._destroyed=!1,this._abortController=null;try{this._networkManager=x.getInstance()}catch(n){this._networkManager=null}}var t,n,r,o,i;return t=e,n=[{key:"sendMessage",value:(o=lt().mark((function e(t){var n,r,o,i,a,s,c,l=this;return lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=(t||"").trim())&&!this._isExecuting&&!this._destroyed){e.next=3;break}return e.abrupt("return");case 3:return this._messages=[].concat(ft(this._messages),[{id:"user-".concat(Date.now()),role:"user",content:n,createdAt:(new Date).toISOString()}]),r="stream-".concat(Date.now()),this._messages=[].concat(ft(this._messages),[{id:r,role:"assistant",content:"",createdAt:(new Date).toISOString(),isStreaming:!0}]),this._isExecuting=!0,this._error=null,this._notify(),o="kai"===this._agentId,i=o?this._messages.filter((function(e){return!e.isStreaming&&e.content})).map((function(e){return{role:e.role,content:e.content}})):[{role:"user",content:n}],a={messages:i},this._conversationId&&(a.conversationId=this._conversationId),this._context&&(a.additionalContext=this._context),this._abortController=new AbortController,s=!this._conversationId,c=this._messages.length-1,e.next=19,this._networkManager.streamAgent(this._agentId,a,{onMeta:function(e){l._destroyed||(e.conversationId&&(l._conversationId=e.conversationId,l._networkManager._invalidateMessagesCache(e.conversationId),s&&l._onConversationCreated&&l._onConversationCreated(e.conversationId)),e.runId&&l._messages[c]&&(l._messages[c]=dt(dt({},l._messages[c]),{},{id:e.runId})))},onToken:function(e){if(!l._destroyed){var t=l._messages[c];t&&(t.content+=e.content||""),l._notify(),l._onToken&&l._onToken(e)}},onDone:function(e){if(!l._destroyed){var t=l._messages[c];t&&(t.isStreaming=!1,e.response&&!t.content&&(t.content=e.response)),l._isExecuting=!1,l._abortController=null,l._notify(),l._onReplyReceived&&l._onReplyReceived(e)}},onError:function(e){if(!l._destroyed){var t=l._messages[c];t&&!t.content?l._messages.splice(c,1):t&&(t.isStreaming=!1),l._isExecuting=!1,l._error=e,l._abortController=null,l._notify(),l._onError&&l._onError(e)}},onToolStart:function(){},onToolEnd:function(){}},this._abortController.signal);case 19:case"end":return e.stop()}}),e,this)})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){gt(i,n,r,a,s,"next",e)}function s(e){gt(i,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)})},{key:"cancelStream",value:function(){this._abortController&&(this._abortController.abort(),this._abortController=null),this._messages=this._messages.map((function(e){return e.isStreaming?dt(dt({},e),{},{isStreaming:!1}):e})),this._messages=this._messages.filter((function(e){return e.content||"user"===e.role})),this._isExecuting=!1,this._notify()}},{key:"clearMessages",value:function(){this._messages=[],this._conversationId=null,this._isExecuting=!1,this._error=null,this.cancelStream(),x.getInstance().clearCache(),this._notify()}},{key:"setContext",value:function(e){this._context=e}},{key:"getState",value:function(){return{messages:this._messages,isExecuting:this._isExecuting,error:this._error,conversationId:this._conversationId}}},{key:"destroy",value:function(){this.cancelStream(),this._destroyed=!0,this._onChange=null,this._onError=null,this._onReplyReceived=null,this._onConversationCreated=null,this._onToken=null}},{key:"_notify",value:function(){this._onChange&&!this._destroyed&&this._onChange(this.getState())}}],n&&mt(t.prototype,n),r&&mt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();const bt=yt;var wt={eu:{apiUrl:"https://api.gleap.io",wsApiUrl:"wss://ws.gleap.io",realtimeHost:"sockets.gleap.io"},us:{apiUrl:"https://api.us.gleap.ai",wsApiUrl:"wss://ws.us.gleap.ai",realtimeHost:"sockets.us.gleap.ai"}},kt="eu";function xt(e){return xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xt(e)}function St(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if("flow-started"===e){var n=oh.getInstance();n.setGlobalDataItem("webReplay",null),n.setGlobalDataItem("screenRecordingData",null),n.takeCurrentReplay()}var r=this.getInstance().eventListeners[e];if(r)for(var o=0;o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Ht(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function qt(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function Wt(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};this.colorScheme=function(e){return e===on||e===an?e:rn}(e),this.lightBackgroundColor=hn(null==t?void 0:t.lightBackgroundColor),this.darkBackgroundColor=hn(null==t?void 0:t.darkBackgroundColor),this.updateWatching(),this.notifyChange()}},{key:"getDashboardConfig",value:function(){try{return br.getInstance().rawFlowConfig||null}catch(e){return null}}},{key:"getColorScheme",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig(),n=(e=null==t?void 0:t.colorScheme,-1!==sn.indexOf(e)?e:nn);return n===nn?nn:this.colorScheme||n}},{key:"hasDarkPalette",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig();return!!this.darkBackgroundColor||!!e&&cn.some((function(t){var n=en(t,2)[1];return null!==hn(e[n])}))}},{key:"getActiveColorScheme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig(),t=this.getColorScheme(e),n=null;return t===rn?n=this.detectedScheme||kn():t!==on&&t!==an||(n=t),n!==an||this.hasDarkPalette(e)?n:null}},{key:"applyToFlowConfig",value:function(e){var t=this.getActiveColorScheme(e);if(!e||!t)return e;if(t===on)return this.lightBackgroundColor?$t($t({},e),{},{backgroundColor:this.lightBackgroundColor}):e;var n=$t({},e);return cn.forEach((function(t){var r=en(t,2),o=r[0],i=r[1],a=hn(e[i]);a&&(n[o]=a)})),this.darkBackgroundColor&&(n.backgroundColor=this.darkBackgroundColor),ln.forEach((function(t){var r=en(t,2),o=r[0],i=r[1],a=e[i];null!=a&&(n[o]=a)})),n}},{key:"applyToChatbarStyle",value:function(e){var t=this.getActiveColorScheme();if(!t)return e;var n=!e||"light-glow"===e||"dark-glow"===e;return t===an?n?"dark-glow":"dark":n?"light-glow":"light"}},{key:"applyToChecklist",value:function(e){e&&(this.getActiveColorScheme()===an?e.setAttribute(gn,""):e.removeAttribute(gn))}},{key:"applyToChecklists",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("undefined"!=typeof document)for(var t=document.querySelectorAll("gleap-checklist"),n=0;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Cn(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function In(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Cn(i,r,o,a,s,"next",e)}function s(e){Cn(i,r,o,a,s,"throw",e)}a(void 0)}))}}function En(e){return En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},En(e)}function Tn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0];if(this._postMessageRaw({name:"chatbar-notification-clear"}),!e)try{var t;jf.getInstance().sendMessage({type:"chatbar-notification-cleared",gleapId:null===(t=vs.getInstance().session)||void 0===t?void 0:t.gleapId})}catch(n){}}},{key:"_resizeFrame",value:function(e){var t=e.width,n=e.height;if(this.chatbarContainer){if(Number.isFinite(t)&&window.innerWidth>=600){var r=window.innerWidth-20;this.chatbarContainer.style.width=Math.min(Math.ceil(t),r)+"px"}Number.isFinite(n)&&(this.chatbarContainer.style.height=Math.ceil(n)+"px"),this.isHidden||(this.chatbarContainer.style.display="block")}}},{key:"_updateBlurBackdrop",value:function(e){var t=e.visible,n=e.top,r=e.bottom,o=e.left,i=e.right,a=e.radius,s=e.dark;if(this.blurBackdrop)if(this.chatbarFrame&&(this.chatbarFrame.style.backdropFilter="",this.chatbarFrame.style.webkitBackdropFilter=""),t){var c=this.blurBackdrop.style;c.top=(null!=n?n:0)+"px",c.bottom=(null!=r?r:0)+"px",c.left=(null!=o?o:0)+"px",c.right=(null!=i?i:0)+"px",c.height="auto",c.borderRadius=(null!=a?a:20)+"px",s?(c.background="rgba(40, 40, 40, 0.55)",c.backdropFilter="blur(20px) saturate(140%) brightness(0.75)",c.webkitBackdropFilter="blur(20px) saturate(140%) brightness(0.75)"):(c.background="rgba(255, 255, 255, 0.45)",c.backdropFilter="blur(20px) saturate(150%) brightness(1.04)",c.webkitBackdropFilter="blur(20px) saturate(150%) brightness(1.04)"),c.opacity="1"}else this.blurBackdrop.style.opacity="0"}},{key:"setConfig",value:function(e){this.config=e,e.enabled?this.show():this.manuallyShown||this.hide(),this.comReady&&this._sendConfigUpdate()}},{key:"setPlaceholder",value:function(e){this.config||(this.config={}),this.config.placeholder=e,this.comReady&&this._sendConfigUpdate()}},{key:"setQuickActions",value:function(e){this.config||(this.config={}),this.config.quickActions=e,this.comReady&&this._sendConfigUpdate()}},{key:"sendAgentToolsUpdate",value:function(){this._postMessageRaw({name:"config-update",data:{config:this._withChatbarConfig(br.getInstance().getFlowConfig()),aiTools:Xt.getInstance().getAgentTools(),agentTools:Xt.getInstance().getAgentTools(),overrideLanguage:Vf.getInstance().getOverrideLanguage()}})}},{key:"_normalizeAgentOptions",value:function(e){return e&&"object"===En(e)?"context"in e||"initialQuestion"in e||"initialMessage"in e?e:{context:e}:{}}},{key:"_getDefaultAgentId",value:function(){try{var e,t;if(null!==(e=this.config)&&void 0!==e&&e.workflowId)return this.config.workflowId;var n=br.getInstance().getFlowConfig()||{};return(null==n||null===(t=n.aiBar)||void 0===t?void 0:t.workflowId)||null}catch(r){return null}}},{key:"_validateAgent",value:(i=In(Sn().mark((function e(t){var n,r,o,i,a,s,c;return Sn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=vs.getInstance(),i=o.apiUrl||wt[kt].apiUrl,a={},o.sdkKey&&(a["Api-Token"]=o.sdkKey),null!==(n=o.session)&&void 0!==n&&n.gleapId&&(a["Gleap-Id"]=o.session.gleapId),null!==(r=o.session)&&void 0!==r&&r.gleapHash&&(a["Gleap-Hash"]=o.session.gleapHash),e.next=9,fetch("".concat(i,"/v3/shared/agents/").concat(encodeURIComponent(t)),{headers:a});case 9:if((s=e.sent).ok){e.next=12;break}return e.abrupt("return",null);case 12:return e.next=14,s.json();case 14:if((c=e.sent)&&!c.error){e.next=17;break}return e.abrupt("return",null);case 17:return this.agentId=t,this.agentName=c.name||"AI Agent",e.abrupt("return",c);case 22:return e.prev=22,e.t0=e.catch(0),e.abrupt("return",null);case 25:case"end":return e.stop()}}),e,this,[[0,22]])}))),function(e){return i.apply(this,arguments)})},{key:"showWithAgent",value:(o=In(Sn().mark((function e(t,n){var r,o,i=this;return Sn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this._normalizeAgentOptions(n),this._suppressOutsideClick=!0,clearTimeout(this._suppressOutsideClickTimeout),this._suppressOutsideClickTimeout=setTimeout((function(){i._suppressOutsideClick=!1}),600),(o=t)&&"default"!==o||(o=this._getDefaultAgentId()||"kai"),!o||"kai"===o){e.next=13;break}return this.agentId=o,this.agentName=null,e.next=11,this._validateAgent(o);case 11:e.next=15;break;case 13:this.agentId="kai",this.agentName=null;case 15:r.context&&(this.agentContext=r.context),this.manuallyHidden=!1,this.manuallyShown=!0,this.show(),this.setPanelOpen(!0),this._postMessageRaw({name:"chatbar-start-agent",data:{agentId:this.agentId,agentName:this.agentName,context:this.agentContext,initialQuestion:r.initialQuestion||void 0,initialMessage:r.initialMessage||void 0}});case 21:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"updateUIVisibility",value:function(){var e;zs.getInstance().isOpened()?this.hide():null!==(e=this.config)&&void 0!==e&&e.enabled||this.manuallyShown?this.show():this.hide()}},{key:"show",value:function(){this.manuallyHidden||(this.isHidden=!1,this._preloadIframe(),this.chatbarContainer&&(this.chatbarContainer.style.display="block"))}},{key:"hide",value:function(){this.isHidden=!0,this._removeUI()}},{key:"_removeUI",value:function(){this.chatbarContainer&&(document.body&&document.body.contains(this.chatbarContainer)&&document.body.removeChild(this.chatbarContainer),this.chatbarContainer=null,this.chatbarFrame=null,this.blurBackdrop=null,this.comReady=!1,this._panelOpen=!1,this.pendingMessages=[])}},{key:"_preloadIframe",value:function(){var e=this;this.chatbarContainer||se((function(){return e._injectUI()}))}},{key:"_injectUI",value:function(){if(document.body&&!this.chatbarContainer){var e={};try{e=br.getInstance().getFlowConfig()||{}}catch(s){}if(!document.getElementById("gleap-chatbar-styles")){var t=e.feedbackButtonPosition,n="";n="BOTTOM_RIGHT"===t?"right: 60px !important;":"BOTTOM_LEFT"===t?"left: 60px !important;":"right: 0 !important;";var r=document.createElement("style");W(r),r.id="gleap-chatbar-styles",r.innerHTML="\n @media (max-width: 460px) {\n .gleap-chatbar {\n width: auto !important;\n max-width: 100% !important;\n ".concat(n,"\n }\n }\n "),document.head.appendChild(r)}var o=document.createElement("div");o.className="gleap-chatbar",o.style.cssText="\n position: fixed;\n bottom: 10px;\n z-index: 2147483000;\n border: 0;\n width: 280px;\n max-width: calc(100vw - 20px);\n overflow: visible;\n height: 80px;\n display: none;\n transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1), height 0.32s cubic-bezier(0.22, 1, 0.36, 1);\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n ";var i=document.createElement("iframe");i.className="gleap-chatbar-frame",i.title="Gleap AI Chatbar",i.setAttribute("role","dialog"),i.setAttribute("frameborder","0"),i.setAttribute("allow","autoplay; encrypted-media; microphone *;"),i.style.cssText="\n position: relative;\n width: 100%;\n height: 100%;\n border: 0;\n background: transparent;\n z-index: 1;\n ";var a=document.createElement("div");a.style.cssText="\n position: absolute;\n opacity: 0;\n transition: opacity 0.24s ease;\n background: rgba(255, 255, 255, 0.45);\n backdrop-filter: blur(20px) saturate(150%) brightness(1.04);\n -webkit-backdrop-filter: blur(20px) saturate(150%) brightness(1.04);\n transform: translateZ(0);\n will-change: backdrop-filter, transform;\n backface-visibility: hidden;\n border-radius: 20px;\n pointer-events: none;\n z-index: 0;\n ",o.appendChild(a),o.appendChild(i),document.body.appendChild(o),this.chatbarContainer=o,this.chatbarFrame=i,this.blurBackdrop=a,K(this.chatbarFrame,this.chatbarUrl)}}},{key:"destroy",value:function(){this._removeUI(),this.config=null,this.isHidden=!0,this.comReady=!1,this._panelOpen=!1,this.pendingMessages=[],this.agentId=null,this.agentName=null,this.agentContext=null,e.instance=null}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&On(t.prototype,n),r&&On(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Rn(e){return Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rn(e)}function Nn(e,t){for(var n=0;n',document.body.appendChild(t),this.bannerContainer=t;var n=t.querySelector(".gleap-b-frame");n&&K(n,this.bannerUrl)}},{key:"sendMessage",value:function(e){try{var t=document.querySelector(".gleap-b-frame");t&&t.contentWindow&&t.contentWindow.postMessage(JSON.stringify(Un(Un({},e),{},{type:"banner"})),"*")}catch(n){}}},{key:"showBanner",value:function(e){this.injectBannerUI(e)}}])&&Hn(t.prototype,n),r&&Hn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Gn(e){return Gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gn(e)}function Vn(e){return function(e){if(Array.isArray(e))return Xn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Xn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1])||arguments[1],o=(t=e.innerText||"",n=40,t.length>n?t.slice(0,n)+"...":t).replace(/(\r\n|\n|\r)/gm,"").replace(/ +(?= )/g,""),i="",a="";if(void 0!==e.getAttribute){var s=e.getAttribute("id");s&&(i=' id="'.concat(s,'"'));var c=e.getAttribute("class");c&&(a=' class="'.concat(c,'"'))}var l=(e.tagName||"").toLowerCase(),u="<",d=">";return r||(u="[",d="]"),"".concat(u).concat(l).concat(i).concat(a).concat(d).concat(o).concat(u,"/").concat(l).concat(d)}(e.target),"CLICK")}}))}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&or(t.prototype,n),r&&or(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ur(e){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ur(e)}function dr(e,t){for(var n=0;n0)for(var e=0;e0&&(t+="#"+e.id);var n="";"string"==typeof e.className?n=e.className:"function"==typeof e.getAttribute&&(n=e.getAttribute("class")||"");for(var r=n.trim().split(/\s+/).filter(Boolean).slice(0,5),o=0;o"}if(3===e.nodeType){var i=String(e.nodeValue||"").trim();return'#text "'+(i.length>40?i.slice(0,40)+"…":i)+'"'}return String(e.nodeName).toLowerCase()},Tr=function e(t,n){try{var r="Error",o="",i="";try{r=t.name?String(t.name):"Error",o=void 0!==t.message&&null!==t.message?String(t.message):"",i="string"==typeof t.stack?t.stack.trim():""}catch(u){}var a=o.length>0?r+": "+o:r,s=a;if(i.length>0)s=(o.length>0?-1!==i.indexOf(o):0===i.indexOf(r))?i:a+"\n"+i;var c,l=n||0;try{c=t.cause}catch(u){}return null!=c&&l<3&&(s+="\nCaused by: "+(Sr(c)?e(c,l+1):Nr(c,1e3))),s}catch(u){return"Error"}},Lr=function(e,t){var n=e.maxLength-e.length;if(t.length>n)throw e.parts.push(t.slice(0,Math.max(0,n))),e.length=e.maxLength,e.truncated=!0,kr;e.parts.push(t),e.length+=t.length},Or=function(e,t){var n=e.maxLength-e.length;Lr(e,JSON.stringify(t.length>n?t.slice(0,n):t))},Ar=function(e,t){try{return{value:e[t]}}catch(n){return{failed:!0}}},Mr=function(e,t,n,r,o,i){Lr(e,t);for(var a=Math.min(r,100),s=0;s0&&Lr(e,","),o(s,i+1);r>a&&Lr(e,",… "+(r-a)+" more"),Lr(e,n)},Pr=function e(t,n,r){var o=wr(n);if(null!==n)if("string"!==o)if("number"!==o&&"boolean"!==o&&"undefined"!==o)if("bigint"!==o)if("symbol"!==o)if("function"!==o)if(-1===t.seen.indexOf(n))if(Sr(n)){var i="Error",a="";try{i=String(n.name||"Error"),a=String(n.message||"")}catch(h){}Or(t,a?i+": "+a:i)}else if(Cr(n))Lr(t,Er(n));else if(function(e){return!!e&&"object"===wr(e)&&e.window===e&&!!e.document}(n))Lr(t,"[Window]");else{var s=xr(n);if("[object Date]"!==s)if("[object RegExp]"!==s)if("[object Promise]"!==s&&"[object WeakMap]"!==s&&"[object WeakSet]"!==s)if("[object ArrayBuffer]"!==s&&"[object SharedArrayBuffer]"!==s)if("undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(n))Lr(t,s.slice(8,-1)+"("+("number"==typeof n.length?n.length:n.byteLength)+")");else if(r>=t.maxDepth)Lr(t,Array.isArray(n)?"[Array]":"[Object]");else{t.seen.push(n);try{if(Array.isArray(n))return void Mr(t,"[","]",n.length,(function(r,o){var i=Ar(n,r);i.failed?Lr(t,'"[unreadable]"'):e(t,i.value,o)}),r);if("[object Map]"===s){var c=[];return n.forEach((function(e,t){c.length<100&&c.push([t,e])})),void Mr(t,"Map("+n.size+"){","}",n.size,(function(n,r){e(t,c[n][0],r),Lr(t," => "),e(t,c[n][1],r)}),r)}if("[object Set]"===s){var l=[];return n.forEach((function(e){l.length<100&&l.push(e)})),void Mr(t,"Set("+n.size+")[","]",n.size,(function(n,r){return e(t,l[n],r)}),r)}if("function"==typeof n.toJSON){var u;try{u=n.toJSON()}catch(h){u=n}if(u!==n)return void e(t,u,r)}var d=Object.keys(n),p=function(e){try{var t=Object.getPrototypeOf(e);if(!t||t===Object.prototype)return"";var n=t.constructor;return n&&"string"==typeof n.name&&"Object"!==n.name?n.name:""}catch(h){return""}}(n);Mr(t,(p?p+" ":"")+"{","}",d.length,(function(r,o){Or(t,d[r]),Lr(t,":");var i=Ar(n,d[r]);i.failed?Lr(t,'"[unreadable]"'):e(t,i.value,o)}),r)}finally{t.seen.pop()}}else Lr(t,s.slice(8,-1)+"("+n.byteLength+")");else Lr(t,s.slice(8,-1));else Lr(t,String(n));else{var f=n.getTime();Or(t,isNaN(f)?"Invalid Date":n.toISOString())}}else Lr(t,'"[Circular]"');else Lr(t,Ir(n));else Lr(t,n.toString());else Lr(t,n.toString()+"n");else Lr(t,String(n));else Or(t,n);else Lr(t,"null")},Rr=function(e,t,n){var r=function(e,t){return{parts:[],length:0,maxLength:e,maxDepth:t,seen:[],truncated:!1}}(t,"number"==typeof n?n:1/0);try{Pr(r,e,0)}catch(o){if(o!==kr)return{text:r.parts.join("")+"[unserializable]",truncated:!1}}return{text:r.parts.join(""),truncated:r.truncated}},Nr=function(e,t){var n="number"==typeof t&&t>0?t:5e3;try{if("string"==typeof e)return e.length>n?e.slice(0,n):e;if(null==e||"number"==typeof e||"boolean"==typeof e)return String(e);if("bigint"==typeof e)return e.toString()+"n";if("symbol"===wr(e))return e.toString();if("function"==typeof e)return Ir(e);if(Sr(e)){var r=Tr(e);return r.length>n?r.slice(0,n):r}if(Cr(e))return Er(e);if("[object Date]"===xr(e)){var o=e.getTime();return isNaN(o)?"Invalid Date":e.toISOString()}return Rr(e,n,4).text}catch(i){try{return xr(e)}catch(a){return"[unserializable]"}}},_r=function(e){try{return"bigint"==typeof e?e:"symbol"===wr(e)?NaN:Number(e)}catch(t){return NaN}},jr=function(e){var t=_r(e);return"bigint"==typeof t?t.toString()+"n":isNaN(t)?"NaN":String(t<0?Math.ceil(t):Math.floor(t))},Dr=function(e){var t=_r(e);return String("bigint"==typeof t?Number(t):t)},Fr=function(e,t){var n="number"==typeof t&&t>0?t:5e3;try{if(!e||0===e.length)return"";var r="",o=0,i=e[0];if("string"==typeof i&&e.length>1&&-1!==i.indexOf("%")){o=1;for(var a=0;a=e.length)r+=s;else{var l=e[o++];a++;var u=Math.max(1,n-r.length);"s"===c?r+=Nr(l,u):"d"===c||"i"===c?r+=jr(l):"f"===c?r+=Dr(l):"c"!==c&&(r+="string"==typeof l?JSON.stringify(l.slice(0,u)):Nr(l,u))}else r+="%",a++}else r+=s}}for(;o0&&(r+=" "),r+=Nr(e[o],Math.max(1,n-r.length));return r.length>n?r.slice(0,n):r}catch(d){return"[unserializable console arguments]"}};function Br(e){return Br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Br(e)}function Ur(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"INFO";if(null!=e&&("string"!=typeof e&&(e=Nr(e,Gr)),!(e.length<=0)))for(this.logArray.push({log:Vr(e,t),date:(new Date).toISOString(),priority:t});this.logArray.length>this.logMaxLength;)this.logArray.shift()}},{key:"addLogWithArgs",value:function(e,t){!e||e.length<=0||this.addLog(Fr(e,Gr),t)}},{key:"capture",value:function(e){if(!this.disabled&&!this.capturing){this.capturing=!0;try{e()}catch(t){}finally{this.capturing=!1}}}},{key:"wrapConsoleMethod",value:function(e,t,n){var r=e[t];if("function"==typeof r&&!r.__gleapConsoleWrapper){var o=function(){return n(arguments),r.apply(e,arguments)};o.__gleapConsoleWrapper=!0,this.originalConsoleMethods[t]=r,this.consoleWrappers[t]=o,e[t]=o}}},{key:"start",value:function(){var e=this;if(!this.disabled&&!this.started&&"undefined"!=typeof window){this.started=!0;var t=this,n=window.console;if(n){for(var r=Object.keys(qr),o=function(){var o=r[i];e.wrapConsoleMethod(n,o,(function(e){t.capture((function(){return t.addLogWithArgs(e,qr[o])}))}))},i=0;i0&&e[0]||t.capture((function(){var n=Fr(Array.prototype.slice.call(e,1),Gr);t.addLog("Assertion failed"+(n?": "+n:""),"ERROR")}))}))}try{this.errorListener=function(e){t.capture((function(){return t.addUncaughtError(e)}))},this.rejectionListener=function(e){t.capture((function(){var n=e?e.reason:void 0;t.addLog("Unhandled promise rejection: "+Nr(n,Gr),"ERROR")}))},window.addEventListener("error",this.errorListener),window.addEventListener("unhandledrejection",this.rejectionListener)}catch(a){}}}},{key:"addUncaughtError",value:function(e){if(e&&("undefined"==typeof ErrorEvent||e instanceof ErrorEvent)){var t,n=e.error;t=n&&"object"===Br(n)&&"string"==typeof n.stack&&n.stack.length>0?Tr(n):null!=n?Nr(n,Gr)+Xr(e):String(e.message||"Script error.").replace(/^Uncaught\s+/,"")+Xr(e),this.addLog("Uncaught "+t,"ERROR")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Ur(t.prototype,n),r&&Ur(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Kr(e){return Kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kr(e)}function $r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yr(e){for(var t=1;t=0)return null;if(function(e){if("password"===bo(e))return!0;var t=e.getAttribute&&e.getAttribute("autocomplete");return!!t&&t.toLowerCase().split(/\s+/).some((function(e){return po.indexOf(e)>=0}))}(e)||function(e,t){return function(e,t){for(var n=e;n;){if(1===n.nodeType&&t(n))return!0;n=n.parentElement||n.parentNode&&n.parentNode.host||null}return!1}(e,(function(e){return xo(e,t)||wo(e,'[gleap-ignore="value"]')}))}(e,t))return yo;if(!function(e,t){var n=So(t);return!(!n[e.tagName?e.tagName.toLowerCase():""]&&!n[bo(e)])}(e,t))return null;var n=t.maskInputFn;return"function"!=typeof n?yo:function(t){try{return n(t,e)}catch(r){return yo(t)}}},Io=function(e){return String(e).replace(/[\S]/g,"*")},Eo=function(e){var t=e&&e.maskTextFn;return"function"!=typeof t?Io:function(e,n){try{var r=t(e,n);return"string"==typeof r?r:Io(e)}catch(o){return Io(e)}}};function To(e){return To="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},To(e)}function Lo(){Lo=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(r||[]);return o(a,"_invoke",{value:E(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==To(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(u).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function E(t,n,r){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=T(s,r);if(c){if(c===m)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=g,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Oo(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function Ao(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Oo(i,r,o,a,s,"next",e)}function s(e){Oo(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Mo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Po(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Po(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Po(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"),e&&e.childNodes&&e.childNodes.length>0)for(var r=0;r1?t-1:0),o=1;o0&&(n--,t+=e[r]):t+=e[r];return t}(n)},Bo=function(e,t){for(var n,r=[],o=function(){var e=document.styleSheets[i];if(e.media&&"print"===e.media.mediaText)return 1;var o=Fo(e);if(e&&e.ownerNode)if(""!=o){var a=document.getElementsByTagName("base");n=a.length?a[0].href.substr(location.origin.length,999):window.location.href.split(/[?#]/)[0],e.href&&(n=e.href);var s=n.substring(0,n.lastIndexOf("/"));r.push(No(o,s,t).then((function(t){return{styletext:t,stylesheet:e,styleId:e.ownerNode.getAttribute("bb-styleid")}})))}else r.push(Promise.resolve({styletext:o,stylesheet:e,styleId:e.ownerNode.getAttribute("bb-styleid")}))},i=0;i0&&t>0&&Math.abs(e-t)>1?e/t:1};return{x:n(e.width,t.width),y:n(e.height,t.height)}},ai=function(e){for(var t=ni(e);t;t=ni(t)){var n=window.getComputedStyle(t);if(parseFloat(n.width)>0&&parseFloat(n.height)>0)return ii(t.getBoundingClientRect(),oi(t,n))}return{x:1,y:1}},si=function(e,t){return{left:e.left/t.x,right:e.right/t.x,top:e.top/t.y,bottom:e.bottom/t.y,width:e.width/t.x,height:e.height/t.y}},ci=function(e){var t=e.createElement("span");return Ko(t.style,"display","inline-block"),["margin","padding","border-width"].forEach((function(e){return Ko(t.style,e,"0")})),t},li=function e(t,n,r){return ti(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var o=window.getComputedStyle(t);if("none"!==o.display&&!Qo(o))if("contents"===o.display||Zo(o))e(t,n,r);else{var i=si(t.getBoundingClientRect(),n),a={left:i.left-$o(o,"margin-left"),right:i.right+$o(o,"margin-right"),top:i.top-$o(o,"margin-top"),bottom:i.bottom+$o(o,"margin-bottom"),verticalAlign:o.verticalAlign};0===o.display.indexOf("inline")?("baseline"!==a.verticalAlign||Xo.test(t.localName)||(a.verticalAlign="middle"),r.atomicInlines.push(a)):r.blocks.push(a)}}})),r},ui=function(e,t,n){var r=function(e){return(e.top+e.bottom)/2},o=[];n.forEach((function(e){for(var n=0,i=1;ia.bottom-a.top)&&(o[n]=e)}));for(var i=0;i=a.top+a.height/2&&e.appendChild(e.ownerDocument.createElement("br"));var s=o[i],c=ci(e.ownerDocument);Ko(c.style,"vertical-align",s?s.verticalAlign:"baseline"),Yo(c.style,t[i].width,s?s.bottom-s.top:0),e.appendChild(c)}},di=function e(t,n,r){ti(n).forEach((function(n){if(n.nodeType!==Node.TEXT_NODE){if(n.nodeType===Node.ELEMENT_NODE){var o=window.getComputedStyle(n).display;"contents"===o?e(t,n,r):"none"!==o&&t.appendChild(Ii(n,t.ownerDocument,!0,r))}}else!function(e,t){var n=ri(t);if(n.length){var r=ai(t),o=e.ownerDocument.createElement("span");Ko(o.style,"display","inline"),["margin","padding","border-width"].forEach((function(e){return Ko(o.style,e,"0")})),ui(o,n.map((function(e){return si(e,r)})),[]),e.appendChild(o)}}(t,n)}))},pi=function(e){return!("block"!==e.display&&"list-item"!==e.display||Qo(e)||ei(e)||/layout|paint|strict|content/.test(e.contain))},fi=function(e,t,n,r){if(!(t instanceof HTMLElement))return!1;var o=e.offsetTop,i=e.offsetTop+e.offsetHeight;if(t.offsetParent===e)o=0,i=e.clientHeight;else if(t.offsetParent!==e.offsetParent)return!1;var a=t.offsetTop-("relative"===n.position?$o(n,"top"):0),s="top"===r?a-o:a+t.offsetHeight-i;return Math.abs(s)<=1},hi=function(e,t,n,r){return r.push($o(t,"margin-"+n)),!pi(t)||$o(t,"padding-"+n)||$o(t,"border-"+n+"-width")||gi(e,ti(e),n,r),r},gi=function e(t,n,r,o){"bottom"===r&&n.reverse();for(var i=0;i0))return!1;if(a.nodeType===Node.ELEMENT_NODE){var s=window.getComputedStyle(a);if("none"!==s.display&&!Qo(s))if("contents"!==s.display){if(/^(inline|ruby)/.test(s.display)||!fi(t,a,s,r))return!1;if(hi(a,s,r,o),0!==a.getBoundingClientRect().height||!pi(s))return!1;hi(a,s,"top"===r?"bottom":"top",o)}else if(!e(t,ti(a),r,o))return!1}}var c;return!0},mi=function(e){return Math.max(0,Math.max.apply(null,e))+Math.min(0,Math.min.apply(null,e))},vi=null,yi=new Map,bi=function(e){var t=window.getComputedStyle(e),n=[t.fontStyle,t.fontWeight,t.fontSize,t.fontFamily].join(" ");return yi.has(n)||((vi=vi||document.createElement("canvas").getContext("2d")).font=n,yi.set(n,vi.measureText("").fontBoundingBoxAscent)),yi.get(n)},wi=function e(t,n,r){var o=ti(t);n&&o.reverse();for(var i=0;i0||t.scrollLeft>0)&&(g.setAttribute("bb-scrollpos",!0),g.setAttribute("bb-scrolltop",t.scrollTop),g.setAttribute("bb-scrollleft",t.scrollLeft)),"SELECT"!==m&&"TEXTAREA"!==m&&"INPUT"!==m||(v=Co(t,n),g.setAttribute("bb-data-value",v?v(t.value):t.value),v&&g.hasAttribute("value")&&g.setAttribute("value",v(g.getAttribute("value"))),"checkbox"!==t.type&&"radio"!==t.type||!t.checked||g.setAttribute("bb-data-checked",!0))),c.appendChild(g),!t.shadowRoot){e.next=43;break}return x=r,r++,zo(o,t.shadowRoot),e.next=41,h(t.shadowRoot.firstChild,g,x);case 41:Ho(t.shadowRoot,g,x),void 0!==g.setAttribute&&g.setAttribute("bb-shadow-parent",x);case 43:if(v&&"TEXTAREA"===m){e.next=46;break}return e.next=46,h(t.firstChild,g);case 46:if(v&&"SELECT"===m)for(S=g.querySelectorAll("option[selected]"),C=0;C0){for(u=l.childNodes;u.length>0;)l.parentNode.insertBefore(u[0],l);l.remove()}for(d=s.querySelectorAll("script, noscript"),a=0;a({x:e,y:e}),Ni={left:"right",right:"left",bottom:"top",top:"bottom"},_i={start:"end",end:"start"};function ji(e,t,n){return Ai(e,Oi(t,n))}function Di(e,t){return"function"==typeof e?e(t):e}function Fi(e){return e.split("-")[0]}function Bi(e){return e.split("-")[1]}function Ui(e){return"x"===e?"y":"x"}function Hi(e){return"y"===e?"height":"width"}const zi=new Set(["top","bottom"]);function qi(e){return zi.has(Fi(e))?"y":"x"}function Wi(e){return Ui(qi(e))}function Gi(e){return e.replace(/start|end/g,(e=>_i[e]))}const Vi=["left","right"],Xi=["right","left"],Ji=["top","bottom"],Ki=["bottom","top"];function $i(e,t,n,r){const o=Bi(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Xi:Vi:t?Vi:Xi;case"left":case"right":return t?Ji:Ki;default:return[]}}(Fi(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Gi)))),i}function Yi(e){return e.replace(/left|right|bottom|top/g,(e=>Ni[e]))}function Zi(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Qi(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ea(e,t,n){let{reference:r,floating:o}=e;const i=qi(t),a=Wi(t),s=Hi(a),c=Fi(t),l="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(c){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Bi(t)){case"start":f[a]-=p*(n&&l?-1:1);break;case"end":f[a]+=p*(n&&l?-1:1)}return f}async function ta(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Di(t,e),h=Zi(f),g=s[p?"floating"===d?"reference":"floating":d],m=Qi(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=Qi(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:c}):v);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}const na=new Set(["left","top"]);function ra(){return"undefined"!=typeof window}function oa(e){return sa(e)?(e.nodeName||"").toLowerCase():"#document"}function ia(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function aa(e){var t;return null==(t=(sa(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function sa(e){return!!ra()&&(e instanceof Node||e instanceof ia(e).Node)}function ca(e){return!!ra()&&(e instanceof Element||e instanceof ia(e).Element)}function la(e){return!!ra()&&(e instanceof HTMLElement||e instanceof ia(e).HTMLElement)}function ua(e){return!(!ra()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ia(e).ShadowRoot)}const da=new Set(["inline","contents"]);function pa(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ca(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!da.has(o)}const fa=new Set(["table","td","th"]);function ha(e){return fa.has(oa(e))}const ga=[":popover-open",":modal"];function ma(e){return ga.some((t=>{try{return e.matches(t)}catch(n){return!1}}))}const va=["transform","translate","scale","rotate","perspective"],ya=["transform","translate","scale","rotate","perspective","filter"],ba=["paint","layout","strict","content"];function wa(e){const t=ka(),n=ca(e)?Ca(e):e;return va.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||ya.some((e=>(n.willChange||"").includes(e)))||ba.some((e=>(n.contain||"").includes(e)))}function ka(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const xa=new Set(["html","body","#document"]);function Sa(e){return xa.has(oa(e))}function Ca(e){return ia(e).getComputedStyle(e)}function Ia(e){return ca(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ea(e){if("html"===oa(e))return e;const t=e.assignedSlot||e.parentNode||ua(e)&&e.host||aa(e);return ua(t)?t.host:t}function Ta(e){const t=Ea(e);return Sa(t)?e.ownerDocument?e.ownerDocument.body:e.body:la(t)&&pa(t)?t:Ta(t)}function La(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Ta(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=ia(o);if(i){const e=Oa(a);return t.concat(a,a.visualViewport||[],pa(o)?o:[],e&&n?La(e):[])}return t.concat(o,La(o,[],n))}function Oa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Aa(e){const t=Ca(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=la(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Mi(n)!==i||Mi(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Ma(e){return ca(e)?e:e.contextElement}function Pa(e){const t=Ma(e);if(!la(t))return Ri(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Aa(t);let a=(i?Mi(n.width):n.width)/r,s=(i?Mi(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Ra=Ri(0);function Na(e){const t=ia(e);return ka()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ra}function _a(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ma(e);let a=Ri(1);t&&(r?ca(r)&&(a=Pa(r)):a=Pa(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ia(e))&&t}(i,n,r)?Na(i):Ri(0);let c=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=ia(i),t=r&&ca(r)?ia(r):r;let n=e,o=Oa(n);for(;o&&r&&t!==n;){const e=Pa(o),t=o.getBoundingClientRect(),r=Ca(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=i,l+=a,n=ia(o),o=Oa(n)}}return Qi({width:u,height:d,x:c,y:l})}function ja(e,t){const n=Ia(e).scrollLeft;return t?t.left+n:_a(aa(e)).left+n}function Da(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ja(e,n),y:n.top+t.scrollTop}}const Fa=25;const Ba=new Set(["absolute","fixed"]);function Ua(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ia(e),r=aa(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;const e=ka();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}const l=ja(r);if(l<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=Fa&&(i-=a)}else l<=Fa&&(i+=l);return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=aa(e),n=Ia(e),r=e.ownerDocument.body,o=Ai(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ai(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ja(e);const s=-n.scrollTop;return"rtl"===Ca(r).direction&&(a+=Ai(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(aa(e));else if(ca(t))r=function(e,t){const n=_a(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=la(e)?Pa(e):Ri(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Na(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Qi(r)}function Ha(e,t){const n=Ea(e);return!(n===t||!ca(n)||Sa(n))&&("fixed"===Ca(n).position||Ha(n,t))}function za(e,t,n){const r=la(t),o=aa(t),i="fixed"===n,a=_a(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Ri(0);function l(){c.x=ja(o)}if(r||!r&&!i)if(("body"!==oa(t)||pa(o))&&(s=Ia(t)),r){const e=_a(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&l();i&&!r&&o&&l();const u=!o||r||i?Ri(0):Da(o,s);return{x:a.left+s.scrollLeft-c.x-u.x,y:a.top+s.scrollTop-c.y-u.y,width:a.width,height:a.height}}function qa(e){return"static"===Ca(e).position}function Wa(e,t){if(!la(e)||"fixed"===Ca(e).position)return null;if(t)return t(e);let n=e.offsetParent;return aa(e)===n&&(n=n.ownerDocument.body),n}function Ga(e,t){const n=ia(e);if(ma(e))return n;if(!la(e)){let t=Ea(e);for(;t&&!Sa(t);){if(ca(t)&&!qa(t))return t;t=Ea(t)}return n}let r=Wa(e,t);for(;r&&ha(r)&&qa(r);)r=Wa(r,t);return r&&Sa(r)&&qa(r)&&!wa(r)?n:r||function(e){let t=Ea(e);for(;la(t)&&!Sa(t);){if(wa(t))return t;if(ma(t))return null;t=Ea(t)}return null}(e)||n}const Va={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=aa(r),s=!!t&&ma(t.floating);if(r===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=Ri(1);const u=Ri(0),d=la(r);if((d||!d&&!i)&&(("body"!==oa(r)||pa(a))&&(c=Ia(r)),la(r))){const e=_a(r);l=Pa(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?Ri(0):Da(a,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}},getDocumentElement:aa,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?ma(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=La(e,[],!1).filter((e=>ca(e)&&"body"!==oa(e))),o=null;const i="fixed"===Ca(e).position;let a=i?Ea(e):e;for(;ca(a)&&!Sa(a);){const t=Ca(a),n=wa(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&Ba.has(o.position)||pa(a)&&!n&&Ha(e,a))?r=r.filter((e=>e!==a)):o=t,a=Ea(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce(((e,n)=>{const r=Ua(t,n,o);return e.top=Ai(r.top,e.top),e.right=Oi(r.right,e.right),e.bottom=Oi(r.bottom,e.bottom),e.left=Ai(r.left,e.left),e}),Ua(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Ga,getElementRects:async function(e){const t=this.getOffsetParent||Ga,n=this.getDimensions,r=await n(e.floating);return{reference:za(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Aa(e);return{width:t,height:n}},getScale:Pa,isElement:ca,isRTL:function(e){return"rtl"===Ca(e).direction}};function Xa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ja(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,l=Ma(e),u=o||i?[...l?La(l):[],...La(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=l&&s?function(e,t){let n,r=null;const o=aa(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=l;if(s||t(),!p||!f)return;const h={rootMargin:-Pi(d)+"px "+-Pi(o.clientWidth-(u+p))+"px "+-Pi(o.clientHeight-(d+f))+"px "+-Pi(u)+"px",threshold:Ai(0,Oi(1,c))||1};let g=!0;function m(t){const r=t[0].intersectionRatio;if(r!==c){if(!g)return a();r?a(!1,r):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==r||Xa(l,e.getBoundingClientRect())||a(),g=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(v){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(l,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),l&&!c&&h.observe(l),h.observe(t));let g=c?_a(e):null;return c&&function t(){const r=_a(e);g&&!Xa(g,r)&&n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Ka=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Fi(n),s=Bi(n),c="y"===qi(n),l=na.has(a)?-1:1,u=i&&c?-1:1,d=Di(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),c?{x:f*u,y:p*l}:{x:p*l,y:f*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},$a=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Di(e,t),u={x:n,y:r},d=await i.detectOverflow(t,l),p=qi(Fi(o)),f=Ui(p);let h=u[f],g=u[p];if(a){const e="y"===f?"bottom":"right";h=ji(h+d["y"===f?"top":"left"],h,h-d[e])}if(s){const e="y"===p?"bottom":"right";g=ji(g+d["y"===p?"top":"left"],g,g-d[e])}const m=c.fn({...t,[f]:h,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:a,[p]:s}}}}}},Ya=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=Di(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Fi(o),y=qi(s),b=Fi(s)===s,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),k=p||(b||!g?[Yi(s)]:function(e){const t=Yi(e);return[Gi(e),t,Gi(t)]}(s)),x="none"!==h;!p&&x&&k.push(...$i(s,g,h,w));const S=[s,...k],C=await c.detectOverflow(t,m),I=[];let E=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&I.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Bi(e),o=Wi(e),i=Hi(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Yi(a)),[a,Yi(a)]}(o,a,w);I.push(C[e[0]],C[e[1]])}if(E=[...E,{placement:o,overflows:I}],!I.every((e=>e<=0))){var T,L;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&y!==qi(t))||E.every((e=>qi(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:E},reset:{placement:t}}}let n=null==(L=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:L.placement;if(!n)switch(f){case"bestFit":{var O;const e=null==(O=E.filter((e=>{if(x){const t=qi(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Za=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Di(e,t)||{};if(null==l)return{};const d=Zi(u),p={x:n,y:r},f=Wi(o),h=Hi(f),g=await a.getDimensions(l),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[f]-p[f]-i.floating[h],k=p[f]-i.reference[f],x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l));let S=x?x[b]:0;S&&await(null==a.isElement?void 0:a.isElement(x))||(S=s.floating[b]||i.floating[h]);const C=w/2-k/2,I=S/2-g[h]/2-1,E=Oi(d[v],I),T=Oi(d[y],I),L=E,O=S-g[h]-T,A=S/2-g[h]/2+C,M=ji(L,A,O),P=!c.arrow&&null!=Bi(o)&&A!==M&&i.reference[h]/2-(A{const r=new Map,o={platform:Va,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=ea(l,r,c),p=r,f={},h=0;for(let m=0;m0)},rs=function(e,t){var n=(t.pageRules&&t.pageRules.length>0?t.pageRules:t.pageFilter?[{pageFilter:t.pageFilter,pageFilterType:t.pageFilterType}]:[]).filter(ns);if(0===n.length)return!0;var r=n.filter((function(e){return!ts.includes(e.pageFilterType)})),o=n.filter((function(e){return ts.includes(e.pageFilterType)})),i=0===r.length||r.some((function(t){return es(e,t.pageFilter,t.pageFilterType)})),a=0===o.length||o.every((function(t){return es(e,t.pageFilter,t.pageFilterType)}));return i&&a};function os(e){return os="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},os(e)}function is(e){return function(e){if(Array.isArray(e))return as(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return as(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return as(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function as(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n'):""),i.appendChild(a),t.repositionHotspot(e,n),o=a,t.elementToTooltipMap.set(e,n)}else o=e;var s=t.createTooltip(o,n.html,n);t.elementToFloatingUIMap.set(e,s)}}})),cs(this,"updateFilteredTooltips",(function(){t.filteredTooltips=t.getFilteredTooltips(),t.checkForTooltips()})),cs(this,"getFilteredTooltips",(function(){if(!t.tooltips)return[];var e=window.location.href;return t.tooltips.filter((function(t){return t.pageRules&&t.pageRules.length>0?rs(e,{pageRules:t.pageRules}):!t.page||0===t.page.length||!!es(e,t.page,t.pageType)}))})),cs(this,"checkForTooltips",(function(){for(var e=0;e0&&this.filteredTooltips.forEach((function(n){n.selector&&e.matches(n.selector)&&t.linkTooltip(e,n)}))}},{key:"start",value:function(){var e=this,t=this;if(window){var n,r,o,i=(n=t.updateHotspotPositions.bind(t),r=250,o=null,function(){if(!o){var e=this,t=arguments;o=setTimeout((function(){n.call.apply(n,[e].concat(is(t))),o=null}),r)}});window.addEventListener("resize",i),window.requestAnimationFrame((function(){e.observer=new MutationObserver((function(n){t.lastUrl!==window.location.href&&(t.lastUrl=window.location.href,t.filteredTooltips=t.getFilteredTooltips()),n.forEach((function(n){if("attributes"===n.type){var r=n.target;r.nodeType===Node.ELEMENT_NODE&&(r.querySelector("[data-gleap-tooltip-hotspot]")||r.hasAttribute("data-gleap-tooltip-mode")||r.hasAttribute("data-gleap-tooltip"))&&t.updateHotspotPositions()}n.addedNodes.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&t.processNodeInsertion(e)})),n.removedNodes.forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE&&e.elementToFloatingUIMap.has(t)){var n=e.elementToFloatingUIMap.get(t);n&&(n.tooltip&&n.tooltip.remove(),n.cleanup(),e.elementToFloatingUIMap.delete(t))}e.elementToTooltipMap.has(t)&&e.elementToTooltipMap.delete(t)}))}))})),e.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]})}))}}},{key:"updateHotspotPositions",value:function(){var e=this;document.querySelectorAll("[data-gleap-tooltip-mode='hotspot']").forEach((function(t){var n=e.elementToTooltipMap.get(t);n&&e.repositionHotspot(t,n)}))}},{key:"createTooltip",value:function(e,t,n){var r=document.createElement("div");r.className="gleap-tooltip",r.innerHTML='
\n '.concat(t,'\n
\n \n \n \n
\n
'),document.body.appendChild(r);var o,i=r.querySelector(".gleap-tooltip-arrow"),a=Ja(e,r,(function(){Qa(e,r,{placement:"left"===n.posX?"left":"right",middleware:[Ka(10),Ya(),$a(),Za({element:i})]}).then((function(e){var t=e.x,n=e.y,o=e.middlewareData,a=e.placement;try{if(Object.assign(r.style,{left:"".concat(t,"px"),top:"".concat(n,"px")}),o.arrow){var s={left:"",top:"",transform:""};null!=o.arrow.x&&(s.left="".concat(o.arrow.x,"px"),"bottom"===a?(s.transform="translateY(-7px) rotate(180deg)",s.top="".concat(-20,"px")):"top"===a&&(s.transform="translateY(7px) rotate(0deg)",s.top="100%")),null!=o.arrow.y&&(s.top="".concat(o.arrow.y,"px"),"right"===a?(s.transform="translateX(-7px) rotate(90deg)",s.left="".concat(-20,"px")):"left"===a&&(s.transform="translateX(7px) rotate(270deg)",s.left="100%")),Object.assign(i.style,s)}}catch(c){}}))}));function s(){clearTimeout(o),r.style.visibility="visible",r.style.opacity="1",r.style.pointerEvents="auto"}function c(){o=setTimeout((function(){r.style.opacity="0",setTimeout((function(){r.style.visibility="hidden",r.style.pointerEvents="none"}),200)}),500)}return e.addEventListener("mouseenter",s),e.addEventListener("mouseleave",c),r.addEventListener("mouseenter",s),r.addEventListener("mouseleave",c),e.addEventListener("click",c),r.addEventListener("click",c),{cleanup:a,tooltip:r}}},{key:"canEmbed",value:function(e){var t=new Set(["area","base","br","embed","hr","img","input","source","track","wbr","canvas"]);return e&&!t.has(e.tagName.toLowerCase())}},{key:"destroy",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),document.querySelectorAll(".gleap-tooltip").forEach((function(e){return e.remove()})),document.querySelectorAll("[data-gleap-tooltip-anchor]").forEach((function(e){return e.remove()})),document.querySelectorAll("[data-gleap-tooltip-hotspot]").forEach((function(e){return e.remove()})),document.querySelectorAll("[data-gleap-tooltip]").forEach((function(e){return e.removeAttribute("data-gleap-tooltip")})),document.querySelectorAll("[data-gleap-tooltip-mode]").forEach((function(e){return e.removeAttribute("data-gleap-tooltip-mode")})),this.elementToFloatingUIMap=new WeakMap,this.elementToTooltipMap=new WeakMap,this.tooltips=[],this.filteredTooltips=[]}},{key:"repositionHotspot",value:function(e,t){if(e&&t){var n=e.getAttribute("data-gleap-tooltip");if(n){var r=document.querySelector('[data-gleap-tooltip-hotspot="'.concat(n,'"]'));if(r){t.posX||(t.posX="right"),t.posY||(t.posY="center"),t.offsetX||(t.offsetX=4),t.offsetY||(t.offsetY=0);var o=e.getBoundingClientRect();try{var i=document.createRange();i.selectNodeContents(e);var a=window.getComputedStyle(e),s=i.getBoundingClientRect().width+parseFloat(a.paddingLeft);s0&&void 0!==arguments[0]?arguments[0]:0,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(clearTimeout(t.fileRefreshTimeout),t.openingProtectedFile=null,null!==(e=t.session)&&void 0!==e&&e.fileAccessToken)try{var o=new XMLHttpRequest;o.open("POST",t.apiUrl+"/files/session/revoke"),o.setRequestHeader("X-File-Session",t.session.fileAccessToken),o.send()}catch(i){}t.session&&t.session.gleapHash&&Ft.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash));try{ae("session-".concat(t.sdkKey),null)}catch(a){}if(t.useCookies)try{!function(e){try{var t=oe(window.location.host.split(":")[0]);document.cookie=e+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT; Domain="+t}catch(a){}}("session-".concat(t.sdkKey))}catch(a){}t.ready=!1,t.session={gleapId:null,gleapHash:null,name:"",email:"",userId:"",phone:"",value:0},t.lastIdentify=null,t.identifyInFlight=!1,zs.getInstance().sendMessage({name:"session-cleared"},!0),bl.getInstance().clearAllNotifications(!1),bl.getInstance().setNotificationCount(0),Wn.getInstance().removeBannerUI(),gc.getInstance().hideModal(),r&&t.scheduleSessionRetry(n)})),gs(this,"scheduleSessionRetry",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!isNaN(e)){var n=10*Math.pow(e,2);setTimeout((function(){t.startSession(e+1)}),1e3*n)}})),gs(this,"openRequestedProtectedFile",(function(){var e,n=new URLSearchParams((null===(e=window.location)||void 0===e?void 0:e.search)||"").get("gleapFile");if(/^[a-f0-9]{24}$/.test(n||"")&&t.openingProtectedFile!==n){t.openingProtectedFile=n;var r=t.session.fileAccessToken,o=new XMLHttpRequest;o.open("GET","".concat(t.apiUrl,"/files/").concat(n,"/location")),o.setRequestHeader("X-File-Session",t.session.fileAccessToken),o.onload=function(){var e;if((null===(e=t.session)||void 0===e?void 0:e.fileAccessToken)===r)if(200===o.status)try{var n=JSON.parse(o.responseText).shareToken,i=zs.getInstance();i.setAppMode("widget"),i.sendMessage({name:"open-conversation",data:{shareToken:n}},!0),i.showWidget()}catch(a){t.openingProtectedFile=null}else t.openingProtectedFile=null},o.onerror=function(){t.openingProtectedFile=null},o.send()}})),gs(this,"validateSession",(function(e){var n,r,o,i,a,s;if(e&&e.gleapId){!e.fileAccessToken&&e.gleapId===(null===(n=t.session)||void 0===n?void 0:n.gleapId)&&e.userId===(null===(r=t.session)||void 0===r?void 0:r.userId)&&Date.parse(t.session.fileAccessExpiresAt)>Date.now()&&(e=fs(fs({},e),{},{fileAccessToken:t.session.fileAccessToken,fileAccessExpiresAt:t.session.fileAccessExpiresAt}));var c=!1;if((null===(o=t.session)||void 0===o?void 0:o.gleapId)!==(null===(i=e)||void 0===i?void 0:i.gleapId)&&(c=!0),t.session&&t.session.gleapHash&&Ft.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),t.localStorageDisabled||ae("session-".concat(t.sdkKey),e),t.useCookies&&function(e,t,n){try{var r="";if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),r="; expires="+o.toUTCString()}var i=oe(window.location.host.split(":")[0]);document.cookie=e+"="+(t||"")+r+"; path=/; domain="+i}catch(a){}}("session-".concat(t.sdkKey),encodeURIComponent(JSON.stringify(e)),365),t.session=e,t.ready=!0,e.fileAccessToken&&t.openRequestedProtectedFile(),clearTimeout(t.fileRefreshTimeout),e.fileAccessToken&&null!==(a=t.lastIdentify)&&void 0!==a&&a.userHash&&(t.fileRefreshTimeout=setTimeout((function(){if(t.lastIdentify){var e,n,r=t.lastIdentify,o=r.userId,i=r.userData,a=r.userHash;null===(e=t.identifySession(o,i,a,!0))||void 0===e||null===(n=e.catch)||void 0===n||n.call(e,(function(){}))}}),Math.max(0,Date.parse(e.fileAccessExpiresAt)-Date.now()-3e5))),t.session&&t.session.gleapHash&&Ft.notifyEvent("register-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),c&&(setTimeout((function(){A.getInstance().clearCache(),x.getInstance().clearCache(),Mf.getInstance().restart();var e=us.getInstance();if(e){try{e.destroy()}catch(t){}e.load()}}),0),"function"==typeof window.dispatchEvent&&window.dispatchEvent(new CustomEvent("session-updated"))),t.notifySessionReady(),c&&t.replayIdentifyIfNeeded(),e.authenticatedFilesRequired&&!e.fileAccessToken&&null!==(s=t.lastIdentify)&&void 0!==s&&s.userHash&&!t.identifyInFlight){var l,u,d=t.lastIdentify,p=d.userId,f=d.userData,h=d.userHash;null===(l=t.identifySession(p,f,h,!0))||void 0===l||null===(u=l.catch)||void 0===u||u.call(l,(function(){}))}}})),gs(this,"replayIdentifyIfNeeded",(function(){try{if(!t.lastIdentify||!t.lastIdentify.userId)return;if(t.identifyInFlight)return;if(t.session&&t.session.userId)return;var e=t.lastIdentify,n=e.userId,r=e.userData,o=e.userHash,i=t.identifySession(n,r,o);i&&"function"==typeof i.catch&&i.catch((function(){}))}catch(a){}})),gs(this,"startSession",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{if(t.useCookies){var n=function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r0)){var o=ie("session-".concat(t.sdkKey));o&&t.validateSession(o)}var i=t,a=new XMLHttpRequest;a.open("POST",i.apiUrl+"/sessions"),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.setRequestHeader("Api-Token",i.sdkKey);try{t.session&&t.session.gleapId&&t.session.gleapHash&&(a.setRequestHeader("Gleap-Id",t.session.gleapId),a.setRequestHeader("Gleap-Hash",t.session.gleapHash))}catch(s){}a.onreadystatechange=function(t){if(4===a.readyState)if(200===a.status||201===a.status)try{var n=JSON.parse(a.responseText);i.validateSession(n)}catch(s){}else 429!==a.status&&(!(a.status>=400&&a.status<500)&&i.session&&i.session.gleapId?i.scheduleSessionRetry(e):i.clearSession(e,!0))},a.send(JSON.stringify({lang:Vf.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}))})),gs(this,"checkIfSessionNeedsUpdate",(function(e,n){if(!t.session||!t.session.userId||!e)return!0;try{if(t.session.userId.toString()!==e.toString())return!0}catch(r){}return t.checkIfSessionDataNeedsUpdate(n)})),gs(this,"checkIfSessionDataNeedsUpdate",(function(e){if(e)for(var n=Object.keys(e),r=0;r3&&void 0!==arguments[3]&&arguments[3];t.lastIdentify={userId:e,userData:n,userHash:r};var s=t.checkIfSessionNeedsUpdate(e,n),c=!!r&&(null===(o=t.session)||void 0===o?void 0:o.authenticatedFilesRequired)&&(!(null!==(i=t.session)&&void 0!==i&&i.fileAccessToken)||Date.parse(t.session.fileAccessExpiresAt)<=Date.now());if(s||a||c){var l=t;return new Promise((function(o,i){t.setOnSessionReady((function(){if(!l.session.gleapId||!l.session.gleapHash)return i("Session not ready yet.");var t=new XMLHttpRequest;t.open("POST",l.apiUrl+"/sessions/identify"),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.setRequestHeader("Api-Token",l.sdkKey);try{t.setRequestHeader("Gleap-Id",l.session.gleapId),t.setRequestHeader("Gleap-Hash",l.session.gleapHash)}catch(s){}l.identifyInFlight=!0,t.onerror=function(){l.identifyInFlight=!1,i()},t.onreadystatechange=function(e){if(4===t.readyState)if(l.identifyInFlight=!1,200===t.status||201===t.status)try{var n=JSON.parse(t.responseText);l.validateSession(n),o(n)}catch(s){i(s)}else i()};var a=fs({},n);n.customData&&(delete a.customData,a=fs(fs({},a),n.customData)),t.send(JSON.stringify(fs(fs({},a),{},{userId:e,userHash:r,lang:Vf.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"})))}))}))}})),gs(this,"startProductTourConfig",(function(e){var n=t;return new Promise((function(r,o){t.setOnSessionReady((function(){if(!n.session.gleapId||!n.session.gleapHash)return o("Session not ready yet.");var t=new XMLHttpRequest;t.open("POST",n.apiUrl+"/outbound/producttours"),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.setRequestHeader("Api-Token",n.sdkKey);try{t.setRequestHeader("Gleap-Id",n.session.gleapId),t.setRequestHeader("Gleap-Hash",n.session.gleapHash)}catch(i){}t.onerror=function(){o()},t.onreadystatechange=function(e){if(4===t.readyState)if(200===t.status||201===t.status)try{var n=JSON.parse(t.responseText);n&&n.config&&r(n.config)}catch(i){o(i)}else o()},t.send(JSON.stringify({outboundId:e}))}))}))})),gs(this,"validateProductTour",(function(e){var n=t;return new Promise((function(r,o){t.setOnSessionReady((function(){var t;if(!n.session.gleapId||!n.session.gleapHash)return o("Session not ready yet.");var i=new XMLHttpRequest;i.open("POST",n.apiUrl+"/outbound/producttourvalidation"),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.setRequestHeader("Api-Token",n.sdkKey);try{i.setRequestHeader("Gleap-Id",n.session.gleapId),i.setRequestHeader("Gleap-Hash",n.session.gleapHash)}catch(a){}i.onerror=function(){o()},i.onreadystatechange=function(e){if(4===i.readyState)if(200===i.status||201===i.status)try{var t=JSON.parse(i.responseText);t&&"live"===t.status&&t.passedPageFilter?r(t.config):o()}catch(a){o(a)}else o()},i.send(JSON.stringify({outboundId:e,currentUrl:null===(t=window)||void 0===t||null===(t=t.location)||void 0===t?void 0:t.href}))}))}))}))}var t,n,r;return t=e,n=[{key:"setRegion",value:function(e){var t=function(e){if("string"!=typeof e)return null;var t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(wt,t)?t:null}(e);if(!t)return console.warn('Gleap: Unknown region "'.concat(e,'". Supported regions: ').concat(Object.keys(wt).join(", "),". Region not changed.")),!1;var n=wt[t];return this.region=t,this.apiUrl=n.apiUrl,this.wsApiUrl=n.wsApiUrl,this.realtimeHost=n.realtimeHost,!0}},{key:"getRegion",value:function(){return this.region}},{key:"getName",value:function(){try{return this.session.name?this.session.name.split(" ")[0].split("@")[0].split(".")[0].split("+")[0]:""}catch(e){return this.session.name}}},{key:"getSession",value:function(){return this.session}},{key:"getGleapId",value:function(){return this.session&&this.session.gleapId?this.session.gleapId:null}},{key:"isUser",value:function(){return!(!this.session||!this.session.userId)}},{key:"notifySessionReady",value:function(){if(this.onSessionReadyListener.length>0)for(var e=0;e=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function ws(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function ks(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ws(i,r,o,a,s,"next",e)}function s(e){ws(i,r,o,a,s,"throw",e)}a(void 0)}))}}function xs(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ss(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ss(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?t[0]:null}},{key:"getFirstAudioTrack",value:function(e){if(!e)return null;var t=e.getAudioTracks();return t.length>0?t[0]:null}},{key:"startScreenRecording",value:(a=ks(bs().mark((function t(){var n,r;return bs().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia&&!this.isRecording){t.next=4;break}return this.available=!1,this.rerender(),t.abrupt("return");case 4:return t.prev=4,t.next=7,navigator.mediaDevices.getDisplayMedia({video:{width:{ideal:Math.min(window.screen.width,e.MAX_WIDTH)},height:{ideal:Math.min(window.screen.height,e.MAX_HEIGHT)},frameRate:{ideal:e.IDEAL_FRAME_RATE,max:e.MAX_FRAME_RATE},displaySurface:"monitor"},audio:!1,selfBrowserSurface:"include"});case 7:if(n=t.sent,this._displayStream=n,this._displayVideoTrack=this.getFirstVideoTrack(n),this.audioMuted){t.next=15;break}return t.next=13,this.startAudioRecording();case 13:t.next=19;break;case 15:this.audioAvailable=!1,r=this.createMediaStream([this._displayVideoTrack]),this.stream=r,this.handleRecord({stream:r});case 19:this.rerender(),t.next=26;break;case 22:t.prev=22,t.t0=t.catch(4),window.alert(this.permissionErrorText),this.rerender();case 26:case"end":return t.stop()}}),t,this,[[4,22]])}))),function(){return a.apply(this,arguments)})},{key:"stopScreenRecording",value:function(){if(this.mediaRecorder&&this.stream&&this.isRecording){this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null);try{this.mediaRecorder.stop()}catch(e){}this.stopStreamTracks(this.stream),this._displayStream&&(this.stopStreamTracks(this._displayStream),this._displayStream=null),this._micStream&&(this.stopStreamTracks(this._micStream),this._micStream=null),this._displayVideoTrack=null,this.rerender()}}},{key:"startAudioRecording",value:(i=ks(bs().mark((function e(){var t,n,r,o;return bs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._displayVideoTrack){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1});case 5:t=e.sent,this._micStream=t,n=this.getFirstAudioTrack(t),this.audioMuted=!1,this.audioAvailable=!!n,r=this.createMediaStream([this._displayVideoTrack,n]),this.stream=r,this.handleRecord({stream:r}),this.rerender(),e.next=23;break;case 16:e.prev=16,e.t0=e.catch(2),this.audioAvailable=!1,o=this.createMediaStream([this._displayVideoTrack]),this.stream=o,this.handleRecord({stream:o}),this.rerender();case 23:case"end":return e.stop()}}),e,this,[[2,16]])}))),function(){return i.apply(this,arguments)})},{key:"toggleAudio",value:function(){if(this.audioMuted=!this.audioMuted,this.rerender(),this.stream)for(var e=this.stream.getAudioTracks(),t=0;t0?i.innerHTML=r.formatTime(e):(i.innerHTML="2:00",r.stopScreenRecording()):e<=0&&r.stopScreenRecording()}),e.TIMER_UPDATE_INTERVAL),this.mediaRecorder.ondataavailable=function(e){e.data&&e.data.size>0&&o.push(e.data)};var a=this.getFirstVideoTrack(n);a&&(a.onended=function(){r.prepareRecording(o)}),this.mediaRecorder.onstop=function(){r.prepareRecording(o)},this.mediaRecorder.start(e.CHUNK_INTERVAL),r.rerender()}},{key:"prepareRecording",value:function(t){var n=this.getSupportedMimeType(),r=new Blob(t,{type:n}),o=n.includes("mp4")?"mp4":"webm";this.file=new File([r],"screen-recording.".concat(o),{type:n});var i=document.querySelector(e.SELECTORS.PREVIEW_VIDEO);i&&(i.src=URL.createObjectURL(r),this.audioAvailable=this.stream?this.stream.getAudioTracks().length>0:this.audioAvailable,this.isRecording=!1,this.rerender())}}],r=[{key:"uploadScreenRecording",value:(o=ks(bs().mark((function e(t){return bs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",null);case 2:return e.abrupt("return",new Promise((function(e,n){var r=new XMLHttpRequest;r.open("POST",vs.getInstance().apiUrl+"/uploads/sdk"),vs.getInstance().injectSession(r);var o=new FormData;o.append("file",t),r.onerror=function(){n(new Error("Network error during file upload"))},r.onreadystatechange=function(){4==r.readyState&&(200==r.status?e(JSON.parse(r.response).fileUrl):n(new Error("Upload failed with status ".concat(r.status))))},r.send(o)})));case 3:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}],n&&Cs(t.prototype,n),r&&Cs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ls(e){return Ls="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ls(e)}function Os(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function As(e){for(var t=1;t0&&(e.tags=t),this.excludeData)for(var n=Object.keys(this.excludeData),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)if(t){var n=window.open(e,"_blank");n&&n.focus()}else window.location.href=e})),Us(this,"autoWhiteListCookieManager",(function(){window&&Array.isArray(window.cmp_block_ignoredomains)&&-1===window.cmp_block_ignoredomains.indexOf("messenger-app.gleap.io")&&window.cmp_block_ignoredomains.push("messenger-app.gleap.io")})),Us(this,"injectFrame",(function(){t.injectedFrame||(t.injectedFrame=!0,t.autoWhiteListCookieManager(),se((function(){br.getInstance().onConfigLoaded((function(){br.getInstance().applyStylesFromConfig();var e=document.createElement("div");e.className="gleap-frame-container gleap-frame-container--hidden rr-block",e.innerHTML='
'.concat(function(e){var t,n,r=e||{},o="image"===r.bgType&&r.bgImage&&r.bgImage.length>0,i=parseInt(r.v,10),a=i>=1&&i<=4?i:1,s=4!==a,c=null===(t=r.bgBlur)||void 0===t||t?'
':"";if(!s){var l,u=r.welcomeText?String(r.welcomeText).replace(/&/g,"&").replace(//g,">"):"",d='
\n
\n
\n
 
'.concat(u?'\n
'.concat(u,"
"):"","\n
\n
");if(o){var p=String(r.bgImage).replace(/"/g,""");return'
\n
\n
\n
\n ').concat(d,'\n
\n
\n
')}var f=null===(l=r.fadebg)||void 0===l||l;return'
\n
\n '.concat(d).concat(f?'\n
':"","\n
\n
")}if(o){var h=String(r.bgImage).replace(/"/g,"""),g=r.hideNews&&r.hideFeatureRequests&&r.hideAllConversations&&r.hideKnowledgeBase;return'
\n
\n ').concat(c,"
\n
")}if("classic"===r.bgType){var m,v=null===(m=r.fadebg)||void 0===m||m;return'
'.concat(v?'\n \n \n \n \n \n \n \n \n \n \n \n \n ':'\n \n \n \n \n \n \n \n ').concat(c,"
")}var y=null===(n=r.animateBG)||void 0===n||n;return'
\n \n \n \n \n \n \n \n \n \n \n \n \n ').concat(c,"
")}(br.getInstance().getFlowConfig()),'
'),document.body.appendChild(e);var n=e.querySelector(".gleap-frame-loader-image");if(n){var r=function(){var t=e.querySelector(".gleap-frame-loader-image-wrap");t&&t.classList.add("gleap-frame-loader-image-wrap--loaded")};n.complete&&n.naturalWidth>0?r():n.addEventListener("load",r)}t.gleapFrameContainer=e,t.gleapFrame=document.querySelector(".gleap-frame"),K(t.gleapFrame,t.frameUrl),t.updateFrameStyle(),"widget"===t.appMode&&t.showFrameContainer(!0)}))})))})),Us(this,"showImage",(function(e){se((function(){var t=document.createElement("div");t.className="gleap-image-view",t.setAttribute("tabindex","-1"),t.innerHTML='
\n \n
'),document.body.appendChild(t);var n=function(){document.removeEventListener("keydown",r,!0),t.remove()},r=function(e){"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),n())};document.addEventListener("keydown",r,!0),t.querySelector(".gleap-image-view-close").addEventListener("click",(function(){n()})),t.addEventListener("click",(function(e){e.target===t&&n()}));try{t.focus({preventScroll:!0})}catch(o){t.focus()}}))})),Us(this,"updateFrameStyle",(function(){if(t.gleapFrameContainer){for(var e="gleap-frame-container--survey",n="gleap-frame-container--extended",r="gleap-frame-container--survey-full",o="gleap-frame-container--classic",i="gleap-frame-container--classic-left",a="gleap-frame-container--modern-left",s="gleap-frame-container--no-button",c="gleap-frame-container--expanded",l=[o,i,c,n,a,s,e,r],u=0;u0&&void 0!==arguments[0]&&arguments[0];if(this.comReady){var t={expandable:this.canExpandWidget(),expanded:this.isWidgetExpanded()},n=this.lastWidgetSizeUpdate;!e&&n&&n.expandable===t.expandable&&n.expanded===t.expanded||(this.lastWidgetSizeUpdate=t,this.sendMessage({name:"widget-size-update",data:t}))}}},{key:"handleViewportResize",value:function(){this.isWidgetExpanded()!==this.appliedWidgetExpanded&&this.updateFrameStyle(),this.sendWidgetSizeUpdate()}},{key:"registerEscListener",value:function(){var e=this;this.escListener||(this.escListener=function(t){if("Escape"===(t=t||window.event).key){var n=document.querySelectorAll(".gleap-image-view");if(n.length>0)return void n[n.length-1].remove();e.hideWidget()}},document.addEventListener("keydown",this.escListener))}},{key:"unregisterEscListener",value:function(){this.escListener&&(document.removeEventListener("keydown",this.escListener),this.escListener=null)}},{key:"destroy",value:function(){this.gleapFrame&&this.gleapFrame.remove(),this.gleapFrameContainer&&this.gleapFrameContainer.remove(),this.injectedFrame=!1,this.widgetOpened=!1,this.markerManager=void 0,this.gleapFrameContainer=null,this.gleapFrame=null}},{key:"isOpened",value:function(){return this.widgetOpened||null!=this.markerManager}},{key:"showFrameContainer",value:function(e){var t,n=this;if(this.gleapFrameContainer){var r="gleap-frame-container--loading";null!==(t=this.gleapFrameContainer)&&void 0!==t&&t.classList&&(this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.gleapFrameContainer.classList.remove("gleap-frame-container--closing"),this.gleapFrameContainer.classList.remove("gleap-frame-container--hidden"),e?this.gleapFrameContainer.classList.add(r):this.gleapFrameContainer.classList.remove(r),setTimeout((function(){var e;null===(e=n.gleapFrameContainer)||void 0===e||e.classList.add("gleap-frame-container--animate")}),500)),this.widgetOpened=!0,this.updateUI()}}},{key:"runWidgetShouldOpenCallback",value:function(){this.gleapFrameContainer&&(this.workThroughQueue(),oh.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),this.showFrameContainer(!1),this.updateWidgetStatus(),Ft.notifyEvent("open"),this.registerEscListener())}},{key:"updateUI",value:function(){bl.getInstance().clearAllNotifications(this.isSurvey()),_.getInstance().updateNotificationBadge(0),_.getInstance().updateFeedbackButtonState()}},{key:"showWidget",value:function(){var t=this;setTimeout((function(){t.gleapFrameContainer?t.runWidgetShouldOpenCallback():e.getInstance().injectFrame(),t.updateUI()}),0)}},{key:"updateWidgetStatus",value:function(){this.sendMessage({name:"widget-status-update",data:{isWidgetOpen:this.widgetOpened}})}},{key:"hideMarkerManager",value:function(){this.markerManager&&(this.markerManager.clear(),this.markerManager=null)}},{key:"hideWidget",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("survey_web"!==this.appMode){if(this.hideMarkerManager(),this.gleapFrameContainer){var n=this.gleapFrameContainer;n.classList.remove("gleap-frame-container--animate"),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),n.classList.contains("gleap-frame-container--survey-full")?n.classList.add("gleap-frame-container--hidden"):(n.classList.add("gleap-frame-container--closing"),this.closeTimeout=setTimeout((function(){n.classList.add("gleap-frame-container--hidden"),n.classList.remove("gleap-frame-container--closing"),e.closeTimeout=null}),260))}t&&this.sendMessage({name:"reset-routes",data:{}}),this.widgetOpened=!1,this.updateWidgetStatus(),_.getInstance().updateFeedbackButtonState(),Ft.notifyEvent("close"),bl.getInstance().reloadNotificationsFromCache(),this.unregisterEscListener(),"undefined"!=typeof window&&void 0!==window.focus&&window.focus()}}},{key:"sendMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{this.gleapFrame=document.querySelector(".gleap-frame"),this.comReady&&this.gleapFrame&&this.gleapFrame.contentWindow?this.gleapFrame.contentWindow.postMessage(JSON.stringify(e),"*"):t&&this.queue.push(e)}catch(n){}}},{key:"sendSessionUpdate",value:function(){this.sendMessage({name:"session-update",data:{sessionData:vs.getInstance().getSession(),apiUrl:vs.getInstance().apiUrl,realtimeHost:vs.getInstance().realtimeHost,sdkKey:vs.getInstance().sdkKey}})}},{key:"sendConfigUpdate",value:function(){this.comReady&&(this.sendMessage({name:"config-update",data:{config:br.getInstance().getFlowConfig(),aiTools:Xt.getInstance().getAgentTools(),agentTools:Xt.getInstance().getAgentTools(),overrideLanguage:Vf.getInstance().getOverrideLanguage()}}),this.updateFrameStyle(),this.sendWidgetSizeUpdate(!0))}},{key:"showDrawingScreen",value:function(e){var t=this;this.hideWidget(),this.markerManager=new rc(e),this.markerManager.show((function(e){e||t.hideMarkerManager(),t.showWidget()}))}},{key:"workThroughQueue",value:function(){var e=Ds(this.queue);this.queue=[];for(var t=0;t0){Ft.notifyEvent("outbound-sent",{outboundId:v,outbound:m,formData:g});try{delete g.reportedBy}catch(n){}oh.trackEvent("outbound-".concat(v,"-submitted"),g)}})).catch((function(t){setTimeout((function(){e.sendingFeedback=!1,e.sendMessage({name:"feedback-sending-failed",data:"Something went wrong, please try again."}),Ft.notifyEvent("error-while-sending")}),1e3)}))}"start-screen-drawing"===t.name&&e.showDrawingScreen(t.data)})),window.addEventListener("message",(function(t){var n=Wn.getInstance(),r=n.bannerContainer?n.bannerContainer.querySelector(".gleap-b-frame"):null,o=e.gleapFrame&&t.source===e.gleapFrame.contentWindow,i=r&&t.source===r.contentWindow,a=t.origin===e.frameUrl,s=t.origin===n.bannerUrl;if(o||i||a||s)try{var c=JSON.parse(t.data);if("MODAL"===(null==c?void 0:c.type)||"BANNER"===(null==c?void 0:c.type)||"CHATBAR"===(null==c?void 0:c.type)||"AGENT_CONVERSATION"===(null==c?void 0:c.type))return;for(var l=0;l0&&(n.tags=r);try{e&&e.contentWindow&&e.contentWindow.postMessage(JSON.stringify({name:"collect-ticket-data",data:n}),"*")}catch(o){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Bs(t.prototype,n),r&&Bs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function qs(e){return qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qs(e)}function Ws(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Gs(this,"rerender",void 0),Gs(this,"svgElement",null),Gs(this,"path",null),Gs(this,"strPath",void 0),Gs(this,"strokeWidth",12),Gs(this,"strokeWidthRect",6),Gs(this,"bufferSize",4),Gs(this,"buffer",[]),Gs(this,"startPoint",null),Gs(this,"tool","rect"),Gs(this,"color","#EB144C"),Gs(this,"mouseDown",null),Gs(this,"mouseMove",null),Gs(this,"mouseUp",null),Gs(this,"resizeListener",null),Gs(this,"pathBuffer",[]);var o=this;this.rerender=t,this.svgElement=document.querySelector(".bb-capture-svg"),this.svgElement.style.minHeight="".concat(document.documentElement.scrollHeight,"px"),this.trackScroll=!!r,this.scrollListener=null,this.trackScroll&&(this.scrollListener=function(){o.svgElement.style.transform="translate(".concat(-window.scrollX,"px, ").concat(-window.scrollY,"px)"),o.svgElement.style.minWidth="".concat(document.documentElement.scrollWidth,"px")},this.scrollListener(),window.addEventListener("scroll",this.scrollListener,{passive:!0})),this.resizeListener=function(e){o.svgElement.style.minHeight="".concat(document.documentElement.scrollHeight,"px")},window.addEventListener("resize",this.resizeListener,!0),this.mouseDown=function(e){e.preventDefault();var t=document.querySelector(".bb-capture-toolbar-item-colorpicker");t&&(t.style.display="none"),o.fadeOutToolbar(),"pen"!==o.tool&&"blur"!==o.tool||o.mouseDownPen(e),"rect"===o.tool&&o.mouseDownRect(e)},this.mouseMove=function(e){e.preventDefault(),"pen"!==o.tool&&"blur"!==o.tool||o.mouseMovePen(e),"rect"===o.tool&&o.mouseMoveRect(e)},this.mouseUp=function(e){e.preventDefault(),o.fadeInToolbar(),"pen"!==o.tool&&"blur"!==o.tool||o.mouseUpPen(e),"rect"===o.tool&&o.mouseUpRect(e)},this.svgElement.addEventListener("mousedown",this.mouseDown),this.svgElement.addEventListener("mousemove",this.mouseMove),this.svgElement.addEventListener("mouseup",this.mouseUp),this.svgElement.addEventListener("touchstart",this.mouseDown,!1),this.svgElement.addEventListener("touchmove",this.mouseMove,!1),this.svgElement.addEventListener("touchend",this.mouseUp,!1),setTimeout((function(){n.rerender()}),100)}var t,n,r;return t=e,n=[{key:"clear",value:function(){if(this.svgElement)for(;this.svgElement.firstChild;)this.svgElement.firstChild.remove()}},{key:"destroy",value:function(){this.svgElement.removeEventListener("mousedown",this.mouseDown),this.svgElement.removeEventListener("mousemove",this.mouseMove),this.svgElement.removeEventListener("mouseup",this.mouseUp),this.svgElement.removeEventListener("touchstart",this.mouseDown),this.svgElement.removeEventListener("touchmove",this.mouseMove),this.svgElement.removeEventListener("touchend",this.mouseUp),window.removeEventListener("resize",this.resizeListener)}},{key:"destroyScrollTracker",value:function(){this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener),this.scrollListener=null)}},{key:"mouseUpPen",value:function(){this.path&&(this.path=null)}},{key:"mouseUpRect",value:function(){this.path&&(this.path=null)}},{key:"mouseMovePen",value:function(e){this.path&&(this.appendToBuffer(this.getMousePosition(e)),this.updateSvgPath())}},{key:"mouseMoveRect",value:function(e){if(this.path){var t=this.getMousePosition(e),n=Math.abs(t.x-this.startPoint.x),r=Math.abs(t.y-this.startPoint.y),o=t.x,i=t.y;t.x>this.startPoint.x&&(o=this.startPoint.x),t.y>this.startPoint.y&&(i=this.startPoint.y),this.path.setAttributeNS(null,"x",o),this.path.setAttributeNS(null,"y",i),this.path.setAttributeNS(null,"width",n),this.path.setAttributeNS(null,"height",r)}}},{key:"mouseDownRect",value:function(e){this.path=document.createElementNS("http://www.w3.org/2000/svg","rect"),this.path.setAttribute("fill","none"),this.path.setAttribute("stroke",this.color),this.path.setAttribute("stroke-linecap","round"),this.path.setAttribute("stroke-width",this.strokeWidthRect),this.startPoint=this.getMousePosition(e),this.appendPathToSvg(this.path)}},{key:"mouseDownPen",value:function(e){var t=this.color+"AA",n=this.strokeWidth;"blur"===this.tool&&(t="#000000",n=40),this.path=document.createElementNS("http://www.w3.org/2000/svg","path"),this.path.setAttribute("fill","none"),this.path.setAttribute("stroke",t),this.path.setAttribute("stroke-linecap","round"),this.path.setAttribute("stroke-width",n),this.buffer=[];var r=this.getMousePosition(e);this.appendToBuffer(r),this.strPath="M"+r.x+" "+r.y,this.path.setAttribute("d",this.strPath),this.appendPathToSvg(this.path)}},{key:"setTool",value:function(e){this.tool=e}},{key:"setColor",value:function(e){this.color=e}},{key:"getMousePosition",value:function(e){var t=this.trackScroll?window.scrollX:0,n=this.trackScroll?window.scrollY:0;return e.touches&&e.touches.length>0?{x:e.touches[0].clientX+t,y:e.touches[0].clientY+n}:{x:e.clientX+t,y:e.clientY+n}}},{key:"getAveragePoint",value:function(e){var t=this.buffer.length;if(t%2==1||t>=this.bufferSize){var n,r,o=0,i=0,a=0;for(r=e;rthis.bufferSize;)this.buffer.shift()}},{key:"appendPathToSvg",value:function(e){this.svgElement.appendChild(e),this.pathBuffer.push(e),this.rerender()}},{key:"removeLastAddedPathFromSvg",value:function(){this.pathBuffer.length<=0||!this.svgElement||(this.svgElement.removeChild(this.pathBuffer[this.pathBuffer.length-1]),this.pathBuffer.pop(),this.rerender())}},{key:"fadeOutToolbar",value:function(){var e=document.querySelector(".bb-capture-toolbar");e&&(e.style.opacity=0,e.style.pointerEvents="none")}},{key:"fadeInToolbar",value:function(){var e=document.querySelector(".bb-capture-toolbar");e&&(e.style.opacity=1,e.style.pointerEvents="auto")}}],n&&Ws(t.prototype,n),r&&Ws(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Js(e){return Js="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Js(e)}function Ks(e,t){for(var n=0;n\n \n
'.concat(fe("dismiss"),"
\n
").concat(fe("rect"),'
\n
\n
\n ').concat(fe("drag"),"\n
\n ").concat("capture"===this.type?'
\n '.concat(fe("recorderon"),"\n ").concat(fe("recorderoff"),'\n \n
\n
\n ').concat(fe("mic"),'\n \n
\n
2:00
\n
\n
\n ').concat(fe("pointer"),"\n
"):"",'\n
\n ').concat(fe("rect"),'\n
\n
\n ').concat(fe("pen"),'\n
\n
\n ').concat(fe("blur"),'\n
\n
\n
\n ').concat(Vf.translateText("pickAColor"),'\n
\n
\n ').concat(fe("undo"),'\n ').concat(Vf.translateText("undo"),"\n
\n ").concat("capture"!==this.type?'
'.concat(Vf.translateText("next"),"
"):"",'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
').concat(Vf.translateText("retry"),'
\n
').concat(Vf.translateText("next"),"
\n
\n
\n
\n "),document.body.appendChild(e),e.setAttribute("dir",Vf.getInstance().isRTLLayout?"rtl":"ltr")}},{key:"unregisterListeners",value:function(){this.escListener&&document.removeEventListener("keydown",this.escListener),this.pageLeaveListener&&window.removeEventListener("beforeunload",this.pageLeaveListener)}},{key:"registerListeners",value:function(){var e=this;this.escListener=function(t){var n=!1,r=!1;"key"in(t=t||window.event)&&(n="Escape"===t.key,r="Enter"===t.key),n&&e.dismiss(),"screenshot"===e.type&&r&&e.showNextStep()},document.addEventListener("keydown",this.escListener),this.pageLeaveListener=function(e){e.preventDefault(),e.returnValue=""},window.addEventListener("beforeunload",this.pageLeaveListener)}},{key:"show",value:function(e){this.callback=e,this.registerListeners(),this.hideWidgetUI(),this.createEditorUI(),this.setupMousePointer(),"screenshot"===this.type?(oh.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),Zs.disableScroll()):this.setupScreenRecording(),this.screenDrawer=new Xs(this.captureScreenDrawerRerender.bind(this),"screenshot"===this.type),this.setupColorPicker(),this.setupToolbar()}},{key:"setupColorPicker",value:function(){for(var t=this,n=document.querySelector(".bb-capture-toolbar-item-selectedcolor"),r=document.querySelectorAll(".bb-capture-toolbar-item-color"),o=document.querySelector(".bb-capture-toolbar-item-colorpicker"),i=function(){var i=r[a],s=i.getAttribute("data-color");i.style.backgroundColor=s,i.onclick=function(){i&&(t.screenDrawer.setColor(s),o&&(o.style.display="none"),n.style.backgroundColor=i.style.backgroundColor,e.setPenColor(s))}},a=0;a0?r.classList.remove(e):r.classList.add(e))}}},{key:"captureRenderer",value:function(){if(this.screenRecorder){this.screenRecorder.file&&oh.getInstance().setGlobalDataItem("screenRecordingData",this.screenRecorder.file);var e="bb-capture-editor-item-inactive",t=document.querySelector(".bb-capture-toolbar-item-timer"),n=document.querySelectorAll(".bb-capture-toolbar-item"),r=document.querySelector(".bb-tooltip-screen-recording"),o=document.querySelector(".bb-tooltip-audio-recording"),i=document.querySelector(".bb-capture-editor"),a="bb-capture-editor-recording",s="bb-capture-editor-notrecording";this.screenRecorder.isRecording?(i.classList.add(a),i.classList.remove(s)):(i.classList.add(s),i.classList.remove(a));var c=document.querySelector(".bb-capture-toolbar");document.querySelector(".bb-capture-preview").style.display=this.screenRecorder.file?"flex":"none",c.style.display=this.screenRecorder.file?"none":"flex";for(var l=0;l0&&-1===t.indexOf(r)&&t.push(r)}return t},Sc=function(e,t){if("string"!=typeof e||!Array.isArray(t))return!1;for(var n=0;n0&&-1!==e.indexOf(r))return!0}return!1},Cc=function(e,t){return"string"==typeof t&&-1!==e.props.indexOf(t.toLowerCase())},Ic=function(e,t){for(var n={},r=!1,o=Object.keys(e),i=0;i0&&Cc(t,c)?o=!0:r.push(a)}return o?r.join("&"):e},Ac=function(e){if(e>500)throw new Error("Network log body is nested too deeply to redact.")},Mc=function e(t,n,r){Ac(r);var o=!1;if(Array.isArray(t)){for(var i=0;i0&&-1===n.indexOf(i)&&n.push(i)}for(var a=Nc.exec(e),s=a?e.slice(0,a.index):e,c=s,l=0;l0?"?"+a:"")+(-1===n?"":e.slice(n))}(n.url,t)),n.request&&"object"===mc(n.request)&&!Array.isArray(n.request)){var r=Object.assign({},n.request),o=Tc(r.headers,"content-type");void 0!==r.headers&&(r.headers=Ec(r.headers,t)),void 0!==r.payload&&(r.payload=jc(r.payload,o,t)),n.request=r}if(n.response&&"object"===mc(n.response)&&!Array.isArray(n.response)){var i=Object.assign({},n.response),a=Tc(i.headers,"content-type");void 0!==i.headers&&(i.headers=Ec(i.headers,t)),void 0!==i.responseText&&(i.responseText=jc(i.responseText,a,t)),n.response=i}return n},Fc=function(e,t){var n=[];if(!Array.isArray(e))return n;for(var r=function(e){for(var t=xc(e).map((function(e){return e.toLowerCase()})),n=[],r=0;r0}))&&n.push(o)}return{props:t,paths:n}}(t&&t.propsToIgnore),o=xc(vc.concat(t&&t.blacklist||[])),i=0;i=55296&&n<=56319&&(t-=1),e.slice(0,t)+Zc(e.length<=1e6?function(e){for(var t=0,n=0;n=55296&&r<=56319&&n+1=56320&&o<=57343?(t+=4,n++):t+=3}else t+=3}return t}(e):void 0)},el=function(e,t){for(var n=t.toLowerCase(),r=Object.keys(e),o=0;o=2&&tl(t,String(e[n][0]),String(e[n][1]));else for(var r=Object.keys(e),o=0;o0&&tl(t,n[r].slice(0,o).trim(),n[r].slice(o+1).trim())}return t},il=function(e){var t=String(e);try{var n="undefined"!=typeof document&&document.baseURI?document.baseURI:"undefined"!=typeof window&&window.location?window.location.href:void 0;return new URL(t,n).href}catch(r){return t}},al=function(e,t,n,r){var o,i=e.byteLength>qc||"number"==typeof r&&r>qc,a=e.byteLength>qc?e.subarray(0,qc):e;try{if(n){if(-1!==(o=new TextDecoder("utf-8",{fatal:!0}).decode(a,{stream:i})).indexOf("\0"))return Gc}else o=function(e){var t=/charset\s*=\s*"?([^";\s]+)/i.exec(e||"");if(t)try{return new TextDecoder(t[1])}catch(n){}return new TextDecoder("utf-8")}(t).decode(a,{stream:i})}catch(s){return n?Gc:bc}return i?o+Zc("number"==typeof r?r:void 0):o},sl=function(e,t,n){var r=e.getReader(),o=[],i=0,a=function(e){for(var r=new Uint8Array(i),a=0,s=0;s0&&(o.push(n instanceof Uint8Array?n:new Uint8Array(n)),i+=n.byteLength),i>qc){try{r.cancel().catch((function(){}))}catch(s){}return a(!1)}return e()}))}()},cl=function(e,t,n){var r=e.size>qc?e.slice(0,150001):e;return("function"==typeof r.arrayBuffer?r.arrayBuffer():new Promise((function(e,t){var n=new FileReader;n.onload=function(){return e(n.result)},n.onerror=function(){return t(n.error)},n.readAsArrayBuffer(r)}))).then((function(r){return al(new Uint8Array(r),t,n,e.size)}))},ll=function(e,t){if(null==e)return{text:""};try{var n=Kc(t);if("stream"===n)return{text:Vc};if("string"==typeof e)return{text:"binary"===n?Gc:Qc(e)};var r=function(e){return Object.prototype.toString.call(e)}(e);if("[object URLSearchParams]"===r)return{text:Qc(e.toString())};if("[object FormData]"===r)return{text:(s=e,c={},s.forEach((function(e,t){var n;n="string"==typeof e?e.length>1e4?e.slice(0,1e4)+"… [truncated]":e:"[file "+(e&&e.name?e.name:"blob")+", "+(e&&"number"==typeof e.size?e.size:0)+" bytes"+(e&&e.type?", "+e.type:"")+"]",Object.prototype.hasOwnProperty.call(c,t)?c[t]=[].concat(c[t],n):Object.defineProperty(c,t,{value:n,enumerable:!0,writable:!0,configurable:!0})})),Qc(JSON.stringify(c)))};if("[object ReadableStream]"===r)return{text:Vc};if("[object Blob]"===r||"[object File]"===r){var o=t||e.type||"",i=Kc(o);return"stream"===i?{text:Vc}:"binary"===i?{text:Gc}:{text:Wc,promise:cl(e,o,"unknown"===i)}}if("[object ArrayBuffer]"===r||"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)){if("binary"===n)return{text:Gc};var a="[object ArrayBuffer]"===r?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{text:al(a,t,"unknown"===n,a.byteLength)}}return"[object Document]"===r||"[object HTMLDocument]"===r||"[object XMLDocument]"===r?{text:bc}:{text:"binary"===n?Gc:Qc(String(e))}}catch(l){return{text:bc}}var s,c},ul=function(e,t,n){e[t]=n.text,n.promise&&n.promise.then((function(n){e[t]=n}),(function(){e[t]=bc}))},dl=function(e){try{if(e&&"object"===zc(e)){var t=e.name?String(e.name):"Error",n=e.message?String(e.message):"";return n?t+": "+n:t}return String(e)}catch(r){return"Error"}},pl=function(e,t){return"abort"===e?"AbortError: The request was aborted.":"timeout"===e?"TimeoutError: The request timed out"+(t.timeout?" after "+t.timeout+" ms.":"."):"string"==typeof e&&-1!==e.indexOf(":")?e:"NetworkError: The request failed."},fl=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Uc(this,"requestId",0),Uc(this,"requests",{}),Uc(this,"externalRequests",[]),Uc(this,"maxRequests",30),Uc(this,"localFilters",[]),Uc(this,"remoteFilters",[]),Uc(this,"localBlacklist",[]),Uc(this,"remoteBlacklist",[]),Uc(this,"initialized",!1),Uc(this,"stopped",!1),Uc(this,"loadAllResources",!1)}var t,n,r;return t=e,n=[{key:"setLoadAllResources",value:function(e){this.loadAllResources=e}},{key:"setExternalRequests",value:function(e){var t=[];if(Array.isArray(e))for(var n=0;n0?e.timeOrigin:e.timing&&e.timing.navigationStart>0?e.timing.navigationStart:Date.now()-e.now()}(window.performance),s=window.performance.getEntriesByType("resource"),c=0;cthis.maxRequests?t.slice(t.length-this.maxRequests):t}},{key:"setMaxRequests",value:function(e){e>70&&(e=70),this.maxRequests=e}},{key:"setStopped",value:function(e){this.stopped=e}},{key:"setFilters",value:function(e){this.localFilters=xc(e)}},{key:"setRemoteFilters",value:function(e){this.remoteFilters=xc(e)}},{key:"setBlacklist",value:function(e){this.localBlacklist=xc(e)}},{key:"setRemoteBlacklist",value:function(e){this.remoteBlacklist=xc(e)}},{key:"getFilters",value:function(){return xc(this.remoteFilters.concat(this.localFilters))}},{key:"getBlacklist",value:function(){return xc(vc.concat(this.remoteBlacklist,this.localBlacklist))}},{key:"isCapturing",value:function(){return this.initialized&&!this.stopped}},{key:"cleanRequests",value:function(){var e=Object.keys(this.requests);if(e.length>this.maxRequests)for(var t=e.slice(0,e.length-this.maxRequests),n=0;n=0&&l<=qc)return void c.text().then((function(e){return i(Qc(e))}),(function(){return i(bc)}));i(bc)}catch(u){i(bc)}}},{key:"failFetch",value:function(e,t){var n=e.request;n.duration=Yc(e.start),n.success=!1,n.response={errorText:dl(t)}}},{key:"interceptXhr",value:function(){if("undefined"!=typeof XMLHttpRequest&&"undefined"!=typeof WeakMap){var e=this,t=new WeakMap,n=XMLHttpRequest.prototype,r=n.open,o=n.send,i=n.setRequestHeader;n.open=function(n,o){try{e.onXhrOpen(t,this,n,o)}catch(i){}return r.apply(this,arguments)},n.setRequestHeader=function(e,n){try{var r=t.get(this);r&&r.capture&&!r.request&&tl(r.headers,String(e),String(n))}catch(o){}return i.apply(this,arguments)},n.send=function(n){var r=!1;try{r=e.onXhrSend(t,this,n)}catch(i){}try{return o.apply(this,arguments)}catch(a){if(r)try{e.finishXhr(this,t.get(this),dl(a))}catch(i){}throw a}}}}},{key:"onXhrOpen",value:function(e,t,n,r){var o=e.get(t);if(o||(o={listening:!1},e.set(t,o)),o.request&&!o.finished){var i=4===t.readyState?void 0:"AbortError: The request was replaced by a new one.";this.finishXhr(t,o,i)}o.request=null,o.finished=!1,o.failure=null,o.headersAt=null,o.method=String(n||"GET").toUpperCase(),o.url=il(r),o.headers={},o.capture=this.isCapturing()&&!Sc(o.url,this.getBlacklist()),o.capture&&!o.listening&&(o.listening=!0,this.listenToXhr(t,o))}},{key:"listenToXhr",value:function(e,t){var n=this,r=function(n){return function(){4===e.readyState&&(t.failure=n)}};e.addEventListener("readystatechange",(function(){try{2===e.readyState&&t.request&&!t.finished&&n.recordXhrHeaders(e,t)}catch(r){}})),e.addEventListener("error",r("error")),e.addEventListener("abort",r("abort")),e.addEventListener("timeout",r("timeout")),e.addEventListener("loadend",(function(){try{4===e.readyState&&n.finishXhr(e,t)}catch(r){}}))}},{key:"onXhrSend",value:function(e,t,n){var r=e.get(t);if(!r||!r.capture||r.request||!this.isCapturing())return!1;var o=$c(),i=this.createRequest(r.method,r.url);if(!i)return r.capture=!1,!1;i.request.headers=Object.assign({},r.headers);var a="GET"!==r.method&&"HEAD"!==r.method;return ul(i.request,"payload",a?ll(n,nl(r.headers,"content-type")):{text:""}),r.request=i,r.start=o,!0}},{key:"recordXhrHeaders",value:function(e,t){t.headersAt=$c();var n=t.request;n.duration=Math.max(0,Math.round(t.headersAt-t.start)),n.success=!0,n.response={status:e.status,statusText:e.statusText||"",headers:ol(e.getAllResponseHeaders()),responseText:Wc}}},{key:"finishXhr",value:function(e,t,n){if(t&&t.request&&!t.finished){t.finished=!0;var r=t.request,o=n||t.failure||(0===e.status?"error":null);if(o)return r.duration=Yc(t.start),r.success=!1,void(r.response={errorText:pl(o,e)});r.duration=t.headersAt?Math.max(0,Math.round(t.headersAt-t.start)):Yc(t.start),r.success=!0;var i,a=ol(e.getAllResponseHeaders());try{i=function(e,t){var n=Kc(nl(t,"content-type"));if("stream"===n)return Vc;var r=e.responseType;if(""===r||"text"===r){if("binary"===n)return Gc;var o=e.responseText;return"string"!=typeof o?"":"unknown"===n&&-1!==o.slice(0,qc).indexOf("\0")?Gc:Qc(o)}if("json"===r){if(null===e.response||void 0===e.response)return"";var i=Rr(e.response,qc);return i.truncated?i.text+Zc():i.text}return"document"===r?bc:Gc}(e,a)}catch(s){i=bc}r.response={status:e.status,statusText:e.statusText||"",headers:a,responseText:i}}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Bc(t.prototype,n),r&&Bc(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Uc(fl,"instance",void 0);const hl=fl;function gl(e){return gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gl(e)}function ml(e,t){for(var n=0;n0){var t=e.filter((function(e){var t;return"chatbar"!==(null==e||null===(t=e.data)||void 0===t?void 0:t.lastSource)&&new Date(e.createdAt)>new Date(Date.now()-36e5)}));this.notifications=t.slice(-4),this.renderNotifications()}}catch(n){}}},{key:"notificationPassesPageRules",value:function(e){try{var t="undefined"!=typeof window&&window.location?window.location.href:void 0;return!t||rs(t,e)}catch(n){return!0}}},{key:"getVisibleNotifications",value:function(){var e=this;return this.notifications.filter((function(t){return e.notificationPassesPageRules(t)}))}},{key:"checkPageRulesForUrl",value:function(e){e&&e!==this.lastPageRulesUrl&&(this.lastPageRulesUrl=e,this.notifications.some((function(e){var t;return(null==e||null===(t=e.pageRules)||void 0===t?void 0:t.length)>0||(null==e?void 0:e.pageFilter)}))&&this.renderNotifications())}},{key:"setNotificationCount",value:function(e){this.unreadCount=e,this.updateTabBarNotificationCount(),_.getInstance().updateNotificationBadge(this.unreadCount)}},{key:"showNotification",value:function(e){if(this.notificationContainer&&e&&e.data){try{var t,n,r=null==e||null===(t=e.data)||void 0===t?void 0:t.lastSource,o=Pn.getInstance(),i=(null==o||null===(n=o.config)||void 0===n?void 0:n.enabled)||(null==o?void 0:o.manuallyShown)||o&&!o.isHidden;if("chatbar"===r&&i)return void o.showChatbarNotification(e.data)}catch(a){}for(this.notifications.find((function(t){return e.outbound===t.outbound}))||(this.notifications.push(e),e.sound&&this.notificationPassesPageRules(e)&&Dn.ping());this.notifications.length>4;)this.notifications.shift();ae(this.unreadNotificationsKey,this.notifications),this.renderNotifications()}}},{key:"renderNotifications",value:function(){var e=this;if(this.notificationContainer){this.clearAllNotifications(!0);var t=document.createElement("div");t.onclick=function(){e.clearAllNotifications(),e.currentNewsIndex=0},t.className="gleap-notification-close",t.innerHTML=fe("dismiss"),this.notificationContainer.appendChild(t);var n=this.getVisibleNotifications(),r=n.filter((function(e){return e.data.news})).sort((function(e,t){return new Date(e.createdAt)-new Date(t.createdAt)})),o=n.filter((function(e){return!e.data.news}));if(r.length>0){var i=this.currentNewsIndex1){var g=document.createElement("div");g.className="gleap-news-pagination";var m=document.createElement("span");m.className="gleap-news-page-indicator",m.innerText="".concat(i+1," / ").concat(r.length),g.appendChild(m);var v=document.createElement("button");v.className="gleap-news-next-button",i\n
\n
\n
\n
\n \n \n \n ').concat(t.data.nextStepTitle,"\n
\n \n ")}else r.className="gleap-notification-item gleap-notification-card",r.innerHTML='\n
\n '.concat(e.renderAvatar(t.data.sender,"gleap-notification-item-avatar"),'\n
\n
').concat(n,"
\n ").concat(e.renderMeta(t),"\n
\n
");e.notificationContainer.appendChild(r)},b=0;b0||o.length>0||this.clearAllNotifications(!0);var w=(r.length>0?1:0)+o.length;this.notificationContainer.classList&&(this.notificationContainer.classList.toggle("gleap-notification-container--stack",w>1),this.notificationContainer.classList.remove("gleap-notification-container--expanded")),this.updateStackLayout()}}},{key:"updateStackLayout",value:function(){try{this.stackResizeObserver&&(this.stackResizeObserver.disconnect(),this.stackResizeObserver=null);var e=this.notificationContainer;if(!e||!e.classList||!e.classList.contains("gleap-notification-container--stack")||"function"!=typeof e.querySelectorAll)return;var t=Array.prototype.slice.call(e.querySelectorAll(".gleap-notification-card"));if(t.length<2)return;var n=function(){try{for(var n=t.map((function(e){return e.offsetHeight||0})),r=n[n.length-1],o=0,i=0,a=t.length-1;a>=0;a--){var s=t.length-1-a,c=0===s?0:1===s?9:17;t[a].style.setProperty("--gleap-nstack-collapse","".concat(n[a]-r-c,"px")),t[a].style.setProperty("--gleap-nstack-expand","".concat(-i,"px"));var l=n[a]-(r-12);t[a].style.setProperty("--gleap-nstack-clip",s>0&&l>0?"".concat(l,"px"):"-40px"),i+=n[a],o+=n[a]}e.style.setProperty("--gleap-nstack-h-collapsed","".concat(r+17,"px")),e.style.setProperty("--gleap-nstack-h-expanded","".concat(o,"px"))}catch(u){}};if(n(),"undefined"!=typeof ResizeObserver){this.stackResizeObserver=new ResizeObserver(n);for(var r=0;r')}},{key:"renderMeta",value:function(e){var t=e.data.sender,n=[];t&&t.name&&n.push(''.concat(t.name,""));var r=function(e,t){try{if(!e||"undefined"==typeof Intl||"function"!=typeof Intl.RelativeTimeFormat)return"";var n,r=new Date(e).getTime();if(isNaN(r))return"";try{n=new Intl.RelativeTimeFormat(t||void 0,{numeric:"auto"})}catch(c){n=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"})}var o=Math.min(0,(r-Date.now())/1e3);if(o>-60)return n.format(0,"second");for(var i=o/60,a=0;a'.concat(r,"")),0===n.length?"":'
'.concat(n.join('•'),"
")}},{key:"renderDescription",value:function(e){var t=e.data,n=t.previewText,r=t.sender;return n&&n.length>0?n:r?'\n
\n '.concat(this.renderAvatar(r,"gleap-notification-item-news-sender-avatar"),"\n ").concat(r.name,"\n
\n "):""}},{key:"clearNotificationsForConversation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)try{var n=function(t){var n;return(null==t||null===(n=t.data)||void 0===n||null===(n=n.conversation)||void 0===n?void 0:n.shareToken)===e},r=ie(this.unreadNotificationsKey);r&&r.length>0&&ae(this.unreadNotificationsKey,r.filter((function(e){return!n(e)})));var o,i=this.notifications.length;this.notifications=this.notifications.filter((function(e){return!n(e)})),this.notifications.length!==i&&this.renderNotifications(),t||jf.getInstance().sendMessage({type:"conversation-notifications-cleared",shareToken:e,gleapId:null===(o=vs.getInstance().session)||void 0===o?void 0:o.gleapId})}catch(a){}}},{key:"clearAllNotifications",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.notificationContainer){for(e||(this.notifications=[],this.currentNewsIndex=0,ae(this.unreadNotificationsKey,this.notifications));this.notificationContainer.firstChild;)this.notificationContainer.removeChild(this.notificationContainer.firstChild);if(!e&&!t)try{var n;jf.getInstance().sendMessage({type:"notifications-cleared",gleapId:null===(n=vs.getInstance().session)||void 0===n?void 0:n.gleapId})}catch(r){}}}},{key:"updateContainerStyle",value:function(){if(this.notificationContainer){var e=br.getInstance().getFlowConfig(),t="gleap-notification-container--left",n="gleap-notification-container--no-button";this.notificationContainer.classList.remove(t),this.notificationContainer.classList.remove(n),e.feedbackButtonPosition!==_.FEEDBACK_BUTTON_CLASSIC_LEFT&&e.feedbackButtonPosition!==_.FEEDBACK_BUTTON_BOTTOM_LEFT||this.notificationContainer.classList.add(t),null===_.getInstance().buttonHidden?e.feedbackButtonPosition===_.FEEDBACK_BUTTON_NONE&&this.notificationContainer.classList.add(n):_.getInstance().buttonHidden&&this.notificationContainer.classList.add(n),this.notificationContainer.setAttribute("dir",Vf.getInstance().isRTLLayout?"rtl":"ltr")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&ml(t.prototype,n),r&&ml(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function wl(e){return wl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wl(e)}function kl(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{})}function n(t){return t?e[t]:e}function r(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}function o(e){var t='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return e.flatMap((function(e){var n=e.matches(t),r=Array.from(e.querySelectorAll(t));return[].concat(El(n?[e]:[]),r)})).filter((function(e){return"none"!==getComputedStyle(e).pointerEvents&&function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}(e)}))}function i(e){if(e&&!function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}(e)){var t=n("smoothScroll");e.scrollIntoView({behavior:!t||a(e)?"auto":"smooth",inline:"center",block:"center"})}}function a(e){if(e&&e.parentElement){var t=e.parentElement;return t.scrollHeight>t.clientHeight}}var s={};function c(e,t){s[e]=t}function l(e){return e?s[e]:s}function u(){s={}}var d={};function p(e,t){d[e]=t}function f(e){var t;null==(t=d[e])||t.call(d)}function h(e){if(e){var t=e.getBoundingClientRect(),n={x:t.x,y:t.y,width:t.width,height:t.height};c("__activeStagePosition",n),m(n)}}function g(e){var t=function(e){var t=window.innerWidth,r=window.innerHeight,o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.classList.add("gleap-tour-overlay","gleap-tour-overlay-animated"),o.setAttribute("viewBox","0 0 ".concat(t," ").concat(r)),o.setAttribute("xmlSpace","preserve"),o.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),o.setAttribute("version","1.1"),o.setAttribute("preserveAspectRatio","xMinYMin slice"),o.style.fillRule="evenodd",o.style.clipRule="evenodd",o.style.strokeLinejoin="round",o.style.strokeMiterlimit="2",o.style.zIndex="10000",o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="100%",o.style.height="100%";var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",v(e)),i.style.fill=n("overlayColor")||"rgb(0,0,0)",i.style.opacity="".concat(n("overlayOpacity")),i.style.pointerEvents="auto",i.style.cursor="auto",o.appendChild(i),o}(e);document.body.appendChild(t),S(t,(function(e){"path"===e.target.tagName&&f("overlayClick")})),c("__overlaySvg",t)}function m(e){var t=l("__overlaySvg");if(t){var n=t.firstElementChild;if("path"!==(null==n?void 0:n.tagName))throw new Error("no path element found in stage svg");n.setAttribute("d",v(e))}else g(e)}function v(e){var t=window.innerWidth,r=window.innerHeight,o=n("stagePadding")||0,i=n("stageRadius")||0,a=e.width+2*o,s=e.height+2*o,c=Math.min(i,a/2,s/2),l=Math.floor(Math.max(c,0)),u=e.x-o+l,d=e.y-o,p=a-2*l,f=s-2*l;return"M".concat(t,",0L0,0L0,").concat(r,"L").concat(t,",").concat(r,"L").concat(t,",0Z\n M").concat(u,",").concat(d," h").concat(p," a").concat(l,",").concat(l," 0 0 1 ").concat(l,",").concat(l," v").concat(f," a").concat(l,",").concat(l," 0 0 1 -").concat(l,",").concat(l," h-").concat(p," a").concat(l,",").concat(l," 0 0 1 -").concat(l,",-").concat(l," v-").concat(f," a").concat(l,",").concat(l," 0 0 1 ").concat(l,",-").concat(l," z")}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,o=e.element,a=o;if("string"==typeof a)try{a=document.querySelector(o)}catch(u){var s=o.replace(/(#[^#\s]+)/g,(function(e){return e.replace(/:/g,"\\:")}));a=document.querySelector(s)}if(o&&!a&&t>=0)setTimeout((function(){C(),y(e,t-100)}),100);else{if(!a){if(e.element){try{console.warn("[Gleap] Product tour selector did not match:",e.element)}catch(d){}return n("onElementNotFound")(e)}a=function(){var e=document.getElementById("gleap-tour-dummy-element");if(e)return e;var t=document.createElement("div");return t.id="gleap-tour-dummy-element",t.style.width="0",t.style.height="0",t.style.pointerEvents="none",t.style.opacity="0",t.style.position="fixed",t.style.top="50%",t.style.left="50%",document.body.appendChild(t),t}()}!function(e,t){var o,a,s=400,u=Date.now(),d=l("__activeStep"),p=l("__activeElement")||e,f=!p||p===e,g="gleap-tour-dummy-element"===e.id,v="gleap-tour-dummy-element"===p.id,y=n("animate"),b=t.onHighlightStarted||n("onHighlightStarted"),w=(null==t?void 0:t.onHighlighted)||n("onHighlighted"),k=(null==d?void 0:d.onDeselected)||n("onDeselected"),x=n(),S=l();!f&&k&&k(v?void 0:p,d,{config:x,state:S});b&&b(g?void 0:e,t,{config:x,state:S});var E=!f&&y,T=!1;C(),c("previousStep",d),c("previousElement",p),c("activeStep",t),c("activeElement",e);var L=function o(){if(l("__transitionCallback")===o){var i=Date.now()-u,a=s-i<=s/2;t.popover&&a&&!T&&E&&(I(e,t),T=!0),n("animate")&&i0&&R[0].focus()}function E(){var e=l("popover");if(null==e?void 0:e.wrapper){var t=e.wrapper.getBoundingClientRect(),r=n("stagePadding")||0,o=n("popoverOffset")||0;return{width:t.width+r+o,height:t.height+r+o,realWidth:t.width,realHeight:t.height}}}function T(e,t){var n=t.elementDimensions,r=t.popoverDimensions,o=t.popoverPadding,i=t.popoverArrowDimensions;return"start"===e?Math.max(Math.min(n.top-o,window.innerHeight-r.realHeight-i.width),i.width):"end"===e?Math.max(Math.min(n.top-(null==r?void 0:r.realHeight)+n.height+o,window.innerHeight-(null==r?void 0:r.realHeight)-i.width),i.width):"center"===e?Math.max(Math.min(n.top+n.height/2-(null==r?void 0:r.realHeight)/2,window.innerHeight-(null==r?void 0:r.realHeight)-i.width),i.width):0}function L(e,t){var n=t.elementDimensions,r=t.popoverDimensions,o=t.popoverPadding,i=t.popoverArrowDimensions;return"start"===e?Math.max(Math.min(n.left-o,window.innerWidth-r.realWidth-i.width),i.width):"end"===e?Math.max(Math.min(n.left-(null==r?void 0:r.realWidth)+n.width+o,window.innerWidth-(null==r?void 0:r.realWidth)-i.width),i.width):"center"===e?Math.max(Math.min(n.left+n.width/2-(null==r?void 0:r.realWidth)/2,window.innerWidth-(null==r?void 0:r.realWidth)-i.width),i.width):0}function O(e,t){var r=l("popover");if(r){var o=(null==t?void 0:t.popover)||{},i=o.align,a=void 0===i?"start":i,s=o.side,c=void 0===s?"left":s,u=a,d="gleap-tour-dummy-element"===e.id?"over":c,p=n("stagePadding")||0,f=E(),h=r.arrow.getBoundingClientRect(),g=e.getBoundingClientRect(),m=g.top-f.height,v=m>=0,y=window.innerHeight-(g.bottom+f.height),b=y>=0,w=g.left-f.width,k=w>=0,x=window.innerWidth-(g.right+f.width),S=x>=0,C=!(v||b||k||S),I=d;if("top"===d&&v?S=k=b=!1:"bottom"===d&&b?S=k=v=!1:"left"===d&&k?S=v=b=!1:"right"===d&&S&&(k=v=b=!1),"over"===d){var O=window.innerWidth/2-f.realWidth/2,A=window.innerHeight/2-f.realHeight/2;r.wrapper.style.left="".concat(O,"px"),r.wrapper.style.right="auto",r.wrapper.style.top="".concat(A,"px"),r.wrapper.style.bottom="auto"}else if(C){var M=window.innerWidth/2-(null==f?void 0:f.realWidth)/2;r.wrapper.style.left="".concat(M,"px"),r.wrapper.style.right="auto",r.wrapper.style.bottom="".concat(10,"px"),r.wrapper.style.top="auto"}else if(k){var P=Math.min(w,window.innerWidth-(null==f?void 0:f.realWidth)-h.width),R=T(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.left="".concat(P,"px"),r.wrapper.style.top="".concat(R,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",I="left"}else if(S){var N=Math.min(x,window.innerWidth-(null==f?void 0:f.realWidth)-h.width),_=T(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.right="".concat(N,"px"),r.wrapper.style.top="".concat(_,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.left="auto",I="right"}else if(v){var j=Math.min(m,window.innerHeight-f.realHeight-h.width),D=L(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.top="".concat(j,"px"),r.wrapper.style.left="".concat(D,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",I="top"}else if(b){var F=Math.min(y,window.innerHeight-(null==f?void 0:f.realHeight)-h.width),B=L(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.left="".concat(B,"px"),r.wrapper.style.bottom="".concat(F,"px"),r.wrapper.style.top="auto",r.wrapper.style.right="auto",I="bottom"}C?r.arrow.classList.add("gleap-tour-popover-arrow-none"):function(e,t,n){var r=l("popover");if(!r)return;var o=n.getBoundingClientRect(),i=E(),a=r.arrow,s=i.width,c=window.innerWidth,u=o.width,d=o.left,p=i.height,f=window.innerHeight,h=o.top,g=o.height;a.className="gleap-tour-popover-arrow";var m=t,v=e;"top"===t?(d+u<=0?(m="right",v="end"):d+u-s<=0&&(m="top",v="start"),d>=c?(m="left",v="end"):d+s>=c&&(m="top",v="end")):"bottom"===t?(d+u<=0?(m="right",v="start"):d+u-s<=0&&(m="bottom",v="start"),d>=c?(m="left",v="start"):d+s>=c&&(m="bottom",v="end")):"left"===t?(h+g<=0?(m="bottom",v="end"):h+g-p<=0&&(m="left",v="start"),h>=f?(m="top",v="end"):h+p>=f&&(m="left",v="end")):"right"===t&&(h+g<=0?(m="bottom",v="start"):h+g-p<=0&&(m="right",v="start"),h>=f?(m="top",v="start"):h+p>=f&&(m="right",v="end"));m?(a.classList.add("gleap-tour-popover-arrow-side-".concat(m)),a.classList.add("gleap-tour-popover-arrow-align-".concat(v))):a.classList.add("gleap-tour-popover-arrow-none")}(u,I,e)}}return function(){function e(){n("allowClose")&&h()}function r(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e+1;t[r]?f(r):h()}}function o(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e-1;t[r]?f(r):h()}}function i(){var e;if(!l("__transitionCallback")){var t=l("activeIndex"),r=l("__activeStep"),i=l("__activeElement");if("CLICK"!==r.mode)if(void 0!==t&&void 0!==r)if(void 0!==l("activeIndex")){var a=(null==(e=r.popover)?void 0:e.onPrevClick)||n("onPrevClick");if(a)return a(i,r,{config:n(),state:l()});o()}}}function a(){var e;if(!l("__transitionCallback")){var t=l("activeIndex"),o=l("__activeStep"),i=l("__activeElement");if("CLICK"!==o.mode&&void 0!==t&&void 0!==o){var a=(null==(e=o.popover)?void 0:e.onNextClick)||n("onNextClick");if(a)return a(i,o,{config:n(),state:l()});r()}}}function s(){l("isInitialized")||(c("isInitialized",!0),document.body.classList.add("gleap-tour-active",n("animate")?"gleap-tour-fade":"gleap-tour-simple"),window.addEventListener("keyup",x,!1),window.addEventListener("keydown",k,!1),window.addEventListener("resize",w),window.addEventListener("scroll",w),c("__positionInterval",setInterval((function(){l("isInitialized")&&w()}),1e3)),p("overlayClick",e),p("escapePress",e),p("arrowLeftPress",i),p("arrowRightPress",a))}function f(){var e,t,r,o,i,a,s,l,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,d=n("steps");if(!d)return console.error("No steps to drive through"),void h();if(d[u]){c("__activeOnDestroyed",document.activeElement),c("activeIndex",u);var p=d[u],g=d[u+1],m=d[u-1],v=(null==(e=p.popover)?void 0:e.doneBtnText)||n("doneBtnText")||"Done",b=n("allowClose"),w=void 0!==(null==(t=p.popover)?void 0:t.showProgress)?null==(r=p.popover)?void 0:r.showProgress:n("showProgress"),k=((null==(o=p.popover)?void 0:o.progressText)||n("progressText")||"{{current}} of {{total}}").replace("{{current}}","".concat(u+1)).replace("{{total}}","".concat(d.length)),x=(null==(i=p.popover)?void 0:i.showButtons)||n("showButtons"),S=["next","previous"].concat(El(b?["close"]:[])).filter((function(e){return!(null==x?void 0:x.length)||x.includes(e)})),C=(null==(a=p.popover)?void 0:a.onNextClick)||n("onNextClick"),I=(null==(s=p.popover)?void 0:s.onPrevClick)||n("onPrevClick"),E=(null==(l=p.popover)?void 0:l.onCloseClick)||n("onCloseClick");y(Ol(Ol({},p),{},{popover:Ol({showButtons:S,nextBtnText:g?void 0:v,disableButtons:El(m?[]:["previous"]),showProgress:w,progressText:k,onNextClick:C||function(){g?f(u+1):h()},onPrevClick:I||function(){f(u-1)},onCloseClick:E||function(){h()}},(null==p?void 0:p.popover)||{})}))}else h()}function h(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=l("__activeElement"),r=l("__activeStep"),o=l("__activeOnDestroyed"),i=n("onDestroyStarted");if(e&&i){i(!t||"gleap-tour-dummy-element"===(null==t?void 0:t.id)?void 0:t,r,{config:n(),state:l()})}else{var a,s=(null==r?void 0:r.onDeselected)||n("onDeselected"),c=n("onDestroyed");if(document.body.classList.remove("gleap-tour-active","gleap-tour-fade","gleap-tour-simple"),function(){window.removeEventListener("keyup",x),window.removeEventListener("resize",w),window.removeEventListener("scroll",w);var e=l("__positionInterval");e&&clearInterval(e)}(),function(){var e,t=l("popover");t&&(null==(e=t.wrapper.parentElement)||e.removeChild(t.wrapper))}(),function(){var e;null==(e=document.getElementById("gleap-tour-dummy-element"))||e.remove(),document.querySelectorAll(".gleap-tour-active-element").forEach((function(e){e.classList.remove("gleap-tour-active-element","gleap-tour-no-interaction"),e.removeAttribute("aria-haspopup"),e.removeAttribute("aria-expanded"),e.removeAttribute("aria-controls")}))}(),(a=l("__overlaySvg"))&&a.remove(),d={},u(),t&&r){var p="gleap-tour-dummy-element"===t.id;s&&s(p?void 0:t,r,{config:n(),state:l()}),c&&c(p?void 0:t,r,{config:n(),state:l()})}o&&o.focus()}}return t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{isActive:function(){return l("isInitialized")||!1},refresh:w,drive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;s(),f(e)},setConfig:t,setSteps:function(e){u(),t(Ol(Ol({},n()),{},{steps:e}))},getConfig:n,getState:l,getActiveIndex:function(){return l("activeIndex")},isFirstStep:function(){return 0===l("activeIndex")},isLastStep:function(){var e=n("steps")||[],t=l("activeIndex");return void 0!==t&&t===e.length-1},getActiveStep:function(){return l("activeStep")},getActiveElement:function(){return l("activeElement")},getPreviousElement:function(){return l("previousElement")},getPreviousStep:function(){return l("previousStep")},moveNext:r,movePrevious:o,moveTo:function(e){(n("steps")||[])[e]?f(e):h()},hasNextStep:function(){var e=n("steps")||[],t=l("activeIndex");return void 0!==t&&e[t+1]},hasPreviousStep:function(){var e=n("steps")||[],t=l("activeIndex");return void 0!==t&&e[t-1]},highlight:function(e){s(),y(Ol(Ol({},e),{},{popover:e.popover?Ol({showButtons:[],showProgress:!1,progressText:""},e.popover):void 0}))},destroy:function(){h(!1)}}}}();const Pl=Ml;var Rl=["text","email","password","search","tel","url","number","date","datetime-local","month","week","time"],Nl="".concat(Rl.map((function(e){return'input[type="'.concat(e,'" i]')})).join(", "),", input:not([type]), textarea, [contenteditable]"),_l=function(e){if(!e||!e.tagName)return!1;var t=e.tagName.toLowerCase();return"input"===t?Rl.indexOf((e.getAttribute("type")||"text").toLowerCase())>=0:"textarea"===t||function(e){return!0===e.isContentEditable||"function"==typeof e.getAttribute&&null!==e.getAttribute("contenteditable")}(e)},jl=function(e,t){try{e.dispatchEvent(new Event(t,{bubbles:!0}))}catch(n){}},Dl=function(e,t){if(e){var n=(e.tagName||"").toLowerCase();if("input"===n||"textarea"===n){var r=function(e){var t,n;if("undefined"==typeof window)return null;var r=window.HTMLTextAreaElement&&e instanceof window.HTMLTextAreaElement?window.HTMLTextAreaElement.prototype:window.HTMLInputElement&&e instanceof window.HTMLInputElement?window.HTMLInputElement.prototype:null;return r&&null!==(t=null===(n=Object.getOwnPropertyDescriptor(r,"value"))||void 0===n?void 0:n.set)&&void 0!==t?t:null}(e);r?r.call(e,t):e.value=t}else e.textContent=t;jl(e,"input")}},Fl=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.charDelay,o=void 0===r?100:r,i=n.onDone,a=function(e){if(!e)return null;if(_l(e))return e;var t="function"==typeof e.querySelector?e.querySelector(Nl):null;return t&&_l(t)?t:null}(e),s=null!=t?t:"";if(a){var c=0,l=function(){jl(a,"change"),i&&i()};!function e(){try{c=0&&t.productTourData&&t.productTourData.steps){var e=t.productTourData.steps[t.currentActiveIndex];e&&e.selector&&""!==e.selector&&t.updatePointerPosition(document.querySelector(e.selector),e)}})))}var t,n,r;return t=e,n=[{key:"disable",value:function(){this.disabled=!0,this.cleanup()}},{key:"startWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;"undefined"!=typeof window&&(this.productTourId||this.disabled||(this.productTourId=e,this.productTourData=t,this.currentActiveIndex=0,this.onCompleteCallback=n,this.start()))}},{key:"storeUncompletedTour",value:function(){if("undefined"!=typeof window)if(this.productTourId&&this.productTourData)try{var e=JSON.parse(JSON.stringify({tourData:this.productTourData,tourId:this.productTourId}));e.tourData.steps=e.tourData.steps.slice(this.currentActiveIndex||0,e.tourData.steps.length),e.audioMuted=this.audioMuted,localStorage.setItem(ql,JSON.stringify(e))}catch(t){}else localStorage.removeItem(ql)}},{key:"loadStoredAudioMuted",value:function(){if("undefined"!=typeof window)try{var e=JSON.parse(localStorage.getItem(ql));if(e&&e.tourId===this.productTourId&&"boolean"==typeof e.audioMuted)return e.audioMuted}catch(t){}}},{key:"attachScrollListeners",value:function(e,t){var n=this;if("undefined"!=typeof window&&e){var r=function(e){if("undefined"!=typeof window){for(var t=[],n=e.parentElement;n;){var r=window.getComputedStyle(n);("auto"===r.overflowY||"scroll"===r.overflowY)&&n.scrollHeight>n.clientHeight&&t.push(n),n=n.parentElement}return t}}(e);r.push(window),r.forEach((function(r){var o=function(){clearTimeout(n._scrollDebounceTimer),n._scrollDebounceTimer=setTimeout((function(){n.updatePointerPosition(e,t)}),150)};r.addEventListener("scroll",o,{passive:!0}),n._scrollListeners.push({el:r,handler:o})}))}}},{key:"removeScrollListeners",value:function(){"undefined"!=typeof window&&(this._scrollListeners&&this._scrollListeners.length>0&&(this._scrollListeners.forEach((function(e){var t=e.el,n=e.handler;t.removeEventListener("scroll",n)})),this._scrollListeners=[]),this._scrollDebounceTimer&&(clearTimeout(this._scrollDebounceTimer),this._scrollDebounceTimer=null))}},{key:"updatePointerPosition",value:function(e,t){var n,r=this;if("undefined"!=typeof window)try{var o=this._pointerContainer||document.getElementById(Wl);if(!o)return;if(!e)return o.style.position="fixed",o.style.left="50%",o.style.top="50%",o.style.transform="translate(-50%, -50%)",function(e){if("undefined"!=typeof window){var t=e-window.innerHeight/2;window.scrollTo({top:t,behavior:"smooth"})}}(window.innerHeight/2),this.removeScrollListeners(),this._currentAnchor=null,void(this._currentStep=null);n=e,"undefined"!=typeof window&&n&&n.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});var i=0;!function n(){if(function(e){if("undefined"!=typeof window){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}}(e)||i>=20){var a=e.getBoundingClientRect(),s=a.left+a.width/2,c=a.top+a.height/2+10;o.style.position="fixed",o.style.left="".concat(s,"px"),o.style.top="".concat(c,"px"),o.style.transform="translate(-50%, -50%)";var l=350;l>window.innerWidth-40&&(l=window.innerWidth-40),s+l>window.innerWidth-20?o.classList.add("copilot-pointer-container-right"):o.classList.remove("copilot-pointer-container-right"),r._currentAnchor===e&&r._currentStep===t||(r.removeScrollListeners(),r._currentAnchor=e,r._currentStep=t,r.attachScrollListeners(e,t))}else i++,setTimeout(n,100)}()}catch(a){}}},{key:"cleanup",value:function(){var e=this;"undefined"!=typeof window&&(document.body.classList.add("gl-copilot-fade-out"),this.currentAudio&&this.currentAudio.pause(),setTimeout((function(){if(e._pointerContainer)e._pointerContainer.remove(),e._pointerContainer=null;else{var t=document.getElementById(Wl);t&&t.remove()}var n=document.getElementById(Vl);n&&n.remove();var r=document.getElementById(Gl);r&&r.remove(),document.body.classList.remove("gl-copilot-fade-out")}),800),this.productTourId=void 0,this.productTourData=void 0,this.removeScrollListeners())}},{key:"toggleAudio",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.audioMuted=e,this.currentAudio&&(this.currentAudio.muted=this.audioMuted);var t=document.querySelector(".".concat(Vl,"-mute"));t&&(t.innerHTML=fe(this.audioMuted?"unmute":"mute")),this.productTourId&&this.productTourData&&this.storeUncompletedTour()}},{key:"setupCopilotTour",value:function(){var e,t,n,r,o,i,a,s=this;if("undefined"!=typeof window){var c,l,u=null!==(e=null===(t=br.getInstance().flowConfig)||void 0===t?void 0:t.color)&&void 0!==e?e:"#485BFF",d=pe(u),p=document.getElementById(Gl);p||(p=document.createElement("style"),W(p),p.id=Gl,p.type="text/css",p.textContent="\n #".concat(Wl," {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n align-items: flex-start;\n pointer-events: none;\n z-index: 2147483610;\n transition: all 0.5s ease;\n }\n .").concat(Wl,"-clickmode {\n cursor: pointer;\n pointer-events: all !important;\n }\n .").concat(Wl,"-clickmode #copilot-info-bubble-content {\n display: flex !important;\n }\n .").concat(Wl,"-clickmode svg {\n display: none !important;\n }\n #").concat(Wl," svg {\n width: 20px;\n height: auto;\n fill: none;\n }\n #copilot-info-bubble {\n position: relative;\n }\n #copilot-info-bubble-content-container {\n position: absolute;\n top: 0px;\n left: 0px;\n min-width: min(300px, 80vw);\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n .").concat(Wl,"-right #copilot-info-bubble-content-container {\n left: auto !important;\n right: 0px !important;\n align-items: flex-end;\n }\n .").concat(Wl,"-right .copilot-info-bubble-content {\n margin-right: 5px;\n }\n .").concat(Wl,"-right svg {\n transform: scaleX(-1);\n }\n #copilot-info-bubble-content svg {\n width: 16px;\n height: 16px;\n display: inline-block !important;\n margin-left: 5px;\n }\n #copilot-info-bubble-content {\n margin-top: 18px;\n margin-left: 5px;\n padding: 10px 15px;\n border-radius: 20px;\n background-color: black;\n color: white;\n font-family: Arial, sans-serif;\n font-size: 14px;\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);\n max-width: 100%;\n white-space: pre-line;\n overflow-wrap: break-word;\n word-break: normal;\n hyphens: none;\n }\n .").concat(Wl,"-right #copilot-info-bubble-content {\n margin-top: 30px;\n margin-left: 0px;\n margin-right: 5px;\n }\n .click-wave {\n position: absolute;\n width: 34px;\n height: 34px;\n border-radius: 50%;\n background-color: rgba(0, 0, 0, 0.5);\n pointer-events: none;\n z-index: 2147483611;\n animation: click-wave-animation 0.8s ease forwards;\n }\n @keyframes click-wave-animation {\n 0% {\n transform: scale(0.2);\n opacity: 1;\n }\n 100% {\n transform: scale(2);\n opacity: 0;\n }\n }\n @keyframes slideInFromTop {\n 0% {\n transform: translateY(-100%);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n }\n @keyframes slideInFromBottom {\n 0% {\n transform: translateY(100%);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n }\n .").concat(Vl," {\n position: fixed;\n z-index: 2147483610;\n background: #fff;\n padding: 6px;\n border-radius: 10px;\n box-shadow: 0 0 20px 0 #C294F2;\n display: flex;\n align-items: center;\n gap: 8px;\n border: 1px solid rgba(192, 146, 242, 0.5);\n }\n .").concat(Vl,"--top-left {\n top: 20px;\n left: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(Vl,"--top-right {\n top: 20px;\n right: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(Vl,"--bottom-left {\n bottom: 20px;\n left: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(Vl,"--bottom-right {\n bottom: 20px;\n right: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(Vl," span {\n font-size: 13px;\n color: #000;\n font-family: sans-serif;\n }\n .").concat(Vl,"-avatar {\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n border-radius: 6px;\n }\n .").concat(Vl,"-mute {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .").concat(Vl,"-mute svg {\n width: 20px;\n height: auto;\n cursor: pointer;\n animation: pulsate 2s infinite;\n }\n .").concat(Vl,"-mute svg:hover {\n opacity: 0.8;\n }\n .").concat(Vl,"-dismiss {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: 3px;\n }\n .").concat(Vl,"-dismiss svg {\n width: 15px;\n height: auto;\n cursor: pointer;\n }\n .").concat(Vl,"-dismiss svg:hover {\n opacity: 0.8;\n }\n @keyframes pulsate {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n 50% {\n transform: scale(1.1);\n opacity: 0.8;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n }\n @keyframes glCoFadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n @keyframes glCoFadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n .gleap-audio-unmute-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 2147483620;\n }\n\n .gleap-audio-unmute-modal {\n background-color: #fff;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);\n text-align: center;\n max-width: 90%;\n width: 400px;\n }\n\n .gleap-audio-unmute-modal p {\n margin-bottom: 20px;\n font-size: 16px;\n line-height: 22px;\n font-weight: normal;\n }\n\n .gleap-audio-unmute-button {\n background: ").concat(u,";\n color: ").concat(d,";\n outline: none;\n border: none;\n padding: 10px 14px;\n border-radius: 12px;\n font-size: 14px;\n font-weight: bold;\n cursor: pointer;\n }\n\n .gleap-audio-unmute-button:hover {\n opacity: 0.8;\n }\n\n .gleap-tour-continue-button {\n color: ").concat(u,";\n text-decoration: none;\n cursor: pointer;\n font-size: 14px;\n font-weight: bold;\n border: none;\n background: none;\n padding: 0;\n margin: 0;\n margin-left: 20px;\n }\n\n .gleap-tour-continue-button:hover {\n opacity: 0.8;\n }\n\n body.gl-copilot-fade-out::before,\n body.gl-copilot-fade-out::after,\n body.gl-copilot-fade-out #").concat(Vl," {\n animation: glCoFadeOut 0.8s ease-out forwards;\n }\n ").concat(null===(c=null===(l=this.productTourData)||void 0===l?void 0:l.playVoice)||void 0===c||c?"":"\n .".concat(Vl,"-mute {\n display: none;\n }\n "),"\n ").concat(this.productTourData.gradient?'body::before {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n box-sizing: border-box;\n border: 18px solid transparent;\n filter: blur(25px);\n border-image-slice: 1;\n border-image-source: linear-gradient(45deg, #ED5587, #FBE6A9, #a6e3f8, #C294F2);\n animation: glCoFadeIn 1.5s ease-out forwards;\n }\n \n body::after {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n opacity: 0.5;\n box-sizing: border-box;\n border: 3px solid transparent;\n border-image-slice: 1;\n border-image-source: linear-gradient(45deg, #ED5587, #FBE6A9, #a6e3f8, #C294F2);\n animation: glCoFadeIn 1.5s ease-out forwards;\n }':'body::after {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n opacity: 0;\n }',"\n "),document.head.appendChild(p));var f=document.createElement("div");f.id=Wl,f.style.opacity=0,this._pointerContainer=f;var h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("viewBox","0 0 380 476"),h.innerHTML='';var g=document.createElement("div");g.id="copilot-info-bubble",g.innerHTML="
";var m,v,y=document.createElement("div");y.id=Vl,y.classList.add(Vl,(m=null===(n=this.productTourData)||void 0===n?void 0:n.joinedIndicatorPosition,null!==(v=Xl[m])&&void 0!==v?v:Xl.TOP_RIGHT)),y.innerHTML='\n \n ').concat(null===(o=this.productTourData)||void 0===o?void 0:o.kaiSlug,'\n
\n ').concat(fe(this.audioMuted?"unmute":"mute"),"\n
\n ").concat(null!==(i=this.productTourData)&&void 0!==i&&i.allowClose?'
\n ').concat(fe("dismiss"),"\n
"):"","\n "),document.body.appendChild(y),document.querySelector(".".concat(Vl,"-mute")).addEventListener("click",(function(){s.toggleAudio(!s.audioMuted)})),null!==(a=this.productTourData)&&void 0!==a&&a.allowClose&&document.querySelector(".".concat(Vl,"-dismiss")).addEventListener("click",(function(){s.completeTour(!1)})),f.appendChild(h),f.appendChild(g),document.body.appendChild(f)}}},{key:"start",value:function(){var e=this;if("undefined"!=typeof window&&!this.disabled){var t=this.productTourData;if(t){var n=function(n,r){e.audioMuted=n,e.setupCopilotTour(),e.audioMuted&&r&&null!=t&&t.showUnmuteModal?e.showAudioUnmuteModal():setTimeout((function(){e.renderNextStep()}),1500)},r=this.loadStoredAudioMuted();"boolean"!=typeof r?("undefined"==typeof window?Promise.resolve(!1):new Promise((function(e){var t=setTimeout((function(){return e(!0)}),500),n=function(n){clearTimeout(t),e(n)};try{new Audio("data:audio/wav;base64,UklGRigAAABXQVZFZm10IBAAAAABAAEARKwAABCxAgAEABAAZGF0YQAAAAA=").play().then((function(){return n(!0)})).catch((function(){return n(!1)}))}catch(r){n(!1)}}))).then((function(e){n(!e,!0)})):n(r,!1)}}}},{key:"showAudioUnmuteModal",value:function(){var e,t,n,r=this,o=document.createElement("div");o.classList.add("gleap-audio-unmute-modal-overlay");var i=document.createElement("div");i.classList.add("gleap-audio-unmute-modal");var a=document.createElement("p");a.textContent=null===(e=this.productTourData)||void 0===e?void 0:e.unmuteModalTitle,i.appendChild(a);var s=document.createElement("button");s.classList.add("gleap-audio-unmute-button"),s.textContent=null===(t=this.productTourData)||void 0===t?void 0:t.unmuteModalButton,s.addEventListener("click",(function(){r.toggleAudio(!1),o.parentNode&&o.parentNode.removeChild(o),setTimeout((function(){r.renderNextStep()}),1e3)})),i.appendChild(s);var c=document.createElement("button");c.classList.add("gleap-tour-continue-button"),c.textContent=null===(n=this.productTourData)||void 0===n?void 0:n.unmuteModalContinue,c.addEventListener("click",(function(){r.toggleAudio(!0),o.parentNode&&o.parentNode.removeChild(o),setTimeout((function(){r.renderNextStep()}),1e3)})),i.appendChild(c),o.appendChild(i),document.body.appendChild(o)}},{key:"completeTour",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];"undefined"!=typeof window&&(this.cleanup(),this.onCompleteCallback&&this.onCompleteCallback(e))}},{key:"renderNextStep",value:function(){var e=this;if("undefined"!=typeof window&&!this.disabled){var t=this,n=this.productTourData.steps;if(this.currentActiveIndex>=n.length)setTimeout((function(){e.completeTour()}),500);else{var r=n[this.currentActiveIndex],o=function(n){var o,i;if(e._pointerContainer.style.display="flex",r.selector&&r.selector.length>0&&!n)e.completeTour(!1);else{var a=function(){if("INPUT"===r.mode&&n){var e,o=function(){document.querySelector("#".concat(Wl)).classList.remove("copilot-pointer-container-clickmode"),n.classList.remove("gleap-input-highlight"),document.getElementById(Wl).style.display="none",t.currentActiveIndex++,t.storeUncompletedTour(),t.renderNextStep()};if("default"===(null!==(e=r.inputType)&&void 0!==e?e:"default")){var i=function e(t){var r;if(0!==(null==t||null===(r=t.target)||void 0===r||null===(r=r.value)||void 0===r?void 0:r.length)){var i=document.getElementById("copilot-info-bubble-content");i&&(i.innerHTML="".concat(Vf.translateText("next"),' \n \n'),i.addEventListener("click",o,{once:!0}),n.classList.add("gleap-input-highlight"),document.querySelector("#".concat(Wl)).classList.add("copilot-pointer-container-clickmode"),n.removeEventListener("input",e))}};n.addEventListener("input",i,{once:!1}),n.hasAttribute("contenteditable")&&n.addEventListener("keyup",i,{once:!1}),n.addEventListener("blur",(function(){n.focus()}),{once:!0}),n.focus()}else{var a;Fl(n,null!==(a=r.inputValue)&&void 0!==a?a:"",{charDelay:100,onDone:function(){setTimeout((function(){o()}),1200)}})}}else{if(t.currentActiveIndex++,t.storeUncompletedTour(),"CLICK"===r.mode&&n){var s=n.getBoundingClientRect(),c=window.scrollX||0,l=window.scrollY||0;!function(e,t){if("undefined"!=typeof window){var n=document.createElement("div");n.className="click-wave",n.style.left="".concat(e-17,"px"),n.style.top="".concat(t-17,"px"),document.body.appendChild(n),setTimeout((function(){n.remove()}),800)}}(s.left+s.width/2+c,s.top+s.height/2+l),n.click()}t.renderNextStep()}};e.updatePointerPosition(n,r);var s=null!=r&&r.message?function(e){if("undefined"!=typeof window){var t=document.createElement("div");return t.innerHTML=e,t.querySelectorAll("address, article, blockquote, br, div, footer, h1, h2, h3, h4, h5, h6, header, hr, li, p, pre, section, table, tr").forEach((function(e){e.insertAdjacentText("afterend","\n")})),(t.textContent||"").replace(/[^\S\n]+/g," ").replace(/ *\n */g,"\n").replace(/\n{3,}/g,"\n\n").trim()}}(r.message):"🤔";document.getElementById("copilot-info-bubble-content").textContent=s,e._pointerContainer.style.opacity=1;var c=function(e){if("undefined"!=typeof window){var t=e.split(/\s+/).filter((function(e){return e.length>0})).length;return Math.ceil(t/3.6)+1}}(s),l=function(){e.currentAudio=void 0,setTimeout((function(){a()}),1e3*c)};(null===(o=null===(i=e.productTourData)||void 0===i?void 0:i.playVoice)||void 0===o||o)&&r.voice&&r.voice.length>0?(e.currentAudio=new Audio(r.voice),e.audioMuted&&(e.currentAudio.muted=!0),e.currentAudio.addEventListener("ended",(function(){setTimeout((function(){a()}),1e3)})),e.currentAudio.play().then((function(){})).catch((function(e){l()}))):l()}},i=r.selector?function(e){if("undefined"!=typeof window){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3)/100,n=0;return new Promise((function(r,o){var i=setInterval((function(){var a=document.querySelector(e);a?(clearInterval(i),r(a)):n>=t&&(clearInterval(i),o(new Error("Element not found for selector: ".concat(e)))),n++}),100)}))}}(r.selector):Promise.resolve(null);i.then(o).catch((function(){return o(null)}))}}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Ul(t.prototype,n),r&&Ul(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Kl(e){return Kl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kl(e)}function $l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yl(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!this.productTourId&&!this.disabled)if(this.productTourId=e,this.productTourData=t,this.currentActiveIndex=0,o)this.start();else{var i=this;vs.getInstance().validateProductTour(e).then((function(){return r>0?setTimeout((function(){i.start()}),r):n.start()})).catch((function(e){console.log("Product tour is not live. Cleaning up..."),console.error(e),i.onComplete(!1)}))}}},{key:"onComplete",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={tourId:this.productTourId};e?(Ft.notifyEvent("productTourCompleted",t),oh.trackEvent("tour-".concat(this.productTourId,"-completed"),t)):(Ft.notifyEvent("productTourQuit",t),oh.trackEvent("tour-".concat(this.productTourId,"-quit"),t)),this.gleapTourObj&&this.gleapTourObj.destroy(),this.gleapTourObj=void 0,this.productTourData=void 0,this.productTourId=void 0,this.currentActiveIndex=void 0,this.clearUncompletedTour()}},{key:"loadUncompletedTour",value:function(){try{var e=JSON.parse(localStorage.getItem(tu));if(null!=e&&e.tourData&&null!=e&&e.tourId)return e}catch(t){}return null}},{key:"storeUncompletedTour",value:function(){if(this.productTourId&&this.productTourData)try{var e=JSON.parse(JSON.stringify({tourData:this.productTourData,tourId:this.productTourId}));e.tourData.steps=e.tourData.steps.slice(this.currentActiveIndex||0,e.tourData.steps.length),localStorage.setItem(tu,JSON.stringify(e))}catch(t){}else this.clearUncompletedTour()}},{key:"clearUncompletedTour",value:function(){try{localStorage.removeItem(tu)}catch(e){}}},{key:"start",value:function(){var e=this,t=this.productTourData;if(t){if("cobrowse"===t.tourType)return Jl.getInstance().startWithConfig(this.productTourId,t,(function(t){e.onComplete(t)}));this.unmuted=!1;for(var n=t.steps,r=this,o=[],i=0;i\n \n
').concat(fe("unmute"),"
\n ");else{var p="";t.sender&&t.sender.firstName&&(d=!0,p='
\n
\n
').concat(t.sender.firstName,"
\n
")),u="".concat(p,'
').concat(a.message,"
")}var f={disableActiveInteraction:!s&&!c&&!l,mode:a.mode,popover:Yl({description:u,popoverClass:"gleap-tour-popover-".concat(a.type," ").concat(!d&&"gleap-tour-popover-no-sender"," ").concat(t.allowClose&&"gleap-tour-popover-can-close")},s?{showButtons:[]}:{})};a.selector&&a.selector.length>0&&(f.element=a.selector),o.push(f)}var h=["next","close"];t.backButton&&h.push("previous"),this.gleapTourObj=Pl(Ql(Ql(Ql(Ql(Ql(Ql(Ql(Ql(Ql(Ql({showProgress:!0,allowKeyboardControl:!1,steps:o},"showProgress",n.length>1),"allowClose",t.allowClose),"nextBtnText",t.nextText),"doneBtnText",t.doneText),"prevBtnText",t.prevText),"showButtons",h),"onHighlightStarted",(function(t,n,r){var o;e.currentActiveIndex=null==r||null===(o=r.state)||void 0===o?void 0:o.activeIndex,e.storeUncompletedTour()})),"onElementNotFound",(function(t){document.removeEventListener("click",g),e.onComplete(!1)})),"onDestroyStarted",(function(){e.gleapTourObj.hasNextStep()?e.onComplete(!1):e.onComplete(!0),document.removeEventListener("click",g)})),"onPopoverRender",(function(t){if(t)for(var n=document.querySelectorAll(".gleap-tour-popover-description img, .gleap-tour-popover-description video"),o=function(){setTimeout((function(){e.gleapTourObj.refresh()}),500),setTimeout((function(){e.gleapTourObj.refresh()}),750)},i=0;i((e,t,n)=>t in e?ou(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),au=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(au||{}),su=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(su||{}),cu=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(cu||{}),lu=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(lu||{}),uu=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(uu||{}),du=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(du||{}),pu=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(pu||{});const fu={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},hu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gu={},mu={},vu=()=>!!globalThis.Zone;function yu(e){if(gu[e])return gu[e];const t=globalThis[e],n=t.prototype,r=e in fu?fu[e]:void 0,o=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),i=e in hu?hu[e]:void 0,a=Boolean(i&&i.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(o&&a&&!vu())return gu[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");r.style.display="none",document.body.appendChild(r);const o=r.contentWindow;if(!o)return t.prototype;const i=o[e].prototype;if(!i)return r.remove(),n;const a=navigator.userAgent;return a.includes("Safari")&&!a.includes("Chrome")?(r.classList.add("rr-block"),r.setAttribute("__rrwebUntaintedMutationObserver",""),mu[e]=()=>r.remove()):r.remove(),gu[e]=i}catch{return n}}const bu={};function wu(e,t,n){var r;const o=`${e}.${String(n)}`;if(bu[o])return bu[o].call(t);const i=yu(e),a=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return a?(bu[o]=a,a.call(t)):t[n]}const ku={};function xu(e,t,n){const r=`${e}.${String(n)}`;if(ku[r])return ku[r].bind(t);const o=yu(e)[n];return"function"!=typeof o?t[n]:(ku[r]=o,o.bind(t))}function Su(){return[yu("MutationObserver").constructor,mu.MutationObserver??(()=>{})]}let Cu=Date.now;function Iu(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}/[1-9][0-9]{12}/.test(Date.now().toString())||(Cu=()=>(new Date).getTime());const Eu={ownerDocument:function(e){return wu("Node",e,"ownerDocument")},childNodes:function(e){return wu("Node",e,"childNodes")},parentNode:function(e){return wu("Node",e,"parentNode")},parentElement:function(e){return wu("Node",e,"parentElement")},textContent:function(e){return wu("Node",e,"textContent")},contains:function(e,t){return xu("Node",e,"contains")(t)},getRootNode:function(e){return xu("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?wu("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?wu("Element",e,"shadowRoot"):null},querySelector:function(e,t){return wu("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return wu("Element",e,"querySelectorAll")(t)},nowTimestamp:Cu,mutationObserverCtor:Su,patch:Iu};function Tu(e){return e.nodeType===e.ELEMENT_NODE}function Lu(e){const t=e&&"host"in e&&"mode"in e&&Eu.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Eu.shadowRoot(t)===e)}function Ou(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Au(e){try{const n=e.rules||e.cssRules;if(!n)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);const o=Array.from(n,(e=>Mu(e,r))).join("");return(t=o).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(n){return null}var t}function Mu(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Au(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?zu(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(n)),t?zu(n,t):n}}class Pu{constructor(){iu(this,"idNodeMap",new Map),iu(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ru({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let a=o||"";const s=r&&Nu(r);return(t[n.toLowerCase()]||s&&t[s])&&(a=i?i(a,e):"*".repeat(a.length)),a}function Nu(e){return e.toLowerCase()}const _u="__rrweb_original__";function ju(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Nu(t):null}function Du(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(o){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}const Fu=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Bu=/^(?:[a-z+]+:)?\/\//i,Uu=/^www\..*/i,Hu=/^(data:)([^,]*),(.*)/i;function zu(e,t){return(e||"").replace(Fu,((e,n,r,o,i,a)=>{const s=r||i||a,c=n||o||"";if(!s)return e;if(Bu.test(s)||Uu.test(s))return`url(${c}${s}${c})`;if(Hu.test(s))return`url(${c}${s}${c})`;if("/"===s[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+s}${c})`;const l=s.split("#")[0],u=s.substring(l.length),d=t.split("#")[0].split("/"),p=l.split("/");d.pop();for(const t of p)"."!==t&&(".."===t?d.pop():d.push(t));return`url(${c}${d.join("/")}${u}${c})`}))}function qu(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Wu(e,t){return function(e,t,n=!1){const r=Array.from(t.childNodes),o=[];let i=0;if(r.length>1&&e&&"string"==typeof e){let t=qu(e,n);const a=t.length/e.length;for(let s=1;s2&&""===p[0]&&""!==r[s-1].textContent)f=t.indexOf(d,1);else if(1===p.length){if(d=d.substring(0,d.length-1),p=t.split(d),p.length<=1)return o.push(e),o;u=l+1}else u===c.length-1&&(f=t.indexOf(d));if(p.length>=2&&u>l){const e=r[s-1].textContent;if(e&&"string"==typeof e){const n=qu(e).length;f=t.indexOf(d,n)}-1===f&&(f=p[0].length)}if(-1!==f){let s=Math.floor(f/a);for(;s>0&&s50*r.length)return o.push(e),o;const c=qu(e.substring(0,s),n);if(c.length===f){o.push(e.substring(0,s)),e=e.substring(s),t=t.substring(f);break}c.length=t.length);){let i=r(Yu);if(","===i.slice(-1))i=ed(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=ed(e,i);let a=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((i+r).trim());break}if(a)")"===e&&(a=!1);else{if(","===e){n+=1,o.push((i+r).trim());break}"("===e&&(a=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?zu(r,nd(e)):"object"===t&&"data"===n?ed(e,r):r:r}function od(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function id(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&id(Eu.parentNode(e),t,n);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!n&&id(Eu.parentNode(e),t,n)}function ad(e,t,n,r){let o;if(Tu(e)){if(o=e,!Eu.childNodes(o).length)return!1}else{if(null===Eu.parentElement(e))return!1;o=Eu.parentElement(e)}try{if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(id(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(i){}return!1}function sd(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:a,inlineStylesheet:s,maskInputOptions:c={},maskTextFn:l,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:g=!1,cssCaptured:m=!1}=t,v=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:pu.Document,childNodes:[],compatMode:e.compatMode}:{type:pu.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:pu.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:i,maskInputOptions:a={},maskInputFn:s,dataURLOptions:c={},inlineImages:l,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:f}=t,h=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(r){}return!1}(e,r,o),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=Nu(e.tagName);return Vu.test(t)?"div":t}(e);let m={};const v=e.attributes.length;for(let w=0;wt.href===e.href));let r=null;t&&(r=Au(t)),r&&(delete m.rel,delete m.href,m._cssText=r)}if("style"===g&&e.sheet){let t=Au(e.sheet);t&&(e.childNodes.length>1&&(t=Wu(t,e)),m._cssText=t)}if(["input","textarea","select"].includes(g)){const t=e.value,n=e.checked;"radio"!==m.type&&"checkbox"!==m.type&&"submit"!==m.type&&"button"!==m.type&&t?m.value=Ru({element:e,type:ju(e),tagName:g,value:t,maskInputOptions:a,maskInputFn:s}):n&&(m.checked=n)}"option"===g&&(e.selected&&!a.select?m.selected=!0:delete m.selected);"dialog"===g&&e.open&&(m.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n0!==e)))return!1}return!0})(e)||(m.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(c.type,c.quality)&&(m.rr_dataURL=t)}if("img"===g&&l){Ku||(Ku=n.createElement("canvas"),$u=Ku.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"",o=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Ku.width=t.naturalWidth,Ku.height=t.naturalHeight,$u.drawImage(t,0,0),m.rr_dataURL=Ku.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(o?m.crossOrigin=o:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if(["audio","video"].includes(g)){const t=m;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop));if(h){const{width:t,height:n}=e.getBoundingClientRect();m={class:m.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==g||d(m.src)||(e.contentDocument||(m.rr_src=m.src),delete m.src);let y;try{customElements.get(g)&&(y=!0)}catch(b){}return{type:pu.Element,tagName:g,attributes:m,childNodes:[],isSVG:td(e)||void 0,needBlock:h,rootId:f,isCustom:y}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:s,maskInputOptions:c,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:g,rootId:v});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:o,cssCaptured:i}=t,a=Eu.parentNode(e),s=a&&a.tagName;let c="";const l="STYLE"===s||void 0,u="SCRIPT"===s||void 0;u?c="SCRIPT_PLACEHOLDER":i||(c=Eu.textContent(e),l&&c&&(c=zu(c,nd(t.doc))));!l&&!u&&c&&n&&(c=r?r(c,Eu.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:pu.Text,textContent:c||"",rootId:o}}(e,{doc:n,needsMask:a,maskTextFn:l,rootId:v,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:pu.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:pu.Comment,textContent:Eu.textContent(e)||"",rootId:v};default:return!1}}function cd(e){return null==e?"":e.toLowerCase()}function ld(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function ud(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:c=!1,inlineStylesheet:l=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:S=!1,cssCaptured:C=!1}=t;let{needsMask:I}=t,{preserveWhiteSpace:E=!0}=t;if(!I){I=ad(e,a,s,void 0===I)}const T=sd(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:I,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:h,inlineImages:g,recordCanvas:m,keepIframeSrcFn:x,newlyAddedElement:S,cssCaptured:C});if(!T)return console.warn(e,"not serialized"),null;let L;L=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===pu.Comment)return!0;if(e.type===pu.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Du(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(cd(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===cd(e.attributes.name)||"icon"===cd(e.attributes.rel)||"apple-touch-icon"===cd(e.attributes.rel)||"shortcut icon"===cd(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&cd(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(cd(e.attributes.property).match(/^(og|twitter|fb):/)||cd(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===cd(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===cd(e.attributes.name)||"googlebot"===cd(e.attributes.name)||"bingbot"===cd(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===cd(e.attributes.name)||"generator"===cd(e.attributes.name)||"framework"===cd(e.attributes.name)||"publisher"===cd(e.attributes.name)||"progid"===cd(e.attributes.name)||cd(e.attributes.property).match(/^article:/)||cd(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===cd(e.attributes.name)||"yandex-verification"===cd(e.attributes.name)||"csrf-token"===cd(e.attributes.name)||"p:domain_verify"===cd(e.attributes.name)||"verify-v1"===cd(e.attributes.name)||"verification"===cd(e.attributes.name)||"shopify-checkout-api-token"===cd(e.attributes.name)))return!0}}return!1}(T,f)||!E&&T.type===pu.Text&&!T.textContent.replace(/^\s+|\s+$/gm,"").length?Xu:Ju();const O=Object.assign(T,{id:L});if(r.add(e,O),L===Xu)return null;v&&v(e);let A=!c;if(O.type===pu.Element){A=A&&!O.needBlock,delete O.needBlock;const t=Eu.shadowRoot(e);t&&Ou(t)&&(O.isShadowHost=!0)}if((O.type===pu.Document||O.type===pu.Element)&&A){f.headWhitespace&&O.type===pu.Element&&"head"===O.tagName&&(E=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:I,maskTextClass:a,maskTextSelector:s,skipChild:c,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(O.type===pu.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else{O.type===pu.Element&&void 0!==O.attributes._cssText&&"string"==typeof O.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(Eu.childNodes(e))){const e=ud(n,t);e&&O.childNodes.push(e)}}let S=null;if(Tu(e)&&(S=Eu.shadowRoot(e)))for(const e of Array.from(Eu.childNodes(S))){const n=ud(e,t);n&&(Ou(S)&&(n.isShadow=!0),O.childNodes.push(n))}}const M=Eu.parentNode(e);return M&&Lu(M)&&Ou(M)&&(O.isShadow=!0),O.type===pu.Element&&"iframe"===O.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,i=!1;try{o=r.document.readyState}catch(s){return}if("complete"!==o){const r=setTimeout((()=>{i||(t(),i=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),i=!0,t()}))}const a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&y){const n=ud(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:I,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});n&&y(e,n)}}),b),O.type===pu.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===Du(O.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(a){return}if(r)return;const i=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}(e,(()=>{if(w){const t=ud(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:I,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});t&&w(e,t)}}),k),O}class dd{constructor(...e){iu(this,"parentElement",null),iu(this,"parentNode",null),iu(this,"ownerDocument"),iu(this,"firstChild",null),iu(this,"lastChild",null),iu(this,"previousSibling",null),iu(this,"nextSibling",null),iu(this,"ELEMENT_NODE",1),iu(this,"TEXT_NODE",3),iu(this,"nodeType"),iu(this,"nodeName"),iu(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof dd))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function pd(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const fd="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let hd={map:{},getId:()=>(console.error(fd),-1),getNode:()=>(console.error(fd),null),removeNodeFromMap(){console.error(fd)},has:()=>(console.error(fd),!1),reset(){console.error(fd)}};function gd(e,t,n={}){let r=null,o=0;return function(...i){const a=Date.now();o||!1!==n.leading||(o=a);const s=t-(a-o),c=this;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(c,i)}),s))}}function md(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>md(e,t,i||{},!0)}function vd(e){var t,n,r,o;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=Eu.parentElement(i.body))?void 0:t.scrollLeft)||(null==(n=null==i?void 0:i.body)?void 0:n.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(r=Eu.parentElement(i.body))?void 0:r.scrollTop)||(null==(o=null==i?void 0:i.body)?void 0:o.scrollTop)||0}}function yd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function bd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function wd(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Eu.parentElement(e)}function kd(e,t,n,r){if(!e)return!1;const o=wd(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(id(o,t,r))return!0}catch(i){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function xd(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===Xu}function Sd(e,t){if(Lu(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=Eu.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||Sd(r,t))}function Cd(e){return Boolean(e.changedTouches)}function Id(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ed(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Td(e){return!!e&&(e instanceof dd&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Eu.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(hd=new Proxy(hd,{get:(e,t,n)=>("map"===t&&console.error(fd),Reflect.get(e,t,n))}));class Ld{constructor(){iu(this,"id",1),iu(this,"styleIDMap",new WeakMap),iu(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Od(e){var t;let n=null;return"getRootNode"in e&&(null==(t=Eu.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Eu.host(Eu.getRootNode(e))&&(n=Eu.host(Eu.getRootNode(e))),n}function Ad(e){const t=Eu.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=Od(n);)n=t;return n}(e);return Eu.contains(t,n)}function Md(e){const t=Eu.ownerDocument(e);return!!t&&(Eu.contains(t,e)||Ad(e))}function Pd(e){return"__ln"in e}class Rd{constructor(){iu(this,"length",0),iu(this,"head",null),iu(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n`${e}@${t}`;class _d{constructor(){iu(this,"frozen",!1),iu(this,"locked",!1),iu(this,"texts",[]),iu(this,"attributes",[]),iu(this,"attributeMap",new WeakMap),iu(this,"removes",[]),iu(this,"mapRemoves",[]),iu(this,"movedMap",{}),iu(this,"addedSet",new Set),iu(this,"movedSet",new Set),iu(this,"droppedSet",new Set),iu(this,"removesSubTreeCache",new Set),iu(this,"mutationCb"),iu(this,"blockClass"),iu(this,"blockSelector"),iu(this,"maskTextClass"),iu(this,"maskTextSelector"),iu(this,"inlineStylesheet"),iu(this,"maskInputOptions"),iu(this,"maskTextFn"),iu(this,"maskInputFn"),iu(this,"keepIframeSrcFn"),iu(this,"recordCanvas"),iu(this,"inlineImages"),iu(this,"slimDOMOptions"),iu(this,"dataURLOptions"),iu(this,"doc"),iu(this,"mirror"),iu(this,"iframeManager"),iu(this,"stylesheetManager"),iu(this,"shadowDomManager"),iu(this,"canvasManager"),iu(this,"processedNodeManager"),iu(this,"unattachedDoc"),iu(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),iu(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Rd,r=e=>{let t=e,n=Xu;for(;n===Xu;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{const i=Eu.parentNode(o);if(!i||!Md(o))return;let a=!1;if(o.nodeType===Node.TEXT_NODE){const e=i.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(i)&&(a=!0)}const s=Lu(i)?this.mirror.getId(Od(o)):this.mirror.getId(i),c=r(o);if(-1===s||-1===c)return n.addNode(o);const l=ud(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Id(e,this.mirror)&&this.iframeManager.addIframe(e),Ed(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Td(o)&&this.shadowDomManager.addShadowRoot(Eu.shadowRoot(o),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:a});l&&(e.push({parentId:s,nextId:c,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)Dd(this.removesSubTreeCache,s,this.mirror)&&!this.movedSet.has(Eu.parentNode(s))||o(s);for(const s of this.addedSet)Fd(this.droppedSet,s)||Dd(this.removesSubTreeCache,s,this.mirror)?Fd(this.movedSet,s)?o(s):this.droppedSet.add(s):o(s);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(Eu.parentNode(i.value)),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(Eu.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=Eu.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Eu.host(r);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),o(e.value)}const a={texts:this.texts.map((e=>{const t=e.node,n=Eu.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))})),iu(this,"genTextAreaValueMutation",(e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const n=Array.from(Eu.childNodes(e),(e=>Eu.textContent(e)||"")).join("");t.attributes.value=Ru({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:ju(e),value:n,maskInputFn:this.maskInputFn})})),iu(this,"processMutation",(e=>{if(!xd(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Eu.textContent(e.target);kd(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ad(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,wd(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,o=e.target.getAttribute(r);if("value"===r){const e=ju(n);o=Ru({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:o,maskInputFn:this.maskInputFn})}if(kd(e.target,this.blockClass,this.blockSelector,!1)||o===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(o)){if(n.contentDocument)return;r="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!od(n.tagName,r))if(i.attributes[r]=rd(this.doc,Nu(n.tagName),Nu(r),o),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),o=n.style.getPropertyPriority(e);t!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?i.styleDiff[e]=""===o?t:[t,o]:i._unchangedStyles[e]=[t,o]}for(const e of Array.from(r.style))""===n.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(kd(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),r=Lu(e.target)?this.mirror.getId(Eu.host(e.target)):this.mirror.getId(e.target);kd(e.target,this.blockClass,this.blockSelector,!1)||xd(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(jd(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Sd(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Nd(n,r)]?jd(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!Lu(e.target)||!Ou(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),Eu.childNodes(e).forEach((e=>n.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),iu(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xd(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Nd(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);kd(e,this.blockClass,this.blockSelector,!1)||(Eu.childNodes(e).forEach((e=>this.genAdds(e))),Td(e)&&Eu.childNodes(Eu.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function jd(e,t){e.delete(t),Eu.childNodes(t).forEach((t=>jd(e,t)))}function Dd(e,t,n){return 0!==e.size&&function(e,t,n){const r=Eu.parentNode(t);return!!r&&e.has(r)}(e,t)}function Fd(e,t){return 0!==e.size&&Bd(e,t)}function Bd(e,t){const n=Eu.parentNode(t);return!!n&&(!!e.has(n)||Bd(e,n))}let Ud;const Hd=e=>{if(!Ud)return e;return(...t)=>{try{return e(...t)}catch(n){if(Ud&&!0===Ud(n))return;throw n}}},zd=[];function qd(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Wd(e,t){const n=new _d;zd.push(n),n.init(e);const[r,o]=Su(),i=new r(Hd(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function Gd({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[];let c=null;return Object.keys(cu).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((i=>{let a=Nu(i);const l=(t=>i=>{const a=qd(i);if(kd(a,r,o,!0))return;let s=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":s=lu.Mouse;break;case"touch":s=lu.Touch;break;case"pen":s=lu.Pen}s===lu.Touch?cu[t]===cu.MouseDown?l="TouchStart":cu[t]===cu.MouseUp&&(l="TouchEnd"):lu.Pen}else Cd(i)&&(s=lu.Touch);null!==s?(c=s,(l.startsWith("Touch")&&s===lu.Touch||l.startsWith("Mouse")&&s===lu.Mouse)&&(s=null)):cu[t]===cu.Click&&(s=c,c=null);const u=Cd(i)?i.changedTouches[0]:i;if(!u)return;const d=n.getId(a),{clientX:p,clientY:f}=u;Hd(e)({type:cu[l],id:d,x:p,y:f,...null!==s&&{pointerType:s}})})(i);if(window.PointerEvent)switch(cu[i]){case cu.MouseDown:case cu.MouseUp:a=a.replace("mouse","pointer");break;case cu.TouchStart:case cu.TouchEnd:return}s.push(pd(a,l,t))})),Hd((()=>{s.forEach((e=>e()))}))}function Vd({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return pd("scroll",Hd(gd(Hd((i=>{const a=qd(i);if(!a||kd(a,r,o,!0))return;const s=n.getId(a);if(a===t&&t.defaultView){const n=vd(t.defaultView);e({id:s,x:n.left,y:n.top})}else e({id:s,x:a.scrollLeft,y:a.scrollTop})})),i.scroll||100)),t)}const Xd=["INPUT","TEXTAREA","SELECT"],Jd=new WeakMap;function Kd(e){return function e(t,n){if(Qd("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Qd("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Qd("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Qd("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const r=Array.from(t.parentRule.cssRules).indexOf(t);return n.unshift(r),e(t.parentRule,n)}if(t.parentStyleSheet){const e=Array.from(t.parentStyleSheet.cssRules).indexOf(t);n.unshift(e)}return n}(e,[])}function $d(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Yd({mirror:e,stylesheetManager:t},n){var r,o,i;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(Eu.host(n));const s="#document"===n.nodeName?null==(r=n.defaultView)?void 0:r.Document:null==(i=null==(o=n.ownerDocument)?void 0:o.defaultView)?void 0:i.ShadowRoot,c=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var n;const r=null==(n=c.set)?void 0:n.call(this,e);if(null!==a&&-1!==a)try{t.adoptStyleSheets(e,a)}catch(o){}return r}}),Hd((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function Zd(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:p,selectionCb:f,customElementCb:h}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),a(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),f(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),h(...e)}}(e,t);let o=()=>{};e.recordDOM&&([r,o]=Wd(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let a,s=[];const c=gd(Hd((t=>{const n=Date.now()-a;e(s.map((e=>(e.timeOffset-=n,e))),t),s=[],a=null})),i),l=Hd(gd(Hd((e=>{const t=qd(e),{clientX:n,clientY:o}=Cd(e)?e.changedTouches[0]:e;a||(a=Cu()),s.push({x:n,y:o,id:r.getId(t),timeOffset:Cu()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?su.Drag:e instanceof MouseEvent?su.MouseMove:su.TouchMove)})),o,{trailing:!1})),u=[pd("mousemove",l,n),pd("touchmove",l,n),pd("drag",l,n)];return Hd((()=>{u.forEach((e=>e()))}))}(e),a=Gd(e),s=Vd(e),c=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return pd("resize",Hd(gd(Hd((()=>{const t=yd(),o=bd();n===t&&r===o||(e({width:Number(o),height:Number(t)}),n=t,r=o)})),200)),t)}(e,{win:n}),l=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,ignoreSelector:a,maskInputOptions:s,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=qd(e);const l=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=Eu.parentElement(n)),!n||!d||Xd.indexOf(d)<0||kd(n,r,o,!0))return;if(n.classList.contains(i)||a&&n.matches(a))return;let f=n.value,h=!1;const g=ju(n)||"";"radio"===g||"checkbox"===g?h=n.checked:(s[d.toLowerCase()]||s[g])&&(f=Ru({element:n,maskInputOptions:s,tagName:d,type:g,value:f,maskInputFn:c})),p(n,u?{text:f,isChecked:h,userTriggered:l}:{text:f,isChecked:h});const m=n.name;"radio"===g&&m&&h&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==n){const t=e.value;p(e,u?{text:t,isChecked:!h,userTriggered:!1}:{text:t,isChecked:!h})}}))}function p(t,r){const o=Jd.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Jd.set(t,r);const o=n.getId(t);Hd(e)({...r,id:o})}}const f=("last"===l.input?["change"]:["input","change"]).map((e=>pd(e,Hd(d),t))),h=t.defaultView;if(!h)return()=>{f.forEach((e=>e()))};const g=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),m=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&f.push(...m.map((e=>md(e[0],e[1],{set(){Hd(d)({target:this,isTrusted:!1})}},!1,h)))),Hd((()=>{f.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const a=Hd((i=>gd(Hd((o=>{const a=qd(o);if(!a||kd(a,t,n,!0))return;const{currentTime:s,volume:c,muted:l,playbackRate:u,loop:d}=a;e({type:i,id:r.getId(a),currentTime:s,volume:c,muted:l,playbackRate:u,loop:d})})),o.media||500))),s=[pd("play",a(du.Play),i),pd("pause",a(du.Pause),i),pd("seeked",a(du.Seeked),i),pd("volumechange",a(du.VolumeChange),i),pd("ratechange",a(du.RateChange),i)];return Hd((()=>{s.forEach((e=>e()))}))}(e);let d=()=>{},p=()=>{},f=()=>{},h=()=>{};e.recordDOM&&(d=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Hd(((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=$d(o,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:a,index:s}]}),r.apply(o,i)}))}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){const o=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[o,n])};const i=r.CSSStyleSheet.prototype.deleteRule;let a,s;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Hd(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=$d(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,removes:[{index:a}]}),r.apply(o,i)}))}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Hd(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=$d(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replace:a}),r.apply(o,i)}))})),r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:Hd(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=$d(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replaceSync:a}),r.apply(o,i)}))}));const c={};ep("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(ep("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),ep("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),ep("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach((([r,o])=>{l[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Hd(((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=$d(o.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:a,index:[...Kd(o),s||0]}]}),r.apply(o,i)}))}),o.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Hd(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=$d(o.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,removes:[{index:[...Kd(o),a]}]}),r.apply(o,i)}))})})),Hd((()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach((([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule}))}))}(e,{win:n}),p=Yd(e,e.doc),f=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Hd(((o,a,s)=>{var c;const[l,u,d]=s;if(n.has(l))return i.apply(a,[l,u,d]);const{id:p,styleId:f}=$d(null==(c=a.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||f&&-1!==f)&&e({id:p,styleId:f,set:{property:l,value:u,priority:d},index:Kd(a.parentRule)}),o.apply(a,s)}))});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Hd(((o,i,s)=>{var c;const[l]=s;if(n.has(l))return a.apply(i,[l]);const{id:u,styleId:d}=$d(null==(c=i.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(u&&-1!==u||d&&-1!==d)&&e({id:u,styleId:d,remove:{property:l},index:Kd(i.parentRule)}),o.apply(i,s)}))}),Hd((()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}))}(e,{win:n}),e.collectFonts&&(h=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=Iu(t.fonts,"add",(function(t){return function(n){return setTimeout(Hd((()=>{const t=o.get(n);t&&(e(t),o.delete(n))})),0),t.apply(this,[n])}}));return r.push((()=>{n.FontFace=i})),r.push(a),Hd((()=>{r.forEach((e=>e()))}))}(e)));const g=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let a=!0;const s=Hd((()=>{const e=t.getSelection();if(!e||a&&(null==e?void 0:e.isCollapsed))return;a=e.isCollapsed||!1;const s=[],c=e.rangeCount||0;for(let t=0;t{}}(e),v=[];for(const y of e.plugins)v.push(y.observer(y.callback,n,y.options));return Hd((()=>{zd.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),a(),s(),c(),l(),u(),d(),p(),f(),h(),g(),m(),v.forEach((e=>e()))}))}function Qd(e){return void 0!==window[e]}function ep(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class tp{constructor(e){iu(this,"iframeIdToRemoteIdMap",new WeakMap),iu(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),i.set(a,t)),a}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class np{constructor(e){iu(this,"iframes",new WeakMap),iu(this,"crossOriginIframeMap",new WeakMap),iu(this,"crossOriginIframeMirror",new tp(Ju)),iu(this,"crossOriginIframeStyleMirror"),iu(this,"crossOriginIframeRootIdMap",new WeakMap),iu(this,"mirror"),iu(this,"mutationCb"),iu(this,"wrappedEmit"),iu(this,"loadListener"),iu(this,"stylesheetManager"),iu(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tp(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case au.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:au.IncrementalSnapshot,data:{source:su.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case au.Meta:case au.Load:case au.DomContentLoaded:return!1;case au.Plugin:return t;case au.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case au.IncrementalSnapshot:switch(t.data.source){case su.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case su.Drag:case su.TouchMove:case su.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case su.ViewportResize:return!1;case su.MediaInteraction:case su.MouseInteraction:case su.Scroll:case su.CanvasMutation:case su.Input:return this.replaceIds(t.data,e,["id"]),t;case su.StyleSheetRule:case su.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case su.Font:return t;case su.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case su.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===pu.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class rp{constructor(e){iu(this,"shadowDoms",new WeakSet),iu(this,"mutationCb"),iu(this,"scrollCb"),iu(this,"bypassOptions"),iu(this,"mirror"),iu(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Ou(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[n]=Wd({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Vd({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(Eu.host(e))),this.restoreHandlers.push(Yd({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(Iu(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r),i=Eu.shadowRoot(this);return i&&Md(this)&&n.addShadowRoot(i,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var op="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ip="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ap=0;ap<64;ap++)ip[op.charCodeAt(ap)]=ap;const sp=new Map;const cp=(e,t,n)=>{if(!e||!dp(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=sp.get(e);return n||(n=new Map,sp.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function lp(e,t,n){if(e instanceof Array)return e.map((e=>lp(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t>2],o+=op[(3&n[t])<<4|n[t+1]>>4],o+=op[(15&n[t+1])<<2|n[t+2]>>6],o+=op[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[lp(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[lp(e.data,t,n),e.width,e.height]}}if(dp(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:cp(e,t,n)}}return e}const up=(e,t,n)=>e.map((e=>lp(e,t,n))),dp=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function pp(e,t,n,r){const o=[];try{const i=Iu(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...i){if(!kd(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...i])}}));o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function fp(e,t,n,r,o,i){const a=[],s=Object.getOwnPropertyNames(e);for(const c of s)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if("function"!=typeof e[c])continue;const s=Iu(e,c,(function(e){return function(...a){const s=e.apply(this,a);if(cp(s,i,this),"tagName"in this.canvas&&!kd(this.canvas,r,o,!0)){const e=up(a,i,this),r={type:t,property:c,args:e};n(this.canvas,r)}return s}}));a.push(s)}catch{const r=md(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});a.push(r)}return a}const hp='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',gp="undefined"!=typeof self&&self.Blob&&new Blob([hp],{type:"text/javascript;charset=utf-8"});function mp(e){let t;try{if(t=gp&&(self.URL||self.webkitURL).createObjectURL(gp),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(hp),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class vp{constructor(e){iu(this,"pendingCanvasMutations",new Map),iu(this,"rafStamps",{latestId:0,invokeId:null}),iu(this,"mirror"),iu(this,"mutationCb"),iu(this,"resetObservers"),iu(this,"frozen",!1),iu(this,"locked",!1),iu(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,r,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const i=pp(t,n,r,!0),a=new Map,s=new mp;s.onmessage=e=>{const{id:t}=e.data;if(a.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:uu["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let l,u=0;const d=e=>{u&&e-u{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{kd(t,n,r,!0)||e.push(t)})),e})().forEach((async e=>{var t;const n=this.mirror.getId(e);if(a.get(n))return;if(0===e.width||0===e.height)return;if(a.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);s.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])}))),l=requestAnimationFrame(d)};l=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=pp(e,t,n,!1),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const i=Iu(t.CanvasRenderingContext2D.prototype,a,(function(o){return function(...i){return kd(this.canvas,n,r,!0)||setTimeout((()=>{const n=up(i,t,this);e(this.canvas,{type:uu["2D"],property:a,args:n})}),0),o.apply(this,i)}}));o.push(i)}catch{const n=md(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:uu["2D"],property:a,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r){const o=[];return void 0!==t.WebGLRenderingContext&&o.push(...fp(t.WebGLRenderingContext.prototype,uu.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...fp(t.WebGL2RenderingContext.prototype,uu.WebGL2,e,n,r,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const{type:t,...n}=e;return n})),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class yp{constructor(e){iu(this,"trackedLinkElements",new WeakSet),iu(this,"mutationCb"),iu(this,"adoptedStyleSheetCb"),iu(this,"styleMirror",new Ld),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const o of e){let e;this.styleMirror.has(o)?e=this.styleMirror.getId(o):(e=this.styleMirror.add(o),r.push({styleId:e,rules:Array.from(o.rules||CSSRule,((e,t)=>({rule:Mu(e,o.href),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class bp{constructor(){iu(this,"nodeMap",new WeakMap),iu(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let wp,kp,xp,Sp=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ru=e.contentWindow)?void 0:ru.Array.from)||Array.from,document.body.removeChild(e)}}catch(ah){console.debug("Unable to override Array.from",ah)}const Cp=new Pu;function Ip(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:s=null,maskTextClass:c="rr-mask",maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:f,maskInputFn:h,maskTextFn:g,hooks:m,packFn:v,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:k=!0,recordCanvas:x=!1,recordCrossOriginIframes:S=!1,recordAfter:C=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:I=!1,collectFonts:E=!1,inlineImages:T=!1,plugins:L,keepIframeSrcFn:O=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:M}=e;Ud=M;const P=!S||window.parent===window;let R=!1;if(!P)try{window.parent.document&&(R=!1)}catch(V){R=!0}if(P&&!t)throw new Error("emit function is required");if(!P&&!R)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Cp.reset();const N=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},_=ld(f);let j;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let D=0;const F=e=>{for(const t of L||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!R&&(e=v(e)),e};wp=(e,o)=>{var i;const a=e;if(a.timestamp=Cu(),!(null==(i=zd[0])?void 0:i.isFrozen())||a.type===au.FullSnapshot||a.type===au.IncrementalSnapshot&&a.data.source===su.Mutation||zd.forEach((e=>e.unfreeze())),P)null==t||t(F(a),o);else if(R){const e={type:"rrweb",event:F(a),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(a.type===au.FullSnapshot)j=a,D=0;else if(a.type===au.IncrementalSnapshot){if(a.data.source===su.Mutation&&a.data.isAttachIframe)return;D++;const e=r&&D>=r,t=n&&a.timestamp-j.timestamp>n;(e||t)&&kp(!0)}};const B=e=>{wp({type:au.IncrementalSnapshot,data:{source:su.Mutation,...e}})},U=e=>wp({type:au.IncrementalSnapshot,data:{source:su.Scroll,...e}}),H=e=>wp({type:au.IncrementalSnapshot,data:{source:su.CanvasMutation,...e}}),z=new yp({mutationCb:B,adoptedStyleSheetCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.AdoptedStyleSheet,...e}})}),q=new np({mirror:Cp,mutationCb:B,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:wp});for(const J of L||[])J.getMirror&&J.getMirror({nodeMirror:Cp,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});const W=new bp;xp=new vp({recordCanvas:x,mutationCb:H,win:window,blockClass:o,blockSelector:i,mirror:Cp,sampling:y.canvas,dataURLOptions:b});const G=new rp({mutationCb:B,scrollCb:U,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:N,dataURLOptions:b,maskTextFn:g,maskInputFn:h,recordCanvas:x,inlineImages:T,sampling:y,slimDOMOptions:_,iframeManager:q,stylesheetManager:z,canvasManager:xp,keepIframeSrcFn:O,processedNodeManager:W},mirror:Cp});kp=(e=!1)=>{if(!k)return;wp({type:au.Meta,data:{href:window.location.href,width:bd(),height:yd()}},e),z.reset(),G.init(),zd.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new Pu,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:p,slimDOM:f=!1,dataURLOptions:h,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k=(()=>!1)}=t;return ud(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:s,maskInputOptions:!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===u?{password:!0}:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:ld(f),dataURLOptions:h,inlineImages:c,recordCanvas:l,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}(document,{mirror:Cp,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:N,maskTextFn:g,maskInputFn:h,slimDOM:_,dataURLOptions:b,recordCanvas:x,inlineImages:T,onSerialize:e=>{Id(e,Cp)&&q.addIframe(e),Ed(e,Cp)&&z.trackLinkElement(e),Td(e)&&G.addShadowRoot(Eu.shadowRoot(e),document)},onIframeLoad:(e,t)=>{q.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:O});if(!t)return console.warn("Failed to snapshot the document");wp({type:au.FullSnapshot,data:{node:t,initialOffset:vd(window)}},e),zd.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Cp.getId(document))};try{const e=[],t=e=>{var t;return Hd(Zd)({mutationCb:B,mousemoveCb:(e,t)=>wp({type:au.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.MouseInteraction,...e}}),scrollCb:U,viewportResizeCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.ViewportResize,...e}}),inputCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.Input,...e}}),mediaInteractionCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.MediaInteraction,...e}}),styleSheetRuleCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.StyleSheetRule,...e}}),styleDeclarationCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.StyleDeclaration,...e}}),canvasMutationCb:H,fontCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.Font,...e}}),selectionCb:e=>{wp({type:au.IncrementalSnapshot,data:{source:su.Selection,...e}})},customElementCb:e=>{wp({type:au.IncrementalSnapshot,data:{source:su.CustomElement,...e}})},blockClass:o,ignoreClass:a,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:N,inlineStylesheet:u,sampling:y,recordDOM:k,recordCanvas:x,inlineImages:T,userTriggeredOnInput:I,collectFonts:E,doc:e,maskInputFn:h,maskTextFn:g,keepIframeSrcFn:O,blockSelector:i,slimDOMOptions:_,dataURLOptions:b,mirror:Cp,iframeManager:q,stylesheetManager:z,shadowDomManager:G,processedNodeManager:W,canvasManager:xp,ignoreCSSAttributes:A,plugins:(null==(t=null==L?void 0:L.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>wp({type:au.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};q.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{kp(),e.push(t(document)),Sp=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(pd("DOMContentLoaded",(()=>{wp({type:au.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&n()}))),e.push(pd("load",(()=>{wp({type:au.Load,data:{}}),"load"===C&&n()}),window))),()=>{e.forEach((e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")||console.warn(t)}})),W.destroy(),Sp=!1,Ud=void 0}}catch(X){console.warn(X)}}Ip.addCustomEvent=(e,t)=>{if(!Sp)throw new Error("please add custom event after start recording");wp({type:au.Custom,data:{tag:e,payload:t}})},Ip.freezePage=()=>{zd.forEach((e=>e.freeze()))},Ip.takeFullSnapshot=e=>{if(!Sp)throw new Error("please take full snapshot after start recording");kp(e)},Ip.mirror=Cp;var Ep=Uint8Array,Tp=Uint16Array,Lp=Uint32Array,Op=new Ep([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ap=new Ep([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Mp=new Ep([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pp=function(e,t){for(var n=new Tp(31),r=0;r<31;++r)n[r]=t+=1<>>1|(21845&Bp)<<1;Up=(61680&(Up=(52428&Up)>>>2|(13107&Up)<<2))>>>4|(3855&Up)<<4,Fp[Bp]=((65280&Up)>>>8|(255&Up)<<8)>>>1}var Hp=function(e,t,n){for(var r=e.length,o=0,i=new Tp(t);o>>c]=l}else for(a=new Tp(r),o=0;o>>15-e[o];return a},zp=new Ep(288);for(Bp=0;Bp<144;++Bp)zp[Bp]=8;for(Bp=144;Bp<256;++Bp)zp[Bp]=9;for(Bp=256;Bp<280;++Bp)zp[Bp]=7;for(Bp=280;Bp<288;++Bp)zp[Bp]=8;var qp=new Ep(32);for(Bp=0;Bp<32;++Bp)qp[Bp]=5;var Wp=Hp(zp,9,0),Gp=Hp(qp,5,0),Vp=function(e){return(e/8>>0)+(7&e&&1)},Xp=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Tp?Tp:e instanceof Lp?Lp:Ep)(n-t);return r.set(e.subarray(t,n)),r},Jp=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Kp=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},$p=function(e,t){for(var n=[],r=0;rp&&(p=i[r].s);var f=new Tp(p+1),h=Yp(n[u-1],f,0);if(h>t){r=0;var g=0,m=h-t,v=1<t))break;g+=v-(1<>>=m;g>0;){var b=i[r].s;f[b]=0&&g;--r){var w=i[r].s;f[w]==t&&(--f[w],++g)}h=t}return[new Ep(f),h]},Yp=function(e,t,n){return-1==e.s?Math.max(Yp(e.l,t,n+1),Yp(e.r,t,n+1)):t[e.s]=n},Zp=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Tp(++t),r=0,o=e[0],i=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return[n.subarray(0,r),t]},Qp=function(e,t){for(var n=0,r=0;r>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i4&&!E[Mp[L-1]];--L);var O,A,M,P,R=l+5<<3,N=Qp(o,zp)+Qp(i,qp)+a,_=Qp(o,p)+Qp(i,g)+a+14+3*L+Qp(S,E)+(2*S[16]+3*S[17]+7*S[18]);if(R<=N&&R<=_)return ef(t,u,e.subarray(c,c+l));if(Jp(t,u,1+(_15&&(Jp(t,u,B[C]>>>5&127),u+=B[C]>>>12)}}}else O=Wp,A=zp,M=Gp,P=qp;for(C=0;C255){U=r[C]>>>18&31;Kp(t,u,O[U+257]),u+=A[U+257],U>7&&(Jp(t,u,r[C]>>>23&31),u+=Op[U]);var H=31&r[C];Kp(t,u,M[H]),u+=P[H],H>3&&(Kp(t,u,r[C]>>>5&8191),u+=Ap[H])}else Kp(t,u,O[r[C]]),u+=A[r[C]];return Kp(t,u,O[256]),u+A[256]},nf=new Lp([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rf=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new Ep(r+a+5*(1+Math.floor(a/7e3))+o),c=s.subarray(r,s.length-o),l=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var d=u+65535;d>>13,h=8191&p,g=(1<7e3||E>24576)&&P>423){l=tf(e,c,0,k,x,S,I,E,L,u-L,l),E=C=I=0,L=u;for(var R=0;R<286;++R)x[R]=0;for(R=0;R<30;++R)S[R]=0}var N=2,_=0,j=h,D=A-M&32767;if(P>2&&O==w(u-D))for(var F=Math.min(f,P)-1,B=Math.min(32767,u),U=Math.min(258,P);D<=B&&--j&&A!=M;){if(e[u+N]==e[u+N-D]){for(var H=0;HN){if(N=H,_=D,H>F)break;var z=Math.min(D,H-2),q=0;for(R=0;Rq&&(q=G,M=W)}}}D+=(A=M)-(M=m[A])+32768&32767}if(_){k[E++]=268435456|_p[N]<<18|Dp[_];var V=31&_p[N],X=31&Dp[_];I+=Op[V]+Ap[X],++x[257+V],++S[X],T=u+N,++C}else k[E++]=e[u],++x[e[u]]}}l=tf(e,c,i,k,x,S,I,E,L,u-L,l)}return Xp(s,0,r+Vp(l)+o)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)};function of(e,t){void 0===t&&(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var r=e,o=t,i=n.length,a=0;a!=i;){for(var s=Math.min(a+5552,i);a>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();n.p(e);var r,o,i,a=rf(e,t,2,4);return r=a,o=t.level,i=0==o?0:o<6?1:9==o?3:2,r[0]=120,r[1]=i<<6|(i?32-2*i:1),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(a,a.length-4,n.d()),a}const af=e=>{const t={...e,v:"v1"};return function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var r=0;r>10,56320|1023&o))}return n}(of(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Ep(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},a=0;ar.length){var s=new Ep(o+8+(n-a<<1));s.set(r),r=s}var c=e.charCodeAt(a);c<128||t?i(c):c<2048?(i(192|c>>>6),i(128|63&c)):c>55295&&c<57344?(i(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++a))>>>18),i(128|c>>>12&63),i(128|c>>>6&63),i(128|63&c)):(i(224|c>>>12),i(128|c>>>6&63),i(128|63&c))}return Xp(r,0,o)}(JSON.stringify(t))),!0)};function sf(e){return function(e){if(Array.isArray(e))return cf(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return cf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cf(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n3;)e.dropOldestSegment();var r=mf(t);e.segments[e.segments.length-1].push(t),e.segmentSizes[e.segmentSizes.length-1]+=r,t&&4!==t.type&&2!==t.type&&(e.incrementalSize+=r),e.enforceBufferSize()}}))}catch(n){console.error(n)}}},{key:"startIfNotRunning",value:function(){this.stopFunction||this.start()}},{key:"stop",value:function(){this.stopFunction&&(this.stopFunction(),this.stopFunction=void 0),this.startDate=void 0,this.resetBuffer()}},{key:"resetBuffer",value:function(){clearTimeout(this.forcedCheckoutTimeout),this.forcedCheckoutTimeout=void 0,this.segments=[[]],this.segmentSizes=[0],this.incrementalSize=0}},{key:"dropOldestSegment",value:function(){this.segments.shift(),this.segmentSizes.shift()}},{key:"getBufferSize",value:function(){for(var e=0,t=0;t1&&this.getBufferSize()>gf;)this.dropOldestSegment();this.getBufferSize()>gf&&this.incrementalSize>5242880&&this.scheduleForcedCheckout()}},{key:"scheduleForcedCheckout",value:function(){var e=this;if(!this.forcedCheckoutTimeout){var t=Math.max(0,this.lastForcedCheckout+3e4-Date.now());this.forcedCheckoutTimeout=setTimeout((function(){e.forcedCheckoutTimeout=void 0,e.lastForcedCheckout=Date.now();try{Ip.takeFullSnapshot(!0)}catch(t){}}),t)}}},{key:"getReplayData",value:function(){var e,t=(e=[]).concat.apply(e,sf(this.segments)),n=t,r=!1;try{n=t.map((function(e){return af(e)})),r=!0}catch(o){n=t,r=!1}return{startDate:this.startDate,events:n,packed:r,baseUrl:window.location.origin,width:window.innerWidth,height:window.innerHeight,isMobile:Q(),type:"rrweb"}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&df(t.prototype,n),r&&df(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function yf(e){return yf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yf(e)}function bf(e,t){for(var n=0;n=1e4&&(this.reconnectAttempts=0),this.cleanupWebSocket(),this.scheduleReconnect()}},{key:"processMessage",value:function(e){try{if(st.getInstance().initialized)return;if("update"===e.name){var t,n,r=e.data,o=r.a,i=r.u,a=r.ai,s=r.rc,c=zs.getInstance().isOpened();if(s&&bl.getInstance().clearNotificationsForConversation(s),a&&Pn.getInstance().setConfig({enabled:null!==(t=a.e)&&void 0!==t&&t,placeholder:a.p,quickActions:a.a,style:a.s,workflowId:null!==(n=a.w)&&void 0!==n?n:null}),o){var l=["banner","modal"],u=o.filter((function(e){var t;return!c||l.includes(null==e||null===(t=e.actionType)||void 0===t?void 0:t.toLowerCase())}));oh.getInstance().performActions(u)}null!=i&&bl.getInstance().setNotificationCount(i)}if("checklist"===e.name&&null!=e&&e.data&&window){var d,p,f=e.data,h=null!==(d=f.completedSteps)&&void 0!==d?d:[],g=null!==(p=f.completedStepsBefore)&&void 0!==p?p:[];if(h.length>g.length)for(var m=function(e){var t,n=null==f||null===(t=f.steps)||void 0===t?void 0:t.find((function(t){return t.id===h[e]}));if(!n)return 1;var r=e;g.includes(n)||Ft.notifyEvent("checklist-step-completed",{checklistId:f.id,outboundId:f.outboundId,stepId:n.id,stepIndex:r,step:n,completedSteps:f.completedSteps,status:f.status,data:f})},v=0;vthis.eventMaxLength&&this.eventArray.shift(),this.trimStreamedEvents()}},{key:"trimStreamedEvents",value:function(){for(;this.streamedEventArray.length>500;){var e=this.streamedEventArray.findIndex((function(e){return!e||"sessionStarted"!==e.name}));this.streamedEventArray.splice(-1!==e?e:0,1)}}},{key:"pingDidFinish",value:function(t,n,r,o){if(this.pingInFlight===t){this.pingInFlight=0;var i=o.status;if(i>=200&&i<300)return this.pingFailures=0,this.pingRetryAt=0,this.removeSentEvents(n),void(r&&this.streamEvents());e.isRetryablePingStatus(i)||this.removeSentEvents(n);var a=-1;try{a=e.parseRetryAfter(o.getResponseHeader("Retry-After"))}catch(c){}this.pingFailures+=1;var s=e.pingBackoffDelay(this.pingFailures,Math.random());a>0&&(s=Math.max(s,Math.min(a,3e5))),this.pingRetryAt=Date.now()+s}}},{key:"nextPingBatch",value:function(){for(var e=[],t=[],n=2,r=0;r0&&n+i>262144)break;e.push(o),n+=i}return t.length>0&&(this.streamedEventArray=this.streamedEventArray.filter((function(e){return-1===t.indexOf(e)}))),{events:e,hasMore:e.length=500}},{key:"parseRetryAfter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n="string"==typeof e?e.trim():"";if(!n)return-1;if(/^\d+$/.test(n))return 1e3*parseInt(n,10);var r=Date.parse(n);return isNaN(r)?-1:Math.max(0,r-t)}}],n&&Cf(t.prototype,n),r&&Cf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Pf(e){return Pf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pf(e)}function Rf(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";return Vf.translateText(e)||t}},{key:"_translateWithVars",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Vf.translateTextWithVars(e,t)||n}},{key:"getCheckIcon",value:function(){return'\n \n '}},{key:"loadChecklist",value:function(){if(this._isSessionReady&&this._networkManager){var e=this.getAttribute("checklistId");e?(this.activeStep=-1,this._initialActiveSet=!1,this.validateChecklist(e)):(this.renderResponse(),this.checklistData=null,this._hasLoaded=!1)}}},{key:"getQueryParams",value:function(){var e=this._getGleapSessionInstance();if(null==e||!e.session)return"";var t=e.session,n="en";try{void 0!==Vf&&(n=Vf.getInstance().getActiveLanguage()||"en")}catch(r){}return"gleapId=".concat(t.gleapId||"","&gleapHash=").concat(t.gleapHash||"","&lang=").concat(n)}},{key:"makeRequest",value:function(e,t,n,r){var o=this._getGleapSessionInstance();if(null!=o&&o.session){var i=new XMLHttpRequest;i.open(e,t);try{o.injectSession(i)}catch(a){}n&&i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.onreadystatechange=function(){4===i.readyState&&r(i)},i.onerror=function(){r(i)},i.send(n?JSON.stringify(n):null)}else r({readyState:4,status:0,responseText:"Session unavailable",_isMock:!0})}},{key:"validateChecklist",value:function(e){var t=this;if(this._isSessionReady&&this._networkManager){this.checklistData=null,this._hasLoaded=!1,this.renderResponse();var n=this.getAttribute("sharedKey");this._networkManager.validateChecklist(e,n).then((function(e){t.isConnected&&t._isSessionReady&&e&&t.fetchChecklist(e)})).catch((function(e){t.renderResponse(),t.checklistData=null,t._hasLoaded=!1}))}}},{key:"fetchChecklist",value:function(e){var t=this;this._isSessionReady&&this._networkManager&&(this._isInitialLoad=!this._hasLoaded,this._networkManager.fetchChecklist(e).then((function(e){var n;if(!t.isConnected||!t._isSessionReady||!e)return t._hasLoaded=!1,t.checklistData=null,void t._checkSessionAndLoad();if(t.checklistData=e,t._hasLoaded=!0,"done"!==e.status){if(t._isInitialLoad&&!t._initialActiveSet){var r,o=(null===(r=e.outbound)||void 0===r||null===(r=r.config)||void 0===r?void 0:r.steps)||[],i=e.completedSteps||[],a=o.findIndex((function(e){return!i.includes(e.id)}));t.activeStep=a>=0?a:-1,-1!==t.activeStep&&(t._initialActiveSet=!0)}t.renderChecklist(t.checklistData),Ft.notifyEvent("checklist-loaded",{checklistId:t.checklistData.id,outboundId:null===(n=t.checklistData.outbound)||void 0===n?void 0:n.id,completedSteps:t.checklistData.completedSteps,status:t.checklistData.status,data:t.checklistData})}else t.renderResponse()})).catch((function(e){t.renderResponse(),t.checklistData=null,t._hasLoaded=!1})))}},{key:"updateChecklist",value:function(e,t){var n,r,o=this._getGleapSessionInstance();if(null!=o&&o.session){var i=o.apiUrl;if(i){var a=o.session,s=null!==(n=null==a?void 0:a.gleapId)&&void 0!==n?n:"",c=null!==(r=null==a?void 0:a.gleapHash)&&void 0!==r?r:"",l="en";try{void 0!==Vf&&(l=Vf.getInstance().getActiveLanguage()||"en")}catch(d){}var u="".concat(i,"/outbound/checklists/").concat(e);t.checkedStep&&(u+="/increment/".concat(t.checkedStep)),u+="?gleapId=".concat(s,"&gleapHash=").concat(c,"&lang=").concat(l),this.makeRequest("PUT",u,t,(function(e){e._isMock||200!==e.status&&e.status}))}}}},{key:"handleChecklistUpdate",value:function(e){if(this._hasLoaded&&this.checklistData){var t=e.detail;if(t&&t.id===this.checklistData.id){var n,r=Vn(this.checklistData.completedSteps||[]),o=!1,i=!1,a=this.activeStep;if(t.completedSteps&&JSON.stringify(t.completedSteps)!==JSON.stringify(r)&&(this.checklistData.completedSteps=Vn(t.completedSteps),o=!0,-1!==a)){var s,c=null===(s=this.checklistData.outbound)||void 0===s||null===(s=s.config)||void 0===s||null===(s=s.steps)||void 0===s||null===(s=s[a])||void 0===s?void 0:s.id;c&&this.checklistData.completedSteps.includes(c)&&!r.includes(c)&&(i=!0)}if(t.status&&t.status!==this.checklistData.status&&(this.checklistData.status=t.status,o=!0),i){for(var l,u=(null===(l=this.checklistData.outbound)||void 0===l||null===(l=l.config)||void 0===l?void 0:l.steps)||[],d=-1,p=a+1;p1&&void 0!==arguments[1]?arguments[1]:"checklist-floating",o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=(null===(t=e.config)||void 0===t?void 0:t.steps)||[],a=(null===(n=this.checklistData)||void 0===n?void 0:n.completedSteps)||[],s=0;if(this.progressbarEnabled&&i.length>0){var c=i.length,l=a.length;s=c>0?l/c*100:0}var u,d,p=i.find((function(e){return!a.includes(e.id)})),f=i.length>0?p?p.title||this._translateWithVars("stepDefaultTitle",{index:i.indexOf(p)+1},"Step ".concat(i.indexOf(p)+1)):"":e.subject||"",h=i.length>0?p&&p.description||"":e.message||"";o&&(f=(null===(u=e.config)||void 0===u?void 0:u.successTitle)||"",h=(null===(d=e.config)||void 0===d?void 0:d.successMessage)||"",s=100);var g=2*Math.PI*7,m=g-s/100*g,v="checklist-floating-header"===r,y=v?'\n \n \n ':'\n \n ';return'\n
\n
\n
\n \n \n \n \n
\n
').concat(f,"
\n ").concat(o?"":''.concat(y,""),'\n
\n
').concat(h,"
\n
\n ")}},{key:"renderInfoSection",value:function(e){var t;if(!this.infoEnabled||!e)return"";var n=e.subject||this._translate("checklistDefaultTitle","Checklist"),r=e.message||"",o="";return null!==(t=e.sender)&&void 0!==t&&t.profileImageUrl&&(o='\n
\n ').concat(e.sender.firstName||\n ').concat(e.sender.firstName||"","\n
")),'\n
\n '.concat(n?'
'.concat(n,"
"):"","\n ").concat(r?'
'.concat(r,"
"):"","\n ").concat(o,"\n
")}},{key:"renderProgressSection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!this.progressbarEnabled||!e.length)return"";var n=e.length,r=t.length,o=n>0?r/n*100:0,i=0;e.forEach((function(e){!t.includes(e.id)&&e.duration>0&&(i+=e.duration)}));var a=this._translateWithVars("taskProgress",{a:r,b:n},"".concat(r," of ").concat(n," done")),s=i>0?this._translateWithVars("aboutMinutes",{a:i},"About ".concat(i," min left")):"";return'\n
\n
'.concat(a,"
\n ").concat(s?'
'.concat(s,"
"):"",'\n
\n
\n
\n
')}},{key:"renderTasks",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t&&0!==t.length?t.map((function(t,r){var o=n.includes(t.id),i=e.activeStep===r,a=o?''.concat(e.getCheckIcon(),""):''.concat(r+1,""),s=t.title||e._translateWithVars("stepDefaultTitle",{index:r+1},"Step ".concat(r+1)),c=t.description||"",l=t.actionTitle||e._translate("actionDefaultTitle","Action"),u=t.action&&"none"!==t.action?'
\n \n
"):"",d=e._translate("markAsDone","Mark as done"),p=t.allowMarkDone&&!o?'
\n ').concat(e.getCheckIcon(),'\n
').concat(d,"
\n
"):"",f=["checklist-task",o?"checklist-task--done":"",i?"checklist-task--active":""].filter(Boolean).join(" ");return'\n
\n
\n ').concat(a,'\n
').concat(s,'
\n \n \n \n \n \n
\n
\n
\n ').concat(c?'
'.concat(c,"
"):"","\n ").concat(u,"\n ").concat(p,"\n
\n
\n
")})).join(""):"

".concat(this._translate("noStepsDefined","No steps defined."),"

")}},{key:"renderChecklist",value:function(e){var t;if(this._hasLoaded&&e&&e.outbound){var n=e.outbound,r=(null===(t=n.config)||void 0===t?void 0:t.steps)||[],o=e.completedSteps||[],i="";if("done"===e.status||r.length>0&&o.length>=r.length){var a,s,c=(null===(a=n.config)||void 0===a?void 0:a.successTitle)||"",l=(null===(s=n.config)||void 0===s?void 0:s.successMessage)||"";i=this.floatingEnabled?this.renderFloatingLauncher(n,"checklist-floating-launcher",!0):'\n
\n
\n '.concat(this.getCheckIcon(),'\n
\n
').concat(c,'
\n
').concat(l,"
\n
"),-1!==this.activeStep&&(this.activeStep=-1)}else i='\n
\n '.concat(this.floatingEnabled?"":this.renderInfoSection(n),"\n ").concat(this.floatingEnabled?"":this.renderProgressSection(r,o),"\n ").concat(this.floatingEnabled?this.renderFloatingLauncher(n):"",'\n
\n ').concat(this.floatingEnabled?this.renderFloatingLauncher(n,"checklist-floating-header"):"","\n ").concat(this.renderTasks(r,o),"\n
\n
");var u=br.getInstance().getFlowConfig(),d=u.color?u.color:"#485BFF";xn.getInstance().applyToChecklist(this);var p="\n \n ');this.shadowRoot.innerHTML=p+i,this.addTaskEventListeners(),this.floatingEnabled&&this.addFloatingClickListeners(),-1!==this.activeStep&&this.toggleTask(this.activeStep,!0)}else this._checkSessionAndLoad()}},{key:"updateActiveTaskMaxHeight",value:function(){if(-1!==this.activeStep){var e=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(this.activeStep,'"] .checklist-task-body-inner')),t=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(this.activeStep,'"] .checklist-task-body'));if(e&&t){var n=e.offsetHeight;t.style.setProperty("--task-body-active-height","".concat(n,"px"))}}}},{key:"addTaskEventListeners",value:function(){var e=this;this.shadowRoot.querySelectorAll(".checklist-task").forEach((function(t){var n=t.querySelector(".checklist-task-header"),r=parseInt(t.getAttribute("data-task-index"),10);n&&n.addEventListener("click",(function(){var t=e.activeStep===r?-1:r;e.setActiveStep(t)}));var o=t.querySelector(".checklist-task-body-markdone");o&&o.addEventListener("click",(function(t){var n;if(t.stopPropagation(),null!==(n=e.checklistData)&&void 0!==n&&null!==(n=n.outbound)&&void 0!==n&&null!==(n=n.config)&&void 0!==n&&n.steps){var o=e.checklistData.outbound.config.steps[r];if(o){var i=e.activeStep;if(e.checklistData.completedSteps||(e.checklistData.completedSteps=[]),!e.checklistData.completedSteps.includes(o.id)){e.checklistData.completedSteps.push(o.id);var a=e.checklistData.outbound.config.steps,s=-1;if(i===r){for(var c=r+1;c0&&e.checklistData.completedSteps.length>=a.length&&(e.checklistData.status="done",l.status="done"),e.updateChecklist(e.checklistData.id,l)}}}}));var i=t.querySelector(".checklist-task-body-action .action-button");i&&i.addEventListener("click",(function(t){var n;if(t.stopPropagation(),null!==(n=e.checklistData)&&void 0!==n&&null!==(n=n.outbound)&&void 0!==n&&null!==(n=n.config)&&void 0!==n&&n.steps&&void 0!==oh){var o=e.checklistData.outbound.config.steps[r];if(o&&o.action&&"none"!==o.action)try{"BOT"===o.action?oh.startBot(o.botId):"CUSTOM_ACTION"===o.action?oh.triggerCustomAction(o.actionBody):"REDIRECT_URL"===o.action?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),oh.openURL(o.actionBody,!!o.actionOpenInNewTab)):"FEEDBACK_FLOW"===o.action?oh.startFeedbackFlow(o.formId):"NEWS_ARTICLE"===o.action?oh.openNewsArticle(o.articleId):"HELP_ARTICLE"===o.action?oh.openHelpCenterArticle(o.articleId):"CHECKLIST"===o.action?oh.startChecklist(o.outboundId,!0,null==o?void 0:o.sharedKey):"PRODUCT_TOUR"===o.action&&oh.startProductTour(o.productTourId,!0)}catch(i){}}}))}))}},{key:"setActiveStep",value:function(e){var t=this,n=this.activeStep;this.activeStep=e;var r=[];-1!==n&&n!==this.activeStep&&r.push({index:n,open:!1}),-1!==this.activeStep&&this.activeStep!==n&&r.push({index:this.activeStep,open:!0}),r.forEach((function(e){var n=e.index,r=e.open;t.toggleTask(n,r)}))}},{key:"toggleTask",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(e,'"]'));if(r){var o=r.querySelector(".checklist-task-header");if(o){var i=r.classList.contains("checklist-task--active"),a=null!==n?n:!i;if(a){i||(r.classList.add("checklist-task--active"),o.setAttribute("aria-expanded","true"));var s=r.querySelector(".checklist-task-body-inner");if(s){var c=s.offsetHeight,l=r.querySelector(".checklist-task-body");l&&l.style.setProperty("--task-body-active-height","".concat(c,"px"))}r.querySelectorAll("iframe").forEach((function(n){n._heightListenerAdded||(n._heightListenerAdded=!0,n.addEventListener("load",(function(){t.activeStep===e&&t.updateActiveTaskMaxHeight()})))}))}else!a&&i&&(r.classList.remove("checklist-task--active"),o.setAttribute("aria-expanded","false"))}}}}],o=[{key:"observedAttributes",get:function(){return["checklistId","info","progressbar","dark","floating","sharedKey"]}}],r&&Jn(n.prototype,r),o&&Jn(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(Yn(HTMLElement));"undefined"==typeof customElements||customElements.get("gleap-checklist")||customElements.define("gleap-checklist",e)}}(),function(){if("undefined"!=typeof customElements&&"undefined"!=typeof HTMLElement&&"undefined"!=typeof window&&!customElements.get("gleap-agent-conversation")){var e=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,r=new Array(n),o=0;o0||r.pageFilter)&&window&&window.location&&!rs(window.location.href,r))continue;"notification"===r.actionType?"widget"===(null==r||null===(a=r.data)||void 0===a||null===(a=a.checklist)||void 0===a?void 0:a.popupType)?e.openChecklist(r.data.checklist.id,!0):this.disableInAppNotifications||e.showNotification(r):"banner"===r.actionType?e.showBanner(r):"modal"===r.actionType?e.showModal(r):"tour"===r.actionType?e.startProductTourWithConfig(r.outbound,r.data,!1):e.showSurvey(r.actionType,r.format)}}}},{key:"setGlobalDataItem",value:function(e,t){this.globalData[e]=t}},{key:"getGlobalDataItem",value:function(e){return this.globalData[e]}},{key:"takeCurrentReplay",value:function(){var e=vf.getInstance().getReplayData(),t=e&&e.startDate&&Array.isArray(e.events)&&e.events.length>0;this.setGlobalDataItem("webReplay",t?e:null)}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"setEnvironment",value:function(e){cc.getInstance().environment=e}},{key:"setEnvDataPropsToIgnore",value:function(e){cc.setEnvDataPropsToIgnore(e)}},{key:"setDisableEnvData",value:function(e){cc.setDisableEnvData(e)}},{key:"setCSPNonce",value:function(e){!function(e){z=U(e)}(e)}},{key:"setTags",value:function(e){Hf.getInstance().setTags(e)}},{key:"setUrlHandler",value:function(e){zs.getInstance().setUrlHandler(e)}},{key:"setOfflineMode",value:function(e){this.getInstance().offlineMode=e}},{key:"setDisableInAppNotifications",value:function(e){this.getInstance().disableInAppNotifications=e}},{key:"setDisablePageTracking",value:function(e){this.getInstance().disablePageTracking=e}},{key:"disableConsoleLogOverwrite",value:function(){Jr.getInstance().stop()}},{key:"setAiTools",value:function(e){Xt.getInstance().setAgentTools(e),Pn.getInstance().sendAgentToolsUpdate(),zs.getInstance().sendConfigUpdate()}},{key:"attachNetworkLogs",value:function(e){hl.getInstance().setExternalRequests(ee(e))}},{key:"log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"INFO";Jr.getInstance().addLog(e,t)}},{key:"initialize",value:function(t){var n=this.getInstance();if(n.initialized)console.warn("Gleap already initialized.");else{n.initialized=!0;try{vf.getInstance().startIfNotRunning()}catch(o){}try{!function(){try{var e=function(){try{var e=document.querySelector(".gleap-frame-container-inner iframe");if(!e)return;r(e);var t=window.visualViewport,n=c(window.innerHeight)-c(t.height);!d&&n>=a?(e.style.setProperty("max-height",t.height+"px","important"),e.style.setProperty("transform","translateY("+t.offsetTop+"px)","important")):(e.style.removeProperty("max-height"),e.style.removeProperty("transform"))}catch(o){}},t=function(){try{window.setTimeout((function(){try{var e=p&&p.activeElement;if(e&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable))return;d=!0;var t=document.querySelector(".gleap-frame-container-inner iframe");t&&(t.style.removeProperty("max-height"),t.style.removeProperty("transform")),i()}catch(n){}}),100)}catch(o){}},n=function(){d=!1,i()},r=function(e){try{var r=e.contentDocument;if(!r||r===p)return;p=r,r.addEventListener("focusout",t,!0),r.addEventListener("focusin",n,!0)}catch(o){}},i=function(){try{u||(u=!0,window.requestAnimationFrame((function(){u=!1,e()}))),l&&clearTimeout(l),l=setTimeout(e,s)}catch(o){}};if(!("visualViewport"in window)||!window.visualViewport||!/iPad|iPhone|iPod/.test(navigator.userAgent))return;if(ce)return;ce=!0;var a=150,s=350,c=function(e){return Math.round(e)},l=null,u=!1,d=!1,p=null,f=window.visualViewport;f.addEventListener("resize",i),f.addEventListener("scroll",i),window.addEventListener("orientationchange",(function(){try{i()}catch(o){}})),e()}catch(o){}}()}catch(o){}var r=vs.getInstance();r.sdkKey=t,r.setOnSessionReady((function(){setTimeout((function(){br.getInstance().start().then((function(){Mf.getInstance().start(),se((function(){_.getInstance().injectFeedbackButton(),bl.getInstance().injectNotificationUI(),e.checkForUncompletedTour(),e.checkForUrlParams(),Ft.notifyEvent("initialized")}))})).catch((function(e){console.warn("Failed to initialize Gleap.")}))}),0)})),r.startSession()}}},{key:"openURL",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];zs.getInstance().urlHandler(e,t)}},{key:"disableQueryParams",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.getInstance().disableQueryParams=e}},{key:"checkForUrlParams",value:function(){if(this.getInstance().disableQueryParams)console.log("Query params are disabled.");else if("undefined"!=typeof window&&window.location.search)try{var t=new URLSearchParams(window.location.search),n=t.get("gleap_widget");n&&n.length>0&&e.open();var r=t.get("gleap_conversation");r&&r.length>0&&("true"===r?e.startConversation(!0):e.startBot(r,!0));var o=t.get("gleap_feedback");o&&o.length>0&&e.startFeedbackFlow(o);var i=t.get("gleap_survey"),a=t.get("gleap_survey_format");i&&i.length>0&&e.showSurvey(i,"survey_full"===a?"survey_full":"survey");var s=t.get("gleap_tour");if(s&&s.length>0){var c=parseInt(t.get("gleap_tour_delay"));isNaN(c)&&(c=2),setTimeout((function(){e.startProductTour(s)}),1e3*c)}}catch(l){}}},{key:"destroy",value:function(){vf.getInstance().stop(),Mf.getInstance().stop(),zs.getInstance().destroy(),_.getInstance().destroy(),bl.getInstance().clearAllNotifications(!0),jf.getInstance().stop(),Pn.getInstance().destroy(),vs.getInstance().clearSession(0,!1),Wn.getInstance().removeBannerUI(),this.instance=null}},{key:"closeBanner",value:function(){Wn.getInstance().removeBannerUI()}},{key:"closeModal",value:function(){gc.getInstance().hideModal()}},{key:"showAiChatbar",value:function(){var e=Pn.getInstance();e.manuallyHidden=!1,e.manuallyShown=!0,e.show()}},{key:"hideAiChatbar",value:function(){var e=Pn.getInstance();e.manuallyHidden=!0,e.manuallyShown=!1,e.hide()}},{key:"startAgent",value:function(e,t){try{Pn.getInstance().showWithAgent(e,t)}catch(n){}}},{key:"setAiChatbarQuickActions",value:function(e){Pn.getInstance().setQuickActions(e)}},{key:"setAiChatbarPlaceholder",value:function(e){Pn.getInstance().setPlaceholder(e)}},{key:"setUseCookies",value:function(e){vs.getInstance().useCookies=e}},{key:"disableLocalStorage",value:function(){vs.getInstance().localStorageDisabled=!0}},{key:"identify",value:function(e,t,n){return vs.getInstance().identifySession(e,ne(ee(t)),n)}},{key:"updateContact",value:function(e){return vs.getInstance().updateSession(ne(ee(e)))}},{key:"clearIdentity",value:function(){vs.getInstance().clearSession()}},{key:"getIdentity",value:function(){return vs.getInstance().getSession()}},{key:"isUserIdentified",value:function(){var e=vs.getInstance().session;return!!(e&&e.userId&&e.userId.length>0)}},{key:"isOpened",value:function(){return zs.getInstance().isOpened()}},{key:"hide",value:function(){zs.getInstance().hideWidget()}},{key:"setMaxNetworkRequests",value:function(e){hl.getInstance().setMaxRequests(e)}},{key:"startNetworkLogger",value:function(){hl.getInstance().start()}},{key:"setNetworkLogsBlacklist",value:function(e){hl.getInstance().setBlacklist(e)}},{key:"setNetworkLogPropsToIgnore",value:function(e){hl.getInstance().setFilters(e)}},{key:"setReplayOptions",value:function(e){vf.getInstance().setOptions(e)}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];zs.getInstance().hideWidget(e)}},{key:"open",value:function(){zs.getInstance().setAppMode("widget"),zs.getInstance().showWidget()}},{key:"trackEvent",value:function(e,t){Mf.getInstance().logEvent(e,t)}},{key:"logEvent",value:function(e,t){Mf.getInstance().logEvent(e,t)}},{key:"preFillForm",value:function(e){var t=ee(e);Cl.getInstance().formPreFill=t,zs.getInstance().sendMessage({name:"prefill-form-data",data:t},!0)}},{key:"on",value:function(e,t){Ft.on(e,t)}},{key:"enableShortcuts",value:function(e){e?xf.getInstance().start():xf.getInstance().stop()}},{key:"showFeedbackButton",value:function(e){_.getInstance().toggleFeedbackButton(e)}},{key:"setAppVersionCode",value:function(e){cc.setAppVersionCode(e)}},{key:"setAppBuildNumber",value:function(e){cc.setAppBuildNumber(e)}},{key:"setRegion",value:function(e){vs.getInstance().setRegion(e)}},{key:"getRegion",value:function(){return vs.getInstance().getRegion()}},{key:"setWSApiUrl",value:function(e){vs.getInstance().wsApiUrl=e}},{key:"setRealtimeHost",value:function(e){vs.getInstance().realtimeHost=e}},{key:"setApiUrl",value:function(e){vs.getInstance().apiUrl=e}},{key:"setBannerUrl",value:function(e){Wn.getInstance().setBannerUrl(e)}},{key:"setModalUrl",value:function(e){gc.getInstance().setModalUrl(e)}},{key:"setAgentConversationUrl",value:function(e){Rt(e)}},{key:"setFrameUrl",value:function(e){zs.getInstance().frameUrl=e}},{key:"setTicketAttribute",value:function(e,t){ao.getInstance().setTicketAttribute(e,t)}},{key:"unsetTicketAttribute",value:function(e){ao.getInstance().unsetTicketAttribute(e)}},{key:"clearTicketAttributes",value:function(){ao.getInstance().clearTicketAttributes()}},{key:"attachCustomData",value:function(e){ao.getInstance().attachCustomData(e)}},{key:"setCustomData",value:function(e,t){ao.getInstance().setCustomData(e,t)}},{key:"removeCustomData",value:function(e){ao.getInstance().removeCustomData(e)}},{key:"clearCustomData",value:function(){ao.getInstance().clearCustomData()}},{key:"playSound",value:function(e){Dn.playSound(e)}},{key:"showTabNotificationBadge",value:function(e){var t=bl.getInstance();t.showNotificationBadge=e,t.updateTabBarNotificationCount()}},{key:"setLanguage",value:function(t){Vf.getInstance().setOverrideLanguage(t),e.getInstance().initialized&&setTimeout((function(){e.getInstance().softReInitialize(),e.updateContact({lang:t})}),1e3)}},{key:"registerAgentToolAction",value:function(e){Xt.getInstance().registerAgentToolAction(e)}},{key:"registerAgentTool",value:function(e,t){Xt.getInstance().registerAgentTool(e,t)}},{key:"registerCustomAction",value:function(e){to.registerCustomAction(e)}},{key:"triggerCustomAction",value:function(e){to.triggerCustomAction(e)}},{key:"setColorScheme",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};xn.getInstance().setColorScheme(e,t)}},{key:"setStyles",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#ffffff",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:20,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:20,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:20,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:_.FEEDBACK_BUTTON_BOTTOM_LEFT,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:void 0,l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:void 0;se((function(){!function(e,t,n,r,o,i,a,s,c,l){var u=pe(e),d=pe(n),p=pe(o),f="#ffffff"===p,h=c||t,g=l||t,m=de(o,f?100:-120),v=de(o,f?30:-12),y=de(o,f?80:-30),b=f?o:"#fff",w=f?p:"#2d2d2d",k=(r=parseInt(r,10),Math.round(1.05*r)),x=Math.round(.8*r),S=Math.round(.4*r),C=Math.round(.25*r),I=Math.max(2,Math.round(.55*r)),E=Math.max(2,Math.round(20*I/32)),T=57+a;s===_.FEEDBACK_BUTTON_CLASSIC_BOTTOM?T=a+15:(s&&s.includes("CLASSIC")||s===_.FEEDBACK_BUTTON_NONE)&&(T=a);var L='\n .gleap-font, .gleap-font * {\n font-style: normal;\n font-variant-caps: normal;\n font-variant-ligatures: normal;\n font-variant-numeric: normal;\n font-variant-east-asian: normal;\n font-weight: normal;\n font-stretch: normal;\n font-size: 100%;\n line-height: 1;\n font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n }\n .gleap-ai-ui-widget {\n display: none;\n }\n .gleap-input-highlight {\n box-shadow: 0 0 0 3px '.concat(e," !important;\n }\n .gleap-frame-container {\n right: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n width: calc(100% - 40px);\n max-width: 410px;\n position: fixed;\n z-index: ").concat(2147483631,";\n visibility: visible;\n box-shadow: 0px 5px 40px 0px rgba(9, 14, 21, 0.16);\n border-radius: ").concat(1.5*x,"px;\n overflow: hidden;\n transform-origin: right bottom;\n animation: gleapWidgetScale 0.3s cubic-bezier(0, 1.2, 1, 1) both, gleapWidgetFade 0.12s ease-out both;\n user-select: none;\n pointer-events: none;\n transition: max-width 0.3s ease-out;\n }\n\n .gleap-admin-highlight {\n box-shadow: 0px 0px 0px 4px red;\n }\n\n :root {\n --gleap-margin-top: 50px;\n }\n\n .gleap-tooltip-anchor {\n position: relative;\n display: inline-block;\n float: left;\n max-width: 0px;\n width: 17px;\n }\n\n .gleap-tooltip-hotspot {\n position: absolute;\n display: block;\n width: 17px;\n height: 17px;\n cursor: pointer;\n top: 0px;\n left: 0px;\n }\n\n @keyframes gleap-pulse {\n 0% {\n transform: scale(0);\n opacity: 0.25;\n }\n 45% {\n transform: scale(2.5);\n opacity: 0;\n }\n 100% {\n transform: scale(0);\n opacity: 0;\n }\n }\n\n .gleap-tooltip-hotspot-animation {\n position: absolute;\n border-radius: 17px;\n opacity: 0.25;\n display: block;\n width: 17px;\n height: 17px;\n cursor: pointer;\n top: 0px;\n left: 0px;\n animation: gleap-pulse 5s infinite;\n }\n\n .gleap-tooltip-hotspot svg {\n width: 17px;\n height: 17px;\n object-fit: contain;\n display: block;\n }\n\n .gleap-tooltip-inner {\n position: relative;\n overflow: visible;\n font-size: 14px;\n font-weight: normal;\n color: #000;\n line-height: 1.3;\n }\n\n .gleap-tooltip {\n position: absolute;\n background-color: #fff;\n color: #000;\n font-size: 15px;\n line-height: 18px;\n padding: 16px;\n padding-top: 8px;\n padding-bottom: 8px;\n border-radius: 4px;\n max-width: min(350px, 80vw);\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.2);\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s, visibility 0.2s;\n z-index: ").concat(2147483700,";\n }\n\n .gleap-tooltip a {\n color: ").concat(e,";\n text-decoration: underline;\n display: inline !important;\n margin: 0px !important;\n padding: 0px !important;\n word-break: break-word;\n }\n\n .gleap-tooltip ul {\n padding-left: 16px;\n }\n\n .gleap-tooltip b {\n font-weight: 600;\n }\n\n .gleap-tooltip h2 {\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip h3 {\n font-size: 16px;\n line-height: 18px;\n font-weight: 600;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip p {\n padding: 0px;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip img {\n max-width: 100%;\n max-height: 300px;\n width: 100%;\n height: auto;\n object-fit: cover;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 4px;\n }\n\n .gleap-tooltip iframe,\n .gleap-tooltip video {\n max-width: 100%;\n width: 100%;\n height: auto;\n min-height: 200px;\n display: block;\n border: none;\n outline: none;\n padding: 0px;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 4px;\n }\n\n .gleap-tooltip-arrow {\n position: absolute;\n width: 20px;\n height: 20px;\n }\n\n .gleap-tooltip-arrow svg {\n width: 20px;\n height: 20px;\n object-fit: contain;\n }\n\n .gleap-b-frame {\n width: 100%;\n height: 100%;\n border: none;\n pointer-events: auto;\n padding: 0px;\n margin: 0px;\n }\n\n .gleap-b-shown {\n transition: margin 0.3s ease-out;\n margin-top: var(--gleap-margin-top);\n position: relative;\n z-index: 10000;\n }\n\n .gleap-b-f {\n margin-top: 0px;\n }\n\n .gleap-b {\n display: none;\n position: absolute;\n top: calc(-1 * var(--gleap-margin-top));\n left: 0px;\n width: 100vw;\n height: var(--gleap-margin-top);\n z-index: ").concat(2147483699,";\n }\n\n @keyframes gleapSlideIn {\n from {\n top: calc(-1 * var(--gleap-margin-top));\n }\n to {\n top: 10px;\n }\n }\n\n .gleap-b-f .gleap-b {\n position: fixed;\n top: 10px;\n animation: gleapSlideIn .25s ease-out forwards;\n max-width: 800px;\n width: calc(100% - 20px);\n left: 50%;\n z-index: ").concat(2147483699,";\n transform: translateX(-50%);\n border-radius: ").concat(S,"px;\n overflow: hidden;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.15), 0px 5px 5px rgba(0, 0, 0, 0.05);\n }\n\n .gleap-b-shown .gleap-b {\n display: block;\n }\n\n .gleap-image-view {\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n z-index: ").concat(2147483699,";\n background-color: ").concat(p,"cc;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .gleap-image-view-image {\n width: 90%;\n height: auto;\n max-width: 90%;\n max-height: 90%;\n object-fit: contain;\n }\n\n .gleap-image-view-close {\n position: fixed;\n top: 20px;\n right: 20px;\n width: 32px;\n height: 32px;\n opacity: 0.8;\n z-index: ").concat(2147483740,";\n box-shadow: 0px 5px 18px rgba(0, 0, 0, 0.16);\n cursor: pointer;\n }\n\n .gleap-image-view-close:hover {\n opacity: 1;\n }\n\n .gleap-image-view-close svg path {\n fill: ").concat(o,";\n }\n\n [dir=rtl].gleap-frame-container {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n .gleap-frame-container iframe {\n transition: opacity 0.3s ease;\n }\n\n .gleap-frame-container--loading iframe {\n opacity: 0;\n transition: none;\n }\n\n .gleap-frame-loader {\n visibility: hidden;\n opacity: 0;\n transition: opacity 0.3s ease, visibility 0s linear 0.35s;\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n overflow: hidden;\n background-color: ").concat(o,";\n pointer-events: none;\n }\n\n .gleap-frame-container--loading .gleap-frame-loader {\n visibility: visible;\n opacity: 1;\n transition: none;\n }\n\n .gleap-frame-loader svg {\n display: block;\n width: 100%;\n height: auto;\n }\n\n .gleap-frame-loader .gleap-bg-base {\n fill: ").concat(o,";\n }\n\n .gleap-frame-loader .gleap-bg-c1 {\n fill: ").concat(t,";\n }\n\n .gleap-frame-loader .gleap-bg-c2 {\n fill: ").concat(h,";\n }\n\n .gleap-frame-loader .gleap-bg-c3 {\n fill: ").concat(g,";\n }\n\n .gleap-frame-loader .gleap-bg-grad-1 {\n stop-color: ").concat(h,";\n }\n\n .gleap-frame-loader .gleap-bg-grad-2 {\n stop-color: ").concat(t,";\n }\n\n .gleap-frame-loader .gleap-bg-fade {\n stop-color: ").concat(o,";\n }\n\n @keyframes gleapBgGrowShrink2 {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.35);\n }\n }\n\n @keyframes gleapBgGrowShrink3 {\n 0%, 100% {\n transform: scale(1) rotate(0deg);\n }\n 50% {\n transform: scale(1.3) rotate(20deg);\n }\n }\n\n .gleap-frame-loader--animate .gleap-bg-c2 {\n animation: gleapBgGrowShrink2 7s infinite;\n transform-origin: 50% 50%;\n }\n\n .gleap-frame-loader--animate .gleap-bg-c3 {\n animation: gleapBgGrowShrink3 6s infinite;\n transform-origin: 50% 50%;\n }\n\n .gleap-frame-loader-blur {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n -webkit-backdrop-filter: blur(30px);\n backdrop-filter: blur(30px);\n }\n\n .gleap-frame-loader--image {\n background-color: #ffffff;\n }\n\n .gleap-frame-loader-image-wrap {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0;\n transition: opacity 0.25s ease-in;\n }\n\n .gleap-frame-loader--dockedbar .gleap-frame-loader-image-wrap {\n bottom: 80px;\n }\n\n /* v4 header block: top-anchored, height driven by the strut child + the\n header's 150px padding-bottom — mirrors .agent-home-v4-header so the\n brand surface is exactly as tall as the app's, at any width/wrap. */\n .gleap-frame-loader-header {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n padding-bottom: 150px;\n overflow: hidden;\n }\n\n .gleap-frame-loader-header--colour {\n background: linear-gradient(\n 180deg,\n ").concat(t," 0%,\n ").concat(h,' 100%\n );\n }\n\n /* Strut: invisible height driver replicating the header\'s content box. */\n .gleap-frame-loader-strut {\n position: relative;\n z-index: 1;\n visibility: hidden;\n /* Match the messenger\'s font stack EXACTLY (and reset any inherited host\n font metrics), so the title wraps to the same number of lines the app\n will — the whole point of the strut is a 1:1 height, and a different\n host font would wrap differently and break it. */\n font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n font-style: normal;\n letter-spacing: normal;\n text-transform: none;\n box-sizing: border-box;\n }\n\n .gleap-frame-loader-strut-bar {\n height: 96px;\n }\n\n .gleap-frame-loader-strut-greeting {\n padding: 54px 38px 0px;\n box-sizing: border-box;\n }\n\n .gleap-frame-loader-strut-kicker {\n font-size: 25px;\n line-height: 25px;\n font-weight: normal;\n margin: 0px 0px 4px;\n }\n\n .gleap-frame-loader-strut-title {\n font-size: 25px;\n line-height: 29.5px;\n font-weight: 600;\n margin: 0px;\n }\n\n .gleap-frame-loader-ramp {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n /* 1px overlap past the block\'s bottom edge so fractional-DPR rounding\n can\'t let the image/gradient shimmer through as a hairline — same\n trick as the Messenger-App\'s header overlay. */\n bottom: -1px;\n background: linear-gradient(\n 180deg,\n transparent calc(100% - 120px),\n ').concat(o,"38 calc(100% - 101px),\n ").concat(o,"73 calc(100% - 82px),\n ").concat(o,"A6 calc(100% - 65px),\n ").concat(o,"D6 calc(100% - 49px),\n ").concat(o," calc(100% - 35px)\n );\n }\n\n .gleap-frame-loader-ramp--image {\n /* Smootherstep whitening ramp — must stay stop-for-stop identical to the\n Messenger-App's image header overlay (AgentHomeV4.scss), or the fade\n visibly shifts during the loader→app cross-fade. */\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 0.2) 0px,\n rgba(0, 0, 0, 0) 60px,\n transparent calc(100% - 90px),\n ").concat(o,"03 calc(100% - 83px),\n ").concat(o,"0F calc(100% - 76px),\n ").concat(o,"29 calc(100% - 69px),\n ").concat(o,"52 calc(100% - 62px),\n ").concat(o,"80 calc(100% - 55px),\n ").concat(o,"AD calc(100% - 48px),\n ").concat(o,"D6 calc(100% - 41px),\n ").concat(o,"F0 calc(100% - 34px),\n ").concat(o,"FC calc(100% - 27px),\n ").concat(o," calc(100% - 20px)\n );\n }\n\n .gleap-frame-loader-image-wrap--loaded {\n opacity: 1;\n }\n\n .gleap-frame-loader-image {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .gleap-frame-container--survey {\n bottom: ").concat(a,"px !important;\n }\n\n .gleap-frame-container--extended {\n max-width: 690px !important;\n }\n\n /* Expanded by the end user (expand/collapse button in the messenger header).\n Below 451px the widget is full screen anyway. The inner max-height must beat\n the inline 700px set by GleapFrameManager.setAppMode. */\n @media only screen and (min-width: 451px) {\n .gleap-frame-container--expanded {\n max-width: 690px !important;\n }\n\n .gleap-frame-container--expanded .gleap-frame-container-inner {\n max-height: none !important;\n }\n }\n\n .gleap-frame-container--survey-full {\n position: fixed;\n top: 0 !important;\n left: 0 !important;\n bottom: 0 !important;\n right: 0 !important;\n width: 100vw !important;\n max-width: 100vw !important;\n height: 100vh;\n height: 100dvh !important;\n background-color: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(6px);\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n max-height: 100vh;\n max-height: 100dvh !important;\n border-radius: 0 !important;\n animation-name: none !important;\n }\n\n .gleap-frame-container--survey-full .gleap-frame-container-inner {\n max-width: 640px !important;\n width: calc(100% - 24px);\n border-radius: ").concat(x,"px;\n overflow: hidden;\n }\n\n .gleap-frame-container--classic {\n right: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--no-button {\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic-left {\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--classic-left {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic-left {\n left: auto;\n right: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--modern-left {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n [dir=rtl].gleap-frame-container--modern-left {\n left: auto;\n right: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n .gleap-frame-container--animate {\n pointer-events: auto !important;\n }\n\n .gleap-frame-container--closing {\n animation: gleapWidgetOut 0.2s cubic-bezier(0.4, 0, 1, 1) both !important;\n pointer-events: none !important;\n }\n\n .gleap-frame-container--modern-left,\n .gleap-frame-container--classic-left {\n transform-origin: left bottom;\n }\n\n [dir=rtl].gleap-frame-container {\n transform-origin: left bottom;\n }\n\n [dir=rtl].gleap-frame-container--modern-left,\n [dir=rtl].gleap-frame-container--classic-left {\n transform-origin: right bottom;\n }\n\n @keyframes gleapWidgetScale {\n from { transform: scale(0.9); }\n to { transform: scale(1); }\n }\n\n @keyframes gleapWidgetFade {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes gleapWidgetOut {\n from { opacity: 1; transform: scale(1); }\n to { opacity: 0; transform: scale(0.96); }\n }\n\n @keyframes gleapWidgetSlideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n\n @keyframes gleapWidgetSlideDown {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(100%); }\n }\n\n @keyframes gleapFadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes gleapFadeInUpMobile {\n from {\n opacity: 0;\n transform: translate3d(0, 10%, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n .gleap-notification-container {\n position: fixed;\n bottom: ").concat(T,"px;\n right: ").concat(i,"px;\n z-index: ").concat(2147483630,";\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n width: 100%;\n max-width: min(340px, 80vw);\n }\n\n .gleap-notification-container--left {\n left: ").concat(4+i,"px;\n right: initial !important;\n }\n\n [dir=rtl].gleap-notification-container {\n left: ").concat(4+i,"px;\n right: initial !important;\n }\n\n [dir=rtl].gleap-notification-container--left {\n left: initial !important;\n right: ").concat(i,"px !important;\n align-items: flex-start !important;\n }\n\n .gleap-notification-container--no-button {\n bottom: ").concat(a,"px;\n }\n\n /* Every notification card shares one chrome: full container width, the same\n radius, the same soft shadow, and a lift on hover. */\n .gleap-notification-item,\n .gleap-notification-item-news,\n .gleap-notification-item-checklist {\n width: 100%;\n animation-duration: 0.45s;\n animation-fill-mode: both;\n animation-name: gleapNotificationIn;\n }\n\n .gleap-notification-item-container,\n .gleap-notification-item-news-container,\n .gleap-notification-item-checklist-container {\n width: 100%;\n box-sizing: border-box;\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n /* A drop shadow alone cannot separate a dark card from a dark page, so\n the card also carries a hairline in the direction the theme needs. */\n border: 1px solid ").concat(f?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.04)",";\n /* A barely-there contact shadow + a large, soft ambient throw. */\n box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.04), 0px 10px 30px rgba(0, 0, 0, 0.1);\n margin-bottom: 12px;\n cursor: pointer;\n transition: box-shadow 0.15s ease-out;\n }\n\n .gleap-notification-item-container:hover,\n .gleap-notification-item-news-container:hover,\n .gleap-notification-item-checklist-container:hover {\n box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.05), 0px 14px 38px rgba(0, 0, 0, 0.14);\n }\n\n @keyframes gleapNotificationIn {\n from {\n opacity: 0;\n transform: translate3d(0, 12px, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n /* More than one notification collapses into a stack: the newest card in\n front, older ones peeking out behind its top edge like a deck. Hovering\n the stack (or tapping it on touch devices, which adds --expanded)\n spreads it back into the full list.\n\n Every stacked card is bottom-anchored and placed purely via translateY\n offsets that updateStackLayout() measures and writes as CSS vars, so\n collapsing and expanding is one smooth transform + height transition\n rather than a layout jump. */\n .gleap-notification-card {\n position: relative;\n }\n\n .gleap-notification-container--stack {\n height: var(--gleap-nstack-h-collapsed, auto);\n transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n .gleap-notification-container--stack:hover,\n .gleap-notification-container--stack.gleap-notification-container--expanded {\n height: var(--gleap-nstack-h-expanded, auto);\n }\n\n .gleap-notification-container--stack .gleap-notification-card {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n transform: translateY(var(--gleap-nstack-expand, 0px));\n transform-origin: top center;\n /* The negative inset keeps the box-shadow outside the clip region. */\n clip-path: inset(-40px);\n transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), clip-path 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease-out;\n }\n\n /* The entrance animation's fill pins transform at translate3d(0,0,0),\n which would defeat the stack offsets — so only the front card animates\n in (its stack offsets are 0 anyway). */\n .gleap-notification-container--stack .gleap-notification-card:not(:last-child) {\n animation-name: none;\n }\n\n /* How far back a card scales at each peek depth when collapsed. */\n .gleap-notification-container--stack .gleap-notification-card:nth-last-child(2) {\n --gleap-nstack-scale: 0.955;\n }\n\n .gleap-notification-container--stack .gleap-notification-card:nth-last-child(n+3) {\n --gleap-nstack-scale: 0.91;\n }\n\n .gleap-notification-container--stack:not(:hover):not(.gleap-notification-container--expanded) .gleap-notification-card {\n transform: translateY(var(--gleap-nstack-collapse, 0px)) scale(var(--gleap-nstack-scale, 1));\n /* Clips a taller card behind down to the front card's height (bottom\n inset measured by updateStackLayout), so e.g. a news cover can't hang\n out below the stack. */\n clip-path: inset(-40px -40px var(--gleap-nstack-clip, -40px) -40px);\n }\n\n .gleap-notification-container--stack:not(:hover):not(.gleap-notification-container--expanded) .gleap-notification-card:not(:last-child) {\n pointer-events: none;\n }\n\n /* Anything deeper than two peeks hides entirely until the stack expands. */\n .gleap-notification-container--stack:not(:hover):not(.gleap-notification-container--expanded) .gleap-notification-card:nth-last-child(n+4) {\n opacity: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .gleap-notification-container--stack,\n .gleap-notification-container--stack .gleap-notification-card {\n transition: none;\n }\n }\n\n /* Floats over the stack's top-right corner instead of taking a row of its\n own above it, so the notifications read as one contained unit. */\n .gleap-notification-close {\n position: absolute;\n top: -9px;\n right: -9px;\n border-radius: 100%;\n width: 26px;\n height: 26px;\n background-color: ").concat(o,";\n box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.18);\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n visibility: hidden;\n pointer-events: none;\n z-index: 1;\n }\n\n [dir=rtl].gleap-notification-container .gleap-notification-close {\n left: -9px;\n right: initial;\n }\n\n .gleap-notification-container:hover .gleap-notification-close {\n visibility: visible;\n pointer-events: auto;\n animation-duration: 0.7s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-notification-close {\n visibility: visible;\n pointer-events: auto;\n animation-duration: 0.7s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n }\n\n .gleap-notification-close svg {\n width: 40%;\n height: 40%;\n object-fit: contain;\n fill: ").concat(p,";\n }\n\n .gleap-notification-item-checklist-container {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .gleap-notification-item-checklist-content {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding: 16px;\n width: 100%;\n max-width: 100%;\n }\n\n .gleap-notification-item-checklist-content-title {\n color: ").concat(p,";\n font-size: 15px;\n font-weight: 500;\n line-height: 21px;\n margin-bottom: 10px;\n max-width: 100%;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-checklist-content-progress {\n width: 100%;\n height: 8px;\n border-radius: 8px;\n background-color: ").concat(v,";\n }\n\n .gleap-notification-item-checklist-content-progress-inner {\n height: 100%;\n border-radius: 8px;\n background-color: ").concat(e,";\n }\n\n .gleap-notification-item-checklist-content-next {\n color: ").concat(m,";\n font-size: 15px;\n font-weight: normal;\n line-height: 21px;\n margin-top: 10px;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n }\n\n .gleap-notification-item-checklist-content-next svg {\n height: 18px;\n margin-right: 5px;\n width: auto;\n }\n\n .gleap-notification-item-checklist-content-next b {\n font-size: 15px;\n font-weight: normal;\n color: ").concat(p,";\n }\n\n .gleap-news-pagination {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 10px;\n width: 100%;\n }\n\n .gleap-news-page-indicator {\n font-size: 12px;\n color: ").concat(m,";\n }\n\n .gleap-news-next-button {\n background-color: ").concat(e,";\n color: ").concat(u,";\n border-radius: ").concat(C,"px;\n box-sizing: border-box;\n padding: 5px 10px;\n font-size: 14px;\n font-weight: bold;\n line-height: 21px;\n border: none;\n text-align: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: none !important;\n outline: none !important;^\n }\n\n .gleap-notification-item-news-content {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: 100%;\n padding: 16px;\n }\n\n .gleap-notification-item-news-preview {\n color: ").concat(m,";\n font-size: 14px;\n line-height: 21px;\n font-weight: 400;\n overflow-wrap: break-word;\n word-break: break-word;\n display: block;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-news-sender {\n display: flex;\n align-items: center;\n color: ").concat(m,";\n font-size: 14px;\n line-height: 21px;\n font-weight: 400;\n }\n\n .gleap-notification-item-news-content-title {\n color: ").concat(p,";\n font-size: 15px;\n font-weight: 500;\n line-height: 21px;\n margin-bottom: 6px;\n max-width: 100%;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n cursor: pointer;\n }\n\n .gleap-notification-item-news-sender-avatar {\n border-radius: 100%;\n height: 20px;\n width: 20px;\n min-width: 20px;\n margin-right: 8px;\n object-fit: cover;\n }\n\n [dir=rtl] .gleap-notification-item-news-sender-avatar {\n margin-left: 8px;\n margin-right: 0px !important;\n }\n\n .gleap-notification-item-news-container {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .gleap-notification-item-news-image {\n background-color: ").concat(m,";\n height: 170px;\n max-height: 170px;\n object-fit: cover;\n width: 100%;\n cursor: pointer;\n }\n \n .gleap-notification-item-news-content-title:hover {\n color: ").concat(e,";\n }\n\n .gleap-notification-item-container {\n display: flex;\n align-items: flex-start;\n padding: 16px;\n font-size: 15px;\n line-height: 21px;\n color: ").concat(p,";\n }\n\n .gleap-notification-item-avatar {\n width: 32px;\n height: 32px;\n min-width: 32px;\n border-radius: 100%;\n object-fit: cover;\n display: block;\n margin-right: 10px;\n }\n\n /* The AI is a product, not a person — a rounded square reads as a logo and\n keeps it distinct from the circular teammate avatars. Same split the\n messenger makes in ChatMessageAuthor. */\n .gleap-notification-item-avatar--bot {\n border-radius: ").concat(I,"px;\n }\n\n .gleap-notification-item-news-sender-avatar--bot {\n border-radius: ").concat(E,"px;\n }\n\n [dir=rtl] .gleap-notification-item-avatar {\n margin-left: 10px;\n margin-right: 0px !important;\n }\n\n /* min-width: 0 so a long unbroken word shrinks the body instead of pushing\n the card past the container. */\n .gleap-notification-item-body {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n }\n\n .gleap-notification-item-content {\n line-height: 20px;\n color: ").concat(p,";\n word-wrap: break-word;\n word-break: break-word;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-meta {\n display: flex;\n align-items: center;\n margin-top: 5px;\n font-size: 13px;\n line-height: 18px;\n color: ").concat(m,";\n overflow: hidden;\n }\n\n .gleap-notification-item-sender {\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .gleap-notification-item-meta-dot {\n margin: 0px 5px;\n opacity: 0.6;\n }\n\n .gleap-notification-item-time {\n white-space: nowrap;\n }\n\n .gleap-frame-container-inner {\n position: relative;\n width: 100%;\n height: calc(100vh - ").concat(84+a,"px);\n max-height: ").concat(700,'px;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n height: calc(100vh - 40px);\n }\n \n .gleap-frame-container-inner:before {\n content: " ";\n position: absolute;\n width: 100%;\n height: calc(100% - ').concat(x,"px);\n top: ").concat(x,"px;\n background-color: ").concat(o,";\n z-index: -1;\n }\n \n .gleap-frame-container iframe {\n height: 100% !important;\n width: 100% !important;\n max-width: 100% !important;\n display: block !important;\n pointer-events: auto !important;\n }\n \n .gleap-frame-container--hidden {\n display: none !important;\n pointer-events: none;\n animation: none !important;\n }\n \n .bb-feedback-button {\n margin: 0px;\n position: fixed;\n bottom: ").concat(a,"px;\n right: ").concat(i,"px;\n border-radius: 30px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n background-color: transparent;\n color: #000000;\n z-index: ").concat(2147483630,";\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding: 0px;\n }\n\n @keyframes bbRedDotPulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 1;\n }\n }\n\n .bb-feedback-button--red-dot {\n position: absolute;\n top: 0px;\n right: 0px;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #ff3b30;\n box-shadow: 0 2px 4px rgba(0,0,0,0.2);\n z-index: ").concat(2147483631,";\n animation: bbRedDotPulse 2s ease-in-out infinite;\n }\n\n [dir=rtl].bb-feedback-button {\n bottom: ").concat(a,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n \n .bb-feedback-button--bottomleft {\n bottom: ").concat(a,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n\n [dir=rtl].bb-feedback-button--bottomleft {\n bottom: ").concat(a,"px;\n right: ").concat(i,'px;\n left: auto;\n }\n \n .bb-feedback-button--disabled {\n display: none !important;\n }\n\n .bb-feedback-button--hidden {\n display: none !important;\n }\n \n .bb-feedback-button-text {\n padding: 8px 12px;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n background-color: #fff;\n border-radius: 8px;\n box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.15);\n position: relative;\n z-index: 99;\n }\n \n .bb-feedback-button-text:before {\n content: "";\n position: absolute;\n box-shadow: rgba(0, 0, 0, 0.04) 6px 6px 5px;\n transform: rotate(315deg);\n bottom: 16px;\n right: -4px;\n border-width: 10px;\n border-style: solid;\n border-color: transparent #fff #fff transparent;\n }\n \n .bb-feedback-button--bottomleft .bb-feedback-button-text:before {\n display: none;\n }\n \n .bb-feedback-button-text:after {\n content: "";\n position: absolute;\n bottom: 12px;\n right: 0px;\n background-color: #fff;\n width: 5px;\n height: 30px;\n }\n \n .bb-feedback-button-text-title {\n font-family: sans-serif;\n font-size: 14px;\n color: #666;\n line-height: 18px;\n max-width: 220px;\n }\n \n .bb-feedback-button-text-title b {\n color: #000000;\n font-weight: 600;\n }\n\n .bb-notification-bubble {\n position: absolute;\n top: -5px;\n right: -5px;\n min-width: 12px;\n padding: 0px 4px;\n height: 20px;\n min-width: 20px;\n border-radius: 20px;\n background-color: red;\n color: #fff;\n font-size: 11px;\n font-family: sans-serif;\n text-align: center;\n line-height: 20px;\n }\n\n .bb-notification-bubble--hidden {\n display: none;\n }\n \n .bb-feedback-button-icon {\n width: 48px;\n height: 48px;\n border-radius: 48px;\n background-color: #485bff;\n transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n position: relative;\n }\n \n .bb-feedback-button-classic {\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n top: 50%;\n right: 0px;\n position: fixed;\n transform: rotate(-90deg) translate(50%, -50%);\n transform-origin: 100% 50%;\n padding: 9px 20px;\n text-align: center;\n background-color: #485bff;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n font-family: sans-serif;\n font-size: 16px;\n color: #fff;\n box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.25);\n }\n\n [dir=rtl].bb-feedback-button .bb-feedback-button-classic {\n top: 50%;\n left: 0px;\n right: auto;\n transform: rotate(90deg) translate(-50%, -100%);\n transform-origin: 0% 0%;\n }\n \n .bb-feedback-button-classic--left {\n top: 50%;\n left: 0px;\n right: auto;\n transform: rotate(90deg) translate(-50%, -100%);\n transform-origin: 0% 0%;\n }\n\n [dir=rtl].bb-feedback-button .bb-feedback-button-classic--left {\n top: 50%;\n right: 0px;\n left: auto;\n transform: rotate(-90deg) translate(50%, -50%);\n transform-origin: 100% 50%;\n }\n \n .bb-feedback-button-classic--bottom {\n top: auto;\n bottom: 0px;\n transform: none;\n right: ').concat(i,"px;\n left: auto;\n }\n \n [dir=rtl].bb-feedback-button .bb-feedback-button-classic--bottom {\n top: auto;\n bottom: 0px;\n transform: none;\n left: ").concat(i,"px;\n right: auto;\n }\n\n .bb-feedback-button--classic-button-style {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n \n .bb-feedback-button--open.bb-feedback-button--classic-button-style {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-name: bbFadeOutRight;\n }\n \n .bb-feedback-button .bb-logo-logo {\n position: absolute;\n width: 30px;\n height: 30px;\n top: 9px;\n left: 9px;\n object-fit: contain;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: bbZoomIn;\n }\n \n .bb-feedback-button .bb-logo-arrowdown {\n position: absolute;\n width: 14px;\n height: 14px;\n top: 17px;\n left: 17px;\n object-fit: contain;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n }\n \n .bb-feedback-button .bb-logo-arrowdown {\n animation-name: bbZoomOut;\n }\n \n .bb-feedback-button--open .bb-logo-arrowdown {\n animation-name: bbZoomIn;\n }\n \n .bb-feedback-button--open .bb-logo-logo {\n animation-name: bbZoomOut;\n }\n \n .bb-feedback-button-icon:hover {\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25), 0px 0px 20px rgba(0, 0, 0, 0.2);\n transform: scale(1.1);\n }\n\n /* The overshoot curve lives in its own class (added only for the release)\n so plain hover in/out keeps its regular ease and never bounces. */\n .bb-feedback-button--springing .bb-feedback-button-icon {\n transition: transform 0.55s cubic-bezier(0.2, 2, 0.45, 1), box-shadow 0.2s ease-in-out;\n }\n\n .bb-feedback-button--pressed .bb-feedback-button-icon {\n transform: scale(0.875);\n transition: transform 0.11s cubic-bezier(0.2, 0, 0.4, 1), box-shadow 0.2s ease-in-out;\n box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2), 0px 0px 12px rgba(0, 0, 0, 0.1);\n }\n \n .bb-feedback-button--open .bb-feedback-button-text {\n animation-name: bbFadeOutDown;\n }\n \n .bb-feedback-button--open .bb-feedback-button-icon {\n display: flex;\n }\n \n .bb-capture-svg {\n position: fixed;\n z-index: ").concat(2147483614,";\n top: 0px;\n left: 0px;\n right: 0px;\n width: 100%;\n height: 100%;\n padding: 0px;\n margin: 0px;\n cursor: crosshair;\n }\n\n .bb-capture-svg--preview {\n cursor: auto !important;\n }\n \n .bb-rec-on-circle {\n animation-name: bbRecIconFade;\n animation-duration: 2s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n }\n \n .bb-rec-on-cont {\n animation-name: bbRecIconContFade;\n animation-duration: 2s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n }\n \n .bb-capture-editor-drag-info {\n position: fixed;\n top: -200px;\n left: 0px;\n z-index: ").concat(2147483616,";\n transition: opacity 0.3s ease-in-out;\n }\n \n .bb-capture-editor-drag-info svg {\n width: 24px;\n height: 24px;\n }\n \n .bb-capture-editor-borderlayer {\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n border: 4px solid ").concat(e,";\n cursor: crosshair;\n z-index: ").concat(2147483610,";\n box-sizing: border-box;\n pointer-events: none;\n }\n \n .bb-capture-editor-notrecording .bb-capture-editor-borderlayer {\n background-color: rgba(0, 0, 0, 0.8);\n }\n\n .bb-capture-editor-recording .bb-capture-editor-borderlayer {\n border: 4px solid #eb144c !important;\n }\n \n .bb-capture-editor-recording .bb-capture-dismiss {\n display: none;\n }\n \n .bb-capture-editor-item-inactive {\n opacity: 0.3;\n cursor: not-allowed !important;\n }\n \n .bb-capture-editor-notrecording .bb-capture-toolbar-drawingitem {\n opacity: 0.3;\n cursor: not-allowed !important;\n }\n \n .bb-capture-editor-notrecording .bb-capture-editor-drag-info {\n display: none;\n }\n \n .bb-capture-editor-notrecording .bb-capture-svg {\n pointer-events: none !important;\n }\n \n .bb-capture-toolbar {\n position: fixed;\n top: 20px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ").concat(2147483618,";\n background-color: #fff;\n padding: 5px;\n display: flex;\n align-items: center;\n border-radius: 8px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n transition: opacity 0.3s ease-in-out;\n }\n \n .bb-capture-dismiss {\n position: fixed;\n top: 0px;\n right: 0px;\n z-index: ").concat(2147483618,";\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n width: 36px;\n height: 36px;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: ").concat(e,";\n border-bottom-left-radius: ").concat(C,"px;\n }\n\n [dir=rtl] .bb-capture-dismiss {\n top: 0px;\n left: 0px;\n right: auto;\n border-bottom-left-radius: 0px !important;\n border-bottom-right-radius: ").concat(C,"px;\n }\n \n .bb-capture-dismiss svg path {\n fill: ").concat(u,';\n }\n \n .bb-capture-dismiss svg {\n width: 20px;\n height: 20px;\n object-fit: contain;\n }\n \n .bb-capture-button-next {\n font-family: sans-serif;\n box-sizing: border-box;\n font-weight: 600;\n text-align: center;\n width: auto;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n margin: 0px;\n line-height: 36px;\n padding: 0px 12px;\n font-size: 15px;\n margin-left: 12px;\n }\n\n [dir=rtl].bb-capture-editor .bb-capture-button-next {\n margin-left: auto;\n margin-right: 12px;\n }\n \n .bb-capture-toolbar-item-spacer {\n width: 1px;\n height: 38px;\n min-width: 1px;\n margin: 0px 5px;\n }\n \n .bb-capture-toolbar-item {\n width: 42px;\n height: 38px;\n min-width: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n position: relative;\n margin-right: 5px;\n }\n\n .drag-handle-item {\n cursor: grab !important;\n width: 34px;\n min-width: 34px;\n }\n\n .drag-handle-item svg {\n width: 18px !important;\n height: 18px !important;\n }\n \n .bb-capture-toolbar-item svg {\n width: 23px;\n height: 23px;\n object-fit: contain;\n }\n \n .bb-capture-toolbar-item-selectedcolor {\n border-radius: 100%;\n width: 20px;\n height: 20px;\n background-color: #db4035;\n }\n \n .bb-capture-toolbar-item[data-type="undo"] svg {\n width: 18px;\n height: 18px;\n }\n \n .bb-capture-toolbar-item[data-active="true"] {\n position: relative;\n }\n \n .bb-capture-preview {\n display: none;\n background-color: rgba(0, 0, 0, 0.6);\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n justify-content: center;\n align-items: center;\n z-index: ').concat(2147483620,";\n }\n \n .bb-capture-preview-inner {\n background-color: #fff;\n padding: 0px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n flex-direction: column;\n max-width: 640px;\n width: 100%;\n margin: 20px;\n }\n \n .bb-capture-preview-inner video {\n border-radius: 8px 8px 0px 0px;\n display: block;\n border: 0px;\n outline: none;\n width: 100%;\n max-height: 60vh;\n }\n \n .bb-capture-preview-buttons {\n display: flex;\n justify-content: space-between;\n padding: 14px;\n }\n \n .bb-capture-preview-retrybutton {\n font-family: sans-serif;\n border-radius: 21px;\n box-sizing: border-box;\n padding: 12px 26px;\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n margin-top: 0px;\n margin-bottom: 0px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-preview-sendbutton {\n font-family: sans-serif;\n border-radius: 21px;\n box-sizing: border-box;\n padding: 12px 26px;\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n margin-top: 0px;\n margin-bottom: 0px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-preview-retrybutton:hover,\n .bb-capture-preview-sendbutton:hover {\n opacity: 0.9;\n }\n \n .bb-capture-toolbar-item-recording {\n margin-right: 0px;\n }\n \n .bb-capture-toolbar-item-recording svg {\n width: 33px;\n height: 33px;\n }\n \n .bb-capture-toolbar-item-colorpicker {\n position: fixed;\n top: 70px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ").concat(2147483618,';\n background-color: #fff;\n display: none;\n padding: 10px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n }\n \n .bb-capture-toolbar-item-color {\n width: 20px;\n height: 20px;\n border-radius: 100%;\n margin-right: 12px;\n box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-toolbar-item-color:hover {\n box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.25);\n }\n \n .bb-capture-toolbar-item-color:last-of-type {\n margin-right: 0px;\n }\n \n [dir=rtl].bb-capture-editor .bb-capture-toolbar-item-color {\n margin-right: auto;\n margin-left: 12px;\n }\n \n [dir=rtl].bb-capture-editor .bb-capture-toolbar-item-color:last-of-type {\n margin-right: auto;\n margin-left: 0px;\n }\n \n .bb-capture-toolbar-item-recording[data-active="true"] svg:first-of-type {\n display: none;\n }\n \n .bb-capture-toolbar-item-recording[data-active="true"] svg:nth-of-type(2) {\n display: block;\n }\n \n .bb-capture-toolbar-item-recording[data-active="false"] svg:first-of-type {\n display: block;\n }\n \n .bb-capture-toolbar-item-recording[data-active="false"] svg:nth-of-type(2) {\n display: none;\n }\n \n .bb-capture-toolbar-item--active {\n background-color: #eee;\n }\n \n .bb-capture-toolbar-item:hover svg {\n opacity: 1;\n }\n \n .bb-capture-toolbar-item--active {\n background-color: #f8f8f8;\n }\n \n .bb-capture-toolbar-item--active svg {\n opacity: 1;\n }\n \n .bb-capture-toolbar-item--inactivecross::before {\n content: "";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 3px;\n width: 26px;\n margin: auto;\n border-radius: 4px;\n background-color: #e80000;\n transform: rotate(45deg);\n }\n \n .bb-capture-toolbar-item--inactivecross svg {\n fill: #eee;\n }\n \n .bb-capture-toolbar-item-timer {\n text-align: left;\n line-height: 32px;\n font-size: 14px;\n font-family: sans-serif;\n margin: 5px;\n min-width: 40px;\n display: none;\n }\n \n .bb-capture-toolbar-item .bb-tooltip {\n background-color: #555;\n color: #fff;\n visibility: hidden;\n font-size: 14px;\n font-family: sans-serif;\n text-align: center;\n padding: 5px 10px;\n position: absolute;\n z-index: 1;\n top: 45px;\n left: 0px;\n transform: translateX(calc(-50% + 21px));\n opacity: 0;\n transition: opacity 0.3s;\n white-space: nowrap;\n }\n \n .bb-capture-toolbar-item .bb-tooltip::after {\n content: "";\n position: absolute;\n bottom: 100%;\n left: 50%;\n margin-left: -5px;\n border-width: 5px;\n border-style: solid;\n transform: rotate(180deg);\n border-color: #555 transparent transparent transparent;\n }\n \n .bb-capture-toolbar-item:hover .bb-tooltip {\n visibility: visible;\n opacity: 1;\n }\n \n .bb-capture-options {\n display: none;\n }\n \n .bb-capture-options--active {\n display: flex;\n }\n\n @keyframes bbFadeOutRight {\n from {\n opacity: 1;\n }\n \n to {\n opacity: 0;\n }\n }\n \n @keyframes bbFadeOutDown {\n from {\n opacity: 1;\n }\n \n to {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n }\n \n @keyframes bbFadeInOpacity {\n from {\n opacity: 0;\n }\n \n to {\n opacity: 1;\n }\n }\n \n @keyframes bbZoomOut {\n from {\n opacity: 1;\n }\n \n 50% {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n \n to {\n opacity: 0;\n }\n }\n \n @keyframes bbZoomIn {\n from {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n \n 50% {\n opacity: 1;\n }\n }\n \n @keyframes bbRecIconContFade {\n 0% {\n fill: #b10802;\n }\n 50% {\n fill: #ff0000;\n }\n 100% {\n fill: #b10802;\n }\n } \n .bb-capture-preview-retrybutton {\n color: ').concat(p,";\n border-radius: ").concat(k,"px;\n background-color: ").concat(v,";\n }\n .bb-capture-preview-retrybutton:hover {\n background-color: ").concat(y,";\n }\n @keyframes bb-suc-fill {\n 100% {\n box-shadow: inset 0px 0px 0px 30px ").concat(e,";\n }\n }\n .bb-capture-toolbar-item-spacer {\n background-color: ").concat(v,";\n }\n .bb-tooltip {\n border-radius: ").concat(S,"px;\n }\n @keyframes bbRecIconFade {\n 0% {\n fill: transparent;\n }\n 50% {\n fill: ").concat(y,";\n }\n 100% {\n fill: transparent;\n }\n }\n .bb-capture-preview-sendbutton {\n color: ").concat(u,";\n background-color: ").concat(e,";\n border-radius: ").concat(k,"px;\n }\n .bb-capture-button-next {\n color: ").concat(u,";\n background-color: ").concat(e,";\n border-radius: ").concat(C,"px;\n }\n .bb-capture-preview-inner {\n background-color: ").concat(o,";\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar-item-timer {\n color: ").concat(m,";\n }\n .bb-svg-path {\n fill: ").concat(p,";\n }\n .bb-capture-toolbar-item {\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar {\n background-color: ").concat(o,";\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar-item-colorpicker {\n background-color: ").concat(o,";\n }\n .bb-capture-toolbar-item--active {\n background-color: ").concat(v,";\n }\n .bb-feedback-button-classic {\n border-top-left-radius: ").concat(S,"px;\n border-top-right-radius: ").concat(S,"px;\n }\n .bb-logo-logo--default path {\n fill: ").concat(d,";\n }\n .bb-logo-arrowdown {\n fill: ").concat(d,";\n }\n .bb-feedback-button-icon {\n background-color: ").concat(n,";\n }\n .bb-feedback-button-classic {\n background-color: ").concat(n,";\n color: ").concat(d,";\n }\n\n @media only screen and (max-width: 450px) {\n [dir=rtl].gleap-frame-container,\n .gleap-frame-container {\n left: 0px;\n right: 0px;\n width: 100vw;\n max-width: 100vw;\n min-height: 100vh;\n max-height: 100vh;\n min-height: 100dvh !important;\n max-height: 100dvh !important;\n top: 0px;\n bottom: 0px;\n border-radius: 0px;\n transform-origin: center bottom;\n animation: gleapWidgetSlideUp 0.34s cubic-bezier(0.16, 1, 0.3, 1) both, gleapWidgetFade 0.15s ease-out both;\n }\n\n .gleap-frame-container--closing {\n animation: gleapWidgetSlideDown 0.26s cubic-bezier(0.4, 0, 1, 1) both !important;\n }\n\n .gleap-frame-container-inner {\n width: 100vw;\n height: 100%;\n }\n\n .gleap-frame-container:not(.gleap-frame-container--survey):not(.gleap-frame-container--survey-full) .gleap-frame-container-inner {\n max-height: calc(var(--glvh, 1vh) * 100) !important;\n }\n\n .gleap-frame-container--survey {\n height: auto !important;\n top: initial !important;\n bottom: 0px !important;\n min-height: initial !important;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n height: 100vh !important;\n }\n\n .bb-tooltip {\n display: none !important;\n }\n \n .bb-capture-toolbar-item-colorpicker {\n top: 75px;\n }\n \n .bb-capture-button-next {\n margin-left: auto;\n }\n \n .bb-capture-dismiss {\n display: none;\n }\n \n .bb-capture-toolbar {\n top: 15px;\n right: 15px;\n left: 15px;\n width: auto;\n transform: none;\n }\n\n .bb-capture-editor-drag-info {\n display: none;\n }\n \n .bb-capture-editor-borderlayer {\n border-width: 4px;\n }\n }\n \n @media print {\n .bb-feedback-button {\n display: none !important;\n }\n \n .gleap-frame-container {\n display: none !important;\n }\n }\n\n .gleap-tour-sender {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n margin-bottom: 10px;\n }\n\n .gleap-tour-sender-image {\n width: 32px;\n height: 32px;\n border-radius: 32px;\n margin-right: 10px;\n background-size: cover;\n background-repeat: no-repeat;\n }\n\n .gleap-tour-popover.gleap-tour-popover-post {\n min-width: 550px;\n max-width: 550px;\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-tour-popover.gleap-tour-popover-post {\n min-width: calc(100vw - 40px);\n max-width: calc(100vw - 40px);\n }\n }\n\n .gleap-tour-message,\n .gleap-tour-message p,\n .gleap-tour-message ul {\n color: ").concat(p,";\n }\n\n .gleap-tour-message h2 {\n font-weight: 600;\n font-size: 22px;\n }\n\n .gleap-tour-message h3 {\n font-weight: 600;\n font-size: 18px;\n }\n\n .gleap-tour-message p {\n line-height: 1.3;\n margin-bottom: 10px !important;\n margin-top: 10px !important;\n }\n\n .gleap-tour-message ul {\n line-height: 1.3;\n padding-left: 20px;\n margin-top: 10px !important;\n margin-bottom: 10px !important;\n }\n\n .gleap-tour-message {\n max-height: calc(80vh - 100px) !important;\n overflow-y: auto;\n min-width: 270px;\n }\n\n .gleap-tour-message::-webkit-scrollbar {\n width: 5px;\n }\n\n .gleap-tour-message::-webkit-scrollbar-track {\n border-radius: 0px;\n }\n \n .gleap-tour-message::-webkit-scrollbar-thumb {\n background: ").concat(y,"; \n border-radius: 5px;\n }\n\n .gleap-tour-message::-webkit-scrollbar-thumb:hover {\n background: ").concat(m,";\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-tour-message {\n min-width: auto !important;\n }\n }\n\n .gleap-tour-message iframe {\n width: 100%;\n height: 300px;\n margin-top: 10px;\n margin-bottom: 10px;\n border: none;\n outline: none;\n display: block;\n }\n\n .gleap-tour-sender-name {\n font-size: 15px;\n }\n\n .gleap-tour-video {\n width: 100%;\n max-width: 100%;\n }\n\n .gleap-tour-video-svg--fullscreen {\n width: 100% !important;\n height: 100% !important;\n top: 0px !important;\n left: 0px !important;\n right: 0px !important;\n bottom: 0px !important;\n }\n\n .gleap-tour-video--playing .gleap-tour-video-playpause {\n opacity: 0;\n }\n \n .gleap-tour-video--playing:hover .gleap-tour-video-playpause {\n opacity: 1;\n }\n\n .gleap-tour-popover-video-pointer {\n padding: 0px !important;\n border-radius: 8px;\n position: relative;\n background-color: transparent !important;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-footer {\n position: absolute;\n top: 0px;\n left: 20px;\n right: 20px;\n opacity: 0;\n transition: opacity 200ms ease-in-out;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-footer button {\n padding: 5px 12px;\n }\n\n .gleap-tour-popover-video-pointer.gleap-tour-popover-can-close .gleap-tour-popover-footer {\n right: 40px !important;\n }\n\n .gleap-tour-popover-video-pointer:hover .gleap-tour-popover-footer {\n opacity: 1;\n }\n\n .gleap-tour-popover-pointer.gleap-tour-popover-no-sender .gleap-tour-message {\n padding-right: 20px;\n }\n\n .gleap-tour-video video {\n width: 100%;\n max-width: 100%;\n height: auto;\n border: none;\n outline: none;\n display: block;\n border-radius: 8px;\n }\n\n .gleap-admin-collapse-ui {\n z-index: ").concat(2147483635,";\n cursor: pointer;\n position: fixed;\n bottom: 75px;\n right: 20px;\n width: 32px;\n height: 32px;\n border-radius: 100%;\n background-color: #fff;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;\n }\n\n .gleap-admin-collapse-ui svg {\n width: 20px;\n height: 14px;\n fill: #000 !important;\n }\n\n .gleap-admin-collapse-ui-active {\n bottom: 20px !important;\n }\n\n .gleap-admin-collapse-ui-active svg {\n transform: rotate(180deg);\n }\n\n .gleap-admin-frame-container-active {\n display: none !important;\n }\n\n .gleap-admin-frame-container {\n position: fixed;\n bottom: 0px;\n left: 0px;\n right: 0px;\n width: 100vw;\n z-index: ").concat(2147483640,";\n }\n\n .gleap-admin-frame {\n width: 100%;\n height: 100% !important;\n border: none;\n outline: none;\n display: block;\n }\n \n .gleap-tour-message .linktype-link {\n display: inline-block !important;\n background-color: transparent !important;\n color: ").concat(n," !important;\n }\n\n .gleap-tooltip .linktype-button,\n .gleap-tour-message .linktype-button {\n display: inline-block !important;\n border-radius: 5px;\n box-sizing: border-box;\n padding: 10px 20px !important;\n text-decoration: none !important;\n background-color: ").concat(n," !important;\n color: ").concat(d," !important;\n }\n\n .gleap-tour-message img {\n width: 100%;\n max-width: 100%;\n min-height: 260px;\n height: auto;\n margin-top: 10px;\n margin-bottom: 10px;\n object-fit: cover;\n }\n\n .gleap-tour-active .gleap-tour-overlay {\n pointer-events: none;\n }\n \n .gleap-tour-active * {\n pointer-events: none;\n }\n \n .gleap-tour-active .gleap-tour-active-element,\n .gleap-tour-active .gleap-tour-active-element *,\n .gleap-tour-popover,\n .gleap-tour-popover * {\n pointer-events: auto;\n }\n \n @keyframes animate-fade-in {\n 0% {\n opacity: 0;\n }\n \n to {\n opacity: 1;\n }\n }\n \n .gleap-tour-fade .gleap-tour-overlay {\n animation: animate-fade-in 200ms ease-in-out;\n }\n \n .gleap-tour-fade .gleap-tour-popover {\n animation: animate-fade-in 200ms;\n }\n\n .gleap-tour-video-playpause {\n position: absolute;\n bottom: 8px;\n left: 8px;\n width: 32px;\n height: 32px;\n padding: 4px;\n background-color: rgba(0,0,0,0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border-radius: 8px;\n transition: opacity 200ms ease-in-out;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-arrow {\n display: none !important;\n }\n\n .gleap-tour-video-playpause svg {\n width: 34px;\n height: auto;\n fill: #fff;\n }\n \n /* Popover styles */\n .gleap-tour-popover {\n all: unset;\n box-sizing: border-box;\n color: ").concat(w,";\n margin: 0;\n padding: 15px;\n border-radius: ").concat(S,"px;\n min-width: 250px;\n max-width: 300px;\n box-shadow: 0 1px 10px #0006;\n ").concat(f?"outline: 1px solid rgba(255, 255, 255, 0.1);":"","\n z-index: 1000000000;\n position: fixed;\n top: 0;\n right: 0;\n background-color: ").concat(b,';\n }\n \n .gleap-tour-popover * {\n font-family: "Helvetica Neue", Inter, ui-sans-serif, "Apple Color Emoji", Helvetica, Arial, sans-serif;\n }\n \n .gleap-tour-popover-title {\n font: 19px / normal sans-serif;\n font-weight: 700;\n display: block;\n position: relative;\n line-height: 1.5;\n zoom: 1;\n margin: 0;\n }\n \n .gleap-tour-popover-close-btn {\n all: unset;\n position: absolute;\n top: 5px;\n right: 5px;\n width: 32px;\n height: 32px;\n cursor: pointer;\n font-size: 30px;\n font-weight: 500;\n line-height: 32px;\n color: ').concat(f?m:"#d2d2d2",";\n z-index: 1;\n text-align: center;\n transition: color;\n transition-duration: 200ms;\n }\n \n .gleap-tour-popover-close-btn:hover,\n .gleap-tour-popover-close-btn:focus {\n color: ").concat(w,';\n }\n \n .gleap-tour-popover-title[style*="block"] + .gleap-tour-popover-description {\n margin-top: 5px;\n }\n \n .gleap-tour-popover-description {\n margin-bottom: 0;\n font: 15px / normal sans-serif;\n line-height: 1.5;\n font-weight: 400;\n zoom: 1;\n }\n \n .gleap-tour-popover-footer {\n margin-top: 15px;\n text-align: right;\n zoom: 1;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n \n .gleap-tour-popover-progress-text {\n font-size: 13px;\n font-weight: 400;\n color: ').concat(f?m:"#727272",";\n zoom: 1;\n }\n \n .gleap-tour-popover-footer button {\n background-color: ").concat(e,";\n color: ").concat(u,";\n border-radius: ").concat(C,"px;\n box-sizing: border-box;\n padding: 10px 20px;\n font-size: 14px;\n font-weight: bold;\n line-height: 21px;\n border: none;\n text-align: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: none !important;\n outline: none !important;\n }\n\n .gleap-tour-popover-prev-btn {\n color: ").concat(p," !important;\n background-color: ").concat(v," !important;\n margin-right: 3px;\n }\n\n .gleap-tour-popover-prev-btn:hover {\n background-color: ").concat(e,"22 !important;\n color: ").concat(e,' !important;\n }\n \n .gleap-tour-popover-footer .gleap-tour-popover-btn-disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n \n .gleap-tour-no-interaction, .gleap-tour-no-interaction * {\n pointer-events: none !important;\n }\n \n .gleap-tour-popover-navigation-btns {\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n }\n \n .gleap-tour-popover-navigation-btns button + button {\n margin-left: 4px;\n }\n \n .gleap-tour-popover-arrow {\n content: "";\n position: absolute;\n border: 5px solid ').concat(b,";\n }\n \n .gleap-tour-popover-arrow-side-over {\n display: none;\n }\n \n /** Popover Arrow Sides **/\n .gleap-tour-popover-arrow-side-left {\n left: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-right {\n right: 100%;\n border-left-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-top {\n top: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-bottom {\n bottom: 100%;\n border-left-color: transparent;\n border-top-color: transparent;\n border-right-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-center {\n display: none;\n }\n \n /* Left/Start + Right/Start */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-start {\n top: 15px;\n }\n \n /* Top/Start + Bottom/Start */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-start {\n left: 15px;\n }\n \n /* End/Left + End/Right */\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-left,\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-right {\n bottom: 15px;\n }\n \n /* Top/End + Bottom/End */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-end,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-end {\n right: 15px;\n }\n \n /* Left/Center + Right/Center */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-center {\n top: 50%;\n margin-top: -5px;\n }\n \n /* Top/Center + Bottom/Center */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-center {\n left: 50%;\n margin-left: -5px;\n }\n \n /* No arrow */\n .gleap-tour-popover-arrow-none {\n display: none;\n } \n\n /* Modal styles */\n .gleap-modal-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ").concat(2147483640,";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Invisible until the card inside the frame reports its height. Before that the frame is an\n empty box, and a bootstrap that fails silently must not leave a blank white card behind. */\n .gleap-modal-wrapper--loading {\n visibility: hidden;\n }\n\n .gleap-modal-wrapper--loading .gleap-modal {\n animation-name: none;\n }\n\n .gleap-modal-backdrop {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: ").concat(2147483641,";\n }\n\n .gleap-modal {\n position: relative;\n width: 90%;\n max-width: 600px;\n max-height: 90vh;\n z-index: ").concat(2147483700,";\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n overflow: hidden;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n }\n\n .gleap-modal-frame {\n width: 100%;\n border: none;\n display: block;\n outline: none;\n }\n\n body.gleap-modal-open {\n overflow: hidden;\n }\n\n /* Agent Popup styles */\n .gleap-agent-popup-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ").concat(2147483640,";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .gleap-agent-popup-backdrop {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: ").concat(2147483641,";\n }\n\n .gleap-agent-popup {\n position: relative;\n width: 95%;\n max-width: 700px;\n height: 85vh;\n max-height: 800px;\n z-index: ").concat(2147483700,";\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n overflow: hidden;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n }\n\n .gleap-agent-popup-frame {\n width: 100%;\n height: 100%;\n border: none;\n display: block;\n outline: none;\n }\n\n body.gleap-agent-popup-open {\n overflow: hidden;\n }\n\n @keyframes gleapFadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 20px, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n .gleap-admin-frame-container,\n .gleap-frame-container,\n .bb-feedback-button,\n .gleap-notification-container,\n .gleap-tooltip,\n .gleap-ai-ui-widget {\n pointer-events: auto !important;\n }\n "),O=document.querySelector(".gleap-styles");O&&O.remove();var A=document.createElement("style");W(A),A.innerHTML=L,A.className="gleap-styles",document.body.appendChild(A)}(e,t,n,o,r,i,a,s,c,l)}))}},{key:"sendSilentCrashReport",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MEDIUM",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{screenshot:!0,replays:!0,attachments:!0};return e.sendSilentCrashReportWithFormData({description:t},n,r)}},{key:"sendSilentCrashReportWithFormData",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MEDIUM",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{screenshot:!0,replays:!0,attachments:!0};if(!this.silentCrashReportSent){this.silentCrashReportSent=!0,setTimeout((function(){t.silentCrashReportSent=!1}),1e4);var o=r?ee(r):{},i=vs.getInstance();if(i.ready){var a=e||{};i.session.email&&(a.reportedBy=i.session.email),new _s("CRASH",n,a,!0,o).sendFeedback().then((function(){})).catch((function(e){}))}}}},{key:"showSurvey",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"survey";e.startFeedbackFlowWithOptions(t,{hideBackButton:!0,format:n},!0)}},{key:"startClassicForm",value:function(t,n){e.startFeedbackFlowWithOptions(t,{hideBackButton:!n})}},{key:"startFeedbackFlow",value:function(t,n){e.startFeedbackFlowWithOptions(t,{hideBackButton:!n})}},{key:"startFeedbackFlowWithOptions",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n.autostartDrawing,i=n.hideBackButton,a=n.format;if(vs.getInstance().ready){e.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY});var s="start-feedbackflow";r&&(s="start-survey"),zs.getInstance().setAppMode(r?a:"widget"),zs.getInstance().sendMessage({name:s,data:{flow:t,hideBackButton:i,format:a}},!0),o?zs.getInstance().showDrawingScreen("screenshot"):zs.getInstance().showWidget()}}},{key:"openConversations",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-conversations",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"openConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-conversation",data:{shareToken:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"startConversation",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.startBot("",t)}},{key:"startBot",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"start-bot",data:{botId:e||"",hideBackButton:!t}},!0),zs.getInstance().showWidget()}},{key:"askAI",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"ask-ai",data:{question:e,hideBackButton:!t}},!0),zs.getInstance().showWidget()}},{key:"sendAgentMessage",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e||!t)return Promise.reject(new Error("agentId and message are required."));var r={messages:[{role:"user",content:t.trim()}]};return n.conversationId&&(r.conversationId=n.conversationId),n.additionalContext&&(r.additionalContext=n.additionalContext),new Promise((function(t,o){var i="",a=n.conversationId||null,s=null;x.getInstance().streamAgent(e,r,{onMeta:function(e){e.conversationId&&(a=e.conversationId),e.runId&&(s=e.runId)},onToken:function(e){i+=e.content||"",n.onToken&&n.onToken(e)},onDone:function(e){t({runId:s||(null==e?void 0:e.runId),status:(null==e?void 0:e.status)||"completed",response:i||(null==e?void 0:e.response)||"",conversationId:a})},onError:function(e){o(e)},onToolStart:function(){},onToolEnd:function(){}})}))}},{key:"clearAgentConversation",value:function(){x.getInstance().clearCache()}},{key:"createAgentChat",value:function(e){return new bt(e)}},{key:"openHelpCenterCollection",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-help-collection",data:{collectionId:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"openHelpCenterArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-help-article",data:{articleId:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"openHelpCenter",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-helpcenter",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"searchHelpCenter",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-helpcenter-search",data:{term:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"openNewsArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-news-article",data:{id:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"openChecklists",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-checklists",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"startChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return!!e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"start-checklist",data:$f({outboundId:e,hideBackButton:!t},n?{sharedKey:n}:{})},!0),zs.getInstance().showWidget(),!0)}},{key:"openChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-checklist",data:{id:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"getChecklistData",value:function(e,t){if(!e)return Promise.reject(new Error("outboundId is required"));var n=A.getInstance();return n.validateChecklist(e,t).then((function(e){return n.fetchChecklist(e)}))}},{key:"openNews",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-news",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"openFeatureRequests",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-feature-requests",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"startProductTour",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;vs.getInstance().startProductTourConfig(e).then((function(r){var o;!t||null==r||!r.startURL||null!==(o=window)&&void 0!==o&&null!==(o=o.location)&&void 0!==o&&null!==(o=o.href)&&void 0!==o&&o.includes(null==r?void 0:r.baseURL)?n.startProductTourWithConfig(e,r,!0):window.location.href="".concat(r.startURL,"?gleap_tour=").concat(e,"&gleap_tour_delay=1")})).catch((function(e){}))}},{key:"checkForUncompletedTour",value:function(){var e=nu.getInstance().loadUncompletedTour();e&&nu.getInstance().startWithConfig(e.tourId,e.tourData,500)}},{key:"startProductTourWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];nu.getInstance().startWithConfig(e,t,0,n)}},{key:"showBanner",value:function(e){try{Wn.getInstance().showBanner(e)}catch(t){}}},{key:"showModal",value:function(e){try{gc.getInstance().showModal(e)}catch(t){}}},{key:"showNotification",value:function(e){bl.getInstance().showNotification(e)}}],n&&Jf(t.prototype,n),r&&Jf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();if(Yf(Qf,"invoked",!0),Yf(Qf,"silentCrashReportSent",!1),Yf(Qf,"instance",void 0),"undefined"!=typeof window){var eh=window.GleapActions;if(eh&&eh.length>0)for(var th=0;th{var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};(()=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(){r=function(){return t};var e,t={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new P(r||[]);return a(i,"_invoke",{value:L(e,n,s)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h="suspendedStart",g="suspendedYield",m="executing",v="completed",y={};function b(){}function w(){}function k(){}var x={};d(x,c,(function(){return this}));var S=Object.getPrototypeOf,C=S&&S(S(R([])));C&&C!==o&&i.call(C,c)&&(x=C);var I=k.prototype=b.prototype=Object.create(x);function E(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,a,s,c){var l=f(e[o],e,a);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==n(d)&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return r("throw",e,s,c)}))}c(l.arg)}var o;a(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}})}function L(t,n,r){var o=h;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=O(s,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var l=f(t,n,r);if("normal"===l.type){if(o=r.done?v:g,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;M(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nih});var s=function(e,t,n){var r,o,i,a,s,c,l;switch(e){case"meta":null===(r=n.onMeta)||void 0===r||r.call(n,t);break;case"token":null===(o=n.onToken)||void 0===o||o.call(n,t);break;case"tool_start":null===(i=n.onToolStart)||void 0===i||i.call(n,t);break;case"tool_end":null===(a=n.onToolEnd)||void 0===a||a.call(n,t);break;case"done":null===(s=n.onDone)||void 0===s||s.call(n,t);break;case"error":null===(c=n.onError)||void 0===c||c.call(n,t);break;case"handoff":null===(l=n.onHandoff)||void 0===l||l.call(n,t)}},c=function(){var e,t=(e=r().mark((function e(t,n){var i,a,c,l,u,d,p,f,h,g,m,v,y,b,w,k,x,S;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.body){e.next=3;break}return null===(i=n.onError)||void 0===i||i.call(n,{message:"No response body."}),e.abrupt("return");case 3:a=t.body.getReader(),c=new TextDecoder,l="",u="",d="",e.prev=8;case 9:return e.next=12,a.read();case 12:if(f=e.sent,h=f.done,g=f.value,!h){e.next=17;break}return e.abrupt("break",24);case 17:l+=c.decode(g,{stream:!0}),m=l.split("\n"),l=null!==(p=m.pop())&&void 0!==p?p:"",v=o(m);try{for(v.s();!(y=v.n()).done;)if(b=y.value,(w=b.replace(/\r$/,"")).startsWith("event: "))u=w.slice(7).trim();else if(w.startsWith("data: "))d+=(d?"\n":"")+w.slice(6);else if(""===w){if(u&&d)try{k=JSON.parse(d),s(u,k,n)}catch(r){}u="",d=""}}catch(C){v.e(C)}finally{v.f()}e.next=9;break;case 24:if(u&&d)try{x=JSON.parse(d),s(u,x,n)}catch(I){}e.next=30;break;case 27:e.prev=27,e.t0=e.catch(8),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)&&(null===(S=n.onError)||void 0===S||S.call(n,{message:"Stream interrupted."}));case 30:case"end":return e.stop()}}),e,null,[[8,27]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,c,"next",e)}function c(e){a(i,r,o,s,c,"throw",e)}s(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;M(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t=200&&i.status<300)try{r(i.responseText?JSON.parse(i.responseText):null)}catch(e){o({status:i.status,statusText:"JSON Parse Error",error:e})}else o({status:i.status,statusText:i.statusText,responseText:i.responseText})},i.onerror=function(){return o({status:0,statusText:"Network Error"})},i.send(n?JSON.stringify(n):null)}))}},{key:"streamAgent",value:(o=p().mark((function e(t,n,r,o){var i,a,s,l,u,d,f;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.executeInFlight.get(t)){e.next=2;break}return e.abrupt("return");case 2:if(this.executeInFlight.set(t,!0),i=this._getApiUrl()){e.next=8;break}return this.executeInFlight.delete(t),null===(a=r.onError)||void 0===a||a.call(r,{message:"Gleap API URL not configured."}),e.abrupt("return");case 8:return s="".concat(i,"/v3/shared/agents/").concat(t,"/stream"),l=h(h({},this._getHeaders()),{},{Accept:"text/event-stream"}),e.prev=10,e.next=13,fetch(s,{method:"POST",headers:l,body:JSON.stringify(n),signal:o});case 13:u=e.sent,e.next=23;break;case 16:if(e.prev=16,e.t0=e.catch(10),this.executeInFlight.delete(t),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)){e.next=21;break}return e.abrupt("return");case 21:return null===(d=r.onError)||void 0===d||d.call(r,{message:"Failed to connect to agent."}),e.abrupt("return");case 23:if(u.ok){e.next=27;break}return this.executeInFlight.delete(t),null===(f=r.onError)||void 0===f||f.call(r,{message:"Server error: ".concat(u.status)}),e.abrupt("return");case 27:return e.next=29,c(u,r);case 29:n.conversationId&&this._invalidateMessagesCache(n.conversationId),this.executeInFlight.delete(t);case 31:case"end":return e.stop()}}),e,this,[[10,16]])})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){g(i,n,r,a,s,"next",e)}function s(e){g(i,n,r,a,s,"throw",e)}a(void 0)}))},function(e,t,n,r){return i.apply(this,arguments)})},{key:"executeAgent",value:function(e,t){var n=this;if(this.executeInFlight.get(e))return Promise.reject(new Error("Agent execution already in progress."));var r=this._getApiUrl();if(!r)return Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."));this.executeInFlight.set(e,!0);var o="".concat(r,"/v3/shared/agents/").concat(e,"/execute");return this._makeRequest("POST",o,t).then((function(e){return t.conversationId&&n._invalidateMessagesCache(t.conversationId),null!=e&&e.conversationId&&n._invalidateMessagesCache(e.conversationId),e})).finally((function(){n.executeInFlight.delete(e)}))}},{key:"getConversationMessages",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("kai"===e)return Promise.resolve({messages:[]});var i="".concat(t,":").concat(r,":").concat(o),a=this.messagesCache.get(i);if(a)return a.status===b?Promise.resolve(JSON.parse(JSON.stringify(a.data))):Promise.reject(a.error);if(this.messagesRequests.has(i))return this.messagesRequests.get(i).then((function(e){return JSON.parse(JSON.stringify(e))}));var s=this._getApiUrl();if(!s)return Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."));var c="".concat(s,"/v3/shared/agents/").concat(e,"/conversations/").concat(t,"/messages?limit=").concat(r,"&skip=").concat(o),l=this._makeRequest("GET",c,null).then((function(e){return n.messagesCache.set(i,{status:b,data:e}),JSON.parse(JSON.stringify(e))})).catch((function(e){throw n.messagesCache.set(i,{status:w,error:e}),e})).finally((function(){n.messagesRequests.delete(i)}));return this.messagesRequests.set(i,l),l.then((function(e){return JSON.parse(JSON.stringify(e))}))}},{key:"getConversations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("kai"===e)return Promise.resolve({conversations:[]});var r=this._getApiUrl();return r?this._makeRequest("GET","".concat(r,"/v3/shared/agents/").concat(e,"/conversations?limit=").concat(t,"&skip=").concat(n),null):Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."))}},{key:"_invalidateMessagesCache",value:function(e){var t,n=u(this.messagesCache.keys());try{for(n.s();!(t=n.n()).done;){var r=t.value;r.startsWith(e+":")&&this.messagesCache.delete(r)}}catch(s){n.e(s)}finally{n.f()}var o,i=u(this.messagesRequests.keys());try{for(i.s();!(o=i.n()).done;){var a=o.value;a.startsWith(e+":")&&this.messagesRequests.delete(a)}}catch(s){i.e(s)}finally{i.f()}}}],r=[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}],n&&m(t.prototype,n),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();v(k,"instance",null);const x=k;function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function C(e,t){for(var n=0;n=200&&i.status<300)try{var e=i.responseText?JSON.parse(i.responseText):null;r(e)}catch(t){o({status:i.status,statusText:"JSON Parse Error",responseText:i.responseText,error:t})}else o({status:i.status,statusText:i.statusText,responseText:i.responseText})},i.onerror=function(){o({status:0,statusText:"Network Error",responseText:null})},i.send(n?JSON.stringify(n):null)}))}},{key:"_createCacheKey",value:function(e,t){return t?"".concat(e,"::").concat(t):e}},{key:"validateChecklist",value:function(e,t){var n=this,r=this._createCacheKey(e,t),o=this.validationCache.get(r);if(o)return o.status===T?Promise.resolve(o.internalId):Promise.reject(o.error);if(this.validationRequests.has(r))return this.validationRequests.get(r);var i=this._getApiUrl();if(!i){var a=new Error("ChecklistNetworkManager: Gleap API URL not configured.");return this.validationCache.set(r,{status:L,error:a}),Promise.reject(a)}var s="".concat(i,"/outbound/checklists?").concat(this._getQueryParams()),c=this._makeRequest("POST",s,{outboundId:e,sharedKey:t}).then((function(e){if(e&&e.id)return n.validationCache.set(r,{status:T,internalId:e.id}),e.id;var t=new Error("Validation response missing checklist ID.");throw n.validationCache.set(r,{status:L,error:e||t}),t})).catch((function(e){throw n.validationCache.set(r,{status:L,error:e}),e})).finally((function(){n.validationRequests.delete(r)}));return this.validationRequests.set(r,c),c}},{key:"fetchChecklist",value:function(e){var t=this,n=this.fetchCache.get(e);if(n)return n.status===T?Promise.resolve(JSON.parse(JSON.stringify(n.data))):Promise.reject(n.error);if(this.fetchRequests.has(e))return this.fetchRequests.get(e).then((function(e){return JSON.parse(JSON.stringify(e))}));var r=this._getApiUrl();if(!r){var o=new Error("ChecklistNetworkManager: Gleap API URL not configured.");return this.fetchCache.set(e,{status:L,error:o}),Promise.reject(o)}var i="".concat(r,"/outbound/checklists/").concat(e,"?convertTipTap=true&").concat(this._getQueryParams()),a=this._makeRequest("GET",i,null).then((function(n){if(n)return t.fetchCache.set(e,{status:T,data:n}),JSON.parse(JSON.stringify(n));var r=new Error("Empty response received for checklist fetch.");throw t.fetchCache.set(e,{status:L,error:n||r}),r})).catch((function(n){throw t.fetchCache.set(e,{status:L,error:n}),n})).finally((function(){t.fetchRequests.delete(e)}));return this.fetchRequests.set(e,a),a.then((function(e){return JSON.parse(JSON.stringify(e))}))}}])&&C(t.prototype,n),r&&C(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();I(O,"instance",null);const A=O;function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function P(e,t){for(var n=0;n0&&!zs.getInstance().isOpened()?(t.classList.remove(n),t.innerText=e):t.classList.add(n)}}},{key:"refresh",value:function(){document.querySelector(".bb-feedback-button")?(this.updateFeedbackButtonText(),this.updateFeedbackButtonState()):(this.injectedFeedbackButton=!1,this.feedbackButton=null,this.buttonHidden=null,this.lastButtonIcon=null,this.injectFeedbackButton())}},{key:"updateFeedbackButtonText",value:function(){var t=br.getInstance().getFlowConfig();if(t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC||t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_BOTTOM||t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_LEFT){var n=document.querySelector(".bb-feedback-button-classic");n&&(n.innerText=t.widgetButtonText)}}},{key:"updateFeedbackButtonState",value:function(){var t=this;if(Pn.getInstance().updateUIVisibility(),null!==this.feedbackButton){var n=br.getInstance().getFlowConfig(),r="";r=n.buttonLogo?''):fe("button","#fff");var o=["bb-feedback-button--pressed","bb-feedback-button--springing"].filter((function(e){return t.feedbackButton.classList.contains(e)}));this.feedbackButton.className="bb-feedback-button gleap-font rr-block",o.forEach((function(e){return t.feedbackButton.classList.add(e)})),this.feedbackButton.setAttribute("dir",Vf.getInstance().isRTLLayout?"rtl":"ltr"),n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC||n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_BOTTOM||n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_LEFT?(this.feedbackButton.classList.add("bb-feedback-button--classic-button-style"),this.feedbackButton.innerHTML='
').concat(n.widgetButtonText,"
")):r!==this.lastButtonIcon&&(this.feedbackButton.innerHTML='
'.concat(r).concat(fe("arrowdown","#fff"),'
')),this.lastButtonIcon=r;var i=!1;null===e.getInstance().buttonHidden?n.feedbackButtonPosition===e.FEEDBACK_BUTTON_NONE&&(i=!0):e.getInstance().buttonHidden&&(i=!0),i&&this.feedbackButton.classList.add("bb-feedback-button--disabled"),n.feedbackButtonPosition===e.FEEDBACK_BUTTON_BOTTOM_LEFT&&this.feedbackButton.classList.add("bb-feedback-button--bottomleft"),zs.getInstance().isOpened()&&this.feedbackButton.classList.add("bb-feedback-button--open");var a=zs.getInstance().appMode;"survey"!==a&&"survey_full"!==a&&"survey_web"!==a||this.feedbackButton.classList.add("bb-feedback-button--survey"),!0!==n.hideForGuests||vs.getInstance().isUser()||this.feedbackButton.classList.add("bb-feedback-button--hidden")}}}])&&P(t.prototype,n),r&&P(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e,t,n){return t=function(e){var t=function(e,t){if("object"!=F(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==F(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}R(_,"FEEDBACK_BUTTON_BOTTOM_RIGHT","BOTTOM_RIGHT"),R(_,"FEEDBACK_BUTTON_BOTTOM_LEFT","BOTTOM_LEFT"),R(_,"FEEDBACK_BUTTON_CLASSIC","BUTTON_CLASSIC"),R(_,"FEEDBACK_BUTTON_CLASSIC_LEFT","BUTTON_CLASSIC_LEFT"),R(_,"FEEDBACK_BUTTON_CLASSIC_BOTTOM","BUTTON_CLASSIC_BOTTOM"),R(_,"FEEDBACK_BUTTON_NONE","BUTTON_NONE"),R(_,"instance",void 0);var B=/^[A-Za-z0-9+/=_-]{1,256}$/,U=function(e){if("string"!=typeof e)return null;var t=e.trim();return B.test(t)?t:null},H=function(){try{if("undefined"==typeof document)return null;var e=document.currentScript;if(e){var t=U(e.nonce||e.getAttribute("nonce"));if(t)return t}var n=document.querySelector('script[src*="sdk.gleap.io"]');if(n)return U(n.nonce||n.getAttribute("nonce"))}catch(r){}return null}(),z=null,q=function(){return z||H},W=function(e){var t=q();if(!t||!e)return e;try{e.setAttribute("nonce",t),e.nonce=t}catch(n){}return e},G="https://docs.gleap.ai/documentation/javascript/content-security-policy",V=new Set,X="gleap-frame-route-failed",J=function(e){return"string"==typeof e&&(0===e.indexOf("script-src")||0===e.indexOf("style-src"))},K=function(e,t){if(e&&t){var n,r=!1,o=function(){if(!r){r=!0;try{e.src=t}catch(n){}}};if(!function(){try{var e,t=null===(e=window.location)||void 0===e?void 0:e.protocol;return"http:"===t||"https:"===t}catch(n){return!1}}())return o();try{if(!e.contentDocument)return o()}catch(a){return o()}try{var i=new URL(t);n=i.origin+"/"}catch(a){return o()}fetch(t,{mode:"cors",credentials:"omit"}).then((function(e){if(!e.ok)throw new Error("Bootstrap fetch failed: "+e.status);return e.text()})).then((function(r){var i=r.replace(/(\s(?:href|src)\s*=\s*["'])\/([^"'/][^"']*)/g,"$1"+n+"$2"),s=q(),c=function(e,t){return t?e.replace(/<(script|style)\b(?![^>]*\snonce\s*=)/gi,'<$1 nonce="'+t+'"'):e}(i,s),l=s?' nonce="'+s+'"':"",u="/",d="/";try{var p=new URL(t);u=(d=p.pathname)+p.search+p.hash}catch(a){}var f,h,g="try{history.replaceState(null,"",'+JSON.stringify(u)+");}catch(e){}try{if(location.pathname!=="+JSON.stringify(d)+"&&window.frameElement){window.frameElement.dispatchEvent(new Event("+JSON.stringify(X)+"));}}catch(e){}<\/script>";f=//i.test(c)?c.replace(/<\/head>/i,g+""):c;try{h=e.contentDocument}catch(a){return o()}if(!h)return o();try{e.addEventListener(X,o,{once:!0})}catch(a){}try{h.open(),function(e,t){var n=!1;try{e.addEventListener("securitypolicyviolation",(function(e){if(e&&"report"!==e.disposition){var r=e.blockedURI||"a resource",o=e.effectiveDirective||e.violatedDirective||"unknown directive",i=r+"|"+o;V.has(i)||(V.add(i),console.warn("Gleap: Your page's Content-Security-Policy blocked "+r+" ("+o+"). Gleap may not appear or work correctly until your policy allows it — see "+G)),t&&!n&&J(o)&&"string"==typeof r&&0===r.indexOf(t.baseHref)&&(n=!0,t.onBlocked())}}))}catch(a){}}(h,{baseHref:n,onBlocked:o}),h.write(f),h.close()}catch(a){o()}})).catch((function(e){V.has(t)||(V.add(t),console.warn("Gleap: Loading "+t+" failed ("+(e&&e.message?e.message:"network error")+") — falling back to loading the frame directly. If Gleap does not appear, your Content-Security-Policy may be blocking it (most often a missing connect-src entry) — see "+G)),o()}))}},$=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400;return new Promise((function(r,o){var i=0===e.indexOf("data:image/jpeg"),a=new Image;a.src=e,a.onerror=function(){o()},a.onload=function(){var e=document.createElement("canvas"),o=t,s=n;t>a.width/1.5&&(o=a.width/1.5),n>a.height/1.5&&(s=a.height/1.5);var c=a.width,l=a.height;c>l?c>o&&(l*=o/c,c=o):l>s&&(c*=s/l,l=s),e.width=c,e.height=l,e.getContext("2d").drawImage(a,0,0,c,l),r(i?e.toDataURL("image/jpeg",.7):e.toDataURL())}}))},Y=/(android|iphone|ipod|ipad|blackberry|iemobile|opera mini|webos)/i,Z=function(){return Q()?"mobile":"desktop"},Q=function(){if("undefined"==typeof window)return!1;try{var e="undefined"!=typeof navigator?navigator:void 0;if(null!=e&&e.userAgentData&&"boolean"==typeof e.userAgentData.mobile&&null!==e.userAgentData.mobile)return e.userAgentData.mobile;if(e&&Y.test(e.userAgent||e.vendor||""))return!0;if((null==e?void 0:e.maxTouchPoints)>1&&window.matchMedia){var t=window.matchMedia("(hover: none) and (pointer: coarse)");if(null!=t&&t.matches)return!0}}catch(n){}return!1},ee=function(e){if(!e)return{};if("string"==typeof e||e instanceof String)try{return JSON.parse(e)}catch(t){return{}}return e},te=function(e){if("string"==typeof e){var t=e.trim();return t.length>0?t:null}return"number"==typeof e?Number.isFinite(e)?String(e):null:"bigint"==typeof e?String(e):null},ne=function(e){try{if(!e||"object"!==F(e)||!("company"in e))return e;var t=e.company,n=function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=160?"#000000":"#ffffff"},fe=function(e,t){return"button"===e?'':"drag"===e?'\x3c!--!Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--\x3e':"unmute"===e?'':"mute"===e?'':"replay"===e?'\n \n ':"dismiss"===e?'':"blur"===e?'\n \n':"pen"===e?'\n \n \n \n \n \n \n \n \n \n \n \n \n':"rect"===e?'\n \n \n \n \n \n \n \n \n \n \n':"pointer"===e?'\n \n ':"clip"===e?'\n \n \n \n \n \n':"mic"===e?'\n \n \n \n \n ':"camera"===e?'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n':"recorderon"===e?'\n \n \n \n \n \n \n \n \n \n \n \n':"recorderoff"===e?'\n \n \n \n \n \n \n \n \n ':"arrowdown"===e?'\n \n '):"arrowleft"===e?'\n \n '):"close"===e?'\n \n '):"undo"===e?'\n \n \n \n \n \n \n \n \n \n ':"circle-dot"===e?''):"circle-question"===e?''):"circle-info"===e?''):"circle-exclamation"===e?''):"circle-up"===e?''):"circle-right"===e?''):""};function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function me(e,t){for(var n=0;n=a-i;++s)n[i]=t[s],Ce(e,t,n,s+1,o,i+1,a);else e.push(n.slice(0,i).join(""))}function Ie(e){return function(e){if(Array.isArray(e))return Ee(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ee(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:["id","class","length"];return Ie(e.attributes).reduce((function(e,n){return t.indexOf(n.nodeName)>-1||e.push("[".concat(n.nodeName,'="').concat(n.value,'"]')),e}),[])}(e,n)},Class:Se,ID:xe};return t.reduce((function(t,n){return t[n]=r[n](e),t}),{})}function _e(e,t){try{var n=e.parentNode.querySelectorAll(t);return 1===n.length&&n[0]===e}catch(r){return!1}}function je(e,t){return t.find(_e.bind(null,e))}function De(e,t,n){var r=function(e,t){for(var n=[],r=e.length,o=[],i=1;i<=t;++i)Ce(n,e,o,0,r-1,0,i);return n}(t,3),o=je(e,r);return Boolean(o)||Boolean(n)&&(o=je(e,r=r.map((function(e){return n+e}))),Boolean(o))?o:null}function Fe(e,t,n,r){var o,i=Ne(e,t,n);r&&r instanceof RegExp&&(i.ID=r.test(i.ID)?null:i.ID,i.Class=i.Class.filter((function(e){return!r.test(e)})));var a,s=Pe(t);try{for(s.s();!(a=s.n()).done;){var c=a.value,l=i.ID,u=i.Tag,d=i.Class,p=i.Attributes,f=i.NthChild;switch(c){case"ID":if(Boolean(l)&&_e(e,l))return l;break;case"Tag":if(Boolean(u)&&_e(e,u))return u;break;case"Class":if(Boolean(d)&&d.length&&(o=De(e,d,u)))return o;break;case"Attributes":if(Boolean(p)&&p.length&&(o=De(e,p,u)))return o;break;case"NthChild":if(Boolean(f))return f}}}catch(h){s.e(h)}finally{s.f()}return"*"}function Be(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.selectorTypes,o=void 0===r?["ID","Class","Tag","NthChild"]:r,i=n.attributesToIgnore,a=void 0===i?["id","class","length"]:i,s=n.excludeRegex,c=void 0===s?null:s,l=[],u=function(e){for(var t=[],n=e;Le(n);)t.push(n),n=n.parentNode;return t}(e),d=Pe(u);try{for(d.s();!(t=d.n()).done;){var p=Fe(t.value,o,a,c);Boolean(p)&&l.push(p)}}catch(y){d.e(y)}finally{d.f()}for(var f=[],h=0,g=l;h ");if(Me(e,v))return v}return null}var Ue=function(e){return'(?:[^"]*[^a-zA-Z0-9])?(?:'.concat(e.join("|"),")")},He=new RegExp(['^(?:#|\\[id=")'.concat(Ue(["v-\\d+",":r[0-9a-z]+:","(?:radix|headlessui|reach|floating-ui)-","mui-\\d+","(?:mat|cdk)-[a-z-]+-?\\d+","(?:downshift|react-select|tippy|uid|uuid)-\\d+","ember\\d+","BVID__\\d+","ext-gen\\d+","yui_\\d","[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"])),"^\\.".concat(Ue(["css-[a-z0-9]*\\d[a-z0-9]*","sc-(?=[a-zA-Z0-9]*[A-Z])[a-zA-Z0-9]{5,}","jsx-\\d+"])),"^\\.[^.]*".concat("__(?=[A-Za-z0-9]{4,}$)(?=[A-Za-z0-9]*[0-9])(?=[A-Za-z0-9]*[A-Z])[A-Za-z0-9]+$")].join("|")),ze=function(e,t){if(!e||"*"===e)return!1;try{var n=document.querySelectorAll(e);return 1===n.length&&n[0]===t}catch(r){return!1}},qe=/\d{2,}/,We=function(e){return e.replace(/\d+/g,"#")},Ge=function(e){return e.match(/(?:^\d|:)/)?'[id="'.concat(e,'"]'):"#".concat(e)},Ve=["data-testid","data-test-id","data-test","data-cy","data-qa","name"],Xe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Be,n=t(e),r=[];try{var o=function(){for(var e={},t=document.querySelectorAll("[id]"),n=0;n1?t.concat(e[n]):t}),[])}(),i="function"==typeof e.getAttribute?e.getAttribute("id"):null;i&&o.indexOf(i)<0&&!He.test(Ge(i))&&r.push(Ge(i)),r.push.apply(r,function(e){var t=(e.tagName||"").toLowerCase();return Ve.reduce((function(n,r){var o="function"==typeof e.getAttribute?e.getAttribute(r):null;if(!o||He.test("#".concat(o)))return n;var i=o.replace(/["\\]/g,"\\$&");return n.concat(["".concat(t,"[").concat(r,'="').concat(i,'"]'),"[".concat(r,'="').concat(i,'"]')])}),[])}(e));var a=o.map((function(e){return Ge(e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})),s=a.length?new RegExp("".concat(He.source,"|^(?:").concat(a.join("|"),")$")):He;r.push(t(e,{excludeRegex:s}))}catch(l){}for(var c=0;c0&&void 0!==arguments[0]&&arguments[0])||r(t.gleapCollapseUI,e)&&r(t.gleapFrameContainer,n))&&(t.gleapCollapseUI&&t.gleapCollapseUI.classList.toggle(e),t.gleapFrameContainer&&t.gleapFrameContainer.classList.toggle(n))})),it(this,"injectCollapseUI",(function(){if(!t.injectedCollapseUI){t.injectedCollapseUI=!0;var e=document.createElement("div");e.className="gleap-admin-collapse-ui",e.innerHTML='
\n '.concat(fe("arrowdown"),"\n
"),document.body.appendChild(e),t.gleapCollapseUI=e,e.addEventListener("click",(function(e){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t.toggleCollapseUI()}))}})),it(this,"injectFrame",(function(){var e;if(!t.injectedFrame){t.injectedFrame=!0;var n=document.createElement("div");n.className="gleap-admin-frame-container",n.innerHTML=''),document.body.appendChild(n),t.gleapFrameContainer=n,t.gleapFrame=document.querySelector(".gleap-admin-frame")}}))}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"logCurrentPage",value:function(){var e=window.location.href;e&&e!==this.lastUrl&&(this.lastUrl=e,this.sendMessageToTourBuilder({name:"page-changed",data:{page:e}}))}},{key:"startPageListener",value:function(){var e=this;setInterval((function(){e.logCurrentPage()}),1e3)}},{key:"initAdminHelper",value:function(){var e=this;this.initialized=!0,nu.getInstance().disable(),Wn.getInstance().disable(),gc.getInstance().disable(),oh.close(),oh.showFeedbackButton(!1),e.adminHelper=new et;try{e.adminHelper.onElementPicked=function(t){e.toggleCollapseUI(!0),e.sendMessageToTourBuilder({name:"element-picked",data:{selector:t}})}}catch(t){console.log(t)}e.injectFrame(),e.injectCollapseUI(),e.setFrameHeight("loading")}},{key:"setFrameHeight",value:function(e){if(this.gleapFrameContainer){var t="";t="picker"===e||"navigate"===e?"65px":"editor"===e?"100vh":"0px",this.gleapFrameContainer.style.height=t}}},{key:"start",value:function(){var e=this;if("undefined"!=typeof window&&!window.gleapAdminDisabled){var t=this;window.addEventListener("message",(function(n){if("https://app.gleap.io"===n.origin)try{var r=JSON.parse(n.data);if("admin"===r.type&&("load"===r.name&&(t.configData=r.data,t.initAdminHelper()),"smartlink-search-result"===r.name&&e.sendMessageToTourBuilder({name:"smartlink-search-result",data:r.data}),"translate-complete"===r.name&&e.sendMessageToTourBuilder({name:"translate-complete",data:r.data})),"tourbuilder"===r.type){var o;if("loaddata"===r.name&&e.sendMessageToTourBuilder({name:"data",data:rt(rt({},t.configData),{},{currentPage:window.location.href})}),"highlight-element"===r.name&&(document.querySelectorAll(".gleap-admin-highlight").forEach((function(e){e.classList.remove("gleap-admin-highlight")})),null!=r&&null!==(o=r.data)&&void 0!==o&&o.selector)){var i,a=document.querySelector(null==r||null===(i=r.data)||void 0===i?void 0:i.selector);a&&a.classList.add("gleap-admin-highlight")}if("smartlink-search"===r.name&&e.sendMessage({name:"smartlink-search",data:r.data}),"product-tour-started"===r.name&&e.sendMessage({name:"product-tour-started",data:r.data}),"translate"===r.name&&e.sendMessage({name:"translate",data:r.data}),"save"===r.name&&e.sendMessage({name:"save",data:r.data}),"update-steps"===r.name&&e.sendMessage({name:"update-steps",data:r.data}),"click"===r.name)try{document.querySelector(r.data.selector).click()}catch(s){console.log(s)}"status-changed"===r.name&&(t.status=r.data,e.setFrameHeight(t.status),t.adminHelper.stopPicker(),"picker"===t.status&&t.adminHelper.startPicker())}}catch(c){}})),this.sendMessage({name:"init"}),this.startPageListener()}}},{key:"sendMessage",value:function(e){try{window&&window.opener&&window.opener.postMessage(JSON.stringify(rt(rt({},e),{},{type:"admin"})),"*")}catch(t){}}},{key:"sendMessageToTourBuilder",value:function(e){try{this.gleapFrame&&this.gleapFrame.contentWindow&&this.gleapFrame.contentWindow.postMessage(JSON.stringify(rt(rt({},e),{},{type:"tourbuilder"})),"*")}catch(t){}}}])&&ot(t.prototype,n),r&&ot(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ct(e){return ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ct(e)}function lt(){lt=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(r||[]);return o(a,"_invoke",{value:E(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==ct(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(u).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function E(t,n,r){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=T(s,r);if(c){if(c===m)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=g,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dt(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._agentId=t.agentId||"kai",this._context=t.context||null,this._onChange=t.onChange||null,this._onError=t.onError||null,this._onReplyReceived=t.onReplyReceived||null,this._onConversationCreated=t.onConversationCreated||null,this._onToken=t.onToken||null,this._messages=[],this._conversationId=t.conversationId||null,this._isExecuting=!1,this._error=null,this._destroyed=!1,this._abortController=null;try{this._networkManager=x.getInstance()}catch(n){this._networkManager=null}}var t,n,r,o,i;return t=e,n=[{key:"sendMessage",value:(o=lt().mark((function e(t){var n,r,o,i,a,s,c,l=this;return lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=(t||"").trim())&&!this._isExecuting&&!this._destroyed){e.next=3;break}return e.abrupt("return");case 3:return this._messages=[].concat(ft(this._messages),[{id:"user-".concat(Date.now()),role:"user",content:n,createdAt:(new Date).toISOString()}]),r="stream-".concat(Date.now()),this._messages=[].concat(ft(this._messages),[{id:r,role:"assistant",content:"",createdAt:(new Date).toISOString(),isStreaming:!0}]),this._isExecuting=!0,this._error=null,this._notify(),o="kai"===this._agentId,i=o?this._messages.filter((function(e){return!e.isStreaming&&e.content})).map((function(e){return{role:e.role,content:e.content}})):[{role:"user",content:n}],a={messages:i},this._conversationId&&(a.conversationId=this._conversationId),this._context&&(a.additionalContext=this._context),this._abortController=new AbortController,s=!this._conversationId,c=this._messages.length-1,e.next=19,this._networkManager.streamAgent(this._agentId,a,{onMeta:function(e){l._destroyed||(e.conversationId&&(l._conversationId=e.conversationId,l._networkManager._invalidateMessagesCache(e.conversationId),s&&l._onConversationCreated&&l._onConversationCreated(e.conversationId)),e.runId&&l._messages[c]&&(l._messages[c]=dt(dt({},l._messages[c]),{},{id:e.runId})))},onToken:function(e){if(!l._destroyed){var t=l._messages[c];t&&(t.content+=e.content||""),l._notify(),l._onToken&&l._onToken(e)}},onDone:function(e){if(!l._destroyed){var t=l._messages[c];t&&(t.isStreaming=!1,e.response&&!t.content&&(t.content=e.response)),l._isExecuting=!1,l._abortController=null,l._notify(),l._onReplyReceived&&l._onReplyReceived(e)}},onError:function(e){if(!l._destroyed){var t=l._messages[c];t&&!t.content?l._messages.splice(c,1):t&&(t.isStreaming=!1),l._isExecuting=!1,l._error=e,l._abortController=null,l._notify(),l._onError&&l._onError(e)}},onToolStart:function(){},onToolEnd:function(){}},this._abortController.signal);case 19:case"end":return e.stop()}}),e,this)})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){gt(i,n,r,a,s,"next",e)}function s(e){gt(i,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)})},{key:"cancelStream",value:function(){this._abortController&&(this._abortController.abort(),this._abortController=null),this._messages=this._messages.map((function(e){return e.isStreaming?dt(dt({},e),{},{isStreaming:!1}):e})),this._messages=this._messages.filter((function(e){return e.content||"user"===e.role})),this._isExecuting=!1,this._notify()}},{key:"clearMessages",value:function(){this._messages=[],this._conversationId=null,this._isExecuting=!1,this._error=null,this.cancelStream(),x.getInstance().clearCache(),this._notify()}},{key:"setContext",value:function(e){this._context=e}},{key:"getState",value:function(){return{messages:this._messages,isExecuting:this._isExecuting,error:this._error,conversationId:this._conversationId}}},{key:"destroy",value:function(){this.cancelStream(),this._destroyed=!0,this._onChange=null,this._onError=null,this._onReplyReceived=null,this._onConversationCreated=null,this._onToken=null}},{key:"_notify",value:function(){this._onChange&&!this._destroyed&&this._onChange(this.getState())}}],n&&mt(t.prototype,n),r&&mt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();const bt=yt;var wt={eu:{apiUrl:"https://api.gleap.io",wsApiUrl:"wss://ws.gleap.io",realtimeHost:"sockets.gleap.io"},us:{apiUrl:"https://api.us.gleap.ai",wsApiUrl:"wss://ws.us.gleap.ai",realtimeHost:"sockets.us.gleap.ai"}},kt="eu";function xt(e){return xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xt(e)}function St(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if("flow-started"===e){var n=oh.getInstance();n.setGlobalDataItem("webReplay",null),n.setGlobalDataItem("screenRecordingData",null),n.takeCurrentReplay()}var r=this.getInstance().eventListeners[e];if(r)for(var o=0;o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Ht(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function qt(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function Wt(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};this.colorScheme=function(e){return e===on||e===an?e:rn}(e),this.lightBackgroundColor=hn(null==t?void 0:t.lightBackgroundColor),this.darkBackgroundColor=hn(null==t?void 0:t.darkBackgroundColor),this.updateWatching(),this.notifyChange()}},{key:"getDashboardConfig",value:function(){try{return br.getInstance().rawFlowConfig||null}catch(e){return null}}},{key:"getColorScheme",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig(),n=(e=null==t?void 0:t.colorScheme,-1!==sn.indexOf(e)?e:nn);return n===nn?nn:this.colorScheme||n}},{key:"hasDarkPalette",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig();return!!this.darkBackgroundColor||!!e&&cn.some((function(t){var n=en(t,2)[1];return null!==hn(e[n])}))}},{key:"getActiveColorScheme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig(),t=this.getColorScheme(e),n=null;return t===rn?n=this.detectedScheme||kn():t!==on&&t!==an||(n=t),n!==an||this.hasDarkPalette(e)?n:null}},{key:"applyToFlowConfig",value:function(e){var t=this.getActiveColorScheme(e);if(!e||!t)return e;if(t===on)return this.lightBackgroundColor?$t($t({},e),{},{backgroundColor:this.lightBackgroundColor}):e;var n=$t({},e);return cn.forEach((function(t){var r=en(t,2),o=r[0],i=r[1],a=hn(e[i]);a&&(n[o]=a)})),this.darkBackgroundColor&&(n.backgroundColor=this.darkBackgroundColor),ln.forEach((function(t){var r=en(t,2),o=r[0],i=r[1],a=e[i];null!=a&&(n[o]=a)})),n}},{key:"applyToChatbarStyle",value:function(e){var t=this.getActiveColorScheme();if(!t)return e;var n=!e||"light-glow"===e||"dark-glow"===e;return t===an?n?"dark-glow":"dark":n?"light-glow":"light"}},{key:"applyToChecklist",value:function(e){e&&(this.getActiveColorScheme()===an?e.setAttribute(gn,""):e.removeAttribute(gn))}},{key:"applyToChecklists",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("undefined"!=typeof document)for(var t=document.querySelectorAll("gleap-checklist"),n=0;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Cn(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function In(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Cn(i,r,o,a,s,"next",e)}function s(e){Cn(i,r,o,a,s,"throw",e)}a(void 0)}))}}function En(e){return En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},En(e)}function Tn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0];if(this._postMessageRaw({name:"chatbar-notification-clear"}),!e)try{var t;jf.getInstance().sendMessage({type:"chatbar-notification-cleared",gleapId:null===(t=vs.getInstance().session)||void 0===t?void 0:t.gleapId})}catch(n){}}},{key:"_resizeFrame",value:function(e){var t=e.width,n=e.height;if(this.chatbarContainer){if(Number.isFinite(t)&&window.innerWidth>=600){var r=window.innerWidth-20;this.chatbarContainer.style.width=Math.min(Math.ceil(t),r)+"px"}Number.isFinite(n)&&(this.chatbarContainer.style.height=Math.ceil(n)+"px"),this.isHidden||(this.chatbarContainer.style.display="block")}}},{key:"_updateBlurBackdrop",value:function(e){var t=e.visible,n=e.top,r=e.bottom,o=e.left,i=e.right,a=e.radius,s=e.dark;if(this.blurBackdrop)if(this.chatbarFrame&&(this.chatbarFrame.style.backdropFilter="",this.chatbarFrame.style.webkitBackdropFilter=""),t){var c=this.blurBackdrop.style;c.top=(null!=n?n:0)+"px",c.bottom=(null!=r?r:0)+"px",c.left=(null!=o?o:0)+"px",c.right=(null!=i?i:0)+"px",c.height="auto",c.borderRadius=(null!=a?a:20)+"px",s?(c.background="rgba(40, 40, 40, 0.55)",c.backdropFilter="blur(20px) saturate(140%) brightness(0.75)",c.webkitBackdropFilter="blur(20px) saturate(140%) brightness(0.75)"):(c.background="rgba(255, 255, 255, 0.45)",c.backdropFilter="blur(20px) saturate(150%) brightness(1.04)",c.webkitBackdropFilter="blur(20px) saturate(150%) brightness(1.04)"),c.opacity="1"}else this.blurBackdrop.style.opacity="0"}},{key:"setConfig",value:function(e){this.config=e,e.enabled?this.show():this.manuallyShown||this.hide(),this.comReady&&this._sendConfigUpdate()}},{key:"setPlaceholder",value:function(e){this.config||(this.config={}),this.config.placeholder=e,this.comReady&&this._sendConfigUpdate()}},{key:"setQuickActions",value:function(e){this.config||(this.config={}),this.config.quickActions=e,this.comReady&&this._sendConfigUpdate()}},{key:"sendAgentToolsUpdate",value:function(){this._postMessageRaw({name:"config-update",data:{config:this._withChatbarConfig(br.getInstance().getFlowConfig()),aiTools:Xt.getInstance().getAgentTools(),agentTools:Xt.getInstance().getAgentTools(),overrideLanguage:Vf.getInstance().getOverrideLanguage()}})}},{key:"_normalizeAgentOptions",value:function(e){return e&&"object"===En(e)?"context"in e||"initialQuestion"in e||"initialMessage"in e?e:{context:e}:{}}},{key:"_getDefaultAgentId",value:function(){try{var e,t;if(null!==(e=this.config)&&void 0!==e&&e.workflowId)return this.config.workflowId;var n=br.getInstance().getFlowConfig()||{};return(null==n||null===(t=n.aiBar)||void 0===t?void 0:t.workflowId)||null}catch(r){return null}}},{key:"_validateAgent",value:(i=In(Sn().mark((function e(t){var n,r,o,i,a,s,c;return Sn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=vs.getInstance(),i=o.apiUrl||wt[kt].apiUrl,a={},o.sdkKey&&(a["Api-Token"]=o.sdkKey),null!==(n=o.session)&&void 0!==n&&n.gleapId&&(a["Gleap-Id"]=o.session.gleapId),null!==(r=o.session)&&void 0!==r&&r.gleapHash&&(a["Gleap-Hash"]=o.session.gleapHash),e.next=9,fetch("".concat(i,"/v3/shared/agents/").concat(encodeURIComponent(t)),{headers:a});case 9:if((s=e.sent).ok){e.next=12;break}return e.abrupt("return",null);case 12:return e.next=14,s.json();case 14:if((c=e.sent)&&!c.error){e.next=17;break}return e.abrupt("return",null);case 17:return this.agentId=t,this.agentName=c.name||"AI Agent",e.abrupt("return",c);case 22:return e.prev=22,e.t0=e.catch(0),e.abrupt("return",null);case 25:case"end":return e.stop()}}),e,this,[[0,22]])}))),function(e){return i.apply(this,arguments)})},{key:"showWithAgent",value:(o=In(Sn().mark((function e(t,n){var r,o,i=this;return Sn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this._normalizeAgentOptions(n),this._suppressOutsideClick=!0,clearTimeout(this._suppressOutsideClickTimeout),this._suppressOutsideClickTimeout=setTimeout((function(){i._suppressOutsideClick=!1}),600),(o=t)&&"default"!==o||(o=this._getDefaultAgentId()||"kai"),!o||"kai"===o){e.next=13;break}return this.agentId=o,this.agentName=null,e.next=11,this._validateAgent(o);case 11:e.next=15;break;case 13:this.agentId="kai",this.agentName=null;case 15:r.context&&(this.agentContext=r.context),this.manuallyHidden=!1,this.manuallyShown=!0,this.show(),this.setPanelOpen(!0),this._postMessageRaw({name:"chatbar-start-agent",data:{agentId:this.agentId,agentName:this.agentName,context:this.agentContext,initialQuestion:r.initialQuestion||void 0,initialMessage:r.initialMessage||void 0}});case 21:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"updateUIVisibility",value:function(){var e;zs.getInstance().isOpened()?this.hide():null!==(e=this.config)&&void 0!==e&&e.enabled||this.manuallyShown?this.show():this.hide()}},{key:"show",value:function(){this.manuallyHidden||(this.isHidden=!1,this._preloadIframe(),this.chatbarContainer&&(this.chatbarContainer.style.display="block"))}},{key:"hide",value:function(){this.isHidden=!0,this._removeUI()}},{key:"_removeUI",value:function(){this.chatbarContainer&&(document.body&&document.body.contains(this.chatbarContainer)&&document.body.removeChild(this.chatbarContainer),this.chatbarContainer=null,this.chatbarFrame=null,this.blurBackdrop=null,this.comReady=!1,this._panelOpen=!1,this.pendingMessages=[])}},{key:"_preloadIframe",value:function(){var e=this;this.chatbarContainer||se((function(){return e._injectUI()}))}},{key:"_injectUI",value:function(){if(document.body&&!this.chatbarContainer){var e={};try{e=br.getInstance().getFlowConfig()||{}}catch(s){}if(!document.getElementById("gleap-chatbar-styles")){var t=e.feedbackButtonPosition,n="";n="BOTTOM_RIGHT"===t?"right: 60px !important;":"BOTTOM_LEFT"===t?"left: 60px !important;":"right: 0 !important;";var r=document.createElement("style");W(r),r.id="gleap-chatbar-styles",r.innerHTML="\n @media (max-width: 460px) {\n .gleap-chatbar {\n width: auto !important;\n max-width: 100% !important;\n ".concat(n,"\n }\n }\n "),document.head.appendChild(r)}var o=document.createElement("div");o.className="gleap-chatbar",o.style.cssText="\n position: fixed;\n bottom: 10px;\n z-index: 2147483000;\n border: 0;\n width: 280px;\n max-width: calc(100vw - 20px);\n overflow: visible;\n height: 80px;\n display: none;\n transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1), height 0.32s cubic-bezier(0.22, 1, 0.36, 1);\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n ";var i=document.createElement("iframe");i.className="gleap-chatbar-frame",i.title="Gleap AI Chatbar",i.setAttribute("role","dialog"),i.setAttribute("frameborder","0"),i.setAttribute("allow","autoplay; encrypted-media; microphone *;"),i.style.cssText="\n position: relative;\n width: 100%;\n height: 100%;\n border: 0;\n background: transparent;\n z-index: 1;\n ";var a=document.createElement("div");a.style.cssText="\n position: absolute;\n opacity: 0;\n transition: opacity 0.24s ease;\n background: rgba(255, 255, 255, 0.45);\n backdrop-filter: blur(20px) saturate(150%) brightness(1.04);\n -webkit-backdrop-filter: blur(20px) saturate(150%) brightness(1.04);\n transform: translateZ(0);\n will-change: backdrop-filter, transform;\n backface-visibility: hidden;\n border-radius: 20px;\n pointer-events: none;\n z-index: 0;\n ",o.appendChild(a),o.appendChild(i),document.body.appendChild(o),this.chatbarContainer=o,this.chatbarFrame=i,this.blurBackdrop=a,K(this.chatbarFrame,this.chatbarUrl)}}},{key:"destroy",value:function(){this._removeUI(),this.config=null,this.isHidden=!0,this.comReady=!1,this._panelOpen=!1,this.pendingMessages=[],this.agentId=null,this.agentName=null,this.agentContext=null,e.instance=null}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&On(t.prototype,n),r&&On(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Rn(e){return Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rn(e)}function Nn(e,t){for(var n=0;n',document.body.appendChild(t),this.bannerContainer=t;var n=t.querySelector(".gleap-b-frame");n&&K(n,this.bannerUrl)}},{key:"sendMessage",value:function(e){try{var t=document.querySelector(".gleap-b-frame");t&&t.contentWindow&&t.contentWindow.postMessage(JSON.stringify(Un(Un({},e),{},{type:"banner"})),"*")}catch(n){}}},{key:"showBanner",value:function(e){this.injectBannerUI(e)}}])&&Hn(t.prototype,n),r&&Hn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Gn(e){return Gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gn(e)}function Vn(e){return function(e){if(Array.isArray(e))return Xn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Xn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1])||arguments[1],o=(t=e.innerText||"",n=40,t.length>n?t.slice(0,n)+"...":t).replace(/(\r\n|\n|\r)/gm,"").replace(/ +(?= )/g,""),i="",a="";if(void 0!==e.getAttribute){var s=e.getAttribute("id");s&&(i=' id="'.concat(s,'"'));var c=e.getAttribute("class");c&&(a=' class="'.concat(c,'"'))}var l=(e.tagName||"").toLowerCase(),u="<",d=">";return r||(u="[",d="]"),"".concat(u).concat(l).concat(i).concat(a).concat(d).concat(o).concat(u,"/").concat(l).concat(d)}(e.target),"CLICK")}}))}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&or(t.prototype,n),r&&or(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ur(e){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ur(e)}function dr(e,t){for(var n=0;n0)for(var e=0;e0&&(t+="#"+e.id);var n="";"string"==typeof e.className?n=e.className:"function"==typeof e.getAttribute&&(n=e.getAttribute("class")||"");for(var r=n.trim().split(/\s+/).filter(Boolean).slice(0,5),o=0;o"}if(3===e.nodeType){var i=String(e.nodeValue||"").trim();return'#text "'+(i.length>40?i.slice(0,40)+"…":i)+'"'}return String(e.nodeName).toLowerCase()},Tr=function e(t,n){try{var r="Error",o="",i="";try{r=t.name?String(t.name):"Error",o=void 0!==t.message&&null!==t.message?String(t.message):"",i="string"==typeof t.stack?t.stack.trim():""}catch(u){}var a=o.length>0?r+": "+o:r,s=a;if(i.length>0)s=(o.length>0?-1!==i.indexOf(o):0===i.indexOf(r))?i:a+"\n"+i;var c,l=n||0;try{c=t.cause}catch(u){}return null!=c&&l<3&&(s+="\nCaused by: "+(Sr(c)?e(c,l+1):Nr(c,1e3))),s}catch(u){return"Error"}},Lr=function(e,t){var n=e.maxLength-e.length;if(t.length>n)throw e.parts.push(t.slice(0,Math.max(0,n))),e.length=e.maxLength,e.truncated=!0,kr;e.parts.push(t),e.length+=t.length},Or=function(e,t){var n=e.maxLength-e.length;Lr(e,JSON.stringify(t.length>n?t.slice(0,n):t))},Ar=function(e,t){try{return{value:e[t]}}catch(n){return{failed:!0}}},Mr=function(e,t,n,r,o,i){Lr(e,t);for(var a=Math.min(r,100),s=0;s0&&Lr(e,","),o(s,i+1);r>a&&Lr(e,",… "+(r-a)+" more"),Lr(e,n)},Pr=function e(t,n,r){var o=wr(n);if(null!==n)if("string"!==o)if("number"!==o&&"boolean"!==o&&"undefined"!==o)if("bigint"!==o)if("symbol"!==o)if("function"!==o)if(-1===t.seen.indexOf(n))if(Sr(n)){var i="Error",a="";try{i=String(n.name||"Error"),a=String(n.message||"")}catch(h){}Or(t,a?i+": "+a:i)}else if(Cr(n))Lr(t,Er(n));else if(function(e){return!!e&&"object"===wr(e)&&e.window===e&&!!e.document}(n))Lr(t,"[Window]");else{var s=xr(n);if("[object Date]"!==s)if("[object RegExp]"!==s)if("[object Promise]"!==s&&"[object WeakMap]"!==s&&"[object WeakSet]"!==s)if("[object ArrayBuffer]"!==s&&"[object SharedArrayBuffer]"!==s)if("undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(n))Lr(t,s.slice(8,-1)+"("+("number"==typeof n.length?n.length:n.byteLength)+")");else if(r>=t.maxDepth)Lr(t,Array.isArray(n)?"[Array]":"[Object]");else{t.seen.push(n);try{if(Array.isArray(n))return void Mr(t,"[","]",n.length,(function(r,o){var i=Ar(n,r);i.failed?Lr(t,'"[unreadable]"'):e(t,i.value,o)}),r);if("[object Map]"===s){var c=[];return n.forEach((function(e,t){c.length<100&&c.push([t,e])})),void Mr(t,"Map("+n.size+"){","}",n.size,(function(n,r){e(t,c[n][0],r),Lr(t," => "),e(t,c[n][1],r)}),r)}if("[object Set]"===s){var l=[];return n.forEach((function(e){l.length<100&&l.push(e)})),void Mr(t,"Set("+n.size+")[","]",n.size,(function(n,r){return e(t,l[n],r)}),r)}if("function"==typeof n.toJSON){var u;try{u=n.toJSON()}catch(h){u=n}if(u!==n)return void e(t,u,r)}var d=Object.keys(n),p=function(e){try{var t=Object.getPrototypeOf(e);if(!t||t===Object.prototype)return"";var n=t.constructor;return n&&"string"==typeof n.name&&"Object"!==n.name?n.name:""}catch(h){return""}}(n);Mr(t,(p?p+" ":"")+"{","}",d.length,(function(r,o){Or(t,d[r]),Lr(t,":");var i=Ar(n,d[r]);i.failed?Lr(t,'"[unreadable]"'):e(t,i.value,o)}),r)}finally{t.seen.pop()}}else Lr(t,s.slice(8,-1)+"("+n.byteLength+")");else Lr(t,s.slice(8,-1));else Lr(t,String(n));else{var f=n.getTime();Or(t,isNaN(f)?"Invalid Date":n.toISOString())}}else Lr(t,'"[Circular]"');else Lr(t,Ir(n));else Lr(t,n.toString());else Lr(t,n.toString()+"n");else Lr(t,String(n));else Or(t,n);else Lr(t,"null")},Rr=function(e,t,n){var r=function(e,t){return{parts:[],length:0,maxLength:e,maxDepth:t,seen:[],truncated:!1}}(t,"number"==typeof n?n:1/0);try{Pr(r,e,0)}catch(o){if(o!==kr)return{text:r.parts.join("")+"[unserializable]",truncated:!1}}return{text:r.parts.join(""),truncated:r.truncated}},Nr=function(e,t){var n="number"==typeof t&&t>0?t:5e3;try{if("string"==typeof e)return e.length>n?e.slice(0,n):e;if(null==e||"number"==typeof e||"boolean"==typeof e)return String(e);if("bigint"==typeof e)return e.toString()+"n";if("symbol"===wr(e))return e.toString();if("function"==typeof e)return Ir(e);if(Sr(e)){var r=Tr(e);return r.length>n?r.slice(0,n):r}if(Cr(e))return Er(e);if("[object Date]"===xr(e)){var o=e.getTime();return isNaN(o)?"Invalid Date":e.toISOString()}return Rr(e,n,4).text}catch(i){try{return xr(e)}catch(a){return"[unserializable]"}}},_r=function(e){try{return"bigint"==typeof e?e:"symbol"===wr(e)?NaN:Number(e)}catch(t){return NaN}},jr=function(e){var t=_r(e);return"bigint"==typeof t?t.toString()+"n":isNaN(t)?"NaN":String(t<0?Math.ceil(t):Math.floor(t))},Dr=function(e){var t=_r(e);return String("bigint"==typeof t?Number(t):t)},Fr=function(e,t){var n="number"==typeof t&&t>0?t:5e3;try{if(!e||0===e.length)return"";var r="",o=0,i=e[0];if("string"==typeof i&&e.length>1&&-1!==i.indexOf("%")){o=1;for(var a=0;a=e.length)r+=s;else{var l=e[o++];a++;var u=Math.max(1,n-r.length);"s"===c?r+=Nr(l,u):"d"===c||"i"===c?r+=jr(l):"f"===c?r+=Dr(l):"c"!==c&&(r+="string"==typeof l?JSON.stringify(l.slice(0,u)):Nr(l,u))}else r+="%",a++}else r+=s}}for(;o0&&(r+=" "),r+=Nr(e[o],Math.max(1,n-r.length));return r.length>n?r.slice(0,n):r}catch(d){return"[unserializable console arguments]"}};function Br(e){return Br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Br(e)}function Ur(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"INFO";if(null!=e&&("string"!=typeof e&&(e=Nr(e,Gr)),!(e.length<=0)))for(this.logArray.push({log:Vr(e,t),date:(new Date).toISOString(),priority:t});this.logArray.length>this.logMaxLength;)this.logArray.shift()}},{key:"addLogWithArgs",value:function(e,t){!e||e.length<=0||this.addLog(Fr(e,Gr),t)}},{key:"capture",value:function(e){if(!this.disabled&&!this.capturing){this.capturing=!0;try{e()}catch(t){}finally{this.capturing=!1}}}},{key:"wrapConsoleMethod",value:function(e,t,n){var r=e[t];if("function"==typeof r&&!r.__gleapConsoleWrapper){var o=function(){return n(arguments),r.apply(e,arguments)};o.__gleapConsoleWrapper=!0,this.originalConsoleMethods[t]=r,this.consoleWrappers[t]=o,e[t]=o}}},{key:"start",value:function(){var e=this;if(!this.disabled&&!this.started&&"undefined"!=typeof window){this.started=!0;var t=this,n=window.console;if(n){for(var r=Object.keys(qr),o=function(){var o=r[i];e.wrapConsoleMethod(n,o,(function(e){t.capture((function(){return t.addLogWithArgs(e,qr[o])}))}))},i=0;i0&&e[0]||t.capture((function(){var n=Fr(Array.prototype.slice.call(e,1),Gr);t.addLog("Assertion failed"+(n?": "+n:""),"ERROR")}))}))}try{this.errorListener=function(e){t.capture((function(){return t.addUncaughtError(e)}))},this.rejectionListener=function(e){t.capture((function(){var n=e?e.reason:void 0;t.addLog("Unhandled promise rejection: "+Nr(n,Gr),"ERROR")}))},window.addEventListener("error",this.errorListener),window.addEventListener("unhandledrejection",this.rejectionListener)}catch(a){}}}},{key:"addUncaughtError",value:function(e){if(e&&("undefined"==typeof ErrorEvent||e instanceof ErrorEvent)){var t,n=e.error;t=n&&"object"===Br(n)&&"string"==typeof n.stack&&n.stack.length>0?Tr(n):null!=n?Nr(n,Gr)+Xr(e):String(e.message||"Script error.").replace(/^Uncaught\s+/,"")+Xr(e),this.addLog("Uncaught "+t,"ERROR")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Ur(t.prototype,n),r&&Ur(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Kr(e){return Kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kr(e)}function $r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yr(e){for(var t=1;t=0)return null;if(function(e){if("password"===bo(e))return!0;var t=e.getAttribute&&e.getAttribute("autocomplete");return!!t&&t.toLowerCase().split(/\s+/).some((function(e){return po.indexOf(e)>=0}))}(e)||function(e,t){return function(e,t){for(var n=e;n;){if(1===n.nodeType&&t(n))return!0;n=n.parentElement||n.parentNode&&n.parentNode.host||null}return!1}(e,(function(e){return xo(e,t)||wo(e,'[gleap-ignore="value"]')}))}(e,t))return yo;if(!function(e,t){var n=So(t);return!(!n[e.tagName?e.tagName.toLowerCase():""]&&!n[bo(e)])}(e,t))return null;var n=t.maskInputFn;return"function"!=typeof n?yo:function(t){try{return n(t,e)}catch(r){return yo(t)}}},Io=function(e){return String(e).replace(/[\S]/g,"*")},Eo=function(e){var t=e&&e.maskTextFn;return"function"!=typeof t?Io:function(e,n){try{var r=t(e,n);return"string"==typeof r?r:Io(e)}catch(o){return Io(e)}}};function To(e){return To="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},To(e)}function Lo(){Lo=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(r||[]);return o(a,"_invoke",{value:E(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==To(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(u).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function E(t,n,r){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=T(s,r);if(c){if(c===m)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=g,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Oo(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function Ao(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Oo(i,r,o,a,s,"next",e)}function s(e){Oo(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Mo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Po(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Po(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Po(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"),e&&e.childNodes&&e.childNodes.length>0)for(var r=0;r1?t-1:0),o=1;o0&&(n--,t+=e[r]):t+=e[r];return t}(n)},Bo=function(e,t){for(var n,r=[],o=function(){var e=document.styleSheets[i];if(e.media&&"print"===e.media.mediaText)return 1;var o=Fo(e);if(e&&e.ownerNode)if(""!=o){var a=document.getElementsByTagName("base");n=a.length?a[0].href.substr(location.origin.length,999):window.location.href.split(/[?#]/)[0],e.href&&(n=e.href);var s=n.substring(0,n.lastIndexOf("/"));r.push(No(o,s,t).then((function(t){return{styletext:t,stylesheet:e,styleId:e.ownerNode.getAttribute("bb-styleid")}})))}else r.push(Promise.resolve({styletext:o,stylesheet:e,styleId:e.ownerNode.getAttribute("bb-styleid")}))},i=0;i0&&t>0&&Math.abs(e-t)>1?e/t:1};return{x:n(e.width,t.width),y:n(e.height,t.height)}},ai=function(e){for(var t=ni(e);t;t=ni(t)){var n=window.getComputedStyle(t);if(parseFloat(n.width)>0&&parseFloat(n.height)>0)return ii(t.getBoundingClientRect(),oi(t,n))}return{x:1,y:1}},si=function(e,t){return{left:e.left/t.x,right:e.right/t.x,top:e.top/t.y,bottom:e.bottom/t.y,width:e.width/t.x,height:e.height/t.y}},ci=function(e){var t=e.createElement("span");return Ko(t.style,"display","inline-block"),["margin","padding","border-width"].forEach((function(e){return Ko(t.style,e,"0")})),t},li=function e(t,n,r){return ti(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var o=window.getComputedStyle(t);if("none"!==o.display&&!Qo(o))if("contents"===o.display||Zo(o))e(t,n,r);else{var i=si(t.getBoundingClientRect(),n),a={left:i.left-$o(o,"margin-left"),right:i.right+$o(o,"margin-right"),top:i.top-$o(o,"margin-top"),bottom:i.bottom+$o(o,"margin-bottom"),verticalAlign:o.verticalAlign};0===o.display.indexOf("inline")?("baseline"!==a.verticalAlign||Xo.test(t.localName)||(a.verticalAlign="middle"),r.atomicInlines.push(a)):r.blocks.push(a)}}})),r},ui=function(e,t,n){var r=function(e){return(e.top+e.bottom)/2},o=[];n.forEach((function(e){for(var n=0,i=1;ia.bottom-a.top)&&(o[n]=e)}));for(var i=0;i=a.top+a.height/2&&e.appendChild(e.ownerDocument.createElement("br"));var s=o[i],c=ci(e.ownerDocument);Ko(c.style,"vertical-align",s?s.verticalAlign:"baseline"),Yo(c.style,t[i].width,s?s.bottom-s.top:0),e.appendChild(c)}},di=function e(t,n,r){ti(n).forEach((function(n){if(n.nodeType!==Node.TEXT_NODE){if(n.nodeType===Node.ELEMENT_NODE){var o=window.getComputedStyle(n).display;"contents"===o?e(t,n,r):"none"!==o&&t.appendChild(Ii(n,t.ownerDocument,!0,r))}}else!function(e,t){var n=ri(t);if(n.length){var r=ai(t),o=e.ownerDocument.createElement("span");Ko(o.style,"display","inline"),["margin","padding","border-width"].forEach((function(e){return Ko(o.style,e,"0")})),ui(o,n.map((function(e){return si(e,r)})),[]),e.appendChild(o)}}(t,n)}))},pi=function(e){return!("block"!==e.display&&"list-item"!==e.display||Qo(e)||ei(e)||/layout|paint|strict|content/.test(e.contain))},fi=function(e,t,n,r){if(!(t instanceof HTMLElement))return!1;var o=e.offsetTop,i=e.offsetTop+e.offsetHeight;if(t.offsetParent===e)o=0,i=e.clientHeight;else if(t.offsetParent!==e.offsetParent)return!1;var a=t.offsetTop-("relative"===n.position?$o(n,"top"):0),s="top"===r?a-o:a+t.offsetHeight-i;return Math.abs(s)<=1},hi=function(e,t,n,r){return r.push($o(t,"margin-"+n)),!pi(t)||$o(t,"padding-"+n)||$o(t,"border-"+n+"-width")||gi(e,ti(e),n,r),r},gi=function e(t,n,r,o){"bottom"===r&&n.reverse();for(var i=0;i0))return!1;if(a.nodeType===Node.ELEMENT_NODE){var s=window.getComputedStyle(a);if("none"!==s.display&&!Qo(s))if("contents"!==s.display){if(/^(inline|ruby)/.test(s.display)||!fi(t,a,s,r))return!1;if(hi(a,s,r,o),0!==a.getBoundingClientRect().height||!pi(s))return!1;hi(a,s,"top"===r?"bottom":"top",o)}else if(!e(t,ti(a),r,o))return!1}}var c;return!0},mi=function(e){return Math.max(0,Math.max.apply(null,e))+Math.min(0,Math.min.apply(null,e))},vi=null,yi=new Map,bi=function(e){var t=window.getComputedStyle(e),n=[t.fontStyle,t.fontWeight,t.fontSize,t.fontFamily].join(" ");return yi.has(n)||((vi=vi||document.createElement("canvas").getContext("2d")).font=n,yi.set(n,vi.measureText("").fontBoundingBoxAscent)),yi.get(n)},wi=function e(t,n,r){var o=ti(t);n&&o.reverse();for(var i=0;i0||t.scrollLeft>0)&&(g.setAttribute("bb-scrollpos",!0),g.setAttribute("bb-scrolltop",t.scrollTop),g.setAttribute("bb-scrollleft",t.scrollLeft)),"SELECT"!==m&&"TEXTAREA"!==m&&"INPUT"!==m||(v=Co(t,n),g.setAttribute("bb-data-value",v?v(t.value):t.value),v&&g.hasAttribute("value")&&g.setAttribute("value",v(g.getAttribute("value"))),"checkbox"!==t.type&&"radio"!==t.type||!t.checked||g.setAttribute("bb-data-checked",!0))),c.appendChild(g),!t.shadowRoot){e.next=43;break}return x=r,r++,zo(o,t.shadowRoot),e.next=41,h(t.shadowRoot.firstChild,g,x);case 41:Ho(t.shadowRoot,g,x),void 0!==g.setAttribute&&g.setAttribute("bb-shadow-parent",x);case 43:if(v&&"TEXTAREA"===m){e.next=46;break}return e.next=46,h(t.firstChild,g);case 46:if(v&&"SELECT"===m)for(S=g.querySelectorAll("option[selected]"),C=0;C0){for(u=l.childNodes;u.length>0;)l.parentNode.insertBefore(u[0],l);l.remove()}for(d=s.querySelectorAll("script, noscript"),a=0;a({x:e,y:e}),Ni={left:"right",right:"left",bottom:"top",top:"bottom"},_i={start:"end",end:"start"};function ji(e,t,n){return Ai(e,Oi(t,n))}function Di(e,t){return"function"==typeof e?e(t):e}function Fi(e){return e.split("-")[0]}function Bi(e){return e.split("-")[1]}function Ui(e){return"x"===e?"y":"x"}function Hi(e){return"y"===e?"height":"width"}const zi=new Set(["top","bottom"]);function qi(e){return zi.has(Fi(e))?"y":"x"}function Wi(e){return Ui(qi(e))}function Gi(e){return e.replace(/start|end/g,(e=>_i[e]))}const Vi=["left","right"],Xi=["right","left"],Ji=["top","bottom"],Ki=["bottom","top"];function $i(e,t,n,r){const o=Bi(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Xi:Vi:t?Vi:Xi;case"left":case"right":return t?Ji:Ki;default:return[]}}(Fi(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Gi)))),i}function Yi(e){return e.replace(/left|right|bottom|top/g,(e=>Ni[e]))}function Zi(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Qi(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ea(e,t,n){let{reference:r,floating:o}=e;const i=qi(t),a=Wi(t),s=Hi(a),c=Fi(t),l="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(c){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Bi(t)){case"start":f[a]-=p*(n&&l?-1:1);break;case"end":f[a]+=p*(n&&l?-1:1)}return f}async function ta(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Di(t,e),h=Zi(f),g=s[p?"floating"===d?"reference":"floating":d],m=Qi(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=Qi(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:c}):v);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}const na=new Set(["left","top"]);function ra(){return"undefined"!=typeof window}function oa(e){return sa(e)?(e.nodeName||"").toLowerCase():"#document"}function ia(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function aa(e){var t;return null==(t=(sa(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function sa(e){return!!ra()&&(e instanceof Node||e instanceof ia(e).Node)}function ca(e){return!!ra()&&(e instanceof Element||e instanceof ia(e).Element)}function la(e){return!!ra()&&(e instanceof HTMLElement||e instanceof ia(e).HTMLElement)}function ua(e){return!(!ra()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ia(e).ShadowRoot)}const da=new Set(["inline","contents"]);function pa(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ca(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!da.has(o)}const fa=new Set(["table","td","th"]);function ha(e){return fa.has(oa(e))}const ga=[":popover-open",":modal"];function ma(e){return ga.some((t=>{try{return e.matches(t)}catch(n){return!1}}))}const va=["transform","translate","scale","rotate","perspective"],ya=["transform","translate","scale","rotate","perspective","filter"],ba=["paint","layout","strict","content"];function wa(e){const t=ka(),n=ca(e)?Ca(e):e;return va.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||ya.some((e=>(n.willChange||"").includes(e)))||ba.some((e=>(n.contain||"").includes(e)))}function ka(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const xa=new Set(["html","body","#document"]);function Sa(e){return xa.has(oa(e))}function Ca(e){return ia(e).getComputedStyle(e)}function Ia(e){return ca(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ea(e){if("html"===oa(e))return e;const t=e.assignedSlot||e.parentNode||ua(e)&&e.host||aa(e);return ua(t)?t.host:t}function Ta(e){const t=Ea(e);return Sa(t)?e.ownerDocument?e.ownerDocument.body:e.body:la(t)&&pa(t)?t:Ta(t)}function La(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Ta(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=ia(o);if(i){const e=Oa(a);return t.concat(a,a.visualViewport||[],pa(o)?o:[],e&&n?La(e):[])}return t.concat(o,La(o,[],n))}function Oa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Aa(e){const t=Ca(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=la(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Mi(n)!==i||Mi(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Ma(e){return ca(e)?e:e.contextElement}function Pa(e){const t=Ma(e);if(!la(t))return Ri(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Aa(t);let a=(i?Mi(n.width):n.width)/r,s=(i?Mi(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Ra=Ri(0);function Na(e){const t=ia(e);return ka()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ra}function _a(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ma(e);let a=Ri(1);t&&(r?ca(r)&&(a=Pa(r)):a=Pa(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ia(e))&&t}(i,n,r)?Na(i):Ri(0);let c=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=ia(i),t=r&&ca(r)?ia(r):r;let n=e,o=Oa(n);for(;o&&r&&t!==n;){const e=Pa(o),t=o.getBoundingClientRect(),r=Ca(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=i,l+=a,n=ia(o),o=Oa(n)}}return Qi({width:u,height:d,x:c,y:l})}function ja(e,t){const n=Ia(e).scrollLeft;return t?t.left+n:_a(aa(e)).left+n}function Da(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ja(e,n),y:n.top+t.scrollTop}}const Fa=25;const Ba=new Set(["absolute","fixed"]);function Ua(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ia(e),r=aa(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;const e=ka();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}const l=ja(r);if(l<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=Fa&&(i-=a)}else l<=Fa&&(i+=l);return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=aa(e),n=Ia(e),r=e.ownerDocument.body,o=Ai(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ai(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ja(e);const s=-n.scrollTop;return"rtl"===Ca(r).direction&&(a+=Ai(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(aa(e));else if(ca(t))r=function(e,t){const n=_a(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=la(e)?Pa(e):Ri(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Na(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Qi(r)}function Ha(e,t){const n=Ea(e);return!(n===t||!ca(n)||Sa(n))&&("fixed"===Ca(n).position||Ha(n,t))}function za(e,t,n){const r=la(t),o=aa(t),i="fixed"===n,a=_a(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Ri(0);function l(){c.x=ja(o)}if(r||!r&&!i)if(("body"!==oa(t)||pa(o))&&(s=Ia(t)),r){const e=_a(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&l();i&&!r&&o&&l();const u=!o||r||i?Ri(0):Da(o,s);return{x:a.left+s.scrollLeft-c.x-u.x,y:a.top+s.scrollTop-c.y-u.y,width:a.width,height:a.height}}function qa(e){return"static"===Ca(e).position}function Wa(e,t){if(!la(e)||"fixed"===Ca(e).position)return null;if(t)return t(e);let n=e.offsetParent;return aa(e)===n&&(n=n.ownerDocument.body),n}function Ga(e,t){const n=ia(e);if(ma(e))return n;if(!la(e)){let t=Ea(e);for(;t&&!Sa(t);){if(ca(t)&&!qa(t))return t;t=Ea(t)}return n}let r=Wa(e,t);for(;r&&ha(r)&&qa(r);)r=Wa(r,t);return r&&Sa(r)&&qa(r)&&!wa(r)?n:r||function(e){let t=Ea(e);for(;la(t)&&!Sa(t);){if(wa(t))return t;if(ma(t))return null;t=Ea(t)}return null}(e)||n}const Va={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=aa(r),s=!!t&&ma(t.floating);if(r===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=Ri(1);const u=Ri(0),d=la(r);if((d||!d&&!i)&&(("body"!==oa(r)||pa(a))&&(c=Ia(r)),la(r))){const e=_a(r);l=Pa(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?Ri(0):Da(a,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}},getDocumentElement:aa,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?ma(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=La(e,[],!1).filter((e=>ca(e)&&"body"!==oa(e))),o=null;const i="fixed"===Ca(e).position;let a=i?Ea(e):e;for(;ca(a)&&!Sa(a);){const t=Ca(a),n=wa(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&Ba.has(o.position)||pa(a)&&!n&&Ha(e,a))?r=r.filter((e=>e!==a)):o=t,a=Ea(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce(((e,n)=>{const r=Ua(t,n,o);return e.top=Ai(r.top,e.top),e.right=Oi(r.right,e.right),e.bottom=Oi(r.bottom,e.bottom),e.left=Ai(r.left,e.left),e}),Ua(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Ga,getElementRects:async function(e){const t=this.getOffsetParent||Ga,n=this.getDimensions,r=await n(e.floating);return{reference:za(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Aa(e);return{width:t,height:n}},getScale:Pa,isElement:ca,isRTL:function(e){return"rtl"===Ca(e).direction}};function Xa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ja(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,l=Ma(e),u=o||i?[...l?La(l):[],...La(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=l&&s?function(e,t){let n,r=null;const o=aa(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=l;if(s||t(),!p||!f)return;const h={rootMargin:-Pi(d)+"px "+-Pi(o.clientWidth-(u+p))+"px "+-Pi(o.clientHeight-(d+f))+"px "+-Pi(u)+"px",threshold:Ai(0,Oi(1,c))||1};let g=!0;function m(t){const r=t[0].intersectionRatio;if(r!==c){if(!g)return a();r?a(!1,r):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==r||Xa(l,e.getBoundingClientRect())||a(),g=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(v){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(l,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),l&&!c&&h.observe(l),h.observe(t));let g=c?_a(e):null;return c&&function t(){const r=_a(e);g&&!Xa(g,r)&&n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Ka=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Fi(n),s=Bi(n),c="y"===qi(n),l=na.has(a)?-1:1,u=i&&c?-1:1,d=Di(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),c?{x:f*u,y:p*l}:{x:p*l,y:f*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},$a=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Di(e,t),u={x:n,y:r},d=await i.detectOverflow(t,l),p=qi(Fi(o)),f=Ui(p);let h=u[f],g=u[p];if(a){const e="y"===f?"bottom":"right";h=ji(h+d["y"===f?"top":"left"],h,h-d[e])}if(s){const e="y"===p?"bottom":"right";g=ji(g+d["y"===p?"top":"left"],g,g-d[e])}const m=c.fn({...t,[f]:h,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:a,[p]:s}}}}}},Ya=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=Di(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Fi(o),y=qi(s),b=Fi(s)===s,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),k=p||(b||!g?[Yi(s)]:function(e){const t=Yi(e);return[Gi(e),t,Gi(t)]}(s)),x="none"!==h;!p&&x&&k.push(...$i(s,g,h,w));const S=[s,...k],C=await c.detectOverflow(t,m),I=[];let E=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&I.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Bi(e),o=Wi(e),i=Hi(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Yi(a)),[a,Yi(a)]}(o,a,w);I.push(C[e[0]],C[e[1]])}if(E=[...E,{placement:o,overflows:I}],!I.every((e=>e<=0))){var T,L;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&y!==qi(t))||E.every((e=>qi(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:E},reset:{placement:t}}}let n=null==(L=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:L.placement;if(!n)switch(f){case"bestFit":{var O;const e=null==(O=E.filter((e=>{if(x){const t=qi(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Za=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Di(e,t)||{};if(null==l)return{};const d=Zi(u),p={x:n,y:r},f=Wi(o),h=Hi(f),g=await a.getDimensions(l),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[f]-p[f]-i.floating[h],k=p[f]-i.reference[f],x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l));let S=x?x[b]:0;S&&await(null==a.isElement?void 0:a.isElement(x))||(S=s.floating[b]||i.floating[h]);const C=w/2-k/2,I=S/2-g[h]/2-1,E=Oi(d[v],I),T=Oi(d[y],I),L=E,O=S-g[h]-T,A=S/2-g[h]/2+C,M=ji(L,A,O),P=!c.arrow&&null!=Bi(o)&&A!==M&&i.reference[h]/2-(A{const r=new Map,o={platform:Va,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=ea(l,r,c),p=r,f={},h=0;for(let m=0;m0)},rs=function(e,t){var n=(t.pageRules&&t.pageRules.length>0?t.pageRules:t.pageFilter?[{pageFilter:t.pageFilter,pageFilterType:t.pageFilterType}]:[]).filter(ns);if(0===n.length)return!0;var r=n.filter((function(e){return!ts.includes(e.pageFilterType)})),o=n.filter((function(e){return ts.includes(e.pageFilterType)})),i=0===r.length||r.some((function(t){return es(e,t.pageFilter,t.pageFilterType)})),a=0===o.length||o.every((function(t){return es(e,t.pageFilter,t.pageFilterType)}));return i&&a};function os(e){return os="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},os(e)}function is(e){return function(e){if(Array.isArray(e))return as(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return as(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return as(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function as(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n'):""),i.appendChild(a),t.repositionHotspot(e,n),o=a,t.elementToTooltipMap.set(e,n)}else o=e;var s=t.createTooltip(o,n.html,n);t.elementToFloatingUIMap.set(e,s)}}})),cs(this,"updateFilteredTooltips",(function(){t.filteredTooltips=t.getFilteredTooltips(),t.checkForTooltips()})),cs(this,"getFilteredTooltips",(function(){if(!t.tooltips)return[];var e=window.location.href;return t.tooltips.filter((function(t){return t.pageRules&&t.pageRules.length>0?rs(e,{pageRules:t.pageRules}):!t.page||0===t.page.length||!!es(e,t.page,t.pageType)}))})),cs(this,"checkForTooltips",(function(){for(var e=0;e0&&this.filteredTooltips.forEach((function(n){n.selector&&e.matches(n.selector)&&t.linkTooltip(e,n)}))}},{key:"start",value:function(){var e=this,t=this;if(window){var n,r,o,i=(n=t.updateHotspotPositions.bind(t),r=250,o=null,function(){if(!o){var e=this,t=arguments;o=setTimeout((function(){n.call.apply(n,[e].concat(is(t))),o=null}),r)}});window.addEventListener("resize",i),window.requestAnimationFrame((function(){e.observer=new MutationObserver((function(n){t.lastUrl!==window.location.href&&(t.lastUrl=window.location.href,t.filteredTooltips=t.getFilteredTooltips()),n.forEach((function(n){if("attributes"===n.type){var r=n.target;r.nodeType===Node.ELEMENT_NODE&&(r.querySelector("[data-gleap-tooltip-hotspot]")||r.hasAttribute("data-gleap-tooltip-mode")||r.hasAttribute("data-gleap-tooltip"))&&t.updateHotspotPositions()}n.addedNodes.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&t.processNodeInsertion(e)})),n.removedNodes.forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE&&e.elementToFloatingUIMap.has(t)){var n=e.elementToFloatingUIMap.get(t);n&&(n.tooltip&&n.tooltip.remove(),n.cleanup(),e.elementToFloatingUIMap.delete(t))}e.elementToTooltipMap.has(t)&&e.elementToTooltipMap.delete(t)}))}))})),e.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]})}))}}},{key:"updateHotspotPositions",value:function(){var e=this;document.querySelectorAll("[data-gleap-tooltip-mode='hotspot']").forEach((function(t){var n=e.elementToTooltipMap.get(t);n&&e.repositionHotspot(t,n)}))}},{key:"createTooltip",value:function(e,t,n){var r=document.createElement("div");r.className="gleap-tooltip",r.innerHTML='
\n '.concat(t,'\n
\n \n \n \n
\n
'),document.body.appendChild(r);var o,i=r.querySelector(".gleap-tooltip-arrow"),a=Ja(e,r,(function(){Qa(e,r,{placement:"left"===n.posX?"left":"right",middleware:[Ka(10),Ya(),$a(),Za({element:i})]}).then((function(e){var t=e.x,n=e.y,o=e.middlewareData,a=e.placement;try{if(Object.assign(r.style,{left:"".concat(t,"px"),top:"".concat(n,"px")}),o.arrow){var s={left:"",top:"",transform:""};null!=o.arrow.x&&(s.left="".concat(o.arrow.x,"px"),"bottom"===a?(s.transform="translateY(-7px) rotate(180deg)",s.top="".concat(-20,"px")):"top"===a&&(s.transform="translateY(7px) rotate(0deg)",s.top="100%")),null!=o.arrow.y&&(s.top="".concat(o.arrow.y,"px"),"right"===a?(s.transform="translateX(-7px) rotate(90deg)",s.left="".concat(-20,"px")):"left"===a&&(s.transform="translateX(7px) rotate(270deg)",s.left="100%")),Object.assign(i.style,s)}}catch(c){}}))}));function s(){clearTimeout(o),r.style.visibility="visible",r.style.opacity="1",r.style.pointerEvents="auto"}function c(){o=setTimeout((function(){r.style.opacity="0",setTimeout((function(){r.style.visibility="hidden",r.style.pointerEvents="none"}),200)}),500)}return e.addEventListener("mouseenter",s),e.addEventListener("mouseleave",c),r.addEventListener("mouseenter",s),r.addEventListener("mouseleave",c),e.addEventListener("click",c),r.addEventListener("click",c),{cleanup:a,tooltip:r}}},{key:"canEmbed",value:function(e){var t=new Set(["area","base","br","embed","hr","img","input","source","track","wbr","canvas"]);return e&&!t.has(e.tagName.toLowerCase())}},{key:"destroy",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),document.querySelectorAll(".gleap-tooltip").forEach((function(e){return e.remove()})),document.querySelectorAll("[data-gleap-tooltip-anchor]").forEach((function(e){return e.remove()})),document.querySelectorAll("[data-gleap-tooltip-hotspot]").forEach((function(e){return e.remove()})),document.querySelectorAll("[data-gleap-tooltip]").forEach((function(e){return e.removeAttribute("data-gleap-tooltip")})),document.querySelectorAll("[data-gleap-tooltip-mode]").forEach((function(e){return e.removeAttribute("data-gleap-tooltip-mode")})),this.elementToFloatingUIMap=new WeakMap,this.elementToTooltipMap=new WeakMap,this.tooltips=[],this.filteredTooltips=[]}},{key:"repositionHotspot",value:function(e,t){if(e&&t){var n=e.getAttribute("data-gleap-tooltip");if(n){var r=document.querySelector('[data-gleap-tooltip-hotspot="'.concat(n,'"]'));if(r){t.posX||(t.posX="right"),t.posY||(t.posY="center"),t.offsetX||(t.offsetX=4),t.offsetY||(t.offsetY=0);var o=e.getBoundingClientRect();try{var i=document.createRange();i.selectNodeContents(e);var a=window.getComputedStyle(e),s=i.getBoundingClientRect().width+parseFloat(a.paddingLeft);s0&&void 0!==arguments[0]?arguments[0]:0,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(clearTimeout(t.fileRefreshTimeout),t.openingProtectedFile=null,null!==(e=t.session)&&void 0!==e&&e.fileAccessToken)try{var o=new XMLHttpRequest;o.open("POST",t.apiUrl+"/files/session/revoke"),o.setRequestHeader("X-File-Session",t.session.fileAccessToken),o.send()}catch(i){}t.session&&t.session.gleapHash&&Ft.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash));try{ae("session-".concat(t.sdkKey),null)}catch(a){}if(t.useCookies)try{!function(e){try{var t=oe(window.location.host.split(":")[0]);document.cookie=e+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT; Domain="+t}catch(a){}}("session-".concat(t.sdkKey))}catch(a){}t.ready=!1,t.session={gleapId:null,gleapHash:null,name:"",email:"",userId:"",phone:"",value:0},t.lastIdentify=null,t.identifyInFlight=!1,zs.getInstance().sendMessage({name:"session-cleared"},!0),bl.getInstance().clearAllNotifications(!1),bl.getInstance().setNotificationCount(0),Wn.getInstance().removeBannerUI(),gc.getInstance().hideModal(),r&&t.scheduleSessionRetry(n)})),gs(this,"scheduleSessionRetry",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!isNaN(e)){var n=10*Math.pow(e,2);setTimeout((function(){t.startSession(e+1)}),1e3*n)}})),gs(this,"openRequestedProtectedFile",(function(){var e,n=new URLSearchParams((null===(e=window.location)||void 0===e?void 0:e.search)||"").get("gleapFile");if(/^[a-f0-9]{24}$/.test(n||"")&&t.openingProtectedFile!==n){t.openingProtectedFile=n;var r=t.session.fileAccessToken,o=new XMLHttpRequest;o.open("GET","".concat(t.apiUrl,"/files/").concat(n,"/location")),o.setRequestHeader("X-File-Session",t.session.fileAccessToken),o.onload=function(){var e;if((null===(e=t.session)||void 0===e?void 0:e.fileAccessToken)===r)if(200===o.status)try{var n=JSON.parse(o.responseText).shareToken,i=zs.getInstance();i.setAppMode("widget"),i.sendMessage({name:"open-conversation",data:{shareToken:n}},!0),i.showWidget()}catch(a){t.openingProtectedFile=null}else t.openingProtectedFile=null},o.onerror=function(){t.openingProtectedFile=null},o.send()}})),gs(this,"validateSession",(function(e){var n,r,o,i,a,s;if(e&&e.gleapId){!e.fileAccessToken&&e.gleapId===(null===(n=t.session)||void 0===n?void 0:n.gleapId)&&e.userId===(null===(r=t.session)||void 0===r?void 0:r.userId)&&Date.parse(t.session.fileAccessExpiresAt)>Date.now()&&(e=fs(fs({},e),{},{fileAccessToken:t.session.fileAccessToken,fileAccessExpiresAt:t.session.fileAccessExpiresAt}));var c=!1;if((null===(o=t.session)||void 0===o?void 0:o.gleapId)!==(null===(i=e)||void 0===i?void 0:i.gleapId)&&(c=!0),t.session&&t.session.gleapHash&&Ft.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),t.localStorageDisabled||ae("session-".concat(t.sdkKey),e),t.useCookies&&function(e,t,n){try{var r="";if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),r="; expires="+o.toUTCString()}var i=oe(window.location.host.split(":")[0]);document.cookie=e+"="+(t||"")+r+"; path=/; domain="+i}catch(a){}}("session-".concat(t.sdkKey),encodeURIComponent(JSON.stringify(e)),365),t.session=e,t.ready=!0,e.fileAccessToken&&t.openRequestedProtectedFile(),clearTimeout(t.fileRefreshTimeout),e.fileAccessToken&&null!==(a=t.lastIdentify)&&void 0!==a&&a.userHash&&(t.fileRefreshTimeout=setTimeout((function(){if(t.lastIdentify){var e,n,r=t.lastIdentify,o=r.userId,i=r.userData,a=r.userHash;null===(e=t.identifySession(o,i,a,!0))||void 0===e||null===(n=e.catch)||void 0===n||n.call(e,(function(){}))}}),Math.max(0,Date.parse(e.fileAccessExpiresAt)-Date.now()-3e5))),t.session&&t.session.gleapHash&&Ft.notifyEvent("register-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),c&&(setTimeout((function(){A.getInstance().clearCache(),x.getInstance().clearCache(),Mf.getInstance().restart();var e=us.getInstance();if(e){try{e.destroy()}catch(t){}e.load()}}),0),"function"==typeof window.dispatchEvent&&window.dispatchEvent(new CustomEvent("session-updated"))),t.notifySessionReady(),c&&t.replayIdentifyIfNeeded(),e.authenticatedFilesRequired&&!e.fileAccessToken&&null!==(s=t.lastIdentify)&&void 0!==s&&s.userHash&&!t.identifyInFlight){var l,u,d=t.lastIdentify,p=d.userId,f=d.userData,h=d.userHash;null===(l=t.identifySession(p,f,h,!0))||void 0===l||null===(u=l.catch)||void 0===u||u.call(l,(function(){}))}}})),gs(this,"replayIdentifyIfNeeded",(function(){try{if(!t.lastIdentify||!t.lastIdentify.userId)return;if(t.identifyInFlight)return;if(t.session&&t.session.userId)return;var e=t.lastIdentify,n=e.userId,r=e.userData,o=e.userHash,i=t.identifySession(n,r,o);i&&"function"==typeof i.catch&&i.catch((function(){}))}catch(a){}})),gs(this,"startSession",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{if(t.useCookies){var n=function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r0)){var o=ie("session-".concat(t.sdkKey));o&&t.validateSession(o)}var i=t,a=new XMLHttpRequest;a.open("POST",i.apiUrl+"/sessions"),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.setRequestHeader("Api-Token",i.sdkKey);try{t.session&&t.session.gleapId&&t.session.gleapHash&&(a.setRequestHeader("Gleap-Id",t.session.gleapId),a.setRequestHeader("Gleap-Hash",t.session.gleapHash))}catch(s){}a.onreadystatechange=function(t){if(4===a.readyState)if(200===a.status||201===a.status)try{var n=JSON.parse(a.responseText);i.validateSession(n)}catch(s){}else 429!==a.status&&(!(a.status>=400&&a.status<500)&&i.session&&i.session.gleapId?i.scheduleSessionRetry(e):i.clearSession(e,!0))},a.send(JSON.stringify({lang:Vf.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}))})),gs(this,"checkIfSessionNeedsUpdate",(function(e,n){if(!t.session||!t.session.userId||!e)return!0;try{if(t.session.userId.toString()!==e.toString())return!0}catch(r){}return t.checkIfSessionDataNeedsUpdate(n)})),gs(this,"checkIfSessionDataNeedsUpdate",(function(e){if(e)for(var n=Object.keys(e),r=0;r3&&void 0!==arguments[3]&&arguments[3];t.lastIdentify={userId:e,userData:n,userHash:r};var s=t.checkIfSessionNeedsUpdate(e,n),c=!!r&&(null===(o=t.session)||void 0===o?void 0:o.authenticatedFilesRequired)&&(!(null!==(i=t.session)&&void 0!==i&&i.fileAccessToken)||Date.parse(t.session.fileAccessExpiresAt)<=Date.now());if(s||a||c){var l=t;return new Promise((function(o,i){t.setOnSessionReady((function(){if(!l.session.gleapId||!l.session.gleapHash)return i("Session not ready yet.");var t=new XMLHttpRequest;t.open("POST",l.apiUrl+"/sessions/identify"),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.setRequestHeader("Api-Token",l.sdkKey);try{t.setRequestHeader("Gleap-Id",l.session.gleapId),t.setRequestHeader("Gleap-Hash",l.session.gleapHash)}catch(s){}l.identifyInFlight=!0,t.onerror=function(){l.identifyInFlight=!1,i()},t.onreadystatechange=function(e){if(4===t.readyState)if(l.identifyInFlight=!1,200===t.status||201===t.status)try{var n=JSON.parse(t.responseText);l.validateSession(n),o(n)}catch(s){i(s)}else i()};var a=fs({},n);n.customData&&(delete a.customData,a=fs(fs({},a),n.customData)),t.send(JSON.stringify(fs(fs({},a),{},{userId:e,userHash:r,lang:Vf.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"})))}))}))}})),gs(this,"startProductTourConfig",(function(e){var n=t;return new Promise((function(r,o){t.setOnSessionReady((function(){if(!n.session.gleapId||!n.session.gleapHash)return o("Session not ready yet.");var t=new XMLHttpRequest;t.open("POST",n.apiUrl+"/outbound/producttours"),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.setRequestHeader("Api-Token",n.sdkKey);try{t.setRequestHeader("Gleap-Id",n.session.gleapId),t.setRequestHeader("Gleap-Hash",n.session.gleapHash)}catch(i){}t.onerror=function(){o()},t.onreadystatechange=function(e){if(4===t.readyState)if(200===t.status||201===t.status)try{var n=JSON.parse(t.responseText);n&&n.config&&r(n.config)}catch(i){o(i)}else o()},t.send(JSON.stringify({outboundId:e}))}))}))})),gs(this,"validateProductTour",(function(e){var n=t;return new Promise((function(r,o){t.setOnSessionReady((function(){var t;if(!n.session.gleapId||!n.session.gleapHash)return o("Session not ready yet.");var i=new XMLHttpRequest;i.open("POST",n.apiUrl+"/outbound/producttourvalidation"),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.setRequestHeader("Api-Token",n.sdkKey);try{i.setRequestHeader("Gleap-Id",n.session.gleapId),i.setRequestHeader("Gleap-Hash",n.session.gleapHash)}catch(a){}i.onerror=function(){o()},i.onreadystatechange=function(e){if(4===i.readyState)if(200===i.status||201===i.status)try{var t=JSON.parse(i.responseText);t&&"live"===t.status&&t.passedPageFilter?r(t.config):o()}catch(a){o(a)}else o()},i.send(JSON.stringify({outboundId:e,currentUrl:null===(t=window)||void 0===t||null===(t=t.location)||void 0===t?void 0:t.href}))}))}))}))}var t,n,r;return t=e,n=[{key:"setRegion",value:function(e){var t=function(e){if("string"!=typeof e)return null;var t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(wt,t)?t:null}(e);if(!t)return console.warn('Gleap: Unknown region "'.concat(e,'". Supported regions: ').concat(Object.keys(wt).join(", "),". Region not changed.")),!1;var n=wt[t];return this.region=t,this.apiUrl=n.apiUrl,this.wsApiUrl=n.wsApiUrl,this.realtimeHost=n.realtimeHost,!0}},{key:"getRegion",value:function(){return this.region}},{key:"getName",value:function(){try{return this.session.name?this.session.name.split(" ")[0].split("@")[0].split(".")[0].split("+")[0]:""}catch(e){return this.session.name}}},{key:"getSession",value:function(){return this.session}},{key:"getGleapId",value:function(){return this.session&&this.session.gleapId?this.session.gleapId:null}},{key:"isUser",value:function(){return!(!this.session||!this.session.userId)}},{key:"notifySessionReady",value:function(){if(this.onSessionReadyListener.length>0)for(var e=0;e=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function ws(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function ks(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ws(i,r,o,a,s,"next",e)}function s(e){ws(i,r,o,a,s,"throw",e)}a(void 0)}))}}function xs(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ss(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ss(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?t[0]:null}},{key:"getFirstAudioTrack",value:function(e){if(!e)return null;var t=e.getAudioTracks();return t.length>0?t[0]:null}},{key:"startScreenRecording",value:(a=ks(bs().mark((function t(){var n,r;return bs().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia&&!this.isRecording){t.next=4;break}return this.available=!1,this.rerender(),t.abrupt("return");case 4:return t.prev=4,t.next=7,navigator.mediaDevices.getDisplayMedia({video:{width:{ideal:Math.min(window.screen.width,e.MAX_WIDTH)},height:{ideal:Math.min(window.screen.height,e.MAX_HEIGHT)},frameRate:{ideal:e.IDEAL_FRAME_RATE,max:e.MAX_FRAME_RATE},displaySurface:"monitor"},audio:!1,selfBrowserSurface:"include"});case 7:if(n=t.sent,this._displayStream=n,this._displayVideoTrack=this.getFirstVideoTrack(n),this.audioMuted){t.next=15;break}return t.next=13,this.startAudioRecording();case 13:t.next=19;break;case 15:this.audioAvailable=!1,r=this.createMediaStream([this._displayVideoTrack]),this.stream=r,this.handleRecord({stream:r});case 19:this.rerender(),t.next=26;break;case 22:t.prev=22,t.t0=t.catch(4),window.alert(this.permissionErrorText),this.rerender();case 26:case"end":return t.stop()}}),t,this,[[4,22]])}))),function(){return a.apply(this,arguments)})},{key:"stopScreenRecording",value:function(){if(this.mediaRecorder&&this.stream&&this.isRecording){this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null);try{this.mediaRecorder.stop()}catch(e){}this.stopStreamTracks(this.stream),this._displayStream&&(this.stopStreamTracks(this._displayStream),this._displayStream=null),this._micStream&&(this.stopStreamTracks(this._micStream),this._micStream=null),this._displayVideoTrack=null,this.rerender()}}},{key:"startAudioRecording",value:(i=ks(bs().mark((function e(){var t,n,r,o;return bs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._displayVideoTrack){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1});case 5:t=e.sent,this._micStream=t,n=this.getFirstAudioTrack(t),this.audioMuted=!1,this.audioAvailable=!!n,r=this.createMediaStream([this._displayVideoTrack,n]),this.stream=r,this.handleRecord({stream:r}),this.rerender(),e.next=23;break;case 16:e.prev=16,e.t0=e.catch(2),this.audioAvailable=!1,o=this.createMediaStream([this._displayVideoTrack]),this.stream=o,this.handleRecord({stream:o}),this.rerender();case 23:case"end":return e.stop()}}),e,this,[[2,16]])}))),function(){return i.apply(this,arguments)})},{key:"toggleAudio",value:function(){if(this.audioMuted=!this.audioMuted,this.rerender(),this.stream)for(var e=this.stream.getAudioTracks(),t=0;t0?i.innerHTML=r.formatTime(e):(i.innerHTML="2:00",r.stopScreenRecording()):e<=0&&r.stopScreenRecording()}),e.TIMER_UPDATE_INTERVAL),this.mediaRecorder.ondataavailable=function(e){e.data&&e.data.size>0&&o.push(e.data)};var a=this.getFirstVideoTrack(n);a&&(a.onended=function(){r.prepareRecording(o)}),this.mediaRecorder.onstop=function(){r.prepareRecording(o)},this.mediaRecorder.start(e.CHUNK_INTERVAL),r.rerender()}},{key:"prepareRecording",value:function(t){var n=this.getSupportedMimeType(),r=new Blob(t,{type:n}),o=n.includes("mp4")?"mp4":"webm";this.file=new File([r],"screen-recording.".concat(o),{type:n});var i=document.querySelector(e.SELECTORS.PREVIEW_VIDEO);i&&(i.src=URL.createObjectURL(r),this.audioAvailable=this.stream?this.stream.getAudioTracks().length>0:this.audioAvailable,this.isRecording=!1,this.rerender())}}],r=[{key:"uploadScreenRecording",value:(o=ks(bs().mark((function e(t){return bs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",null);case 2:return e.abrupt("return",new Promise((function(e,n){var r=new XMLHttpRequest;r.open("POST",vs.getInstance().apiUrl+"/uploads/sdk"),vs.getInstance().injectSession(r);var o=new FormData;o.append("file",t),r.onerror=function(){n(new Error("Network error during file upload"))},r.onreadystatechange=function(){4==r.readyState&&(200==r.status?e(JSON.parse(r.response).fileUrl):n(new Error("Upload failed with status ".concat(r.status))))},r.send(o)})));case 3:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}],n&&Cs(t.prototype,n),r&&Cs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ls(e){return Ls="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ls(e)}function Os(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function As(e){for(var t=1;t0&&(e.tags=t),this.excludeData)for(var n=Object.keys(this.excludeData),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)if(t){var n=window.open(e,"_blank");n&&n.focus()}else window.location.href=e})),Us(this,"autoWhiteListCookieManager",(function(){window&&Array.isArray(window.cmp_block_ignoredomains)&&-1===window.cmp_block_ignoredomains.indexOf("messenger-app.gleap.io")&&window.cmp_block_ignoredomains.push("messenger-app.gleap.io")})),Us(this,"injectFrame",(function(){t.injectedFrame||(t.injectedFrame=!0,t.autoWhiteListCookieManager(),se((function(){br.getInstance().onConfigLoaded((function(){br.getInstance().applyStylesFromConfig();var e=document.createElement("div");e.className="gleap-frame-container gleap-frame-container--hidden rr-block",e.innerHTML='
'.concat(function(e){var t,n,r=e||{},o="image"===r.bgType&&r.bgImage&&r.bgImage.length>0,i=parseInt(r.v,10),a=i>=1&&i<=4?i:1,s=4!==a,c=null===(t=r.bgBlur)||void 0===t||t?'
':"";if(!s){var l,u=r.welcomeText?String(r.welcomeText).replace(/&/g,"&").replace(//g,">"):"",d='
\n
\n
\n
 
'.concat(u?'\n
'.concat(u,"
"):"","\n
\n
");if(o){var p=String(r.bgImage).replace(/"/g,""");return'
\n
\n
\n
\n ').concat(d,'\n
\n
\n
')}var f=null===(l=r.fadebg)||void 0===l||l;return'
\n
\n '.concat(d).concat(f?'\n
':"","\n
\n
")}if(o){var h=String(r.bgImage).replace(/"/g,"""),g=r.hideNews&&r.hideFeatureRequests&&r.hideAllConversations&&r.hideKnowledgeBase;return'
\n
\n ').concat(c,"
\n
")}if("classic"===r.bgType){var m,v=null===(m=r.fadebg)||void 0===m||m;return'
'.concat(v?'\n \n \n \n \n \n \n \n \n \n \n \n \n ':'\n \n \n \n \n \n \n \n ').concat(c,"
")}var y=null===(n=r.animateBG)||void 0===n||n;return'
\n \n \n \n \n \n \n \n \n \n \n \n \n ').concat(c,"
")}(br.getInstance().getFlowConfig()),'
'),document.body.appendChild(e);var n=e.querySelector(".gleap-frame-loader-image");if(n){var r=function(){var t=e.querySelector(".gleap-frame-loader-image-wrap");t&&t.classList.add("gleap-frame-loader-image-wrap--loaded")};n.complete&&n.naturalWidth>0?r():n.addEventListener("load",r)}t.gleapFrameContainer=e,t.gleapFrame=document.querySelector(".gleap-frame"),K(t.gleapFrame,t.frameUrl),t.updateFrameStyle(),"widget"===t.appMode&&t.showFrameContainer(!0)}))})))})),Us(this,"showImage",(function(e){se((function(){var t=document.createElement("div");t.className="gleap-image-view",t.setAttribute("tabindex","-1"),t.innerHTML='
\n \n
'),document.body.appendChild(t);var n=function(){document.removeEventListener("keydown",r,!0),t.remove()},r=function(e){"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),n())};document.addEventListener("keydown",r,!0),t.querySelector(".gleap-image-view-close").addEventListener("click",(function(){n()})),t.addEventListener("click",(function(e){e.target===t&&n()}));try{t.focus({preventScroll:!0})}catch(o){t.focus()}}))})),Us(this,"updateFrameStyle",(function(){if(t.gleapFrameContainer){for(var e="gleap-frame-container--survey",n="gleap-frame-container--extended",r="gleap-frame-container--survey-full",o="gleap-frame-container--classic",i="gleap-frame-container--classic-left",a="gleap-frame-container--modern-left",s="gleap-frame-container--no-button",c="gleap-frame-container--expanded",l=[o,i,c,n,a,s,e,r],u=0;u0&&void 0!==arguments[0]&&arguments[0];if(this.comReady){var t={expandable:this.canExpandWidget(),expanded:this.isWidgetExpanded()},n=this.lastWidgetSizeUpdate;!e&&n&&n.expandable===t.expandable&&n.expanded===t.expanded||(this.lastWidgetSizeUpdate=t,this.sendMessage({name:"widget-size-update",data:t}))}}},{key:"handleViewportResize",value:function(){this.isWidgetExpanded()!==this.appliedWidgetExpanded&&this.updateFrameStyle(),this.sendWidgetSizeUpdate()}},{key:"registerEscListener",value:function(){var e=this;this.escListener||(this.escListener=function(t){if("Escape"===(t=t||window.event).key){var n=document.querySelectorAll(".gleap-image-view");if(n.length>0)return void n[n.length-1].remove();e.hideWidget()}},document.addEventListener("keydown",this.escListener))}},{key:"unregisterEscListener",value:function(){this.escListener&&(document.removeEventListener("keydown",this.escListener),this.escListener=null)}},{key:"destroy",value:function(){this.gleapFrame&&this.gleapFrame.remove(),this.gleapFrameContainer&&this.gleapFrameContainer.remove(),this.injectedFrame=!1,this.widgetOpened=!1,this.markerManager=void 0,this.gleapFrameContainer=null,this.gleapFrame=null}},{key:"isOpened",value:function(){return this.widgetOpened||null!=this.markerManager}},{key:"showFrameContainer",value:function(e){var t,n=this;if(this.gleapFrameContainer){var r="gleap-frame-container--loading";null!==(t=this.gleapFrameContainer)&&void 0!==t&&t.classList&&(this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.gleapFrameContainer.classList.remove("gleap-frame-container--closing"),this.gleapFrameContainer.classList.remove("gleap-frame-container--hidden"),e?this.gleapFrameContainer.classList.add(r):this.gleapFrameContainer.classList.remove(r),setTimeout((function(){var e;null===(e=n.gleapFrameContainer)||void 0===e||e.classList.add("gleap-frame-container--animate")}),500)),this.widgetOpened=!0,this.updateUI()}}},{key:"runWidgetShouldOpenCallback",value:function(){this.gleapFrameContainer&&(this.workThroughQueue(),oh.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),this.showFrameContainer(!1),this.updateWidgetStatus(),Ft.notifyEvent("open"),this.registerEscListener())}},{key:"updateUI",value:function(){bl.getInstance().clearAllNotifications(this.isSurvey()),_.getInstance().updateNotificationBadge(0),_.getInstance().updateFeedbackButtonState()}},{key:"showWidget",value:function(){var t=this;setTimeout((function(){t.gleapFrameContainer?t.runWidgetShouldOpenCallback():e.getInstance().injectFrame(),t.updateUI()}),0)}},{key:"updateWidgetStatus",value:function(){this.sendMessage({name:"widget-status-update",data:{isWidgetOpen:this.widgetOpened}})}},{key:"hideMarkerManager",value:function(){this.markerManager&&(this.markerManager.clear(),this.markerManager=null)}},{key:"hideWidget",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("survey_web"!==this.appMode){if(this.hideMarkerManager(),this.gleapFrameContainer){var n=this.gleapFrameContainer;n.classList.remove("gleap-frame-container--animate"),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),n.classList.contains("gleap-frame-container--survey-full")?n.classList.add("gleap-frame-container--hidden"):(n.classList.add("gleap-frame-container--closing"),this.closeTimeout=setTimeout((function(){n.classList.add("gleap-frame-container--hidden"),n.classList.remove("gleap-frame-container--closing"),e.closeTimeout=null}),260))}t&&this.sendMessage({name:"reset-routes",data:{}}),this.widgetOpened=!1,this.updateWidgetStatus(),_.getInstance().updateFeedbackButtonState(),Ft.notifyEvent("close"),bl.getInstance().reloadNotificationsFromCache(),this.unregisterEscListener(),"undefined"!=typeof window&&void 0!==window.focus&&window.focus()}}},{key:"sendMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{this.gleapFrame=document.querySelector(".gleap-frame"),this.comReady&&this.gleapFrame&&this.gleapFrame.contentWindow?this.gleapFrame.contentWindow.postMessage(JSON.stringify(e),"*"):t&&this.queue.push(e)}catch(n){}}},{key:"sendSessionUpdate",value:function(){this.sendMessage({name:"session-update",data:{sessionData:vs.getInstance().getSession(),apiUrl:vs.getInstance().apiUrl,realtimeHost:vs.getInstance().realtimeHost,sdkKey:vs.getInstance().sdkKey}})}},{key:"sendConfigUpdate",value:function(){this.comReady&&(this.sendMessage({name:"config-update",data:{config:br.getInstance().getFlowConfig(),aiTools:Xt.getInstance().getAgentTools(),agentTools:Xt.getInstance().getAgentTools(),overrideLanguage:Vf.getInstance().getOverrideLanguage()}}),this.updateFrameStyle(),this.sendWidgetSizeUpdate(!0))}},{key:"showDrawingScreen",value:function(e){var t=this;this.hideWidget(),this.markerManager=new rc(e),this.markerManager.show((function(e){e||t.hideMarkerManager(),t.showWidget()}))}},{key:"workThroughQueue",value:function(){var e=Ds(this.queue);this.queue=[];for(var t=0;t0){Ft.notifyEvent("outbound-sent",{outboundId:v,outbound:m,formData:g});try{delete g.reportedBy}catch(n){}oh.trackEvent("outbound-".concat(v,"-submitted"),g)}})).catch((function(t){setTimeout((function(){e.sendingFeedback=!1,e.sendMessage({name:"feedback-sending-failed",data:"Something went wrong, please try again."}),Ft.notifyEvent("error-while-sending")}),1e3)}))}"start-screen-drawing"===t.name&&e.showDrawingScreen(t.data)})),window.addEventListener("message",(function(t){var n=Wn.getInstance(),r=n.bannerContainer?n.bannerContainer.querySelector(".gleap-b-frame"):null,o=e.gleapFrame&&t.source===e.gleapFrame.contentWindow,i=r&&t.source===r.contentWindow,a=t.origin===e.frameUrl,s=t.origin===n.bannerUrl;if(o||i||a||s)try{var c=JSON.parse(t.data);if("MODAL"===(null==c?void 0:c.type)||"BANNER"===(null==c?void 0:c.type)||"CHATBAR"===(null==c?void 0:c.type)||"AGENT_CONVERSATION"===(null==c?void 0:c.type))return;for(var l=0;l0&&(n.tags=r);try{e&&e.contentWindow&&e.contentWindow.postMessage(JSON.stringify({name:"collect-ticket-data",data:n}),"*")}catch(o){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Bs(t.prototype,n),r&&Bs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function qs(e){return qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qs(e)}function Ws(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Gs(this,"rerender",void 0),Gs(this,"svgElement",null),Gs(this,"path",null),Gs(this,"strPath",void 0),Gs(this,"strokeWidth",12),Gs(this,"strokeWidthRect",6),Gs(this,"bufferSize",4),Gs(this,"buffer",[]),Gs(this,"startPoint",null),Gs(this,"tool","rect"),Gs(this,"color","#EB144C"),Gs(this,"mouseDown",null),Gs(this,"mouseMove",null),Gs(this,"mouseUp",null),Gs(this,"resizeListener",null),Gs(this,"pathBuffer",[]);var o=this;this.rerender=t,this.svgElement=document.querySelector(".bb-capture-svg"),this.svgElement.style.minHeight="".concat(document.documentElement.scrollHeight,"px"),this.trackScroll=!!r,this.scrollListener=null,this.trackScroll&&(this.scrollListener=function(){o.svgElement.style.transform="translate(".concat(-window.scrollX,"px, ").concat(-window.scrollY,"px)"),o.svgElement.style.minWidth="".concat(document.documentElement.scrollWidth,"px")},this.scrollListener(),window.addEventListener("scroll",this.scrollListener,{passive:!0})),this.resizeListener=function(e){o.svgElement.style.minHeight="".concat(document.documentElement.scrollHeight,"px")},window.addEventListener("resize",this.resizeListener,!0),this.mouseDown=function(e){e.preventDefault();var t=document.querySelector(".bb-capture-toolbar-item-colorpicker");t&&(t.style.display="none"),o.fadeOutToolbar(),"pen"!==o.tool&&"blur"!==o.tool||o.mouseDownPen(e),"rect"===o.tool&&o.mouseDownRect(e)},this.mouseMove=function(e){e.preventDefault(),"pen"!==o.tool&&"blur"!==o.tool||o.mouseMovePen(e),"rect"===o.tool&&o.mouseMoveRect(e)},this.mouseUp=function(e){e.preventDefault(),o.fadeInToolbar(),"pen"!==o.tool&&"blur"!==o.tool||o.mouseUpPen(e),"rect"===o.tool&&o.mouseUpRect(e)},this.svgElement.addEventListener("mousedown",this.mouseDown),this.svgElement.addEventListener("mousemove",this.mouseMove),this.svgElement.addEventListener("mouseup",this.mouseUp),this.svgElement.addEventListener("touchstart",this.mouseDown,!1),this.svgElement.addEventListener("touchmove",this.mouseMove,!1),this.svgElement.addEventListener("touchend",this.mouseUp,!1),setTimeout((function(){n.rerender()}),100)}var t,n,r;return t=e,n=[{key:"clear",value:function(){if(this.svgElement)for(;this.svgElement.firstChild;)this.svgElement.firstChild.remove()}},{key:"destroy",value:function(){this.svgElement.removeEventListener("mousedown",this.mouseDown),this.svgElement.removeEventListener("mousemove",this.mouseMove),this.svgElement.removeEventListener("mouseup",this.mouseUp),this.svgElement.removeEventListener("touchstart",this.mouseDown),this.svgElement.removeEventListener("touchmove",this.mouseMove),this.svgElement.removeEventListener("touchend",this.mouseUp),window.removeEventListener("resize",this.resizeListener)}},{key:"destroyScrollTracker",value:function(){this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener),this.scrollListener=null)}},{key:"mouseUpPen",value:function(){this.path&&(this.path=null)}},{key:"mouseUpRect",value:function(){this.path&&(this.path=null)}},{key:"mouseMovePen",value:function(e){this.path&&(this.appendToBuffer(this.getMousePosition(e)),this.updateSvgPath())}},{key:"mouseMoveRect",value:function(e){if(this.path){var t=this.getMousePosition(e),n=Math.abs(t.x-this.startPoint.x),r=Math.abs(t.y-this.startPoint.y),o=t.x,i=t.y;t.x>this.startPoint.x&&(o=this.startPoint.x),t.y>this.startPoint.y&&(i=this.startPoint.y),this.path.setAttributeNS(null,"x",o),this.path.setAttributeNS(null,"y",i),this.path.setAttributeNS(null,"width",n),this.path.setAttributeNS(null,"height",r)}}},{key:"mouseDownRect",value:function(e){this.path=document.createElementNS("http://www.w3.org/2000/svg","rect"),this.path.setAttribute("fill","none"),this.path.setAttribute("stroke",this.color),this.path.setAttribute("stroke-linecap","round"),this.path.setAttribute("stroke-width",this.strokeWidthRect),this.startPoint=this.getMousePosition(e),this.appendPathToSvg(this.path)}},{key:"mouseDownPen",value:function(e){var t=this.color+"AA",n=this.strokeWidth;"blur"===this.tool&&(t="#000000",n=40),this.path=document.createElementNS("http://www.w3.org/2000/svg","path"),this.path.setAttribute("fill","none"),this.path.setAttribute("stroke",t),this.path.setAttribute("stroke-linecap","round"),this.path.setAttribute("stroke-width",n),this.buffer=[];var r=this.getMousePosition(e);this.appendToBuffer(r),this.strPath="M"+r.x+" "+r.y,this.path.setAttribute("d",this.strPath),this.appendPathToSvg(this.path)}},{key:"setTool",value:function(e){this.tool=e}},{key:"setColor",value:function(e){this.color=e}},{key:"getMousePosition",value:function(e){var t=this.trackScroll?window.scrollX:0,n=this.trackScroll?window.scrollY:0;return e.touches&&e.touches.length>0?{x:e.touches[0].clientX+t,y:e.touches[0].clientY+n}:{x:e.clientX+t,y:e.clientY+n}}},{key:"getAveragePoint",value:function(e){var t=this.buffer.length;if(t%2==1||t>=this.bufferSize){var n,r,o=0,i=0,a=0;for(r=e;rthis.bufferSize;)this.buffer.shift()}},{key:"appendPathToSvg",value:function(e){this.svgElement.appendChild(e),this.pathBuffer.push(e),this.rerender()}},{key:"removeLastAddedPathFromSvg",value:function(){this.pathBuffer.length<=0||!this.svgElement||(this.svgElement.removeChild(this.pathBuffer[this.pathBuffer.length-1]),this.pathBuffer.pop(),this.rerender())}},{key:"fadeOutToolbar",value:function(){var e=document.querySelector(".bb-capture-toolbar");e&&(e.style.opacity=0,e.style.pointerEvents="none")}},{key:"fadeInToolbar",value:function(){var e=document.querySelector(".bb-capture-toolbar");e&&(e.style.opacity=1,e.style.pointerEvents="auto")}}],n&&Ws(t.prototype,n),r&&Ws(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Js(e){return Js="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Js(e)}function Ks(e,t){for(var n=0;n\n \n
'.concat(fe("dismiss"),"
\n
").concat(fe("rect"),'
\n
\n
\n ').concat(fe("drag"),"\n
\n ").concat("capture"===this.type?'
\n '.concat(fe("recorderon"),"\n ").concat(fe("recorderoff"),'\n \n
\n
\n ').concat(fe("mic"),'\n \n
\n
2:00
\n
\n
\n ').concat(fe("pointer"),"\n
"):"",'\n
\n ').concat(fe("rect"),'\n
\n
\n ').concat(fe("pen"),'\n
\n
\n ').concat(fe("blur"),'\n
\n
\n
\n ').concat(Vf.translateText("pickAColor"),'\n
\n
\n ').concat(fe("undo"),'\n ').concat(Vf.translateText("undo"),"\n
\n ").concat("capture"!==this.type?'
'.concat(Vf.translateText("next"),"
"):"",'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
').concat(Vf.translateText("retry"),'
\n
').concat(Vf.translateText("next"),"
\n
\n
\n
\n "),document.body.appendChild(e),e.setAttribute("dir",Vf.getInstance().isRTLLayout?"rtl":"ltr")}},{key:"unregisterListeners",value:function(){this.escListener&&document.removeEventListener("keydown",this.escListener),this.pageLeaveListener&&window.removeEventListener("beforeunload",this.pageLeaveListener)}},{key:"registerListeners",value:function(){var e=this;this.escListener=function(t){var n=!1,r=!1;"key"in(t=t||window.event)&&(n="Escape"===t.key,r="Enter"===t.key),n&&e.dismiss(),"screenshot"===e.type&&r&&e.showNextStep()},document.addEventListener("keydown",this.escListener),this.pageLeaveListener=function(e){e.preventDefault(),e.returnValue=""},window.addEventListener("beforeunload",this.pageLeaveListener)}},{key:"show",value:function(e){this.callback=e,this.registerListeners(),this.hideWidgetUI(),this.createEditorUI(),this.setupMousePointer(),"screenshot"===this.type?(oh.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),Zs.disableScroll()):this.setupScreenRecording(),this.screenDrawer=new Xs(this.captureScreenDrawerRerender.bind(this),"screenshot"===this.type),this.setupColorPicker(),this.setupToolbar()}},{key:"setupColorPicker",value:function(){for(var t=this,n=document.querySelector(".bb-capture-toolbar-item-selectedcolor"),r=document.querySelectorAll(".bb-capture-toolbar-item-color"),o=document.querySelector(".bb-capture-toolbar-item-colorpicker"),i=function(){var i=r[a],s=i.getAttribute("data-color");i.style.backgroundColor=s,i.onclick=function(){i&&(t.screenDrawer.setColor(s),o&&(o.style.display="none"),n.style.backgroundColor=i.style.backgroundColor,e.setPenColor(s))}},a=0;a0?r.classList.remove(e):r.classList.add(e))}}},{key:"captureRenderer",value:function(){if(this.screenRecorder){this.screenRecorder.file&&oh.getInstance().setGlobalDataItem("screenRecordingData",this.screenRecorder.file);var e="bb-capture-editor-item-inactive",t=document.querySelector(".bb-capture-toolbar-item-timer"),n=document.querySelectorAll(".bb-capture-toolbar-item"),r=document.querySelector(".bb-tooltip-screen-recording"),o=document.querySelector(".bb-tooltip-audio-recording"),i=document.querySelector(".bb-capture-editor"),a="bb-capture-editor-recording",s="bb-capture-editor-notrecording";this.screenRecorder.isRecording?(i.classList.add(a),i.classList.remove(s)):(i.classList.add(s),i.classList.remove(a));var c=document.querySelector(".bb-capture-toolbar");document.querySelector(".bb-capture-preview").style.display=this.screenRecorder.file?"flex":"none",c.style.display=this.screenRecorder.file?"none":"flex";for(var l=0;l0&&-1===t.indexOf(r)&&t.push(r)}return t},Sc=function(e,t){if("string"!=typeof e||!Array.isArray(t))return!1;for(var n=0;n0&&-1!==e.indexOf(r))return!0}return!1},Cc=function(e,t){return"string"==typeof t&&-1!==e.props.indexOf(t.toLowerCase())},Ic=function(e,t){for(var n={},r=!1,o=Object.keys(e),i=0;i0&&Cc(t,c)?o=!0:r.push(a)}return o?r.join("&"):e},Ac=function(e){if(e>500)throw new Error("Network log body is nested too deeply to redact.")},Mc=function e(t,n,r){Ac(r);var o=!1;if(Array.isArray(t)){for(var i=0;i0&&-1===n.indexOf(i)&&n.push(i)}for(var a=Nc.exec(e),s=a?e.slice(0,a.index):e,c=s,l=0;l0?"?"+a:"")+(-1===n?"":e.slice(n))}(n.url,t)),n.request&&"object"===mc(n.request)&&!Array.isArray(n.request)){var r=Object.assign({},n.request),o=Tc(r.headers,"content-type");void 0!==r.headers&&(r.headers=Ec(r.headers,t)),void 0!==r.payload&&(r.payload=jc(r.payload,o,t)),n.request=r}if(n.response&&"object"===mc(n.response)&&!Array.isArray(n.response)){var i=Object.assign({},n.response),a=Tc(i.headers,"content-type");void 0!==i.headers&&(i.headers=Ec(i.headers,t)),void 0!==i.responseText&&(i.responseText=jc(i.responseText,a,t)),n.response=i}return n},Fc=function(e,t){var n=[];if(!Array.isArray(e))return n;for(var r=function(e){for(var t=xc(e).map((function(e){return e.toLowerCase()})),n=[],r=0;r0}))&&n.push(o)}return{props:t,paths:n}}(t&&t.propsToIgnore),o=xc(vc.concat(t&&t.blacklist||[])),i=0;i=55296&&n<=56319&&(t-=1),e.slice(0,t)+Zc(e.length<=1e6?function(e){for(var t=0,n=0;n=55296&&r<=56319&&n+1=56320&&o<=57343?(t+=4,n++):t+=3}else t+=3}return t}(e):void 0)},el=function(e,t){for(var n=t.toLowerCase(),r=Object.keys(e),o=0;o=2&&tl(t,String(e[n][0]),String(e[n][1]));else for(var r=Object.keys(e),o=0;o0&&tl(t,n[r].slice(0,o).trim(),n[r].slice(o+1).trim())}return t},il=function(e){var t=String(e);try{var n="undefined"!=typeof document&&document.baseURI?document.baseURI:"undefined"!=typeof window&&window.location?window.location.href:void 0;return new URL(t,n).href}catch(r){return t}},al=function(e,t,n,r){var o,i=e.byteLength>qc||"number"==typeof r&&r>qc,a=e.byteLength>qc?e.subarray(0,qc):e;try{if(n){if(-1!==(o=new TextDecoder("utf-8",{fatal:!0}).decode(a,{stream:i})).indexOf("\0"))return Gc}else o=function(e){var t=/charset\s*=\s*"?([^";\s]+)/i.exec(e||"");if(t)try{return new TextDecoder(t[1])}catch(n){}return new TextDecoder("utf-8")}(t).decode(a,{stream:i})}catch(s){return n?Gc:bc}return i?o+Zc("number"==typeof r?r:void 0):o},sl=function(e,t,n){var r=e.getReader(),o=[],i=0,a=function(e){for(var r=new Uint8Array(i),a=0,s=0;s0&&(o.push(n instanceof Uint8Array?n:new Uint8Array(n)),i+=n.byteLength),i>qc){try{r.cancel().catch((function(){}))}catch(s){}return a(!1)}return e()}))}()},cl=function(e,t,n){var r=e.size>qc?e.slice(0,150001):e;return("function"==typeof r.arrayBuffer?r.arrayBuffer():new Promise((function(e,t){var n=new FileReader;n.onload=function(){return e(n.result)},n.onerror=function(){return t(n.error)},n.readAsArrayBuffer(r)}))).then((function(r){return al(new Uint8Array(r),t,n,e.size)}))},ll=function(e,t){if(null==e)return{text:""};try{var n=Kc(t);if("stream"===n)return{text:Vc};if("string"==typeof e)return{text:"binary"===n?Gc:Qc(e)};var r=function(e){return Object.prototype.toString.call(e)}(e);if("[object URLSearchParams]"===r)return{text:Qc(e.toString())};if("[object FormData]"===r)return{text:(s=e,c={},s.forEach((function(e,t){var n;n="string"==typeof e?e.length>1e4?e.slice(0,1e4)+"… [truncated]":e:"[file "+(e&&e.name?e.name:"blob")+", "+(e&&"number"==typeof e.size?e.size:0)+" bytes"+(e&&e.type?", "+e.type:"")+"]",Object.prototype.hasOwnProperty.call(c,t)?c[t]=[].concat(c[t],n):Object.defineProperty(c,t,{value:n,enumerable:!0,writable:!0,configurable:!0})})),Qc(JSON.stringify(c)))};if("[object ReadableStream]"===r)return{text:Vc};if("[object Blob]"===r||"[object File]"===r){var o=t||e.type||"",i=Kc(o);return"stream"===i?{text:Vc}:"binary"===i?{text:Gc}:{text:Wc,promise:cl(e,o,"unknown"===i)}}if("[object ArrayBuffer]"===r||"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)){if("binary"===n)return{text:Gc};var a="[object ArrayBuffer]"===r?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{text:al(a,t,"unknown"===n,a.byteLength)}}return"[object Document]"===r||"[object HTMLDocument]"===r||"[object XMLDocument]"===r?{text:bc}:{text:"binary"===n?Gc:Qc(String(e))}}catch(l){return{text:bc}}var s,c},ul=function(e,t,n){e[t]=n.text,n.promise&&n.promise.then((function(n){e[t]=n}),(function(){e[t]=bc}))},dl=function(e){try{if(e&&"object"===zc(e)){var t=e.name?String(e.name):"Error",n=e.message?String(e.message):"";return n?t+": "+n:t}return String(e)}catch(r){return"Error"}},pl=function(e,t){return"abort"===e?"AbortError: The request was aborted.":"timeout"===e?"TimeoutError: The request timed out"+(t.timeout?" after "+t.timeout+" ms.":"."):"string"==typeof e&&-1!==e.indexOf(":")?e:"NetworkError: The request failed."},fl=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Uc(this,"requestId",0),Uc(this,"requests",{}),Uc(this,"externalRequests",[]),Uc(this,"maxRequests",30),Uc(this,"localFilters",[]),Uc(this,"remoteFilters",[]),Uc(this,"localBlacklist",[]),Uc(this,"remoteBlacklist",[]),Uc(this,"initialized",!1),Uc(this,"stopped",!1),Uc(this,"loadAllResources",!1)}var t,n,r;return t=e,n=[{key:"setLoadAllResources",value:function(e){this.loadAllResources=e}},{key:"setExternalRequests",value:function(e){var t=[];if(Array.isArray(e))for(var n=0;n0?e.timeOrigin:e.timing&&e.timing.navigationStart>0?e.timing.navigationStart:Date.now()-e.now()}(window.performance),s=window.performance.getEntriesByType("resource"),c=0;cthis.maxRequests?t.slice(t.length-this.maxRequests):t}},{key:"setMaxRequests",value:function(e){e>70&&(e=70),this.maxRequests=e}},{key:"setStopped",value:function(e){this.stopped=e}},{key:"setFilters",value:function(e){this.localFilters=xc(e)}},{key:"setRemoteFilters",value:function(e){this.remoteFilters=xc(e)}},{key:"setBlacklist",value:function(e){this.localBlacklist=xc(e)}},{key:"setRemoteBlacklist",value:function(e){this.remoteBlacklist=xc(e)}},{key:"getFilters",value:function(){return xc(this.remoteFilters.concat(this.localFilters))}},{key:"getBlacklist",value:function(){return xc(vc.concat(this.remoteBlacklist,this.localBlacklist))}},{key:"isCapturing",value:function(){return this.initialized&&!this.stopped}},{key:"cleanRequests",value:function(){var e=Object.keys(this.requests);if(e.length>this.maxRequests)for(var t=e.slice(0,e.length-this.maxRequests),n=0;n=0&&l<=qc)return void c.text().then((function(e){return i(Qc(e))}),(function(){return i(bc)}));i(bc)}catch(u){i(bc)}}},{key:"failFetch",value:function(e,t){var n=e.request;n.duration=Yc(e.start),n.success=!1,n.response={errorText:dl(t)}}},{key:"interceptXhr",value:function(){if("undefined"!=typeof XMLHttpRequest&&"undefined"!=typeof WeakMap){var e=this,t=new WeakMap,n=XMLHttpRequest.prototype,r=n.open,o=n.send,i=n.setRequestHeader;n.open=function(n,o){try{e.onXhrOpen(t,this,n,o)}catch(i){}return r.apply(this,arguments)},n.setRequestHeader=function(e,n){try{var r=t.get(this);r&&r.capture&&!r.request&&tl(r.headers,String(e),String(n))}catch(o){}return i.apply(this,arguments)},n.send=function(n){var r=!1;try{r=e.onXhrSend(t,this,n)}catch(i){}try{return o.apply(this,arguments)}catch(a){if(r)try{e.finishXhr(this,t.get(this),dl(a))}catch(i){}throw a}}}}},{key:"onXhrOpen",value:function(e,t,n,r){var o=e.get(t);if(o||(o={listening:!1},e.set(t,o)),o.request&&!o.finished){var i=4===t.readyState?void 0:"AbortError: The request was replaced by a new one.";this.finishXhr(t,o,i)}o.request=null,o.finished=!1,o.failure=null,o.headersAt=null,o.method=String(n||"GET").toUpperCase(),o.url=il(r),o.headers={},o.capture=this.isCapturing()&&!Sc(o.url,this.getBlacklist()),o.capture&&!o.listening&&(o.listening=!0,this.listenToXhr(t,o))}},{key:"listenToXhr",value:function(e,t){var n=this,r=function(n){return function(){4===e.readyState&&(t.failure=n)}};e.addEventListener("readystatechange",(function(){try{2===e.readyState&&t.request&&!t.finished&&n.recordXhrHeaders(e,t)}catch(r){}})),e.addEventListener("error",r("error")),e.addEventListener("abort",r("abort")),e.addEventListener("timeout",r("timeout")),e.addEventListener("loadend",(function(){try{4===e.readyState&&n.finishXhr(e,t)}catch(r){}}))}},{key:"onXhrSend",value:function(e,t,n){var r=e.get(t);if(!r||!r.capture||r.request||!this.isCapturing())return!1;var o=$c(),i=this.createRequest(r.method,r.url);if(!i)return r.capture=!1,!1;i.request.headers=Object.assign({},r.headers);var a="GET"!==r.method&&"HEAD"!==r.method;return ul(i.request,"payload",a?ll(n,nl(r.headers,"content-type")):{text:""}),r.request=i,r.start=o,!0}},{key:"recordXhrHeaders",value:function(e,t){t.headersAt=$c();var n=t.request;n.duration=Math.max(0,Math.round(t.headersAt-t.start)),n.success=!0,n.response={status:e.status,statusText:e.statusText||"",headers:ol(e.getAllResponseHeaders()),responseText:Wc}}},{key:"finishXhr",value:function(e,t,n){if(t&&t.request&&!t.finished){t.finished=!0;var r=t.request,o=n||t.failure||(0===e.status?"error":null);if(o)return r.duration=Yc(t.start),r.success=!1,void(r.response={errorText:pl(o,e)});r.duration=t.headersAt?Math.max(0,Math.round(t.headersAt-t.start)):Yc(t.start),r.success=!0;var i,a=ol(e.getAllResponseHeaders());try{i=function(e,t){var n=Kc(nl(t,"content-type"));if("stream"===n)return Vc;var r=e.responseType;if(""===r||"text"===r){if("binary"===n)return Gc;var o=e.responseText;return"string"!=typeof o?"":"unknown"===n&&-1!==o.slice(0,qc).indexOf("\0")?Gc:Qc(o)}if("json"===r){if(null===e.response||void 0===e.response)return"";var i=Rr(e.response,qc);return i.truncated?i.text+Zc():i.text}return"document"===r?bc:Gc}(e,a)}catch(s){i=bc}r.response={status:e.status,statusText:e.statusText||"",headers:a,responseText:i}}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Bc(t.prototype,n),r&&Bc(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Uc(fl,"instance",void 0);const hl=fl;function gl(e){return gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gl(e)}function ml(e,t){for(var n=0;n0){var t=e.filter((function(e){var t;return"chatbar"!==(null==e||null===(t=e.data)||void 0===t?void 0:t.lastSource)&&new Date(e.createdAt)>new Date(Date.now()-36e5)}));this.notifications=t.slice(-4),this.renderNotifications()}}catch(n){}}},{key:"notificationPassesPageRules",value:function(e){try{var t="undefined"!=typeof window&&window.location?window.location.href:void 0;return!t||rs(t,e)}catch(n){return!0}}},{key:"getVisibleNotifications",value:function(){var e=this;return this.notifications.filter((function(t){return e.notificationPassesPageRules(t)}))}},{key:"checkPageRulesForUrl",value:function(e){e&&e!==this.lastPageRulesUrl&&(this.lastPageRulesUrl=e,this.notifications.some((function(e){var t;return(null==e||null===(t=e.pageRules)||void 0===t?void 0:t.length)>0||(null==e?void 0:e.pageFilter)}))&&this.renderNotifications())}},{key:"setNotificationCount",value:function(e){this.unreadCount=e,this.updateTabBarNotificationCount(),_.getInstance().updateNotificationBadge(this.unreadCount)}},{key:"showNotification",value:function(e){if(this.notificationContainer&&e&&e.data){try{var t,n,r=null==e||null===(t=e.data)||void 0===t?void 0:t.lastSource,o=Pn.getInstance(),i=(null==o||null===(n=o.config)||void 0===n?void 0:n.enabled)||(null==o?void 0:o.manuallyShown)||o&&!o.isHidden;if("chatbar"===r&&i)return void o.showChatbarNotification(e.data)}catch(a){}for(this.notifications.find((function(t){return e.outbound===t.outbound}))||(this.notifications.push(e),e.sound&&this.notificationPassesPageRules(e)&&Dn.ping());this.notifications.length>4;)this.notifications.shift();ae(this.unreadNotificationsKey,this.notifications),this.renderNotifications()}}},{key:"renderNotifications",value:function(){var e=this;if(this.notificationContainer){this.clearAllNotifications(!0);var t=document.createElement("div");t.onclick=function(){e.clearAllNotifications(),e.currentNewsIndex=0},t.className="gleap-notification-close",t.innerHTML=fe("dismiss"),this.notificationContainer.appendChild(t);var n=this.getVisibleNotifications(),r=n.filter((function(e){return e.data.news})).sort((function(e,t){return new Date(e.createdAt)-new Date(t.createdAt)})),o=n.filter((function(e){return!e.data.news}));if(r.length>0){var i=this.currentNewsIndex1){var g=document.createElement("div");g.className="gleap-news-pagination";var m=document.createElement("span");m.className="gleap-news-page-indicator",m.innerText="".concat(i+1," / ").concat(r.length),g.appendChild(m);var v=document.createElement("button");v.className="gleap-news-next-button",i\n
\n
\n
\n
\n \n \n \n ').concat(t.data.nextStepTitle,"\n
\n \n ")}else r.className="gleap-notification-item gleap-notification-card",r.innerHTML='\n
\n '.concat(e.renderAvatar(t.data.sender,"gleap-notification-item-avatar"),'\n
\n
').concat(n,"
\n ").concat(e.renderMeta(t),"\n
\n
");e.notificationContainer.appendChild(r)},b=0;b0||o.length>0||this.clearAllNotifications(!0);var w=(r.length>0?1:0)+o.length;this.notificationContainer.classList&&(this.notificationContainer.classList.toggle("gleap-notification-container--stack",w>1),this.notificationContainer.classList.remove("gleap-notification-container--expanded")),this.updateStackLayout()}}},{key:"updateStackLayout",value:function(){try{this.stackResizeObserver&&(this.stackResizeObserver.disconnect(),this.stackResizeObserver=null);var e=this.notificationContainer;if(!e||!e.classList||!e.classList.contains("gleap-notification-container--stack")||"function"!=typeof e.querySelectorAll)return;var t=Array.prototype.slice.call(e.querySelectorAll(".gleap-notification-card"));if(t.length<2)return;var n=function(){try{for(var n=t.map((function(e){return e.offsetHeight||0})),r=n[n.length-1],o=0,i=0,a=t.length-1;a>=0;a--){var s=t.length-1-a,c=0===s?0:1===s?9:17;t[a].style.setProperty("--gleap-nstack-collapse","".concat(n[a]-r-c,"px")),t[a].style.setProperty("--gleap-nstack-expand","".concat(-i,"px"));var l=n[a]-(r-12);t[a].style.setProperty("--gleap-nstack-clip",s>0&&l>0?"".concat(l,"px"):"-40px"),i+=n[a],o+=n[a]}e.style.setProperty("--gleap-nstack-h-collapsed","".concat(r+17,"px")),e.style.setProperty("--gleap-nstack-h-expanded","".concat(o,"px"))}catch(u){}};if(n(),"undefined"!=typeof ResizeObserver){this.stackResizeObserver=new ResizeObserver(n);for(var r=0;r')}},{key:"renderMeta",value:function(e){var t=e.data.sender,n=[];t&&t.name&&n.push(''.concat(t.name,""));var r=function(e,t){try{if(!e||"undefined"==typeof Intl||"function"!=typeof Intl.RelativeTimeFormat)return"";var n,r=new Date(e).getTime();if(isNaN(r))return"";try{n=new Intl.RelativeTimeFormat(t||void 0,{numeric:"auto"})}catch(c){n=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"})}var o=Math.min(0,(r-Date.now())/1e3);if(o>-60)return n.format(0,"second");for(var i=o/60,a=0;a'.concat(r,"")),0===n.length?"":'
'.concat(n.join('•'),"
")}},{key:"renderDescription",value:function(e){var t=e.data,n=t.previewText,r=t.sender;return n&&n.length>0?n:r?'\n
\n '.concat(this.renderAvatar(r,"gleap-notification-item-news-sender-avatar"),"\n ").concat(r.name,"\n
\n "):""}},{key:"clearNotificationsForConversation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)try{var n=function(t){var n;return(null==t||null===(n=t.data)||void 0===n||null===(n=n.conversation)||void 0===n?void 0:n.shareToken)===e},r=ie(this.unreadNotificationsKey);r&&r.length>0&&ae(this.unreadNotificationsKey,r.filter((function(e){return!n(e)})));var o,i=this.notifications.length;this.notifications=this.notifications.filter((function(e){return!n(e)})),this.notifications.length!==i&&this.renderNotifications(),t||jf.getInstance().sendMessage({type:"conversation-notifications-cleared",shareToken:e,gleapId:null===(o=vs.getInstance().session)||void 0===o?void 0:o.gleapId})}catch(a){}}},{key:"clearAllNotifications",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.notificationContainer){for(e||(this.notifications=[],this.currentNewsIndex=0,ae(this.unreadNotificationsKey,this.notifications));this.notificationContainer.firstChild;)this.notificationContainer.removeChild(this.notificationContainer.firstChild);if(!e&&!t)try{var n;jf.getInstance().sendMessage({type:"notifications-cleared",gleapId:null===(n=vs.getInstance().session)||void 0===n?void 0:n.gleapId})}catch(r){}}}},{key:"updateContainerStyle",value:function(){if(this.notificationContainer){var e=br.getInstance().getFlowConfig(),t="gleap-notification-container--left",n="gleap-notification-container--no-button";this.notificationContainer.classList.remove(t),this.notificationContainer.classList.remove(n),e.feedbackButtonPosition!==_.FEEDBACK_BUTTON_CLASSIC_LEFT&&e.feedbackButtonPosition!==_.FEEDBACK_BUTTON_BOTTOM_LEFT||this.notificationContainer.classList.add(t),null===_.getInstance().buttonHidden?e.feedbackButtonPosition===_.FEEDBACK_BUTTON_NONE&&this.notificationContainer.classList.add(n):_.getInstance().buttonHidden&&this.notificationContainer.classList.add(n),this.notificationContainer.setAttribute("dir",Vf.getInstance().isRTLLayout?"rtl":"ltr")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&ml(t.prototype,n),r&&ml(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function wl(e){return wl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wl(e)}function kl(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{})}function n(t){return t?e[t]:e}function r(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}function o(e){var t='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return e.flatMap((function(e){var n=e.matches(t),r=Array.from(e.querySelectorAll(t));return[].concat(El(n?[e]:[]),r)})).filter((function(e){return"none"!==getComputedStyle(e).pointerEvents&&function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}(e)}))}function i(e){if(e&&!function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}(e)){var t=n("smoothScroll");e.scrollIntoView({behavior:!t||a(e)?"auto":"smooth",inline:"center",block:"center"})}}function a(e){if(e&&e.parentElement){var t=e.parentElement;return t.scrollHeight>t.clientHeight}}var s={};function c(e,t){s[e]=t}function l(e){return e?s[e]:s}function u(){s={}}var d={};function p(e,t){d[e]=t}function f(e){var t;null==(t=d[e])||t.call(d)}function h(e){if(e){var t=e.getBoundingClientRect(),n={x:t.x,y:t.y,width:t.width,height:t.height};c("__activeStagePosition",n),m(n)}}function g(e){var t=function(e){var t=window.innerWidth,r=window.innerHeight,o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.classList.add("gleap-tour-overlay","gleap-tour-overlay-animated"),o.setAttribute("viewBox","0 0 ".concat(t," ").concat(r)),o.setAttribute("xmlSpace","preserve"),o.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),o.setAttribute("version","1.1"),o.setAttribute("preserveAspectRatio","xMinYMin slice"),o.style.fillRule="evenodd",o.style.clipRule="evenodd",o.style.strokeLinejoin="round",o.style.strokeMiterlimit="2",o.style.zIndex="10000",o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="100%",o.style.height="100%";var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",v(e)),i.style.fill=n("overlayColor")||"rgb(0,0,0)",i.style.opacity="".concat(n("overlayOpacity")),i.style.pointerEvents="auto",i.style.cursor="auto",o.appendChild(i),o}(e);document.body.appendChild(t),S(t,(function(e){"path"===e.target.tagName&&f("overlayClick")})),c("__overlaySvg",t)}function m(e){var t=l("__overlaySvg");if(t){var n=t.firstElementChild;if("path"!==(null==n?void 0:n.tagName))throw new Error("no path element found in stage svg");n.setAttribute("d",v(e))}else g(e)}function v(e){var t=window.innerWidth,r=window.innerHeight,o=n("stagePadding")||0,i=n("stageRadius")||0,a=e.width+2*o,s=e.height+2*o,c=Math.min(i,a/2,s/2),l=Math.floor(Math.max(c,0)),u=e.x-o+l,d=e.y-o,p=a-2*l,f=s-2*l;return"M".concat(t,",0L0,0L0,").concat(r,"L").concat(t,",").concat(r,"L").concat(t,",0Z\n M").concat(u,",").concat(d," h").concat(p," a").concat(l,",").concat(l," 0 0 1 ").concat(l,",").concat(l," v").concat(f," a").concat(l,",").concat(l," 0 0 1 -").concat(l,",").concat(l," h-").concat(p," a").concat(l,",").concat(l," 0 0 1 -").concat(l,",-").concat(l," v-").concat(f," a").concat(l,",").concat(l," 0 0 1 ").concat(l,",-").concat(l," z")}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,o=e.element,a=o;if("string"==typeof a)try{a=document.querySelector(o)}catch(u){var s=o.replace(/(#[^#\s]+)/g,(function(e){return e.replace(/:/g,"\\:")}));a=document.querySelector(s)}if(o&&!a&&t>=0)setTimeout((function(){C(),y(e,t-100)}),100);else{if(!a){if(e.element){try{console.warn("[Gleap] Product tour selector did not match:",e.element)}catch(d){}return n("onElementNotFound")(e)}a=function(){var e=document.getElementById("gleap-tour-dummy-element");if(e)return e;var t=document.createElement("div");return t.id="gleap-tour-dummy-element",t.style.width="0",t.style.height="0",t.style.pointerEvents="none",t.style.opacity="0",t.style.position="fixed",t.style.top="50%",t.style.left="50%",document.body.appendChild(t),t}()}!function(e,t){var o,a,s=400,u=Date.now(),d=l("__activeStep"),p=l("__activeElement")||e,f=!p||p===e,g="gleap-tour-dummy-element"===e.id,v="gleap-tour-dummy-element"===p.id,y=n("animate"),b=t.onHighlightStarted||n("onHighlightStarted"),w=(null==t?void 0:t.onHighlighted)||n("onHighlighted"),k=(null==d?void 0:d.onDeselected)||n("onDeselected"),x=n(),S=l();!f&&k&&k(v?void 0:p,d,{config:x,state:S});b&&b(g?void 0:e,t,{config:x,state:S});var E=!f&&y,T=!1;C(),c("previousStep",d),c("previousElement",p),c("activeStep",t),c("activeElement",e);var L=function o(){if(l("__transitionCallback")===o){var i=Date.now()-u,a=s-i<=s/2;t.popover&&a&&!T&&E&&(I(e,t),T=!0),n("animate")&&i0&&R[0].focus()}function E(){var e=l("popover");if(null==e?void 0:e.wrapper){var t=e.wrapper.getBoundingClientRect(),r=n("stagePadding")||0,o=n("popoverOffset")||0;return{width:t.width+r+o,height:t.height+r+o,realWidth:t.width,realHeight:t.height}}}function T(e,t){var n=t.elementDimensions,r=t.popoverDimensions,o=t.popoverPadding,i=t.popoverArrowDimensions;return"start"===e?Math.max(Math.min(n.top-o,window.innerHeight-r.realHeight-i.width),i.width):"end"===e?Math.max(Math.min(n.top-(null==r?void 0:r.realHeight)+n.height+o,window.innerHeight-(null==r?void 0:r.realHeight)-i.width),i.width):"center"===e?Math.max(Math.min(n.top+n.height/2-(null==r?void 0:r.realHeight)/2,window.innerHeight-(null==r?void 0:r.realHeight)-i.width),i.width):0}function L(e,t){var n=t.elementDimensions,r=t.popoverDimensions,o=t.popoverPadding,i=t.popoverArrowDimensions;return"start"===e?Math.max(Math.min(n.left-o,window.innerWidth-r.realWidth-i.width),i.width):"end"===e?Math.max(Math.min(n.left-(null==r?void 0:r.realWidth)+n.width+o,window.innerWidth-(null==r?void 0:r.realWidth)-i.width),i.width):"center"===e?Math.max(Math.min(n.left+n.width/2-(null==r?void 0:r.realWidth)/2,window.innerWidth-(null==r?void 0:r.realWidth)-i.width),i.width):0}function O(e,t){var r=l("popover");if(r){var o=(null==t?void 0:t.popover)||{},i=o.align,a=void 0===i?"start":i,s=o.side,c=void 0===s?"left":s,u=a,d="gleap-tour-dummy-element"===e.id?"over":c,p=n("stagePadding")||0,f=E(),h=r.arrow.getBoundingClientRect(),g=e.getBoundingClientRect(),m=g.top-f.height,v=m>=0,y=window.innerHeight-(g.bottom+f.height),b=y>=0,w=g.left-f.width,k=w>=0,x=window.innerWidth-(g.right+f.width),S=x>=0,C=!(v||b||k||S),I=d;if("top"===d&&v?S=k=b=!1:"bottom"===d&&b?S=k=v=!1:"left"===d&&k?S=v=b=!1:"right"===d&&S&&(k=v=b=!1),"over"===d){var O=window.innerWidth/2-f.realWidth/2,A=window.innerHeight/2-f.realHeight/2;r.wrapper.style.left="".concat(O,"px"),r.wrapper.style.right="auto",r.wrapper.style.top="".concat(A,"px"),r.wrapper.style.bottom="auto"}else if(C){var M=window.innerWidth/2-(null==f?void 0:f.realWidth)/2;r.wrapper.style.left="".concat(M,"px"),r.wrapper.style.right="auto",r.wrapper.style.bottom="".concat(10,"px"),r.wrapper.style.top="auto"}else if(k){var P=Math.min(w,window.innerWidth-(null==f?void 0:f.realWidth)-h.width),R=T(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.left="".concat(P,"px"),r.wrapper.style.top="".concat(R,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",I="left"}else if(S){var N=Math.min(x,window.innerWidth-(null==f?void 0:f.realWidth)-h.width),_=T(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.right="".concat(N,"px"),r.wrapper.style.top="".concat(_,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.left="auto",I="right"}else if(v){var j=Math.min(m,window.innerHeight-f.realHeight-h.width),D=L(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.top="".concat(j,"px"),r.wrapper.style.left="".concat(D,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",I="top"}else if(b){var F=Math.min(y,window.innerHeight-(null==f?void 0:f.realHeight)-h.width),B=L(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.left="".concat(B,"px"),r.wrapper.style.bottom="".concat(F,"px"),r.wrapper.style.top="auto",r.wrapper.style.right="auto",I="bottom"}C?r.arrow.classList.add("gleap-tour-popover-arrow-none"):function(e,t,n){var r=l("popover");if(!r)return;var o=n.getBoundingClientRect(),i=E(),a=r.arrow,s=i.width,c=window.innerWidth,u=o.width,d=o.left,p=i.height,f=window.innerHeight,h=o.top,g=o.height;a.className="gleap-tour-popover-arrow";var m=t,v=e;"top"===t?(d+u<=0?(m="right",v="end"):d+u-s<=0&&(m="top",v="start"),d>=c?(m="left",v="end"):d+s>=c&&(m="top",v="end")):"bottom"===t?(d+u<=0?(m="right",v="start"):d+u-s<=0&&(m="bottom",v="start"),d>=c?(m="left",v="start"):d+s>=c&&(m="bottom",v="end")):"left"===t?(h+g<=0?(m="bottom",v="end"):h+g-p<=0&&(m="left",v="start"),h>=f?(m="top",v="end"):h+p>=f&&(m="left",v="end")):"right"===t&&(h+g<=0?(m="bottom",v="start"):h+g-p<=0&&(m="right",v="start"),h>=f?(m="top",v="start"):h+p>=f&&(m="right",v="end"));m?(a.classList.add("gleap-tour-popover-arrow-side-".concat(m)),a.classList.add("gleap-tour-popover-arrow-align-".concat(v))):a.classList.add("gleap-tour-popover-arrow-none")}(u,I,e)}}return function(){function e(){n("allowClose")&&h()}function r(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e+1;t[r]?f(r):h()}}function o(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e-1;t[r]?f(r):h()}}function i(){var e;if(!l("__transitionCallback")){var t=l("activeIndex"),r=l("__activeStep"),i=l("__activeElement");if("CLICK"!==r.mode)if(void 0!==t&&void 0!==r)if(void 0!==l("activeIndex")){var a=(null==(e=r.popover)?void 0:e.onPrevClick)||n("onPrevClick");if(a)return a(i,r,{config:n(),state:l()});o()}}}function a(){var e;if(!l("__transitionCallback")){var t=l("activeIndex"),o=l("__activeStep"),i=l("__activeElement");if("CLICK"!==o.mode&&void 0!==t&&void 0!==o){var a=(null==(e=o.popover)?void 0:e.onNextClick)||n("onNextClick");if(a)return a(i,o,{config:n(),state:l()});r()}}}function s(){l("isInitialized")||(c("isInitialized",!0),document.body.classList.add("gleap-tour-active",n("animate")?"gleap-tour-fade":"gleap-tour-simple"),window.addEventListener("keyup",x,!1),window.addEventListener("keydown",k,!1),window.addEventListener("resize",w),window.addEventListener("scroll",w),c("__positionInterval",setInterval((function(){l("isInitialized")&&w()}),1e3)),p("overlayClick",e),p("escapePress",e),p("arrowLeftPress",i),p("arrowRightPress",a))}function f(){var e,t,r,o,i,a,s,l,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,d=n("steps");if(!d)return console.error("No steps to drive through"),void h();if(d[u]){c("__activeOnDestroyed",document.activeElement),c("activeIndex",u);var p=d[u],g=d[u+1],m=d[u-1],v=(null==(e=p.popover)?void 0:e.doneBtnText)||n("doneBtnText")||"Done",b=n("allowClose"),w=void 0!==(null==(t=p.popover)?void 0:t.showProgress)?null==(r=p.popover)?void 0:r.showProgress:n("showProgress"),k=((null==(o=p.popover)?void 0:o.progressText)||n("progressText")||"{{current}} of {{total}}").replace("{{current}}","".concat(u+1)).replace("{{total}}","".concat(d.length)),x=(null==(i=p.popover)?void 0:i.showButtons)||n("showButtons"),S=["next","previous"].concat(El(b?["close"]:[])).filter((function(e){return!(null==x?void 0:x.length)||x.includes(e)})),C=(null==(a=p.popover)?void 0:a.onNextClick)||n("onNextClick"),I=(null==(s=p.popover)?void 0:s.onPrevClick)||n("onPrevClick"),E=(null==(l=p.popover)?void 0:l.onCloseClick)||n("onCloseClick");y(Ol(Ol({},p),{},{popover:Ol({showButtons:S,nextBtnText:g?void 0:v,disableButtons:El(m?[]:["previous"]),showProgress:w,progressText:k,onNextClick:C||function(){g?f(u+1):h()},onPrevClick:I||function(){f(u-1)},onCloseClick:E||function(){h()}},(null==p?void 0:p.popover)||{})}))}else h()}function h(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=l("__activeElement"),r=l("__activeStep"),o=l("__activeOnDestroyed"),i=n("onDestroyStarted");if(e&&i){i(!t||"gleap-tour-dummy-element"===(null==t?void 0:t.id)?void 0:t,r,{config:n(),state:l()})}else{var a,s=(null==r?void 0:r.onDeselected)||n("onDeselected"),c=n("onDestroyed");if(document.body.classList.remove("gleap-tour-active","gleap-tour-fade","gleap-tour-simple"),function(){window.removeEventListener("keyup",x),window.removeEventListener("resize",w),window.removeEventListener("scroll",w);var e=l("__positionInterval");e&&clearInterval(e)}(),function(){var e,t=l("popover");t&&(null==(e=t.wrapper.parentElement)||e.removeChild(t.wrapper))}(),function(){var e;null==(e=document.getElementById("gleap-tour-dummy-element"))||e.remove(),document.querySelectorAll(".gleap-tour-active-element").forEach((function(e){e.classList.remove("gleap-tour-active-element","gleap-tour-no-interaction"),e.removeAttribute("aria-haspopup"),e.removeAttribute("aria-expanded"),e.removeAttribute("aria-controls")}))}(),(a=l("__overlaySvg"))&&a.remove(),d={},u(),t&&r){var p="gleap-tour-dummy-element"===t.id;s&&s(p?void 0:t,r,{config:n(),state:l()}),c&&c(p?void 0:t,r,{config:n(),state:l()})}o&&o.focus()}}return t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{isActive:function(){return l("isInitialized")||!1},refresh:w,drive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;s(),f(e)},setConfig:t,setSteps:function(e){u(),t(Ol(Ol({},n()),{},{steps:e}))},getConfig:n,getState:l,getActiveIndex:function(){return l("activeIndex")},isFirstStep:function(){return 0===l("activeIndex")},isLastStep:function(){var e=n("steps")||[],t=l("activeIndex");return void 0!==t&&t===e.length-1},getActiveStep:function(){return l("activeStep")},getActiveElement:function(){return l("activeElement")},getPreviousElement:function(){return l("previousElement")},getPreviousStep:function(){return l("previousStep")},moveNext:r,movePrevious:o,moveTo:function(e){(n("steps")||[])[e]?f(e):h()},hasNextStep:function(){var e=n("steps")||[],t=l("activeIndex");return void 0!==t&&e[t+1]},hasPreviousStep:function(){var e=n("steps")||[],t=l("activeIndex");return void 0!==t&&e[t-1]},highlight:function(e){s(),y(Ol(Ol({},e),{},{popover:e.popover?Ol({showButtons:[],showProgress:!1,progressText:""},e.popover):void 0}))},destroy:function(){h(!1)}}}}();const Pl=Ml;var Rl=["text","email","password","search","tel","url","number","date","datetime-local","month","week","time"],Nl="".concat(Rl.map((function(e){return'input[type="'.concat(e,'" i]')})).join(", "),", input:not([type]), textarea, [contenteditable]"),_l=function(e){if(!e||!e.tagName)return!1;var t=e.tagName.toLowerCase();return"input"===t?Rl.indexOf((e.getAttribute("type")||"text").toLowerCase())>=0:"textarea"===t||function(e){return!0===e.isContentEditable||"function"==typeof e.getAttribute&&null!==e.getAttribute("contenteditable")}(e)},jl=function(e,t){try{e.dispatchEvent(new Event(t,{bubbles:!0}))}catch(n){}},Dl=function(e,t){if(e){var n=(e.tagName||"").toLowerCase();if("input"===n||"textarea"===n){var r=function(e){var t,n;if("undefined"==typeof window)return null;var r=window.HTMLTextAreaElement&&e instanceof window.HTMLTextAreaElement?window.HTMLTextAreaElement.prototype:window.HTMLInputElement&&e instanceof window.HTMLInputElement?window.HTMLInputElement.prototype:null;return r&&null!==(t=null===(n=Object.getOwnPropertyDescriptor(r,"value"))||void 0===n?void 0:n.set)&&void 0!==t?t:null}(e);r?r.call(e,t):e.value=t}else e.textContent=t;jl(e,"input")}},Fl=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.charDelay,o=void 0===r?100:r,i=n.onDone,a=function(e){if(!e)return null;if(_l(e))return e;var t="function"==typeof e.querySelector?e.querySelector(Nl):null;return t&&_l(t)?t:null}(e),s=null!=t?t:"";if(a){var c=0,l=function(){jl(a,"change"),i&&i()};!function e(){try{c=0&&t.productTourData&&t.productTourData.steps){var e=t.productTourData.steps[t.currentActiveIndex];e&&e.selector&&""!==e.selector&&t.updatePointerPosition(document.querySelector(e.selector),e)}})))}var t,n,r;return t=e,n=[{key:"disable",value:function(){this.disabled=!0,this.cleanup()}},{key:"startWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;"undefined"!=typeof window&&(this.productTourId||this.disabled||(this.productTourId=e,this.productTourData=t,this.currentActiveIndex=0,this.onCompleteCallback=n,this.start()))}},{key:"storeUncompletedTour",value:function(){if("undefined"!=typeof window)if(this.productTourId&&this.productTourData)try{var e=JSON.parse(JSON.stringify({tourData:this.productTourData,tourId:this.productTourId}));e.tourData.steps=e.tourData.steps.slice(this.currentActiveIndex||0,e.tourData.steps.length),e.audioMuted=this.audioMuted,localStorage.setItem(ql,JSON.stringify(e))}catch(t){}else localStorage.removeItem(ql)}},{key:"loadStoredAudioMuted",value:function(){if("undefined"!=typeof window)try{var e=JSON.parse(localStorage.getItem(ql));if(e&&e.tourId===this.productTourId&&"boolean"==typeof e.audioMuted)return e.audioMuted}catch(t){}}},{key:"attachScrollListeners",value:function(e,t){var n=this;if("undefined"!=typeof window&&e){var r=function(e){if("undefined"!=typeof window){for(var t=[],n=e.parentElement;n;){var r=window.getComputedStyle(n);("auto"===r.overflowY||"scroll"===r.overflowY)&&n.scrollHeight>n.clientHeight&&t.push(n),n=n.parentElement}return t}}(e);r.push(window),r.forEach((function(r){var o=function(){clearTimeout(n._scrollDebounceTimer),n._scrollDebounceTimer=setTimeout((function(){n.updatePointerPosition(e,t)}),150)};r.addEventListener("scroll",o,{passive:!0}),n._scrollListeners.push({el:r,handler:o})}))}}},{key:"removeScrollListeners",value:function(){"undefined"!=typeof window&&(this._scrollListeners&&this._scrollListeners.length>0&&(this._scrollListeners.forEach((function(e){var t=e.el,n=e.handler;t.removeEventListener("scroll",n)})),this._scrollListeners=[]),this._scrollDebounceTimer&&(clearTimeout(this._scrollDebounceTimer),this._scrollDebounceTimer=null))}},{key:"updatePointerPosition",value:function(e,t){var n,r=this;if("undefined"!=typeof window)try{var o=this._pointerContainer||document.getElementById(Wl);if(!o)return;if(!e)return o.style.position="fixed",o.style.left="50%",o.style.top="50%",o.style.transform="translate(-50%, -50%)",function(e){if("undefined"!=typeof window){var t=e-window.innerHeight/2;window.scrollTo({top:t,behavior:"smooth"})}}(window.innerHeight/2),this.removeScrollListeners(),this._currentAnchor=null,void(this._currentStep=null);n=e,"undefined"!=typeof window&&n&&n.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});var i=0;!function n(){if(function(e){if("undefined"!=typeof window){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}}(e)||i>=20){var a=e.getBoundingClientRect(),s=a.left+a.width/2,c=a.top+a.height/2+10;o.style.position="fixed",o.style.left="".concat(s,"px"),o.style.top="".concat(c,"px"),o.style.transform="translate(-50%, -50%)";var l=350;l>window.innerWidth-40&&(l=window.innerWidth-40),s+l>window.innerWidth-20?o.classList.add("copilot-pointer-container-right"):o.classList.remove("copilot-pointer-container-right"),r._currentAnchor===e&&r._currentStep===t||(r.removeScrollListeners(),r._currentAnchor=e,r._currentStep=t,r.attachScrollListeners(e,t))}else i++,setTimeout(n,100)}()}catch(a){}}},{key:"cleanup",value:function(){var e=this;"undefined"!=typeof window&&(document.body.classList.add("gl-copilot-fade-out"),this.currentAudio&&this.currentAudio.pause(),setTimeout((function(){if(e._pointerContainer)e._pointerContainer.remove(),e._pointerContainer=null;else{var t=document.getElementById(Wl);t&&t.remove()}var n=document.getElementById(Vl);n&&n.remove();var r=document.getElementById(Gl);r&&r.remove(),document.body.classList.remove("gl-copilot-fade-out")}),800),this.productTourId=void 0,this.productTourData=void 0,this.removeScrollListeners())}},{key:"toggleAudio",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.audioMuted=e,this.currentAudio&&(this.currentAudio.muted=this.audioMuted);var t=document.querySelector(".".concat(Vl,"-mute"));t&&(t.innerHTML=fe(this.audioMuted?"unmute":"mute")),this.productTourId&&this.productTourData&&this.storeUncompletedTour()}},{key:"setupCopilotTour",value:function(){var e,t,n,r,o,i,a,s=this;if("undefined"!=typeof window){var c,l,u=null!==(e=null===(t=br.getInstance().flowConfig)||void 0===t?void 0:t.color)&&void 0!==e?e:"#485BFF",d=pe(u),p=document.getElementById(Gl);p||(p=document.createElement("style"),W(p),p.id=Gl,p.type="text/css",p.textContent="\n #".concat(Wl," {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n align-items: flex-start;\n pointer-events: none;\n z-index: 2147483610;\n transition: all 0.5s ease;\n }\n .").concat(Wl,"-clickmode {\n cursor: pointer;\n pointer-events: all !important;\n }\n .").concat(Wl,"-clickmode #copilot-info-bubble-content {\n display: flex !important;\n }\n .").concat(Wl,"-clickmode svg {\n display: none !important;\n }\n #").concat(Wl," svg {\n width: 20px;\n height: auto;\n fill: none;\n }\n #copilot-info-bubble {\n position: relative;\n }\n #copilot-info-bubble-content-container {\n position: absolute;\n top: 0px;\n left: 0px;\n min-width: min(300px, 80vw);\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n .").concat(Wl,"-right #copilot-info-bubble-content-container {\n left: auto !important;\n right: 0px !important;\n align-items: flex-end;\n }\n .").concat(Wl,"-right .copilot-info-bubble-content {\n margin-right: 5px;\n }\n .").concat(Wl,"-right svg {\n transform: scaleX(-1);\n }\n #copilot-info-bubble-content svg {\n width: 16px;\n height: 16px;\n display: inline-block !important;\n margin-left: 5px;\n }\n #copilot-info-bubble-content {\n margin-top: 18px;\n margin-left: 5px;\n padding: 10px 15px;\n border-radius: 20px;\n background-color: black;\n color: white;\n font-family: Arial, sans-serif;\n font-size: 14px;\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);\n max-width: 100%;\n white-space: pre-line;\n overflow-wrap: break-word;\n word-break: normal;\n hyphens: none;\n }\n .").concat(Wl,"-right #copilot-info-bubble-content {\n margin-top: 30px;\n margin-left: 0px;\n margin-right: 5px;\n }\n .click-wave {\n position: absolute;\n width: 34px;\n height: 34px;\n border-radius: 50%;\n background-color: rgba(0, 0, 0, 0.5);\n pointer-events: none;\n z-index: 2147483611;\n animation: click-wave-animation 0.8s ease forwards;\n }\n @keyframes click-wave-animation {\n 0% {\n transform: scale(0.2);\n opacity: 1;\n }\n 100% {\n transform: scale(2);\n opacity: 0;\n }\n }\n @keyframes slideInFromTop {\n 0% {\n transform: translateY(-100%);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n }\n @keyframes slideInFromBottom {\n 0% {\n transform: translateY(100%);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n }\n .").concat(Vl," {\n position: fixed;\n z-index: 2147483610;\n background: #fff;\n padding: 6px;\n border-radius: 10px;\n box-shadow: 0 0 20px 0 #C294F2;\n display: flex;\n align-items: center;\n gap: 8px;\n border: 1px solid rgba(192, 146, 242, 0.5);\n }\n .").concat(Vl,"--top-left {\n top: 20px;\n left: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(Vl,"--top-right {\n top: 20px;\n right: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(Vl,"--bottom-left {\n bottom: 20px;\n left: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(Vl,"--bottom-right {\n bottom: 20px;\n right: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(Vl," span {\n font-size: 13px;\n color: #000;\n font-family: sans-serif;\n }\n .").concat(Vl,"-avatar {\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n border-radius: 6px;\n }\n .").concat(Vl,"-mute {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .").concat(Vl,"-mute svg {\n width: 20px;\n height: auto;\n cursor: pointer;\n animation: pulsate 2s infinite;\n }\n .").concat(Vl,"-mute svg:hover {\n opacity: 0.8;\n }\n .").concat(Vl,"-dismiss {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: 3px;\n }\n .").concat(Vl,"-dismiss svg {\n width: 15px;\n height: auto;\n cursor: pointer;\n }\n .").concat(Vl,"-dismiss svg:hover {\n opacity: 0.8;\n }\n @keyframes pulsate {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n 50% {\n transform: scale(1.1);\n opacity: 0.8;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n }\n @keyframes glCoFadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n @keyframes glCoFadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n .gleap-audio-unmute-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 2147483620;\n }\n\n .gleap-audio-unmute-modal {\n background-color: #fff;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);\n text-align: center;\n max-width: 90%;\n width: 400px;\n }\n\n .gleap-audio-unmute-modal p {\n margin-bottom: 20px;\n font-size: 16px;\n line-height: 22px;\n font-weight: normal;\n }\n\n .gleap-audio-unmute-button {\n background: ").concat(u,";\n color: ").concat(d,";\n outline: none;\n border: none;\n padding: 10px 14px;\n border-radius: 12px;\n font-size: 14px;\n font-weight: bold;\n cursor: pointer;\n }\n\n .gleap-audio-unmute-button:hover {\n opacity: 0.8;\n }\n\n .gleap-tour-continue-button {\n color: ").concat(u,";\n text-decoration: none;\n cursor: pointer;\n font-size: 14px;\n font-weight: bold;\n border: none;\n background: none;\n padding: 0;\n margin: 0;\n margin-left: 20px;\n }\n\n .gleap-tour-continue-button:hover {\n opacity: 0.8;\n }\n\n body.gl-copilot-fade-out::before,\n body.gl-copilot-fade-out::after,\n body.gl-copilot-fade-out #").concat(Vl," {\n animation: glCoFadeOut 0.8s ease-out forwards;\n }\n ").concat(null===(c=null===(l=this.productTourData)||void 0===l?void 0:l.playVoice)||void 0===c||c?"":"\n .".concat(Vl,"-mute {\n display: none;\n }\n "),"\n ").concat(this.productTourData.gradient?'body::before {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n box-sizing: border-box;\n border: 18px solid transparent;\n filter: blur(25px);\n border-image-slice: 1;\n border-image-source: linear-gradient(45deg, #ED5587, #FBE6A9, #a6e3f8, #C294F2);\n animation: glCoFadeIn 1.5s ease-out forwards;\n }\n \n body::after {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n opacity: 0.5;\n box-sizing: border-box;\n border: 3px solid transparent;\n border-image-slice: 1;\n border-image-source: linear-gradient(45deg, #ED5587, #FBE6A9, #a6e3f8, #C294F2);\n animation: glCoFadeIn 1.5s ease-out forwards;\n }':'body::after {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n opacity: 0;\n }',"\n "),document.head.appendChild(p));var f=document.createElement("div");f.id=Wl,f.style.opacity=0,this._pointerContainer=f;var h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("viewBox","0 0 380 476"),h.innerHTML='';var g=document.createElement("div");g.id="copilot-info-bubble",g.innerHTML="
";var m,v,y=document.createElement("div");y.id=Vl,y.classList.add(Vl,(m=null===(n=this.productTourData)||void 0===n?void 0:n.joinedIndicatorPosition,null!==(v=Xl[m])&&void 0!==v?v:Xl.TOP_RIGHT)),y.innerHTML='\n \n ').concat(null===(o=this.productTourData)||void 0===o?void 0:o.kaiSlug,'\n
\n ').concat(fe(this.audioMuted?"unmute":"mute"),"\n
\n ").concat(null!==(i=this.productTourData)&&void 0!==i&&i.allowClose?'
\n ').concat(fe("dismiss"),"\n
"):"","\n "),document.body.appendChild(y),document.querySelector(".".concat(Vl,"-mute")).addEventListener("click",(function(){s.toggleAudio(!s.audioMuted)})),null!==(a=this.productTourData)&&void 0!==a&&a.allowClose&&document.querySelector(".".concat(Vl,"-dismiss")).addEventListener("click",(function(){s.completeTour(!1)})),f.appendChild(h),f.appendChild(g),document.body.appendChild(f)}}},{key:"start",value:function(){var e=this;if("undefined"!=typeof window&&!this.disabled){var t=this.productTourData;if(t){var n=function(n,r){e.audioMuted=n,e.setupCopilotTour(),e.audioMuted&&r&&null!=t&&t.showUnmuteModal?e.showAudioUnmuteModal():setTimeout((function(){e.renderNextStep()}),1500)},r=this.loadStoredAudioMuted();"boolean"!=typeof r?("undefined"==typeof window?Promise.resolve(!1):new Promise((function(e){var t=setTimeout((function(){return e(!0)}),500),n=function(n){clearTimeout(t),e(n)};try{new Audio("data:audio/wav;base64,UklGRigAAABXQVZFZm10IBAAAAABAAEARKwAABCxAgAEABAAZGF0YQAAAAA=").play().then((function(){return n(!0)})).catch((function(){return n(!1)}))}catch(r){n(!1)}}))).then((function(e){n(!e,!0)})):n(r,!1)}}}},{key:"showAudioUnmuteModal",value:function(){var e,t,n,r=this,o=document.createElement("div");o.classList.add("gleap-audio-unmute-modal-overlay");var i=document.createElement("div");i.classList.add("gleap-audio-unmute-modal");var a=document.createElement("p");a.textContent=null===(e=this.productTourData)||void 0===e?void 0:e.unmuteModalTitle,i.appendChild(a);var s=document.createElement("button");s.classList.add("gleap-audio-unmute-button"),s.textContent=null===(t=this.productTourData)||void 0===t?void 0:t.unmuteModalButton,s.addEventListener("click",(function(){r.toggleAudio(!1),o.parentNode&&o.parentNode.removeChild(o),setTimeout((function(){r.renderNextStep()}),1e3)})),i.appendChild(s);var c=document.createElement("button");c.classList.add("gleap-tour-continue-button"),c.textContent=null===(n=this.productTourData)||void 0===n?void 0:n.unmuteModalContinue,c.addEventListener("click",(function(){r.toggleAudio(!0),o.parentNode&&o.parentNode.removeChild(o),setTimeout((function(){r.renderNextStep()}),1e3)})),i.appendChild(c),o.appendChild(i),document.body.appendChild(o)}},{key:"completeTour",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];"undefined"!=typeof window&&(this.cleanup(),this.onCompleteCallback&&this.onCompleteCallback(e))}},{key:"renderNextStep",value:function(){var e=this;if("undefined"!=typeof window&&!this.disabled){var t=this,n=this.productTourData.steps;if(this.currentActiveIndex>=n.length)setTimeout((function(){e.completeTour()}),500);else{var r=n[this.currentActiveIndex],o=function(n){var o,i;if(e._pointerContainer.style.display="flex",r.selector&&r.selector.length>0&&!n)e.completeTour(!1);else{var a=function(){if("INPUT"===r.mode&&n){var e,o=function(){document.querySelector("#".concat(Wl)).classList.remove("copilot-pointer-container-clickmode"),n.classList.remove("gleap-input-highlight"),document.getElementById(Wl).style.display="none",t.currentActiveIndex++,t.storeUncompletedTour(),t.renderNextStep()};if("default"===(null!==(e=r.inputType)&&void 0!==e?e:"default")){var i=function e(t){var r;if(0!==(null==t||null===(r=t.target)||void 0===r||null===(r=r.value)||void 0===r?void 0:r.length)){var i=document.getElementById("copilot-info-bubble-content");i&&(i.innerHTML="".concat(Vf.translateText("next"),' \n \n'),i.addEventListener("click",o,{once:!0}),n.classList.add("gleap-input-highlight"),document.querySelector("#".concat(Wl)).classList.add("copilot-pointer-container-clickmode"),n.removeEventListener("input",e))}};n.addEventListener("input",i,{once:!1}),n.hasAttribute("contenteditable")&&n.addEventListener("keyup",i,{once:!1}),n.addEventListener("blur",(function(){n.focus()}),{once:!0}),n.focus()}else{var a;Fl(n,null!==(a=r.inputValue)&&void 0!==a?a:"",{charDelay:100,onDone:function(){setTimeout((function(){o()}),1200)}})}}else{if(t.currentActiveIndex++,t.storeUncompletedTour(),"CLICK"===r.mode&&n){var s=n.getBoundingClientRect(),c=window.scrollX||0,l=window.scrollY||0;!function(e,t){if("undefined"!=typeof window){var n=document.createElement("div");n.className="click-wave",n.style.left="".concat(e-17,"px"),n.style.top="".concat(t-17,"px"),document.body.appendChild(n),setTimeout((function(){n.remove()}),800)}}(s.left+s.width/2+c,s.top+s.height/2+l),n.click()}t.renderNextStep()}};e.updatePointerPosition(n,r);var s=null!=r&&r.message?function(e){if("undefined"!=typeof window){var t=document.createElement("div");return t.innerHTML=e,t.querySelectorAll("address, article, blockquote, br, div, footer, h1, h2, h3, h4, h5, h6, header, hr, li, p, pre, section, table, tr").forEach((function(e){e.insertAdjacentText("afterend","\n")})),(t.textContent||"").replace(/[^\S\n]+/g," ").replace(/ *\n */g,"\n").replace(/\n{3,}/g,"\n\n").trim()}}(r.message):"🤔";document.getElementById("copilot-info-bubble-content").textContent=s,e._pointerContainer.style.opacity=1;var c=function(e){if("undefined"!=typeof window){var t=e.split(/\s+/).filter((function(e){return e.length>0})).length;return Math.ceil(t/3.6)+1}}(s),l=function(){e.currentAudio=void 0,setTimeout((function(){a()}),1e3*c)};(null===(o=null===(i=e.productTourData)||void 0===i?void 0:i.playVoice)||void 0===o||o)&&r.voice&&r.voice.length>0?(e.currentAudio=new Audio(r.voice),e.audioMuted&&(e.currentAudio.muted=!0),e.currentAudio.addEventListener("ended",(function(){setTimeout((function(){a()}),1e3)})),e.currentAudio.play().then((function(){})).catch((function(e){l()}))):l()}},i=r.selector?function(e){if("undefined"!=typeof window){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3)/100,n=0;return new Promise((function(r,o){var i=setInterval((function(){var a=document.querySelector(e);a?(clearInterval(i),r(a)):n>=t&&(clearInterval(i),o(new Error("Element not found for selector: ".concat(e)))),n++}),100)}))}}(r.selector):Promise.resolve(null);i.then(o).catch((function(){return o(null)}))}}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Ul(t.prototype,n),r&&Ul(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Kl(e){return Kl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kl(e)}function $l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yl(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!this.productTourId&&!this.disabled)if(this.productTourId=e,this.productTourData=t,this.currentActiveIndex=0,o)this.start();else{var i=this;vs.getInstance().validateProductTour(e).then((function(){return r>0?setTimeout((function(){i.start()}),r):n.start()})).catch((function(e){console.log("Product tour is not live. Cleaning up..."),console.error(e),i.onComplete(!1)}))}}},{key:"onComplete",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={tourId:this.productTourId};e?(Ft.notifyEvent("productTourCompleted",t),oh.trackEvent("tour-".concat(this.productTourId,"-completed"),t)):(Ft.notifyEvent("productTourQuit",t),oh.trackEvent("tour-".concat(this.productTourId,"-quit"),t)),this.gleapTourObj&&this.gleapTourObj.destroy(),this.gleapTourObj=void 0,this.productTourData=void 0,this.productTourId=void 0,this.currentActiveIndex=void 0,this.clearUncompletedTour()}},{key:"loadUncompletedTour",value:function(){try{var e=JSON.parse(localStorage.getItem(tu));if(null!=e&&e.tourData&&null!=e&&e.tourId)return e}catch(t){}return null}},{key:"storeUncompletedTour",value:function(){if(this.productTourId&&this.productTourData)try{var e=JSON.parse(JSON.stringify({tourData:this.productTourData,tourId:this.productTourId}));e.tourData.steps=e.tourData.steps.slice(this.currentActiveIndex||0,e.tourData.steps.length),localStorage.setItem(tu,JSON.stringify(e))}catch(t){}else this.clearUncompletedTour()}},{key:"clearUncompletedTour",value:function(){try{localStorage.removeItem(tu)}catch(e){}}},{key:"start",value:function(){var e=this,t=this.productTourData;if(t){if("cobrowse"===t.tourType)return Jl.getInstance().startWithConfig(this.productTourId,t,(function(t){e.onComplete(t)}));this.unmuted=!1;for(var n=t.steps,r=this,o=[],i=0;i\n \n
').concat(fe("unmute"),"
\n ");else{var p="";t.sender&&t.sender.firstName&&(d=!0,p='
\n
\n
').concat(t.sender.firstName,"
\n
")),u="".concat(p,'
').concat(a.message,"
")}var f={disableActiveInteraction:!s&&!c&&!l,mode:a.mode,popover:Yl({description:u,popoverClass:"gleap-tour-popover-".concat(a.type," ").concat(!d&&"gleap-tour-popover-no-sender"," ").concat(t.allowClose&&"gleap-tour-popover-can-close")},s?{showButtons:[]}:{})};a.selector&&a.selector.length>0&&(f.element=a.selector),o.push(f)}var h=["next","close"];t.backButton&&h.push("previous"),this.gleapTourObj=Pl(Ql(Ql(Ql(Ql(Ql(Ql(Ql(Ql(Ql(Ql({showProgress:!0,allowKeyboardControl:!1,steps:o},"showProgress",n.length>1),"allowClose",t.allowClose),"nextBtnText",t.nextText),"doneBtnText",t.doneText),"prevBtnText",t.prevText),"showButtons",h),"onHighlightStarted",(function(t,n,r){var o;e.currentActiveIndex=null==r||null===(o=r.state)||void 0===o?void 0:o.activeIndex,e.storeUncompletedTour()})),"onElementNotFound",(function(t){document.removeEventListener("click",g),e.onComplete(!1)})),"onDestroyStarted",(function(){e.gleapTourObj.hasNextStep()?e.onComplete(!1):e.onComplete(!0),document.removeEventListener("click",g)})),"onPopoverRender",(function(t){if(t)for(var n=document.querySelectorAll(".gleap-tour-popover-description img, .gleap-tour-popover-description video"),o=function(){setTimeout((function(){e.gleapTourObj.refresh()}),500),setTimeout((function(){e.gleapTourObj.refresh()}),750)},i=0;i((e,t,n)=>t in e?ou(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),au=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(au||{}),su=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(su||{}),cu=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(cu||{}),lu=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(lu||{}),uu=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(uu||{}),du=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(du||{}),pu=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(pu||{});const fu={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},hu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gu={},mu={},vu=()=>!!globalThis.Zone;function yu(e){if(gu[e])return gu[e];const t=globalThis[e],n=t.prototype,r=e in fu?fu[e]:void 0,o=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),i=e in hu?hu[e]:void 0,a=Boolean(i&&i.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(o&&a&&!vu())return gu[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");r.style.display="none",document.body.appendChild(r);const o=r.contentWindow;if(!o)return t.prototype;const i=o[e].prototype;if(!i)return r.remove(),n;const a=navigator.userAgent;return a.includes("Safari")&&!a.includes("Chrome")?(r.classList.add("rr-block"),r.setAttribute("__rrwebUntaintedMutationObserver",""),mu[e]=()=>r.remove()):r.remove(),gu[e]=i}catch{return n}}const bu={};function wu(e,t,n){var r;const o=`${e}.${String(n)}`;if(bu[o])return bu[o].call(t);const i=yu(e),a=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return a?(bu[o]=a,a.call(t)):t[n]}const ku={};function xu(e,t,n){const r=`${e}.${String(n)}`;if(ku[r])return ku[r].bind(t);const o=yu(e)[n];return"function"!=typeof o?t[n]:(ku[r]=o,o.bind(t))}function Su(){return[yu("MutationObserver").constructor,mu.MutationObserver??(()=>{})]}let Cu=Date.now;function Iu(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}/[1-9][0-9]{12}/.test(Date.now().toString())||(Cu=()=>(new Date).getTime());const Eu={ownerDocument:function(e){return wu("Node",e,"ownerDocument")},childNodes:function(e){return wu("Node",e,"childNodes")},parentNode:function(e){return wu("Node",e,"parentNode")},parentElement:function(e){return wu("Node",e,"parentElement")},textContent:function(e){return wu("Node",e,"textContent")},contains:function(e,t){return xu("Node",e,"contains")(t)},getRootNode:function(e){return xu("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?wu("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?wu("Element",e,"shadowRoot"):null},querySelector:function(e,t){return wu("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return wu("Element",e,"querySelectorAll")(t)},nowTimestamp:Cu,mutationObserverCtor:Su,patch:Iu};function Tu(e){return e.nodeType===e.ELEMENT_NODE}function Lu(e){const t=e&&"host"in e&&"mode"in e&&Eu.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Eu.shadowRoot(t)===e)}function Ou(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Au(e){try{const n=e.rules||e.cssRules;if(!n)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);const o=Array.from(n,(e=>Mu(e,r))).join("");return(t=o).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(n){return null}var t}function Mu(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Au(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?zu(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(n)),t?zu(n,t):n}}class Pu{constructor(){iu(this,"idNodeMap",new Map),iu(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ru({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let a=o||"";const s=r&&Nu(r);return(t[n.toLowerCase()]||s&&t[s])&&(a=i?i(a,e):"*".repeat(a.length)),a}function Nu(e){return e.toLowerCase()}const _u="__rrweb_original__";function ju(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Nu(t):null}function Du(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(o){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}const Fu=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Bu=/^(?:[a-z+]+:)?\/\//i,Uu=/^www\..*/i,Hu=/^(data:)([^,]*),(.*)/i;function zu(e,t){return(e||"").replace(Fu,((e,n,r,o,i,a)=>{const s=r||i||a,c=n||o||"";if(!s)return e;if(Bu.test(s)||Uu.test(s))return`url(${c}${s}${c})`;if(Hu.test(s))return`url(${c}${s}${c})`;if("/"===s[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+s}${c})`;const l=s.split("#")[0],u=s.substring(l.length),d=t.split("#")[0].split("/"),p=l.split("/");d.pop();for(const t of p)"."!==t&&(".."===t?d.pop():d.push(t));return`url(${c}${d.join("/")}${u}${c})`}))}function qu(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Wu(e,t){return function(e,t,n=!1){const r=Array.from(t.childNodes),o=[];let i=0;if(r.length>1&&e&&"string"==typeof e){let t=qu(e,n);const a=t.length/e.length;for(let s=1;s2&&""===p[0]&&""!==r[s-1].textContent)f=t.indexOf(d,1);else if(1===p.length){if(d=d.substring(0,d.length-1),p=t.split(d),p.length<=1)return o.push(e),o;u=l+1}else u===c.length-1&&(f=t.indexOf(d));if(p.length>=2&&u>l){const e=r[s-1].textContent;if(e&&"string"==typeof e){const n=qu(e).length;f=t.indexOf(d,n)}-1===f&&(f=p[0].length)}if(-1!==f){let s=Math.floor(f/a);for(;s>0&&s50*r.length)return o.push(e),o;const c=qu(e.substring(0,s),n);if(c.length===f){o.push(e.substring(0,s)),e=e.substring(s),t=t.substring(f);break}c.length=t.length);){let i=r(Yu);if(","===i.slice(-1))i=ed(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=ed(e,i);let a=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((i+r).trim());break}if(a)")"===e&&(a=!1);else{if(","===e){n+=1,o.push((i+r).trim());break}"("===e&&(a=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?zu(r,nd(e)):"object"===t&&"data"===n?ed(e,r):r:r}function od(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function id(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&id(Eu.parentNode(e),t,n);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!n&&id(Eu.parentNode(e),t,n)}function ad(e,t,n,r){let o;if(Tu(e)){if(o=e,!Eu.childNodes(o).length)return!1}else{if(null===Eu.parentElement(e))return!1;o=Eu.parentElement(e)}try{if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(id(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(i){}return!1}function sd(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:a,inlineStylesheet:s,maskInputOptions:c={},maskTextFn:l,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:g=!1,cssCaptured:m=!1}=t,v=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:pu.Document,childNodes:[],compatMode:e.compatMode}:{type:pu.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:pu.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:i,maskInputOptions:a={},maskInputFn:s,dataURLOptions:c={},inlineImages:l,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:f}=t,h=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(r){}return!1}(e,r,o),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=Nu(e.tagName);return Vu.test(t)?"div":t}(e);let m={};const v=e.attributes.length;for(let w=0;wt.href===e.href));let r=null;t&&(r=Au(t)),r&&(delete m.rel,delete m.href,m._cssText=r)}if("style"===g&&e.sheet){let t=Au(e.sheet);t&&(e.childNodes.length>1&&(t=Wu(t,e)),m._cssText=t)}if(["input","textarea","select"].includes(g)){const t=e.value,n=e.checked;"radio"!==m.type&&"checkbox"!==m.type&&"submit"!==m.type&&"button"!==m.type&&t?m.value=Ru({element:e,type:ju(e),tagName:g,value:t,maskInputOptions:a,maskInputFn:s}):n&&(m.checked=n)}"option"===g&&(e.selected&&!a.select?m.selected=!0:delete m.selected);"dialog"===g&&e.open&&(m.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n0!==e)))return!1}return!0})(e)||(m.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(c.type,c.quality)&&(m.rr_dataURL=t)}if("img"===g&&l){Ku||(Ku=n.createElement("canvas"),$u=Ku.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"",o=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Ku.width=t.naturalWidth,Ku.height=t.naturalHeight,$u.drawImage(t,0,0),m.rr_dataURL=Ku.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(o?m.crossOrigin=o:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if(["audio","video"].includes(g)){const t=m;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop));if(h){const{width:t,height:n}=e.getBoundingClientRect();m={class:m.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==g||d(m.src)||(e.contentDocument||(m.rr_src=m.src),delete m.src);let y;try{customElements.get(g)&&(y=!0)}catch(b){}return{type:pu.Element,tagName:g,attributes:m,childNodes:[],isSVG:td(e)||void 0,needBlock:h,rootId:f,isCustom:y}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:s,maskInputOptions:c,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:g,rootId:v});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:o,cssCaptured:i}=t,a=Eu.parentNode(e),s=a&&a.tagName;let c="";const l="STYLE"===s||void 0,u="SCRIPT"===s||void 0;u?c="SCRIPT_PLACEHOLDER":i||(c=Eu.textContent(e),l&&c&&(c=zu(c,nd(t.doc))));!l&&!u&&c&&n&&(c=r?r(c,Eu.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:pu.Text,textContent:c||"",rootId:o}}(e,{doc:n,needsMask:a,maskTextFn:l,rootId:v,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:pu.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:pu.Comment,textContent:Eu.textContent(e)||"",rootId:v};default:return!1}}function cd(e){return null==e?"":e.toLowerCase()}function ld(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function ud(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:c=!1,inlineStylesheet:l=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:S=!1,cssCaptured:C=!1}=t;let{needsMask:I}=t,{preserveWhiteSpace:E=!0}=t;if(!I){I=ad(e,a,s,void 0===I)}const T=sd(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:I,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:h,inlineImages:g,recordCanvas:m,keepIframeSrcFn:x,newlyAddedElement:S,cssCaptured:C});if(!T)return console.warn(e,"not serialized"),null;let L;L=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===pu.Comment)return!0;if(e.type===pu.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Du(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(cd(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===cd(e.attributes.name)||"icon"===cd(e.attributes.rel)||"apple-touch-icon"===cd(e.attributes.rel)||"shortcut icon"===cd(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&cd(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(cd(e.attributes.property).match(/^(og|twitter|fb):/)||cd(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===cd(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===cd(e.attributes.name)||"googlebot"===cd(e.attributes.name)||"bingbot"===cd(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===cd(e.attributes.name)||"generator"===cd(e.attributes.name)||"framework"===cd(e.attributes.name)||"publisher"===cd(e.attributes.name)||"progid"===cd(e.attributes.name)||cd(e.attributes.property).match(/^article:/)||cd(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===cd(e.attributes.name)||"yandex-verification"===cd(e.attributes.name)||"csrf-token"===cd(e.attributes.name)||"p:domain_verify"===cd(e.attributes.name)||"verify-v1"===cd(e.attributes.name)||"verification"===cd(e.attributes.name)||"shopify-checkout-api-token"===cd(e.attributes.name)))return!0}}return!1}(T,f)||!E&&T.type===pu.Text&&!T.textContent.replace(/^\s+|\s+$/gm,"").length?Xu:Ju();const O=Object.assign(T,{id:L});if(r.add(e,O),L===Xu)return null;v&&v(e);let A=!c;if(O.type===pu.Element){A=A&&!O.needBlock,delete O.needBlock;const t=Eu.shadowRoot(e);t&&Ou(t)&&(O.isShadowHost=!0)}if((O.type===pu.Document||O.type===pu.Element)&&A){f.headWhitespace&&O.type===pu.Element&&"head"===O.tagName&&(E=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:I,maskTextClass:a,maskTextSelector:s,skipChild:c,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(O.type===pu.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else{O.type===pu.Element&&void 0!==O.attributes._cssText&&"string"==typeof O.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(Eu.childNodes(e))){const e=ud(n,t);e&&O.childNodes.push(e)}}let S=null;if(Tu(e)&&(S=Eu.shadowRoot(e)))for(const e of Array.from(Eu.childNodes(S))){const n=ud(e,t);n&&(Ou(S)&&(n.isShadow=!0),O.childNodes.push(n))}}const M=Eu.parentNode(e);return M&&Lu(M)&&Ou(M)&&(O.isShadow=!0),O.type===pu.Element&&"iframe"===O.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,i=!1;try{o=r.document.readyState}catch(s){return}if("complete"!==o){const r=setTimeout((()=>{i||(t(),i=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),i=!0,t()}))}const a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&y){const n=ud(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:I,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});n&&y(e,n)}}),b),O.type===pu.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===Du(O.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(a){return}if(r)return;const i=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}(e,(()=>{if(w){const t=ud(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:I,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});t&&w(e,t)}}),k),O}class dd{constructor(...e){iu(this,"parentElement",null),iu(this,"parentNode",null),iu(this,"ownerDocument"),iu(this,"firstChild",null),iu(this,"lastChild",null),iu(this,"previousSibling",null),iu(this,"nextSibling",null),iu(this,"ELEMENT_NODE",1),iu(this,"TEXT_NODE",3),iu(this,"nodeType"),iu(this,"nodeName"),iu(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof dd))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function pd(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const fd="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let hd={map:{},getId:()=>(console.error(fd),-1),getNode:()=>(console.error(fd),null),removeNodeFromMap(){console.error(fd)},has:()=>(console.error(fd),!1),reset(){console.error(fd)}};function gd(e,t,n={}){let r=null,o=0;return function(...i){const a=Date.now();o||!1!==n.leading||(o=a);const s=t-(a-o),c=this;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(c,i)}),s))}}function md(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>md(e,t,i||{},!0)}function vd(e){var t,n,r,o;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=Eu.parentElement(i.body))?void 0:t.scrollLeft)||(null==(n=null==i?void 0:i.body)?void 0:n.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(r=Eu.parentElement(i.body))?void 0:r.scrollTop)||(null==(o=null==i?void 0:i.body)?void 0:o.scrollTop)||0}}function yd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function bd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function wd(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Eu.parentElement(e)}function kd(e,t,n,r){if(!e)return!1;const o=wd(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(id(o,t,r))return!0}catch(i){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function xd(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===Xu}function Sd(e,t){if(Lu(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=Eu.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||Sd(r,t))}function Cd(e){return Boolean(e.changedTouches)}function Id(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ed(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Td(e){return!!e&&(e instanceof dd&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Eu.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(hd=new Proxy(hd,{get:(e,t,n)=>("map"===t&&console.error(fd),Reflect.get(e,t,n))}));class Ld{constructor(){iu(this,"id",1),iu(this,"styleIDMap",new WeakMap),iu(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Od(e){var t;let n=null;return"getRootNode"in e&&(null==(t=Eu.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Eu.host(Eu.getRootNode(e))&&(n=Eu.host(Eu.getRootNode(e))),n}function Ad(e){const t=Eu.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=Od(n);)n=t;return n}(e);return Eu.contains(t,n)}function Md(e){const t=Eu.ownerDocument(e);return!!t&&(Eu.contains(t,e)||Ad(e))}function Pd(e){return"__ln"in e}class Rd{constructor(){iu(this,"length",0),iu(this,"head",null),iu(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n`${e}@${t}`;class _d{constructor(){iu(this,"frozen",!1),iu(this,"locked",!1),iu(this,"texts",[]),iu(this,"attributes",[]),iu(this,"attributeMap",new WeakMap),iu(this,"removes",[]),iu(this,"mapRemoves",[]),iu(this,"movedMap",{}),iu(this,"addedSet",new Set),iu(this,"movedSet",new Set),iu(this,"droppedSet",new Set),iu(this,"removesSubTreeCache",new Set),iu(this,"mutationCb"),iu(this,"blockClass"),iu(this,"blockSelector"),iu(this,"maskTextClass"),iu(this,"maskTextSelector"),iu(this,"inlineStylesheet"),iu(this,"maskInputOptions"),iu(this,"maskTextFn"),iu(this,"maskInputFn"),iu(this,"keepIframeSrcFn"),iu(this,"recordCanvas"),iu(this,"inlineImages"),iu(this,"slimDOMOptions"),iu(this,"dataURLOptions"),iu(this,"doc"),iu(this,"mirror"),iu(this,"iframeManager"),iu(this,"stylesheetManager"),iu(this,"shadowDomManager"),iu(this,"canvasManager"),iu(this,"processedNodeManager"),iu(this,"unattachedDoc"),iu(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),iu(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Rd,r=e=>{let t=e,n=Xu;for(;n===Xu;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{const i=Eu.parentNode(o);if(!i||!Md(o))return;let a=!1;if(o.nodeType===Node.TEXT_NODE){const e=i.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(i)&&(a=!0)}const s=Lu(i)?this.mirror.getId(Od(o)):this.mirror.getId(i),c=r(o);if(-1===s||-1===c)return n.addNode(o);const l=ud(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Id(e,this.mirror)&&this.iframeManager.addIframe(e),Ed(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Td(o)&&this.shadowDomManager.addShadowRoot(Eu.shadowRoot(o),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:a});l&&(e.push({parentId:s,nextId:c,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)Dd(this.removesSubTreeCache,s,this.mirror)&&!this.movedSet.has(Eu.parentNode(s))||o(s);for(const s of this.addedSet)Fd(this.droppedSet,s)||Dd(this.removesSubTreeCache,s,this.mirror)?Fd(this.movedSet,s)?o(s):this.droppedSet.add(s):o(s);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(Eu.parentNode(i.value)),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(Eu.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=Eu.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Eu.host(r);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),o(e.value)}const a={texts:this.texts.map((e=>{const t=e.node,n=Eu.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))})),iu(this,"genTextAreaValueMutation",(e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const n=Array.from(Eu.childNodes(e),(e=>Eu.textContent(e)||"")).join("");t.attributes.value=Ru({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:ju(e),value:n,maskInputFn:this.maskInputFn})})),iu(this,"processMutation",(e=>{if(!xd(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Eu.textContent(e.target);kd(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ad(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,wd(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,o=e.target.getAttribute(r);if("value"===r){const e=ju(n);o=Ru({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:o,maskInputFn:this.maskInputFn})}if(kd(e.target,this.blockClass,this.blockSelector,!1)||o===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(o)){if(n.contentDocument)return;r="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!od(n.tagName,r))if(i.attributes[r]=rd(this.doc,Nu(n.tagName),Nu(r),o),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),o=n.style.getPropertyPriority(e);t!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?i.styleDiff[e]=""===o?t:[t,o]:i._unchangedStyles[e]=[t,o]}for(const e of Array.from(r.style))""===n.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(kd(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),r=Lu(e.target)?this.mirror.getId(Eu.host(e.target)):this.mirror.getId(e.target);kd(e.target,this.blockClass,this.blockSelector,!1)||xd(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(jd(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Sd(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Nd(n,r)]?jd(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!Lu(e.target)||!Ou(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),Eu.childNodes(e).forEach((e=>n.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),iu(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xd(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Nd(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);kd(e,this.blockClass,this.blockSelector,!1)||(Eu.childNodes(e).forEach((e=>this.genAdds(e))),Td(e)&&Eu.childNodes(Eu.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function jd(e,t){e.delete(t),Eu.childNodes(t).forEach((t=>jd(e,t)))}function Dd(e,t,n){return 0!==e.size&&function(e,t,n){const r=Eu.parentNode(t);return!!r&&e.has(r)}(e,t)}function Fd(e,t){return 0!==e.size&&Bd(e,t)}function Bd(e,t){const n=Eu.parentNode(t);return!!n&&(!!e.has(n)||Bd(e,n))}let Ud;const Hd=e=>{if(!Ud)return e;return(...t)=>{try{return e(...t)}catch(n){if(Ud&&!0===Ud(n))return;throw n}}},zd=[];function qd(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Wd(e,t){const n=new _d;zd.push(n),n.init(e);const[r,o]=Su(),i=new r(Hd(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function Gd({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[];let c=null;return Object.keys(cu).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((i=>{let a=Nu(i);const l=(t=>i=>{const a=qd(i);if(kd(a,r,o,!0))return;let s=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":s=lu.Mouse;break;case"touch":s=lu.Touch;break;case"pen":s=lu.Pen}s===lu.Touch?cu[t]===cu.MouseDown?l="TouchStart":cu[t]===cu.MouseUp&&(l="TouchEnd"):lu.Pen}else Cd(i)&&(s=lu.Touch);null!==s?(c=s,(l.startsWith("Touch")&&s===lu.Touch||l.startsWith("Mouse")&&s===lu.Mouse)&&(s=null)):cu[t]===cu.Click&&(s=c,c=null);const u=Cd(i)?i.changedTouches[0]:i;if(!u)return;const d=n.getId(a),{clientX:p,clientY:f}=u;Hd(e)({type:cu[l],id:d,x:p,y:f,...null!==s&&{pointerType:s}})})(i);if(window.PointerEvent)switch(cu[i]){case cu.MouseDown:case cu.MouseUp:a=a.replace("mouse","pointer");break;case cu.TouchStart:case cu.TouchEnd:return}s.push(pd(a,l,t))})),Hd((()=>{s.forEach((e=>e()))}))}function Vd({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return pd("scroll",Hd(gd(Hd((i=>{const a=qd(i);if(!a||kd(a,r,o,!0))return;const s=n.getId(a);if(a===t&&t.defaultView){const n=vd(t.defaultView);e({id:s,x:n.left,y:n.top})}else e({id:s,x:a.scrollLeft,y:a.scrollTop})})),i.scroll||100)),t)}const Xd=["INPUT","TEXTAREA","SELECT"],Jd=new WeakMap;function Kd(e){return function e(t,n){if(Qd("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Qd("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Qd("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Qd("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const r=Array.from(t.parentRule.cssRules).indexOf(t);return n.unshift(r),e(t.parentRule,n)}if(t.parentStyleSheet){const e=Array.from(t.parentStyleSheet.cssRules).indexOf(t);n.unshift(e)}return n}(e,[])}function $d(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Yd({mirror:e,stylesheetManager:t},n){var r,o,i;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(Eu.host(n));const s="#document"===n.nodeName?null==(r=n.defaultView)?void 0:r.Document:null==(i=null==(o=n.ownerDocument)?void 0:o.defaultView)?void 0:i.ShadowRoot,c=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var n;const r=null==(n=c.set)?void 0:n.call(this,e);if(null!==a&&-1!==a)try{t.adoptStyleSheets(e,a)}catch(o){}return r}}),Hd((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function Zd(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:p,selectionCb:f,customElementCb:h}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),a(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),f(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),h(...e)}}(e,t);let o=()=>{};e.recordDOM&&([r,o]=Wd(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let a,s=[];const c=gd(Hd((t=>{const n=Date.now()-a;e(s.map((e=>(e.timeOffset-=n,e))),t),s=[],a=null})),i),l=Hd(gd(Hd((e=>{const t=qd(e),{clientX:n,clientY:o}=Cd(e)?e.changedTouches[0]:e;a||(a=Cu()),s.push({x:n,y:o,id:r.getId(t),timeOffset:Cu()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?su.Drag:e instanceof MouseEvent?su.MouseMove:su.TouchMove)})),o,{trailing:!1})),u=[pd("mousemove",l,n),pd("touchmove",l,n),pd("drag",l,n)];return Hd((()=>{u.forEach((e=>e()))}))}(e),a=Gd(e),s=Vd(e),c=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return pd("resize",Hd(gd(Hd((()=>{const t=yd(),o=bd();n===t&&r===o||(e({width:Number(o),height:Number(t)}),n=t,r=o)})),200)),t)}(e,{win:n}),l=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,ignoreSelector:a,maskInputOptions:s,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=qd(e);const l=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=Eu.parentElement(n)),!n||!d||Xd.indexOf(d)<0||kd(n,r,o,!0))return;if(n.classList.contains(i)||a&&n.matches(a))return;let f=n.value,h=!1;const g=ju(n)||"";"radio"===g||"checkbox"===g?h=n.checked:(s[d.toLowerCase()]||s[g])&&(f=Ru({element:n,maskInputOptions:s,tagName:d,type:g,value:f,maskInputFn:c})),p(n,u?{text:f,isChecked:h,userTriggered:l}:{text:f,isChecked:h});const m=n.name;"radio"===g&&m&&h&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==n){const t=e.value;p(e,u?{text:t,isChecked:!h,userTriggered:!1}:{text:t,isChecked:!h})}}))}function p(t,r){const o=Jd.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Jd.set(t,r);const o=n.getId(t);Hd(e)({...r,id:o})}}const f=("last"===l.input?["change"]:["input","change"]).map((e=>pd(e,Hd(d),t))),h=t.defaultView;if(!h)return()=>{f.forEach((e=>e()))};const g=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),m=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&f.push(...m.map((e=>md(e[0],e[1],{set(){Hd(d)({target:this,isTrusted:!1})}},!1,h)))),Hd((()=>{f.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const a=Hd((i=>gd(Hd((o=>{const a=qd(o);if(!a||kd(a,t,n,!0))return;const{currentTime:s,volume:c,muted:l,playbackRate:u,loop:d}=a;e({type:i,id:r.getId(a),currentTime:s,volume:c,muted:l,playbackRate:u,loop:d})})),o.media||500))),s=[pd("play",a(du.Play),i),pd("pause",a(du.Pause),i),pd("seeked",a(du.Seeked),i),pd("volumechange",a(du.VolumeChange),i),pd("ratechange",a(du.RateChange),i)];return Hd((()=>{s.forEach((e=>e()))}))}(e);let d=()=>{},p=()=>{},f=()=>{},h=()=>{};e.recordDOM&&(d=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Hd(((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=$d(o,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:a,index:s}]}),r.apply(o,i)}))}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){const o=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[o,n])};const i=r.CSSStyleSheet.prototype.deleteRule;let a,s;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Hd(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=$d(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,removes:[{index:a}]}),r.apply(o,i)}))}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Hd(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=$d(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replace:a}),r.apply(o,i)}))})),r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:Hd(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=$d(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replaceSync:a}),r.apply(o,i)}))}));const c={};ep("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(ep("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),ep("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),ep("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach((([r,o])=>{l[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Hd(((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=$d(o.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:a,index:[...Kd(o),s||0]}]}),r.apply(o,i)}))}),o.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Hd(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=$d(o.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,removes:[{index:[...Kd(o),a]}]}),r.apply(o,i)}))})})),Hd((()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach((([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule}))}))}(e,{win:n}),p=Yd(e,e.doc),f=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Hd(((o,a,s)=>{var c;const[l,u,d]=s;if(n.has(l))return i.apply(a,[l,u,d]);const{id:p,styleId:f}=$d(null==(c=a.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||f&&-1!==f)&&e({id:p,styleId:f,set:{property:l,value:u,priority:d},index:Kd(a.parentRule)}),o.apply(a,s)}))});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Hd(((o,i,s)=>{var c;const[l]=s;if(n.has(l))return a.apply(i,[l]);const{id:u,styleId:d}=$d(null==(c=i.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(u&&-1!==u||d&&-1!==d)&&e({id:u,styleId:d,remove:{property:l},index:Kd(i.parentRule)}),o.apply(i,s)}))}),Hd((()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}))}(e,{win:n}),e.collectFonts&&(h=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=Iu(t.fonts,"add",(function(t){return function(n){return setTimeout(Hd((()=>{const t=o.get(n);t&&(e(t),o.delete(n))})),0),t.apply(this,[n])}}));return r.push((()=>{n.FontFace=i})),r.push(a),Hd((()=>{r.forEach((e=>e()))}))}(e)));const g=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let a=!0;const s=Hd((()=>{const e=t.getSelection();if(!e||a&&(null==e?void 0:e.isCollapsed))return;a=e.isCollapsed||!1;const s=[],c=e.rangeCount||0;for(let t=0;t{}}(e),v=[];for(const y of e.plugins)v.push(y.observer(y.callback,n,y.options));return Hd((()=>{zd.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),a(),s(),c(),l(),u(),d(),p(),f(),h(),g(),m(),v.forEach((e=>e()))}))}function Qd(e){return void 0!==window[e]}function ep(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class tp{constructor(e){iu(this,"iframeIdToRemoteIdMap",new WeakMap),iu(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),i.set(a,t)),a}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class np{constructor(e){iu(this,"iframes",new WeakMap),iu(this,"crossOriginIframeMap",new WeakMap),iu(this,"crossOriginIframeMirror",new tp(Ju)),iu(this,"crossOriginIframeStyleMirror"),iu(this,"crossOriginIframeRootIdMap",new WeakMap),iu(this,"mirror"),iu(this,"mutationCb"),iu(this,"wrappedEmit"),iu(this,"loadListener"),iu(this,"stylesheetManager"),iu(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tp(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case au.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:au.IncrementalSnapshot,data:{source:su.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case au.Meta:case au.Load:case au.DomContentLoaded:return!1;case au.Plugin:return t;case au.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case au.IncrementalSnapshot:switch(t.data.source){case su.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case su.Drag:case su.TouchMove:case su.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case su.ViewportResize:return!1;case su.MediaInteraction:case su.MouseInteraction:case su.Scroll:case su.CanvasMutation:case su.Input:return this.replaceIds(t.data,e,["id"]),t;case su.StyleSheetRule:case su.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case su.Font:return t;case su.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case su.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===pu.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class rp{constructor(e){iu(this,"shadowDoms",new WeakSet),iu(this,"mutationCb"),iu(this,"scrollCb"),iu(this,"bypassOptions"),iu(this,"mirror"),iu(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Ou(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[n]=Wd({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Vd({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(Eu.host(e))),this.restoreHandlers.push(Yd({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(Iu(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r),i=Eu.shadowRoot(this);return i&&Md(this)&&n.addShadowRoot(i,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var op="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ip="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ap=0;ap<64;ap++)ip[op.charCodeAt(ap)]=ap;const sp=new Map;const cp=(e,t,n)=>{if(!e||!dp(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=sp.get(e);return n||(n=new Map,sp.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function lp(e,t,n){if(e instanceof Array)return e.map((e=>lp(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t>2],o+=op[(3&n[t])<<4|n[t+1]>>4],o+=op[(15&n[t+1])<<2|n[t+2]>>6],o+=op[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[lp(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[lp(e.data,t,n),e.width,e.height]}}if(dp(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:cp(e,t,n)}}return e}const up=(e,t,n)=>e.map((e=>lp(e,t,n))),dp=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function pp(e,t,n,r){const o=[];try{const i=Iu(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...i){if(!kd(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...i])}}));o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function fp(e,t,n,r,o,i){const a=[],s=Object.getOwnPropertyNames(e);for(const c of s)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if("function"!=typeof e[c])continue;const s=Iu(e,c,(function(e){return function(...a){const s=e.apply(this,a);if(cp(s,i,this),"tagName"in this.canvas&&!kd(this.canvas,r,o,!0)){const e=up(a,i,this),r={type:t,property:c,args:e};n(this.canvas,r)}return s}}));a.push(s)}catch{const r=md(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});a.push(r)}return a}const hp='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',gp="undefined"!=typeof self&&self.Blob&&new Blob([hp],{type:"text/javascript;charset=utf-8"});function mp(e){let t;try{if(t=gp&&(self.URL||self.webkitURL).createObjectURL(gp),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(hp),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class vp{constructor(e){iu(this,"pendingCanvasMutations",new Map),iu(this,"rafStamps",{latestId:0,invokeId:null}),iu(this,"mirror"),iu(this,"mutationCb"),iu(this,"resetObservers"),iu(this,"frozen",!1),iu(this,"locked",!1),iu(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,r,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const i=pp(t,n,r,!0),a=new Map,s=new mp;s.onmessage=e=>{const{id:t}=e.data;if(a.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:uu["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let l,u=0;const d=e=>{u&&e-u{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{kd(t,n,r,!0)||e.push(t)})),e})().forEach((async e=>{var t;const n=this.mirror.getId(e);if(a.get(n))return;if(0===e.width||0===e.height)return;if(a.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);s.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])}))),l=requestAnimationFrame(d)};l=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=pp(e,t,n,!1),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const i=Iu(t.CanvasRenderingContext2D.prototype,a,(function(o){return function(...i){return kd(this.canvas,n,r,!0)||setTimeout((()=>{const n=up(i,t,this);e(this.canvas,{type:uu["2D"],property:a,args:n})}),0),o.apply(this,i)}}));o.push(i)}catch{const n=md(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:uu["2D"],property:a,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r){const o=[];return void 0!==t.WebGLRenderingContext&&o.push(...fp(t.WebGLRenderingContext.prototype,uu.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...fp(t.WebGL2RenderingContext.prototype,uu.WebGL2,e,n,r,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const{type:t,...n}=e;return n})),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class yp{constructor(e){iu(this,"trackedLinkElements",new WeakSet),iu(this,"mutationCb"),iu(this,"adoptedStyleSheetCb"),iu(this,"styleMirror",new Ld),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const o of e){let e;this.styleMirror.has(o)?e=this.styleMirror.getId(o):(e=this.styleMirror.add(o),r.push({styleId:e,rules:Array.from(o.rules||CSSRule,((e,t)=>({rule:Mu(e,o.href),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class bp{constructor(){iu(this,"nodeMap",new WeakMap),iu(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let wp,kp,xp,Sp=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ru=e.contentWindow)?void 0:ru.Array.from)||Array.from,document.body.removeChild(e)}}catch(ah){console.debug("Unable to override Array.from",ah)}const Cp=new Pu;function Ip(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:s=null,maskTextClass:c="rr-mask",maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:f,maskInputFn:h,maskTextFn:g,hooks:m,packFn:v,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:k=!0,recordCanvas:x=!1,recordCrossOriginIframes:S=!1,recordAfter:C=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:I=!1,collectFonts:E=!1,inlineImages:T=!1,plugins:L,keepIframeSrcFn:O=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:M}=e;Ud=M;const P=!S||window.parent===window;let R=!1;if(!P)try{window.parent.document&&(R=!1)}catch(V){R=!0}if(P&&!t)throw new Error("emit function is required");if(!P&&!R)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Cp.reset();const N=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},_=ld(f);let j;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let D=0;const F=e=>{for(const t of L||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!R&&(e=v(e)),e};wp=(e,o)=>{var i;const a=e;if(a.timestamp=Cu(),!(null==(i=zd[0])?void 0:i.isFrozen())||a.type===au.FullSnapshot||a.type===au.IncrementalSnapshot&&a.data.source===su.Mutation||zd.forEach((e=>e.unfreeze())),P)null==t||t(F(a),o);else if(R){const e={type:"rrweb",event:F(a),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(a.type===au.FullSnapshot)j=a,D=0;else if(a.type===au.IncrementalSnapshot){if(a.data.source===su.Mutation&&a.data.isAttachIframe)return;D++;const e=r&&D>=r,t=n&&a.timestamp-j.timestamp>n;(e||t)&&kp(!0)}};const B=e=>{wp({type:au.IncrementalSnapshot,data:{source:su.Mutation,...e}})},U=e=>wp({type:au.IncrementalSnapshot,data:{source:su.Scroll,...e}}),H=e=>wp({type:au.IncrementalSnapshot,data:{source:su.CanvasMutation,...e}}),z=new yp({mutationCb:B,adoptedStyleSheetCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.AdoptedStyleSheet,...e}})}),q=new np({mirror:Cp,mutationCb:B,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:wp});for(const J of L||[])J.getMirror&&J.getMirror({nodeMirror:Cp,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});const W=new bp;xp=new vp({recordCanvas:x,mutationCb:H,win:window,blockClass:o,blockSelector:i,mirror:Cp,sampling:y.canvas,dataURLOptions:b});const G=new rp({mutationCb:B,scrollCb:U,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:N,dataURLOptions:b,maskTextFn:g,maskInputFn:h,recordCanvas:x,inlineImages:T,sampling:y,slimDOMOptions:_,iframeManager:q,stylesheetManager:z,canvasManager:xp,keepIframeSrcFn:O,processedNodeManager:W},mirror:Cp});kp=(e=!1)=>{if(!k)return;wp({type:au.Meta,data:{href:window.location.href,width:bd(),height:yd()}},e),z.reset(),G.init(),zd.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new Pu,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:p,slimDOM:f=!1,dataURLOptions:h,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k=(()=>!1)}=t;return ud(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:s,maskInputOptions:!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===u?{password:!0}:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:ld(f),dataURLOptions:h,inlineImages:c,recordCanvas:l,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}(document,{mirror:Cp,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:N,maskTextFn:g,maskInputFn:h,slimDOM:_,dataURLOptions:b,recordCanvas:x,inlineImages:T,onSerialize:e=>{Id(e,Cp)&&q.addIframe(e),Ed(e,Cp)&&z.trackLinkElement(e),Td(e)&&G.addShadowRoot(Eu.shadowRoot(e),document)},onIframeLoad:(e,t)=>{q.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:O});if(!t)return console.warn("Failed to snapshot the document");wp({type:au.FullSnapshot,data:{node:t,initialOffset:vd(window)}},e),zd.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Cp.getId(document))};try{const e=[],t=e=>{var t;return Hd(Zd)({mutationCb:B,mousemoveCb:(e,t)=>wp({type:au.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.MouseInteraction,...e}}),scrollCb:U,viewportResizeCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.ViewportResize,...e}}),inputCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.Input,...e}}),mediaInteractionCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.MediaInteraction,...e}}),styleSheetRuleCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.StyleSheetRule,...e}}),styleDeclarationCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.StyleDeclaration,...e}}),canvasMutationCb:H,fontCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.Font,...e}}),selectionCb:e=>{wp({type:au.IncrementalSnapshot,data:{source:su.Selection,...e}})},customElementCb:e=>{wp({type:au.IncrementalSnapshot,data:{source:su.CustomElement,...e}})},blockClass:o,ignoreClass:a,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:N,inlineStylesheet:u,sampling:y,recordDOM:k,recordCanvas:x,inlineImages:T,userTriggeredOnInput:I,collectFonts:E,doc:e,maskInputFn:h,maskTextFn:g,keepIframeSrcFn:O,blockSelector:i,slimDOMOptions:_,dataURLOptions:b,mirror:Cp,iframeManager:q,stylesheetManager:z,shadowDomManager:G,processedNodeManager:W,canvasManager:xp,ignoreCSSAttributes:A,plugins:(null==(t=null==L?void 0:L.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>wp({type:au.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};q.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{kp(),e.push(t(document)),Sp=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(pd("DOMContentLoaded",(()=>{wp({type:au.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&n()}))),e.push(pd("load",(()=>{wp({type:au.Load,data:{}}),"load"===C&&n()}),window))),()=>{e.forEach((e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")||console.warn(t)}})),W.destroy(),Sp=!1,Ud=void 0}}catch(X){console.warn(X)}}Ip.addCustomEvent=(e,t)=>{if(!Sp)throw new Error("please add custom event after start recording");wp({type:au.Custom,data:{tag:e,payload:t}})},Ip.freezePage=()=>{zd.forEach((e=>e.freeze()))},Ip.takeFullSnapshot=e=>{if(!Sp)throw new Error("please take full snapshot after start recording");kp(e)},Ip.mirror=Cp;var Ep=Uint8Array,Tp=Uint16Array,Lp=Uint32Array,Op=new Ep([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ap=new Ep([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Mp=new Ep([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pp=function(e,t){for(var n=new Tp(31),r=0;r<31;++r)n[r]=t+=1<>>1|(21845&Bp)<<1;Up=(61680&(Up=(52428&Up)>>>2|(13107&Up)<<2))>>>4|(3855&Up)<<4,Fp[Bp]=((65280&Up)>>>8|(255&Up)<<8)>>>1}var Hp=function(e,t,n){for(var r=e.length,o=0,i=new Tp(t);o>>c]=l}else for(a=new Tp(r),o=0;o>>15-e[o];return a},zp=new Ep(288);for(Bp=0;Bp<144;++Bp)zp[Bp]=8;for(Bp=144;Bp<256;++Bp)zp[Bp]=9;for(Bp=256;Bp<280;++Bp)zp[Bp]=7;for(Bp=280;Bp<288;++Bp)zp[Bp]=8;var qp=new Ep(32);for(Bp=0;Bp<32;++Bp)qp[Bp]=5;var Wp=Hp(zp,9,0),Gp=Hp(qp,5,0),Vp=function(e){return(e/8>>0)+(7&e&&1)},Xp=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Tp?Tp:e instanceof Lp?Lp:Ep)(n-t);return r.set(e.subarray(t,n)),r},Jp=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Kp=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},$p=function(e,t){for(var n=[],r=0;rp&&(p=i[r].s);var f=new Tp(p+1),h=Yp(n[u-1],f,0);if(h>t){r=0;var g=0,m=h-t,v=1<t))break;g+=v-(1<>>=m;g>0;){var b=i[r].s;f[b]=0&&g;--r){var w=i[r].s;f[w]==t&&(--f[w],++g)}h=t}return[new Ep(f),h]},Yp=function(e,t,n){return-1==e.s?Math.max(Yp(e.l,t,n+1),Yp(e.r,t,n+1)):t[e.s]=n},Zp=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Tp(++t),r=0,o=e[0],i=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return[n.subarray(0,r),t]},Qp=function(e,t){for(var n=0,r=0;r>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i4&&!E[Mp[L-1]];--L);var O,A,M,P,R=l+5<<3,N=Qp(o,zp)+Qp(i,qp)+a,_=Qp(o,p)+Qp(i,g)+a+14+3*L+Qp(S,E)+(2*S[16]+3*S[17]+7*S[18]);if(R<=N&&R<=_)return ef(t,u,e.subarray(c,c+l));if(Jp(t,u,1+(_15&&(Jp(t,u,B[C]>>>5&127),u+=B[C]>>>12)}}}else O=Wp,A=zp,M=Gp,P=qp;for(C=0;C255){U=r[C]>>>18&31;Kp(t,u,O[U+257]),u+=A[U+257],U>7&&(Jp(t,u,r[C]>>>23&31),u+=Op[U]);var H=31&r[C];Kp(t,u,M[H]),u+=P[H],H>3&&(Kp(t,u,r[C]>>>5&8191),u+=Ap[H])}else Kp(t,u,O[r[C]]),u+=A[r[C]];return Kp(t,u,O[256]),u+A[256]},nf=new Lp([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rf=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new Ep(r+a+5*(1+Math.floor(a/7e3))+o),c=s.subarray(r,s.length-o),l=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var d=u+65535;d>>13,h=8191&p,g=(1<7e3||E>24576)&&P>423){l=tf(e,c,0,k,x,S,I,E,L,u-L,l),E=C=I=0,L=u;for(var R=0;R<286;++R)x[R]=0;for(R=0;R<30;++R)S[R]=0}var N=2,_=0,j=h,D=A-M&32767;if(P>2&&O==w(u-D))for(var F=Math.min(f,P)-1,B=Math.min(32767,u),U=Math.min(258,P);D<=B&&--j&&A!=M;){if(e[u+N]==e[u+N-D]){for(var H=0;HN){if(N=H,_=D,H>F)break;var z=Math.min(D,H-2),q=0;for(R=0;Rq&&(q=G,M=W)}}}D+=(A=M)-(M=m[A])+32768&32767}if(_){k[E++]=268435456|_p[N]<<18|Dp[_];var V=31&_p[N],X=31&Dp[_];I+=Op[V]+Ap[X],++x[257+V],++S[X],T=u+N,++C}else k[E++]=e[u],++x[e[u]]}}l=tf(e,c,i,k,x,S,I,E,L,u-L,l)}return Xp(s,0,r+Vp(l)+o)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)};function of(e,t){void 0===t&&(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var r=e,o=t,i=n.length,a=0;a!=i;){for(var s=Math.min(a+5552,i);a>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();n.p(e);var r,o,i,a=rf(e,t,2,4);return r=a,o=t.level,i=0==o?0:o<6?1:9==o?3:2,r[0]=120,r[1]=i<<6|(i?32-2*i:1),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(a,a.length-4,n.d()),a}const af=e=>{const t={...e,v:"v1"};return function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var r=0;r>10,56320|1023&o))}return n}(of(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Ep(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},a=0;ar.length){var s=new Ep(o+8+(n-a<<1));s.set(r),r=s}var c=e.charCodeAt(a);c<128||t?i(c):c<2048?(i(192|c>>>6),i(128|63&c)):c>55295&&c<57344?(i(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++a))>>>18),i(128|c>>>12&63),i(128|c>>>6&63),i(128|63&c)):(i(224|c>>>12),i(128|c>>>6&63),i(128|63&c))}return Xp(r,0,o)}(JSON.stringify(t))),!0)};function sf(e){return function(e){if(Array.isArray(e))return cf(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return cf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cf(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n3;)e.dropOldestSegment();var r=mf(t);e.segments[e.segments.length-1].push(t),e.segmentSizes[e.segmentSizes.length-1]+=r,t&&4!==t.type&&2!==t.type&&(e.incrementalSize+=r),e.enforceBufferSize()}}))}catch(n){console.error(n)}}},{key:"startIfNotRunning",value:function(){this.stopFunction||this.start()}},{key:"stop",value:function(){this.stopFunction&&(this.stopFunction(),this.stopFunction=void 0),this.startDate=void 0,this.resetBuffer()}},{key:"resetBuffer",value:function(){clearTimeout(this.forcedCheckoutTimeout),this.forcedCheckoutTimeout=void 0,this.segments=[[]],this.segmentSizes=[0],this.incrementalSize=0}},{key:"dropOldestSegment",value:function(){this.segments.shift(),this.segmentSizes.shift()}},{key:"getBufferSize",value:function(){for(var e=0,t=0;t1&&this.getBufferSize()>gf;)this.dropOldestSegment();this.getBufferSize()>gf&&this.incrementalSize>5242880&&this.scheduleForcedCheckout()}},{key:"scheduleForcedCheckout",value:function(){var e=this;if(!this.forcedCheckoutTimeout){var t=Math.max(0,this.lastForcedCheckout+3e4-Date.now());this.forcedCheckoutTimeout=setTimeout((function(){e.forcedCheckoutTimeout=void 0,e.lastForcedCheckout=Date.now();try{Ip.takeFullSnapshot(!0)}catch(t){}}),t)}}},{key:"getReplayData",value:function(){var e,t=(e=[]).concat.apply(e,sf(this.segments)),n=t,r=!1;try{n=t.map((function(e){return af(e)})),r=!0}catch(o){n=t,r=!1}return{startDate:this.startDate,events:n,packed:r,baseUrl:window.location.origin,width:window.innerWidth,height:window.innerHeight,isMobile:Q(),type:"rrweb"}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&df(t.prototype,n),r&&df(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function yf(e){return yf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yf(e)}function bf(e,t){for(var n=0;n=1e4&&(this.reconnectAttempts=0),this.cleanupWebSocket(),this.scheduleReconnect()}},{key:"processMessage",value:function(e){try{if(st.getInstance().initialized)return;if("update"===e.name){var t,n,r=e.data,o=r.a,i=r.u,a=r.ai,s=r.rc,c=zs.getInstance().isOpened();if(s&&bl.getInstance().clearNotificationsForConversation(s),a&&Pn.getInstance().setConfig({enabled:null!==(t=a.e)&&void 0!==t&&t,placeholder:a.p,quickActions:a.a,style:a.s,workflowId:null!==(n=a.w)&&void 0!==n?n:null}),o){var l=["banner","modal"],u=o.filter((function(e){var t;return!c||l.includes(null==e||null===(t=e.actionType)||void 0===t?void 0:t.toLowerCase())}));oh.getInstance().performActions(u)}null!=i&&bl.getInstance().setNotificationCount(i)}if("checklist"===e.name&&null!=e&&e.data&&window){var d,p,f=e.data,h=null!==(d=f.completedSteps)&&void 0!==d?d:[],g=null!==(p=f.completedStepsBefore)&&void 0!==p?p:[];if(h.length>g.length)for(var m=function(e){var t,n=null==f||null===(t=f.steps)||void 0===t?void 0:t.find((function(t){return t.id===h[e]}));if(!n)return 1;var r=e;g.includes(n)||Ft.notifyEvent("checklist-step-completed",{checklistId:f.id,outboundId:f.outboundId,stepId:n.id,stepIndex:r,step:n,completedSteps:f.completedSteps,status:f.status,data:f})},v=0;vthis.eventMaxLength&&this.eventArray.shift(),this.trimStreamedEvents()}},{key:"trimStreamedEvents",value:function(){for(;this.streamedEventArray.length>500;){var e=this.streamedEventArray.findIndex((function(e){return!e||"sessionStarted"!==e.name}));this.streamedEventArray.splice(-1!==e?e:0,1)}}},{key:"pingDidFinish",value:function(t,n,r,o){if(this.pingInFlight===t){this.pingInFlight=0;var i=o.status;if(i>=200&&i<300)return this.pingFailures=0,this.pingRetryAt=0,this.removeSentEvents(n),void(r&&this.streamEvents());e.isRetryablePingStatus(i)||this.removeSentEvents(n);var a=-1;try{a=e.parseRetryAfter(o.getResponseHeader("Retry-After"))}catch(c){}this.pingFailures+=1;var s=e.pingBackoffDelay(this.pingFailures,Math.random());a>0&&(s=Math.max(s,Math.min(a,3e5))),this.pingRetryAt=Date.now()+s}}},{key:"nextPingBatch",value:function(){for(var e=[],t=[],n=2,r=0;r0&&n+i>262144)break;e.push(o),n+=i}return t.length>0&&(this.streamedEventArray=this.streamedEventArray.filter((function(e){return-1===t.indexOf(e)}))),{events:e,hasMore:e.length=500}},{key:"parseRetryAfter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n="string"==typeof e?e.trim():"";if(!n)return-1;if(/^\d+$/.test(n))return 1e3*parseInt(n,10);var r=Date.parse(n);return isNaN(r)?-1:Math.max(0,r-t)}}],n&&Cf(t.prototype,n),r&&Cf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Pf(e){return Pf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pf(e)}function Rf(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";return Vf.translateText(e)||t}},{key:"_translateWithVars",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Vf.translateTextWithVars(e,t)||n}},{key:"getCheckIcon",value:function(){return'\n \n '}},{key:"loadChecklist",value:function(){if(this._isSessionReady&&this._networkManager){var e=this.getAttribute("checklistId");e?(this.activeStep=-1,this._initialActiveSet=!1,this.validateChecklist(e)):(this.renderResponse(),this.checklistData=null,this._hasLoaded=!1)}}},{key:"getQueryParams",value:function(){var e=this._getGleapSessionInstance();if(null==e||!e.session)return"";var t=e.session,n="en";try{void 0!==Vf&&(n=Vf.getInstance().getActiveLanguage()||"en")}catch(r){}return"gleapId=".concat(t.gleapId||"","&gleapHash=").concat(t.gleapHash||"","&lang=").concat(n)}},{key:"makeRequest",value:function(e,t,n,r){var o=this._getGleapSessionInstance();if(null!=o&&o.session){var i=new XMLHttpRequest;i.open(e,t);try{o.injectSession(i)}catch(a){}n&&i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.onreadystatechange=function(){4===i.readyState&&r(i)},i.onerror=function(){r(i)},i.send(n?JSON.stringify(n):null)}else r({readyState:4,status:0,responseText:"Session unavailable",_isMock:!0})}},{key:"validateChecklist",value:function(e){var t=this;if(this._isSessionReady&&this._networkManager){this.checklistData=null,this._hasLoaded=!1,this.renderResponse();var n=this.getAttribute("sharedKey");this._networkManager.validateChecklist(e,n).then((function(e){t.isConnected&&t._isSessionReady&&e&&t.fetchChecklist(e)})).catch((function(e){t.renderResponse(),t.checklistData=null,t._hasLoaded=!1}))}}},{key:"fetchChecklist",value:function(e){var t=this;this._isSessionReady&&this._networkManager&&(this._isInitialLoad=!this._hasLoaded,this._networkManager.fetchChecklist(e).then((function(e){var n;if(!t.isConnected||!t._isSessionReady||!e)return t._hasLoaded=!1,t.checklistData=null,void t._checkSessionAndLoad();if(t.checklistData=e,t._hasLoaded=!0,"done"!==e.status){if(t._isInitialLoad&&!t._initialActiveSet){var r,o=(null===(r=e.outbound)||void 0===r||null===(r=r.config)||void 0===r?void 0:r.steps)||[],i=e.completedSteps||[],a=o.findIndex((function(e){return!i.includes(e.id)}));t.activeStep=a>=0?a:-1,-1!==t.activeStep&&(t._initialActiveSet=!0)}t.renderChecklist(t.checklistData),Ft.notifyEvent("checklist-loaded",{checklistId:t.checklistData.id,outboundId:null===(n=t.checklistData.outbound)||void 0===n?void 0:n.id,completedSteps:t.checklistData.completedSteps,status:t.checklistData.status,data:t.checklistData})}else t.renderResponse()})).catch((function(e){t.renderResponse(),t.checklistData=null,t._hasLoaded=!1})))}},{key:"updateChecklist",value:function(e,t){var n,r,o=this._getGleapSessionInstance();if(null!=o&&o.session){var i=o.apiUrl;if(i){var a=o.session,s=null!==(n=null==a?void 0:a.gleapId)&&void 0!==n?n:"",c=null!==(r=null==a?void 0:a.gleapHash)&&void 0!==r?r:"",l="en";try{void 0!==Vf&&(l=Vf.getInstance().getActiveLanguage()||"en")}catch(d){}var u="".concat(i,"/outbound/checklists/").concat(e);t.checkedStep&&(u+="/increment/".concat(t.checkedStep)),u+="?gleapId=".concat(s,"&gleapHash=").concat(c,"&lang=").concat(l),this.makeRequest("PUT",u,t,(function(e){e._isMock||200!==e.status&&e.status}))}}}},{key:"handleChecklistUpdate",value:function(e){if(this._hasLoaded&&this.checklistData){var t=e.detail;if(t&&t.id===this.checklistData.id){var n,r=Vn(this.checklistData.completedSteps||[]),o=!1,i=!1,a=this.activeStep;if(t.completedSteps&&JSON.stringify(t.completedSteps)!==JSON.stringify(r)&&(this.checklistData.completedSteps=Vn(t.completedSteps),o=!0,-1!==a)){var s,c=null===(s=this.checklistData.outbound)||void 0===s||null===(s=s.config)||void 0===s||null===(s=s.steps)||void 0===s||null===(s=s[a])||void 0===s?void 0:s.id;c&&this.checklistData.completedSteps.includes(c)&&!r.includes(c)&&(i=!0)}if(t.status&&t.status!==this.checklistData.status&&(this.checklistData.status=t.status,o=!0),i){for(var l,u=(null===(l=this.checklistData.outbound)||void 0===l||null===(l=l.config)||void 0===l?void 0:l.steps)||[],d=-1,p=a+1;p1&&void 0!==arguments[1]?arguments[1]:"checklist-floating",o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=(null===(t=e.config)||void 0===t?void 0:t.steps)||[],a=(null===(n=this.checklistData)||void 0===n?void 0:n.completedSteps)||[],s=0;if(this.progressbarEnabled&&i.length>0){var c=i.length,l=a.length;s=c>0?l/c*100:0}var u,d,p=i.find((function(e){return!a.includes(e.id)})),f=i.length>0?p?p.title||this._translateWithVars("stepDefaultTitle",{index:i.indexOf(p)+1},"Step ".concat(i.indexOf(p)+1)):"":e.subject||"",h=i.length>0?p&&p.description||"":e.message||"";o&&(f=(null===(u=e.config)||void 0===u?void 0:u.successTitle)||"",h=(null===(d=e.config)||void 0===d?void 0:d.successMessage)||"",s=100);var g=2*Math.PI*7,m=g-s/100*g,v="checklist-floating-header"===r,y=v?'\n \n \n ':'\n \n ';return'\n
\n
\n
\n \n \n \n \n
\n
').concat(f,"
\n ").concat(o?"":''.concat(y,""),'\n
\n
').concat(h,"
\n
\n ")}},{key:"renderInfoSection",value:function(e){var t;if(!this.infoEnabled||!e)return"";var n=e.subject||this._translate("checklistDefaultTitle","Checklist"),r=e.message||"",o="";return null!==(t=e.sender)&&void 0!==t&&t.profileImageUrl&&(o='\n
\n ').concat(e.sender.firstName||\n ').concat(e.sender.firstName||"","\n
")),'\n
\n '.concat(n?'
'.concat(n,"
"):"","\n ").concat(r?'
'.concat(r,"
"):"","\n ").concat(o,"\n
")}},{key:"renderProgressSection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!this.progressbarEnabled||!e.length)return"";var n=e.length,r=t.length,o=n>0?r/n*100:0,i=0;e.forEach((function(e){!t.includes(e.id)&&e.duration>0&&(i+=e.duration)}));var a=this._translateWithVars("taskProgress",{a:r,b:n},"".concat(r," of ").concat(n," done")),s=i>0?this._translateWithVars("aboutMinutes",{a:i},"About ".concat(i," min left")):"";return'\n
\n
'.concat(a,"
\n ").concat(s?'
'.concat(s,"
"):"",'\n
\n
\n
\n
')}},{key:"renderTasks",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t&&0!==t.length?t.map((function(t,r){var o=n.includes(t.id),i=e.activeStep===r,a=o?''.concat(e.getCheckIcon(),""):''.concat(r+1,""),s=t.title||e._translateWithVars("stepDefaultTitle",{index:r+1},"Step ".concat(r+1)),c=t.description||"",l=t.actionTitle||e._translate("actionDefaultTitle","Action"),u=t.action&&"none"!==t.action?'
\n \n
"):"",d=e._translate("markAsDone","Mark as done"),p=t.allowMarkDone&&!o?'
\n ').concat(e.getCheckIcon(),'\n
').concat(d,"
\n
"):"",f=["checklist-task",o?"checklist-task--done":"",i?"checklist-task--active":""].filter(Boolean).join(" ");return'\n
\n
\n ').concat(a,'\n
').concat(s,'
\n \n \n \n \n \n
\n
\n
\n ').concat(c?'
'.concat(c,"
"):"","\n ").concat(u,"\n ").concat(p,"\n
\n
\n
")})).join(""):"

".concat(this._translate("noStepsDefined","No steps defined."),"

")}},{key:"renderChecklist",value:function(e){var t;if(this._hasLoaded&&e&&e.outbound){var n=e.outbound,r=(null===(t=n.config)||void 0===t?void 0:t.steps)||[],o=e.completedSteps||[],i="";if("done"===e.status||r.length>0&&o.length>=r.length){var a,s,c=(null===(a=n.config)||void 0===a?void 0:a.successTitle)||"",l=(null===(s=n.config)||void 0===s?void 0:s.successMessage)||"";i=this.floatingEnabled?this.renderFloatingLauncher(n,"checklist-floating-launcher",!0):'\n
\n
\n '.concat(this.getCheckIcon(),'\n
\n
').concat(c,'
\n
').concat(l,"
\n
"),-1!==this.activeStep&&(this.activeStep=-1)}else i='\n
\n '.concat(this.floatingEnabled?"":this.renderInfoSection(n),"\n ").concat(this.floatingEnabled?"":this.renderProgressSection(r,o),"\n ").concat(this.floatingEnabled?this.renderFloatingLauncher(n):"",'\n
\n ').concat(this.floatingEnabled?this.renderFloatingLauncher(n,"checklist-floating-header"):"","\n ").concat(this.renderTasks(r,o),"\n
\n
");var u=br.getInstance().getFlowConfig(),d=u.color?u.color:"#485BFF";xn.getInstance().applyToChecklist(this);var p="\n \n ');this.shadowRoot.innerHTML=p+i,this.addTaskEventListeners(),this.floatingEnabled&&this.addFloatingClickListeners(),-1!==this.activeStep&&this.toggleTask(this.activeStep,!0)}else this._checkSessionAndLoad()}},{key:"updateActiveTaskMaxHeight",value:function(){if(-1!==this.activeStep){var e=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(this.activeStep,'"] .checklist-task-body-inner')),t=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(this.activeStep,'"] .checklist-task-body'));if(e&&t){var n=e.offsetHeight;t.style.setProperty("--task-body-active-height","".concat(n,"px"))}}}},{key:"addTaskEventListeners",value:function(){var e=this;this.shadowRoot.querySelectorAll(".checklist-task").forEach((function(t){var n=t.querySelector(".checklist-task-header"),r=parseInt(t.getAttribute("data-task-index"),10);n&&n.addEventListener("click",(function(){var t=e.activeStep===r?-1:r;e.setActiveStep(t)}));var o=t.querySelector(".checklist-task-body-markdone");o&&o.addEventListener("click",(function(t){var n;if(t.stopPropagation(),null!==(n=e.checklistData)&&void 0!==n&&null!==(n=n.outbound)&&void 0!==n&&null!==(n=n.config)&&void 0!==n&&n.steps){var o=e.checklistData.outbound.config.steps[r];if(o){var i=e.activeStep;if(e.checklistData.completedSteps||(e.checklistData.completedSteps=[]),!e.checklistData.completedSteps.includes(o.id)){e.checklistData.completedSteps.push(o.id);var a=e.checklistData.outbound.config.steps,s=-1;if(i===r){for(var c=r+1;c0&&e.checklistData.completedSteps.length>=a.length&&(e.checklistData.status="done",l.status="done"),e.updateChecklist(e.checklistData.id,l)}}}}));var i=t.querySelector(".checklist-task-body-action .action-button");i&&i.addEventListener("click",(function(t){var n;if(t.stopPropagation(),null!==(n=e.checklistData)&&void 0!==n&&null!==(n=n.outbound)&&void 0!==n&&null!==(n=n.config)&&void 0!==n&&n.steps&&void 0!==oh){var o=e.checklistData.outbound.config.steps[r];if(o&&o.action&&"none"!==o.action)try{"BOT"===o.action?oh.startBot(o.botId):"CUSTOM_ACTION"===o.action?oh.triggerCustomAction(o.actionBody):"REDIRECT_URL"===o.action?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),oh.openURL(o.actionBody,!!o.actionOpenInNewTab)):"FEEDBACK_FLOW"===o.action?oh.startFeedbackFlow(o.formId):"NEWS_ARTICLE"===o.action?oh.openNewsArticle(o.articleId):"HELP_ARTICLE"===o.action?oh.openHelpCenterArticle(o.articleId):"CHECKLIST"===o.action?oh.startChecklist(o.outboundId,!0,null==o?void 0:o.sharedKey):"PRODUCT_TOUR"===o.action&&oh.startProductTour(o.productTourId,!0)}catch(i){}}}))}))}},{key:"setActiveStep",value:function(e){var t=this,n=this.activeStep;this.activeStep=e;var r=[];-1!==n&&n!==this.activeStep&&r.push({index:n,open:!1}),-1!==this.activeStep&&this.activeStep!==n&&r.push({index:this.activeStep,open:!0}),r.forEach((function(e){var n=e.index,r=e.open;t.toggleTask(n,r)}))}},{key:"toggleTask",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(e,'"]'));if(r){var o=r.querySelector(".checklist-task-header");if(o){var i=r.classList.contains("checklist-task--active"),a=null!==n?n:!i;if(a){i||(r.classList.add("checklist-task--active"),o.setAttribute("aria-expanded","true"));var s=r.querySelector(".checklist-task-body-inner");if(s){var c=s.offsetHeight,l=r.querySelector(".checklist-task-body");l&&l.style.setProperty("--task-body-active-height","".concat(c,"px"))}r.querySelectorAll("iframe").forEach((function(n){n._heightListenerAdded||(n._heightListenerAdded=!0,n.addEventListener("load",(function(){t.activeStep===e&&t.updateActiveTaskMaxHeight()})))}))}else!a&&i&&(r.classList.remove("checklist-task--active"),o.setAttribute("aria-expanded","false"))}}}}],o=[{key:"observedAttributes",get:function(){return["checklistId","info","progressbar","dark","floating","sharedKey"]}}],r&&Jn(n.prototype,r),o&&Jn(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(Yn(HTMLElement));"undefined"==typeof customElements||customElements.get("gleap-checklist")||customElements.define("gleap-checklist",e)}}(),function(){if("undefined"!=typeof customElements&&"undefined"!=typeof HTMLElement&&"undefined"!=typeof window&&!customElements.get("gleap-agent-conversation")){var e=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,r=new Array(n),o=0;o0||r.pageFilter)&&window&&window.location&&!rs(window.location.href,r))continue;"notification"===r.actionType?"widget"===(null==r||null===(a=r.data)||void 0===a||null===(a=a.checklist)||void 0===a?void 0:a.popupType)?e.openChecklist(r.data.checklist.id,!0):this.disableInAppNotifications||e.showNotification(r):"banner"===r.actionType?e.showBanner(r):"modal"===r.actionType?e.showModal(r):"tour"===r.actionType?e.startProductTourWithConfig(r.outbound,r.data,!1):e.showSurvey(r.actionType,r.format)}}}},{key:"setGlobalDataItem",value:function(e,t){this.globalData[e]=t}},{key:"getGlobalDataItem",value:function(e){return this.globalData[e]}},{key:"takeCurrentReplay",value:function(){var e=vf.getInstance().getReplayData(),t=e&&e.startDate&&Array.isArray(e.events)&&e.events.length>0;this.setGlobalDataItem("webReplay",t?e:null)}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"setEnvironment",value:function(e){cc.getInstance().environment=e}},{key:"setEnvDataPropsToIgnore",value:function(e){cc.setEnvDataPropsToIgnore(e)}},{key:"setDisableEnvData",value:function(e){cc.setDisableEnvData(e)}},{key:"setCSPNonce",value:function(e){!function(e){z=U(e)}(e)}},{key:"setTags",value:function(e){Hf.getInstance().setTags(e)}},{key:"setUrlHandler",value:function(e){zs.getInstance().setUrlHandler(e)}},{key:"setOfflineMode",value:function(e){this.getInstance().offlineMode=e}},{key:"setDisableInAppNotifications",value:function(e){this.getInstance().disableInAppNotifications=e}},{key:"setDisablePageTracking",value:function(e){this.getInstance().disablePageTracking=e}},{key:"disableConsoleLogOverwrite",value:function(){Jr.getInstance().stop()}},{key:"setAiTools",value:function(e){Xt.getInstance().setAgentTools(e),Pn.getInstance().sendAgentToolsUpdate(),zs.getInstance().sendConfigUpdate()}},{key:"attachNetworkLogs",value:function(e){hl.getInstance().setExternalRequests(ee(e))}},{key:"log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"INFO";Jr.getInstance().addLog(e,t)}},{key:"initialize",value:function(t){var n=this.getInstance();if(n.initialized)console.warn("Gleap already initialized.");else{n.initialized=!0;try{vf.getInstance().startIfNotRunning()}catch(o){}try{!function(){try{var e=function(){try{var e=document.querySelector(".gleap-frame-container-inner iframe");if(!e)return;r(e);var t=window.visualViewport,n=c(window.innerHeight)-c(t.height);!d&&n>=a?(e.style.setProperty("max-height",t.height+"px","important"),e.style.setProperty("transform","translateY("+t.offsetTop+"px)","important")):(e.style.removeProperty("max-height"),e.style.removeProperty("transform"))}catch(o){}},t=function(){try{window.setTimeout((function(){try{var e=p&&p.activeElement;if(e&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable))return;d=!0;var t=document.querySelector(".gleap-frame-container-inner iframe");t&&(t.style.removeProperty("max-height"),t.style.removeProperty("transform")),i()}catch(n){}}),100)}catch(o){}},n=function(){d=!1,i()},r=function(e){try{var r=e.contentDocument;if(!r||r===p)return;p=r,r.addEventListener("focusout",t,!0),r.addEventListener("focusin",n,!0)}catch(o){}},i=function(){try{u||(u=!0,window.requestAnimationFrame((function(){u=!1,e()}))),l&&clearTimeout(l),l=setTimeout(e,s)}catch(o){}};if(!("visualViewport"in window)||!window.visualViewport||!/iPad|iPhone|iPod/.test(navigator.userAgent))return;if(ce)return;ce=!0;var a=150,s=350,c=function(e){return Math.round(e)},l=null,u=!1,d=!1,p=null,f=window.visualViewport;f.addEventListener("resize",i),f.addEventListener("scroll",i),window.addEventListener("orientationchange",(function(){try{i()}catch(o){}})),e()}catch(o){}}()}catch(o){}var r=vs.getInstance();r.sdkKey=t,r.setOnSessionReady((function(){setTimeout((function(){br.getInstance().start().then((function(){Mf.getInstance().start(),se((function(){_.getInstance().injectFeedbackButton(),bl.getInstance().injectNotificationUI(),e.checkForUncompletedTour(),e.checkForUrlParams(),Ft.notifyEvent("initialized")}))})).catch((function(e){console.warn("Failed to initialize Gleap.")}))}),0)})),r.startSession()}}},{key:"openURL",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];zs.getInstance().urlHandler(e,t)}},{key:"disableQueryParams",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.getInstance().disableQueryParams=e}},{key:"checkForUrlParams",value:function(){if(this.getInstance().disableQueryParams)console.log("Query params are disabled.");else if("undefined"!=typeof window&&window.location.search)try{var t=new URLSearchParams(window.location.search),n=t.get("gleap_widget");n&&n.length>0&&e.open();var r=t.get("gleap_conversation");r&&r.length>0&&("true"===r?e.startConversation(!0):e.startBot(r,!0));var o=t.get("gleap_feedback");o&&o.length>0&&e.startFeedbackFlow(o);var i=t.get("gleap_survey"),a=t.get("gleap_survey_format");i&&i.length>0&&e.showSurvey(i,"survey_full"===a?"survey_full":"survey");var s=t.get("gleap_tour");if(s&&s.length>0){var c=parseInt(t.get("gleap_tour_delay"));isNaN(c)&&(c=2),setTimeout((function(){e.startProductTour(s)}),1e3*c)}}catch(l){}}},{key:"destroy",value:function(){vf.getInstance().stop(),Mf.getInstance().stop(),zs.getInstance().destroy(),_.getInstance().destroy(),bl.getInstance().clearAllNotifications(!0),jf.getInstance().stop(),Pn.getInstance().destroy(),vs.getInstance().clearSession(0,!1),Wn.getInstance().removeBannerUI(),this.instance=null}},{key:"closeBanner",value:function(){Wn.getInstance().removeBannerUI()}},{key:"closeModal",value:function(){gc.getInstance().hideModal()}},{key:"showAiChatbar",value:function(){var e=Pn.getInstance();e.manuallyHidden=!1,e.manuallyShown=!0,e.show()}},{key:"hideAiChatbar",value:function(){var e=Pn.getInstance();e.manuallyHidden=!0,e.manuallyShown=!1,e.hide()}},{key:"startAgent",value:function(e,t){try{Pn.getInstance().showWithAgent(e,t)}catch(n){}}},{key:"setAiChatbarQuickActions",value:function(e){Pn.getInstance().setQuickActions(e)}},{key:"setAiChatbarPlaceholder",value:function(e){Pn.getInstance().setPlaceholder(e)}},{key:"setUseCookies",value:function(e){vs.getInstance().useCookies=e}},{key:"disableLocalStorage",value:function(){vs.getInstance().localStorageDisabled=!0}},{key:"identify",value:function(e,t,n){return vs.getInstance().identifySession(e,ne(ee(t)),n)}},{key:"updateContact",value:function(e){return vs.getInstance().updateSession(ne(ee(e)))}},{key:"clearIdentity",value:function(){vs.getInstance().clearSession()}},{key:"getIdentity",value:function(){return vs.getInstance().getSession()}},{key:"isUserIdentified",value:function(){var e=vs.getInstance().session;return!!(e&&e.userId&&e.userId.length>0)}},{key:"isOpened",value:function(){return zs.getInstance().isOpened()}},{key:"hide",value:function(){zs.getInstance().hideWidget()}},{key:"setMaxNetworkRequests",value:function(e){hl.getInstance().setMaxRequests(e)}},{key:"startNetworkLogger",value:function(){hl.getInstance().start()}},{key:"setNetworkLogsBlacklist",value:function(e){hl.getInstance().setBlacklist(e)}},{key:"setNetworkLogPropsToIgnore",value:function(e){hl.getInstance().setFilters(e)}},{key:"setReplayOptions",value:function(e){vf.getInstance().setOptions(e)}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];zs.getInstance().hideWidget(e)}},{key:"open",value:function(){zs.getInstance().setAppMode("widget"),zs.getInstance().showWidget()}},{key:"trackEvent",value:function(e,t){Mf.getInstance().logEvent(e,t)}},{key:"logEvent",value:function(e,t){Mf.getInstance().logEvent(e,t)}},{key:"preFillForm",value:function(e){var t=ee(e);Cl.getInstance().formPreFill=t,zs.getInstance().sendMessage({name:"prefill-form-data",data:t},!0)}},{key:"on",value:function(e,t){Ft.on(e,t)}},{key:"enableShortcuts",value:function(e){e?xf.getInstance().start():xf.getInstance().stop()}},{key:"showFeedbackButton",value:function(e){_.getInstance().toggleFeedbackButton(e)}},{key:"setAppVersionCode",value:function(e){cc.setAppVersionCode(e)}},{key:"setAppBuildNumber",value:function(e){cc.setAppBuildNumber(e)}},{key:"setRegion",value:function(e){vs.getInstance().setRegion(e)}},{key:"getRegion",value:function(){return vs.getInstance().getRegion()}},{key:"setWSApiUrl",value:function(e){vs.getInstance().wsApiUrl=e}},{key:"setRealtimeHost",value:function(e){vs.getInstance().realtimeHost=e}},{key:"setApiUrl",value:function(e){vs.getInstance().apiUrl=e}},{key:"setBannerUrl",value:function(e){Wn.getInstance().setBannerUrl(e)}},{key:"setModalUrl",value:function(e){gc.getInstance().setModalUrl(e)}},{key:"setAgentConversationUrl",value:function(e){Rt(e)}},{key:"setFrameUrl",value:function(e){zs.getInstance().frameUrl=e}},{key:"setTicketAttribute",value:function(e,t){ao.getInstance().setTicketAttribute(e,t)}},{key:"unsetTicketAttribute",value:function(e){ao.getInstance().unsetTicketAttribute(e)}},{key:"clearTicketAttributes",value:function(){ao.getInstance().clearTicketAttributes()}},{key:"attachCustomData",value:function(e){ao.getInstance().attachCustomData(e)}},{key:"setCustomData",value:function(e,t){ao.getInstance().setCustomData(e,t)}},{key:"removeCustomData",value:function(e){ao.getInstance().removeCustomData(e)}},{key:"clearCustomData",value:function(){ao.getInstance().clearCustomData()}},{key:"playSound",value:function(e){Dn.playSound(e)}},{key:"showTabNotificationBadge",value:function(e){var t=bl.getInstance();t.showNotificationBadge=e,t.updateTabBarNotificationCount()}},{key:"setLanguage",value:function(t){Vf.getInstance().setOverrideLanguage(t),e.getInstance().initialized&&setTimeout((function(){e.getInstance().softReInitialize(),e.updateContact({lang:t})}),1e3)}},{key:"registerAgentToolAction",value:function(e){Xt.getInstance().registerAgentToolAction(e)}},{key:"registerAgentTool",value:function(e,t){Xt.getInstance().registerAgentTool(e,t)}},{key:"registerCustomAction",value:function(e){to.registerCustomAction(e)}},{key:"triggerCustomAction",value:function(e){to.triggerCustomAction(e)}},{key:"setColorScheme",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};xn.getInstance().setColorScheme(e,t)}},{key:"setStyles",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#ffffff",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:20,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:20,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:20,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:_.FEEDBACK_BUTTON_BOTTOM_LEFT,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:void 0,l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:void 0;se((function(){!function(e,t,n,r,o,i,a,s,c,l){var u=pe(e),d=pe(n),p=pe(o),f="#ffffff"===p,h=c||t,g=l||t,m=de(o,f?100:-120),v=de(o,f?30:-12),y=de(o,f?80:-30),b=f?o:"#fff",w=f?p:"#2d2d2d",k=(r=parseInt(r,10),Math.round(1.05*r)),x=Math.round(.8*r),S=Math.round(.4*r),C=Math.round(.25*r),I=Math.max(2,Math.round(.55*r)),E=Math.max(2,Math.round(20*I/32)),T=57+a;s===_.FEEDBACK_BUTTON_CLASSIC_BOTTOM?T=a+15:(s&&s.includes("CLASSIC")||s===_.FEEDBACK_BUTTON_NONE)&&(T=a);var L='\n .gleap-font, .gleap-font * {\n font-style: normal;\n font-variant-caps: normal;\n font-variant-ligatures: normal;\n font-variant-numeric: normal;\n font-variant-east-asian: normal;\n font-weight: normal;\n font-stretch: normal;\n font-size: 100%;\n line-height: 1;\n font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n }\n .gleap-ai-ui-widget {\n display: none;\n }\n .gleap-input-highlight {\n box-shadow: 0 0 0 3px '.concat(e," !important;\n }\n .gleap-frame-container {\n right: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n width: calc(100% - 40px);\n max-width: 410px;\n position: fixed;\n z-index: ").concat(2147483631,";\n visibility: visible;\n box-shadow: 0px 5px 40px 0px rgba(9, 14, 21, 0.16);\n border-radius: ").concat(1.5*x,"px;\n overflow: hidden;\n transform-origin: right bottom;\n animation: gleapWidgetScale 0.3s cubic-bezier(0, 1.2, 1, 1) both, gleapWidgetFade 0.12s ease-out both;\n user-select: none;\n pointer-events: none;\n transition: max-width 0.3s ease-out;\n }\n\n .gleap-admin-highlight {\n box-shadow: 0px 0px 0px 4px red;\n }\n\n :root {\n --gleap-margin-top: 50px;\n }\n\n .gleap-tooltip-anchor {\n position: relative;\n display: inline-block;\n float: left;\n max-width: 0px;\n width: 17px;\n }\n\n .gleap-tooltip-hotspot {\n position: absolute;\n display: block;\n width: 17px;\n height: 17px;\n cursor: pointer;\n top: 0px;\n left: 0px;\n }\n\n @keyframes gleap-pulse {\n 0% {\n transform: scale(0);\n opacity: 0.25;\n }\n 45% {\n transform: scale(2.5);\n opacity: 0;\n }\n 100% {\n transform: scale(0);\n opacity: 0;\n }\n }\n\n .gleap-tooltip-hotspot-animation {\n position: absolute;\n border-radius: 17px;\n opacity: 0.25;\n display: block;\n width: 17px;\n height: 17px;\n cursor: pointer;\n top: 0px;\n left: 0px;\n animation: gleap-pulse 5s infinite;\n }\n\n .gleap-tooltip-hotspot svg {\n width: 17px;\n height: 17px;\n object-fit: contain;\n display: block;\n }\n\n .gleap-tooltip-inner {\n position: relative;\n overflow: visible;\n font-size: 14px;\n font-weight: normal;\n color: #000;\n line-height: 1.3;\n }\n\n .gleap-tooltip {\n position: absolute;\n background-color: #fff;\n color: #000;\n font-size: 15px;\n line-height: 18px;\n padding: 16px;\n padding-top: 8px;\n padding-bottom: 8px;\n border-radius: 4px;\n max-width: min(350px, 80vw);\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.2);\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s, visibility 0.2s;\n z-index: ").concat(2147483700,";\n }\n\n .gleap-tooltip a {\n color: ").concat(e,";\n text-decoration: underline;\n display: inline !important;\n margin: 0px !important;\n padding: 0px !important;\n word-break: break-word;\n }\n\n .gleap-tooltip ul {\n padding-left: 16px;\n }\n\n .gleap-tooltip b {\n font-weight: 600;\n }\n\n .gleap-tooltip h2 {\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip h3 {\n font-size: 16px;\n line-height: 18px;\n font-weight: 600;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip p {\n padding: 0px;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip img {\n max-width: 100%;\n max-height: 300px;\n width: 100%;\n height: auto;\n object-fit: cover;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 4px;\n }\n\n .gleap-tooltip iframe,\n .gleap-tooltip video {\n max-width: 100%;\n width: 100%;\n height: auto;\n min-height: 200px;\n display: block;\n border: none;\n outline: none;\n padding: 0px;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 4px;\n }\n\n .gleap-tooltip-arrow {\n position: absolute;\n width: 20px;\n height: 20px;\n }\n\n .gleap-tooltip-arrow svg {\n width: 20px;\n height: 20px;\n object-fit: contain;\n }\n\n .gleap-b-frame {\n width: 100%;\n height: 100%;\n border: none;\n pointer-events: auto;\n padding: 0px;\n margin: 0px;\n }\n\n .gleap-b-shown {\n transition: margin 0.3s ease-out;\n margin-top: var(--gleap-margin-top);\n position: relative;\n z-index: 10000;\n }\n\n .gleap-b-f {\n margin-top: 0px;\n }\n\n .gleap-b {\n display: none;\n position: absolute;\n top: calc(-1 * var(--gleap-margin-top));\n left: 0px;\n width: 100vw;\n height: var(--gleap-margin-top);\n z-index: ").concat(2147483699,";\n }\n\n @keyframes gleapSlideIn {\n from {\n top: calc(-1 * var(--gleap-margin-top));\n }\n to {\n top: 10px;\n }\n }\n\n .gleap-b-f .gleap-b {\n position: fixed;\n top: 10px;\n animation: gleapSlideIn .25s ease-out forwards;\n max-width: 800px;\n width: calc(100% - 20px);\n left: 50%;\n z-index: ").concat(2147483699,";\n transform: translateX(-50%);\n border-radius: ").concat(S,"px;\n overflow: hidden;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.15), 0px 5px 5px rgba(0, 0, 0, 0.05);\n }\n\n .gleap-b-shown .gleap-b {\n display: block;\n }\n\n .gleap-image-view {\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n z-index: ").concat(2147483699,";\n background-color: ").concat(p,"cc;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .gleap-image-view-image {\n width: 90%;\n height: auto;\n max-width: 90%;\n max-height: 90%;\n object-fit: contain;\n }\n\n .gleap-image-view-close {\n position: fixed;\n top: 20px;\n right: 20px;\n width: 32px;\n height: 32px;\n opacity: 0.8;\n z-index: ").concat(2147483740,";\n box-shadow: 0px 5px 18px rgba(0, 0, 0, 0.16);\n cursor: pointer;\n }\n\n .gleap-image-view-close:hover {\n opacity: 1;\n }\n\n .gleap-image-view-close svg path {\n fill: ").concat(o,";\n }\n\n [dir=rtl].gleap-frame-container {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n .gleap-frame-container iframe {\n transition: opacity 0.3s ease;\n }\n\n .gleap-frame-container--loading iframe {\n opacity: 0;\n transition: none;\n }\n\n .gleap-frame-loader {\n visibility: hidden;\n opacity: 0;\n transition: opacity 0.3s ease, visibility 0s linear 0.35s;\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n overflow: hidden;\n background-color: ").concat(o,";\n pointer-events: none;\n }\n\n .gleap-frame-container--loading .gleap-frame-loader {\n visibility: visible;\n opacity: 1;\n transition: none;\n }\n\n .gleap-frame-loader svg {\n display: block;\n width: 100%;\n height: auto;\n }\n\n .gleap-frame-loader .gleap-bg-base {\n fill: ").concat(o,";\n }\n\n .gleap-frame-loader .gleap-bg-c1 {\n fill: ").concat(t,";\n }\n\n .gleap-frame-loader .gleap-bg-c2 {\n fill: ").concat(h,";\n }\n\n .gleap-frame-loader .gleap-bg-c3 {\n fill: ").concat(g,";\n }\n\n .gleap-frame-loader .gleap-bg-grad-1 {\n stop-color: ").concat(h,";\n }\n\n .gleap-frame-loader .gleap-bg-grad-2 {\n stop-color: ").concat(t,";\n }\n\n .gleap-frame-loader .gleap-bg-fade {\n stop-color: ").concat(o,";\n }\n\n @keyframes gleapBgGrowShrink2 {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.35);\n }\n }\n\n @keyframes gleapBgGrowShrink3 {\n 0%, 100% {\n transform: scale(1) rotate(0deg);\n }\n 50% {\n transform: scale(1.3) rotate(20deg);\n }\n }\n\n .gleap-frame-loader--animate .gleap-bg-c2 {\n animation: gleapBgGrowShrink2 7s infinite;\n transform-origin: 50% 50%;\n }\n\n .gleap-frame-loader--animate .gleap-bg-c3 {\n animation: gleapBgGrowShrink3 6s infinite;\n transform-origin: 50% 50%;\n }\n\n .gleap-frame-loader-blur {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n -webkit-backdrop-filter: blur(30px);\n backdrop-filter: blur(30px);\n }\n\n .gleap-frame-loader--image {\n background-color: #ffffff;\n }\n\n .gleap-frame-loader-image-wrap {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0;\n transition: opacity 0.25s ease-in;\n }\n\n .gleap-frame-loader--dockedbar .gleap-frame-loader-image-wrap {\n bottom: 80px;\n }\n\n /* v4 header block: top-anchored, height driven by the strut child + the\n header's 150px padding-bottom — mirrors .agent-home-v4-header so the\n brand surface is exactly as tall as the app's, at any width/wrap. */\n .gleap-frame-loader-header {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n padding-bottom: 150px;\n overflow: hidden;\n }\n\n .gleap-frame-loader-header--colour {\n background: linear-gradient(\n 180deg,\n ").concat(t," 0%,\n ").concat(h,' 100%\n );\n }\n\n /* Strut: invisible height driver replicating the header\'s content box. */\n .gleap-frame-loader-strut {\n position: relative;\n z-index: 1;\n visibility: hidden;\n /* Match the messenger\'s font stack EXACTLY (and reset any inherited host\n font metrics), so the title wraps to the same number of lines the app\n will — the whole point of the strut is a 1:1 height, and a different\n host font would wrap differently and break it. */\n font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n font-style: normal;\n letter-spacing: normal;\n text-transform: none;\n box-sizing: border-box;\n }\n\n .gleap-frame-loader-strut-bar {\n height: 96px;\n }\n\n .gleap-frame-loader-strut-greeting {\n padding: 54px 38px 0px;\n box-sizing: border-box;\n }\n\n .gleap-frame-loader-strut-kicker {\n font-size: 25px;\n line-height: 25px;\n font-weight: normal;\n margin: 0px 0px 4px;\n }\n\n .gleap-frame-loader-strut-title {\n font-size: 25px;\n line-height: 29.5px;\n font-weight: 600;\n margin: 0px;\n }\n\n .gleap-frame-loader-ramp {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n /* 1px overlap past the block\'s bottom edge so fractional-DPR rounding\n can\'t let the image/gradient shimmer through as a hairline — same\n trick as the Messenger-App\'s header overlay. */\n bottom: -1px;\n background: linear-gradient(\n 180deg,\n transparent calc(100% - 120px),\n ').concat(o,"38 calc(100% - 101px),\n ").concat(o,"73 calc(100% - 82px),\n ").concat(o,"A6 calc(100% - 65px),\n ").concat(o,"D6 calc(100% - 49px),\n ").concat(o," calc(100% - 35px)\n );\n }\n\n .gleap-frame-loader-ramp--image {\n /* Smootherstep whitening ramp — must stay stop-for-stop identical to the\n Messenger-App's image header overlay (AgentHomeV4.scss), or the fade\n visibly shifts during the loader→app cross-fade. */\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 0.2) 0px,\n rgba(0, 0, 0, 0) 60px,\n transparent calc(100% - 90px),\n ").concat(o,"03 calc(100% - 83px),\n ").concat(o,"0F calc(100% - 76px),\n ").concat(o,"29 calc(100% - 69px),\n ").concat(o,"52 calc(100% - 62px),\n ").concat(o,"80 calc(100% - 55px),\n ").concat(o,"AD calc(100% - 48px),\n ").concat(o,"D6 calc(100% - 41px),\n ").concat(o,"F0 calc(100% - 34px),\n ").concat(o,"FC calc(100% - 27px),\n ").concat(o," calc(100% - 20px)\n );\n }\n\n .gleap-frame-loader-image-wrap--loaded {\n opacity: 1;\n }\n\n .gleap-frame-loader-image {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .gleap-frame-container--survey {\n bottom: ").concat(a,"px !important;\n }\n\n .gleap-frame-container--extended {\n max-width: 690px !important;\n }\n\n /* Expanded by the end user (expand/collapse button in the messenger header).\n Below 451px the widget is full screen anyway. The inner max-height must beat\n the inline 700px set by GleapFrameManager.setAppMode. */\n @media only screen and (min-width: 451px) {\n .gleap-frame-container--expanded {\n max-width: 690px !important;\n }\n\n .gleap-frame-container--expanded .gleap-frame-container-inner {\n max-height: none !important;\n }\n }\n\n .gleap-frame-container--survey-full {\n position: fixed;\n top: 0 !important;\n left: 0 !important;\n bottom: 0 !important;\n right: 0 !important;\n width: 100vw !important;\n max-width: 100vw !important;\n height: 100vh;\n height: 100dvh !important;\n background-color: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(6px);\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n max-height: 100vh;\n max-height: 100dvh !important;\n border-radius: 0 !important;\n animation-name: none !important;\n }\n\n .gleap-frame-container--survey-full .gleap-frame-container-inner {\n max-width: 640px !important;\n width: calc(100% - 24px);\n border-radius: ").concat(x,"px;\n overflow: hidden;\n }\n\n .gleap-frame-container--classic {\n right: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--no-button {\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic-left {\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--classic-left {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic-left {\n left: auto;\n right: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--modern-left {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n [dir=rtl].gleap-frame-container--modern-left {\n left: auto;\n right: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n .gleap-frame-container--animate {\n pointer-events: auto !important;\n }\n\n .gleap-frame-container--closing {\n animation: gleapWidgetOut 0.2s cubic-bezier(0.4, 0, 1, 1) both !important;\n pointer-events: none !important;\n }\n\n .gleap-frame-container--modern-left,\n .gleap-frame-container--classic-left {\n transform-origin: left bottom;\n }\n\n [dir=rtl].gleap-frame-container {\n transform-origin: left bottom;\n }\n\n [dir=rtl].gleap-frame-container--modern-left,\n [dir=rtl].gleap-frame-container--classic-left {\n transform-origin: right bottom;\n }\n\n @keyframes gleapWidgetScale {\n from { transform: scale(0.9); }\n to { transform: scale(1); }\n }\n\n @keyframes gleapWidgetFade {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes gleapWidgetOut {\n from { opacity: 1; transform: scale(1); }\n to { opacity: 0; transform: scale(0.96); }\n }\n\n @keyframes gleapWidgetSlideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n\n @keyframes gleapWidgetSlideDown {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(100%); }\n }\n\n @keyframes gleapFadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes gleapFadeInUpMobile {\n from {\n opacity: 0;\n transform: translate3d(0, 10%, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n .gleap-notification-container {\n position: fixed;\n bottom: ").concat(T,"px;\n right: ").concat(i,"px;\n z-index: ").concat(2147483630,";\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n width: 100%;\n max-width: min(340px, 80vw);\n }\n\n .gleap-notification-container--left {\n left: ").concat(4+i,"px;\n right: initial !important;\n }\n\n [dir=rtl].gleap-notification-container {\n left: ").concat(4+i,"px;\n right: initial !important;\n }\n\n [dir=rtl].gleap-notification-container--left {\n left: initial !important;\n right: ").concat(i,"px !important;\n align-items: flex-start !important;\n }\n\n .gleap-notification-container--no-button {\n bottom: ").concat(a,"px;\n }\n\n /* Every notification card shares one chrome: full container width, the same\n radius, the same soft shadow, and a lift on hover. */\n .gleap-notification-item,\n .gleap-notification-item-news,\n .gleap-notification-item-checklist {\n width: 100%;\n animation-duration: 0.45s;\n animation-fill-mode: both;\n animation-name: gleapNotificationIn;\n }\n\n .gleap-notification-item-container,\n .gleap-notification-item-news-container,\n .gleap-notification-item-checklist-container {\n width: 100%;\n box-sizing: border-box;\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n /* A drop shadow alone cannot separate a dark card from a dark page, so\n the card also carries a hairline in the direction the theme needs. */\n border: 1px solid ").concat(f?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.04)",";\n /* A barely-there contact shadow + a large, soft ambient throw. */\n box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.04), 0px 10px 30px rgba(0, 0, 0, 0.1);\n margin-bottom: 12px;\n cursor: pointer;\n transition: box-shadow 0.15s ease-out;\n }\n\n .gleap-notification-item-container:hover,\n .gleap-notification-item-news-container:hover,\n .gleap-notification-item-checklist-container:hover {\n box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.05), 0px 14px 38px rgba(0, 0, 0, 0.14);\n }\n\n @keyframes gleapNotificationIn {\n from {\n opacity: 0;\n transform: translate3d(0, 12px, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n /* More than one notification collapses into a stack: the newest card in\n front, older ones peeking out behind its top edge like a deck. Hovering\n the stack (or tapping it on touch devices, which adds --expanded)\n spreads it back into the full list.\n\n Every stacked card is bottom-anchored and placed purely via translateY\n offsets that updateStackLayout() measures and writes as CSS vars, so\n collapsing and expanding is one smooth transform + height transition\n rather than a layout jump. */\n .gleap-notification-card {\n position: relative;\n }\n\n .gleap-notification-container--stack {\n height: var(--gleap-nstack-h-collapsed, auto);\n transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n .gleap-notification-container--stack:hover,\n .gleap-notification-container--stack.gleap-notification-container--expanded {\n height: var(--gleap-nstack-h-expanded, auto);\n }\n\n .gleap-notification-container--stack .gleap-notification-card {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n transform: translateY(var(--gleap-nstack-expand, 0px));\n transform-origin: top center;\n /* The negative inset keeps the box-shadow outside the clip region. */\n clip-path: inset(-40px);\n transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), clip-path 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease-out;\n }\n\n /* The entrance animation's fill pins transform at translate3d(0,0,0),\n which would defeat the stack offsets — so only the front card animates\n in (its stack offsets are 0 anyway). */\n .gleap-notification-container--stack .gleap-notification-card:not(:last-child) {\n animation-name: none;\n }\n\n /* How far back a card scales at each peek depth when collapsed. */\n .gleap-notification-container--stack .gleap-notification-card:nth-last-child(2) {\n --gleap-nstack-scale: 0.955;\n }\n\n .gleap-notification-container--stack .gleap-notification-card:nth-last-child(n+3) {\n --gleap-nstack-scale: 0.91;\n }\n\n .gleap-notification-container--stack:not(:hover):not(.gleap-notification-container--expanded) .gleap-notification-card {\n transform: translateY(var(--gleap-nstack-collapse, 0px)) scale(var(--gleap-nstack-scale, 1));\n /* Clips a taller card behind down to the front card's height (bottom\n inset measured by updateStackLayout), so e.g. a news cover can't hang\n out below the stack. */\n clip-path: inset(-40px -40px var(--gleap-nstack-clip, -40px) -40px);\n }\n\n .gleap-notification-container--stack:not(:hover):not(.gleap-notification-container--expanded) .gleap-notification-card:not(:last-child) {\n pointer-events: none;\n }\n\n /* Anything deeper than two peeks hides entirely until the stack expands. */\n .gleap-notification-container--stack:not(:hover):not(.gleap-notification-container--expanded) .gleap-notification-card:nth-last-child(n+4) {\n opacity: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .gleap-notification-container--stack,\n .gleap-notification-container--stack .gleap-notification-card {\n transition: none;\n }\n }\n\n /* Floats over the stack's top-right corner instead of taking a row of its\n own above it, so the notifications read as one contained unit. */\n .gleap-notification-close {\n position: absolute;\n top: -9px;\n right: -9px;\n border-radius: 100%;\n width: 26px;\n height: 26px;\n background-color: ").concat(o,";\n box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.18);\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n visibility: hidden;\n pointer-events: none;\n z-index: 1;\n }\n\n [dir=rtl].gleap-notification-container .gleap-notification-close {\n left: -9px;\n right: initial;\n }\n\n .gleap-notification-container:hover .gleap-notification-close {\n visibility: visible;\n pointer-events: auto;\n animation-duration: 0.7s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-notification-close {\n visibility: visible;\n pointer-events: auto;\n animation-duration: 0.7s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n }\n\n .gleap-notification-close svg {\n width: 40%;\n height: 40%;\n object-fit: contain;\n fill: ").concat(p,";\n }\n\n .gleap-notification-item-checklist-container {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .gleap-notification-item-checklist-content {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding: 16px;\n width: 100%;\n max-width: 100%;\n }\n\n .gleap-notification-item-checklist-content-title {\n color: ").concat(p,";\n font-size: 15px;\n font-weight: 500;\n line-height: 21px;\n margin-bottom: 10px;\n max-width: 100%;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-checklist-content-progress {\n width: 100%;\n height: 8px;\n border-radius: 8px;\n background-color: ").concat(v,";\n }\n\n .gleap-notification-item-checklist-content-progress-inner {\n height: 100%;\n border-radius: 8px;\n background-color: ").concat(e,";\n }\n\n .gleap-notification-item-checklist-content-next {\n color: ").concat(m,";\n font-size: 15px;\n font-weight: normal;\n line-height: 21px;\n margin-top: 10px;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n }\n\n .gleap-notification-item-checklist-content-next svg {\n height: 18px;\n margin-right: 5px;\n width: auto;\n }\n\n .gleap-notification-item-checklist-content-next b {\n font-size: 15px;\n font-weight: normal;\n color: ").concat(p,";\n }\n\n .gleap-news-pagination {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 10px;\n width: 100%;\n }\n\n .gleap-news-page-indicator {\n font-size: 12px;\n color: ").concat(m,";\n }\n\n .gleap-news-next-button {\n background-color: ").concat(e,";\n color: ").concat(u,";\n border-radius: ").concat(C,"px;\n box-sizing: border-box;\n padding: 5px 10px;\n font-size: 14px;\n font-weight: bold;\n line-height: 21px;\n border: none;\n text-align: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: none !important;\n outline: none !important;^\n }\n\n .gleap-notification-item-news-content {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: 100%;\n padding: 16px;\n }\n\n .gleap-notification-item-news-preview {\n color: ").concat(m,";\n font-size: 14px;\n line-height: 21px;\n font-weight: 400;\n overflow-wrap: break-word;\n word-break: break-word;\n display: block;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-news-sender {\n display: flex;\n align-items: center;\n color: ").concat(m,";\n font-size: 14px;\n line-height: 21px;\n font-weight: 400;\n }\n\n .gleap-notification-item-news-content-title {\n color: ").concat(p,";\n font-size: 15px;\n font-weight: 500;\n line-height: 21px;\n margin-bottom: 6px;\n max-width: 100%;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n cursor: pointer;\n }\n\n .gleap-notification-item-news-sender-avatar {\n border-radius: 100%;\n height: 20px;\n width: 20px;\n min-width: 20px;\n margin-right: 8px;\n object-fit: cover;\n }\n\n [dir=rtl] .gleap-notification-item-news-sender-avatar {\n margin-left: 8px;\n margin-right: 0px !important;\n }\n\n .gleap-notification-item-news-container {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .gleap-notification-item-news-image {\n background-color: ").concat(m,";\n height: 170px;\n max-height: 170px;\n object-fit: cover;\n width: 100%;\n cursor: pointer;\n }\n \n .gleap-notification-item-news-content-title:hover {\n color: ").concat(e,";\n }\n\n .gleap-notification-item-container {\n display: flex;\n align-items: flex-start;\n padding: 16px;\n font-size: 15px;\n line-height: 21px;\n color: ").concat(p,";\n }\n\n .gleap-notification-item-avatar {\n width: 32px;\n height: 32px;\n min-width: 32px;\n border-radius: 100%;\n object-fit: cover;\n display: block;\n margin-right: 10px;\n }\n\n /* The AI is a product, not a person — a rounded square reads as a logo and\n keeps it distinct from the circular teammate avatars. Same split the\n messenger makes in ChatMessageAuthor. */\n .gleap-notification-item-avatar--bot {\n border-radius: ").concat(I,"px;\n }\n\n .gleap-notification-item-news-sender-avatar--bot {\n border-radius: ").concat(E,"px;\n }\n\n [dir=rtl] .gleap-notification-item-avatar {\n margin-left: 10px;\n margin-right: 0px !important;\n }\n\n /* min-width: 0 so a long unbroken word shrinks the body instead of pushing\n the card past the container. */\n .gleap-notification-item-body {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n }\n\n .gleap-notification-item-content {\n line-height: 20px;\n color: ").concat(p,";\n word-wrap: break-word;\n word-break: break-word;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-meta {\n display: flex;\n align-items: center;\n margin-top: 5px;\n font-size: 13px;\n line-height: 18px;\n color: ").concat(m,";\n overflow: hidden;\n }\n\n .gleap-notification-item-sender {\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .gleap-notification-item-meta-dot {\n margin: 0px 5px;\n opacity: 0.6;\n }\n\n .gleap-notification-item-time {\n white-space: nowrap;\n }\n\n .gleap-frame-container-inner {\n position: relative;\n width: 100%;\n height: calc(100vh - ").concat(84+a,"px);\n max-height: ").concat(700,'px;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n height: calc(100vh - 40px);\n }\n \n .gleap-frame-container-inner:before {\n content: " ";\n position: absolute;\n width: 100%;\n height: calc(100% - ').concat(x,"px);\n top: ").concat(x,"px;\n background-color: ").concat(o,";\n z-index: -1;\n }\n \n .gleap-frame-container iframe {\n height: 100% !important;\n width: 100% !important;\n max-width: 100% !important;\n display: block !important;\n pointer-events: auto !important;\n }\n \n .gleap-frame-container--hidden {\n display: none !important;\n pointer-events: none;\n animation: none !important;\n }\n \n .bb-feedback-button {\n margin: 0px;\n position: fixed;\n bottom: ").concat(a,"px;\n right: ").concat(i,"px;\n border-radius: 30px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n background-color: transparent;\n color: #000000;\n z-index: ").concat(2147483630,";\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding: 0px;\n }\n\n @keyframes bbRedDotPulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 1;\n }\n }\n\n .bb-feedback-button--red-dot {\n position: absolute;\n top: 0px;\n right: 0px;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #ff3b30;\n box-shadow: 0 2px 4px rgba(0,0,0,0.2);\n z-index: ").concat(2147483631,";\n animation: bbRedDotPulse 2s ease-in-out infinite;\n }\n\n [dir=rtl].bb-feedback-button {\n bottom: ").concat(a,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n \n .bb-feedback-button--bottomleft {\n bottom: ").concat(a,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n\n [dir=rtl].bb-feedback-button--bottomleft {\n bottom: ").concat(a,"px;\n right: ").concat(i,'px;\n left: auto;\n }\n \n .bb-feedback-button--disabled {\n display: none !important;\n }\n\n .bb-feedback-button--hidden {\n display: none !important;\n }\n \n .bb-feedback-button-text {\n padding: 8px 12px;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n background-color: #fff;\n border-radius: 8px;\n box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.15);\n position: relative;\n z-index: 99;\n }\n \n .bb-feedback-button-text:before {\n content: "";\n position: absolute;\n box-shadow: rgba(0, 0, 0, 0.04) 6px 6px 5px;\n transform: rotate(315deg);\n bottom: 16px;\n right: -4px;\n border-width: 10px;\n border-style: solid;\n border-color: transparent #fff #fff transparent;\n }\n \n .bb-feedback-button--bottomleft .bb-feedback-button-text:before {\n display: none;\n }\n \n .bb-feedback-button-text:after {\n content: "";\n position: absolute;\n bottom: 12px;\n right: 0px;\n background-color: #fff;\n width: 5px;\n height: 30px;\n }\n \n .bb-feedback-button-text-title {\n font-family: sans-serif;\n font-size: 14px;\n color: #666;\n line-height: 18px;\n max-width: 220px;\n }\n \n .bb-feedback-button-text-title b {\n color: #000000;\n font-weight: 600;\n }\n\n .bb-notification-bubble {\n position: absolute;\n top: -5px;\n right: -5px;\n min-width: 12px;\n padding: 0px 4px;\n height: 20px;\n min-width: 20px;\n border-radius: 20px;\n background-color: red;\n color: #fff;\n font-size: 11px;\n font-family: sans-serif;\n text-align: center;\n line-height: 20px;\n }\n\n .bb-notification-bubble--hidden {\n display: none;\n }\n \n .bb-feedback-button-icon {\n width: 48px;\n height: 48px;\n border-radius: 48px;\n background-color: #485bff;\n transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n position: relative;\n }\n \n .bb-feedback-button-classic {\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n top: 50%;\n right: 0px;\n position: fixed;\n transform: rotate(-90deg) translate(50%, -50%);\n transform-origin: 100% 50%;\n padding: 9px 20px;\n text-align: center;\n background-color: #485bff;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n font-family: sans-serif;\n font-size: 16px;\n color: #fff;\n box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.25);\n }\n\n [dir=rtl].bb-feedback-button .bb-feedback-button-classic {\n top: 50%;\n left: 0px;\n right: auto;\n transform: rotate(90deg) translate(-50%, -100%);\n transform-origin: 0% 0%;\n }\n \n .bb-feedback-button-classic--left {\n top: 50%;\n left: 0px;\n right: auto;\n transform: rotate(90deg) translate(-50%, -100%);\n transform-origin: 0% 0%;\n }\n\n [dir=rtl].bb-feedback-button .bb-feedback-button-classic--left {\n top: 50%;\n right: 0px;\n left: auto;\n transform: rotate(-90deg) translate(50%, -50%);\n transform-origin: 100% 50%;\n }\n \n .bb-feedback-button-classic--bottom {\n top: auto;\n bottom: 0px;\n transform: none;\n right: ').concat(i,"px;\n left: auto;\n }\n \n [dir=rtl].bb-feedback-button .bb-feedback-button-classic--bottom {\n top: auto;\n bottom: 0px;\n transform: none;\n left: ").concat(i,"px;\n right: auto;\n }\n\n .bb-feedback-button--classic-button-style {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n \n .bb-feedback-button--open.bb-feedback-button--classic-button-style {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-name: bbFadeOutRight;\n }\n \n .bb-feedback-button .bb-logo-logo {\n position: absolute;\n width: 30px;\n height: 30px;\n top: 9px;\n left: 9px;\n object-fit: contain;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: bbZoomIn;\n }\n \n .bb-feedback-button .bb-logo-arrowdown {\n position: absolute;\n width: 14px;\n height: 14px;\n top: 17px;\n left: 17px;\n object-fit: contain;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n }\n \n .bb-feedback-button .bb-logo-arrowdown {\n animation-name: bbZoomOut;\n }\n \n .bb-feedback-button--open .bb-logo-arrowdown {\n animation-name: bbZoomIn;\n }\n \n .bb-feedback-button--open .bb-logo-logo {\n animation-name: bbZoomOut;\n }\n \n .bb-feedback-button-icon:hover {\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25), 0px 0px 20px rgba(0, 0, 0, 0.2);\n transform: scale(1.1);\n }\n\n /* The overshoot curve lives in its own class (added only for the release)\n so plain hover in/out keeps its regular ease and never bounces. */\n .bb-feedback-button--springing .bb-feedback-button-icon {\n transition: transform 0.55s cubic-bezier(0.2, 2, 0.45, 1), box-shadow 0.2s ease-in-out;\n }\n\n .bb-feedback-button--pressed .bb-feedback-button-icon {\n transform: scale(0.875);\n transition: transform 0.11s cubic-bezier(0.2, 0, 0.4, 1), box-shadow 0.2s ease-in-out;\n box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2), 0px 0px 12px rgba(0, 0, 0, 0.1);\n }\n \n .bb-feedback-button--open .bb-feedback-button-text {\n animation-name: bbFadeOutDown;\n }\n \n .bb-feedback-button--open .bb-feedback-button-icon {\n display: flex;\n }\n \n .bb-capture-svg {\n position: fixed;\n z-index: ").concat(2147483614,";\n top: 0px;\n left: 0px;\n right: 0px;\n width: 100%;\n height: 100%;\n padding: 0px;\n margin: 0px;\n cursor: crosshair;\n }\n\n .bb-capture-svg--preview {\n cursor: auto !important;\n }\n \n .bb-rec-on-circle {\n animation-name: bbRecIconFade;\n animation-duration: 2s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n }\n \n .bb-rec-on-cont {\n animation-name: bbRecIconContFade;\n animation-duration: 2s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n }\n \n .bb-capture-editor-drag-info {\n position: fixed;\n top: -200px;\n left: 0px;\n z-index: ").concat(2147483616,";\n transition: opacity 0.3s ease-in-out;\n }\n \n .bb-capture-editor-drag-info svg {\n width: 24px;\n height: 24px;\n }\n \n .bb-capture-editor-borderlayer {\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n border: 4px solid ").concat(e,";\n cursor: crosshair;\n z-index: ").concat(2147483610,";\n box-sizing: border-box;\n pointer-events: none;\n }\n \n .bb-capture-editor-notrecording .bb-capture-editor-borderlayer {\n background-color: rgba(0, 0, 0, 0.8);\n }\n\n .bb-capture-editor-recording .bb-capture-editor-borderlayer {\n border: 4px solid #eb144c !important;\n }\n \n .bb-capture-editor-recording .bb-capture-dismiss {\n display: none;\n }\n \n .bb-capture-editor-item-inactive {\n opacity: 0.3;\n cursor: not-allowed !important;\n }\n \n .bb-capture-editor-notrecording .bb-capture-toolbar-drawingitem {\n opacity: 0.3;\n cursor: not-allowed !important;\n }\n \n .bb-capture-editor-notrecording .bb-capture-editor-drag-info {\n display: none;\n }\n \n .bb-capture-editor-notrecording .bb-capture-svg {\n pointer-events: none !important;\n }\n \n .bb-capture-toolbar {\n position: fixed;\n top: 20px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ").concat(2147483618,";\n background-color: #fff;\n padding: 5px;\n display: flex;\n align-items: center;\n border-radius: 8px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n transition: opacity 0.3s ease-in-out;\n }\n \n .bb-capture-dismiss {\n position: fixed;\n top: 0px;\n right: 0px;\n z-index: ").concat(2147483618,";\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n width: 36px;\n height: 36px;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: ").concat(e,";\n border-bottom-left-radius: ").concat(C,"px;\n }\n\n [dir=rtl] .bb-capture-dismiss {\n top: 0px;\n left: 0px;\n right: auto;\n border-bottom-left-radius: 0px !important;\n border-bottom-right-radius: ").concat(C,"px;\n }\n \n .bb-capture-dismiss svg path {\n fill: ").concat(u,';\n }\n \n .bb-capture-dismiss svg {\n width: 20px;\n height: 20px;\n object-fit: contain;\n }\n \n .bb-capture-button-next {\n font-family: sans-serif;\n box-sizing: border-box;\n font-weight: 600;\n text-align: center;\n width: auto;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n margin: 0px;\n line-height: 36px;\n padding: 0px 12px;\n font-size: 15px;\n margin-left: 12px;\n }\n\n [dir=rtl].bb-capture-editor .bb-capture-button-next {\n margin-left: auto;\n margin-right: 12px;\n }\n \n .bb-capture-toolbar-item-spacer {\n width: 1px;\n height: 38px;\n min-width: 1px;\n margin: 0px 5px;\n }\n \n .bb-capture-toolbar-item {\n width: 42px;\n height: 38px;\n min-width: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n position: relative;\n margin-right: 5px;\n }\n\n .drag-handle-item {\n cursor: grab !important;\n width: 34px;\n min-width: 34px;\n }\n\n .drag-handle-item svg {\n width: 18px !important;\n height: 18px !important;\n }\n \n .bb-capture-toolbar-item svg {\n width: 23px;\n height: 23px;\n object-fit: contain;\n }\n \n .bb-capture-toolbar-item-selectedcolor {\n border-radius: 100%;\n width: 20px;\n height: 20px;\n background-color: #db4035;\n }\n \n .bb-capture-toolbar-item[data-type="undo"] svg {\n width: 18px;\n height: 18px;\n }\n \n .bb-capture-toolbar-item[data-active="true"] {\n position: relative;\n }\n \n .bb-capture-preview {\n display: none;\n background-color: rgba(0, 0, 0, 0.6);\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n justify-content: center;\n align-items: center;\n z-index: ').concat(2147483620,";\n }\n \n .bb-capture-preview-inner {\n background-color: #fff;\n padding: 0px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n flex-direction: column;\n max-width: 640px;\n width: 100%;\n margin: 20px;\n }\n \n .bb-capture-preview-inner video {\n border-radius: 8px 8px 0px 0px;\n display: block;\n border: 0px;\n outline: none;\n width: 100%;\n max-height: 60vh;\n }\n \n .bb-capture-preview-buttons {\n display: flex;\n justify-content: space-between;\n padding: 14px;\n }\n \n .bb-capture-preview-retrybutton {\n font-family: sans-serif;\n border-radius: 21px;\n box-sizing: border-box;\n padding: 12px 26px;\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n margin-top: 0px;\n margin-bottom: 0px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-preview-sendbutton {\n font-family: sans-serif;\n border-radius: 21px;\n box-sizing: border-box;\n padding: 12px 26px;\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n margin-top: 0px;\n margin-bottom: 0px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-preview-retrybutton:hover,\n .bb-capture-preview-sendbutton:hover {\n opacity: 0.9;\n }\n \n .bb-capture-toolbar-item-recording {\n margin-right: 0px;\n }\n \n .bb-capture-toolbar-item-recording svg {\n width: 33px;\n height: 33px;\n }\n \n .bb-capture-toolbar-item-colorpicker {\n position: fixed;\n top: 70px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ").concat(2147483618,';\n background-color: #fff;\n display: none;\n padding: 10px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n }\n \n .bb-capture-toolbar-item-color {\n width: 20px;\n height: 20px;\n border-radius: 100%;\n margin-right: 12px;\n box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-toolbar-item-color:hover {\n box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.25);\n }\n \n .bb-capture-toolbar-item-color:last-of-type {\n margin-right: 0px;\n }\n \n [dir=rtl].bb-capture-editor .bb-capture-toolbar-item-color {\n margin-right: auto;\n margin-left: 12px;\n }\n \n [dir=rtl].bb-capture-editor .bb-capture-toolbar-item-color:last-of-type {\n margin-right: auto;\n margin-left: 0px;\n }\n \n .bb-capture-toolbar-item-recording[data-active="true"] svg:first-of-type {\n display: none;\n }\n \n .bb-capture-toolbar-item-recording[data-active="true"] svg:nth-of-type(2) {\n display: block;\n }\n \n .bb-capture-toolbar-item-recording[data-active="false"] svg:first-of-type {\n display: block;\n }\n \n .bb-capture-toolbar-item-recording[data-active="false"] svg:nth-of-type(2) {\n display: none;\n }\n \n .bb-capture-toolbar-item--active {\n background-color: #eee;\n }\n \n .bb-capture-toolbar-item:hover svg {\n opacity: 1;\n }\n \n .bb-capture-toolbar-item--active {\n background-color: #f8f8f8;\n }\n \n .bb-capture-toolbar-item--active svg {\n opacity: 1;\n }\n \n .bb-capture-toolbar-item--inactivecross::before {\n content: "";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 3px;\n width: 26px;\n margin: auto;\n border-radius: 4px;\n background-color: #e80000;\n transform: rotate(45deg);\n }\n \n .bb-capture-toolbar-item--inactivecross svg {\n fill: #eee;\n }\n \n .bb-capture-toolbar-item-timer {\n text-align: left;\n line-height: 32px;\n font-size: 14px;\n font-family: sans-serif;\n margin: 5px;\n min-width: 40px;\n display: none;\n }\n \n .bb-capture-toolbar-item .bb-tooltip {\n background-color: #555;\n color: #fff;\n visibility: hidden;\n font-size: 14px;\n font-family: sans-serif;\n text-align: center;\n padding: 5px 10px;\n position: absolute;\n z-index: 1;\n top: 45px;\n left: 0px;\n transform: translateX(calc(-50% + 21px));\n opacity: 0;\n transition: opacity 0.3s;\n white-space: nowrap;\n }\n \n .bb-capture-toolbar-item .bb-tooltip::after {\n content: "";\n position: absolute;\n bottom: 100%;\n left: 50%;\n margin-left: -5px;\n border-width: 5px;\n border-style: solid;\n transform: rotate(180deg);\n border-color: #555 transparent transparent transparent;\n }\n \n .bb-capture-toolbar-item:hover .bb-tooltip {\n visibility: visible;\n opacity: 1;\n }\n \n .bb-capture-options {\n display: none;\n }\n \n .bb-capture-options--active {\n display: flex;\n }\n\n @keyframes bbFadeOutRight {\n from {\n opacity: 1;\n }\n \n to {\n opacity: 0;\n }\n }\n \n @keyframes bbFadeOutDown {\n from {\n opacity: 1;\n }\n \n to {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n }\n \n @keyframes bbFadeInOpacity {\n from {\n opacity: 0;\n }\n \n to {\n opacity: 1;\n }\n }\n \n @keyframes bbZoomOut {\n from {\n opacity: 1;\n }\n \n 50% {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n \n to {\n opacity: 0;\n }\n }\n \n @keyframes bbZoomIn {\n from {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n \n 50% {\n opacity: 1;\n }\n }\n \n @keyframes bbRecIconContFade {\n 0% {\n fill: #b10802;\n }\n 50% {\n fill: #ff0000;\n }\n 100% {\n fill: #b10802;\n }\n } \n .bb-capture-preview-retrybutton {\n color: ').concat(p,";\n border-radius: ").concat(k,"px;\n background-color: ").concat(v,";\n }\n .bb-capture-preview-retrybutton:hover {\n background-color: ").concat(y,";\n }\n @keyframes bb-suc-fill {\n 100% {\n box-shadow: inset 0px 0px 0px 30px ").concat(e,";\n }\n }\n .bb-capture-toolbar-item-spacer {\n background-color: ").concat(v,";\n }\n .bb-tooltip {\n border-radius: ").concat(S,"px;\n }\n @keyframes bbRecIconFade {\n 0% {\n fill: transparent;\n }\n 50% {\n fill: ").concat(y,";\n }\n 100% {\n fill: transparent;\n }\n }\n .bb-capture-preview-sendbutton {\n color: ").concat(u,";\n background-color: ").concat(e,";\n border-radius: ").concat(k,"px;\n }\n .bb-capture-button-next {\n color: ").concat(u,";\n background-color: ").concat(e,";\n border-radius: ").concat(C,"px;\n }\n .bb-capture-preview-inner {\n background-color: ").concat(o,";\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar-item-timer {\n color: ").concat(m,";\n }\n .bb-svg-path {\n fill: ").concat(p,";\n }\n .bb-capture-toolbar-item {\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar {\n background-color: ").concat(o,";\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar-item-colorpicker {\n background-color: ").concat(o,";\n }\n .bb-capture-toolbar-item--active {\n background-color: ").concat(v,";\n }\n .bb-feedback-button-classic {\n border-top-left-radius: ").concat(S,"px;\n border-top-right-radius: ").concat(S,"px;\n }\n .bb-logo-logo--default path {\n fill: ").concat(d,";\n }\n .bb-logo-arrowdown {\n fill: ").concat(d,";\n }\n .bb-feedback-button-icon {\n background-color: ").concat(n,";\n }\n .bb-feedback-button-classic {\n background-color: ").concat(n,";\n color: ").concat(d,";\n }\n\n @media only screen and (max-width: 450px) {\n [dir=rtl].gleap-frame-container,\n .gleap-frame-container {\n left: 0px;\n right: 0px;\n width: 100vw;\n max-width: 100vw;\n min-height: 100vh;\n max-height: 100vh;\n min-height: 100dvh !important;\n max-height: 100dvh !important;\n top: 0px;\n bottom: 0px;\n border-radius: 0px;\n transform-origin: center bottom;\n animation: gleapWidgetSlideUp 0.34s cubic-bezier(0.16, 1, 0.3, 1) both, gleapWidgetFade 0.15s ease-out both;\n }\n\n .gleap-frame-container--closing {\n animation: gleapWidgetSlideDown 0.26s cubic-bezier(0.4, 0, 1, 1) both !important;\n }\n\n .gleap-frame-container-inner {\n width: 100vw;\n height: 100%;\n }\n\n .gleap-frame-container:not(.gleap-frame-container--survey):not(.gleap-frame-container--survey-full) .gleap-frame-container-inner {\n max-height: calc(var(--glvh, 1vh) * 100) !important;\n }\n\n .gleap-frame-container--survey {\n height: auto !important;\n top: initial !important;\n bottom: 0px !important;\n min-height: initial !important;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n height: 100vh !important;\n }\n\n .bb-tooltip {\n display: none !important;\n }\n \n .bb-capture-toolbar-item-colorpicker {\n top: 75px;\n }\n \n .bb-capture-button-next {\n margin-left: auto;\n }\n \n .bb-capture-dismiss {\n display: none;\n }\n \n .bb-capture-toolbar {\n top: 15px;\n right: 15px;\n left: 15px;\n width: auto;\n transform: none;\n }\n\n .bb-capture-editor-drag-info {\n display: none;\n }\n \n .bb-capture-editor-borderlayer {\n border-width: 4px;\n }\n }\n \n @media print {\n .bb-feedback-button {\n display: none !important;\n }\n \n .gleap-frame-container {\n display: none !important;\n }\n }\n\n .gleap-tour-sender {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n margin-bottom: 10px;\n }\n\n .gleap-tour-sender-image {\n width: 32px;\n height: 32px;\n border-radius: 32px;\n margin-right: 10px;\n background-size: cover;\n background-repeat: no-repeat;\n }\n\n .gleap-tour-popover.gleap-tour-popover-post {\n min-width: 550px;\n max-width: 550px;\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-tour-popover.gleap-tour-popover-post {\n min-width: calc(100vw - 40px);\n max-width: calc(100vw - 40px);\n }\n }\n\n .gleap-tour-message,\n .gleap-tour-message p,\n .gleap-tour-message ul {\n color: ").concat(p,";\n }\n\n .gleap-tour-message h2 {\n font-weight: 600;\n font-size: 22px;\n }\n\n .gleap-tour-message h3 {\n font-weight: 600;\n font-size: 18px;\n }\n\n .gleap-tour-message p {\n line-height: 1.3;\n margin-bottom: 10px !important;\n margin-top: 10px !important;\n }\n\n .gleap-tour-message ul {\n line-height: 1.3;\n padding-left: 20px;\n margin-top: 10px !important;\n margin-bottom: 10px !important;\n }\n\n .gleap-tour-message {\n max-height: calc(80vh - 100px) !important;\n overflow-y: auto;\n min-width: 270px;\n }\n\n .gleap-tour-message::-webkit-scrollbar {\n width: 5px;\n }\n\n .gleap-tour-message::-webkit-scrollbar-track {\n border-radius: 0px;\n }\n \n .gleap-tour-message::-webkit-scrollbar-thumb {\n background: ").concat(y,"; \n border-radius: 5px;\n }\n\n .gleap-tour-message::-webkit-scrollbar-thumb:hover {\n background: ").concat(m,";\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-tour-message {\n min-width: auto !important;\n }\n }\n\n .gleap-tour-message iframe {\n width: 100%;\n height: 300px;\n margin-top: 10px;\n margin-bottom: 10px;\n border: none;\n outline: none;\n display: block;\n }\n\n .gleap-tour-sender-name {\n font-size: 15px;\n }\n\n .gleap-tour-video {\n width: 100%;\n max-width: 100%;\n }\n\n .gleap-tour-video-svg--fullscreen {\n width: 100% !important;\n height: 100% !important;\n top: 0px !important;\n left: 0px !important;\n right: 0px !important;\n bottom: 0px !important;\n }\n\n .gleap-tour-video--playing .gleap-tour-video-playpause {\n opacity: 0;\n }\n \n .gleap-tour-video--playing:hover .gleap-tour-video-playpause {\n opacity: 1;\n }\n\n .gleap-tour-popover-video-pointer {\n padding: 0px !important;\n border-radius: 8px;\n position: relative;\n background-color: transparent !important;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-footer {\n position: absolute;\n top: 0px;\n left: 20px;\n right: 20px;\n opacity: 0;\n transition: opacity 200ms ease-in-out;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-footer button {\n padding: 5px 12px;\n }\n\n .gleap-tour-popover-video-pointer.gleap-tour-popover-can-close .gleap-tour-popover-footer {\n right: 40px !important;\n }\n\n .gleap-tour-popover-video-pointer:hover .gleap-tour-popover-footer {\n opacity: 1;\n }\n\n .gleap-tour-popover-pointer.gleap-tour-popover-no-sender .gleap-tour-message {\n padding-right: 20px;\n }\n\n .gleap-tour-video video {\n width: 100%;\n max-width: 100%;\n height: auto;\n border: none;\n outline: none;\n display: block;\n border-radius: 8px;\n }\n\n .gleap-admin-collapse-ui {\n z-index: ").concat(2147483635,";\n cursor: pointer;\n position: fixed;\n bottom: 75px;\n right: 20px;\n width: 32px;\n height: 32px;\n border-radius: 100%;\n background-color: #fff;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;\n }\n\n .gleap-admin-collapse-ui svg {\n width: 20px;\n height: 14px;\n fill: #000 !important;\n }\n\n .gleap-admin-collapse-ui-active {\n bottom: 20px !important;\n }\n\n .gleap-admin-collapse-ui-active svg {\n transform: rotate(180deg);\n }\n\n .gleap-admin-frame-container-active {\n display: none !important;\n }\n\n .gleap-admin-frame-container {\n position: fixed;\n bottom: 0px;\n left: 0px;\n right: 0px;\n width: 100vw;\n z-index: ").concat(2147483640,";\n }\n\n .gleap-admin-frame {\n width: 100%;\n height: 100% !important;\n border: none;\n outline: none;\n display: block;\n }\n \n .gleap-tour-message .linktype-link {\n display: inline-block !important;\n background-color: transparent !important;\n color: ").concat(n," !important;\n }\n\n .gleap-tooltip .linktype-button,\n .gleap-tour-message .linktype-button {\n display: inline-block !important;\n border-radius: 5px;\n box-sizing: border-box;\n padding: 10px 20px !important;\n text-decoration: none !important;\n background-color: ").concat(n," !important;\n color: ").concat(d," !important;\n }\n\n .gleap-tour-message img {\n width: 100%;\n max-width: 100%;\n min-height: 260px;\n height: auto;\n margin-top: 10px;\n margin-bottom: 10px;\n object-fit: cover;\n }\n\n .gleap-tour-active .gleap-tour-overlay {\n pointer-events: none;\n }\n \n .gleap-tour-active * {\n pointer-events: none;\n }\n \n .gleap-tour-active .gleap-tour-active-element,\n .gleap-tour-active .gleap-tour-active-element *,\n .gleap-tour-popover,\n .gleap-tour-popover * {\n pointer-events: auto;\n }\n \n @keyframes animate-fade-in {\n 0% {\n opacity: 0;\n }\n \n to {\n opacity: 1;\n }\n }\n \n .gleap-tour-fade .gleap-tour-overlay {\n animation: animate-fade-in 200ms ease-in-out;\n }\n \n .gleap-tour-fade .gleap-tour-popover {\n animation: animate-fade-in 200ms;\n }\n\n .gleap-tour-video-playpause {\n position: absolute;\n bottom: 8px;\n left: 8px;\n width: 32px;\n height: 32px;\n padding: 4px;\n background-color: rgba(0,0,0,0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border-radius: 8px;\n transition: opacity 200ms ease-in-out;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-arrow {\n display: none !important;\n }\n\n .gleap-tour-video-playpause svg {\n width: 34px;\n height: auto;\n fill: #fff;\n }\n \n /* Popover styles */\n .gleap-tour-popover {\n all: unset;\n box-sizing: border-box;\n color: ").concat(w,";\n margin: 0;\n padding: 15px;\n border-radius: ").concat(S,"px;\n min-width: 250px;\n max-width: 300px;\n box-shadow: 0 1px 10px #0006;\n ").concat(f?"outline: 1px solid rgba(255, 255, 255, 0.1);":"","\n z-index: 1000000000;\n position: fixed;\n top: 0;\n right: 0;\n background-color: ").concat(b,';\n }\n \n .gleap-tour-popover * {\n font-family: "Helvetica Neue", Inter, ui-sans-serif, "Apple Color Emoji", Helvetica, Arial, sans-serif;\n }\n \n .gleap-tour-popover-title {\n font: 19px / normal sans-serif;\n font-weight: 700;\n display: block;\n position: relative;\n line-height: 1.5;\n zoom: 1;\n margin: 0;\n }\n \n .gleap-tour-popover-close-btn {\n all: unset;\n position: absolute;\n top: 5px;\n right: 5px;\n width: 32px;\n height: 32px;\n cursor: pointer;\n font-size: 30px;\n font-weight: 500;\n line-height: 32px;\n color: ').concat(f?m:"#d2d2d2",";\n z-index: 1;\n text-align: center;\n transition: color;\n transition-duration: 200ms;\n }\n \n .gleap-tour-popover-close-btn:hover,\n .gleap-tour-popover-close-btn:focus {\n color: ").concat(w,';\n }\n \n .gleap-tour-popover-title[style*="block"] + .gleap-tour-popover-description {\n margin-top: 5px;\n }\n \n .gleap-tour-popover-description {\n margin-bottom: 0;\n font: 15px / normal sans-serif;\n line-height: 1.5;\n font-weight: 400;\n zoom: 1;\n }\n \n .gleap-tour-popover-footer {\n margin-top: 15px;\n text-align: right;\n zoom: 1;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n \n .gleap-tour-popover-progress-text {\n font-size: 13px;\n font-weight: 400;\n color: ').concat(f?m:"#727272",";\n zoom: 1;\n }\n \n .gleap-tour-popover-footer button {\n background-color: ").concat(e,";\n color: ").concat(u,";\n border-radius: ").concat(C,"px;\n box-sizing: border-box;\n padding: 10px 20px;\n font-size: 14px;\n font-weight: bold;\n line-height: 21px;\n border: none;\n text-align: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: none !important;\n outline: none !important;\n }\n\n .gleap-tour-popover-prev-btn {\n color: ").concat(p," !important;\n background-color: ").concat(v," !important;\n margin-right: 3px;\n }\n\n .gleap-tour-popover-prev-btn:hover {\n background-color: ").concat(e,"22 !important;\n color: ").concat(e,' !important;\n }\n \n .gleap-tour-popover-footer .gleap-tour-popover-btn-disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n \n .gleap-tour-no-interaction, .gleap-tour-no-interaction * {\n pointer-events: none !important;\n }\n \n .gleap-tour-popover-navigation-btns {\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n gap: 4px;\n }\n \n .gleap-tour-popover-arrow {\n content: "";\n position: absolute;\n border: 5px solid ').concat(b,";\n }\n \n .gleap-tour-popover-arrow-side-over {\n display: none;\n }\n \n /** Popover Arrow Sides **/\n .gleap-tour-popover-arrow-side-left {\n left: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-right {\n right: 100%;\n border-left-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-top {\n top: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-bottom {\n bottom: 100%;\n border-left-color: transparent;\n border-top-color: transparent;\n border-right-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-center {\n display: none;\n }\n \n /* Left/Start + Right/Start */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-start {\n top: 15px;\n }\n \n /* Top/Start + Bottom/Start */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-start {\n left: 15px;\n }\n \n /* End/Left + End/Right */\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-left,\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-right {\n bottom: 15px;\n }\n \n /* Top/End + Bottom/End */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-end,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-end {\n right: 15px;\n }\n \n /* Left/Center + Right/Center */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-center {\n top: 50%;\n margin-top: -5px;\n }\n \n /* Top/Center + Bottom/Center */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-center {\n left: 50%;\n margin-left: -5px;\n }\n \n /* No arrow */\n .gleap-tour-popover-arrow-none {\n display: none;\n } \n\n /* Modal styles */\n .gleap-modal-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ").concat(2147483640,";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Invisible until the card inside the frame reports its height. Before that the frame is an\n empty box, and a bootstrap that fails silently must not leave a blank white card behind. */\n .gleap-modal-wrapper--loading {\n visibility: hidden;\n }\n\n .gleap-modal-wrapper--loading .gleap-modal {\n animation-name: none;\n }\n\n .gleap-modal-backdrop {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: ").concat(2147483641,";\n }\n\n .gleap-modal {\n position: relative;\n width: 90%;\n max-width: 600px;\n max-height: 90vh;\n z-index: ").concat(2147483700,";\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n overflow: hidden;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n }\n\n .gleap-modal-frame {\n width: 100%;\n border: none;\n display: block;\n outline: none;\n }\n\n body.gleap-modal-open {\n overflow: hidden;\n }\n\n /* Agent Popup styles */\n .gleap-agent-popup-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ").concat(2147483640,";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .gleap-agent-popup-backdrop {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: ").concat(2147483641,";\n }\n\n .gleap-agent-popup {\n position: relative;\n width: 95%;\n max-width: 700px;\n height: 85vh;\n max-height: 800px;\n z-index: ").concat(2147483700,";\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n overflow: hidden;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n }\n\n .gleap-agent-popup-frame {\n width: 100%;\n height: 100%;\n border: none;\n display: block;\n outline: none;\n }\n\n body.gleap-agent-popup-open {\n overflow: hidden;\n }\n\n @keyframes gleapFadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 20px, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n .gleap-admin-frame-container,\n .gleap-frame-container,\n .bb-feedback-button,\n .gleap-notification-container,\n .gleap-tooltip,\n .gleap-ai-ui-widget {\n pointer-events: auto !important;\n }\n "),O=document.querySelector(".gleap-styles");O&&O.remove();var A=document.createElement("style");W(A),A.innerHTML=L,A.className="gleap-styles",document.body.appendChild(A)}(e,t,n,o,r,i,a,s,c,l)}))}},{key:"sendSilentCrashReport",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MEDIUM",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{screenshot:!0,replays:!0,attachments:!0};return e.sendSilentCrashReportWithFormData({description:t},n,r)}},{key:"sendSilentCrashReportWithFormData",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MEDIUM",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{screenshot:!0,replays:!0,attachments:!0};if(!this.silentCrashReportSent){this.silentCrashReportSent=!0,setTimeout((function(){t.silentCrashReportSent=!1}),1e4);var o=r?ee(r):{},i=vs.getInstance();if(i.ready){var a=e||{};i.session.email&&(a.reportedBy=i.session.email),new _s("CRASH",n,a,!0,o).sendFeedback().then((function(){})).catch((function(e){}))}}}},{key:"showSurvey",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"survey";e.startFeedbackFlowWithOptions(t,{hideBackButton:!0,format:n},!0)}},{key:"startClassicForm",value:function(t,n){e.startFeedbackFlowWithOptions(t,{hideBackButton:!n})}},{key:"startFeedbackFlow",value:function(t,n){e.startFeedbackFlowWithOptions(t,{hideBackButton:!n})}},{key:"startFeedbackFlowWithOptions",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n.autostartDrawing,i=n.hideBackButton,a=n.format;if(vs.getInstance().ready){e.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY});var s="start-feedbackflow";r&&(s="start-survey"),zs.getInstance().setAppMode(r?a:"widget"),zs.getInstance().sendMessage({name:s,data:{flow:t,hideBackButton:i,format:a}},!0),o?zs.getInstance().showDrawingScreen("screenshot"):zs.getInstance().showWidget()}}},{key:"openConversations",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-conversations",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"openConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-conversation",data:{shareToken:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"startConversation",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.startBot("",t)}},{key:"startBot",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"start-bot",data:{botId:e||"",hideBackButton:!t}},!0),zs.getInstance().showWidget()}},{key:"askAI",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"ask-ai",data:{question:e,hideBackButton:!t}},!0),zs.getInstance().showWidget()}},{key:"sendAgentMessage",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e||!t)return Promise.reject(new Error("agentId and message are required."));var r={messages:[{role:"user",content:t.trim()}]};return n.conversationId&&(r.conversationId=n.conversationId),n.additionalContext&&(r.additionalContext=n.additionalContext),new Promise((function(t,o){var i="",a=n.conversationId||null,s=null;x.getInstance().streamAgent(e,r,{onMeta:function(e){e.conversationId&&(a=e.conversationId),e.runId&&(s=e.runId)},onToken:function(e){i+=e.content||"",n.onToken&&n.onToken(e)},onDone:function(e){t({runId:s||(null==e?void 0:e.runId),status:(null==e?void 0:e.status)||"completed",response:i||(null==e?void 0:e.response)||"",conversationId:a})},onError:function(e){o(e)},onToolStart:function(){},onToolEnd:function(){}})}))}},{key:"clearAgentConversation",value:function(){x.getInstance().clearCache()}},{key:"createAgentChat",value:function(e){return new bt(e)}},{key:"openHelpCenterCollection",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-help-collection",data:{collectionId:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"openHelpCenterArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-help-article",data:{articleId:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"openHelpCenter",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-helpcenter",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"searchHelpCenter",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-helpcenter-search",data:{term:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"openNewsArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-news-article",data:{id:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"openChecklists",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-checklists",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"startChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return!!e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"start-checklist",data:$f({outboundId:e,hideBackButton:!t},n?{sharedKey:n}:{})},!0),zs.getInstance().showWidget(),!0)}},{key:"openChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-checklist",data:{id:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"getChecklistData",value:function(e,t){if(!e)return Promise.reject(new Error("outboundId is required"));var n=A.getInstance();return n.validateChecklist(e,t).then((function(e){return n.fetchChecklist(e)}))}},{key:"openNews",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-news",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"openFeatureRequests",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-feature-requests",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"startProductTour",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;vs.getInstance().startProductTourConfig(e).then((function(r){var o;!t||null==r||!r.startURL||null!==(o=window)&&void 0!==o&&null!==(o=o.location)&&void 0!==o&&null!==(o=o.href)&&void 0!==o&&o.includes(null==r?void 0:r.baseURL)?n.startProductTourWithConfig(e,r,!0):window.location.href="".concat(r.startURL,"?gleap_tour=").concat(e,"&gleap_tour_delay=1")})).catch((function(e){}))}},{key:"checkForUncompletedTour",value:function(){var e=nu.getInstance().loadUncompletedTour();e&&nu.getInstance().startWithConfig(e.tourId,e.tourData,500)}},{key:"startProductTourWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];nu.getInstance().startWithConfig(e,t,0,n)}},{key:"showBanner",value:function(e){try{Wn.getInstance().showBanner(e)}catch(t){}}},{key:"showModal",value:function(e){try{gc.getInstance().showModal(e)}catch(t){}}},{key:"showNotification",value:function(e){bl.getInstance().showNotification(e)}}],n&&Jf(t.prototype,n),r&&Jf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();if(Yf(Qf,"invoked",!0),Yf(Qf,"silentCrashReportSent",!1),Yf(Qf,"instance",void 0),"undefined"!=typeof window){var eh=window.GleapActions;if(eh&&eh.length>0)for(var th=0;th {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","/**\n * Shared SSE (Server-Sent Events) stream parser.\n *\n * Reads a fetch Response body as an SSE stream and dispatches\n * parsed events to callbacks. Used by both the JavaScript SDK\n * and the Gleap Frontend dashboard.\n *\n * @example\n * import { parseSSEStream, dispatchSSEEvent } from 'gleap/sse'; // or from './GleapSSEParser'\n *\n * const response = await fetch(url, { method: 'POST', ... });\n * await parseSSEStream(response, {\n * onMeta: (data) => { ... },\n * onToken: (data) => { ... },\n * onDone: (data) => { ... },\n * onError: (data) => { ... },\n * });\n */\n\n/**\n * Dispatch a single parsed SSE event to the appropriate callback.\n *\n * @param {string} event - Event type: 'meta', 'token', 'tool_start', 'tool_end', 'done', 'error'\n * @param {object} data - Parsed JSON data\n * @param {object} callbacks - { onMeta, onToken, onToolStart?, onToolEnd?, onDone, onError }\n */\nexport const dispatchSSEEvent = (event, data, callbacks) => {\n switch (event) {\n case 'meta': callbacks.onMeta?.(data); break;\n case 'token': callbacks.onToken?.(data); break;\n case 'tool_start': callbacks.onToolStart?.(data); break;\n case 'tool_end': callbacks.onToolEnd?.(data); break;\n case 'done': callbacks.onDone?.(data); break;\n case 'error': callbacks.onError?.(data); break;\n case 'handoff': callbacks.onHandoff?.(data); break;\n }\n};\n\n/**\n * Parse an SSE stream from a fetch Response and dispatch events to callbacks.\n *\n * @param {Response} response - A fetch Response with a readable body (text/event-stream).\n * @param {object} callbacks - { onMeta, onToken, onToolStart?, onToolEnd?, onDone, onError }\n * @returns {Promise}\n */\nexport const parseSSEStream = async (response, callbacks) => {\n if (!response.body) {\n callbacks.onError?.({ message: 'No response body.' });\n return;\n }\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let buffer = '';\n let currentEvent = '';\n let currentData = '';\n\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n\n buffer += decoder.decode(value, { stream: true });\n const lines = buffer.split('\\n');\n buffer = lines.pop() ?? '';\n\n for (const line of lines) {\n const trimmed = line.replace(/\\r$/, '');\n\n if (trimmed.startsWith('event: ')) {\n currentEvent = trimmed.slice(7).trim();\n } else if (trimmed.startsWith('data: ')) {\n currentData += (currentData ? '\\n' : '') + trimmed.slice(6);\n } else if (trimmed === '') {\n if (currentEvent && currentData) {\n try {\n const parsed = JSON.parse(currentData);\n dispatchSSEEvent(currentEvent, parsed, callbacks);\n } catch { /* skip malformed event */ }\n }\n currentEvent = '';\n currentData = '';\n }\n }\n }\n\n // Flush any remaining buffered event\n if (currentEvent && currentData) {\n try {\n const parsed = JSON.parse(currentData);\n dispatchSSEEvent(currentEvent, parsed, callbacks);\n } catch { /* skip */ }\n }\n } catch (err) {\n if (err?.name !== 'AbortError') {\n callbacks.onError?.({ message: 'Stream interrupted.' });\n }\n }\n};\n","import { GleapSession, GleapTranslationManager } from './Gleap';\nimport { parseSSEStream } from './GleapSSEParser';\n\nconst RequestStatus = {\n PENDING: 'pending',\n SUCCESS: 'success',\n ERROR: 'error',\n};\n\nclass AgentNetworkManager {\n static instance = null;\n\n /** @private {Map} agentId -> true if currently executing */\n executeInFlight = new Map();\n\n /** @private {Map} */\n messagesCache = new Map();\n /** @private {Map} */\n messagesRequests = new Map();\n\n constructor() {\n if (AgentNetworkManager.instance) {\n return AgentNetworkManager.instance;\n }\n AgentNetworkManager.instance = this;\n }\n\n static getInstance() {\n if (!AgentNetworkManager.instance) {\n AgentNetworkManager.instance = new AgentNetworkManager();\n }\n return AgentNetworkManager.instance;\n }\n\n clearCache() {\n this.messagesCache.clear();\n this.messagesRequests.clear();\n this.executeInFlight.clear();\n }\n\n /** @private */\n _getApiUrl() {\n const s = GleapSession.getInstance();\n return s?.apiUrl || null;\n }\n\n /** @private — build auth headers for fetch */\n _getHeaders() {\n const s = GleapSession.getInstance();\n const headers = { 'Content-Type': 'application/json' };\n if (s?.sdkKey) headers['Api-Token'] = s.sdkKey;\n if (s?.session?.gleapId) headers['Gleap-Id'] = s.session.gleapId;\n if (s?.session?.gleapHash) headers['Gleap-Hash'] = s.session.gleapHash;\n return headers;\n }\n\n /** @private — XHR for non-streaming requests */\n _makeRequest(method, url, data) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(method, url);\n const s = GleapSession.getInstance();\n s?.injectSession(xhr);\n if (data) xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300) {\n try {\n resolve(xhr.responseText ? JSON.parse(xhr.responseText) : null);\n } catch (err) {\n reject({ status: xhr.status, statusText: 'JSON Parse Error', error: err });\n }\n } else {\n reject({ status: xhr.status, statusText: xhr.statusText, responseText: xhr.responseText });\n }\n }\n };\n xhr.onerror = () => reject({ status: 0, statusText: 'Network Error' });\n xhr.send(data ? JSON.stringify(data) : null);\n });\n }\n\n /**\n * Stream an agent execution via SSE.\n *\n * @param {string} agentId\n * @param {object} body - { messages, conversationId?, additionalContext? }\n * @param {object} callbacks - { onMeta, onToken, onDone, onError, onToolStart?, onToolEnd? }\n * @param {AbortSignal} [signal] - optional abort signal\n * @returns {Promise}\n */\n async streamAgent(agentId, body, callbacks, signal) {\n if (this.executeInFlight.get(agentId)) return;\n this.executeInFlight.set(agentId, true);\n\n const apiUrl = this._getApiUrl();\n if (!apiUrl) {\n this.executeInFlight.delete(agentId);\n callbacks.onError?.({ message: 'Gleap API URL not configured.' });\n return;\n }\n\n const url = `${apiUrl}/v3/shared/agents/${agentId}/stream`;\n const headers = { ...this._getHeaders(), Accept: 'text/event-stream' };\n\n let response;\n try {\n response = await fetch(url, {\n method: 'POST',\n headers,\n body: JSON.stringify(body),\n signal,\n });\n } catch (err) {\n this.executeInFlight.delete(agentId);\n if (err?.name === 'AbortError') return;\n callbacks.onError?.({ message: 'Failed to connect to agent.' });\n return;\n }\n\n if (!response.ok) {\n this.executeInFlight.delete(agentId);\n callbacks.onError?.({ message: `Server error: ${response.status}` });\n return;\n }\n\n // Use shared SSE parser\n await parseSSEStream(response, callbacks);\n\n // Invalidate caches\n if (body.conversationId) this._invalidateMessagesCache(body.conversationId);\n this.executeInFlight.delete(agentId);\n }\n\n /**\n * Non-streaming execute (fallback).\n */\n executeAgent(agentId, body) {\n if (this.executeInFlight.get(agentId)) {\n return Promise.reject(new Error('Agent execution already in progress.'));\n }\n\n const apiUrl = this._getApiUrl();\n if (!apiUrl) return Promise.reject(new Error('AgentNetworkManager: Gleap API URL not configured.'));\n\n this.executeInFlight.set(agentId, true);\n const url = `${apiUrl}/v3/shared/agents/${agentId}/execute`;\n return this._makeRequest('POST', url, body)\n .then((responseData) => {\n if (body.conversationId) this._invalidateMessagesCache(body.conversationId);\n if (responseData?.conversationId) this._invalidateMessagesCache(responseData.conversationId);\n return responseData;\n })\n .finally(() => { this.executeInFlight.delete(agentId); });\n }\n\n getConversationMessages(agentId, conversationId, limit = 50, skip = 0) {\n if (agentId === 'kai') return Promise.resolve({ messages: [] });\n\n const cacheKey = `${conversationId}:${limit}:${skip}`;\n const cached = this.messagesCache.get(cacheKey);\n if (cached) {\n return cached.status === RequestStatus.SUCCESS\n ? Promise.resolve(JSON.parse(JSON.stringify(cached.data)))\n : Promise.reject(cached.error);\n }\n if (this.messagesRequests.has(cacheKey)) {\n return this.messagesRequests.get(cacheKey).then((d) => JSON.parse(JSON.stringify(d)));\n }\n\n const apiUrl = this._getApiUrl();\n if (!apiUrl) return Promise.reject(new Error('AgentNetworkManager: Gleap API URL not configured.'));\n\n const url = `${apiUrl}/v3/shared/agents/${agentId}/conversations/${conversationId}/messages?limit=${limit}&skip=${skip}`;\n const p = this._makeRequest('GET', url, null)\n .then((d) => { this.messagesCache.set(cacheKey, { status: RequestStatus.SUCCESS, data: d }); return JSON.parse(JSON.stringify(d)); })\n .catch((e) => { this.messagesCache.set(cacheKey, { status: RequestStatus.ERROR, error: e }); throw e; })\n .finally(() => { this.messagesRequests.delete(cacheKey); });\n\n this.messagesRequests.set(cacheKey, p);\n return p.then((d) => JSON.parse(JSON.stringify(d)));\n }\n\n getConversations(agentId, limit = 10, skip = 0) {\n if (agentId === 'kai') return Promise.resolve({ conversations: [] });\n\n const apiUrl = this._getApiUrl();\n if (!apiUrl) return Promise.reject(new Error('AgentNetworkManager: Gleap API URL not configured.'));\n return this._makeRequest('GET', `${apiUrl}/v3/shared/agents/${agentId}/conversations?limit=${limit}&skip=${skip}`, null);\n }\n\n /** @private */\n _invalidateMessagesCache(conversationId) {\n for (const key of this.messagesCache.keys()) {\n if (key.startsWith(conversationId + ':')) this.messagesCache.delete(key);\n }\n for (const key of this.messagesRequests.keys()) {\n if (key.startsWith(conversationId + ':')) this.messagesRequests.delete(key);\n }\n }\n}\n\nexport default AgentNetworkManager;\n","import { GleapSession, GleapTranslationManager } from './Gleap'; // Adjust path if needed\n\n// Enum for request states\nconst RequestStatus = {\n PENDING: 'pending',\n SUCCESS: 'success',\n ERROR: 'error',\n};\n\nclass ChecklistNetworkManager {\n static instance = null;\n\n /** @private {Map>} outboundId -> Promise */\n validationRequests = new Map();\n /** @private {Map} */\n validationCache = new Map(); // Caches final results (success/error)\n\n /** @private {Map>} internalId -> Promise */\n fetchRequests = new Map();\n /** @private {Map} */\n fetchCache = new Map(); // Caches final results (success/error)\n\n // Private constructor for Singleton\n constructor() {\n if (ChecklistNetworkManager.instance) {\n return ChecklistNetworkManager.instance;\n }\n ChecklistNetworkManager.instance = this;\n }\n\n /**\n * Gets the singleton instance of the ChecklistNetworkManager.\n * @returns {ChecklistNetworkManager} The singleton instance.\n */\n static getInstance() {\n if (!ChecklistNetworkManager.instance) {\n ChecklistNetworkManager.instance = new ChecklistNetworkManager();\n }\n return ChecklistNetworkManager.instance;\n }\n\n clearCache() {\n this.validationCache.clear();\n this.fetchCache.clear();\n this.validationRequests.clear();\n this.fetchRequests.clear();\n }\n\n /**\n * @private\n * Gets common query parameters for API requests.\n * @returns {string} Query parameter string.\n */\n _getQueryParams() {\n const gleapSessionInstance = GleapSession.getInstance();\n const session = gleapSessionInstance?.session;\n const lang = GleapTranslationManager.getInstance().getActiveLanguage() || 'en';\n return `gleapId=${session?.gleapId || ''}&gleapHash=${session?.gleapHash || ''}&lang=${lang}`;\n }\n\n /**\n * @private\n * Gets the API base URL.\n * @returns {string | null} The API URL or null if not configured.\n */\n _getApiUrl() {\n const gleapSessionInstance = GleapSession.getInstance();\n return gleapSessionInstance?.apiUrl || null;\n }\n\n /**\n * @private\n * Makes an XMLHttpRequest and returns a Promise.\n * @param {string} method - HTTP method.\n * @param {string} url - The request URL.\n * @param {object|null} data - Data to send in the request body.\n * @returns {Promise} Promise resolving with parsed JSON response on success, rejecting on error.\n */\n _makeRequest(method, url, data) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(method, url);\n\n const gleapSessionInstance = GleapSession.getInstance();\n gleapSessionInstance?.injectSession(xhr); // Inject session headers\n\n if (data) {\n xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n }\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300) {\n try {\n // Handle potential empty success responses (e.g., 204)\n const responseData = xhr.responseText ? JSON.parse(xhr.responseText) : null;\n resolve(responseData);\n } catch (err) {\n reject({\n status: xhr.status,\n statusText: 'JSON Parse Error',\n responseText: xhr.responseText,\n error: err,\n });\n }\n } else {\n reject({\n status: xhr.status,\n statusText: xhr.statusText,\n responseText: xhr.responseText,\n });\n }\n }\n };\n\n xhr.onerror = () => {\n reject({ status: 0, statusText: 'Network Error', responseText: null });\n };\n\n xhr.send(data ? JSON.stringify(data) : null);\n });\n }\n\n /**\n * @private\n * Creates a cache key from outboundId and sharedKey\n * @param {string} outboundId - The public/outbound checklist ID.\n * @param {string|undefined} sharedKey - Optional shared key.\n * @returns {string} Combined cache key.\n */\n _createCacheKey(outboundId, sharedKey) {\n return sharedKey ? `${outboundId}::${sharedKey}` : outboundId;\n }\n\n /**\n * Validates an outbound checklist ID, returning a Promise for the internal ID.\n * Manages caching and deduplicates requests.\n * @param {string} outboundId - The public/outbound checklist ID.\n * @param {string} [sharedKey] - Optional shared key for the checklist.\n * @returns {Promise} A promise that resolves with the internal checklist ID.\n */\n validateChecklist(outboundId, sharedKey) {\n const cacheKey = this._createCacheKey(outboundId, sharedKey);\n\n // 1. Check cache for final result (success or error)\n const cachedResult = this.validationCache.get(cacheKey);\n if (cachedResult) {\n if (cachedResult.status === RequestStatus.SUCCESS) {\n return Promise.resolve(cachedResult.internalId);\n } else {\n return Promise.reject(cachedResult.error);\n }\n }\n\n // 2. Check for an ongoing request\n if (this.validationRequests.has(cacheKey)) {\n return this.validationRequests.get(cacheKey);\n }\n\n // 3. Start a new request\n const apiUrl = this._getApiUrl();\n if (!apiUrl) {\n const error = new Error('ChecklistNetworkManager: Gleap API URL not configured.');\n this.validationCache.set(cacheKey, {\n status: RequestStatus.ERROR,\n error,\n });\n return Promise.reject(error);\n }\n\n const url = `${apiUrl}/outbound/checklists?${this._getQueryParams()}`;\n const requestPromise = this._makeRequest('POST', url, {\n outboundId,\n sharedKey,\n })\n .then((responseData) => {\n if (responseData && responseData.id) {\n this.validationCache.set(cacheKey, {\n status: RequestStatus.SUCCESS,\n internalId: responseData.id,\n });\n return responseData.id;\n } else {\n const error = new Error('Validation response missing checklist ID.');\n this.validationCache.set(cacheKey, {\n status: RequestStatus.ERROR,\n error: responseData || error,\n });\n throw error; // Rethrow to be caught by catch block\n }\n })\n .catch((error) => {\n // Store the error object itself in the cache\n this.validationCache.set(cacheKey, {\n status: RequestStatus.ERROR,\n error,\n });\n throw error; // Re-throw so callers can catch it\n })\n .finally(() => {\n // Remove from pending requests map once done (success or fail)\n this.validationRequests.delete(cacheKey);\n });\n\n // Store the promise for potential concurrent requests\n this.validationRequests.set(cacheKey, requestPromise);\n return requestPromise;\n }\n\n /**\n * Fetches the full checklist data using the internal ID, returning a Promise.\n * Manages caching and deduplicates requests.\n * @param {string} internalId - The internal checklist ID.\n * @returns {Promise} A promise that resolves with the full checklist data.\n */\n fetchChecklist(internalId) {\n // 1. Check cache for final result (success or error)\n const cachedResult = this.fetchCache.get(internalId);\n if (cachedResult) {\n if (cachedResult.status === RequestStatus.SUCCESS) {\n // Return a deep copy to prevent mutation issues if multiple components use it\n return Promise.resolve(JSON.parse(JSON.stringify(cachedResult.data)));\n } else {\n return Promise.reject(cachedResult.error);\n }\n }\n\n // 2. Check for an ongoing request\n if (this.fetchRequests.has(internalId)) {\n // Return a promise that resolves with a deep copy\n return this.fetchRequests.get(internalId).then((data) => JSON.parse(JSON.stringify(data)));\n }\n\n // 3. Start a new request\n const apiUrl = this._getApiUrl();\n if (!apiUrl) {\n const error = new Error('ChecklistNetworkManager: Gleap API URL not configured.');\n this.fetchCache.set(internalId, { status: RequestStatus.ERROR, error });\n return Promise.reject(error);\n }\n\n const url = `${apiUrl}/outbound/checklists/${internalId}?convertTipTap=true&${this._getQueryParams()}`;\n const requestPromise = this._makeRequest('GET', url, null)\n .then((responseData) => {\n if (responseData) {\n // Cache the successful data\n this.fetchCache.set(internalId, {\n status: RequestStatus.SUCCESS,\n data: responseData,\n });\n // Return a deep copy of the data\n return JSON.parse(JSON.stringify(responseData));\n } else {\n // Should not happen with successful GET usually, but handle defensively\n const error = new Error('Empty response received for checklist fetch.');\n this.fetchCache.set(internalId, {\n status: RequestStatus.ERROR,\n error: responseData || error,\n });\n throw error;\n }\n })\n .catch((error) => {\n this.fetchCache.set(internalId, { status: RequestStatus.ERROR, error });\n throw error; // Re-throw so callers can catch it\n })\n .finally(() => {\n // Remove from pending requests map once done (success or fail)\n this.fetchRequests.delete(internalId);\n });\n\n this.fetchRequests.set(internalId, requestPromise);\n // Return a promise that resolves with a deep copy\n return requestPromise.then((data) => JSON.parse(JSON.stringify(data)));\n }\n}\n\nexport default ChecklistNetworkManager;\n","import {\n GleapFrameManager,\n GleapConfigManager,\n GleapNotificationManager,\n GleapTranslationManager,\n GleapAiChatbarManager,\n GleapSession,\n} from './Gleap';\nimport { loadIcon } from './UI';\n\nexport default class GleapFeedbackButtonManager {\n feedbackButton = null;\n injectedFeedbackButton = false;\n buttonHidden = null;\n lastButtonIcon = null;\n showingRedDot = false;\n removePressListeners = null;\n\n // Feedback button types\n static FEEDBACK_BUTTON_BOTTOM_RIGHT = 'BOTTOM_RIGHT';\n static FEEDBACK_BUTTON_BOTTOM_LEFT = 'BOTTOM_LEFT';\n static FEEDBACK_BUTTON_CLASSIC = 'BUTTON_CLASSIC';\n static FEEDBACK_BUTTON_CLASSIC_LEFT = 'BUTTON_CLASSIC_LEFT';\n static FEEDBACK_BUTTON_CLASSIC_BOTTOM = 'BUTTON_CLASSIC_BOTTOM';\n static FEEDBACK_BUTTON_NONE = 'BUTTON_NONE';\n\n // GleapFeedbackButtonManager singleton\n static instance;\n static getInstance() {\n if (!this.instance) {\n this.instance = new GleapFeedbackButtonManager();\n }\n return this.instance;\n }\n\n destroy() {\n if (this.removePressListeners) {\n this.removePressListeners();\n this.removePressListeners = null;\n }\n\n if (this.feedbackButton) {\n this.feedbackButton.remove();\n this.feedbackButton = null;\n }\n\n this.buttonHidden = null;\n this.lastButtonIcon = null;\n this.injectedFeedbackButton = false;\n this.instance = null;\n }\n\n /**\n * Toggles the feedback button visibility.\n * @param {*} show\n * @returns\n */\n toggleFeedbackButton(show) {\n this.buttonHidden = !show;\n\n GleapFeedbackButtonManager.getInstance().updateFeedbackButtonState();\n GleapNotificationManager.getInstance().updateContainerStyle();\n }\n\n updateRedDot(show) {\n var frameManager = GleapFrameManager.getInstance();\n if (!this.feedbackButton || this.buttonHidden || frameManager.isOpened()) {\n return;\n }\n\n const redDotClass = 'bb-feedback-button--red-dot';\n const existingDot = this.feedbackButton.querySelector(`.${redDotClass}`);\n\n if (show) {\n if (!existingDot) {\n const dot = document.createElement('div');\n dot.className = redDotClass;\n this.feedbackButton.appendChild(dot);\n }\n } else {\n if (existingDot) {\n existingDot.remove();\n }\n }\n }\n\n feedbackButtonPressed() {\n var frameManager = GleapFrameManager.getInstance();\n if (frameManager.isOpened()) {\n frameManager.hideWidget();\n this.updateRedDot(this.showingRedDot);\n } else {\n frameManager.setAppMode('widget');\n frameManager.showWidget();\n this.updateRedDot(false);\n }\n }\n\n /**\n * Injects the feedback button into the current DOM.\n */\n injectFeedbackButton() {\n if (this.injectedFeedbackButton) {\n return;\n }\n this.injectedFeedbackButton = true;\n\n var elem = document.createElement('div');\n elem.addEventListener('click', () => {\n this.feedbackButtonPressed();\n });\n this.attachPressAnimation(elem);\n document.body.appendChild(elem);\n this.feedbackButton = elem;\n\n this.updateFeedbackButtonState();\n }\n\n /**\n * Scales the icon button down while held and springs it back on release.\n * The release listeners sit on the document so a press that ends outside\n * the button (drag off, cancelled touch) still springs back — it just\n * doesn't toggle the widget, since no click fires in that case.\n */\n attachPressAnimation(elem) {\n const pressedClass = 'bb-feedback-button--pressed';\n const springingClass = 'bb-feedback-button--springing';\n var springingTimeout = null;\n\n const press = () => {\n clearTimeout(springingTimeout);\n elem.classList.remove(springingClass);\n elem.classList.add(pressedClass);\n };\n\n const release = () => {\n if (!elem.classList.contains(pressedClass)) {\n return;\n }\n elem.classList.remove(pressedClass);\n elem.classList.add(springingClass);\n springingTimeout = setTimeout(() => {\n elem.classList.remove(springingClass);\n }, 550);\n };\n\n if (window.PointerEvent) {\n elem.addEventListener('pointerdown', press);\n document.addEventListener('pointerup', release);\n document.addEventListener('pointercancel', release);\n this.removePressListeners = () => {\n document.removeEventListener('pointerup', release);\n document.removeEventListener('pointercancel', release);\n };\n } else {\n elem.addEventListener('mousedown', press);\n elem.addEventListener('touchstart', press, { passive: true });\n document.addEventListener('mouseup', release);\n document.addEventListener('touchend', release);\n document.addEventListener('touchcancel', release);\n this.removePressListeners = () => {\n document.removeEventListener('mouseup', release);\n document.removeEventListener('touchend', release);\n document.removeEventListener('touchcancel', release);\n };\n }\n }\n\n updateNotificationBadge(count) {\n const notificationBadge = document.querySelector('.bb-notification-bubble');\n if (!notificationBadge) {\n return;\n }\n\n const notificationHiddenClass = 'bb-notification-bubble--hidden';\n if (count > 0 && !GleapFrameManager.getInstance().isOpened()) {\n notificationBadge.classList.remove(notificationHiddenClass);\n notificationBadge.innerText = count;\n } else {\n notificationBadge.classList.add(notificationHiddenClass);\n }\n }\n\n refresh() {\n const feedbackButton = document.querySelector('.bb-feedback-button');\n if (feedbackButton) {\n this.updateFeedbackButtonText();\n this.updateFeedbackButtonState();\n } else {\n this.injectedFeedbackButton = false;\n this.feedbackButton = null;\n this.buttonHidden = null;\n this.lastButtonIcon = null;\n this.injectFeedbackButton();\n }\n }\n\n updateFeedbackButtonText() {\n const flowConfig = GleapConfigManager.getInstance().getFlowConfig();\n\n if (\n !(\n flowConfig.feedbackButtonPosition === GleapFeedbackButtonManager.FEEDBACK_BUTTON_CLASSIC ||\n flowConfig.feedbackButtonPosition === GleapFeedbackButtonManager.FEEDBACK_BUTTON_CLASSIC_BOTTOM ||\n flowConfig.feedbackButtonPosition === GleapFeedbackButtonManager.FEEDBACK_BUTTON_CLASSIC_LEFT\n )\n ) {\n return;\n }\n\n const feedbackButton = document.querySelector('.bb-feedback-button-classic');\n if (!feedbackButton) {\n return;\n }\n\n feedbackButton.innerText = flowConfig.widgetButtonText;\n }\n\n /**\n * Updates the feedback button state\n * @returns\n */\n updateFeedbackButtonState() {\n GleapAiChatbarManager.getInstance().updateUIVisibility();\n\n if (this.feedbackButton === null) {\n return;\n }\n\n const flowConfig = GleapConfigManager.getInstance().getFlowConfig();\n\n var buttonIcon = '';\n if (flowConfig.buttonLogo) {\n buttonIcon = `\"Feedback`;\n } else {\n buttonIcon = loadIcon('button', '#fff');\n }\n\n // Opening the widget re-runs this while the release spring is mid-flight;\n // the wholesale className reset must not swallow the press animation classes.\n const pressAnimationClasses = ['bb-feedback-button--pressed', 'bb-feedback-button--springing'].filter(\n (className) => this.feedbackButton.classList.contains(className)\n );\n this.feedbackButton.className = 'bb-feedback-button gleap-font rr-block';\n pressAnimationClasses.forEach((className) => this.feedbackButton.classList.add(className));\n this.feedbackButton.setAttribute('dir', GleapTranslationManager.getInstance().isRTLLayout ? 'rtl' : 'ltr');\n\n if (\n flowConfig.feedbackButtonPosition === GleapFeedbackButtonManager.FEEDBACK_BUTTON_CLASSIC ||\n flowConfig.feedbackButtonPosition === GleapFeedbackButtonManager.FEEDBACK_BUTTON_CLASSIC_BOTTOM ||\n flowConfig.feedbackButtonPosition === GleapFeedbackButtonManager.FEEDBACK_BUTTON_CLASSIC_LEFT\n ) {\n this.feedbackButton.classList.add('bb-feedback-button--classic-button-style');\n\n this.feedbackButton.innerHTML = `
${flowConfig.widgetButtonText}
`;\n } else {\n if (buttonIcon !== this.lastButtonIcon) {\n this.feedbackButton.innerHTML = `
${buttonIcon}${loadIcon(\n 'arrowdown',\n '#fff'\n )}
`;\n }\n }\n\n // Prevent dom update if not needed.\n this.lastButtonIcon = buttonIcon;\n\n var hideButton = false;\n if (GleapFeedbackButtonManager.getInstance().buttonHidden === null) {\n if (flowConfig.feedbackButtonPosition === GleapFeedbackButtonManager.FEEDBACK_BUTTON_NONE) {\n hideButton = true;\n }\n } else {\n if (GleapFeedbackButtonManager.getInstance().buttonHidden) {\n hideButton = true;\n }\n }\n if (hideButton) {\n this.feedbackButton.classList.add('bb-feedback-button--disabled');\n }\n\n if (flowConfig.feedbackButtonPosition === GleapFeedbackButtonManager.FEEDBACK_BUTTON_BOTTOM_LEFT) {\n this.feedbackButton.classList.add('bb-feedback-button--bottomleft');\n }\n\n if (GleapFrameManager.getInstance().isOpened()) {\n this.feedbackButton.classList.add('bb-feedback-button--open');\n }\n\n const appMode = GleapFrameManager.getInstance().appMode;\n if (appMode === 'survey' || appMode === 'survey_full' || appMode === 'survey_web') {\n this.feedbackButton.classList.add('bb-feedback-button--survey');\n }\n\n if (flowConfig.hideForGuests === true && !GleapSession.getInstance().isUser()) {\n this.feedbackButton.classList.add('bb-feedback-button--hidden');\n }\n }\n}\n","// A nonce ends up both as a DOM attribute and inside doc.write'd markup, so only a\n// conservative token charset is accepted — anything else could close the attribute and\n// inject markup into the bootstrapped document. This is the base64 alphabet plus the\n// url-safe variants real generators emit.\nconst CSP_NONCE_PATTERN = /^[A-Za-z0-9+/=_-]{1,256}$/;\n\nconst sanitizeCSPNonce = (nonce) => {\n if (typeof nonce !== 'string') {\n return null;\n }\n const trimmed = nonce.trim();\n return CSP_NONCE_PATTERN.test(trimmed) ? trimmed : null;\n};\n\n/**\n * Reads the nonce off the SDK's own ';\n\n // Inject the route-setter script BEFORE the first existing ';\n\n // Inject the route-setter script BEFORE the first existing ';\n\n // Inject the route-setter script BEFORE the first existing ';\n\n // Inject the route-setter script BEFORE the first existing ';\n\n // Inject the route-setter script BEFORE the first existing ';\n\n // Inject the route-setter script BEFORE the first existing ';\n\n // Inject the route-setter script BEFORE the first existing ';\n\n // Inject the route-setter script BEFORE the first existing ';\n\n // Inject the route-setter script BEFORE the first existing