diff --git a/CHANGELOG.md b/CHANGELOG.md index ca3ccad..9082507 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 19.1.0 Capture requests ("show me the issue"): when a workflow, an AI agent or a teammate asks the customer for a screenshot or a screen recording in a conversation, the customer answers from the card in the widget and the SDK captures the page. On desktop Chrome and Edge the screenshot is taken from the tab itself after one "Share this tab" confirmation (exact pixels); everywhere else, and when sharing is declined, the page is rendered in the browser. Screen recordings use the browser's screen sharing (MP4 where supported, otherwise WebM with its duration written in so players can seek), with the microphone if the project allows it; while recording, everything a screenshot masks is blurred on the page. When screen sharing doesn't start, and on phones and tablets, the customer can record the page instead (a page recording the dashboard plays like a session replay). Password, one-time-code and card fields, the `gl-mask` / `gl-block` / `rr-mask` / `rr-block` classes, the `setReplayOptions` privacy options, payment frames and the project's masked elements are left out. The capture bar is a small dark pill the customer can drag; all its texts come from the widget's translations. Logs requests: workflows, AI agents and teammates can collect the page's console logs, network logs, custom data, environment data and events in the background, the same data a bug report carries. They arrive over the SDK's websocket and are uploaded once, gzipped. New: `Gleap.setCaptureEnabled(enabled)` (off: the widget only offers a file upload) and `Gleap.setRemoteLogCollectionEnabled(enabled)` (off: logs requests are answered as unsupported and captures are sent without logs). diff --git a/build/browser/index.js b/build/browser/index.js index 166b553..dc1d113 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 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{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 R(r||[]);return a(i,"_invoke",{value:L(e,n,s)}),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var f="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(P([])));C&&C!==o&&i.call(C,c)&&(x=C);var E=k.prototype=b.prototype=Object.create(x);function I(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=h(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=f;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===f)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var l=h(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=h(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 R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function P(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:P(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);nYv});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,h,f,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(h=e.sent,f=h.done,g=h.value,!f){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(E){}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:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function h(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 f(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,h;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=f(f({},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===(h=r.onError)||void 0===h||h.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}();E(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 R(e,t){for(var n=0;n0&&!Jf.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=Gu.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(Rn.getInstance().updateUIVisibility(),null!==this.feedbackButton){var n=Gu.getInstance().getFlowConfig(),r="";r=n.buttonLogo?''):he("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",Fv.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(he("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"),Jf.getInstance().isOpened()&&this.feedbackButton.classList.add("bb-feedback-button--open");var a=Jf.getInstance().appMode;"survey"!==a&&"survey_full"!==a&&"survey_web"!==a||this.feedbackButton.classList.add("bb-feedback-button--survey"),!0!==n.hideForGuests||Cf.getInstance().isUser()||this.feedbackButton.classList.add("bb-feedback-button--hidden")}}}])&&R(t.prototype,n),r&&R(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 _(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)}P(N,"FEEDBACK_BUTTON_BOTTOM_RIGHT","BOTTOM_RIGHT"),P(N,"FEEDBACK_BUTTON_BOTTOM_LEFT","BOTTOM_LEFT"),P(N,"FEEDBACK_BUTTON_CLASSIC","BUTTON_CLASSIC"),P(N,"FEEDBACK_BUTTON_CLASSIC_LEFT","BUTTON_CLASSIC_LEFT"),P(N,"FEEDBACK_BUTTON_CLASSIC_BOTTOM","BUTTON_CLASSIC_BOTTOM"),P(N,"FEEDBACK_BUTTON_NONE","BUTTON_NONE"),P(N,"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}(),q=null,z=function(){return q||H},W=function(e){var t=z();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,$="gleap-frame-route-failed",X=function(e){return"string"==typeof e&&(0===e.indexOf("script-src")||0===e.indexOf("style-src"))},J=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=z(),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 h,f,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($)+"));}}catch(e){}<\/script>";h=//i.test(c)?c.replace(/<\/head>/i,g+""):c;try{f=e.contentDocument}catch(a){return o()}if(!f)return o();try{e.addEventListener($,o,{once:!0})}catch(a){}try{f.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&&X(o)&&"string"==typeof r&&0===r.indexOf(t.baseHref)&&(n=!0,t.onBlocked())}}))}catch(a){}}(f,{baseHref:n,onBlocked:o}),f.write(h),f.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()}))}},K=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"},he=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 fe(e){return fe="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},fe(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 Ee(e){return function(e){if(Array.isArray(e))return Ie(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 Ie(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 Ie(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 Ie(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 Pe(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 Ee(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 Ne(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(Ne.bind(null,e))}function _e(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=De(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=Re(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,h=i.NthChild;switch(c){case"ID":if(Boolean(l)&&Ne(e,l))return l;break;case"Tag":if(Boolean(u)&&Ne(e,u))return u;break;case"Class":if(Boolean(d)&&d.length&&(o=_e(e,d,u)))return o;break;case"Attributes":if(Boolean(p)&&p.length&&(o=_e(e,p,u)))return o;break;case"NthChild":if(Boolean(h))return h}}}catch(f){s.e(f)}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=Re(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 h=[],f=0,g=l;f ");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("|")),qe=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}},ze=/\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"],$e=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(he("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,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,lv.getInstance().disable(),ir.getInstance().disable(),xg.getInstance().disable(),Kv.close(),Kv.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){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&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:I(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",h="suspendedYield",f="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 E(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 I(t,n,r){var o=p;return function(i,a){if(o===f)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=f;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:h,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(ht(this._messages),[{id:"user-".concat(Date.now()),role:"user",content:n,createdAt:(new Date).toISOString()}]),r="stream-".concat(Date.now()),this._messages=[].concat(ht(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=Kv.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 zt(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=fn(null==t?void 0:t.lightBackgroundColor),this.darkBackgroundColor=fn(null==t?void 0:t.darkBackgroundColor),this.updateWatching(),this.notifyChange()}},{key:"getDashboardConfig",value:function(){try{return Gu.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!==fn(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?Kt(Kt({},e),{},{backgroundColor:this.lightBackgroundColor}):e;var n=Kt({},e);return cn.forEach((function(t){var r=en(t,2),o=r[0],i=r[1],a=fn(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 En(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 In(e){return In="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},In(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;Lv.getInstance().sendMessage({type:"chatbar-notification-cleared",gleapId:null===(t=Cf.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(Gu.getInstance().getFlowConfig()),aiTools:$t.getInstance().getAgentTools(),agentTools:$t.getInstance().getAgentTools(),overrideLanguage:Fv.getInstance().getOverrideLanguage()}})}},{key:"_normalizeAgentOptions",value:function(e){return e&&"object"===In(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=Gu.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=En(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=Cf.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=En(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;Jf.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=Gu.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,J(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 Pn(e){return Pn="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},Pn(e)}function Dn(e,t){for(var n=0;nHn,zn=["start-conversation","start-custom-action","start-product-tour","open-url","show-form","show-survey","show-news-article","show-help-article","show-checklist"],Wn=e=>{try{return-1!==zn.indexOf(e)&&Jf.getInstance().isCaptureHidden()}catch(t){return!1}},Gn=()=>{try{return"19.1.0"}catch(e){return""}},Vn=()=>{try{const e=Gu.getInstance().getFlowConfig();if(e&&e.capture&&"object"==typeof e.capture)return e.capture}catch(e){}return{}},$n=()=>{try{return"undefined"!=typeof navigator&&!!navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia}catch(e){return!1}},Xn=()=>{try{return"undefined"!=typeof navigator&&!!navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getUserMedia}catch(e){return!1}},Jn=()=>{try{const e=navigator,t=e.userAgentData;if(t&&Array.isArray(t.brands))return!t.mobile&&t.brands.some((e=>e&&/Chromium/i.test(e.brand)));const n=e.userAgent||"";return/\bChrome\/\d+/.test(n)&&!/Android|Mobile|CriOS|EdgiOS|FxiOS/i.test(n)}catch(e){return!1}},Kn=()=>$n()&&"undefined"!=typeof window&&"function"==typeof window.MediaRecorder?"display":"rrweb",Yn=()=>{if(!Un)return!1;try{return"undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof HTMLCanvasElement&&"undefined"!=typeof Element&&"function"==typeof Element.prototype.attachShadow}catch(e){return!1}},Zn=()=>{const e={version:1,platform:Bn,sdkType:Fn,sdkVersion:Gn(),screenshot:!1,recording:!1,annotate:!1};if(!Yn())return e;const t=Kn();return e.screenshot=!0,e.recording=!0,e.annotate=!0,e.recordingMethod=t,e.maxRecordingSec=180,e.microphone="display"===t&&!0===Vn().allowMicrophone&&Xn(),e};function Qn(e){return Qn="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},Qn(e)}function er(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 tr(e){for(var t=1;t',document.body.appendChild(t),this.bannerContainer=t;var n=t.querySelector(".gleap-b-frame");n&&J(n,this.bannerUrl)}},{key:"sendMessage",value:function(e){try{var t=document.querySelector(".gleap-b-frame");t&&t.contentWindow&&t.contentWindow.postMessage(JSON.stringify(tr(tr({},e),{},{type:"banner"})),"*")}catch(n){}}},{key:"showBanner",value:function(e){this.injectBannerUI(e)}}])&&nr(t.prototype,n),r&&nr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();rr(ir,"instance",void 0);var ar,sr=Object.defineProperty,cr=(e,t,n)=>((e,t,n)=>t in e?sr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),lr=(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))(lr||{}),ur=(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))(ur||{}),dr=(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))(dr||{}),pr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(pr||{}),hr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(hr||{}),fr=(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))(fr||{}),gr=(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))(gr||{});const mr={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},vr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},yr={},br={},wr=()=>!!globalThis.Zone;function kr(e){if(yr[e])return yr[e];const t=globalThis[e],n=t.prototype,r=e in mr?mr[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 vr?vr[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&&!wr())return yr[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",""),br[e]=()=>r.remove()):r.remove(),yr[e]=i}catch{return n}}const xr={};function Sr(e,t,n){var r;const o=`${e}.${String(n)}`;if(xr[o])return xr[o].call(t);const i=kr(e),a=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return a?(xr[o]=a,a.call(t)):t[n]}const Cr={};function Er(e,t,n){const r=`${e}.${String(n)}`;if(Cr[r])return Cr[r].bind(t);const o=kr(e)[n];return"function"!=typeof o?t[n]:(Cr[r]=o,o.bind(t))}function Ir(){return[kr("MutationObserver").constructor,br.MutationObserver??(()=>{})]}let Tr=Date.now;function Lr(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())||(Tr=()=>(new Date).getTime());const Or={ownerDocument:function(e){return Sr("Node",e,"ownerDocument")},childNodes:function(e){return Sr("Node",e,"childNodes")},parentNode:function(e){return Sr("Node",e,"parentNode")},parentElement:function(e){return Sr("Node",e,"parentElement")},textContent:function(e){return Sr("Node",e,"textContent")},contains:function(e,t){return Er("Node",e,"contains")(t)},getRootNode:function(e){return Er("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Sr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Sr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Sr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Sr("Element",e,"querySelectorAll")(t)},nowTimestamp:Tr,mutationObserverCtor:Ir,patch:Lr};function Ar(e){return e.nodeType===e.ELEMENT_NODE}function Mr(e){const t=e&&"host"in e&&"mode"in e&&Or.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Or.shadowRoot(t)===e)}function Rr(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Pr(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=>Dr(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 Dr(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Pr(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?Gr(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?Gr(n,t):n}}class Nr{constructor(){cr(this,"idNodeMap",new Map),cr(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 jr({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let a=o||"";const s=r&&_r(r);return(t[n.toLowerCase()]||s&&t[s])&&(a=i?i(a,e):"*".repeat(a.length)),a}function _r(e){return e.toLowerCase()}const Fr="__rrweb_original__";function Br(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?_r(t):null}function Ur(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 Hr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,qr=/^(?:[a-z+]+:)?\/\//i,zr=/^www\..*/i,Wr=/^(data:)([^,]*),(.*)/i;function Gr(e,t){return(e||"").replace(Hr,((e,n,r,o,i,a)=>{const s=r||i||a,c=n||o||"";if(!s)return e;if(qr.test(s)||zr.test(s))return`url(${c}${s}${c})`;if(Wr.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 Vr(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function $r(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=Vr(e,n);const a=t.length/e.length;for(let s=1;s2&&""===p[0]&&""!==r[s-1].textContent)h=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&&(h=t.indexOf(d));if(p.length>=2&&u>l){const e=r[s-1].textContent;if(e&&"string"==typeof e){const n=Vr(e).length;h=t.indexOf(d,n)}-1===h&&(h=p[0].length)}if(-1!==h){let s=Math.floor(h/a);for(;s>0&&s50*r.length)return o.push(e),o;const c=Vr(e.substring(0,s),n);if(c.length===h){o.push(e.substring(0,s)),e=e.substring(s),t=t.substring(h);break}c.length=t.length);){let i=r(eo);if(","===i.slice(-1))i=ro(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=ro(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?Gr(r,io(e)):"object"===t&&"data"===n?ro(e,r):r:r}function so(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function co(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&co(Or.parentNode(e),t,n);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!n&&co(Or.parentNode(e),t,n)}function lo(e,t,n,r){let o;if(Ar(e)){if(o=e,!Or.childNodes(o).length)return!1}else{if(null===Or.parentElement(e))return!1;o=Or.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(co(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 uo(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:h,keepIframeSrcFn:f,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:gr.Document,childNodes:[],compatMode:e.compatMode}:{type:gr.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:gr.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:h}=t,f=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=_r(e.tagName);return Jr.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=Pr(t)),r&&(delete m.rel,delete m.href,m._cssText=r)}if("style"===g&&e.sheet){let t=Pr(e.sheet);t&&(e.childNodes.length>1&&(t=$r(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=jr({element:e,type:Br(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){Zr||(Zr=n.createElement("canvas"),Qr=Zr.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"",o=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Zr.width=t.naturalWidth,Zr.height=t.naturalHeight,Qr.drawImage(t,0,0),m.rr_dataURL=Zr.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(f){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:gr.Element,tagName:g,attributes:m,childNodes:[],isSVG:oo(e)||void 0,needBlock:f,rootId:h,isCustom:y}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:s,maskInputOptions:c,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:g,rootId:v});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:o,cssCaptured:i}=t,a=Or.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=Or.textContent(e),l&&c&&(c=Gr(c,io(t.doc))));!l&&!u&&c&&n&&(c=r?r(c,Or.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:gr.Text,textContent:c||"",rootId:o}}(e,{doc:n,needsMask:a,maskTextFn:l,rootId:v,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:gr.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:gr.Comment,textContent:Or.textContent(e)||"",rootId:v};default:return!1}}function po(e){return null==e?"":e.toLowerCase()}function ho(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 fo(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:h,dataURLOptions:f={},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:E}=t,{preserveWhiteSpace:I=!0}=t;if(!E){E=lo(e,a,s,void 0===E)}const T=uo(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:f,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===gr.Comment)return!0;if(e.type===gr.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"===Ur(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(po(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===po(e.attributes.name)||"icon"===po(e.attributes.rel)||"apple-touch-icon"===po(e.attributes.rel)||"shortcut icon"===po(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&po(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(po(e.attributes.property).match(/^(og|twitter|fb):/)||po(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===po(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===po(e.attributes.name)||"googlebot"===po(e.attributes.name)||"bingbot"===po(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===po(e.attributes.name)||"generator"===po(e.attributes.name)||"framework"===po(e.attributes.name)||"publisher"===po(e.attributes.name)||"progid"===po(e.attributes.name)||po(e.attributes.property).match(/^article:/)||po(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===po(e.attributes.name)||"yandex-verification"===po(e.attributes.name)||"csrf-token"===po(e.attributes.name)||"p:domain_verify"===po(e.attributes.name)||"verify-v1"===po(e.attributes.name)||"verification"===po(e.attributes.name)||"shopify-checkout-api-token"===po(e.attributes.name)))return!0}}return!1}(T,h)||!I&&T.type===gr.Text&&!T.textContent.replace(/^\s+|\s+$/gm,"").length?Kr:Yr();const O=Object.assign(T,{id:L});if(r.add(e,O),L===Kr)return null;v&&v(e);let A=!c;if(O.type===gr.Element){A=A&&!O.needBlock,delete O.needBlock;const t=Or.shadowRoot(e);t&&Rr(t)&&(O.isShadowHost=!0)}if((O.type===gr.Document||O.type===gr.Element)&&A){h.headWhitespace&&O.type===gr.Element&&"head"===O.tagName&&(I=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:c,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(O.type===gr.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else{O.type===gr.Element&&void 0!==O.attributes._cssText&&"string"==typeof O.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(Or.childNodes(e))){const e=fo(n,t);e&&O.childNodes.push(e)}}let S=null;if(Ar(e)&&(S=Or.shadowRoot(e)))for(const e of Array.from(Or.childNodes(S))){const n=fo(e,t);n&&(Rr(S)&&(n.isShadow=!0),O.childNodes.push(n))}}const M=Or.parentNode(e);return M&&Mr(M)&&Rr(M)&&(O.isShadow=!0),O.type===gr.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=fo(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});n&&y(e,n)}}),b),O.type===gr.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===Ur(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=fo(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});t&&w(e,t)}}),k),O}class go{constructor(...e){cr(this,"parentElement",null),cr(this,"parentNode",null),cr(this,"ownerDocument"),cr(this,"firstChild",null),cr(this,"lastChild",null),cr(this,"previousSibling",null),cr(this,"nextSibling",null),cr(this,"ELEMENT_NODE",1),cr(this,"TEXT_NODE",3),cr(this,"nodeType"),cr(this,"nodeName"),cr(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 go))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 mo(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const vo="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 yo={map:{},getId:()=>(console.error(vo),-1),getNode:()=>(console.error(vo),null),removeNodeFromMap(){console.error(vo)},has:()=>(console.error(vo),!1),reset(){console.error(vo)}};function bo(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 wo(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)}}),()=>wo(e,t,i||{},!0)}function ko(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=Or.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=Or.parentElement(i.body))?void 0:r.scrollTop)||(null==(o=null==i?void 0:i.body)?void 0:o.scrollTop)||0}}function xo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function So(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Co(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Or.parentElement(e)}function Eo(e,t,n,r){if(!e)return!1;const o=Co(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(co(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 Io(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===Kr}function To(e,t){if(Mr(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=Or.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||To(r,t))}function Lo(e){return Boolean(e.changedTouches)}function Oo(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ao(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Mo(e){return!!e&&(e instanceof go&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Or.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(yo=new Proxy(yo,{get:(e,t,n)=>("map"===t&&console.error(vo),Reflect.get(e,t,n))}));class Ro{constructor(){cr(this,"id",1),cr(this,"styleIDMap",new WeakMap),cr(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 Po(e){var t;let n=null;return"getRootNode"in e&&(null==(t=Or.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Or.host(Or.getRootNode(e))&&(n=Or.host(Or.getRootNode(e))),n}function Do(e){const t=Or.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=Po(n);)n=t;return n}(e);return Or.contains(t,n)}function No(e){const t=Or.ownerDocument(e);return!!t&&(Or.contains(t,e)||Do(e))}function jo(e){return"__ln"in e}class _o{constructor(){cr(this,"length",0),cr(this,"head",null),cr(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 Bo{constructor(){cr(this,"frozen",!1),cr(this,"locked",!1),cr(this,"texts",[]),cr(this,"attributes",[]),cr(this,"attributeMap",new WeakMap),cr(this,"removes",[]),cr(this,"mapRemoves",[]),cr(this,"movedMap",{}),cr(this,"addedSet",new Set),cr(this,"movedSet",new Set),cr(this,"droppedSet",new Set),cr(this,"removesSubTreeCache",new Set),cr(this,"mutationCb"),cr(this,"blockClass"),cr(this,"blockSelector"),cr(this,"maskTextClass"),cr(this,"maskTextSelector"),cr(this,"inlineStylesheet"),cr(this,"maskInputOptions"),cr(this,"maskTextFn"),cr(this,"maskInputFn"),cr(this,"keepIframeSrcFn"),cr(this,"recordCanvas"),cr(this,"inlineImages"),cr(this,"slimDOMOptions"),cr(this,"dataURLOptions"),cr(this,"doc"),cr(this,"mirror"),cr(this,"iframeManager"),cr(this,"stylesheetManager"),cr(this,"shadowDomManager"),cr(this,"canvasManager"),cr(this,"processedNodeManager"),cr(this,"unattachedDoc"),cr(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),cr(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new _o,r=e=>{let t=e,n=Kr;for(;n===Kr;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{const i=Or.parentNode(o);if(!i||!No(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=Mr(i)?this.mirror.getId(Po(o)):this.mirror.getId(i),c=r(o);if(-1===s||-1===c)return n.addNode(o);const l=fo(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=>{Oo(e,this.mirror)&&this.iframeManager.addIframe(e),Ao(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Mo(o)&&this.shadowDomManager.addShadowRoot(Or.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)Ho(this.removesSubTreeCache,s,this.mirror)&&!this.movedSet.has(Or.parentNode(s))||o(s);for(const s of this.addedSet)qo(this.droppedSet,s)||Ho(this.removesSubTreeCache,s,this.mirror)?qo(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(Or.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(Or.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=Or.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Or.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=Or.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))})),cr(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(Or.childNodes(e),(e=>Or.textContent(e)||"")).join("");t.attributes.value=jr({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Br(e),value:n,maskInputFn:this.maskInputFn})})),cr(this,"processMutation",(e=>{if(!Io(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Or.textContent(e.target);Eo(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:lo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Co(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=Br(n);o=jr({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:o,maskInputFn:this.maskInputFn})}if(Eo(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"),!so(n.tagName,r))if(i.attributes[r]=ao(this.doc,_r(n.tagName),_r(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(Eo(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=Mr(e.target)?this.mirror.getId(Or.host(e.target)):this.mirror.getId(e.target);Eo(e.target,this.blockClass,this.blockSelector,!1)||Io(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Uo(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||To(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Fo(n,r)]?Uo(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!Mr(e.target)||!Rr(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),Or.childNodes(e).forEach((e=>n.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),cr(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Io(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[Fo(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Eo(e,this.blockClass,this.blockSelector,!1)||(Or.childNodes(e).forEach((e=>this.genAdds(e))),Mo(e)&&Or.childNodes(Or.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 Uo(e,t){e.delete(t),Or.childNodes(t).forEach((t=>Uo(e,t)))}function Ho(e,t,n){return 0!==e.size&&function(e,t,n){const r=Or.parentNode(t);return!!r&&e.has(r)}(e,t)}function qo(e,t){return 0!==e.size&&zo(e,t)}function zo(e,t){const n=Or.parentNode(t);return!!n&&(!!e.has(n)||zo(e,n))}let Wo;const Go=e=>{if(!Wo)return e;return(...t)=>{try{return e(...t)}catch(n){if(Wo&&!0===Wo(n))return;throw n}}},Vo=[];function $o(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 Xo(e,t){const n=new Bo;Vo.push(n),n.init(e);const[r,o]=Ir(),i=new r(Go(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function Jo({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(dr).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((i=>{let a=_r(i);const l=(t=>i=>{const a=$o(i);if(Eo(a,r,o,!0))return;let s=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":s=pr.Mouse;break;case"touch":s=pr.Touch;break;case"pen":s=pr.Pen}s===pr.Touch?dr[t]===dr.MouseDown?l="TouchStart":dr[t]===dr.MouseUp&&(l="TouchEnd"):pr.Pen}else Lo(i)&&(s=pr.Touch);null!==s?(c=s,(l.startsWith("Touch")&&s===pr.Touch||l.startsWith("Mouse")&&s===pr.Mouse)&&(s=null)):dr[t]===dr.Click&&(s=c,c=null);const u=Lo(i)?i.changedTouches[0]:i;if(!u)return;const d=n.getId(a),{clientX:p,clientY:h}=u;Go(e)({type:dr[l],id:d,x:p,y:h,...null!==s&&{pointerType:s}})})(i);if(window.PointerEvent)switch(dr[i]){case dr.MouseDown:case dr.MouseUp:a=a.replace("mouse","pointer");break;case dr.TouchStart:case dr.TouchEnd:return}s.push(mo(a,l,t))})),Go((()=>{s.forEach((e=>e()))}))}function Ko({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return mo("scroll",Go(bo(Go((i=>{const a=$o(i);if(!a||Eo(a,r,o,!0))return;const s=n.getId(a);if(a===t&&t.defaultView){const n=ko(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 Yo=["INPUT","TEXTAREA","SELECT"],Zo=new WeakMap;function Qo(e){return function e(t,n){if(ri("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ri("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ri("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ri("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 ei(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function ti({mirror:e,stylesheetManager:t},n){var r,o,i;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(Or.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}}),Go((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function ni(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:h,customElementCb:f}=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),h(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t);let o=()=>{};e.recordDOM&&([r,o]=Xo(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=bo(Go((t=>{const n=Date.now()-a;e(s.map((e=>(e.timeOffset-=n,e))),t),s=[],a=null})),i),l=Go(bo(Go((e=>{const t=$o(e),{clientX:n,clientY:o}=Lo(e)?e.changedTouches[0]:e;a||(a=Tr()),s.push({x:n,y:o,id:r.getId(t),timeOffset:Tr()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?ur.Drag:e instanceof MouseEvent?ur.MouseMove:ur.TouchMove)})),o,{trailing:!1})),u=[mo("mousemove",l,n),mo("touchmove",l,n),mo("drag",l,n)];return Go((()=>{u.forEach((e=>e()))}))}(e),a=Jo(e),s=Ko(e),c=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return mo("resize",Go(bo(Go((()=>{const t=xo(),o=So();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=$o(e);const l=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=Or.parentElement(n)),!n||!d||Yo.indexOf(d)<0||Eo(n,r,o,!0))return;if(n.classList.contains(i)||a&&n.matches(a))return;let h=n.value,f=!1;const g=Br(n)||"";"radio"===g||"checkbox"===g?f=n.checked:(s[d.toLowerCase()]||s[g])&&(h=jr({element:n,maskInputOptions:s,tagName:d,type:g,value:h,maskInputFn:c})),p(n,u?{text:h,isChecked:f,userTriggered:l}:{text:h,isChecked:f});const m=n.name;"radio"===g&&m&&f&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==n){const t=e.value;p(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}}))}function p(t,r){const o=Zo.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Zo.set(t,r);const o=n.getId(t);Go(e)({...r,id:o})}}const h=("last"===l.input?["change"]:["input","change"]).map((e=>mo(e,Go(d),t))),f=t.defaultView;if(!f)return()=>{h.forEach((e=>e()))};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&h.push(...m.map((e=>wo(e[0],e[1],{set(){Go(d)({target:this,isTrusted:!1})}},!1,f)))),Go((()=>{h.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const a=Go((i=>bo(Go((o=>{const a=$o(o);if(!a||Eo(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=[mo("play",a(fr.Play),i),mo("pause",a(fr.Pause),i),mo("seeked",a(fr.Seeked),i),mo("volumechange",a(fr.VolumeChange),i),mo("ratechange",a(fr.RateChange),i)];return Go((()=>{s.forEach((e=>e()))}))}(e);let d=()=>{},p=()=>{},h=()=>{},f=()=>{};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:Go(((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=ei(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:Go(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=ei(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:Go(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=ei(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:Go(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=ei(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replaceSync:a}),r.apply(o,i)}))}));const c={};oi("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(oi("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),oi("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),oi("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:Go(((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=ei(o.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:a,index:[...Qo(o),s||0]}]}),r.apply(o,i)}))}),o.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Go(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=ei(o.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,removes:[{index:[...Qo(o),a]}]}),r.apply(o,i)}))})})),Go((()=>{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=ti(e,e.doc),h=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:Go(((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:h}=ei(null==(c=a.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||h&&-1!==h)&&e({id:p,styleId:h,set:{property:l,value:u,priority:d},index:Qo(a.parentRule)}),o.apply(a,s)}))});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Go(((o,i,s)=>{var c;const[l]=s;if(n.has(l))return a.apply(i,[l]);const{id:u,styleId:d}=ei(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:Qo(i.parentRule)}),o.apply(i,s)}))}),Go((()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}))}(e,{win:n}),e.collectFonts&&(f=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=Lr(t.fonts,"add",(function(t){return function(n){return setTimeout(Go((()=>{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),Go((()=>{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=Go((()=>{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 Go((()=>{Vo.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),a(),s(),c(),l(),u(),d(),p(),h(),f(),g(),m(),v.forEach((e=>e()))}))}function ri(e){return void 0!==window[e]}function oi(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ii{constructor(e){cr(this,"iframeIdToRemoteIdMap",new WeakMap),cr(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 ai{constructor(e){cr(this,"iframes",new WeakMap),cr(this,"crossOriginIframeMap",new WeakMap),cr(this,"crossOriginIframeMirror",new ii(Yr)),cr(this,"crossOriginIframeStyleMirror"),cr(this,"crossOriginIframeRootIdMap",new WeakMap),cr(this,"mirror"),cr(this,"mutationCb"),cr(this,"wrappedEmit"),cr(this,"loadListener"),cr(this,"stylesheetManager"),cr(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ii(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 lr.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:lr.IncrementalSnapshot,data:{source:ur.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case lr.Meta:case lr.Load:case lr.DomContentLoaded:return!1;case lr.Plugin:return t;case lr.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case lr.IncrementalSnapshot:switch(t.data.source){case ur.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 ur.Drag:case ur.TouchMove:case ur.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case ur.ViewportResize:return!1;case ur.MediaInteraction:case ur.MouseInteraction:case ur.Scroll:case ur.CanvasMutation:case ur.Input:return this.replaceIds(t.data,e,["id"]),t;case ur.StyleSheetRule:case ur.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case ur.Font:return t;case ur.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case ur.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===gr.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class si{constructor(e){cr(this,"shadowDoms",new WeakSet),cr(this,"mutationCb"),cr(this,"scrollCb"),cr(this,"bypassOptions"),cr(this,"mirror"),cr(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(!Rr(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[n]=Xo({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Ko({...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(Or.host(e))),this.restoreHandlers.push(ti({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(Lr(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r),i=Or.shadowRoot(this);return i&&No(this)&&n.addShadowRoot(i,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ci="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",li="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ui=0;ui<64;ui++)li[ci.charCodeAt(ui)]=ui;const di=new Map;const pi=(e,t,n)=>{if(!e||!gi(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=di.get(e);return n||(n=new Map,di.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 hi(e,t,n){if(e instanceof Array)return e.map((e=>hi(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+=ci[(3&n[t])<<4|n[t+1]>>4],o+=ci[(15&n[t+1])<<2|n[t+2]>>6],o+=ci[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:[hi(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:[hi(e.data,t,n),e.width,e.height]}}if(gi(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:pi(e,t,n)}}return e}const fi=(e,t,n)=>e.map((e=>hi(e,t,n))),gi=(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 mi(e,t,n,r){const o=[];try{const i=Lr(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...i){if(!Eo(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 vi(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=Lr(e,c,(function(e){return function(...a){const s=e.apply(this,a);if(pi(s,i,this),"tagName"in this.canvas&&!Eo(this.canvas,r,o,!0)){const e=fi(a,i,this),r={type:t,property:c,args:e};n(this.canvas,r)}return s}}));a.push(s)}catch{const r=wo(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});a.push(r)}return a}const yi='(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',bi="undefined"!=typeof self&&self.Blob&&new Blob([yi],{type:"text/javascript;charset=utf-8"});function wi(e){let t;try{if(t=bi&&(self.URL||self.webkitURL).createObjectURL(bi),!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(yi),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class ki{constructor(e){cr(this,"pendingCanvasMutations",new Map),cr(this,"rafStamps",{latestId:0,invokeId:null}),cr(this,"mirror"),cr(this,"mutationCb"),cr(this,"resetObservers"),cr(this,"frozen",!1),cr(this,"locked",!1),cr(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=mi(t,n,r,!0),a=new Map,s=new wi;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:hr["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=>{Eo(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=mi(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=Lr(t.CanvasRenderingContext2D.prototype,a,(function(o){return function(...i){return Eo(this.canvas,n,r,!0)||setTimeout((()=>{const n=fi(i,t,this);e(this.canvas,{type:hr["2D"],property:a,args:n})}),0),o.apply(this,i)}}));o.push(i)}catch{const n=wo(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:hr["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(...vi(t.WebGLRenderingContext.prototype,hr.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...vi(t.WebGL2RenderingContext.prototype,hr.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 xi{constructor(e){cr(this,"trackedLinkElements",new WeakSet),cr(this,"mutationCb"),cr(this,"adoptedStyleSheetCb"),cr(this,"styleMirror",new Ro),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:Dr(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 Si{constructor(){cr(this,"nodeMap",new WeakMap),cr(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 Ci,Ei,Ii,Ti=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ar=e.contentWindow)?void 0:ar.Array.from)||Array.from,document.body.removeChild(e)}}catch(Zv){console.debug("Unable to override Array.from",Zv)}const Li=new Nr;function Oi(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:h,maskInputFn:f,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:E=!1,collectFonts:I=!1,inlineImages:T=!1,plugins:L,keepIframeSrcFn:O=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:M}=e;Wo=M;const R=!S||window.parent===window;let P=!1;if(!R)try{window.parent.document&&(P=!1)}catch(V){P=!0}if(R&&!t)throw new Error("emit function is required");if(!R&&!P)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Li.reset();const D=!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},N=ho(h);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 _=0;const F=e=>{for(const t of L||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!P&&(e=v(e)),e};Ci=(e,o)=>{var i;const a=e;if(a.timestamp=Tr(),!(null==(i=Vo[0])?void 0:i.isFrozen())||a.type===lr.FullSnapshot||a.type===lr.IncrementalSnapshot&&a.data.source===ur.Mutation||Vo.forEach((e=>e.unfreeze())),R)null==t||t(F(a),o);else if(P){const e={type:"rrweb",event:F(a),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(a.type===lr.FullSnapshot)j=a,_=0;else if(a.type===lr.IncrementalSnapshot){if(a.data.source===ur.Mutation&&a.data.isAttachIframe)return;_++;const e=r&&_>=r,t=n&&a.timestamp-j.timestamp>n;(e||t)&&Ei(!0)}};const B=e=>{Ci({type:lr.IncrementalSnapshot,data:{source:ur.Mutation,...e}})},U=e=>Ci({type:lr.IncrementalSnapshot,data:{source:ur.Scroll,...e}}),H=e=>Ci({type:lr.IncrementalSnapshot,data:{source:ur.CanvasMutation,...e}}),q=new xi({mutationCb:B,adoptedStyleSheetCb:e=>Ci({type:lr.IncrementalSnapshot,data:{source:ur.AdoptedStyleSheet,...e}})}),z=new ai({mirror:Li,mutationCb:B,stylesheetManager:q,recordCrossOriginIframes:S,wrappedEmit:Ci});for(const X of L||[])X.getMirror&&X.getMirror({nodeMirror:Li,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});const W=new Si;Ii=new ki({recordCanvas:x,mutationCb:H,win:window,blockClass:o,blockSelector:i,mirror:Li,sampling:y.canvas,dataURLOptions:b});const G=new si({mutationCb:B,scrollCb:U,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:b,maskTextFn:g,maskInputFn:f,recordCanvas:x,inlineImages:T,sampling:y,slimDOMOptions:N,iframeManager:z,stylesheetManager:q,canvasManager:Ii,keepIframeSrcFn:O,processedNodeManager:W},mirror:Li});Ei=(e=!1)=>{if(!k)return;Ci({type:lr.Meta,data:{href:window.location.href,width:So(),height:xo()}},e),q.reset(),G.init(),Vo.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new Nr,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:h=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k=(()=>!1)}=t;return fo(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:ho(h),dataURLOptions:f,inlineImages:c,recordCanvas:l,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}(document,{mirror:Li,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:D,maskTextFn:g,maskInputFn:f,slimDOM:N,dataURLOptions:b,recordCanvas:x,inlineImages:T,onSerialize:e=>{Oo(e,Li)&&z.addIframe(e),Ao(e,Li)&&q.trackLinkElement(e),Mo(e)&&G.addShadowRoot(Or.shadowRoot(e),document)},onIframeLoad:(e,t)=>{z.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{q.attachLinkElement(e,t)},keepIframeSrcFn:O});if(!t)return console.warn("Failed to snapshot the document");Ci({type:lr.FullSnapshot,data:{node:t,initialOffset:ko(window)}},e),Vo.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,Li.getId(document))};try{const e=[],t=e=>{var t;return Go(ni)({mutationCb:B,mousemoveCb:(e,t)=>Ci({type:lr.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Ci({type:lr.IncrementalSnapshot,data:{source:ur.MouseInteraction,...e}}),scrollCb:U,viewportResizeCb:e=>Ci({type:lr.IncrementalSnapshot,data:{source:ur.ViewportResize,...e}}),inputCb:e=>Ci({type:lr.IncrementalSnapshot,data:{source:ur.Input,...e}}),mediaInteractionCb:e=>Ci({type:lr.IncrementalSnapshot,data:{source:ur.MediaInteraction,...e}}),styleSheetRuleCb:e=>Ci({type:lr.IncrementalSnapshot,data:{source:ur.StyleSheetRule,...e}}),styleDeclarationCb:e=>Ci({type:lr.IncrementalSnapshot,data:{source:ur.StyleDeclaration,...e}}),canvasMutationCb:H,fontCb:e=>Ci({type:lr.IncrementalSnapshot,data:{source:ur.Font,...e}}),selectionCb:e=>{Ci({type:lr.IncrementalSnapshot,data:{source:ur.Selection,...e}})},customElementCb:e=>{Ci({type:lr.IncrementalSnapshot,data:{source:ur.CustomElement,...e}})},blockClass:o,ignoreClass:a,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:D,inlineStylesheet:u,sampling:y,recordDOM:k,recordCanvas:x,inlineImages:T,userTriggeredOnInput:E,collectFonts:I,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:O,blockSelector:i,slimDOMOptions:N,dataURLOptions:b,mirror:Li,iframeManager:z,stylesheetManager:q,shadowDomManager:G,processedNodeManager:W,canvasManager:Ii,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=>Ci({type:lr.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};z.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{Ei(),e.push(t(document)),Ti=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(mo("DOMContentLoaded",(()=>{Ci({type:lr.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&n()}))),e.push(mo("load",(()=>{Ci({type:lr.Load,data:{}}),"load"===C&&n()}),window))),()=>{e.forEach((e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")||console.warn(t)}})),W.destroy(),Ti=!1,Wo=void 0}}catch($){console.warn($)}}Oi.addCustomEvent=(e,t)=>{if(!Ti)throw new Error("please add custom event after start recording");Ci({type:lr.Custom,data:{tag:e,payload:t}})},Oi.freezePage=()=>{Vo.forEach((e=>e.freeze()))},Oi.takeFullSnapshot=e=>{if(!Ti)throw new Error("please take full snapshot after start recording");Ei(e)},Oi.mirror=Li;var Ai=Uint8Array,Mi=Uint16Array,Ri=Uint32Array,Pi=new Ai([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]),Di=new Ai([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]),Ni=new Ai([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ji=function(e,t){for(var n=new Mi(31),r=0;r<31;++r)n[r]=t+=1<>>1|(21845&zi)<<1;Wi=(61680&(Wi=(52428&Wi)>>>2|(13107&Wi)<<2))>>>4|(3855&Wi)<<4,qi[zi]=((65280&Wi)>>>8|(255&Wi)<<8)>>>1}var Gi=function(e,t,n){for(var r=e.length,o=0,i=new Mi(t);o>>c]=l}else for(a=new Mi(r),o=0;o>>15-e[o];return a},Vi=new Ai(288);for(zi=0;zi<144;++zi)Vi[zi]=8;for(zi=144;zi<256;++zi)Vi[zi]=9;for(zi=256;zi<280;++zi)Vi[zi]=7;for(zi=280;zi<288;++zi)Vi[zi]=8;var $i=new Ai(32);for(zi=0;zi<32;++zi)$i[zi]=5;var Xi=Gi(Vi,9,0),Ji=Gi($i,5,0),Ki=function(e){return(e/8>>0)+(7&e&&1)},Yi=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Mi?Mi:e instanceof Ri?Ri:Ai)(n-t);return r.set(e.subarray(t,n)),r},Zi=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Qi=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},ea=function(e,t){for(var n=[],r=0;rp&&(p=i[r].s);var h=new Mi(p+1),f=ta(n[u-1],h,0);if(f>t){r=0;var g=0,m=f-t,v=1<t))break;g+=v-(1<>>=m;g>0;){var b=i[r].s;h[b]=0&&g;--r){var w=i[r].s;h[w]==t&&(--h[w],++g)}f=t}return[new Ai(h),f]},ta=function(e,t,n){return-1==e.s?Math.max(ta(e.l,t,n+1),ta(e.r,t,n+1)):t[e.s]=n},na=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Mi(++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]},ra=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&&!I[Ni[L-1]];--L);var O,A,M,R,P=l+5<<3,D=ra(o,Vi)+ra(i,$i)+a,N=ra(o,p)+ra(i,g)+a+14+3*L+ra(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(P<=D&&P<=N)return oa(t,u,e.subarray(c,c+l));if(Zi(t,u,1+(N15&&(Zi(t,u,B[C]>>>5&127),u+=B[C]>>>12)}}}else O=Xi,A=Vi,M=Ji,R=$i;for(C=0;C255){U=r[C]>>>18&31;Qi(t,u,O[U+257]),u+=A[U+257],U>7&&(Zi(t,u,r[C]>>>23&31),u+=Pi[U]);var H=31&r[C];Qi(t,u,M[H]),u+=R[H],H>3&&(Qi(t,u,r[C]>>>5&8191),u+=Di[H])}else Qi(t,u,O[r[C]]),u+=A[r[C]];return Qi(t,u,O[256]),u+A[256]},aa=new Ri([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sa=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new Ai(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,f=8191&p,g=(1<7e3||I>24576)&&R>423){l=ia(e,c,0,k,x,S,E,I,L,u-L,l),I=C=E=0,L=u;for(var P=0;P<286;++P)x[P]=0;for(P=0;P<30;++P)S[P]=0}var D=2,N=0,j=f,_=A-M&32767;if(R>2&&O==w(u-_))for(var F=Math.min(h,R)-1,B=Math.min(32767,u),U=Math.min(258,R);_<=B&&--j&&A!=M;){if(e[u+D]==e[u+D-_]){for(var H=0;HD){if(D=H,N=_,H>F)break;var q=Math.min(_,H-2),z=0;for(P=0;Pz&&(z=G,M=W)}}}_+=(A=M)-(M=m[A])+32768&32767}if(N){k[I++]=268435456|Bi[D]<<18|Hi[N];var V=31&Bi[D],$=31&Hi[N];E+=Pi[V]+Di[$],++x[257+V],++S[$],T=u+D,++C}else k[I++]=e[u],++x[e[u]]}}l=ia(e,c,i,k,x,S,E,I,L,u-L,l)}return Yi(s,0,r+Ki(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 ca(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=sa(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 la=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}(ca(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Ai(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},a=0;ar.length){var s=new Ai(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 Yi(r,0,o)}(JSON.stringify(t))),!0)};function ua(e){return ua="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},ua(e)}function da(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 pa(e){for(var t=1;t=0)return null;if(function(e){if("password"===xa(e))return!0;var t=e.getAttribute&&e.getAttribute("autocomplete");return!!t&&t.toLowerCase().split(/\s+/).some((function(e){return fa.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 Ea(e,t)||Sa(e,ga)}))}(e,t))return ka;if(!function(e,t){var n=Ta(t);return!(!n[e.tagName?e.tagName.toLowerCase():""]&&!n[xa(e)])}(e,t))return null;var n=t.maskInputFn;return"function"!=typeof n?ka:function(t){try{return n(t,e)}catch(r){return ka(t)}}},Oa=ma.map((function(e){return':not([type="'+e+'" i])'})).join(""),Aa=function(e){return String(e).replace(/[\S]/g,"*")},Ma=function(e){var t=e&&e.maskTextFn;return"function"!=typeof t?Aa:function(e,n){try{var r=t(e,n);return"string"==typeof r?r:Aa(e)}catch(o){return Aa(e)}}};function Ra(e){return function(e){if(Array.isArray(e))return Pa(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 Pa(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 Pa(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 Pa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]&&arguments[0]&&this.startDate){if(this.stopFunction){try{this.stopFunction()}catch(n){}this.stopFunction=void 0}if(this.segments[this.segments.length-1].length>0)for(this.segments.push([]),this.segmentSizes.push(0),this.incrementalSize=0;this.segments.length>3;)this.dropOldestSegment()}else this.stop(),this.startDate=Date.now(),this.resetBuffer();var t={inlineStylesheet:!0,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0},dataURLOptions:{quality:.7},recordCanvas:!1,checkoutEveryNms:3e5,sampling:{scroll:150,mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!0,DblClick:!0,Focus:!0,Blur:!0,TouchStart:!0,TouchEnd:!1}},collectFonts:!1,recordCrossOriginIframes:!1};try{this.stopFunction=Oi(Na(Na(Na(Na({},t),this.customOptions),function(e){var t=function(t,n){var r=La(n,e);return r?r(t):t};return!0===(e=e||{}).maskAllInputs?{maskInputFn:t}:{maskInputFn:t,maskInputOptions:pa(pa({},Ta(e)),wa)}}(this.customOptions)),{},{emit:function(t,n){if(n&&t&&4===t.type)for(e.segments.push([]),e.segmentSizes.push(0),e.incrementalSize=0;e.segments.length>3;)e.dropOldestSegment();var r=Ha(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.pausedForCapture||this.start()}},{key:"stop",value:function(){this.stopFunction&&(this.stopFunction(),this.stopFunction=void 0),this.pausedForCapture=!1,this.startDate=void 0,this.resetBuffer()}},{key:"pauseForCapture",value:function(){if(!this.stopFunction)return!1;try{this.stopFunction()}catch(e){}return this.stopFunction=void 0,clearTimeout(this.forcedCheckoutTimeout),this.forcedCheckoutTimeout=void 0,this.pausedForCapture=!0,!0}},{key:"resumeAfterCapture",value:function(){this.pausedForCapture&&(this.pausedForCapture=!1,this.start(!0))}},{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()>Ua;)this.dropOldestSegment();this.getBufferSize()>Ua&&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{Oi.takeFullSnapshot(!0)}catch(t){}}),t)}}},{key:"getReplaySnapshot",value:function(){var e;return{startDate:this.startDate,events:(e=[]).concat.apply(e,Ra(this.segments)),packed:!1,baseUrl:window.location.origin,width:window.innerWidth,height:window.innerHeight,isMobile:Q(),type:"rrweb"}}},{key:"getReplayData",value:function(){var e,t=(e=[]).concat.apply(e,Ra(this.segments)),n=t,r=!1;try{n=t.map((function(e){return la(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&&ja(t.prototype,n),r&&ja(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();_a(qa,"instance",void 0);const za=475249515,Wa=(e,t,n)=>{const r=e[t];if(!r)return null;let o=1,i=128;for(;!(r&i);)i>>=1,o+=1;if(o>(n?4:8)||t+o>e.length)return null;let a=n?r:r&i-1,s=(r&i-1)==i-1;for(let c=1;c{const n=Wa(e,t,!0),r=n&&Wa(e,t+n.length,!1);return r?{id:n.value,start:t,idLength:n.length,size:r.value,unknown:r.unknown,dataStart:t+n.length+r.length}:null},Va=(e,t)=>{for(let n=t;n<=8;n++)if(e=0;e--)t[e]=r%256,r=Math.floor(r/256);return t[0]|=128>>n-1,t}return null},$a=(e,t,n)=>{let r=0;for(let o=0;o{let o=r;for(let i=n-1;i>=0;i--)e[t+i]=o%256,o=Math.floor(o/256);return 0===o},Ja=(e,t)=>{const n=[];for(let r=t.dataStart;r8)return null;const o=$a(e,t.dataStart,t.size);if(21419===t.id&&o===za)return null;21420===t.id&&n.push({pos:t.dataStart,size:t.size,value:o}),r=t.dataStart+t.size}r=t.dataStart+t.size}return n},Ka=(e,t)=>{try{if(!(e&&t>0&&"function"==typeof e.slice))return Promise.resolve(e);const n=e.slice(0,Math.min(e.size,65536));return"function"!=typeof n.arrayBuffer?Promise.resolve(e):n.arrayBuffer().then((n=>{try{return((e,t,n)=>{const r=Ga(t,0);if(!r||440786851!==r.id||r.unknown)return null;const o=Ga(t,r.dataStart+r.size);if(!o||408125543!==o.id)return null;const i=[];let a=null;for(let v=o.dataStart;vt.length)return null;let c=1e6,l=null;for(let v=a.dataStart;vs)return null;2807729===e.id&&e.size>0&&e.size<=6&&(c=$a(t,e.dataStart,e.size)||c),17545===e.id&&(l=e),v=e.dataStart+e.size}const u=1e6*n/c,d=t.slice(),p=e.slice(t.length);if(l){const t=new DataView(d.buffer);if(8===l.size)t.setFloat64(l.dataStart,u);else{if(4!==l.size)return null;t.setFloat32(l.dataStart,u)}return new Blob([d,p],{type:e.type})}const h=new Uint8Array(11);h.set([68,137,136]),new DataView(h.buffer).setFloat64(3,u);const f=Va(a.size+h.length,a.dataStart-a.start-a.idLength);if(!f)return null;const g=new Uint8Array(a.idLength+f.length);g.set(d.subarray(a.start,a.start+a.idLength)),g.set(f,a.idLength);const m=g.length-(a.dataStart-a.start)+h.length;for(let v=0;va.start)return null;for(let t=0;ta.start&&!Xa(d,n.pos,n.size,n.value+m))return null}}if(!o.unknown){const e=o.dataStart-o.start-o.idLength,t=Va(o.size+m,e);if(!t||t.length!==e)return null;d.set(t,o.start+o.idLength)}return new Blob([d.subarray(0,a.start),g,d.subarray(a.dataStart,s),h,d.subarray(s),p],{type:e.type})})(e,new Uint8Array(n),t)||e}catch(r){return e}}),(()=>e))}catch(n){return Promise.resolve(e)}},Ya=()=>"undefined"!=typeof performance&&performance.now?performance.now():Date.now(),Za=()=>new Promise((e=>{try{if("function"==typeof MessageChannel){const t=new MessageChannel;return t.port1.onmessage=()=>{t.port1.onmessage=null;try{t.port1.close(),t.port2.close()}catch(n){}e()},void t.port2.postMessage(0)}}catch(t){}setTimeout(e,0)})),Qa=e=>{const t=JSON.stringify(e);return void 0===t?null:t},es=(e,t)=>{const n=["{"];let r=!0;const o=Object.keys(e),i=o=>{const i=e[o],a=(r?"":",")+JSON.stringify(o)+":";if(Array.isArray(i)&&i.length>50)return r=!1,n.push(a+"["),((e,t,n)=>new Promise(((r,o)=>{let i=0;const a=()=>{try{if(n&&n())return void o(new Error("cancelled"));const s=Ya();for(;i25&&i{let r=null;try{r=Qa(e)}catch(o){}n.push((t?",":"")+(r||"null"))}),t).then((()=>{n.push("]")}));if((e=>!!e&&"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).some((t=>Array.isArray(e[t])&&e[t].length>50)))(i))return r=!1,n.push(a),es(i,t).then((e=>{e.forEach((e=>n.push(e)))}));let s=null;try{s=Qa(i)}catch(c){s=null}return null!==s&&(r=!1,n.push(a+s)),Za()};return o.reduce(((e,t)=>e.then((()=>i(t)))),Promise.resolve()).then((()=>(n.push("}"),n)))};function ts(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ns=["video/mp4;codecs=avc3","video/mp4;codecs=avc1","video/mp4","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"],rs=["video/mp4;codecs=avc3,mp4a.40.2","video/mp4;codecs=avc1,mp4a.40.2","video/mp4","video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"],os=e=>{try{e&&e.getTracks().forEach((e=>{try{e.stop()}catch(t){}}))}catch(t){}};class is{constructor(e){ts(this,"stream",null),ts(this,"micStream",null),ts(this,"videoTrack",null),ts(this,"recorder",null),ts(this,"chunks",[]),ts(this,"mimeType",""),ts(this,"timer",null),ts(this,"startedAt",0),ts(this,"endedAt",0),ts(this,"settings",{}),ts(this,"finished",!1),ts(this,"recorderStopped",!1),ts(this,"stopTimeout",null),ts(this,"onEndedBound",null),ts(this,"recorderError",null),this.options=e}start(e,t){if(this.stream=e,this.videoTrack=e.getVideoTracks()[0]||null,!this.videoTrack)return Promise.reject(new Error("no-video-track"));try{this.settings=this.videoTrack.getSettings?this.videoTrack.getSettings():{}}catch(n){this.settings={}}return(t?navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}).catch((()=>null)):Promise.resolve(null)).then((e=>{this.micStream=e;const t=e&&e.getAudioTracks()[0]||null;if(this.finished||!this.videoTrack||"ended"===this.videoTrack.readyState)throw this.cleanup(),new Error("stopped-before-start");const r=[this.videoTrack];t&&r.push(t),this.mimeType=(e=>{const t=e?rs.concat(ns):ns;try{if("undefined"!=typeof MediaRecorder&&"function"==typeof MediaRecorder.isTypeSupported)for(let e=0;e{try{e.data&&e.data.size>0&&this.chunks.push(e.data)}catch(n){}},this.recorder.onstop=()=>{try{this.recorderStopped=!0,this.finish()}catch(n){}},this.recorder.onerror=e=>{try{this.onRecorderError(e&&e.error||new Error("recorder-error"))}catch(n){}},this.onEndedBound=()=>{try{this.stop()}catch(n){}},this.videoTrack.addEventListener("ended",this.onEndedBound);try{this.recorder.start(1e3)}catch(a){throw this.cleanup(),a}this.startedAt=Date.now();const i=1e3*this.options.maxDurationSec;return this.timer=setInterval((()=>{try{const e=Date.now()-this.startedAt;try{this.options.onTick(Math.floor(e/1e3))}catch(n){}e>=i&&this.stop()}catch(n){}}),250),{hasMicrophone:!!t}}))}setMicrophoneEnabled(e){try{this.micStream&&this.micStream.getAudioTracks().forEach((t=>{t.enabled=!!e}))}catch(t){}}stop(){if(!this.finished&&!this.stopTimeout)if(this.endedAt=this.endedAt||Date.now(),this.clearTimer(),this.recorder&&!this.recorderStopped){try{"inactive"!==this.recorder.state&&this.recorder.stop()}catch(e){}this.releaseTracks(),this.stopTimeout=setTimeout((()=>{try{this.finish()}catch(e){}}),3e3)}else this.finish()}onRecorderError(e){this.finished||(this.recorderError=e,this.stop())}finish(){if(this.finished)return;this.finished=!0,this.endedAt=this.endedAt||Date.now();const e=-1!==(this.recorder&&this.recorder.mimeType||this.mimeType||"video/webm").indexOf("mp4")?"video/mp4":"video/webm",t=new Blob(this.chunks,{type:e});this.chunks=[],this.cleanup();const n={blob:t,type:e,fileName:"screen-recording."+("video/mp4"===e?"mp4":"webm"),startedAt:this.startedAt,endedAt:this.endedAt,durationMs:Math.max(0,this.endedAt-this.startedAt),width:this.settings.width,height:this.settings.height,method:"browser"===this.settings.displaySurface?"tab":"display"};if(0===t.size)return void this.options.onError(this.recorderError||new Error("empty-recording"));const r=e=>{n.blob=e;try{this.options.onStop(n)}catch(t){try{this.options.onError(t)}catch(r){}}};"video/webm"===e?Ka(t,n.durationMs).then(r):r(t)}fail(e){if(!this.finished){this.finished=!0,this.chunks=[],this.cleanup();try{this.options.onError(e)}catch(t){}}}cancel(){this.finished=!0,this.chunks=[];try{this.recorder&&"inactive"!==this.recorder.state&&this.recorder.stop()}catch(e){}this.cleanup()}clearTimer(){this.timer&&(clearInterval(this.timer),this.timer=null),this.stopTimeout&&(clearTimeout(this.stopTimeout),this.stopTimeout=null)}releaseTracks(){if(this.videoTrack&&this.onEndedBound)try{this.videoTrack.removeEventListener("ended",this.onEndedBound)}catch(e){}if(this.onEndedBound=null,os(this.stream),os(this.micStream),this.options.onReleased)try{this.options.onReleased()}catch(e){}}cleanup(){this.clearTimer(),this.releaseTracks(),this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null,this.stream=null,this.micStream=null,this.videoTrack=null}}const as=e=>e.filter((e=>{if("string"!=typeof e||!e.trim())return!1;try{return document.createDocumentFragment().querySelector(e),!0}catch(t){return!1}})).join(", ")||null,ss=e=>{if("function"==typeof CompressionStream&&"function"==typeof Response){const t=JSON.stringify(Object.assign({},e,{v:"v1"}));if(t.length>204800)return new Response(new Blob([t]).stream().pipeThrough(new CompressionStream("deflate"))).arrayBuffer().then((e=>(e=>{let t="";for(let n=0;nnew Promise(((n,r)=>{const o=new Array(e.length);let i=0;const a=()=>{try{if(t&&t())return void r(new Error("cancelled"));const s=Ya();for(;i{o[r]=e,a()}),(()=>n(null)));if(o[r]=t,Ya()-s>25&&i{try{if(this.finished)return;this.events.push(e),this.size+=Ha(e),this.size>26214400&&setTimeout((()=>{try{this.stop()}catch(e){}}),0)}catch(t){}},maskAllInputs:!0,blockClass:e.blockClass||"rr-block",blockSelector:as([".rr-block",".gl-block",e.blockSelector].concat(this.options.maskSelectors||[])),maskTextClass:e.maskTextClass||"rr-mask",maskTextSelector:as([".rr-mask",".gl-mask",e.maskTextSelector]),inlineStylesheet:!0,recordCanvas:!1,collectFonts:!1,recordCrossOriginIframes:!1,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0},dataURLOptions:{quality:.7},sampling:{scroll:150,input:"last",mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!0,DblClick:!0,Focus:!0,Blur:!0,TouchStart:!0,TouchEnd:!1}}})}catch(n){throw this.cleanup(),n}if(!this.stopFunction)throw this.cleanup(),new Error("page-recording-unavailable");const t=1e3*this.options.maxDurationSec;this.timer=setInterval((()=>{try{const n=Date.now()-this.startedAt;try{this.options.onTick(Math.floor(n/1e3))}catch(e){}n>=t&&this.stop()}catch(e){}}),250)}stop(){if(this.finished)return;this.finished=!0,this.endedAt=Date.now(),this.cleanup();const e=this.events;this.events=[];const t=()=>this.cancelled;cs(e,t).then((n=>es({startDate:this.startedAt,events:n||e,packed:!!n,baseUrl:window.location.origin,width:this.width,height:this.height,isMobile:Q(),type:"rrweb"},t))).then((e=>{this.cancelled||this.options.onStop({blob:new Blob(e,{type:"application/json"}),type:"application/json",fileName:"page-recording.json",startedAt:this.startedAt,endedAt:this.endedAt,durationMs:Math.max(0,this.endedAt-this.startedAt),width:this.width,height:this.height,method:"rrweb"})})).catch((e=>{if(!this.cancelled)try{this.options.onError(e)}catch(t){}}))}cancel(){this.finished=!0,this.cancelled=!0,this.events=[],this.cleanup()}cleanup(){if(this.timer&&(clearInterval(this.timer),this.timer=null),this.stopFunction){try{this.stopFunction()}catch(e){}this.stopFunction=null}if(this.resumeReplay){this.resumeReplay=!1;try{qa.getInstance().resumeAfterCapture()}catch(e){}}}}const us=(e,t)=>{const n=String(e||"").replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t-1)+"…":n},ds=(e,t,n)=>{if(!e||1!==e.nodeType)return"element";const r=e.tagName.toLowerCase(),o=e.getAttribute("role")||("a"===r?"link":r),i=((e,t,n)=>{let r=e;for(;r;){if(1===r.nodeType)try{if(Ia(r,t)||Ea(r,t)||n&&r.matches(n))return!0}catch(o){}r=r.parentElement||r.parentNode&&r.parentNode.host||null}return!1})(e,t,as(Array.isArray(n)?n:[]));if("input"===r||"select"===r||"textarea"===r){const t="checkbox"===e.type||"radio"===e.type?e.type:"field";return i?t:t+' "'+(us((a=e).getAttribute("aria-label")||a.labels&&a.labels[0]&&a.labels[0].textContent||a.getAttribute("placeholder")||a.getAttribute("name")||a.id||a.type||a.tagName.toLowerCase(),60)+'"')}var a;if(i)return o;const s=us(e.getAttribute("aria-label")||e.getAttribute("title")||e.getAttribute("alt")||e.textContent,60);return s?o+' "'+s+'"':o},ps=e=>{try{const t=new URL(e);return us(t.pathname+t.search+t.hash,150)}catch(t){return us(e,150)}};class hs{constructor(e){let{privacyOptions:t,maskSelectors:n,isOwnElement:r}=e;ts(this,"entries",[]),ts(this,"startedAt",0),ts(this,"listeners",[]),ts(this,"urlTimer",null),ts(this,"lastUrl",""),ts(this,"lastInputField",null),ts(this,"lastInputAt",0),this.privacyOptions=t||{},this.maskSelectors=Array.isArray(n)?n:[],this.isOwnElement=r||(()=>!1)}add(e,t,n){this.entries.length>=200||this.entries.push({t:Math.max(0,(n||Date.now())-this.startedAt),type:e,label:us(t,200)})}target(e){try{const t=e.composedPath?e.composedPath():[e.target];for(let e=0;e{e.addEventListener(t,n,{capture:!0,passive:!0}),this.listeners.push((()=>e.removeEventListener(t,n,{capture:!0,passive:!0})))};t(document,"click",(e=>{try{if(this.isOwnElement(e.target))return;const t=this.target(e),n=t?ds(t,this.privacyOptions,this.maskSelectors):e.target&&e.target.tagName?e.target.tagName.toLowerCase():"page";this.add("click","Clicked "+n)}catch(t){}}));const n=e=>{try{const t=this.target(e);if(!t||this.isOwnElement(e.target))return;const n=Date.now();if(t===this.lastInputField&&n-this.lastInputAt<5e3)return void(this.lastInputAt=n);this.lastInputField=t,this.lastInputAt=n,this.add("input",("change"===e.type?"Changed ":"Typed in ")+ds(t,this.privacyOptions,this.maskSelectors))}catch(t){}};t(document,"input",n),t(document,"change",n);const r=()=>{try{const e=window.location.href;e!==this.lastUrl&&(this.lastUrl=e,this.add("navigation","Navigated to "+ps(e)))}catch(e){}};t(window,"popstate",r),t(window,"hashchange",r),this.urlTimer=setInterval(r,500)}stop(e){const t=e||Date.now();this.listeners.forEach((e=>{try{e()}catch(t){}})),this.listeners=[],this.urlTimer&&(clearInterval(this.urlTimer),this.urlTimer=null);const n=e=>{const n=new Date(e).getTime();return n>=this.startedAt&&n<=t?n:null};try{wd.getInstance().getLogs().forEach((e=>{const t=e&&"ERROR"===e.priority?n(e.date):null;null!==t&&this.add("error",String(e.log||"").split("\n")[0],t)}))}catch(r){}try{km.getInstance().getRequests().forEach((e=>{if(!e||"RESOURCE"===e.type)return;const t=e.response&&e.response.status,r=!1===e.success||"number"==typeof t&&t>=400?n(e.date):null;null!==r&&this.add("network-error",(e.type||"GET")+" "+ps(e.url)+" → "+(t||"failed"),r)}))}catch(r){}return this.entries.sort(((e,t)=>e.t-t.t))}get interactions(){return this.entries.filter((e=>"click"===e.type||"input"===e.type)).length}}const fs=19922944,gs={consoleLog:!0,networkLogs:!0,customData:!0,metaData:!0,customEventLog:!0,replays:!1},ms=(e,t)=>"/v3/shared/capture-requests/"+encodeURIComponent(String(e))+"/"+t,vs=e=>{try{return e?JSON.parse(e):null}catch(t){return null}},ys=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((o=>{let i=!1;const a=(e,t)=>{i||(i=!0,o({status:e,data:t}))};try{const o=Cf.getInstance(),i=new XMLHttpRequest;i.open(e,o.apiUrl+t),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.gzip&&i.setRequestHeader("Content-Encoding","gzip"),o.injectSession(i),i.timeout=r.timeoutMs||3e4,i.onreadystatechange=()=>{4===i.readyState&&a(i.status,vs(i.responseText))},i.onerror=()=>a(0,null),i.ontimeout=()=>a(0,null),i.send(void 0===n?null:n)}catch(s){a(0,null)}}))},bs=(e,t,n)=>ys("POST",ms(e,t),JSON.stringify(n||{})),ws=(e,t,n)=>{const r={type:t};return n&&(r.reason=String(n).slice(0,200)),bs(e,"event",r)},ks=e=>es(e).then((e=>{const t=new Blob(e,{type:"application/json"});return(e=>{try{if("function"==typeof CompressionStream&&"function"==typeof Response&&"function"==typeof e.stream)return new Response(e.stream().pipeThrough(new CompressionStream("gzip"))).blob().catch((()=>null))}catch(t){}return Promise.resolve(null)})(t).then((e=>e?{body:e,gzip:!0,size:e.size}:{body:t,gzip:!1,size:t.size}))})),xs=e=>(e=>{const t=e.webReplay;return t&&!t.packed&&Array.isArray(t.events)?cs(t.events).then((n=>n?Object.assign({},e,{webReplay:Object.assign({},t,{events:n,packed:!0})}):e)):Promise.resolve(e)})(e).then((e=>ks(e))).then((t=>{if(t.size<=fs)return t;if(!e.webReplay)return null;const n=Object.assign({},e);return delete n.webReplay,ks(n).then((e=>e.size<=fs?e:null))})),Ss=(e,t)=>xs(t).then((t=>{return t?ys("POST",ms(e,"logs"),t.body,{gzip:t.gzip,timeoutMs:(n=t.size,3e4+1e3*Math.ceil((n||0)/65536))}):{status:413,data:null};var n})),Cs=e=>{const t=Object.assign({},gs);return e&&"object"==typeof e&&Object.keys(gs).forEach((n=>{"boolean"==typeof e[n]&&(t[n]=e[n])})),t},Es=(e,t,n)=>Array.isArray(e)?t?e.filter((e=>{const r=(e=>{if(!e)return NaN;const t=e.date;return t instanceof Date?t.getTime():"string"==typeof t||"number"==typeof t?new Date(t).getTime():NaN})(e);return isNaN(r)||r>=t&&r<=n})):e.slice():[],Is=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Cs(e.include),n=Date.now(),r=e.windowEnd||n,o=e.windowStart?e.windowStart-1e4:0,i={},a=(e,t)=>{try{i[e]=t()}catch(n){}};if(t.consoleLog&&a("consoleLog",(()=>Es(wd.getInstance().getLogs(),o,r))),t.networkLogs&&a("networkLogs",(()=>Es(km.getInstance().getRequests(),o,r))),t.customData&&a("customData",(()=>Rd.getInstance().getCustomData())),t.metaData&&a("metaData",(()=>gg.getInstance().getMetaData())),t.customEventLog&&a("customEventLog",(()=>Es(Sv.getInstance().getEventArray(),o,r))),t.replays&&(()=>{try{const e=Gu.getInstance().getFlowConfig();return!(!e||!e.enableWebReplays)}catch(e){return!1}})())try{const e=qa.getInstance().getReplaySnapshot();e&&e.startDate&&Array.isArray(e.events)&&e.events.length>0&&(i.webReplay=e)}catch(c){}let s=e.windowStart;if(!s)try{s=gg.getInstance().sessionStart.getTime()}catch(c){s=n}return i.capturedAt=new Date(n).toISOString(),i.windowStart=new Date(s).toISOString(),i.windowEnd=new Date(r).toISOString(),i.platform=Bn,i.sdkType=Fn,i.sdkVersion=Gn(),e.deviceId&&(i.deviceId=e.deviceId),i};"p".charCodeAt(0),"H".charCodeAt(0),"Y".charCodeAt(0),"s".charCodeAt(0);const Ts="[modern-screenshot]",Ls="undefined"!=typeof window,Os=Ls&&"Worker"in window,As=(Ls&&window,Ls&&window,Ls?window.navigator?.userAgent:""),Ms=As.includes("Chrome"),Rs=As.includes("AppleWebKit")&&!Ms,Ps=As.includes("Firefox"),Ds=e=>e&&"__CONTEXT__"in e,Ns=e=>"CSSFontFaceRule"===e.constructor.name,js=e=>"CSSImportRule"===e.constructor.name,_s=e=>"CSSLayerBlockRule"===e.constructor.name,Fs=e=>1===e.nodeType,Bs=e=>"object"==typeof e.className,Us=e=>"image"===e.tagName,Hs=e=>"use"===e.tagName,qs=e=>Fs(e)&&void 0!==e.style&&!Bs(e),zs=e=>8===e.nodeType,Ws=e=>3===e.nodeType,Gs=e=>"IMG"===e.tagName,Vs=e=>"VIDEO"===e.tagName,$s=e=>"CANVAS"===e.tagName,Xs=e=>"TEXTAREA"===e.tagName,Js=e=>"INPUT"===e.tagName,Ks=e=>"STYLE"===e.tagName,Ys=e=>"SCRIPT"===e.tagName,Zs=e=>"SELECT"===e.tagName,Qs=e=>"SLOT"===e.tagName,ec=e=>"IFRAME"===e.tagName,tc=(...e)=>console.warn(Ts,...e);function nc(e){const t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),Boolean(t)&&"toDataURL"in t&&Boolean(t.toDataURL("image/webp").includes("image/webp"))}const rc=e=>e.startsWith("data:");function oc(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Ls&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;if(!Ls)return e;const n=ic().implementation.createHTMLDocument(),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),t&&(r.href=t),o.href=e,o.href}function ic(e){return(e&&Fs(e)?e?.ownerDocument:e)??window.document}const ac="http://www.w3.org/2000/svg";function sc(e,t,n){const r=ic(n).createElementNS(ac,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function cc(e,t){let n=(new XMLSerializer).serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function lc(e,t){return new Promise(((n,r)=>{const o=new FileReader;o.onload=()=>n(o.result),o.onerror=()=>r(o.error),o.onabort=()=>r(new Error(`Failed read blob to ${t}`)),"dataUrl"===t?o.readAsDataURL(e):"arrayBuffer"===t&&o.readAsArrayBuffer(e)}))}const uc=e=>lc(e,"dataUrl");function dc(e,t){const n=ic(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function pc(e,t){return new Promise((n=>{const{timeout:r,ownerDocument:o,onError:i,onWarn:a}=t??{},s="string"==typeof e?dc(e,ic(o)):e;let c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),Vs(s)){const e=s.currentSrc||s.src;if(!e)return s.poster?pc(s.poster,t).then(n):u();if(s.readyState>=2)return u();const r=u,o=t=>{a?.("Failed video load",e,t),i?.(t),u()};l=()=>{s.removeEventListener("loadeddata",r),s.removeEventListener("error",o)},s.addEventListener("loadeddata",r,{once:!0}),s.addEventListener("error",o,{once:!0})}else{const e=Us(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();const t=async()=>{if(Gs(s)&&"decode"in s)try{await s.decode()}catch(t){a?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||e,t)}u()},n=t=>{a?.("Failed image load",s.dataset.originalSrc||e,t),u()};if(Gs(s)&&s.complete)return t();l=()=>{s.removeEventListener("load",t),s.removeEventListener("error",n)},s.addEventListener("load",t,{once:!0}),s.addEventListener("error",n,{once:!0})}}))}const hc=function(){let e=0;return()=>(e+=1,`u${`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4)}${e}`)}();function fc(e){return e?.split(",").map((e=>e.trim().replace(/"|'/g,"").toLowerCase())).filter(Boolean)}let gc=0;function mc(e){const t=`${Ts}[#${gc}]`;return gc++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&tc(...t)}}async function vc(e,t){return Ds(e)?e:yc(e,{...t,autoDestruct:!0})}async function yc(e,t){const{scale:n=1,workerUrl:r,workerNumber:o=1}=t||{},i=Boolean(t?.debug),a=t?.features??!0,s=e.ownerDocument??(Ls?window.document:void 0),c=e.ownerDocument?.defaultView??(Ls?window:void 0),l=new Map,u={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:(d=t?.fetch?.bypassingCache,{cache:d?"no-cache":"force-cache"}),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:o,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:mc(i),node:e,ownerDocument:s,ownerWindow:c,dpi:1===n?null:96*n,svgStyleElement:bc(s),svgDefsElement:s?.createElementNS(ac,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Os&&r&&o?o:0})].map((()=>{try{const e=new Worker(r);return e.onmessage=async e=>{const{url:t,result:n}=e.data;n?l.get(t)?.resolve?.(n):l.get(t)?.reject?.(new Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{const{url:t}=e.data;l.get(t)?.reject?.(new Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn("Failed to new Worker",e),null}})).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[nc(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:a,isEnable:e=>"restoreScrollPosition"===e?"boolean"!=typeof a&&(a[e]??!1):"boolean"==typeof a?a:a[e]??!0,shadowRoots:[]};var d;u.log.time("wait until load"),await async function(e,t){qs(e)&&(Gs(e)||Vs(e)?await pc(e,t):await Promise.all(["img","video"].flatMap((n=>Array.from(e.querySelectorAll(n)).map((e=>pc(e,t)))))))}(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd("wait until load");const{width:p,height:h}=function(e,t){let{width:n,height:r}=t;if(Fs(e)&&(!n||!r)){const t=e.getBoundingClientRect();n=n||t.width||Number(e.getAttribute("width"))||0,r=r||t.height||Number(e.getAttribute("height"))||0}return{width:n,height:r}}(e,u);return u.width=p,u.height=h,u}function bc(e){if(!e)return;const t=e.createElement("style"),n=t.ownerDocument.createTextNode("\n.______background-clip--text {\n background-clip: text;\n -webkit-background-clip: text;\n}\n");return t.appendChild(n),t}async function wc(e,t){const{log:n,timeout:r,drawImageCount:o,drawImageInterval:i}=t;n.time("image to canvas");const a=await pc(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:c}=function(e,t){const{width:n,height:r,scale:o,backgroundColor:i,maximumCanvasSize:a}=t,s=e.createElement("canvas");s.width=Math.floor(n*o),s.height=Math.floor(r*o),s.style.width=`${n}px`,s.style.height=`${r}px`,a&&(s.width>a||s.height>a)&&(s.width>a&&s.height>a?s.width>s.height?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a):s.width>a?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a));const c=s.getContext("2d");c&&i&&(c.fillStyle=i,c.fillRect(0,0,s.width,s.height));return{canvas:s,context2d:c}}(e.ownerDocument,t),l=()=>{try{c?.drawImage(a,0,0,s.width,s.height)}catch(e){t.log.warn("Failed to drawImage",e)}};if(l(),t.isEnable("fixSvgXmlDecode"))for(let u=0;u{setTimeout((()=>{c?.clearRect(0,0,s.width,s.height),l(),e()}),u+i)}));return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function kc(e,t){if(e.ownerDocument)try{const t=e.toDataURL();if("data:,"!==t)return dc(t,e.ownerDocument)}catch(i){t.log.warn("Failed to clone canvas",i)}const n=e.cloneNode(!1),r=e.getContext("2d"),o=n.getContext("2d");try{return r&&o&&o.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(i){t.log.warn("Failed to clone canvas",i)}return n}function xc(e,t){return $s(e)?kc(e,t):ec(e)?function(e,t){try{if(e?.contentDocument?.documentElement)return Pc(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}(e,t):Gs(e)?function(e){const t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager"),t}(e):Vs(e)?async function(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return dc(e.poster,e.ownerDocument);const n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);const r=n.ownerDocument;if(r){let i=!0;if(await pc(n,{onError:()=>i=!1,onWarn:t.log.warn}),!i)return e.poster?dc(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise((e=>{n.addEventListener("seeked",e,{once:!0})}));const a=r.createElement("canvas");a.width=e.offsetWidth,a.height=e.offsetHeight;try{const e=a.getContext("2d");e&&e.drawImage(n,0,0,a.width,a.height)}catch(o){return t.log.warn("Failed to clone video",o),e.poster?dc(e.poster,e.ownerDocument):n}return kc(a,t)}return n}(e,t):e.cloneNode(!1)}const Sc=["width","height","-webkit-text-fill-color"],Cc=["stroke","fill"];function Ec(e,t,n){const{defaultComputedStyles:r}=n,o=e.nodeName.toLowerCase(),i=Bs(e)&&"svg"!==o,a=i?Cc.map((t=>[t,e.getAttribute(t)])).filter((([,e])=>null!==e)):[],s=[i&&"svg",o,a.map(((e,t)=>`${e}=${t}`)).join(","),t].filter(Boolean).join(":");if(r.has(s))return r.get(s);const c=function(e){let t=e.sandbox;if(!t){const{ownerDocument:r}=e;try{r&&(t=r.createElement("iframe"),t.id=`__SANDBOX__${hc()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",r.body.appendChild(t),t.srcdoc='',e.sandbox=t)}catch(n){e.log.warn("Failed to getSandBox",n)}}return t}(n),l=c?.contentWindow;if(!l)return new Map;const u=l?.document;let d,p;i?(d=u.createElementNS(ac,"svg"),p=d.ownerDocument.createElementNS(d.namespaceURI,o),a.forEach((([e,t])=>{p.setAttributeNS(null,e,t)})),d.appendChild(p)):d=p=u.createElement(o),p.textContent=" ",u.body.appendChild(d);const h=l.getComputedStyle(p,t),f=new Map;for(let g=h.length,m=0;mr.set(t,e)));function a(n){const a=e.getPropertyValue(n),s=e.getPropertyPriority(n),c=n.lastIndexOf("-"),l=c>-1?n.substring(0,c):void 0;if(l){let e=i.get(l);e||(e=new Map,i.set(l,e)),e.set(n,[a,s])}(t.get(n)!==a||s)&&(l?o.push(l):r.set(n,[a,s]))}return r}const Tc=["::before","::after"],Lc=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];const Oc=new Set(["symbol"]);async function Ac(e,t,n,r,o){if(Fs(n)&&(Ks(n)||Ys(n)))return;if(r.filter&&!r.filter(n))return;Oc.has(t.nodeName)||Oc.has(n.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;const i=await Pc(n,r,!1,o);r.isEnable("restoreScrollPosition")&&function(e,t){if(!qs(e)||!qs(t))return;const{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;const{transform:o}=t.style,i=new DOMMatrix(o),{a,b:s,c,d:l}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-r,-n),i.a=a,i.b=s,i.c=c,i.d=l,t.style.transform=i.toString()}(e,i),t.appendChild(i)}async function Mc(e,t,n,r){let o=e.firstChild;Fs(e)&&e.shadowRoot&&(o=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let i=o;i;i=i.nextSibling)if(!zs(i))if(Fs(i)&&Qs(i)&&"function"==typeof i.assignedNodes){const o=i.assignedNodes();for(let i=0;i{l.delete(t)}));const u=Ic(c,l,i);u.delete("transition-property"),u.delete("all"),u.delete("d"),u.delete("content"),n&&(u.delete("position"),u.delete("margin-top"),u.delete("margin-right"),u.delete("margin-bottom"),u.delete("margin-left"),u.delete("margin-block-start"),u.delete("margin-block-end"),u.delete("margin-inline-start"),u.delete("margin-inline-end"),u.set("box-sizing",["border-box",""])),"text"===u.get("background-clip")?.[0]&&t.classList.add("______background-clip--text"),Ms&&(u.has("font-kerning")||u.set("font-kerning",["normal",""]),"hidden"!==u.get("overflow-x")?.[0]&&"hidden"!==u.get("overflow-y")?.[0]||"ellipsis"!==u.get("text-overflow")?.[0]||e.scrollWidth!==e.clientWidth||u.set("text-overflow",["clip",""]));for(let d=s.length,p=0;p{s.setProperty(n,e,t)})),u}(e,r,n,t);n&&function(e,t){const{backgroundColor:n,width:r,height:o,style:i}=t,a=e.style;if(n&&a.setProperty("background-color",n,"important"),r&&a.setProperty("width",`${r}px`,"important"),o&&a.setProperty("height",`${o}px`,"important"),i)for(const s in i)a[s]=i[s]}(r,t);let i=!1;if(t.isEnable("copyScrollbar")){const t=[o.get("overflow-x")?.[0],o.get("overflow-y")?.[0]];i=t.includes("scroll")||(t.includes("auto")||t.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}const c=o.get("text-transform")?.[0],l=fc(o.get("font-family")?.[0]),u=l?e=>{"uppercase"===c?e=e.toUpperCase():"lowercase"===c?e=e.toLowerCase():"capitalize"===c&&(e=e[0].toUpperCase()+e.substring(1)),l.forEach((t=>{let n=a.get(t);n||a.set(t,n=new Set),e.split("").forEach((e=>n.add(e)))}))}:void 0;return function(e,t,n,r,o){const{ownerWindow:i,svgStyleElement:a,svgStyles:s,currentNodeStyle:c}=r;function l(n){const a=i.getComputedStyle(e,n);let l=a.getPropertyValue("content");if(!l||"none"===l)return;o?.(l),l=l.replace(/(')|(")|(counter\(.+\))/g,"");const u=[hc()],d=Ec(e,n,r);c?.forEach(((e,t)=>{d.delete(t)}));const p=Ic(a,d,r.includeStyleProperties);p.delete("content"),p.delete("-webkit-locale"),"text"===p.get("background-clip")?.[0]&&t.classList.add("______background-clip--text");const h=[`content: '${l}';`];if(p.forEach((([e,t],n)=>{h.push(`${n}: ${e}${t?" !important":""};`)})),1===h.length)return;try{t.className=[t.className,...u].join(" ")}catch(Zv){return void r.log.warn("Failed to copyPseudoClass",Zv)}const f=h.join("\n ");let g=s.get(f);g||(g=[],s.set(f,g)),g.push(`.${u[0]}${n}`)}a&&i&&(Tc.forEach(l),n&&Lc.forEach(l))}(e,r,i,t,u),function(e,t){(Xs(e)||Js(e)||Zs(e))&&t.setAttribute("value",e.value)}(e,r),Vs(e)||await Mc(e,r,t,u),await(s?.(r)),r}const c=e.cloneNode(!1);return await Mc(e,c,t),await(s?.(c)),c}function Dc(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(Zv){e.log.warn("Failed to destroyContext",Zv)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function Nc(e,t){const{url:n,requestType:r="text",responseType:o="text",imageDom:i}=t;let a=n;const{timeout:s,acceptOfImage:c,requests:l,fetchFn:u,fetch:{requestInit:d,bypassingCache:p,placeholderImage:h},font:f,workers:g,fontFamilies:m}=e;"image"===r&&(Rs||Ps)&&e.drawImageCount++;let v=l.get(n);if(!v){p&&p instanceof RegExp&&p.test(a)&&(a+=(/\?/.test(a)?"&":"?")+(new Date).getTime());const t=r.startsWith("font")&&f&&f.minify,y=new Set;if(t){r.split(";")[1].split(",").forEach((e=>{m.has(e)&&m.get(e).forEach((e=>y.add(e)))}))}const b=t&&y.size,w={url:a,timeout:s,responseType:b?"arrayBuffer":o,headers:"image"===r?{accept:c}:void 0,...d};v={type:r,resolve:void 0,reject:void 0,response:null},v.response=(async()=>{if(u&&"image"===r){const e=await u(n);if(e)return e}return!Rs&&n.startsWith("http")&&g.length?new Promise(((e,t)=>{g[l.size&g.length-1].postMessage({rawUrl:n,...w}),v.resolve=e,v.reject=t})):function(e){const{url:t,timeout:n,responseType:r,...o}=e,i=new AbortController,a=n?setTimeout((()=>i.abort()),n):void 0;return fetch(t,{signal:i.signal,...o}).then((e=>{if(!e.ok)throw new Error("Failed fetch, not 2xx response",{cause:e});switch(r){case"arrayBuffer":return e.arrayBuffer();case"dataUrl":return e.blob().then(uc);default:return e.text()}})).finally((()=>clearTimeout(a)))}(w)})().catch((t=>{if(l.delete(n),"image"===r&&h)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),"string"==typeof h?h:h(i);throw t})),l.set(n,v)}return v.response}async function jc(e,t,n,r){if(!_c(e))return e;for(const[i,a]of function(e,t){const n=[];return e.replace(Fc,((e,r,o)=>(n.push([o,oc(o,t)]),e))),n.filter((([e])=>!rc(e)))}(e,t))try{const t=await Nc(n,{url:a,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(Bc(i),`$1${t}$3`)}catch(o){n.log.warn("Failed to fetch css data url",i,o)}return e}function _c(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}const Fc=/url\((['"]?)([^'"]+?)\1\)/g;function Bc(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}const Uc=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function Hc(e,t){const{tasks:n}=t;Fs(e)&&((Gs(e)||Us(e))&&n.push(...function(e,t){if(Gs(e)){const n=e.currentSrc||e.src;if(!rc(n))return[Nc(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then((t=>{t&&(e.srcset="",e.dataset.originalSrc=n,e.src=t||"")}))];(Rs||Ps)&&t.drawImageCount++}else if(Bs(e)&&!rc(e.href.baseVal)){const n=e.href.baseVal;return[Nc(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then((t=>{t&&(e.dataset.originalSrc=n,e.href.baseVal=t||"")}))]}return[]}(e,t)),Hs(e)&&n.push(...function(e,t){const{ownerDocument:n,svgDefsElement:r}=t,o=e.getAttribute("href")??e.getAttribute("xlink:href");if(!o)return[];const[i,a]=o.split("#");if(a){const o=`#${a}`,s=t.shadowRoots.reduce(((e,t)=>e??t.querySelector(`svg ${o}`)),n?.querySelector(`svg ${o}`));if(i&&e.setAttribute("href",o),r?.querySelector(o))return[];if(s)return r?.appendChild(s.cloneNode(!0)),[];if(i)return[Nc(t,{url:i,responseType:"text"}).then((e=>{r?.insertAdjacentHTML("beforeend",e)}))]}return[]}(e,t))),qs(e)&&n.push(...function(e,t){return Uc.map((n=>{const r=e.getPropertyValue(n);return r&&"none"!==r?((Rs||Ps)&&t.drawImageCount++,jc(r,null,t,!0).then((t=>{t&&r!==t&&e.setProperty(n,t,e.getPropertyPriority(n))}))):null})).filter(Boolean)}(e.style,t)),e.childNodes.forEach((e=>{Hc(e,t)}))}async function qc(e,t){const{ownerDocument:n,svgStyleElement:r,fontFamilies:o,fontCssTexts:i,tasks:a,font:s}=t;if(n&&r&&o.size)if(s&&s.cssText){const e=$c(s.cssText,t);r.appendChild(n.createTextNode(`${e}\n`))}else{const e=Array.from(n.styleSheets).filter((e=>{try{return"cssRules"in e&&Boolean(e.cssRules.length)}catch(n){return t.log.warn(`Error while reading CSS rules from ${e.href}`,n),!1}})),s=n.implementation.createHTMLDocument(""),c=s.createElement("style");s.head.appendChild(c);const l=c.sheet;await Promise.all(e.flatMap((e=>Array.from(e.cssRules).map((async e=>{if(js(e)){const r=e.href;let o="";try{o=await Nc(t,{url:r,requestType:"text",responseType:"text"})}catch(n){t.log.warn(`Error fetch remote css import from ${r}`,n)}const i=o.replace(Fc,((e,t,n)=>e.replace(n,oc(n,r))));for(const e of function(e){if(null==e)return[];const t=[];let n=e.replace(zc,"");for(;;){const e=Wc.exec(n);if(!e)break;t.push(e[0])}n=n.replace(Wc,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let e=r.exec(n);if(e)o.lastIndex=r.lastIndex;else{if(e=o.exec(n),!e)break;r.lastIndex=o.lastIndex}t.push(e[0])}return t}(i))try{l.insertRule(e,l.cssRules.length)}catch(n){t.log.warn("Error inserting rule from remote css import",{rule:e,error:n})}}}))))),l.cssRules.length&&e.push(l);const u=[];e.forEach((e=>{Xc(e.cssRules,u)})),u.filter((e=>Ns(e)&&_c(e.style.getPropertyValue("src"))&&fc(e.style.getPropertyValue("font-family"))?.some((e=>o.has(e))))).forEach((e=>{const o=e,s=i.get(o.cssText);s?r.appendChild(n.createTextNode(`${s}\n`)):a.push(jc(o.cssText,o.parentStyleSheet?o.parentStyleSheet.href:null,t).then((e=>{e=$c(e,t),i.set(o.cssText,e),r.appendChild(n.createTextNode(`${e}\n`))})))}))}}const zc=/(\/\*[\s\S]*?\*\/)/g,Wc=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;const Gc=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Vc=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function $c(e,t){const{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(Vc,(e=>{for(;;){const[t,,n]=Gc.exec(e)||[];if(!n)return"";if(n===r)return`src: ${t};`}})):e}function Xc(e,t=[]){for(const n of Array.from(e))_s(n)?t.push(...Xc(n.cssRules)):"cssRules"in n?Xc(n.cssRules,t):t.push(n);return t}const Jc=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;async function Kc(e,t){const n=await vc(e,t);if(Fs(n.node)&&Bs(n.node)&&!function(e){return Jc.test(e.innerHTML)}(n.node))return n.node;const{ownerDocument:r,log:o,tasks:i,svgStyleElement:a,svgDefsElement:s,svgStyles:c,font:l,progress:u,autoDestruct:d,onCloneNode:p,onEmbedNode:h,onCreateForeignObjectSvg:f}=n;o.time("clone node");const g=await Pc(n.node,n,!0);if(a&&r){let e="";c.forEach(((t,n)=>{e+=`${t.join(",\n")} {\n ${n}\n}\n`})),a.appendChild(r.createTextNode(e))}o.timeEnd("clone node"),await(p?.(g)),!1!==l&&Fs(g)&&(o.time("embed web font"),await qc(0,n),o.timeEnd("embed web font")),o.time("embed node"),Hc(g,n);const m=i.length;let v=0;u?.(v,m),await Promise.all([...Array.from({length:4})].map((async()=>{for(;;){const t=i.pop();if(!t)break;try{await t}catch(e){n.log.warn("Failed to run task",e)}u?.(++v,m)}}))),o.timeEnd("embed node"),await(h?.(g));const y=function(e,t){const{width:n,height:r}=t,o=sc(n,r,e.ownerDocument),i=o.ownerDocument.createElementNS(o.namespaceURI,"foreignObject");return i.setAttributeNS(null,"x","0%"),i.setAttributeNS(null,"y","0%"),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.append(e),o.appendChild(i),o}(g,n);return s&&y.insertBefore(s,y.children[0]),a&&y.insertBefore(a,y.children[0]),d&&Dc(n),await(f?.(y)),y}async function Yc(e,t){const n=await vc(e,t),r=await Kc(n),o=cc(r,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=bc(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(ac,"defs"),n.svgStyles.clear());const i=dc(o,r.ownerDocument);return await wc(i,n)}const Zc=2560,Qc="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",el=[".gleap-frame-container",".bb-feedback-button",".gleap-notification-container",".gleap-chatbar",".gleap-capture-root",".gleap-image-view",".bb-capture-editor",".gleap-b",".gleap-modal-wrapper",".gleap-tooltip",".gleap-tour-popover",".gleap-tour-overlay","#copilot-pointer-container","#copilot-joined-container",".gleap-audio-unmute-modal-overlay",".gleap-admin-frame-container",".gleap-admin-collapse-ui",".click-wave"].join(", "),tl=["stripe.com","stripe.network","braintreegateway.com","braintree-api.com","paypal.com","adyen.com","adyenpayments.com","checkout.com","squareup.com","squareupsandbox.com","recurly.com","chargebee.com","paddle.com","mollie.com","klarna.com","worldpay.com","authorize.net","razorpay.com","2checkout.com","cybersource.com","spreedly.com","gocardless.com","payu.com","mercadopago.com","paystack.co","flutterwave.com"],nl=new RegExp("(^|\\.)("+tl.map((e=>e.replace(/\./g,"\\."))).join("|")+")$","i"),rl=["card","payment","cvc","cvv","security code","expir","iban"],ol=new RegExp(rl.join("|"),"i"),il=()=>{const e=['iframe[allow*="payment" i]'];return rl.forEach((t=>{e.push('iframe[title*="'+t+'" i]','iframe[name*="'+t+'" i]')})),tl.forEach((t=>{e.push('iframe[src*="//'+t+'" i]','iframe[src*=".'+t+'" i]')})),e.join(", ")},al=e=>new Promise((t=>setTimeout(t,e))),sl=(e,t,n)=>new Promise(((r,o)=>{const i=setTimeout((()=>o(new Error(n||"timeout"))),t);e.then((e=>{clearTimeout(i),r(e)}),(e=>{clearTimeout(i),o(e)}))})),cl=e=>{try{if("undefined"!=typeof CSS&&"function"==typeof CSS.escape)return CSS.escape(e)}catch(t){}return String(e).replace(/[^a-zA-Z0-9_-]/g,(e=>"\\"+e))},ll=e=>{if("string"!=typeof e||0===e.trim().length)return null;try{return document.createDocumentFragment().querySelector(e),e.trim()}catch(t){return null}},ul=(e,t)=>{const n=e||{},r=[".rr-block, .gl-block, .rr-mask, .gl-mask"];return[n.blockSelector,n.maskTextSelector].concat(Array.isArray(t)?t:[]).forEach((e=>{const t=ll(e);t&&r.push(t)})),[n.blockClass,n.maskTextClass].forEach((e=>{if("string"==typeof e&&e.length>0){const t=ll("."+cl(e));t&&r.push(t)}})),r},dl=e=>{const t=e||{};return[t.blockClass,t.maskTextClass].filter((e=>e&&"function"==typeof e.test))},pl=(e,t)=>{if(!t.length||!e.classList)return!1;for(let n=0;n{try{return!!(e&&e.matches&&e.matches(el))}catch(t){return!1}},fl=e=>{try{return!!(e&&e.closest&&e.closest(el))}catch(t){return!1}},gl=e=>{try{if(-1!==(e.getAttribute("allow")||"").toLowerCase().indexOf("payment"))return!0;const t=(e.getAttribute("title")||"")+" "+(e.getAttribute("name")||"");if(ol.test(t))return!0;const n=e.getAttribute("src");if(n)return nl.test(new URL(n,window.location.href).hostname)}catch(t){}return!1},ml=e=>{let t=null;try{t=e.getBoundingClientRect()}catch(n){}try{const n=(e.ownerDocument||document).createRange();n.selectNodeContents(e),t=((e,t)=>{if(!e||e.width<=0||e.height<=0)return t;if(!t||t.width<=0||t.height<=0)return e;const n=Math.min(e.left,t.left),r=Math.min(e.top,t.top);return{left:n,top:r,width:Math.max(e.left+e.width,t.left+t.width)-n,height:Math.max(e.top+e.height,t.top+t.height)-r}})(t,n.getBoundingClientRect())}catch(n){}return t},vl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[],n={},r=e.privacyOptions||{},o=((e,t)=>ul(e,t).join(", "))(r,e.maskSelectors),i=dl(r),a=(e,r)=>{if(!(e&&e.width>0&&e.height>0))return;let o=e.left+r.x,i=e.top+r.y,a=o+e.width,s=i+e.height;r.clip&&(o=Math.max(o,r.clip.left),i=Math.max(i,r.clip.top),a=Math.min(a,r.clip.right),s=Math.min(s,r.clip.bottom));const c=[o,i,a,s].join(",");a>o&&s>i&&!n[c]&&(n[c]=!0,t.push({x:o,y:i,width:a-o,height:s-i}))},s=(e,t,n)=>{if(!e||n>8)return;const c=(t,n)=>{let r=[];try{r=e.querySelectorAll(t)}catch(o){}for(let e=0;ea(ml(e),t))),c("input, textarea, select",(e=>{((e,t)=>{try{return!!La(e,t)}catch(n){return!0}})(e,r)&&a(e.getBoundingClientRect(),t)})),c("iframe, frame",(e=>{const r=e.getBoundingClientRect();if(gl(e))return void a(r,t);let o=null;try{o=e.contentDocument}catch(i){}if(o&&o.documentElement&&r.width>0&&r.height>0){const i=t.x+r.left+(e.clientLeft||0),a=t.y+r.top+(e.clientTop||0);let c={left:t.x+r.left,top:t.y+r.top,right:t.x+r.right,bottom:t.y+r.bottom};t.clip&&(c={left:Math.max(c.left,t.clip.left),top:Math.max(c.top,t.clip.top),right:Math.min(c.right,t.clip.right),bottom:Math.min(c.bottom,t.clip.bottom)}),s(o,{x:i,y:a,clip:c},n+1)}}));try{const r=(e.ownerDocument||e).createTreeWalker(e,1,{acceptNode:e=>hl(e)?2:1});let o=r.nextNode();for(;o;)o.shadowRoot&&s(o.shadowRoot,t,n+1),i.length&&pl(o,i)&&a(ml(o),t),o=r.nextNode()}catch(l){}};return s(document,{x:0,y:0,clip:null},0),t},yl=(e,t)=>{const n=document.createElement("canvas");return n.width=Math.max(1,Math.round(e)),n.height=Math.max(1,Math.round(t)),n},bl=e=>{try{e&&(e.width=0,e.height=0)}catch(t){}},wl=e=>{try{const t=48,n=yl(t,t),r=n.getContext("2d");r.drawImage(e,0,0,t,t);const o=r.getImageData(0,0,t,t).data;bl(n);let i=!0,a=!0;for(let e=0;e0&&(i=!1,(o[e]>12||o[e+1]>12||o[e+2]>12)&&(a=!1));return i?"transparent":a?"black":"content"}catch(t){return"content"}},kl=e=>{let{canvas:t,scaleX:n,scaleY:r,rects:o,background:i}=e;const a=Math.max(t.width,t.height),s=a>Zc?Zc/a:1,c=yl(t.width*s,t.height*s),l=c.getContext("2d");l.fillStyle=i||"#ffffff",l.fillRect(0,0,c.width,c.height),l.imageSmoothingEnabled=!0;try{l.imageSmoothingQuality="high"}catch(d){}l.drawImage(t,0,0,c.width,c.height),((e,t,n,r)=>{e.save(),e.fillStyle="#000000";for(let o=0;o{try{e&&e.getTracks().forEach((e=>{try{e.stop()}catch(t){}}))}catch(t){}},Sl=(e,t)=>("function"!=typeof ImageCapture?Promise.resolve(null):sl(new ImageCapture(e).grabFrame(),3e3,"grab-timeout").then((e=>e&&e.width>0?{source:e,width:e.width,height:e.height,release:()=>e.close&&e.close()}:null),(()=>null))).then((t=>t||(()=>{if("function"!=typeof MediaStreamTrackProcessor)return Promise.resolve(null);let t=null;const n=()=>{try{t&&t.cancel()}catch(e){}};try{t=new MediaStreamTrackProcessor({track:e}).readable.getReader()}catch(r){return Promise.resolve(null)}return sl(t.read(),3e3,"read-timeout").then((e=>{n();const t=e&&e.value;return t?{source:t,width:t.displayWidth||t.codedWidth,height:t.displayHeight||t.codedHeight,release:()=>t.close()}:null}),(()=>(n(),null)))})())).then((e=>e||(()=>{const e=document.createElement("video");e.muted=!0,e.playsInline=!0,e.srcObject=t;const n=()=>{try{e.pause(),e.srcObject=null}catch(t){}},r=new Promise((t=>{"function"==typeof e.requestVideoFrameCallback?e.requestVideoFrameCallback((()=>t())):e.addEventListener("loadeddata",(()=>setTimeout(t,60)),{once:!0})}));return sl(Promise.resolve(e.play()),3e3,"play-timeout").then((()=>sl(r,3e3,"frame-timeout"))).then((()=>({source:e,width:e.videoWidth,height:e.videoHeight,release:n})),(e=>{throw n(),e}))})())),Cl=(e,t)=>{let{setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}=t;const a=e&&e.getVideoTracks?e.getVideoTracks()[0]:null;let s=!1;const c=()=>{s=!0,xl(e),n(!1)};if(!a)return c(),Promise.reject(new Error("no-video-track"));let l={};try{l=a.getSettings?a.getSettings():{}}catch(d){}if(l.displaySurface&&"browser"!==l.displaySurface)return c(),Promise.reject(new Error("not-this-tab"));const u=t=>{if(s)throw new Error("tab-timeout");if(t>=3)throw new Error("no-usable-frame");if("ended"===a.readyState)throw new Error("track-ended");const n=vl({privacyOptions:r,maskSelectors:o});return Sl(a,e).then((e=>{const i=window.innerWidth,a=window.innerHeight,c=(e=>{const t=window.visualViewport,n=t&&t.scale?t.scale:1;return t&&(1!==n||t.offsetLeft||t.offsetTop)?e.map((e=>({x:(e.x-t.offsetLeft)*n,y:(e.y-t.offsetTop)*n,width:e.width*n,height:e.height*n}))):e})(n.concat(vl({privacyOptions:r,maskSelectors:o})));let l=null;try{if(!s&&e&&e.width>0&&e.height>0){const n=i/a;Math.abs(e.width/e.height-n)/n<=.04&&(l=yl(e.width,e.height),l.getContext("2d").drawImage(e.source,0,0,e.width,e.height),t<2&&"content"!==wl(l)&&(bl(l),l=null))}}finally{try{e&&e.release()}catch(d){}}if(s)throw bl(l),new Error("tab-timeout");return l?{canvas:l,scaleX:l.width/i,scaleY:l.height/a,rects:c,background:"#000000",method:"tab"}:al(150).then((()=>u(t+1)))}))};return n(!0),new Promise(((e,t)=>{let n=null;const r=(r,o)=>{s?o&&bl(o.canvas):(clearInterval(n),c(),r?t(r):e(o))};n=setInterval((()=>{try{i&&!i()&&r(new Error("aborted"))}catch(d){}}),200),sl(new Promise((e=>{let t=!1;const n=()=>{t||(t=!0,e())};setTimeout(n,120);try{requestAnimationFrame((()=>requestAnimationFrame(n)))}catch(d){n()}})).then((()=>al(120))).then((()=>u(0))),15e3,"tab-timeout").then((e=>r(null,e)),(e=>r(e)))}))},El=200,Il=["background-image","border-image-source","mask-image","-webkit-mask-image","list-style-image"],Tl=(e,t)=>(e.width>0||e.height>0)&&e.bottom>t.top&&e.topt.left&&e.left{const t=[],n=e=>{for(let n=0;nnew Promise(((t,n)=>{const r=new Set,o={top:-200,left:-200,bottom:window.innerHeight+El,right:window.innerWidth+El},i=document.documentElement,a=[{element:i,children:Ll(i),index:0,visible:!0,sized:!1}],s=()=>{try{if(e())return void n(new Error("aborted"));const c=Ya();for(;a.length;){const e=a[a.length-1];if(e.index0&&n.height>0})}else a.pop(),a.length&&(e.visible?a[a.length-1].visible=!0:e.sized&&r.add(e.element));if(a.length&&Ya()-c>25)return void Za().then(s)}t(r)}catch(c){n(c)}};s()})),Al={block:!0,"flow-root":!0,"list-item":!0,flex:!0,grid:!0,table:!0},Ml={flex:!0,"inline-flex":!0,grid:!0,"inline-grid":!0},Rl=(e,t)=>{let{offscreen:n,masked:r}=t,o=null;if(!n&&!r){try{const t=e.videoWidth,n=e.videoHeight;if(e.readyState>=2&&t>0&&n>0){const r=Math.min(1,1280/Math.max(t,n)),i=yl(t*r,n*r);try{i.getContext("2d").drawImage(e,0,0,i.width,i.height),o=i.toDataURL("image/jpeg",.85)}finally{bl(i)}}}catch(a){o=null}if(!o)try{o=e.poster||null}catch(a){}}const i=document.createElement(o?"img":"div");try{const t=window.getComputedStyle(e);for(let e=0;e{const i=[e],a=(Array.isArray(n)?n:[]).map(ll).filter(Boolean).join(", "),s=document.scrollingElement||document.documentElement,c={broken:!1,offsetX:0,offsetY:0,lastYield:Ya(),canYield:!1,elements:0,offscreen:null},l=new Map,u=new Map,d=new Set,p=e=>{try{return Ia(e,t)||Ea(e,t)||!!a&&e.matches(a)}catch(n){return!1}},h=e=>l.set(e,(l.get(e)||0)+1),f=e=>e.style&&e.style.setProperty("visibility","hidden","important"),g=(e,t)=>{if(e===document.documentElement||e===s)return;const n=e.scrollTop||0,r=e.scrollLeft||0;if(!n&&!r)return;let o=null;try{o=e.getBoundingClientRect()}catch(a){}if(o&&(e=>Math.abs(e.left)<=2&&Math.abs(e.top)<=2&&Math.abs(e.right-window.innerWidth)<=20&&Math.abs(e.bottom-window.innerHeight)<=20)(o))return c.offsetX+=r,c.offsetY+=n,void t.style.setProperty("overflow","visible","important");const i=t.children||[];for(let s=0;s{o();const t=i[i.length-1];if(d.has(t))return!1;if(!e||1!==e.nodeType)return h(t),!0;const n=String(e.tagName).toUpperCase();if("NOSCRIPT"===n||"TEMPLATE"===n)return!1;if(hl(e)||"string"==typeof e.id&&0===e.id.indexOf("__SANDBOX__"))return!1;if("VIDEO"===n){const n=u.get(t)||[];return n.push({index:l.get(t)||0,placeholder:Rl(e,{offscreen:!!c.offscreen&&c.offscreen.has(e),masked:p(e)})}),u.set(t,n),!1}if(c.elements+=1,c.elements>1e4)throw new Error("render-budget");return h(t),i.push(e),"IFRAME"!==n&&"FRAME"!==n||!(e=>{try{return!(!e.contentDocument||!e.contentDocument.documentElement)}catch(t){return!1}})(e)||i.push(e),c.offscreen&&c.offscreen.has(e)&&(e=>{try{if(e.ownerDocument!==document||e===document.body)return!1;const t=window.getComputedStyle(e);if(!Al[t.display])return!1;if("block"!==t.display&&"list-item"!==t.display)return!0;const n=e=>"hidden"===e||"scroll"===e||"auto"===e;if(n(t.overflowX)||n(t.overflowY)||"none"!==t.float||"absolute"===t.position||"fixed"===t.position)return!0;const r=e.parentElement;if(r&&Ml[window.getComputedStyle(r).display])return!0;const o=e=>parseFloat(t["padding"+e])>0||parseFloat(t["border"+e+"Width"])>0;return o("Top")&&o("Bottom")}catch(t){return!1}})(e)&&d.add(e),!0},onCloneEachNode:e=>{if(o(),!e||1!==e.nodeType)return;const n=i.pop();if(n&&((e,t)=>{const n=String(e.nodeName).toUpperCase(),r=String(t.nodeName).toUpperCase();return n===r||("IFRAME"===n||"FRAME"===n?"HTML"===r:!("VIDEO"!==n&&"CANVAS"!==n||"IMG"!==r&&"CANVAS"!==r&&"VIDEO"!==r))})(n,e)||(c.broken=!0),!c.broken)try{((e,t)=>{const n=u.get(e);n&&(u.delete(e),n.forEach(((e,n)=>{t.insertBefore(e.placeholder,t.childNodes[e.index+n]||null)})))})(n,e),((e,n)=>{const r=String(e.tagName).toUpperCase();if("INPUT"===r||"TEXTAREA"===r||"SELECT"===r){let o=null;try{o=La(e,t)}catch(a){o=()=>""}if(o){const t=o(e.value);if(n.setAttribute("value","string"==typeof t?t:""),"TEXTAREA"===r&&(n.textContent="string"==typeof t?t:""),"SELECT"===r){const e=n.querySelectorAll("option[selected]");for(let t=0;t{e.style&&Il.forEach((t=>e.style.setProperty(t,"none","important"))),"IMG"===String(e.nodeName).toUpperCase()&&(e.removeAttribute("srcset"),e.setAttribute("src",Qc))})(e)}catch(r){}return l.delete(n),c.canYield&&Ya()-c.lastYield>40?(c.lastYield=Ya(),Za()):void 0},onCloneNode:e=>{!c.broken&&(c.offsetX||c.offsetY)&&e&&e.style&&(e.style.top=-(r.y+c.offsetY)+"px",e.style.left=-(r.x+c.offsetX)+"px")},state:c}},Dl={contentWindow:null,remove:()=>{}},Nl=()=>{try{const e=window.innerHeight,t=document.images;for(let n=0;n0&&o.height>0&&o.bottom>0&&o.top{try{const e=-200,t=window.innerHeight+El,n=new Set,r=new Set,o=document.images;for(let a=0;at||s.bottomt||n.bottomn.delete(e))),0===n.size?null:e=>Promise.resolve(!!n.has(e)&&Qc)}catch(e){return null}};let _l=0,Fl=!1;const Bl=e=>{let{privacyOptions:t,maskSelectors:n,isActive:r}=e;return new Promise(((e,o)=>{const i=document.documentElement,a=Math.max(1,i.clientWidth||window.innerWidth),s=Math.max(1,i.clientHeight||window.innerHeight),c=Math.min(Math.max(window.devicePixelRatio||1,1),Zc/Math.max(a,s)),l={x:window.scrollX||0,y:window.scrollY||0},u=vl({privacyOptions:t,maskSelectors:n}),d=(()=>{const e=e=>e&&"transparent"!==e&&!/rgba\(\s*0,\s*0,\s*0,\s*0\s*\)/.test(e);try{const t=window.getComputedStyle(document.documentElement).backgroundColor;if(e(t))return t;const n=document.body?window.getComputedStyle(document.body).backgroundColor:null;if(e(n))return n}catch(t){}return"#ffffff"})();let p=null;const h=()=>(p||!r||r()||(p="aborted"),!!p),f=()=>{if(h())throw new Error(p)},g=Pl(i,t,n,l,f),m=(()=>{let e=null;try{e=km.getInstance(),0===_l&&(Fl=!!e.stopped,e.setStopped(!0)),_l+=1}catch(n){return()=>{}}let t=!1;return()=>{if(!t&&(t=!0,_l=Math.max(0,_l-1),0===_l))try{e.setStopped(Fl)}catch(n){}}})();let v=null,y=null,b=!1,w=null,k=null;const x=(t,n)=>{b?n&&bl(n.canvas):(b=!0,(()=>{if(clearTimeout(w),clearInterval(k),v){try{Dc(v)}catch(e){}v=null}if(y){try{y.remove()}catch(e){}y=null}m()})(),t?o(t):e(n))};w=setTimeout((()=>{try{p=p||"render-timeout",x(new Error("render-timeout"))}catch(e){}}),1e4),k=setInterval((()=>{try{h()&&x(new Error(p))}catch(e){}}),200),Promise.all([Ol(h),new Promise((e=>{const t=document.createElement("iframe");t.id="__SANDBOX__gleap",t.width="0",t.height="0",t.tabIndex=-1,t.setAttribute("aria-hidden","true"),t.style.visibility="hidden",t.style.position="fixed";let n=!1;try{t.srcdoc='',n=!0}catch(c){}const r=()=>{try{const e=t.contentDocument;return!(!e||!e.body||"complete"!==e.readyState||n&&"about:srcdoc"!==t.contentWindow.location.href)}catch(c){return!1}};let o=!1,i=null;const a=n=>{if(!o){if(o=!0,clearTimeout(i),t.removeEventListener("load",s),!n)try{t.remove()}catch(c){}e(n?t:null)}},s=()=>{r()&&a(!0)};t.addEventListener("load",s),i=setTimeout((()=>a(r())),1500);try{(document.body||document.documentElement).appendChild(t)}catch(c){return void a(!1)}n||a(r())}))]).then((e=>{let[t,n]=e;return b?(n&&n.remove(),null):(y=n,f(),g.state.offscreen=t,yc(i,{width:a,height:s,scale:c,backgroundColor:null,filter:g.filter,onCloneEachNode:g.onCloneEachNode,onCloneNode:g.onCloneNode,onCreateForeignObjectSvg:()=>{v&&(v.drawImageCount=Math.min(v.drawImageCount||0,2))},style:{position:"relative",top:-l.y+"px",left:-l.x+"px",overflow:"visible"},features:{restoreScrollPosition:!1},fetchFn:jl(),timeout:Nl()?3e3:50}))})).then((e=>{if(!e)return null;if(b){try{Dc(e)}catch(t){}return null}return v=e,v.timeout=8e3,v.sandbox=y||Dl,y=null,g.state.canYield=!0,f(),Yc(v)})).then((e=>{if(e){if(!b)return"transparent"===wl(e)?(bl(e),void x(new Error("render-empty"))):void x(null,{canvas:e,scaleX:e.width/a,scaleY:e.height/s,rects:u,background:d,method:"dom"});bl(e)}})).catch((e=>x(e)))}))};function Ul(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Hl={barScreenshotHint:"Go to the screen you want to show, then tap Capture.",barCapture:"Capture",barCancel:"Cancel",barRecordHint:"Go to where the issue happens, then start recording.",barStart:"Start",barStop:"Stop",barRecording:"Recording",barDragHint:"Drag to move",microphone:"Microphone",previewTitle:"Send this recording?",previewSend:"Send",previewRetake:"Retake",uploading:"Uploading…",recordingInterrupted:"Recording stopped because the page changed.",recordAgain:"Record again",permissionDenied:"Screen capture was blocked. You can upload a file instead.",notSupported:"Screen capture isn't available here. You can upload a file instead.",failed:"That didn't work. Please try again or upload a file.",recordPage:"Record this page",recordPageHint:"Screen sharing didn't start. You can record this page instead."},ql=e=>{const t=Object.assign({},Hl);return e&&"object"==typeof e&&Object.keys(Hl).forEach((n=>{const r=e[n];"string"==typeof r&&r.trim().length>0&&(t[n]=r.slice(0,300))})),t},zl=e=>{const t=Math.max(0,Math.floor(e||0)),n=t%60;return Math.floor(t/60)+":"+(n<10?"0":"")+n},Wl=':host{all:initial}.bar,.overlay{font:14px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color:#fff;letter-spacing:normal;text-align:start;-webkit-font-smoothing:antialiased;box-sizing:border-box;pointer-events:auto;animation:in .18s ease-out both}.bar *,.overlay *{box-sizing:border-box}.bar{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);display:flex;align-items:center;gap:8px;width:max-content;max-width:min(680px,calc(100vw - 32px));padding:8px;border-radius:28px;background:rgba(22,22,26,.97);box-shadow:0 12px 40px rgba(0,0,0,.3),0 0 0 1px rgba(255,255,255,.1)}.moved{transform:none}.grip{flex:none;align-self:stretch;width:18px;display:flex;align-items:center;justify-content:center;color:rgba(255,255,255,.45);cursor:grab;touch-action:none}.hint{flex:1 1 auto;min-width:0;padding:0 6px}.rec{display:flex;align-items:center;gap:8px;white-space:nowrap}.dot{flex:none;width:10px;height:10px;border-radius:50%;background:#ff4d4f;animation:pulse 1.4s ease-in-out infinite}.timer{font-variant-numeric:tabular-nums;color:rgba(255,255,255,.85)}.actions{flex:none;display:flex;align-items:center;gap:8px}button{-webkit-appearance:none;appearance:none;margin:0;border:0;border-radius:999px;min-height:36px;padding:0 14px;display:inline-flex;align-items:center;justify-content:center;gap:6px;font:inherit;font-weight:600;white-space:nowrap;cursor:pointer;color:#fff;background:rgba(255,255,255,.12)}button:hover{background:rgba(255,255,255,.2)}button:focus-visible{outline:2px solid #fff;outline-offset:2px}button[disabled]{opacity:.55;cursor:default}button[aria-disabled=true]{cursor:default}.primary,.primary:hover{background:var(--primary);color:var(--on-primary)}.stop,.stop:hover{background:#e5484d;color:#fff}.icon{width:36px;padding:0;border-radius:50%}.icon[aria-pressed=false]{color:rgba(255,255,255,.55)}.spin{flex:none;width:16px;height:16px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:spin .8s linear infinite}svg{flex:none;width:18px;height:18px}.overlay{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(8,8,10,.62)}.card{width:100%;max-width:760px;max-height:100%;display:flex;flex-direction:column;overflow:hidden;border-radius:16px;background:#16161a;box-shadow:0 24px 60px rgba(0,0,0,.45),0 0 0 1px rgba(255,255,255,.1)}.title{padding:16px 20px 12px;font-size:16px;font-weight:600}.media{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:#000;color:rgba(255,255,255,.85)}.media video{display:block;width:100%;max-height:62vh;background:#000;object-fit:contain}.summary{padding:32px 20px;background:rgba(255,255,255,.04)}.summary>svg{width:40px;height:40px;opacity:.8}.facts{display:flex;gap:14px;font-variant-numeric:tabular-nums}.facts span{display:inline-flex;align-items:center;gap:6px}.footer{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:12px 16px 16px}.status{flex:1 1 200px;min-width:0;color:rgba(255,255,255,.8)}.error{color:#ff9a9d}.progress{height:4px;margin-top:8px;overflow:hidden;border-radius:2px;background:rgba(255,255,255,.15)}.progress div{height:100%;width:0;background:var(--primary);transition:width .2s}.footer .actions{margin-left:auto}@keyframes in{from{opacity:0}}@keyframes pulse{50%{opacity:.3}}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.bar,.overlay,.dot{animation:none}.spin{animation-duration:2.4s}.progress div{transition:none}}@media (max-width:600px){.bar,.moved{left:0!important;right:0;top:auto!important;bottom:0;transform:none;width:auto;max-width:none;flex-wrap:wrap;border-radius:16px 16px 0 0;padding:12px calc(12px + env(safe-area-inset-right,0px)) calc(12px + env(safe-area-inset-bottom,0px)) calc(12px + env(safe-area-inset-left,0px))}.grip{display:none}.hint{flex:1 1 100%;padding:2px 4px 6px}.recording .hint{flex:1 1 auto}.actions{flex:1 1 100%}.recording .actions{flex:0 0 auto}.actions button:not(.icon){flex:1 1 0}button{min-height:44px}.icon{width:44px}.overlay{padding:0;align-items:flex-end}.card{max-width:none;border-radius:16px 16px 0 0;padding-bottom:env(safe-area-inset-bottom,0px)}.media video{max-height:55vh}}',Gl={grip:["M9 6h0M15 6h0M9 12h0M15 12h0M9 18h0M15 18h0","dots"],camera:["M4 8h3l1.6-2.4a1.5 1.5 0 0 1 1.3-.6h4.2a1.5 1.5 0 0 1 1.3.6L17 8h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1ZM12 16.4a3.4 3.4 0 1 0 0-6.8 3.4 3.4 0 0 0 0 6.8Z"],record:["M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM12 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"],stop:["M8 7h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1Z","fill"],mic:["M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3ZM5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21"],micOff:["M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3ZM5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M4 4l16 16"],page:["M6.5 3h11A2.5 2.5 0 0 1 20 5.5v13a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 4 18.5v-13A2.5 2.5 0 0 1 6.5 3ZM8 8h8M8 12h8M8 16h5"],clock:["M12 20.5a8.5 8.5 0 1 0 0-17 8.5 8.5 0 0 0 0 17ZM12 7.5V12l3 2"],pointer:["M6 3.5 18.5 12l-5.6 1.3-2.7 5.2Z"],send:["M14.54 21.69a.5.5 0 0 0 .94-.03l6.5-19a.5.5 0 0 0-.64-.63l-19 6.5a.5.5 0 0 0-.02.93l7.93 3.18a2 2 0 0 1 1.11 1.11zM21.85 2.15l-10.94 10.94"]},Vl="http://www.w3.org/2000/svg",$l=e=>{const[t,n]=Gl[e],r=document.createElementNS(Vl,"svg");r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("aria-hidden","true");const o=document.createElementNS(Vl,"path");return o.setAttribute("d",t),"fill"===n?o.setAttribute("fill","currentColor"):(o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width",n?"3.2":"1.8"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round")),r.appendChild(o),r},Xl=(e,t,n)=>{const r=document.createElement(e);return t&&(r.className=t),(n||[]).forEach((e=>{null!=e&&r.appendChild("string"==typeof e?document.createTextNode(e):e)})),r};class Jl{constructor(e){let{labels:t,primaryColor:n,rtl:r,onAction:o}=e;Ul(this,"host",null),Ul(this,"root",null),Ul(this,"timer",null),Ul(this,"maxSec",0),Ul(this,"micButton",null),Ul(this,"progress",null),Ul(this,"status",null),Ul(this,"previewButtons",null),Ul(this,"previewUrl",null),Ul(this,"position",null),Ul(this,"cleanupDrag",null),Ul(this,"autoFocus",!0),this.labels=ql(t),this.onAction=o,this.rtl=!!r,this.primaryColor=/^#[0-9a-f]{6}$/i.test(n||"")?n:"#485BFF"}mount(){if(!this.host){const t=document.createElement("div");t.className="gleap-capture-root rr-block gl-block";const n={position:"fixed",top:"0",left:"0",width:"0",height:"0",overflow:"visible","z-index":"2147483647",display:"block",margin:"0",padding:"0",border:"0",transform:"none",filter:"none","pointer-events":"none"};Object.keys(n).forEach((e=>t.style.setProperty(e,n[e],"important")));const r=t.attachShadow({mode:"open"});let o=!1;try{if("function"==typeof CSSStyleSheet&&"adoptedStyleSheets"in r){const e=new CSSStyleSheet;e.replaceSync(Wl),r.adoptedStyleSheets=[e],o=!0}}catch(e){}if(!o){const e=document.createElement("style");W(e),e.textContent=Wl,r.appendChild(e)}const i=parseInt(this.primaryColor.substr(1,2),16),a=parseInt(this.primaryColor.substr(3,2),16),s=parseInt(this.primaryColor.substr(5,2),16);this.root=Xl("div"),this.root.setAttribute("dir",this.rtl?"rtl":"ltr"),this.root.style.setProperty("--primary",this.primaryColor),this.root.style.setProperty("--on-primary",(299*i+587*a+114*s)/1e3>=160?"#000":"#fff"),r.appendChild(this.root),this.host=t}this.ensureAttached()}ensureAttached(){try{this.host&&!this.host.isConnected&&(document.body||document.documentElement).appendChild(this.host)}catch(e){}}isOwnElement(e){return!(!this.host||!e||e!==this.host&&!this.host.contains(e))}setVisible(e){this.host&&this.host.style.setProperty("visibility",e?"visible":"hidden","important")}action(e){try{this.onAction&&this.onAction(e)}catch(t){}}button(e,t,n,r,o,i){const a=r?$l(r):null,s=Xl("button",n,i?[e,a]:[a,e]);return s.type="button",s.disabled=!!o,s.addEventListener("click",(e=>{e.stopPropagation(),s.disabled||"true"===s.getAttribute("aria-disabled")||this.action(t)})),s}micToggle(e,t){if(!e||!e.available)return null;const n=this.button(null,"mic","icon",e.on?"mic":"micOff",t);return n.setAttribute("aria-pressed",e.on?"true":"false"),n.setAttribute("aria-label",this.labels.microphone),n.title=this.labels.microphone,this.micButton=n,n}focus(e){try{this.autoFocus&&e&&e.focus({preventScroll:!0})}catch(t){}}reset(){if(this.cleanupDrag&&(this.cleanupDrag(),this.cleanupDrag=null),this.previewUrl){try{URL.revokeObjectURL(this.previewUrl)}catch(e){}this.previewUrl=null}for(this.timer=this.micButton=this.progress=this.status=this.previewButtons=null;this.root&&this.root.firstChild;)this.root.removeChild(this.root.firstChild)}bar(e,t,n,r,o){this.mount(),this.reset();const i=Xl("div","grip",[$l("grip")]);i.setAttribute("aria-hidden","true"),i.title=this.labels.barDragHint;const a=Xl("div","actions",n),s=Xl("div","bar"+(o?" recording":""),[i,t,a]);s.setAttribute("role","region"),s.setAttribute("aria-label",e),o||s.addEventListener("keydown",(e=>{try{"Escape"===e.key&&(e.stopPropagation(),this.action("cancel"))}catch(t){}})),this.place(s),this.enableDragging(s,i),this.root.appendChild(s),this.focus(n[r])}place(e){this.position&&(e.classList.add("moved"),e.style.left=this.position.left+"px",e.style.top=this.position.top+"px",e.style.bottom="auto")}enableDragging(e,t){let n=null;const r=t=>{try{n&&(this.position={left:Math.max(8,Math.min(window.innerWidth-e.offsetWidth-8,n.left+t.clientX-n.x)),top:Math.max(8,Math.min(window.innerHeight-e.offsetHeight-8,n.top+t.clientY-n.y))},this.place(e))}catch(r){}},o=()=>{n=null,window.removeEventListener("pointermove",r,!0),window.removeEventListener("pointerup",o,!0),window.removeEventListener("pointercancel",o,!0)};t.addEventListener("pointerdown",(t=>{try{if(t.button)return;t.preventDefault();const i=e.getBoundingClientRect();n={x:t.clientX,y:t.clientY,left:i.left,top:i.top},window.addEventListener("pointermove",r,!0),window.addEventListener("pointerup",o,!0),window.addEventListener("pointercancel",o,!0)}catch(i){}})),this.cleanupDrag=o}busyButton(e,t,n,r){const o=this.button(r?null:e,t,"primary",r?null:n);return r&&(o.appendChild(Xl("span","spin")),o.appendChild(document.createTextNode(e)),o.setAttribute("aria-busy","true"),o.setAttribute("aria-disabled","true")),o}showScreenshotBar(e){const t=this.labels;this.bar(t.barCapture,Xl("div","hint",[t.barScreenshotHint]),[this.busyButton(t.barCapture,"capture","camera",e),this.button(t.barCancel,"cancel")],0)}showRecordBar(e){let{busy:t,mic:n,interrupted:r}=e;const o=this.labels,i=r?o.recordAgain:o.barStart,a=[this.busyButton(i,"start","record",t),this.micToggle(n,t),this.button(o.barCancel,"cancel")].filter(Boolean);this.bar(i,Xl("div","hint",[r?o.recordingInterrupted:o.barRecordHint]),a,0)}showPageRecordingOffer(){const e=this.labels;this.bar(e.recordPage,Xl("div","hint",[e.recordPageHint]),[this.button(e.recordPage,"record-page","primary","record"),this.button(e.barCancel,"cancel")],0)}showRecordingBar(e){let{mic:t,maxSec:n}=e;const r=this.labels;this.maxSec=n;const o=Xl("span","timer",[zl(0)+" / "+zl(n)]);o.setAttribute("role","timer");const i=this.button(null,"stop","stop icon","stop");i.setAttribute("aria-label",r.barStop),i.title=r.barStop;const a=[this.micToggle(t),i].filter(Boolean);this.bar(r.barRecording,Xl("div","hint rec",[Xl("span","dot"),o]),a,a.length-1,!0),this.timer=o}updateTimer(e){this.timer&&(this.timer.textContent=zl(e)+" / "+zl(this.maxSec))}setMicOn(e){const t=this.micButton;t&&(t.setAttribute("aria-pressed",e?"true":"false"),t.replaceChild($l(e?"mic":"micOff"),t.firstChild))}showPreview(e){this.mount(),this.reset();const t=this.labels;let n;if(e.video){const t=document.createElement("video");t.controls=!0,t.playsInline=!0,t.preload="auto",t.addEventListener("loadedmetadata",(()=>{try{if(t.duration===1/0){const e=()=>{t.removeEventListener("timeupdate",e),t.currentTime=0};t.addEventListener("timeupdate",e),t.currentTime=1e7}}catch(e){}}),{once:!0}),this.previewUrl=URL.createObjectURL(e.video),t.src=this.previewUrl,n=Xl("div","media",[t])}else{const t=Xl("div","facts",[Xl("span",null,[$l("clock"),zl((e.durationMs||0)/1e3)])]);"number"==typeof e.interactions&&t.appendChild(Xl("span",null,[$l("pointer"),String(e.interactions)])),n=Xl("div","media summary",[$l("page"),t])}this.status=Xl("div","status"),this.status.setAttribute("aria-live","polite");const r={cancel:this.button(t.barCancel,"cancel"),retake:this.button(t.previewRetake,"retake"),send:this.button(t.previewSend,"send","primary","send",!1,!0)};this.previewButtons=r;const o=Xl("div","title",[t.previewTitle]);o.id="gl-title";const i=Xl("div","card",[o,n,Xl("div","footer",[this.status,Xl("div","actions",[r.cancel,r.retake,r.send])])]);i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true"),i.setAttribute("aria-labelledby",o.id),this.root.appendChild(Xl("div","overlay",[i])),this.focus(r.send)}setUploading(e){if(this.status){if(this.previewButtons.retake.disabled=this.previewButtons.send.disabled=!0,!this.progress){this.status.className="status",this.status.textContent=this.labels.uploading,this.progress=Xl("div");const e=Xl("div","progress",[this.progress]);e.setAttribute("role","progressbar"),this.status.appendChild(e)}this.progress.style.width=Math.round(100*Math.max(0,Math.min(1,e||0)))+"%"}}setPreviewError(e){this.status&&(this.progress=null,this.status.className="status error",this.status.textContent=e||this.labels.failed,this.previewButtons.retake.disabled=this.previewButtons.send.disabled=!1)}destroy(){this.reset();try{this.host&&this.host.remove()}catch(e){}this.host=this.root=this.onAction=null}}const Kl="filter: blur(12px) !important;",Yl=Kl+" -webkit-text-security: disc !important;",Zl=el.split(",").map((e=>":not("+e.trim()+")")).join(""),Ql=e=>{try{return!(!e.matches||!e.matches(el))}catch(t){return!1}},eu=e=>{const t=":is("+e+"):not(html):not(body)"+Zl,n=["html:is("+e+") > body > *","body:is("+e+") > *"].map((e=>e+Zl)).join(", ");return{rules:[t+":not("+t+" *) { "+Kl+" }",n+" { "+Kl+" }"],fallback:e+" { "+Kl+" }"}},tu=(e,t)=>{const n=ul(e,t).map(eu);return n.push({rules:[il()+" { "+Kl+" }"],fallback:null}),function(e){e=e||{};var t=['input[type="password" i]',"input[data-rr-is-password]"];fa.forEach((function(e){t.push('input[autocomplete~="'+e+'" i]','textarea[autocomplete~="'+e+'" i]')})),["input"+Oa,"textarea","select"].forEach((function(e){t.push(e+ga,ga+" "+e)}));var n=Ta(e);return Object.keys(n).forEach((function(e){!n[e]||ma.indexOf(e)>=0||!/^[a-z-]+$/.test(e)||("textarea"!==e&&"select"!==e?(t.push('input[type="'+e+'" i]'),"text"===e&&t.push("input:not([type])")):t.push(e))})),t}(e).forEach((e=>{n.push({rules:[e+" { "+Yl+" }"],fallback:null})})),n},nu=(e,t)=>{let n=!1;if(t.rules.forEach((t=>{try{e.insertRule(t,e.cssRules.length),n=!0}catch(r){}})),!n&&t.fallback)try{e.insertRule(t.fallback,e.cssRules.length)}catch(r){}},ru=()=>new Promise((e=>{let t=!1;const n=()=>{t||(t=!0,e())};setTimeout(n,120);try{requestAnimationFrame((()=>requestAnimationFrame(n)))}catch(r){n()}})),ou=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.privacyOptions||{},n=tu(t,e.maskSelectors),r=dl(t),o=Object.create(null),i=[],a=new WeakSet,s=[];let c=null,l=!1;const u=e=>{const t=(e=>{for(let n=0;nnu(t.sheet,e))),Object.keys(o).forEach((e=>nu(t.sheet,eu("."+cl(e))))),i.push(t)),t})(9===e.nodeType?e:e.ownerDocument);if(t&&!t.style)try{e.adoptedStyleSheets=Array.prototype.slice.call(e.adoptedStyleSheets||[]).concat([t.sheet]),t.roots.push(e)}catch(r){}},d=e=>{const t=e.classList;if(r.length&&t)for(let n=0;n(t.lastIndex=0,t.test(e))))){o[e]=!0;const t=eu("."+cl(e));i.forEach((e=>nu(e.sheet,t)))}}};let p=null;const h=(e,t)=>{!e||a.has(e)||t>8||(a.add(e),u(e),(e=>{if(c)try{c.observe(e,r.length?{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}:{childList:!0,subtree:!0})}catch(t){}})(e),p(e,t))},f=(e,t)=>{let n=null;try{n=e.contentDocument}catch(r){}n&&n.documentElement&&h(n,t)},g=(e,t)=>{d(e),e.shadowRoot&&h(e.shadowRoot,t+1),"IFRAME"!==e.tagName&&"FRAME"!==e.tagName||((e,t)=>{for(let o=0;o{l||f(e,t)};try{e.addEventListener("load",n),s.push({frame:e,onLoad:n})}catch(r){}f(e,t)})(e,t+1)};p=(e,t)=>{if(!l&&e)try{if(1===e.nodeType){if(Ql(e))return;g(e,t)}const n=(e.ownerDocument||e).createTreeWalker(e,1,{acceptNode:e=>Ql(e)?2:1});let r=n.nextNode();for(;r;)g(r,t),r=n.nextNode()}catch(n){}};const m=()=>{if(!l){l=!0;try{c&&c.disconnect()}catch(e){}c=null,s.forEach((t=>{try{t.frame.removeEventListener("load",t.onLoad)}catch(e){}})),s.length=0,i.forEach((t=>{t.roots.forEach((n=>{try{n.adoptedStyleSheets=Array.prototype.filter.call(n.adoptedStyleSheets||[],(e=>e!==t.sheet))}catch(e){}}));try{t.style&&t.style.parentNode&&t.style.parentNode.removeChild(t.style)}catch(e){}})),i.length=0;try{window.removeEventListener("pagehide",m)}catch(e){}}};try{window.addEventListener("pagehide",m),"function"==typeof MutationObserver&&(c=new MutationObserver((e=>{if(!l)try{e.forEach((e=>{if("attributes"!==e.type)for(let t=0;t{try{return window.sessionStorage.getItem(e)}catch(t){return null}},du=(e,t)=>{try{null===t?window.sessionStorage.removeItem(e):window.sessionStorage.setItem(e,t)}catch(n){}},pu=e=>{const t=parseInt(e,10);return isNaN(t)?60:Math.max(5,Math.min(180,t))},hu=e=>{if(!e)return"unknown";const t=e.name&&"Error"!==e.name?e.name:"",n=e.message?String(e.message):t?"":String(e);return(t&&n?t+": "+n:t||n).slice(0,120)},fu=e=>e>=200&&e<300;let gu=0;class mu{constructor(){iu(this,"session",null),iu(this,"ui",null),iu(this,"watchdog",null),iu(this,"hiddenElements",[]),iu(this,"hiddenEscape",null),iu(this,"handledLogRequests",[]),iu(this,"logsPostedFor",[]),iu(this,"deviceId",null)}static getInstance(){return this.instance||(this.instance=new mu),this.instance}setCaptureEnabled(e){(e=>{Un=!!e})(e),e||(du(au,null),this.session&&this.cancelSession(this.session,"disabled"));try{Jf.instance&&Jf.instance.sendCaptureCapabilities()}catch(t){}}setRemoteLogCollectionEnabled(e){(e=>{Hn=!!e})(e)}getDeviceId(){if(this.deviceId)return this.deviceId;let e=uu(su);return e&&/^web-[0-9a-f]{32}$/.test(e)||(e="web-"+(e=>{try{const t=new Uint8Array(e);return window.crypto.getRandomValues(t),Array.prototype.map.call(t,(e=>(e<16?"0":"")+e.toString(16))).join("")}catch(t){let n="";for(let r=0;r<2*e;r++)n+=Math.floor(16*Math.random()).toString(16);return n}})(16),du(su,e)),this.deviceId=e,e}privacyOptions(){try{return qa.getInstance().customOptions||{}}catch(e){return{}}}maskSelectors(){const e=Vn().maskSelectors;return Array.isArray(e)?e.filter((e=>"string"==typeof e)):[]}attachesLogs(e){return!!(e&&e.options&&e.options.attachLogs)&&qn()}applyVeil(e){this.liftVeil(e);try{e.veil=ou({privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors()})}catch(t){e.veil=null}}liftVeil(e,t){const n=t||e.veil;if(n){e.veil===n&&(e.veil=null);try{n.remove()}catch(r){}}}handleMessengerMessage(e){try{const t=e&&e.data&&"object"==typeof e.data?e.data:{};switch(e&&e.name){case"capture-start":this.onCaptureStart(t);break;case"capture-cancel":this.onCaptureCancel(t);break;case"capture-editor":this.setEditorOpen(!!t.open);break;case"capture-done":this.onCaptureDone(t)}}catch(t){}}sendState(e,t,n){try{Jf.getInstance().sendMessage({name:"capture-state",data:Object.assign({requestId:e,state:t},n)})}catch(r){}}setEditorOpen(e){try{Jf.getInstance().setCaptureEditorOpen(e)}catch(t){}}onCaptureStart(e){const t="string"==typeof e.requestId?e.requestId:null,n="screenshot"===e.kind||"recording"===e.kind?e.kind:null;if(!t||!n)return;if(!Yn())return this.sendState(t,"unsupported",{error:"capture-disabled"}),void ws(t,"unsupported","capture-disabled");const r=this.session;if(r){if("uploading"===r.phase)return;r.requestId!==t?this.cancelSession(r,"replaced",!0):this.endSession(r,{restore:!1})}this.setEditorOpen(!1),this.startSession({requestId:t,kind:n,ticketShareToken:"string"==typeof e.ticketShareToken?e.ticketShareToken:null,options:e.options,labels:e.labels,resumed:!1,phase:"bar"})}onCaptureCancel(e){const t=this.session;!t||e.requestId&&e.requestId!==t.requestId||(this.endSession(t,{restore:!0}),this.sendState(t.requestId,"cancelled")),this.setEditorOpen(!1)}onCaptureDone(e){const t=this.session;!t||e.requestId&&e.requestId!==t.requestId||this.endSession(t,{restore:!0}),this.setEditorOpen(!1)}onWidgetDestroyed(){const e=this.session;e&&("editor"!==e.phase?e.resumed=!0:this.endSession(e,{restore:!1}))}destroy(){this.session&&this.endSession(this.session,{restore:!1}),this.setEditorOpen(!1)}normalizeOptions(e){const t=e&&"object"==typeof e?e:{};return{annotate:!1!==t.annotate,maxDurationSec:pu(t.maxDurationSec),audio:!0===t.audio,attachLogs:!1!==t.attachLogs,include:Cs(t.include)}}startSession(e){let t={};try{t=Gu.getInstance().getFlowConfig()||{}}catch(r){}const n={key:++gu,requestId:e.requestId,kind:e.kind,ticketShareToken:e.ticketShareToken||null,options:this.normalizeOptions(e.options),labels:ql(e.labels),rawLabels:e.labels&&"object"==typeof e.labels?e.labels:null,resumed:!!e.resumed,phase:e.phase,interrupted:"interrupted"===e.phase,pageRecording:!0===e.pageRecording,micOn:!1,createdAt:"number"==typeof e.createdAt?e.createdAt:Date.now(),startedAt:Date.now(),lastTick:-1,lastProgressSent:0};this.session=n;try{let o=!1;try{o=!!Fv.getInstance().isRTLLayout}catch(r){}this.ui=new Jl({labels:e.labels,primaryColor:t.color,rtl:o,onAction:e=>this.onUiAction(n,e)}),this.ui.autoFocus=!n.resumed,this.renderBar(n)}catch(o){return void this.failSession(n,"failed",hu(o))}if(!n.resumed)try{Jf.getInstance().setCaptureHidden(!0)}catch(r){}this.hideGleapUi(),this.startWatchdog(),this.persist(n),this.sendState(n.requestId,"bar")}renderBar(e){this.ui&&("screenshot"===e.kind?this.ui.showScreenshotBar(!1):this.ui.showRecordBar({busy:!1,mic:this.micState(e),interrupted:e.interrupted}))}micState(e){return!0===e.options.audio&&!0===Vn().allowMicrophone&&this.usesScreenRecording(e)&&Xn()?{available:!0,on:e.micOn}:null}usesScreenRecording(e){return"display"===Kn()&&!e.pageRecording}endSession(e,t){let{restore:n}=t;if(e&&this.session===e){this.session=null;try{e.recording&&e.recording.cancel()}catch(r){}this.liftVeil(e);try{e.timeline&&e.timeline.stop()}catch(r){}try{e.upload&&e.upload.abort()}catch(r){}if(e.recording=null,e.timeline=null,e.upload=null,e.result=null,this.stopWatchdog(),this.hiddenEscape&&(document.removeEventListener("keydown",this.hiddenEscape,!0),this.hiddenEscape=null),this.ui){try{this.ui.destroy()}catch(r){}this.ui=null}if(this.showGleapUi(),du(au,null),n)this.restoreWidget(e);else if(!e.resumed)try{Jf.getInstance().setCaptureHidden(!1,!1)}catch(r){}}}restoreWidget(e){try{e.resumed?this.openConversation(e.ticketShareToken):Jf.getInstance().setCaptureHidden(!1,!0)}catch(t){}}openConversation(e){e?Kv.openConversation(e,!0):Kv.open()}cancelSession(e,t,n){const r="editor"===e.phase;this.endSession(e,{restore:!n}),r||(this.sendState(e.requestId,"cancelled"),ws(e.requestId,"released",t))}failSession(e,t,n){e&&this.session===e&&(this.endSession(e,{restore:!0}),this.sendState(e.requestId,t,{error:n}),ws(e.requestId,"declined"===t||"unsupported"===t?t:"failed",n))}onUiAction(e,t){if(this.session===e)try{switch(t){case"capture":this.takeScreenshot(e);break;case"start":this.startRecording(e);break;case"record-page":e.pageRecording=!0,this.startRecording(e);break;case"stop":e.recording&&e.recording.stop();break;case"mic":this.toggleMicrophone(e);break;case"send":this.sendRecording(e);break;case"retake":this.retakeRecording(e);break;case"cancel":"fallback"===e.phase?this.failSession(e,e.fallbackState,e.fallbackReason):this.cancelSession(e,"cancelled")}}catch(n){this.failSession(e,"failed",hu(n))}}takeScreenshot(e){if("screenshot"!==e.kind||"bar"!==e.phase)return;const t="dom-only"!==Vn().webScreenshotMethod&&Jn()&&$n()&&(()=>{try{return window.top===window.self}catch(e){return!1}})(),n=t?(()=>{let e;try{e=navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude",monitorTypeSurfaces:"exclude"})}catch(t){e=Promise.reject(t)}return e.catch((()=>{})),e})():null;e.phase="capturing",this.ui.showScreenshotBar(!0),this.sendState(e.requestId,"capturing"),t&&this.setCaptureUiHidden(!0);let r=null;if(this.attachesLogs(e)&&-1===this.logsPostedFor.indexOf(e.requestId))try{r=Is({include:e.options.include,deviceId:this.getDeviceId()})}catch(i){}const o=()=>this.session===e;(e=>{let{streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}=e;const a=()=>!i||i();return(t?t.then((e=>a()?Cl(e,{setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:a}).catch((()=>null)):(xl(e),null)),(()=>(n(!1),null))):Promise.resolve(null)).then((e=>{if(!a())throw e&&bl(e.canvas),new Error("aborted");return e||Bl({privacyOptions:r,maskSelectors:o,isActive:a})})).then((e=>{try{const t=kl(e);return t.method=e.method,t}finally{bl(e.canvas)}}))})({streamPromise:n,privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),isActive:o,setUiHidden:e=>{o()&&this.setCaptureUiHidden(e)}}).then((t=>{o()&&this.onScreenshotReady(e,t,r)})).catch((t=>{o()&&this.failSession(e,"failed",hu(t))}))}onScreenshotReady(e,t,n){const r=Jf.getInstance(),o={name:"capture-image",data:{requestId:e.requestId,dataUrl:t.dataUrl,width:t.width,height:t.height,method:t.method,platform:Bn,sdkType:Fn,sdkVersion:Gn()}};e.phase="editor",du(au,null),this.stopWatchdog(),this.ui&&(this.ui.destroy(),this.ui=null),this.showGleapUi(),e.resumed?(this.openConversation(e.ticketShareToken),r.sendMessage(o,!0)):(r.sendMessage(o,!0),r.setCaptureHidden(!1,!0)),n&&this.postLogs(e.requestId,n)}postLogs(e,t){qn()&&-1===this.logsPostedFor.indexOf(e)&&(this.logsPostedFor.push(e),this.logsPostedFor.length>100&&this.logsPostedFor.shift(),Ss(e,t).catch((()=>{})))}setCaptureUiHidden(e){if(this.ui&&this.ui.setVisible(!e),this.hiddenEscape&&(document.removeEventListener("keydown",this.hiddenEscape,!0),this.hiddenEscape=null),e){this.hideGleapUi();const e=this.session;this.hiddenEscape=t=>{try{"Escape"===t.key&&e&&this.session===e&&this.cancelSession(e,"cancelled")}catch(n){}},document.addEventListener("keydown",this.hiddenEscape,!0)}}startRecording(e){if("recording"!==e.kind||-1===["bar","interrupted","fallback"].indexOf(e.phase))return;const t=()=>this.session===e,n=e.options.maxDurationSec,r=n=>{t()&&n!==e.lastTick&&(e.lastTick=n,this.ui&&this.ui.updateTimer(n),this.sendState(e.requestId,"recording",{elapsedSec:n}))},o=n=>{t()&&this.onRecordingStopped(e,n)},i=n=>{t()&&this.failSession(e,"failed",hu(n))};if(this.usesScreenRecording(e)){const a=(e=>{const t={frameRate:{ideal:15,max:30}},n={video:t,audio:!1};let r;e&&(t.displaySurface="browser",n.preferCurrentTab=!0,n.selfBrowserSurface="include",n.surfaceSwitching="include");try{r=navigator.mediaDevices.getDisplayMedia(n)}catch(o){r=Promise.reject(o)}return r.catch((()=>{})),r})(Jn());this.applyVeil(e);const s=e.veil;return e.phase="starting",this.ui.showRecordBar({busy:!0,mic:this.micState(e),interrupted:e.interrupted}),void a.then((e=>(s?s.ready():Promise.resolve()).then((()=>e)))).then((a=>{if(!t())return xl(a),null;const c=new is({maxDurationSec:n,onTick:r,onStop:o,onError:i,onReleased:()=>{s&&this.liftVeil(e,s)}});return e.recording=c,c.start(a,!!this.micState(e)&&e.micOn).then((n=>{t()?this.onRecordingStarted(e,c.startedAt,n.hasMicrophone):c.cancel()}))})).catch((n=>{t()&&this.offerPageRecording(e,n)}))}const a=new ls({maxDurationSec:n,privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),onTick:r,onStop:o,onError:i});e.recording=a,a.start(),this.onRecordingStarted(e,a.startedAt,!1)}offerPageRecording(e,t){const n=t&&t.name;try{e.recording&&e.recording.cancel()}catch(r){}this.liftVeil(e),e.phase="fallback",e.recording=null,e.fallbackState="NotAllowedError"===n||"SecurityError"===n?"declined":"failed",e.fallbackReason=hu(t),this.ui.showPageRecordingOffer(),this.persist(e),this.sendState(e.requestId,"bar")}onRecordingStarted(e,t,n){e.phase="recording",e.interrupted=!1,e.hasMicrophone=!!n,e.lastTick=0,e.timeline=new hs({privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),isOwnElement:e=>!(!this.ui||!this.ui.isOwnElement(e))}),e.timeline.start(t),this.ui.showRecordingBar({mic:e.hasMicrophone?{available:!0,on:e.micOn}:null,maxSec:e.options.maxDurationSec}),this.persist(e),this.sendState(e.requestId,"recording",{elapsedSec:0})}toggleMicrophone(e){"recording"!==e.phase&&"bar"!==e.phase&&"interrupted"!==e.phase||(e.micOn=!e.micOn,"recording"===e.phase&&e.recording&&e.recording.setMicrophoneEnabled&&e.recording.setMicrophoneEnabled(e.micOn),this.ui.setMicOn(e.micOn))}onRecordingStopped(e,t){this.liftVeil(e),e.recording=null,e.result=t,e.timelineEntries=e.timeline?e.timeline.stop(t.endedAt):[];const n=e.timeline?e.timeline.interactions:0;e.timeline=null,e.phase="preview",this.ui.showPreview({video:0===t.type.indexOf("video/")?t.blob:null,durationMs:t.durationMs,interactions:n}),this.persist(e),this.sendState(e.requestId,"preview")}retakeRecording(e){"preview"===e.phase&&(e.result=null,e.uploadedUrl=null,e.timelineEntries=null,e.phase="bar",e.interrupted=!1,this.renderBar(e),this.persist(e),this.sendState(e.requestId,"bar"))}sendRecording(e){const t=e.result;if("preview"!==e.phase||!t)return;const n=()=>this.session===e;if(e.phase="uploading",this.ui.setUploading(0),this.sendState(e.requestId,"uploading",{progress:0}),this.attachesLogs(e))try{this.postLogs(e.requestId,Is({include:e.options.include,windowStart:t.startedAt,windowEnd:t.endedAt,deviceId:this.getDeviceId()}))}catch(i){}const r=t=>{if(!n())return;this.ui&&this.ui.setUploading(t);const r=Date.now();(r-e.lastProgressSent>250||t>=1)&&(e.lastProgressSent=r,this.sendState(e.requestId,"uploading",{progress:Math.round(100*t)/100}))};let o;e.uploadedUrl?o=Promise.resolve(e.uploadedUrl):(e.upload=((e,t,n)=>{let r=null;return{promise:new Promise(((o,a)=>{try{const i=Cf.getInstance(),s=new FormData;s.append("file",e,t),r=new XMLHttpRequest,r.open("POST",i.apiUrl+"/uploads/attachments"),i.injectSession(r),r.upload&&n&&(r.upload.onprogress=e=>{e.lengthComputable&&e.total>0&&n(Math.min(1,e.loaded/e.total))}),r.onreadystatechange=()=>{if(4!==r.readyState)return;const e=vs(r.responseText);200===r.status&&e&&Array.isArray(e.fileUrls)&&"string"==typeof e.fileUrls[0]?o(e.fileUrls[0]):a(new Error(413===r.status?"file-too-large":"upload-failed-"+r.status))},r.onerror=()=>a(new Error("upload-failed")),r.onabort=()=>a(new Error("upload-aborted")),r.send(s)}catch(i){a(i)}})),abort:()=>{try{r&&r.abort()}catch(i){}}}})(t.blob,t.fileName,r),o=e.upload.promise),o.then((r=>{if(!n())return null;e.upload=null,e.uploadedUrl=r;const o={url:r,name:t.fileName,type:t.type,size:t.blob.size,durationMs:t.durationMs};return t.width>0&&t.height>0&&(o.width=t.width,o.height=t.height),(i=e.requestId,a={files:[o],method:t.method,platform:Bn,sdkType:Fn,sdkVersion:Gn(),deviceId:this.getDeviceId(),annotations:[],timeline:e.timelineEntries||[],recordingStartedAt:new Date(t.startedAt).toISOString(),recordingEndedAt:new Date(t.endedAt).toISOString()},bs(i,"complete",a)).then((t=>{n()&&(fu(t.status)?(this.endSession(e,{restore:!0}),this.sendState(e.requestId,"done")):409===t.status||410===t.status?(this.endSession(e,{restore:!0}),this.sendState(e.requestId,"failed",{error:409===t.status?"already-completed":"request-closed"})):this.onUploadFailed(e,"complete-"+t.status))}));var i,a})).catch((t=>{n()&&this.onUploadFailed(e,hu(t))}))}onUploadFailed(e,t){e.upload=null,e.phase="preview",this.ui&&this.ui.setPreviewError(e.labels.failed),this.sendState(e.requestId,"preview",{error:t})}hideGleapUi(){try{const e=document.querySelectorAll(lu);for(let t=0;t{try{e.style.removeProperty("visibility")}catch(t){}})),this.hiddenElements=[]}startWatchdog(){this.stopWatchdog(),this.watchdog=setInterval((()=>{try{this.ui&&this.ui.ensureAttached(),this.hideGleapUi()}catch(e){}}),1e3)}stopWatchdog(){this.watchdog&&(clearInterval(this.watchdog),this.watchdog=null)}persist(e){if(this.session!==e)return;let t=null;if(-1!==["bar","capturing","starting","fallback"].indexOf(e.phase)?t=e.interrupted?"recording":"bar":"recording"===e.kind&&-1!==["recording","preview","uploading","interrupted"].indexOf(e.phase)&&(t="recording"),!t)return void du(au,null);let n=null,r=null;try{const e=Cf.getInstance();n=e.session?e.session.gleapId:null,r=e.sdkKey}catch(o){}try{du(au,JSON.stringify({v:1,requestId:e.requestId,kind:e.kind,ticketShareToken:e.ticketShareToken,options:e.options,labels:e.rawLabels,phase:t,pageRecording:!0===e.pageRecording,gleapId:n,sdkKey:r,at:e.createdAt}))}catch(o){}}resumeFromStorage(){try{if(this.session)return;const n=uu(au);if(!n)return;let r=null;try{r=JSON.parse(n)}catch(t){}const o=Cf.getInstance();if(!(r&&1===r.v&&"string"==typeof r.requestId&&("screenshot"===r.kind||"recording"===r.kind)&&"number"==typeof r.at&&Date.now()-r.at<18e5&&o.session&&r.gleapId===o.session.gleapId&&r.sdkKey===o.sdkKey)||!Yn())return void du(au,null);(e=r.requestId,ys("GET","/v3/shared/capture-requests/"+encodeURIComponent(String(e)))).then((e=>{try{const t=e.data;if(e.status>=400&&e.status<500||t&&-1!==cu.indexOf(t.status)||t&&t.expiresAt&&Date.parse(t.expiresAt)100&&this.handledLogRequests.shift(),e.expiresAt&&Date.parse(e.expiresAt){this.collectLogs(t,n).catch((()=>{}))}))}catch(t){}}collectLogs(e,t){if(!qn())return ws(e,"unsupported","disabled-by-app");if(!1===Vn().backgroundLogs)return ws(e,"unsupported","disabled-by-project");const n=this.getDeviceId();return((e,t)=>bs(e,"claim",t))(e,{deviceId:n,platform:Bn,sdkType:Fn,sdkVersion:Gn()}).then((r=>!fu(r.status)||r.data&&r.data.claimedElsewhere?null:Promise.resolve().then((()=>Ss(e,Is({include:t.include,deviceId:n})))).then((t=>fu(t.status)?null:ws(e,"failed","logs-"+t.status)),(t=>ws(e,"failed",hu(t))))))}}function vu(e){return vu="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},vu(e)}function yu(e){return function(e){if(Array.isArray(e))return bu(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 bu(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 bu(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 bu(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&&Au(t.prototype,n),r&&Au(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ju(e){return ju="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},ju(e)}function _u(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()},Qu=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: "+(Ju(c)?e(c,l+1):ad(c,1e3))),s}catch(u){return"Error"}},ed=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,$u;e.parts.push(t),e.length+=t.length},td=function(e,t){var n=e.maxLength-e.length;ed(e,JSON.stringify(t.length>n?t.slice(0,n):t))},nd=function(e,t){try{return{value:e[t]}}catch(n){return{failed:!0}}},rd=function(e,t,n,r,o,i){ed(e,t);for(var a=Math.min(r,100),s=0;s0&&ed(e,","),o(s,i+1);r>a&&ed(e,",… "+(r-a)+" more"),ed(e,n)},od=function e(t,n,r){var o=Vu(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(Ju(n)){var i="Error",a="";try{i=String(n.name||"Error"),a=String(n.message||"")}catch(f){}td(t,a?i+": "+a:i)}else if(Ku(n))ed(t,Zu(n));else if(function(e){return!!e&&"object"===Vu(e)&&e.window===e&&!!e.document}(n))ed(t,"[Window]");else{var s=Xu(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))ed(t,s.slice(8,-1)+"("+("number"==typeof n.length?n.length:n.byteLength)+")");else if(r>=t.maxDepth)ed(t,Array.isArray(n)?"[Array]":"[Object]");else{t.seen.push(n);try{if(Array.isArray(n))return void rd(t,"[","]",n.length,(function(r,o){var i=nd(n,r);i.failed?ed(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 rd(t,"Map("+n.size+"){","}",n.size,(function(n,r){e(t,c[n][0],r),ed(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 rd(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(f){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(f){return""}}(n);rd(t,(p?p+" ":"")+"{","}",d.length,(function(r,o){td(t,d[r]),ed(t,":");var i=nd(n,d[r]);i.failed?ed(t,'"[unreadable]"'):e(t,i.value,o)}),r)}finally{t.seen.pop()}}else ed(t,s.slice(8,-1)+"("+n.byteLength+")");else ed(t,s.slice(8,-1));else ed(t,String(n));else{var h=n.getTime();td(t,isNaN(h)?"Invalid Date":n.toISOString())}}else ed(t,'"[Circular]"');else ed(t,Yu(n));else ed(t,n.toString());else ed(t,n.toString()+"n");else ed(t,String(n));else td(t,n);else ed(t,"null")},id=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{od(r,e,0)}catch(o){if(o!==$u)return{text:r.parts.join("")+"[unserializable]",truncated:!1}}return{text:r.parts.join(""),truncated:r.truncated}},ad=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"===Vu(e))return e.toString();if("function"==typeof e)return Yu(e);if(Ju(e)){var r=Qu(e);return r.length>n?r.slice(0,n):r}if(Ku(e))return Zu(e);if("[object Date]"===Xu(e)){var o=e.getTime();return isNaN(o)?"Invalid Date":e.toISOString()}return id(e,n,4).text}catch(i){try{return Xu(e)}catch(a){return"[unserializable]"}}},sd=function(e){try{return"bigint"==typeof e?e:"symbol"===Vu(e)?NaN:Number(e)}catch(t){return NaN}},cd=function(e){var t=sd(e);return"bigint"==typeof t?t.toString()+"n":isNaN(t)?"NaN":String(t<0?Math.ceil(t):Math.floor(t))},ld=function(e){var t=sd(e);return String("bigint"==typeof t?Number(t):t)},ud=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+=ad(l,u):"d"===c||"i"===c?r+=cd(l):"f"===c?r+=ld(l):"c"!==c&&(r+="string"==typeof l?JSON.stringify(l.slice(0,u)):ad(l,u))}else r+="%",a++}else r+=s}}for(;o0&&(r+=" "),r+=ad(e[o],Math.max(1,n-r.length));return r.length>n?r.slice(0,n):r}catch(d){return"[unserializable console arguments]"}};function dd(e){return dd="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},dd(e)}function pd(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"INFO";if(null!=e&&("string"!=typeof e&&(e=ad(e,vd)),!(e.length<=0)))for(this.logArray.push({log:yd(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(ud(e,vd),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(gd),o=function(){var o=r[i];e.wrapConsoleMethod(n,o,(function(e){t.capture((function(){return t.addLogWithArgs(e,gd[o])}))}))},i=0;i0&&e[0]||t.capture((function(){var n=ud(Array.prototype.slice.call(e,1),vd);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: "+ad(n,vd),"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"===dd(n)&&"string"==typeof n.stack&&n.stack.length>0?Qu(n):null!=n?ad(n,vd)+bd(e):String(e.message||"Script error.").replace(/^Uncaught\s+/,"")+bd(e),this.addLog("Uncaught "+t,"ERROR")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&pd(t.prototype,n),r&&pd(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function kd(e){return kd="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},kd(e)}function xd(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 Sd(e){for(var t=1;t=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 Nd(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 jd(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Nd(i,r,o,a,s,"next",e)}function s(e){Nd(i,r,o,a,s,"throw",e)}a(void 0)}))}}function _d(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 Fd(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 Fd(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 Fd(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)},Gd=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=Wd(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(Ud(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)}},pp=function(e){for(var t=cp(e);t;t=cp(t)){var n=window.getComputedStyle(t);if(parseFloat(n.width)>0&&parseFloat(n.height)>0)return dp(t.getBoundingClientRect(),up(t,n))}return{x:1,y:1}},hp=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}},fp=function(e){var t=e.createElement("span");return tp(t.style,"display","inline-block"),["margin","padding","border-width"].forEach((function(e){return tp(t.style,e,"0")})),t},gp=function e(t,n,r){return sp(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var o=window.getComputedStyle(t);if("none"!==o.display&&!ip(o))if("contents"===o.display||op(o))e(t,n,r);else{var i=hp(t.getBoundingClientRect(),n),a={left:i.left-np(o,"margin-left"),right:i.right+np(o,"margin-right"),top:i.top-np(o,"margin-top"),bottom:i.bottom+np(o,"margin-bottom"),verticalAlign:o.verticalAlign};0===o.display.indexOf("inline")?("baseline"!==a.verticalAlign||Qd.test(t.localName)||(a.verticalAlign="middle"),r.atomicInlines.push(a)):r.blocks.push(a)}}})),r},mp=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=fp(e.ownerDocument);tp(c.style,"vertical-align",s?s.verticalAlign:"baseline"),rp(c.style,t[i].width,s?s.bottom-s.top:0),e.appendChild(c)}},vp=function e(t,n,r){sp(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(Mp(n,t.ownerDocument,!0,r))}}else!function(e,t){var n=lp(t);if(n.length){var r=pp(t),o=e.ownerDocument.createElement("span");tp(o.style,"display","inline"),["margin","padding","border-width"].forEach((function(e){return tp(o.style,e,"0")})),mp(o,n.map((function(e){return hp(e,r)})),[]),e.appendChild(o)}}(t,n)}))},yp=function(e){return!("block"!==e.display&&"list-item"!==e.display||ip(e)||ap(e)||/layout|paint|strict|content/.test(e.contain))},bp=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?np(n,"top"):0),s="top"===r?a-o:a+t.offsetHeight-i;return Math.abs(s)<=1},wp=function(e,t,n,r){return r.push(np(t,"margin-"+n)),!yp(t)||np(t,"padding-"+n)||np(t,"border-"+n+"-width")||kp(e,sp(e),n,r),r},kp=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&&!ip(s))if("contents"!==s.display){if(/^(inline|ruby)/.test(s.display)||!bp(t,a,s,r))return!1;if(wp(a,s,r,o),0!==a.getBoundingClientRect().height||!yp(s))return!1;wp(a,s,"top"===r?"bottom":"top",o)}else if(!e(t,sp(a),r,o))return!1}}var c;return!0},xp=function(e){return Math.max(0,Math.max.apply(null,e))+Math.min(0,Math.min.apply(null,e))},Sp=null,Cp=new Map,Ep=function(e){var t=window.getComputedStyle(e),n=[t.fontStyle,t.fontWeight,t.fontSize,t.fontFamily].join(" ");return Cp.has(n)||((Sp=Sp||document.createElement("canvas").getContext("2d")).font=n,Cp.set(n,Sp.measureText("").fontBoundingBoxAscent)),Cp.get(n)},Ip=function e(t,n,r){var o=sp(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=La(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++,Xd(o,t.shadowRoot),e.next=41,f(t.shadowRoot.firstChild,g,x);case 41:$d(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,f(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}),Up={left:"right",right:"left",bottom:"top",top:"bottom"},Hp={start:"end",end:"start"};function qp(e,t,n){return jp(e,Np(t,n))}function zp(e,t){return"function"==typeof e?e(t):e}function Wp(e){return e.split("-")[0]}function Gp(e){return e.split("-")[1]}function Vp(e){return"x"===e?"y":"x"}function $p(e){return"y"===e?"height":"width"}const Xp=new Set(["top","bottom"]);function Jp(e){return Xp.has(Wp(e))?"y":"x"}function Kp(e){return Vp(Jp(e))}function Yp(e){return e.replace(/start|end/g,(e=>Hp[e]))}const Zp=["left","right"],Qp=["right","left"],eh=["top","bottom"],th=["bottom","top"];function nh(e,t,n,r){const o=Gp(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Qp:Zp:t?Zp:Qp;case"left":case"right":return t?eh:th;default:return[]}}(Wp(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Yp)))),i}function rh(e){return e.replace(/left|right|bottom|top/g,(e=>Up[e]))}function oh(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 ih(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 ah(e,t,n){let{reference:r,floating:o}=e;const i=Jp(t),a=Kp(t),s=$p(a),c=Wp(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 h;switch(c){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Gp(t)){case"start":h[a]-=p*(n&&l?-1:1);break;case"end":h[a]+=p*(n&&l?-1:1)}return h}async function sh(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:h=0}=zp(t,e),f=oh(h),g=s[p?"floating"===d?"reference":"floating":d],m=ih(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=ih(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:c}):v);return{top:(m.top-w.top+f.top)/b.y,bottom:(w.bottom-m.bottom+f.bottom)/b.y,left:(m.left-w.left+f.left)/b.x,right:(w.right-m.right+f.right)/b.x}}const ch=new Set(["left","top"]);function lh(){return"undefined"!=typeof window}function uh(e){return hh(e)?(e.nodeName||"").toLowerCase():"#document"}function dh(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ph(e){var t;return null==(t=(hh(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function hh(e){return!!lh()&&(e instanceof Node||e instanceof dh(e).Node)}function fh(e){return!!lh()&&(e instanceof Element||e instanceof dh(e).Element)}function gh(e){return!!lh()&&(e instanceof HTMLElement||e instanceof dh(e).HTMLElement)}function mh(e){return!(!lh()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof dh(e).ShadowRoot)}const vh=new Set(["inline","contents"]);function yh(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ah(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!vh.has(o)}const bh=new Set(["table","td","th"]);function wh(e){return bh.has(uh(e))}const kh=[":popover-open",":modal"];function xh(e){return kh.some((t=>{try{return e.matches(t)}catch(n){return!1}}))}const Sh=["transform","translate","scale","rotate","perspective"],Ch=["transform","translate","scale","rotate","perspective","filter"],Eh=["paint","layout","strict","content"];function Ih(e){const t=Th(),n=fh(e)?Ah(e):e;return Sh.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Ch.some((e=>(n.willChange||"").includes(e)))||Eh.some((e=>(n.contain||"").includes(e)))}function Th(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Lh=new Set(["html","body","#document"]);function Oh(e){return Lh.has(uh(e))}function Ah(e){return dh(e).getComputedStyle(e)}function Mh(e){return fh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rh(e){if("html"===uh(e))return e;const t=e.assignedSlot||e.parentNode||mh(e)&&e.host||ph(e);return mh(t)?t.host:t}function Ph(e){const t=Rh(e);return Oh(t)?e.ownerDocument?e.ownerDocument.body:e.body:gh(t)&&yh(t)?t:Ph(t)}function Dh(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Ph(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=dh(o);if(i){const e=Nh(a);return t.concat(a,a.visualViewport||[],yh(o)?o:[],e&&n?Dh(e):[])}return t.concat(o,Dh(o,[],n))}function Nh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jh(e){const t=Ah(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=gh(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=_p(n)!==i||_p(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function _h(e){return fh(e)?e:e.contextElement}function Fh(e){const t=_h(e);if(!gh(t))return Bp(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=jh(t);let a=(i?_p(n.width):n.width)/r,s=(i?_p(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Bh=Bp(0);function Uh(e){const t=dh(e);return Th()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Bh}function Hh(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=_h(e);let a=Bp(1);t&&(r?fh(r)&&(a=Fh(r)):a=Fh(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==dh(e))&&t}(i,n,r)?Uh(i):Bp(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=dh(i),t=r&&fh(r)?dh(r):r;let n=e,o=Nh(n);for(;o&&r&&t!==n;){const e=Fh(o),t=o.getBoundingClientRect(),r=Ah(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=dh(o),o=Nh(n)}}return ih({width:u,height:d,x:c,y:l})}function qh(e,t){const n=Mh(e).scrollLeft;return t?t.left+n:Hh(ph(e)).left+n}function zh(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qh(e,n),y:n.top+t.scrollTop}}const Wh=25;const Gh=new Set(["absolute","fixed"]);function Vh(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=dh(e),r=ph(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=Th();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}const l=qh(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<=Wh&&(i-=a)}else l<=Wh&&(i+=l);return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=ph(e),n=Mh(e),r=e.ownerDocument.body,o=jp(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=jp(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+qh(e);const s=-n.scrollTop;return"rtl"===Ah(r).direction&&(a+=jp(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(ph(e));else if(fh(t))r=function(e,t){const n=Hh(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=gh(e)?Fh(e):Bp(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=Uh(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ih(r)}function $h(e,t){const n=Rh(e);return!(n===t||!fh(n)||Oh(n))&&("fixed"===Ah(n).position||$h(n,t))}function Xh(e,t,n){const r=gh(t),o=ph(t),i="fixed"===n,a=Hh(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Bp(0);function l(){c.x=qh(o)}if(r||!r&&!i)if(("body"!==uh(t)||yh(o))&&(s=Mh(t)),r){const e=Hh(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?Bp(0):zh(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 Jh(e){return"static"===Ah(e).position}function Kh(e,t){if(!gh(e)||"fixed"===Ah(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ph(e)===n&&(n=n.ownerDocument.body),n}function Yh(e,t){const n=dh(e);if(xh(e))return n;if(!gh(e)){let t=Rh(e);for(;t&&!Oh(t);){if(fh(t)&&!Jh(t))return t;t=Rh(t)}return n}let r=Kh(e,t);for(;r&&wh(r)&&Jh(r);)r=Kh(r,t);return r&&Oh(r)&&Jh(r)&&!Ih(r)?n:r||function(e){let t=Rh(e);for(;gh(t)&&!Oh(t);){if(Ih(t))return t;if(xh(t))return null;t=Rh(t)}return null}(e)||n}const Zh={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=ph(r),s=!!t&&xh(t.floating);if(r===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=Bp(1);const u=Bp(0),d=gh(r);if((d||!d&&!i)&&(("body"!==uh(r)||yh(a))&&(c=Mh(r)),gh(r))){const e=Hh(r);l=Fh(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?Bp(0):zh(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:ph,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?xh(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Dh(e,[],!1).filter((e=>fh(e)&&"body"!==uh(e))),o=null;const i="fixed"===Ah(e).position;let a=i?Rh(e):e;for(;fh(a)&&!Oh(a);){const t=Ah(a),n=Ih(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&Gh.has(o.position)||yh(a)&&!n&&$h(e,a))?r=r.filter((e=>e!==a)):o=t,a=Rh(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],c=a.reduce(((e,n)=>{const r=Vh(t,n,o);return e.top=jp(r.top,e.top),e.right=Np(r.right,e.right),e.bottom=Np(r.bottom,e.bottom),e.left=jp(r.left,e.left),e}),Vh(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Yh,getElementRects:async function(e){const t=this.getOffsetParent||Yh,n=this.getDimensions,r=await n(e.floating);return{reference:Xh(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}=jh(e);return{width:t,height:n}},getScale:Fh,isElement:fh,isRTL:function(e){return"rtl"===Ah(e).direction}};function Qh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ef(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=_h(e),u=o||i?[...l?Dh(l):[],...Dh(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=ph(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:h}=l;if(s||t(),!p||!h)return;const f={rootMargin:-Fp(d)+"px "+-Fp(o.clientWidth-(u+p))+"px "+-Fp(o.clientHeight-(d+h))+"px "+-Fp(u)+"px",threshold:jp(0,Np(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||Qh(l,e.getBoundingClientRect())||a(),g=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(v){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(l,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),l&&!c&&f.observe(l),f.observe(t));let g=c?Hh(e):null;return c&&function t(){const r=Hh(e);g&&!Qh(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=f)||e.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const tf=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=Wp(n),s=Gp(n),c="y"===Jp(n),l=ch.has(a)?-1:1,u=i&&c?-1:1,d=zp(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),c?{x:h*u,y:p*l}:{x:p*l,y:h*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}}}}},nf=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}=zp(e,t),u={x:n,y:r},d=await i.detectOverflow(t,l),p=Jp(Wp(o)),h=Vp(p);let f=u[h],g=u[p];if(a){const e="y"===h?"bottom":"right";f=qp(f+d["y"===h?"top":"left"],f,f-d[e])}if(s){const e="y"===p?"bottom":"right";g=qp(g+d["y"===p?"top":"left"],g,g-d[e])}const m=c.fn({...t,[h]:f,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[p]:s}}}}}},rf=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:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=zp(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Wp(o),y=Jp(s),b=Wp(s)===s,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),k=p||(b||!g?[rh(s)]:function(e){const t=rh(e);return[Yp(e),t,Yp(t)]}(s)),x="none"!==f;!p&&x&&k.push(...nh(s,g,f,w));const S=[s,...k],C=await c.detectOverflow(t,m),E=[];let I=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Gp(e),o=Kp(e),i=$p(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=rh(a)),[a,rh(a)]}(o,a,w);E.push(C[e[0]],C[e[1]])}if(I=[...I,{placement:o,overflows:E}],!E.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!==Jp(t))||I.every((e=>Jp(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}}}let n=null==(L=I.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:L.placement;if(!n)switch(h){case"bestFit":{var O;const e=null==(O=I.filter((e=>{if(x){const t=Jp(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{}}}},of=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}=zp(e,t)||{};if(null==l)return{};const d=oh(u),p={x:n,y:r},h=Kp(o),f=$p(h),g=await a.getDimensions(l),m="y"===h,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[h]-p[h]-i.floating[f],k=p[h]-i.reference[h],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[f]);const C=w/2-k/2,E=S/2-g[f]/2-1,I=Np(d[v],E),T=Np(d[y],E),L=I,O=S-g[f]-T,A=S/2-g[f]/2+C,M=qp(L,A,O),R=!c.arrow&&null!=Gp(o)&&A!==M&&i.reference[f]/2-(A{const r=new Map,o={platform:Zh,...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}=ah(l,r,c),p=r,h={},f=0;for(let m=0;m0)},uf=function(e,t){var n=(t.pageRules&&t.pageRules.length>0?t.pageRules:t.pageFilter?[{pageFilter:t.pageFilter,pageFilterType:t.pageFilterType}]:[]).filter(lf);if(0===n.length)return!0;var r=n.filter((function(e){return!cf.includes(e.pageFilterType)})),o=n.filter((function(e){return cf.includes(e.pageFilterType)})),i=0===r.length||r.some((function(t){return sf(e,t.pageFilter,t.pageFilterType)})),a=0===o.length||o.every((function(t){return sf(e,t.pageFilter,t.pageFilterType)}));return i&&a};function df(e){return df="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},df(e)}function pf(e){return function(e){if(Array.isArray(e))return hf(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 hf(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 hf(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 hf(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)}}})),gf(this,"updateFilteredTooltips",(function(){t.filteredTooltips=t.getFilteredTooltips(),t.checkForTooltips()})),gf(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?uf(e,{pageRules:t.pageRules}):!t.page||0===t.page.length||!!sf(e,t.page,t.pageType)}))})),gf(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(pf(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=ef(e,r,(function(){af(e,r,{placement:"left"===n.posX?"left":"right",middleware:[tf(10),rf(),nf(),of({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,Jf.getInstance().sendMessage({name:"session-cleared"},!0),Im.getInstance().clearAllNotifications(!1),Im.getInstance().setNotificationCount(0),ir.getInstance().removeBannerUI(),xg.getInstance().hideModal(),r&&t.scheduleSessionRetry(n)})),xf(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)}})),xf(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=Jf.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()}})),xf(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=wf(wf({},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(),Sv.getInstance().restart();var e=vf.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,h=d.userData,f=d.userHash;null===(l=t.identifySession(p,h,f,!0))||void 0===l||null===(u=l.catch)||void 0===u||u.call(l,(function(){}))}}})),xf(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){}})),xf(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:Fv.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}))})),xf(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)})),xf(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=wf({},n);n.customData&&(delete a.customData,a=wf(wf({},a),n.customData)),t.send(JSON.stringify(wf(wf({},a),{},{userId:e,userHash:r,lang:Fv.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"})))}))}))}})),xf(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}))}))}))})),xf(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 Tf(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 Lf(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Tf(i,r,o,a,s,"next",e)}function s(e){Tf(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Of(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 Af(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 Af(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 Af(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=Lf(If().mark((function t(){var n,r;return If().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.releaseCapture(),this.rerender()}}},{key:"releaseCapture",value:function(){this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null),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}},{key:"startAudioRecording",value:(i=Lf(If().mark((function e(){var t,n,r,o;return If().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.isRecording?r.stopScreenRecording():r.releaseCapture()}),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=Lf(If().mark((function e(t){return If().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",Cf.getInstance().apiUrl+"/uploads/sdk"),Cf.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&&Mf(t.prototype,n),r&&Mf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Nf(e){return Nf="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},Nf(e)}function jf(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 _f(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})),$f(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")})),$f(this,"injectFrame",(function(){t.injectedFrame||(t.injectedFrame=!0,t.autoWhiteListCookieManager(),se((function(){Gu.getInstance().onConfigLoaded((function(){Gu.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 h=null===(l=r.fadebg)||void 0===l||l;return'
\n
\n '.concat(d).concat(h?'\n
':"","\n
\n
")}if(o){var f=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,"
")}(Gu.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"),J(t.gleapFrame,t.frameUrl),t.updateFrameStyle(),"widget"===t.appMode&&t.showFrameContainer(!0)}))})))})),$f(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()}}))})),$f(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.captureHidden||(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,this.captureHidden=!1;try{mu&&mu.getInstance().onWidgetDestroyed()}catch(e){}}},{key:"setCaptureHidden",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.captureHidden=!!e;var n=this.gleapFrameContainer;if(n&&n.classList.toggle("gleap-frame-container--capture-hidden",this.captureHidden),this.captureHidden)return this.unregisterEscListener(),void this.setCaptureEditorOpen(!1);n&&(this.widgetOpened?this.registerEscListener():t&&this.showWidget())}},{key:"isCaptureHidden",value:function(){return this.captureHidden}},{key:"setCaptureEditorOpen",value:function(e){this.gleapFrameContainer&&this.gleapFrameContainer.classList.toggle("gleap-frame-container--capture-editor",!!e)}},{key:"sendCaptureCapabilities",value:function(){if(this.comReady)try{this.sendMessage({name:"capture-capabilities",data:Zn()})}catch(e){}}},{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(),Kv.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),this.showFrameContainer(!1),this.updateWidgetStatus(),Ft.notifyEvent("open"),this.registerEscListener())}},{key:"updateUI",value:function(){Im.getInstance().clearAllNotifications(this.isSurvey()),N.getInstance().updateNotificationBadge(0),N.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.setCaptureEditorOpen(!1),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(),N.getInstance().updateFeedbackButtonState(),Ft.notifyEvent("close"),Im.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:Cf.getInstance().getSession(),apiUrl:Cf.getInstance().apiUrl,realtimeHost:Cf.getInstance().realtimeHost,sdkKey:Cf.getInstance().sdkKey}})}},{key:"sendConfigUpdate",value:function(){this.comReady&&(this.sendMessage({name:"config-update",data:{config:Gu.getInstance().getFlowConfig(),aiTools:$t.getInstance().getAgentTools(),agentTools:$t.getInstance().getAgentTools(),overrideLanguage:Fv.getInstance().getOverrideLanguage()}}),this.updateFrameStyle(),this.sendWidgetSizeUpdate(!0))}},{key:"showDrawingScreen",value:function(e){var t=this;this.hideWidget(),this.markerManager=new ug(e),this.markerManager.show((function(e){e||t.hideMarkerManager(),t.showWidget()}))}},{key:"workThroughQueue",value:function(){var e=Wf(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){}Kv.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),!mu||"capture-start"!==t.name&&"capture-cancel"!==t.name&&"capture-editor"!==t.name&&"capture-done"!==t.name||mu.getInstance().handleMessengerMessage(t)})),window.addEventListener("message",(function(t){var n=ir.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&&Vf(t.prototype,n),r&&Vf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Kf(e){return Kf="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},Kf(e)}function Yf(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),Zf(this,"rerender",void 0),Zf(this,"svgElement",null),Zf(this,"path",null),Zf(this,"strPath",void 0),Zf(this,"strokeWidth",12),Zf(this,"strokeWidthRect",6),Zf(this,"bufferSize",4),Zf(this,"buffer",[]),Zf(this,"startPoint",null),Zf(this,"tool","rect"),Zf(this,"color","#EB144C"),Zf(this,"mouseDown",null),Zf(this,"mouseMove",null),Zf(this,"mouseUp",null),Zf(this,"resizeListener",null),Zf(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&&Yf(t.prototype,n),r&&Yf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function tg(e){return tg="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},tg(e)}function ng(e,t){for(var n=0;n\n \n
'.concat(he("dismiss"),"
\n
").concat(he("rect"),'
\n
\n
\n ').concat(he("drag"),"\n
\n ").concat("capture"===this.type?'
\n '.concat(he("recorderon"),"\n ").concat(he("recorderoff"),'\n \n
\n
\n ').concat(he("mic"),'\n \n
\n
2:00
\n
\n
\n ').concat(he("pointer"),"\n
"):"",'\n
\n ').concat(he("rect"),'\n
\n
\n ').concat(he("pen"),'\n
\n
\n ').concat(he("blur"),'\n
\n
\n
\n ').concat(Fv.translateText("pickAColor"),'\n
\n
\n ').concat(he("undo"),'\n ').concat(Fv.translateText("undo"),"\n
\n ").concat("capture"!==this.type?'
'.concat(Fv.translateText("next"),"
"):"",'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
').concat(Fv.translateText("retry"),'
\n
').concat(Fv.translateText("next"),"
\n
\n
\n
\n "),document.body.appendChild(e),e.setAttribute("dir",Fv.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?(Kv.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),ig.disableScroll()):this.setupScreenRecording(),this.screenDrawer=new eg(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&&Kv.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},Ag=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},Mg=function(e,t){return"string"==typeof t&&-1!==e.props.indexOf(t.toLowerCase())},Rg=function(e,t){for(var n={},r=!1,o=Object.keys(e),i=0;i0&&Mg(t,c)?o=!0:r.push(a)}return o?r.join("&"):e},_g=function(e){if(e>500)throw new Error("Network log body is nested too deeply to redact.")},Fg=function e(t,n,r){_g(r);var o=!1;if(Array.isArray(t)){for(var i=0;i0&&-1===n.indexOf(i)&&n.push(i)}for(var a=Hg.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"===Sg(n.request)&&!Array.isArray(n.request)){var r=Object.assign({},n.request),o=Dg(r.headers,"content-type");void 0!==r.headers&&(r.headers=Pg(r.headers,t)),void 0!==r.payload&&(r.payload=zg(r.payload,o,t)),n.request=r}if(n.response&&"object"===Sg(n.response)&&!Array.isArray(n.response)){var i=Object.assign({},n.response),a=Dg(i.headers,"content-type");void 0!==i.headers&&(i.headers=Pg(i.headers,t)),void 0!==i.responseText&&(i.responseText=zg(i.responseText,a,t)),n.response=i}return n},Gg=function(e,t){var n=[];if(!Array.isArray(e))return n;for(var r=function(e){for(var t=Og(e).map((function(e){return e.toLowerCase()})),n=[],r=0;r0}))&&n.push(o)}return{props:t,paths:n}}(t&&t.propsToIgnore),o=Og(Cg.concat(t&&t.blacklist||[])),i=0;i=55296&&n<=56319&&(t-=1),e.slice(0,t)+im(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)},sm=function(e,t){for(var n=t.toLowerCase(),r=Object.keys(e),o=0;o=2&&cm(t,String(e[n][0]),String(e[n][1]));else for(var r=Object.keys(e),o=0;o0&&cm(t,n[r].slice(0,o).trim(),n[r].slice(o+1).trim())}return t},pm=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}},hm=function(e,t,n,r){var o,i=e.byteLength>Kg||"number"==typeof r&&r>Kg,a=e.byteLength>Kg?e.subarray(0,Kg):e;try{if(n){if(-1!==(o=new TextDecoder("utf-8",{fatal:!0}).decode(a,{stream:i})).indexOf("\0"))return Zg}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?Zg:Ig}return i?o+im("number"==typeof r?r:void 0):o},fm=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>Kg){try{r.cancel().catch((function(){}))}catch(s){}return a(!1)}return e()}))}()},gm=function(e,t,n){var r=e.size>Kg?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 hm(new Uint8Array(r),t,n,e.size)}))},mm=function(e,t){if(null==e)return{text:""};try{var n=nm(t);if("stream"===n)return{text:Qg};if("string"==typeof e)return{text:"binary"===n?Zg:am(e)};var r=function(e){return Object.prototype.toString.call(e)}(e);if("[object URLSearchParams]"===r)return{text:am(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})})),am(JSON.stringify(c)))};if("[object ReadableStream]"===r)return{text:Qg};if("[object Blob]"===r||"[object File]"===r){var o=t||e.type||"",i=nm(o);return"stream"===i?{text:Qg}:"binary"===i?{text:Zg}:{text:Yg,promise:gm(e,o,"unknown"===i)}}if("[object ArrayBuffer]"===r||"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)){if("binary"===n)return{text:Zg};var a="[object ArrayBuffer]"===r?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{text:hm(a,t,"unknown"===n,a.byteLength)}}return"[object Document]"===r||"[object HTMLDocument]"===r||"[object XMLDocument]"===r?{text:Ig}:{text:"binary"===n?Zg:am(String(e))}}catch(l){return{text:Ig}}var s,c},vm=function(e,t,n){e[t]=n.text,n.promise&&n.promise.then((function(n){e[t]=n}),(function(){e[t]=Ig}))},ym=function(e){try{if(e&&"object"===Jg(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"}},bm=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."},wm=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),$g(this,"requestId",0),$g(this,"requests",{}),$g(this,"externalRequests",[]),$g(this,"maxRequests",30),$g(this,"localFilters",[]),$g(this,"remoteFilters",[]),$g(this,"localBlacklist",[]),$g(this,"remoteBlacklist",[]),$g(this,"initialized",!1),$g(this,"stopped",!1),$g(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=Og(e)}},{key:"setRemoteFilters",value:function(e){this.remoteFilters=Og(e)}},{key:"setBlacklist",value:function(e){this.localBlacklist=Og(e)}},{key:"setRemoteBlacklist",value:function(e){this.remoteBlacklist=Og(e)}},{key:"getFilters",value:function(){return Og(this.remoteFilters.concat(this.localFilters))}},{key:"getBlacklist",value:function(){return Og(Cg.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<=Kg)return void c.text().then((function(e){return i(am(e))}),(function(){return i(Ig)}));i(Ig)}catch(u){i(Ig)}}},{key:"failFetch",value:function(e,t){var n=e.request;n.duration=om(e.start),n.success=!1,n.response={errorText:ym(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&&cm(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),ym(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=pm(r),o.headers={},o.capture=this.isCapturing()&&!Ag(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=rm(),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 vm(i.request,"payload",a?mm(n,lm(r.headers,"content-type")):{text:""}),r.request=i,r.start=o,!0}},{key:"recordXhrHeaders",value:function(e,t){t.headersAt=rm();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:dm(e.getAllResponseHeaders()),responseText:Yg}}},{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=om(t.start),r.success=!1,void(r.response={errorText:bm(o,e)});r.duration=t.headersAt?Math.max(0,Math.round(t.headersAt-t.start)):om(t.start),r.success=!0;var i,a=dm(e.getAllResponseHeaders());try{i=function(e,t){var n=nm(lm(t,"content-type"));if("stream"===n)return Qg;var r=e.responseType;if(""===r||"text"===r){if("binary"===n)return Zg;var o=e.responseText;return"string"!=typeof o?"":"unknown"===n&&-1!==o.slice(0,Kg).indexOf("\0")?Zg:am(o)}if("json"===r){if(null===e.response||void 0===e.response)return"";var i=id(e.response,Kg);return i.truncated?i.text+im():i.text}return"document"===r?Ig:Zg}(e,a)}catch(s){i=Ig}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&&Vg(t.prototype,n),r&&Vg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();$g(wm,"instance",void 0);const km=wm;function xm(e){return xm="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},xm(e)}function Sm(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||uf(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(),N.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=Rn.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)&&_n.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=he("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||Lv.getInstance().sendMessage({type:"conversation-notifications-cleared",shareToken:e,gleapId:null===(o=Cf.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;Lv.getInstance().sendMessage({type:"notifications-cleared",gleapId:null===(n=Cf.getInstance().session)||void 0===n?void 0:n.gleapId})}catch(r){}}}},{key:"updateContainerStyle",value:function(){if(this.notificationContainer){var e=Gu.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!==N.FEEDBACK_BUTTON_CLASSIC_LEFT&&e.feedbackButtonPosition!==N.FEEDBACK_BUTTON_BOTTOM_LEFT||this.notificationContainer.classList.add(t),null===N.getInstance().buttonHidden?e.feedbackButtonPosition===N.FEEDBACK_BUTTON_NONE&&this.notificationContainer.classList.add(n):N.getInstance().buttonHidden&&this.notificationContainer.classList.add(n),this.notificationContainer.setAttribute("dir",Fv.getInstance().isRTLLayout?"rtl":"ltr")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Sm(t.prototype,n),r&&Sm(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Tm(e){return Tm="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},Tm(e)}function Lm(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(Pm(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 h(e){var t;null==(t=d[e])||t.call(d)}function f(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&&h("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,h=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(h," 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(h," 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,h=!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();!h&&k&&k(v?void 0:p,d,{config:x,state:S});b&&b(g?void 0:e,t,{config:x,state:S});var I=!h&&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&&I&&(E(e,t),T=!0),n("animate")&&i0&&P[0].focus()}function I(){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,h=I(),f=r.arrow.getBoundingClientRect(),g=e.getBoundingClientRect(),m=g.top-h.height,v=m>=0,y=window.innerHeight-(g.bottom+h.height),b=y>=0,w=g.left-h.width,k=w>=0,x=window.innerWidth-(g.right+h.width),S=x>=0,C=!(v||b||k||S),E=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-h.realWidth/2,A=window.innerHeight/2-h.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==h?void 0:h.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 R=Math.min(w,window.innerWidth-(null==h?void 0:h.realWidth)-f.width),P=T(u,{elementDimensions:g,popoverDimensions:h,popoverPadding:p,popoverArrowDimensions:f});r.wrapper.style.left="".concat(R,"px"),r.wrapper.style.top="".concat(P,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",E="left"}else if(S){var D=Math.min(x,window.innerWidth-(null==h?void 0:h.realWidth)-f.width),N=T(u,{elementDimensions:g,popoverDimensions:h,popoverPadding:p,popoverArrowDimensions:f});r.wrapper.style.right="".concat(D,"px"),r.wrapper.style.top="".concat(N,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.left="auto",E="right"}else if(v){var j=Math.min(m,window.innerHeight-h.realHeight-f.width),_=L(u,{elementDimensions:g,popoverDimensions:h,popoverPadding:p,popoverArrowDimensions:f});r.wrapper.style.top="".concat(j,"px"),r.wrapper.style.left="".concat(_,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",E="top"}else if(b){var F=Math.min(y,window.innerHeight-(null==h?void 0:h.realHeight)-f.width),B=L(u,{elementDimensions:g,popoverDimensions:h,popoverPadding:p,popoverArrowDimensions:f});r.wrapper.style.left="".concat(B,"px"),r.wrapper.style.bottom="".concat(F,"px"),r.wrapper.style.top="auto",r.wrapper.style.right="auto",E="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=I(),a=r.arrow,s=i.width,c=window.innerWidth,u=o.width,d=o.left,p=i.height,h=window.innerHeight,f=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?(f+g<=0?(m="bottom",v="end"):f+g-p<=0&&(m="left",v="start"),f>=h?(m="top",v="end"):f+p>=h&&(m="left",v="end")):"right"===t&&(f+g<=0?(m="bottom",v="start"):f+g-p<=0&&(m="right",v="start"),f>=h?(m="top",v="start"):f+p>=h&&(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,E,e)}}return function(){function e(){n("allowClose")&&f()}function r(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e+1;t[r]?h(r):f()}}function o(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e-1;t[r]?h(r):f()}}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 h(){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 f();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(Pm(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"),E=(null==(s=p.popover)?void 0:s.onPrevClick)||n("onPrevClick"),I=(null==(l=p.popover)?void 0:l.onCloseClick)||n("onCloseClick");y(jm(jm({},p),{},{popover:jm({showButtons:S,nextBtnText:g?void 0:v,disableButtons:Pm(m?[]:["previous"]),showProgress:w,progressText:k,onNextClick:C||function(){g?h(u+1):f()},onPrevClick:E||function(){h(u-1)},onCloseClick:I||function(){f()}},(null==p?void 0:p.popover)||{})}))}else f()}function f(){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(),h(e)},setConfig:t,setSteps:function(e){u(),t(jm(jm({},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]?h(e):f()},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(jm(jm({},e),{},{popover:e.popover?jm({showButtons:[],showProgress:!1,progressText:""},e.popover):void 0}))},destroy:function(){f(!1)}}}}();const Bm=Fm;var Um=["text","email","password","search","tel","url","number","date","datetime-local","month","week","time"],Hm="".concat(Um.map((function(e){return'input[type="'.concat(e,'" i]')})).join(", "),", input:not([type]), textarea, [contenteditable]"),qm=function(e){if(!e||!e.tagName)return!1;var t=e.tagName.toLowerCase();return"input"===t?Um.indexOf((e.getAttribute("type")||"text").toLowerCase())>=0:"textarea"===t||function(e){return!0===e.isContentEditable||"function"==typeof e.getAttribute&&null!==e.getAttribute("contenteditable")}(e)},zm=function(e,t){try{e.dispatchEvent(new Event(t,{bubbles:!0}))}catch(n){}},Wm=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;zm(e,"input")}},Gm=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(qm(e))return e;var t="function"==typeof e.querySelector?e.querySelector(Hm):null;return t&&qm(t)?t:null}(e),s=null!=t?t:"";if(a){var c=0,l=function(){zm(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(Km,JSON.stringify(e))}catch(t){}else localStorage.removeItem(Km)}},{key:"loadStoredAudioMuted",value:function(){if("undefined"!=typeof window)try{var e=JSON.parse(localStorage.getItem(Km));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(Ym);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(Ym);t&&t.remove()}var n=document.getElementById(Qm);n&&n.remove();var r=document.getElementById(Zm);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(Qm,"-mute"));t&&(t.innerHTML=he(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=Gu.getInstance().flowConfig)||void 0===t?void 0:t.color)&&void 0!==e?e:"#485BFF",d=pe(u),p=document.getElementById(Zm);p||(p=document.createElement("style"),W(p),p.id=Zm,p.type="text/css",p.textContent="\n #".concat(Ym," {\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(Ym,"-clickmode {\n cursor: pointer;\n pointer-events: all !important;\n }\n .").concat(Ym,"-clickmode #copilot-info-bubble-content {\n display: flex !important;\n }\n .").concat(Ym,"-clickmode svg {\n display: none !important;\n }\n #").concat(Ym," 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(Ym,"-right #copilot-info-bubble-content-container {\n left: auto !important;\n right: 0px !important;\n align-items: flex-end;\n }\n .").concat(Ym,"-right .copilot-info-bubble-content {\n margin-right: 5px;\n }\n .").concat(Ym,"-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(Ym,"-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(Qm," {\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(Qm,"--top-left {\n top: 20px;\n left: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(Qm,"--top-right {\n top: 20px;\n right: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(Qm,"--bottom-left {\n bottom: 20px;\n left: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(Qm,"--bottom-right {\n bottom: 20px;\n right: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(Qm," span {\n font-size: 13px;\n color: #000;\n font-family: sans-serif;\n }\n .").concat(Qm,"-avatar {\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n border-radius: 6px;\n }\n .").concat(Qm,"-mute {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .").concat(Qm,"-mute svg {\n width: 20px;\n height: auto;\n cursor: pointer;\n animation: pulsate 2s infinite;\n }\n .").concat(Qm,"-mute svg:hover {\n opacity: 0.8;\n }\n .").concat(Qm,"-dismiss {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: 3px;\n }\n .").concat(Qm,"-dismiss svg {\n width: 15px;\n height: auto;\n cursor: pointer;\n }\n .").concat(Qm,"-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(Qm," {\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(Qm,"-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 h=document.createElement("div");h.id=Ym,h.style.opacity=0,this._pointerContainer=h;var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("viewBox","0 0 380 476"),f.innerHTML='';var g=document.createElement("div");g.id="copilot-info-bubble",g.innerHTML="
";var m,v,y=document.createElement("div");y.id=Qm,y.classList.add(Qm,(m=null===(n=this.productTourData)||void 0===n?void 0:n.joinedIndicatorPosition,null!==(v=ev[m])&&void 0!==v?v:ev.TOP_RIGHT)),y.innerHTML='\n \n ').concat(null===(o=this.productTourData)||void 0===o?void 0:o.kaiSlug,'\n
\n ').concat(he(this.audioMuted?"unmute":"mute"),"\n
\n ").concat(null!==(i=this.productTourData)&&void 0!==i&&i.allowClose?'
\n ').concat(he("dismiss"),"\n
"):"","\n "),document.body.appendChild(y),document.querySelector(".".concat(Qm,"-mute")).addEventListener("click",(function(){s.toggleAudio(!s.audioMuted)})),null!==(a=this.productTourData)&&void 0!==a&&a.allowClose&&document.querySelector(".".concat(Qm,"-dismiss")).addEventListener("click",(function(){s.completeTour(!1)})),h.appendChild(f),h.appendChild(g),document.body.appendChild(h)}}},{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(Ym)).classList.remove("copilot-pointer-container-clickmode"),n.classList.remove("gleap-input-highlight"),document.getElementById(Ym).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(Fv.translateText("next"),' \n \n'),i.addEventListener("click",o,{once:!0}),n.classList.add("gleap-input-highlight"),document.querySelector("#".concat(Ym)).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;Gm(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&&$m(t.prototype,n),r&&$m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function nv(e){return nv="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},nv(e)}function rv(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 ov(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;Cf.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),Kv.trackEvent("tour-".concat(this.productTourId,"-completed"),t)):(Ft.notifyEvent("productTourQuit",t),Kv.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(cv));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(cv,JSON.stringify(e))}catch(t){}else this.clearUncompletedTour()}},{key:"clearUncompletedTour",value:function(){try{localStorage.removeItem(cv)}catch(e){}}},{key:"start",value:function(){var e=this,t=this.productTourData;if(t){if("cobrowse"===t.tourType)return tv.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(he("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 h={disableActiveInteraction:!s&&!c&&!l,mode:a.mode,popover:ov({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&&(h.element=a.selector),o.push(h)}var f=["next","close"];t.backButton&&f.push("previous"),this.gleapTourObj=Bm(av(av(av(av(av(av(av(av(av(av({showProgress:!0,allowKeyboardControl:!1,steps:o},"showProgress",n.length>1),"allowClose",t.allowClose),"nextBtnText",t.nextText),"doneBtnText",t.doneText),"prevBtnText",t.prevText),"showButtons",f),"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{const e=[];return Yn()&&e.push("capture.screenshot","capture.recording"),Hn&&e.push("capture.logs"),e})();n.length>0&&(t="&caps="+n.join(","))}catch(r){}this.socket=new WebSocket("".concat(Cf.getInstance().wsApiUrl,"?gleapId=").concat(Cf.getInstance().session.gleapId,"&gleapHash=").concat(Cf.getInstance().session.gleapHash,"&apiKey=").concat(Cf.getInstance().sdkKey,"&sdkVersion=").concat("19.1.0").concat(t)),this.socket.addEventListener("open",this.handleOpenBound),this.socket.addEventListener("message",this.handleMessageBound),this.socket.addEventListener("error",this.handleErrorBound),this.socket.addEventListener("close",this.handleCloseBound),this.addNetworkListeners()}}},{key:"clearReconnectTimeout",value:function(){this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null)}},{key:"scheduleReconnect",value:function(){var t=this;if(this.clearReconnectTimeout(),!wv()){var n=e.reconnectDelay(this.reconnectAttempts,Math.random());this.reconnectAttempts+=1,this.reconnectTimeout=setTimeout((function(){t.reconnectTimeout=null,wv()||t.initWebSocket()}),n)}}},{key:"addNetworkListeners",value:function(){!this.networkListenersAdded&&"undefined"!=typeof window&&window&&"function"==typeof window.addEventListener&&(window.addEventListener("online",this.handleOnlineBound),this.networkListenersAdded=!0)}},{key:"removeNetworkListeners",value:function(){if(this.networkListenersAdded){try{window.removeEventListener("online",this.handleOnlineBound)}catch(e){}this.networkListenersAdded=!1}}},{key:"handleOnline",value:function(){this.socket&&this.socket.readyState===this.socket.OPEN||(this.reconnectAttempts=0,this.initWebSocket())}},{key:"handleOpen",value:function(e){var t=this;this.socketOpenedAt=Date.now(),this.pingWS&&clearInterval(this.pingWS),this.pingWS=setInterval((function(){t.socket.readyState===t.socket.OPEN&&(t.socket.send("PING"),t.socket.send(9))}),1e4),this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null)}},{key:"handleMessage",value:function(e){this.reconnectAttempts=0,this.processMessage(JSON.parse(e.data))}},{key:"handleError",value:function(e){}},{key:"handleClose",value:function(e){this.socketOpenedAt&&Date.now()-this.socketOpenedAt>=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=Jf.getInstance().isOpened();if(s&&Im.getInstance().clearNotificationsForConversation(s),a&&Rn.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())}));Kv.getInstance().performActions(u)}null!=i&&Im.getInstance().setNotificationCount(i)}if("capture-request"===e.name&&mu&&mu.getInstance().handleServerRequest(e.data),"checklist"===e.name&&null!=e&&e.data&&window){var d,p,h=e.data,f=null!==(d=h.completedSteps)&&void 0!==d?d:[],g=null!==(p=h.completedStepsBefore)&&void 0!==p?p:[];if(f.length>g.length)for(var m=function(e){var t,n=null==h||null===(t=h.steps)||void 0===t?void 0:t.find((function(t){return t.id===f[e]}));if(!n)return 1;var r=e;g.includes(n)||Ft.notifyEvent("checklist-step-completed",{checklistId:h.id,outboundId:h.outboundId,stepId:n.id,stepIndex:r,step:n,completedSteps:h.completedSteps,status:h.status,data:h})},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&&mv(t.prototype,n),r&&mv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Cv(e){return Cv="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},Cv(e)}function Ev(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";return Fv.translateText(e)||t}},{key:"_translateWithVars",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Fv.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!==Fv&&(n=Fv.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!==Fv&&(l=Fv.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=yu(this.checklistData.completedSteps||[]),o=!1,i=!1,a=this.activeStep;if(t.completedSteps&&JSON.stringify(t.completedSteps)!==JSON.stringify(r)&&(this.checklistData.completedSteps=yu(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)})),h=i.length>0?p?p.title||this._translateWithVars("stepDefaultTitle",{index:i.indexOf(p)+1},"Step ".concat(i.indexOf(p)+1)):"":e.subject||"",f=i.length>0?p&&p.description||"":e.message||"";o&&(h=(null===(u=e.config)||void 0===u?void 0:u.successTitle)||"",f=(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(h,"
\n ").concat(o?"":''.concat(y,""),'\n
\n
').concat(f,"
\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
"):"",h=["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=Gu.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!==Kv){var o=e.checklistData.outbound.config.steps[r];if(o&&o.action&&"none"!==o.action&&!Wn("start-custom-action"))try{"BOT"===o.action?Kv.startBot(o.botId):"CUSTOM_ACTION"===o.action?Kv.triggerCustomAction(o.actionBody):"REDIRECT_URL"===o.action?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),Kv.openURL(o.actionBody,!!o.actionOpenInNewTab)):"FEEDBACK_FLOW"===o.action?Kv.startFeedbackFlow(o.formId):"NEWS_ARTICLE"===o.action?Kv.openNewsArticle(o.articleId):"HELP_ARTICLE"===o.action?Kv.openHelpCenterArticle(o.articleId):"CHECKLIST"===o.action?Kv.startChecklist(o.outboundId,!0,null==o?void 0:o.sharedKey):"PRODUCT_TOUR"===o.action&&Kv.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&&wu(n.prototype,r),o&&wu(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(Su(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&&!uf(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=qa.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){gg.getInstance().environment=e}},{key:"setEnvDataPropsToIgnore",value:function(e){gg.setEnvDataPropsToIgnore(e)}},{key:"setDisableEnvData",value:function(e){gg.setDisableEnvData(e)}},{key:"setCSPNonce",value:function(e){!function(e){q=U(e)}(e)}},{key:"setTags",value:function(e){Pv.getInstance().setTags(e)}},{key:"setUrlHandler",value:function(e){Jf.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(){wd.getInstance().stop()}},{key:"setAiTools",value:function(e){$t.getInstance().setAgentTools(e),Rn.getInstance().sendAgentToolsUpdate(),Jf.getInstance().sendConfigUpdate()}},{key:"attachNetworkLogs",value:function(e){km.getInstance().setExternalRequests(ee(e))}},{key:"log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"INFO";wd.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{qa.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,h=window.visualViewport;h.addEventListener("resize",i),h.addEventListener("scroll",i),window.addEventListener("orientationchange",(function(){try{i()}catch(o){}})),e()}catch(o){}}()}catch(o){}var r=Cf.getInstance();r.sdkKey=t,r.setOnSessionReady((function(){setTimeout((function(){Gu.getInstance().start().then((function(){Sv.getInstance().start(),se((function(){N.getInstance().injectFeedbackButton(),Im.getInstance().injectNotificationUI(),e.checkForUncompletedTour(),e.checkForUrlParams();try{mu.getInstance().resumeFromStorage()}catch(t){}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];Jf.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(){try{mu.getInstance().destroy()}catch(e){}qa.getInstance().stop(),Sv.getInstance().stop(),Jf.getInstance().destroy(),N.getInstance().destroy(),Im.getInstance().clearAllNotifications(!0),Lv.getInstance().stop(),Rn.getInstance().destroy(),Cf.getInstance().clearSession(0,!1),ir.getInstance().removeBannerUI(),this.instance=null}},{key:"closeBanner",value:function(){ir.getInstance().removeBannerUI()}},{key:"closeModal",value:function(){xg.getInstance().hideModal()}},{key:"showAiChatbar",value:function(){var e=Rn.getInstance();e.manuallyHidden=!1,e.manuallyShown=!0,e.show()}},{key:"hideAiChatbar",value:function(){var e=Rn.getInstance();e.manuallyHidden=!0,e.manuallyShown=!1,e.hide()}},{key:"startAgent",value:function(e,t){try{Rn.getInstance().showWithAgent(e,t)}catch(n){}}},{key:"setAiChatbarQuickActions",value:function(e){Rn.getInstance().setQuickActions(e)}},{key:"setAiChatbarPlaceholder",value:function(e){Rn.getInstance().setPlaceholder(e)}},{key:"setUseCookies",value:function(e){Cf.getInstance().useCookies=e}},{key:"disableLocalStorage",value:function(){Cf.getInstance().localStorageDisabled=!0}},{key:"identify",value:function(e,t,n){return Cf.getInstance().identifySession(e,ne(ee(t)),n)}},{key:"updateContact",value:function(e){return Cf.getInstance().updateSession(ne(ee(e)))}},{key:"clearIdentity",value:function(){Cf.getInstance().clearSession()}},{key:"getIdentity",value:function(){return Cf.getInstance().getSession()}},{key:"isUserIdentified",value:function(){var e=Cf.getInstance().session;return!!(e&&e.userId&&e.userId.length>0)}},{key:"isOpened",value:function(){return Jf.getInstance().isOpened()}},{key:"hide",value:function(){Jf.getInstance().hideWidget()}},{key:"setMaxNetworkRequests",value:function(e){km.getInstance().setMaxRequests(e)}},{key:"startNetworkLogger",value:function(){km.getInstance().start()}},{key:"setNetworkLogsBlacklist",value:function(e){km.getInstance().setBlacklist(e)}},{key:"setNetworkLogPropsToIgnore",value:function(e){km.getInstance().setFilters(e)}},{key:"setReplayOptions",value:function(e){qa.getInstance().setOptions(e)}},{key:"setCaptureEnabled",value:function(e){mu.getInstance().setCaptureEnabled(e)}},{key:"setRemoteLogCollectionEnabled",value:function(e){mu.getInstance().setRemoteLogCollectionEnabled(e)}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Jf.getInstance().hideWidget(e)}},{key:"open",value:function(){Jf.getInstance().setAppMode("widget"),Jf.getInstance().showWidget()}},{key:"trackEvent",value:function(e,t){Sv.getInstance().logEvent(e,t)}},{key:"logEvent",value:function(e,t){Sv.getInstance().logEvent(e,t)}},{key:"preFillForm",value:function(e){var t=ee(e);Mm.getInstance().formPreFill=t,Jf.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?fv.getInstance().start():fv.getInstance().stop()}},{key:"showFeedbackButton",value:function(e){N.getInstance().toggleFeedbackButton(e)}},{key:"setAppVersionCode",value:function(e){gg.setAppVersionCode(e)}},{key:"setAppBuildNumber",value:function(e){gg.setAppBuildNumber(e)}},{key:"setRegion",value:function(e){Cf.getInstance().setRegion(e)}},{key:"getRegion",value:function(){return Cf.getInstance().getRegion()}},{key:"setWSApiUrl",value:function(e){Cf.getInstance().wsApiUrl=e}},{key:"setRealtimeHost",value:function(e){Cf.getInstance().realtimeHost=e}},{key:"setApiUrl",value:function(e){Cf.getInstance().apiUrl=e}},{key:"setBannerUrl",value:function(e){ir.getInstance().setBannerUrl(e)}},{key:"setModalUrl",value:function(e){xg.getInstance().setModalUrl(e)}},{key:"setAgentConversationUrl",value:function(e){Pt(e)}},{key:"setFrameUrl",value:function(e){Jf.getInstance().frameUrl=e}},{key:"setTicketAttribute",value:function(e,t){Rd.getInstance().setTicketAttribute(e,t)}},{key:"unsetTicketAttribute",value:function(e){Rd.getInstance().unsetTicketAttribute(e)}},{key:"clearTicketAttributes",value:function(){Rd.getInstance().clearTicketAttributes()}},{key:"attachCustomData",value:function(e){Rd.getInstance().attachCustomData(e)}},{key:"setCustomData",value:function(e,t){Rd.getInstance().setCustomData(e,t)}},{key:"removeCustomData",value:function(e){Rd.getInstance().removeCustomData(e)}},{key:"clearCustomData",value:function(){Rd.getInstance().clearCustomData()}},{key:"playSound",value:function(e){_n.playSound(e)}},{key:"showTabNotificationBadge",value:function(e){var t=Im.getInstance();t.showNotificationBadge=e,t.updateTabBarNotificationCount()}},{key:"setLanguage",value:function(t){Fv.getInstance().setOverrideLanguage(t),e.getInstance().initialized&&setTimeout((function(){e.getInstance().softReInitialize(),e.updateContact({lang:t})}),1e3)}},{key:"registerAgentToolAction",value:function(e){$t.getInstance().registerAgentToolAction(e)}},{key:"registerAgentTool",value:function(e,t){$t.getInstance().registerAgentTool(e,t)}},{key:"registerCustomAction",value:function(e){Td.registerCustomAction(e)}},{key:"triggerCustomAction",value:function(e){Td.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]:N.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),h="#ffffff"===p,f=c||t,g=l||t,m=de(o,h?100:-120),v=de(o,h?30:-12),y=de(o,h?80:-30),b=h?o:"#fff",w=h?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),E=Math.max(2,Math.round(.55*r)),I=Math.max(2,Math.round(20*E/32)),T=57+a;s===N.FEEDBACK_BUTTON_CLASSIC_BOTTOM?T=a+15:(s&&s.includes("CLASSIC")||s===N.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(f,";\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(f,";\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(f,' 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(h?"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(E,"px;\n }\n\n .gleap-notification-item-news-sender-avatar--bot {\n border-radius: ").concat(I,"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 /* Capture requests: hidden while the customer captures the page (the iframe stays alive), and\n the whole viewport while the Messenger's capture editor is open. */\n .gleap-frame-container--capture-hidden {\n visibility: hidden !important;\n pointer-events: none !important;\n animation: none !important;\n }\n\n .gleap-frame-container--capture-editor {\n top: 0 !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n width: 100vw !important;\n max-width: 100vw !important;\n height: 100vh !important;\n height: 100dvh !important;\n min-height: 0 !important;\n max-height: none !important;\n border-radius: 0 !important;\n transform: none !important;\n animation: none !important;\n }\n\n .gleap-frame-container--capture-editor .gleap-frame-container-inner {\n width: 100% !important;\n height: 100% !important;\n max-height: 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(h?"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(h?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(h?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=Cf.getInstance();if(i.ready){var a=e||{};i.session.email&&(a.reportedBy=i.session.email),new qf("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(Cf.getInstance().ready){e.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY});var s="start-feedbackflow";r&&(s="start-survey"),Jf.getInstance().setAppMode(r?a:"widget"),Jf.getInstance().sendMessage({name:s,data:{flow:t,hideBackButton:i,format:a}},!0),o?Jf.getInstance().showDrawingScreen("screenshot"):Jf.getInstance().showWidget()}}},{key:"openConversations",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"open-conversations",data:{hideBackButton:!e}},!0),Jf.getInstance().showWidget()}},{key:"openConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"open-conversation",data:{shareToken:e,hideBackButton:!t}},!0),Jf.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];Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"start-bot",data:{botId:e||"",hideBackButton:!t}},!0),Jf.getInstance().showWidget()}},{key:"askAI",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"ask-ai",data:{question:e,hideBackButton:!t}},!0),Jf.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&&(Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"open-help-collection",data:{collectionId:e,hideBackButton:!t}},!0),Jf.getInstance().showWidget())}},{key:"openHelpCenterArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"open-help-article",data:{articleId:e,hideBackButton:!t}},!0),Jf.getInstance().showWidget())}},{key:"openHelpCenter",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"open-helpcenter",data:{hideBackButton:!e}},!0),Jf.getInstance().showWidget()}},{key:"searchHelpCenter",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"open-helpcenter-search",data:{term:e,hideBackButton:!t}},!0),Jf.getInstance().showWidget())}},{key:"openNewsArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"open-news-article",data:{id:e,hideBackButton:!t}},!0),Jf.getInstance().showWidget())}},{key:"openChecklists",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"open-checklists",data:{hideBackButton:!e}},!0),Jf.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&&(Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"start-checklist",data:qv({outboundId:e,hideBackButton:!t},n?{sharedKey:n}:{})},!0),Jf.getInstance().showWidget(),!0)}},{key:"openChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"open-checklist",data:{id:e,hideBackButton:!t}},!0),Jf.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];Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"open-news",data:{hideBackButton:!e}},!0),Jf.getInstance().showWidget()}},{key:"openFeatureRequests",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Jf.getInstance().setAppMode("widget"),Jf.getInstance().sendMessage({name:"open-feature-requests",data:{hideBackButton:!e}},!0),Jf.getInstance().showWidget()}},{key:"startProductTour",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;Cf.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=lv.getInstance().loadUncompletedTour();e&&lv.getInstance().startWithConfig(e.tourId,e.tourData,500)}},{key:"startProductTourWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];lv.getInstance().startWithConfig(e,t,0,n)}},{key:"showBanner",value:function(e){try{ir.getInstance().showBanner(e)}catch(t){}}},{key:"showModal",value:function(e){try{xg.getInstance().showModal(e)}catch(t){}}},{key:"showNotification",value:function(e){Im.getInstance().showNotification(e)}}],n&&Uv(t.prototype,n),r&&Uv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();if(zv(Gv,"invoked",!0),zv(Gv,"silentCrashReportSent",!1),zv(Gv,"instance",void 0),"undefined"!=typeof window){var Vv=window.GleapActions;if(Vv&&Vv.length>0)for(var $v=0;$v {\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